suntianwu 2 rokov pred
rodič
commit
212620b308
32 zmenil súbory, kde vykonal 440 pridanie a 1629 odobranie
  1. 8 0
      purchase-admin/src/main/java/com/ozs/web/controller/base/BaseExpertController.java
  2. 44 17
      purchase-admin/src/main/java/com/ozs/web/controller/pm/PmPurchaseExecutionController.java
  3. 29 0
      purchase-common/src/main/java/com/ozs/common/enums/ExpertType.java
  4. 29 0
      purchase-common/src/main/java/com/ozs/common/utils/RandomUtil.java
  5. 2 1
      purchase-system/src/main/java/com/ozs/base/domain/BaseExpert.java
  6. 3 0
      purchase-system/src/main/java/com/ozs/pm/doman/PmDemandExpertRef.java
  7. 37 0
      purchase-system/src/main/java/com/ozs/pm/doman/vo/requestVo/PmBaseExpertExtractReqVo.java
  8. 4 1
      purchase-system/src/main/java/com/ozs/pm/doman/vo/requestVo/PmBaseExpertReqVo.java
  9. 4 34
      purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandEngineeringMapper.java
  10. 2 34
      purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandEquipMapper.java
  11. 2 38
      purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandMapper.java
  12. 3 35
      purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandMaterialsMapper.java
  13. 3 35
      purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandServeMapper.java
  14. 2 48
      purchase-system/src/main/java/com/ozs/pm/mapper/PmFlowChartMapper.java
  15. 4 33
      purchase-system/src/main/java/com/ozs/pm/service/IPmDemandEngineeringService.java
  16. 2 33
      purchase-system/src/main/java/com/ozs/pm/service/IPmDemandEquipService.java
  17. 2 34
      purchase-system/src/main/java/com/ozs/pm/service/IPmDemandMaterialsService.java
  18. 3 33
      purchase-system/src/main/java/com/ozs/pm/service/IPmDemandServeService.java
  19. 13 30
      purchase-system/src/main/java/com/ozs/pm/service/IPmDemandService.java
  20. 4 48
      purchase-system/src/main/java/com/ozs/pm/service/IPmFlowChartService.java
  21. 4 57
      purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandEngineeringServiceImpl.java
  22. 4 57
      purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandEquipServiceImpl.java
  23. 4 57
      purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandMaterialsServiceImpl.java
  24. 3 57
      purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServeServiceImpl.java
  25. 221 133
      purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServiceImpl.java
  26. 4 79
      purchase-system/src/main/java/com/ozs/pm/service/impl/PmFlowChartServiceImpl.java
  27. 0 160
      purchase-system/src/main/resources/mapper/pm/PmDemandEngineeringMapper.xml
  28. 0 105
      purchase-system/src/main/resources/mapper/pm/PmDemandEquipMapper.xml
  29. 0 186
      purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml
  30. 0 105
      purchase-system/src/main/resources/mapper/pm/PmDemandMaterialsMapper.xml
  31. 0 104
      purchase-system/src/main/resources/mapper/pm/PmDemandServeMapper.xml
  32. 0 75
      purchase-system/src/main/resources/mapper/pm/PmFlowChartMapper.xml

+ 8 - 0
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseExpertController.java

@@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.constraints.NotEmpty;
+import java.util.Date;
 
 /**
  * 专家库管理
@@ -46,6 +47,10 @@ public class BaseExpertController extends BaseController {
         if (StringUtils.isNull(baseExpert) || StringUtils.isNull(baseExpert.getExpertName())) {
             return error("专家库名称不能为空");
         }
+        baseExpert.setCreated(getUserId().toString());
+        baseExpert.setCreateTime(new Date());
+        baseExpert.setUpdated(baseExpert.getCreated());
+        baseExpert.setUpdateTime(baseExpert.getCreateTime());
         return toAjax(baseExpertService.insertExpert(baseExpert));
     }
 
@@ -64,6 +69,9 @@ public class BaseExpertController extends BaseController {
         if (StringUtils.isNull(baseExpert) || StringUtils.isNull(baseExpert.getId())) {
             return error("专家库id和修改数据不能为空");
         }
+
+        baseExpert.setUpdated(getUserId().toString());
+        baseExpert.setUpdateTime(new Date());
         return toAjax(baseExpertService.updateById(baseExpert));
     }
 

+ 44 - 17
purchase-admin/src/main/java/com/ozs/web/controller/pm/PmPurchaseExecutionController.java

@@ -3,10 +3,8 @@ package com.ozs.web.controller.pm;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ozs.base.domain.BaseAgency;
 import com.ozs.base.domain.BaseExpert;
-import com.ozs.base.domain.vo.BaseExpertVo;
 import com.ozs.base.service.BaseAgencyService;
 import com.ozs.base.service.BaseExpertService;
 import com.ozs.common.annotation.Log;
@@ -16,16 +14,11 @@ import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.enums.BusinessType;
 import com.ozs.common.enums.NameListType;
 import com.ozs.common.enums.SysFileRefEnum;
-import com.ozs.common.utils.StringUtils;
+import com.ozs.common.utils.RandomUtil;
 import com.ozs.pm.doman.PmDemand;
-import com.ozs.pm.doman.PmReleaseAnnouncement;
-import com.ozs.pm.doman.vo.requestVo.PmBaseExpertReqVo;
-import com.ozs.pm.doman.vo.requestVo.PmDemandReqVo;
-import com.ozs.pm.doman.vo.requestVo.PmPurchaseExecutionReqVo;
-import com.ozs.pm.doman.vo.requestVo.PmReleaseAnnouncementReqVo;
+import com.ozs.pm.doman.vo.requestVo.*;
 import com.ozs.pm.doman.vo.responseVo.PmDemandResVo;
 import com.ozs.pm.service.IPmDemandService;
-import com.ozs.pm.service.PmReleaseAnnouncementService;
 import com.ozs.system.domain.SysFileRef;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -36,6 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.validation.constraints.NotEmpty;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Optional;
@@ -127,13 +121,16 @@ public class PmPurchaseExecutionController extends BaseController {
         LambdaQueryWrapper<BaseAgency> lw = new LambdaQueryWrapper<>();
         lw.eq(BaseAgency::getCompanyType,pmDemand.getProjectType());
         lw.eq(BaseAgency::getStatus,0);
-        Optional<BaseAgency> any = baseAgencyService.list(lw).stream().findAny();
-        if(ObjectUtils.isEmpty(any)){
+        List<BaseAgency> baseAgencyList = baseAgencyService.list(lw);
+        if (ObjectUtils.isEmpty(baseAgencyList)){
             return error("没有符合的招标代理机构,抽取失败!");
         }
+
+        BaseAgency any = (BaseAgency)(RandomUtil.getRandomList(baseAgencyList,1).get(0));
+
         PmDemand pmDemandUpdate = new PmDemand();
         pmDemandUpdate.setDemandId(demandId);
-        pmDemandUpdate.setAgencyId(any.get().getId());
+        pmDemandUpdate.setAgencyId(any.getId());
         pmDemandUpdate.setExtractAgencyTime(new Date());
         pmDemandUpdate.setUpdateTime(pmDemandUpdate.getExtractAgencyTime());
         pmDemandUpdate.setUpdateBy(getUserId().toString());
@@ -187,8 +184,14 @@ public class PmPurchaseExecutionController extends BaseController {
         LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<BaseExpert>();
         lw.eq(BaseExpert::getVarietyPurchase,pmDemand.getProjectType())
                 .eq(BaseExpert::getStatus,NameListType.WHITE.getCode());
-        BaseExpert baseExpert = baseExpertService.getOne(lw);
-        return success(baseExpert);
+        List<BaseExpert> baseExpertList = baseExpertService.list(lw);
+        List<String> idNumberList = new ArrayList<>();
+        if (!ObjectUtils.isEmpty(baseExpertList)) {
+            for(BaseExpert baseExpert :baseExpertList ){
+                idNumberList.add(baseExpert.getIdNumber());
+            }
+        }
+        return success(idNumberList);
     }
 
     @ApiOperation(value = "根据身份证号查询专家", notes = "必传 查询条件:身份证号")
@@ -221,15 +224,39 @@ public class PmPurchaseExecutionController extends BaseController {
     @PostMapping("/insertExpertBatch")
     @PreAuthorize("@ss.hasPermi('pm:purchaseExecution:insertExpertBatch')")
     @Log(title = ModularConstans.purchaseExecution, businessType = BusinessType.INSERT)
-    public AjaxResult insertExpertBatch(@RequestBody PmBaseExpertReqVo pmBaseExpertReqVo) {
-        if (ObjectUtils.isEmpty(pmBaseExpertReqVo) || ObjectUtils.isEmpty(pmBaseExpertReqVo.getDemandId()) || ObjectUtils.isEmpty(pmBaseExpertReqVo.getBaseExpertList())) {
+    public AjaxResult insertExpertBatch(@NotEmpty(message = "参数不能为空") @RequestBody PmBaseExpertFillReqVo pmBaseExpertFillReqVo) {
+        if (ObjectUtils.isEmpty(pmBaseExpertFillReqVo)
+                || ObjectUtils.isEmpty(pmBaseExpertFillReqVo.getDemandId())
+                || ObjectUtils.isEmpty(pmBaseExpertFillReqVo.getAccessTime())
+                || ObjectUtils.isEmpty(pmBaseExpertFillReqVo.getBaseExpertList())) {
             return error("参数错误");
         }
+        pmBaseExpertFillReqVo.setCreateBy(getUserId().toString());
+        pmBaseExpertFillReqVo.setUpdateBy(pmBaseExpertFillReqVo.getCreateBy());
+
         try {
-            return toAjax(pmDemandService.insertExpertBatch(pmBaseExpertReqVo));
+            return toAjax(pmDemandService.insertExpertBatch(pmBaseExpertFillReqVo));
         } catch (Exception e) {
             return error(e.getMessage());
         }
+    }
 
+    /**
+     * 抽取专家
+     */
+    @ApiOperation(value = "抽取专家",notes = "采购需求ID必传")
+    @PostMapping("/extractExpertBatch")
+    public AjaxResult extractExpertBatch(@NotEmpty(message = "参数不能为空")
+                                             @RequestBody PmBaseExpertExtractReqVo pmBaseExpertExtractReqVo) {
+        if (ObjectUtils.isEmpty(pmBaseExpertExtractReqVo)
+                || ObjectUtils.isEmpty(pmBaseExpertExtractReqVo.getDemandId())
+                || ObjectUtils.isEmpty(pmBaseExpertExtractReqVo.getAccessTime())) {
+            return error("参数错误");
+        }
+        try {
+            return toAjax(pmDemandService.extractExpertBatch(pmBaseExpertExtractReqVo));
+        } catch (Exception e) {
+            return error(e.getMessage());
+        }
     }
 }

+ 29 - 0
purchase-common/src/main/java/com/ozs/common/enums/ExpertType.java

@@ -0,0 +1,29 @@
+package com.ozs.common.enums;
+
+/**
+ * 专家类型
+ *
+ * @author buzhanyi
+ */
+public enum ExpertType {
+    TECHNICAL_EXPERT("1", "技术专家"),
+    ECONOMIC_EXPERT("2", "经济专家"),
+    LEGALAFFAIRS_EXPERT("3", "法务专家"),
+    SPARE_EXPERT("4", "备用专家");
+
+    private final String code;
+    private final String info;
+
+    ExpertType(String code, String info) {
+        this.code = code;
+        this.info = info;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getInfo() {
+        return info;
+    }
+}

+ 29 - 0
purchase-common/src/main/java/com/ozs/common/utils/RandomUtil.java

@@ -0,0 +1,29 @@
+package com.ozs.common.utils;
+
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class RandomUtil {
+    public static List getRandomList(List list, int randomSeriesLength){
+        if(randomSeriesLength >  list.size()){
+            randomSeriesLength = list.size();
+        }
+        Collections.shuffle(list);
+        List randomSeries = list.subList(0, randomSeriesLength);
+        return randomSeries;
+    }
+    public static void main(String args[]){
+        List<Object> list = new ArrayList<>();
+        list.add("1");
+        list.add("2");
+        list.add("3");
+        list.add("4");
+        list.add("5");
+        list = getRandomList(list,8);
+        for(Object o: list){
+            System.out.println(o);
+        }
+    }
+}

+ 2 - 1
purchase-system/src/main/java/com/ozs/base/domain/BaseExpert.java

@@ -4,13 +4,14 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.base.domain.vo.BaseExpertVo;
+import com.ozs.common.vo.BaseDto;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import org.joda.time.DateTime;
 
 @Data
 @TableName("base_expert")
-public class BaseExpert {
+public class BaseExpert extends BaseDto {
 
     /**
      * 主键ID

+ 3 - 0
purchase-system/src/main/java/com/ozs/pm/doman/PmDemandExpertRef.java

@@ -51,6 +51,9 @@ public class PmDemandExpertRef implements Serializable {
     @TableField("CREATE_BY")
     private String createBy;
 
+    @ApiModelProperty("选取时间")
+    @TableField("ACCESS_TIME")
+    private Date accessTime;
 
     @ApiModelProperty("创建时间")
     @TableField("CREATE_TIME")

+ 37 - 0
purchase-system/src/main/java/com/ozs/pm/doman/vo/requestVo/PmBaseExpertExtractReqVo.java

@@ -0,0 +1,37 @@
+package com.ozs.pm.doman.vo.requestVo;
+
+
+import com.ozs.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class PmBaseExpertExtractReqVo extends BaseEntity {
+
+    @ApiModelProperty("需求ID")
+    private Long demandId;
+
+    @ApiModelProperty("选取时间 yyy-MM-dd")
+    private String accessTime;
+
+    @ApiModelProperty("技术专家数量")
+    private Integer technicalExpertNumber;
+
+    @ApiModelProperty("经济专家数量")
+    private Integer economicExpertNumber;
+
+    @ApiModelProperty("法务专家数量")
+    private Integer legalAffairsExpertNumber;
+
+    @ApiModelProperty("备用专家数量")
+    private Integer spareExpertNumber;
+
+    @ApiModelProperty("专家专业,多个用逗号分隔")
+    private String professional;
+
+    @ApiModelProperty("所在区域")
+    private String localArea;
+
+    @ApiModelProperty("需要回避单位,多个用逗号分隔")
+    private String needAvoidUnit;
+}

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

@@ -8,11 +8,14 @@ import lombok.Data;
 import java.util.List;
 
 @Data
-public class PmBaseExpertReqVo extends BaseEntity {
+public class PmBaseExpertFillReqVo extends BaseEntity {
 
     @ApiModelProperty("需求ID")
     private Long demandId;
 
     @ApiModelProperty("专家信息列表")
     private List<BaseExpert> baseExpertList;
+
+    @ApiModelProperty("选取时间 yyy-MM-dd")
+    private String accessTime;
 }

+ 4 - 34
purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandEngineeringMapper.java

@@ -1,8 +1,10 @@
 package com.ozs.pm.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
 import com.ozs.pm.doman.PmDemandEngineering;
 
-import java.util.List;
+
 
 
 /**
@@ -11,39 +13,7 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-01-16
  */
-public interface PmDemandEngineeringMapper 
+public interface PmDemandEngineeringMapper extends BaseMapper<PmDemandEngineering>
 {
-    /**
-     * 查询采购需求工程类
-     * 
-     * @param demandEngineeringId 采购需求工程类主键
-     * @return 采购需求工程类
-     */
-    public PmDemandEngineering selectPmDemandEngineeringByDemandEngineeringId(Long demandEngineeringId);
-
-    /**
-     * 查询采购需求工程类列表
-     * 
-     * @param pmDemandEngineering 采购需求工程类
-     * @return 采购需求工程类集合
-     */
-    public List<PmDemandEngineering> selectPmDemandEngineeringList(PmDemandEngineering pmDemandEngineering);
-
-    /**
-     * 新增采购需求工程类
-     * 
-     * @param pmDemandEngineering 采购需求工程类
-     * @return 结果
-     */
-    public int insertPmDemandEngineering(PmDemandEngineering pmDemandEngineering);
-
-    /**
-     * 修改采购需求工程类
-     * 
-     * @param pmDemandEngineering 采购需求工程类
-     * @return 结果
-     */
-    public int updatePmDemandEngineering(PmDemandEngineering pmDemandEngineering);
-
 
 }

+ 2 - 34
purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandEquipMapper.java

@@ -1,8 +1,8 @@
 package com.ozs.pm.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ozs.pm.doman.PmDemandEquip;
 
-import java.util.List;
 
 
 /**
@@ -11,39 +11,7 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-01-16
  */
-public interface PmDemandEquipMapper 
+public interface PmDemandEquipMapper extends BaseMapper<PmDemandEquip>
 {
-    /**
-     * 查询采购需求装备类
-     * 
-     * @param demandEquipId 采购需求装备类主键
-     * @return 采购需求装备类
-     */
-    public PmDemandEquip selectPmDemandEquipByDemandEquipId(Long demandEquipId);
-
-    /**
-     * 查询采购需求装备类列表
-     * 
-     * @param pmDemandEquip 采购需求装备类
-     * @return 采购需求装备类集合
-     */
-    public List<PmDemandEquip> selectPmDemandEquipList(PmDemandEquip pmDemandEquip);
-
-    /**
-     * 新增采购需求装备类
-     * 
-     * @param pmDemandEquip 采购需求装备类
-     * @return 结果
-     */
-    public int insertPmDemandEquip(PmDemandEquip pmDemandEquip);
-
-    /**
-     * 修改采购需求装备类
-     * 
-     * @param pmDemandEquip 采购需求装备类
-     * @return 结果
-     */
-    public int updatePmDemandEquip(PmDemandEquip pmDemandEquip);
-
 
 }

+ 2 - 38
purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandMapper.java

@@ -1,11 +1,9 @@
 package com.ozs.pm.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.ozs.plan.doman.PlanYears;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
 import com.ozs.pm.doman.PmDemand;
 
-import java.util.List;
 
 
 /**
@@ -14,39 +12,5 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-01-16
  */
-public interface PmDemandMapper extends BaseMapper<PmDemand>
-{
-    /**
-     * 查询采购需求
-     * 
-     * @param demandId 采购需求主键
-     * @return 采购需求
-     */
-    public PmDemand selectPmDemandByDemandId(Long demandId);
-
-    /**
-     * 查询采购需求列表
-     * 
-     * @param pmDemand 采购需求
-     * @return 采购需求集合
-     */
-    public List<PmDemand> selectPmDemandList(PmDemand pmDemand);
-
-    /**
-     * 新增采购需求
-     * 
-     * @param pmDemand 采购需求
-     * @return 结果
-     */
-    public int insertPmDemand(PmDemand pmDemand);
-
-    /**
-     * 修改采购需求
-     * 
-     * @param pmDemand 采购需求
-     * @return 结果
-     */
-    public int updatePmDemand(PmDemand pmDemand);
-
-
+public interface PmDemandMapper extends BaseMapper<PmDemand> {
 }

+ 3 - 35
purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandMaterialsMapper.java

@@ -1,8 +1,9 @@
 package com.ozs.pm.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
 import com.ozs.pm.doman.PmDemandMaterials;
 
-import java.util.List;
 
 
 /**
@@ -11,39 +12,6 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-01-16
  */
-public interface PmDemandMaterialsMapper 
+public interface PmDemandMaterialsMapper extends BaseMapper<PmDemandMaterials>
 {
-    /**
-     * 查询采购需求物资类
-     * 
-     * @param demandMaterialsId 采购需求物资类主键
-     * @return 采购需求物资类
-     */
-    public PmDemandMaterials selectPmDemandMaterialsByDemandMaterialsId(Long demandMaterialsId);
-
-    /**
-     * 查询采购需求物资类列表
-     * 
-     * @param pmDemandMaterials 采购需求物资类
-     * @return 采购需求物资类集合
-     */
-    public List<PmDemandMaterials> selectPmDemandMaterialsList(PmDemandMaterials pmDemandMaterials);
-
-    /**
-     * 新增采购需求物资类
-     * 
-     * @param pmDemandMaterials 采购需求物资类
-     * @return 结果
-     */
-    public int insertPmDemandMaterials(PmDemandMaterials pmDemandMaterials);
-
-    /**
-     * 修改采购需求物资类
-     * 
-     * @param pmDemandMaterials 采购需求物资类
-     * @return 结果
-     */
-    public int updatePmDemandMaterials(PmDemandMaterials pmDemandMaterials);
-
-
 }

+ 3 - 35
purchase-system/src/main/java/com/ozs/pm/mapper/PmDemandServeMapper.java

@@ -1,8 +1,9 @@
 package com.ozs.pm.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
 import com.ozs.pm.doman.PmDemandServe;
 
-import java.util.List;
 
 /**
  * 采购需求服务类Mapper接口
@@ -10,39 +11,6 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-01-16
  */
-public interface PmDemandServeMapper 
+public interface PmDemandServeMapper extends BaseMapper<PmDemandServe>
 {
-    /**
-     * 查询采购需求服务类
-     * 
-     * @param demandServeId 采购需求服务类主键
-     * @return 采购需求服务类
-     */
-    public PmDemandServe selectPmDemandServeByDemandServeId(Long demandServeId);
-
-    /**
-     * 查询采购需求服务类列表
-     * 
-     * @param pmDemandServe 采购需求服务类
-     * @return 采购需求服务类集合
-     */
-    public List<PmDemandServe> selectPmDemandServeList(PmDemandServe pmDemandServe);
-
-    /**
-     * 新增采购需求服务类
-     * 
-     * @param pmDemandServe 采购需求服务类
-     * @return 结果
-     */
-    public int insertPmDemandServe(PmDemandServe pmDemandServe);
-
-    /**
-     * 修改采购需求服务类
-     * 
-     * @param pmDemandServe 采购需求服务类
-     * @return 结果
-     */
-    public int updatePmDemandServe(PmDemandServe pmDemandServe);
-
-
 }

+ 2 - 48
purchase-system/src/main/java/com/ozs/pm/mapper/PmFlowChartMapper.java

@@ -1,8 +1,8 @@
 package com.ozs.pm.mapper;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ozs.pm.doman.PmFlowChart;
 
-import java.util.List;
 
 
 /**
@@ -11,53 +11,7 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-01-25
  */
-public interface PmFlowChartMapper 
+public interface PmFlowChartMapper extends BaseMapper<PmFlowChart>
 {
-    /**
-     * 查询流程图
-     * 
-     * @param flowChartId 流程图主键
-     * @return 流程图
-     */
-    public PmFlowChart selectPmFlowChartByFlowChartId(Long flowChartId);
 
-    /**
-     * 查询流程图列表
-     * 
-     * @param pmFlowChart 流程图
-     * @return 流程图集合
-     */
-    public List<PmFlowChart> selectPmFlowChartList(PmFlowChart pmFlowChart);
-
-    /**
-     * 新增流程图
-     * 
-     * @param pmFlowChart 流程图
-     * @return 结果
-     */
-    public int insertPmFlowChart(PmFlowChart pmFlowChart);
-
-    /**
-     * 修改流程图
-     * 
-     * @param pmFlowChart 流程图
-     * @return 结果
-     */
-    public int updatePmFlowChart(PmFlowChart pmFlowChart);
-
-    /**
-     * 删除流程图
-     * 
-     * @param flowChartId 流程图主键
-     * @return 结果
-     */
-    public int deletePmFlowChartByFlowChartId(Long flowChartId);
-
-    /**
-     * 批量删除流程图
-     * 
-     * @param flowChartIds 需要删除的数据主键集合
-     * @return 结果
-     */
-    public int deletePmFlowChartByFlowChartIds(Long[] flowChartIds);
 }

+ 4 - 33
purchase-system/src/main/java/com/ozs/pm/service/IPmDemandEngineeringService.java

@@ -1,8 +1,10 @@
 package com.ozs.pm.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
+
 import com.ozs.pm.doman.PmDemandEngineering;
 
-import java.util.List;
+
 
 
 /**
@@ -11,38 +13,7 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-01-16
  */
-public interface IPmDemandEngineeringService 
+public interface IPmDemandEngineeringService  extends IService<PmDemandEngineering>
 {
-    /**
-     * 查询采购需求工程类
-     * 
-     * @param demandEngineeringId 采购需求工程类主键
-     * @return 采购需求工程类
-     */
-    public PmDemandEngineering selectPmDemandEngineeringByDemandEngineeringId(Long demandEngineeringId);
-
-    /**
-     * 查询采购需求工程类列表
-     * 
-     * @param pmDemandEngineering 采购需求工程类
-     * @return 采购需求工程类集合
-     */
-    public List<PmDemandEngineering> selectPmDemandEngineeringList(PmDemandEngineering pmDemandEngineering);
-
-    /**
-     * 新增采购需求工程类
-     * 
-     * @param pmDemandEngineering 采购需求工程类
-     * @return 结果
-     */
-    public int insertPmDemandEngineering(PmDemandEngineering pmDemandEngineering);
-
-    /**
-     * 修改采购需求工程类
-     * 
-     * @param pmDemandEngineering 采购需求工程类
-     * @return 结果
-     */
-    public int updatePmDemandEngineering(PmDemandEngineering pmDemandEngineering);
 
 }

+ 2 - 33
purchase-system/src/main/java/com/ozs/pm/service/IPmDemandEquipService.java

@@ -1,8 +1,8 @@
 package com.ozs.pm.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ozs.pm.doman.PmDemandEquip;
 
-import java.util.List;
 
 /**
  * 采购需求装备类Service接口
@@ -10,38 +10,7 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-01-16
  */
-public interface IPmDemandEquipService 
+public interface IPmDemandEquipService extends IService<PmDemandEquip>
 {
-    /**
-     * 查询采购需求装备类
-     * 
-     * @param demandEquipId 采购需求装备类主键
-     * @return 采购需求装备类
-     */
-    public PmDemandEquip selectPmDemandEquipByDemandEquipId(Long demandEquipId);
-
-    /**
-     * 查询采购需求装备类列表
-     * 
-     * @param pmDemandEquip 采购需求装备类
-     * @return 采购需求装备类集合
-     */
-    public List<PmDemandEquip> selectPmDemandEquipList(PmDemandEquip pmDemandEquip);
-
-    /**
-     * 新增采购需求装备类
-     * 
-     * @param pmDemandEquip 采购需求装备类
-     * @return 结果
-     */
-    public int insertPmDemandEquip(PmDemandEquip pmDemandEquip);
-
-    /**
-     * 修改采购需求装备类
-     * 
-     * @param pmDemandEquip 采购需求装备类
-     * @return 结果
-     */
-    public int updatePmDemandEquip(PmDemandEquip pmDemandEquip);
 
 }

+ 2 - 34
purchase-system/src/main/java/com/ozs/pm/service/IPmDemandMaterialsService.java

@@ -1,8 +1,8 @@
 package com.ozs.pm.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.ozs.pm.doman.PmDemandMaterials;
 
-import java.util.List;
 
 /**
  * 采购需求物资类Service接口
@@ -10,39 +10,7 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-01-16
  */
-public interface IPmDemandMaterialsService 
+public interface IPmDemandMaterialsService extends IService<PmDemandMaterials>
 {
-    /**
-     * 查询采购需求物资类
-     * 
-     * @param demandMaterialsId 采购需求物资类主键
-     * @return 采购需求物资类
-     */
-    public PmDemandMaterials selectPmDemandMaterialsByDemandMaterialsId(Long demandMaterialsId);
-
-    /**
-     * 查询采购需求物资类列表
-     * 
-     * @param pmDemandMaterials 采购需求物资类
-     * @return 采购需求物资类集合
-     */
-    public List<PmDemandMaterials> selectPmDemandMaterialsList(PmDemandMaterials pmDemandMaterials);
-
-    /**
-     * 新增采购需求物资类
-     * 
-     * @param pmDemandMaterials 采购需求物资类
-     * @return 结果
-     */
-    public int insertPmDemandMaterials(PmDemandMaterials pmDemandMaterials);
-
-    /**
-     * 修改采购需求物资类
-     * 
-     * @param pmDemandMaterials 采购需求物资类
-     * @return 结果
-     */
-    public int updatePmDemandMaterials(PmDemandMaterials pmDemandMaterials);
-
 
 }

+ 3 - 33
purchase-system/src/main/java/com/ozs/pm/service/IPmDemandServeService.java

@@ -1,8 +1,9 @@
 package com.ozs.pm.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
+
 import com.ozs.pm.doman.PmDemandServe;
 
-import java.util.List;
 
 
 /**
@@ -11,39 +12,8 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-01-16
  */
-public interface IPmDemandServeService 
+public interface IPmDemandServeService extends IService<PmDemandServe>
 {
-    /**
-     * 查询采购需求服务类
-     * 
-     * @param demandServeId 采购需求服务类主键
-     * @return 采购需求服务类
-     */
-    public PmDemandServe selectPmDemandServeByDemandServeId(Long demandServeId);
-
-    /**
-     * 查询采购需求服务类列表
-     * 
-     * @param pmDemandServe 采购需求服务类
-     * @return 采购需求服务类集合
-     */
-    public List<PmDemandServe> selectPmDemandServeList(PmDemandServe pmDemandServe);
-
-    /**
-     * 新增采购需求服务类
-     * 
-     * @param pmDemandServe 采购需求服务类
-     * @return 结果
-     */
-    public int insertPmDemandServe(PmDemandServe pmDemandServe);
-
-    /**
-     * 修改采购需求服务类
-     * 
-     * @param pmDemandServe 采购需求服务类
-     * @return 结果
-     */
-    public int updatePmDemandServe(PmDemandServe pmDemandServe);
 
 
 }

+ 13 - 30
purchase-system/src/main/java/com/ozs/pm/service/IPmDemandService.java

@@ -3,12 +3,8 @@ package com.ozs.pm.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.ozs.base.domain.BaseExpert;
 import com.ozs.pm.doman.PmDemand;
-import com.ozs.pm.doman.vo.requestVo.PmBaseExpertReqVo;
-import com.ozs.pm.doman.vo.requestVo.PmBookBuildingReqVo;
-import com.ozs.pm.doman.vo.requestVo.PmDemandReqVo;
-import com.ozs.pm.doman.vo.requestVo.PmReleaseAnnouncementReqVo;
+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.system.domain.SysFileRef;
@@ -30,7 +26,7 @@ public interface IPmDemandService extends IService<PmDemand>
      * @param demandId 采购需求主键
      * @return 采购需求
      */
-    public PmDemandResVo selectPmDemandByDemandId(Long demandId,String detailType);
+    PmDemandResVo selectPmDemandByDemandId(Long demandId,String detailType);
 
     /**
      * 查询采购需求列表
@@ -38,31 +34,16 @@ public interface IPmDemandService extends IService<PmDemand>
      * @param pmDemandReqVo 采购需求
      * @return 采购需求集合
      */
-    public IPage<PmDemandResVo> selectPmDemandList(PmDemandReqVo pmDemandReqVo,int reqType);
+    IPage<PmDemandResVo> selectPmDemandList(PmDemandReqVo pmDemandReqVo,int reqType);
 
 
-    /**
-     * 新增采购需求
-     * 
-     * @param pmDemand 采购需求
-     * @return 结果
-     */
-    public int insertPmDemand(PmDemand pmDemand);
-    /**
-     *修改采购需求
-     *
-     * @param pmDemand 采购需求
-     * @return 结果
-     */
-    public int updatePmDemand(PmDemand pmDemand);
-
     /**
      * 需求建档
      * 
      * @param pmBookBuildingReqVo 需求建档
      * @return 结果
      */
-    public int bookBuilding(PmBookBuildingReqVo pmBookBuildingReqVo);
+    boolean bookBuilding(PmBookBuildingReqVo pmBookBuildingReqVo);
 
     /**
      * 查看流程图
@@ -70,7 +51,7 @@ public interface IPmDemandService extends IService<PmDemand>
      * @param demandId 采购需求主键
      * @return 采购需求
      */
-    public Object viewFlowChart(Long demandId);
+    Object viewFlowChart(Long demandId);
 
     /**
      * 查看流程图
@@ -78,7 +59,7 @@ public interface IPmDemandService extends IService<PmDemand>
      * @param demandId 采购需求主键
      * @return 采购需求
      */
-    public PmFlowChartResVo getModuleInfo(Long demandId, String moduleName);
+    PmFlowChartResVo getModuleInfo(Long demandId, String moduleName);
 
     /**
      * 提交采购需求
@@ -86,7 +67,7 @@ public interface IPmDemandService extends IService<PmDemand>
      * @param pmDemandReqVo
      * @return 结果
      */
-    public int commit(PmDemandReqVo pmDemandReqVo);
+    boolean commit(PmDemandReqVo pmDemandReqVo);
 
     /**
      * 审核采购需求通过
@@ -94,7 +75,7 @@ public interface IPmDemandService extends IService<PmDemand>
      * @param pmDemandReqVo
      * @return 结果
      */
-    public int reviewTo(PmDemandReqVo pmDemandReqVo);
+    boolean reviewTo(PmDemandReqVo pmDemandReqVo);
 
     /**
      * 审核采购需求退回
@@ -102,7 +83,7 @@ public interface IPmDemandService extends IService<PmDemand>
      * @param pmDemandReqVo
      * @return 结果
      */
-    public int reviewReturn(PmDemandReqVo pmDemandReqVo);
+    boolean reviewReturn(PmDemandReqVo pmDemandReqVo);
 
     /**
      * 下达任务
@@ -110,12 +91,14 @@ public interface IPmDemandService extends IService<PmDemand>
      * @param pmDemandReqVo
      * @return 结果
      */
-    public int releaseTask(PmDemandReqVo pmDemandReqVo);
+    boolean releaseTask(PmDemandReqVo pmDemandReqVo);
 
     boolean uploadFile(Long redId,Integer fileType, List<SysFileRef> sysFileRefs,String upateBy);
 
     boolean insertPmReleaseAnnouncement(PmReleaseAnnouncementReqVo pmReleaseAnnouncementReqVo);
 
-    boolean insertExpertBatch(PmBaseExpertReqVo pmBaseExpertReqVo) throws Exception;
+    boolean insertExpertBatch(PmBaseExpertFillReqVo pmBaseExpertFillReqVo) throws Exception;
+
+    boolean extractExpertBatch(PmBaseExpertExtractReqVo pmBaseExpertExtractReqVo) throws Exception;
 
 }

+ 4 - 48
purchase-system/src/main/java/com/ozs/pm/service/IPmFlowChartService.java

@@ -1,8 +1,10 @@
 package com.ozs.pm.service;
 
+import com.baomidou.mybatisplus.extension.service.IService;
+
 import com.ozs.pm.doman.PmFlowChart;
 
-import java.util.List;
+
 
 
 /**
@@ -11,53 +13,7 @@ import java.util.List;
  * @author ruoyi
  * @date 2023-01-25
  */
-public interface IPmFlowChartService 
+public interface IPmFlowChartService extends IService<PmFlowChart>
 {
-    /**
-     * 查询流程图
-     * 
-     * @param flowChartId 流程图主键
-     * @return 流程图
-     */
-    public PmFlowChart selectPmFlowChartByFlowChartId(Long flowChartId);
-
-    /**
-     * 查询流程图列表
-     * 
-     * @param pmFlowChart 流程图
-     * @return 流程图集合
-     */
-    public List<PmFlowChart> selectPmFlowChartList(PmFlowChart pmFlowChart);
-
-    /**
-     * 新增流程图
-     * 
-     * @param pmFlowChart 流程图
-     * @return 结果
-     */
-    public int insertPmFlowChart(PmFlowChart pmFlowChart);
-
-    /**
-     * 修改流程图
-     * 
-     * @param pmFlowChart 流程图
-     * @return 结果
-     */
-    public int updatePmFlowChart(PmFlowChart pmFlowChart);
-
-    /**
-     * 批量删除流程图
-     * 
-     * @param flowChartIds 需要删除的流程图主键集合
-     * @return 结果
-     */
-    public int deletePmFlowChartByFlowChartIds(Long[] flowChartIds);
 
-    /**
-     * 删除流程图信息
-     * 
-     * @param flowChartId 流程图主键
-     * @return 结果
-     */
-    public int deletePmFlowChartByFlowChartId(Long flowChartId);
 }

+ 4 - 57
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandEngineeringServiceImpl.java

@@ -1,11 +1,11 @@
 package com.ozs.pm.service.impl;
 
-import java.util.List;
-import com.ozs.common.utils.DateUtils;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ozs.pm.doman.PmDemandEngineering;
 import com.ozs.pm.mapper.PmDemandEngineeringMapper;
 import com.ozs.pm.service.IPmDemandEngineeringService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 
@@ -16,59 +16,6 @@ import org.springframework.stereotype.Service;
  * @date 2023-01-16
  */
 @Service
-public class PmDemandEngineeringServiceImpl implements IPmDemandEngineeringService
+public class PmDemandEngineeringServiceImpl extends ServiceImpl<PmDemandEngineeringMapper, PmDemandEngineering> implements IPmDemandEngineeringService
 {
-    @Autowired
-    private PmDemandEngineeringMapper pmDemandEngineeringMapper;
-
-    /**
-     * 查询采购需求工程类
-     *
-     * @param demandEngineeringId 采购需求工程类主键
-     * @return 采购需求工程类
-     */
-    @Override
-    public PmDemandEngineering selectPmDemandEngineeringByDemandEngineeringId(Long demandEngineeringId)
-    {
-        return pmDemandEngineeringMapper.selectPmDemandEngineeringByDemandEngineeringId(demandEngineeringId);
-    }
-
-    /**
-     * 查询采购需求工程类列表
-     *
-     * @param pmDemandEngineering 采购需求工程类
-     * @return 采购需求工程类
-     */
-    @Override
-    public List<PmDemandEngineering> selectPmDemandEngineeringList(PmDemandEngineering pmDemandEngineering)
-    {
-        return pmDemandEngineeringMapper.selectPmDemandEngineeringList(pmDemandEngineering);
-    }
-
-    /**
-     * 新增采购需求工程类
-     *
-     * @param pmDemandEngineering 采购需求工程类
-     * @return 结果
-     */
-    @Override
-    public int insertPmDemandEngineering(PmDemandEngineering pmDemandEngineering)
-    {
-        pmDemandEngineering.setCreateTime(DateUtils.getNowDate());
-        return pmDemandEngineeringMapper.insertPmDemandEngineering(pmDemandEngineering);
-    }
-
-    /**
-     * 修改采购需求工程类
-     *
-     * @param pmDemandEngineering 采购需求工程类
-     * @return 结果
-     */
-    @Override
-    public int updatePmDemandEngineering(PmDemandEngineering pmDemandEngineering)
-    {
-        pmDemandEngineering.setUpdateTime(DateUtils.getNowDate());
-        return pmDemandEngineeringMapper.updatePmDemandEngineering(pmDemandEngineering);
-    }
-
 }

+ 4 - 57
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandEquipServiceImpl.java

@@ -1,11 +1,11 @@
 package com.ozs.pm.service.impl;
 
-import java.util.List;
-import com.ozs.common.utils.DateUtils;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ozs.pm.doman.PmDemandEquip;
 import com.ozs.pm.mapper.PmDemandEquipMapper;
 import com.ozs.pm.service.IPmDemandEquipService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 
@@ -16,60 +16,7 @@ import org.springframework.stereotype.Service;
  * @date 2023-01-16
  */
 @Service
-public class PmDemandEquipServiceImpl implements IPmDemandEquipService
+public class PmDemandEquipServiceImpl extends ServiceImpl<PmDemandEquipMapper, PmDemandEquip> implements IPmDemandEquipService
 {
-    @Autowired
-    private PmDemandEquipMapper pmDemandEquipMapper;
-
-    /**
-     * 查询采购需求装备类
-     *
-     * @param demandEquipId 采购需求装备类主键
-     * @return 采购需求装备类
-     */
-    @Override
-    public PmDemandEquip selectPmDemandEquipByDemandEquipId(Long demandEquipId)
-    {
-        return pmDemandEquipMapper.selectPmDemandEquipByDemandEquipId(demandEquipId);
-    }
-
-    /**
-     * 查询采购需求装备类列表
-     *
-     * @param pmDemandEquip 采购需求装备类
-     * @return 采购需求装备类
-     */
-    @Override
-    public List<PmDemandEquip> selectPmDemandEquipList(PmDemandEquip pmDemandEquip)
-    {
-        return pmDemandEquipMapper.selectPmDemandEquipList(pmDemandEquip);
-    }
-
-    /**
-     * 新增采购需求装备类
-     *
-     * @param pmDemandEquip 采购需求装备类
-     * @return 结果
-     */
-    @Override
-    public int insertPmDemandEquip(PmDemandEquip pmDemandEquip)
-    {
-        pmDemandEquip.setCreateTime(DateUtils.getNowDate());
-        return pmDemandEquipMapper.insertPmDemandEquip(pmDemandEquip);
-    }
-
-    /**
-     * 修改采购需求装备类
-     *
-     * @param pmDemandEquip 采购需求装备类
-     * @return 结果
-     */
-    @Override
-    public int updatePmDemandEquip(PmDemandEquip pmDemandEquip)
-    {
-        pmDemandEquip.setUpdateTime(DateUtils.getNowDate());
-        return pmDemandEquipMapper.updatePmDemandEquip(pmDemandEquip);
-    }
-
 
 }

+ 4 - 57
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandMaterialsServiceImpl.java

@@ -1,11 +1,11 @@
 package com.ozs.pm.service.impl;
 
-import java.util.List;
-import com.ozs.common.utils.DateUtils;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ozs.pm.doman.PmDemandMaterials;
 import com.ozs.pm.mapper.PmDemandMaterialsMapper;
 import com.ozs.pm.service.IPmDemandMaterialsService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 
@@ -16,59 +16,6 @@ import org.springframework.stereotype.Service;
  * @date 2023-01-16
  */
 @Service
-public class PmDemandMaterialsServiceImpl implements IPmDemandMaterialsService
+public class PmDemandMaterialsServiceImpl  extends ServiceImpl<PmDemandMaterialsMapper, PmDemandMaterials> implements IPmDemandMaterialsService
 {
-    @Autowired
-    private PmDemandMaterialsMapper pmDemandMaterialsMapper;
-
-    /**
-     * 查询采购需求物资类
-     *
-     * @param demandMaterialsId 采购需求物资类主键
-     * @return 采购需求物资类
-     */
-    @Override
-    public PmDemandMaterials selectPmDemandMaterialsByDemandMaterialsId(Long demandMaterialsId)
-    {
-        return pmDemandMaterialsMapper.selectPmDemandMaterialsByDemandMaterialsId(demandMaterialsId);
-    }
-
-    /**
-     * 查询采购需求物资类列表
-     *
-     * @param pmDemandMaterials 采购需求物资类
-     * @return 采购需求物资类
-     */
-    @Override
-    public List<PmDemandMaterials> selectPmDemandMaterialsList(PmDemandMaterials pmDemandMaterials)
-    {
-        return pmDemandMaterialsMapper.selectPmDemandMaterialsList(pmDemandMaterials);
-    }
-
-    /**
-     * 新增采购需求物资类
-     *
-     * @param pmDemandMaterials 采购需求物资类
-     * @return 结果
-     */
-    @Override
-    public int insertPmDemandMaterials(PmDemandMaterials pmDemandMaterials)
-    {
-        pmDemandMaterials.setCreateTime(DateUtils.getNowDate());
-        return pmDemandMaterialsMapper.insertPmDemandMaterials(pmDemandMaterials);
-    }
-
-    /**
-     * 修改采购需求物资类
-     *
-     * @param pmDemandMaterials 采购需求物资类
-     * @return 结果
-     */
-    @Override
-    public int updatePmDemandMaterials(PmDemandMaterials pmDemandMaterials)
-    {
-        pmDemandMaterials.setUpdateTime(DateUtils.getNowDate());
-        return pmDemandMaterialsMapper.updatePmDemandMaterials(pmDemandMaterials);
-    }
-
 }

+ 3 - 57
purchase-system/src/main/java/com/ozs/pm/service/impl/PmDemandServeServiceImpl.java

@@ -1,11 +1,10 @@
 package com.ozs.pm.service.impl;
 
-import java.util.List;
-import com.ozs.common.utils.DateUtils;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ozs.pm.doman.PmDemandServe;
 import com.ozs.pm.mapper.PmDemandServeMapper;
 import com.ozs.pm.service.IPmDemandServeService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 
@@ -16,60 +15,7 @@ import org.springframework.stereotype.Service;
  * @date 2023-01-16
  */
 @Service
-public class PmDemandServeServiceImpl implements IPmDemandServeService
+public class PmDemandServeServiceImpl extends ServiceImpl<PmDemandServeMapper, PmDemandServe> implements IPmDemandServeService
 {
-    @Autowired
-    private PmDemandServeMapper pmDemandServeMapper;
-
-    /**
-     * 查询采购需求服务类
-     *
-     * @param demandServeId 采购需求服务类主键
-     * @return 采购需求服务类
-     */
-    @Override
-    public PmDemandServe selectPmDemandServeByDemandServeId(Long demandServeId)
-    {
-        return pmDemandServeMapper.selectPmDemandServeByDemandServeId(demandServeId);
-    }
-
-    /**
-     * 查询采购需求服务类列表
-     *
-     * @param pmDemandServe 采购需求服务类
-     * @return 采购需求服务类
-     */
-    @Override
-    public List<PmDemandServe> selectPmDemandServeList(PmDemandServe pmDemandServe)
-    {
-        return pmDemandServeMapper.selectPmDemandServeList(pmDemandServe);
-    }
-
-    /**
-     * 新增采购需求服务类
-     *
-     * @param pmDemandServe 采购需求服务类
-     * @return 结果
-     */
-    @Override
-    public int insertPmDemandServe(PmDemandServe pmDemandServe)
-    {
-        pmDemandServe.setCreateTime(DateUtils.getNowDate());
-        return pmDemandServeMapper.insertPmDemandServe(pmDemandServe);
-    }
-
-    /**
-     * 修改采购需求服务类
-     *
-     * @param pmDemandServe 采购需求服务类
-     * @return 结果
-     */
-    @Override
-    public int updatePmDemandServe(PmDemandServe pmDemandServe)
-    {
-        pmDemandServe.setUpdateTime(DateUtils.getNowDate());
-        return pmDemandServeMapper.updatePmDemandServe(pmDemandServe);
-    }
-
 
 }

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

@@ -11,6 +11,7 @@ import com.ozs.base.domain.BaseExpert;
 import com.ozs.base.service.BaseExpertService;
 import com.ozs.common.enums.*;
 import com.ozs.common.utils.DateUtils;
+import com.ozs.common.utils.RandomUtil;
 import com.ozs.common.utils.StringUtils;
 import com.ozs.common.utils.bean.BeanUtils;
 import com.ozs.pm.doman.*;
@@ -39,10 +40,7 @@ import org.springframework.util.ObjectUtils;
  * @date 2023-01-16
  */
 @Service
-public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> implements IPmDemandService
-{
-    @Autowired
-    private PmDemandMapper pmDemandMapper;
+public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> implements IPmDemandService {
 
     @Autowired
     private IPmDemandEquipService iPmDemandEquipService;
@@ -79,7 +77,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
      */
     @Override
     public PmDemandResVo selectPmDemandByDemandId(Long demandId,String detailType) {
-        PmDemand pmDemand = pmDemandMapper.selectPmDemandByDemandId(demandId);
+        PmDemand pmDemand = this.getById(demandId);
         if(pmDemand != null){
             PmDemandResVo vo = new PmDemandResVo();
             vo.setDemandId(demandId);
@@ -157,12 +155,12 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                 }
 
                 if(ProjectTypes.EQUIPMENTTYPE.getCode().equals(pmDemand.getProjectType())){//装备类
-                    PmDemandEquip obj = new PmDemandEquip();
-                    obj.setDemandId(demandId);
-                    List<PmDemandEquip> list = iPmDemandEquipService.selectPmDemandEquipList(obj);
-                    if(list !=null && list.size() > 0){
+                    LambdaQueryWrapper<PmDemandEquip> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+                    lambdaQueryWrapper.eq(PmDemandEquip::getDemandId,demandId);
+                    PmDemandEquip pmDemandEquip = iPmDemandEquipService.getOne(lambdaQueryWrapper);
+                    if(pmDemandEquip != null){
                         PmDemandEquipResVo responseVo = new PmDemandEquipResVo();
-                        BeanUtils.copyProperties(list.get(0),responseVo);
+                        BeanUtils.copyProperties(pmDemandEquip,responseVo);
                         //采购方式建议
                         for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
                             if (responseVo.getProcurementMethodSuggest() != null && responseVo.getProcurementMethodSuggest().equals(value.getCode())) {
@@ -179,12 +177,13 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                         vo.setPmDemandEquipResVo(responseVo);
                     }
                 } else if(ProjectTypes.MATERIALTYPE.getCode().equals(pmDemand.getProjectType())){ //物资类
-                    PmDemandMaterials obj = new PmDemandMaterials();
-                    obj.setDemandId(demandId);
-                    List<PmDemandMaterials> list = iPmDemandMaterialsService.selectPmDemandMaterialsList(obj);
-                    if(list !=null && list.size() > 0){
+                    LambdaQueryWrapper<PmDemandMaterials> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+                    lambdaQueryWrapper.eq(PmDemandMaterials::getDemandId,demandId);
+                    PmDemandMaterials pmDemandMaterials = iPmDemandMaterialsService.getOne(lambdaQueryWrapper);
+
+                    if(pmDemandMaterials != null){
                         PmDemandMaterialsResVo responseVo = new PmDemandMaterialsResVo();
-                        BeanUtils.copyProperties(list.get(0),responseVo);
+                        BeanUtils.copyProperties(pmDemandMaterials,responseVo);
                         //采购方式建议
                         for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
                             if (responseVo.getProcurementMethodSuggest() != null && responseVo.getProcurementMethodSuggest().equals(value.getCode())) {
@@ -199,12 +198,13 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                         vo.setPmDemandMaterialsResVo(responseVo);
                     }
                 } else if(ProjectTypes.SERVICESTYPE.getCode().equals(pmDemand.getProjectType())){//服务类
-                    PmDemandServe obj = new PmDemandServe();
-                    obj.setDemandId(demandId);
-                    List<PmDemandServe> list = iPmDemandServeService.selectPmDemandServeList(obj);
-                    if(list !=null && list.size() > 0){
+                    LambdaQueryWrapper<PmDemandServe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+                    lambdaQueryWrapper.eq(PmDemandServe::getDemandId,demandId);
+                    PmDemandServe pmDemandServe = iPmDemandServeService.getOne(lambdaQueryWrapper);
+
+                    if(pmDemandServe != null){
                         PmDemandServeResVo responseVo = new PmDemandServeResVo();
-                        BeanUtils.copyProperties(list.get(0),responseVo);
+                        BeanUtils.copyProperties(pmDemandServe,responseVo);
                         //采购方式建议
                         for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
                             if (responseVo.getProcurementMethodSuggest() != null && responseVo.getProcurementMethodSuggest().equals(value.getCode())) {
@@ -219,12 +219,12 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                         vo.setPmDemandServeResVo(responseVo);
                     }
                 } else if(ProjectTypes.PLANTOEXAMINETYPE.getCode().equals(pmDemand.getProjectType())){//工程类
-                    PmDemandEngineering obj = new PmDemandEngineering();
-                    obj.setDemandId(demandId);
-                    List<PmDemandEngineering> list = iPmDemandEngineeringService.selectPmDemandEngineeringList(obj);
-                    if(list !=null && list.size() > 0){
+                    LambdaQueryWrapper<PmDemandEngineering> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+                    lambdaQueryWrapper.eq(PmDemandEngineering::getDemandId,demandId);
+                    PmDemandEngineering pmDemandEngineering = iPmDemandEngineeringService.getOne(lambdaQueryWrapper);
+                    if(pmDemandEngineering != null){
                         PmDemandEngineeringResVo responseVo = new PmDemandEngineeringResVo();
-                        BeanUtils.copyProperties(list.get(0),responseVo);
+                        BeanUtils.copyProperties(pmDemandEngineering,responseVo);
                         //采购方式建议
                         for (ProcurementMethodSuggest value : ProcurementMethodSuggest.values()) {
                             if (responseVo.getProcurementMethodSuggest() != null && responseVo.getProcurementMethodSuggest().equals(value.getCode())) {
@@ -396,30 +396,6 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     }
 
 
-    /**
-     * 新增采购需求
-     *
-     * @param pmDemand 采购需求
-     * @return 结果
-     */
-    @Override
-    public int insertPmDemand(PmDemand pmDemand) {
-        pmDemand.setCreateTime(DateUtils.getNowDate());
-        return pmDemandMapper.insertPmDemand(pmDemand);
-    }
-
-    /**
-     * 修改采购需求
-     *
-     * @param pmDemand 采购需求
-     * @return 结果
-     */
-    @Override
-    public int updatePmDemand(PmDemand pmDemand) {
-        pmDemand.setUpdateTime(DateUtils.getNowDate());
-        return pmDemandMapper.updatePmDemand(pmDemand);
-    }
-
     /**
      * 需求建档
      *
@@ -427,22 +403,22 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
      * @return 结果
      */
     @Override
-    public int bookBuilding(PmBookBuildingReqVo vo) {
-        PmDemand pmDemand = pmDemandMapper.selectPmDemandByDemandId(vo.getDemandId());
+    public boolean bookBuilding(PmBookBuildingReqVo vo) {
+        PmDemand pmDemand = this.getById(vo.getDemandId());
         String projectType = pmDemand.getProjectType();
         if(ProjectTypes.EQUIPMENTTYPE.getCode().equals(projectType)){ //装备类
             PmDemandEquipReqVo pmDemandEquipReqVo =  vo.getPmDemandEquipReqVo();
-            PmDemandEquip pmDemandEquipReq = new PmDemandEquip();
-            pmDemandEquipReq.setDemandId(vo.getDemandId());
-            PmDemandEquip pmDemandEquip = null;
-            List<PmDemandEquip> pmDemandEquipList = iPmDemandEquipService.selectPmDemandEquipList(pmDemandEquipReq);
-            if(pmDemandEquipList != null && pmDemandEquipList.size() > 0){
-                pmDemandEquip = pmDemandEquipList.get(0);
+
+            LambdaQueryWrapper<PmDemandEquip> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+            lambdaQueryWrapper.eq(PmDemandEquip::getDemandId,vo.getDemandId());
+            PmDemandEquip pmDemandEquip = iPmDemandEquipService.getOne(lambdaQueryWrapper);
+
+            if(pmDemandEquip != null){
                 pmDemandEquipReqVo.setDemandEquipId(pmDemandEquip.getDemandEquipId());
                 BeanUtils.copyProperties(pmDemandEquipReqVo,pmDemandEquip);
                 pmDemandEquip.setUpdateBy(vo.getUpdateBy());
                 pmDemandEquip.setUpdateTime(new Date());
-                iPmDemandEquipService.updatePmDemandEquip(pmDemandEquip);
+                iPmDemandEquipService.updateById(pmDemandEquip);
             } else {
                 pmDemandEquip = new PmDemandEquip();
                 BeanUtils.copyProperties(pmDemandEquipReqVo,pmDemandEquip);
@@ -450,7 +426,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                 pmDemandEquip.setCreateTime(new Date());
                 pmDemandEquip.setUpdateBy(vo.getUpdateBy());
                 pmDemandEquip.setUpdateTime(pmDemandEquip.getCreateTime());
-                iPmDemandEquipService.insertPmDemandEquip(pmDemandEquip);
+                iPmDemandEquipService.save(pmDemandEquip);
             }
 
             List<SysFileRef> sysFileRefs = pmDemandEquipReqVo.getSysFileRefs();
@@ -458,17 +434,17 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
 
         } else if(ProjectTypes.MATERIALTYPE.getCode().equals(projectType)) { //物资类
             PmDemandMaterialsReqVo pmDemandMaterialsReqVo =  vo.getPmDemandMaterialsReqVo();
-            PmDemandMaterials pmDemandMaterialsReq = new PmDemandMaterials();
-            pmDemandMaterialsReq.setDemandId(vo.getDemandId());
-            PmDemandMaterials pmDemandMaterials = null;
-            List<PmDemandMaterials> pmDemandMaterialsList = iPmDemandMaterialsService.selectPmDemandMaterialsList(pmDemandMaterialsReq);
-            if(pmDemandMaterialsList != null && pmDemandMaterialsList.size() > 0){
-                pmDemandMaterials = pmDemandMaterialsList.get(0);
+
+            LambdaQueryWrapper<PmDemandMaterials> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+            lambdaQueryWrapper.eq(PmDemandMaterials::getDemandId,vo.getDemandId());
+            PmDemandMaterials pmDemandMaterials = iPmDemandMaterialsService.getOne(lambdaQueryWrapper);
+
+            if(pmDemandMaterials != null){
                 pmDemandMaterialsReqVo.setDemandMaterialsId(pmDemandMaterials.getDemandMaterialsId());
                 BeanUtils.copyProperties(pmDemandMaterialsReqVo,pmDemandMaterials);
                 pmDemandMaterials.setUpdateBy(vo.getUpdateBy());
                 pmDemandMaterials.setUpdateTime(new Date());
-                iPmDemandMaterialsService.updatePmDemandMaterials(pmDemandMaterials);
+                iPmDemandMaterialsService.updateById(pmDemandMaterials);
             } else {
                 pmDemandMaterials = new PmDemandMaterials();
                 BeanUtils.copyProperties(pmDemandMaterialsReqVo,pmDemandMaterials);
@@ -476,7 +452,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                 pmDemandMaterials.setCreateTime(new Date());
                 pmDemandMaterials.setUpdateBy(vo.getUpdateBy());
                 pmDemandMaterials.setUpdateTime(pmDemandMaterials.getCreateTime());
-                iPmDemandMaterialsService.insertPmDemandMaterials(pmDemandMaterials);
+                iPmDemandMaterialsService.save(pmDemandMaterials);
             }
 
             List<SysFileRef> sysFileRefs = pmDemandMaterialsReqVo.getSysFileRefs();
@@ -484,17 +460,17 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
 
         } else if(ProjectTypes.SERVICESTYPE.getCode().equals(projectType)) { //服务类
             PmDemandServeReqVo pmDemandServeReqVo =  vo.getPmDemandServeReqVo();
-            PmDemandServe pmDemandServeReq = new PmDemandServe();
-            pmDemandServeReq.setDemandId(vo.getDemandId());
-            PmDemandServe pmDemandServe = null;
-            List<PmDemandServe> pmDemandServeList = iPmDemandServeService.selectPmDemandServeList(pmDemandServeReq);
-            if(pmDemandServeList != null && pmDemandServeList.size() > 0){
-                pmDemandServe = pmDemandServeList.get(0);
+
+            LambdaQueryWrapper<PmDemandServe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+            lambdaQueryWrapper.eq(PmDemandServe::getDemandId,vo.getDemandId());
+            PmDemandServe pmDemandServe = iPmDemandServeService.getOne(lambdaQueryWrapper);
+
+            if(pmDemandServe != null){
                 pmDemandServeReqVo.setDemandServeId(pmDemandServe.getDemandServeId());
                 BeanUtils.copyProperties(pmDemandServeReqVo,pmDemandServe);
                 pmDemandServe.setUpdateBy(vo.getUpdateBy());
                 pmDemandServe.setUpdateTime(new Date());
-                iPmDemandServeService.updatePmDemandServe(pmDemandServe);
+                iPmDemandServeService.updateById(pmDemandServe);
             } else {
                 pmDemandServe = new PmDemandServe();
                 BeanUtils.copyProperties(pmDemandServeReqVo,pmDemandServe);
@@ -502,24 +478,24 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                 pmDemandServe.setCreateTime(new Date());
                 pmDemandServe.setUpdateBy(vo.getUpdateBy());
                 pmDemandServe.setUpdateTime(pmDemandServe.getCreateTime());
-                iPmDemandServeService.insertPmDemandServe(pmDemandServe);
+                iPmDemandServeService.save(pmDemandServe);
             }
             List<SysFileRef> sysFileRefs = pmDemandServeReqVo.getSysFileRefs();
             uploadFile(pmDemandServe.getDemandServeId(),SysFileRefEnum.PM_DEMAND_SERVE.getType(),sysFileRefs,vo.getUpdateBy());
 
         } else if(ProjectTypes.PLANTOEXAMINETYPE.getCode().equals(projectType)) { //工程类
             PmDemandEngineeringReqVo pmDemandEngineeringReqVo =  vo.getPmDemandEngineeringReqVo();
-            PmDemandEngineering pmDemandEngineeringReq = new PmDemandEngineering();
-            pmDemandEngineeringReq.setDemandId(vo.getDemandId());
-            PmDemandEngineering pmDemandEngineering = null;
-            List<PmDemandEngineering> pmDemandEngineeringList = iPmDemandEngineeringService.selectPmDemandEngineeringList(pmDemandEngineeringReq);
-            if(pmDemandEngineeringList != null && pmDemandEngineeringList.size() > 0){
-                pmDemandEngineering = pmDemandEngineeringList.get(0);
+
+            LambdaQueryWrapper<PmDemandEngineering> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+            lambdaQueryWrapper.eq(PmDemandEngineering::getDemandId,vo.getDemandId());
+            PmDemandEngineering pmDemandEngineering = iPmDemandEngineeringService.getOne(lambdaQueryWrapper);
+
+            if(pmDemandEngineering != null){
                 pmDemandEngineeringReqVo.setDemandEngineeringId(pmDemandEngineering.getDemandEngineeringId());
                 BeanUtils.copyProperties(pmDemandEngineeringReqVo,pmDemandEngineering);
                 pmDemandEngineering.setUpdateBy(vo.getUpdateBy());
                 pmDemandEngineering.setUpdateTime(new Date());
-                iPmDemandEngineeringService.updatePmDemandEngineering(pmDemandEngineering);
+                iPmDemandEngineeringService.updateById(pmDemandEngineering);
             } else {
                 pmDemandEngineering = new PmDemandEngineering();
                 BeanUtils.copyProperties(pmDemandEngineeringReqVo,pmDemandEngineering);
@@ -527,7 +503,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
                 pmDemandEngineering.setCreateTime(new Date());
                 pmDemandEngineering.setUpdateBy(vo.getUpdateBy());
                 pmDemandEngineering.setUpdateTime(pmDemandEngineering.getCreateTime());
-                iPmDemandEngineeringService.insertPmDemandEngineering(pmDemandEngineering);
+                iPmDemandEngineeringService.save(pmDemandEngineering);
             }
             List<SysFileRef> sysFileRefs = pmDemandEngineeringReqVo.getSysFileRefs();
             uploadFile(pmDemandEngineering.getDemandEngineeringId(),SysFileRefEnum.PM_DEMAND_ENGINEERING.getType(),sysFileRefs,vo.getUpdateBy());
@@ -536,7 +512,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
 
         pmDemand.setUpdateBy(vo.getUpdateBy());
         pmDemand.setUpdateTime(DateUtils.getNowDate());
-        return pmDemandMapper.updatePmDemand(pmDemand);
+        return this.updateById(pmDemand);
     }
 
     private HashMap<String, String> getFileMap(Long redId,Integer type){
@@ -566,7 +542,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
      */
     @Override
     public Object viewFlowChart(Long demandId) {
-        PmDemand pmDemand = pmDemandMapper.selectPmDemandByDemandId(demandId);
+        PmDemand pmDemand = this.getById(demandId);
         String projectStatus = String.valueOf(pmDemand.getProjectStatus());
         String moduleName = null;
         if (PmProjectStatus.DEMAND_WAIT_FILL.getCode().equals(projectStatus) || PmProjectStatus.DEMAND_AUDIT_RETURN.getCode().equals(projectStatus)) {
@@ -600,17 +576,17 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     }
 
     public PmFlowChartResVo getModuleInfo(Long demandId,String moduleName){
-        PmDemand pmDemand = pmDemandMapper.selectPmDemandByDemandId(demandId);
+        PmDemand pmDemand = this.getById(demandId);
         String projectType = pmDemand.getProjectType();
 
-        PmFlowChart pmFlowChartReq = new PmFlowChart();
-        pmFlowChartReq.setModuleName(moduleName);
-        List<PmFlowChart> pmFlowChartList = iPmFlowChartService.selectPmFlowChartList(pmFlowChartReq);
-        if(pmFlowChartList == null || pmFlowChartList.size() ==0){
+        LambdaQueryWrapper<PmFlowChart> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+        lambdaQueryWrapper.eq(PmFlowChart::getModuleName,moduleName);
+        PmFlowChart pmFlowChart = iPmFlowChartService.getOne(lambdaQueryWrapper);
+        if(pmFlowChart == null){
             return null;
         }
         PmFlowChartResVo vo = new PmFlowChartResVo();
-        BeanUtils.copyProperties(pmFlowChartList.get(0), vo);
+        BeanUtils.copyProperties(pmFlowChart, vo);
 
         if("需求填制".equals(moduleName)) {
             HashMap<String, String> fileMap = getFileMap(demandId,SysFileRefEnum.PM_DEMAND.getType());
@@ -619,41 +595,41 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
             }
         } else if("需求提交".equals(moduleName)) {
             if(ProjectTypes.EQUIPMENTTYPE.getCode().equals(projectType)){ //装备类
-                PmDemandEquip pmDemandEquipReq = new PmDemandEquip();
-                pmDemandEquipReq.setDemandId(demandId);
-                List<PmDemandEquip> pmDemandEquipList = iPmDemandEquipService.selectPmDemandEquipList(pmDemandEquipReq);
-                if(pmDemandEquipList != null && pmDemandEquipList.size() > 0){
-                    HashMap<String, String> fileMap = getFileMap(pmDemandEquipList.get(0).getDemandEquipId(),SysFileRefEnum.PM_DEMAND_EQUIP.getType());
+                LambdaQueryWrapper<PmDemandEquip> pmDemandEquipLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                pmDemandEquipLambdaQueryWrapper.eq(PmDemandEquip::getDemandId,demandId);
+                PmDemandEquip pmDemandEquip = iPmDemandEquipService.getOne(pmDemandEquipLambdaQueryWrapper);
+                if(pmDemandEquip != null){
+                    HashMap<String, String> fileMap = getFileMap(pmDemandEquip.getDemandEquipId(),SysFileRefEnum.PM_DEMAND_EQUIP.getType());
                     if(fileMap != null){
                         vo.setFileMap(fileMap);
                     }
                 }
             } else if(ProjectTypes.MATERIALTYPE.getCode().equals(projectType)) { //物资类
-                PmDemandMaterials pmDemandMaterialsReq = new PmDemandMaterials();
-                pmDemandMaterialsReq.setDemandId(demandId);
-                List<PmDemandMaterials> pmDemandMaterialsList = iPmDemandMaterialsService.selectPmDemandMaterialsList(pmDemandMaterialsReq);
-                if(pmDemandMaterialsList != null && pmDemandMaterialsList.size() > 0){
-                    HashMap<String, String> fileMap = getFileMap(pmDemandMaterialsList.get(0).getDemandMaterialsId(),SysFileRefEnum.PM_DEMAND_MATERIALS.getType());
+                LambdaQueryWrapper<PmDemandMaterials> pmDemandMaterialsLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                pmDemandMaterialsLambdaQueryWrapper.eq(PmDemandMaterials::getDemandId,demandId);
+                PmDemandMaterials pmDemandMaterials = iPmDemandMaterialsService.getOne(pmDemandMaterialsLambdaQueryWrapper);
+                if(pmDemandMaterials != null){
+                    HashMap<String, String> fileMap = getFileMap(pmDemandMaterials.getDemandMaterialsId(),SysFileRefEnum.PM_DEMAND_MATERIALS.getType());
                     if(fileMap != null){
                         vo.setFileMap(fileMap);
                     }
                 }
             } else if(ProjectTypes.SERVICESTYPE.getCode().equals(projectType)) { //服务类
-                PmDemandServe pmDemandServeReq = new PmDemandServe();
-                pmDemandServeReq.setDemandId(demandId);
-                List<PmDemandServe> pmDemandServeList = iPmDemandServeService.selectPmDemandServeList(pmDemandServeReq);
-                if(pmDemandServeList != null && pmDemandServeList.size() > 0){
-                    HashMap<String, String> fileMap = getFileMap(pmDemandServeList.get(0).getDemandServeId(),SysFileRefEnum.PM_DEMAND_SERVE.getType());
+                LambdaQueryWrapper<PmDemandServe> pmDemandServeLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                pmDemandServeLambdaQueryWrapper.eq(PmDemandServe::getDemandId,demandId);
+                PmDemandServe pmDemandServe = iPmDemandServeService.getOne(pmDemandServeLambdaQueryWrapper);
+                if(pmDemandServe != null){
+                    HashMap<String, String> fileMap = getFileMap(pmDemandServe.getDemandServeId(),SysFileRefEnum.PM_DEMAND_SERVE.getType());
                     if(fileMap != null){
                         vo.setFileMap(fileMap);
                     }
                 }
             } else if(ProjectTypes.PLANTOEXAMINETYPE.getCode().equals(projectType)) { //工程类
-                PmDemandEngineering pmDemandEngineeringReq = new PmDemandEngineering();
-                pmDemandEngineeringReq.setDemandId(demandId);
-                List<PmDemandEngineering> pmDemandEngineeringList = iPmDemandEngineeringService.selectPmDemandEngineeringList(pmDemandEngineeringReq);
-                if(pmDemandEngineeringList != null && pmDemandEngineeringList.size() > 0){
-                    HashMap<String, String> fileMap = getFileMap(pmDemandEngineeringList.get(0).getDemandEngineeringId(),SysFileRefEnum.PM_DEMAND_ENGINEERING.getType());
+                LambdaQueryWrapper<PmDemandEngineering> pmDemandEngineeringLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                pmDemandEngineeringLambdaQueryWrapper.eq(PmDemandEngineering::getDemandId,demandId);
+                PmDemandEngineering pmDemandEngineering = iPmDemandEngineeringService.getOne(pmDemandEngineeringLambdaQueryWrapper);
+                if(pmDemandEngineering != null){
+                    HashMap<String, String> fileMap = getFileMap(pmDemandEngineering.getDemandEngineeringId(),SysFileRefEnum.PM_DEMAND_ENGINEERING.getType());
                     if(fileMap != null){
                         vo.setFileMap(fileMap);
                     }
@@ -679,13 +655,13 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
      * @return 结果
      */
     @Override
-    public int commit(PmDemandReqVo pmDemandReqVo) {
+    public boolean commit(PmDemandReqVo pmDemandReqVo) {
         PmDemand pmDemand = new PmDemand();
         pmDemand.setDemandId(pmDemandReqVo.getDemandId());
         pmDemand.setProjectStatus(Long.parseLong(PmProjectStatus.DEMAND_WAIT_AUDIT.getCode()));
         pmDemand.setUpdateBy(pmDemandReqVo.getUpdateBy());
         pmDemand.setUpdateTime(DateUtils.getNowDate());
-        return pmDemandMapper.updatePmDemand(pmDemand);
+        return this.updateById(pmDemand);
     }
 
     /**
@@ -695,7 +671,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
      * @return 结果
      */
     @Override
-    public int reviewTo(PmDemandReqVo pmDemandReqVo) {
+    public boolean reviewTo(PmDemandReqVo pmDemandReqVo) {
         PmDemand pmDemand = new PmDemand();
         pmDemand.setDemandId(pmDemandReqVo.getDemandId());
         pmDemand.setProjectStatus(Long.parseLong(PmProjectStatus.TASK_WAIT_RELEASE.getCode()));
@@ -705,7 +681,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         pmDemand.setUpdateBy(pmDemandReqVo.getUpdateBy());
         pmDemand.setUpdateTime(DateUtils.getNowDate());
         pmDemand.setAuditTime(DateUtils.getNowDate());
-        return pmDemandMapper.updatePmDemand(pmDemand);
+        return this.updateById(pmDemand);
     }
 
     /**
@@ -715,7 +691,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
      * @return 结果
      */
     @Override
-    public int reviewReturn(PmDemandReqVo pmDemandReqVo) {
+    public boolean reviewReturn(PmDemandReqVo pmDemandReqVo) {
         PmDemand pmDemand = new PmDemand();
         pmDemand.setDemandId(pmDemandReqVo.getDemandId());
         pmDemand.setProjectStatus(Long.parseLong(PmProjectStatus.DEMAND_WAIT_COMMIT.getCode()));
@@ -723,7 +699,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         pmDemand.setUpdateBy(pmDemandReqVo.getUpdateBy());
         pmDemand.setUpdateTime(DateUtils.getNowDate());
         pmDemand.setAuditTime(DateUtils.getNowDate());
-        return pmDemandMapper.updatePmDemand(pmDemand);
+        return this.updateById(pmDemand);
     }
 
     /**
@@ -733,7 +709,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
      * @return 结果
      */
     @Override
-    public int releaseTask(PmDemandReqVo pmDemandReqVo) {
+    public boolean releaseTask(PmDemandReqVo pmDemandReqVo) {
         PmDemand pmDemand = new PmDemand();
         pmDemand.setDemandId(pmDemandReqVo.getDemandId());
         pmDemand.setProjectStatus(Long.parseLong(PmProjectStatus.WAIT_SELECT_AGENT.getCode()));
@@ -743,7 +719,7 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
         pmDemand.setUpdateBy(pmDemandReqVo.getUpdateBy());
         pmDemand.setUpdateTime(DateUtils.getNowDate());
         pmDemand.setAuditTime(DateUtils.getNowDate());
-        return pmDemandMapper.updatePmDemand(pmDemand);
+        return this.updateById(pmDemand);
     }
 
 
@@ -785,36 +761,38 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
     }
 
     @Transactional(rollbackFor = Exception.class)
-    public boolean insertExpertBatch(PmBaseExpertReqVo pmBaseExpertReqVo) throws Exception {
-        PmDemand pmDemand = this.getById(pmBaseExpertReqVo.getDemandId());
+    public boolean insertExpertBatch(PmBaseExpertFillReqVo pmBaseExpertFillReqVo) throws Exception {
+        PmDemand pmDemand = this.getById(pmBaseExpertFillReqVo.getDemandId());
         if(ObjectUtils.isEmpty(pmDemand)){
             throw new Exception("参数错误");
         }
-        List<BaseExpert> baseExpertList = pmBaseExpertReqVo.getBaseExpertList();
+        List<BaseExpert> baseExpertList = pmBaseExpertFillReqVo.getBaseExpertList();
         List<PmDemandExpertRef> pmDemandExpertRefList = new ArrayList<>();
+        Date now = new Date();
         for (BaseExpert baseExpert : baseExpertList) {
             if(baseExpert.getStatus().equals(NameListType.WHITE.getCode())){
-                throw new Exception("该专家属于黑名单");
+                throw new Exception("该专家(身份证号:" +baseExpert.getIdNumber() + ")属于黑名单");
             }
             if(pmDemand.getProjectType().equals(baseExpert.getVarietyPurchase())){
-                throw new Exception("该专家所属采购品种和项目类型不匹配");
+                throw new Exception("该专家(身份证号:" +baseExpert.getIdNumber() + ")所属采购品种和项目类型不匹配");
             }
-            if(ObjectUtils.isEmpty(pmDemand.getCreateBy())){
-                pmDemand.setCreateBy(pmBaseExpertReqVo.getCreateBy());
-                pmDemand.setCreateTime(new Date());
+            if(ObjectUtils.isEmpty(baseExpert.getCreated())){
+                baseExpert.setCreated(pmBaseExpertFillReqVo.getCreateBy());
+                baseExpert.setCreateTime(now);
             }
 
-            if(ObjectUtils.isEmpty(pmDemand.getUpdateBy())){
-                pmDemand.setUpdateBy(pmBaseExpertReqVo.getUpdateBy());
-                pmDemand.setUpdateTime(new Date());
+            if(ObjectUtils.isEmpty(baseExpert.getUpdated())){
+                baseExpert.setUpdated(pmBaseExpertFillReqVo.getUpdateBy());
+                baseExpert.setUpdateTime(now);
             }
 
             PmDemandExpertRef pmDemandExpertRef = new PmDemandExpertRef();
             pmDemandExpertRef.setDemandId(pmDemand.getDemandId());
             pmDemandExpertRef.setExpertId(baseExpert.getId().longValue());
-            pmDemandExpertRef.setCreateBy(pmBaseExpertReqVo.getCreateBy());
-            pmDemandExpertRef.setCreateTime(new Date());
-            pmDemandExpertRef.setUpdateBy(pmBaseExpertReqVo.getCreateBy());
+            pmDemandExpertRef.setCreateBy(pmBaseExpertFillReqVo.getCreateBy());
+            pmDemandExpertRef.setAccessTime(DateUtils.parseDate(pmBaseExpertFillReqVo.getAccessTime()));
+            pmDemandExpertRef.setCreateTime(now);
+            pmDemandExpertRef.setUpdateBy(pmBaseExpertFillReqVo.getCreateBy());
             pmDemandExpertRef.setUpdateTime(pmDemandExpertRef.getCreateTime());
             pmDemandExpertRefList.add(pmDemandExpertRef);
         }
@@ -824,6 +802,116 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
           } else {
               return false;
           }
+    }
 
+   public boolean extractExpertBatch(PmBaseExpertExtractReqVo pmBaseExpertExtractReqVo) throws Exception {
+       Integer technicalExpertNumber = pmBaseExpertExtractReqVo.getTechnicalExpertNumber();
+       if(technicalExpertNumber== null){
+           technicalExpertNumber = 0;
+       }
+       Integer economicExpertNumber = pmBaseExpertExtractReqVo.getEconomicExpertNumber();
+       if(economicExpertNumber == null){
+           economicExpertNumber = 0;
+       }
+       Integer legalAffairsExpertNumber = pmBaseExpertExtractReqVo.getLegalAffairsExpertNumber();
+       if(legalAffairsExpertNumber == null){
+           legalAffairsExpertNumber = 0;
+       }
+       Integer spareExpertNumber = pmBaseExpertExtractReqVo.getSpareExpertNumber();
+       if(spareExpertNumber == null){
+           spareExpertNumber = 0;
+       }
+
+       String  professional = pmBaseExpertExtractReqVo.getProfessional();
+       if(spareExpertNumber > 0 && ObjectUtils.isEmpty(professional)){
+           throw new Exception("抽取备用专家必须选择专家专业");
+       }
+       String  localArea = pmBaseExpertExtractReqVo.getLocalArea();
+       if(spareExpertNumber > 0 && ObjectUtils.isEmpty(localArea)){
+           throw new Exception("抽取备用专家必须选择所在区域");
+       }
+
+       PmDemand pmDemand = this.getById(pmBaseExpertExtractReqVo.getDemandId());
+       if(ObjectUtils.isEmpty(pmDemand)){
+           throw new Exception("参数错误");
+       }
+
+       LambdaQueryWrapper<BaseExpert> lw = new LambdaQueryWrapper<BaseExpert>();
+       lw.eq(BaseExpert::getVarietyPurchase,pmDemand.getProjectType())
+               .eq(BaseExpert::getStatus,NameListType.WHITE.getCode());
+       List<BaseExpert> baseExpertList = baseExpertService.list(lw);
+       if(ObjectUtils.isEmpty(baseExpertList)){
+           throw new Exception("没抽取到符合条件的专家");
+       }
+
+       List<BaseExpert> technicalExpertList = new ArrayList<>();
+       List<BaseExpert> economicExpertList = new ArrayList<>();
+       List<BaseExpert> legalAffairsExpertList = new ArrayList<>();
+       List<BaseExpert> spareExpertList = new ArrayList<>();
+
+       for(BaseExpert baseExpert : baseExpertList){
+           if(technicalExpertNumber > 0) {
+               if(ExpertType.TECHNICAL_EXPERT.getCode().equals(baseExpert.getExpertType())){
+                   technicalExpertList.add(baseExpert);
+               }
+           }
+
+           if(economicExpertNumber > 0) {
+               if(ExpertType.ECONOMIC_EXPERT.getCode().equals(baseExpert.getExpertType())){
+                   economicExpertList.add(baseExpert);
+               }
+           }
+
+           if (legalAffairsExpertNumber > 0) {
+               if(ExpertType.LEGALAFFAIRS_EXPERT.getCode().equals(baseExpert.getExpertType())){
+                   legalAffairsExpertList.add(baseExpert);
+               }
+           }
+
+           if (spareExpertNumber > 0) {
+               String[] arr = professional.split(",");
+               List<String> professionalList = Arrays.asList(arr);
+               String majorType = baseExpert.getMajorType();
+               //TODO 所在区域判读
+
+               if(!ObjectUtils.isEmpty(majorType)){
+                   if(professionalList.contains(majorType)){
+                       spareExpertList.add(baseExpert);
+                   }
+               }
+           }
+       }
+
+       List<BaseExpert> alltExpertList = new ArrayList<>();
+       if(!ObjectUtils.isEmpty(technicalExpertList)){
+           alltExpertList.addAll(RandomUtil.getRandomList(technicalExpertList,technicalExpertNumber));
+       }
+       if(!ObjectUtils.isEmpty(economicExpertList)){
+           alltExpertList.addAll(RandomUtil.getRandomList(economicExpertList,economicExpertNumber));
+       }
+       if(!ObjectUtils.isEmpty(legalAffairsExpertList)){
+           alltExpertList.addAll(RandomUtil.getRandomList(legalAffairsExpertList,legalAffairsExpertNumber));
+       }
+       if(!ObjectUtils.isEmpty(spareExpertList)){
+           alltExpertList.addAll(RandomUtil.getRandomList(spareExpertList,spareExpertNumber));
+       }
+
+      if(ObjectUtils.isEmpty(alltExpertList)){
+          throw new Exception("没抽取到符合条件的专家");
+      } else {
+          List<PmDemandExpertRef> pmDemandExpertRefList = new ArrayList<>();
+          for(BaseExpert baseExpert :alltExpertList ) {
+              PmDemandExpertRef pmDemandExpertRef = new PmDemandExpertRef();
+              pmDemandExpertRef.setDemandId(pmDemand.getDemandId());
+              pmDemandExpertRef.setExpertId(baseExpert.getId().longValue());
+              pmDemandExpertRef.setCreateBy(pmBaseExpertExtractReqVo.getCreateBy());
+              pmDemandExpertRef.setAccessTime(DateUtils.parseDate(pmBaseExpertExtractReqVo.getAccessTime()));
+              pmDemandExpertRef.setCreateTime(new Date());
+              pmDemandExpertRef.setUpdateBy(pmBaseExpertExtractReqVo.getCreateBy());
+              pmDemandExpertRef.setUpdateTime(pmDemandExpertRef.getCreateTime());
+              pmDemandExpertRefList.add(pmDemandExpertRef);
+          }
+          return pmDemandExpertRefService.saveBatch(pmDemandExpertRefList);
+      }
     }
 }

+ 4 - 79
purchase-system/src/main/java/com/ozs/pm/service/impl/PmFlowChartServiceImpl.java

@@ -1,11 +1,11 @@
 package com.ozs.pm.service.impl;
 
-import java.util.List;
-import com.ozs.common.utils.DateUtils;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ozs.pm.doman.PmFlowChart;
+
 import com.ozs.pm.mapper.PmFlowChartMapper;
 import com.ozs.pm.service.IPmFlowChartService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 
@@ -16,82 +16,7 @@ import org.springframework.stereotype.Service;
  * @date 2023-01-25
  */
 @Service
-public class PmFlowChartServiceImpl implements IPmFlowChartService
+public class PmFlowChartServiceImpl extends ServiceImpl<PmFlowChartMapper, PmFlowChart> implements IPmFlowChartService
 {
-    @Autowired
-    private PmFlowChartMapper pmFlowChartMapper;
-
-    /**
-     * 查询流程图
-     *
-     * @param flowChartId 流程图主键
-     * @return 流程图
-     */
-    @Override
-    public PmFlowChart selectPmFlowChartByFlowChartId(Long flowChartId)
-    {
-        return pmFlowChartMapper.selectPmFlowChartByFlowChartId(flowChartId);
-    }
-
-    /**
-     * 查询流程图列表
-     *
-     * @param pmFlowChart 流程图
-     * @return 流程图
-     */
-    @Override
-    public List<PmFlowChart> selectPmFlowChartList(PmFlowChart pmFlowChart)
-    {
-        return pmFlowChartMapper.selectPmFlowChartList(pmFlowChart);
-    }
-
-    /**
-     * 新增流程图
-     *
-     * @param pmFlowChart 流程图
-     * @return 结果
-     */
-    @Override
-    public int insertPmFlowChart(PmFlowChart pmFlowChart)
-    {
-        pmFlowChart.setCreateTime(DateUtils.getNowDate());
-        return pmFlowChartMapper.insertPmFlowChart(pmFlowChart);
-    }
-
-    /**
-     * 修改流程图
-     *
-     * @param pmFlowChart 流程图
-     * @return 结果
-     */
-    @Override
-    public int updatePmFlowChart(PmFlowChart pmFlowChart)
-    {
-        pmFlowChart.setUpdateTime(DateUtils.getNowDate());
-        return pmFlowChartMapper.updatePmFlowChart(pmFlowChart);
-    }
-
-    /**
-     * 批量删除流程图
-     *
-     * @param flowChartIds 需要删除的流程图主键
-     * @return 结果
-     */
-    @Override
-    public int deletePmFlowChartByFlowChartIds(Long[] flowChartIds)
-    {
-        return pmFlowChartMapper.deletePmFlowChartByFlowChartIds(flowChartIds);
-    }
 
-    /**
-     * 删除流程图信息
-     *
-     * @param flowChartId 流程图主键
-     * @return 结果
-     */
-    @Override
-    public int deletePmFlowChartByFlowChartId(Long flowChartId)
-    {
-        return pmFlowChartMapper.deletePmFlowChartByFlowChartId(flowChartId);
-    }
 }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 160
purchase-system/src/main/resources/mapper/pm/PmDemandEngineeringMapper.xml


+ 0 - 105
purchase-system/src/main/resources/mapper/pm/PmDemandEquipMapper.xml

@@ -3,110 +3,5 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ozs.pm.mapper.PmDemandEquipMapper">
-    
-    <resultMap type="com.ozs.pm.doman.PmDemandEquip" id="PmDemandEquipResult">
-        <result property="demandEquipId"    column="demand_equip_id"    />
-        <result property="demandId"    column="demand_id"    />
-        <result property="typeAndName"    column="type_and_name"    />
-        <result property="specification"    column="specification"    />
-        <result property="qualityTechnicalStandard"    column="quality_technical_standard"    />
-        <result property="measurementUnit"    column="measurement_unit"    />
-        <result property="procurementQuantity"    column="procurement_quantity"    />
-        <result property="price"    column="price"    />
-        <result property="budgetAmount"    column="budget_amount"    />
-        <result property="demandCommitTime"    column="demand_commit_time"    />
-        <result property="procurementMethodSuggest"    column="procurement_method_suggest"    />
-        <result property="remarks"    column="remarks"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-    </resultMap>
-
-    <sql id="selectPmDemandEquipVo">
-        select demand_equip_id, demand_id, type_and_name, specification, quality_technical_standard, measurement_unit, procurement_quantity, price, budget_amount, demand_commit_time, procurement_method_suggest, remarks, create_by, create_time, update_by, update_time from pm_demand_equip
-    </sql>
-
-    <select id="selectPmDemandEquipList" parameterType="com.ozs.pm.doman.PmDemandEquip" resultMap="PmDemandEquipResult">
-        <include refid="selectPmDemandEquipVo"/>
-        <where>  
-            <if test="demandId != null "> and demand_id = #{demandId}</if>
-            <if test="typeAndName != null  and typeAndName != ''"> and type_and_name like concat('%', #{typeAndName}, '%')</if>
-            <if test="specification != null  and specification != ''"> and specification = #{specification}</if>
-            <if test="qualityTechnicalStandard != null  and qualityTechnicalStandard != ''"> and quality_technical_standard = #{qualityTechnicalStandard}</if>
-            <if test="measurementUnit != null  and measurementUnit != ''"> and measurement_unit = #{measurementUnit}</if>
-            <if test="procurementQuantity != null "> and procurement_quantity = #{procurementQuantity}</if>
-            <if test="price != null "> and price = #{price}</if>
-            <if test="budgetAmount != null "> and budget_amount = #{budgetAmount}</if>
-            <if test="demandCommitTime != null "> and demand_commit_time = #{demandCommitTime}</if>
-            <if test="procurementMethodSuggest != null  and procurementMethodSuggest != ''"> and procurement_method_suggest = #{procurementMethodSuggest}</if>
-            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
-        </where>
-    </select>
-    
-    <select id="selectPmDemandEquipByDemandEquipId" parameterType="Long" resultMap="PmDemandEquipResult">
-        <include refid="selectPmDemandEquipVo"/>
-        where demand_equip_id = #{demandEquipId}
-    </select>
-        
-    <insert id="insertPmDemandEquip" parameterType="com.ozs.pm.doman.PmDemandEquip" useGeneratedKeys="true" keyProperty="demandEquipId">
-        insert into pm_demand_equip
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="demandId != null">demand_id,</if>
-            <if test="typeAndName != null">type_and_name,</if>
-            <if test="specification != null">specification,</if>
-            <if test="qualityTechnicalStandard != null">quality_technical_standard,</if>
-            <if test="measurementUnit != null and measurementUnit != ''">measurement_unit,</if>
-            <if test="procurementQuantity != null">procurement_quantity,</if>
-            <if test="price != null">price,</if>
-            <if test="budgetAmount != null">budget_amount,</if>
-            <if test="demandCommitTime != null">demand_commit_time,</if>
-            <if test="procurementMethodSuggest != null">procurement_method_suggest,</if>
-            <if test="remarks != null">remarks,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="demandId != null">#{demandId},</if>
-            <if test="typeAndName != null">#{typeAndName},</if>
-            <if test="specification != null">#{specification},</if>
-            <if test="qualityTechnicalStandard != null">#{qualityTechnicalStandard},</if>
-            <if test="measurementUnit != null and measurementUnit != ''">#{measurementUnit},</if>
-            <if test="procurementQuantity != null">#{procurementQuantity},</if>
-            <if test="price != null">#{price},</if>
-            <if test="budgetAmount != null">#{budgetAmount},</if>
-            <if test="demandCommitTime != null">#{demandCommitTime},</if>
-            <if test="procurementMethodSuggest != null">#{procurementMethodSuggest},</if>
-            <if test="remarks != null">#{remarks},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-         </trim>
-    </insert>
-
-    <update id="updatePmDemandEquip" parameterType="com.ozs.pm.doman.PmDemandEquip">
-        update pm_demand_equip
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="demandId != null">demand_id = #{demandId},</if>
-            <if test="typeAndName != null">type_and_name = #{typeAndName},</if>
-            <if test="specification != null">specification = #{specification},</if>
-            <if test="qualityTechnicalStandard != null">quality_technical_standard = #{qualityTechnicalStandard},</if>
-            <if test="measurementUnit != null and measurementUnit != ''">measurement_unit = #{measurementUnit},</if>
-            <if test="procurementQuantity != null">procurement_quantity = #{procurementQuantity},</if>
-            <if test="price != null">price = #{price},</if>
-            <if test="budgetAmount != null">budget_amount = #{budgetAmount},</if>
-            <if test="demandCommitTime != null">demand_commit_time = #{demandCommitTime},</if>
-            <if test="procurementMethodSuggest != null">procurement_method_suggest = #{procurementMethodSuggest},</if>
-            <if test="remarks != null">remarks = #{remarks},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-        </trim>
-        where demand_equip_id = #{demandEquipId}
-    </update>
 
 </mapper>

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 186
purchase-system/src/main/resources/mapper/pm/PmDemandMapper.xml


+ 0 - 105
purchase-system/src/main/resources/mapper/pm/PmDemandMaterialsMapper.xml

@@ -4,110 +4,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ozs.pm.mapper.PmDemandMaterialsMapper">
     
-    <resultMap type="com.ozs.pm.doman.PmDemandMaterials" id="PmDemandMaterialsResult">
-        <result property="demandMaterialsId"    column="demand_materials_id"    />
-        <result property="demandId"    column="demand_id"    />
-        <result property="typeAndName"    column="type_and_name"    />
-        <result property="specification"    column="specification"    />
-        <result property="qualityTechnicalStandard"    column="quality_technical_standard"    />
-        <result property="measurementUnit"    column="measurement_unit"    />
-        <result property="procurementQuantity"    column="procurement_quantity"    />
-        <result property="price"    column="price"    />
-        <result property="budgetAmount"    column="budget_amount"    />
-        <result property="demandCommitTime"    column="demand_commit_time"    />
-        <result property="procurementMethodSuggest"    column="procurement_method_suggest"    />
-        <result property="remarks"    column="remarks"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-    </resultMap>
-
-    <sql id="selectPmDemandMaterialsVo">
-        select demand_materials_id, demand_id, type_and_name, specification, quality_technical_standard, measurement_unit, procurement_quantity, price, budget_amount, demand_commit_time, procurement_method_suggest, remarks, create_by, create_time, update_by, update_time from pm_demand_materials
-    </sql>
-
-    <select id="selectPmDemandMaterialsList" parameterType="com.ozs.pm.doman.PmDemandMaterials" resultMap="PmDemandMaterialsResult">
-        <include refid="selectPmDemandMaterialsVo"/>
-        <where>  
-            <if test="demandId != null "> and demand_id = #{demandId}</if>
-            <if test="typeAndName != null  and typeAndName != ''"> and type_and_name like concat('%', #{typeAndName}, '%')</if>
-            <if test="specification != null  and specification != ''"> and specification = #{specification}</if>
-            <if test="qualityTechnicalStandard != null  and qualityTechnicalStandard != ''"> and quality_technical_standard = #{qualityTechnicalStandard}</if>
-            <if test="measurementUnit != null  and measurementUnit != ''"> and measurement_unit = #{measurementUnit}</if>
-            <if test="procurementQuantity != null "> and procurement_quantity = #{procurementQuantity}</if>
-            <if test="price != null "> and price = #{price}</if>
-            <if test="budgetAmount != null "> and budget_amount = #{budgetAmount}</if>
-            <if test="demandCommitTime != null "> and demand_commit_time = #{demandCommitTime}</if>
-            <if test="procurementMethodSuggest != null  and procurementMethodSuggest != ''"> and procurement_method_suggest = #{procurementMethodSuggest}</if>
-            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
-
-        </where>
-    </select>
-    
-    <select id="selectPmDemandMaterialsByDemandMaterialsId" parameterType="Long" resultMap="PmDemandMaterialsResult">
-        <include refid="selectPmDemandMaterialsVo"/>
-        where demand_materials_id = #{demandMaterialsId}
-    </select>
-        
-    <insert id="insertPmDemandMaterials" parameterType="com.ozs.pm.doman.PmDemandMaterials" useGeneratedKeys="true" keyProperty="demandMaterialsId">
-        insert into pm_demand_materials
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="demandId != null">demand_id,</if>
-            <if test="typeAndName != null">type_and_name,</if>
-            <if test="specification != null">specification,</if>
-            <if test="qualityTechnicalStandard != null">quality_technical_standard,</if>
-            <if test="measurementUnit != null">measurement_unit,</if>
-            <if test="procurementQuantity != null">procurement_quantity,</if>
-            <if test="price != null">price,</if>
-            <if test="budgetAmount != null">budget_amount,</if>
-            <if test="demandCommitTime != null">demand_commit_time,</if>
-            <if test="procurementMethodSuggest != null">procurement_method_suggest,</if>
-            <if test="remarks != null">remarks,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="demandId != null">#{demandId},</if>
-            <if test="typeAndName != null">#{typeAndName},</if>
-            <if test="specification != null">#{specification},</if>
-            <if test="qualityTechnicalStandard != null">#{qualityTechnicalStandard},</if>
-            <if test="measurementUnit != null">#{measurementUnit},</if>
-            <if test="procurementQuantity != null">#{procurementQuantity},</if>
-            <if test="price != null">#{price},</if>
-            <if test="budgetAmount != null">#{budgetAmount},</if>
-            <if test="demandCommitTime != null">#{demandCommitTime},</if>
-            <if test="procurementMethodSuggest != null">#{procurementMethodSuggest},</if>
-            <if test="remarks != null">#{remarks},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-         </trim>
-    </insert>
-
-    <update id="updatePmDemandMaterials" parameterType="com.ozs.pm.doman.PmDemandMaterials">
-        update pm_demand_materials
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="demandId != null">demand_id = #{demandId},</if>
-            <if test="typeAndName != null">type_and_name = #{typeAndName},</if>
-            <if test="specification != null">specification = #{specification},</if>
-            <if test="qualityTechnicalStandard != null">quality_technical_standard = #{qualityTechnicalStandard},</if>
-            <if test="measurementUnit != null">measurement_unit = #{measurementUnit},</if>
-            <if test="procurementQuantity != null">procurement_quantity = #{procurementQuantity},</if>
-            <if test="price != null">price = #{price},</if>
-            <if test="budgetAmount != null">budget_amount = #{budgetAmount},</if>
-            <if test="demandCommitTime != null">demand_commit_time = #{demandCommitTime},</if>
-            <if test="procurementMethodSuggest != null">procurement_method_suggest = #{procurementMethodSuggest},</if>
-            <if test="remarks != null">remarks = #{remarks},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-        </trim>
-        where demand_materials_id = #{demandMaterialsId}
-    </update>
 
 </mapper>

+ 0 - 104
purchase-system/src/main/resources/mapper/pm/PmDemandServeMapper.xml

@@ -3,110 +3,6 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ozs.pm.mapper.PmDemandServeMapper">
-    
-    <resultMap type="com.ozs.pm.doman.PmDemandServe" id="PmDemandServeResult">
-        <result property="demandServeId"    column="demand_serve_id"    />
-        <result property="demandId"    column="demand_id"    />
-        <result property="serviceName"    column="service_name"    />
-        <result property="technicalServiceRequirement"    column="technical_service_requirement"    />
-        <result property="measurementUnit"    column="measurement_unit"    />
-        <result property="procurementQuantity"    column="procurement_quantity"    />
-        <result property="price"    column="price"    />
-        <result property="budgetAmount"    column="budget_amount"    />
-        <result property="deliveryTimeLimit"    column="delivery_time_limit"    />
-        <result property="procurementMethodSuggest"    column="procurement_method_suggest"    />
-        <result property="supplierId"    column="supplier_id"    />
-        <result property="remarks"    column="remarks"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-    </resultMap>
 
-    <sql id="selectPmDemandServeVo">
-        select demand_serve_id, demand_id, service_name, technical_service_requirement, measurement_unit, procurement_quantity, price, budget_amount, delivery_time_limit, procurement_method_suggest, supplier_id, remarks, create_by, create_time, update_by, update_time from pm_demand_serve
-    </sql>
-
-    <select id="selectPmDemandServeList" parameterType="com.ozs.pm.doman.PmDemandServe" resultMap="PmDemandServeResult">
-        <include refid="selectPmDemandServeVo"/>
-        <where>  
-            <if test="demandId != null "> and demand_id = #{demandId}</if>
-            <if test="serviceName != null  and serviceName != ''"> and service_name like concat('%', #{serviceName}, '%')</if>
-            <if test="technicalServiceRequirement != null  and technicalServiceRequirement != ''"> and technical_service_requirement = #{technicalServiceRequirement}</if>
-            <if test="measurementUnit != null  and measurementUnit != ''"> and measurement_unit = #{measurementUnit}</if>
-            <if test="procurementQuantity != null "> and procurement_quantity = #{procurementQuantity}</if>
-            <if test="price != null "> and price = #{price}</if>
-            <if test="budgetAmount != null "> and budget_amount = #{budgetAmount}</if>
-            <if test="deliveryTimeLimit != null  and deliveryTimeLimit != ''"> and delivery_time_limit = #{deliveryTimeLimit}</if>
-            <if test="procurementMethodSuggest != null  and procurementMethodSuggest != ''"> and procurement_method_suggest = #{procurementMethodSuggest}</if>
-            <if test="supplierId != null "> and supplier_id = #{supplierId}</if>
-            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
-        </where>
-    </select>
-    
-    <select id="selectPmDemandServeByDemandServeId" parameterType="Long" resultMap="PmDemandServeResult">
-        <include refid="selectPmDemandServeVo"/>
-        where demand_serve_id = #{demandServeId}
-    </select>
-        
-    <insert id="insertPmDemandServe" parameterType="com.ozs.pm.doman.PmDemandServe" useGeneratedKeys="true" keyProperty="demandServeId">
-        insert into pm_demand_serve
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="demandId != null">demand_id,</if>
-            <if test="serviceName != null">service_name,</if>
-            <if test="technicalServiceRequirement != null">technical_service_requirement,</if>
-            <if test="measurementUnit != null">measurement_unit,</if>
-            <if test="procurementQuantity != null">procurement_quantity,</if>
-            <if test="price != null">price,</if>
-            <if test="budgetAmount != null">budget_amount,</if>
-            <if test="deliveryTimeLimit != null">delivery_time_limit,</if>
-            <if test="procurementMethodSuggest != null">procurement_method_suggest,</if>
-            <if test="supplierId != null">supplier_id,</if>
-            <if test="remarks != null">remarks,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="demandId != null">#{demandId},</if>
-            <if test="serviceName != null">#{serviceName},</if>
-            <if test="technicalServiceRequirement != null">#{technicalServiceRequirement},</if>
-            <if test="measurementUnit != null">#{measurementUnit},</if>
-            <if test="procurementQuantity != null">#{procurementQuantity},</if>
-            <if test="price != null">#{price},</if>
-            <if test="budgetAmount != null">#{budgetAmount},</if>
-            <if test="deliveryTimeLimit != null">#{deliveryTimeLimit},</if>
-            <if test="procurementMethodSuggest != null">#{procurementMethodSuggest},</if>
-            <if test="supplierId != null">#{supplierId},</if>
-            <if test="remarks != null">#{remarks},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-         </trim>
-    </insert>
-
-    <update id="updatePmDemandServe" parameterType="com.ozs.pm.doman.PmDemandServe">
-        update pm_demand_serve
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="demandId != null">demand_id = #{demandId},</if>
-            <if test="serviceName != null">service_name = #{serviceName},</if>
-            <if test="technicalServiceRequirement != null">technical_service_requirement = #{technicalServiceRequirement},</if>
-            <if test="measurementUnit != null">measurement_unit = #{measurementUnit},</if>
-            <if test="procurementQuantity != null">procurement_quantity = #{procurementQuantity},</if>
-            <if test="price != null">price = #{price},</if>
-            <if test="budgetAmount != null">budget_amount = #{budgetAmount},</if>
-            <if test="deliveryTimeLimit != null">delivery_time_limit = #{deliveryTimeLimit},</if>
-            <if test="procurementMethodSuggest != null">procurement_method_suggest = #{procurementMethodSuggest},</if>
-            <if test="supplierId != null">supplier_id = #{supplierId},</if>
-            <if test="remarks != null">remarks = #{remarks},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-        </trim>
-        where demand_serve_id = #{demandServeId}
-    </update>
 
 </mapper>

+ 0 - 75
purchase-system/src/main/resources/mapper/pm/PmFlowChartMapper.xml

@@ -3,80 +3,5 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ozs.pm.mapper.PmFlowChartMapper">
-    
-    <resultMap type="com.ozs.pm.doman.PmFlowChart" id="PmFlowChartResult">
-        <result property="flowChartId"    column="flow_chart_id"    />
-        <result property="moduleName"    column="module_name"    />
-        <result property="deptRole"    column="dept_role"    />
-        <result property="promptWords"    column="prompt_words"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-    </resultMap>
 
-    <sql id="selectPmFlowChartVo">
-        select flow_chart_id, module_name, dept_role, prompt_words, create_by, create_time, update_by, update_time from pm_flow_chart
-    </sql>
-
-    <select id="selectPmFlowChartList" parameterType="com.ozs.pm.doman.PmFlowChart" resultMap="PmFlowChartResult">
-        <include refid="selectPmFlowChartVo"/>
-        <where>  
-            <if test="moduleName != null  and moduleName != ''"> and module_name like concat('%', #{moduleName}, '%')</if>
-            <if test="deptRole != null  and deptRole != ''"> and dept_role = #{deptRole}</if>
-            <if test="promptWords != null  and promptWords != ''"> and prompt_words = #{promptWords}</if>
-        </where>
-    </select>
-    
-    <select id="selectPmFlowChartByFlowChartId" parameterType="Long" resultMap="PmFlowChartResult">
-        <include refid="selectPmFlowChartVo"/>
-        where flow_chart_id = #{flowChartId}
-    </select>
-        
-    <insert id="insertPmFlowChart" parameterType="com.ozs.pm.doman.PmFlowChart" useGeneratedKeys="true" keyProperty="flowChartId">
-        insert into pm_flow_chart
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="moduleName != null and moduleName != ''">module_name,</if>
-            <if test="deptRole != null">dept_role,</if>
-            <if test="promptWords != null">prompt_words,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="moduleName != null and moduleName != ''">#{moduleName},</if>
-            <if test="deptRole != null">#{deptRole},</if>
-            <if test="promptWords != null">#{promptWords},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-         </trim>
-    </insert>
-
-    <update id="updatePmFlowChart" parameterType="com.ozs.pm.doman.PmFlowChart">
-        update pm_flow_chart
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="moduleName != null and moduleName != ''">module_name = #{moduleName},</if>
-            <if test="deptRole != null">dept_role = #{deptRole},</if>
-            <if test="promptWords != null">prompt_words = #{promptWords},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-        </trim>
-        where flow_chart_id = #{flowChartId}
-    </update>
-
-    <delete id="deletePmFlowChartByFlowChartId" parameterType="Long">
-        delete from pm_flow_chart where flow_chart_id = #{flowChartId}
-    </delete>
-
-    <delete id="deletePmFlowChartByFlowChartIds" parameterType="String">
-        delete from pm_flow_chart where flow_chart_id in 
-        <foreach item="flowChartId" collection="array" open="(" separator="," close=")">
-            #{flowChartId}
-        </foreach>
-    </delete>
 </mapper>