Commit 64076218 authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/develop' into develop

parents 84ce6767 5625cdaa
......@@ -12,6 +12,6 @@ dapr.check.appId=yifu-check
dapr.archives.appUrl=http://yifu-archives.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.archives.appId=yifu-archives
dapr.insurances.appUrl=http://yifu-insurances.qas-mvp.svc.cluster.local:3511/v1.0/invoke/
dapr.insurances.appUrl=http://yifu-insurances.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.insurances.appId=yifu-insurances
......@@ -146,9 +146,9 @@ public class InsurancesConstants {
*/
public static final String REDUCE_ROLLBACK_IS_NOT_ALLOW = "投保状态不是待投保、投保中、已投保,无法退回";
/**
* 减员中,无法退回
* 商险减员中,无法退回
*/
public static final String REDUCE_ROLLBACK_REDUCE_IS_NOT_ALLOW = "减员中,无法退回";
public static final String REDUCE_ROLLBACK_REDUCE_IS_NOT_ALLOW = "商险减员中,无法退回";
/**
* 员工姓名不能为空
*/
......@@ -326,9 +326,9 @@ public class InsurancesConstants {
*/
public static final String ACTUAL_PREMIUM_EMPTY = "保费不能为空";
/**
* 保费金额格式错误
* 保费金额需要填写不大于9999999.99的正数,最多支持两位小数
*/
public static final String ACTUAL_PREMIUM_PARSE_ERROR= "保费金额格式错误";
public static final String ACTUAL_PREMIUM_PARSE_ERROR= "保费金额需要填写不大于9999999.99的正数,最多支持两位小数";
/**
* 替换类型无法登记保单保费
*/
......@@ -525,7 +525,7 @@ public class InsurancesConstants {
/**
* 商险已减员,无法变更项目
*/
public static final String DEPT_NO_CHANGE_REFUND_STATUS_ONE_ERROR = "商险减员中,无法变更项目";
public static final String DEPT_NO_CHANGE_REFUND_STATUS_ONE_ERROR = "减员流程中,无法变更项目";
/**
* 商险结算中,无法变更项目
......
......@@ -38,6 +38,18 @@ public class DeptChangeCheckParam implements Serializable {
@Schema(description = "原项目编码")
private String oldDeptNo;
/**
* 新项目名称
*/
@Schema(description = "新项目名称")
private String newDeptName;
/**
* 原项目名称
*/
@Schema(description = "原项目名称")
private String oldDeptName;
/**
* 新项目编码
*/
......
......@@ -3,18 +3,14 @@ package com.yifu.cloud.plus.v1.yifu.insurances.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceCompany;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.Dept;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceDetailService;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpHeaders;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -33,7 +29,6 @@ import java.util.List;
@RequestMapping("/insuranceDetail")
@Tag(name = "商险相关")
@Validated
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TInsuranceDetailController {
@Resource
private TInsuranceDetailService tInsuranceDetailService;
......
......@@ -2825,10 +2825,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel.setSettleId(defaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
//查询旧的结算信息
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//推送EKP // TODO: 2022/8/2
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
......@@ -2868,10 +2872,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceSettle.setCreateTime(LocalDateTime.now());
tInsuranceSettleService.save(tInsuranceSettle);
//将结算id赋值给保单信息,并新增预估费用
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium());
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,tInsuranceSettle.getId());
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,success.getEstimatePremium())
.set(TInsuranceDetail :: getDefaultSettleId,tInsuranceSettle.getId());
update(updateWrapper);
//推送结算信息至EKP // TODO: 2022/8/2
//推送结算信息至EKP // TODO: 2022/8/2
tInsuranceSettle.setIsEstimatePush(CommonConstants.ONE_INT);
tInsuranceSettle.setEstimatePushTime(LocalDateTime.now());
tInsuranceSettleService.updateById(tInsuranceSettle);
}
}
......@@ -2889,9 +2896,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel.setSettleId(defaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//旧的结算信息推送作废至EKP
//旧的结算信息推送作废至EKP,更新推送标识
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
......@@ -2917,8 +2928,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel.setSettleId(defaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//推送EKP,更新推送标识
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
......@@ -2948,8 +2964,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel.setSettleId(defaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
//推送至EKP // TODO: 2022/8/2
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//删除预估费用和结算id
updateWrapper.set(TInsuranceDetail ::getEstimatePremium,new BigDecimal("0.00"));
updateWrapper.set(TInsuranceDetail :: getDefaultSettleId,null);
......@@ -2964,9 +2984,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
cancel.setSettleId(defaultSettleId);
cancel.setCreateUesr(user.getId());
cancel.setCreateTime(LocalDateTime.now());
cancel.setDeptName(success.getOldDeptName());
cancel.setIsCancelPush(CommonConstants.ZERO_INT);
tInsuranceSettleCancelService.save(cancel);
TInsuranceSettle byId = tInsuranceSettleService.getById(defaultSettleId);
//推送至EKP作废 // TODO: 2022/8/2
cancel.setIsCancelPush(CommonConstants.ONE_INT);
tInsuranceSettleCancelService.updateById(cancel);
//新增新的结算信息
TInsuranceSettle newInsuranceSettle = new TInsuranceSettle();
newInsuranceSettle.setInsDetailId(insuranceDetailId);
......@@ -3684,7 +3708,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
//根据项目编码查询项目是否存在
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(newDeptNo));
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(newDeptNo,oldDeptNo));
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)){
......@@ -3694,6 +3718,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}else {
//结算类型,根据项目编码获取,并冗余到明细记录中
ProjectSetInfoVo jsonObject = data.get(newDeptNo);
ProjectSetInfoVo oldJsonObject = data.get(oldDeptNo);
param.setOldDeptName(oldJsonObject.getDepartName());
param.setNewDeptName(jsonObject.getDepartName());
String settleType = jsonObject.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
......
......@@ -84,14 +84,6 @@ public class TInsuranceTypeStandardServiceImpl extends ServiceImpl<TInsuranceTyp
if (Common.isEmpty(byId) || CommonConstants.ONE_INT == byId.getDeleteFlag()){
return R.failed("购买标准信息不存在或已被删除");
}
LambdaQueryWrapper<TInsuranceDetail> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceDetail::getInsuranceTypeId,byId.getInsuranceTypeId())
.eq(TInsuranceDetail::getBuyStandard,byId.getBuyStandard())
.eq(TInsuranceDetail::getDeleteFlag,CommonConstants.ZERO_INT);
List<TInsuranceDetail> list = tInsuranceDetailService.list(queryWrapper);
if (Common.isNotEmpty(list)){
return R.failed("当前险种的购买标准已存在对应的商险信息,不能删除");
}
LambdaUpdateWrapper<TInsuranceTypeStandard> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceTypeStandard::getId,id)
.set(TInsuranceTypeStandard::getDeleteFlag, CommonConstants.ONE_INT)
......
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