Commit 64c8cbbd authored by 查济's avatar 查济

Merge branch 'feature-zhaji' into 'develop'

Feature zhaji

See merge request fangxinjiang/yifu!78
parents 3e6e75da d32dedac
package com.yifu.cloud.plus.v1.yifu.insurances.entity;
import java.io.Serializable;
import java.util.Date;
/**
* 结算信息作废记录表(用于记录项目变更导致推信息送至EKP)
* @TableName t_insurance_settle_cancel
*/
public class TInsuranceSettleCancel implements Serializable {
/**
*
*/
private String id;
/**
* 结算明细id
*/
private String insDetailId;
/**
* 结算信息表id
*/
private String settleId;
/**
* 项目编码
*/
private String deptNo;
/**
* 项目名称
*/
private String deptName;
/**
* 订单编号
*/
private String orderNo;
/**
* 推送标识 1成功 0失败
*/
private Integer isCancelPush;
/**
* 创建时间
*/
private Date createTime;
/**
* 操作人
*/
private String createUesr;
private static final long serialVersionUID = 1L;
/**
*
*/
public String getId() {
return id;
}
/**
*
*/
public void setId(String id) {
this.id = id;
}
/**
* 结算明细id
*/
public String getInsDetailId() {
return insDetailId;
}
/**
* 结算明细id
*/
public void setInsDetailId(String insDetailId) {
this.insDetailId = insDetailId;
}
/**
* 结算信息表id
*/
public String getSettleId() {
return settleId;
}
/**
* 结算信息表id
*/
public void setSettleId(String settleId) {
this.settleId = settleId;
}
/**
* 项目编码
*/
public String getDeptNo() {
return deptNo;
}
/**
* 项目编码
*/
public void setDeptNo(String deptNo) {
this.deptNo = deptNo;
}
/**
* 项目名称
*/
public String getDeptName() {
return deptName;
}
/**
* 项目名称
*/
public void setDeptName(String deptName) {
this.deptName = deptName;
}
/**
* 订单编号
*/
public String getOrderNo() {
return orderNo;
}
/**
* 订单编号
*/
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
/**
* 推送标识 1成功 0失败
*/
public Integer getIsCancelPush() {
return isCancelPush;
}
/**
* 推送标识 1成功 0失败
*/
public void setIsCancelPush(Integer isCancelPush) {
this.isCancelPush = isCancelPush;
}
/**
* 创建时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 创建时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 操作人
*/
public String getCreateUesr() {
return createUesr;
}
/**
* 操作人
*/
public void setCreateUesr(String createUesr) {
this.createUesr = createUesr;
}
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.insurances.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel;
import org.apache.ibatis.annotations.Mapper;
/**
* @author Administrator
* @description 针对表【t_insurance_settle_cancel(结算信息作废记录表(用于记录项目变更导致推信息送至EKP))】的数据库操作Mapper
* @createDate 2022-08-01 11:37:54
* @Entity generator.domain.TInsuranceSettleCancel
*/
@Mapper
public interface TInsuranceSettleCancelMapper extends BaseMapper<TInsuranceSettleCancel> {
}
package com.yifu.cloud.plus.v1.yifu.insurances.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel;
/**
* @author Administrator
* @description 针对表【t_insurance_settle_cancel(结算信息作废记录表(用于记录项目变更导致推信息送至EKP))】的数据库操作Service
* @createDate 2022-08-01 11:37:54
*/
public interface TInsuranceSettleCancelService extends IService<TInsuranceSettleCancel> {
}
......@@ -75,7 +75,10 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
return R.failed("计费方式格式不正确");
}
if (!ValidityUtil.validate60(insuranceCompany.getCompanyName())){
return R.failed("保险公司名称过长");
return R.failed("保险公司名称格式不正确");
}
if (!ValidityUtil.validate50(insuranceCompany.getCompanyAddress())){
return R.failed("保险公司地址格式不正确");
}
boolean b = companyIsExists(insuranceCompany.getCompanyName());
if (!b){
......@@ -84,7 +87,7 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
insuranceCompany.setCreateTime(LocalDateTime.now());
insuranceCompany.setDeleteFlag(CommonConstants.ZERO_INT);
save(insuranceCompany);
addOperate(insuranceCompany,user, InsurancesConstants.DELETE_INSURANCE_COMPANY);
addOperate(insuranceCompany,user, InsurancesConstants.NEW_INSURANCE_COMPANY);
return R.ok("新增成功");
}else{
return R.failed("保险公司名称不能重复添加");
......@@ -109,6 +112,9 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
if (!CommonConstants.ZERO_STRING.equals(billingType) && !CommonConstants.ONE_STRING.equals(billingType)){
return R.failed("计费方式格式不正确");
}
if (!ValidityUtil.validate50(insuranceCompany.getCompanyAddress())){
return R.failed("保险公司地址格式不正确");
}
LambdaQueryWrapper<TInsuranceCompany> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceCompany::getId,id).eq(TInsuranceCompany::getDeleteFlag, CommonConstants.ZERO_INT);
TInsuranceCompany one = this.getOne(queryWrapper);
......@@ -117,8 +123,8 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
}
String companyName = one.getCompanyName();
String newCompanyName = insuranceCompany.getCompanyName();
if (newCompanyName.length()>CommonConstants.SIXTY_INT){
return R.failed("要修改的保险公司名称过长");
if (!ValidityUtil.validate60(newCompanyName)){
return R.failed("要修改的保险公司名称格式不正确");
}
//如果当前保险公司名称和修改后的名称不同
if (!companyName.equals(insuranceCompany.getCompanyName())){
......@@ -133,9 +139,11 @@ public class TInsuranceCompanyServiceImpl extends ServiceImpl<TInsuranceCompanyM
//校验新的保险公司名称在数据库中是否存在
boolean b = companyIsExists(insuranceCompany.getCompanyName());
if(b){
return R.failed("当前保险公司名称已存在");
return R.failed("保险公司名称不能重复");
}else {
return R.ok(updateById(insuranceCompany));
updateById(insuranceCompany);
addOperate(insuranceCompany,user, InsurancesConstants.NEW_INSURANCE_COMPANY);
return R.ok("修改保险信息公司成功");
}
}
}else{
......
package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceSettleCancelMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceSettleCancelService;
import org.springframework.stereotype.Service;
/**
* @author Administrator
* @description 针对表【t_insurance_settle_cancel(结算信息作废记录表(用于记录项目变更导致推信息送至EKP))】的数据库操作Service实现
* @createDate 2022-08-01 11:37:54
*/
@Service
public class TInsuranceSettleCancelServiceImpl extends ServiceImpl<TInsuranceSettleCancelMapper, TInsuranceSettleCancel>
implements TInsuranceSettleCancelService {
}
......@@ -9,10 +9,13 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceTypeRate;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceTypeRateMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceOperateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeRateService;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceTypeService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
......@@ -34,6 +37,9 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
@Resource
private TInsuranceTypeService insuranceTypeService;
@Resource
private TInsuranceOperateService tInsuranceOperateService;
/**
* 根据险种id查询费率列表
*
......@@ -44,11 +50,11 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
@Override
public R getInsuranceTypeRateList(String id) {
if (Common.isEmpty(id)){
return R.failed("险种id为空");
return R.failed("险种为空");
}
TInsuranceType byId = insuranceTypeService.getById(id);
if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("当前险种信息不存在或已被删除");
return R.failed("险种信息不存在或已被删除");
}
LambdaQueryWrapper<TInsuranceTypeRate> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT).eq(TInsuranceTypeRate::getInsuranceTypeId,id);
......@@ -78,7 +84,9 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
.set(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ONE_INT)
.set(TInsuranceTypeRate :: getUpdateBy,user.getId())
.set(TInsuranceTypeRate :: getUpdateTime, LocalDateTime.now());
return R.ok(update(updateWrapper),"删除费率信息成功");
update(updateWrapper);
addOperate(byId,user, InsurancesConstants.DELETE_INSURANCE_TYPE_RATE);
return R.ok("删除费率信息成功");
}
/**
......@@ -98,15 +106,15 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
String insuranceTypeId = insuranceTypeRate.getInsuranceTypeId();
TInsuranceType byId = insuranceTypeService.getById(insuranceTypeId);
if ( Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("当前险种信息不存在或已被删除");
return R.failed("险种信息不存在或已被删除");
}
String month = insuranceTypeRate.getMonth();
if (!ValidityUtil.validatePositiveInt(month)){
return R.failed("当前月份格式不正确");
return R.failed("月份格式不正确");
}
String rate = insuranceTypeRate.getRate();
if (!ValidityUtil.validateMoney(rate)){
return R.failed("当前费率格式不正确");
return R.failed("费率格式不正确");
}
LambdaQueryWrapper<TInsuranceTypeRate> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceTypeRate::getDeleteFlag, CommonConstants.ZERO_INT).eq(TInsuranceTypeRate::getInsuranceTypeId,insuranceTypeId)
......@@ -117,11 +125,34 @@ public class TInsuranceTypeRateServiceImpl extends ServiceImpl<TInsuranceTypeRat
insuranceTypeRate.setCreateBy(user.getId());
insuranceTypeRate.setCreateName(user.getNickname());
insuranceTypeRate.setCreateTime(LocalDateTime.now());
return R.ok(this.baseMapper.insert(insuranceTypeRate));
save(insuranceTypeRate);
addOperate(insuranceTypeRate,user, InsurancesConstants.NEW_INSURANCE_TYPE_RATE);
return R.ok("新增费率信息成功");
}else{
return R.failed("当前险种已存在相同的费率");
return R.failed("该险种购买月份已存在");
}
}
/**
* 操作记录
*
* @author zhaji
* @param insuranceTypeRate 费率信息
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private void addOperate(TInsuranceTypeRate insuranceTypeRate,YifuUser user,String operateDesc){
try {
TInsuranceOperate operate = new TInsuranceOperate();
operate.setInsuranceDetailId(insuranceTypeRate.getId());
operate.setOperateDesc(operateDesc);
operate.setCreateBy(user.getId());
operate.setCreateName(user.getNickname());
operate.setCreateTime(LocalDateTime.now());
tInsuranceOperateService.save(operate);
}catch (Exception e){
e.getStackTrace();
}
}
}
......@@ -20,6 +20,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceTypeVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
......@@ -60,6 +61,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R saveInsuranceType(TInsuranceType insuranceType) {
if(Common.isEmpty(insuranceType)){
return R.failed("新增的险种信息为空");
......@@ -134,6 +136,7 @@ public class TInsuranceTypeServiceImpl extends ServiceImpl<TInsuranceTypeMapper,
* @return {@link R}
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R updateInsuranceType(TInsuranceType insuranceType) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(insuranceType.getId())){
......
......@@ -8,6 +8,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.constants.InsurancesConstants;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceOperate;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceType;
......@@ -94,7 +95,9 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
.set(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ONE_INT)
.set(TInsuranceTypeStandard :: getUpdateBy,user.getId())
.set(TInsuranceTypeStandard :: getUpdateTime,LocalDateTime.now());
return R.ok(update(updateWrapper),"删除购买标准成功");
update(updateWrapper);
addOperate(byId,user, InsurancesConstants.DELETE_INSURANCE_TYPE_STANDARD);
return R.ok("删除购买标准成功");
}
/**
* 新增购买标准
......@@ -137,12 +140,35 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
insuranceTypeStandard.setCreateBy(user.getId());
insuranceTypeStandard.setCreateName(user.getNickname());
insuranceTypeStandard.setCreateTime(LocalDateTime.now());
return R.ok(this.baseMapper.insert(insuranceTypeStandard),"新增购买标准成功");
save(insuranceTypeStandard);
addOperate(insuranceTypeStandard,user, InsurancesConstants.NEW_INSURANCE_TYPE_STANDARD);
return R.ok("新增购买标准成功");
}else{
return R.failed("当前险种下的购买标准已存在");
return R.failed("该险种下购买标准已存在");
}
}
/**
* 操作记录
*
* @author zhaji
* @param insuranceTypeStandard 购买标准信息
* @param user 登录用户
* @param operateDesc 操作描述
* @return void
*/
private void addOperate(TInsuranceTypeStandard insuranceTypeStandard,YifuUser user,String operateDesc){
try {
TInsuranceOperate operate = new TInsuranceOperate();
operate.setInsuranceDetailId(insuranceTypeStandard.getId());
operate.setOperateDesc(operateDesc);
operate.setCreateBy(user.getId());
operate.setCreateName(user.getNickname());
operate.setCreateTime(LocalDateTime.now());
tInsuranceOperateService.save(operate);
}catch (Exception e){
e.getStackTrace();
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceSettleCancelMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceSettleCancel">
<id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="insDetailId" column="INS_DETAIL_ID" jdbcType="VARCHAR"/>
<result property="settleId" column="SETTLE_ID" jdbcType="VARCHAR"/>
<result property="deptNo" column="DEPT_NO" jdbcType="VARCHAR"/>
<result property="deptName" column="DEPT_NAME" jdbcType="VARCHAR"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="isCancelPush" column="IS_CANCEL_PUSH" jdbcType="TINYINT"/>
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="createUesr" column="CREATE_UESR" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,INS_DETAIL_ID,SETTLE_ID,
DEPT_NO,DEPT_NAME,ORDER_NO,
IS_CANCEL_PUSH,CREATE_TIME,CREATE_UESR
</sql>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment