Commit ce123c42 authored by hongguangwu's avatar hongguangwu

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

parents 8499e9fb 381076c4
......@@ -389,8 +389,8 @@ public class TEmployeeContractInfo extends BaseEntity {
/**
* 最新审核通过时间
*/
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
@Schema(description = "最新审核通过时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime auditTimeLast;
/**
......
......@@ -2113,6 +2113,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(c)){
c.setAuditStatus(CommonConstants.TWO_INT);
c.setInUse(CommonConstants.ZERO_STRING);
contractServicer.updateById(c);
}
......@@ -2165,6 +2166,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
}
contract.setAuditStatus(CommonConstants.ONE_INT);
contract.setApplyNo(contractServicer.getCode(false));
contract.setInUse(CommonConstants.ONE_STRING);
contractServicer.save(contract);
contractAdd.setId(contract.getId());
contractAdd.setEmpNo(contract.getEmpNo());
......
......@@ -117,11 +117,11 @@ emp.dispatch.fund.not.empty=\u6D3E\u5355\u5458\u5DE5\u516C\u79EF\u91D1\u76F8\u51
emp.dispatch.social.existing=\u65B0\u589E\u5F02\u5E38\uFF1A\u5DF2\u5B58\u5728\u793E\u4FDD\u6570\u636E
emp.dispatch.social.injury.existing=\u65B0\u589E\u5F02\u5E38\uFF1A\u5B58\u5728\u529E\u7406\u6210\u529F\u672A\u6D3E\u51CF\u7684\u5DE5\u4F24\u793E\u4FDD\u6570\u636E
emp.dispatch.social.injury.existing=\u65B0\u589E\u5F02\u5E38\uFF1A\u5B58\u5728\u672A\u6D3E\u51CF\u7684\u5DE5\u4F24\u793E\u4FDD\u6570\u636E
emp.dispatch.social.not.reduce=\u65B0\u589E\u5F02\u5E38\uFF1A\u5B58\u5728\u529E\u7406\u6210\u529F\u672A\u6D3E\u51CF\u7684\u4E94\u9669\u793E\u4FDD\u6570\u636E\uFF0C\u7981\u6B62\u65B0\u589E\u5DE5\u4F24
emp.dispatch.social.not.reduce=\u65B0\u589E\u5F02\u5E38\uFF1A\u5B58\u5728\u672A\u6D3E\u51CF\u7684\u4E94\u9669\u793E\u4FDD\u6570\u636E\uFF0C\u7981\u6B62\u65B0\u589E\u5DE5\u4F24
emp.dispatch.social.injury.not.reduce=\u65B0\u589E\u5F02\u5E38\uFF1A\u5B58\u5728\u529E\u7406\u6210\u529F\u672A\u6D3E\u51CF\u7684\u5DE5\u4F24\u793E\u4FDD\u6570\u636E\uFF0C\u7981\u6B62\u65B0\u589E\u4E94\u9669
emp.dispatch.social.injury.not.reduce=\u65B0\u589E\u5F02\u5E38\uFF1A\u5B58\u5728\u672A\u6D3E\u51CF\u7684\u5DE5\u4F24\u793E\u4FDD\u6570\u636E\uFF0C\u7981\u6B62\u65B0\u589E\u4E94\u9669
emp.dispatch.social.hold.not.exist=\u65B0\u589E\u5F02\u5E38\uFF1A\u672A\u627E\u5230\u5BF9\u5E94\u793E\u4FDD\u6237\u540D\u79F0\u7684\u53EF\u7528\u57FA\u6570\u914D\u7F6E\u4FE1\u606F
......
......@@ -92,10 +92,18 @@ public class InsurancesConstants {
* 项目编码不存在
*/
public static final String DEPT_NO_IS_NOT_EXIST = "项目编码不存在";
/**
* 替换员工项目不存在
*/
public static final String REPLACE_DEPT_NO_IS_NOT_EXIST = "替换员工项目不存在";
/**
* 未找到项目的结算方式
*/
public static final String PROJECT_NOT_FIND_SETTLE_TYPE = "未找到项目的结算方式";
/**
* 根据替换员工的项目,未找到项目的结算方式
*/
public static final String REPLACE_PROJECT_NOT_FIND_SETTLE_TYPE = "根据替换员工的项目,未找到项目的结算方式";
/**
* 替换员工投保记录已存在
*/
......
......@@ -248,6 +248,7 @@ public class TInsuranceDetail extends BaseEntity {
* 是否有效 0有效 1无效
*/
@Schema(description = "是否有效 0有效 1无效")
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Integer isEffect;
/**
......
......@@ -29,6 +29,7 @@ import com.yifu.cloud.plus.v1.yifu.insurances.util.BigDecimalUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.util.LocalDateUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -52,6 +53,7 @@ import java.util.stream.Collectors;
* @date 2022-07-18 16:20:16
*/
@Service
@Slf4j
public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMapper, TInsuranceDetail> implements TInsuranceDetailService {
@Resource
@Lazy
......@@ -92,7 +94,25 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
public void updateOverdueByTask() {
//todo
// 获取未失效的所有明细数据
List<TInsuranceDetail> list = this.baseMapper.selectList(Wrappers.<TInsuranceDetail>query().lambda()
.eq(TInsuranceDetail::getIsEffect, CommonConstants.ZERO_INT)
.eq(TInsuranceDetail::getDeleteFlag, CommonConstants.ZERO_INT)
);
if (CollectionUtils.isNotEmpty(list)){
log.info("定时任务扫描到的有效数据是:{}条",list.size());
list.stream().forEach(e -> {
if (!LocalDateUtil.isFutureDate(e.getPolicyEnd().toString())){
e.setIsEffect(CommonConstants.ONE_INT);
e.setUpdateTime(LocalDateTime.now());
}
});
List<TInsuranceDetail> collect = list.stream().filter(e -> e.getIsEffect() == CommonConstants.ONE_INT).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(collect)){
log.info("定时任务扫描到的已失效数据是:{}条",collect.size());
this.updateBatchById(collect);
}
}
}
/**
......@@ -408,6 +428,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.failed(InsurancesConstants.DATA_IS_NOT_EXIST);
}
if (byId.getBuyHandleStatus() == CommonConstants.FOUR_INT && byId.getBuyType() != CommonConstants.FOUR_INT){
//新增、批增的编辑逻辑
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
return R.failed(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
......@@ -559,7 +581,56 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
byId.setUpdateBy(user.getId());
byId.setUpdateTime(LocalDateTime.now());
this.updateById(byId);
}else {
}else if(byId.getBuyHandleStatus() == CommonConstants.FOUR_INT && byId.getBuyType() == CommonConstants.FOUR_INT){
//替换的编辑逻辑
// 身份证号位数校验(18 位合法)
if (!ValidityUtil.validateIDCard(param.getEmpIdcardNo())){
return R.failed(InsurancesConstants.EMP_IDCARD_NO_NOT_LEGITIMATE);
}
//校验身份合法
/*TCheckIdCard checkIdCard = new TCheckIdCard();
checkIdCard.setName(param.getEmpName());
checkIdCard.setIdCard(param.getEmpIdcardNo());
R<TCheckIdCard> tCheckIdCardR = checkDaprUtil.checkIdCardSingle(checkIdCard);
if (null != tCheckIdCardR && tCheckIdCardR.getCode() == CommonConstants.SUCCESS){
TCheckIdCard data = tCheckIdCardR.getData();
if (CommonConstants.ONE_INT != data.getIsTrue()){
return R.failed(InsurancesConstants.EMP_ID_CARD_NO_NOT_FIT);
}
}*/
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, byId.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()){
TInsuranceDetail insuranceDetail = this.getById(one.getFromInsuranceDetailId());
if (Optional.ofNullable(insuranceDetail).isPresent()){
if (insuranceDetail.getIsUse() == CommonConstants.ONE_INT){
return R.failed("员工"+insuranceDetail.getEmpName()+"的投保记录已出险,无法替换");
}
if (insuranceDetail.getIsEffect() == CommonConstants.ONE_INT){
return R.failed("员工"+insuranceDetail.getEmpName()+"的投保记录无效,无法替换");
}
//被替换者无效
insuranceDetail.setIsEffect(CommonConstants.ONE_INT);
this.updateById(insuranceDetail);
//替换记录成功
one.setReplaceStatus(CommonConstants.ONE_INT);
tInsuranceReplaceService.updateById(one);
//替换状态下目前只能编辑姓名、身份证、岗位
//投保状态:待投保
byId.setBuyHandleStatus(CommonConstants.ONE_INT);
byId.setEmpName(param.getEmpName());
byId.setEmpIdcardNo(param.getEmpIdcardNo());
byId.setPost(param.getPost());
byId.setUpdateBy(user.getId());
byId.setUpdateTime(LocalDateTime.now());
this.updateById(byId);
}
}
} else {
return R.failed(InsurancesConstants.EDIT_NOT_ALLOW);
}
//操作记录
......@@ -685,6 +756,27 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listVO.setErrorMessage(InsurancesConstants.REDUCE_ROLLBACK_REDUCE_IS_NOT_ALLOW);
errorList.add(listVO);
}else{
//判断是否是替换类型的退回,如果是,需要将被替换者激活,替换者有效状态为空
if(detail.getBuyType() == CommonConstants.FOUR_INT){
//替换者有效状态为空
detail.setIsEffect(null);
TInsuranceReplace one = tInsuranceReplaceService.getOne(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getToInsuranceDetailId, detail.getId())
.last(CommonConstants.LAST_ONE_SQL));
if (Optional.ofNullable(one).isPresent()){
//替换记录变为失败
one.setReplaceStatus(CommonConstants.ZERO_INT);
tInsuranceReplaceService.updateById(one);
TInsuranceDetail byId = this.getById(one.getFromInsuranceDetailId());
if (Optional.ofNullable(byId).isPresent()){
//被替换者激活
byId.setIsEffect(CommonConstants.ZERO_INT);
this.updateById(byId);
}
}
}
// 记录状态置为「退回」
detail.setBuyHandleStatus(CommonConstants.FOUR_INT);
detail.setUpdateBy(user.getId());
......@@ -763,6 +855,17 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
listVO.setErrorMessage(InsurancesConstants.INSURANCE_BUY_STATUS_NOT_TWO);
errorList.add(listVO);
}else {
//替换类型不参与结算
if(detail.getBuyType() == CommonConstants.FOUR_INT){
//记录状态均置为「已投保」
detail.setBuyHandleStatus(CommonConstants.THREE_INT);
detail.setSignFlag(CommonConstants.ONE_INT);
//记录的有效状态,置为「有效」
detail.setIsEffect(CommonConstants.ZERO_INT);
detail.setIsOverdue(CommonConstants.ZERO_INT);
detail.setIsUse(CommonConstants.ZERO_INT);
successList.add(detail);
}else{
//根据结算类型判断是否需要计算预估保费
//预估
if (detail.getSettleType() == CommonConstants.ZERO_INT){
......@@ -848,6 +951,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
}
if (CollectionUtils.isNotEmpty(successList)){
//更新
this.saveOrUpdateBatch(successList);
......@@ -1813,24 +1917,24 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//根据项目编码查询项目是否存在
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getDeptNo()));
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(Arrays.asList(param.getReplaceDeptNo()));
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS) {
Map<String, ProjectSetInfoVo> data = setInfoByCodes.getData().getProjectSetInfoVoMap();
if (MapUtils.isEmpty(data)){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
param.setErrorMessage(InsurancesConstants.REPLACE_DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
ProjectSetInfoVo projectSetInfoVo = data.get(param.getDeptNo());
ProjectSetInfoVo projectSetInfoVo = data.get(param.getReplaceDeptNo());
if (null == projectSetInfoVo){
param.setErrorMessage(InsurancesConstants.DEPT_NO_IS_NOT_EXIST);
param.setErrorMessage(InsurancesConstants.REPLACE_DEPT_NO_IS_NOT_EXIST);
listResult.add(param);
continue;
}else {
//结算类型,根据项目编码获取,并冗余到明细记录中
String settleType = projectSetInfoVo.getInsuranceSettleType();
if (StringUtils.isEmpty(settleType)){
param.setErrorMessage(InsurancesConstants.PROJECT_NOT_FIND_SETTLE_TYPE);
param.setErrorMessage(InsurancesConstants.REPLACE_PROJECT_NOT_FIND_SETTLE_TYPE);
listResult.add(param);
continue;
}else {
......
......@@ -365,11 +365,11 @@ public class TDispatchInfo extends BaseEntity {
@ExcelProperty("社保办理状态" )
private String socialHandleStatus;
/**
* 公积金办理状态:0 未办理 1办理成功 2 办理失败 3 已派减
* 公积金办理状态:0 未办理 1办理成功 2 办理失败
*/
@Length(max = 1, message = "公积金办理状态 不能超过1个字符" )
@ExcelAttribute(name = "公积金办理状态", maxLength = 1)
@Schema(description = "公积金办理状态:0 未办理 1办理成功 2 办理失败 3 已派减" )
@Schema(description = "公积金办理状态:0 未办理 1办理成功 2 办理失败 " )
@ExcelProperty("公积金办理状态" )
private String fundHandleStatus;
/**
......
......@@ -763,4 +763,20 @@ public class TSocialInfo extends BaseEntity {
@ExcelProperty("基数下限(社保或公积金)")
private BigDecimal lowerLimit;
/**
* 单位社保合计
*/
@ExcelAttribute(name = "单位社保合计" )
@Schema(description ="单位社保合计")
@ExcelProperty("单位社保合计")
private BigDecimal unitSocialSum;
/**
* 个人社保合计
*/
@ExcelAttribute(name = "个人社保合计" )
@Schema(description ="个人社保合计")
@ExcelProperty("个人社保合计")
private BigDecimal personalSocialSum;
}
......@@ -394,6 +394,10 @@
<if test="tDispatchInfo.providentHouseholdName != null and tDispatchInfo.providentHouseholdName.trim() != ''">
AND f.PROVIDENT_HOUSEHOLD_NAME = #{tDispatchInfo.providentHouseholdName}
</if>
<if test="tDispatchInfo.createTimes != null and tDispatchInfo.createTimes.length>0">
AND a.UPDATE_TIME <![CDATA[ >= ]]> #{tDispatchInfo.createTimes[0]}
AND a.UPDATE_TIME <![CDATA[ <= ]]> #{tDispatchInfo.createTimes[1]}
</if>
</if>
</sql>
<!--tDispatchInfo简单分页查询-->
......
......@@ -386,7 +386,7 @@
a.PERSONAL_INTEREST_FEE,
a.SOCIAL_STATUS,
a.FUND_STATUS,
a.DISPATCH_ID
a.DISPATCH_ID,a.UNIT_SOCIAL_SUM,a.PERSONAL_SOCIAL_SUM
</sql>
<sql id="tSocialFundInfo_where">
<if test="tSocialFundInfo != null">
......
......@@ -123,6 +123,8 @@
<result property="payPolicy" column="PAY_POLICY"/>
<result property="lowerLimit" column="LOWER_LIMIT"/>
<result property="upperLimit" column="UPPER_LIMIT"/>
<result property="unitSocialSum" column="UNIT_SOCIAL_SUM"/>
<result property="personalSocialSum" column="PERSONAL_SOCIAL_SUM"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -225,7 +227,7 @@
a.UPDATE_TIME,
a.PAY_POLICY,
a.LOWER_LIMIT,
a.UPPER_LIMIT
a.UPPER_LIMIT,a.UNIT_SOCIAL_SUM,a.PERSONAL_SOCIAL_SUM
</sql>
<sql id="tSocialInfo_where">
<if test="tSocialInfo != null">
......
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