From 4c236ba83da7c69ac838b004d0a4b83c25fc9bea Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期五, 23 二月 2024 16:41:02 +0800
Subject: [PATCH] mrshi
---
server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java | 188 +++++++++++++++++++++++++++++++++++++++-------
1 files changed, 159 insertions(+), 29 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 00a2029..bf1e82b 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
@@ -82,6 +82,9 @@
private MemberInsuranceJoinMapper memberInsuranceJoinMapper;
@Autowired
+ private ApplyChangeDetailJoinMapper applyChangeDetailJoinMapper;
+
+ @Autowired
private MemberMapper memberMapper;
@Autowired
@@ -120,6 +123,7 @@
throw new BusinessException(ResponseStatus.DATA_EMPTY);
}
if(Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.UPLOAD.getKey())
+ ||Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.SIGNATURE.getKey())
||Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.APPROVE.getKey())){
//宸叉彁浜ゅ拰宸插畬鎴愮姸鎬佷笉鏀寔瀹℃牳涓嶉�氳繃
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
@@ -164,6 +168,11 @@
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
}
+ InsuranceApply insuranceApply = insuranceApplyMapper.selectById(model.getApplyId());
+ if(Objects.isNull(insuranceApply)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌淇濆崟淇℃伅");
+ }
+
LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
ApplyChange update = new ApplyChange();
update.setEditDate(new Date());
@@ -175,8 +184,8 @@
update.setCheckUserId(user.getId());
update.setId(model.getId());
update.setValidCode(param.getValidCode());
- update.setApplyStartTime(model.getApplyStartTime());
- applyChangeMapper.updateById(update);
+ update.setApplyStartTime(param.getApplyStartTime());
+ update.setCode(model.getCode());
param.getPidanFile().setIsdeleted(Constants.ZERO);
param.getPidanFile().setCreator(user.getId());
@@ -187,6 +196,8 @@
multifileMapper.insert(param.getPidanFile());
update.setApplyId(model.getApplyId());
+
+
if(Constants.equalsInteger(model.getType(),Constants.ZERO)){
//濡傛灉鏄姞鍑忎繚鐢宠 澶勭悊鍔犲噺淇濇槑缁嗘暟鎹�
dealDetailsValidTime(update);
@@ -194,6 +205,8 @@
//濡傛灉鏄崲鍘傜敵璇� 澶勭悊鏄庣粏鏁版嵁
dealDetailsDUdata(update);
}
+
+ applyChangeMapper.updateById(update);
// if(1==1){
// throw new BusinessException(ResponseStatus.DATA_EMPTY);
@@ -243,6 +256,15 @@
update.setId(model.getId());
update.setValidCode(param.getValidCode());
applyChangeMapper.updateById(update);
+
+ //淇敼鍛樺伐淇濆崟璁板綍
+ memberInsuranceJoinMapper.update(null,new UpdateWrapper<MemberInsurance>()
+ .lambda()
+ .set(MemberInsurance::getPdCode,param.getValidCode())
+ .eq(MemberInsurance::getRelationType,Constants.ONE)
+ .eq(MemberInsurance::getApplyChangeId,model.getId())
+ );
+
//鍒犻櫎鍘熸湁鐨勪繚鍗曚俊鎭�
multifileMapper.delete(new UpdateWrapper<Multifile>().lambda()
.set(Multifile::getIsdeleted,Constants.ZERO)
@@ -278,21 +300,38 @@
.selectAll(ApplyChagneDetail.class)
.selectAs(Solutions::getTimeUnit,ApplyChagneDetail::getSolutionTimeUnit)
.selectAs(Solutions::getPrice,ApplyChagneDetail::getSolutionPrice)
+ .selectAs(Solutions::getName,ApplyChagneDetail::getSolutionsName)
.selectAs(Worktype::getName,ApplyChagneDetail::getWorkTypeName)
.selectAs(DispatchUnit::getName,ApplyChagneDetail::getDuName)
- .leftJoin(ApplyChange.class, ApplyChange::getId, ApplyChagneDetail::getApplyChangeId)
- .leftJoin(InsuranceApply.class, InsuranceApply::getId, ApplyChange::getApplyId)
- .leftJoin(Solutions.class, Solutions::getId, InsuranceApply::getSolutionId)
+ .selectAs(Member::getIdcardNo,ApplyChagneDetail::getIdcardNo)
+ .selectAs(Member::getName, ApplyChagneDetail::getMemberName)
+ .selectAs(InsuranceApply::getCode,ApplyChagneDetail::getApplyCode)
+ .leftJoin(Member.class, Member::getId, ApplyChagneDetail::getMemberId)
+ .leftJoin(ApplyChange.class, ApplyChange::getId, ApplyChagneDetail::getApplyChangeId)
+ .leftJoin(InsuranceApply.class, InsuranceApply::getId, ApplyChange::getApplyId)
+ .leftJoin(Solutions.class, Solutions::getId, InsuranceApply::getSolutionId)
.leftJoin(Worktype.class,Worktype::getId,ApplyChagneDetail::getWorktypeId)
.leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyChagneDetail::getDuId)
.eq(ApplyChagneDetail::getApplyChangeId,update.getId())
.eq(ApplyChagneDetail::getIsdeleted,Constants.ZERO) );
+
if(detailList ==null || detailList.size()==0){
return;
}
//瀹為檯鎵瑰崟鐢熸晥鏃ユ湡
Date applyStartTime = DateUtil.getMontageDate(update.getApplyStartTime(),1);
for(ApplyChagneDetail detail : detailList){
+ //鏌ヨ鍑忎繚浜哄憳鏄惁瀛樺湪 鍐茬獊鐨� 淇濆崟鏄庣粏鏁版嵁
+ if(applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>()
+ .lambda()
+ .eq(ApplyDetail::getApplyId,update.getApplyId())
+ .eq(ApplyDetail::getIdcardNo,detail.getIdcardNo())
+ .le(ApplyDetail::getStartTime,applyStartTime)
+ .ge(ApplyDetail::getEndTime,applyStartTime)
+ )<=Constants.ZERO){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "褰撳墠淇濆崟涓嬶紝鎹㈠巶浜哄憳銆�" + detail.getMemberName() + "銆戞湭鏌ヨ鍒扮鍚堟壒鍗曟棩鏈熺殑鏁版嵁");
+ }
+
//鏌ヨ鍛樺伐鏄湪涓诲崟涓� 鏄惁瀛樺湪鐢熸晥涓殑鏁版嵁
ApplyDetail oldModel = applyDetailJoinMapper.selectOne(new QueryWrapper<ApplyDetail>().lambda()
.eq(ApplyDetail::getApplyId, update.getApplyId())
@@ -337,12 +376,16 @@
applyDetail.setCreateDate(new Date());
applyDetail.setCreator(update.getEditor());
applyDetail.setMemberId(oldModel.getMemberId());
+ applyDetail.setIdcardNo(detail.getIdcardNo());
+ applyDetail.setSex(Constants.getSexByIdCard(detail.getIdcardNo()));
+ applyDetail.setMemberName(detail.getMemberName());
applyDetail.setStartTime(DateUtil.getMontageDate(update.getApplyStartTime(),1));
applyDetail.setEndTime(endDate);
applyDetail.setDuId(detail.getDuId());
applyDetail.setWorktypeId(detail.getWorktypeId());
applyDetail.setIdcardNo(oldModel.getIdcardNo());
applyDetail.setFee(fee.subtract(oldFee));
+ applyDetail.setIsdeleted(Constants.ZERO);
if(flag){
applyDetail.setCurrentFee(oldCurrentFee.multiply(oldFee));
}else{
@@ -354,6 +397,7 @@
applyDetailJoinMapper.insert(applyDetail);
MemberInsurance memberInsurance = new MemberInsurance(applyDetail,update.getId());
+ memberInsurance.setRelationType(Constants.ONE);
memberInsuranceJoinMapper.insert(memberInsurance);
}else{
@@ -385,6 +429,11 @@
member.setStartTime(detail.getStartTime());
member.setEndTime(detail.getEndTime());
memberMapper.updateById(member);
+
+ applyChangeDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda()
+ .set(ApplyChagneDetail::getStartTime,DateUtil.getMontageDate(update.getApplyStartTime(), 1))
+ .eq(ApplyChagneDetail::getId,detail.getId())
+ );
}
}
/**
@@ -395,11 +444,16 @@
List<ApplyChagneDetail> detailList = applyChagneDetailJoinMapper.selectJoinList(ApplyChagneDetail.class,
new MPJLambdaWrapper<ApplyChagneDetail>()
.selectAll(ApplyChagneDetail.class)
+ .selectAs(Member::getIdcardNo,ApplyChagneDetail::getIdcardNo)
.selectAs(Solutions::getTimeUnit, ApplyChagneDetail::getSolutionTimeUnit)
.selectAs(Solutions::getPrice, ApplyChagneDetail::getSolutionPrice)
.selectAs(Worktype::getName, ApplyChagneDetail::getWorkTypeName)
.selectAs(DispatchUnit::getName, ApplyChagneDetail::getDuName)
+ .selectAs(Member::getName, ApplyChagneDetail::getMemberName)
+ .selectAs(Solutions::getName,ApplyChagneDetail::getSolutionsName)
+ .selectAs(InsuranceApply::getCode,ApplyChagneDetail::getApplyCode)
.leftJoin(ApplyChange.class, ApplyChange::getId, ApplyChagneDetail::getApplyChangeId)
+ .leftJoin(Member.class, Member::getId, ApplyChagneDetail::getMemberId)
.leftJoin(InsuranceApply.class, InsuranceApply::getId, ApplyChange::getApplyId)
.leftJoin(Solutions.class, Solutions::getId, InsuranceApply::getSolutionId)
.leftJoin(Worktype.class, Worktype::getId, ApplyChagneDetail::getWorktypeId)
@@ -416,7 +470,6 @@
//鎶曚繚璁板綍 鍔犱繚鏁版嵁鍔犲叆鏂版暟鎹� 鍑忎繚鏁版嵁 淇敼鑰佹暟鎹�
List<MemberInsurance> memberInsuranceList = new ArrayList<>();
-
//鍔犱繚涓氬姟 浣跨敤鐨勫姞淇濋噾棰�
ApplyChangeCyclePriceDTO applyChangeCyclePriceDTO_add = new ApplyChangeCyclePriceDTO();
applyChangeCyclePriceDTO_add.setApplyId(update.getApplyId());
@@ -432,6 +485,19 @@
throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"鏈煡璇㈠埌鍛樺伐鏁版嵁");
}
if (Constants.equalsInteger(detail.getType(), Constants.ZERO)) {
+
+ //鏌ヨ鍔犱繚浜哄憳鏄惁瀛樺湪 鍐茬獊鐨� 淇濆崟鏄庣粏鏁版嵁
+ if(applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>()
+ .lambda()
+ .eq(ApplyDetail::getApplyId,update.getApplyId())
+ .eq(ApplyDetail::getIdcardNo,detail.getIdcardNo())
+ .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(update.getApplyStartTime(),1))
+ .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(detail.getEndTime(),2))
+ )>Constants.ZERO){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "褰撳墠淇濆崟涓嬶紝鍔犱繚浜哄憳銆�" + detail.getMemberName() + "銆戝瓨鍦ㄦ棩鏈熷啿绐佺殑鏁版嵁");
+ }
+
+
//鍔犱繚
ApplyDetail add = new ApplyDetail();
add.setApplyId(update.getApplyId());
@@ -443,9 +509,12 @@
add.setMemberId(detail.getMemberId());
add.setMemberName(detail.getMemberName());
add.setWorktypeId(detail.getWorktypeId());
+ add.setIsdeleted(Constants.ZERO);
+ add.setIdcardNo(detail.getIdcardNo());
+ add.setSex(Constants.getSexByIdCard(detail.getIdcardNo()));
+ add.setMemberName(detail.getMemberName());
add.setDuId(detail.getDuId());
add.setStartTime(update.getApplyStartTime());
- add.setEndTime(detail.getEndTime());
add.setStartTime(DateUtil.getMontageDate(update.getApplyStartTime(), 1));
add.setEndTime(DateUtil.getMontageDate(detail.getEndTime(), 2));
add.setFee(countCyclePriceVO_add.getCyclePrice());
@@ -463,7 +532,15 @@
currentFee = currentFee.add(add.getCurrentFee());
MemberInsurance memberInsurance = new MemberInsurance(detail, update, update.getEditor(), add.getId());
+ memberInsurance.setRelationType(Constants.ONE);
memberInsuranceList.add(memberInsurance);
+
+ applyChangeDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda()
+ .set(ApplyChagneDetail::getFee,add.getFee())
+ .set(ApplyChagneDetail::getStartTime,DateUtil.getMontageDate(update.getApplyStartTime(), 1))
+ .eq(ApplyChagneDetail::getId,detail.getId())
+ );
+
} else {
//鍑忎繚鎿嶄綔
//鏌ヨ鍛樺伐鏄湪涓诲崟涓� 鏄惁瀛樺湪鐢熸晥涓殑鏁版嵁
@@ -507,6 +584,14 @@
.set(MemberInsurance::getEndTime, update.getApplyStartTime())
.eq(MemberInsurance::getRelationId, oldModel.getId())
);
+
+ //淇敼涓氬姟鏄庣粏琛屾暟鎹疄闄呮壒鍗曟棩鏈�
+ applyChangeDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda()
+ .set(ApplyChagneDetail::getFee,updateFee)
+ .set(ApplyChagneDetail::getEndTime,DateUtil.getMontageDate(update.getApplyStartTime(), 3))
+ .eq(ApplyChagneDetail::getId,detail.getId())
+ );
+
}
member.setApplyId(update.getApplyId());
@@ -529,6 +614,9 @@
.set(InsuranceApply::getEditDate, update.getEditDate())
.eq(InsuranceApply::getId, update.getApplyId())
);
+
+ update.setFee(totalFee);
+
}
}
@@ -568,7 +656,9 @@
Constants.NoticeType noticeType = Constants.NoticeType.FOUR;
if(param.getDealBackApply() ==1){
//濡傛灉鏄┏鍥�,鍙兘鍙┏鍥炲凡绛剧珷鐘舵�佷笅鐨勯��鍥炵敵璇风姸鎬佽繘琛屾搷浣�
- if(!Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey())){
+ if(!(Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.RETURN_APPLY_SIGNATURE.getKey())
+ ||Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.RETURN_APPLY_UPLOAD.getKey()))
+ ){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧凤紝璇ョ敵璇风姸鎬佸凡娴佽浆锛屽綋鍓嶄笉鏀寔璇ユ搷浣渵");
}
applyLogType = Constants.ApplyLogType.CA_PALTFORM_REFUSE_APPLY;
@@ -647,7 +737,7 @@
}
CompanySolution companySolution = companySolutionMapper.selectOne(new QueryWrapper<CompanySolution>().lambda()
.eq(CompanySolution::getCompanyId,loginUserInfo.getCompanyId())
- .eq(CompanySolution::getSolutionId,solutions.getId())
+ .eq(CompanySolution::getSolutionBaseId,solutions.getBaseId())
.eq(CompanySolution::getIsdeleted,Constants.ZERO)
.last(" limit 1 ")
);
@@ -684,12 +774,6 @@
applyChangeFee.setId(applyChange.getId());
applyChangeFee.setFee(fee);
applyChangeMapper.updateById(applyChangeFee);
-
-// if(1==1){
-// throw new BusinessException(ResponseStatus.DATA_EMPTY);
-// }
-
-
Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_COMPANY_COMMIT;
String info =applyLogType.getInfo();
@@ -801,7 +885,7 @@
.eq(DispatchUnit::getUnitStatus,Constants.ONE)
.eq(DuSolution::getIsdeleted,Constants.ZERO)
.eq(DuSolution::getStatus,Constants.ONE)
- .eq(DuSolution::getSolutionId,insuranceApply.getSolutionId()));
+ .eq(DuSolution::getSolutionId,companySolution.getSolutionId()));
if(!CollectionUtils.isNotEmpty(duSolutionList)){
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"鏁版嵁寮傚父锛氫繚闄╂柟妗堜笅鏈煡璇㈠埌娲鹃仯鍗曚綅");
}
@@ -887,6 +971,18 @@
if (Objects.isNull(applyChagneDetail.getMemberId())) {
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鍑忎繚浜哄憳銆�" + applyChagneDetail.getMemberName() + "銆戝繀濉」缂哄け");
}
+
+ //鏌ヨ鍑忎繚浜哄憳鏄惁瀛樺湪 鍐茬獊鐨� 淇濆崟鏄庣粏鏁版嵁
+ if(applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>()
+ .lambda()
+ .eq(ApplyDetail::getApplyId,applyChange.getApplyId())
+ .eq(ApplyDetail::getIdcardNo,applyChagneDetail.getIdcardNo())
+ .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),1))
+ .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),3))
+ )<=Constants.ZERO){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "褰撳墠淇濆崟涓嬶紝鍑忎繚浜哄憳銆�" + applyChagneDetail.getMemberName() + "銆戞湭鏌ヨ鍒扮鍚堟壒鍗曟棩鏈熺殑鏁版嵁");
+ }
+
Member member = memberMapper.selectById(applyChagneDetail.getMemberId());
if (Objects.isNull(member)) {
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鍑忎繚浜哄憳銆�" + applyChagneDetail.getMemberName() + "銆戞湭鏌ヨ鍒扮郴缁熶汉鍛樹俊鎭�");
@@ -905,6 +1001,8 @@
List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectList(new QueryWrapper<ApplyDetail>().lambda()
.eq(ApplyDetail::getApplyId, applyChange.getApplyId())
.eq(ApplyDetail::getMemberId, applyChagneDetail.getMemberId())
+ .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),1))
+ .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),3))
.orderByDesc(ApplyDetail::getCreateDate));
if (applyDetailList.size() > Constants.ONE) {
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鍑忎繚浜哄憳銆�" + applyChagneDetail.getMemberName() + "銆戜繚鍗曚俊鎭紓甯革紝瀛樺湪澶氭潯鏁版嵁");
@@ -944,13 +1042,26 @@
* @param duSolutionList
* @param loginUserInfo
*/
- public void addChangeDetail(ApplyChange applyChange ,List<ApplyChagneDetail> addDetailList,List<DuWorktype> duWorktypeList,List<DuSolution> duSolutionList,InsuranceApply insuranceApply,Solutions solutions,LoginUserInfo loginUserInfo,BigDecimal detailFee){
+ public void addChangeDetail(ApplyChange applyChange ,List<ApplyChagneDetail> addDetailList,
+ List<DuWorktype> duWorktypeList,List<DuSolution> duSolutionList,
+ InsuranceApply insuranceApply,Solutions solutions,LoginUserInfo loginUserInfo,BigDecimal detailFee){
for (ApplyChagneDetail applyChagneDetail : addDetailList) {
if ( Objects.isNull(applyChagneDetail.getDuId())
|| Objects.isNull(applyChagneDetail.getWorktypeId())
|| StringUtils.isBlank(applyChagneDetail.getIdcardNo())
) {
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鍔犱繚浜哄憳銆�" + applyChagneDetail.getMemberName() + "銆戝繀濉」缂哄け");
+ }
+ //鏌ヨ鍔犱繚浜哄憳鏄惁瀛樺湪 鍐茬獊鐨� 淇濆崟鏄庣粏鏁版嵁
+ if(applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>()
+ .lambda()
+ .eq(ApplyDetail::getApplyId,applyChange.getApplyId())
+ .eq(ApplyDetail::getIdcardNo,applyChagneDetail.getIdcardNo())
+ .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),1))
+ .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(insuranceApply.getEndTime(),2))
+ //.ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),3))
+ )>Constants.ZERO){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "褰撳墠淇濆崟涓嬶紝鍔犱繚浜哄憳銆�" + applyChagneDetail.getMemberName() + "銆戝瓨鍦ㄦ棩鏈熷啿绐佺殑鏁版嵁");
}
applyChagneDetail.setCreateDate(new Date());
@@ -1069,6 +1180,18 @@
) {
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鎹㈠巶浜哄憳銆�" + applyChagneDetail.getMemberName() + "銆戝繀濉」缂哄け");
}
+
+ //鏌ヨ鎹㈠巶浜哄憳鏄惁瀛樺湪 鏈夋晥鐨勪繚鍗曟槑缁嗘暟鎹�
+ if(applyDetailJoinMapper.selectCount(new QueryWrapper<ApplyDetail>()
+ .lambda()
+ .eq(ApplyDetail::getApplyId,applyChange.getApplyId())
+ .eq(ApplyDetail::getIdcardNo,applyChagneDetail.getIdcardNo())
+ .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),1))
+ .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),1))
+ )<=Constants.ZERO){
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "褰撳墠淇濆崟涓嬶紝鎹㈠巶浜哄憳銆�" + applyChagneDetail.getMemberName() + "銆戞湭鏌ヨ鍒扮鍚堟壒鍗曟棩鏈熺殑鏁版嵁");
+ }
+
Member member = memberMapper.selectById(applyChagneDetail.getMemberId());
if (Objects.isNull(member)) {
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鎹㈠巶浜哄憳銆�" + applyChagneDetail.getMemberName() + "銆戞湭鏌ヨ鍒扮郴缁熶汉鍛樹俊鎭�");
@@ -1087,7 +1210,8 @@
List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectList(new QueryWrapper<ApplyDetail>().lambda()
.eq(ApplyDetail::getApplyId, applyChange.getApplyId())
.eq(ApplyDetail::getMemberId, applyChagneDetail.getMemberId())
- .ge(ApplyDetail::getEndTime, new Date()));
+ .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),1))
+ .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),1)));
if(applyDetailList.size()>Constants.ONE){
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鎹㈠巶浜哄憳銆�" + applyChagneDetail.getMemberName() + "銆戜繚鍗曚俊鎭紓甯革紝瀛樺湪澶氭潯鏁版嵁");
}else if(applyDetailList.size()==Constants.ZERO){
@@ -1249,6 +1373,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.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" )
.le(StringUtils.isNotBlank(model.getCreateDateE()),ApplyChange::getCreateDate, model.getCreateDateE()+" 23:59:59" );
@@ -1264,13 +1389,16 @@
}
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());
- } else {
- queryWrapper.orderByAsc(sortData.getProperty());
- }
- }
+
+ queryWrapper.orderByDesc(ApplyDetail::getCreateDate);
+
+// for(PageWrap.SortData sortData: pageWrap.getSorts()) {
+// if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
+// queryWrapper.orderByDesc(sortData.getProperty());
+// } else {
+// queryWrapper.orderByAsc(sortData.getProperty());
+// }
+// }
PageData<ApplyChange> pageData = PageData.from(applyChangeJoinMapper.selectJoinPage(page,ApplyChange.class, queryWrapper));
return pageData;
}
@@ -1328,7 +1456,7 @@
//鍒犻櫎鍏朵粬寰呭姙
noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()).eq(Notices::getObjId,applyChange.getId()));
Notices notices = new Notices(noticeObjectType,Constants.ZERO,applyChange.getId(),solutions.getName(),
- applyChange.getCompanyId(), Constants.NoticeType.THREE);
+ insuranceApply.getCompanyId(), Constants.NoticeType.THREE);
noticesMapper.insert(notices);
@@ -1382,7 +1510,9 @@
applyChangeMapper.updateById(applyChange);
String info = applyLogType.getInfo();
- info = info.replace("${param}", applyChangeOptDTO.getOptIllustration());
+ if(StringUtils.isNotBlank(applyChangeOptDTO.getOptIllustration())){
+ info = info.replace("${param}", applyChangeOptDTO.getOptIllustration());
+ }
ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null);
applyLogMapper.insert(log);
}
@@ -1579,7 +1709,7 @@
.selectAs(InsuranceApply::getCompanyId,ApplyChange::getCompanyId)
.selectAs(InsuranceApply::getCode,ApplyChange::getApplyCode)
.selectAs(InsuranceApply::getStartTime,ApplyChange::getStartTime)
- .selectAs(InsuranceApply::getStartTime,ApplyChange::getEndTime)
+ .selectAs(InsuranceApply::getEndTime,ApplyChange::getEndTime)
.leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId)
.leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
.leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId)
@@ -1666,7 +1796,7 @@
BigDecimal sumPrice = countCyclePriceVO.getCyclePrice();
CountCyclePriceVO returnCountCyclePriceVO = new CountCyclePriceVO();
//鍔犲噺淇濋噾棰�
- returnCountCyclePriceVO.setCyclePrice(sumPrice.divide(new BigDecimal(sumDays),2, RoundingMode.HALF_UP).multiply(new BigDecimal(optDays)));
+ returnCountCyclePriceVO.setCyclePrice(sumPrice.multiply(new BigDecimal(optDays)).divide(new BigDecimal(sumDays),2, RoundingMode.HALF_UP));
return returnCountCyclePriceVO;
}
--
Gitblit v1.9.3