From 14cbe4f1e07a9b542176edff4f682fcbc6d5c220 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期日, 04 二月 2024 17:46:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java | 69 +++++++++++++++++++++++-----------
1 files changed, 47 insertions(+), 22 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 2a99876..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,23 +1134,36 @@
.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,
Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey(),
Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey())
- .eq(!Objects.isNull(model.getCompanyId()),InsuranceApply::getCompanyId,model.getCompanyId())
+// .eq(!Objects.isNull(model.getCompanyId()),InsuranceApply::getCompanyId,model.getCompanyId())
// .eq(!Objects.isNull(model.getSolutionsId()),ApplyChange::getSolutionsId,model.getSolutionsId())
.eq(!Objects.isNull(model.getBaseSolutionsId()),Solutions::getBaseId,model.getBaseSolutionsId())
.ge(StringUtils.isNotBlank(model.getCreateDateS()),ApplyChange::getCreateDate, model.getCreateDateS()+" 00:00:00" )
.le(StringUtils.isNotBlank(model.getCreateDateE()),ApplyChange::getCreateDate, model.getCreateDateE()+" 23:59:59" );
-
+ LoginUserInfo loginUserInfo =(LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
+ //浼佷笟浜哄憳鏌ョ湅鏈紒涓氭暟鎹�
+ if(loginUserInfo.getType().equals(Constants.ONE)){
+ queryWrapper.eq(InsuranceApply::getCompanyId, loginUserInfo.getCompanyId());
+ }else{
+ if(loginUserInfo.getCompanyIdList()!=null && loginUserInfo.getCompanyIdList().size()>0){
+ queryWrapper.in(InsuranceApply::getCompanyId, loginUserInfo.getCompanyIdList());
+ }else{
+ queryWrapper.eq(InsuranceApply::getCompanyId, -1);
+ }
+ queryWrapper.eq(pageWrap.getModel().getCompanyId()!=null,InsuranceApply::getCompanyId, pageWrap.getModel().getCompanyId());
+ }
for(PageWrap.SortData sortData: pageWrap.getSorts()) {
if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
queryWrapper.orderByDesc(sortData.getProperty());
@@ -1179,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)){
@@ -1210,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(),"闈炲钩鍙扮鐢ㄦ埛鏃犳硶杩涜璇ユ搷浣�");
@@ -1221,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(),"闈炲钩鍙扮鐢ㄦ埛鏃犳硶杩涜璇ユ搷浣�");
@@ -1238,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(),"闈炰紒涓氱鐢ㄦ埛鏃犳硶杩涜璇ユ搷浣�");
}
@@ -1246,7 +1269,6 @@
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鏁版嵁鐘舵�侀敊璇棤娉曡繘琛岃鎿嶄綔!");
}
applyChange.setStatus(Constants.ApplyChangeStatus.CLOSE.getKey());
-
//瀛樺偍寰呭姙淇℃伅
//鍒犻櫎鍏朵粬寰呭姙
@@ -1259,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);
}
@@ -1291,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