Ver Fonte

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun

ccjgmwz há 4 anos atrás
pai
commit
4bb501f33e
54 ficheiros alterados com 2873 adições e 125 exclusões
  1. 13 13
      pom.xml
  2. 12 12
      winsea-haixin-platform-backend/pom.xml
  3. 22 28
      winsea-haixin-platform-backend/src/main/resources/banner.txt
  4. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/GeneratorCodeByTables.java
  5. 9 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/constant/StatusEnum.java
  6. 3 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CommonSysParameterController.java
  7. 28 15
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/ContractManagementInfoController.java
  8. 96 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WarehouseBaseInfoController.java
  9. 21 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WarehouseInOutDetailController.java
  10. 71 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WarehouseInOutInfoController.java
  11. 51 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WarehouseInventoryCountInfoController.java
  12. 35 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WarehousePositionInfoController.java
  13. 21 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WarehousePositionStorageInfoController.java
  14. 4 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CommonSysParameter.java
  15. 3 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ContractManagementInfo.java
  16. 1 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ContractProcessInfo.java
  17. 102 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehouseBaseInfo.java
  18. 76 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehouseInOutDetail.java
  19. 177 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehouseInOutInfo.java
  20. 97 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehouseInventoryCountInfo.java
  21. 66 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehousePositionInfo.java
  22. 64 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehousePositionStorageInfo.java
  23. 43 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/WarehouseView.java
  24. 27 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/YException.java
  25. 36 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/YExceptionEnum.java
  26. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehouseBaseInfoMapper.java
  27. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehouseInOutDetailMapper.java
  28. 35 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehouseInOutInfoMapper.java
  29. 37 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehouseInventoryCountInfoMapper.java
  30. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehousePositionInfoMapper.java
  31. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehousePositionStorageInfoMapper.java
  32. 2 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ICommonSysParameterService.java
  33. 13 3
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IContractManagementInfoService.java
  34. 65 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWarehouseBaseInfoService.java
  35. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWarehouseInOutDetailService.java
  36. 40 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWarehouseInOutInfoService.java
  37. 34 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWarehouseInventoryCountInfoService.java
  38. 21 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWarehousePositionInfoService.java
  39. 16 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWarehousePositionStorageInfoService.java
  40. 9 9
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CommonSysParameterServiceImpl.java
  41. 519 18
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java
  42. 287 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseBaseInfoServiceImpl.java
  43. 20 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutDetailServiceImpl.java
  44. 238 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java
  45. 150 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInventoryCountInfoServiceImpl.java
  46. 53 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousePositionInfoServiceImpl.java
  47. 20 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousePositionStorageInfoServiceImpl.java
  48. 30 23
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml
  49. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml
  50. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseInOutDetailMapper.xml
  51. 67 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseInOutInfoMapper.xml
  52. 38 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseInventoryCountInfoMapper.xml
  53. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousePositionInfoMapper.xml
  54. 5 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousePositionStorageInfoMapper.xml

+ 13 - 13
pom.xml

@@ -46,7 +46,7 @@
         <!--            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>-->
         <!--        </repository>-->
         <repository>
-            <id>nexus-winsea</id>
+            <id>maven-public</id>
             <url>http://nexus.winsea.com:8081/repository/maven-public/</url>
             <releases>
                 <enabled>true</enabled>
@@ -63,18 +63,18 @@
             <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
         </pluginRepository>
     </pluginRepositories>
-<!--    <distributionManagement>-->
-<!--        <repository>-->
-<!--            <id>nexus-winsea</id>-->
-<!--            <name>Nexus Release Repository</name>-->
-<!--            <url>http://nexus.winsea.com:8081/repository/maven-releases/</url>-->
-<!--        </repository>-->
-<!--        <snapshotRepository>-->
-<!--            <id>nexus-winsea</id>-->
-<!--            <name>Nexus Snapshot Repository</name>-->
-<!--            <url>http://nexus.winsea.com:8081/repository/maven-snapshots/</url>-->
-<!--        </snapshotRepository>-->
-<!--    </distributionManagement>-->
+    <distributionManagement>
+        <repository>
+            <id>maven-releases</id>
+            <name>Nexus Release Repository</name>
+            <url>http://maven.zthymaoyi.com/nexus/repository/maven-releases/</url>
+        </repository>
+        <snapshotRepository>
+            <id>maven-snapshots</id>
+            <name>Nexus Snapshot Repository</name>
+            <url>http://maven.zthymaoyi.com/nexus/repository/maven-snapshots/</url>
+        </snapshotRepository>
+    </distributionManagement>
 
     <dependencies>
         <dependency>

+ 12 - 12
winsea-haixin-platform-backend/pom.xml

@@ -36,18 +36,18 @@
             <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
         </pluginRepository>
     </pluginRepositories>
-<!--    <distributionManagement>-->
-<!--        <repository>-->
-<!--            <id>nexus-winsea</id>-->
-<!--            <name>Nexus Release Repository</name>-->
-<!--            <url>http://nexus.winsea.com:8081/repository/maven-releases/</url>-->
-<!--        </repository>-->
-<!--        <snapshotRepository>-->
-<!--            <id>nexus-winsea</id>-->
-<!--            <name>Nexus Snapshot Repository</name>-->
-<!--            <url>http://nexus.winsea.com:8081/repository/maven-snapshots/</url>-->
-<!--        </snapshotRepository>-->
-<!--    </distributionManagement>-->
+    <distributionManagement>
+        <repository>
+            <id>maven-releases</id>
+            <name>Nexus Release Repository</name>
+            <url>http://maven.zthymaoyi.com/nexus/repository/maven-releases/</url>
+        </repository>
+        <snapshotRepository>
+            <id>maven-snapshots</id>
+            <name>Nexus Snapshot Repository</name>
+            <url>http://maven.zthymaoyi.com/nexus/repository/maven-snapshots/</url>
+        </snapshotRepository>
+    </distributionManagement>
     <dependencies>
 
         <!--海务模块-->

+ 22 - 28
winsea-haixin-platform-backend/src/main/resources/banner.txt

@@ -1,30 +1,24 @@
-                                      ,iti,.
-                       t;           ;DDDGGDDi
-                      fDD          fDD;.  .LD:
-                      DDDjG.      tDD,     .Dj
-                     .DDfDDj:    GDD;       Df
-                      DLfDjDG.  jDDD,      GG
-                      iD;DjD.   DDDD:   ,DD,
-                       iDijfjDf;DDDDiGDL:
-                        :jGDGDDDDDDD;.
-                            .:,;DDDDfjt,.
-                           .LDG,DDDD. .LD;
-                         :fDf:  DDDD    DDj
-                       :DG.     DDDD    tDDG
-                       GG       DDDL    ;DDD:
-                      jD       iDDj     .DDDG
-                      .DG.  .;DDL       .DDDD
-                       ,DDGGDDDi        .DDDD
-                         ,iii,           ;;;;
- __        __  _           ____                      __          ___
- \ \      / / (_)  _ __   / ___|    ___    __ _     / /_        / _ \ 
-  \ \ /\ / /  | | | '_ \  \___ \   / _ \  / _` |   | '_ \      | | | |
-   \ V  V /   | | | | | |  ___) | |  __/ | (_| |   | (_) |  _  | |_| |
-    \_/\_/    |_| |_| |_| |____/   \___|  \__,_|    \___/  (_)  \___/
 
-         __     __  ___                   __            __               __
-   ___  / /__ _/ /_/ _/__  ______ _  ____/ /  ___ _____/ /_____ ___  ___/ /
-  / _ \/ / _ `/ __/ _/ _ \/ __/  ' \/___/ _ \/ _ `/ __/  '_/ -_) _ \/ _  /
- / .__/_/\_,_/\__/_/ \___/_/ /_/_/_/   /_.__/\_,_/\__/_/\_\\__/_//_/\_,_/
-/_/
+ _______           _______  _        _______ _________ _______ _________
+/ ___   )|\     /|(  ___  )( (    /|(  ____ \\__   __/(  ___  )\__   __/
+\/   )  || )   ( || (   ) ||  \  ( || (    \/   ) (   | (   ) |   ) (
+    /   )| (___) || |   | ||   \ | || |         | |   | (___) |   | |
+   /   / |  ___  || |   | || (\ \) || | ____    | |   |  ___  |   | |
+  /   /  | (   ) || |   | || | \   || | \_  )   | |   | (   ) |   | |
+ /   (_/\| )   ( || (___) || )  \  || (___) |   | |   | )   ( |___) (___
+(_______/|/     \|(_______)|/    )_)(_______)   )_(   |/     \|\_______/
+
+ _                 _______  _______                    _______  _
+( (    /||\     /|(  ___  )(  ___  )|\     /||\     /|(  ___  )( (    /|
+|  \  ( || )   ( || (   ) || (   ) |( \   / )| )   ( || (   ) ||  \  ( |
+|   \ | || (___) || (___) || |   | | \ (_) / | |   | || (___) ||   \ | |
+| (\ \) ||  ___  ||  ___  || |   | |  \   /  | |   | ||  ___  || (\ \) |
+| | \   || (   ) || (   ) || |   | |   ) (   | |   | || (   ) || | \   |
+| )  \  || )   ( || )   ( || (___) |   | |   | (___) || )   ( || )  \  |
+|/    )_)|/     \||/     \|(_______)   \_/   (_______)|/     \||/    )_)
+ _  _  ____  __    ____    __    _  _  ___  _  _  ____  _  _  __  __  _  _
+( \/ )(_  _)(  )  (_  _)  /__\  ( \( )/ __)( \/ )(_  _)( \/ )(  )(  )( \( )
+ \  /  _)(_  )(__  _)(_  /(__)\  )  (( (_-. \  /  _)(_  \  /  )(__)(  )  (
+ (__) (____)(____)(____)(__)(__)(_)\_)\___/ (__) (____) (__) (______)(_)\_)
+
 ::: Project (version:${application.version}) :::             \(^O^)/

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/GeneratorCodeByTables.java

@@ -54,7 +54,7 @@ public class GeneratorCodeByTables {
 
     public static void main(String[] args) throws IOException {
 //        generateByTables("Gongdc", "com.yh.saas.plugin.crew","crew_interview_info");
-        generateByTables("Gongdc", "com.yh.saas.plugin.com.yh.saas.plugin.yiliangyiyun","common_sys_parameter");
+        generateByTables("Gongdc", "com.yh.saas.plugin.yiliangyiyun","warehouse_inventory_count_info");
     }
 
     /**

+ 9 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/constant/StatusEnum.java

@@ -14,6 +14,15 @@ public enum StatusEnum {
     CONTRACT_DO("1", "执行中", "Under implementation"),
     CONTRACT_COMPLETED("3", "已完成", "Completed"),
 
+    // 仓库显示标识
+    HIDE("0","隐藏",""),
+    SHOW("1","显示",""),
+
+
+    // 出入库记录
+    TEMPORARILY_STORED("1", "已暂存", "Temporarily stored"),
+    SUBMITTED("3", "已提交", "Submitted"),
+
     ;
     @Getter
     private String flag;

+ 3 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CommonSysParameterController.java

@@ -1,6 +1,7 @@
 package com.yh.saas.plugin.yiliangyiyun.controller;
 
 
+import com.yh.saas.plugin.yiliangyiyun.entity.CommonSysParameter;
 import com.yh.saas.plugin.yiliangyiyun.service.ICommonSysParameterService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -8,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -27,7 +29,7 @@ public class CommonSysParameterController {
      * 查询
      */
     @GetMapping("/getInfo")
-    public Map<String, String> getInfo(String constId){
+    public List<CommonSysParameter> getInfo(String constId){
         return iCommonSysParameterService.getInfo(constId);
     }
 

+ 28 - 15
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/ContractManagementInfoController.java

@@ -8,11 +8,11 @@ import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 //import org.springframework.web.bind.annotation.*;
 import com.baomidou.mybatisplus.plugins.Page;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-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 org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+
 /**
  * <p>
  * 合同管理 前端控制器
@@ -31,8 +31,8 @@ public class ContractManagementInfoController {
     /**
      * 新增合同信息
      */
-    @PostMapping("/addInfo")
-    public String addInfo(@RequestBody ContractManagementInfo contractManagementInfo) {
+    @PostMapping("/api/addInfo")
+    public String addInfo(@RequestBody @Valid ContractManagementInfo contractManagementInfo) {
         return contractManagementInfoService.addInfo(contractManagementInfo);
     }
 
@@ -48,7 +48,7 @@ public class ContractManagementInfoController {
      * 查看合同信息
      */
     @GetMapping("/getInfo")
-    public ContractManagementInfo getInfo(String id) {
+    public ContractManagementInfo getInfo(@RequestParam String id) {
         return contractManagementInfoService.getInfo(id);
     }
 
@@ -66,23 +66,36 @@ public class ContractManagementInfoController {
     /**
      * 更改状态
      *
-     * @param id
+     * @param contractManagementInfo
      * @return
      */
     @PostMapping("/editStatus")
-    public String editStatus(String id) {
-        return contractManagementInfoService.editStatus(id);
+    public String editStatus(@RequestBody ContractManagementInfo contractManagementInfo) {
+        return contractManagementInfoService.editStatus(contractManagementInfo.getId());
     }
 
     /**
      * 删除
      *
-     * @param id
+     * @param example
      * @return
      */
     @PostMapping("/deleteInfo")
-    public void deleteInfo(String id) {
-        contractManagementInfoService.deleteInfo(id);
+    public void deleteInfo(@RequestBody  ContractManagementInfo example) {
+        contractManagementInfoService.deleteInfo(example.getId());
+    }
+
+
+    /**
+     * 导出船员简历
+     *
+     * @return
+     * @throws Exception
+     */
+    @GetMapping("export")
+    public void export(ContractManagementInfo example, HttpServletResponse response) throws Exception {
+        contractManagementInfoService.export(example,response);
+    }
+
     }
-}
 

+ 96 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WarehouseBaseInfoController.java

@@ -0,0 +1,96 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseView;
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseBaseInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * <p>
+ * 记录仓库信息 前端控制器
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@RestController
+@RequestMapping("/warehouseBaseInfo")
+public class WarehouseBaseInfoController {
+
+    @Autowired
+    private IWarehouseBaseInfoService warehouseBaseInfoService;
+    /**
+     * 添加仓库
+     */
+    @PostMapping("/api/addWarehouse")
+    public String addWarehouse(@RequestBody WarehouseBaseInfo warehouseBaseInfo) {
+        return warehouseBaseInfoService.addWarehouse(warehouseBaseInfo);
+    }
+    /**
+     * 编辑仓库
+     */
+    @PostMapping("/api/editWarehouse")
+    public String editWarehouse(@RequestBody WarehouseBaseInfo warehouseBaseInfo) {
+        return warehouseBaseInfoService.editWarehouse(warehouseBaseInfo);
+    }
+    /**
+     * 查询存储
+     */
+    @GetMapping("/selectWarehouse")
+    public List<WarehouseBaseInfo> selectWarehouse(String compId){
+        return warehouseBaseInfoService.selectWarehouse(compId);
+    }
+    /**
+     * 查看库房
+     */
+    @GetMapping("/getWarehouse")
+    public WarehouseBaseInfo getWarehouse(String id){
+        return warehouseBaseInfoService.getWarehouse(id);
+    }
+
+    /**
+     * 仓库管理页面列表
+     *
+     * @param compId
+     * @return
+     */
+    @GetMapping("/selectWarehouseViewinfo")
+    public List<WarehouseView> selectWarehouseViewinfo(String compId,String warehouseName){
+        return warehouseBaseInfoService.selectWarehouseViewinfo(compId,warehouseName);
+    }
+
+    /**
+     * 更改显示状态
+     */
+    @PostMapping("/api/editShow")
+    public String editShow(@RequestBody WarehouseBaseInfo warehouseBaseInfo){
+        return warehouseBaseInfoService.editShow(warehouseBaseInfo.getId());
+    }
+
+    /**
+     * 查询所有库房
+     * @param compId
+     * @return
+     */
+    @GetMapping("/selectAllWarehouse")
+    public List<WarehouseBaseInfo> selectAllWarehouse(String compId){
+        return warehouseBaseInfoService.selectAllWarehouse(compId);
+    }
+
+    /**
+     * 删除库房
+     * @param id
+     */
+    @PostMapping("/api/deleteWarehouse")
+    public void deleteWarehouse(String id){
+        warehouseBaseInfoService.deleteWarehouse(id);
+    }
+
+}
+

+ 21 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WarehouseInOutDetailController.java

@@ -0,0 +1,21 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 记录出入库化验数据信息 前端控制器
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@RestController
+@RequestMapping("/warehouseInOutDetail")
+public class WarehouseInOutDetailController {
+
+}
+

+ 71 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WarehouseInOutInfoController.java

@@ -0,0 +1,71 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo;
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInOutInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import com.baomidou.mybatisplus.plugins.Page;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+import com.baomidou.mybatisplus.plugins.Page;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import java.util.List;
+/**
+ * <p>
+ * 记录出入库信息 前端控制器
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@RestController
+@RequestMapping("/warehouseInOutInfo")
+public class WarehouseInOutInfoController {
+    @Autowired
+    private IWarehouseInOutInfoService warehouseInOutInfoService;
+    /**
+     * 待完成页面分页列表查询
+     * @param warehouseInOutInfo
+     * @return
+     */
+    @GetMapping("/selectWarehouseInOutInfo")
+    public Page<WarehouseInOutInfo> selectWarehouseInOutInfo(@RequestBody WarehouseInOutInfo warehouseInOutInfo){
+        return warehouseInOutInfoService.selectWarehouseInOutInfo(warehouseInOutInfo);
+    }
+
+    /**
+     * 删除记录
+     * @param example
+     */
+    @PostMapping("/api/deleteWarehouse")
+    public void deleteWarehouse(@RequestBody WarehouseInOutInfo example){
+        warehouseInOutInfoService.deleteWarehouse(example.getId());
+    }
+
+    /**
+     * 出入库
+     * @param warehouseInOutInfo
+     * @return
+     */
+    @GetMapping("/InOutWarehouse")
+    public String InOutWarehouse (@RequestBody WarehouseInOutInfo warehouseInOutInfo) {
+        return warehouseInOutInfoService.InOutWarehouse(warehouseInOutInfo);
+    }
+
+    /**
+     * 流转记录查询
+     * @param warehouseInOutInfo
+     * @return
+     */
+    @GetMapping("/selectInfo")
+    public Page<WarehouseInOutInfo> selectInfo(WarehouseInOutInfo warehouseInOutInfo) {
+        return warehouseInOutInfoService.selectInfo(warehouseInOutInfo);
+    }
+
+}
+

+ 51 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WarehouseInventoryCountInfoController.java

@@ -0,0 +1,51 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInventoryCountInfo;
+import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInventoryCountInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 记录库存盘点信息 前端控制器
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-25
+ */
+@RestController
+@RequestMapping("/warehouseInventoryCountInfo")
+public class WarehouseInventoryCountInfoController {
+
+    @Autowired
+    private IWarehouseInventoryCountInfoService warehouseInventoryCountInfoService;
+    /**
+     * 盘损记录分页查询
+     *
+     * @param warehouseInventoryCountInfo
+     * @return
+     */
+    @GetMapping("/selectInfo")
+    public Page<WarehouseInventoryCountInfo> selectInfo(WarehouseInventoryCountInfo warehouseInventoryCountInfo) {
+        return warehouseInventoryCountInfoService.selectInfo(warehouseInventoryCountInfo);
+    }
+
+    /**
+     * 盘损
+     */
+    @GetMapping("/getInfo")
+    public WarehouseInventoryCountInfo getInfo(WarehouseInventoryCountInfo warehouseInventoryCountInfo) {
+        return warehouseInventoryCountInfoService.getInfo(warehouseInventoryCountInfo);
+    }
+
+
+}
+

+ 35 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WarehousePositionInfoController.java

@@ -0,0 +1,35 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionInfo;
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehousePositionInfoService;
+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;
+
+/**
+ * <p>
+ * 记录仓库仓位信息 前端控制器
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@RestController
+@RequestMapping("/warehousePositionInfo")
+public class WarehousePositionInfoController {
+
+    @Autowired
+    private IWarehousePositionInfoService warehousePositionInfoService;
+    /**
+     * 删除仓位
+     */
+    @PostMapping("/api/deleteWarehousePosition")
+    public void deleteWarehousePosition(@RequestBody WarehousePositionInfo warehousePositionInfo){
+            warehousePositionInfoService.deleteWarehousePosition(warehousePositionInfo.getId());
+    }
+
+}
+

+ 21 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/WarehousePositionStorageInfoController.java

@@ -0,0 +1,21 @@
+package com.yh.saas.plugin.yiliangyiyun.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 记录仓库仓位储存信息 前端控制器
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@RestController
+@RequestMapping("/warehousePositionStorageInfo")
+public class WarehousePositionStorageInfoController {
+
+}
+

+ 4 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CommonSysParameter.java

@@ -56,6 +56,10 @@ public class CommonSysParameter extends BaseModel<CommonSysParameter> {
      * 变量描述
      */
     private String constDescription;
+    /**
+     * 顺序
+     */
+    private int sort;
 
 
     @Override

+ 3 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ContractManagementInfo.java

@@ -108,11 +108,13 @@ public class ContractManagementInfo extends BaseModel<ContractManagementInfo> {
     /**
      * 交货日期(起)
      */
+    @JsonFormat(pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date deliveryDateStart;
     /**
      * 交货日期(止)
      */
+    @JsonFormat(pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date deliveryDateEnd;
     /**
@@ -126,6 +128,7 @@ public class ContractManagementInfo extends BaseModel<ContractManagementInfo> {
     /**
      * 签订日期
      */
+    @JsonFormat(pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     private Date signingDate;
     /**

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/ContractProcessInfo.java

@@ -57,7 +57,7 @@ public class ContractProcessInfo extends BaseModel<ContractProcessInfo> {
      */
     private Double impurity;
     /**
-     * 未收款
+     * 未收款(已付)
      */
     private Double mildewGrain;
     /**

+ 102 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehouseBaseInfo.java

@@ -0,0 +1,102 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+import com.baomidou.mybatisplus.activerecord.Model;
+import java.io.Serializable;
+import java.util.List;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.annotations.Version;
+
+import com.baomidou.mybatisplus.enums.IdType;
+import com.yh.saas.common.support.entity.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 记录仓库信息
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("warehouse_base_info")
+public class WarehouseBaseInfo extends BaseModel<WarehouseBaseInfo> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 公司id
+     */
+    private String compId;
+    /**
+     * 仓库名称
+     */
+    private String warehouseName;
+    /**
+     * 负责人
+     */
+    private String personCharge;
+    /**
+     * 负责人电话
+     */
+    private String personPhone;
+    /**
+     * 仓库所在地省
+     */
+    private String warehousePrivate;
+    /**
+     * 仓库所在地市
+     */
+    private String warehouseCity;
+    /**
+     * 仓库所在地区
+     */
+    private String warehouseArea;
+    /**
+     * 详细地址
+     */
+    private String detailedAddress;
+    /**
+     * 总储存量(吨)
+     */
+    private Float totalStorage;
+    /**
+     * 附件地址
+     */
+    private String addressUrl;
+    /**
+     * 仓库定位
+     */
+    private String warehousePositioning;
+    /**
+     * 是否显示
+     */
+    private String showFlag;
+    /**
+     * 应余量
+     */
+    @TableField(exist = false)
+    private Float residual;
+
+    @TableField(exist = false)
+    private List<WarehousePositionInfo> warehousePositionInfoList;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 76 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehouseInOutDetail.java

@@ -0,0 +1,76 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+import com.baomidou.mybatisplus.activerecord.Model;
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.annotations.Version;
+
+import com.baomidou.mybatisplus.enums.IdType;
+import com.yh.saas.common.support.entity.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 记录出入库化验数据信息
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("warehouse_in_out_detail")
+public class WarehouseInOutDetail extends BaseModel<WarehouseInOutDetail> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 出入库id
+     */
+    private String infoId;
+    /**
+     * 质检员
+     */
+    private String qualityInspector;
+    /**
+     * 水分
+     */
+    private String waterContent;
+    /**
+     * 杂质
+     */
+    private String impurity;
+    /**
+     * 霉变粒
+     */
+    private String mildewGrain;
+    /**
+     * 不完善粒
+     */
+    private String imperfectGrain;
+    /**
+     * 容重
+     */
+    private String bulkDensity;
+    /**
+     * 热损伤
+     */
+    private String jiaorenli;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 177 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehouseInOutInfo.java

@@ -0,0 +1,177 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+import java.util.Date;
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+
+import com.baomidou.mybatisplus.enums.IdType;
+import com.yh.saas.common.support.entity.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 记录出入库信息
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("warehouse_in_out_info")
+public class WarehouseInOutInfo extends BaseModel<WarehouseInOutInfo> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 仓库id
+     */
+    private String baseId;
+    /**
+     * 仓库名称
+     */
+    private String warehouseName;
+    /**
+     * 仓位编号id
+     */
+    private String positionId;
+    /**
+     * 仓位编号
+     */
+    private String binNumber;
+    /**
+     * 出入库标识(出库1入库2)
+     */
+    private String inOutFlag;
+    /**
+     * 货名key
+     */
+    private String goodsNameKey;
+    /**
+     * 货名
+     */
+    private String goodsName;
+    /**
+     * 毛重(吨)
+     */
+    private Float grossWeight;
+    /**
+     * 皮重(吨)
+     */
+    private Float tare;
+    /**
+     * 净重(吨)
+     */
+    private Float netWeight;
+    /**
+     * 品级key
+     */
+    private String gradeKey;
+    /**
+     * 品级
+     */
+    private String grade;
+    /**
+     * 经办人
+     */
+    private String agent;
+    /**
+     * 入库日期(出库)
+     */
+    private Date inOutDate;
+    /**
+     * 出入库类型key
+     */
+    private String inOutTypeKey;
+    /**
+     * 出入库类型
+     */
+    private String inOutType;
+    /**
+     * 车牌号
+     */
+    private String carNo;
+    /**
+     * 合同编号
+     */
+    private String contractNo;
+    /**
+     * 附件地址
+     */
+    private String addressUrl;
+    /**
+     * 状态标识(1已暂存3已提交)
+     */
+    private String statusFlag;
+    /**
+     * 状态
+     */
+    private String status;
+    /**
+     * 内勤
+     */
+    private String backOffice;
+
+
+    @TableField(exist = false)
+    private WarehouseInOutDetail warehouseInOutDetail;
+
+    /**
+     * 查询类型
+     */
+    @TableField(exist = false)
+    private String searchType;
+
+    /**
+     * 质检员
+     */
+    @TableField(exist = false)
+    private String qualityInspector;
+    /**
+     * 水分
+     */
+    @TableField(exist = false)
+    private String waterContent;
+    /**
+     * 杂质
+     */
+    @TableField(exist = false)
+    private String impurity;
+    /**
+     * 霉变粒
+     */
+    @TableField(exist = false)
+    private String mildewGrain;
+    /**
+     * 不完善粒
+     */
+    @TableField(exist = false)
+    private String imperfectGrain;
+    /**
+     * 容重
+     */
+    @TableField(exist = false)
+    private String bulkDensity;
+    /**
+     * 热损伤
+     */
+    @TableField(exist = false)
+    private String jiaorenli;
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 97 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehouseInventoryCountInfo.java

@@ -0,0 +1,97 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+import com.baomidou.mybatisplus.activerecord.Model;
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.annotations.Version;
+
+import com.baomidou.mybatisplus.enums.IdType;
+import com.yh.saas.common.support.entity.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 记录库存盘点信息
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-25
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("warehouse_inventory_count_info")
+public class WarehouseInventoryCountInfo extends BaseModel<WarehouseInventoryCountInfo> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 仓库id
+     */
+    private String baseId;
+    /**
+     * 仓库名称
+     */
+    private String warehouseName;
+    /**
+     * 仓位编号id
+     */
+    private String positionId;
+    /**
+     * 仓位编号
+     */
+    private String binNumber;
+    /**
+     * 经办人
+     */
+    private String qualityInspector;
+    /**
+     * 货名key
+     */
+    private String goodsNameKey;
+    /**
+     * 货名
+     */
+    private String goodsName;
+    /**
+     * 当期累计入库量(吨)
+     */
+    private Float cumulativeStockIn;
+    /**
+     * 当期累计出库量(吨)
+     */
+    private Float cumulativeStockOut;
+    /**
+     * 应余库存(吨)
+     */
+    private Float surplusInventory;
+    /**
+     * 实际库存(吨)
+     */
+    private Float physicalInventory;
+    /**
+     * 损耗量(吨)
+     */
+    private Float loss;
+    /**
+     * 库存比例
+     */
+    private String inventoryRatio;
+
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 66 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehousePositionInfo.java

@@ -0,0 +1,66 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+import com.baomidou.mybatisplus.activerecord.Model;
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.annotations.Version;
+
+import com.baomidou.mybatisplus.enums.IdType;
+import com.yh.saas.common.support.entity.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 记录仓库仓位信息
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("warehouse_position_info")
+public class WarehousePositionInfo extends BaseModel<WarehousePositionInfo> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 仓库id
+     */
+    private String baseId;
+    /**
+     * 仓位编号
+     */
+    private String binNumber;
+    /**
+     * 最大储存量(吨)
+     */
+    private Float maxStorage;
+    /**
+     * 现有储存量(吨)
+     */
+    private Float nowStorage;
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 64 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/WarehousePositionStorageInfo.java

@@ -0,0 +1,64 @@
+package com.yh.saas.plugin.yiliangyiyun.entity;
+
+import com.baomidou.mybatisplus.activerecord.Model;
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.annotations.Version;
+
+import com.baomidou.mybatisplus.enums.IdType;
+import com.yh.saas.common.support.entity.BaseModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 记录仓库仓位储存信息
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("warehouse_position_storage_info")
+public class WarehousePositionStorageInfo extends BaseModel<WarehousePositionStorageInfo> {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.UUID)
+    private String id;
+    /**
+     * 仓位编号id
+     */
+    private String positionId;
+    /**
+     * 仓位编号
+     */
+    private String binNumber;
+    /**
+     * 货名key
+     */
+    private String goodsNameKey;
+    /**
+     * 货名
+     */
+    private String goodsName;
+    /**
+     * 储存量(吨)
+     */
+    private Float storage;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 43 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/WarehouseView.java

@@ -0,0 +1,43 @@
+package com.yh.saas.plugin.yiliangyiyun.entity.view;
+
+import lombok.Data;
+
+@Data
+public class WarehouseView {
+    /**
+     * 仓库名称ID
+     */
+    private String warehouseId;
+    /**
+     * 仓库名称
+     */
+    private String warehouseName;
+    /**
+     * 仓位编号id
+     */
+    private String binNumberId;
+    /**
+     * 仓位编号
+     */
+    private String binNumber;
+    /**
+     * 入库量
+     */
+    private String inNetWeight;
+    /**
+     * 出库量
+     */
+    private String outNetWeight;
+    /**
+     * 应余量
+     */
+    private String storage;
+    /**
+     * 容量
+     */
+    private String capacity;
+    /**
+     * 待完成数
+     */
+    private int number;
+}

+ 27 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/YException.java

@@ -0,0 +1,27 @@
+package com.yh.saas.plugin.yiliangyiyun.exception;
+
+import lombok.Getter;
+
+@Getter
+public class YException extends RuntimeException {
+
+	private static final long serialVersionUID = 1L;
+
+	private final String code;
+
+	private final String message;
+
+	public YException(YExceptionEnum exceptionEnum) {
+		super(exceptionEnum.getDesc());
+
+		this.code = exceptionEnum.getValue();
+		this.message = exceptionEnum.getDesc();
+	}
+
+	public YException(String code, String message) {
+		super(message);
+
+		this.code = code;
+		this.message = message;
+	}
+}

+ 36 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/exception/YExceptionEnum.java

@@ -0,0 +1,36 @@
+package com.yh.saas.plugin.yiliangyiyun.exception;
+
+import lombok.Getter;
+
+/**
+ * 服务商管理错误码
+ * 
+ * @author yul
+ *
+ */
+public enum YExceptionEnum {
+
+	WAREHOSE_SYSTEM_ERROR("ERROR", "现有库存不为0,不可删除!"),
+	CONTRACT_NO_ERROR("ERROR", "合同编号已存在,不可重复!"),
+	WAREHOUSE_NO_ERROR("ERROR","仓库不存在"),
+	POSITION_NO_ERROR("ERROR","库位不存在"),
+	POSITIONSTORAGE_NO_ERROR("ERROR","没有储存量"),
+	INVENTORY_NO_ERROR("ERROR","出库量大于库存量"),
+	;
+
+	@Getter
+	private String value;
+
+	@Getter
+	private String desc;
+
+	private YExceptionEnum(String value, String desc) {
+		this.value = value;
+		this.desc = desc;
+	}
+
+	@Override
+	public String toString() {
+		return "[" + this.value + "]" + this.desc;
+	}
+}

+ 16 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehouseBaseInfoMapper.java

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 记录仓库信息 Mapper 接口
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+public interface WarehouseBaseInfoMapper extends BaseMapper<WarehouseBaseInfo> {
+
+}

+ 16 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehouseInOutDetailMapper.java

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutDetail;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 记录出入库化验数据信息 Mapper 接口
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+public interface WarehouseInOutDetailMapper extends BaseMapper<WarehouseInOutDetail> {
+
+}

+ 35 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehouseInOutInfoMapper.java

@@ -0,0 +1,35 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 记录出入库信息 Mapper 接口
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+public interface WarehouseInOutInfoMapper extends BaseMapper<WarehouseInOutInfo> {
+    /**
+     * 根据条件流转记录总数
+     *
+     * @param pageView
+     * @return
+     */
+    Integer getCountByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询流转记录列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<WarehouseInOutInfo> getListByCondition(Map<String, Object> pageView);
+
+}

+ 37 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehouseInventoryCountInfoMapper.java

@@ -0,0 +1,37 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInventoryCountInfo;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 记录库存盘点信息 Mapper 接口
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-25
+ */
+public interface WarehouseInventoryCountInfoMapper extends BaseMapper<WarehouseInventoryCountInfo> {
+
+    /**
+     * 根据条件查询盘损记录总数
+     *
+     * @param pageView
+     * @return
+     */
+    Integer getCountByCondition(Map<String, Object> pageView);
+
+    /**
+     * 根据条件查询盘损记录列表
+     *
+     * @param pageView
+     * @return
+     */
+    List<WarehouseInventoryCountInfo> getListByCondition(Map<String, Object> pageView);
+
+}

+ 16 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehousePositionInfoMapper.java

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionInfo;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 记录仓库仓位信息 Mapper 接口
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+public interface WarehousePositionInfoMapper extends BaseMapper<WarehousePositionInfo> {
+
+}

+ 16 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehousePositionStorageInfoMapper.java

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.mapper;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionStorageInfo;
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 记录仓库仓位储存信息 Mapper 接口
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+public interface WarehousePositionStorageInfoMapper extends BaseMapper<WarehousePositionStorageInfo> {
+
+}

+ 2 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ICommonSysParameterService.java

@@ -3,6 +3,7 @@ package com.yh.saas.plugin.yiliangyiyun.service;
 import com.yh.saas.plugin.yiliangyiyun.entity.CommonSysParameter;
 import com.baomidou.mybatisplus.service.IService;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -19,6 +20,6 @@ public interface ICommonSysParameterService extends IService<CommonSysParameter>
      *
      * @param
      */
-    public Map<String, String> getInfo(String constId);
+    List<CommonSysParameter> getInfo(String constId);
 
 }

+ 13 - 3
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IContractManagementInfoService.java

@@ -4,6 +4,8 @@ import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 import com.baomidou.mybatisplus.service.IService;
 import com.baomidou.mybatisplus.plugins.Page;
 
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * <p>
  * 合同管理 服务类
@@ -18,21 +20,21 @@ public interface IContractManagementInfoService extends IService<ContractManagem
      *
      * @param contractManagementInfo
      */
-    public String addInfo(ContractManagementInfo contractManagementInfo);
+     String addInfo(ContractManagementInfo contractManagementInfo);
 
     /**
      * 编辑
      *
      * @param contractManagementInfo
      */
-    public String editInfo(ContractManagementInfo contractManagementInfo);
+     String editInfo(ContractManagementInfo contractManagementInfo);
 
     /**
      * 查看
      *
      * @param
      */
-    public ContractManagementInfo getInfo(String id);
+     ContractManagementInfo getInfo(String id);
 
     /**
      * 信息分页列表查询
@@ -57,4 +59,12 @@ public interface IContractManagementInfoService extends IService<ContractManagem
      */
     void deleteInfo(String id);
 
+    /**
+     * 导出
+     * @param example
+     * @param response
+     * @throws Exception
+     */
+    void export(ContractManagementInfo example, HttpServletResponse response) throws Exception;
+
 }

+ 65 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWarehouseBaseInfoService.java

@@ -0,0 +1,65 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
+import com.baomidou.mybatisplus.service.IService;
+import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseView;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 记录仓库信息 服务类
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+public interface IWarehouseBaseInfoService extends IService<WarehouseBaseInfo> {
+
+
+    /**
+     * 添加仓库
+     */
+    String addWarehouse(WarehouseBaseInfo warehouseBaseInfo);
+
+
+    /**
+     * 编辑仓库
+     */
+    String editWarehouse(WarehouseBaseInfo warehouseBaseInfo);
+
+    /**
+     * 查询存储
+     * @param compId
+     * @return
+     */
+    List<WarehouseBaseInfo> selectWarehouse(String compId);
+
+    /**
+     * 查看库房
+     */
+    WarehouseBaseInfo getWarehouse(String id);
+
+    /**
+     * 仓库管理页面列表
+     *
+     * @param compId
+     * @return
+     */
+    List<WarehouseView> selectWarehouseViewinfo(String compId,String warehouseName);
+
+    /**
+     * 更改显示状态
+     */
+    String editShow(String id);
+
+    /**
+     *查询所有库房
+     */
+    List<WarehouseBaseInfo> selectAllWarehouse(String compId);
+
+    /**
+     * 删除库房
+     */
+     void deleteWarehouse(String id);
+}

+ 16 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWarehouseInOutDetailService.java

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutDetail;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * 记录出入库化验数据信息 服务类
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+public interface IWarehouseInOutDetailService extends IService<WarehouseInOutDetail> {
+
+}

+ 40 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWarehouseInOutInfoService.java

@@ -0,0 +1,40 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo;
+import com.baomidou.mybatisplus.service.IService;
+/**
+ * <p>
+ * 记录出入库信息 服务类
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+public interface IWarehouseInOutInfoService extends IService<WarehouseInOutInfo> {
+    /**
+     * 待完成页面列表
+     *
+     * @param warehouseInOutInfo
+     * @return
+     */
+    Page<WarehouseInOutInfo> selectWarehouseInOutInfo(WarehouseInOutInfo warehouseInOutInfo);
+    /**
+     * 删除记录
+     */
+    void deleteWarehouse(String id);
+
+    /**
+     * 出入库
+     */
+    String InOutWarehouse (WarehouseInOutInfo warehouseInOutInfo);
+
+    /**
+     * 流转记录分页查询
+     *
+     * @param warehouseInOutInfo
+     * @return
+     */
+    Page<WarehouseInOutInfo> selectInfo(WarehouseInOutInfo warehouseInOutInfo);
+
+}

+ 34 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWarehouseInventoryCountInfoService.java

@@ -0,0 +1,34 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInventoryCountInfo;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * 记录库存盘点信息 服务类
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-25
+ */
+public interface IWarehouseInventoryCountInfoService extends IService<WarehouseInventoryCountInfo> {
+
+    /**
+     * 盘损记录分页查询
+     *
+     * @param warehouseInventoryCountInfo
+     * @return
+     */
+    Page<WarehouseInventoryCountInfo> selectInfo(WarehouseInventoryCountInfo warehouseInventoryCountInfo);
+
+    /**
+     * 盘损当期仓损
+     *
+     * @param warehouseInventoryCountInfo
+     * @return
+     */
+    WarehouseInventoryCountInfo getInfo(WarehouseInventoryCountInfo warehouseInventoryCountInfo);
+
+}

+ 21 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWarehousePositionInfoService.java

@@ -0,0 +1,21 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionInfo;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * 记录仓库仓位信息 服务类
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+public interface IWarehousePositionInfoService extends IService<WarehousePositionInfo> {
+
+    /**
+     * 删除仓位
+     */
+    void deleteWarehousePosition(String id);
+}

+ 16 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IWarehousePositionStorageInfoService.java

@@ -0,0 +1,16 @@
+package com.yh.saas.plugin.yiliangyiyun.service;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionStorageInfo;
+import com.baomidou.mybatisplus.service.IService;
+
+/**
+ * <p>
+ * 记录仓库仓位储存信息 服务类
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+public interface IWarehousePositionStorageInfoService extends IService<WarehousePositionStorageInfo> {
+
+}

+ 9 - 9
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CommonSysParameterServiceImpl.java

@@ -28,15 +28,15 @@ public class CommonSysParameterServiceImpl extends ServiceImpl<CommonSysParamete
      * @param constId
      * @return
      */
-    public Map<String, String> getInfo(String constId){
+    public List<CommonSysParameter> getInfo(String constId){
         List<CommonSysParameter> commonSysParameterList = this.selectList(new EntityWrapper<CommonSysParameter>()
-        .eq("const_id",constId));
-        Map<String, String> map = new HashMap<>();
-        if(CollectionUtils.isNotEmpty(commonSysParameterList)){
-            for(CommonSysParameter commonSysParameter : commonSysParameterList){
-                map.put(commonSysParameter.getConstKey(),commonSysParameter.getConstValue());
-            }
-        }
-        return map;
+        .eq("const_id",constId).orderBy("sort"));
+//        Map<String, String> map = new HashMap<>();
+//        if(CollectionUtils.isNotEmpty(commonSysParameterList)){
+//            for(CommonSysParameter commonSysParameter : commonSysParameterList){
+//                map.put(commonSysParameter.getConstKey(),commonSysParameter.getConstValue());
+//            }
+//        }
+        return commonSysParameterList;
     }
 }

+ 519 - 18
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java

@@ -2,9 +2,14 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
 
 import com.alipay.sofa.runtime.api.annotation.SofaService;
+import com.winsea.svc.base.base.util.DateUtils;
 import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.common.support.util.StringUtils;
+import com.yh.saas.plugin.base.service.ICommonBillOperateHisService;
 import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
 import com.yh.saas.plugin.yiliangyiyun.entity.ContractProcessInfo;
+import com.yh.saas.plugin.yiliangyiyun.exception.YException;
+import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.ContractManagementInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractGoodsInfoService;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractProcessInfoService;
@@ -15,15 +20,23 @@ import com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo;
 import com.yh.saas.plugin.yiliangyiyun.service.IContractManagementInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.httpclient.util.DateUtil;
+import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.ss.usermodel.IndexedColors;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.util.CellRangeAddress;
 import org.springframework.beans.factory.annotation.Autowired;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import org.springframework.beans.factory.annotation.Value;
 
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
+import javax.servlet.http.HttpServletResponse;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.io.*;
+import java.net.URLDecoder;
 
 /**
  * <p>
@@ -38,10 +51,14 @@ import java.util.Map;
 public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManagementInfoMapper, ContractManagementInfo> implements IContractManagementInfoService {
     @Autowired
     private IContractGoodsInfoService contractGoodsInfoService;
-
+    @Autowired
+    private IContractManagementInfoService contractManagementInfoService;
+    @Autowired
+    private ICommonBillOperateHisService billOperateHisService;
     @Autowired
     private IContractProcessInfoService contractProcessInfoService;
-
+    @Value("${file-root-path}")
+    private String localPath;
 
     /**
      * 新增合同信息
@@ -56,15 +73,31 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
         contractManagementInfo.setId(IdGenerator.generateUUID());
         contractManagementInfo.setStatusFlag(StatusEnum.CONTRACT_WAIT.getFlag());
         contractManagementInfo.setStatus(StatusEnum.CONTRACT_WAIT.getName());
+        //判断合同编号是否唯一
+        List<ContractManagementInfo> contractManagementInfos =
+                contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
+                        .eq("contract_no", contractManagementInfo.getContractNo())
+                        .eq("delete_flag","0"));
+        if (contractManagementInfos.size()>0){
+            throw new YException(YExceptionEnum.CONTRACT_NO_ERROR);
+        }
         // 货物信息新增
         ContractGoodsInfo contractGoodsInfo = contractManagementInfo.getContractGoodsInfo();
         contractGoodsInfo.setId(IdGenerator.generateUUID());
+        contractGoodsInfo.setContractId(contractManagementInfo.getId());
         //流程新增
         ContractProcessInfo contractProcessInfo = contractManagementInfo.getContractProcessInfo();
         contractProcessInfo.setId(IdGenerator.generateUUID());
+        contractProcessInfo.setContractId(contractManagementInfo.getId());
         boolean one = this.insert(contractManagementInfo);
         boolean two = contractGoodsInfoService.insert(contractGoodsInfo);
         boolean three = contractProcessInfoService.insert(contractProcessInfo);
+
+        // 插入操作历史
+        String staffName = this.billOperateHisService.getStaffAndName();
+        // 插入操作历史
+        this.billOperateHisService.saveBillOperateHis(contractManagementInfo.getId(), "CONTRACT", staffName, null,
+                StatusEnum.CONTRACT_WAIT.getName(), StatusEnum.CONTRACT_WAIT.getName(), "");
         // 假如 都成功返回ok
         if (one && two && three) {
             return "OK";
@@ -72,19 +105,21 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
             return "NG";
         }
     }
+
     /**
      * 编辑合同信息
+     *
      * @param contractManagementInfo
      * @return
      */
     @Override
-    public String editInfo(ContractManagementInfo contractManagementInfo){
+    public String editInfo(ContractManagementInfo contractManagementInfo) {
         // 主表信息编辑
         boolean one = this.updateById(contractManagementInfo);
         // 货物信息编辑
-        boolean two =contractGoodsInfoService.updateById(contractManagementInfo.getContractGoodsInfo());
+        boolean two = contractGoodsInfoService.updateById(contractManagementInfo.getContractGoodsInfo());
         //流程编辑
-        boolean three =contractProcessInfoService.updateById(contractManagementInfo.getContractProcessInfo());
+        boolean three = contractProcessInfoService.updateById(contractManagementInfo.getContractProcessInfo());
         // 假如 都成功返回ok
         if (one && two && three) {
             return "OK";
@@ -92,8 +127,10 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
             return "NG";
         }
     }
+
     /**
      * 查看合同信息
+     *
      * @param id
      * @return
      */
@@ -118,10 +155,13 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
                 * contractManagementInfo.getPageSize());
         //  公司ID
         pageView.put("compId", AuthSecurityUtils.getCurrentUserInfo().getCompId());
-        pageView.put("searchKeyWord",contractManagementInfo.getSearchKeyWord());
-        pageView.put("startDate",contractManagementInfo.getStartDate());
-        pageView.put("endDate",contractManagementInfo.getEndDate());
-        pageView.put("searchType",contractManagementInfo.getSearchType());
+        pageView.put("searchKeyWord", contractManagementInfo.getSearchKeyWord());
+        pageView.put("startDate", contractManagementInfo.getStartDate());
+        pageView.put("endDate", contractManagementInfo.getEndDate());
+        pageView.put("searchType", contractManagementInfo.getSearchType());
+        pageView.put("contractType", contractManagementInfo.getContractType());
+        pageView.put("pageSize", contractManagementInfo.getPageSize());
+        pageView.put("currentPage", contractManagementInfo.getCurrentPage());
         // 查询服务商总数
         Integer dataCount = baseMapper.getCountByCondition(pageView);
         List<ContractManagementInfo> dataList = baseMapper.getListByCondition(pageView);
@@ -136,7 +176,8 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
 
 
     /**
-     *  更改状态
+     * 更改状态
+     *
      * @param id
      * @return
      */
@@ -148,26 +189,486 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
             if (StatusEnum.CONTRACT_DO.getFlag().equals(contractManagementInfo.getStatusFlag())) {
                 contractManagementInfo.setStatusFlag(StatusEnum.CONTRACT_COMPLETED.getFlag());
                 contractManagementInfo.setStatus(StatusEnum.CONTRACT_COMPLETED.getName());
-            }
-            else{
+            } else {
                 contractManagementInfo.setStatusFlag(StatusEnum.CONTRACT_DO.getFlag());
                 contractManagementInfo.setStatus(StatusEnum.CONTRACT_DO.getName());
             }
             this.updateById(contractManagementInfo);
+            // 插入操作历史
+            String staffName = this.billOperateHisService.getStaffAndName();
+            // 插入操作历史
+            this.billOperateHisService.saveBillOperateHis(contractManagementInfo.getId(), "CONTRACT", staffName, null,
+                    contractManagementInfo.getStatus(), null, "");
             return "OK";
         }
         return "NG";
     }
 
     /**
-     *  删除
+     * 删除
+     *
      * @param id
      */
     @Override
-    public void deleteInfo(String id){
+    public void deleteInfo(String id) {
         ContractManagementInfo contractManagementInfo = this.selectById(id);
         if (contractManagementInfo != null) {
+            //合同信息
             this.deleteById(contractManagementInfo.getId());
+            //货物信息
+            ContractGoodsInfo contractGoodsInfo = contractGoodsInfoService.selectOne(new EntityWrapper<ContractGoodsInfo>().eq("contract_id", id));
+            //流程信息
+            ContractProcessInfo contractProcessInfo = contractProcessInfoService.selectOne(new EntityWrapper<ContractProcessInfo>().eq("contract_id", id));
+            contractGoodsInfoService.deleteById(contractGoodsInfo.getId());
+            contractProcessInfoService.deleteById(contractProcessInfo.getId());
+
         }
+
     }
+
+
+
+    /**
+     * 导出
+     *
+     * @return
+     * @throws Exception
+     */
+    @Override
+    public void export(ContractManagementInfo example, HttpServletResponse response) throws Exception {
+
+
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+        // 查询在船船员
+        Page<ContractManagementInfo> contractManagementInfoPage = this.selectInfo(example);
+        List<ContractManagementInfo> contractManagementInfos = contractManagementInfoPage.getRecords();
+
+
+        // 1.Excel的头部信息
+        String headerTitle = "";
+
+        // 2.创建一个webbook 对应一个Excel文件
+        HSSFWorkbook wb = new HSSFWorkbook();
+
+        // 3.在webbook中添加一个sheet,对应Excel文件中的sheet
+        HSSFSheet sheet;
+
+        sheet = wb.createSheet("合同信息");
+        headerTitle = "合同信息";
+
+        // 4.设置打印参数
+        sheet.setMargin(HSSFSheet.TopMargin, (short) 1);// 页边距(上)
+        sheet.setMargin(HSSFSheet.BottomMargin, (short) 1);// 页边距(下)
+        sheet.setMargin(HSSFSheet.LeftMargin, (short) 1);// 页边距(左)
+        sheet.setMargin(HSSFSheet.RightMargin, (short) 1);// 页边距(右)
+
+        // 不显示网格
+        sheet.setDisplayGridlines(false);
+        // 设置水平居中
+        sheet.setHorizontallyCenter(true);
+
+        /**************** 数据行样式 start ****************/
+        HSSFFont fontTitle = wb.createFont();
+        fontTitle.setFontName("宋体");
+        fontTitle.setFontHeightInPoints((short) 14);
+        // 设置字体加粗
+        fontTitle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+
+        HSSFFont fontComp = wb.createFont();
+        fontComp.setFontName("宋体");
+        fontComp.setFontHeightInPoints((short) 16);
+        // 设置字体加粗
+        fontComp.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
+
+        HSSFFont fontDetail = wb.createFont();
+        fontDetail.setFontName("宋体");
+        fontDetail.setFontHeightInPoints((short) 12);
+
+        // title
+        HSSFCellStyle styleTitle = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleTitle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        // 指定单元格垂直居中对齐
+        styleTitle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleTitle.setWrapText(true);
+        // 设置单元格字体
+        styleTitle.setFont(fontTitle);
+        // 右边框
+        styleTitle.setBorderRight(HSSFCellStyle.BORDER_NONE);
+        // 左边框
+        styleTitle.setBorderLeft(HSSFCellStyle.BORDER_NONE);
+        // 上边框
+        styleTitle.setBorderTop(HSSFCellStyle.BORDER_NONE);
+        // 下边框
+        styleTitle.setBorderBottom(HSSFCellStyle.BORDER_NONE);
+
+        // title
+        HSSFCellStyle styleComp = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleComp.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        // 指定单元格垂直居中对齐
+        styleComp.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleComp.setWrapText(true);
+        // 设置单元格字体
+        styleComp.setFont(fontComp);
+        // 右边框
+        styleComp.setBorderRight(HSSFCellStyle.BORDER_NONE);
+        // 左边框
+        styleComp.setBorderLeft(HSSFCellStyle.BORDER_NONE);
+        // 上边框
+        styleComp.setBorderTop(HSSFCellStyle.BORDER_NONE);
+        // 下边框
+        styleComp.setBorderBottom(HSSFCellStyle.BORDER_NONE);
+
+        HSSFCellStyle styleInfo = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleInfo.setAlignment(HSSFCellStyle.ALIGN_LEFT);
+        // 指定单元格垂直居中对齐
+        styleInfo.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleInfo.setWrapText(true);
+        // 设置单元格字体
+        styleInfo.setFont(fontDetail);
+        // 右边框
+        styleInfo.setBorderRight(HSSFCellStyle.BORDER_NONE);
+        // 左边框
+        styleInfo.setBorderLeft(HSSFCellStyle.BORDER_NONE);
+        // 上边框
+        styleInfo.setBorderTop(HSSFCellStyle.BORDER_NONE);
+        // 下边框
+        styleInfo.setBorderBottom(HSSFCellStyle.BORDER_NONE);
+
+        HSSFCellStyle styleDetail = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleDetail.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        // 指定单元格垂直居中对齐
+        styleDetail.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleDetail.setWrapText(true);
+        // 设置单元格字体
+        styleDetail.setFont(fontDetail);
+        // 右边框
+        styleDetail.setBorderRight(HSSFCellStyle.BORDER_THIN);
+        // 左边框
+        styleDetail.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+        // 上边框
+        styleDetail.setBorderTop(HSSFCellStyle.BORDER_THIN);
+        // 下styleDetailTitle
+        styleDetail.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+
+        HSSFCellStyle styleDetailYellow = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleDetailYellow.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        // 指定单元格垂直居中对齐
+        styleDetailYellow.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleDetailYellow.setWrapText(true);
+        // 设置单元格字体
+        styleDetailYellow.setFont(fontDetail);
+        // 右边框
+        styleDetailYellow.setBorderRight(HSSFCellStyle.BORDER_THIN);
+        // 左边框
+        styleDetailYellow.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+        // 上边框
+        styleDetailYellow.setBorderTop(HSSFCellStyle.BORDER_THIN);
+        // 下styleDetailTitle
+        styleDetailYellow.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+        styleDetailYellow.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
+        styleDetailYellow.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
+
+
+        HSSFCellStyle styleDetailLeft = wb.createCellStyle();
+        // 指定单元格居中对齐
+        styleDetailLeft.setAlignment(HSSFCellStyle.ALIGN_LEFT);
+        // 指定单元格垂直居中对齐
+        styleDetailLeft.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
+        // 指定单元格自动换行
+        styleDetailLeft.setWrapText(true);
+        // 设置单元格字体
+        styleDetailLeft.setFont(fontDetail);
+        // 右边框
+        styleDetailLeft.setBorderRight(HSSFCellStyle.BORDER_THIN);
+        // 左边框
+        styleDetailLeft.setBorderLeft(HSSFCellStyle.BORDER_THIN);
+        // 上边框
+        styleDetailLeft.setBorderTop(HSSFCellStyle.BORDER_THIN);
+        // 下styleDetailTitle
+        styleDetailLeft.setBorderBottom(HSSFCellStyle.BORDER_THIN);
+        /**************** 数据行样式 end ****************/
+
+        // 设置列宽
+        sheet.setColumnWidth(0, 1 * 256 + 184);
+        sheet.setColumnWidth(1, 6 * 256 + 184);
+        sheet.setColumnWidth(2, 12 * 256 + 184);
+        sheet.setColumnWidth(3, 12 * 256 + 184);
+        sheet.setColumnWidth(4, 12 * 256 + 184);
+        sheet.setColumnWidth(5, 12 * 256 + 184);
+        sheet.setColumnWidth(6, 12 * 256 + 184);
+        sheet.setColumnWidth(7, 12 * 256 + 184);
+        sheet.setColumnWidth(8, 12 * 256 + 184);
+        sheet.setColumnWidth(9, 12 * 256 + 184);
+        sheet.setColumnWidth(10, 12 * 256 + 184);
+        sheet.setColumnWidth(11, 12 * 256 + 184);
+        sheet.setColumnWidth(12, 12 * 256 + 184);
+        sheet.setColumnWidth(13, 12 * 256 + 184);
+        sheet.setColumnWidth(14, 1 * 256 + 184);
+
+        // 创建单元格对象
+        HSSFCell cell = null;
+
+        // 创建打印设置对象
+        HSSFPrintSetup ps = sheet.getPrintSetup();
+        // 打印方向,true:横向,false:纵向(默认)
+        ps.setLandscape(false);
+        // // 打印质量
+        // ps.setVResolution((short) 700)
+        // 设置缩放比例
+        ps.setScale((short) 80);
+        // 纸张类型
+        ps.setPaperSize(HSSFPrintSetup.A4_PAPERSIZE);
+
+
+        int rownum = 1;
+        HSSFRow row0 = sheet.createRow((int) rownum);
+        row0.setHeightInPoints(25);
+        cell = row0.createCell(1);
+        cell.setCellStyle(styleTitle);
+        cell.setCellValue("合同信息");
+        sheet.addMergedRegion(new CellRangeAddress(rownum, rownum, (short) 1, (short) 13));
+        cell = row0.createCell(2);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(3);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(4);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(5);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(6);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(7);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(8);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(9);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(10);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(11);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(12);
+        cell.setCellStyle(styleTitle);
+        cell = row0.createCell(13);
+        cell.setCellStyle(styleTitle);
+        rownum++;
+
+        HSSFRow row1 = sheet.createRow((int) rownum);
+        row1.setHeightInPoints(30);
+        cell = row1.createCell(1);
+        cell.setCellValue("序号");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(2);
+        cell.setCellValue("合同编号");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(3);
+        cell.setCellValue("货名");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(4);
+        cell.setCellValue("品级");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(5);
+        cell.setCellValue("重量(吨)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(6);
+        cell.setCellValue("合同单价");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(7);
+        cell.setCellValue("包装方式");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(8);
+        cell.setCellValue("买方");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(9);
+        cell.setCellValue("卖方");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(10);
+        cell.setCellValue("已完成(吨)");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(11);
+        cell.setCellValue("状态");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(12);
+        cell.setCellValue("签订日期");
+        cell.setCellStyle(styleDetail);
+        cell = row1.createCell(13);
+        cell.setCellValue("未回款/已付款(元)");
+        cell.setCellStyle(styleDetail);
+
+        rownum++;
+
+        // 详情信息
+        if (CollectionUtils.isNotEmpty(contractManagementInfos)) {
+            for (int i = 0; i < contractManagementInfos.size(); i++) {
+                ContractManagementInfo contractManagementInfo = contractManagementInfos.get(i);
+                HSSFRow rowx = sheet.createRow((int) rownum);
+                rowx.setHeightInPoints(20);
+                cell = rowx.createCell(1);
+                cell.setCellValue(i + 1);
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(2);
+                cell.setCellValue(editString(contractManagementInfo.getContractNo()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(3);
+                cell.setCellValue(editString(contractManagementInfo.getGoodsName()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(4);
+                cell.setCellValue(editString(contractManagementInfo.getGrade()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(5);
+                cell.setCellValue(editFloat(contractManagementInfo.getWeight()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(6);
+                cell.setCellValue(editDouble(contractManagementInfo.getUnitContractPrice()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(7);
+                cell.setCellValue(editString(contractManagementInfo.getPackingMethod()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(8);
+                cell.setCellValue(editString(contractManagementInfo.getBuyer()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(9);
+                cell.setCellValue(editString(contractManagementInfo.getSeller()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(10);
+                cell.setCellValue(editFloat(contractManagementInfo.getImperfectGrain()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(11);
+                cell.setCellValue(editString(contractManagementInfo.getStatus()));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(12);
+                cell.setCellValue(DateUtil.formatDate(contractManagementInfo.getSigningDate()!=null?contractManagementInfo.getSigningDate():new Date(), DateUtils.DATE_FMT_YYYY_MM_DD));
+                cell.setCellStyle(styleDetail);
+                cell = rowx.createCell(13);
+                cell.setCellValue(editFloat(contractManagementInfo.getMildewGrain()));
+                cell.setCellStyle(styleDetail);
+                rownum++;
+            }
+
+        }
+
+
+        String path = null;
+        String tempPath = null;
+        String excelPath = null;
+
+        try {
+
+            // 取得绝对路径
+            tempPath = URLDecoder.decode((localPath), "utf-8");
+
+            // EXCEL路径
+            excelPath = "/web/temp/repair/" + DateUtil.formatDate(new Date(), DateUtils.DATE_FMT_YYYYMMDD_NS) + '/'
+                    + UUID.randomUUID().toString().replaceAll("-", "");
+
+            path = tempPath + excelPath + '/' + "合同信息"
+                    + ".xls";
+
+        } catch (Exception e) {
+            log.debug(e.getMessage());
+        }
+        // 下载
+        download(path, response, wb);
+
+    }
+
+    /**
+     * 判断字符串
+     * @param example
+     * @return
+     */
+    private String  editString(String example){
+        String exampleOne = example !=null?example:"";
+        return exampleOne;
+    }
+
+
+    /**
+     * 判断浮点数
+     * @param example
+     * @return
+     */
+    private Float editFloat(Float example){
+        Float exampleOne = example !=null?example:0f;
+        return exampleOne;
+    }
+
+    /**
+     * 判断浮点数
+     * @param example
+     * @return
+     */
+    private Double editDouble(Double example){
+        Double exampleOne = example !=null?example:0.00;
+        return exampleOne;
+    }
+
+
+
+
+    /**
+     * 下载
+     *
+     * @param path
+     * @param response
+     * @author 穆永春
+     */
+    private void download(String path, HttpServletResponse response, Workbook wb) {
+
+        try {
+
+            // path是指欲下载的文件的路径。
+            File file = new File(path);
+            // 取得文件名。
+            String fileName = file.getName();
+            // 给文件名编码
+            fileName = new String(fileName.getBytes("GBK"), "ISO-8859-1");
+
+            response.setContentType("application/vnd.ms-excel");
+            response.addHeader("Content-Disposition", "attachment;filename=" + fileName);
+
+            // 定义byte输出流
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+
+            // 写导出文件
+            wb.write(out);
+
+            // 取得模板文件中的数据
+            byte[] result = out.toByteArray();
+
+            // 设置输出数据类型
+            response.setContentType("application/vnd.ms-excel");
+            // 设置输出数据长度
+            response.setContentLength(result.length);
+
+            // 设置文件名称
+            response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
+            // 将文件流输出到画面
+            response.getOutputStream().write(result);
+
+            out.flush();
+            out.close();
+//            File localFile = new File(path);
+//            OutputStream os = new FileOutputStream(localFile);
+//
+//            wb.write(os);
+//            os.flush();
+//            os.close();
+
+        } catch (IOException ex) {
+            log.debug(ex.getMessage());
+        }
+
+    }
+
 }

+ 287 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseBaseInfoServiceImpl.java

@@ -0,0 +1,287 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.common.support.util.StringUtils;
+import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionStorageInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.view.WarehouseView;
+import com.yh.saas.plugin.yiliangyiyun.exception.YException;
+import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
+import com.yh.saas.plugin.yiliangyiyun.mapper.WarehouseBaseInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.*;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * <p>
+ * 记录仓库信息 服务实现类
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@Service
+public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoMapper, WarehouseBaseInfo> implements IWarehouseBaseInfoService {
+
+    @Autowired
+    private IWarehousePositionInfoService warehousePositionInfoService;
+    @Autowired
+    private IWarehouseInOutInfoService warehouseInOutInfoService;
+    @Autowired
+    private IWarehousePositionStorageInfoService warehousePositionStorageInfoService;
+
+    /**
+     * 仓库管理页面列表
+     *
+     * @param compId
+     * @return
+     */
+    @Override
+    public List<WarehouseView> selectWarehouseViewinfo(String compId, String warehouseName) {
+        List<WarehouseView> warehouseViews = new ArrayList<>();
+        Wrapper<WarehouseBaseInfo> warehouseBaseInfoWrapper = new EntityWrapper<>();
+        warehouseBaseInfoWrapper.eq("comp_id", compId).eq("delete_flag", "0").eq("show_flag", "1");
+        if (!StringUtils.isEmpty(warehouseName)) {
+            warehouseBaseInfoWrapper.eq("warehouse_name", warehouseName);
+        }
+        // 查出所有仓库
+        List<WarehouseBaseInfo> warehouseBaseInfoList = this.selectList(warehouseBaseInfoWrapper);
+        if (!CollectionUtils.isEmpty(warehouseBaseInfoList)) {
+            for (WarehouseBaseInfo warehouseBaseInfo : warehouseBaseInfoList) {
+                // 以库位为维度查询
+                List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
+                        .eq("comp_id", compId).eq("base_id", warehouseBaseInfo.getId()));
+                if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
+                    for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfos) {
+                        WarehouseView warehouseView = new WarehouseView();
+                        warehouseView.setWarehouseId(warehouseBaseInfo.getId());
+                        warehouseView.setWarehouseName(warehouseBaseInfo.getWarehouseName());
+                        warehouseView.setBinNumberId(warehousePositionInfo.getId());
+                        warehouseView.setBinNumber(warehousePositionInfo.getBinNumber());
+                        warehouseView.setCapacity(String.valueOf(warehousePositionInfo.getMaxStorage()));
+                        // 定义待完成数量
+                        int count = 0;
+                        // 定义应余量
+                        String storage = "";
+                        //定义入库
+                        String inNetWeight = "";
+                        // 查询入库数量
+                        List<WarehouseInOutInfo> warehouseInOutInfoList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
+                                .eq("position_id", warehousePositionInfo.getId()).eq("in_out_flag", "2").groupBy("goods_name_key").orderBy("goods_name_key"));
+                        if (!CollectionUtils.isEmpty(warehouseInOutInfoList)) {
+                            for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfoList) {
+                                // 查询入库数量
+                                List<WarehouseInOutInfo> warehouseInOutInfoAllList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
+                                        .eq("position_id", warehousePositionInfo.getId()).eq("in_out_flag", "2")
+                                        .eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
+                                if (!CollectionUtils.isEmpty(warehouseInOutInfoAllList)) {
+                                    Float netWeight = 0f;
+                                    for (WarehouseInOutInfo warehouse : warehouseInOutInfoAllList) {
+                                        netWeight = netWeight + warehouse.getNetWeight();
+                                        if ("1".equals(warehouse.getStatusFlag())) {
+                                            count++;
+                                        }
+                                    }
+                                    inNetWeight = inNetWeight + warehouseInOutInfo.getGoodsName() + "(" + netWeight + ")  ";
+                                }
+                                // 查询应余量
+                                WarehousePositionStorageInfo warehousePositionStorageInfo = warehousePositionStorageInfoService.selectOne(new EntityWrapper<WarehousePositionStorageInfo>()
+                                        .eq("position_id", warehouseInOutInfo.getPositionId()).eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
+                                storage = storage + warehousePositionStorageInfo.getGoodsName() + "(" + warehousePositionStorageInfo.getStorage() + ")";
+
+                            }
+                        }
+                        warehouseView.setStorage(storage);
+                        warehouseView.setInNetWeight(inNetWeight);
+                        //定义出库
+                        String outNetWeight = "";
+                        // 查询出库数量
+                        List<WarehouseInOutInfo> warehouseInOutInfos = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
+                                .eq("position_id", warehousePositionInfo.getId()).eq("in_out_flag", "1").groupBy("goods_name_key").orderBy("goods_name_key"));
+                        if (!CollectionUtils.isEmpty(warehouseInOutInfos)) {
+                            for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfos) {
+                                List<WarehouseInOutInfo> warehouseInOutInfoAllList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
+                                        .eq("position_id", warehousePositionInfo.getId()).eq("in_out_flag", "1").eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey()));
+                                if (!CollectionUtils.isEmpty(warehouseInOutInfoAllList)) {
+                                    Float netWeight = 0f;
+                                    for (WarehouseInOutInfo warehouse : warehouseInOutInfoAllList) {
+                                        netWeight = netWeight + warehouse.getNetWeight();
+                                        if ("1".equals(warehouse.getStatusFlag())) {
+                                            count++;
+                                        }
+                                    }
+                                    outNetWeight = outNetWeight + warehouseInOutInfo.getGoodsName() + "(" + netWeight + ")  ";
+                                }
+                            }
+
+                        }
+                        warehouseView.setOutNetWeight(outNetWeight);
+                        warehouseView.setNumber(count);
+                        warehouseViews.add(warehouseView);
+
+                    }
+                }
+            }
+
+        }
+
+        return warehouseViews;
+    }
+
+    /**
+     * 添加仓库
+     */
+    @Override
+    public String addWarehouse(WarehouseBaseInfo warehouseBaseInfo) {
+        //新增主键id
+        warehouseBaseInfo.setId(IdGenerator.generateUUID());
+        List<WarehousePositionInfo> warehousePositionInfoList = warehouseBaseInfo.getWarehousePositionInfoList();
+        if (!CollectionUtils.isEmpty(warehousePositionInfoList)) {
+            for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfoList) {
+                warehousePositionInfo.setId(IdGenerator.generateUUID());
+                warehousePositionInfo.setBaseId(warehouseBaseInfo.getId());
+            }
+        }
+        boolean one = this.insert(warehouseBaseInfo);
+        boolean two = warehousePositionInfoService.insertBatch(warehousePositionInfoList);
+        // 假如 都成功返回ok
+        if (one && two) {
+            return "OK";
+        } else {
+            return "NG";
+        }
+    }
+
+    /**
+     * 编辑仓库
+     */
+    @Override
+    public String editWarehouse(WarehouseBaseInfo warehouseBaseInfo) {
+        List<WarehousePositionInfo> warehousePositionInfoList = warehouseBaseInfo.getWarehousePositionInfoList();
+        this.updateById(warehouseBaseInfo);
+        warehousePositionInfoService.updateBatchById(warehousePositionInfoList);
+        return warehouseBaseInfo.getId();
+    }
+
+    /**
+     * 查询仓储
+     *
+     * @return
+     */
+    @Override
+    public List<WarehouseBaseInfo> selectWarehouse(String compId) {
+        List<WarehouseBaseInfo> warehouseBaseInfoList = this.selectList(new EntityWrapper<WarehouseBaseInfo>()
+                .eq("comp_id", compId).eq("delete_flag", "0"));
+        return warehouseBaseInfoList;
+    }
+
+    /**
+     * 查看库房
+     */
+    @Override
+    public WarehouseBaseInfo getWarehouse(String id) {
+        WarehouseBaseInfo warehouseBaseInfo = this.selectById(id);
+        List<WarehousePositionInfo> warehousePositionInfoList = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
+                .eq("base_id", id));
+        warehouseBaseInfo.setWarehousePositionInfoList(warehousePositionInfoList);
+        return warehouseBaseInfo;
+    }
+
+    /**
+     * 更改显示状态
+     */
+    @Override
+    public String editShow(String id) {
+        //查询仓库信息
+        WarehouseBaseInfo warehouseBaseInfo = this.selectById(id);
+        if (warehouseBaseInfo != null) {
+            if (StatusEnum.SHOW.getFlag().equals(warehouseBaseInfo.getShowFlag())) {
+                warehouseBaseInfo.setShowFlag(StatusEnum.HIDE.getFlag());
+            } else {
+                warehouseBaseInfo.setShowFlag(StatusEnum.SHOW.getFlag());
+            }
+            //更改仓库信息
+            this.updateById(warehouseBaseInfo);
+            return "OK";
+        }
+        return "NG";
+    }
+
+    /**
+     * 查询所有库房
+     *
+     * @param compId
+     * @return
+     */
+    @Override
+    public List<WarehouseBaseInfo> selectAllWarehouse(String compId) {
+        // 查出所有仓库
+        List<WarehouseBaseInfo> warehouseBaseInfoList = this.selectList(new EntityWrapper<WarehouseBaseInfo>().eq("comp_id", compId).eq("delete_flag", "0"));
+        if (!CollectionUtils.isEmpty(warehouseBaseInfoList)) {
+            for (WarehouseBaseInfo warehouseBaseInfo : warehouseBaseInfoList) {
+                // 应余量
+                Float residual = 0f;
+                // 以库位为维度查询
+                List<WarehousePositionInfo> warehousePositionInfoList = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
+                        .eq("base_id", warehouseBaseInfo.getId()));
+                if (!CollectionUtils.isEmpty(warehousePositionInfoList)) {
+                    for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfoList) {
+                        // 查询应余量
+                        List<WarehousePositionStorageInfo> warehousePositionStorageInfoList = warehousePositionStorageInfoService.selectList(new EntityWrapper<WarehousePositionStorageInfo>()
+                                .eq("position_id", warehousePositionInfo.getId()));
+                        if (!CollectionUtils.isEmpty(warehousePositionStorageInfoList)) {
+                            for (WarehousePositionStorageInfo warehousePositionStorageInfo : warehousePositionStorageInfoList) {
+                                residual = residual + warehousePositionStorageInfo.getStorage();
+                            }
+                        }
+                    }
+                }
+                warehouseBaseInfo.setResidual(residual);
+            }
+        }
+        return warehouseBaseInfoList;
+    }
+
+    /**
+     * 删除库房
+     *
+     * @param id
+     */
+    @Override
+    public void deleteWarehouse(String id) {
+        //查询仓库信息
+        WarehouseBaseInfo warehouseBaseInfo = this.selectById(id);
+        this.deleteById(warehouseBaseInfo.getId());
+        //查询仓位信息
+        List<WarehousePositionInfo> warehousePositionInfos = warehousePositionInfoService.selectList(new EntityWrapper<WarehousePositionInfo>()
+                .eq("base_id", warehouseBaseInfo.getId()));
+        if (!CollectionUtils.isEmpty(warehousePositionInfos)) {
+            for (WarehousePositionInfo warehousePositionInfo : warehousePositionInfos) {
+                warehousePositionInfoService.deleteById(warehousePositionInfo.getId());
+                //查询仓位存储量
+                List<WarehousePositionStorageInfo> warehousePositionStorageInfos = warehousePositionStorageInfoService.selectList(new EntityWrapper<WarehousePositionStorageInfo>()
+                        .eq("position_id", warehousePositionInfo.getId()));
+                if (!CollectionUtils.isEmpty(warehousePositionStorageInfos)) {
+                    for (WarehousePositionStorageInfo warehousePositionStorageInfo : warehousePositionStorageInfos) {
+                        //判断是否有剩余库存
+                        if (warehousePositionStorageInfo.getStorage() > 0) {
+                            throw new YException(YExceptionEnum.WAREHOSE_SYSTEM_ERROR);
+                        } else {
+                            warehousePositionStorageInfoService.deleteById(warehousePositionStorageInfo.getId());
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

+ 20 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutDetailServiceImpl.java

@@ -0,0 +1,20 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutDetail;
+import com.yh.saas.plugin.yiliangyiyun.mapper.WarehouseInOutDetailMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInOutDetailService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 记录出入库化验数据信息 服务实现类
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@Service
+public class WarehouseInOutDetailServiceImpl extends ServiceImpl<WarehouseInOutDetailMapper, WarehouseInOutDetail> implements IWarehouseInOutDetailService {
+
+}

+ 238 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java

@@ -0,0 +1,238 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.yh.saas.common.support.util.IdGenerator;
+import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
+import com.yh.saas.plugin.yiliangyiyun.entity.*;
+import com.yh.saas.plugin.yiliangyiyun.exception.YException;
+import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
+import com.yh.saas.plugin.yiliangyiyun.mapper.WarehouseInOutInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.*;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.yh.saas.common.support.util.StringUtils;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseBaseInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutDetail;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo;
+import com.google.common.collect.Lists;
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInOutDetailService;
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInOutInfoService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * <p>
+ * 记录出入库信息 服务实现类
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@Service
+public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInfoMapper, WarehouseInOutInfo> implements IWarehouseInOutInfoService {
+    @Autowired
+    private IWarehouseInOutDetailService warehouseInOutDetailService;
+    @Autowired
+    private IWarehousePositionStorageInfoService warehousePositionStorageInfoService;
+    @Autowired
+    private IWarehouseBaseInfoService warehouseBaseInfoService;
+    @Autowired
+    private IWarehousePositionInfoService warehousePositionInfoService;
+
+    /**
+     * 待完成页面列表
+     *
+     * @param warehouseInOutInfo
+     * @return
+     */
+    @Override
+    public Page<WarehouseInOutInfo> selectWarehouseInOutInfo(WarehouseInOutInfo warehouseInOutInfo) {
+        //查询页面信息
+        Page<WarehouseInOutInfo> warehouseInOutInfoPage = this.selectPage(warehouseInOutInfo.getQueryPage(), new EntityWrapper<WarehouseInOutInfo>()
+                .eq("base_id", warehouseInOutInfo.getBaseId())
+                .eq("position_id", warehouseInOutInfo.getPositionId())
+                .orderBy("update_date",false));
+        //查询总数
+        Integer count=this.selectCount( new EntityWrapper<WarehouseInOutInfo>()
+                .eq("base_id", warehouseInOutInfo.getBaseId())
+                .eq("position_id", warehouseInOutInfo.getPositionId()));
+        warehouseInOutInfoPage.setSize(count);
+        return warehouseInOutInfoPage;
+    }
+
+    /**
+     * 删除
+     *
+     * @param id
+     */
+    @Override
+    public void deleteWarehouse(String id) {
+        WarehouseInOutInfo warehouseInOutInfo = this.selectById(id);
+        if (warehouseInOutInfo != null) {
+            //记录
+            this.deleteById(warehouseInOutInfo.getId());
+            //化验信息
+            WarehouseInOutDetail warehouseInOutDetail = warehouseInOutDetailService.selectOne(new EntityWrapper<WarehouseInOutDetail>().eq("info_id", id));
+            warehouseInOutDetailService.deleteById(warehouseInOutDetail.getId());
+
+        }
+    }
+
+
+    /**
+     * 出入库
+     * @param warehouseInOutInfo
+     * @return
+     */
+    @Override
+    public String InOutWarehouse(WarehouseInOutInfo warehouseInOutInfo) {
+        WarehouseInOutDetail warehouseInOutDetail = warehouseInOutInfo.getWarehouseInOutDetail();
+        //判断暂存提交(前端传参1暂存3提交)
+        if ("1".equals(warehouseInOutInfo.getStatusFlag())) {
+            //插入记录
+            if (StringUtils.isEmpty(warehouseInOutInfo.getId())) {
+                warehouseInOutInfo.setId(IdGenerator.generateUUID());
+                warehouseInOutInfo.setStatus(StatusEnum.TEMPORARILY_STORED.getName());
+                this.insert(warehouseInOutInfo);
+                // 详情
+                warehouseInOutDetail.setInfoId(warehouseInOutInfo.getId());
+                warehouseInOutDetail.setId(IdGenerator.generateUUID());
+                warehouseInOutDetailService.insert(warehouseInOutDetail);
+            }
+            // 编辑修改记录
+            else {
+                this.updateById(warehouseInOutInfo);
+                warehouseInOutDetailService.updateById(warehouseInOutDetail);
+            }
+
+        } else {
+            //判断出入库
+            if ("2".equals(warehouseInOutInfo.getInOutFlag())) {
+                //判断是否有货
+                // 查询仓库
+                WarehouseBaseInfo warehouseBaseInfo = warehouseBaseInfoService.selectById(warehouseInOutInfo.getBaseId());
+                if (warehouseBaseInfo != null) {
+                    //  查询库位
+                    WarehousePositionInfo warehousePositionInfo = warehousePositionInfoService.selectById(warehouseInOutInfo.getPositionId());
+                    if (warehousePositionInfo != null) {
+                        // 查询货物库存量
+                        WarehousePositionStorageInfo warehousePositionStorageInfo = warehousePositionStorageInfoService.selectOne(new EntityWrapper<WarehousePositionStorageInfo>()
+                                .eq("position_id", warehouseInOutInfo.getPositionId())
+                                .eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey())
+                                .eq("delete_flag", "0"));
+                        // 判断是否有货
+                        if (warehousePositionStorageInfo != null) {
+                            // 更新库存量
+                            warehousePositionStorageInfo.setStorage(warehousePositionStorageInfo.getStorage() + warehouseInOutInfo.getNetWeight());
+                            warehousePositionStorageInfoService.updateById(warehousePositionStorageInfo);
+                        }
+                        // 没有货
+                        else {
+                            WarehousePositionStorageInfo warehousePositionStorageInfo1 = new WarehousePositionStorageInfo();
+                            warehousePositionStorageInfo1.setId(IdGenerator.generateUUID());
+                            warehousePositionStorageInfo1.setPositionId(warehouseInOutInfo.getPositionId());
+                            warehousePositionStorageInfo1.setBinNumber(warehouseInOutInfo.getBinNumber());
+                            warehousePositionStorageInfo1.setGoodsNameKey(warehouseInOutInfo.getGoodsNameKey());
+                            warehousePositionStorageInfo1.setGoodsName(warehouseInOutInfo.getGoodsName());
+                            warehousePositionStorageInfo1.setStorage(warehouseInOutInfo.getNetWeight());
+                            warehousePositionStorageInfoService.insert(warehousePositionStorageInfo1);
+                        }
+                    }
+                }
+
+            } else {
+                //判断是否有货
+                // 查询仓库
+                WarehouseBaseInfo warehouseBaseInfo = warehouseBaseInfoService.selectById(warehouseInOutInfo.getBaseId());
+                if (warehouseBaseInfo != null) {
+                    //  查询库位
+                    WarehousePositionInfo warehousePositionInfo = warehousePositionInfoService.selectById(warehouseInOutInfo.getPositionId());
+                    if (warehousePositionInfo != null) {
+                        // 查询货物库存量
+                        WarehousePositionStorageInfo warehousePositionStorageInfo = warehousePositionStorageInfoService.selectOne(new EntityWrapper<WarehousePositionStorageInfo>()
+                                .eq("position_id", warehouseInOutInfo.getPositionId())
+                                .eq("goods_name_key", warehouseInOutInfo.getGoodsNameKey())
+                                .eq("delete_flag", "0"));
+                        // 判断是否有货
+                        if (warehousePositionStorageInfo != null) {
+                            if (warehouseInOutInfo.getNetWeight() <= warehousePositionStorageInfo.getStorage()) {
+                                // 更新库存量
+                                warehousePositionStorageInfo.setStorage(warehousePositionStorageInfo.getStorage() - warehouseInOutInfo.getNetWeight());
+                                warehousePositionStorageInfoService.updateById(warehousePositionStorageInfo);
+                            }
+                            //出库量大于库存量
+                            else {
+                                throw new YException(YExceptionEnum.INVENTORY_NO_ERROR);
+                            }
+                        }
+                        // 没有储存量
+                        else {
+                            throw new YException(YExceptionEnum.POSITIONSTORAGE_NO_ERROR);
+                        }
+                    }
+                    //库位不存在
+                    else {
+                        throw new YException(YExceptionEnum.POSITION_NO_ERROR);
+                    }
+                }
+                //仓库不存在
+                else {
+                    throw new YException(YExceptionEnum.WAREHOUSE_NO_ERROR);
+                }
+            }
+
+            //插入记录
+            if (StringUtils.isEmpty(warehouseInOutInfo.getId())) {
+                warehouseInOutInfo.setId(IdGenerator.generateUUID());
+                warehouseInOutInfo.setStatus(StatusEnum.SUBMITTED.getName());
+                this.insert(warehouseInOutInfo);
+                // 详情
+                warehouseInOutDetail.setInfoId(warehouseInOutInfo.getId());
+                warehouseInOutDetail.setId(IdGenerator.generateUUID());
+                warehouseInOutDetailService.insert(warehouseInOutDetail);
+            }
+            // 编辑修改记录
+            else {
+                warehouseInOutInfo.setStatus(StatusEnum.SUBMITTED.getName());
+                this.updateById(warehouseInOutInfo);
+                warehouseInOutDetailService.updateById(warehouseInOutDetail);
+            }
+        }
+
+        return "OK";
+    }
+    /**
+     * 流转记录查询
+     *
+     * @param warehouseInOutInfo
+     * @return
+     */
+    @Override
+    public Page<WarehouseInOutInfo> selectInfo(WarehouseInOutInfo warehouseInOutInfo) {
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("startRecord", (warehouseInOutInfo.getCurrentPage() - 1)
+                * warehouseInOutInfo.getPageSize());
+        //  仓库ID
+        pageView.put("baseId", warehouseInOutInfo.getBaseId());
+        //  仓位ID
+        pageView.put("positionId", warehouseInOutInfo.getPositionId());
+        pageView.put("searchType", warehouseInOutInfo.getSearchType());
+        pageView.put("pageSize", warehouseInOutInfo.getPageSize());
+        pageView.put("currentPage", warehouseInOutInfo.getCurrentPage());
+        // 查询记录总数
+        Integer dataCount = baseMapper.getCountByCondition(pageView);
+        List<WarehouseInOutInfo> dataList = baseMapper.getListByCondition(pageView);
+        Page<WarehouseInOutInfo> page = new Page<>();
+        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+        page.setTotal(dataCount == null ? 0 : dataCount);
+        page.setCurrent(warehouseInOutInfo.getCurrentPage());
+        page.setSize(warehouseInOutInfo.getPageSize());
+        return page;
+    }
+}

+ 150 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInventoryCountInfoServiceImpl.java

@@ -0,0 +1,150 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.google.common.collect.Lists;
+import com.winsea.svc.base.security.util.AuthSecurityUtils;
+import com.yh.saas.plugin.yiliangyiyun.entity.*;
+import com.yh.saas.plugin.yiliangyiyun.mapper.WarehouseInventoryCountInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInOutInfoService;
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInventoryCountInfoService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 记录库存盘点信息 服务实现类
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-25
+ */
+@Service
+public class WarehouseInventoryCountInfoServiceImpl extends ServiceImpl<WarehouseInventoryCountInfoMapper, WarehouseInventoryCountInfo> implements IWarehouseInventoryCountInfoService {
+
+    @Autowired
+    private IWarehouseInOutInfoService warehouseInOutInfoService;
+
+    /**
+     * 查询盘损记录
+     *
+     * @param warehouseInventoryCountInfo
+     * @return
+     */
+    @Override
+    public Page<WarehouseInventoryCountInfo> selectInfo(WarehouseInventoryCountInfo warehouseInventoryCountInfo) {
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("startRecord", (warehouseInventoryCountInfo.getCurrentPage() - 1)
+                * warehouseInventoryCountInfo.getPageSize());
+        //  仓库ID
+        pageView.put("baseId", warehouseInventoryCountInfo.getBaseId());
+        //  仓位ID
+        pageView.put("positionId", warehouseInventoryCountInfo.getPositionId());
+        pageView.put("pageSize", warehouseInventoryCountInfo.getPageSize());
+        pageView.put("currentPage", warehouseInventoryCountInfo.getCurrentPage());
+        // 查询记录总数
+        Integer dataCount = baseMapper.getCountByCondition(pageView);
+        List<WarehouseInventoryCountInfo> dataList = baseMapper.getListByCondition(pageView);
+        Page<WarehouseInventoryCountInfo> page = new Page<>();
+        page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
+        page.setTotal(dataCount == null ? 0 : dataCount);
+        page.setCurrent(warehouseInventoryCountInfo.getCurrentPage());
+        page.setSize(warehouseInventoryCountInfo.getPageSize());
+        return page;
+    }
+
+    /**
+     * 盘损
+     *
+     * @param warehouseInventoryCountInfo
+     * @return
+     */
+    @Override
+    public WarehouseInventoryCountInfo getInfo(WarehouseInventoryCountInfo warehouseInventoryCountInfo) {
+        WarehouseInventoryCountInfo warehouseInventoryCountInfoCopy = new WarehouseInventoryCountInfo();
+        Wrapper<WarehouseInventoryCountInfo> warehouseInventoryCountInfoWrapper = new EntityWrapper<>();
+        warehouseInventoryCountInfoWrapper.eq("base_id", warehouseInventoryCountInfo.getBaseId())
+                .eq("position_id", warehouseInventoryCountInfo.getPositionId())
+                .eq("goods_name_key",warehouseInventoryCountInfo.getGoodsNameKey())
+                .eq("delete_flag", "0")
+                .orderBy("create_date",false);
+        List<WarehouseInventoryCountInfo> warehouseInventoryCountInfos = this.selectList(warehouseInventoryCountInfoWrapper);
+        // 有盘损记录
+        if (!CollectionUtils.isEmpty(warehouseInventoryCountInfos)) {
+            WarehouseInventoryCountInfo warehouseInventoryCountInfo1=warehouseInventoryCountInfos.get(0);
+            //最后一次盘损剩余量
+            Float physicalInventory=warehouseInventoryCountInfo1.getPhysicalInventory();
+            //定义入库
+            Float inNetWeight =0f;
+            // 查询入库数量
+            List<WarehouseInOutInfo> warehouseInOutInfoList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
+                    .eq("base_id", warehouseInventoryCountInfo1.getBaseId())
+                    .eq("position_id", warehouseInventoryCountInfo1.getPositionId())
+                    .eq("in_out_flag", "2")
+                    .ge("create_date",warehouseInventoryCountInfo1.getCreateDate())
+                    .eq("goods_name_key",warehouseInventoryCountInfo1.getGoodsNameKey()));
+            if (!CollectionUtils.isEmpty(warehouseInOutInfoList)) {
+                for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfoList) {
+                    inNetWeight = inNetWeight + warehouseInOutInfo.getNetWeight();
+                }
+            }
+            warehouseInventoryCountInfoCopy.setCumulativeStockIn(inNetWeight + physicalInventory);
+            //定义出库
+            Float outNetWeight = 0f;
+            // 查询出库数量
+            List<WarehouseInOutInfo> warehouseInOutInfos = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
+                    .eq("base_id", warehouseInventoryCountInfo1.getBaseId())
+                    .eq("position_id", warehouseInventoryCountInfo1.getPositionId())
+                    .ge("create_date",warehouseInventoryCountInfo1.getCreateDate())
+                    .eq("in_out_flag", "1")
+                    .eq("goods_name_key",warehouseInventoryCountInfo1.getGoodsNameKey()));
+            if (!CollectionUtils.isEmpty(warehouseInOutInfos)) {
+                for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfos) {
+                        outNetWeight = outNetWeight + warehouseInOutInfo.getNetWeight();
+                }
+            }
+            warehouseInventoryCountInfoCopy.setCumulativeStockOut(outNetWeight);
+
+        }
+        // 未盘损过
+        else{
+            //定义入库
+            Float inNetWeight =0f;
+            // 查询入库数量
+            List<WarehouseInOutInfo> warehouseInOutInfoList = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
+                    .eq("base_id", warehouseInventoryCountInfo.getBaseId())
+                    .eq("position_id", warehouseInventoryCountInfo.getPositionId())
+                    .eq("in_out_flag", "2")
+                    .eq("goods_name_key",warehouseInventoryCountInfo.getGoodsNameKey()));
+            if (!CollectionUtils.isEmpty(warehouseInOutInfoList)) {
+                for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfoList) {
+                    inNetWeight = inNetWeight + warehouseInOutInfo.getNetWeight();
+                }
+            }
+            warehouseInventoryCountInfoCopy.setCumulativeStockIn(inNetWeight);
+            //定义出库
+            Float outNetWeight = 0f;
+            // 查询出库数量
+            List<WarehouseInOutInfo> warehouseInOutInfos = warehouseInOutInfoService.selectList(new EntityWrapper<WarehouseInOutInfo>()
+                    .eq("base_id", warehouseInventoryCountInfo.getBaseId())
+                    .eq("position_id", warehouseInventoryCountInfo.getPositionId())
+                    .eq("in_out_flag", "1")
+                    .eq("goods_name_key",warehouseInventoryCountInfo.getGoodsNameKey()));
+            if (!CollectionUtils.isEmpty(warehouseInOutInfos)) {
+                for (WarehouseInOutInfo warehouseInOutInfo : warehouseInOutInfos) {
+                    outNetWeight = outNetWeight + warehouseInOutInfo.getNetWeight();
+                }
+            }
+            warehouseInventoryCountInfoCopy.setCumulativeStockOut(outNetWeight);
+
+        }
+        return warehouseInventoryCountInfoCopy;
+    }
+}

+ 53 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousePositionInfoServiceImpl.java

@@ -0,0 +1,53 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionInfo;
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionStorageInfo;
+import com.yh.saas.plugin.yiliangyiyun.exception.YException;
+import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
+import com.yh.saas.plugin.yiliangyiyun.mapper.WarehousePositionInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehousePositionInfoService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehousePositionStorageInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 记录仓库仓位信息 服务实现类
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@Service
+public class WarehousePositionInfoServiceImpl extends ServiceImpl<WarehousePositionInfoMapper, WarehousePositionInfo> implements IWarehousePositionInfoService {
+
+    @Autowired
+    private IWarehousePositionStorageInfoService warehousePositionStorageInfoService;
+
+    /**
+     * 删除仓位
+     */
+    @Override
+    public void deleteWarehousePosition(String id) {
+        WarehousePositionInfo warehousePositionInfo = this.selectById(id);
+        if (warehousePositionInfo != null && warehousePositionInfo.getNowStorage() > 0) {
+            throw new YException(YExceptionEnum.WAREHOSE_SYSTEM_ERROR);
+        } else {
+            this.deleteById(warehousePositionInfo.getId());
+            List<WarehousePositionStorageInfo> warehousePositionStorageInfoList = warehousePositionStorageInfoService
+                    .selectList(new EntityWrapper<WarehousePositionStorageInfo>()
+                            .eq("position_id", id));
+            if (!CollectionUtils.isEmpty(warehousePositionStorageInfoList)) {
+                warehousePositionStorageInfoList.forEach(warehousePositionStorageInfo -> {
+                    warehousePositionStorageInfoService.deleteById(warehousePositionStorageInfo.getId());
+                });
+            }
+        }
+    }
+
+}

+ 20 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousePositionStorageInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.yh.saas.plugin.yiliangyiyun.service.impl;
+
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehousePositionStorageInfo;
+import com.yh.saas.plugin.yiliangyiyun.mapper.WarehousePositionStorageInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehousePositionStorageInfoService;
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 记录仓库仓位储存信息 服务实现类
+ * </p>
+ *
+ * @author Gongdc
+ * @since 2021-05-21
+ */
+@Service
+public class WarehousePositionStorageInfoServiceImpl extends ServiceImpl<WarehousePositionStorageInfoMapper, WarehousePositionStorageInfo> implements IWarehousePositionStorageInfoService {
+
+}

+ 30 - 23
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml

@@ -10,28 +10,31 @@
         left join contract_process_info p on m.id=p.contract_id
         WHERE
         m.comp_id = #{compId}
+        and m.delete_flag = '0'
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
-                AND m.status_flag == '1' or m.status_flag == '0'
+                AND m.status_flag != '3'
             </if>
             <if test="searchType == 2">
-                AND m.status_flag == '3'
+                AND m.status_flag = '3'
             </if>
             <if test="searchType == 3">
                 AND p.mildew_grain != 0
             </if>
-
         </if>
-        <if test="startDate != null and startDate != ''">
-            AND DATE_FORMAT(m.signing_date,"%Y%m%d") ge
-            DATE_FORMAT(#{startDate},"%Y%m%d")
+        <if test="contractType != null and contractType != ''">
+            AND m.contract_type = #{contractType}
         </if>
-        <if test="endDate != null and endDate != ''">
-            AND DATE_FORMAT(m.signing_date,"%Y%m%d") le
-            DATE_FORMAT(#{endDate},"%Y%m%d")
+        <if test="startDate != null">
+            AND (DATE_FORMAT(m.signing_date,"%Y%m%d") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d"))
         </if>
-        <if test="searchType != null and searchType != ''">
-            AND (lower(m.contract_id) like lower(CONCAT('%',#{searchKeyWord},'%'))
+        <if test="endDate != null">
+            AND (DATE_FORMAT(m.signing_date,"%Y%m%d") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d"))
+        </if>
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(m.contract_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower( m.buyer) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower( m.seller) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
@@ -40,7 +43,8 @@
     <select id="getListByCondition" parameterType="Map"
             resultType="com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo">
         SELECT
-        m.contract_id as contractId,
+        m.id,
+        m.contract_no as contractNo,
         g.goods_name as goodsName,
         g.grade as grade,
         m.weight,
@@ -58,28 +62,31 @@
         left join contract_process_info p on m.id=p.contract_id
         WHERE
         m.comp_id = #{compId}
+        and m.delete_flag = '0'
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
-                AND m.status_flag == '1'
+                AND m.status_flag != '3'
             </if>
             <if test="searchType == 2">
-                AND m.status_flag == '3'
+                AND m.status_flag = '3'
             </if>
             <if test="searchType == 3">
                 AND p.mildew_grain != 0
             </if>
-
         </if>
-        <if test="startDate != null and startDate != ''">
-            AND DATE_FORMAT(m.signing_date,"%Y%m%d") ge
-            DATE_FORMAT(#{startDate},"%Y%m%d")
+        <if test="contractType != null and contractType != ''">
+            AND m.contract_type = #{contractType}
         </if>
-        <if test="endDate != null and endDate != ''">
-            AND DATE_FORMAT(m.signing_date,"%Y%m%d") le
-            DATE_FORMAT(#{endDate},"%Y%m%d")
+        <if test="startDate != null">
+            AND (DATE_FORMAT(m.signing_date,"%Y%m%d") &gt;=
+            DATE_FORMAT(#{startDate},"%Y%m%d"))
         </if>
-        <if test="searchType != null and searchType != ''">
-            AND (lower(m.contract_id) like lower(CONCAT('%',#{searchKeyWord},'%'))
+        <if test="endDate != null">
+            AND (DATE_FORMAT(m.signing_date,"%Y%m%d") &lt;=
+            DATE_FORMAT(#{endDate},"%Y%m%d"))
+        </if>
+        <if test="searchKeyWord != null and searchKeyWord != ''">
+            AND (lower(m.contract_no) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower( m.buyer) like lower(CONCAT('%',#{searchKeyWord},'%'))
             OR lower( m.seller) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml

@@ -0,0 +1,5 @@
+<?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.yh.saas.plugin.yiliangyiyun.mapper.WarehouseBaseInfoMapper">
+
+</mapper>

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseInOutDetailMapper.xml

@@ -0,0 +1,5 @@
+<?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.yh.saas.plugin.yiliangyiyun.mapper.WarehouseInOutDetailMapper">
+
+</mapper>

+ 67 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseInOutInfoMapper.xml

@@ -0,0 +1,67 @@
+<?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.yh.saas.plugin.yiliangyiyun.mapper.WarehouseInOutInfoMapper">
+    <!-- 获得流转记录总数 -->
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(w.id)
+        FROM warehouse_in_out_info w
+        left join warehouse_in_out_detail d on w.id=d.info_id
+        WHERE
+        w.base_id = #{baseId}
+        and w.position_id = #{positionId}
+        and w.delete_flag = '0'
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND w.in_out_flag = '1'
+            </if>
+            <if test="searchType == 3">
+                AND w.in_out_flag = '2'
+            </if>
+        </if>
+    </select>
+    <!-- 流转记录列表查询 -->
+    <select id="getListByCondition" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInOutInfo">
+        SELECT
+        w.id,
+        w.goods_name as goodsName,
+        w.gross_weight as grossWeight,
+        w.tare,
+        w.net_weight as netWeight,
+        w.grade,
+        w.in_out_date as inOutDate,
+        w.in_out_type as inOutType,
+        w.contract_no as contractNo,
+        w.car_no as carNo,
+        w.agent,
+        w.back_office as backOffice
+        w.create_date as createDate,
+        d.water_content as waterContent,
+        d.bulk_density as bulkDensity,
+        d.jiaorenli as jiaorenli,
+        d.impurity as impurity,
+        d.mildew_grain as mildewGrain,
+        d.imperfect_grain as imperfectGrain,
+        d.quality_inspector as qualityInspector,
+        w.address_url as addressUrl
+        FROM warehouse_in_out_info w
+        left join warehouse_in_out_detail d on w.id=d.info_id
+        WHERE
+        w.base_id = #{baseId}
+        and w.position_id = #{positionId}
+        and w.delete_flag = '0'
+        <if test="searchType != null and searchType != ''">
+            <if test="searchType == 2">
+                AND w.in_out_flag = '1'
+            </if>
+            <if test="searchType == 3">
+                AND w.in_out_flag = '2'
+            </if>
+        </if>
+        ORDER BY w.update_date DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
+</mapper>

+ 38 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseInventoryCountInfoMapper.xml

@@ -0,0 +1,38 @@
+<?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.yh.saas.plugin.yiliangyiyun.mapper.WarehouseInventoryCountInfoMapper">
+    <!-- 获得盘损记录总数 -->
+    <select id="getCountByCondition" parameterType="Map" resultType="java.lang.Integer">
+        SELECT
+        COUNT(id)
+        FROM warehouse_inventory_count_info
+        WHERE
+        base_id = #{baseId}
+        and position_id = #{positionId}
+        and delete_flag = '0'
+    </select>
+    <!-- 盘损记录查询 -->
+    <select id="getListByCondition" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.WarehouseInventoryCountInfo">
+        SELECT
+        id,
+        goods_name as goodsName,
+        cumulative_stock_in as cumulativeStockIn,
+        cumulative_stock_out as cumulativeStockOut,
+        surplus_inventory as surplusInventory,
+        physical_inventory as physicalinventory,
+        loss,
+        inventory_ratio as inventoryRatio,
+        quality_inspector as qualityInspector,
+        create_date as createDate
+        FROM warehouse_inventory_count_info
+        WHERE
+        base_id = #{baseId}
+        and position_id = #{positionId}
+        and delete_flag = '0'
+        ORDER BY create_date DESC
+        <if test="currentPage != null and currentPage != ''">
+            LIMIT ${startRecord}, ${pageSize}
+        </if>
+    </select>
+</mapper>

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousePositionInfoMapper.xml

@@ -0,0 +1,5 @@
+<?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.yh.saas.plugin.yiliangyiyun.mapper.WarehousePositionInfoMapper">
+
+</mapper>

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousePositionStorageInfoMapper.xml

@@ -0,0 +1,5 @@
+<?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.yh.saas.plugin.yiliangyiyun.mapper.WarehousePositionStorageInfoMapper">
+
+</mapper>