111
k94314517
2024-03-05 0b161bd2fa0b448c8824815904355ad245287f01
server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java
@@ -122,6 +122,19 @@
        if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        InsuranceApply insuranceApply = insuranceApplyMapper.selectById(model.getApplyId());
        if(Objects.isNull(insuranceApply)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(insuranceApply.getIsdeleted().equals(Constants.ONE)){
            throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"数据已删除,无法进行该操作");
        }
        Solutions solutions = solutionsMapper.selectById(insuranceApply.getSolutionId());
        if(Objects.isNull(solutions)){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"未查询到方案信息");
        }
        if(
//                Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.UPLOAD.getKey())
//                ||Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.SIGNATURE.getKey())
@@ -140,6 +153,17 @@
        update.setCheckUserId(user.getId());
        update.setId(model.getId());
        applyChangeMapper.updateById(update);
        //存储待办信息
        Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.APPLY_CHANGE;
        if(model.getType().equals(Constants.ONE)){
            noticeObjectType = Constants.NoticeObjectType.CHANGE_FACTORY;
        }
        //删除其他待办
        noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,model.getId()));
        Notices notices = new Notices(noticeObjectType,Constants.ONE,model.getId(),solutions.getName(),
                insuranceApply.getCompanyId(), Constants.NoticeType.FOUR);
        noticesMapper.insert(notices);
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_PLATFORM_CHECK_PASS_NO;
        String info =applyLogType.getInfo();
@@ -591,8 +615,8 @@
                    applyDetailJoinMapper.update(null, new UpdateWrapper<ApplyDetail>().lambda()
                            .setSql(" fee = ifnull(fee,0)+" + updateFee)
                            .setSql(" current_fee = " + updateCurrentFee)
                            .set(insuranceApply.getStartTime().compareTo(update.getValidTime())!=0,ApplyDetail::getEndTime, DateUtil.getMontageDate(update.getApplyStartTime(), 3))
                            .set(insuranceApply.getStartTime().compareTo(update.getValidTime())==0,ApplyDetail::getEndTime, DateUtil.getMontageDate(update.getApplyStartTime(), 2))
                            .set(insuranceApply.getStartTime().compareTo(update.getApplyStartTime())!=0,ApplyDetail::getEndTime, DateUtil.getMontageDate(update.getApplyStartTime(), 3))
                            .set(insuranceApply.getStartTime().compareTo(update.getApplyStartTime())==0,ApplyDetail::getEndTime, DateUtil.getMontageDate(update.getApplyStartTime(), 2))
                            .set(ApplyDetail::getEditor, update.getEditor())
                            .set(ApplyDetail::getEditDate, update.getEditDate())
                            .eq(ApplyDetail::getId, oldModel.getId())
@@ -603,8 +627,8 @@
                    //修改 员工投保明细记录 历史数据
                    memberInsuranceJoinMapper.update(null, new UpdateWrapper<MemberInsurance>().lambda()
                            .setSql(" fee = ifnull(fee,0)+" + updateFee)
                            .set(insuranceApply.getStartTime().compareTo(update.getValidTime())!=0,MemberInsurance::getEndTime,DateUtil.getMontageDate(update.getApplyStartTime(), 3))
                            .set(insuranceApply.getStartTime().compareTo(update.getValidTime())==0,MemberInsurance::getEndTime,DateUtil.getMontageDate(update.getApplyStartTime(), 2))
                            .set(insuranceApply.getStartTime().compareTo(update.getApplyStartTime())!=0,MemberInsurance::getEndTime,DateUtil.getMontageDate(update.getApplyStartTime(), 3))
                            .set(insuranceApply.getStartTime().compareTo(update.getApplyStartTime())==0,MemberInsurance::getEndTime,DateUtil.getMontageDate(update.getApplyStartTime(), 2))
                            .set(MemberInsurance::getStartTime, update.getApplyStartTime())
                            .eq(MemberInsurance::getRelationId, oldModel.getId())
                    );
@@ -723,7 +747,7 @@
        //删除其他待办
        noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,model.getId()));
        Notices notices = new Notices(noticeObjectType,Constants.ONE,model.getId(),solutions.getName(),
                model.getCompanyId(), noticeType);
                insuranceApply.getCompanyId(), noticeType);
        noticesMapper.insert(notices);
        ApplyLog log = new ApplyLog(update,applyLogType.getName(),info,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));