From d7fe8ae3888c8e2b1eea3c1e3769be0d42a21cc9 Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期一, 16 十月 2023 09:03:47 +0800 Subject: [PATCH] Merge branch '1.0.3' of http://139.186.142.91:10010/r/productDev/dmMes into 1.0.3 --- server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java b/server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java index f33817e..a5931f2 100644 --- a/server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java +++ b/server/src/main/java/doumeemes/service/ext/impl/WorkPlansExtServiceImpl.java @@ -33,6 +33,7 @@ import java.math.BigDecimal; import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -175,11 +176,15 @@ i.setFinishUnQualifiedNum(Objects.isNull(plansExtListVO.getUnqulifiedNum())?Constants.ZERO:plansExtListVO.getUnqulifiedNum()); i.setFinishNum(Objects.isNull(plansExtListVO.getDoneNum())?Constants.ZERO:plansExtListVO.getDoneNum()); } - if (Objects.nonNull(i.getPlanDate())){ - i.setHasExpire(DateUtil.toDateLocalDateTime(i.getPlanDate()).toLocalDate().isBefore(LocalDate.now())); - }else { - i.setHasExpire(false); + i.setHasExpire(false); + i.setStatus(Constants.formatIntegerNum(i.getStatus())); + if ( !i.getStatus().equals(Constants.WORKPLANHISTORY_TYPE.done) && + !i.getStatus().equals(Constants.WORKPLANHISTORY_TYPE.close)){ + if (Objects.nonNull(i.getPlanDate())){ + i.setHasExpire(DateUtil.toDateLocalDateTime(i.getPlanDate()).toLocalDate().isBefore(LocalDate.now())); + } } + }); } @@ -380,7 +385,7 @@ if(p.getPlanDate() == null){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝绗��"+(index+2)+"銆戣銆愯鍒掔粨鏉熸棩鏈熴�戞暟鎹敊璇紝姝g‘鏍煎紡涓猴細yyyy-MM-dd锛堝2022-06-07锛夛紒"); } - if(p.getPlanDate().getTime() <= p.getStartDate().getTime()){ + if(p.getPlanDate().getTime() < p.getStartDate().getTime()){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝绗��"+(index+2)+"銆戣銆愯鍒掑紑濮嬫棩鏈熴�戣鏃╀簬銆愯鍒掔粨鏉熸棩鏈熴�戯紒"); } if(StringUtils.isBlank(p.getMaterialCode())){ @@ -393,9 +398,8 @@ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"瀵逛笉璧凤紝绗��"+(index+2)+"銆戣銆愮敓浜ф壒娆°�戞暟鎹敊璇紒"); } - Date pDate = DateUtil.getDateFromString(DateUtil.getShortTime(p.getPlanDate()) +" 00:00:00"); - Date nDate = DateUtil.getDateFromString(DateUtil.getShortTime(DateUtil.getCurrentDate()) +" 00:00:00"); - if( nDate.getTime() > pDate.getTime()){ + LocalDateTime localLocalDateTime = DateUtil.toDateLocalDateTime(p.getStartDate()); + if( localLocalDateTime.toLocalDate().isBefore(LocalDate.now())){ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝璁″垝鐢熶骇鏃ユ湡蹇呴』涓轰粖澶╀互鍚庣殑鏃ユ湡锛�"); } p.setMaterialCode(p.getMaterialCode().trim()); -- Gitblit v1.9.3