111
k94314517
2024-02-23 274d9de5e50cc2d23b25ba271a8e66021b448916
server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java
@@ -123,6 +123,7 @@
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.UPLOAD.getKey())
                ||Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.SIGNATURE.getKey())
                ||Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.APPROVE.getKey())){
            //已提交和已完成状态不支持审核不通过
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~");
@@ -255,6 +256,15 @@
        update.setId(model.getId());
        update.setValidCode(param.getValidCode());
        applyChangeMapper.updateById(update);
        //修改员工保单记录
        memberInsuranceJoinMapper.update(null,new UpdateWrapper<MemberInsurance>()
                .lambda()
                .set(MemberInsurance::getPdCode,param.getValidCode())
                .eq(MemberInsurance::getRelationType,Constants.ONE)
                .eq(MemberInsurance::getApplyChangeId,model.getId())
        );
        //删除原有的保单信息
        multifileMapper.delete(new UpdateWrapper<Multifile>().lambda()
                .set(Multifile::getIsdeleted,Constants.ZERO)
@@ -387,6 +397,7 @@
                applyDetailJoinMapper.insert(applyDetail);
                MemberInsurance memberInsurance = new MemberInsurance(applyDetail,update.getId());
                memberInsurance.setRelationType(Constants.ONE);
                memberInsuranceJoinMapper.insert(memberInsurance);
            }else{
@@ -481,7 +492,7 @@
                        .eq(ApplyDetail::getApplyId,update.getApplyId())
                        .eq(ApplyDetail::getIdcardNo,detail.getIdcardNo())
                        .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(update.getApplyStartTime(),1))
                        .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(update.getApplyStartTime(),3))
                        .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(detail.getEndTime(),2))
                )>Constants.ZERO){
                    throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "当前保单下,加保人员【" + detail.getMemberName() + "】存在日期冲突的数据");
                }
@@ -521,6 +532,7 @@
                currentFee = currentFee.add(add.getCurrentFee());
                MemberInsurance memberInsurance = new MemberInsurance(detail, update, update.getEditor(), add.getId());
                memberInsurance.setRelationType(Constants.ONE);
                memberInsuranceList.add(memberInsurance);
                applyChangeDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda()
@@ -644,7 +656,9 @@
        Constants.NoticeType noticeType = Constants.NoticeType.FOUR;
        if(param.getDealBackApply() ==1){
            //如果是驳回,只能可驳回已签章状态下的退回申请状态进行操作
            if(!Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey())){
            if(!(Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey())
                    ||Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()))
            ){
                throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~");
            }
            applyLogType = Constants.ApplyLogType.CA_PALTFORM_REFUSE_APPLY;
@@ -723,7 +737,7 @@
        }
        CompanySolution companySolution = companySolutionMapper.selectOne(new QueryWrapper<CompanySolution>().lambda()
                .eq(CompanySolution::getCompanyId,loginUserInfo.getCompanyId())
                .eq(CompanySolution::getSolutionId,solutions.getId())
                .eq(CompanySolution::getSolutionBaseId,solutions.getBaseId())
                .eq(CompanySolution::getIsdeleted,Constants.ZERO)
                .last(" limit 1 ")
        );
@@ -871,7 +885,7 @@
                .eq(DispatchUnit::getUnitStatus,Constants.ONE)
                .eq(DuSolution::getIsdeleted,Constants.ZERO)
                .eq(DuSolution::getStatus,Constants.ONE)
                .eq(DuSolution::getSolutionId,insuranceApply.getSolutionId()));
                .eq(DuSolution::getSolutionId,companySolution.getSolutionId()));
        if(!CollectionUtils.isNotEmpty(duSolutionList)){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"数据异常:保险方案下未查询到派遣单位");
        }
@@ -1044,7 +1058,8 @@
                    .eq(ApplyDetail::getApplyId,applyChange.getApplyId())
                    .eq(ApplyDetail::getIdcardNo,applyChagneDetail.getIdcardNo())
                    .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),1))
                    .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),3))
                            .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(insuranceApply.getEndTime(),2))
                    //.ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),3))
            )>Constants.ZERO){
                throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "当前保单下,加保人员【" + applyChagneDetail.getMemberName() + "】存在日期冲突的数据");
            }
@@ -1781,7 +1796,7 @@
        BigDecimal sumPrice = countCyclePriceVO.getCyclePrice();
        CountCyclePriceVO returnCountCyclePriceVO = new CountCyclePriceVO();
        //加减保金额
        returnCountCyclePriceVO.setCyclePrice(sumPrice.divide(new BigDecimal(sumDays),2, RoundingMode.HALF_UP).multiply(new BigDecimal(optDays)));
        returnCountCyclePriceVO.setCyclePrice(sumPrice.multiply(new BigDecimal(optDays)).divide(new BigDecimal(sumDays),2, RoundingMode.HALF_UP));
        return returnCountCyclePriceVO;
    }