Commit d6c4b1a4 authored by zhaji's avatar zhaji

Merge branch 'develop' into feature-zhaji

parents c6d282ce 9192d9b9
......@@ -58,7 +58,7 @@ public class ProjectSetInfoVo implements Serializable {
* 商险结算类型:0预估 1 实缴
*/
@Schema(description = "商险结算类型")
private String insuranceSettleType = CommonConstants.ONE_STRING;
private String insuranceSettleType;
}
......@@ -195,6 +195,7 @@
SELECT a.ID,
a.DEPART_NO,
a.DEPART_NAME,
a.INSURANCE_SETTLE_TYPE,
c.ID AS 'customerId',
c.CUSTOMER_NAME as 'customerName',
c.CUSTOMER_CODE as 'customerCode'
......
......@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author licancan
......@@ -27,6 +28,12 @@ public class InsuranceListParam implements Serializable {
@Schema(description = "投保状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
private Integer buyHandleStatus;
/**
* 投保列表专用字段
*/
@Schema(description = "投保状态 集合中只能有这三个状态 1待投保 2投保中 4投保退回")
private List<Integer> buyHandleStatusList;
/**
* 员工姓名
*/
......
......@@ -346,7 +346,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.failed(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
}
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -355,7 +355,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (CommonConstants.ONE_INT != data.getIsTrue()){
return R.failed(InsurancesConstants.EMP_ID_CARD_NO_NOT_FIT);
}
}
}*/
if(!LocalDateUtil.isDate(param.getPolicyStart(),LocalDateUtil.NORM_DATE_PATTERN)){
return R.failed(InsurancesConstants.POLICY_START_PARSE_ERROR);
......@@ -579,10 +579,37 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
if (CollectionUtils.isNotEmpty(successList)){
//todo 判断是否推送过保费到ekp,如果推送过就新增一条负的,将结算表中的数据求和放到明细表中
for (TInsuranceDetail detail : successList) {
if (StringUtils.isNotBlank(detail.getDefaultSettleId())){
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if (Optional.ofNullable(settle).isPresent()){
TInsuranceSettle burden = new TInsuranceSettle();
BeanCopyUtils.copyProperties(settle,burden);
burden.setId(null);
burden.setCreateTime(LocalDateTime.now());
burden.setUpdateTime(LocalDateTime.now());
if (burden.getActualPremium() != null){
burden.setActualPremium(burden.getActualPremium().negate());
burden.setActualPushTime(LocalDateTime.now());
detail.setActualPremium(new BigDecimal("0.00"));
}
if (burden.getEstimatePremium() != null){
burden.setEstimatePremium(burden.getEstimatePremium().negate());
burden.setEstimatePushTime(LocalDateTime.now());
detail.setEstimatePremium(new BigDecimal("0.00"));
}
tInsuranceSettleService.save(burden);
//推送负的给ekp
//这里退回的时候,必须置为null,防止是实缴的时候,登记保费出错
detail.setDefaultSettleId(null);
}
}
}
//更新状态
this.saveOrUpdateBatch(successList);
//todo 判断是否推送过保费到ekp,如果推送过就新增一条负的,将结算表中的数据求和放到明细表中
}
//根据项目编码获取项目名称
setProjectNameByDeptNo(errorList);
......@@ -676,7 +703,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle.setSettleType(detail.getSettleType());
settle.setSettleHandleStatus(CommonConstants.ONE_STRING);
settle.setEstimatePremium(estimatePremium);
settle.setIsEstimatePush(CommonConstants.ZERO_INT);
//调完ekp接口才会是1
settle.setIsEstimatePush(CommonConstants.ONE_INT);
settle.setEstimatePushTime(LocalDateTime.now());
settle.setCreateTime(LocalDateTime.now());
tInsuranceSettleService.save(settle);
detail.setDefaultSettleId(settle.getId());
......@@ -706,7 +735,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
settle.setSettleType(detail.getSettleType());
settle.setSettleHandleStatus(CommonConstants.ONE_STRING);
settle.setEstimatePremium(estimatePremium);
settle.setIsEstimatePush(CommonConstants.ZERO_INT);
//调完ekp接口才会是1
settle.setIsEstimatePush(CommonConstants.ONE_INT);
settle.setEstimatePushTime(LocalDateTime.now());
settle.setCreateTime(LocalDateTime.now());
tInsuranceSettleService.save(settle);
detail.setDefaultSettleId(settle.getId());
......@@ -781,17 +812,50 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
.eq(TInsuranceDetail::getPolicyEnd, LocalDateUtil.parseLocalDate(success.getPolicyEnd()))
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
);
if (detail.getActualPremium() != null){
// 已推送过,只更新发票号
if (StringUtils.isNotBlank(success.getInvoiceNo())){
detail.setInvoiceNo(success.getInvoiceNo());
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now());
this.updateById(detail);
}else {
}
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now());
if (StringUtils.isNotBlank(success.getPolicyNo())){
detail.setPolicyNo(success.getPolicyNo());
}
if (StringUtils.isNotBlank(success.getActualPremium())){
detail.setActualPremium(new BigDecimal(success.getActualPremium()));
// todo 判断是否推送过ekp,没推送过调新增接口,推送过调更新接口
if (StringUtils.isNotBlank(detail.getDefaultSettleId())){
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if (Optional.ofNullable(settle).isPresent()){
settle.setActualPremium(detail.getActualPremium());
settle.setIsActualPush(CommonConstants.ONE_INT);
settle.setActualPushTime(LocalDateTime.now());
settle.setUpdateTime(LocalDateTime.now());
tInsuranceSettleService.updateById(settle);
//调更新接口
}
}else {
//保费存储
TInsuranceSettle settle = new TInsuranceSettle();
settle.setInsDetailId(detail.getId());
settle.setSettleType(detail.getSettleType());
settle.setSettleHandleStatus(CommonConstants.ONE_STRING);
settle.setActualPremium(detail.getActualPremium());
//调完ekp接口才会是1
settle.setIsActualPush(CommonConstants.ONE_INT);
settle.setActualPushTime(LocalDateTime.now());
settle.setCreateTime(LocalDateTime.now());
tInsuranceSettleService.save(settle);
detail.setDefaultSettleId(settle.getId());
//调新增接口
}
}
//可以改成批量更新
this.updateById(detail);
detailList.add(detail);
}
}
......@@ -910,7 +974,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -921,7 +985,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
}
}*/
//根据项目编码查询项目是否存在
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
......@@ -1216,7 +1280,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -1227,7 +1291,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
}
}*/
//根据项目编码查询项目是否存在
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
......@@ -1484,7 +1548,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}
//校验身份合法
TCheckIdCard checkIdCard = new TCheckIdCard();
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getReplaceEmpName());
checkIdCard.setIdCard(param.getReplaceEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
......@@ -1495,7 +1559,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
}
}*/
if (param.getEmpName().equals(param.getReplaceEmpName()) && param.getEmpIdcardNo().equals(param.getReplaceEmpIdcardNo())){
param.setErrorMessage(InsurancesConstants.REPLACE_EMP_INFO_SAME);
......@@ -1749,7 +1813,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listResult.add(param);
continue;
}
if(BigDecimalUtils.isBigDecimal(param.getActualPremium())){
if(!BigDecimalUtils.isBigDecimal(param.getActualPremium())){
param.setErrorMessage(InsurancesConstants.ACTUAL_PREMIUM_PARSE_ERROR);
listResult.add(param);
continue;
......
......@@ -101,6 +101,12 @@
<if test="param.insuranceTypeName != null and param.insuranceTypeName.trim() != ''">
and detail.INSURANCE_TYPE_NAME like concat('%',replace(replace(#{param.insuranceTypeName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyHandleStatusList.size > 0 and param.buyHandleStatusList != null">
and detail.BUY_HANDLE_STATUS in
<foreach collection="param.buyHandleStatusList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
ORDER BY detail.CREATE_TIME DESC
</select>
......@@ -140,6 +146,12 @@
<if test="param.insuranceTypeName != null and param.insuranceTypeName.trim() != ''">
and detail.INSURANCE_TYPE_NAME like concat('%',replace(replace(#{param.insuranceTypeName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.buyHandleStatusList.size > 0 and param.buyHandleStatusList != null">
and detail.BUY_HANDLE_STATUS in
<foreach collection="param.buyHandleStatusList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
ORDER BY detail.CREATE_TIME DESC
</select>
......
......@@ -370,7 +370,7 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
this.updateById(socialFundInfo);
// 3:新增变更日志
tSocialLogService.saveModificationRecord(CommonConstants.ONE_INT, oldSocialFundInfo.getId(), oldSocialFundInfo, socialFundInfo);
tSocialLogService.saveModificationRecord(CommonConstants.THREE_INT, oldSocialFundInfo.getId(), oldSocialFundInfo, socialFundInfo);
// 4:同步预估库
tForecastLibraryService.updateToneForecastLibary(socialFundInfo, doMonth);
// 返回信息处理
......
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