From e9446e2b5de0374a0d4df9cfa93ecc4a305524a8 Mon Sep 17 00:00:00 2001 From: k94314517 <8417338+k94314517@user.noreply.gitee.com> Date: 星期日, 04 二月 2024 16:13:15 +0800 Subject: [PATCH] 111 --- server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java | 54 ++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 34 insertions(+), 20 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 d1c2c30..e2cfd75 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 @@ -637,7 +637,14 @@ applyChangeMapper.updateById(applyChangeFee); - this.saveApplyLog(applyChange,Constants.ApplyChangeLogStatus.UPLOAD,null); + + Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_COMPANY_COMMIT; + String info =applyLogType.getInfo(); + info = info.replace("${param}", ""); + ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null); + applyLogMapper.insert(log); + + return applyChange.getId(); } @@ -710,7 +717,15 @@ BigDecimal fee = this.dealApplyChangeData(applyChange,insuranceApply,companySolution,solutions,loginUserInfo,BigDecimal.ZERO); applyChange.setFee(fee); applyChangeMapper.updateById(applyChange); - this.saveApplyLog(applyChange,Constants.ApplyChangeLogStatus.UPLOAD,null); + + + Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_UPLOAD_AGAIN; + String info =applyLogType.getInfo(); + info = info.replace("${param}", ""); + ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null); + applyLogMapper.insert(log); + + return applyChange.getId(); } @@ -783,23 +798,18 @@ } - - - - public void saveApplyLog(ApplyChange applyChange,Constants.ApplyChangeLogStatus applyChangeLogStatus,String content){ + public void saveApplyLog(ApplyChange applyChange,Constants.ApplyLogType applyLogType,String content){ LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); ApplyLog applyLog = new ApplyLog(); applyLog.setCreateDate(new Date()); applyLog.setCreator(loginUserInfo.getId()); applyLog.setIsdeleted(Constants.ZERO); applyLog.setApplyId(applyChange.getApplyId()); - applyLog.setTitle(applyChangeLogStatus.getName()); + applyLog.setTitle(applyLogType.getName()); if(StringUtils.isNotBlank(content)){ - applyLog.setContent(applyChangeLogStatus.getInfo().replace("${param}",content)); - }else{ - applyLog.setContent(applyChangeLogStatus.getInfo()); + applyLog.setContent(applyLogType.getInfo().replace("${param}",content)); } - applyLog.setObjType(applyChangeLogStatus.getKey()); + applyLog.setObjType(applyLogType.getKey()); applyLog.setObjId( applyChange.getId()); applyLog.setStatus(applyChange.getStatus()); applyLogMapper.insert(applyLog); @@ -849,7 +859,7 @@ applyChagneDetail.setApplyChangeId(applyChange.getId()); applyChagneDetail.setType(Constants.ONE); - applyChagneDetail.setStartTime(DateUtil.getMontageDate(applyDetail.getStartTime(),1)); + applyChagneDetail.setStartTime(DateUtil.getMontageDate(applyChange.getApplyStartTime(),1)); applyChagneDetail.setEndTime(DateUtil.getMontageDate(applyChange.getApplyStartTime(),3)); applyChagneDetail.setFee( detailFee.multiply(new BigDecimal(-1))); @@ -948,7 +958,7 @@ applyChagneDetail.setCreator(loginUserInfo.getId()); applyChagneDetail.setIsdeleted(Constants.ZERO); applyChagneDetail.setApplyChangeId(applyChange.getId()); - applyChagneDetail.setStartTime(DateUtil.getMontageDate(applyChange.getStartTime(),1)); + applyChagneDetail.setStartTime(DateUtil.getMontageDate(applyChange.getApplyStartTime(),1)); applyChagneDetail.setEndTime(DateUtil.getMontageDate(insuranceApply.getEndTime(),2)); applyChagneDetail.setType(Constants.ZERO); applyChagneDetail.setFee(detailFee); @@ -1124,12 +1134,14 @@ .selectAll(ApplyChange.class) .selectAs(InsuranceApply::getCode,ApplyChange::getApplyCode) .selectAs(Solutions::getName,ApplyChange::getSolutionsName) + .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) .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 2 )",ApplyChange::getChangeNum) .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(Company.class,Company::getId,InsuranceApply::getCompanyId) .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, @@ -1190,7 +1202,7 @@ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈡柟妗堜俊鎭�"); } - Constants.ApplyChangeLogStatus applyChangeLogStatus = Constants.ApplyChangeLogStatus.RETURN_APPLY; + Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_PLATFORM_CHECK_PASS_NO; Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.APPLY_CHANGE; if(applyChange.getType().equals(Constants.ONE)){ @@ -1221,7 +1233,7 @@ }else if(applyChangeOptDTO.getOptType().equals(4)){ - applyChangeLogStatus = Constants.ApplyChangeLogStatus.PLATFORM_AGREE; + applyLogType = Constants.ApplyLogType.CA_PLATFORM_AGREE_BACK_APPLY; //骞冲彴鍚屾剰閫�鍥� if(loginUserInfo.getType().equals(Constants.ZERO)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炲钩鍙扮鐢ㄦ埛鏃犳硶杩涜璇ユ搷浣�"); @@ -1232,7 +1244,7 @@ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏁版嵁鐘舵�侀敊璇棤娉曡繘琛岃鎿嶄綔!"); } }else if(applyChangeOptDTO.getOptType().equals(5)){ - applyChangeLogStatus = Constants.ApplyChangeLogStatus.PLATFORM_UN_AGREE; + applyLogType = Constants.ApplyLogType.CA_PALTFORM_REFUSE_APPLY; //骞冲彴椹冲洖閫�鍥� if(loginUserInfo.getType().equals(Constants.ZERO)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炲钩鍙扮鐢ㄦ埛鏃犳硶杩涜璇ユ搷浣�"); @@ -1249,7 +1261,7 @@ } }else if(applyChangeOptDTO.getOptType().equals(6)){ //浼佷笟鍏抽棴 - applyChangeLogStatus = Constants.ApplyChangeLogStatus.CLOSE; + applyLogType = Constants.ApplyLogType.CA_COMPANY_CLOSE; if(!loginUserInfo.getType().equals(Constants.ONE)){ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闈炰紒涓氱鐢ㄦ埛鏃犳硶杩涜璇ユ搷浣�"); } @@ -1257,7 +1269,6 @@ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏁版嵁鐘舵�侀敊璇棤娉曡繘琛岃鎿嶄綔!"); } applyChange.setStatus(Constants.ApplyChangeStatus.CLOSE.getKey()); - //瀛樺偍寰呭姙淇℃伅 //鍒犻櫎鍏朵粬寰呭姙 @@ -1270,8 +1281,10 @@ applyChange.setEditDate(new Date()); applyChangeMapper.updateById(applyChange); - //瀛樺偍鏃ュ織鏁版嵁 - this.saveApplyLog(applyChange,applyChangeLogStatus,applyChangeOptDTO.getOptIllustration()); + String info = applyLogType.getInfo(); + info = info.replace("${param}", applyChangeOptDTO.getOptIllustration()); + ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null); + applyLogMapper.insert(log); } @@ -1302,6 +1315,7 @@ .selectAs(Company::getName,ApplyLog::getCompanyName) .leftJoin(SystemUser.class,SystemUser::getId,ApplyLog::getCreator) .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) + .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.ONE)) .eq(ApplyLog::getObjId,applyChange.getId()) .orderByAsc(ApplyLog::getCreateDate) ); -- Gitblit v1.9.3