From 4cb17b2019008ea2df010ba022db7e93b438831f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 21 六月 2024 16:09:43 +0800
Subject: [PATCH] 提交一把
---
server/service/src/main/java/com/doumee/service/business/impl/ApplyChangeServiceImpl.java | 94 +++++++++++++++++++++++------------------------
1 files changed, 46 insertions(+), 48 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 1b8848e..3759e76 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
@@ -1038,13 +1038,15 @@
}
if (!(Constants.equalsInteger(insuranceApply.getStatus(), Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())
||Constants.equalsInteger(insuranceApply.getStatus(), Constants.InsuranceApplyStatus.WTB_DONE.getKey())
- )
- ) {
+ )) {
throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(), "淇濆崟鐘舵�侀敊璇�");
}
- if (DateUtil.compareDate(insuranceApply.getEndTime(),new Date()) >= Constants.ZERO
- ) {
+ if (DateUtil.compareDate(insuranceApply.getEndTime(),new Date()) >= Constants.ZERO ) {
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "淇濆崟宸茶繃淇濓紝鏃犳硶杩涜璇ユ搷浣�");
+ }
+ if (DateUtil.compareDate(applyChange.getValidTime(),insuranceApply.getStartTime()) >= Constants.ZERO) {
+ //濡傛灉淇濆崟灏氭湭鐢熸晥锛岃缃湡鏈涚敓鏁堟棩鏈熶负淇濆崟鐢熸晥寮�濮嬫椂闂�
+ applyChange.setValidTime(insuranceApply.getStartTime());
}
Solutions solutions = solutionsMapper.selectById(insuranceApply.getSolutionId());
if(Objects.isNull(solutions)){
@@ -1086,30 +1088,10 @@
applyChange.setIsdeleted(Constants.ZERO);
//鏍规嵁鐢宠鏃ユ湡 澶勭悊鍔犲噺淇濈殑 瀹為檯鐢熸晥鏃ユ湡
if(applyChange.getType().equals(Constants.ZERO)){
- if(Objects.nonNull(solutions.getAddValidDays())){
- applyChange.setApplyStartTime(
- DateUtil.afterDateByType(applyChange.getValidTime(),0,solutions.getAddValidDays())
- );
- }else{
- applyChange.setApplyStartTime(applyChange.getValidTime());
- }
- if(Objects.nonNull(solutions.getDelValidDays())){
- applyChange.setDelValidTime(
- DateUtil.afterDateByType(applyChange.getValidTime(),0,solutions.getDelValidDays())
- );
- }else{
- applyChange.setDelValidTime(applyChange.getValidTime());
- }
- //浠呮敮鎸佹浛鎹� 淇濊瘉鍔犲噺淇濇棩鏈熶负鍚屼竴澶�
- if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE)){
- applyChange.setApplyStartTime(
- applyChange.getDelValidTime()
- );
- }
+ initJJBValidTime(applyChange,insuranceApply,solutions);
}else{
applyChange.setApplyStartTime(applyChange.getValidTime());
}
-
applyChange.setStatus(Constants.ZERO);
applyChangeMapper.insert(applyChange);
@@ -1137,13 +1119,17 @@
@Override
@Transactional(rollbackFor = {Exception.class,BusinessException.class})
public Integer update(ApplyChange applyChange) {
+ if(applyChange.getType().equals(Constants.ZERO)){
+ //2024骞�5鏈�9鏃�14:59:24 淇敼 榛樿鍏ュ綋鍓嶅ぉ
+ applyChange.setValidTime(DateUtil.getMontageDate(new Date(),1));
+ }
if (Objects.isNull(applyChange)
|| Objects.isNull(applyChange.getId())
|| Objects.isNull(applyChange.getApplyId())
- || Objects.isNull(applyChange.getValidTime())
+// || Objects.isNull(applyChange.getValidTime())
|| Objects.isNull(applyChange.getType())
|| !(applyChange.getType().equals(Constants.ZERO) || applyChange.getType().equals(Constants.ONE))
- ) {
+ ){
throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
@@ -1172,6 +1158,9 @@
if (DateUtil.compareDate(insuranceApply.getEndTime(),new Date()) >= Constants.ZERO
) {
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "淇濆崟宸茶繃淇濓紝鏃犳硶杩涜璇ユ搷浣�");
+ }
+ if (DateUtil.compareDate(applyChange.getValidTime(),insuranceApply.getStartTime()) > Constants.ZERO) {
+ applyChange.setValidTime(insuranceApply.getStartTime());
}
Solutions solutions = solutionsMapper.selectById(insuranceApply.getSolutionId());
if(Objects.isNull(solutions)){
@@ -1207,27 +1196,8 @@
};
if(applyChange.getType().equals(Constants.ZERO)){
- if(Objects.nonNull(solutions.getAddValidDays())){
- applyChange.setApplyStartTime(
- DateUtil.afterDateByType(applyChange.getValidTime(),0,solutions.getAddValidDays())
- );
- }else{
- applyChange.setApplyStartTime(applyChange.getValidTime());
- }
- if(Objects.nonNull(solutions.getDelValidDays())){
- applyChange.setDelValidTime(
- DateUtil.afterDateByType(applyChange.getValidTime(),0,solutions.getDelValidDays())
- );
- }else{
- applyChange.setDelValidTime(applyChange.getValidTime());
- }
- //浠呮敮鎸佹浛鎹� 淇濊瘉鍔犲噺淇濇棩鏈熶负鍚屼竴澶�
- if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE)){
- applyChange.setApplyStartTime(
- applyChange.getDelValidTime()
- );
- }
-
+ //澶勭悊鏈熸湜鐢熸晥鏃ユ湡
+ initJJBValidTime(applyChange,insuranceApply,solutions);
}else{
applyChange.setApplyStartTime(applyChange.getValidTime());
}
@@ -1257,6 +1227,34 @@
return applyChange.getId();
}
+ private void initJJBValidTime(ApplyChange applyChange, InsuranceApply insuranceApply, Solutions solutions) {
+ if( applyChange.getValidTime().getTime()>=insuranceApply.getStartTime().getTime()
+ && Objects.nonNull(solutions.getAddValidDays())){
+ //濡傛灉淇濆崟宸茬敓鏁堬紝鎸夌収t+n鐨勮鍒�
+ applyChange.setApplyStartTime(
+ DateUtil.afterDateByType(applyChange.getValidTime(),0,solutions.getAddValidDays())
+ );
+ }else{
+ //濡傛灉淇濆崟鏈敓鎴栬�呮病鏈夐厤缃敓鏁堝ぉ鏁帮紝璁剧疆鏈熸湜鐢熸晥鏃ユ湡涓轰繚鍗曠敓鏁堝紑濮嬫椂闂�
+ applyChange.setApplyStartTime(applyChange.getValidTime());
+ }
+ if(applyChange.getValidTime().getTime()>=insuranceApply.getStartTime().getTime()
+ &&Objects.nonNull(solutions.getDelValidDays())){
+ applyChange.setDelValidTime(
+ DateUtil.afterDateByType(applyChange.getValidTime(),0,solutions.getDelValidDays())
+ );
+ }else{
+ applyChange.setDelValidTime(applyChange.getValidTime());
+ }
+ //浠呮敮鎸佹浛鎹� 淇濊瘉鍔犲噺淇濇棩鏈熶负鍚屼竴澶�
+ if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE)){
+ applyChange.setApplyStartTime(
+ applyChange.getDelValidTime()
+ );
+ }
+
+ }
+
public BigDecimal dealApplyChangeData(ApplyChange applyChange,InsuranceApply insuranceApply
,CompanySolution companySolution,Solutions solutions,LoginUserInfo loginUserInfo,BigDecimal fee){
--
Gitblit v1.9.3