Răsfoiți Sursa

Merge remote-tracking branch 'origin/master'

24282 2 ani în urmă
părinte
comite
1ad6fb44cb
67 a modificat fișierele cu 2307 adăugiri și 20 ștergeri
  1. 0 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/a-json/EhsdPurchaseApi.json
  2. 0 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/a-json/EhsdPurchaseArrivalApi.json
  3. 0 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/a-json/EhsdPurchaseProductApi.json
  4. 0 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/a-json/EhsdPurchaseProductMountingsApi.json
  5. 0 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/a-json/EhsdPurchaseProjectApi.json
  6. 25 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/controller/delivery/DeliveryController.java
  7. 68 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/controller/purchase/EhsdPurchaseArrivalController.java
  8. 68 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/controller/purchase/EhsdPurchaseController.java
  9. 68 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/controller/purchase/EhsdPurchaseProductController.java
  10. 68 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/controller/purchase/EhsdPurchaseProductMountingsController.java
  11. 68 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/controller/purchase/EhsdPurchaseProjectController.java
  12. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseArrivalDto.java
  13. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseArrivalSelectDto.java
  14. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseDto.java
  15. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseProductDto.java
  16. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseProductMountingsDto.java
  17. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseProductMountingsSelectDto.java
  18. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseProductSelectDto.java
  19. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseProjectDto.java
  20. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseProjectSelectDto.java
  21. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseSelectDto.java
  22. 188 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/po/EhsdPurchase.java
  23. 48 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/po/EhsdPurchaseArrival.java
  24. 92 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/po/EhsdPurchaseProduct.java
  25. 68 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/po/EhsdPurchaseProductMountings.java
  26. 44 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/po/EhsdPurchaseProject.java
  27. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/vo/EhsdPurchaseArrivalVo.java
  28. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/vo/EhsdPurchaseProductMountingsVo.java
  29. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/vo/EhsdPurchaseProductVo.java
  30. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/vo/EhsdPurchaseProjectVo.java
  31. 17 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/vo/EhsdPurchaseVo.java
  32. 134 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/flow/EhsdPurchaseFlow.java
  33. 26 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/mapper/purchase/EhsdPurchaseArrivalMapper.java
  34. 26 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/mapper/purchase/EhsdPurchaseMapper.java
  35. 26 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/mapper/purchase/EhsdPurchaseProductMapper.java
  36. 26 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/mapper/purchase/EhsdPurchaseProductMountingsMapper.java
  37. 26 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/mapper/purchase/EhsdPurchaseProjectMapper.java
  38. 46 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/EhsdPurchaseArrivalService.java
  39. 46 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/EhsdPurchaseProductMountingsService.java
  40. 46 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/EhsdPurchaseProductService.java
  41. 46 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/EhsdPurchaseProjectService.java
  42. 46 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/EhsdPurchaseService.java
  43. 57 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/impl/EhsdPurchaseArrivalServiceImpl.java
  44. 57 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/impl/EhsdPurchaseProductMountingsServiceImpl.java
  45. 57 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/impl/EhsdPurchaseProductServiceImpl.java
  46. 57 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/impl/EhsdPurchaseProjectServiceImpl.java
  47. 57 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/impl/EhsdPurchaseServiceImpl.java
  48. 103 0
      hx-ehsd/src/main/java/com/fjhx/ehsd/util/CodeEnum.java
  49. 20 0
      hx-ehsd/src/main/resources/mapper/purchase/EhsdPurchaseArrivalMapper.xml
  50. 46 0
      hx-ehsd/src/main/resources/mapper/purchase/EhsdPurchaseMapper.xml
  51. 24 0
      hx-ehsd/src/main/resources/mapper/purchase/EhsdPurchaseProductMapper.xml
  52. 24 0
      hx-ehsd/src/main/resources/mapper/purchase/EhsdPurchaseProductMountingsMapper.xml
  53. 19 0
      hx-ehsd/src/main/resources/mapper/purchase/EhsdPurchaseProjectMapper.xml
  54. 7 0
      hx-jxst/src/main/java/com/fjhx/jxst/entity/sales/po/SalesContract.java
  55. 0 5
      hx-jxst/src/main/java/com/fjhx/jxst/entity/sales/vo/SalesContractVo.java
  56. 27 9
      hx-jxst/src/main/java/com/fjhx/jxst/service/sales/impl/SalesContractServiceImpl.java
  57. 5 1
      hx-sale/src/main/java/com/fjhx/sale/controller/sample/SampleController.java
  58. 17 1
      hx-sale/src/main/java/com/fjhx/sale/entity/contract/vo/ContractProductVo.java
  59. 1 1
      hx-sale/src/main/java/com/fjhx/sale/flow/PurchaseFlow.java
  60. 8 1
      hx-sale/src/main/java/com/fjhx/sale/mapper/contract/ContractProductMapper.java
  61. 9 1
      hx-sale/src/main/java/com/fjhx/sale/mapper/sample/SampleMapper.java
  62. 5 1
      hx-sale/src/main/java/com/fjhx/sale/service/contract/ContractProductService.java
  63. 47 0
      hx-sale/src/main/java/com/fjhx/sale/service/contract/impl/ContractProductServiceImpl.java
  64. 8 0
      hx-sale/src/main/java/com/fjhx/sale/service/sample/SampleService.java
  65. 45 0
      hx-sale/src/main/java/com/fjhx/sale/service/sample/impl/SampleServiceImpl.java
  66. 27 0
      hx-sale/src/main/resources/mapper/contract/ContractProductMapper.xml
  67. 26 0
      hx-sale/src/main/resources/mapper/sample/SampleMapper.xml

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/a-json/EhsdPurchaseApi.json


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/a-json/EhsdPurchaseArrivalApi.json


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/a-json/EhsdPurchaseProductApi.json


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/a-json/EhsdPurchaseProductMountingsApi.json


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/a-json/EhsdPurchaseProjectApi.json


+ 25 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/controller/delivery/DeliveryController.java

@@ -1,16 +1,22 @@
 package com.fjhx.ehsd.controller.delivery;
 
+import cn.hutool.http.server.SimpleServer;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.fjhx.sale.entity.contract.dto.ContractProductDto;
 import com.fjhx.sale.entity.contract.dto.ContractProductSelectDto;
 import com.fjhx.sale.entity.contract.vo.ContractProductVo;
+import com.fjhx.sale.entity.sample.dto.SampleSelectDto;
+import com.fjhx.sale.entity.sample.vo.SampleVo;
 import com.fjhx.sale.service.contract.ContractProductService;
+import com.fjhx.sale.service.sample.SampleService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -27,6 +33,9 @@ public class DeliveryController {
     @Autowired
     private ContractProductService contractProductService;
 
+    @Autowired
+    private SampleService sampleService;
+
     /**
      * 交接单--分页
      */
@@ -35,4 +44,20 @@ public class DeliveryController {
         return contractProductService.getEHSDPage(dto);
     }
 
+    /**
+     * 合同交接单--分页
+     */
+    @PostMapping("/contractHandoverPage")
+    public Page<ContractProductVo> contractHandoverPage(@RequestBody ContractProductSelectDto dto) {
+        return contractProductService.contractHandoverPage(dto);
+    }
+
+    /**
+     * 样品交接单添加
+     */
+    @PostMapping("/sampleHandoverList")
+    public Page<ContractProductVo> sampleHandoverList(@RequestBody SampleSelectDto dto) {
+        return  sampleService.sampleHandoverList(dto);
+    }
+
 }

+ 68 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/controller/purchase/EhsdPurchaseArrivalController.java

@@ -0,0 +1,68 @@
+package com.fjhx.ehsd.controller.purchase;
+
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseArrivalVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseArrivalSelectDto;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseArrivalDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.ehsd.service.purchase.EhsdPurchaseArrivalService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * <p>
+ * 采购合同-到货计划 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@RestController
+@RequestMapping("/ehsdPurchaseArrival")
+public class EhsdPurchaseArrivalController {
+
+    @Autowired
+    private EhsdPurchaseArrivalService ehsdPurchaseArrivalService;
+
+    /**
+     * 采购合同-到货计划分页
+     */
+    @PostMapping("/page")
+    public Page<EhsdPurchaseArrivalVo> page(@RequestBody EhsdPurchaseArrivalSelectDto dto) {
+        return ehsdPurchaseArrivalService.getPage(dto);
+    }
+
+    /**
+     * 采购合同-到货计划明细
+     */
+    @PostMapping("/detail")
+    public EhsdPurchaseArrivalVo detail(@RequestBody BaseSelectDto dto) {
+        return ehsdPurchaseArrivalService.detail(dto.getId());
+    }
+
+    /**
+     * 采购合同-到货计划新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody EhsdPurchaseArrivalDto ehsdPurchaseArrivalDto) {
+        ehsdPurchaseArrivalService.add(ehsdPurchaseArrivalDto);
+    }
+
+    /**
+     * 采购合同-到货计划编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody EhsdPurchaseArrivalDto ehsdPurchaseArrivalDto) {
+        ehsdPurchaseArrivalService.edit(ehsdPurchaseArrivalDto);
+    }
+
+    /**
+     * 采购合同-到货计划删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        ehsdPurchaseArrivalService.delete(dto.getId());
+    }
+
+}

+ 68 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/controller/purchase/EhsdPurchaseController.java

@@ -0,0 +1,68 @@
+package com.fjhx.ehsd.controller.purchase;
+
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseSelectDto;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.ehsd.service.purchase.EhsdPurchaseService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * <p>
+ * ehsd采购表 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@RestController
+@RequestMapping("/ehsdPurchase")
+public class EhsdPurchaseController {
+
+    @Autowired
+    private EhsdPurchaseService ehsdPurchaseService;
+
+    /**
+     * ehsd采购表分页
+     */
+    @PostMapping("/page")
+    public Page<EhsdPurchaseVo> page(@RequestBody EhsdPurchaseSelectDto dto) {
+        return ehsdPurchaseService.getPage(dto);
+    }
+
+    /**
+     * ehsd采购表明细
+     */
+    @PostMapping("/detail")
+    public EhsdPurchaseVo detail(@RequestBody BaseSelectDto dto) {
+        return ehsdPurchaseService.detail(dto.getId());
+    }
+
+    /**
+     * ehsd采购表新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody EhsdPurchaseDto ehsdPurchaseDto) {
+        ehsdPurchaseService.add(ehsdPurchaseDto);
+    }
+
+    /**
+     * ehsd采购表编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody EhsdPurchaseDto ehsdPurchaseDto) {
+        ehsdPurchaseService.edit(ehsdPurchaseDto);
+    }
+
+    /**
+     * ehsd采购表删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        ehsdPurchaseService.delete(dto.getId());
+    }
+
+}

+ 68 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/controller/purchase/EhsdPurchaseProductController.java

@@ -0,0 +1,68 @@
+package com.fjhx.ehsd.controller.purchase;
+
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProductVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProductSelectDto;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProductDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.ehsd.service.purchase.EhsdPurchaseProductService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * <p>
+ * ehsd采购产品表 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@RestController
+@RequestMapping("/ehsdPurchaseProduct")
+public class EhsdPurchaseProductController {
+
+    @Autowired
+    private EhsdPurchaseProductService ehsdPurchaseProductService;
+
+    /**
+     * ehsd采购产品表分页
+     */
+    @PostMapping("/page")
+    public Page<EhsdPurchaseProductVo> page(@RequestBody EhsdPurchaseProductSelectDto dto) {
+        return ehsdPurchaseProductService.getPage(dto);
+    }
+
+    /**
+     * ehsd采购产品表明细
+     */
+    @PostMapping("/detail")
+    public EhsdPurchaseProductVo detail(@RequestBody BaseSelectDto dto) {
+        return ehsdPurchaseProductService.detail(dto.getId());
+    }
+
+    /**
+     * ehsd采购产品表新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody EhsdPurchaseProductDto ehsdPurchaseProductDto) {
+        ehsdPurchaseProductService.add(ehsdPurchaseProductDto);
+    }
+
+    /**
+     * ehsd采购产品表编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody EhsdPurchaseProductDto ehsdPurchaseProductDto) {
+        ehsdPurchaseProductService.edit(ehsdPurchaseProductDto);
+    }
+
+    /**
+     * ehsd采购产品表删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        ehsdPurchaseProductService.delete(dto.getId());
+    }
+
+}

+ 68 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/controller/purchase/EhsdPurchaseProductMountingsController.java

@@ -0,0 +1,68 @@
+package com.fjhx.ehsd.controller.purchase;
+
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProductMountingsVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProductMountingsSelectDto;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProductMountingsDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.ehsd.service.purchase.EhsdPurchaseProductMountingsService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * <p>
+ * ehsd采购产品配件表 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@RestController
+@RequestMapping("/ehsdPurchaseProductMountings")
+public class EhsdPurchaseProductMountingsController {
+
+    @Autowired
+    private EhsdPurchaseProductMountingsService ehsdPurchaseProductMountingsService;
+
+    /**
+     * ehsd采购产品配件表分页
+     */
+    @PostMapping("/page")
+    public Page<EhsdPurchaseProductMountingsVo> page(@RequestBody EhsdPurchaseProductMountingsSelectDto dto) {
+        return ehsdPurchaseProductMountingsService.getPage(dto);
+    }
+
+    /**
+     * ehsd采购产品配件表明细
+     */
+    @PostMapping("/detail")
+    public EhsdPurchaseProductMountingsVo detail(@RequestBody BaseSelectDto dto) {
+        return ehsdPurchaseProductMountingsService.detail(dto.getId());
+    }
+
+    /**
+     * ehsd采购产品配件表新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody EhsdPurchaseProductMountingsDto ehsdPurchaseProductMountingsDto) {
+        ehsdPurchaseProductMountingsService.add(ehsdPurchaseProductMountingsDto);
+    }
+
+    /**
+     * ehsd采购产品配件表编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody EhsdPurchaseProductMountingsDto ehsdPurchaseProductMountingsDto) {
+        ehsdPurchaseProductMountingsService.edit(ehsdPurchaseProductMountingsDto);
+    }
+
+    /**
+     * ehsd采购产品配件表删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        ehsdPurchaseProductMountingsService.delete(dto.getId());
+    }
+
+}

+ 68 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/controller/purchase/EhsdPurchaseProjectController.java

@@ -0,0 +1,68 @@
+package com.fjhx.ehsd.controller.purchase;
+
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProjectVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProjectSelectDto;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProjectDto;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import com.fjhx.ehsd.service.purchase.EhsdPurchaseProjectService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+
+/**
+ * <p>
+ * 采购合同-收费项目 前端控制器
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@RestController
+@RequestMapping("/ehsdPurchaseProject")
+public class EhsdPurchaseProjectController {
+
+    @Autowired
+    private EhsdPurchaseProjectService ehsdPurchaseProjectService;
+
+    /**
+     * 采购合同-收费项目分页
+     */
+    @PostMapping("/page")
+    public Page<EhsdPurchaseProjectVo> page(@RequestBody EhsdPurchaseProjectSelectDto dto) {
+        return ehsdPurchaseProjectService.getPage(dto);
+    }
+
+    /**
+     * 采购合同-收费项目明细
+     */
+    @PostMapping("/detail")
+    public EhsdPurchaseProjectVo detail(@RequestBody BaseSelectDto dto) {
+        return ehsdPurchaseProjectService.detail(dto.getId());
+    }
+
+    /**
+     * 采购合同-收费项目新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody EhsdPurchaseProjectDto ehsdPurchaseProjectDto) {
+        ehsdPurchaseProjectService.add(ehsdPurchaseProjectDto);
+    }
+
+    /**
+     * 采购合同-收费项目编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody EhsdPurchaseProjectDto ehsdPurchaseProjectDto) {
+        ehsdPurchaseProjectService.edit(ehsdPurchaseProjectDto);
+    }
+
+    /**
+     * 采购合同-收费项目删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        ehsdPurchaseProjectService.delete(dto.getId());
+    }
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseArrivalDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.dto;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseArrival;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购合同-到货计划新增编辑入参实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseArrivalDto extends EhsdPurchaseArrival {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseArrivalSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购合同-到货计划列表查询入参实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseArrivalSelectDto extends BaseSelectDto {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.dto;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchase;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * ehsd采购表新增编辑入参实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseDto extends EhsdPurchase {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseProductDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.dto;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProduct;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * ehsd采购产品表新增编辑入参实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseProductDto extends EhsdPurchaseProduct {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseProductMountingsDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.dto;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProductMountings;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * ehsd采购产品配件表新增编辑入参实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseProductMountingsDto extends EhsdPurchaseProductMountings {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseProductMountingsSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * ehsd采购产品配件表列表查询入参实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseProductMountingsSelectDto extends BaseSelectDto {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseProductSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * ehsd采购产品表列表查询入参实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseProductSelectDto extends BaseSelectDto {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseProjectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.dto;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProject;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购合同-收费项目新增编辑入参实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseProjectDto extends EhsdPurchaseProject {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseProjectSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购合同-收费项目列表查询入参实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseProjectSelectDto extends BaseSelectDto {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/dto/EhsdPurchaseSelectDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * ehsd采购表列表查询入参实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseSelectDto extends BaseSelectDto {
+
+}

+ 188 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/po/EhsdPurchase.java

@@ -0,0 +1,188 @@
+package com.fjhx.ehsd.entity.purchase.po;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * ehsd采购表
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+@TableName("ehsd_purchase")
+public class EhsdPurchase extends BasePo {
+
+    /**
+     * 编码
+     */
+    private String code;
+
+    /**
+     * 合同模版ID
+     */
+    private Long contractTemplateId;
+
+    /**
+     * 卖方公司ID
+     */
+    private Long sellCorporationId;
+
+    /**
+     * 卖方联系人名称
+     */
+    private String sellContactName;
+
+    /**
+     * 卖方联系人电话
+     */
+    private String sellContactNumber;
+
+    /**
+     * 卖方国家表id
+     */
+    private String sellCountryId;
+
+    /**
+     * 卖方省份id
+     */
+    private String sellProvinceId;
+
+    /**
+     * 卖方城市id
+     */
+    private String sellCityId;
+
+    /**
+     * 卖方详细地址
+     */
+    private String sellAddress;
+
+    /**
+     * 买方公司ID
+     */
+    private Long buyCorporationId;
+
+    /**
+     * 买方联系人名称
+     */
+    private String buyContactName;
+
+    /**
+     * 买方联系人电话
+     */
+    private String buyContactNumber;
+
+    /**
+     * 买方国家表id
+     */
+    private String buyCountryId;
+
+    /**
+     * 买方省份id
+     */
+    private String buyProvinceId;
+
+    /**
+     * 买方城市id
+     */
+    private String buyCityId;
+
+    /**
+     * 买方详细地址
+     */
+    private String buyAddress;
+
+    /**
+     * 买方邮编
+     */
+    private String buyPostalCode;
+
+    /**
+     * 审批状态 0草稿 10、审批中;20、驳回  30、审批通过 88:作废   99终止
+     */
+    private Integer status;
+
+    /**
+     * 采购总金额
+     */
+    private BigDecimal amount;
+
+    /**
+     * 条款内容
+     */
+    private String remark;
+
+    /**
+     * 币种(字典account_currency)
+     */
+    private String currency;
+
+    /**
+     * 交期
+     */
+    private String deliveryTime;
+
+    /**
+     * 交货类型字典(delivery_type)
+     */
+    private String deliveryType;
+
+    /**
+     * 发票类型
+     */
+    private String invoiceType;
+
+    /**
+     * 付款方式(字典funds_payment_method
+     */
+    private String paymentMethod;
+
+    /**
+     * 质保期
+     */
+    private Integer warranty;
+
+    /**
+     * 流程KEY
+     */
+    private String processInstanceId;
+
+    /**
+     * 审核通过时间
+     */
+    private Date approvedDate;
+
+    /**
+     * 创建人名称
+     */
+    private String userName;
+
+    /**
+     * 采购到货列表
+     */
+    @TableField(exist = false)
+    private List<EhsdPurchaseArrival> purchaseArrivalList;
+
+    /**
+     * 采购商品列表
+     */
+    @TableField(exist = false)
+    private List<EhsdPurchaseProduct> purchaseProductList;
+
+    /**
+     * 采购商品列表
+     */
+    @TableField(exist = false)
+    private List<EhsdPurchaseProject> purchaseProjectList;
+}

+ 48 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/po/EhsdPurchaseArrival.java

@@ -0,0 +1,48 @@
+package com.fjhx.ehsd.entity.purchase.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.math.BigDecimal;
+import java.util.Date;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 采购合同-到货计划
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+@TableName("ehsd_purchase_arrival")
+public class EhsdPurchaseArrival extends BasePo {
+
+    /**
+     * 采购合同ID
+     */
+    private Long purchaseId;
+
+    /**
+     * 商品ID
+     */
+    private Long productId;
+
+    /**
+     * 到货日期
+     */
+    private Date arrivalTime;
+
+    /**
+     * 到货数量
+     */
+    private BigDecimal quantity;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 92 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/po/EhsdPurchaseProduct.java

@@ -0,0 +1,92 @@
+package com.fjhx.ehsd.entity.purchase.po;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fjhx.file.entity.ObsFile;
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.math.BigDecimal;
+import java.util.List;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * ehsd采购产品表
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+@TableName("ehsd_purchase_product")
+public class EhsdPurchaseProduct extends BasePo {
+
+    /**
+     * 采购单ID
+     */
+    private Long purchaseId;
+
+    /**
+     * 商品ID
+     */
+    private Long productId;
+
+    /**
+     * 商品名称
+     */
+    private String productName;
+
+    /**
+     * 商品型号
+     */
+    private String productModel;
+
+    /**
+     * 商品数量
+     */
+    private BigDecimal quantity;
+
+    /**
+     * 商品单价
+     */
+    private BigDecimal price;
+
+    /**
+     * 商品金额
+     */
+    private BigDecimal amount;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 尔弘时代扩展JSON
+     */
+    private String json;
+
+    /**
+     * 业务来源 0自建  1外销合同采购
+     */
+    private Integer dataResource;
+
+    /**
+     * 业务来源ID
+     */
+    private Long dataResourceId;
+
+    /**
+     * 产品配件列表
+     */
+    @TableField(exist = false)
+    private List<EhsdPurchaseProductMountings> purchaseProductMountingsList;
+
+    /**
+     * 附件列表
+     */
+    @TableField(exist = false)
+    private List<ObsFile> fileList;
+}

+ 68 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/po/EhsdPurchaseProductMountings.java

@@ -0,0 +1,68 @@
+package com.fjhx.ehsd.entity.purchase.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.math.BigDecimal;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * ehsd采购产品配件表
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+@TableName("ehsd_purchase_product_mountings")
+public class EhsdPurchaseProductMountings extends BasePo {
+
+    /**
+     * 采购单ID
+     */
+    private Long purchaseProductId;
+
+    /**
+     * 商品ID
+     */
+    private Long productId;
+
+    /**
+     * 商品名称
+     */
+    private String productName;
+
+    /**
+     * 商品型号
+     */
+    private String productModel;
+
+    /**
+     * 商品数量
+     */
+    private BigDecimal quantity;
+
+    /**
+     * 商品单价
+     */
+    private BigDecimal price;
+
+    /**
+     * 商品金额
+     */
+    private BigDecimal amount;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 尔弘时代扩展JSON
+     */
+    private String json;
+
+}

+ 44 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/po/EhsdPurchaseProject.java

@@ -0,0 +1,44 @@
+package com.fjhx.ehsd.entity.purchase.po;
+
+import com.ruoyi.common.core.domain.BasePo;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.math.BigDecimal;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 采购合同-收费项目
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+@TableName("ehsd_purchase_project")
+public class EhsdPurchaseProject extends BasePo {
+
+    /**
+     * 采购单ID
+     */
+    private Long purchaseId;
+
+    /**
+     * 收费项目
+
+     */
+    private String payName;
+
+    /**
+     * 金额
+     */
+    private BigDecimal amount;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/vo/EhsdPurchaseArrivalVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.vo;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseArrival;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购合同-到货计划列表查询返回值实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseArrivalVo extends EhsdPurchaseArrival {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/vo/EhsdPurchaseProductMountingsVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.vo;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProductMountings;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * ehsd采购产品配件表列表查询返回值实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseProductMountingsVo extends EhsdPurchaseProductMountings {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/vo/EhsdPurchaseProductVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.vo;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProduct;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * ehsd采购产品表列表查询返回值实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseProductVo extends EhsdPurchaseProduct {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/vo/EhsdPurchaseProjectVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.vo;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProject;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 采购合同-收费项目列表查询返回值实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseProjectVo extends EhsdPurchaseProject {
+
+}

+ 17 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/entity/purchase/vo/EhsdPurchaseVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.ehsd.entity.purchase.vo;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchase;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * ehsd采购表列表查询返回值实体
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Getter
+@Setter
+public class EhsdPurchaseVo extends EhsdPurchase {
+
+}

+ 134 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/flow/EhsdPurchaseFlow.java

@@ -0,0 +1,134 @@
+package com.fjhx.ehsd.flow;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fjhx.common.constant.SourceConstant;
+import com.fjhx.ehsd.entity.purchase.po.*;
+import com.fjhx.ehsd.service.purchase.*;
+import com.fjhx.file.utils.ObsFileUtil;
+import com.fjhx.flow.core.FlowDelegate;
+import com.fjhx.purchase.entity.purchase.enums.PurchaseDataResourceEnum;
+import com.fjhx.purchase.entity.purchase.enums.PurchaseDetailStatusEnum;
+import com.fjhx.purchase.entity.purchase.enums.PurchaseStatusEnum;
+import com.fjhx.purchase.entity.purchase.po.Purchase;
+import com.fjhx.purchase.entity.purchase.po.PurchaseDetail;
+import com.fjhx.purchase.service.purchase.PurchaseDetailService;
+import com.fjhx.purchase.service.purchase.PurchaseService;
+import com.fjhx.purchase.util.code.CodeEnum;
+import com.fjhx.sale.entity.contract.po.ContractProduct;
+import com.fjhx.sale.entity.sample.po.SampleProduct;
+import com.fjhx.sale.service.contract.ContractProductService;
+import com.fjhx.sale.service.sample.SampleProductService;
+import com.obs.services.internal.ServiceException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * EHSD采购流程
+ *
+ * @Author:caozj
+ * @DATE:2023/4/3 17:38
+ */
+@Component
+public class EhsdPurchaseFlow extends FlowDelegate {
+
+    @Autowired
+    private EhsdPurchaseService purchaseService;
+
+    @Autowired
+    private SampleProductService sampleProductService;
+
+    @Autowired
+    private EhsdPurchaseProductService purchaseProductService;
+
+    @Autowired
+    private EhsdPurchaseProjectService purchaseProjectService;
+
+    @Autowired
+    private EhsdPurchaseArrivalService purchaseArrivalService;
+
+    @Autowired
+    private ContractProductService contractProductService;
+
+    @Autowired
+    private EhsdPurchaseProductMountingsService purchaseProductMountingsService;
+
+
+    @Override
+    public String getFlowKey() {
+        return "ehsd_purchase_flow";
+    }
+
+    /**
+     * 发起流程
+     * @param flowId 流程ID
+     * @param submitData 采购数据
+     * @return
+     */
+    @Override
+    public Long start(Long flowId, JSONObject submitData) {
+        EhsdPurchase purchase = submitData.toJavaObject(EhsdPurchase.class);
+        purchase.setCode(CodeEnum.PURCHASE.getCode());
+        purchase.setStatus(PurchaseStatusEnum.UNDER_REVIEW.getKey());
+        purchaseService.save(purchase);
+        List<EhsdPurchaseProduct> purchaseProductList = purchase.getPurchaseProductList();
+        List<EhsdPurchaseProject> purchaseProjectList = purchase.getPurchaseProjectList();
+        List<EhsdPurchaseArrival> purchaseArrivalList = purchase.getPurchaseArrivalList();
+        List<EhsdPurchaseProductMountings> addMountingsList = new ArrayList<>();
+        if(CollectionUtils.isNotEmpty(purchaseProductList)){
+            for(EhsdPurchaseProduct s : purchaseProductList){//产品
+                s.setPurchaseId(purchase.getId());
+                List<EhsdPurchaseProductMountings> purchaseProductMountingsList = s.getPurchaseProductMountingsList();
+                if(CollectionUtils.isNotEmpty(purchaseProductMountingsList)){//产品配件
+                    purchaseProductMountingsList.forEach(obj -> obj.setId(s.getId()));
+                    addMountingsList.addAll(purchaseProductMountingsList);
+                }
+                ObsFileUtil.saveFile(s.getFileList(),s.getId());
+            }
+            purchaseProductService.saveBatch(purchaseProductList);
+            purchaseProductMountingsService.saveBatch(addMountingsList);
+        }
+        if(CollectionUtils.isNotEmpty(purchaseProjectList)){//到货
+            for(EhsdPurchaseProject s : purchaseProjectList){
+                s.setPurchaseId(purchase.getId());
+            }
+            purchaseProjectService.saveBatch(purchaseProjectList);
+        }
+        if(CollectionUtils.isNotEmpty(purchaseArrivalList)){//收费项目
+            for(EhsdPurchaseArrival s : purchaseArrivalList){
+                s.setPurchaseId(purchase.getId());
+            }
+            purchaseArrivalService.saveBatch(purchaseArrivalList);
+        }
+        return purchase.getId();
+    }
+
+    /**
+     * 结束流程
+     * @param flowId 流程ID
+     * @param businessId 业务ID
+     * @param submitData 数据
+     */
+    @Override
+    public void end(Long flowId, Long businessId, JSONObject submitData) {
+        //通过业务ID查询采购数据
+        EhsdPurchase purchase = purchaseService.getById(businessId);
+        if(ObjectUtils.isEmpty(purchase)){
+            throw new ServiceException("采购单不存在,或已被删除");
+        }
+        //修改采购状态为审批通过
+        purchase.setStatus(PurchaseStatusEnum.PASS.getKey());
+        purchase.setApprovedDate(new Date());
+        purchaseService.updateById(purchase);
+    }
+
+}

+ 26 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/mapper/purchase/EhsdPurchaseArrivalMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.ehsd.mapper.purchase;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseArrival;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseArrivalVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 采购合同-到货计划 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+public interface EhsdPurchaseArrivalMapper extends BaseMapper<EhsdPurchaseArrival> {
+
+    /**
+     * 采购合同-到货计划分页
+     */
+    Page<EhsdPurchaseArrivalVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<EhsdPurchaseArrival> wrapper);
+
+}

+ 26 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/mapper/purchase/EhsdPurchaseMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.ehsd.mapper.purchase;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchase;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * ehsd采购表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+public interface EhsdPurchaseMapper extends BaseMapper<EhsdPurchase> {
+
+    /**
+     * ehsd采购表分页
+     */
+    Page<EhsdPurchaseVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<EhsdPurchase> wrapper);
+
+}

+ 26 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/mapper/purchase/EhsdPurchaseProductMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.ehsd.mapper.purchase;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProduct;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProductVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * ehsd采购产品表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+public interface EhsdPurchaseProductMapper extends BaseMapper<EhsdPurchaseProduct> {
+
+    /**
+     * ehsd采购产品表分页
+     */
+    Page<EhsdPurchaseProductVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<EhsdPurchaseProduct> wrapper);
+
+}

+ 26 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/mapper/purchase/EhsdPurchaseProductMountingsMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.ehsd.mapper.purchase;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProductMountings;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProductMountingsVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * ehsd采购产品配件表 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+public interface EhsdPurchaseProductMountingsMapper extends BaseMapper<EhsdPurchaseProductMountings> {
+
+    /**
+     * ehsd采购产品配件表分页
+     */
+    Page<EhsdPurchaseProductMountingsVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<EhsdPurchaseProductMountings> wrapper);
+
+}

+ 26 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/mapper/purchase/EhsdPurchaseProjectMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.ehsd.mapper.purchase;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProject;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProjectVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 采购合同-收费项目 Mapper 接口
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+public interface EhsdPurchaseProjectMapper extends BaseMapper<EhsdPurchaseProject> {
+
+    /**
+     * 采购合同-收费项目分页
+     */
+    Page<EhsdPurchaseProjectVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<EhsdPurchaseProject> wrapper);
+
+}

+ 46 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/EhsdPurchaseArrivalService.java

@@ -0,0 +1,46 @@
+package com.fjhx.ehsd.service.purchase;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseArrival;
+import com.ruoyi.common.core.service.BaseService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseArrivalVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseArrivalSelectDto;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseArrivalDto;
+
+
+/**
+ * <p>
+ * 采购合同-到货计划 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+public interface EhsdPurchaseArrivalService extends BaseService<EhsdPurchaseArrival> {
+
+    /**
+     * 采购合同-到货计划分页
+     */
+    Page<EhsdPurchaseArrivalVo> getPage(EhsdPurchaseArrivalSelectDto dto);
+
+    /**
+     * 采购合同-到货计划明细
+     */
+    EhsdPurchaseArrivalVo detail(Long id);
+
+    /**
+     * 采购合同-到货计划新增
+     */
+    void add(EhsdPurchaseArrivalDto ehsdPurchaseArrivalDto);
+
+    /**
+     * 采购合同-到货计划编辑
+     */
+    void edit(EhsdPurchaseArrivalDto ehsdPurchaseArrivalDto);
+
+    /**
+     * 采购合同-到货计划删除
+     */
+    void delete(Long id);
+
+}

+ 46 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/EhsdPurchaseProductMountingsService.java

@@ -0,0 +1,46 @@
+package com.fjhx.ehsd.service.purchase;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProductMountings;
+import com.ruoyi.common.core.service.BaseService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProductMountingsVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProductMountingsSelectDto;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProductMountingsDto;
+
+
+/**
+ * <p>
+ * ehsd采购产品配件表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+public interface EhsdPurchaseProductMountingsService extends BaseService<EhsdPurchaseProductMountings> {
+
+    /**
+     * ehsd采购产品配件表分页
+     */
+    Page<EhsdPurchaseProductMountingsVo> getPage(EhsdPurchaseProductMountingsSelectDto dto);
+
+    /**
+     * ehsd采购产品配件表明细
+     */
+    EhsdPurchaseProductMountingsVo detail(Long id);
+
+    /**
+     * ehsd采购产品配件表新增
+     */
+    void add(EhsdPurchaseProductMountingsDto ehsdPurchaseProductMountingsDto);
+
+    /**
+     * ehsd采购产品配件表编辑
+     */
+    void edit(EhsdPurchaseProductMountingsDto ehsdPurchaseProductMountingsDto);
+
+    /**
+     * ehsd采购产品配件表删除
+     */
+    void delete(Long id);
+
+}

+ 46 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/EhsdPurchaseProductService.java

@@ -0,0 +1,46 @@
+package com.fjhx.ehsd.service.purchase;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProduct;
+import com.ruoyi.common.core.service.BaseService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProductVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProductSelectDto;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProductDto;
+
+
+/**
+ * <p>
+ * ehsd采购产品表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+public interface EhsdPurchaseProductService extends BaseService<EhsdPurchaseProduct> {
+
+    /**
+     * ehsd采购产品表分页
+     */
+    Page<EhsdPurchaseProductVo> getPage(EhsdPurchaseProductSelectDto dto);
+
+    /**
+     * ehsd采购产品表明细
+     */
+    EhsdPurchaseProductVo detail(Long id);
+
+    /**
+     * ehsd采购产品表新增
+     */
+    void add(EhsdPurchaseProductDto ehsdPurchaseProductDto);
+
+    /**
+     * ehsd采购产品表编辑
+     */
+    void edit(EhsdPurchaseProductDto ehsdPurchaseProductDto);
+
+    /**
+     * ehsd采购产品表删除
+     */
+    void delete(Long id);
+
+}

+ 46 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/EhsdPurchaseProjectService.java

@@ -0,0 +1,46 @@
+package com.fjhx.ehsd.service.purchase;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProject;
+import com.ruoyi.common.core.service.BaseService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProjectVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProjectSelectDto;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProjectDto;
+
+
+/**
+ * <p>
+ * 采购合同-收费项目 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+public interface EhsdPurchaseProjectService extends BaseService<EhsdPurchaseProject> {
+
+    /**
+     * 采购合同-收费项目分页
+     */
+    Page<EhsdPurchaseProjectVo> getPage(EhsdPurchaseProjectSelectDto dto);
+
+    /**
+     * 采购合同-收费项目明细
+     */
+    EhsdPurchaseProjectVo detail(Long id);
+
+    /**
+     * 采购合同-收费项目新增
+     */
+    void add(EhsdPurchaseProjectDto ehsdPurchaseProjectDto);
+
+    /**
+     * 采购合同-收费项目编辑
+     */
+    void edit(EhsdPurchaseProjectDto ehsdPurchaseProjectDto);
+
+    /**
+     * 采购合同-收费项目删除
+     */
+    void delete(Long id);
+
+}

+ 46 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/EhsdPurchaseService.java

@@ -0,0 +1,46 @@
+package com.fjhx.ehsd.service.purchase;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchase;
+import com.ruoyi.common.core.service.BaseService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseSelectDto;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseDto;
+
+
+/**
+ * <p>
+ * ehsd采购表 服务类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+public interface EhsdPurchaseService extends BaseService<EhsdPurchase> {
+
+    /**
+     * ehsd采购表分页
+     */
+    Page<EhsdPurchaseVo> getPage(EhsdPurchaseSelectDto dto);
+
+    /**
+     * ehsd采购表明细
+     */
+    EhsdPurchaseVo detail(Long id);
+
+    /**
+     * ehsd采购表新增
+     */
+    void add(EhsdPurchaseDto ehsdPurchaseDto);
+
+    /**
+     * ehsd采购表编辑
+     */
+    void edit(EhsdPurchaseDto ehsdPurchaseDto);
+
+    /**
+     * ehsd采购表删除
+     */
+    void delete(Long id);
+
+}

+ 57 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/impl/EhsdPurchaseArrivalServiceImpl.java

@@ -0,0 +1,57 @@
+package com.fjhx.ehsd.service.purchase.impl;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseArrival;
+import com.fjhx.ehsd.mapper.purchase.EhsdPurchaseArrivalMapper;
+import com.fjhx.ehsd.service.purchase.EhsdPurchaseArrivalService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseArrivalVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseArrivalSelectDto;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseArrivalDto;
+import cn.hutool.core.bean.BeanUtil;
+
+
+/**
+ * <p>
+ * 采购合同-到货计划 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Service
+public class EhsdPurchaseArrivalServiceImpl extends ServiceImpl<EhsdPurchaseArrivalMapper, EhsdPurchaseArrival> implements EhsdPurchaseArrivalService {
+
+    @Override
+    public Page<EhsdPurchaseArrivalVo> getPage(EhsdPurchaseArrivalSelectDto dto) {
+        IWrapper<EhsdPurchaseArrival> wrapper = getWrapper();
+        wrapper.orderByDesc("epa", EhsdPurchaseArrival::getId);
+        Page<EhsdPurchaseArrivalVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public EhsdPurchaseArrivalVo detail(Long id) {
+        EhsdPurchaseArrival EhsdPurchaseArrival = this.getById(id);
+        EhsdPurchaseArrivalVo result = BeanUtil.toBean(EhsdPurchaseArrival, EhsdPurchaseArrivalVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(EhsdPurchaseArrivalDto ehsdPurchaseArrivalDto) {
+        this.save(ehsdPurchaseArrivalDto);
+    }
+
+    @Override
+    public void edit(EhsdPurchaseArrivalDto ehsdPurchaseArrivalDto) {
+        this.updateById(ehsdPurchaseArrivalDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 57 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/impl/EhsdPurchaseProductMountingsServiceImpl.java

@@ -0,0 +1,57 @@
+package com.fjhx.ehsd.service.purchase.impl;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProductMountings;
+import com.fjhx.ehsd.mapper.purchase.EhsdPurchaseProductMountingsMapper;
+import com.fjhx.ehsd.service.purchase.EhsdPurchaseProductMountingsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProductMountingsVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProductMountingsSelectDto;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProductMountingsDto;
+import cn.hutool.core.bean.BeanUtil;
+
+
+/**
+ * <p>
+ * ehsd采购产品配件表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Service
+public class EhsdPurchaseProductMountingsServiceImpl extends ServiceImpl<EhsdPurchaseProductMountingsMapper, EhsdPurchaseProductMountings> implements EhsdPurchaseProductMountingsService {
+
+    @Override
+    public Page<EhsdPurchaseProductMountingsVo> getPage(EhsdPurchaseProductMountingsSelectDto dto) {
+        IWrapper<EhsdPurchaseProductMountings> wrapper = getWrapper();
+        wrapper.orderByDesc("eppm", EhsdPurchaseProductMountings::getId);
+        Page<EhsdPurchaseProductMountingsVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public EhsdPurchaseProductMountingsVo detail(Long id) {
+        EhsdPurchaseProductMountings EhsdPurchaseProductMountings = this.getById(id);
+        EhsdPurchaseProductMountingsVo result = BeanUtil.toBean(EhsdPurchaseProductMountings, EhsdPurchaseProductMountingsVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(EhsdPurchaseProductMountingsDto ehsdPurchaseProductMountingsDto) {
+        this.save(ehsdPurchaseProductMountingsDto);
+    }
+
+    @Override
+    public void edit(EhsdPurchaseProductMountingsDto ehsdPurchaseProductMountingsDto) {
+        this.updateById(ehsdPurchaseProductMountingsDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 57 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/impl/EhsdPurchaseProductServiceImpl.java

@@ -0,0 +1,57 @@
+package com.fjhx.ehsd.service.purchase.impl;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProduct;
+import com.fjhx.ehsd.mapper.purchase.EhsdPurchaseProductMapper;
+import com.fjhx.ehsd.service.purchase.EhsdPurchaseProductService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProductVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProductSelectDto;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProductDto;
+import cn.hutool.core.bean.BeanUtil;
+
+
+/**
+ * <p>
+ * ehsd采购产品表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Service
+public class EhsdPurchaseProductServiceImpl extends ServiceImpl<EhsdPurchaseProductMapper, EhsdPurchaseProduct> implements EhsdPurchaseProductService {
+
+    @Override
+    public Page<EhsdPurchaseProductVo> getPage(EhsdPurchaseProductSelectDto dto) {
+        IWrapper<EhsdPurchaseProduct> wrapper = getWrapper();
+        wrapper.orderByDesc("epp", EhsdPurchaseProduct::getId);
+        Page<EhsdPurchaseProductVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public EhsdPurchaseProductVo detail(Long id) {
+        EhsdPurchaseProduct EhsdPurchaseProduct = this.getById(id);
+        EhsdPurchaseProductVo result = BeanUtil.toBean(EhsdPurchaseProduct, EhsdPurchaseProductVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(EhsdPurchaseProductDto ehsdPurchaseProductDto) {
+        this.save(ehsdPurchaseProductDto);
+    }
+
+    @Override
+    public void edit(EhsdPurchaseProductDto ehsdPurchaseProductDto) {
+        this.updateById(ehsdPurchaseProductDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 57 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/impl/EhsdPurchaseProjectServiceImpl.java

@@ -0,0 +1,57 @@
+package com.fjhx.ehsd.service.purchase.impl;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchaseProject;
+import com.fjhx.ehsd.mapper.purchase.EhsdPurchaseProjectMapper;
+import com.fjhx.ehsd.service.purchase.EhsdPurchaseProjectService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProjectVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProjectSelectDto;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseProjectDto;
+import cn.hutool.core.bean.BeanUtil;
+
+
+/**
+ * <p>
+ * 采购合同-收费项目 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Service
+public class EhsdPurchaseProjectServiceImpl extends ServiceImpl<EhsdPurchaseProjectMapper, EhsdPurchaseProject> implements EhsdPurchaseProjectService {
+
+    @Override
+    public Page<EhsdPurchaseProjectVo> getPage(EhsdPurchaseProjectSelectDto dto) {
+        IWrapper<EhsdPurchaseProject> wrapper = getWrapper();
+        wrapper.orderByDesc("epp", EhsdPurchaseProject::getId);
+        Page<EhsdPurchaseProjectVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public EhsdPurchaseProjectVo detail(Long id) {
+        EhsdPurchaseProject EhsdPurchaseProject = this.getById(id);
+        EhsdPurchaseProjectVo result = BeanUtil.toBean(EhsdPurchaseProject, EhsdPurchaseProjectVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(EhsdPurchaseProjectDto ehsdPurchaseProjectDto) {
+        this.save(ehsdPurchaseProjectDto);
+    }
+
+    @Override
+    public void edit(EhsdPurchaseProjectDto ehsdPurchaseProjectDto) {
+        this.updateById(ehsdPurchaseProjectDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 57 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/service/purchase/impl/EhsdPurchaseServiceImpl.java

@@ -0,0 +1,57 @@
+package com.fjhx.ehsd.service.purchase.impl;
+
+import com.fjhx.ehsd.entity.purchase.po.EhsdPurchase;
+import com.fjhx.ehsd.mapper.purchase.EhsdPurchaseMapper;
+import com.fjhx.ehsd.service.purchase.EhsdPurchaseService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseVo;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseSelectDto;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.fjhx.ehsd.entity.purchase.dto.EhsdPurchaseDto;
+import cn.hutool.core.bean.BeanUtil;
+
+
+/**
+ * <p>
+ * ehsd采购表 服务实现类
+ * </p>
+ *
+ * @author 
+ * @since 2023-05-17
+ */
+@Service
+public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, EhsdPurchase> implements EhsdPurchaseService {
+
+    @Override
+    public Page<EhsdPurchaseVo> getPage(EhsdPurchaseSelectDto dto) {
+        IWrapper<EhsdPurchase> wrapper = getWrapper();
+        wrapper.orderByDesc("ep", EhsdPurchase::getId);
+        Page<EhsdPurchaseVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        return page;
+    }
+
+    @Override
+    public EhsdPurchaseVo detail(Long id) {
+        EhsdPurchase EhsdPurchase = this.getById(id);
+        EhsdPurchaseVo result = BeanUtil.toBean(EhsdPurchase, EhsdPurchaseVo.class);
+        return result;
+    }
+
+    @Override
+    public void add(EhsdPurchaseDto ehsdPurchaseDto) {
+        this.save(ehsdPurchaseDto);
+    }
+
+    @Override
+    public void edit(EhsdPurchaseDto ehsdPurchaseDto) {
+        this.updateById(ehsdPurchaseDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 103 - 0
hx-ehsd/src/main/java/com/fjhx/ehsd/util/CodeEnum.java

@@ -0,0 +1,103 @@
+package com.fjhx.ehsd.util;
+
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.text.CharSequenceUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.extra.spring.SpringUtil;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fjhx.ehsd.service.purchase.EhsdPurchaseService;
+import com.fjhx.purchase.service.arrival.ArrivalService;
+import com.fjhx.purchase.service.purchase.PurchaseService;
+import com.fjhx.purchase.service.quality.QualityService;
+import com.fjhx.purchase.service.sales.SalesReturnService;
+import com.fjhx.purchase.service.subscribe.SubscribeService;
+import com.obs.services.internal.ServiceException;
+import lombok.Getter;
+
+import java.util.Date;
+import java.util.Map;
+
+@Getter
+public enum CodeEnum {
+
+    //采购
+    PURCHASE("PO", "yyMM-", "code", 3, EhsdPurchaseService.class),
+    ;
+
+    CodeEnum(String prefix, String dateFormat, String codeFieldName, Integer length, Class<? extends IService<?>> serviceCls) {
+        this.prefix = prefix;
+        this.dateFormat = dateFormat;
+        this.length = length;
+        this.codeFieldName = codeFieldName;
+        this.service = SpringUtil.getBean(serviceCls);
+    }
+
+    // 编码前缀
+    private final String prefix;
+    // 编码加日期规则
+    private final String dateFormat;
+    // 长度
+    private final Integer length;
+    // 编码字段名
+    private final String codeFieldName;
+    // service
+    private final IService<?> service;
+
+    /**
+     * 获取键值对
+     */
+    public String getCode() {
+        String itemPrefix;
+
+        if (ObjectUtil.isNotEmpty(dateFormat)) {
+            Date date = new Date();
+            String format = DateUtil.format(date, dateFormat);
+            itemPrefix = prefix + format;
+        } else {
+            itemPrefix = prefix;
+        }
+
+        Object obj = service.query()
+                .likeRight(codeFieldName, itemPrefix)
+                .orderByDesc(codeFieldName)
+                .last("limit 1")
+                .one();
+
+        if (obj == null) {
+            return itemPrefix + autoGenericCode(length, 0);
+        }
+
+        Map<String, Object> map = Convert.toMap(String.class, Object.class, obj);
+
+        String code = Convert.toStr(map.get(CharSequenceUtil.toCamelCase(codeFieldName)));
+        Integer codeNum = Convert.toInt(code.substring(itemPrefix.length()));
+        if (ObjectUtil.isEmpty(codeNum)) {
+            throw new ServiceException("自定义编码与系统编码生成规则冲突,暂时无法生成编码,请联系管理员");
+        }
+
+        return itemPrefix + autoGenericCode(length, codeNum);
+    }
+
+    /**
+     * 获取键值对
+     */
+    public String getCode(String code) {
+        if (ObjectUtil.isNotEmpty(code)) {
+            Long count = service.query().eq(codeFieldName, code).count();
+            if (count != 0) {
+                throw new ServiceException("编码已存在");
+            }
+            return code;
+        } else {
+            return getCode();
+        }
+    }
+    /**
+     * 不够位数的在前面补0,保留num的长度位数字
+     */
+    private static String autoGenericCode(int length, Integer codeNum) {
+        return String.format("%0" + length + "d", codeNum + 1);
+    }
+
+}

+ 20 - 0
hx-ehsd/src/main/resources/mapper/purchase/EhsdPurchaseArrivalMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.ehsd.mapper.purchase.EhsdPurchaseArrivalMapper">
+    <select id="getPage" resultType="com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseArrivalVo">
+        select
+            epa.id,
+            epa.purchase_id,
+            epa.product_id,
+            epa.arrival_time,
+            epa.quantity,
+            epa.remark,
+            epa.create_user,
+            epa.create_time,
+            epa.update_user,
+            epa.update_time
+        from ehsd_purchase_arrival epa
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 46 - 0
hx-ehsd/src/main/resources/mapper/purchase/EhsdPurchaseMapper.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.ehsd.mapper.purchase.EhsdPurchaseMapper">
+    <select id="getPage" resultType="com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseVo">
+        select
+            ep.id,
+            ep.code,
+            ep.business_id,
+            ep.business_type,
+            ep.contract_template_id,
+            ep.sell_corporation_id,
+            ep.sell_contact_name,
+            ep.sell_contact_number,
+            ep.sell_country_id,
+            ep.sell_province_id,
+            ep.sell_city_id,
+            ep.sell_address,
+            ep.buy_corporation_id,
+            ep.buy_contact_name,
+            ep.buy_contact_number,
+            ep.buy_country_id,
+            ep.buy_province_id,
+            ep.buy_city_id,
+            ep.buy_address,
+            ep.buy_postal_code,
+            ep.status,
+            ep.amount,
+            ep.remark,
+            ep.currency,
+            ep.delivery_time,
+            ep.delivery_type,
+            ep.invoice_type,
+            ep.payment_method,
+            ep.warranty,
+            ep.process_instance_id,
+            ep.approved_date,
+            ep.create_user,
+            ep.user_name,
+            ep.create_time,
+            ep.update_user,
+            ep.update_time
+        from ehsd_purchase ep
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 24 - 0
hx-ehsd/src/main/resources/mapper/purchase/EhsdPurchaseProductMapper.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.ehsd.mapper.purchase.EhsdPurchaseProductMapper">
+    <select id="getPage" resultType="com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProductVo">
+        select
+            epp.id,
+            epp.purchase_id,
+            epp.product_id,
+            epp.product_name,
+            epp.product_model,
+            epp.quantity,
+            epp.price,
+            epp.amount,
+            epp.remark,
+            epp.json,
+            epp.create_user,
+            epp.create_time,
+            epp.update_user,
+            epp.update_time
+        from ehsd_purchase_product epp
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 24 - 0
hx-ehsd/src/main/resources/mapper/purchase/EhsdPurchaseProductMountingsMapper.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.ehsd.mapper.purchase.EhsdPurchaseProductMountingsMapper">
+    <select id="getPage" resultType="com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProductMountingsVo">
+        select
+            eppm.id,
+            eppm.purchase_product_id,
+            eppm.product_id,
+            eppm.product_name,
+            eppm.product_model,
+            eppm.quantity,
+            eppm.price,
+            eppm.amount,
+            eppm.remark,
+            eppm.json,
+            eppm.create_user,
+            eppm.create_time,
+            eppm.update_user,
+            eppm.update_time
+        from ehsd_purchase_product_mountings eppm
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 19 - 0
hx-ehsd/src/main/resources/mapper/purchase/EhsdPurchaseProjectMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.ehsd.mapper.purchase.EhsdPurchaseProjectMapper">
+    <select id="getPage" resultType="com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseProjectVo">
+        select
+            epp.id,
+            epp.purchase_id,
+            epp.pay_name,
+            epp.amount,
+            epp.remark,
+            epp.create_user,
+            epp.create_time,
+            epp.update_user,
+            epp.update_time
+        from ehsd_purchase_project epp
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>

+ 7 - 0
hx-jxst/src/main/java/com/fjhx/jxst/entity/sales/po/SalesContract.java

@@ -2,6 +2,8 @@ package com.fjhx.jxst.entity.sales.po;
 
 import com.ruoyi.common.core.domain.BasePo;
 import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.math.BigDecimal;
 import java.util.Date;
 import lombok.Getter;
 import lombok.Setter;
@@ -54,4 +56,9 @@ public class SalesContract extends BasePo {
      */
     private String flowKey;
 
+    /**
+     * 合同金额
+     */
+    private BigDecimal contractAmount;
+
 }

+ 0 - 5
hx-jxst/src/main/java/com/fjhx/jxst/entity/sales/vo/SalesContractVo.java

@@ -21,9 +21,4 @@ public class SalesContractVo extends SalesContract {
      */
     private String customerName;
 
-    /**
-     * 合同金额
-     */
-    private BigDecimal contractAmount;
-
 }

+ 27 - 9
hx-jxst/src/main/java/com/fjhx/jxst/service/sales/impl/SalesContractServiceImpl.java

@@ -1,23 +1,27 @@
 package com.fjhx.jxst.service.sales.impl;
 
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.customer.entity.customer.po.Customer;
 import com.fjhx.customer.service.customer.CustomerService;
+import com.fjhx.jxst.entity.sales.dto.SalesContractDto;
+import com.fjhx.jxst.entity.sales.dto.SalesContractSelectDto;
 import com.fjhx.jxst.entity.sales.po.SalesContract;
 import com.fjhx.jxst.entity.sales.po.SalesContractDetails;
+import com.fjhx.jxst.entity.sales.vo.SalesContractVo;
 import com.fjhx.jxst.mapper.sales.SalesContractMapper;
 import com.fjhx.jxst.service.sales.SalesContractDetailsService;
 import com.fjhx.jxst.service.sales.SalesContractService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.fjhx.jxst.entity.sales.vo.SalesContractVo;
-import com.fjhx.jxst.entity.sales.dto.SalesContractSelectDto;
-import com.ruoyi.common.utils.wrapper.IWrapper;
-import com.fjhx.jxst.entity.sales.dto.SalesContractDto;
-import cn.hutool.core.bean.BeanUtil;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
 import java.util.List;
+import java.util.stream.Collectors;
 
 
 /**
@@ -25,7 +29,7 @@ import java.util.List;
  * 销售合同 服务实现类
  * </p>
  *
- * @author 
+ * @author
  * @since 2023-05-16
  */
 @Service
@@ -39,6 +43,15 @@ public class SalesContractServiceImpl extends ServiceImpl<SalesContractMapper, S
     @Override
     public Page<SalesContractVo> getPage(SalesContractSelectDto dto) {
         IWrapper<SalesContract> wrapper = getWrapper();
+        if (ObjectUtil.isNotEmpty(dto.getKeyword())) {
+            List<Customer> list = customerService.list(q -> q.like(Customer::getName, dto.getKeyword()));
+            if (ObjectUtil.isNotEmpty(list)) {
+                List<Long> ids = list.stream().map(Customer::getId).collect(Collectors.toList());
+                wrapper.and(q -> q.in(SalesContract::getCustomerId, ids).or().like(SalesContractVo::getContractAmount, dto.getKeyword()));
+            }else{
+                wrapper.and(q -> q.like(SalesContractVo::getContractAmount, dto.getKeyword()));
+            }
+        }
         wrapper.orderByDesc("sc", SalesContract::getId);
         Page<SalesContractVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         List<SalesContractVo> records = page.getRecords();
@@ -59,8 +72,13 @@ public class SalesContractServiceImpl extends ServiceImpl<SalesContractMapper, S
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void add(SalesContractDto salesContractDto) {
-        this.save(salesContractDto);
         List<SalesContractDetails> salesContractDetailsList = salesContractDto.getSalesContractDetailsList();
+        BigDecimal count = BigDecimal.ZERO;
+        for (SalesContractDetails salesContractDetails : salesContractDetailsList) {
+            count.add(salesContractDetails.getUnitPrice().multiply(salesContractDetails.getQuantity()));
+        }
+        salesContractDto.setContractAmount(count);
+        this.save(salesContractDto);
         for (SalesContractDetails salesContractDetails : salesContractDetailsList) {
             salesContractDetails.setSalesContractId(salesContractDto.getId());
         }

+ 5 - 1
hx-sale/src/main/java/com/fjhx/sale/controller/sample/SampleController.java

@@ -11,6 +11,8 @@ import com.ruoyi.common.core.domain.BaseSelectDto;
 import com.fjhx.sale.service.sample.SampleService;
 import org.springframework.beans.factory.annotation.Autowired;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -68,11 +70,13 @@ public class SampleController {
     }
 
     /**
-     * 样品交接单
+     * 样品交接单添加
      */
     @PostMapping("/sampleHandover")
     public void sampleHandover(@RequestBody SampleDto dto) {
         sampleService.sampleHandover(dto);
     }
 
+
+
 }

+ 17 - 1
hx-sale/src/main/java/com/fjhx/sale/entity/contract/vo/ContractProductVo.java

@@ -5,11 +5,12 @@ import lombok.Getter;
 import lombok.Setter;
 
 import java.math.BigDecimal;
+import java.util.Date;
 
 /**
  * 外销合同-产品列表查询返回值实体
  *
- * @author 
+ * @author
  * @since 2023-04-17
  */
 @Getter
@@ -100,4 +101,19 @@ public class ContractProductVo extends ContractProduct {
      * 合同到账时间
      */
     private String claimTime;
+
+    /**
+     * 合同到账时间
+     */
+    private Long buyCorporationId;
+
+    /**
+     * 交接单时间
+     */
+    private Date sampleTime;
+
+    /**
+     * 客户名称
+     */
+    private String buyCorporationName;
 }

+ 1 - 1
hx-sale/src/main/java/com/fjhx/sale/flow/PurchaseFlow.java

@@ -29,7 +29,7 @@ import java.util.Date;
 import java.util.List;
 
 /**
- * 采购流程
+ * EHSD采购流程
  *
  * @Author:caozj
  * @DATE:2023/4/3 17:38

+ 8 - 1
hx-sale/src/main/java/com/fjhx/sale/mapper/contract/ContractProductMapper.java

@@ -15,7 +15,7 @@ import java.util.List;
  * 外销合同-产品 Mapper 接口
  * </p>
  *
- * @author 
+ * @author
  * @since 2023-04-17
  */
 public interface ContractProductMapper extends BaseMapper<ContractProduct> {
@@ -48,4 +48,11 @@ public interface ContractProductMapper extends BaseMapper<ContractProduct> {
      */
     Page<ContractProductVo> getEHSDPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<ContractProduct> wrapper);
 
+    /**
+     * 合同交接单
+     * @param page
+     * @param wrapper
+     * @return
+     */
+    Page<ContractProductVo> contractHandoverPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<ContractProduct> wrapper);
 }

+ 9 - 1
hx-sale/src/main/java/com/fjhx/sale/mapper/sample/SampleMapper.java

@@ -1,5 +1,6 @@
 package com.fjhx.sale.mapper.sample;
 
+import com.fjhx.sale.entity.contract.vo.ContractProductVo;
 import com.fjhx.sale.entity.sample.po.Sample;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -13,7 +14,7 @@ import org.apache.ibatis.annotations.Param;
  * 样品单表 Mapper 接口
  * </p>
  *
- * @author 
+ * @author
  * @since 2023-05-05
  */
 public interface SampleMapper extends BaseMapper<Sample> {
@@ -23,4 +24,11 @@ public interface SampleMapper extends BaseMapper<Sample> {
      */
     Page<SampleVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<Sample> wrapper);
 
+    /**
+     * 查询样品交接单列表
+     * @param page
+     * @param wrapper
+     * @return
+     */
+    Page<ContractProductVo> sampleHandoverList(@Param("page") Page<Object> page, @Param("ew") IWrapper<Sample> wrapper);
 }

+ 5 - 1
hx-sale/src/main/java/com/fjhx/sale/service/contract/ContractProductService.java

@@ -15,7 +15,7 @@ import java.util.List;
  * 外销合同-产品 服务类
  * </p>
  *
- * @author 
+ * @author
  * @since 2023-04-17
  */
 public interface ContractProductService extends BaseService<ContractProduct> {
@@ -62,4 +62,8 @@ public interface ContractProductService extends BaseService<ContractProduct> {
      */
     Page<ContractProductVo> getEHSDPage(ContractProductSelectDto dto);
 
+    /**
+     * 合同交接单--分页
+     */
+    Page<ContractProductVo> contractHandoverPage(ContractProductSelectDto dto);
 }

+ 47 - 0
hx-sale/src/main/java/com/fjhx/sale/service/contract/impl/ContractProductServiceImpl.java

@@ -1,8 +1,12 @@
 package com.fjhx.sale.service.contract.impl;
 
 import cn.hutool.http.HttpRequest;
+import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.common.enums.FlowStatusEnum;
+import com.fjhx.common.service.corporation.CorporationService;
+import com.fjhx.customer.service.customer.CustomerService;
 import com.fjhx.item.service.product.ProductClassifyService;
 import com.fjhx.item.service.product.ProductInfoService;
 import com.fjhx.purchase.entity.purchase.vo.PurchaseDetailVo;
@@ -57,6 +61,11 @@ public class ContractProductServiceImpl extends ServiceImpl<ContractProductMappe
 
     @Autowired
     private PurchaseDetailService purchaseDetailService;
+
+    @Autowired
+    private CustomerService customerService;
+
+
     /**
      * 分页
      * @param dto
@@ -147,6 +156,40 @@ public class ContractProductServiceImpl extends ServiceImpl<ContractProductMappe
     }
 
     /**
+     * 合同交接单--分页
+     */
+    @Override
+    public Page<ContractProductVo> contractHandoverPage(ContractProductSelectDto dto) {
+        IWrapper<ContractProduct> wrapper = getWrapper();
+        wrapper.orderByDesc("t1.ct");
+        if(StringUtils.isNotEmpty(dto.getKeyword())){
+            wrapper.keyword(dto.getKeyword(),new SqlField("t1.`contractCode`"),new SqlField("t1.`userName`"));
+        }
+        wrapper.ge("t2.`status`",30);
+        wrapper.lt("t2.`status`",88);
+        wrapper.gt("t1.expend_quantity",0);
+        Page<ContractProductVo> page = this.baseMapper.contractHandoverPage(dto.getPage(), wrapper);
+
+        List<ContractProductVo> list = page.getRecords();
+        if(CollectionUtils.isNotEmpty(list)){
+            // 赋值产品属性
+            productInfoService.attributeAssign(list, ContractProductVo::getProductId, (item, product) -> {
+                item.setProductCode(product.getCode());
+                item.setProductUnit(product.getUnit());
+                item.setProductType(product.getType());
+                item.setProductName(product.getName());
+                item.setProductSpec(product.getSpec());
+                item.setProductCategoryId(product.getProductClassifyId());
+            });
+            // 赋值客户名称
+            customerService.attributeAssign(list, ContractProductVo::getBuyCorporationId, (item, corporation) -> {
+                item.setBuyCorporationName(corporation.getName());
+            });
+        }
+        return page;
+    }
+
+    /**
      * 根据合同产品IDS查询合同产品
      * @param ids
      * @return
@@ -167,6 +210,7 @@ public class ContractProductServiceImpl extends ServiceImpl<ContractProductMappe
                     c.setSumPurchaseCount(voMap.getOrDefault(c.getId(),BigDecimal.ZERO));
                 }
             }
+
             // 赋值产品属性
             productInfoService.attributeAssign(list, ContractProductVo::getProductId, (item, product) -> {
                 item.setProductCode(product.getCode());
@@ -176,10 +220,13 @@ public class ContractProductServiceImpl extends ServiceImpl<ContractProductMappe
                 item.setProductSpec(product.getSpec());
                 item.setProductCategoryId(product.getProductClassifyId());
             });
+
             // 赋值产品分类名称
             productClassifyService.attributeAssign(list, ContractProductVo::getProductCategoryId, (item, productClassify) -> {
                 item.setProductCategory(productClassify.getName());
             });
+
+
         }
         return list;
     }

+ 8 - 0
hx-sale/src/main/java/com/fjhx/sale/service/sample/SampleService.java

@@ -1,5 +1,6 @@
 package com.fjhx.sale.service.sample;
 
+import com.fjhx.sale.entity.contract.vo.ContractProductVo;
 import com.fjhx.sale.entity.sample.po.Sample;
 import com.ruoyi.common.core.service.BaseService;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -7,6 +8,8 @@ import com.fjhx.sale.entity.sample.vo.SampleVo;
 import com.fjhx.sale.entity.sample.dto.SampleSelectDto;
 import com.fjhx.sale.entity.sample.dto.SampleDto;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -47,4 +50,9 @@ public interface SampleService extends BaseService<Sample> {
      * 样品交接单
      */
     void sampleHandover(SampleDto dto);
+
+    /**
+     * 样品交接单添加
+     */
+    Page<ContractProductVo> sampleHandoverList(SampleSelectDto dto);
 }

+ 45 - 0
hx-sale/src/main/java/com/fjhx/sale/service/sample/impl/SampleServiceImpl.java

@@ -1,14 +1,20 @@
 package com.fjhx.sale.service.sample.impl;
 
 import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.fjhx.common.constant.SourceConstant;
+import com.fjhx.common.controller.corporation.CorporationController;
 import com.fjhx.common.enums.FlowStatusEnum;
+import com.fjhx.common.service.corporation.CorporationService;
 import com.fjhx.customer.entity.customer.po.Customer;
 import com.fjhx.customer.service.customer.CustomerService;
 import com.fjhx.file.entity.FileInfoVo;
 import com.fjhx.file.utils.ObsFileUtil;
+import com.fjhx.item.service.product.ProductInfoService;
+import com.fjhx.sale.entity.contract.po.ContractProduct;
+import com.fjhx.sale.entity.contract.vo.ContractProductVo;
 import com.fjhx.sale.entity.sample.po.Sample;
 import com.fjhx.sale.mapper.sample.SampleMapper;
 import com.fjhx.sale.service.sample.SampleService;
@@ -45,6 +51,10 @@ public class SampleServiceImpl extends ServiceImpl<SampleMapper, Sample> impleme
     @Autowired
     private CustomerService customerService;
 
+    @Autowired
+    private ProductInfoService productInfoService;
+
+
     /**
      * 分页
      *
@@ -134,4 +144,39 @@ public class SampleServiceImpl extends ServiceImpl<SampleMapper, Sample> impleme
         ObsFileUtil.editFile(dto.getPackageFileList(),dto.getId(),2);
     }
 
+    /**
+     * 样品交接单添加
+     */
+    @Override
+    public Page<ContractProductVo> sampleHandoverList(SampleSelectDto dto) {
+        IWrapper<Sample> wrapper = getWrapper();
+        wrapper.orderByDesc("t1.ct");
+        if(StringUtils.isNotEmpty(dto.getKeyword())){
+            wrapper.keyword(dto.getKeyword(),new SqlField("t1.`contractCode`"),new SqlField("t1.`userName`"));
+        }
+        wrapper.ge("t2.`status`",30);
+        wrapper.lt("t2.`status`",88);
+        wrapper.gt("t1.expend_quantity",0);
+        //查询样品交接单列表
+        Page<ContractProductVo> page = this.baseMapper.sampleHandoverList(dto.getPage(), wrapper);
+
+        List<ContractProductVo> list = page.getRecords();
+        if(CollectionUtils.isNotEmpty(list)){
+            // 赋值产品属性
+            productInfoService.attributeAssign(list, ContractProductVo::getProductId, (item, product) -> {
+                item.setProductCode(product.getCode());
+                item.setProductUnit(product.getUnit());
+                item.setProductType(product.getType());
+                item.setProductName(product.getName());
+                item.setProductSpec(product.getSpec());
+                item.setProductCategoryId(product.getProductClassifyId());
+            });
+            // 赋值客户名称
+            customerService.attributeAssign(list, ContractProductVo::getBuyCorporationId, (item, corporation) -> {
+                item.setBuyCorporationName(corporation.getName());
+            });
+        }
+        return page;
+    }
+
 }

+ 27 - 0
hx-sale/src/main/resources/mapper/contract/ContractProductMapper.xml

@@ -102,4 +102,31 @@
             </foreach>
         </if>
     </select>
+    <select id="contractHandoverPage" resultType="com.fjhx.sale.entity.contract.vo.ContractProductVo">
+        SELECT
+            t1.create_time AS ct,
+            t1.id,
+            t1.contract_id,
+            t1.product_id,
+            t2.`code` AS `contractCode`,
+            t2.user_name AS userName,
+            t2.version AS contractVersion,
+            t2.buy_corporation_id buyCorporationId,
+            <!-- 待采购数量-->
+            t1.expend_quantity AS expendQuantity,
+            <!-- 交接单时间-->
+            t3.sampleTime,
+            <!-- 合同审批通过后的时间(每次合同审批后都会修改时间 所以取update_time) -->
+            t2.update_time updateTime,
+
+            <!-- 合同到账时间-->
+            ( SELECT create_time FROM claim_contract WHERE contract_id = t2.id ORDER BY create_time DESC LIMIT 1 ) AS claimTime
+        FROM
+            contract_product t1
+            LEFT JOIN contract t2 ON t1.contract_id = t2.id
+            <!-- 列表中只显示存在交接单的数据 获取到交接单时间最单的一条-->
+            join(SELECT business_id,create_time sampleTime from bytesailing_base.file_info GROUP BY business_id HAVING MAX(create_time)) t3 on
+            t2.id = t3.business_id
+        ${ew.customSqlSegment}
+    </select>
 </mapper>

+ 26 - 0
hx-sale/src/main/resources/mapper/sample/SampleMapper.xml

@@ -8,4 +8,30 @@
             ${ew.customSqlSegment}
     </select>
 
+    <select id="sampleHandoverList" resultType="com.fjhx.sale.entity.contract.vo.ContractProductVo">
+        SELECT
+            t1.create_time AS ct,
+            t1.id,
+            t1.sample_id,
+            t1.product_id,
+            t2.`code` AS `contractCode`,
+            t2.user_name AS userName,
+            t2.versions AS contractVersion,
+            t2.buy_corporation_id buyCorporationId,
+            <!-- 需要采购的合同数量-->
+            t1.expend_quantity AS expendQuantity,
+            <!-- 交接单时间-->
+            t3.sampleTime,
+            <!-- 合同审批通过后的时间(每次合同审批后都会修改时间 所以取update_time) -->
+            t2.update_time updateTime,
+            ( SELECT create_time FROM claim_contract WHERE contract_id = t2.id ORDER BY create_time DESC LIMIT 1 ) AS claimTime
+        FROM
+            sample_product t1
+            LEFT JOIN sample t2 ON t1.sample_id = t2.id
+            <!-- 列表中只显示存在交接单的数据 获取到交接单时间最单的一条-->
+            join(SELECT business_id,create_time sampleTime from bytesailing_base.file_info GROUP BY business_id HAVING MAX(create_time)) t3 on
+            t2.id = t3.business_id
+        ${ew.customSqlSegment}
+    </select>
+
 </mapper>

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff