buzhanyi пре 2 година
родитељ
комит
e26445aa47

+ 184 - 182
purchase-admin/src/main/java/com/ozs/web/controller/pm/PmPurchaseExecutionController.java

@@ -111,14 +111,14 @@ public class PmPurchaseExecutionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:getAgencyList')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult getAgencyList(@NotEmpty(message = "采购需求ID不能为空")
-                               @RequestParam(value = "demandId", required = true) Long demandId) {
+                                    @RequestParam(value = "demandId", required = true) Long demandId) {
         PmDemand pmDemand = pmDemandService.getById(demandId);
-        if(ObjectUtils.isEmpty(pmDemand)){
+        if (ObjectUtils.isEmpty(pmDemand)) {
             return error("参数错误");
         }
         LambdaQueryWrapper<BaseAgency> lw = new LambdaQueryWrapper<>();
-        lw.eq(BaseAgency::getCompanyType,pmDemand.getProjectType());
-        lw.eq(BaseAgency::getStatus,NameListType.WHITE.getCode());//白名单
+        lw.eq(BaseAgency::getCompanyType, pmDemand.getProjectType());
+        lw.eq(BaseAgency::getStatus, NameListType.WHITE.getCode());//白名单
         List<BaseAgency> agencyList = baseAgencyService.list(lw);
         return success(agencyList);
     }
@@ -126,7 +126,7 @@ public class PmPurchaseExecutionController extends BaseController {
     /**
      * 选取代理-选择填写招标代理机构信息
      */
-    @ApiOperation(value = "选取代理-选择填写招标代理机构信息",notes = "采购需求ID和代理机构ID必传")
+    @ApiOperation(value = "选取代理-选择填写招标代理机构信息", notes = "采购需求ID和代理机构ID必传")
     @GetMapping("/selectAgency")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:selectAgency')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.UPDATE)
@@ -137,11 +137,11 @@ public class PmPurchaseExecutionController extends BaseController {
                                    @RequestParam(value = "purchaseTaskDocumentNumber", required = false) String purchaseTaskDocumentNumber) {
 
         PmDemand pmDemand = pmDemandService.getById(demandId);
-        if(ObjectUtils.isEmpty(pmDemand)){
+        if (ObjectUtils.isEmpty(pmDemand)) {
             return error("参数错误");
         }
         BaseAgency baseAgency = baseAgencyService.getById(agencyId);
-        if(ObjectUtils.isEmpty(baseAgency)){
+        if (ObjectUtils.isEmpty(baseAgency)) {
             return error("参数错误");
         }
         PmDemand pmDemandUpdate = new PmDemand();
@@ -158,27 +158,27 @@ public class PmPurchaseExecutionController extends BaseController {
     /**
      * 选取代理-抽取招标代理机构信息
      */
-    @ApiOperation(value = "选取代理-抽取招标代理机构信息",notes = "采购需求ID必传")
+    @ApiOperation(value = "选取代理-抽取招标代理机构信息", notes = "采购需求ID必传")
     @GetMapping("/extractAgency")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:extractAgency')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.UPDATE)
     public AjaxResult extractAgency(@NotEmpty(message = "采购需求id不能为空")
-                                     @RequestParam(value = "demandId", required = true) Long demandId,
+                                    @RequestParam(value = "demandId", required = true) Long demandId,
                                     @RequestParam(value = "purchaseTaskDocumentNumber", required = false) String purchaseTaskDocumentNumber) {
 
         PmDemand pmDemand = pmDemandService.getById(demandId);
-        if(ObjectUtils.isEmpty(pmDemand)){
+        if (ObjectUtils.isEmpty(pmDemand)) {
             return error("参数错误");
         }
         LambdaQueryWrapper<BaseAgency> lw = new LambdaQueryWrapper<>();
-        lw.eq(BaseAgency::getCompanyType,pmDemand.getProjectType());
-        lw.eq(BaseAgency::getStatus,NameListType.WHITE.getCode()); //白名单
+        lw.eq(BaseAgency::getCompanyType, pmDemand.getProjectType());
+        lw.eq(BaseAgency::getStatus, NameListType.WHITE.getCode()); //白名单
         List<BaseAgency> baseAgencyList = baseAgencyService.list(lw);
-        if (ObjectUtils.isEmpty(baseAgencyList)){
+        if (ObjectUtils.isEmpty(baseAgencyList)) {
             return error("没有符合的招标代理机构,抽取失败!");
         }
 
-        BaseAgency any = (BaseAgency)(RandomUtil.getRandomList(baseAgencyList,1).get(0));
+        BaseAgency any = (BaseAgency) (RandomUtil.getRandomList(baseAgencyList, 1).get(0));
 
         PmDemand pmDemandUpdate = new PmDemand();
         pmDemandUpdate.setDemandId(demandId);
@@ -191,29 +191,29 @@ public class PmPurchaseExecutionController extends BaseController {
         return success(pmDemandService.updateById(pmDemandUpdate));
     }
 
-    @ApiOperation(value = "1-2专家意见反馈",notes = "采购需求ID和上传附件必传")
+    @ApiOperation(value = "1-2专家意见反馈", notes = "采购需求ID和上传附件必传")
     @PostMapping("/expertFeedback")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:expertFeedback')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.IMPORT)
     public AjaxResult expertFeedback(@NotEmpty(message = "数据为空") @RequestBody PmExpertFeedbackReqVo pmExpertFeedbackReqVo) {
         Long demandId = pmExpertFeedbackReqVo.getDemandId();
-        if(ObjectUtils.isEmpty(demandId)){
+        if (ObjectUtils.isEmpty(demandId)) {
             return error("参数错误");
         }
 
         PmDemand pmDemand = pmDemandService.getById(demandId);
-        if(ObjectUtils.isEmpty(pmDemand)){
+        if (ObjectUtils.isEmpty(pmDemand)) {
             return error("参数错误");
         }
 
         List<SysFileRef> sysFileRefs = pmExpertFeedbackReqVo.getSysFileRefs();
-        if(ObjectUtils.isEmpty(sysFileRefs)){
+        if (ObjectUtils.isEmpty(sysFileRefs)) {
             return error("上传附件不能为空");
         }
         PmExpertFeedback pmExpertFeedback = new PmExpertFeedback();
-        BeanUtils.copyProperties(pmExpertFeedbackReqVo,pmExpertFeedback);
-        if(pmExpertFeedbackService.save(pmExpertFeedback)){
-            pmDemandService.uploadFile(pmExpertFeedback.getId(), SysFileRefEnum.PM_EXPERT_FEEDBACK.getType(),sysFileRefs,getUserId().toString());
+        BeanUtils.copyProperties(pmExpertFeedbackReqVo, pmExpertFeedback);
+        if (pmExpertFeedbackService.save(pmExpertFeedback)) {
+            pmDemandService.uploadFile(pmExpertFeedback.getId(), SysFileRefEnum.PM_EXPERT_FEEDBACK.getType(), sysFileRefs, getUserId().toString());
             PmDemand pmDemandUpdate = new PmDemand();
             pmDemandUpdate.setDemandId(demandId);
             pmDemandUpdate.setProjectStatus(PmProjectStatus.PROCUREMENT_DOCUMENTS_REVIEW.getCode());
@@ -226,29 +226,29 @@ public class PmPurchaseExecutionController extends BaseController {
     }
 
 
-    @ApiOperation(value = "1-3采购文件编制审核",notes = "采购需求ID和上传附件必传")
+    @ApiOperation(value = "1-3采购文件编制审核", notes = "采购需求ID和上传附件必传")
     @PostMapping("/uploadBidFile")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:uploadBidFile')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.IMPORT)
     public AjaxResult uploadBidFile(@NotEmpty(message = "数据为空") @RequestBody PmProcurementDocumentsReviewReqVo pmProcurementDocumentsReviewReqVo) {
         Long demandId = pmProcurementDocumentsReviewReqVo.getDemandId();
-        if(ObjectUtils.isEmpty(demandId)){
+        if (ObjectUtils.isEmpty(demandId)) {
             return error("参数错误");
         }
 
         PmDemand pmDemand = pmDemandService.getById(demandId);
-        if(ObjectUtils.isEmpty(pmDemand)){
+        if (ObjectUtils.isEmpty(pmDemand)) {
             return error("参数错误");
         }
 
         List<SysFileRef> sysFileRefs = pmProcurementDocumentsReviewReqVo.getSysFileRefs();
-        if(ObjectUtils.isEmpty(sysFileRefs)){
+        if (ObjectUtils.isEmpty(sysFileRefs)) {
             return error("上传附件不能为空");
         }
         PmProcurementDocumentsReview pmProcurementDocumentsReview = new PmProcurementDocumentsReview();
-        BeanUtils.copyProperties(pmProcurementDocumentsReviewReqVo,pmProcurementDocumentsReview);
-        if(this.pmProcurementDocumentsReviewService.save(pmProcurementDocumentsReview)){
-            pmDemandService.uploadFile(pmProcurementDocumentsReview.getId(), SysFileRefEnum.PM_BID_FILE.getType(),sysFileRefs,getUserId().toString());
+        BeanUtils.copyProperties(pmProcurementDocumentsReviewReqVo, pmProcurementDocumentsReview);
+        if (this.pmProcurementDocumentsReviewService.save(pmProcurementDocumentsReview)) {
+            pmDemandService.uploadFile(pmProcurementDocumentsReview.getId(), SysFileRefEnum.PM_BID_FILE.getType(), sysFileRefs, getUserId().toString());
             PmDemand pmDemandUpdate = new PmDemand();
             pmDemandUpdate.setDemandId(demandId);
             pmDemandUpdate.setProjectStatus(PmProjectStatus.PROCUREMENT_ANNOUNCEMENT.getCode());
@@ -266,10 +266,10 @@ public class PmPurchaseExecutionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:insertPmReleaseAnnouncement')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.INSERT)
     public AjaxResult insertPmReleaseAnnouncement(@NotEmpty(message = "数据为空")
-                                       @RequestBody PmReleaseAnnouncementReqVo pmReleaseAnnouncementReqVo) {
+                                                  @RequestBody PmReleaseAnnouncementReqVo pmReleaseAnnouncementReqVo) {
         try {
             Long demandId = pmReleaseAnnouncementReqVo.getDemandId();
-            if(ObjectUtils.isEmpty(demandId)){
+            if (ObjectUtils.isEmpty(demandId)) {
                 return error("参数错误");
             }
             pmReleaseAnnouncementReqVo.setCreateBy(getUserId().toString());
@@ -277,49 +277,49 @@ public class PmPurchaseExecutionController extends BaseController {
             pmReleaseAnnouncementReqVo.setUpdateBy(pmReleaseAnnouncementReqVo.getCreateBy());
             pmReleaseAnnouncementReqVo.setUpdateTime(pmReleaseAnnouncementReqVo.getCreateTime());
             return toAjax(pmDemandService.insertPmReleaseAnnouncement(pmReleaseAnnouncementReqVo));
-        }  catch (Exception e) {
+        } catch (Exception e) {
             return error(e.getMessage());
         }
 
     }
 
-    @ApiOperation(value = "1-5标前质疑投诉",notes = "采购需求ID必传")
+    @ApiOperation(value = "1-5标前质疑投诉", notes = "采购需求ID必传")
     @PostMapping("/handlePreCallQuestion")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:handlePreCallQuestion')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.UPDATE)
     public AjaxResult handlePreCallQuestion(@NotEmpty(message = "数据为空")
-                                         @RequestBody PmCallQuestionReqVo pmCallQuestionReqVo) {
+                                            @RequestBody PmCallQuestionReqVo pmCallQuestionReqVo) {
         try {
             Long demandId = pmCallQuestionReqVo.getDemandId();
-            if(ObjectUtils.isEmpty(demandId)){
+            if (ObjectUtils.isEmpty(demandId)) {
                 return error("参数错误");
             }
             PmDemand pmDemand = pmDemandService.getById(demandId);
-            if(ObjectUtils.isEmpty(pmDemand)){
+            if (ObjectUtils.isEmpty(pmDemand)) {
                 return error("参数错误");
             }
-            if("1".equals(pmCallQuestionReqVo.getCallQuestion())) { //有质疑
+            if ("1".equals(pmCallQuestionReqVo.getCallQuestion())) { //有质疑
                 if (ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())) {
                     return error("质疑时间不能为空");
                 }
             }
             PmCallQuestion pmCallQuestion = new PmCallQuestion();
-            BeanUtils.copyProperties(pmCallQuestionReqVo,pmCallQuestion);
+            BeanUtils.copyProperties(pmCallQuestionReqVo, pmCallQuestion);
             pmCallQuestion.setType("0");
 
-           if(pmCallQuestionService.save(pmCallQuestion)) {
-               if("1".equals(pmCallQuestion.getCallQuestion())) { //有质疑
-                   List<SysFileRef> sysFileRefs = pmCallQuestionReqVo.getSysFileRefs();
-                   pmDemandService.uploadFile(pmCallQuestion.getId(), SysFileRefEnum.PM_PRE_BID_CALL_QUESTION.getType(),sysFileRefs,getUserId().toString());
-               }
-           }
+            if (pmCallQuestionService.save(pmCallQuestion)) {
+                if ("1".equals(pmCallQuestion.getCallQuestion())) { //有质疑
+                    List<SysFileRef> sysFileRefs = pmCallQuestionReqVo.getSysFileRefs();
+                    pmDemandService.uploadFile(pmCallQuestion.getId(), SysFileRefEnum.PM_PRE_BID_CALL_QUESTION.getType(), sysFileRefs, getUserId().toString());
+                }
+            }
 
             pmDemand.setProjectStatus(PmProjectStatus.WAIT_OPEN_BID.getCode());
             pmDemand.setUpdateBy(getUserId().toString());
             pmDemand.setUpdateTime(new Date());
             return toAjax(pmDemandService.updateById(pmDemand));
 
-        }  catch (Exception e) {
+        } catch (Exception e) {
             return error(e.getMessage());
         }
     }
@@ -330,19 +330,19 @@ public class PmPurchaseExecutionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:getExpertIdNumberList')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult getExpertIdNumberList(@NotEmpty(message = "采购需求id不能为空")
-                                                @RequestParam(value = "demandId", required = true) Long demandId) {
+                                            @RequestParam(value = "demandId", required = true) Long demandId) {
         PmDemand pmDemand = pmDemandService.getById(demandId);
-        if(ObjectUtils.isEmpty(pmDemand)){
+        if (ObjectUtils.isEmpty(pmDemand)) {
             return error("参数错误");
         }
 
         LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<BaseExpert>();
-        lw.eq(BaseExpert::getVarietyPurchase,pmDemand.getProjectType())
-                .eq(BaseExpert::getStatus,NameListType.WHITE.getCode());
+        lw.eq(BaseExpert::getVarietyPurchase, pmDemand.getProjectType())
+                .eq(BaseExpert::getStatus, NameListType.WHITE.getCode());
         List<BaseExpert> baseExpertList = baseExpertService.list(lw);
         List<String> idNumberList = new ArrayList<>();
         if (!ObjectUtils.isEmpty(baseExpertList)) {
-            for(BaseExpert baseExpert :baseExpertList ){
+            for (BaseExpert baseExpert : baseExpertList) {
                 idNumberList.add(baseExpert.getIdNumber());
             }
         }
@@ -354,21 +354,21 @@ public class PmPurchaseExecutionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:findExpertWithIdNumber')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult findExpertWithIdNumber(@NotEmpty(message = "采购需求id不能为空")
-                                                 @RequestParam(value = "demandId", required = true) Long demandId,
+                                             @RequestParam(value = "demandId", required = true) Long demandId,
                                              @NotEmpty(message = "身份证号不能为空")
-                                       @RequestParam(value = "idNumber", required = true) String idNumber) {
+                                             @RequestParam(value = "idNumber", required = true) String idNumber) {
         PmDemand pmDemand = pmDemandService.getById(demandId);
-        if(ObjectUtils.isEmpty(pmDemand)){
+        if (ObjectUtils.isEmpty(pmDemand)) {
             return error("参数错误");
         }
         LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<>();
-        lw.eq(BaseExpert::getIdNumber,idNumber);
+        lw.eq(BaseExpert::getIdNumber, idNumber);
         BaseExpert baseExpert = baseExpertService.getOne(lw);
-        if(baseExpert != null){
-            if(NameListType.BLACK.getCode().equals(baseExpert.getStatus())){
+        if (baseExpert != null) {
+            if (NameListType.BLACK.getCode().equals(baseExpert.getStatus())) {
                 return error("该专家属于黑名单");
             }
-            if(!ObjectUtils.isEmpty(pmDemand.getProjectType()) && !pmDemand.getProjectType().equals(baseExpert.getVarietyPurchase())){
+            if (!ObjectUtils.isEmpty(pmDemand.getProjectType()) && !pmDemand.getProjectType().equals(baseExpert.getVarietyPurchase())) {
                 return error("该专家所属采购品种和项目类型不匹配");
             }
         }
@@ -414,11 +414,11 @@ public class PmPurchaseExecutionController extends BaseController {
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult getExpertUnitList() {
         List<BaseUnitInformation> baseUnitInformationList = baseExpertService.getBaseUnitInformationList();
-        if(ObjectUtils.isEmpty(baseUnitInformationList)){
+        if (ObjectUtils.isEmpty(baseUnitInformationList)) {
             return error("专家单位列表是空的");
         }
         Set<String> set = new HashSet<>();
-        for(BaseUnitInformation baseUnitInformation : baseUnitInformationList) {
+        for (BaseUnitInformation baseUnitInformation : baseUnitInformationList) {
             set.add(baseUnitInformation.getUnitName());
         }
         return success(set);
@@ -427,12 +427,12 @@ public class PmPurchaseExecutionController extends BaseController {
     /**
      * 抽取专家
      */
-    @ApiOperation(value = "抽取专家",notes = "采购需求ID必传")
+    @ApiOperation(value = "抽取专家", notes = "采购需求ID必传")
     @PostMapping("/extractExpertBatch")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:extractExpertBatch')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.UPDATE)
     public AjaxResult extractExpertBatch(@NotEmpty(message = "参数不能为空")
-                                             @RequestBody PmBaseExpertExtractReqVo pmBaseExpertExtractReqVo) {
+                                         @RequestBody PmBaseExpertExtractReqVo pmBaseExpertExtractReqVo) {
 
         try {
             if (ObjectUtils.isEmpty(pmBaseExpertExtractReqVo)
@@ -446,12 +446,12 @@ public class PmPurchaseExecutionController extends BaseController {
         }
     }
 
-    @ApiOperation(value = "填写开标信息",notes = "采购需求ID必传")
+    @ApiOperation(value = "填写开标信息", notes = "采购需求ID必传")
     @PostMapping("/insertBidOpeningBatch")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:insertBidOpeningBatch')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.INSERT)
     public AjaxResult insertBidOpeningBatch(@NotEmpty(message = "数据为空")
-                                                  @RequestBody PmBidOpeningFillReqVo pmBidOpeningFillReqVo) {
+                                            @RequestBody PmBidOpeningFillReqVo pmBidOpeningFillReqVo) {
 
         try {
             if (ObjectUtils.isEmpty(pmBidOpeningFillReqVo)
@@ -475,37 +475,37 @@ public class PmPurchaseExecutionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:getPullDownBidOpeningList')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult getPullDownBidOpeningList(@NotEmpty(message = "需求ID不能为空")
-                                        @RequestParam(value = "demandId", required = true) Long demandId) {
+                                                @RequestParam(value = "demandId", required = true) Long demandId) {
         LambdaQueryWrapper<PmBidOpening> pmBidOpeningLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        pmBidOpeningLambdaQueryWrapper.eq(PmBidOpening::getDemandId,demandId)
+        pmBidOpeningLambdaQueryWrapper.eq(PmBidOpening::getDemandId, demandId)
                 .orderByDesc(PmBidOpening::getScore)
         ;
         List<PmBidOpening> pmBidOpeningList = pmBidOpeningService.list(pmBidOpeningLambdaQueryWrapper);
         return success(pmBidOpeningList);
     }
 
-    @ApiOperation(value = "中标基本情况填制-中标情况填制提交(评标结果公告)",notes = "采购需求ID必传")
+    @ApiOperation(value = "中标基本情况填制-中标情况填制提交(评标结果公告)", notes = "采购需求ID必传")
     @PostMapping("/insertPmBidWinning")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:insertPmBidWinning')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.INSERT)
     public AjaxResult insertPmBidWinning(@NotEmpty(message = "数据为空")
-                                                  @RequestBody PmBidWinningReqVo pmBidWinningReqVo) {
-      try {
-          Long demandId = pmBidWinningReqVo.getDemandId();
-          if(ObjectUtils.isEmpty(demandId)){
-              return error("采购需求ID不能为空");
-          }
-          pmBidWinningReqVo.setCreateBy(getUserId().toString());
-          pmBidWinningReqVo.setCreateTime(new Date());
-          pmBidWinningReqVo.setUpdateBy(pmBidWinningReqVo.getCreateBy());
-          pmBidWinningReqVo.setUpdateTime(pmBidWinningReqVo.getCreateTime());
-          return toAjax(pmDemandService.insertPmBidWinning(pmBidWinningReqVo));
-      }  catch (Exception e) {
-          return error(e.getMessage());
-      }
-    }
-
-    @ApiOperation(value = "中标基本情况填制-更换中标人提交",notes = "采购需求ID必传")
+                                         @RequestBody PmBidWinningReqVo pmBidWinningReqVo) {
+        try {
+            Long demandId = pmBidWinningReqVo.getDemandId();
+            if (ObjectUtils.isEmpty(demandId)) {
+                return error("采购需求ID不能为空");
+            }
+            pmBidWinningReqVo.setCreateBy(getUserId().toString());
+            pmBidWinningReqVo.setCreateTime(new Date());
+            pmBidWinningReqVo.setUpdateBy(pmBidWinningReqVo.getCreateBy());
+            pmBidWinningReqVo.setUpdateTime(pmBidWinningReqVo.getCreateTime());
+            return toAjax(pmDemandService.insertPmBidWinning(pmBidWinningReqVo));
+        } catch (Exception e) {
+            return error(e.getMessage());
+        }
+    }
+
+    @ApiOperation(value = "中标基本情况填制-更换中标人提交", notes = "采购需求ID必传")
     @PostMapping("/updatePmBidWinning")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:updatePmBidWinning')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.UPDATE)
@@ -513,18 +513,18 @@ public class PmPurchaseExecutionController extends BaseController {
                                          @RequestBody PmBidWinningReqVo pmBidWinningReqVo) {
         try {
             Long demandId = pmBidWinningReqVo.getDemandId();
-            if(ObjectUtils.isEmpty(demandId)){
+            if (ObjectUtils.isEmpty(demandId)) {
                 return error("采购需求ID不能为空");
             }
             pmBidWinningReqVo.setUpdateBy(getUserId().toString());
             pmBidWinningReqVo.setUpdateTime(new Date());
             return toAjax(pmDemandService.updatePmBidWinning(pmBidWinningReqVo));
-        }  catch (Exception e) {
+        } catch (Exception e) {
             return error(e.getMessage());
         }
     }
 
-    @ApiOperation(value = "流标情况填制",notes = "采购需求ID必传")
+    @ApiOperation(value = "流标情况填制", notes = "采购需求ID必传")
     @PostMapping("/insertPmBidFailure")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:insertPmBidFailure')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.INSERT)
@@ -532,7 +532,7 @@ public class PmPurchaseExecutionController extends BaseController {
                                          @RequestBody PmBidFailureReqVo pmBidFailureReqVo) {
         try {
             Long demandId = pmBidFailureReqVo.getDemandId();
-            if(ObjectUtils.isEmpty(demandId)){
+            if (ObjectUtils.isEmpty(demandId)) {
                 return error("参数错误");
             }
             pmBidFailureReqVo.setCreateBy(getUserId().toString());
@@ -540,33 +540,33 @@ public class PmPurchaseExecutionController extends BaseController {
             pmBidFailureReqVo.setUpdateBy(pmBidFailureReqVo.getCreateBy());
             pmBidFailureReqVo.setUpdateTime(pmBidFailureReqVo.getCreateTime());
             return toAjax(pmDemandService.insertPmBidFailure(pmBidFailureReqVo));
-        }  catch (Exception e) {
+        } catch (Exception e) {
             return error(e.getMessage());
         }
     }
 
-    @ApiOperation(value = "流废标处置-质疑处理",notes = "采购需求ID必传")
+    @ApiOperation(value = "流废标处置-质疑处理", notes = "采购需求ID必传")
     @PostMapping("/handleBidFailureCallQuestion")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:handleBidFailureCallQuestion')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.UPDATE)
     public AjaxResult handleBidFailureCallQuestion(@NotEmpty(message = "数据为空")
-                                         @RequestBody PmCallQuestionReqVo pmCallQuestionReqVo) {
+                                                   @RequestBody PmCallQuestionReqVo pmCallQuestionReqVo) {
         try {
             Long demandId = pmCallQuestionReqVo.getDemandId();
-            if(ObjectUtils.isEmpty(demandId)){
+            if (ObjectUtils.isEmpty(demandId)) {
                 return error("参数错误");
             }
             PmDemand pmDemand = pmDemandService.getById(demandId);
-            if(ObjectUtils.isEmpty(pmDemand)){
+            if (ObjectUtils.isEmpty(pmDemand)) {
                 return error("参数错误");
             }
-            if("1".equals(pmCallQuestionReqVo.getCallQuestion())) { //有质疑
+            if ("1".equals(pmCallQuestionReqVo.getCallQuestion())) { //有质疑
                 if (ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())) {
                     return error("质疑时间不能为空");
                 }
             }
             LambdaQueryWrapper<PmBidFailure> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-            lambdaQueryWrapper.eq(PmBidFailure::getDemandId,pmDemand.getDemandId())
+            lambdaQueryWrapper.eq(PmBidFailure::getDemandId, pmDemand.getDemandId())
                     .orderByDesc(PmBidFailure::getBidFailureTime)
                     .last(" limit 1");
             PmBidFailure bidFailure = this.pmBidFailureService.getOne(lambdaQueryWrapper);
@@ -578,34 +578,34 @@ public class PmPurchaseExecutionController extends BaseController {
             bidFailureUpdate.setCallQuestion(pmCallQuestionReqVo.getCallQuestion());
             bidFailureUpdate.setCallQuestionTime(pmCallQuestionReqVo.getCallQuestionTime());
 
-            if("1".equals(bidFailureUpdate.getCallQuestion())){ //有质疑
+            if ("1".equals(bidFailureUpdate.getCallQuestion())) { //有质疑
                 List<SysFileRef> sysFileRefs = pmCallQuestionReqVo.getSysFileRefs();
-                pmDemandService.uploadFile(bidFailureUpdate.getId(), SysFileRefEnum.PM_BID_FAILURE_CALL_QUESTION.getType(),sysFileRefs,getUserId().toString());
+                pmDemandService.uploadFile(bidFailureUpdate.getId(), SysFileRefEnum.PM_BID_FAILURE_CALL_QUESTION.getType(), sysFileRefs, getUserId().toString());
             }
 
             bidFailureUpdate.setUpdateBy(getUserId().toString());
             bidFailureUpdate.setUpdateTime(new Date());
             return toAjax(pmBidFailureService.updateById(bidFailureUpdate));
 
-        }  catch (Exception e) {
+        } catch (Exception e) {
             return error(e.getMessage());
         }
     }
 
-    @ApiOperation(value = "流废标退回",notes = "采购需求ID必传")
+    @ApiOperation(value = "流废标退回", notes = "采购需求ID必传")
     @GetMapping("/returnBidFailure")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:returnBidFailure')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.UPDATE)
     public AjaxResult returnBidFailure(@NotEmpty(message = "采购需求id不能为空")
-                                           @RequestParam(value = "demandId", required = true) Long demandId) {
+                                       @RequestParam(value = "demandId", required = true) Long demandId) {
         try {
             return toAjax(pmDemandHisService.returnBidFailure(demandId, getUserId().toString()));
-        }  catch (Exception e) {
+        } catch (Exception e) {
             return error(e.getMessage());
         }
     }
 
-    @ApiOperation(value = "标后质疑",notes = "采购需求ID必传")
+    @ApiOperation(value = "标后质疑", notes = "采购需求ID必传")
     @PostMapping("/handleCallQuestion")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:handleCallQuestion')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.UPDATE)
@@ -613,23 +613,23 @@ public class PmPurchaseExecutionController extends BaseController {
                                          @RequestBody PmCallQuestionReqVo pmCallQuestionReqVo) {
         try {
             Long demandId = pmCallQuestionReqVo.getDemandId();
-            if(ObjectUtils.isEmpty(demandId)){
+            if (ObjectUtils.isEmpty(demandId)) {
                 return error("参数错误");
             }
             PmDemand pmDemand = pmDemandService.getById(demandId);
-            if(ObjectUtils.isEmpty(pmDemand)){
+            if (ObjectUtils.isEmpty(pmDemand)) {
                 return error("参数错误");
             }
-            if("1".equals(pmCallQuestionReqVo.getCallQuestion())) { //有质疑
+            if ("1".equals(pmCallQuestionReqVo.getCallQuestion())) { //有质疑
                 if (ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())) {
                     return error("质疑时间不能为空");
                 }
             }
             PmCallQuestion pmCallQuestion = new PmCallQuestion();
-            BeanUtils.copyProperties(pmCallQuestionReqVo,pmCallQuestion);
+            BeanUtils.copyProperties(pmCallQuestionReqVo, pmCallQuestion);
             pmCallQuestion.setType("1");
-            if(pmCallQuestionService.save(pmCallQuestion)) {
-                if("1".equals(pmCallQuestion.getCallQuestion())) { //有质疑
+            if (pmCallQuestionService.save(pmCallQuestion)) {
+                if ("1".equals(pmCallQuestion.getCallQuestion())) { //有质疑
                     List<SysFileRef> sysFileRefs = pmCallQuestionReqVo.getSysFileRefs();
                     pmDemandService.uploadFile(pmCallQuestion.getId(), SysFileRefEnum.PM_BID_CALL_QEUSTION_FILE.getType(), sysFileRefs, getUserId().toString());
                 }
@@ -639,31 +639,31 @@ public class PmPurchaseExecutionController extends BaseController {
             pmDemand.setUpdateTime(new Date());
             return toAjax(pmDemandService.updateById(pmDemand));
 
-        }  catch (Exception e) {
+        } catch (Exception e) {
             return error(e.getMessage());
         }
     }
 
-    @ApiOperation(value = "上传中标通知书",notes = "采购需求ID和上传附件必传")
+    @ApiOperation(value = "上传中标通知书", notes = "采购需求ID和上传附件必传")
     @PostMapping("/uploadBidWinningNotification")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:uploadBidWinningNotification')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.IMPORT)
     public AjaxResult uploadBidWinningNotification(@NotEmpty(message = "数据为空") @RequestBody PmPurchaseExecutionReqVo pmPurchaseExecutionReqVo) {
         Long demandId = pmPurchaseExecutionReqVo.getDemandId();
-        if(ObjectUtils.isEmpty(demandId)){
+        if (ObjectUtils.isEmpty(demandId)) {
             return error("参数错误");
         }
 
         PmDemand pmDemand = pmDemandService.getById(demandId);
-        if(ObjectUtils.isEmpty(pmDemand)){
+        if (ObjectUtils.isEmpty(pmDemand)) {
             return error("参数错误");
         }
 
         List<SysFileRef> sysFileRefs = pmPurchaseExecutionReqVo.getSysFileRefs();
-        if(ObjectUtils.isEmpty(sysFileRefs)){
+        if (ObjectUtils.isEmpty(sysFileRefs)) {
             return error("上传附件不能为空");
         }
-        if (pmDemandService.uploadFile(demandId, SysFileRefEnum.PM_BID_WINNING_NOTIFICATION.getType(),sysFileRefs,getUserId().toString())) {
+        if (pmDemandService.uploadFile(demandId, SysFileRefEnum.PM_BID_WINNING_NOTIFICATION.getType(), sysFileRefs, getUserId().toString())) {
             PmDemand pmDemandUpdate = new PmDemand();
             pmDemandUpdate.setDemandId(demandId);
             pmDemandUpdate.setProjectStatus(PmProjectStatus.CONTRACT_WAIT_FILL.getCode());
@@ -677,10 +677,10 @@ public class PmPurchaseExecutionController extends BaseController {
             log.info("******** setting3 == " + setting3);
             //计划交付时间:根据数据阈值中设置的交付时间进行判断,进行预警
             int diff3 = DateUtils.differentDaysByMillisecond(pmDemand.getPlanDeliverTime(), DateUtils.parseDate(DateUtils.getDate()));
-            if (ObjectUtils.isEmpty(pmDemand.getRealDeliverTime()) && diff3 >= setting3) {
+            if (ObjectUtils.isEmpty(pmDemand.getRealDeliverTime()) && diff3 > 0 && diff3 >= setting3) {
                 log.info("******** 计划交付预警: " + pmDemand.getProjectName());
                 pmDemandUpdate.setWarnStatus(WarnStatus.PLAN_DELIVER_WARNING.getCode());
-            } else{
+            } else {
                 pmDemandUpdate.setWarnStatus(WarnStatus.NORMAL.getCode());
             }
 
@@ -698,14 +698,15 @@ public class PmPurchaseExecutionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:view')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult view(@RequestBody PmDemandReqVo pmDemandReqVo) {
-        if(pmDemandReqVo.getDemandId() == null){
+        if (pmDemandReqVo.getDemandId() == null) {
             return AjaxResult.error("demandId不能为空");
         }
-        if(StringUtils.isEmpty(pmDemandReqVo.getDetailType())){
+        if (StringUtils.isEmpty(pmDemandReqVo.getDetailType())) {
             return AjaxResult.error("详情的类型不能为空");
         }
-        return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId(),pmDemandReqVo.getDetailType()));
+        return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId(), pmDemandReqVo.getDetailType()));
     }
+
     /**
      * 获取回退下拉列表
      */
@@ -715,23 +716,24 @@ public class PmPurchaseExecutionController extends BaseController {
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult getReturnList(@NotEmpty(message = "需求ID不能为空")
                                     @RequestParam(value = "demandId", required = true) Long demandId) {
-        List< Map<String,Integer>> list = new ArrayList<>();
+        List<Map<String, Integer>> list = new ArrayList<>();
         LambdaQueryWrapper<PmDemandHis> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper.eq(PmDemandHis::getDemandId,demandId).orderByAsc(PmDemandHis::getReturnOrderNumber);
+        lambdaQueryWrapper.eq(PmDemandHis::getDemandId, demandId).orderByAsc(PmDemandHis::getReturnOrderNumber);
         List<PmDemandHis> pmDemandHisList = this.pmDemandHisService.list(lambdaQueryWrapper);
-        if(!ObjectUtils.isEmpty(pmDemandHisList)){
-            Map<String,Integer> map = new HashMap<>();
-            map.put("当前信息",0);
+        if (!ObjectUtils.isEmpty(pmDemandHisList)) {
+            Map<String, Integer> map = new HashMap<>();
+            map.put("当前信息", 0);
             list.add(map);
             for (PmDemandHis pmDemandHis : pmDemandHisList) {
-                Map<String,Integer> map2 = new HashMap<>();
-                map2.put("第" + pmDemandHis.getReturnOrderNumber() + "回退",pmDemandHis.getReturnOrderNumber());
+                Map<String, Integer> map2 = new HashMap<>();
+                map2.put("第" + pmDemandHis.getReturnOrderNumber() + "回退", pmDemandHis.getReturnOrderNumber());
                 list.add(map2);
             }
         }
 
         return success(list);
     }
+
     /**
      * 查看历史详情
      */
@@ -740,19 +742,19 @@ public class PmPurchaseExecutionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:viewHis')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult viewHis(@RequestBody PmDemandReqVo pmDemandReqVo) {
-        if(pmDemandReqVo.getDemandId() == null){
+        if (pmDemandReqVo.getDemandId() == null) {
             return AjaxResult.error("demandId不能为空");
         }
-        if(ObjectUtils.isEmpty(pmDemandReqVo.getDetailType())){
+        if (ObjectUtils.isEmpty(pmDemandReqVo.getDetailType())) {
             return AjaxResult.error("详情的类型不能为空");
         }
-        if(ObjectUtils.isEmpty(pmDemandReqVo.getReturnOrderNumber())){
+        if (ObjectUtils.isEmpty(pmDemandReqVo.getReturnOrderNumber())) {
             return AjaxResult.error("回退序号不能为空");
         }
-        if(0 == pmDemandReqVo.getReturnOrderNumber()){
-            return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId(),pmDemandReqVo.getDetailType()));
+        if (0 == pmDemandReqVo.getReturnOrderNumber()) {
+            return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId(), pmDemandReqVo.getDetailType()));
         } else {
-            return success(pmDemandHisService.selectPmDemandHisByDemandId(pmDemandReqVo.getDemandId(),pmDemandReqVo.getDetailType(),pmDemandReqVo.getReturnOrderNumber()));
+            return success(pmDemandHisService.selectPmDemandHisByDemandId(pmDemandReqVo.getDemandId(), pmDemandReqVo.getDetailType(), pmDemandReqVo.getReturnOrderNumber()));
         }
 
     }
@@ -765,20 +767,20 @@ public class PmPurchaseExecutionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:getBaseExpertList')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult getBaseExpertList(@NotEmpty(message = "需求ID不能为空")
-                                            @RequestParam(value = "demandId", required = true) Long demandId,
-                                         @NotEmpty(message = "选取时间不能为空")
-                                            @RequestParam(value = "accessTime", required = true) String accessTime) {
+                                        @RequestParam(value = "demandId", required = true) Long demandId,
+                                        @NotEmpty(message = "选取时间不能为空")
+                                        @RequestParam(value = "accessTime", required = true) String accessTime) {
         LambdaQueryWrapper<PmDemandExpertRef> pmDemandExpertRefLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        pmDemandExpertRefLambdaQueryWrapper.eq(PmDemandExpertRef::getDemandId,demandId);
-        pmDemandExpertRefLambdaQueryWrapper.eq(PmDemandExpertRef::getAccessTime,accessTime);
+        pmDemandExpertRefLambdaQueryWrapper.eq(PmDemandExpertRef::getDemandId, demandId);
+        pmDemandExpertRefLambdaQueryWrapper.eq(PmDemandExpertRef::getAccessTime, accessTime);
         List<PmDemandExpertRef> pmDemandExpertRefList = pmDemandExpertRefService.list(pmDemandExpertRefLambdaQueryWrapper);
         List<BaseExpertVo> baseExpertVoList = new ArrayList<>();
-        if(!ObjectUtils.isEmpty(pmDemandExpertRefList)) {
-            for(PmDemandExpertRef pmDemandExpertRef : pmDemandExpertRefList) {
+        if (!ObjectUtils.isEmpty(pmDemandExpertRefList)) {
+            for (PmDemandExpertRef pmDemandExpertRef : pmDemandExpertRefList) {
                 BaseExpert baseExpert = baseExpertService.getById(pmDemandExpertRef.getExpertId());
-                if(baseExpert != null){
+                if (baseExpert != null) {
                     BaseExpertVo baseExpertVo = new BaseExpertVo();
-                    BeanUtils.copyProperties(baseExpert,baseExpertVo);
+                    BeanUtils.copyProperties(baseExpert, baseExpertVo);
                     baseExpertVo.setMajorTypeName(getMajorTypeName(baseExpertVo.getMajorType()));
                     baseExpertVo.setExpertTypeName(ExpertType.getCodeToInfo(baseExpertVo.getExpertType()));
                     baseExpertVo.setVarietyPurchaseName(PurchaseType.getCodeToInfo(baseExpertVo.getVarietyPurchase()));
@@ -798,26 +800,26 @@ public class PmPurchaseExecutionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:getBaseExpertHisList')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult getBaseExpertHisList(@NotEmpty(message = "需求ID不能为空")
-                                        @RequestParam(value = "demandId", required = true) Long demandId,
+                                           @RequestParam(value = "demandId", required = true) Long demandId,
                                            @NotEmpty(message = "回退序号不能为空")
                                            @RequestParam(value = "returnOrderNumber", required = true) Integer returnOrderNumber,
-                                        @NotEmpty(message = "选取时间不能为空")
-                                        @RequestParam(value = "accessTime", required = true) String accessTime) {
-        if( 0 == returnOrderNumber){
-            return getBaseExpertList(demandId,accessTime);
+                                           @NotEmpty(message = "选取时间不能为空")
+                                           @RequestParam(value = "accessTime", required = true) String accessTime) {
+        if (0 == returnOrderNumber) {
+            return getBaseExpertList(demandId, accessTime);
         }
         LambdaQueryWrapper<PmDemandExpertRefHis> pmDemandExpertRefLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        pmDemandExpertRefLambdaQueryWrapper.eq(PmDemandExpertRefHis::getDemandId,demandId);
-        pmDemandExpertRefLambdaQueryWrapper.eq(PmDemandExpertRefHis::getReturnOrderNumber,returnOrderNumber);
-        pmDemandExpertRefLambdaQueryWrapper.eq(PmDemandExpertRefHis::getAccessTime,accessTime);
+        pmDemandExpertRefLambdaQueryWrapper.eq(PmDemandExpertRefHis::getDemandId, demandId);
+        pmDemandExpertRefLambdaQueryWrapper.eq(PmDemandExpertRefHis::getReturnOrderNumber, returnOrderNumber);
+        pmDemandExpertRefLambdaQueryWrapper.eq(PmDemandExpertRefHis::getAccessTime, accessTime);
         List<PmDemandExpertRefHis> pmDemandExpertRefHisList = pmDemandExpertRefHisService.list(pmDemandExpertRefLambdaQueryWrapper);
         List<BaseExpertVo> baseExpertVoList = new ArrayList<>();
-        if(!ObjectUtils.isEmpty(pmDemandExpertRefHisList)) {
-            for(PmDemandExpertRefHis pmDemandExpertRefHis : pmDemandExpertRefHisList) {
+        if (!ObjectUtils.isEmpty(pmDemandExpertRefHisList)) {
+            for (PmDemandExpertRefHis pmDemandExpertRefHis : pmDemandExpertRefHisList) {
                 BaseExpert baseExpert = baseExpertService.getById(pmDemandExpertRefHis.getExpertId());
-                if(baseExpert != null){
+                if (baseExpert != null) {
                     BaseExpertVo baseExpertVo = new BaseExpertVo();
-                    BeanUtils.copyProperties(baseExpert,baseExpertVo);
+                    BeanUtils.copyProperties(baseExpert, baseExpertVo);
                     baseExpertVo.setMajorTypeName(getMajorTypeName(baseExpertVo.getMajorType()));
                     baseExpertVo.setExpertTypeName(ExpertType.getCodeToInfo(baseExpertVo.getExpertType()));
                     baseExpertVo.setVarietyPurchaseName(PurchaseType.getCodeToInfo(baseExpertVo.getVarietyPurchase()));
@@ -829,28 +831,28 @@ public class PmPurchaseExecutionController extends BaseController {
         return success(baseExpertVoList);
     }
 
-    private String getMajorTypeName(String majorType){
-        if(ObjectUtils.isEmpty(majorType)) {
+    private String getMajorTypeName(String majorType) {
+        if (ObjectUtils.isEmpty(majorType)) {
             return null;
         }
         LambdaQueryWrapper<BaseProfessional> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper.in(BaseProfessional::getProfessionalCode,majorType.split(","));
+        lambdaQueryWrapper.in(BaseProfessional::getProfessionalCode, majorType.split(","));
         List<BaseProfessional> list = this.baseProfessionalService.list(lambdaQueryWrapper);
-        if(ObjectUtils.isEmpty(list)){
+        if (ObjectUtils.isEmpty(list)) {
             return null;
         }
         StringBuilder sb = new StringBuilder();
-        for(BaseProfessional baseProfessional : list){
+        for (BaseProfessional baseProfessional : list) {
             sb.append(baseProfessional.getProfessionalName()).append(",");
         }
         String majorTypeName = sb.toString();
-        if(majorTypeName.endsWith(",")){
+        if (majorTypeName.endsWith(",")) {
             majorTypeName = majorTypeName.substring(0, majorTypeName.length() - 1);
         }
         return majorTypeName;
     }
 
-  /**
+    /**
      * 开标信息查看详情列表
      */
     @ApiOperation(value = "开标信息查看详情列表", notes = "必传选需求ID和开标时间(yyyy-MM-dd)")
@@ -862,8 +864,8 @@ public class PmPurchaseExecutionController extends BaseController {
                                         @NotEmpty(message = "开标时间不能为空")
                                         @RequestParam(value = "openBidTime", required = true) String openBidTime) {
         LambdaQueryWrapper<PmBidOpening> pmBidOpeningLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        pmBidOpeningLambdaQueryWrapper.eq(PmBidOpening::getDemandId,demandId)
-        .eq(PmBidOpening::getOpenBidTime,openBidTime).orderByDesc(PmBidOpening::getScore);
+        pmBidOpeningLambdaQueryWrapper.eq(PmBidOpening::getDemandId, demandId)
+                .eq(PmBidOpening::getOpenBidTime, openBidTime).orderByDesc(PmBidOpening::getScore);
         List<PmBidOpening> pmBidOpeningList = pmBidOpeningService.list(pmBidOpeningLambdaQueryWrapper);
         return success(pmBidOpeningList);
     }
@@ -876,17 +878,17 @@ public class PmPurchaseExecutionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:getBidOpeningHisList')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult getBidOpeningHisList(@NotEmpty(message = "需求ID不能为空")
-                                        @RequestParam(value = "demandId", required = true) Long demandId,
+                                           @RequestParam(value = "demandId", required = true) Long demandId,
                                            @NotEmpty(message = "回退序号不能为空")
                                            @RequestParam(value = "returnOrderNumber", required = true) Integer returnOrderNumber,
-                                        @NotEmpty(message = "开标时间不能为空")
-                                        @RequestParam(value = "openBidTime", required = true) String openBidTime) {
-        if( 0 == returnOrderNumber){
-            return getBidOpeningList(demandId,openBidTime);
+                                           @NotEmpty(message = "开标时间不能为空")
+                                           @RequestParam(value = "openBidTime", required = true) String openBidTime) {
+        if (0 == returnOrderNumber) {
+            return getBidOpeningList(demandId, openBidTime);
         }
         LambdaQueryWrapper<PmBidOpeningHis> pmBidOpeningLambdaQueryWrapper = new LambdaQueryWrapper<>();
-        pmBidOpeningLambdaQueryWrapper.eq(PmBidOpeningHis::getDemandId,demandId).eq(PmBidOpeningHis::getReturnOrderNumber,returnOrderNumber)
-                .eq(PmBidOpeningHis::getOpenBidTime,openBidTime).orderByDesc(PmBidOpeningHis::getScore);
+        pmBidOpeningLambdaQueryWrapper.eq(PmBidOpeningHis::getDemandId, demandId).eq(PmBidOpeningHis::getReturnOrderNumber, returnOrderNumber)
+                .eq(PmBidOpeningHis::getOpenBidTime, openBidTime).orderByDesc(PmBidOpeningHis::getScore);
         List<PmBidOpeningHis> pmBidOpeningList = pmBidOpeningHisService.list(pmBidOpeningLambdaQueryWrapper);
         return success(pmBidOpeningList);
     }
@@ -899,14 +901,14 @@ public class PmPurchaseExecutionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:getBidWinningUnitList')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult getBidWinningUnitList(@NotEmpty(message = "需求ID不能为空")
-                                        @RequestParam(value = "demandId", required = true) Long demandId,
-                                        @NotEmpty(message = "开中标ID不能为空")
-                                        @RequestParam(value = "winningId", required = true) Long winningId) {
+                                            @RequestParam(value = "demandId", required = true) Long demandId,
+                                            @NotEmpty(message = "开中标ID不能为空")
+                                            @RequestParam(value = "winningId", required = true) Long winningId) {
 
         LambdaQueryWrapper<PmBidWinningOpeningRef> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper.eq(PmBidWinningOpeningRef::getDemandId,demandId).eq(PmBidWinningOpeningRef::getWinningId,winningId);
+        lambdaQueryWrapper.eq(PmBidWinningOpeningRef::getDemandId, demandId).eq(PmBidWinningOpeningRef::getWinningId, winningId);
         List<PmBidWinningOpeningRef> pmBidWinningOpeningRefList = pmBidWinningOpeningRefService.list(lambdaQueryWrapper);
-        if(ObjectUtils.isEmpty(pmBidWinningOpeningRefList)){
+        if (ObjectUtils.isEmpty(pmBidWinningOpeningRefList)) {
             return AjaxResult.error("中标单位列表为空");
         }
 
@@ -916,7 +918,7 @@ public class PmPurchaseExecutionController extends BaseController {
         }
 
         LambdaQueryWrapper<PmBidOpening> lambdaQueryWrapper1 = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper1.in(PmBidOpening::getId,idList).orderByDesc(PmBidOpening::getScore);
+        lambdaQueryWrapper1.in(PmBidOpening::getId, idList).orderByDesc(PmBidOpening::getScore);
         List<PmBidOpening> pmBidOpeningList = this.pmBidOpeningService.list(lambdaQueryWrapper1);
 
         return success(pmBidOpeningList);
@@ -930,19 +932,19 @@ public class PmPurchaseExecutionController extends BaseController {
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:getBidWinningUnitHisList')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
     public AjaxResult getBidWinningUnitHisList(@NotEmpty(message = "需求ID不能为空")
-                                            @RequestParam(value = "demandId", required = true) Long demandId,
+                                               @RequestParam(value = "demandId", required = true) Long demandId,
                                                @NotEmpty(message = "回退序号不能为空")
                                                @RequestParam(value = "returnOrderNumber", required = true) Integer returnOrderNumber,
-                                            @NotEmpty(message = "开中标ID不能为空")
-                                            @RequestParam(value = "winningId", required = true) Long winningId) {
-        if( 0 == returnOrderNumber){
-            return getBidWinningUnitList(demandId,winningId);
+                                               @NotEmpty(message = "开中标ID不能为空")
+                                               @RequestParam(value = "winningId", required = true) Long winningId) {
+        if (0 == returnOrderNumber) {
+            return getBidWinningUnitList(demandId, winningId);
         }
         LambdaQueryWrapper<PmBidWinningOpeningRefHis> lambdaQueryWrapper = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper.eq(PmBidWinningOpeningRefHis::getDemandId,demandId).eq(PmBidWinningOpeningRefHis::getReturnOrderNumber,returnOrderNumber)
-                .eq(PmBidWinningOpeningRefHis::getWinningId,winningId);
+        lambdaQueryWrapper.eq(PmBidWinningOpeningRefHis::getDemandId, demandId).eq(PmBidWinningOpeningRefHis::getReturnOrderNumber, returnOrderNumber)
+                .eq(PmBidWinningOpeningRefHis::getWinningId, winningId);
         List<PmBidWinningOpeningRefHis> pmBidWinningOpeningRefHisList = pmBidWinningOpeningRefHisService.list(lambdaQueryWrapper);
-        if(ObjectUtils.isEmpty(pmBidWinningOpeningRefHisList)){
+        if (ObjectUtils.isEmpty(pmBidWinningOpeningRefHisList)) {
             return AjaxResult.error("中标单位列表为空");
         }
 
@@ -952,7 +954,7 @@ public class PmPurchaseExecutionController extends BaseController {
         }
 
         LambdaQueryWrapper<PmBidOpeningHis> lambdaQueryWrapper1 = new LambdaQueryWrapper<>();
-        lambdaQueryWrapper1.in(PmBidOpeningHis::getId,idList).eq(PmBidOpeningHis::getReturnOrderNumber,returnOrderNumber)
+        lambdaQueryWrapper1.in(PmBidOpeningHis::getId, idList).eq(PmBidOpeningHis::getReturnOrderNumber, returnOrderNumber)
                 .orderByDesc(PmBidOpeningHis::getScore);
         List<PmBidOpeningHis> pmBidOpeningHisList = this.pmBidOpeningHisService.list(lambdaQueryWrapper1);
 

+ 23 - 45
purchase-common/src/main/java/com/ozs/common/utils/DateUtils.java

@@ -10,6 +10,7 @@ import java.time.ZoneId;
 import java.time.ZonedDateTime;
 import java.util.Calendar;
 import java.util.Date;
+
 import org.apache.commons.lang3.time.DateFormatUtils;
 
 /**
@@ -17,8 +18,7 @@ import org.apache.commons.lang3.time.DateFormatUtils;
  *
  * @author ruoyi
  */
-public class DateUtils extends org.apache.commons.lang3.time.DateUtils
-{
+public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
     public static String YYYY = "yyyy";
 
     public static String YYYY_MM = "yyyy-MM";
@@ -39,8 +39,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
      *
      * @return Date() 当前日期
      */
-    public static Date getNowDate()
-    {
+    public static Date getNowDate() {
         return new Date();
     }
 
@@ -49,44 +48,34 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
      *
      * @return String
      */
-    public static String getDate()
-    {
+    public static String getDate() {
         return dateTimeNow(YYYY_MM_DD);
     }
 
-    public static final String getTime()
-    {
+    public static final String getTime() {
         return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
     }
 
-    public static final String dateTimeNow()
-    {
+    public static final String dateTimeNow() {
         return dateTimeNow(YYYYMMDDHHMMSS);
     }
 
-    public static final String dateTimeNow(final String format)
-    {
+    public static final String dateTimeNow(final String format) {
         return parseDateToStr(format, new Date());
     }
 
-    public static final String dateTime(final Date date)
-    {
+    public static final String dateTime(final Date date) {
         return parseDateToStr(YYYY_MM_DD, date);
     }
 
-    public static final String parseDateToStr(final String format, final Date date)
-    {
+    public static final String parseDateToStr(final String format, final Date date) {
         return new SimpleDateFormat(format).format(date);
     }
 
-    public static final Date dateTime(final String format, final String ts)
-    {
-        try
-        {
+    public static final Date dateTime(final String format, final String ts) {
+        try {
             return new SimpleDateFormat(format).parse(ts);
-        }
-        catch (ParseException e)
-        {
+        } catch (ParseException e) {
             throw new RuntimeException(e);
         }
     }
@@ -94,8 +83,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 日期路径 即年/月/日 如2018/08/08
      */
-    public static final String datePath()
-    {
+    public static final String datePath() {
         Date now = new Date();
         return DateFormatUtils.format(now, "yyyy/MM/dd");
     }
@@ -103,8 +91,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 日期路径 即年/月/日 如20180808
      */
-    public static final String dateTime()
-    {
+    public static final String dateTime() {
         Date now = new Date();
         return DateFormatUtils.format(now, "yyyyMMdd");
     }
@@ -112,18 +99,13 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 日期型字符串转化为日期 格式
      */
-    public static Date parseDate(Object str)
-    {
-        if (str == null)
-        {
+    public static Date parseDate(Object str) {
+        if (str == null) {
             return null;
         }
-        try
-        {
+        try {
             return parseDate(str.toString(), parsePatterns);
-        }
-        catch (ParseException e)
-        {
+        } catch (ParseException e) {
             return null;
         }
     }
@@ -131,8 +113,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 获取服务器启动时间
      */
-    public static Date getServerStartDate()
-    {
+    public static Date getServerStartDate() {
         long time = ManagementFactory.getRuntimeMXBean().getStartTime();
         return new Date(time);
     }
@@ -140,16 +121,14 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 计算相差天数
      */
-    public static int differentDaysByMillisecond(Date date1, Date date2)
-    {
-        return Math.abs((int) ((date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)));
+    public static int differentDaysByMillisecond(Date date1, Date date2) {
+        return (int) ((date1.getTime() - date2.getTime()) / (1000 * 3600 * 24));
     }
 
     /**
      * 计算两个时间差
      */
-    public static String getDatePoor(Date endDate, Date nowDate)
-    {
+    public static String getDatePoor(Date endDate, Date nowDate) {
         long nd = 1000 * 24 * 60 * 60;
         long nh = 1000 * 60 * 60;
         long nm = 1000 * 60;
@@ -170,8 +149,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
     /**
      * 增加 LocalDateTime ==> Date
      */
-    public static Date toDate(LocalDateTime temporalAccessor)
-    {
+    public static Date toDate(LocalDateTime temporalAccessor) {
         ZonedDateTime zdt = temporalAccessor.atZone(ZoneId.systemDefault());
         return Date.from(zdt.toInstant());
     }

+ 1 - 1
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

@@ -823,7 +823,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
 
         //采购完成时间:根据数据阈值中设置的采购完成时间进行判断,进行预警
         int diff2 = DateUtils.differentDaysByMillisecond(pmDemand.getPlanPurchaseFinishTime(), DateUtils.parseDate(DateUtils.getDate()));
-        if (ObjectUtils.isEmpty(pmDemand.getRealPurchaseFinishTime()) && diff2 >= setting2) {
+        if (ObjectUtils.isEmpty(pmDemand.getRealPurchaseFinishTime()) && diff2 > 0 && diff2 >= setting2) {
             log.info("******** 采购完成预警: " + pmDemand.getProjectName());
             pmDemandUpdate.setWarnStatus(WarnStatus.PURCHASE_FINISH_WARNING.getCode());
         } else {