suntianwu 2 vuotta sitten
vanhempi
commit
6b8647deb7
20 muutettua tiedostoa jossa 297 lisäystä ja 97 poistoa
  1. 52 29
      purchase-admin/src/main/java/com/ozs/web/controller/pm/PmPurchaseExecutionController.java
  2. 8 3
      purchase-system/src/main/java/com/ozs/pm/doman/PmBidFailureHis.java
  3. 8 3
      purchase-system/src/main/java/com/ozs/pm/doman/PmBidOpeningHis.java
  4. 8 3
      purchase-system/src/main/java/com/ozs/pm/doman/PmBidWinningHis.java
  5. 8 3
      purchase-system/src/main/java/com/ozs/pm/doman/PmBidWinningOpeningRefHis.java
  6. 8 3
      purchase-system/src/main/java/com/ozs/pm/doman/PmBookBuildingHis.java
  7. 8 3
      purchase-system/src/main/java/com/ozs/pm/doman/PmCallQuestionHis.java
  8. 4 0
      purchase-system/src/main/java/com/ozs/pm/doman/PmDemand.java
  9. 8 3
      purchase-system/src/main/java/com/ozs/pm/doman/PmDemandExpertRefHis.java
  10. 7 4
      purchase-system/src/main/java/com/ozs/pm/doman/PmDemandHis.java
  11. 8 3
      purchase-system/src/main/java/com/ozs/pm/doman/PmExpertFeedbackHis.java
  12. 8 3
      purchase-system/src/main/java/com/ozs/pm/doman/PmProcurementDocumentsReviewHis.java
  13. 8 3
      purchase-system/src/main/java/com/ozs/pm/doman/PmReleaseAnnouncementHis.java
  14. 3 1
      purchase-system/src/main/java/com/ozs/pm/doman/vo/requestVo/PmDemandReqVo.java
  15. 11 0
      purchase-system/src/main/java/com/ozs/pm/doman/vo/responseVo/PmDemandResVo.java
  16. 8 19
      purchase-system/src/main/java/com/ozs/pm/doman/vo/responseVo/PmPurchaseExecutionResVo.java
  17. 0 1
      purchase-system/src/main/java/com/ozs/pm/service/IPmDemandService.java
  18. 9 0
      purchase-system/src/main/java/com/ozs/pm/service/PmDemandHisService.java
  19. 96 2
      purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandHisServiceImpl.java
  20. 27 11
      purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java

+ 52 - 29
purchase-admin/src/main/java/com/ozs/web/controller/pm/PmPurchaseExecutionController.java

@@ -50,6 +50,8 @@ public class PmPurchaseExecutionController extends BaseController {
     @Autowired
     private IPmDemandService pmDemandService;
     @Autowired
+    private PmDemandHisService pmDemandHisService;
+    @Autowired
     private BaseAgencyService baseAgencyService;
     @Autowired
     private BaseExpertService baseExpertService;
@@ -113,7 +115,8 @@ public class PmPurchaseExecutionController extends BaseController {
     public AjaxResult selectAgency(@NotEmpty(message = "采购需求ID不能为空")
                                    @RequestParam(value = "demandId", required = true) Long demandId,
                                    @NotEmpty(message = "代理机构ID不能为空")
-                                   @RequestParam(value = "agencyId", required = true) Long agencyId) {
+                                   @RequestParam(value = "agencyId", required = true) Long agencyId,
+                                   @RequestParam(value = "purchaseTaskDocumentNumber", required = false) String purchaseTaskDocumentNumber) {
 
         PmDemand pmDemand = pmDemandService.getById(demandId);
         if(ObjectUtils.isEmpty(pmDemand)){
@@ -127,6 +130,7 @@ public class PmPurchaseExecutionController extends BaseController {
         pmDemandUpdate.setDemandId(demandId);
         pmDemandUpdate.setProjectStatus(PmProjectStatus.EXPERT_FEEDBACK.getCode());
         pmDemandUpdate.setAgencyId(agencyId);
+        pmDemandUpdate.setPurchaseTaskDocumentNumber(purchaseTaskDocumentNumber);
         pmDemandUpdate.setExtractAgencyTime(new Date());
         pmDemandUpdate.setUpdateTime(pmDemandUpdate.getExtractAgencyTime());
         pmDemandUpdate.setUpdateBy(getUserId().toString());
@@ -141,7 +145,8 @@ public class PmPurchaseExecutionController extends BaseController {
     @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)){
@@ -161,6 +166,7 @@ public class PmPurchaseExecutionController extends BaseController {
         pmDemandUpdate.setDemandId(demandId);
         pmDemandUpdate.setProjectStatus(PmProjectStatus.EXPERT_FEEDBACK.getCode());
         pmDemandUpdate.setAgencyId(any.getId());
+        pmDemandUpdate.setPurchaseTaskDocumentNumber(purchaseTaskDocumentNumber);
         pmDemandUpdate.setExtractAgencyTime(new Date());
         pmDemandUpdate.setUpdateTime(pmDemandUpdate.getExtractAgencyTime());
         pmDemandUpdate.setUpdateBy(getUserId().toString());
@@ -274,10 +280,15 @@ public class PmPurchaseExecutionController extends BaseController {
             if(ObjectUtils.isEmpty(pmDemand)){
                 return error("参数错误");
             }
-
+            if("1".equals(pmCallQuestionReqVo.getCallQuestion())) { //有质疑
+                if (ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())) {
+                    return error("质疑时间不能为空");
+                }
+            }
             PmCallQuestion pmCallQuestion = new PmCallQuestion();
             BeanUtils.copyProperties(pmCallQuestionReqVo,pmCallQuestion);
             pmCallQuestion.setType("0");
+
            if(pmCallQuestionService.save(pmCallQuestion)) {
                if("1".equals(pmCallQuestion.getCallQuestion())) { //有质疑
                    List<SysFileRef> sysFileRefs = pmCallQuestionReqVo.getSysFileRefs();
@@ -531,6 +542,11 @@ public class PmPurchaseExecutionController extends BaseController {
             if(ObjectUtils.isEmpty(pmDemand)){
                 return error("参数错误");
             }
+            if("1".equals(pmCallQuestionReqVo.getCallQuestion())) { //有质疑
+                if (ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())) {
+                    return error("质疑时间不能为空");
+                }
+            }
             LambdaQueryWrapper<PmBidFailure> lambdaQueryWrapper = new LambdaQueryWrapper<>();
             lambdaQueryWrapper.eq(PmBidFailure::getDemandId,pmDemand.getDemandId())
                     .orderByDesc(PmBidFailure::getBidFailureTime)
@@ -542,12 +558,9 @@ public class PmPurchaseExecutionController extends BaseController {
             PmBidFailure bidFailureUpdate = new PmBidFailure();
             bidFailureUpdate.setId(bidFailure.getId());
             bidFailureUpdate.setCallQuestion(pmCallQuestionReqVo.getCallQuestion());
+            bidFailureUpdate.setCallQuestionTime(pmCallQuestionReqVo.getCallQuestionTime());
+
             if("1".equals(bidFailureUpdate.getCallQuestion())){ //有质疑
-                if(!ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())){
-                    bidFailureUpdate.setCallQuestionTime(pmCallQuestionReqVo.getCallQuestionTime());
-                } else {
-                    bidFailureUpdate.setCallQuestionTime(new Date());
-                }
                 List<SysFileRef> sysFileRefs = pmCallQuestionReqVo.getSysFileRefs();
                 pmDemandService.uploadFile(bidFailureUpdate.getId(), SysFileRefEnum.PM_BID_FAILURE_CALL_QUESTION.getType(),sysFileRefs,getUserId().toString());
             }
@@ -568,19 +581,7 @@ public class PmPurchaseExecutionController extends BaseController {
     public AjaxResult returnBidFailure(@NotEmpty(message = "采购需求id不能为空")
                                            @RequestParam(value = "demandId", required = true) Long demandId) {
         try {
-            PmDemand pmDemand = pmDemandService.getById(demandId);
-            if(ObjectUtils.isEmpty(pmDemand)){
-                return error("参数错误");
-            }
-            //TODO 把相关表数据存入历史表,清空相关表数据
-
-
-
-            pmDemand.setProjectStatus(PmProjectStatus.WASTE_BID_RETURN.getCode());
-            pmDemand.setUpdateBy(getUserId().toString());
-            pmDemand.setUpdateTime(new Date());
-            return toAjax(pmDemandService.updateById(pmDemand));
-
+            return toAjax(pmDemandHisService.returnBidFailure(demandId, getUserId().toString()));
         }  catch (Exception e) {
             return error(e.getMessage());
         }
@@ -601,17 +602,14 @@ public class PmPurchaseExecutionController extends BaseController {
             if(ObjectUtils.isEmpty(pmDemand)){
                 return error("参数错误");
             }
-
+            if("1".equals(pmCallQuestionReqVo.getCallQuestion())) { //有质疑
+                if (ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())) {
+                    return error("质疑时间不能为空");
+                }
+            }
             PmCallQuestion pmCallQuestion = new PmCallQuestion();
             BeanUtils.copyProperties(pmCallQuestionReqVo,pmCallQuestion);
             pmCallQuestion.setType("1");
-            if("1".equals(pmCallQuestion.getCallQuestion())) { //有质疑
-                if (!ObjectUtils.isEmpty(pmCallQuestionReqVo.getCallQuestionTime())) {
-                    pmCallQuestion.setCallQuestionTime(pmCallQuestionReqVo.getCallQuestionTime());
-                } else {
-                    pmCallQuestion.setCallQuestionTime(new Date());
-                }
-            }
             if(pmCallQuestionService.save(pmCallQuestion)) {
                 if("1".equals(pmCallQuestion.getCallQuestion())) { //有质疑
                     List<SysFileRef> sysFileRefs = pmCallQuestionReqVo.getSysFileRefs();
@@ -677,6 +675,31 @@ public class PmPurchaseExecutionController extends BaseController {
         return success(pmDemandService.selectPmDemandByDemandId(pmDemandReqVo.getDemandId(),pmDemandReqVo.getDetailType()));
     }
 
+    /**
+     * 查看历史详情
+     */
+    @ApiOperation(value = "查看详情", notes = "必传demandId和详情类型(1项目计划,2需求建档,3任务下达,4中标信息,5合同信息,6建设情况),returnOrderNumber(回退序号,0当前/1第一次回退/2第二次回退...),其他字段不传")
+    @PostMapping("/view")
+    @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:view')")
+    @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.QUERY)
+    public AjaxResult viewHis(@RequestBody PmDemandReqVo pmDemandReqVo) {
+        if(pmDemandReqVo.getDemandId() == null){
+            return AjaxResult.error("demandId不能为空");
+        }
+        if(ObjectUtils.isEmpty(pmDemandReqVo.getDetailType())){
+            return AjaxResult.error("详情的类型不能为空");
+        }
+        if(ObjectUtils.isEmpty(pmDemandReqVo.getReturnOrderNumber())){
+            return AjaxResult.error("回退序号不能为空");
+        }
+        if(0 == pmDemandReqVo.getReturnOrderNumber()){
+            return view(pmDemandReqVo);
+        } else {
+            return success(pmDemandHisService.selectPmDemandHisByDemandId(pmDemandReqVo.getDemandId(),pmDemandReqVo.getDetailType(),pmDemandReqVo.getReturnOrderNumber()));
+        }
+
+    }
+
     /**
      * 专家信息查看详情列表
      */

+ 8 - 3
purchase-system/src/main/java/com/ozs/pm/doman/PmBidFailureHis.java

@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
  * 流标基本情况表历史表(PmBidFailureHis)实体类
  *
  * @author makejava
- * @since 2023-03-06 17:04:27
+ * @since 2023-03-06 23:22:08
  */
 
 @Data
@@ -31,9 +31,14 @@ import lombok.experimental.Accessors;
 @TableName("pm_bid_failure_his")
 @ApiModel(value = "流标基本情况表历史表", description = "")
 public class PmBidFailureHis implements Serializable {
-    private static final long serialVersionUID = -93570728508547250L;
+    private static final long serialVersionUID = 617102349635142094L;
 
-    @TableId(value = "ID", type = IdType.AUTO)
+    @TableId(value = "HIS_ID", type = IdType.AUTO)
+    private Long hisId;
+
+
+    @ApiModelProperty("主表主键")
+    @TableField("ID")
     private Long id;
 
 

+ 8 - 3
purchase-system/src/main/java/com/ozs/pm/doman/PmBidOpeningHis.java

@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
  * 开标信息表历史表(PmBidOpeningHis)实体类
  *
  * @author makejava
- * @since 2023-03-06 17:04:28
+ * @since 2023-03-06 23:22:08
  */
 
 @Data
@@ -31,9 +31,14 @@ import lombok.experimental.Accessors;
 @TableName("pm_bid_opening_his")
 @ApiModel(value = "开标信息表历史表", description = "")
 public class PmBidOpeningHis implements Serializable {
-    private static final long serialVersionUID = 194401321537515160L;
+    private static final long serialVersionUID = -67862303564531496L;
 
-    @TableId(value = "ID", type = IdType.AUTO)
+    @TableId(value = "HIS_ID", type = IdType.AUTO)
+    private Long hisId;
+
+
+    @ApiModelProperty("主表主键")
+    @TableField("ID")
     private Long id;
 
 

+ 8 - 3
purchase-system/src/main/java/com/ozs/pm/doman/PmBidWinningHis.java

@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
  * 中标基本情况表历史表(PmBidWinningHis)实体类
  *
  * @author makejava
- * @since 2023-03-06 17:04:26
+ * @since 2023-03-06 23:22:08
  */
 
 @Data
@@ -31,9 +31,14 @@ import lombok.experimental.Accessors;
 @TableName("pm_bid_winning_his")
 @ApiModel(value = "中标基本情况表历史表", description = "")
 public class PmBidWinningHis implements Serializable {
-    private static final long serialVersionUID = -31378210682126750L;
+    private static final long serialVersionUID = -27629594014176432L;
 
-    @TableId(value = "ID", type = IdType.AUTO)
+    @TableId(value = "HIS_ID", type = IdType.AUTO)
+    private Long hisId;
+
+
+    @ApiModelProperty("主表主键")
+    @TableField("ID")
     private Long id;
 
 

+ 8 - 3
purchase-system/src/main/java/com/ozs/pm/doman/PmBidWinningOpeningRefHis.java

@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
  * 中标开标关联表历史表(PmBidWinningOpeningRefHis)实体类
  *
  * @author makejava
- * @since 2023-03-06 17:04:29
+ * @since 2023-03-06 23:22:08
  */
 
 @Data
@@ -31,9 +31,14 @@ import lombok.experimental.Accessors;
 @TableName("pm_bid_winning_opening_ref_his")
 @ApiModel(value = "中标开标关联表历史表", description = "")
 public class PmBidWinningOpeningRefHis implements Serializable {
-    private static final long serialVersionUID = -33359392883321337L;
+    private static final long serialVersionUID = -97173124967861825L;
 
-    @TableId(value = "ID", type = IdType.AUTO)
+    @TableId(value = "HIS_ID", type = IdType.AUTO)
+    private Long hisId;
+
+
+    @ApiModelProperty("主表主键")
+    @TableField("ID")
     private Long id;
 
 

+ 8 - 3
purchase-system/src/main/java/com/ozs/pm/doman/PmBookBuildingHis.java

@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
  * 需求建档表历史表(PmBookBuildingHis)实体类
  *
  * @author makejava
- * @since 2023-03-06 17:04:28
+ * @since 2023-03-06 23:22:07
  */
 
 @Data
@@ -31,9 +31,14 @@ import lombok.experimental.Accessors;
 @TableName("pm_book_building_his")
 @ApiModel(value = "需求建档表历史表", description = "")
 public class PmBookBuildingHis implements Serializable {
-    private static final long serialVersionUID = 929087670050944831L;
+    private static final long serialVersionUID = -82887734072906881L;
 
-    @TableId(value = "ID", type = IdType.AUTO)
+    @TableId(value = "HIS_ID", type = IdType.AUTO)
+    private Long hisId;
+
+
+    @ApiModelProperty("主表主键")
+    @TableField("ID")
     private Long id;
 
 

+ 8 - 3
purchase-system/src/main/java/com/ozs/pm/doman/PmCallQuestionHis.java

@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
  * 质疑表历史表(PmCallQuestionHis)实体类
  *
  * @author makejava
- * @since 2023-03-06 17:04:29
+ * @since 2023-03-06 23:22:07
  */
 
 @Data
@@ -31,9 +31,14 @@ import lombok.experimental.Accessors;
 @TableName("pm_call_question_his")
 @ApiModel(value = "质疑表历史表", description = "")
 public class PmCallQuestionHis implements Serializable {
-    private static final long serialVersionUID = -39946985232863235L;
+    private static final long serialVersionUID = -72652060293278758L;
 
-    @TableId(value = "ID", type = IdType.AUTO)
+    @TableId(value = "HIS_ID", type = IdType.AUTO)
+    private Long hisId;
+
+
+    @ApiModelProperty("主表主键")
+    @TableField("ID")
     private Long id;
 
 

+ 4 - 0
purchase-system/src/main/java/com/ozs/pm/doman/PmDemand.java

@@ -164,6 +164,10 @@ public class PmDemand implements Serializable {
     private Date extractAgencyTime;
 
 
+    @ApiModelProperty("采购任务文号")
+    @TableField("PURCHASE_TASK_DOCUMENT_NUMBER")
+    private String purchaseTaskDocumentNumber;
+
     @ApiModelProperty("0:没有关联专家,1:有关联专家")
     @TableField("HAS_EXPERT")
     private String hasExpert;

+ 8 - 3
purchase-system/src/main/java/com/ozs/pm/doman/PmDemandExpertRefHis.java

@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
  * 项目专家关联表历史表(PmDemandExpertRefHis)实体类
  *
  * @author makejava
- * @since 2023-03-06 17:04:30
+ * @since 2023-03-06 23:22:07
  */
 
 @Data
@@ -31,9 +31,14 @@ import lombok.experimental.Accessors;
 @TableName("pm_demand_expert_ref_his")
 @ApiModel(value = "项目专家关联表历史表", description = "")
 public class PmDemandExpertRefHis implements Serializable {
-    private static final long serialVersionUID = 172270792062500021L;
+    private static final long serialVersionUID = -27650735754235826L;
 
-    @TableId(value = "ID", type = IdType.AUTO)
+    @TableId(value = "HIS_ID", type = IdType.AUTO)
+    private Long hisId;
+
+
+    @ApiModelProperty("主表主键")
+    @TableField("ID")
     private Long id;
 
 

+ 7 - 4
purchase-system/src/main/java/com/ozs/pm/doman/PmDemandHis.java

@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
  * 采购需求表历史表(PmDemandHis)实体类
  *
  * @author makejava
- * @since 2023-03-06 17:04:31
+ * @since 2023-03-06 23:22:07
  */
 
 @Data
@@ -31,10 +31,10 @@ import lombok.experimental.Accessors;
 @TableName("pm_demand_his")
 @ApiModel(value = "采购需求表历史表", description = "")
 public class PmDemandHis implements Serializable {
-    private static final long serialVersionUID = -38293690941663221L;
+    private static final long serialVersionUID = -10048698510514416L;
 
-    @TableId(value = "ID", type = IdType.AUTO)
-    private Long id;
+    @TableId(value = "HIS_ID", type = IdType.AUTO)
+    private Long hisId;
 
 
     @ApiModelProperty("主键")
@@ -171,6 +171,9 @@ public class PmDemandHis implements Serializable {
     @TableField("EXTRACT_AGENCY_TIME")
     private Date extractAgencyTime;
 
+    @ApiModelProperty("采购任务文号")
+    @TableField("PURCHASE_TASK_DOCUMENT_NUMBER")
+    private String purchaseTaskDocumentNumber;
 
     @ApiModelProperty("创建者")
     @TableField("CREATE_BY")

+ 8 - 3
purchase-system/src/main/java/com/ozs/pm/doman/PmExpertFeedbackHis.java

@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
  * 专家意见反馈表历史表(PmExpertFeedbackHis)实体类
  *
  * @author makejava
- * @since 2023-03-06 17:04:32
+ * @since 2023-03-06 23:22:07
  */
 
 @Data
@@ -31,9 +31,14 @@ import lombok.experimental.Accessors;
 @TableName("pm_expert_feedback_his")
 @ApiModel(value = "专家意见反馈表历史表", description = "")
 public class PmExpertFeedbackHis implements Serializable {
-    private static final long serialVersionUID = 211349998389199296L;
+    private static final long serialVersionUID = 624456489553905491L;
 
-    @TableId(value = "ID", type = IdType.AUTO)
+    @TableId(value = "HIS_ID", type = IdType.AUTO)
+    private Long hisId;
+
+
+    @ApiModelProperty("主表主键")
+    @TableField("ID")
     private Long id;
 
 

+ 8 - 3
purchase-system/src/main/java/com/ozs/pm/doman/PmProcurementDocumentsReviewHis.java

@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
  * 采购文件编制审核表历史表(PmProcurementDocumentsReviewHis)实体类
  *
  * @author makejava
- * @since 2023-03-06 17:04:32
+ * @since 2023-03-06 23:22:06
  */
 
 @Data
@@ -31,9 +31,14 @@ import lombok.experimental.Accessors;
 @TableName("pm_procurement_documents_review_his")
 @ApiModel(value = "采购文件编制审核表历史表", description = "")
 public class PmProcurementDocumentsReviewHis implements Serializable {
-    private static final long serialVersionUID = 228137517950776009L;
+    private static final long serialVersionUID = -60059199420679767L;
 
-    @TableId(value = "ID", type = IdType.AUTO)
+    @TableId(value = "HIS_ID", type = IdType.AUTO)
+    private Long hisId;
+
+
+    @ApiModelProperty("主表主键")
+    @TableField("ID")
     private Long id;
 
 

+ 8 - 3
purchase-system/src/main/java/com/ozs/pm/doman/PmReleaseAnnouncementHis.java

@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
  * 发布公告表历史表(PmReleaseAnnouncementHis)实体类
  *
  * @author makejava
- * @since 2023-03-06 17:04:33
+ * @since 2023-03-06 23:22:04
  */
 
 @Data
@@ -31,9 +31,14 @@ import lombok.experimental.Accessors;
 @TableName("pm_release_announcement_his")
 @ApiModel(value = "发布公告表历史表", description = "")
 public class PmReleaseAnnouncementHis implements Serializable {
-    private static final long serialVersionUID = 415166300363022418L;
+    private static final long serialVersionUID = 809634277459668205L;
 
-    @TableId(value = "ID", type = IdType.AUTO)
+    @TableId(value = "HIS_ID", type = IdType.AUTO)
+    private Long hisId;
+
+
+    @ApiModelProperty("主表主键")
+    @TableField("ID")
     private Long id;
 
 

+ 3 - 1
purchase-system/src/main/java/com/ozs/pm/doman/vo/requestVo/PmDemandReqVo.java

@@ -133,6 +133,8 @@ public class PmDemandReqVo extends PageVo {
     private Long userId;
     private Boolean isAdmin;
     //查询全部or指定部门
-    List<Integer> deptList;
+    private List<Integer> deptList;
 
+    @ApiModelProperty("回退序号")
+    private Integer returnOrderNumber;
 }

+ 11 - 0
purchase-system/src/main/java/com/ozs/pm/doman/vo/responseVo/PmDemandResVo.java

@@ -226,6 +226,17 @@ public class PmDemandResVo extends BaseEntity
     @ApiModelProperty("调整建议")
     private String adjustAdvice;
 
+    /** 抽取招标代理机构id */
+    @ApiModelProperty("抽取招标代理机构id")
+    private Long agencyId;
+
+    /** 抽取招标代理机构时间 */
+    @ApiModelProperty("抽取招标代理机构时间")
+    private Date extractAgencyTime;
+
+    @ApiModelProperty("采购任务文号")
+    private String purchaseTaskDocumentNumber;
+
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty("任务下达时间")
     private Date taskReleaseTime;

+ 8 - 19
purchase-system/src/main/java/com/ozs/pm/doman/vo/responseVo/PmPurchaseExecutionResVo.java

@@ -50,7 +50,6 @@ public class PmPurchaseExecutionResVo {
 
     @ApiModelProperty("标前质疑投诉列表")
     private List<PmCallQuestionResVo> pmCallQuestionPreResVoList;
-
     @ApiModelProperty("标前质疑投诉附件")
     private List<SysFileInfo> pmCallQuestionPreFileInfos;
 
@@ -66,35 +65,25 @@ public class PmPurchaseExecutionResVo {
     @ApiModelProperty("评标结果公告附件")
     private List<SysFileInfo> pmBidWinningFileInfos;
 
-    @ApiModelProperty("标前是否有质疑,1是,0否")
-    private String preBidCallQuestion;
-    @ApiModelProperty("标前是否有质疑,1是,0否")
-    private String preBidCallQuestionName;
-    @ApiModelProperty("标前质疑时间")
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    private Date preBidCallQuestionTime;
-
-    @ApiModelProperty("标后是否有质疑,1是,0否")
-    private String callQuestion;
-    @ApiModelProperty("标后是否有质疑,1是,0否")
-    private String callQuestionName;
-    @ApiModelProperty("标后质疑时间")
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    private Date callQuestionTime;
-
     @ApiModelProperty("标后质疑列表")
     private List<PmCallQuestionResVo> pmCallQuestionPostResVoList;
     @ApiModelProperty("标后质疑情况附件")
     private List<SysFileInfo> pmCallRequestPostFileInfos;
 
+
     @ApiModelProperty("流标信息列表")
     private List<PmBidFailureResVo> pmBidFailureResVoList;
     @ApiModelProperty("流标信息附件")
     private List<SysFileInfo> pmBidFailureFileInfos;
 
+    @ApiModelProperty("流废标处置-质疑列表")
+    private List<PmCallQuestionResVo> pmCallQuestionBidFailureResVoList;
+    @ApiModelProperty("流废标处置-质疑情况附件")
+    private List<SysFileInfo> pmCallRequestBidFailureFileInfos;
+
     /**
-     * 已上传的关联附件信息
+     * 中标通知书
      */
-    @ApiModelProperty("已上传的关联附件信息")
+    @ApiModelProperty("中标通知书")
     private List<SysFileInfo> fileInfos;
 }

+ 0 - 1
purchase-system/src/main/java/com/ozs/pm/service/IPmDemandService.java

@@ -8,7 +8,6 @@ import com.ozs.base.domain.vo.BaseExpertVo;
 import com.ozs.pm.doman.PmDemand;
 import com.ozs.pm.doman.vo.requestVo.*;
 import com.ozs.pm.doman.vo.responseVo.PmDemandResVo;
-import com.ozs.pm.doman.vo.responseVo.PmFlowChartResVo;
 import com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo;
 import com.ozs.system.domain.SysFileRef;
 

+ 9 - 0
purchase-system/src/main/java/com/ozs/pm/service/PmDemandHisService.java

@@ -2,6 +2,7 @@ package com.ozs.pm.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ozs.pm.doman.PmDemandHis;
+import com.ozs.pm.doman.vo.responseVo.PmDemandResVo;
 
 /**
  * 采购需求表历史表(PmDemandHis)表服务接口
@@ -10,5 +11,13 @@ import com.ozs.pm.doman.PmDemandHis;
  * @since 2023-03-06 16:43:50
  */
 public interface PmDemandHisService extends IService<PmDemandHis> {
+    boolean returnBidFailure(Long demandId,String updateBy) throws Exception;
 
+    /**
+     * 查询采购需求
+     *
+     * @param demandId 采购需求主键
+     * @return 采购需求
+     */
+    PmDemandResVo selectPmDemandHisByDemandId(Long demandId, String detailType,Integer returnOrderNumber);
 }

+ 96 - 2
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandHisServiceImpl.java

@@ -1,10 +1,27 @@
 package com.ozs.pm.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ozs.base.domain.BaseAgency;
+import com.ozs.common.enums.*;
+import com.ozs.common.utils.StringUtils;
+import com.ozs.common.utils.bean.BeanUtils;
+import com.ozs.plan.doman.ProvisionalPlan;
+import com.ozs.pm.doman.*;
+import com.ozs.pm.doman.vo.responseVo.*;
 import com.ozs.pm.mapper.PmDemandHisMapper;
-import com.ozs.pm.doman.PmDemandHis;
-import com.ozs.pm.service.PmDemandHisService;
+import com.ozs.pm.service.*;
+import com.ozs.system.domain.SysFileInfo;
+import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.ObjectUtils;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 采购需求表历史表(PmDemandHis)表服务实现类
@@ -14,5 +31,82 @@ import org.springframework.stereotype.Service;
  */
 @Service
 public class PmDemandHisServiceImpl extends ServiceImpl<PmDemandHisMapper, PmDemandHis> implements PmDemandHisService {
+    @Autowired
+    private PmBidFailureHisService pmBidFailureHisService;
+    @Autowired
+    private PmBidOpeningHisService pmBidOpeningHisService;
+    @Autowired
+    private PmBidWinningHisService pmBidWinningHisService;
+    @Autowired
+    private PmBidWinningOpeningRefHisService pmBidWinningOpeningRefHisService;
+    @Autowired
+    private PmBookBuildingHisService pmBookBuildingHisService;
+    @Autowired
+    private PmCallQuestionHisService pmCallQuestionHisService;
+    @Autowired
+    private PmDemandExpertRefHisService pmDemandExpertRefHisService;
+    @Autowired
+    private PmDemandHisService pmDemandHisService;
+    @Autowired
+    private PmExpertFeedbackHisService pmExpertFeedbackHisService;
+    @Autowired
+    private PmProcurementDocumentsReviewHisService pmProcurementDocumentsReviewHisService;
+    @Autowired
+    private PmReleaseAnnouncementHisService pmReleaseAnnouncementHisService;
+
+    /**
+     * 流废标退回
+     * @param demandId
+     * @param updateBy
+     * @return
+     * @throws Exception
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean returnBidFailure(Long demandId,String updateBy) throws Exception {
+//        PmDemand pmDemand = this.getById(demandId);
+//        if(ObjectUtils.isEmpty(pmDemand)){
+//            throw new Exception("参数错误");
+//        }
+//        //把相关表数据存入历史表,清空相关表数据
+//        PmDemandHis pmDemandHis = new PmDemandHis();
+//        BeanUtils.copyProperties(pmDemand,pmDemandHis);
+//
+//        LambdaQueryWrapper<PmDemandHis> pmDemandHisLambdaQueryWrapper = new LambdaQueryWrapper<>();
+//        pmDemandHisLambdaQueryWrapper.eq(PmDemandHis::getDemandId,demandId)
+//                .orderByDesc(PmDemandHis::getReturnOrderNumber).last(" limit 1");
+//        PmDemandHis pmDemandHisDb= this.pmDemandHisService.getOne(pmDemandHisLambdaQueryWrapper);
+//        if(pmDemandHisDb != null){
+//            pmDemandHis.setReturnOrderNumber(pmDemandHisDb.getReturnOrderNumber() + 1);
+//        } else {
+//            pmDemandHis.setReturnOrderNumber(1);
+//        }
+//        if(this.pmDemandHisService.save(pmDemandHis)){
+//            UpdateWrapper<PmDemand> pmDemandUpdateWrapper = new UpdateWrapper<>();
+//            pmDemandUpdateWrapper.lambda()
+//                    .set(PmDemand::getAgencyId,null)
+//                    .set(PmDemand::getExtractAgencyTime,null)
+//                    .set(PmDemand::getPurchaseTaskDocumentNumber,null)
+//                    .set(PmDemand::getTaskReleaseTime,null)
+//                    .set(PmDemand::getHasExpert,0)
+//                    .set(PmDemand::getProjectStatus,PmProjectStatus.WASTE_BID_RETURN.getCode())
+//                    .set(PmDemand::getUpdateBy,updateBy)
+//                    .set(PmDemand::getUpdateTime,new Date())
+//                    .eq(PmDemand::getDemandId,demandId);
+//            this.update(pmDemandUpdateWrapper);
+//        }
+
+        return true;
+    }
 
+    /**
+     * 查询采购需求
+     *
+     * @param demandId 采购需求主键
+     * @return 采购需求
+     */
+    @Override
+    public PmDemandResVo selectPmDemandHisByDemandId(Long demandId, String detailType,Integer returnOrderNumber) {
+        return null;
+    }
 }

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

@@ -39,7 +39,6 @@ import com.ozs.system.domain.SysFileRef;
 import com.ozs.system.domain.vo.SysRegionVO;
 import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
 import com.ozs.system.mapper.SysDeptMapper;
-import com.ozs.system.mapper.SysRoleMapper;
 import com.ozs.system.service.*;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -69,8 +68,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     private SysFileService fileService;
     @Autowired
     private SysFileRefService sysFileRefService;
-    @Autowired
-    private IPmFlowChartService iPmFlowChartService;
+
     @Autowired
     private PmReleaseAnnouncementService pmReleaseAnnouncementService;
     @Autowired
@@ -113,9 +111,6 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     @Autowired
     private ISysRegionService iSysRegionService;
 
-    @Autowired
-    private SysRoleMapper sysRoleMapper;
-
     @Autowired
     private ISysUserService userService;
 
@@ -132,6 +127,8 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     private PmExpertFeedbackService pmExpertFeedbackService;
     @Autowired
     private PmProcurementDocumentsReviewService pmProcurementDocumentsReviewService;
+
+
     /**
      * 查询采购需求
      *
@@ -393,26 +390,45 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                     pmPurchaseExecutionResVo.setPmCallRequestPostFileInfos(fileInfosAll);
                 }
 
-
                 //流标情况
                 LambdaQueryWrapper<PmBidFailure> lambdaQueryWrapper2 = new LambdaQueryWrapper<>();
                 lambdaQueryWrapper2.eq(PmBidFailure::getDemandId, demandId).orderByDesc(PmBidFailure::getBidFailureTime);
                 List<PmBidFailure> pmBidFailureList = this.pmBidFailureService.list(lambdaQueryWrapper2);
                 if (!ObjectUtils.isEmpty(pmBidFailureList)) {
                     List<PmBidFailureResVo> pmBidFailureResVoList = new ArrayList<>();
-                    List<SysFileInfo> fileInfosAll = new ArrayList<>();
+                    List<PmCallQuestionResVo> pmCallQuestionBidFailureResVoList = new ArrayList<>();
+                    List<SysFileInfo> pmBidFailureFileInfos = new ArrayList<>();
+                    List<SysFileInfo> pmCallRequestBidFailureFileInfos = new ArrayList<>();
                     for (PmBidFailure pmBidFailure : pmBidFailureList) {
                         PmBidFailureResVo pmBidFailureResVo = new PmBidFailureResVo();
                         BeanUtils.copyProperties(pmBidFailure, pmBidFailureResVo);
+                        pmBidFailureResVoList.add(pmBidFailureResVo);
+
                         List<SysFileInfo> fileInfos = getSysFileInfoList(pmBidFailure.getId(), SysFileRefEnum.PM_BID_FAILURE_FILE.getType());
                         if (!ObjectUtils.isEmpty(fileInfos)) {
-                            fileInfosAll.addAll(fileInfos);
+                            pmBidFailureFileInfos.addAll(fileInfos);
+                        }
+
+
+                        if("1".equals(pmBidFailure.getCallQuestion())){
+                            PmCallQuestionResVo pmCallQuestionResVo = new PmCallQuestionResVo();
+                            pmCallQuestionResVo.setCallQuestion(pmBidFailure.getCallQuestion());
+                            pmCallQuestionResVo.setCallQuestionTime(pmBidFailure.getCallQuestionTime());
+                            pmCallQuestionBidFailureResVoList.add(pmCallQuestionResVo);
+
+                            List<SysFileInfo> fileInfos2 = getSysFileInfoList(pmBidFailure.getId(), SysFileRefEnum.PM_BID_FAILURE_CALL_QUESTION.getType());
+                            if (!ObjectUtils.isEmpty(fileInfos2)) {
+                                pmCallRequestBidFailureFileInfos.addAll(fileInfos2);
+                            }
                         }
-                        pmBidFailureResVoList.add(pmBidFailureResVo);
                     }
 
                     pmPurchaseExecutionResVo.setPmBidFailureResVoList(pmBidFailureResVoList);
-                    pmPurchaseExecutionResVo.setPmBidFailureFileInfos(fileInfosAll);
+                    pmPurchaseExecutionResVo.setPmBidFailureFileInfos(pmBidFailureFileInfos);
+
+                    //流废标处置
+                    pmPurchaseExecutionResVo.setPmCallQuestionBidFailureResVoList(pmCallQuestionBidFailureResVoList);
+                    pmPurchaseExecutionResVo.setPmCallRequestBidFailureFileInfos(pmCallRequestBidFailureFileInfos);
                 }
 
                 //中标通知书