From 94c670060fb681b4e7262989bdea9748f03fb93c Mon Sep 17 00:00:00 2001 From: k94314517 <8417338+k94314517@user.noreply.gitee.com> Date: 星期一, 18 三月 2024 16:19:28 +0800 Subject: [PATCH] git ch --- server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java | 43 ++++++++++++++++++++++++++++++++++++------- 1 files changed, 36 insertions(+), 7 deletions(-) diff --git a/server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java index ee34315..3a9949f 100644 --- a/server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java +++ b/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(); @@ -539,7 +563,7 @@ if(new Date().compareTo(DateUtil.getMontageDate(detail.getStartTime(), 2))>=0){ Integer days = DateUtil.daysBetweenDates(DateUtil.getMontageDate(new Date(), 2), detail.getStartTime()) + 1; - //濡傛灉宸蹭骇鐢熻垂鐢紝璁$畻宸蹭骇鐢熻垂鐢� + //濡傛灉宸插凡浜х敓璐圭敤锛岃绠楀凡宸蹭骇鐢熻垂鐢� add.setCurrentFee(this.getApplyPrice(update.getApplyId(), days)); }else{ add.setCurrentFee(BigDecimal.ZERO); @@ -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)); @@ -1374,11 +1398,13 @@ .select("( select ifnull(sum(ad.FEE),0) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID )",ApplyChange::getChangeMoney) .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) + .leftJoin(Solutions.class,Solutions::getType,InsuranceApply::getSolutionType) .eq(!Objects.isNull(model.getType()),ApplyChange::getType,model.getType()) .eq(!Objects.isNull(model.getStatus())&&!model.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()),ApplyChange::getStatus,model.getStatus()) .in(!Objects.isNull(model.getStatus())&&model.getStatus().equals(Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()),ApplyChange::getStatus, Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey(), Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey()) + .eq(!Objects.isNull(model.getSolutionType()),Solutions::getType,model.getSolutionType()) .eq(!Objects.isNull(model.getCompanyId()),InsuranceApply::getCompanyId,model.getCompanyId()) .eq(!Objects.isNull(model.getSolutionsId()),ApplyChange::getSolutionsId,model.getSolutionsId()) .ge(StringUtils.isNotBlank(model.getCreateDateS()),ApplyChange::getCreateDate, model.getCreateDateS()+" 00:00:00" ) @@ -1413,6 +1439,7 @@ .selectAll(ApplyChange.class) .selectAs(InsuranceApply::getCode,ApplyChange::getApplyCode) .selectAs(Solutions::getName,ApplyChange::getSolutionsName) + .selectAs(Solutions::getType,ApplyChange::getSolutionType) .selectAs(Company::getName,ApplyChange::getCompanyName) .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 0 )",ApplyChange::getAddNum) .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 1 )",ApplyChange::getDelNum) @@ -1428,6 +1455,7 @@ Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey()) // .eq(!Objects.isNull(model.getCompanyId()),InsuranceApply::getCompanyId,model.getCompanyId()) // .eq(!Objects.isNull(model.getSolutionsId()),ApplyChange::getSolutionsId,model.getSolutionsId()) + .eq(!Objects.isNull(model.getType()),Solutions::getType,model.getSolutionType()) .eq(!Objects.isNull(model.getApplyId()),ApplyChange::getApplyId,model.getApplyId()) .eq(!Objects.isNull(model.getBaseSolutionsId()),Solutions::getBaseId,model.getBaseSolutionsId()) .ge(StringUtils.isNotBlank(model.getCreateDateS()),ApplyChange::getCreateDate, model.getCreateDateS()+" 00:00:00" ) @@ -1584,6 +1612,7 @@ .selectAs(InsuranceApply::getStartTime,ApplyChange::getStartTime) .selectAs(InsuranceApply::getEndTime,ApplyChange::getEndTime) .selectAs(Solutions::getName,ApplyChange::getSolutionsName) + .selectAs(Solutions::getType,ApplyChange::getSolutionType) .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 0 )",ApplyChange::getAddNum) .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 1 )",ApplyChange::getDelNum) .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 2 )",ApplyChange::getChangeNum) @@ -1609,7 +1638,7 @@ applyChange.setApplyLogList(applyLogList); List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() - .eq(Multifile::getObjId,applyChange.getId()) + .eq(Multifile::getObjId,Constants.equalsInteger(applyChange.getSolutionType(),Constants.ZERO)? applyChange.getId():applyChange.getUnionChangeId()) .in(Multifile::getObjType, Arrays.asList(new Integer[]{Constants.MultiFile.CA_APPLY_JIAJIAN_SIGN.getKey() ,Constants.MultiFile.CA_PD_PDF.getKey() ,Constants.MultiFile.CA_APPLY_CHANGEUNIT_SIGN.getKey()})) -- Gitblit v1.9.3