From eb4335eb25d8235ef2048c91181d004c27192688 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 18 六月 2024 18:17:09 +0800
Subject: [PATCH] 提交一把
---
server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java | 51 +++++++++++++++++++++++----------------------------
1 files changed, 23 insertions(+), 28 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 d581e01..4a5ac91 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
@@ -881,10 +881,10 @@
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌浼佷笟鍒嗛厤淇濋櫓鏂规淇℃伅");
}
//鐢宠鏃堕棿蹇呴』澶勪簬淇濆崟鐨勬椂闂磋寖鍥村唴
- if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChange.getValidTime()) >= Constants.ZERO
- && DateUtil.compareDate( applyChange.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) {
- throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "鐢宠鏃ユ湡鏈浜庝繚鍗曟棩鏈熷唴锛屾棤娉曡繘琛岃鎿嶄綔");
- }
+// if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChange.getValidTime()) >= Constants.ZERO
+// && DateUtil.compareDate( applyChange.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) {
+// throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "鐢宠鏃ユ湡鏈浜庝繚鍗曟棩鏈熷唴锛屾棤娉曡繘琛岃鎿嶄綔");
+// }
//鏌ヨ淇濆崟涓嬫槸鍚﹀瓨鍦ㄨ繘琛屼腑鐨勫姞鍑忎繚/鎹㈠巶鍗曟嵁
if(applyChangeMapper.selectCount(new QueryWrapper<ApplyChange>().lambda()
.eq(ApplyChange::getApplyId,insuranceApply.getId())
@@ -1002,10 +1002,10 @@
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌浼佷笟鍒嗛厤淇濋櫓鏂规淇℃伅");
}
//鐢宠鏃堕棿蹇呴』澶勪簬淇濆崟鐨勬椂闂磋寖鍥村唴
- if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChange.getValidTime()) >= Constants.ZERO
- && DateUtil.compareDate( applyChange.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) {
- throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "鐢宠鏃ユ湡鏈浜庝繚鍗曟棩鏈熷唴锛屾棤娉曡繘琛岃鎿嶄綔");
- }
+// if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChange.getValidTime()) >= Constants.ZERO
+// && DateUtil.compareDate( applyChange.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) {
+// throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "鐢宠鏃ユ湡鏈浜庝繚鍗曟棩鏈熷唴锛屾棤娉曡繘琛岃鎿嶄綔");
+// }
//鏌ヨ淇濆崟涓嬫槸鍚﹀瓨鍦ㄨ繘琛屼腑鐨勫姞鍑忎繚/鎹㈠巶鍗曟嵁
if(applyChangeMapper.selectCount(new QueryWrapper<ApplyChange>().lambda()
.eq(ApplyChange::getApplyId,insuranceApply.getId())
@@ -1042,8 +1042,11 @@
public BigDecimal dealApplyChangeData(ApplyChange applyChange,InsuranceApply insuranceApply,CompanySolution companySolution,Solutions solutions,LoginUserInfo loginUserInfo,BigDecimal fee){
-
-
+ if(Objects.nonNull(solutions.getDelOnlyReplace())&& solutions.getDelOnlyReplace().equals(Constants.ONE)){
+ if(applyChange.getDelDetailList().size() > applyChange.getAddDetailList().size()){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "璇ヤ繚闄╂柟妗堜粎鏀寔鏇挎崲锛堝噺淇濅汉鏁颁笉寰楀ぇ浜庡姞淇濅汉鏁帮級");
+ }
+ }
//鏌ヨ淇濋櫓鏂规涓嬬殑鎵�鏈夋淳閬e崟浣�
List<DuSolution> duSolutionList = duSolutionJoinMapper.selectJoinList(DuSolution.class,new MPJLambdaWrapper<DuSolution>()
.selectAll(DuSolution.class)
@@ -1057,7 +1060,6 @@
if(!CollectionUtils.isNotEmpty(duSolutionList)){
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鏁版嵁寮傚父锛氫繚闄╂柟妗堜笅鏈煡璇㈠埌娲鹃仯鍗曚綅");
}
-
//鏌ヨ鎵�鏈夋淳閬e崟浣嶄笅鐨勫伐绉�
List<Integer> duSolutionIdList = duSolutionList.stream().map(i->i.getId()).collect(Collectors.toList());
List<DuWorktype> duWorktypeList = duWorktypeMapper.selectList(new QueryWrapper<DuWorktype>().lambda()
@@ -1070,17 +1072,15 @@
ApplyChangeCyclePriceDTO applyChangeCyclePriceDTO = new ApplyChangeCyclePriceDTO();
applyChangeCyclePriceDTO.setApplyId(insuranceApply.getId());
+
+
//鍔犱繚鏁版嵁
List<ApplyChagneDetail> addDetailList = applyChange.getAddDetailList();
- Integer addDetailSize = 0 ;
+
if (CollectionUtils.isNotEmpty(addDetailList)) {
- addDetailSize = addDetailList.size();
if(Objects.isNull(solutions.getCanAdd()) || solutions.getCanAdd().equals(Constants.ZERO)){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "璇ヤ繚闄╂柟妗堟棤娉曡繘琛屽姞淇�");
}
-// if(companySolution.getCanAdd().equals(Constants.ZERO)){
-// throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "璇ヤ紒涓氬垎閰嶄繚闄╂柟妗堟棤娉曡繘琛屽姞淇�");
-// }
//楠岃瘉鏄惁瀛樺湪閲嶅鏁版嵁
List<String> idcarNo = addDetailList.stream().map(m->m.getIdcardNo()).collect(Collectors.toList());
Set<String> set = new HashSet<>(idcarNo);
@@ -1104,9 +1104,7 @@
//鍑忎繚鏁版嵁
List<ApplyChagneDetail> delDetailList = applyChange.getDelDetailList();
- Integer delDetailSize = 0 ;
if (CollectionUtils.isNotEmpty(delDetailList)) {
- delDetailSize = delDetailList.size() ;
//楠岃瘉鏄惁瀛樺湪閲嶅鏁版嵁
List<String> idcarNo = delDetailList.stream().map(m->m.getIdcardNo()).collect(Collectors.toList());
Set<String> set = new HashSet<>(idcarNo);
@@ -1121,11 +1119,7 @@
fee = fee.add(delDetailList.stream().map(ApplyChagneDetail::getFee).reduce(BigDecimal.ZERO,BigDecimal::add));
}
- if(Objects.nonNull(solutions.getDelOnlyReplace())&& solutions.getDelOnlyReplace().equals(Constants.ONE)){
- if(delDetailSize > addDetailSize){
- throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "璇ヤ繚闄╂柟妗堜粎鏀寔鏇挎崲锛堝噺淇濅汉鏁颁笉寰楀ぇ浜庡姞淇濅汉鏁帮級");
- }
- }
+
//鎹㈠巶涓氬姟
List<ApplyChagneDetail> changeDetailList = applyChange.getChangeDetailList();
@@ -1222,7 +1216,7 @@
applyChagneDetail.setIsdeleted(Constants.ZERO);
applyChagneDetail.setApplyChangeId(applyChange.getId());
applyChagneDetail.setType(Constants.ONE);
-
+ applyChagneDetail.setApplyDetailId(applyDetail.getId());
applyChagneDetail.setStartTime(applyDetail.getStartTime());
applyChagneDetail.setEndTime(endTime);
@@ -1235,6 +1229,7 @@
//鏌ヨ鍑忎繚鏃ユ湡
// Integer delDays = DateUtil.daysBetweenDates(applyDetail.getEndTime(),endTime);
// ;
+ //鏌ヨ鍛ㄦ湡鏁伴噺
applyChagneDetail.setFee(
Constants.reduceFee(solutions,
Objects.isNull(insuranceApply.getServerCost())?
@@ -2144,10 +2139,10 @@
}
//鏍规嵁鎵瑰崟鏃ユ湡 鍜� 缁撴潫鏃ユ湡 璁$畻閲戦
//楠岃瘉鎵瑰崟鏃ユ湡鏄惁鍦ㄥ綋鍓嶆棩鏈熷悗 涓� 鍦ㄤ繚鍗曠粨鏉熸棩鏈熷墠 鐢宠鏃堕棿蹇呴』澶勪簬淇濆崟鐨勬椂闂磋寖鍥村唴
- if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChangeCyclePriceDTO.getValidTime()) >= Constants.ZERO
- && DateUtil.compareDate( applyChangeCyclePriceDTO.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) {
- throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "鐢宠鏃ユ湡鏈浜庝繚鍗曟棩鏈熷唴锛屾棤娉曡繘琛岃鎿嶄綔");
- }
+// if (!(DateUtil.compareDate( insuranceApply.getStartTime(),applyChangeCyclePriceDTO.getValidTime()) >= Constants.ZERO
+// && DateUtil.compareDate( applyChangeCyclePriceDTO.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) {
+// throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "鐢宠鏃ユ湡鏈浜庝繚鍗曟棩鏈熷唴锛屾棤娉曡繘琛岃鎿嶄綔");
+// }
BigDecimal sumPrice = Objects.isNull(insuranceApply.getServerCost())?solutions.getPrice():solutions.getPrice().add(insuranceApply.getServerCost());
CountCyclePriceVO returnCountCyclePriceVO = new CountCyclePriceVO();
returnCountCyclePriceVO.setCyclePrice(Constants.addFee(solutions,
--
Gitblit v1.9.3