Forráskód Böngészése

出库、库内、gsp

plg-xiongt 2 hónapja
szülő
commit
3602462248
100 módosított fájl, 13395 hozzáadás és 0 törlés
  1. 23 0
      upcloud-base-gsp/.gitignore
  2. 72 0
      upcloud-base-gsp/.gitlab-ci.yml
  3. 11 0
      upcloud-base-gsp/Dockerfile
  4. 0 0
      upcloud-base-gsp/README.md
  5. 68 0
      upcloud-base-gsp/deploy.yml
  6. 53 0
      upcloud-base-gsp/pom.xml
  7. 63 0
      upcloud-base-gsp/upcloud-base-gsp-facade/pom.xml
  8. 73 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/QueryDTO.java
  9. 32 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/QueryVO.java
  10. 30 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/constant/EisBusinessType.java
  11. 21 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/constant/EisConstant.java
  12. 29 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/constant/EisWorkType.java
  13. 9 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/constant/MsgTemplate.java
  14. 20 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/constant/WhOperataConstant.java
  15. 29 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/enums/GspQualityReviewAuditStatus.java
  16. 40 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/enums/GspQualityReviewBillType.java
  17. 35 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/enums/GspUnqualifiedStatus.java
  18. 37 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/enums/StockStatusEnum.java
  19. 16 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/enums/UpkeepTypeEnum.java
  20. 900 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/DxiGspDestroyRequestRecord.java
  21. 698 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/DxiGspGainslossesBillRec.java
  22. 660 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/DxiGspMaintenanceRecord.java
  23. 252 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/DxiGspQualityReviewD.java
  24. 144 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/DxiGspQualityReviewH.java
  25. 148 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUnqualifiedDestroy.java
  26. 150 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUnqualifiedDestroyD.java
  27. 107 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUnqualifiedLoss.java
  28. 418 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUnqualifiedLossD.java
  29. 120 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUnqualifiedStock.java
  30. 410 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUpkeepCheck.java
  31. 132 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUpkeepCheckPlan.java
  32. 241 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/OmsInventoryOrder.java
  33. 33 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/GspQualityReviewService.java
  34. 36 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/GspUnqualifiedDestroyService.java
  35. 39 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/GspUnqualifiedLossService.java
  36. 23 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/GspUpkeepCheckPlanService.java
  37. 53 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/GspUpkeepCheckService.java
  38. 10 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/MqGspConsumer.java
  39. 16 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/MqGspProducer.java
  40. 42 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/CallOutTaskVO.java
  41. 110 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/DxiGspMaintenanceRecordVO.java
  42. 49 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/EisCallOutTaskCallbackSubListVO.java
  43. 29 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/EisCallOutTaskCallbackVO.java
  44. 24 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/EisCheckBackDetailVo.java
  45. 37 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/EisPushTaskVO.java
  46. 22 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/EisTaskFinishedConfirmVO.java
  47. 30 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/EisWorkConfirmVO.java
  48. 178 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/ErpUnqualifiedLossVo.java
  49. 227 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/GspQualityCheckMoveItemVo.java
  50. 64 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/GspQualityCheckMoveVo.java
  51. 163 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/GspUnqualifiedDestroyDVO.java
  52. 172 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/GspUnqualifiedLossDVO.java
  53. 67 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/GspUnqualifiedLossVO.java
  54. 451 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/GspUpkeepCheckVO.java
  55. 83 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/InfTaskOutBackDTO.java
  56. 27 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/LossToOmsVo.java
  57. 54 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/RfGspUpkeepCheckVO.java
  58. 55 0
      upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/TaskFinishedConfirmSubListVO.java
  59. 156 0
      upcloud-base-gsp/upcloud-base-gsp-service/pom.xml
  60. 27 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/Application.java
  61. 65 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/aspect/AceAspect.java
  62. 134 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/controller/GspQualityReviewController.java
  63. 177 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/controller/GspUnqualifiedDestroyController.java
  64. 141 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/controller/GspUnqualifiedLossController.java
  65. 236 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/controller/GspUpkeepCheckController.java
  66. 124 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/controller/PrintController.java
  67. 43 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/controller/RfGspUpkeepCheckController.java
  68. 43 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/core/ControllerExceptionAdvice.java
  69. 14 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/DxiGspDestroyRequestRecordMapper.java
  70. 14 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/DxiGspGainslossesBillRecMapper.java
  71. 14 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/DxiGspMaintenanceRecordMapper.java
  72. 25 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/DxiGspQualityReviewDMapper.java
  73. 26 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/DxiGspQualityReviewHMapper.java
  74. 14 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUnqualifiedDestroyDMapper.java
  75. 14 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUnqualifiedDestroyMapper.java
  76. 24 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUnqualifiedLossDMapper.java
  77. 14 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUnqualifiedLossMapper.java
  78. 14 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUnqualifiedStockMapper.java
  79. 24 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUpkeepCheckMapper.java
  80. 21 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUpkeepCheckPlanMapper.java
  81. 10 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/OmsInventoryOrderMapper.java
  82. 34 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/ChainClient.java
  83. 38 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/CommonClient.java
  84. 38 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/EisResource.java
  85. 15 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/IntegrationResource.java
  86. 76 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/InventoryClient.java
  87. 47 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/ItemClient.java
  88. 26 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/OperateClient.java
  89. 20 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/PrestoClient.java
  90. 57 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/StrategyClient.java
  91. 76 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/WarehouseClient.java
  92. 149 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/AutoUpKeepTask.java
  93. 462 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/GspQualityReviewServiceImpl.java
  94. 467 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/GspUnqualifiedDestroyServiceImpl.java
  95. 871 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/GspUnqualifiedLossServiceImpl.java
  96. 218 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/GspUpkeepCheckPlanServiceImpl.java
  97. 2102 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/GspUpkeepCheckServiceImpl.java
  98. 70 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/eis/EisGspHandler.java
  99. 82 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/mq/RabbitMqGspConsumerImpl.java
  100. 38 0
      upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/mq/RabbitMqGspProducerImpl.java

+ 23 - 0
upcloud-base-gsp/.gitignore

@@ -0,0 +1,23 @@
+target
+**/target
+.classpath
+**/.classpath
+.project
+**/.project
+.settings
+**/.settings
+.svn
+**/.svn
+bin
+**/bin
+.idea/**
+*.iml
+**/*.iml
+rebel.xml
+.factorypath
+**/.factorypath
+.tmp
+**/.tmp
+.log
+**/.log
+rebel.xml

+ 72 - 0
upcloud-base-gsp/.gitlab-ci.yml

@@ -0,0 +1,72 @@
+stages:
+  - compile
+  - build
+  - deploy
+
+variables:
+  PROJECT_NAME: ${CI_PROJECT_NAME}
+  K8S_FILE: "deploy.yml"
+  PROJECT_IMAGE: harbor.cloud.prolog.org/test/${CI_PROJECT_NAME}
+before_script:
+  - PROJECT_IMAGE_TAG=${PROJECT_IMAGE}:${CI_COMMIT_SHA:0:5}
+#开始构建jar包
+compile:
+  image: harbor.cloud.prolog.org/base-solution/maven:3-openjdk-8
+  stage: compile
+  only:
+    refs:
+     - dev   #对应分支代码分支
+  script:
+     - mvn -q clean package -Dmaven.test.skip=true
+  artifacts:
+    expire_in: 1 day  #工作目录保存时间
+    paths:
+      - ./upcloud-base-gsp-service/target/*.jar #获取构建的jar包,此路径随对应项目修改
+#  when: manual  #手动执行,注释后会自动在每次提交变更后执行
+
+#开始构建镜像并上传至harbor
+build:
+  stage: build
+  image: harbor.cloud.prolog.org/base-solution/drone-kaniko:bate
+  variables:
+    PLUGIN_REPO: "test/${CI_PROJECT_NAME}"      #此处为上传harbor时候的容器名称
+    PLUGIN_REGISTRY: "harbor.cloud.prolog.org"
+    PLUGIN_USERNAME: "$DOCKER_USERNAME"       #项目设置里面cicd 配置变量
+    PLUGIN_PASSWORD: "$DOCKER_PASSWORD"       #项目设置里面cicd 配置变量
+    PLUGIN_SKIP_TLS_VERIFY: "true"
+    PLUGIN_SKIP_TLS_VERIFY_PULL: "true"
+    PLUGIN_CACHE: "false"
+    PLUGIN_TAGS: "${CI_COMMIT_SHA:0:5}"
+  script:
+    - PLUGIN_TAGS="${CI_COMMIT_SHA:0:5}"
+    - /kaniko/plugin.sh
+  only:
+    refs:
+     - dev   #对应分支代码分支
+  when: manual  #手动执行,注释后会自动在每次提交变更后执行
+
+#发布流程
+k8s-deploy:
+  stage: deploy
+  variables:
+    PROJECT_PORT: 8080         #配置文件里面的端口需要和deployment容器端口一致 次端口只能在k8s内部访问
+    PROJECT_NODEPORT: 30814    #nodeport 为该服务在k8s集群外访问端口
+    PROJECT_NAME: ${CI_PROJECT_NAME} #启用变量配。
+    PROJECT_NAMESPACE: test           # k8s集群内部的命名空间namespaces
+    PROJECT_ACTIVE: k8s               # 项目对应的环境配置文件
+  image: harbor.cloud.prolog.org/base-solution/kubectl:v1
+  script:
+    - kubectl get nodes
+    - kubectl version
+    - sed -i "s#{PROJECT_NAME}#$PROJECT_NAME#g;
+      s#{PROJECT_NODEPORT}#$PROJECT_NODEPORT#g;
+      s#{PROJECT_PORT}#$PROJECT_PORT#g;
+      s#{PROJECT_NAMESPACE}#$PROJECT_NAMESPACE#g;
+      s#{PROJECT_IMAGE}#$PROJECT_IMAGE_TAG#g;
+      s#{PROJECT_ACTIVE}#$PROJECT_ACTIVE#g" ./deploy.yml
+    - cat ./deploy.yml
+    - kubectl apply -f ./deploy.yml
+  only:
+    refs:
+     - dev   #对应分支代码分支
+  when: manual  #手动执行,注释后会自动在每次提交变更后执行

+ 11 - 0
upcloud-base-gsp/Dockerfile

@@ -0,0 +1,11 @@
+FROM harbor.cloud.prolog.org/base-solution/jar:v2
+ENV LANG=zh_CN.UTF-8
+ENV JAVA_OPTS="-XX:MetaspaceSize=56m -XX:MaxMetaspaceSize=128m -Xms128m -Xmx512m -Xmn110m -Xss256k -XX:SurvivorRatio=8 -Djava.security.egd=file:/dev/./urandom -Duser.timezone=GMT+08"
+RUN mkdir /usr/local/apps
+RUN mkdir /usr/local/logs
+
+COPY ./*/target/*.jar /usr/local/apps/app.jar
+
+WORKDIR /usr/local/apps
+
+CMD java ${JAVA_OPTS} -jar /usr/local/apps/app.jar

+ 0 - 0
upcloud-base-gsp/README.md


+ 68 - 0
upcloud-base-gsp/deploy.yml

@@ -0,0 +1,68 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  namespace: {PROJECT_NAMESPACE}
+  name: {PROJECT_NAME}
+spec:
+  selector:
+    matchLabels:
+      app: {PROJECT_NAME}
+  replicas: 1
+  template:
+    metadata:
+      namespace: {PROJECT_NAMESPACE}
+      labels:
+        app: {PROJECT_NAME}
+    spec:
+      containers:
+      - name: {PROJECT_NAME}
+        image: {PROJECT_IMAGE}
+        imagePullPolicy: Always
+        env:
+        - name: SPRING_PROFILES_ACTIVE
+          value: {PROJECT_ACTIVE}
+        ports:
+        - containerPort: {PROJECT_PORT}
+        readinessProbe:
+          tcpSocket:
+            port: {PROJECT_PORT}
+          initialDelaySeconds: 30
+          periodSeconds: 10
+          successThreshold: 1
+          timeoutSeconds: 10
+          failureThreshold: 3
+        livenessProbe:
+          tcpSocket:
+            port: {PROJECT_PORT}
+          initialDelaySeconds: 30
+          periodSeconds: 10
+          successThreshold: 1
+          timeoutSeconds: 10
+          failureThreshold: 3
+        volumeMounts:
+        - name: spring-log
+          mountPath: /user/local/logs
+        - name: host-time
+          mountPath: /etc/localtime
+      volumes:
+      - name: host-time
+        hostPath:
+         path: "/etc/localtime"
+      - name: spring-log
+        persistentVolumeClaim:
+          claimName: log-pvc
+---
+#service
+apiVersion: v1
+kind: Service
+metadata:
+  namespace: {PROJECT_NAMESPACE}
+  name: {PROJECT_NAME}
+spec:
+  ports:
+  - port: {PROJECT_PORT}
+    targetPort: {PROJECT_PORT}
+    nodePort: {PROJECT_NODEPORT}
+  type: NodePort
+  selector:
+    app: {PROJECT_NAME}

+ 53 - 0
upcloud-base-gsp/pom.xml

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.prolog.upcloud</groupId>
+    <artifactId>upcloud-base-gsp</artifactId>
+    <version>1.0.0.QINGNIU-SNAPSHOT</version>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>upcloud-base-gsp-service</module>
+        <module>upcloud-base-gsp-facade</module>
+    </modules>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>com.prolog.framework</groupId>
+                <artifactId>plg-fx-parent</artifactId>
+                <version>2.1.0.release</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+
+            <dependency>
+                <groupId>com.prolog.upcloud</groupId>
+                <artifactId>upcloud-base-gsp-facade</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+
+            <dependency>
+                <groupId>com.prolog.upcloud</groupId>
+                <artifactId>item-facade</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+
+        </dependencies>
+    </dependencyManagement>
+
+    <distributionManagement>
+        <repository>
+            <id>releases</id>
+            <url>http://192.168.0.167:8081/repository/releases/</url>
+        </repository>
+        <snapshotRepository>
+            <id>snapshots</id>
+            <url>http://192.168.0.167:8081/repository/snapshots/</url>
+        </snapshotRepository>
+    </distributionManagement>
+
+</project>

+ 63 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/pom.xml

@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>upcloud-base-gsp</artifactId>
+        <groupId>com.prolog.upcloud</groupId>
+        <version>1.0.0.QINGNIU-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>upcloud-base-gsp-facade</artifactId>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+    </properties>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>8</source>
+                    <target>8</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.prolog.framework</groupId>
+            <artifactId>plg-fx-core</artifactId>
+        </dependency>
+        
+        <dependency>
+            <groupId>com.prolog.framework</groupId>
+            <artifactId>plg-fx-microservice</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.16.10</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.prolog.upcloud</groupId>
+            <artifactId>upcloud-base-inventory-facade</artifactId>
+            <version>${project.version}</version>
+            <!--            <version>${project.version}</version>-->
+        </dependency>
+        <dependency>
+            <groupId>com.prolog.upcloud</groupId>
+            <artifactId>outbound-facade</artifactId>
+            <version>${project.version}</version>
+            <!--            <version>${project.version}</version>-->
+        </dependency>
+    </dependencies>
+
+
+</project>

+ 73 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/QueryDTO.java

@@ -0,0 +1,73 @@
+package com.prolog.cs.base.gsp;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 养护查询对象
+ *
+ * @author tianhailong
+ */
+
+@Data
+@ApiModel
+public class QueryDTO extends QueryVO implements Serializable {
+
+    private static final long serialVersionUID = -4382080867353082291L;
+
+    @ApiModelProperty(value = "仓库ID")
+    private String warehouseId;
+
+    @ApiModelProperty(value = "货主ID")
+    private String cargoOwnerId;
+
+    @ApiModelProperty(value = "ID")
+    private String id;
+
+    @ApiModelProperty(value = "建筑物ID")
+    private String bldgId;
+
+    @ApiModelProperty(value = "商品ID")
+    private String itemId;
+
+    @ApiModelProperty(value = "商品大类")
+    private String itemHealthCategory;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "开始时间")
+    private Date startTime;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "结束时间")
+    private Date endTime;
+
+    @ApiModelProperty(value = "类型:0=未分类 1=重点特殊药品,2=重点专管药品,3=重点其他药品,4=重点医疗器械,5=重点非药品,6=一般药品,7=一般器械,8=一般非药品")
+    private String upkeepType;
+
+    private String type;
+
+    @ApiModelProperty(value = "养护类型:(0=一般 1=重点)")
+    private String isProtected;
+
+    @ApiModelProperty(value = "养护id")
+    private String planId;
+
+    @ApiModelProperty(value = "托盘号")
+    private String containerCode;
+
+    @ApiModelProperty(value = "商品条码")
+    private String itemBarcode;
+
+    @ApiModelProperty(value = "货位")
+    private String locatorCode;
+    @ApiModelProperty(value = "货位")
+    private String locatorId;
+
+    @ApiModelProperty(value = "批号")
+    private String lotNum;
+}

+ 32 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/QueryVO.java

@@ -0,0 +1,32 @@
+package com.prolog.cs.base.gsp;
+
+import com.prolog.framework.authority.core.dto.UserDTO;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class QueryVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    @ApiModelProperty(value = "仓库ID", hidden = true)
+    private String enterpriseId;
+    @ApiModelProperty(value = "当前页码")
+    private Integer pageNum;
+    @ApiModelProperty(value = "每页数量")
+    private Integer pageSize;
+
+    /**
+     * 初始化请求参数
+     */
+    public void initialPageWhenValueIsNull(UserDTO user) {
+        if (this.pageNum == null) {
+            this.pageNum = 1;
+        }
+        if (this.pageSize == null) {
+            this.pageSize = 10;
+        }
+        this.enterpriseId = user.getEnterpriseId();
+    }
+}

+ 30 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/constant/EisBusinessType.java

@@ -0,0 +1,30 @@
+package com.prolog.cs.base.gsp.constant;
+
+public interface EisBusinessType {
+
+
+    /**
+     * 正常出库
+     */
+    String BT_NORMAL = "10";
+    /**
+     * 移库(移出)出库
+     */
+    String BT_MOVE = "30";
+    /**
+     * 盘点出库
+     */
+    String BT_CHECK = "35";
+    /**
+     * 养护出库
+     */
+    String BT_UPKEEP = "40";
+    /**
+     * 补货出库
+     */
+    String BT_REPLENISH = "50";
+    /**
+     * 合托出库
+     */
+    String BT_COMBINED = "55";
+}

+ 21 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/constant/EisConstant.java

@@ -0,0 +1,21 @@
+package com.prolog.cs.base.gsp.constant;
+
+public interface EisConstant {
+    /**
+     * 未发送
+     */
+    Integer OUTBOUND_INSTRUCT_NO_SEND = 0;
+    /**
+     * 已发未达
+     */
+    Integer OUTBOUND_INSTRUCT_UN_DELIVERY = 1;
+    /**
+     * 已送到
+     */
+    Integer OUTBOUND_INSTRUCT_DELIVERY = 2;
+
+    /**
+     * eis大货位(与EIS约定)
+     */
+    String EIS_LOCATION = "ASRS01";
+}

+ 29 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/constant/EisWorkType.java

@@ -0,0 +1,29 @@
+package com.prolog.cs.base.gsp.constant;
+
+public interface EisWorkType {
+
+    /**
+     * 正常出库
+     */
+    String WT_NORMAL = "10";
+    /**
+     * 移库(移出)出库
+     */
+    String WT_MOVE = "20";
+    /**
+     * 盘点出库
+     */
+    String WT_CHECK = "30";
+    /**
+     * 养护出库
+     */
+    String WT_UPKEEP = "40";
+    /**
+     * 补货出库
+     */
+    String WT_REPLENISH = "50";
+    /**
+     * 合托出库
+     */
+    String WT_COMBINED = "55";
+}

+ 9 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/constant/MsgTemplate.java

@@ -0,0 +1,9 @@
+package com.prolog.cs.base.gsp.constant;
+
+public interface MsgTemplate {
+
+    String NO_RESPONSE = "请求无响应";
+    String IS_EMPTY = "没有数据";
+    String SUCCESS = "操作成功";
+    String DATA_OVERDUE = "数据已过期,请刷新页面";
+}

+ 20 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/constant/WhOperataConstant.java

@@ -0,0 +1,20 @@
+package com.prolog.cs.base.gsp.constant;
+
+/**
+ * 库内作业常量类
+ * 
+ * @author Xiong
+ *
+ */
+public class WhOperataConstant {
+
+	/**
+	 * 拣货方式(AGV设备)
+	 */
+	public final static String PICK_MODE_DEVICE = "Device";
+
+	/**
+	 * 拣货方式(纸单)
+	 */
+	public final static String PICK_MODE_PAPER = "Paper";
+}

+ 29 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/enums/GspQualityReviewAuditStatus.java

@@ -0,0 +1,29 @@
+package com.prolog.cs.base.gsp.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
+@Getter
+public enum GspQualityReviewAuditStatus {
+    /**
+     * 初始化,待审核
+     */
+    START("10"),
+
+    /**
+     *
+     * 合格 也是主表的已审核
+     */
+    WMS_AUDIT_YES("20"),
+    /**
+     * 不合格
+     */
+    WMS_AUDIT_NO("30"),
+    /**
+     * 待处理
+     */
+    REVIEW("40");
+
+    private String status;
+}

+ 40 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/enums/GspQualityReviewBillType.java

@@ -0,0 +1,40 @@
+package com.prolog.cs.base.gsp.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
+@Getter
+public enum GspQualityReviewBillType {
+    /**
+     * 入库单
+     */
+    INBOUND("1","入库单"),
+
+    /**
+     * 出库单
+     */
+    OUTBOUND("2","出库单"),
+    /**
+     * 养护计划
+     */
+    MAINTENANCE("3","养护计划"),
+    /**
+     * 库存
+     */
+    INVENTORY("4","库存");
+
+    private String code;
+    private String desc;
+
+    public static String getByCode(String code) {
+        for (GspQualityReviewBillType type : GspQualityReviewBillType.values()) {
+            if (type.getCode().equals(code)){
+                return type.getDesc();
+            }
+        }
+        return "";
+    }
+
+
+}

+ 35 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/enums/GspUnqualifiedStatus.java

@@ -0,0 +1,35 @@
+package com.prolog.cs.base.gsp.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
+@Getter
+public enum GspUnqualifiedStatus {
+    /**
+     * 初始化,待审核
+     */
+    START("0"),
+    /**
+     * ERP已审核通过
+     */
+    OUT_AUDIT_YES("10"),
+    /**
+     * ERP已审核驳回
+     */
+    OUT_AUDIT_NO("11"),
+    /**
+     * 审核通过
+     */
+    WMS_AUDIT_YES("20"),
+    /**
+     * 审核驳回
+     */
+    WMS_AUDIT_NO("30"),
+    /**
+     * 销毁申请
+     */
+    DESTROY("40");
+
+    private String status;
+}

+ 37 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/enums/StockStatusEnum.java

@@ -0,0 +1,37 @@
+package com.prolog.cs.base.gsp.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @author wujunjie
+ */
+
+@AllArgsConstructor
+@Getter
+public enum StockStatusEnum {
+    /**
+     * 合格
+     */
+    NULL("0", "未确定"),
+    /**
+     * 合格
+     */
+    QUALIFIED("1", "合格"),
+    /**
+     * 不合格
+     */
+    UNQUALIFIED("2", "不合格"),
+    /**
+     * 待检
+     */
+    WAITING_INSPECTION("3", "待检"),
+    /**
+     * 退货
+     */
+    REFUND("4", "退货");
+
+    private String code;
+
+    private String name;
+}

+ 16 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/enums/UpkeepTypeEnum.java

@@ -0,0 +1,16 @@
+package com.prolog.cs.base.gsp.enums;
+
+import lombok.Getter;
+
+@Getter
+public enum UpkeepTypeEnum {
+    UNCLASSIFIED(0, "未分类"), FOCU_SPECIAL_DRUG(1, "重点特殊药品"), FOCU_MANAGE_DRUG(2, "重点专管药品"), FOCU_OTHER_DRUG(3, "重点其他药品"), FOCU_MEDICA_DEVICE(4, "重点医疗器械"), FOCU_NON_DRUG(5, "重点非药品"), GENERAL_DRUG(6, "一般药品"), GENERAL_DEVICE(7, "一般器械"), GENERAL_NON_DRUG(8, "一般非药品");
+
+    private final int code;
+    private final String msg;
+
+    UpkeepTypeEnum(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+}

+ 900 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/DxiGspDestroyRequestRecord.java

@@ -0,0 +1,900 @@
+package com.prolog.cs.base.gsp.model;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.prolog.framework.core.annotation.AutoKey;
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Id;
+import com.prolog.framework.core.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+/**
+ * @Description  
+ * @Date 2021-06-30 
+ */
+
+@ApiModel
+@Table ( value ="dxi_gsp_destroy_request_record" )
+public class DxiGspDestroyRequestRecord  implements Serializable {
+	private static final long serialVersionUID =  8901831895581628025L;
+	
+	@Id
+	@ApiModelProperty(value = "对接单据行号") 
+	@Column(value = "lineid")
+	private String lineid;
+
+	@ApiModelProperty(value = "对接单据行号") 
+	@Column(value = "seqno")
+	private String seqno;
+
+	@ApiModelProperty(value = "单据ID") 
+	@Column(value = "billid")
+	private String billid;
+
+	@ApiModelProperty(value = "销毁单号") 
+	@Column(value = "billno")
+	private String billno;
+
+	@ApiModelProperty(value = "申请仓库ID") 
+	@Column(value = "branchid")
+	private String branchid;
+
+	@ApiModelProperty(value = "申请仓库编码") 
+	@Column(value = "branchcode")
+	private String branchcode;
+
+	@ApiModelProperty(value = "申请仓库名称") 
+	@Column(value = "branchname")
+	private String branchname;
+
+	@ApiModelProperty(value = "货主ID") 
+	@Column(value = "consignorid")
+	private String consignorid;
+
+	@ApiModelProperty(value = "货主编码") 
+	@Column(value = "consignorcode")
+	private String consignorcode;
+
+	@ApiModelProperty(value = "货主名称") 
+	@Column(value = "consignorname")
+	private String consignorname;
+
+	@ApiModelProperty(value = "单据来源类型") 
+	@Column(value = "ref_billtype")
+	private String refBilltype;
+
+	@ApiModelProperty(value = "销毁商品类别") 
+	@Column(value = "defects_item_type")
+	private String defectsItemType;
+
+	@ApiModelProperty(value = "商品ID") 
+	@Column(value = "itemid")
+	private String itemid;
+
+	@ApiModelProperty(value = "商品编码") 
+	@Column(value = "itemcode")
+	private String itemcode;
+
+	@ApiModelProperty(value = "商品名称") 
+	@Column(value = "itemname")
+	private String itemname;
+
+	@ApiModelProperty(value = "商品规格") 
+	@Column(value = "item_specs")
+	private String itemSpecs;
+
+	@ApiModelProperty(value = "生产厂家") 
+	@Column(value = "manufacturer")
+	private String manufacturer;
+
+	@ApiModelProperty(value = "父商品ID") 
+	@Column(value = "parernt_itemid")
+	private String parerntItemid;
+
+	@ApiModelProperty(value = "商品类别ID--商品大类表ID") 
+	@Column(value = "category_id")
+	private String categoryId;
+
+	@ApiModelProperty(value = "商品大类编码") 
+	@Column(value = "type_code")
+	private String typeCode;
+
+	@ApiModelProperty(value = "商品大类名称") 
+	@Column(value = "type_name")
+	private String typeName;
+
+	@ApiModelProperty(value = "批号") 
+	@Column(value = "lot_no")
+	private String lotNo;
+
+	@ApiModelProperty(value = "批次号") 
+	@Column(value = "batch_no")
+	private String batchNo;
+
+	@ApiModelProperty(value = "生产日期") 
+	@Column(value = "pdate_from")
+	private Date pdateFrom;
+
+	@ApiModelProperty(value = "有效期至") 
+	@Column(value = "valid_until")
+	private Date validUntil;
+
+	@ApiModelProperty(value = "备案凭证号") 
+	@Column(value = "paper_no")
+	private String paperNo;
+
+	@ApiModelProperty(value = "批准文号") 
+	@Column(value = "approval_number")
+	private String approvalNumber;
+
+	@ApiModelProperty(value = "产地") 
+	@Column(value = "production_place")
+	private String productionPlace;
+
+	@ApiModelProperty(value = "商品条码") 
+	@Column(value = "barcode")
+	private String barcode;
+
+	@ApiModelProperty(value = "包装数量") 
+	@Column(value = "pack_size")
+	private String packSize;
+
+	@ApiModelProperty(value = "包装单位") 
+	@Column(value = "pack_units")
+	private String packUnits;
+
+	@ApiModelProperty(value = "不合格原因") 
+	@Column(value = "defects_reason")
+	private String defectsReason;
+
+	@ApiModelProperty(value = "销毁数量") 
+	@Column(value = "destroy_qty")
+	private String destroyQty;
+
+	@ApiModelProperty(value = "销毁原因") 
+	@Column(value = "destroy_reason")
+	private String destroyReason;
+
+	@ApiModelProperty(value = "销毁地点") 
+	@Column(value = "destroy_site")
+	private String destroySite;
+
+	@ApiModelProperty(value = "销毁方式") 
+	@Column(value = "destroy_mode")
+	private String destroyMode;
+
+	@ApiModelProperty(value = "运输工具") 
+	@Column(value = "transport_facility")
+	private String transportFacility;
+
+	@ApiModelProperty(value = "运输人员") 
+	@Column(value = "transport_person")
+	private String transportPerson;
+
+	@ApiModelProperty(value = "销毁后现场情况") 
+	@Column(value = "destroy_site_cond")
+	private String destroySiteCond;
+
+	@ApiModelProperty(value = "销毁执行人") 
+	@Column(value = "destroy_executor")
+	private String destroyExecutor;
+
+	@ApiModelProperty(value = "销毁监督人") 
+	@Column(value = "destroy_supervisor")
+	private String destroySupervisor;
+
+	@ApiModelProperty(value = "监管部门人员") 
+	@Column(value = "dapartment_staff")
+	private String dapartmentStaff;
+
+	@ApiModelProperty(value = "发起申请日期") 
+	@Column(value = "bill_date")
+	private Date billDate;
+
+	@ApiModelProperty(value = "状态") 
+	@Column(value = "status")
+	private String status;
+
+	@ApiModelProperty(value = "备注") 
+	@Column(value = "remark")
+	private String remark;
+
+	@ApiModelProperty(value = "作废原因") 
+	@Column(value = "closed_reason")
+	private String closedReason;
+
+	@ApiModelProperty(value = "字符扩展属性1") 
+	@Column(value = "attr_str1")
+	private String attrStr1;
+
+	@ApiModelProperty(value = "字符扩展属性2") 
+	@Column(value = "attr_str2")
+	private String attrStr2;
+
+	@ApiModelProperty(value = "字符扩展属性3") 
+	@Column(value = "attr_str3")
+	private String attrStr3;
+
+	@ApiModelProperty(value = "字符扩展属性4") 
+	@Column(value = "attr_str4")
+	private String attrStr4;
+
+	@ApiModelProperty(value = "字符扩展属性5") 
+	@Column(value = "attr_str5")
+	private String attrStr5;
+
+	@ApiModelProperty(value = "字符扩展属性6") 
+	@Column(value = "attr_str6")
+	private String attrStr6;
+
+	@ApiModelProperty(value = "字符扩展属性7") 
+	@Column(value = "attr_str7")
+	private String attrStr7;
+
+	@ApiModelProperty(value = "字符扩展属性8") 
+	@Column(value = "attr_str8")
+	private String attrStr8;
+
+	@ApiModelProperty(value = "字符扩展属性9") 
+	@Column(value = "attr_str9")
+	private String attrStr9;
+
+	@ApiModelProperty(value = "字符扩展属性10") 
+	@Column(value = "attr_str10")
+	private String attrStr10;
+
+	@ApiModelProperty(value = "数字扩展属性1") 
+	@Column(value = "attr_num1")
+	private String attrNum1;
+
+	@ApiModelProperty(value = "数字扩展属性2") 
+	@Column(value = "attr_num2")
+	private String attrNum2;
+
+	@ApiModelProperty(value = "数字扩展属性3") 
+	@Column(value = "attr_num3")
+	private String attrNum3;
+
+	@ApiModelProperty(value = "数字扩展属性4") 
+	@Column(value = "attr_num4")
+	private String attrNum4;
+
+	@ApiModelProperty(value = "数字扩展属性5") 
+	@Column(value = "attr_num5")
+	private String attrNum5;
+
+	@ApiModelProperty(value = "日期属性扩展1") 
+	@Column(value = "attr_dte1")
+	private Date attrDte1;
+
+	@ApiModelProperty(value = "日期属性扩展2") 
+	@Column(value = "attr_dte2")
+	private Date attrDte2;
+
+	@ApiModelProperty(value = "日期属性扩展3") 
+	@Column(value = "attr_dte3")
+	private Date attrDte3;
+
+	@ApiModelProperty(value = "日期属性扩展4") 
+	@Column(value = "attr_dte4")
+	private Date attrDte4;
+
+	@ApiModelProperty(value = "日期属性扩展5") 
+	@Column(value = "attr_dte5")
+	private Date attrDte5;
+
+	@ApiModelProperty(value = "录入员") 
+	@Column(value = "createby")
+	private String createby;
+
+	@ApiModelProperty(value = "录入时间") 
+	@Column(value = "createdate")
+	private Date createdate;
+
+	@ApiModelProperty(value = "修改人") 
+	@Column(value = "lastmodifyby")
+	private String lastmodifyby;
+
+	@ApiModelProperty(value = "修改时间") 
+	@Column(value = "lastmodifydate")
+	private Date lastmodifydate;
+
+	@ApiModelProperty(value = "企业ID") 
+	@Column(value = "p_enterpriseid")
+	private String enterpriseid;
+
+	@ApiModelProperty(value = "企业名称") 
+	@Column(value = "p_enterprisename")
+	private String enterprisename;
+
+//	@ApiModelProperty(value = "业务时间")
+//	@Column(value = "BILLDATE")
+//	private Date billdate;
+//
+//	public Date getBilldate() {
+//		return billdate;
+//	}
+//
+//	public void setBilldate(Date billdate) {
+//		this.billdate = billdate;
+//	}
+	
+	public String getLineid() {
+		return this.lineid;
+	}
+
+	public void setLineid(String lineid) {
+		this.lineid = lineid;
+	}
+
+	public String getSeqno() {
+		return this.seqno;
+	}
+
+	public void setSeqno(String seqno) {
+		this.seqno = seqno;
+	}
+
+	public String getBillid() {
+		return this.billid;
+	}
+
+	public void setBillid(String billid) {
+		this.billid = billid;
+	}
+
+	public String getBillno() {
+		return this.billno;
+	}
+
+	public void setBillno(String billno) {
+		this.billno = billno;
+	}
+
+	public String getBranchid() {
+		return this.branchid;
+	}
+
+	public void setBranchid(String branchid) {
+		this.branchid = branchid;
+	}
+
+	public String getBranchcode() {
+		return this.branchcode;
+	}
+
+	public void setBranchcode(String branchcode) {
+		this.branchcode = branchcode;
+	}
+
+	public String getBranchname() {
+		return this.branchname;
+	}
+
+	public void setBranchname(String branchname) {
+		this.branchname = branchname;
+	}
+
+	public String getConsignorid() {
+		return this.consignorid;
+	}
+
+	public void setConsignorid(String consignorid) {
+		this.consignorid = consignorid;
+	}
+
+	public String getConsignorcode() {
+		return this.consignorcode;
+	}
+
+	public void setConsignorcode(String consignorcode) {
+		this.consignorcode = consignorcode;
+	}
+
+	public String getConsignorname() {
+		return this.consignorname;
+	}
+
+	public void setConsignorname(String consignorname) {
+		this.consignorname = consignorname;
+	}
+
+	public String getRefBilltype() {
+		return this.refBilltype;
+	}
+
+	public void setRefBilltype(String refBilltype) {
+		this.refBilltype = refBilltype;
+	}
+
+	public String getDefectsItemType() {
+		return this.defectsItemType;
+	}
+
+	public void setDefectsItemType(String defectsItemType) {
+		this.defectsItemType = defectsItemType;
+	}
+
+	public String getItemid() {
+		return this.itemid;
+	}
+
+	public void setItemid(String itemid) {
+		this.itemid = itemid;
+	}
+
+	public String getItemcode() {
+		return this.itemcode;
+	}
+
+	public void setItemcode(String itemcode) {
+		this.itemcode = itemcode;
+	}
+
+	public String getItemname() {
+		return this.itemname;
+	}
+
+	public void setItemname(String itemname) {
+		this.itemname = itemname;
+	}
+
+	public String getItemSpecs() {
+		return this.itemSpecs;
+	}
+
+	public void setItemSpecs(String itemSpecs) {
+		this.itemSpecs = itemSpecs;
+	}
+
+	public String getManufacturer() {
+		return this.manufacturer;
+	}
+
+	public void setManufacturer(String manufacturer) {
+		this.manufacturer = manufacturer;
+	}
+
+	public String getParerntItemid() {
+		return this.parerntItemid;
+	}
+
+	public void setParerntItemid(String parerntItemid) {
+		this.parerntItemid = parerntItemid;
+	}
+
+	public String getCategoryId() {
+		return this.categoryId;
+	}
+
+	public void setCategoryId(String categoryId) {
+		this.categoryId = categoryId;
+	}
+
+	public String getTypeCode() {
+		return this.typeCode;
+	}
+
+	public void setTypeCode(String typeCode) {
+		this.typeCode = typeCode;
+	}
+
+	public String getTypeName() {
+		return this.typeName;
+	}
+
+	public void setTypeName(String typeName) {
+		this.typeName = typeName;
+	}
+
+	public String getLotNo() {
+		return this.lotNo;
+	}
+
+	public void setLotNo(String lotNo) {
+		this.lotNo = lotNo;
+	}
+
+	public String getBatchNo() {
+		return this.batchNo;
+	}
+
+	public void setBatchNo(String batchNo) {
+		this.batchNo = batchNo;
+	}
+
+	public Date getPdateFrom() {
+		return this.pdateFrom;
+	}
+
+	public void setPdateFrom(Date pdateFrom) {
+		this.pdateFrom = pdateFrom;
+	}
+
+	public Date getValidUntil() {
+		return this.validUntil;
+	}
+
+	public void setValidUntil(Date validUntil) {
+		this.validUntil = validUntil;
+	}
+
+	public String getPaperNo() {
+		return this.paperNo;
+	}
+
+	public void setPaperNo(String paperNo) {
+		this.paperNo = paperNo;
+	}
+
+	public String getApprovalNumber() {
+		return this.approvalNumber;
+	}
+
+	public void setApprovalNumber(String approvalNumber) {
+		this.approvalNumber = approvalNumber;
+	}
+
+	public String getProductionPlace() {
+		return this.productionPlace;
+	}
+
+	public void setProductionPlace(String productionPlace) {
+		this.productionPlace = productionPlace;
+	}
+
+	public String getBarcode() {
+		return this.barcode;
+	}
+
+	public void setBarcode(String barcode) {
+		this.barcode = barcode;
+	}
+
+	public String getPackSize() {
+		return this.packSize;
+	}
+
+	public void setPackSize(String packSize) {
+		this.packSize = packSize;
+	}
+
+	public String getPackUnits() {
+		return this.packUnits;
+	}
+
+	public void setPackUnits(String packUnits) {
+		this.packUnits = packUnits;
+	}
+
+	public String getDefectsReason() {
+		return this.defectsReason;
+	}
+
+	public void setDefectsReason(String defectsReason) {
+		this.defectsReason = defectsReason;
+	}
+
+	public String getDestroyQty() {
+		return this.destroyQty;
+	}
+
+	public void setDestroyQty(String destroyQty) {
+		this.destroyQty = destroyQty;
+	}
+
+	public String getDestroyReason() {
+		return this.destroyReason;
+	}
+
+	public void setDestroyReason(String destroyReason) {
+		this.destroyReason = destroyReason;
+	}
+
+	public String getDestroySite() {
+		return this.destroySite;
+	}
+
+	public void setDestroySite(String destroySite) {
+		this.destroySite = destroySite;
+	}
+
+	public String getDestroyMode() {
+		return this.destroyMode;
+	}
+
+	public void setDestroyMode(String destroyMode) {
+		this.destroyMode = destroyMode;
+	}
+
+	public String getTransportFacility() {
+		return this.transportFacility;
+	}
+
+	public void setTransportFacility(String transportFacility) {
+		this.transportFacility = transportFacility;
+	}
+
+	public String getTransportPerson() {
+		return this.transportPerson;
+	}
+
+	public void setTransportPerson(String transportPerson) {
+		this.transportPerson = transportPerson;
+	}
+
+	public String getDestroySiteCond() {
+		return this.destroySiteCond;
+	}
+
+	public void setDestroySiteCond(String destroySiteCond) {
+		this.destroySiteCond = destroySiteCond;
+	}
+
+	public String getDestroyExecutor() {
+		return this.destroyExecutor;
+	}
+
+	public void setDestroyExecutor(String destroyExecutor) {
+		this.destroyExecutor = destroyExecutor;
+	}
+
+	public String getDestroySupervisor() {
+		return this.destroySupervisor;
+	}
+
+	public void setDestroySupervisor(String destroySupervisor) {
+		this.destroySupervisor = destroySupervisor;
+	}
+
+	public String getDapartmentStaff() {
+		return this.dapartmentStaff;
+	}
+
+	public void setDapartmentStaff(String dapartmentStaff) {
+		this.dapartmentStaff = dapartmentStaff;
+	}
+
+	public Date getBillDate() {
+		return this.billDate;
+	}
+
+	public void setBillDate(Date billDate) {
+		this.billDate = billDate;
+	}
+
+	public String getStatus() {
+		return this.status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getRemark() {
+		return this.remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public String getClosedReason() {
+		return this.closedReason;
+	}
+
+	public void setClosedReason(String closedReason) {
+		this.closedReason = closedReason;
+	}
+
+	public String getAttrStr1() {
+		return this.attrStr1;
+	}
+
+	public void setAttrStr1(String attrStr1) {
+		this.attrStr1 = attrStr1;
+	}
+
+	public String getAttrStr2() {
+		return this.attrStr2;
+	}
+
+	public void setAttrStr2(String attrStr2) {
+		this.attrStr2 = attrStr2;
+	}
+
+	public String getAttrStr3() {
+		return this.attrStr3;
+	}
+
+	public void setAttrStr3(String attrStr3) {
+		this.attrStr3 = attrStr3;
+	}
+
+	public String getAttrStr4() {
+		return this.attrStr4;
+	}
+
+	public void setAttrStr4(String attrStr4) {
+		this.attrStr4 = attrStr4;
+	}
+
+	public String getAttrStr5() {
+		return this.attrStr5;
+	}
+
+	public void setAttrStr5(String attrStr5) {
+		this.attrStr5 = attrStr5;
+	}
+
+	public String getAttrStr6() {
+		return this.attrStr6;
+	}
+
+	public void setAttrStr6(String attrStr6) {
+		this.attrStr6 = attrStr6;
+	}
+
+	public String getAttrStr7() {
+		return this.attrStr7;
+	}
+
+	public void setAttrStr7(String attrStr7) {
+		this.attrStr7 = attrStr7;
+	}
+
+	public String getAttrStr8() {
+		return this.attrStr8;
+	}
+
+	public void setAttrStr8(String attrStr8) {
+		this.attrStr8 = attrStr8;
+	}
+
+	public String getAttrStr9() {
+		return this.attrStr9;
+	}
+
+	public void setAttrStr9(String attrStr9) {
+		this.attrStr9 = attrStr9;
+	}
+
+	public String getAttrStr10() {
+		return this.attrStr10;
+	}
+
+	public void setAttrStr10(String attrStr10) {
+		this.attrStr10 = attrStr10;
+	}
+
+	public String getAttrNum1() {
+		return this.attrNum1;
+	}
+
+	public void setAttrNum1(String attrNum1) {
+		this.attrNum1 = attrNum1;
+	}
+
+	public String getAttrNum2() {
+		return this.attrNum2;
+	}
+
+	public void setAttrNum2(String attrNum2) {
+		this.attrNum2 = attrNum2;
+	}
+
+	public String getAttrNum3() {
+		return this.attrNum3;
+	}
+
+	public void setAttrNum3(String attrNum3) {
+		this.attrNum3 = attrNum3;
+	}
+
+	public String getAttrNum4() {
+		return this.attrNum4;
+	}
+
+	public void setAttrNum4(String attrNum4) {
+		this.attrNum4 = attrNum4;
+	}
+
+	public String getAttrNum5() {
+		return this.attrNum5;
+	}
+
+	public void setAttrNum5(String attrNum5) {
+		this.attrNum5 = attrNum5;
+	}
+
+	public Date getAttrDte1() {
+		return this.attrDte1;
+	}
+
+	public void setAttrDte1(Date attrDte1) {
+		this.attrDte1 = attrDte1;
+	}
+
+	public Date getAttrDte2() {
+		return this.attrDte2;
+	}
+
+	public void setAttrDte2(Date attrDte2) {
+		this.attrDte2 = attrDte2;
+	}
+
+	public Date getAttrDte3() {
+		return this.attrDte3;
+	}
+
+	public void setAttrDte3(Date attrDte3) {
+		this.attrDte3 = attrDte3;
+	}
+
+	public Date getAttrDte4() {
+		return this.attrDte4;
+	}
+
+	public void setAttrDte4(Date attrDte4) {
+		this.attrDte4 = attrDte4;
+	}
+
+	public Date getAttrDte5() {
+		return this.attrDte5;
+	}
+
+	public void setAttrDte5(Date attrDte5) {
+		this.attrDte5 = attrDte5;
+	}
+
+	public String getCreateby() {
+		return this.createby;
+	}
+
+	public void setCreateby(String createby) {
+		this.createby = createby;
+	}
+
+	public Date getCreatedate() {
+		return this.createdate;
+	}
+
+	public void setCreatedate(Date createdate) {
+		this.createdate = createdate;
+	}
+
+	public String getLastmodifyby() {
+		return this.lastmodifyby;
+	}
+
+	public void setLastmodifyby(String lastmodifyby) {
+		this.lastmodifyby = lastmodifyby;
+	}
+
+	public Date getLastmodifydate() {
+		return this.lastmodifydate;
+	}
+
+	public void setLastmodifydate(Date lastmodifydate) {
+		this.lastmodifydate = lastmodifydate;
+	}
+
+	public String getEnterpriseid() {
+		return this.enterpriseid;
+	}
+
+	public void setEnterpriseid(String enterpriseid) {
+		this.enterpriseid = enterpriseid;
+	}
+
+	public String getEnterprisename() {
+		return this.enterprisename;
+	}
+
+	public void setEnterprisename(String enterprisename) {
+		this.enterprisename = enterprisename;
+	}
+
+}

+ 698 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/DxiGspGainslossesBillRec.java

@@ -0,0 +1,698 @@
+package com.prolog.cs.base.gsp.model;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.prolog.framework.core.annotation.AutoKey;
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Id;
+import com.prolog.framework.core.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+/**
+ * @Description  
+ * @Date 2021-06-30 
+ */
+
+@ApiModel
+@Table ( value ="dxi_gsp_gainslosses_bill_rec" )
+public class DxiGspGainslossesBillRec implements Serializable {
+	private static final long serialVersionUID =  9168884070091461486L;
+
+	@Id
+	// 删除自增注释,避免自动生成行号
+	// @AutoKey(type=AutoKey.TYPE_SNOWFLAKE)
+	@ApiModelProperty(value = "对接单据行号") 
+	@Column(value = "lineid")
+	private String lineid;
+
+	@ApiModelProperty(value = "对接单据行号") 
+	@Column(value = "seqno")
+	private String seqno;
+
+	@ApiModelProperty(value = "单据ID") 
+	@Column(value = "billid")
+	private String billid;
+
+	@ApiModelProperty(value = "单据编号") 
+	@Column(value = "billno")
+	private String billno;
+
+	@ApiModelProperty(value = "单据类型") 
+	@Column(value = "type")
+	private String type;
+
+	@ApiModelProperty(value = "状态") 
+	@Column(value = "status")
+	private String status;
+
+	@ApiModelProperty(value = "货主ID") 
+	@Column(value = "consignorid")
+	private String consignorid;
+
+	@ApiModelProperty(value = "货主编码") 
+	@Column(value = "consignorcode")
+	private String consignorcode;
+
+	@ApiModelProperty(value = "货主名称") 
+	@Column(value = "consignorname")
+	private String consignorname;
+
+	@ApiModelProperty(value = "仓库ID") 
+	@Column(value = "branchid")
+	private String branchid;
+
+	@ApiModelProperty(value = "仓库编码") 
+	@Column(value = "branchcode")
+	private String branchcode;
+
+	@ApiModelProperty(value = "仓库名称") 
+	@Column(value = "branchname")
+	private String branchname;
+
+	@ApiModelProperty(value = "商品ID") 
+	@Column(value = "itemid")
+	private String itemid;
+
+	@ApiModelProperty(value = "商品名称") 
+	@Column(value = "itemname")
+	private String itemname;
+
+	@ApiModelProperty(value = "商品编码") 
+	@Column(value = "itemcode")
+	private String itemcode;
+
+	@ApiModelProperty(value = "单价") 
+	@Column(value = "price")
+	private String price;
+
+	@ApiModelProperty(value = "数量") 
+	@Column(value = "amount")
+	private String amount;
+
+	@ApiModelProperty(value = "包装数量") 
+	@Column(value = "pack_amount")
+	private String packAmount;
+
+	@ApiModelProperty(value = "包装单位") 
+	@Column(value = "pack_unit")
+	private String packUnit;
+
+	@ApiModelProperty(value = "总金额") 
+	@Column(value = "total_price")
+	private String totalPrice;
+
+	@ApiModelProperty(value = "规格") 
+	@Column(value = "spec")
+	private String spec;
+
+	@ApiModelProperty(value = "产地") 
+	@Column(value = "place")
+	private String place;
+
+	@ApiModelProperty(value = "生产企业") 
+	@Column(value = "manufacturer")
+	private String manufacturer;
+
+	@ApiModelProperty(value = "批号") 
+	@Column(value = "batch_num")
+	private String batchNum;
+
+	@ApiModelProperty(value = "生产日期") 
+	@Column(value = "production_date")
+	private Date productionDate;
+
+	@ApiModelProperty(value = "有效期至") 
+	@Column(value = "expired_date")
+	private Date expiredDate;
+
+	@ApiModelProperty(value = "批准文号") 
+	@Column(value = "approval_number")
+	private String approvalNumber;
+
+	@ApiModelProperty(value = "原因") 
+	@Column(value = "reason")
+	private String reason;
+
+	@ApiModelProperty(value = "数据来源") 
+	@Column(value = "ref_billtype")
+	private String refBilltype;
+
+	@ApiModelProperty(value = "扩展字段1") 
+	@Column(value = "attr_str1")
+	private String attrStr1;
+
+	@ApiModelProperty(value = "扩展字段2") 
+	@Column(value = "attr_str2")
+	private String attrStr2;
+
+	@ApiModelProperty(value = "扩展字段3") 
+	@Column(value = "attr_str3")
+	private String attrStr3;
+
+	@ApiModelProperty(value = "扩展字段4") 
+	@Column(value = "attr_str4")
+	private String attrStr4;
+
+	@ApiModelProperty(value = "扩展字段5") 
+	@Column(value = "attr_str5")
+	private String attrStr5;
+
+	@ApiModelProperty(value = "扩展字段6") 
+	@Column(value = "attr_str6")
+	private String attrStr6;
+
+	@ApiModelProperty(value = "扩展字段7") 
+	@Column(value = "attr_str7")
+	private String attrStr7;
+
+	@ApiModelProperty(value = "扩展字段8") 
+	@Column(value = "attr_str8")
+	private String attrStr8;
+
+	@ApiModelProperty(value = "扩展字段9") 
+	@Column(value = "attr_str9")
+	private String attrStr9;
+
+	@ApiModelProperty(value = "扩展字段10") 
+	@Column(value = "attr_str10")
+	private String attrStr10;
+
+	@ApiModelProperty(value = "扩展字段11") 
+	@Column(value = "attr_num1")
+	private String attrNum1;
+
+	@ApiModelProperty(value = "扩展字段12") 
+	@Column(value = "attr_num2")
+	private String attrNum2;
+
+	@ApiModelProperty(value = "扩展字段13") 
+	@Column(value = "attr_num3")
+	private String attrNum3;
+
+	@ApiModelProperty(value = "扩展字段14") 
+	@Column(value = "attr_num4")
+	private String attrNum4;
+
+	@ApiModelProperty(value = "扩展字段15") 
+	@Column(value = "attr_num5")
+	private String attrNum5;
+
+	@ApiModelProperty(value = "扩展字段16") 
+	@Column(value = "attr_dte1")
+	private Date attrDte1;
+
+	@ApiModelProperty(value = "扩展字段17") 
+	@Column(value = "attr_dte2")
+	private Date attrDte2;
+
+	@ApiModelProperty(value = "扩展字段18") 
+	@Column(value = "attr_dte3")
+	private Date attrDte3;
+
+	@ApiModelProperty(value = "扩展字段19") 
+	@Column(value = "attr_dte4")
+	private Date attrDte4;
+
+	@ApiModelProperty(value = "扩展字段20") 
+	@Column(value = "attr_dte5")
+	private Date attrDte5;
+
+	@ApiModelProperty(value = "创建时间") 
+	@Column(value = "createdate")
+	private Date createdate;
+
+	@ApiModelProperty(value = "创建人") 
+	@Column(value = "createby")
+	private String createby;
+
+	@ApiModelProperty(value = "修改时间") 
+	@Column(value = "lastmodifydate")
+	private Date lastmodifydate;
+
+	@ApiModelProperty(value = "修改人") 
+	@Column(value = "lastmodifyby")
+	private String lastmodifyby;
+
+	@ApiModelProperty(value = "企业ID") 
+	@Column(value = "p_enterpriseid")
+	private String enterpriseid;
+
+	@ApiModelProperty(value = "企业名称") 
+	@Column(value = "p_enterprisename")
+	private String enterprisename;
+	
+	@ApiModelProperty(value = "业务时间") 
+	@Column(value = "BILLDATE")
+	private Date billdate;
+
+	public Date getBilldate() {
+		return billdate;
+	}
+
+	public void setBilldate(Date billdate) {
+		this.billdate = billdate;
+	}
+
+	public String getLineid() {
+		return this.lineid;
+	}
+
+	public void setLineid(String lineid) {
+		this.lineid = lineid;
+	}
+
+	public String getSeqno() {
+		return this.seqno;
+	}
+
+	public void setSeqno(String seqno) {
+		this.seqno = seqno;
+	}
+
+	public String getBillid() {
+		return this.billid;
+	}
+
+	public void setBillid(String billid) {
+		this.billid = billid;
+	}
+
+	public String getBillno() {
+		return this.billno;
+	}
+
+	public void setBillno(String billno) {
+		this.billno = billno;
+	}
+
+	public String getType() {
+		return this.type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
+	public String getStatus() {
+		return this.status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getConsignorid() {
+		return this.consignorid;
+	}
+
+	public void setConsignorid(String consignorid) {
+		this.consignorid = consignorid;
+	}
+
+	public String getConsignorcode() {
+		return this.consignorcode;
+	}
+
+	public void setConsignorcode(String consignorcode) {
+		this.consignorcode = consignorcode;
+	}
+
+	public String getConsignorname() {
+		return this.consignorname;
+	}
+
+	public void setConsignorname(String consignorname) {
+		this.consignorname = consignorname;
+	}
+
+	public String getBranchid() {
+		return this.branchid;
+	}
+
+	public void setBranchid(String branchid) {
+		this.branchid = branchid;
+	}
+
+	public String getBranchcode() {
+		return this.branchcode;
+	}
+
+	public void setBranchcode(String branchcode) {
+		this.branchcode = branchcode;
+	}
+
+	public String getBranchname() {
+		return this.branchname;
+	}
+
+	public void setBranchname(String branchname) {
+		this.branchname = branchname;
+	}
+
+	public String getItemid() {
+		return this.itemid;
+	}
+
+	public void setItemid(String itemid) {
+		this.itemid = itemid;
+	}
+
+	public String getItemname() {
+		return this.itemname;
+	}
+
+	public void setItemname(String itemname) {
+		this.itemname = itemname;
+	}
+
+	public String getItemcode() {
+		return this.itemcode;
+	}
+
+	public void setItemcode(String itemcode) {
+		this.itemcode = itemcode;
+	}
+
+	public String getPrice() {
+		return this.price;
+	}
+
+	public void setPrice(String price) {
+		this.price = price;
+	}
+
+	public String getAmount() {
+		return this.amount;
+	}
+
+	public void setAmount(String amount) {
+		this.amount = amount;
+	}
+
+	public String getPackAmount() {
+		return this.packAmount;
+	}
+
+	public void setPackAmount(String packAmount) {
+		this.packAmount = packAmount;
+	}
+
+	public String getPackUnit() {
+		return this.packUnit;
+	}
+
+	public void setPackUnit(String packUnit) {
+		this.packUnit = packUnit;
+	}
+
+	public String getTotalPrice() {
+		return this.totalPrice;
+	}
+
+	public void setTotalPrice(String totalPrice) {
+		this.totalPrice = totalPrice;
+	}
+
+	public String getSpec() {
+		return this.spec;
+	}
+
+	public void setSpec(String spec) {
+		this.spec = spec;
+	}
+
+	public String getPlace() {
+		return this.place;
+	}
+
+	public void setPlace(String place) {
+		this.place = place;
+	}
+
+	public String getManufacturer() {
+		return this.manufacturer;
+	}
+
+	public void setManufacturer(String manufacturer) {
+		this.manufacturer = manufacturer;
+	}
+
+	public String getBatchNum() {
+		return this.batchNum;
+	}
+
+	public void setBatchNum(String batchNum) {
+		this.batchNum = batchNum;
+	}
+
+	public Date getProductionDate() {
+		return this.productionDate;
+	}
+
+	public void setProductionDate(Date productionDate) {
+		this.productionDate = productionDate;
+	}
+
+	public Date getExpiredDate() {
+		return this.expiredDate;
+	}
+
+	public void setExpiredDate(Date expiredDate) {
+		this.expiredDate = expiredDate;
+	}
+
+	public String getApprovalNumber() {
+		return this.approvalNumber;
+	}
+
+	public void setApprovalNumber(String approvalNumber) {
+		this.approvalNumber = approvalNumber;
+	}
+
+	public String getReason() {
+		return this.reason;
+	}
+
+	public void setReason(String reason) {
+		this.reason = reason;
+	}
+
+	public String getRefBilltype() {
+		return this.refBilltype;
+	}
+
+	public void setRefBilltype(String refBilltype) {
+		this.refBilltype = refBilltype;
+	}
+
+	public String getAttrStr1() {
+		return this.attrStr1;
+	}
+
+	public void setAttrStr1(String attrStr1) {
+		this.attrStr1 = attrStr1;
+	}
+
+	public String getAttrStr2() {
+		return this.attrStr2;
+	}
+
+	public void setAttrStr2(String attrStr2) {
+		this.attrStr2 = attrStr2;
+	}
+
+	public String getAttrStr3() {
+		return this.attrStr3;
+	}
+
+	public void setAttrStr3(String attrStr3) {
+		this.attrStr3 = attrStr3;
+	}
+
+	public String getAttrStr4() {
+		return this.attrStr4;
+	}
+
+	public void setAttrStr4(String attrStr4) {
+		this.attrStr4 = attrStr4;
+	}
+
+	public String getAttrStr5() {
+		return this.attrStr5;
+	}
+
+	public void setAttrStr5(String attrStr5) {
+		this.attrStr5 = attrStr5;
+	}
+
+	public String getAttrStr6() {
+		return this.attrStr6;
+	}
+
+	public void setAttrStr6(String attrStr6) {
+		this.attrStr6 = attrStr6;
+	}
+
+	public String getAttrStr7() {
+		return this.attrStr7;
+	}
+
+	public void setAttrStr7(String attrStr7) {
+		this.attrStr7 = attrStr7;
+	}
+
+	public String getAttrStr8() {
+		return this.attrStr8;
+	}
+
+	public void setAttrStr8(String attrStr8) {
+		this.attrStr8 = attrStr8;
+	}
+
+	public String getAttrStr9() {
+		return this.attrStr9;
+	}
+
+	public void setAttrStr9(String attrStr9) {
+		this.attrStr9 = attrStr9;
+	}
+
+	public String getAttrStr10() {
+		return this.attrStr10;
+	}
+
+	public void setAttrStr10(String attrStr10) {
+		this.attrStr10 = attrStr10;
+	}
+
+	public String getAttrNum1() {
+		return this.attrNum1;
+	}
+
+	public void setAttrNum1(String attrNum1) {
+		this.attrNum1 = attrNum1;
+	}
+
+	public String getAttrNum2() {
+		return this.attrNum2;
+	}
+
+	public void setAttrNum2(String attrNum2) {
+		this.attrNum2 = attrNum2;
+	}
+
+	public String getAttrNum3() {
+		return this.attrNum3;
+	}
+
+	public void setAttrNum3(String attrNum3) {
+		this.attrNum3 = attrNum3;
+	}
+
+	public String getAttrNum4() {
+		return this.attrNum4;
+	}
+
+	public void setAttrNum4(String attrNum4) {
+		this.attrNum4 = attrNum4;
+	}
+
+	public String getAttrNum5() {
+		return this.attrNum5;
+	}
+
+	public void setAttrNum5(String attrNum5) {
+		this.attrNum5 = attrNum5;
+	}
+
+	public Date getAttrDte1() {
+		return this.attrDte1;
+	}
+
+	public void setAttrDte1(Date attrDte1) {
+		this.attrDte1 = attrDte1;
+	}
+
+	public Date getAttrDte2() {
+		return this.attrDte2;
+	}
+
+	public void setAttrDte2(Date attrDte2) {
+		this.attrDte2 = attrDte2;
+	}
+
+	public Date getAttrDte3() {
+		return this.attrDte3;
+	}
+
+	public void setAttrDte3(Date attrDte3) {
+		this.attrDte3 = attrDte3;
+	}
+
+	public Date getAttrDte4() {
+		return this.attrDte4;
+	}
+
+	public void setAttrDte4(Date attrDte4) {
+		this.attrDte4 = attrDte4;
+	}
+
+	public Date getAttrDte5() {
+		return this.attrDte5;
+	}
+
+	public void setAttrDte5(Date attrDte5) {
+		this.attrDte5 = attrDte5;
+	}
+
+	public Date getCreatedate() {
+		return this.createdate;
+	}
+
+	public void setCreatedate(Date createdate) {
+		this.createdate = createdate;
+	}
+
+	public String getCreateby() {
+		return this.createby;
+	}
+
+	public void setCreateby(String createby) {
+		this.createby = createby;
+	}
+
+	public Date getLastmodifydate() {
+		return this.lastmodifydate;
+	}
+
+	public void setLastmodifydate(Date lastmodifydate) {
+		this.lastmodifydate = lastmodifydate;
+	}
+
+	public String getLastmodifyby() {
+		return this.lastmodifyby;
+	}
+
+	public void setLastmodifyby(String lastmodifyby) {
+		this.lastmodifyby = lastmodifyby;
+	}
+
+	public String getEnterpriseid() {
+		return this.enterpriseid;
+	}
+
+	public void setEnterpriseid(String enterpriseid) {
+		this.enterpriseid = enterpriseid;
+	}
+
+	public String getEnterprisename() {
+		return this.enterprisename;
+	}
+
+	public void setEnterprisename(String enterprisename) {
+		this.enterprisename = enterprisename;
+	}
+
+}

+ 660 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/DxiGspMaintenanceRecord.java

@@ -0,0 +1,660 @@
+package com.prolog.cs.base.gsp.model;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.prolog.framework.core.annotation.AutoKey;
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Id;
+import com.prolog.framework.core.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.Date;
+
+/**
+ * @Description
+ * @Date 2021-07-13 
+ */
+
+@ApiModel
+@Table (value ="dxi_gsp_maintenance_record")
+public class DxiGspMaintenanceRecord implements Serializable {
+	private static final long serialVersionUID =  2378979319518916810L;
+	
+	@Id
+	@ApiModelProperty(value = "行ID")
+	@Column(value = "lineid")
+	private String lineid;
+
+	@ApiModelProperty(value = "行号")
+	@Column(value = "seqno")
+	private String seqno;
+
+	@ApiModelProperty(value = "单据ID")
+	@Column(value = "billid")
+	private String billid;
+
+	@ApiModelProperty(value = "单据编号")
+	@Column(value = "billno")
+	private String billno;
+
+	@ApiModelProperty(value = "仓库ID")
+	@Column(value = "branchid")
+	private String branchid;
+
+	@ApiModelProperty(value = "仓库编码")
+	@Column(value = "branchcode")
+	private String branchcode;
+
+	@ApiModelProperty(value = "仓库名称")
+	@Column(value = "branchname")
+	private String branchname;
+
+	@ApiModelProperty(value = "货主ID")
+	@Column(value = "consignorid")
+	private String consignorid;
+
+	@ApiModelProperty(value = "货主编码")
+	@Column(value = "consignorcode")
+	private String consignorcode;
+
+	@ApiModelProperty(value = "货主名称")
+	@Column(value = "consignorname")
+	private String consignorname;
+
+	@ApiModelProperty(value = "养护计划日期")
+	@Column(value = "billdate")
+	private Date billdate;
+
+	@ApiModelProperty(value = "商品ID")
+	@Column(value = "itemid")
+	private String itemid;
+
+	@ApiModelProperty(value = "商品编号")
+	@Column(value = "itemcode")
+	private String itemcode;
+
+	@ApiModelProperty(value = "商品名称")
+	@Column(value = "itemname")
+	private String itemname;
+
+	@ApiModelProperty(value = "批号")
+	@Column(value = "lotno")
+	private String lotno;
+
+	@ApiModelProperty(value = "货位编号")
+	@Column(value = "locno")
+	private String locno;
+
+	@ApiModelProperty(value = "库存数量")
+	@Column(value = "stockqty")
+	private String stockqty;
+
+	@ApiModelProperty(value = "养护商品类型")
+	@Column(value = "itemtype")
+	private String itemtype;
+
+	@ApiModelProperty(value = "商品库存状态")
+	@Column(value = "stockstate")
+	private String stockstate;
+
+	@ApiModelProperty(value = "养护审核状态")
+	@Column(value = "status")
+	private String status;
+
+	@ApiModelProperty(value = "养护数据来源")
+	@Column(value = "sourcetype")
+	private String sourcetype;
+
+	@ApiModelProperty(value = "养护员")
+	@Column(value = "upkeepoperator")
+	private String upkeepoperator;
+
+	@ApiModelProperty(value = "处理意见")
+	@Column(value = "processopinion")
+	private String processopinion;
+
+	@ApiModelProperty(value = "复检员")
+	@Column(value = "recheckoperator")
+	private String recheckoperator;
+
+	@ApiModelProperty(value = "复检意见")
+	@Column(value = "recheckopinion")
+	private String recheckopinion;
+
+	@ApiModelProperty(value = "审核员")
+	@Column(value = "auditoperator")
+	private String auditoperator;
+
+	@ApiModelProperty(value = "审核意见")
+	@Column(value = "auditopinion")
+	private String auditopinion;
+
+	@ApiModelProperty(value = "养护操作")
+	@Column(value = "checkoperation")
+	private String checkoperation;
+
+	@ApiModelProperty(value = "养护数量")
+	@Column(value = "qualifiedqty")
+	private String qualifiedqty;
+
+	@ApiModelProperty(value = "养护待处理数量")
+	@Column(value = "pendingqty")
+	private String pendingqty;
+
+	@ApiModelProperty(value = "质量状况")
+	@Column(value = "qualitystatus")
+	private String qualitystatus;
+
+	@ApiModelProperty(value = "温湿度状况")
+	@Column(value = "thstatus")
+	private String thstatus;
+
+	@ApiModelProperty(value = "养护待处理原因")
+	@Column(value = "pendingreason")
+	private String pendingreason;
+
+	@ApiModelProperty(value = "养护时间")
+	@Column(value = "upkeepdate")
+	private Date upkeepdate;
+
+	@ApiModelProperty(value = "复检日期")
+	@Column(value = "recheckdate")
+	private Date recheckdate;
+
+	@ApiModelProperty(value = "备注")
+	@Column(value = "remark")
+	private String remark;
+
+	@ApiModelProperty(value = "字符扩展属性1")
+	@Column(value = "attr_str1")
+	private String attrStr1;
+
+	@ApiModelProperty(value = "字符扩展属性2")
+	@Column(value = "attr_str2")
+	private String attrStr2;
+
+	@ApiModelProperty(value = "字符扩展属性3")
+	@Column(value = "attr_num1")
+	private String attrNum1;
+
+	@ApiModelProperty(value = "字符扩展属性4")
+	@Column(value = "attr_num2")
+	private String attrNum2;
+
+	@ApiModelProperty(value = "字符扩展属性5")
+	@Column(value = "attr_dte1")
+	private Date attrDte1;
+
+	@ApiModelProperty(value = "字符扩展属性6")
+	@Column(value = "attr_dte2")
+	private Date attrDte2;
+
+	@ApiModelProperty(value = "录入员")
+	@Column(value = "createby")
+	private String createby;
+
+	@ApiModelProperty(value = "录入时间")
+	@Column(value = "createdate")
+	private Date createdate;
+
+	@ApiModelProperty(value = "修改人")
+	@Column(value = "lastmodifyby")
+	private String lastmodifyby;
+
+	@ApiModelProperty(value = "修改时间")
+	@Column(value = "lastmodifydate")
+	private Date lastmodifydate;
+
+	@ApiModelProperty(value = "企业ID")
+	@Column(value = "p_enterpriseid")
+	private String enterpriseid;
+
+	@ApiModelProperty(value = "企业名称")
+	@Column(value = "p_enterprisename")
+	private String enterprisename;
+
+	@ApiModelProperty(value = "数据来源(1ERP 2OMS 3WMS 4SAP)")
+	@Column(value = "datasource")
+	private String datasource;
+
+	@ApiModelProperty(value = "是否近效期")
+	@Column(value = "isneardate")
+	private String isneardate;
+
+	@ApiModelProperty(value = "字符扩展属性3")
+	@Column(value = "attr_str3")
+	private String attrStr3;
+
+	@ApiModelProperty(value = "养护措施")
+	@Column(value = "checkmemo")
+	private String checkmemo;
+
+	@ApiModelProperty(value = "建筑物")
+	@Column(value = "building")
+	private String building;
+
+	public String getBuilding() {
+		return building;
+	}
+
+	public void setBuilding(String building) {
+		this.building = building;
+	}
+
+	public String getLineid() {
+		return this.lineid;
+	}
+
+	public void setLineid(String lineid) {
+		this.lineid = lineid;
+	}
+
+	public String getSeqno() {
+		return this.seqno;
+	}
+
+	public void setSeqno(String seqno) {
+		this.seqno = seqno;
+	}
+
+	public String getBillid() {
+		return this.billid;
+	}
+
+	public void setBillid(String billid) {
+		this.billid = billid;
+	}
+
+	public String getBillno() {
+		return this.billno;
+	}
+
+	public void setBillno(String billno) {
+		this.billno = billno;
+	}
+
+	public String getBranchid() {
+		return this.branchid;
+	}
+
+	public void setBranchid(String branchid) {
+		this.branchid = branchid;
+	}
+
+	public String getBranchcode() {
+		return this.branchcode;
+	}
+
+	public void setBranchcode(String branchcode) {
+		this.branchcode = branchcode;
+	}
+
+	public String getBranchname() {
+		return this.branchname;
+	}
+
+	public void setBranchname(String branchname) {
+		this.branchname = branchname;
+	}
+
+	public String getConsignorid() {
+		return this.consignorid;
+	}
+
+	public void setConsignorid(String consignorid) {
+		this.consignorid = consignorid;
+	}
+
+	public String getConsignorcode() {
+		return this.consignorcode;
+	}
+
+	public void setConsignorcode(String consignorcode) {
+		this.consignorcode = consignorcode;
+	}
+
+	public String getConsignorname() {
+		return this.consignorname;
+	}
+
+	public void setConsignorname(String consignorname) {
+		this.consignorname = consignorname;
+	}
+
+	public Date getBilldate() {
+		return this.billdate;
+	}
+
+	public void setBilldate(Date billdate) {
+		this.billdate = billdate;
+	}
+
+	public String getItemid() {
+		return this.itemid;
+	}
+
+	public void setItemid(String itemid) {
+		this.itemid = itemid;
+	}
+
+	public String getItemcode() {
+		return this.itemcode;
+	}
+
+	public void setItemcode(String itemcode) {
+		this.itemcode = itemcode;
+	}
+
+	public String getItemname() {
+		return this.itemname;
+	}
+
+	public void setItemname(String itemname) {
+		this.itemname = itemname;
+	}
+
+	public String getLotno() {
+		return this.lotno;
+	}
+
+	public void setLotno(String lotno) {
+		this.lotno = lotno;
+	}
+
+	public String getLocno() {
+		return this.locno;
+	}
+
+	public void setLocno(String locno) {
+		this.locno = locno;
+	}
+
+	public String getStockqty() {
+		return this.stockqty;
+	}
+
+	public void setStockqty(String stockqty) {
+		this.stockqty = stockqty;
+	}
+
+	public String getItemtype() {
+		return this.itemtype;
+	}
+
+	public void setItemtype(String itemtype) {
+		this.itemtype = itemtype;
+	}
+
+	public String getStockstate() {
+		return this.stockstate;
+	}
+
+	public void setStockstate(String stockstate) {
+		this.stockstate = stockstate;
+	}
+
+	public String getStatus() {
+		return this.status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getSourcetype() {
+		return this.sourcetype;
+	}
+
+	public void setSourcetype(String sourcetype) {
+		this.sourcetype = sourcetype;
+	}
+
+	public String getUpkeepoperator() {
+		return this.upkeepoperator;
+	}
+
+	public void setUpkeepoperator(String upkeepoperator) {
+		this.upkeepoperator = upkeepoperator;
+	}
+
+	public String getProcessopinion() {
+		return this.processopinion;
+	}
+
+	public void setProcessopinion(String processopinion) {
+		this.processopinion = processopinion;
+	}
+
+	public String getRecheckoperator() {
+		return this.recheckoperator;
+	}
+
+	public void setRecheckoperator(String recheckoperator) {
+		this.recheckoperator = recheckoperator;
+	}
+
+	public String getRecheckopinion() {
+		return this.recheckopinion;
+	}
+
+	public void setRecheckopinion(String recheckopinion) {
+		this.recheckopinion = recheckopinion;
+	}
+
+	public String getAuditoperator() {
+		return this.auditoperator;
+	}
+
+	public void setAuditoperator(String auditoperator) {
+		this.auditoperator = auditoperator;
+	}
+
+	public String getAuditopinion() {
+		return this.auditopinion;
+	}
+
+	public void setAuditopinion(String auditopinion) {
+		this.auditopinion = auditopinion;
+	}
+
+	public String getCheckoperation() {
+		return this.checkoperation;
+	}
+
+	public void setCheckoperation(String checkoperation) {
+		this.checkoperation = checkoperation;
+	}
+
+	public String getQualifiedqty() {
+		return this.qualifiedqty;
+	}
+
+	public void setQualifiedqty(String qualifiedqty) {
+		this.qualifiedqty = qualifiedqty;
+	}
+
+	public String getPendingqty() {
+		return this.pendingqty;
+	}
+
+	public void setPendingqty(String pendingqty) {
+		this.pendingqty = pendingqty;
+	}
+
+	public String getQualitystatus() {
+		return this.qualitystatus;
+	}
+
+	public void setQualitystatus(String qualitystatus) {
+		this.qualitystatus = qualitystatus;
+	}
+
+	public String getThstatus() {
+		return this.thstatus;
+	}
+
+	public void setThstatus(String thstatus) {
+		this.thstatus = thstatus;
+	}
+
+	public String getPendingreason() {
+		return this.pendingreason;
+	}
+
+	public void setPendingreason(String pendingreason) {
+		this.pendingreason = pendingreason;
+	}
+
+	public Date getUpkeepdate() {
+		return this.upkeepdate;
+	}
+
+	public void setUpkeepdate(Date upkeepdate) {
+		this.upkeepdate = upkeepdate;
+	}
+
+	public Date getRecheckdate() {
+		return this.recheckdate;
+	}
+
+	public void setRecheckdate(Date recheckdate) {
+		this.recheckdate = recheckdate;
+	}
+
+	public String getRemark() {
+		return this.remark;
+	}
+
+	public void setRemark(String remark) {
+		this.remark = remark;
+	}
+
+	public String getAttrStr1() {
+		return this.attrStr1;
+	}
+
+	public void setAttrStr1(String attrStr1) {
+		this.attrStr1 = attrStr1;
+	}
+
+	public String getAttrStr2() {
+		return this.attrStr2;
+	}
+
+	public void setAttrStr2(String attrStr2) {
+		this.attrStr2 = attrStr2;
+	}
+
+	public String getAttrNum1() {
+		return this.attrNum1;
+	}
+
+	public void setAttrNum1(String attrNum1) {
+		this.attrNum1 = attrNum1;
+	}
+
+	public String getAttrNum2() {
+		return this.attrNum2;
+	}
+
+	public void setAttrNum2(String attrNum2) {
+		this.attrNum2 = attrNum2;
+	}
+
+	public Date getAttrDte1() {
+		return this.attrDte1;
+	}
+
+	public void setAttrDte1(Date attrDte1) {
+		this.attrDte1 = attrDte1;
+	}
+
+	public Date getAttrDte2() {
+		return this.attrDte2;
+	}
+
+	public void setAttrDte2(Date attrDte2) {
+		this.attrDte2 = attrDte2;
+	}
+
+	public String getCreateby() {
+		return this.createby;
+	}
+
+	public void setCreateby(String createby) {
+		this.createby = createby;
+	}
+
+	public Date getCreatedate() {
+		return this.createdate;
+	}
+
+	public void setCreatedate(Date createdate) {
+		this.createdate = createdate;
+	}
+
+	public String getLastmodifyby() {
+		return this.lastmodifyby;
+	}
+
+	public void setLastmodifyby(String lastmodifyby) {
+		this.lastmodifyby = lastmodifyby;
+	}
+
+	public Date getLastmodifydate() {
+		return this.lastmodifydate;
+	}
+
+	public void setLastmodifydate(Date lastmodifydate) {
+		this.lastmodifydate = lastmodifydate;
+	}
+
+	public String getEnterpriseid() {
+		return this.enterpriseid;
+	}
+
+	public void setEnterpriseid(String enterpriseid) {
+		this.enterpriseid = enterpriseid;
+	}
+
+	public String getEnterprisename() {
+		return this.enterprisename;
+	}
+
+	public void setEnterprisename(String enterprisename) {
+		this.enterprisename = enterprisename;
+	}
+
+	public String getDatasource() {
+		return this.datasource;
+	}
+
+	public void setDatasource(String datasource) {
+		this.datasource = datasource;
+	}
+
+	public String getIsneardate() {
+		return this.isneardate;
+	}
+
+	public void setIsneardate(String isneardate) {
+		this.isneardate = isneardate;
+	}
+
+	public String getAttrStr3() {
+		return this.attrStr3;
+	}
+
+	public void setAttrStr3(String attrStr3) {
+		this.attrStr3 = attrStr3;
+	}
+
+	public String getCheckmemo() {
+		return this.checkmemo;
+	}
+
+	public void setCheckmemo(String checkmemo) {
+		this.checkmemo = checkmemo;
+	}
+
+}

+ 252 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/DxiGspQualityReviewD.java

@@ -0,0 +1,252 @@
+package com.prolog.cs.base.gsp.model;
+
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Id;
+import com.prolog.framework.core.annotation.Ignore;
+import com.prolog.framework.core.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Description
+ * @Date 2022-05-26
+ */
+
+@ApiModel
+@Table (value ="dxi_gsp_quality_review_d")
+@Data
+public class DxiGspQualityReviewD implements Serializable {
+
+
+	private static final long serialVersionUID = 1139987853932586366L;
+
+	@Id
+	@ApiModelProperty(value = "对接单据行号")
+	@Column(value = "lineid")
+	private String lineid;
+
+
+	@ApiModelProperty(value = "单据ID")
+	@Column(value = "billid")
+	private String billid;
+
+	@ApiModelProperty(value = "单号")
+	@Column(value = "billno")
+	private String billno;
+
+	@ApiModelProperty(value = "申请复查行id")
+	@Column(value = "request_lineid")
+	private String requestLineid;
+
+	@ApiModelProperty(value = "对接单据行号")
+	@Column(value = "seqno")
+	private String seqno;
+
+	@ApiModelProperty(value = "商品ID")
+	@Column(value = "itemid")
+	private String itemid;
+
+	@ApiModelProperty(value = "商品编码")
+	@Column(value = "itemcode")
+	private String itemcode;
+
+	@ApiModelProperty(value = "商品名称")
+	@Column(value = "itemname")
+	private String itemname;
+
+	@ApiModelProperty(value = "商品规格")
+	@Column(value = "item_specs")
+	private String itemSpecs;
+
+	@ApiModelProperty(value = "生产厂家")
+	@Column(value = "manufacturer")
+	private String manufacturer;
+
+	@ApiModelProperty(value = "产地")
+	@Column(value = "production_place")
+	private String productionPlace;
+
+	@ApiModelProperty(value = "包装数量")
+	@Column(value = "pack_size")
+	private String packSize;
+
+	@ApiModelProperty(value = "包装单位")
+	@Column(value = "pack_units")
+	private String packUnits;
+
+	@ApiModelProperty(value = "批准文号")
+	@Column(value = "approval_number")
+	private String approvalNumber;
+
+	@ApiModelProperty(value = "备案凭证号")
+	@Column(value = "paper_no")
+	private String paperNo;
+
+	@ApiModelProperty(value = "批号")
+	@Column(value = "lot_no")
+	private String lotNo;
+
+
+	@ApiModelProperty(value = "批次号")
+	@Column(value = "batch_no")
+	private String batchNo;
+
+	@ApiModelProperty(value = "生产日期")
+	@Column(value = "pdate_from")
+	private String pdateFrom;
+
+	@ApiModelProperty(value = "有效期至")
+	@Column(value = "valid_until")
+	private String validUntil;
+
+	@ApiModelProperty(value = "数量")
+	@Column(value = "qty")
+	private String qty;
+
+	@ApiModelProperty(value = "备注")
+	@Column(value = "remark")
+	private String remark;
+
+	@ApiModelProperty(value = "质量主管")
+	@Column(value = "audit_director")
+	private String auditDirector;
+
+	@ApiModelProperty(value = "主管审核结论")
+	@Column(value = "audit_staus_director")
+	private String auditStausDirector;
+
+	@ApiModelProperty(value = "主管审核意见  10初始  20合格  30不合格  40待处理")
+	@Column(value = "audit_text_director")
+	private String auditTextDirector;
+
+	@ApiModelProperty(value = "主管审核日期")
+	@Column(value = "audit_date_director")
+	private Date auditDateDirector;
+
+	@ApiModelProperty(value = "质量经理")
+	@Column(value = "audit_manager")
+	private String auditManager;
+
+	@ApiModelProperty(value = "经理审核结论 10初始  20合格 30不合格")
+	@Column(value = "audit_staus_manager")
+	private String auditStausManager;
+
+	@ApiModelProperty(value = "经理审核意见")
+	@Column(value = "audit_text_manager")
+	private String auditTextManager;
+
+	@ApiModelProperty(value = "经理审核日期")
+	@Column(value = "audit_date_manager")
+	private Date auditDateManager;
+
+	@ApiModelProperty(value = "最终审核结论  10初始  20合格 30不合格")
+	@Column(value = "end_status")
+	private String endStatus;
+
+	@ApiModelProperty(value = "不合格数量")
+	@Column(value = "review_qty")
+	private String reviewQty;
+
+	@ApiModelProperty(value = "不合格移库完成数量")
+	@Column(value = "review_moved_qty")
+	private String reviewMovedQty;
+
+	@ApiModelProperty(value = "字符扩展属性1")
+	@Column(value = "attr_str1")
+	private String attrStr1;
+
+	@ApiModelProperty(value = "字符扩展属性2")
+	@Column(value = "attr_str2")
+	private String attrStr2;
+
+	@ApiModelProperty(value = "字符扩展属性3")
+	@Column(value = "attr_str3")
+	private String attrStr3;
+
+	@ApiModelProperty(value = "字符扩展属性4")
+	@Column(value = "attr_str4")
+	private String attrStr4;
+
+	@ApiModelProperty(value = "字符扩展属性5")
+	@Column(value = "attr_str5")
+	private String attrStr5;
+
+	@ApiModelProperty(value = "录入员")
+	@Column(value = "createby")
+	private String createby;
+
+	@ApiModelProperty(value = "录入时间")
+	@Column(value = "createdate")
+	private Date createdate;
+
+	@ApiModelProperty(value = "修改人")
+	@Column(value = "lastmodifyby")
+	private String lastmodifyby;
+
+	@ApiModelProperty(value = "修改时间")
+	@Column(value = "lastmodifydate")
+	private Date lastmodifydate;
+
+	@ApiModelProperty(value = "企业ID")
+	@Column(value = "p_enterpriseid")
+	private String enterpriseid;
+
+	@ApiModelProperty(value = "企业名称")
+	@Column(value = "p_enterprisename")
+	private String enterprisename;
+
+	@ApiModelProperty(value = "接口回传OMS状态N:未处理  E:处理异常  Y:处理完成")
+	@Column(value = "INF_STATUS")
+	private String infStatus;
+
+
+	@ApiModelProperty(value = "商品大类")
+	@Ignore
+	private String itemHealthCategory;
+
+	@ApiModelProperty(value = "剂型")
+	@Ignore
+	private String itemHealthType;
+
+	@ApiModelProperty(value = "上市许可持有人")
+	@Ignore
+	private String itemHealthListedLicensor;
+
+	@Ignore
+	@ApiModelProperty(hidden =true,value = "库存数量")
+	private BigDecimal stockQty;
+
+	@Ignore
+	@ApiModelProperty(hidden =true,value = "库存件数")
+	private BigDecimal caseQuantity;
+	@Ignore
+	@ApiModelProperty(hidden =true,value = "库存零散数")
+	private BigDecimal oddPieceQuantity;
+
+
+	@Ignore
+	@ApiModelProperty(value = "单据来源类型")
+	private String refBilltype;
+
+	@Ignore
+	@ApiModelProperty(value = "申请复查单据类别")
+	private String requestBilltype;
+
+	@Ignore
+	@ApiModelProperty(value = "操作人")
+	private String operator;
+
+	@Ignore
+	@ApiModelProperty(value = "发起申请日期")
+	private Date billDate;
+
+	@Ignore
+	@ApiModelProperty(value = "复查原因")
+	private String reviewReason;
+
+}

+ 144 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/DxiGspQualityReviewH.java

@@ -0,0 +1,144 @@
+package com.prolog.cs.base.gsp.model;
+
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Id;
+import com.prolog.framework.core.annotation.Ignore;
+import com.prolog.framework.core.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description
+ * @Date 2022-05-26
+ */
+
+@ApiModel
+@Table (value ="dxi_gsp_quality_review_h")
+@Data
+public class DxiGspQualityReviewH implements Serializable {
+
+	private static final long serialVersionUID = -8419845298076084040L;
+
+	@ApiModelProperty(value = "单据ID")
+	@Column(value = "billid")
+	private String billid;
+
+	@ApiModelProperty(value = "单号")
+	@Column(value = "billno")
+	private String billno;
+
+	@ApiModelProperty(value = "申请仓库ID")
+	@Column(value = "branchid")
+	private String branchid;
+
+	@ApiModelProperty(value = "申请仓库编码")
+	@Column(value = "branchcode")
+	private String branchcode;
+
+	@ApiModelProperty(value = "申请仓库名称")
+	@Column(value = "branchname")
+	private String branchname;
+
+	@ApiModelProperty(value = "货主ID")
+	@Column(value = "consignorid")
+	private String consignorid;
+
+	@ApiModelProperty(value = "货主编码")
+	@Column(value = "consignorcode")
+	private String consignorcode;
+
+	@ApiModelProperty(value = "货主名称")
+	@Column(value = "consignorname")
+	private String consignorname;
+
+	@ApiModelProperty(value = "单据来源类型")
+	@Column(value = "ref_billtype")
+	private String refBilltype;
+
+	@ApiModelProperty(value = "申请复查单据类别")
+	@Column(value = "request_billtype")
+	private String requestBilltype;
+
+	@ApiModelProperty(value = "申请复查单据id")
+	@Column(value = "request_billid")
+	private String requestBillid;
+
+	@ApiModelProperty(value = "申请复查单据号")
+	@Column(value = "request_billno")
+	private String requestBillno;
+
+	@ApiModelProperty(value = "操作人")
+	@Column(value = "operator")
+	private String operator;
+
+	@ApiModelProperty(value = "发起申请日期")
+	@Column(value = "bill_date")
+	private Date billDate;
+
+	@ApiModelProperty(value = "复查原因")
+	@Column(value = "review_reason")
+	private String reviewReason;
+
+	@ApiModelProperty(value = "状态")
+	@Column(value = "status")
+	private String status;
+
+	@ApiModelProperty(value = "备注")
+	@Column(value = "remark")
+	private String remark;
+
+	@ApiModelProperty(value = "字符扩展属性1")
+	@Column(value = "attr_str1")
+	private String attrStr1;
+
+	@ApiModelProperty(value = "字符扩展属性2")
+	@Column(value = "attr_str2")
+	private String attrStr2;
+
+	@ApiModelProperty(value = "字符扩展属性3")
+	@Column(value = "attr_str3")
+	private String attrStr3;
+
+	@ApiModelProperty(value = "字符扩展属性4")
+	@Column(value = "attr_str4")
+	private String attrStr4;
+
+	@ApiModelProperty(value = "字符扩展属性5")
+	@Column(value = "attr_str5")
+	private String attrStr5;
+
+	@ApiModelProperty(value = "录入员")
+	@Column(value = "createby")
+	private String createby;
+
+	@ApiModelProperty(value = "录入时间")
+	@Column(value = "createdate")
+	private Date createdate;
+
+	@ApiModelProperty(value = "修改人")
+	@Column(value = "lastmodifyby")
+	private String lastmodifyby;
+
+	@ApiModelProperty(value = "修改时间")
+	@Column(value = "lastmodifydate")
+	private Date lastmodifydate;
+
+	@ApiModelProperty(value = "企业ID")
+	@Column(value = "p_enterpriseid")
+	private String enterpriseid;
+
+	@ApiModelProperty(value = "企业名称")
+	@Column(value = "p_enterprisename")
+	private String enterprisename;
+
+	@ApiModelProperty(value = "wms仓库id")
+	@Column(value = "warehouse_id")
+	private String warehouseId;
+
+
+}

+ 148 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUnqualifiedDestroy.java

@@ -0,0 +1,148 @@
+package com.prolog.cs.base.gsp.model;
+
+import com.prolog.framework.core.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description  
+ * @Date 2021-05-10 
+ */
+
+@Data
+@ApiModel
+@Table ( value ="gsp_unqualified_destroy" )
+public class GspUnqualifiedDestroy implements Serializable {
+	private static final long serialVersionUID =  4460460597628829391L;
+	
+	@Id
+	@ApiModelProperty(value = "单据ID") 
+	@Column(value = "id")
+	private String id;
+
+	@ApiModelProperty(value = "单据编号") 
+	@Column(value = "code")
+	private String code;
+
+	@ApiModelProperty(value = "企业ID") 
+	@Column(value = "enterprise_id")
+	private String enterpriseId;
+
+	@ApiModelProperty(value = "仓配中心ID") 
+	@Column(value = "dc_id")
+	private String dcId;
+
+	@ApiModelProperty(value = "仓ID") 
+	@Column(value = "warehouse_id")
+	private String warehouseId;
+	
+	@Ignore
+	private String warehouseName;
+
+	@ApiModelProperty(value = "货主id") 
+	@Column(value = "cargo_owner_id")
+	private String cargoOwnerId;
+	
+	@Ignore
+	private String cargoOwnerName;
+	
+	@ApiModelProperty(value = "审核员") 
+	@Column(value = "audit_operator")
+	private String auditOperator;
+
+	@ApiModelProperty(value = "审核日期") 
+	@Column(value = "audit_date")
+	private Date auditDate;
+
+	@ApiModelProperty(value = "审核意见") 
+	@Column(value = "audit_text")
+	private String auditText;
+
+	@ApiModelProperty(value = "状态:10=初始 20=已审批 30=已驳回") 
+	@Column(value = "status")
+	private String status;
+
+	@ApiModelProperty(value = "数据来源") 
+	@Column(value = "source")
+	private String source;
+
+	@ApiModelProperty(value = "创建日期") 
+	@Column(value = "gmt_create")
+	private Date gmtCreate;
+
+	@ApiModelProperty(value = "创建人") 
+	@Column(value = "creator")
+	private String creator;
+
+	@ApiModelProperty(value = "创建人") 
+	@Column(value = "creator_name")
+	private String creatorName;
+
+	@ApiModelProperty(value = "最后修改日期") 
+	@Column(value = "gmt_modified")
+	private Date gmtModified;
+
+	@ApiModelProperty(value = "最后修改人") 
+	@Column(value = "modifier")
+	private String modifier;
+
+	@ApiModelProperty(value = "最后修改人") 
+	@Column(value = "modifier_name")
+	private String modifierName;
+
+	@ApiModelProperty(value = "备注") 
+	@Column(value = "remark")
+	private String remark;
+
+	@ApiModelProperty(value = "销毁原因")
+	@Column(value = "destroy_reason")
+	private String destroyReason;
+
+	@ApiModelProperty(value = "销毁方式")
+	@Column(value = "destroy_mode")
+	private String destroyMode;
+
+	@ApiModelProperty(value = "销毁地点")
+	@Column(value = "destroy_site")
+	private String destroySite;
+
+	@ApiModelProperty(value = "销毁日期")
+	@Column(value = "destroy_date")
+	private Date destroyDate;
+
+	@ApiModelProperty(value = "运输工具")
+	@Column(value = "transport_tool")
+	private String transportTool;
+
+	@ApiModelProperty(value = "运输人员")
+	@Column(value = "transportor")
+	private String transportor;
+
+	@ApiModelProperty(value = "销毁后现场情况")
+	@Column(value = "destroy_situation")
+	private String destroySituation;
+
+	@ApiModelProperty(value = "销毁执行人")
+	@Column(value = "destroy_executor")
+	private String destroyExecutor;
+
+	@ApiModelProperty(value = "销毁监督人")
+	@Column(value = "destroy_supervisor")
+	private String destroySupervisor;
+
+	@ApiModelProperty(value = "销毁图片")
+	@Column(value = "destroy_pic")
+	private String destroyPic;
+
+	@ApiModelProperty(value = "药监部门人员")
+	@Column(value = "nmpa_officer")
+	private String nmpaOfficer;
+
+	@Ignore
+	private List<GspUnqualifiedDestroyD> gspUnqualifiedDestroyDList;
+}

+ 150 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUnqualifiedDestroyD.java

@@ -0,0 +1,150 @@
+package com.prolog.cs.base.gsp.model;
+
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Id;
+import com.prolog.framework.core.annotation.Ignore;
+import com.prolog.framework.core.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description  
+ * @Date 2021-05-10 
+ */
+
+@Data
+@ApiModel
+@Table ( value ="gsp_unqualified_destroy_d" )
+public class GspUnqualifiedDestroyD implements Serializable {
+	private static final long serialVersionUID =  195645956853206383L;
+	
+	@Id
+	@ApiModelProperty(value = "行ID") 
+	@Column(value = "id")
+	private String id;
+
+	@ApiModelProperty(value = "code")
+	@Column(value = "code")
+	private String code;
+
+	@ApiModelProperty(value = "单据ID") 
+	@Column(value = "destroy_id")
+	private String destroyId;
+
+	@ApiModelProperty(value = "单据编号") 
+	@Column(value = "destroy_code")
+	private String destroyCode;
+
+	@ApiModelProperty(value = "企业ID") 
+	@Column(value = "enterprise_id")
+	private String enterpriseId;
+
+	@ApiModelProperty(value = "仓配中心ID") 
+	@Column(value = "dc_id")
+	private String dcId;
+
+	@ApiModelProperty(value = "仓ID") 
+	@Column(value = "warehouse_id")
+	private String warehouseId;
+
+	@ApiModelProperty(value = "货主id") 
+	@Column(value = "cargo_owner_id")
+	private String cargoOwnerId;
+
+	@ApiModelProperty(value = "货位ID") 
+	@Column(value = "locator_id")
+	private String locatorId;
+
+	@ApiModelProperty(value = "货位编号") 
+	@Column(value = "locator_code")
+	private String locatorCode;
+
+	@ApiModelProperty(value = "商品ID") 
+	@Column(value = "item_id")
+	private String itemId;
+
+	@ApiModelProperty(value = "商品编号") 
+	@Column(value = "item_code")
+	private String itemCode;
+
+	@ApiModelProperty(value = "批号") 
+	@Column(value = "lot_num")
+	private String lotNum;
+
+	@ApiModelProperty(value = "不合格数量") 
+	@Column(value = "unqualified_qty")
+	private String unqualifiedQty;
+
+	@ApiModelProperty(value = "不合格原因") 
+	@Column(value = "unqualified_reason")
+	private String unqualifiedReason;
+
+	@ApiModelProperty(value = "质量情况反映") 
+	@Column(value = "quality_status")
+	private String qualityStatus;
+
+	@ApiModelProperty(value = "意见") 
+	@Column(value = "opinion")
+	private String opinion;
+
+	@ApiModelProperty(value = "关联单ID") 
+	@Column(value = "ref_bill_id")
+	private String refBillId;
+	
+	@ApiModelProperty(value = "关联行ID") 
+	@Column(value = "REF_LINE_ID")
+	private String refLineId;
+
+	@ApiModelProperty(value = "状态10初始,20已审批") 
+	@Column(value = "status")
+	private String status;
+
+	@ApiModelProperty(value = "销毁数量") 
+	@Column(value = "destroy_qty")
+	private String destroyQty;
+
+	@ApiModelProperty(value = "创建日期") 
+	@Column(value = "gmt_create")
+	private Date gmtCreate;
+
+	@ApiModelProperty(value = "创建人") 
+	@Column(value = "creator")
+	private String creator;
+
+	@ApiModelProperty(value = "创建人") 
+	@Column(value = "creator_name")
+	private String creatorName;
+
+	@ApiModelProperty(value = "最后修改日期") 
+	@Column(value = "gmt_modified")
+	private Date gmtModified;
+
+	@ApiModelProperty(value = "最后修改人") 
+	@Column(value = "modifier")
+	private String modifier;
+
+	@ApiModelProperty(value = "最后修改人") 
+	@Column(value = "modifier_name")
+	private String modifierName;
+
+	@ApiModelProperty(value = "备注") 
+	@Column(value = "remark")
+	private String remark;
+	
+	@ApiModelProperty(value = "报损数量") 
+	@Column(value = "loss_qty")
+	private String lossQty;
+
+	@ApiModelProperty(value = "批次")
+	@Column(value = "batch_id")
+	private String batchId;
+
+    @Ignore
+	@ApiModelProperty(value = "已申请销毁数量")
+	private String destroyingQty;
+
+}

+ 107 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUnqualifiedLoss.java

@@ -0,0 +1,107 @@
+package com.prolog.cs.base.gsp.model;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.prolog.framework.core.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description  
+ * @Date 2021-05-10 
+ */
+
+@Data
+@ApiModel
+@Table ( value ="gsp_unqualified_loss" )
+public class GspUnqualifiedLoss implements Serializable {
+	private static final long serialVersionUID =  3629171736422910060L;
+
+	@Id
+	
+	@ApiModelProperty(value = "单据ID")
+	@Column(value = "id")
+	private String id;
+
+	@ApiModelProperty(value = "单据编号") 
+	@Column(value = "code")
+	private String code;
+
+	@ApiModelProperty(value = "企业ID") 
+	@Column(value = "enterprise_id")
+	private String enterpriseId;
+
+	@ApiModelProperty(value = "仓配中心ID") 
+	@Column(value = "dc_id")
+	private String dcId;
+
+	@ApiModelProperty(value = "仓ID") 
+	@Column(value = "warehouse_id")
+	private String warehouseId;
+	
+	@Ignore
+	private String warehouseName;
+
+	@ApiModelProperty(value = "货主id") 
+	@Column(value = "cargo_owner_id")
+	private String cargoOwnerId;
+
+	@Ignore
+	private String cargoOwnerName;
+
+	@ApiModelProperty(value = "所在部门意见")
+	@Column(value = "opinion")
+	private String opinion;
+
+	@ApiModelProperty(value = "审核员") 
+	@Column(value = "audit_operator")
+	private String auditOperator;
+
+	@ApiModelProperty(value = "审核日期") 
+	@Column(value = "audit_date")
+	private Date auditDate;
+
+	@ApiModelProperty(value = "审核意见") 
+	@Column(value = "audit_text")
+	private String auditText;
+
+	@ApiModelProperty(value = "状态:10=初始 20=已审批 30=已驳回") 
+	@Column(value = "status")
+	private String status;
+
+	@ApiModelProperty(value = "数据来源") 
+	@Column(value = "source")
+	private String source;
+
+	@ApiModelProperty(value = "创建日期") 
+	@Column(value = "gmt_create")
+	private Date gmtCreate;
+
+	@ApiModelProperty(value = "创建人") 
+	@Column(value = "creator")
+	private String creator;
+
+	@ApiModelProperty(value = "创建人") 
+	@Column(value = "creator_name")
+	private String creatorName;
+
+	@ApiModelProperty(value = "最后修改日期") 
+	@Column(value = "gmt_modified")
+	private Date gmtModified;
+
+	@ApiModelProperty(value = "最后修改人") 
+	@Column(value = "modifier")
+	private String modifier;
+
+	@ApiModelProperty(value = "最后修改人") 
+	@Column(value = "modifier_name")
+	private String modifierName;
+
+	@Ignore
+	private List<GspUnqualifiedLossD> gspUnqualifiedLossDList;
+
+}

+ 418 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUnqualifiedLossD.java

@@ -0,0 +1,418 @@
+package com.prolog.cs.base.gsp.model;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.prolog.framework.core.annotation.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Description  
+ * @Date 2021-05-10 
+ */
+
+@ApiModel
+@Table ( value ="gsp_unqualified_loss_d" )
+public class GspUnqualifiedLossD  implements Serializable {
+	
+	private static final long serialVersionUID =  1420213556099295369L;
+	@Id
+	@ApiModelProperty(value = "行ID")
+	@Column(value = "id")
+	private String id;
+
+	@ApiModelProperty(value = "行号") 
+	@Column(value = "code")
+	private String code;
+
+	@ApiModelProperty(value = "单据ID") 
+	@Column(value = "loss_id")
+	private String lossId;
+
+	@ApiModelProperty(value = "单据编号") 
+	@Column(value = "loss_code")
+	private String lossCode;
+
+	@ApiModelProperty(value = "企业ID") 
+	@Column(value = "enterprise_id")
+	private String enterpriseId;
+
+	@ApiModelProperty(value = "仓配中心ID") 
+	@Column(value = "dc_id")
+	private String dcId;
+
+	@ApiModelProperty(value = "仓ID") 
+	@Column(value = "warehouse_id")
+	private String warehouseId;
+
+	@ApiModelProperty(value = "货主id") 
+	@Column(value = "cargo_owner_id")
+	private String cargoOwnerId;
+
+	@ApiModelProperty(value = "货位ID") 
+	@Column(value = "locator_id")
+	private String locatorId;
+
+	@ApiModelProperty(value = "货位编号") 
+	@Column(value = "locator_code")
+	private String locatorCode;
+
+	@ApiModelProperty(value = "商品ID") 
+	@Column(value = "item_id")
+	private String itemId;
+
+	@ApiModelProperty(value = "商品编号") 
+	@Column(value = "item_code")
+	private String itemCode;
+
+	@ApiModelProperty(value = "批号") 
+	@Column(value = "lot_num")
+	private String lotNum;
+
+	@ApiModelProperty(value = "不合格数量,前端隐藏不显示,但破损提交接口需传给后台")
+	@Column(value = "unqualified_qty")
+	private String unqualifiedQty;
+
+	@ApiModelProperty(value = "不合格原因") 
+	@Column(value = "unqualified_reason")
+	private String unqualifiedReason;
+
+	@ApiModelProperty(value = "质量情况反映") 
+	@Column(value = "quality_status")
+	private String qualityStatus;
+
+	@ApiModelProperty(value = "意见") 
+	@Column(value = "opinion")
+	private String opinion;
+
+	@ApiModelProperty(value = "关联单ID") 
+	@Column(value = "ref_bill_id")
+	private String refBillId;
+
+	@ApiModelProperty(value = "关联单类型:1=入库 2=移库")
+	@Column(value = "REF_BILL_TYPE")
+	private String refBillType;
+
+	@ApiModelProperty(value = "状态10初始,20已审批") 
+	@Column(value = "status")
+	private String status;
+
+	@ApiModelProperty(value = "报损数量,必须不大于不合格数,且支持小数")
+	@Column(value = "loss_qty")
+	private String lossQty;
+
+	@ApiModelProperty(value = "销毁申请数量,必须不大于报损数量,且支持小数")
+	@Column(value = "destroying_qty")
+	private String destroyingQty;
+
+	@ApiModelProperty(value = "销毁完成数量,必须不大于报损数量,且支持小数")
+	@Column(value = "destroyed_qty")
+	private String destroyedQty;
+
+	@ApiModelProperty(value = "创建日期") 
+	@Column(value = "gmt_create")
+	private Date gmtCreate;
+
+	@ApiModelProperty(value = "创建人") 
+	@Column(value = "creator")
+	private String creator;
+
+	@ApiModelProperty(value = "创建人") 
+	@Column(value = "creator_name")
+	private String creatorName;
+
+	@ApiModelProperty(value = "最后修改日期") 
+	@Column(value = "gmt_modified")
+	private Date gmtModified;
+
+	@ApiModelProperty(value = "日期")
+	@Column(value = "REF_BILL_DATE")
+	private Date refBillDate;
+
+	@ApiModelProperty(value = "最后修改人") 
+	@Column(value = "modifier")
+	private String modifier;
+
+	@ApiModelProperty(value = "最后修改人") 
+	@Column(value = "modifier_name")
+	private String modifierName;
+
+	@ApiModelProperty(value = "批次ID")
+	@Column(value = "batch_id")
+	private String batchId;
+
+	@ApiModelProperty(value = "行号")
+	@Column(value = "seq_no")
+	private String seqNo;
+
+	@ApiModelProperty(value = "批号")
+	@Ignore
+	private String manufacturerLotNum;
+
+	public String getSeqNo() {
+		return seqNo;
+	}
+
+	public void setSeqNo(String seqNo) {
+		this.seqNo = seqNo;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getLossId() {
+		return lossId;
+	}
+
+	public void setLossId(String lossId) {
+		this.lossId = lossId;
+	}
+
+	public String getLossCode() {
+		return lossCode;
+	}
+
+	public void setLossCode(String lossCode) {
+		this.lossCode = lossCode;
+	}
+
+	public String getEnterpriseId() {
+		return enterpriseId;
+	}
+
+	public void setEnterpriseId(String enterpriseId) {
+		this.enterpriseId = enterpriseId;
+	}
+
+	public String getDcId() {
+		return dcId;
+	}
+
+	public void setDcId(String dcId) {
+		this.dcId = dcId;
+	}
+
+	public String getWarehouseId() {
+		return warehouseId;
+	}
+
+	public void setWarehouseId(String warehouseId) {
+		this.warehouseId = warehouseId;
+	}
+
+	public String getCargoOwnerId() {
+		return cargoOwnerId;
+	}
+
+	public void setCargoOwnerId(String cargoOwnerId) {
+		this.cargoOwnerId = cargoOwnerId;
+	}
+
+	public String getLocatorId() {
+		return locatorId;
+	}
+
+	public void setLocatorId(String locatorId) {
+		this.locatorId = locatorId;
+	}
+
+	public String getLocatorCode() {
+		return locatorCode;
+	}
+
+	public void setLocatorCode(String locatorCode) {
+		this.locatorCode = locatorCode;
+	}
+
+	public String getItemId() {
+		return itemId;
+	}
+
+	public void setItemId(String itemId) {
+		this.itemId = itemId;
+	}
+
+	public String getItemCode() {
+		return itemCode;
+	}
+
+	public void setItemCode(String itemCode) {
+		this.itemCode = itemCode;
+	}
+
+	public String getLotNum() {
+		return lotNum;
+	}
+
+	public void setLotNum(String lotNum) {
+		this.lotNum = lotNum;
+	}
+
+	public String getUnqualifiedQty() {
+		return unqualifiedQty;
+	}
+
+	public void setUnqualifiedQty(String unqualifiedQty) {
+		this.unqualifiedQty = unqualifiedQty;
+	}
+
+	public String getUnqualifiedReason() {
+		return unqualifiedReason;
+	}
+
+	public void setUnqualifiedReason(String unqualifiedReason) {
+		this.unqualifiedReason = unqualifiedReason;
+	}
+
+	public String getQualityStatus() {
+		return qualityStatus;
+	}
+
+	public void setQualityStatus(String qualityStatus) {
+		this.qualityStatus = qualityStatus;
+	}
+
+	public String getOpinion() {
+		return opinion;
+	}
+
+	public void setOpinion(String opinion) {
+		this.opinion = opinion;
+	}
+
+	public String getRefBillId() {
+		return refBillId;
+	}
+
+	public void setRefBillId(String refBillId) {
+		this.refBillId = refBillId;
+	}
+
+	public String getRefBillType() {
+		return refBillType;
+	}
+
+	public void setRefBillType(String refBillType) {
+		this.refBillType = refBillType;
+	}
+
+	public String getStatus() {
+		return status;
+	}
+
+	public void setStatus(String status) {
+		this.status = status;
+	}
+
+	public String getLossQty() {
+		return lossQty;
+	}
+
+	public void setLossQty(String lossQty) {
+		this.lossQty = lossQty;
+	}
+
+	public String getDestroyingQty() {
+		return destroyingQty;
+	}
+
+	public void setDestroyingQty(String destroyingQty) {
+		this.destroyingQty = destroyingQty;
+	}
+
+	public String getDestroyedQty() {
+		return destroyedQty;
+	}
+
+	public void setDestroyedQty(String destroyedQty) {
+		this.destroyedQty = destroyedQty;
+	}
+
+	public Date getGmtCreate() {
+		return gmtCreate;
+	}
+
+	public void setGmtCreate(Date gmtCreate) {
+		this.gmtCreate = gmtCreate;
+	}
+
+	public String getCreator() {
+		return creator;
+	}
+
+	public void setCreator(String creator) {
+		this.creator = creator;
+	}
+
+	public String getCreatorName() {
+		return creatorName;
+	}
+
+	public void setCreatorName(String creatorName) {
+		this.creatorName = creatorName;
+	}
+
+	public Date getGmtModified() {
+		return gmtModified;
+	}
+
+	public void setGmtModified(Date gmtModified) {
+		this.gmtModified = gmtModified;
+	}
+
+	public Date getRefBillDate() {
+		return refBillDate;
+	}
+
+	public void setRefBillDate(Date refBillDate) {
+		this.refBillDate = refBillDate;
+	}
+
+	public String getModifier() {
+		return modifier;
+	}
+
+	public void setModifier(String modifier) {
+		this.modifier = modifier;
+	}
+
+	public String getModifierName() {
+		return modifierName;
+	}
+
+	public void setModifierName(String modifierName) {
+		this.modifierName = modifierName;
+	}
+
+	public String getBatchId() {
+		return batchId;
+	}
+
+	public void setBatchId(String batchId) {
+		this.batchId = batchId;
+	}
+
+	public String getManufacturerLotNum() {
+		return manufacturerLotNum;
+	}
+
+	public void setManufacturerLotNum(String manufacturerLotNum) {
+		this.manufacturerLotNum = manufacturerLotNum;
+	}
+}

+ 120 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUnqualifiedStock.java

@@ -0,0 +1,120 @@
+package com.prolog.cs.base.gsp.model;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.prolog.framework.core.annotation.AutoKey;
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Id;
+import com.prolog.framework.core.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Description  
+ * @Date 2021-05-17 
+ */
+
+@Data
+@ApiModel
+@Table ( value ="gsp_unqualified_stock" )
+public class GspUnqualifiedStock  implements Serializable {
+	
+	private static final long serialVersionUID =  8097738355432592239L;
+	@Id
+	
+	@ApiModelProperty(value = "行ID") 
+	@Column(value = "id")
+	private String id;
+
+	@ApiModelProperty(value = "企业ID") 
+	@Column(value = "enterprise_id")
+	private String enterpriseId;
+
+	@ApiModelProperty(value = "仓配中心ID") 
+	@Column(value = "dc_id")
+	private String dcId;
+
+	@ApiModelProperty(value = "仓ID") 
+	@Column(value = "warehouse_id")
+	private String warehouseId;
+
+	@ApiModelProperty(value = "货主id") 
+	@Column(value = "cargo_owner_id")
+	private String cargoOwnerId;
+
+	@ApiModelProperty(value = "货位ID") 
+	@Column(value = "locator_id")
+	private String locatorId;
+
+	@ApiModelProperty(value = "货位编号") 
+	@Column(value = "locator_code")
+	private String locatorCode;
+
+	@ApiModelProperty(value = "商品ID") 
+	@Column(value = "item_id")
+	private String itemId;
+
+	@ApiModelProperty(value = "商品编号") 
+	@Column(value = "item_code")
+	private String itemCode;
+
+	@ApiModelProperty(value = "批号") 
+	@Column(value = "lot_num")
+	private String lotNum;
+
+	@ApiModelProperty(value = "不合格数量") 
+	@Column(value = "unqualified_qty")
+	private String unqualifiedQty;
+
+	@ApiModelProperty(value = "报损申请数据量") 
+	@Column(value = "lossing_qty")
+	private String lossingQty;
+
+	@ApiModelProperty(value = "报损已审核数量") 
+	@Column(value = "loss_qty")
+	private String lossQty;
+
+	@ApiModelProperty(value = "销毁申请数量") 
+	@Column(value = "destroying_qty")
+	private String destroyingQty;
+
+	@ApiModelProperty(value = "销毁数量") 
+	@Column(value = "destroy_qty")
+	private String destroyQty;
+
+	@ApiModelProperty(value = "创建日期") 
+	@Column(value = "gmt_create")
+	private Date gmtCreate;
+
+	@ApiModelProperty(value = "创建人") 
+	@Column(value = "creator")
+	private String creator;
+
+	@ApiModelProperty(value = "创建人") 
+	@Column(value = "creator_name")
+	private String creatorName;
+
+	@ApiModelProperty(value = "最后修改日期") 
+	@Column(value = "gmt_modified")
+	private Date gmtModified;
+
+	@ApiModelProperty(value = "最后修改人") 
+	@Column(value = "modifier")
+	private String modifier;
+
+	@ApiModelProperty(value = "最后修改人") 
+	@Column(value = "modifier_name")
+	private String modifierName;
+
+	@ApiModelProperty(value = "备注") 
+	@Column(value = "remark")
+	private String remark;
+
+	@ApiModelProperty(value = "批次") 
+	@Column(value = "batch_id")
+	private String batchId;
+
+}

+ 410 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUpkeepCheck.java

@@ -0,0 +1,410 @@
+package com.prolog.cs.base.gsp.model;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Id;
+import com.prolog.framework.core.annotation.Ignore;
+import com.prolog.framework.core.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Description
+ * @Date 2021-05-19
+ */
+
+@ApiModel
+@Data
+@Table(value = "gsp_upkeep_check")
+public class GspUpkeepCheck implements Serializable {
+    private static final long serialVersionUID = 6278321957398812097L;
+    @Id
+    @ApiModelProperty(value = "ID")
+    @Column(value = "id")
+    private String id;
+
+    @ApiModelProperty(value = "养护明细单号")
+    @Column(value = "code")
+    private String code;
+
+    @ApiModelProperty(value = "企业ID")
+    @Column(value = "enterprise_id")
+    private String enterpriseId;
+
+    @ApiModelProperty(value = "仓配中心ID")
+    @Column(value = "dc_id")
+    private String dcId;
+
+    @ApiModelProperty(value = "仓ID")
+    @Column(value = "warehouse_id")
+    private String warehouseId;
+
+    @ApiModelProperty(value = "货主ID")
+    @Column(value = "cargo_owner_id")
+    private String cargoOwnerId;
+
+    @ApiModelProperty(value = "批次ID")
+    @Column(value = "batch_id")
+    private String batchId;
+
+    @ApiModelProperty(value = "养护计划ID")
+    @Column(value = "plan_id")
+    private String planId;
+
+    @ApiModelProperty(value = "养护计划CODE")
+    @Column(value = "plan_code")
+    private String planCode;
+
+    @ApiModelProperty(value = "商品ID")
+    @Column(value = "item_id")
+    private String itemId;
+
+    @ApiModelProperty(value = "商品编号")
+    @Column(value = "item_code")
+    private String itemCode;
+
+    @ApiModelProperty(value = "商品条码")
+    @Column(value = "item_barcode")
+    private String itemBarcode;
+
+    @ApiModelProperty(value = "批号")
+    @Column(value = "LOT_NUM")
+    private String lotNum;
+
+    @ApiModelProperty(value = "货位ID")
+    @Column(value = "locator_id")
+    private String locatorId;
+
+    @ApiModelProperty(value = "货位编号")
+    @Column(value = "locator_code")
+    private String locatorCode;
+
+    @ApiModelProperty(value = "库存数量")
+    @Column(value = "stock_qty")
+    private String stockQty;
+
+    @ApiModelProperty(value = "养护数量")
+    @Column(value = "upkeep_qty")
+    private String upkeepQty;
+
+    @ApiModelProperty(value = "养护待处理数量")
+    @Column(value = "pending_qty")
+    private BigDecimal pendingQty;
+
+    @ApiModelProperty(value = "养护类型:(0=一般 1=重点)")
+    @Column(value = "IS_PROTECTED")
+    private Integer isProtected;
+
+    @ApiModelProperty(value = "类型:0=未分类 1=重点特殊药品,2=重点专管药品,3=重点其他药品,4=重点医疗器械,5=重点非药品,3=一般药品,4=一般器械,5=一般非药品")
+    @Column(value = "UPKEEP_TYPE")
+    private Integer upkeepType;
+
+    @ApiModelProperty(value = "养护员")
+    @Column(value = "upkeep_operator")
+    private String upkeepOperator;
+
+    @ApiModelProperty(value = "状态:0初始,1-正常无需质检,2-质检,3-质检无需复检,4-复检,5-复检完成,6-发起移库完成")
+    @Column(value = "status")
+    private String status;
+
+    @ApiModelProperty(value = "来源:0-自动;1手动")
+    @Column(value = "source_type")
+    private String sourceType;
+
+    @ApiModelProperty(value = "养护结论:0=待处理,1=合格,2=不合格")
+    @Column(value = "upkeep_conclusion")
+    private Integer upkeepConclusion;
+
+    @ApiModelProperty(value = "一级审核结论:0=待处理,1=合格,2=不合格")
+    @Column(value = "check_conclusion")
+    private Integer checkConclusion;
+
+    @ApiModelProperty(value = "二级审核结论:1=合格, 2=不合格入不合格库 3=不合格入不合格库")
+    @Column(value = "recheck_conclusion")
+    private Integer recheckConclusion;
+
+    @ApiModelProperty(value = "最终结论:1=合格,2=不合格入不合格库 3=不合格入不合格库")
+    @Column(value = "conclusion")
+    private Integer conclusion;
+
+    @ApiModelProperty(value = "处理意见")
+    @Column(value = "process_opinion")
+    private String processOpinion;
+
+    @ApiModelProperty(value = "审核员")
+    @Column(value = "check_operator")
+    private String checkOperator;
+
+    @ApiModelProperty(value = "审核意见")
+    @Column(value = "check_opinion")
+    private String checkOpinion;
+
+    @ApiModelProperty(value = "复检员")
+    @Column(value = "recheck_operator")
+    private String recheckOperator;
+
+    @ApiModelProperty(value = "复检意见")
+    @Column(value = "recheck_opinion")
+    private String recheckOpinion;
+
+    @ApiModelProperty(value = "外观(0=未选 1=已选)")
+    @Column(value = "check_wai_guan")
+    private Boolean checkWaiGuan;
+
+    @ApiModelProperty(value = "包装(0=未选 1=已选)")
+    @Column(value = "check_bao_zhuang")
+    private Boolean checkBaoZhuang;
+
+    @ApiModelProperty(value = "存储条件(0=未选 1=已选)")
+    @Column(value = "check_chen_chu_tiao_jian")
+    private Boolean checkChenChuTiaoJian;
+
+    @ApiModelProperty(value = "翻跺(0=未选 1=已选)")
+    @Column(value = "check_fan_duo")
+    private Boolean checkFanDuo;
+
+    @ApiModelProperty(value = "除湿(0=未选 1=已选)")
+    @Column(value = "check_chu_shi")
+    private Boolean checkChuShi;
+
+    @ApiModelProperty(value = "加湿(0=未选 1=已选)")
+    @Column(value = "check_jia_shi")
+    private Boolean checkJiaShi;
+
+    @ApiModelProperty(value = "升温(0=未选 1=已选)")
+    @Column(value = "check_shen_wen")
+    private Boolean checkShenWen;
+
+    @ApiModelProperty(value = "降温(0=未选 1=已选)")
+    @Column(value = "check_jiang_wen")
+    private Boolean checkJiangWen;
+
+    @ApiModelProperty(value = "通风(0=未选 1=已选)")
+    @Column(value = "check_tong_feng")
+    private Boolean checkTongFeng;
+
+    @ApiModelProperty(value = "除尘(0=未选 1=已选)")
+    @Column(value = "check_chu_chen")
+    private Boolean checkChuChen;
+
+    @ApiModelProperty(value = "质量状况:0=未确定 1=合格 2=不合格")
+    @Column(value = "quality_status")
+    private String qualityStatus;
+
+    @ApiModelProperty(value = "温湿度状况")
+    @Column(value = "ths_tatus")
+    private String thsTatus;
+
+    @ApiModelProperty(value = "养护待处理原因")
+    @Column(value = "pending_reason")
+    private String pendingReason;
+
+    @ApiModelProperty(value = "计划养护时间")
+    @Column(value = "plan_upkeep_date")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date planUpkeepDate;
+
+    @ApiModelProperty(value = "养护时间")
+    @Column(value = "upkeep_date")
+    private Date upkeepDate;
+
+    @ApiModelProperty(value = "一检时间")
+    @Column(value = "check_date")
+    private Date checkDate;
+
+    @ApiModelProperty(value = "复检日期")
+    @Column(value = "recheck_date")
+    private Date recheckDate;
+
+    //@ApiModelProperty(value = "生产日期")
+    @Column(value = "PDATE_FROM")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date pdateFrom;
+
+    //@ApiModelProperty(value = "有效期至")
+    @Column(value = "VALID_UNTIL")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date validUntil;
+
+    //@ApiModelProperty(value = "创建日期")
+    @Column(value = "gmt_create")
+    private Date gmtCreate;
+
+    //@ApiModelProperty(value = "创建人")
+    @Column(value = "creator")
+    private String creator;
+
+    //@ApiModelProperty(value = "创建人")
+    @Column(value = "creator_name")
+    private String creatorName;
+
+    //@ApiModelProperty(value = "最后修改日期")
+    @Column(value = "gmt_modified")
+    private Date gmtModified;
+
+    @ApiModelProperty(value = "最后修改人")
+    @Column(value = "modifier")
+    private String modifier;
+
+    @ApiModelProperty(value = "最后修改人")
+    @Column(value = "modifier_name")
+    private String modifierName;
+
+    @ApiModelProperty(value = "备注")
+    @Column(value = "remark")
+    private String remark;
+
+    @ApiModelProperty(value = "建筑物ID")
+    @Column(value = "BLDG_ID")
+    private String bldgId;
+
+    @ApiModelProperty(value = "商品大类(字典) (对应ERP药品大类)(oms增加)")
+    @Column(value = "ITEM_HEALTH_CATEGORY")
+    private String itemHealthCategory;
+
+    @Ignore
+    @ApiModelProperty(value = "仓库")
+    private String warehouseName;
+
+    @Ignore
+    @ApiModelProperty(value = "货主")
+    private String cargoOwnerName;
+
+    @Ignore
+    @ApiModelProperty(value = "商品名称")
+    private String itemName;
+
+    @Ignore
+    @ApiModelProperty(value = "货位")
+    private String locatorName;
+
+    @Ignore
+    @ApiModelProperty(value = "生产日期")
+    private String productionDate;
+
+    @Ignore
+    @ApiModelProperty(value = "有效期至日期")
+    private String expiredDate;
+
+    @Ignore
+    @ApiModelProperty(value = "显示生产日期")
+    private String showProductionDate;
+
+    @Ignore
+    @ApiModelProperty(value = "显示有效期至日期")
+    private String showExpiredDate;
+
+    @Ignore
+    @ApiModelProperty(value = "上市许可持有人")
+    private String itemHealthListedLicensor;
+
+    @Ignore
+    @ApiModelProperty(value = "下架库存状态")
+    private String outStockStatus;
+
+    @Ignore
+    @ApiModelProperty(value = "上架库存状态")
+    private String inStockStatus;
+
+    @ApiModelProperty(value = "是否近效期:(0=否 1=是)")
+    @Column(value = "IS_NEAR_DATE")
+    private String isNearDate;
+
+    @ApiModelProperty(value = "计划养护数量")
+    @Column(value = "PLAN_STOCK_QTY")
+    private String planStockQty;
+
+    // 设备养护合格数
+    @Ignore
+    @ApiModelProperty(value = "设备养护合格数量")
+    private String okQty;
+
+    /**
+     * 虫蛀(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "虫蛀(0=未选 1=已选)")
+    @Column(value = "CHECK_CHONG_ZHU")
+    private Boolean checkChongZhu;
+
+    /**
+     * 发霉(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "发霉(0=未选 1=已选)")
+    @Column(value = "CHECK_FA_MEI")
+    private Boolean checkFaMei;
+
+    /**
+     * 泛油(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "泛油(0=未选 1=已选)")
+    @Column(value = "CHECK_FAN_YOU")
+    private Boolean checkFanYou;
+
+    /**
+     * 潮解(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "潮解(0=未选 1=已选)")
+    @Column(value = "CHECK_CHAO_JIE")
+    private Boolean checkChaoJie;
+
+    /**
+     * 变色(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "变色(0=未选 1=已选)")
+    @Column(value = "CHECK_BIAN_SE")
+    private Boolean checkBianSe;
+
+    /**
+     * 上斗(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "上斗(0=未选 1=已选)")
+    @Column(value = "CHECK_SHANG_DOU")
+    private Boolean checkShangDou;
+
+    /**
+     * 破损(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "破损(0=未选 1=已选)")
+    @Column(value = "CHECK_PO_SUN")
+    private Boolean checkPoSun;
+
+    /**
+     * 破损(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "遮光(0=未选 1=已选)")
+    @Column(value = "CHECK_ZHE_GUANG")
+    private Boolean checkZheGuang;
+
+
+    /**
+     * 破损(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "避光(0=未选 1=已选)")
+    @Column(value = "CHECK_BI_GUANG")
+    private Boolean checkBiGuang;
+
+    @ApiModelProperty(value = "是否已发出库指令(0-否;1-已发未达;2-已送达)")
+    @Column(value = "outbound_instruct")
+    private Integer outboundInstruct;
+
+    @ApiModelProperty(value = "容器编码")
+    @Column(value = "container_code")
+    private String containerCode;
+
+    @ApiModelProperty(value = "容器编码")
+    @Column(value = "location_no")
+    private String locationNo;
+
+    @ApiModelProperty(value = "容器编码")
+    @Column(value = "STORE_TEMPERATURE")
+    private String storeTemperature;
+
+    @ApiModelProperty(value = "出库库区")
+    @Ignore
+    private String outWhAreaCategory;
+}

+ 132 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/GspUpkeepCheckPlan.java

@@ -0,0 +1,132 @@
+package com.prolog.cs.base.gsp.model;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.prolog.cs.base.gsp.vo.GspUpkeepCheckVO;
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Id;
+import com.prolog.framework.core.annotation.Ignore;
+import com.prolog.framework.core.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description
+ * @Date 2021-05-19
+ */
+
+@Data
+@ApiModel
+@Table(value = "gsp_upkeep_check_plan")
+public class GspUpkeepCheckPlan implements Serializable {
+    private static final long serialVersionUID = 8241210990350951861L;
+
+    @Id
+    @ApiModelProperty(value = "单据ID")
+    @Column(value = "id")
+    private String id;
+
+    @ApiModelProperty(value = "养护单号")
+    @Column(value = "code")
+    private String code;
+
+    @ApiModelProperty(value = "企业ID")
+    @Column(value = "enterprise_id")
+    private String enterpriseId;
+
+    @ApiModelProperty(value = "仓配中心ID")
+    @Column(value = "dc_id")
+    private String dcId;
+
+    @ApiModelProperty(value = "仓ID")
+    @Column(value = "warehouse_id")
+    private String warehouseId;
+
+    @ApiModelProperty(value = "货主id")
+    @Column(value = "cargo_owner_id")
+    private String cargoOwnerId;
+
+    @ApiModelProperty(value = "状态:10=初始 20=已审批 30=已驳回")
+    @Column(value = "status")
+    private String status;
+
+    @ApiModelProperty(value = "数据来源")
+    @Column(value = "source")
+    private String source;
+
+    @ApiModelProperty(value = "创建日期")
+    @Column(value = "gmt_create")
+    private Date gmtCreate;
+
+    @ApiModelProperty(value = "创建人")
+    @Column(value = "creator")
+    private String creator;
+
+    @ApiModelProperty(value = "创建人")
+    @Column(value = "creator_name")
+    private String creatorName;
+
+    @ApiModelProperty(value = "最后修改日期")
+    @Column(value = "gmt_modified")
+    private Date gmtModified;
+
+    @ApiModelProperty(value = "最后修改人")
+    @Column(value = "modifier")
+    private String modifier;
+
+    @ApiModelProperty(value = "最后修改人")
+    @Column(value = "modifier_name")
+    private String modifierName;
+
+    @ApiModelProperty(value = "备注")
+    @Column(value = "remark")
+    private String remark;
+
+    @ApiModelProperty(value = "打印次数")
+    @Column(value = "PRINT_COUNT")
+    private Integer printCount;
+
+    @ApiModelProperty(value = "建筑物ID")
+    @Column(value = "BLDG_ID")
+    private String bldgId;
+
+    @Ignore
+    @ApiModelProperty(value = "货主")
+    private String cargoOwnerName;
+
+    @Ignore
+    @ApiModelProperty(value = "仓库Name")
+    private String warehouseName;
+
+    @Ignore
+    private List<GspUpkeepCheckVO> gspUpkeepCheckList;
+
+    @Ignore
+    @ApiModelProperty(value = "建筑物")
+    private String bldgName;
+
+    @ApiModelProperty(value = "")
+    @Column(value = "IS_PROTECTED")
+    private Integer isProtected;
+
+    @ApiModelProperty(value = "类型:0=未分类 1=重点特殊药品,2=重点专管药品,3=重点其他药品,4=重点医疗器械,5=重点非药品,3=一般药品,4=一般器械,5=一般非药品")
+    @Column(value = "UPKEEP_TYPE")
+    private Integer upkeepType;
+
+    @Ignore
+    @ApiModelProperty(value = "类型:0=未分类 1=重点特殊药品,2=重点专管药品,3=重点其他药品,4=重点医疗器械,5=重点非药品,3=一般药品,4=一般器械,5=一般非药品")
+    private String upkeepTypeDesc;
+
+    @Ignore
+    @ApiModelProperty(value = "打印时间")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date printDate;
+
+    @Ignore
+    @ApiModelProperty(value = "养护员")
+    private String operBy;
+}

+ 241 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/model/OmsInventoryOrder.java

@@ -0,0 +1,241 @@
+package com.prolog.cs.base.gsp.model;
+
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Id;
+import com.prolog.framework.core.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Description
+ * @Date 2021-06-29
+ */
+@Data
+@ApiModel
+@Table(value = "oms_inventory_order")
+public class OmsInventoryOrder implements Serializable {
+	private static final long serialVersionUID = 850376771022738974L;
+
+	@Id
+	@ApiModelProperty(value = "行ID")
+	@Column(value = "lineid")
+	private String lineid;
+
+	@ApiModelProperty(value = "单据ID")
+	@Column(value = "billid")
+	private String billid;
+
+	@ApiModelProperty(value = "单据编号 GL_年月日_4位序列号")
+	@Column(value = "billno")
+	private String billno;
+
+	@ApiModelProperty(value = "单据类型 1:报损单2:报溢单")
+	@Column(value = "type")
+	private String type;
+
+	@ApiModelProperty(value = "状态0:已作废10:已创建 20审核中 30已驳回 40已审核")
+	@Column(value = "status")
+	private String status;
+
+	@ApiModelProperty(value = "货主ID")
+	@Column(value = "consignorid")
+	private String consignorid;
+
+	@ApiModelProperty(value = "货主名称")
+	@Column(value = "consignorname")
+	private String consignorname;
+
+	@ApiModelProperty(value = "仓库名称")
+	@Column(value = "branchname")
+	private String branchname;
+
+	@ApiModelProperty(value = "仓库ID")
+	@Column(value = "branchid")
+	private String branchid;
+
+	@ApiModelProperty(value = "商品ID")
+	@Column(value = "itemid")
+	private String itemid;
+
+	@ApiModelProperty(value = "商品名称")
+	@Column(value = "itemname")
+	private String itemname;
+
+	@ApiModelProperty(value = "商品编码")
+	@Column(value = "itemcode")
+	private String itemcode;
+
+	@ApiModelProperty(value = "单价")
+	@Column(value = "price")
+	private BigDecimal price;
+
+	@ApiModelProperty(value = "数量")
+	@Column(value = "amount")
+	private BigDecimal amount;
+
+	@ApiModelProperty(value = "包装数量")
+	@Column(value = "pack_amount")
+	private BigDecimal packAmount;
+
+	@ApiModelProperty(value = "包装单位")
+	@Column(value = "pack_unit")
+	private String packUnit;
+
+	@ApiModelProperty(value = "总金额")
+	@Column(value = "total_price")
+	private BigDecimal totalPrice;
+
+	@ApiModelProperty(value = "规格")
+	@Column(value = "spec")
+	private String spec;
+
+	@ApiModelProperty(value = "产地")
+	@Column(value = "place")
+	private String place;
+
+	@ApiModelProperty(value = "生产企业")
+	@Column(value = "manufacturer")
+	private String manufacturer;
+
+	@ApiModelProperty(value = "批号")
+	@Column(value = "batch_num")
+	private String batchNum;
+
+	@ApiModelProperty(value = "生产日期")
+	@Column(value = "production_date")
+	private Date productionDate;
+
+	@ApiModelProperty(value = "有效期至")
+	@Column(value = "expired_date")
+	private Date expiredDate;
+
+	@ApiModelProperty(value = "批准文号")
+	@Column(value = "approval_number")
+	private String approvalNumber;
+
+	@ApiModelProperty(value = "原因")
+	@Column(value = "reason")
+	private String reason;
+
+	@ApiModelProperty(value = "扩展字段1")
+	@Column(value = "attr_str1")
+	private String attrStr1;
+
+	@ApiModelProperty(value = "扩展字段2")
+	@Column(value = "attr_str2")
+	private String attrStr2;
+
+	@ApiModelProperty(value = "扩展字段3")
+	@Column(value = "attr_str3")
+	private String attrStr3;
+
+	@ApiModelProperty(value = "扩展字段4")
+	@Column(value = "attr_str4")
+	private String attrStr4;
+
+	@ApiModelProperty(value = "扩展字段5")
+	@Column(value = "attr_str5")
+	private String attrStr5;
+
+	@ApiModelProperty(value = "创建时间")
+	@Column(value = "createdate")
+	private Date createdate;
+
+	@ApiModelProperty(value = "创建人")
+	@Column(value = "createby")
+	private String createby;
+
+	@ApiModelProperty(value = "修改时间")
+	@Column(value = "lastmodifydate")
+	private Date lastmodifydate;
+
+	@ApiModelProperty(value = "修改人")
+	@Column(value = "lastmodifyby")
+	private String lastmodifyby;
+
+	@ApiModelProperty(value = "企业ID")
+	@Column(value = "p_enterpriseid")
+	private String enterpriseid;
+
+	@ApiModelProperty(value = "企业名称")
+	@Column(value = "p_enterprisename")
+	private String enterprisename;
+
+	@ApiModelProperty(value = "行号")
+	@Column(value = "seqno")
+	private String seqno;
+
+	@ApiModelProperty(value = "业务类型")
+	@Column(value = "billtype")
+	private String billtype;
+
+	@ApiModelProperty(value = "库存状态")
+	@Column(value = "stockstatus")
+	private String stockstatus;
+
+	@ApiModelProperty(value = "单据日期")
+	@Column(value = "billdate")
+	private Date billdate;
+
+	@ApiModelProperty(value = "基本数量")
+	@Column(value = "basenum")
+	private BigDecimal basenum;
+
+	@ApiModelProperty(value = "执行数量")
+	@Column(value = "execnum")
+	private BigDecimal execnum;
+
+	@ApiModelProperty(value = "个别计价")
+	@Column(value = "gebjj")
+	private BigDecimal gebjj;
+
+	@ApiModelProperty(value = "考核成本价")
+	@Column(value = "k_taxcost")
+	private BigDecimal kTaxcost;
+
+	@ApiModelProperty(value = "件包装规格")
+	@Column(value = "wmsmeas")
+	private String wmsmeas;
+
+	@ApiModelProperty(value = "业务员ID")
+	@Column(value = "salemanid")
+	private String salemanid;
+
+	@ApiModelProperty(value = "操作人ID")
+	@Column(value = "caozyid")
+	private String caozyid;
+
+	@ApiModelProperty(value = "部门ID")
+	@Column(value = "deptid")
+	private String deptid;
+
+	@ApiModelProperty(value = "备注")
+	@Column(value = "remark")
+	private String remark;
+
+	@ApiModelProperty(value = "货主编号")
+	@Column(value = "consignorcode")
+	private String consignorcode;
+
+	@ApiModelProperty(value = "仓库编号")
+	@Column(value = "branchcode")
+	private String branchcode;
+
+	@ApiModelProperty(value = "1:wms;2:erp")
+	@Column(value = "datasource")
+	private String datasource;
+	
+	@ApiModelProperty(value = "是否需要销毁")
+	@Column(value = "is_destroy")
+	private String isDestroy;
+	
+	@ApiModelProperty(value = "建筑物")
+	@Column(value = "building")
+	private String building;
+
+}

+ 33 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/GspQualityReviewService.java

@@ -0,0 +1,33 @@
+package com.prolog.cs.base.gsp.service;
+
+
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.model.DxiGspQualityReviewD;
+import com.prolog.cs.base.gsp.model.DxiGspQualityReviewH;
+import com.prolog.cs.base.gsp.vo.GspQualityCheckMoveItemVo;
+import com.prolog.cs.base.gsp.vo.GspQualityCheckMoveVo;
+import com.prolog.framework.core.pojo.Page;
+
+import java.util.List;
+
+/**
+ * @Description  
+ * @Date 2022-05-26
+ */
+
+public interface GspQualityReviewService {
+
+
+	Page<DxiGspQualityReviewH> listPage(String warehouseId, String cargoOwnerId, String requestBilltype, String billid, String status, Integer pageSize, Integer pageNum);
+
+	List<DxiGspQualityReviewD> findDetailByBillId(String billId);
+
+	void batchAudit(List<DxiGspQualityReviewD> list);
+
+    List<GspQualityCheckMoveVo> findQualityReview4MovePick(String warehouseId,String cargoOwnerId,String requestBilltype, String billno);
+
+	List<GspQualityCheckMoveItemVo> findQualityReview4MoveItemPick(String lineId);
+
+    void confirmQualityReviewMove(String[] arrList);
+
+}

+ 36 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/GspUnqualifiedDestroyService.java

@@ -0,0 +1,36 @@
+package com.prolog.cs.base.gsp.service;
+
+import com.prolog.cs.base.gsp.model.GspUnqualifiedDestroy;
+import com.prolog.cs.base.gsp.vo.GspUnqualifiedDestroyDVO;
+import com.prolog.framework.core.pojo.Page;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description  
+ * @Date 2021-05-10 
+ */
+
+public interface GspUnqualifiedDestroyService {
+
+
+	void add(GspUnqualifiedDestroy model);
+
+	@Transactional
+	void delIds(List<String> pkIdList);
+
+	Page<GspUnqualifiedDestroyDVO> listPagePick(String warehouseId, String cargoOwnerId, String refBillId, String itemId, Integer pageSize, Integer pageNum);
+	
+	Page<GspUnqualifiedDestroy> listPage(String warehouseId, String cargoOwnerId, String status, Integer pageSize, Integer pageNum);
+
+	List<GspUnqualifiedDestroyDVO> findDetailByMstId(String mstId);
+
+	void batchUpdate(List<GspUnqualifiedDestroy> gspUnqualifiedDestroyDTOList, String status) throws Exception;
+
+	@Transactional
+	void oneAudit(GspUnqualifiedDestroy gspUnqualifiedDestroyDTO, String status, Date auditDate) throws Exception;
+
+	GspUnqualifiedDestroy getById(String mstId);
+}

+ 39 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/GspUnqualifiedLossService.java

@@ -0,0 +1,39 @@
+package com.prolog.cs.base.gsp.service;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedLoss;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedLossD;
+import com.prolog.cs.base.gsp.vo.ErpUnqualifiedLossVo;
+import com.prolog.cs.base.gsp.vo.GspUnqualifiedLossDVO;
+import com.prolog.cs.base.gsp.vo.LossToOmsVo;
+import com.prolog.framework.core.pojo.Page;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @Description  
+ * @Date 2021-05-10 
+ */
+
+public interface GspUnqualifiedLossService {
+
+
+	Boolean add(GspUnqualifiedLoss model);
+
+	@Transactional
+	void delIds(List<String> pkIdList);
+
+	Page<GspUnqualifiedLoss> listPage(String warehouseId, String cargoOwnerId, String status, Integer pageSize, Integer pageNum);
+
+	List<GspUnqualifiedLossDVO> findDetailByMstId(String mstId);
+
+	List<GspUnqualifiedLossDVO> spellGspUnqualifiedLossDVOS(List<GspUnqualifiedLossD> list);
+
+	void batchAudit(List<GspUnqualifiedLoss> list,String status) throws Exception;
+
+	void oneAudit(GspUnqualifiedLoss gspUnqualifiedLoss, String status, Date auditDate) throws Exception;
+
+    Boolean erpAdd(ErpUnqualifiedLossVo vo);
+}

+ 23 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/GspUpkeepCheckPlanService.java

@@ -0,0 +1,23 @@
+package com.prolog.cs.base.gsp.service;
+
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheckPlan;
+import com.prolog.framework.core.pojo.Page;
+
+import java.util.List;
+
+/**
+ * @Description  
+ * @Date 2021-05-10 
+ */
+
+public interface GspUpkeepCheckPlanService {
+	
+	Page<GspUpkeepCheckPlan> findPlan(QueryDTO upkeepCheckDTO);
+
+	List<GspUpkeepCheckPlan> spellGspUpkeepCheckPlans(List<GspUpkeepCheckPlan> list);
+
+	List<GspUpkeepCheckPlan> findUpkeepPlan4MovePick(QueryDTO upkeepCheckDTO);
+
+	String spellUpkeepType(Integer upkeepType);
+}

+ 53 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/GspUpkeepCheckService.java

@@ -0,0 +1,53 @@
+package com.prolog.cs.base.gsp.service;
+
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheck;
+import com.prolog.cs.base.gsp.vo.GspUpkeepCheckVO;
+import com.prolog.cs.base.gsp.vo.InfTaskOutBackDTO;
+import com.prolog.cs.base.gsp.vo.RfGspUpkeepCheckVO;
+import com.prolog.framework.core.pojo.Page;
+import com.prolog.upcloud.base.inventory.model.WmsInvStockLot;
+import com.prolog.upcloud.base.inventory.vo.InfTaskOutBackVO;
+
+import java.util.List;
+
+/**
+ * @Description
+ * @Date 2021-05-10
+ */
+
+public interface GspUpkeepCheckService {
+
+
+    void batchAddStockLockDb(List<WmsInvStockLot> wmsInvStockLots);
+
+    void batchAdd(String source, List<GspUpkeepCheck> model);
+
+    public String[] batchEdit(List<GspUpkeepCheck> model, boolean isCheck);
+
+    Page<GspUpkeepCheckVO> listPage(String warehouseId, String cargoOwnerId, String status, String billtype, Integer pageSize, Integer pageNum);
+
+    Page<GspUpkeepCheckVO> findUpkeepPage(QueryDTO upkeepCheckDTO);
+
+    List<GspUpkeepCheckVO> findUpkeepItem4MovePick(String id);
+
+    void confirmUpkeepMove(String[] arrList);
+
+    public List<GspUpkeepCheckVO> spellGspUpkeepCheckVOSPage(List<GspUpkeepCheck> list);
+
+    void confirmDevice();
+
+    void sendTaskToEis(List<String> ids);
+
+    Page<RfGspUpkeepCheckVO> findUpkeepPageByRf(QueryDTO dto);
+
+    GspUpkeepCheckVO findUpkeepDtlByRf(QueryDTO dto);
+
+    void callbackPushTask(List<String> ids);
+
+    void gspUpKeepOutBack(List<InfTaskOutBackDTO> upkeepList);
+
+    String getLocationNoByLineId(String lineId);
+
+    void addStockUnLock(List<WmsInvStockLot> wmsInvStockLots);
+}

+ 10 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/MqGspConsumer.java

@@ -0,0 +1,10 @@
+package com.prolog.cs.base.gsp.service;
+
+import com.rabbitmq.client.Channel;
+import org.springframework.amqp.core.Message;
+
+public interface MqGspConsumer {
+    void gspTaskCallback(Message message, Channel channel);
+
+
+}

+ 16 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/service/MqGspProducer.java

@@ -0,0 +1,16 @@
+package com.prolog.cs.base.gsp.service;
+
+import com.prolog.entity.vo.OperationCompleteVO;
+import com.prolog.entity.vo.OutBoundRequestVO;
+import com.prolog.upcloud.base.wh.operate.model.EisLog;
+
+import java.util.List;
+
+public interface MqGspProducer {
+    void outBoundRequest(List<OutBoundRequestVO> list);
+
+    void operationComplete(List<OperationCompleteVO> list);
+
+    void saveEisLog(EisLog eisLog);
+
+}

+ 42 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/CallOutTaskVO.java

@@ -0,0 +1,42 @@
+package com.prolog.cs.base.gsp.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * EIS出库任务回告VO
+ *
+ * @author 鄢菁KingYan
+ * @date 2022/07/13
+ */
+@Data
+public class CallOutTaskVO {
+
+    @ApiModelProperty(value = "仓库编号", required = true)
+    private String warehouseId;
+    @ApiModelProperty(value = "货主ID", required = true)
+    private String ownerId;
+    @ApiModelProperty(value = "单据编号", required = true, notes = "出库单号,移库单号")
+    private String billNo;
+    @ApiModelProperty(value = "行号", required = true, notes = "有任务取任务的行号,无任务的业务取单明细的行号")
+    private String seqNo;
+    @ApiModelProperty(value = "作业类型", required = true)
+    private String workType;
+    @ApiModelProperty(value = "业务类型", required = true)
+    private String businessType;
+    @ApiModelProperty(value = "商品编号", required = true)
+    private String itemCode;
+    @ApiModelProperty(value = "数量", required = true, notes = "出库/移库/补货业务,按照需求数量;盘点按照EIS容器库存数;合托/养护默认0")
+    private BigDecimal qty;
+    @ApiModelProperty(value = "批号", required = true)
+    private String lotNo;
+    @ApiModelProperty(value = "订单优先级", required = true, notes = "出库,移库,盘点,养护,合托对应的优先级,生成指令时取配置默认的优先级,后续可以提升优先级")
+    private Integer priority;
+    @ApiModelProperty(value = "WMS出库货位", required = true, notes = "空托业务非必须,货位取值 说明:大货位:ASRS01,以上取值需要与EIS确定好,约定好,EIS靠此值来识别出库的库区范围")
+    private String wmslocationCode;
+    @ApiModelProperty(value = "指令ID", required = true, notes = "每行唯一")
+    private String msgId;
+
+}

+ 110 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/DxiGspMaintenanceRecordVO.java

@@ -0,0 +1,110 @@
+package com.prolog.cs.base.gsp.vo;
+
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Id;
+import com.prolog.framework.core.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Description
+ * @Date 2021-07-13
+ * 回传OMS接口平台对象
+ */
+
+@ApiModel
+@Data
+public class DxiGspMaintenanceRecordVO implements Serializable {
+	private static final long serialVersionUID =  2378979319518916810L;
+	
+
+	@ApiModelProperty(value = "单据编号")
+	private String billno;
+
+	@ApiModelProperty(value = "单据日期")
+	private String billdate;
+
+	@ApiModelProperty(value = "养护商品类型")
+	private String maintenanceType;
+
+	@ApiModelProperty(value = "仓库编码")
+	private String branchcode;
+
+	@ApiModelProperty(value = "货主编码")
+	private String consignorcode;
+
+	@ApiModelProperty(value = "商品编号")
+	private String itemcode;
+
+	@ApiModelProperty(value = "商品ID")
+	private String itemid;
+
+	@ApiModelProperty(value = "商品规格")
+	private String capacity;
+
+	@ApiModelProperty(value = "批准文号")
+	private String fsymbol;
+
+	@ApiModelProperty(value = "生产厂家")
+	private String ffactory;
+
+	@ApiModelProperty(value = "养护措施")
+	private String maintenanceMeasure;
+
+	@ApiModelProperty(value = "批号")
+	private String lotNo;
+
+	@ApiModelProperty(value = "库存数量")
+	private String onhandQuantity;
+
+	@ApiModelProperty(value = "养护结论")
+	private String maintenanceResult;
+
+	@ApiModelProperty(value = "养护员")
+	private String maintenanceby;
+
+	@ApiModelProperty(value = "审核员")
+	private String auditby;
+
+	@ApiModelProperty(value = "审核意见")
+	private String auditOpinion;
+
+	@ApiModelProperty(value = "养护数量")
+	private String maintenanceNum;
+
+	@ApiModelProperty(value = "养护待处理数量")
+	private String pendingNum;
+
+	@ApiModelProperty(value = "质量状况")
+	private String qualityState;
+
+	@ApiModelProperty(value = "温湿度状况")
+	private String humitureState;
+
+	@ApiModelProperty(value = "养护待处理原因")
+	private String manageReason;
+
+	@ApiModelProperty(value = "复检员")
+	private String recheckby;
+
+	@ApiModelProperty(value = "养护时间")
+	private String maintenanceDate;
+
+	@ApiModelProperty(value = "复检日期")
+	private String recheckDate;
+
+	@ApiModelProperty(value = "复检意见")
+	private String reviewOpinion;
+
+	@ApiModelProperty(value = "备注")
+	private String remark;
+
+	@ApiModelProperty(value = "企业ID")
+	private String penterpriseid;
+
+}

+ 49 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/EisCallOutTaskCallbackSubListVO.java

@@ -0,0 +1,49 @@
+package com.prolog.cs.base.gsp.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * EIS出库任务回告子列表VO
+ *
+ * @author 鄢菁KingYan
+ * @date 2022/07/13
+ */
+@Data
+public class EisCallOutTaskCallbackSubListVO {
+    @ApiModelProperty(value = "仓库编号", required = true)
+    private String warehouseId;
+    @ApiModelProperty(value = "仓库编号", required = true)
+    private String ownerId;
+    @ApiModelProperty(value = "单据编号", required = true, notes = "出库单号,移库单号")
+    private String billNo;
+    @ApiModelProperty(value = "行号", required = true, notes = "有任务取任务的行号,无任务的业务取单明细的行号")
+    private String seqNo;
+    @ApiModelProperty(value = "作业类型", required = true)
+    private String workType;
+    @ApiModelProperty(value = "业务类型", required = true)
+    private String businessType;
+    @ApiModelProperty(value = "商品编号", required = true)
+    private String itemCode;
+    @ApiModelProperty(value = "商品名称", required = false)
+    private String itemName;
+    @ApiModelProperty(value = "数量", required = true, notes = "出库/移库/补货业务,按照需求数量;盘点按照EIS容器库存数;合托/养护默认0")
+    private BigDecimal qty;
+    @ApiModelProperty(value = "EIS源货位", required = false)
+    private String locCode;
+    @ApiModelProperty(value = "批号", required = true)
+    private String lotNo;
+    @ApiModelProperty(value = "生产日期", required = true)
+    private Date yieldDate;
+    @ApiModelProperty(value = "有效日期", required = true)
+    private Date expDate;
+    @ApiModelProperty(value = "出库口", required = true, notes = "EIS对应的出库站台号,与WMS做好对照")
+    private String OutboundPlatform;
+    @ApiModelProperty(value = "WMS出库货位", required = true, notes = "空托业务非必须")
+    private String wmslocationCode;
+    @ApiModelProperty(value = "指令ID", required = true, notes = "每行唯一")
+    private String msgId;
+}

+ 29 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/EisCallOutTaskCallbackVO.java

@@ -0,0 +1,29 @@
+package com.prolog.cs.base.gsp.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
+
+/**
+ * EIS出库任务回告VO
+ *
+ * @author 鄢菁KingYan
+ * @date 2022/07/13
+ */
+@Data
+public class EisCallOutTaskCallbackVO {
+
+    @ApiModelProperty(value = "容器编号", required = true)
+    @NotBlank(message = "容器编号不能为空")
+    private String containerNo;
+
+    @ApiModelProperty(value = "部分是包括托盘对应的拣选信息")
+    @NotEmpty(message = "子列表不能为空")
+    @Valid
+    private List<EisCallOutTaskCallbackSubListVO> subList;
+
+}

+ 24 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/EisCheckBackDetailVo.java

@@ -0,0 +1,24 @@
+package com.prolog.cs.base.gsp.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class EisCheckBackDetailVo {
+    private String locationNo;//	String	货格号	否	AGV货架库:仅养护业务填入货格号,其他业务为空
+    private BigDecimal inventoryQty;//	Float	库存数量	否	仅针对养护:货格库存数量;
+    private String yhResult;//	String	养护结论(1:合格;2:不合格;3:待处理)	非必填	yhResult仅针对养护
+    private String yhItem1;//	String	翻剁	非必填	仅针对养护 1:是 空值:无
+    private String yhItem2;//	String	除湿	非必填	仅针对养护
+    private String yhItem3;//	String	加湿	非必填	仅针对养护
+    private String yhItem4;//		升温		仅针对养护
+    private String yhItem5;//		降温		仅针对养护
+    private String yhItem6;//		通风		仅针对养护
+    private String yhItem7;//		除尘		仅针对养护
+    private String yhItem9;//		防虫蛀		仅针对养护
+    private String yhItem10;//		防霉变		仅针对养护
+    private String yhItem11;//		防潮		仅针对养护
+    private String yhItem12;//		遮光		仅针对养护
+
+}

+ 37 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/EisPushTaskVO.java

@@ -0,0 +1,37 @@
+package com.prolog.cs.base.gsp.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * EIS出库任务回告VO
+ *
+ * @author 鄢菁KingYan
+ * @date 2022/07/13
+ */
+@Data
+public class EisPushTaskVO {
+
+    private String msgId;//	String	接口唯一性ID	是	无	幂等标识
+    private String taskId;//	String	WMS单据任务号	是		WMS单据任务号
+    private String warehouseId;//	String	仓库编号	是		江西鹰江:JXYJ;江西仁海:JXRH
+    private String workType;//	String	作业类型(见上述接口清单作业类型与业务类型约定)	是
+    private String businessType;// String	业务类型(见上述接口清单作业类型与业务类型约定)	是
+    private Integer priority;//	Number	订单优先级	是		出库,盘点对应的优先级,生成指令时取配置默认的优先级,后续可以提升优先级
+    private String seqNo;//	String	WMS单据任务行号	否	无	wms任务行号,没有则默认等于wms单据号
+    private String containerNo;//	String	容器号	否	无	正常出库/补货:AGV托盘库必填;盘点/移库/养护:四向库/AGV托盘库必填;其他业务非必填
+    private String ownerId;//	String	货主Id	否	无	正常出库:四向库/AGV货架库必填;补货:四向库必填;盘点/养护/移库:AGV货架库必填;指定容器非必填
+    private String ItemId;//	String	物料id	否	无	正常出库:四向库/AGV货架库必填;补货:四向库必填;盘点/养护/移库:AGV货架库必填;指定容器非必填
+    private String lotId;//	String	批次id	否	无	正常出库:四向库/AGV货架库必填;补货:四向库必填;盘点/养护/移库:AGV货架库必填;指定容器非必填
+    private String packId;//	String	包装ID	否	无	正常出库:四向库/AGV货架库必填;补货:四向库必填;盘点/养护/移库:AGV货架库必填;指定容器非必填
+    private BigDecimal qty;//	Float	数量(最小库存单位)	否	无	正常出库:四向库/AGV货架库必填;补货:四向库必填;盘点/养护/移库:AGV货架库必填;指定容器非必填
+    private String originalArea;//	String	源区域	否	无
+    private String originalLocation;//	String	源点位	否	无	可为空
+    private String targetArea;//	String	目标区域	否	无	AGV托盘整托出库区(必填):AGVTP01-C01;AGV托盘拣选出库区(必填):AGVTP01-C02;其他业务不需要
+    private String targetLocation;//	String	目标点位	否	无	预留字段,本项目可为空
+    private String wmslocationCode;//	String	wms大货位	是	无	四向库:SX01;AGV托盘:AGVTP01;AGV货架:AGVHJ01
+
+
+}

+ 22 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/EisTaskFinishedConfirmVO.java

@@ -0,0 +1,22 @@
+package com.prolog.cs.base.gsp.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * EIS作业完成确认VO
+ *
+ * @author 鄢菁KingYan
+ * @date 2022/07/13
+ */
+@Data
+public class EisTaskFinishedConfirmVO {
+
+    @ApiModelProperty(value = "容器编号", required = true)
+    private String containerNo;
+    @ApiModelProperty(value = "部分是包括托盘对应的拣选信息")
+    private List<TaskFinishedConfirmSubListVO> subList;
+
+}

+ 30 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/EisWorkConfirmVO.java

@@ -0,0 +1,30 @@
+package com.prolog.cs.base.gsp.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * EIS作业完成回告
+ */
+@Data
+public class EisWorkConfirmVO {
+    private String msgId;//	String	指令ID(每行唯一)	必须	幂等标识
+    private String warehouseId;//	String	仓库编号	必须	江西鹰江:JXYJ;江西仁海:JXRH
+    private String itemId;//	String	物料ID	非必须	正常出库:四向库/AGV货架库必填;补货:四向库必填;盘点/养护/移库:AGV货架库必填
+    private String lotId;//	String	批次ID	非必须	正常出库:四向库/AGV货架库必填;补货:四向库必填;盘点/养护/移库:AGV货架库必填
+    private String ownerId;//	String	货主ID	非必须	正常出库:四向库/AGV货架库必填;补货:四向库必填;盘点/养护/移库:AGV货架库必填
+    private String packId;//	String	包装ID	非必须	正常出库:四向库/AGV货架库必填;补货:四向库必填;盘点/养护/移库:AGV货架库必填
+    private BigDecimal inventoryQty;//	Float	库存数量(最小库存单位)	非必须	四向库盘点时必填,WMS库存数量;拣选作业、库内作业后最后剩余数量
+    private BigDecimal countQty;//	Float	实盘数量(最小库存单位)	非必须	四向库盘点时必填,WMS盘点数量,其他业务不需要
+    private String isLock;//	String	是否锁定容器库存	非必须	根据实盘数量与WMS库存比对,有差异则要求EIS锁定容器差异库存,1:锁定,0:不锁定
+    private String wmslocationCode;//	String	WMS大货位	是	四向库:SX01;AGV托盘:AGVTP01;AGV货架:AGVHJ01
+    private String originalArea;//	String	源区域	否	可为空
+    private String originalLocation;//	String	源点位	否	可为空
+    private String targetArea;//	String	目标区域	否	四向库整托出库区:SX01-C01;四向库拣选出库区:SX01-C02;AGV托盘整托出库区(非常关键):AGVTP01-C01;AGV托盘拣选出库区(非常关键):AGVTP01-C02;AGV货架出库区:AGVHJ01-C01;四向库入库区:SX01-R01;AGV托盘入库区:AGVTP01-R01;AGV货架入库区:AGVHJ01-R01;
+    private String targetLocation;//	String	目标点位	否	预留字段,本项目可为空
+    private String taskId;//	String	任务编号	必须	出库单号,移库单号
+    private String seqNo;//	String	行号	必须	有任务取任务的行号,无任务的业务取单明细的行号
+    private String workType;//	String	作业类型(见上述接口清单作业类型与业务类型约定)	必须
+    private String businessType;// String	业务类型(见上述接口清单作业类型与业务类型约定)	必须
+}

+ 178 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/ErpUnqualifiedLossVo.java

@@ -0,0 +1,178 @@
+package com.prolog.cs.base.gsp.vo;
+
+import com.alibaba.fastjson.JSONObject;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ErpUnqualifiedLossVo {
+    private LossData data;
+
+    @Data
+    public static class LossData{
+        private List<LossH> bills;
+    }
+
+
+    @Data
+    public static class LossH{
+        //			"billno": "D0001",
+        private String billno;
+        //			"billtype": "D0_WKO",
+        private String billtype;
+        //			"billdate": "2020/4/16",
+        private String billdate;
+        //			"status": "10",
+        private String status;
+        //			"bill_cancel": "N",
+        private String bill_cancel;
+        //			"replan": "N",
+        private String replan;
+        //			"closedate": "2021/4/16",
+        private String closedate;
+        //			"businesstype": "WKO",
+        private String businesstype;
+        //			"customercode": "CST001",
+        private String customercode;
+        //			"customername": "测试客户",
+        private String customername;
+        //			"customertel": "12312312312",
+        private String customertel;
+        //			"delivertype": "",
+        private String delivertype;
+        //			"shipbillno": "Y00001",
+        private String shipbillno;
+        //			"prioritylevel": "50",
+        private String prioritylevel;
+        //			"operator": "张三",
+        private String operator;
+        //			"confirmer": "李四",
+        private String confirmer;
+        //			"sumpcs": "2",
+        private String sumpcs;
+        //			"sumqty": "100",
+        private String sumqty;
+        //			"sumitems": "2",
+        private String sumitems;
+        //			"deliver_lxr": "张三",
+        private String deliver_lxr;
+        //			"deliver_tel": "12312312312",
+        private String deliver_tel;
+        //			"provna": "湖北省",
+        private String provna;
+        //			"cityna": "武汉市",
+        private String cityna;
+        //			"distna": "硚口区",
+        private String distna;
+        //			"addres": "湖北省武汉市硚口区越秀财富中心24楼",
+        private String addres;
+        //			"mobile": "12312312312",
+        private String mobile;
+        //			"teleph": "",
+        private String teleph;
+        //			"consignor": "TEST001",
+        private String consignor;
+        //			"consignorname": "测试货主",
+        private String consignorname;
+        //			"branchid": "W01",
+        private String branchid;
+        //			"enterpriseid": "E01",
+        private String enterpriseid;
+        //			"remark": "接口测试单据",
+        private String remark;
+        //			"whole_flg": "0",
+        private String whole_flg;
+        //			"wkonum": "WKO001",
+        private String wkonum;
+        private List<LossD> details;
+    }
+
+    @Data
+    public static class LossD{
+        //                  "billno": "D0001",
+        private String billno;
+        //					"seqno": "1",
+        private String seqno;
+        //					"itemcode": "ITM001",
+        private String itemcode;
+        //					"itemname": "测试商品01",
+        private String itemname;
+        //					"itembarcode": "ITM001",
+        private String itembarcode;
+        //					"capacity": "1*10",
+        private String capacity;
+        //					"fmodel": "TEST",
+        private String fmodel;
+        //					"packcode": "",
+        private String packcode;
+        //					"packsize": "50",
+        private String packsize;
+        //					"pcs": "1",
+        private String pcs;
+        //					"odd": "0",
+        private String odd;
+        //					"qty": "50",
+        private String qty;
+        //					"stockunit": "个",
+        private String stockunit;
+        //					"refunitqty": "50",
+        private String refunitqty;
+        //					"refunitname": "个",
+        private String refunitname;
+        //					"lotno": "P001",
+        private String lotno;
+        //					"yielddate": "2020/4/16",
+        private String yielddate;
+        //					"expdate": "2021/4/16",
+        private String expdate;
+        //					"linestatus": "10",
+        private String linestatus;
+        //					"refbillno": "",
+        private String refbillno;
+        //					"refbilllineid": "",
+        private String refbilllineid;
+        //					"stockstatus": "1",
+        private String stockstatus;
+        //					"batchrequest": "",
+        private String batchrequest;
+        //					"invturmode": "",
+        private String invturmode;
+        //					"iscancel": "0",
+        private String iscancel;
+        //					"consignor": "TEST001",
+        private String consignor;
+        //					"consignorname": "测试货主",
+        private String consignorname;
+        //					"remark": "接口测试行01",
+        private String remark;
+        //					"wave_flg": "1",
+        private String wave_flg;
+        //					"prdline": "PRD01",
+        private String prdline;
+        //					"prdloc": "DSTLOC001",
+        private String prdloc;
+        //					"onlinedate": "2020/4/20",
+        private String onlinedate;
+        //					"dstloc": "DSTLOC001",
+        private String dstloc;
+        //					"onlinetime": "15:00",
+        private String onlinetime;
+        private List<LossRule> rule;
+    }
+
+    @Data
+    public static class LossRule{
+        //"lotno": "P001",
+        private String lotno;
+        //						"Supno": "SUP01",
+        private String Supno;
+        //						"Cnsg_flg": "0"
+        private String Cnsg_flg;
+    }
+
+    @Override
+    public String toString(){
+        return JSONObject.toJSONString(this);
+    }
+}

+ 227 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/GspQualityCheckMoveItemVo.java

@@ -0,0 +1,227 @@
+package com.prolog.cs.base.gsp.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Ignore;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Description  
+ * @Date 2022-05-28
+ */
+
+@ApiModel
+@Data
+public class GspQualityCheckMoveItemVo implements Serializable {
+
+
+	private static final long serialVersionUID = 1184799694767874827L;
+
+
+	@ApiModelProperty(hidden =true,value = "lineId",required = true)
+	private String lineId;
+
+	@ApiModelProperty(hidden =true,value = "billId")
+	private String billId;
+
+	@ApiModelProperty(hidden =true,value = "billNo")
+	private String billNo;
+
+	@ApiModelProperty(value = "申请复查行id")
+	private String requestLineid;
+
+	@ApiModelProperty(value = "对接单据行号")
+	private String seqno;
+
+	//todo 未封装
+	@ApiModelProperty(hidden =true,value = "仓配中心ID")
+	private String dcId;
+
+	@ApiModelProperty(value = "仓ID")
+	private String warehouseId;
+
+	@ApiModelProperty(value = "仓库编码")
+	private String warehouseCode;
+
+	@ApiModelProperty(value = "仓库")
+	private String warehouseName;
+
+	@ApiModelProperty(value = "货主ID")
+	private String cargoOwnerId;
+
+	@ApiModelProperty(value = "货主ID")
+	private String cargoOwnerCode;
+
+	@ApiModelProperty(value = "货主")
+	private String cargoOwnerName;
+
+
+	@ApiModelProperty(value = "商品ID")
+	private String itemId;
+
+
+	@ApiModelProperty(value = "商品编号")
+	private String itemCode;
+
+	@ApiModelProperty(value = "商品名称")
+	private String itemName;
+
+	//todo 属性名不一样
+	@ApiModelProperty(value = "商品规格")
+	private String itemSpecs;
+
+	//todo 属性名不一样
+	@ApiModelProperty(value = "生产厂家")
+	private String manufacturerName;
+
+	//todo 属性名不一样
+	@ApiModelProperty(value = "产地")
+	private String productionPlace;
+
+	@ApiModelProperty(value = "包装数量")
+	private BigDecimal packSize;
+
+	@ApiModelProperty(value = "包装单位(字典)")
+	private String packUnits;
+
+	@ApiModelProperty("批准文号")
+	private String approvalNumber;
+
+	@ApiModelProperty(value = "备案凭证号")
+	private String paperNo;
+
+
+	@ApiModelProperty(value = "批次ID")
+	@NotBlank(message = "{required}")
+	private String batchId;
+
+	@ApiModelProperty(value = "批次")
+	private String batchNum;
+
+	@ApiModelProperty(value = "批号")
+	private String lotNum;
+
+	@Ignore
+	@ApiModelProperty(value = "生产日期")
+	private String productionDate;
+
+	//todo 上面todo一直到这里属性名都不一样
+	@Ignore
+	@ApiModelProperty(value = "有效期至日期")
+	private String expiredDate;
+
+	@Ignore
+	@ApiModelProperty(value = "显示生产日期")
+	private String showProductionDate;
+
+	@Ignore
+	@ApiModelProperty(value = "显示有效期至日期")
+	private String showExpiredDate;
+
+
+	//todo  未封装查商品库存后封装
+	@ApiModelProperty(hidden =true,value = "库存数量")
+	private BigDecimal stockQty;
+
+	@ApiModelProperty(hidden =true,value = "质量复查数量")
+	private BigDecimal qty;
+
+	@ApiModelProperty(hidden =true,value = "质量复查移库数量")
+	private BigDecimal reviewQty;
+
+
+	@ApiModelProperty(hidden =true,value = "数量")
+	private BigDecimal quantity;
+
+
+	/**
+	 * 移入库位ID
+	 */
+	@ApiModelProperty(value = "移入库位ID")
+	@NotBlank(message = "{required}")
+	private String inLocatorId;
+
+	/**
+	 * 移出库位ID
+	 */
+	@ApiModelProperty(value = "移出库位ID")
+	@NotBlank(message = "{required}")
+	private String outLocatorId;
+
+
+	@Ignore
+	@ApiModelProperty(value = "下架库存状态,逻辑页面不显示")
+	private String outStockStatus;
+
+	@Ignore
+	@ApiModelProperty(value = "上架库存状态,逻辑页面不显示")
+	private String inStockStatus;
+
+	/**
+	 * 零散数
+	 */
+	@NotNull(message = "{required}")
+	@ApiModelProperty(value = "零散数")
+	@Digits(integer = 30, fraction = 4, message = "{invalid}")
+	private BigDecimal oddPieceQuantity;
+
+	/**
+	 * 数量
+	 */
+	@NotNull(message = "{required}")
+	@ApiModelProperty(value = "整件数")
+	@Digits(integer = 30, fraction = 4, message = "{invalid}")
+	private BigDecimal caseQuantity;
+
+
+
+	/**
+	 * 移动原因
+	 */
+	@ApiModelProperty(value = "移动原因")
+	private String reason;
+
+	@ApiModelProperty(value = "备注")
+	private String comments;
+
+
+
+
+	//下面三个暂时不用
+	/**
+	 * GSP 养护单ID
+	 */
+	@ApiModelProperty(value = "养护单ID")
+	private String gspBillId;
+
+	/**
+	 * GSP 质量复检单号
+	 */
+	@ApiModelProperty(value = "质量复检单号")
+	private String gspBillNo;
+
+	/**
+	 * GSP 养护子单号
+	 */
+	@ApiModelProperty(value = "养护子单ID")
+	private String gspLineId;
+
+
+	private String inWhAreaCategoryName = "不合格库";
+
+
+	//单据来源类型
+	private String refBilltype;
+
+
+}

+ 64 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/GspQualityCheckMoveVo.java

@@ -0,0 +1,64 @@
+package com.prolog.cs.base.gsp.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Id;
+import com.prolog.framework.core.annotation.Ignore;
+import com.prolog.framework.core.annotation.Table;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description  
+ * @Date 2022-05-28
+ */
+
+@ApiModel
+@Data
+public class GspQualityCheckMoveVo implements Serializable {
+
+
+	private static final long serialVersionUID = 7988031893076318975L;
+
+
+	@ApiModelProperty(value = "质量复查id")
+	private String billId;
+
+	@ApiModelProperty(value = "仓ID")
+	private String warehouseId;
+
+	@ApiModelProperty(value = "仓库Name")
+	private String warehouseName;
+
+	@ApiModelProperty(value = "货主id")
+	private String cargoOwnerId;
+
+	@ApiModelProperty(value = "货主")
+	private String cargoOwnerName;
+
+	@ApiModelProperty(value = "创建日期")
+	private Date gmtCreate;
+
+	@ApiModelProperty(value = "创建人")
+	private String creator;
+
+	@ApiModelProperty(value = "创建人")
+	private String creatorName;
+
+	@ApiModelProperty(value = "最后修改日期")
+	private Date gmtModified;
+
+	@ApiModelProperty(value = "最后修改人")
+	private String modifier;
+
+	@ApiModelProperty(value = "最后修改人")
+	private String modifierName;
+
+	@ApiModelProperty(value = "备注")
+	private String remark;
+	
+}

+ 163 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/GspUnqualifiedDestroyDVO.java

@@ -0,0 +1,163 @@
+package com.prolog.cs.base.gsp.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @Description 不合格报损明细表 
+ * @Author Xiong  
+ * @Date 2021-05-11 
+ */
+
+@Data
+@ApiModel
+public class GspUnqualifiedDestroyDVO implements Serializable {
+	private static final long serialVersionUID =  891134317433131503L;
+
+	@ApiModelProperty(value = "行ID",required = true) 
+	@NotBlank(message = "行ID can not blank!") 
+	private String id;
+
+	@ApiModelProperty(value = "行号",required = true) 
+	@NotBlank(message = "行号 can not blank!") 
+	private String code;
+
+	@ApiModelProperty(value = "单据ID",required = true) 
+	@NotBlank(message = "单据ID can not blank!") 
+	private String lossId;
+
+	@ApiModelProperty(value = "单据编号",required = true) 
+	@NotBlank(message = "单据编号 can not blank!") 
+	private String lossCode;
+
+	@ApiModelProperty(value = "仓配中心ID",required = true) 
+	@NotBlank(message = "仓配中心ID can not blank!") 
+	private String dcId;
+
+	@ApiModelProperty(value = "仓ID",required = true) 
+	@NotBlank(message = "仓ID can not blank!") 
+	private String warehouseId;
+
+	@ApiModelProperty(value = "货主id",required = true) 
+	@NotBlank(message = "货主id can not blank!") 
+	private String cargoOwnerId;
+
+	@ApiModelProperty(value = "货位ID",required = true) 
+	@NotBlank(message = "货位ID can not blank!") 
+	private String locatorId;
+
+	@ApiModelProperty(value = "货位编号",required = true) 
+	@NotBlank(message = "货位编号 can not blank!") 
+	private String locatorCode;
+
+	@ApiModelProperty(value = "商品ID",required = true) 
+	@NotBlank(message = "商品ID can not blank!") 
+	private String itemId;
+
+	@ApiModelProperty(value = "商品编号",required = true) 
+	@NotBlank(message = "商品编号 can not blank!") 
+	private String itemCode;
+
+	@ApiModelProperty(value = "批号",required = true) 
+	@NotBlank(message = "批号 can not blank!") 
+	private String lotNum;
+
+	//@ApiModelProperty(value = "不合格数量,前端隐藏不显示,但破损提交接口需传给后台",required = true)
+	@NotNull(message = "不合格数量 can not blank!") 
+	private String unqualifiedQty;
+
+	@ApiModelProperty(value = "不合格原因") 
+	private String unqualifiedReason;
+
+	@ApiModelProperty(value = "质量情况反映") 
+	private String qualityStatus;
+
+	@ApiModelProperty(value = "所在部门意见")
+	private String opinion;
+
+	@ApiModelProperty(value = "状态10初始,20已审批",required = true) 
+	@NotNull(message = "状态10初始,20已审批 can not blank!") 
+	private String status;
+
+	@ApiModelProperty(value = "破损数量,前端页面隐藏不显示,销毁数量不能大于破损数量") 
+	private String lossQty;
+	
+	@ApiModelProperty(value = "销毁数量") 
+	private String destroyQty;
+
+
+	@ApiModelProperty(value = "原单据Id")
+	private String refBillId;
+
+	@ApiModelProperty(value = "原单据编号")
+	private String refBillCode;
+	
+	@ApiModelProperty(value = "原单据LINE编号")
+	private String refLineId;
+	
+	@ApiModelProperty(value = "不合格品来源")
+	private String refBillType;
+
+	@ApiModelProperty(value = "数量")
+	private String quantity;
+
+	@ApiModelProperty(value = "商品名称")
+	private String itemName;
+
+	@ApiModelProperty(value = "生产厂家")
+	private String manufacturerName;
+
+	@ApiModelProperty(value = "助记码")
+	private String itemAssistantCode;
+
+	@ApiModelProperty(value = "是否监管")
+	private String itemHealthSuperviseFlag;
+
+	@ApiModelProperty(value = "商品规格")
+	private String specification;
+
+	@ApiModelProperty(value = "产地")
+	private String countryOriginName;
+
+	@ApiModelProperty(value = "上市许可持有人")
+	private String itemHealthListedLicensor;
+
+	@ApiModelProperty(value = "单位")
+	private String caseUom;
+
+	@ApiModelProperty(value = "包装数")
+	private BigDecimal caseConversionRate;
+
+	@ApiModelProperty(value = "批次")
+	private String batchId;
+
+	@ApiModelProperty(value = "已申请销毁数量")
+	private String destroyingQty;
+
+	@ApiModelProperty(value = "商品大类")
+	private String itemHealthCategory;
+
+	@ApiModelProperty(value = "批准文号")
+	private String itemHealthApprovalNbr;
+
+	@ApiModelProperty(value = "注册证号")
+	private String itemHealthRegisterNbr;
+
+	@ApiModelProperty(value = "显示生产日期")
+	private String batchProductionDateShow;
+
+	@ApiModelProperty(value = "显示有效期至日期")
+	private String batchExpiredDateShow;
+
+	@ApiModelProperty("库区名称")
+	private String warehouseAreaName;
+
+	@ApiModelProperty("库别名称")
+	private String warehouseAreaCategoryName;
+}

+ 172 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/GspUnqualifiedLossDVO.java

@@ -0,0 +1,172 @@
+package com.prolog.cs.base.gsp.vo;
+
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Ignore;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Description 不合格报损明细表 
+ * @Author Xiong  
+ * @Date 2021-05-11 
+ */
+
+@Data
+@ApiModel
+public class GspUnqualifiedLossDVO implements Serializable {
+	private static final long serialVersionUID =  891134317433131503L;
+
+	@ApiModelProperty(value = "行ID",required = true) 
+	@NotBlank(message = "行ID can not blank!") 
+	private String id;
+
+	@ApiModelProperty(value = "行号",required = true) 
+	@NotBlank(message = "行号 can not blank!") 
+	private String code;
+
+	@ApiModelProperty(value = "单据ID",required = true) 
+	@NotBlank(message = "单据ID can not blank!") 
+	private String lossId;
+
+	@ApiModelProperty(value = "单据编号",required = true) 
+	@NotBlank(message = "单据编号 can not blank!") 
+	private String lossCode;
+
+	@ApiModelProperty(value = "仓配中心ID",required = true) 
+	@NotBlank(message = "仓配中心ID can not blank!") 
+	private String dcId;
+
+	@ApiModelProperty(value = "仓ID",required = true) 
+	@NotBlank(message = "仓ID can not blank!") 
+	private String warehouseId;
+
+	@ApiModelProperty(value = "货主id",required = true) 
+	@NotBlank(message = "货主id can not blank!") 
+	private String cargoOwnerId;
+
+	@ApiModelProperty(value = "货位ID",required = true) 
+	@NotBlank(message = "货位ID can not blank!") 
+	private String locatorId;
+
+	@ApiModelProperty(value = "货位编号",required = true) 
+	@NotBlank(message = "货位编号 can not blank!") 
+	private String locatorCode;
+
+	@ApiModelProperty(value = "商品ID",required = true) 
+	@NotBlank(message = "商品ID can not blank!") 
+	private String itemId;
+
+	@ApiModelProperty(value = "商品编号",required = true) 
+	@NotBlank(message = "商品编号 can not blank!") 
+	private String itemCode;
+
+	@ApiModelProperty(value = "批号",required = true) 
+	@NotBlank(message = "批号 can not blank!") 
+	private String lotNum;
+
+	@ApiModelProperty(value = "不合格数量,前端隐藏不显示,但破损提交接口需传给后台",required = true)
+	@NotNull(message = "不合格数量 can not blank!") 
+	private String unqualifiedQty;
+
+	@ApiModelProperty(value = "不合格原因") 
+	private String unqualifiedReason;
+
+	@ApiModelProperty(value = "质量情况反映") 
+	private String qualityStatus;
+
+	@ApiModelProperty(value = "所在部门意见")
+	private String opinion;
+
+	@ApiModelProperty(value = "状态10初始,20已审批",required = true) 
+	@NotNull(message = "状态10初始,20已审批 can not blank!") 
+	private String status;
+
+	@ApiModelProperty(value = "销毁数量") 
+	private String lossQty;
+
+
+	@ApiModelProperty(value = "原单据编号")
+	private String refBillId;
+
+	@ApiModelProperty(value = "不合格品来源")
+	private String refBillType;
+
+	@ApiModelProperty(value = "数量")
+	private String quantity;
+
+	@ApiModelProperty(value = "商品名称")
+	private String itemName;
+
+	@ApiModelProperty(value = "生产厂家")
+	private String manufacturerName;
+
+	@ApiModelProperty(value = "助记码")
+	private String itemAssistantCode;
+
+	@ApiModelProperty(value = "是否监管")
+	private String itemHealthSuperviseFlag;
+
+	@ApiModelProperty(value = "商品规格")
+	private String specification;
+
+	@ApiModelProperty(value = "产地")
+	private String countryOriginName;
+
+	@ApiModelProperty(value = "上市许可持有人")
+	private String itemHealthListedLicensor;
+
+	@ApiModelProperty(value = "单位")
+	private String caseUom;
+
+	@ApiModelProperty(value = "包装数量")
+	private BigDecimal caseConversionRate;
+
+	@ApiModelProperty(value = "批次ID")
+	private String batchId;
+
+	@Ignore
+	private String cargoOwnerName;
+	
+	@Ignore
+	private String cargoOwnerCode;
+
+	@ApiModelProperty(value = "商品大类")
+	private String itemHealthCategory;
+	
+	@ApiModelProperty(value = "批准文号")
+	private String itemHealthApprovalNbr;
+	
+	@ApiModelProperty(value = "注册证号")
+	private String itemHealthRegisterNbr;
+
+	@ApiModelProperty(value = "销毁申请数量,必须不大于报损数量,且支持小数")
+	private String destroyingQty;
+
+	@ApiModelProperty(value = "显示生产日期")
+	private String batchProductionDateShow;
+
+	@ApiModelProperty(value = "显示有效期至日期")
+	private String batchExpiredDateShow;
+
+	@ApiModelProperty(value = "生产日期")
+	private Date productionDate;
+
+	@ApiModelProperty(value = "有效期至日期")
+	private Date expiredDate;
+	
+	@ApiModelProperty(value = "行号")
+	private String seqNo;
+
+	@ApiModelProperty("库区名称")
+	private String warehouseAreaName;
+
+	@ApiModelProperty("库别名称")
+	private String warehouseAreaCategoryName;
+}

+ 67 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/GspUnqualifiedLossVO.java

@@ -0,0 +1,67 @@
+package com.prolog.cs.base.gsp.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Description 不合格报损汇总表 
+ * @Author Xiong  
+ * @Date 2021-05-10 
+ */
+@Data
+@ApiModel
+public class GspUnqualifiedLossVO implements Serializable {
+	private static final long serialVersionUID =  4191456615718865696L;
+
+	@ApiModelProperty(value = "单据ID",required = true) 
+	@NotBlank(message = "单据ID can not blank!") 
+	private String id;
+
+	@ApiModelProperty(value = "单据编号",required = true) 
+	@NotBlank(message = "单据编号 can not blank!") 
+	private String code;
+
+	@ApiModelProperty(value = "仓配中心ID",required = true) 
+	@NotBlank(message = "仓配中心ID can not blank!") 
+	private String dcId;
+
+	@ApiModelProperty(value = "仓ID",required = true) 
+	@NotBlank(message = "仓ID can not blank!") 
+	private String warehouseId;
+
+	@ApiModelProperty(value = "货主id",required = true) 
+	@NotBlank(message = "货主id can not blank!") 
+	private String cargoOwnerId;
+
+	@ApiModelProperty(value = "审核员") 
+	private String auditOperator;
+
+	@ApiModelProperty(value = "审核日期") 
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date auditDate;
+
+	@ApiModelProperty(value = "审核意见") 
+	private String auditText;
+
+	@ApiModelProperty(value = "状态:10=初始 20=已审批 30=已驳回",required = true) 
+	@NotNull(message = "状态:10=初始 20=已审批 30=已驳回 can not blank!") 
+	private BigDecimal status;
+
+	@ApiModelProperty(value = "数据来源",required = true) 
+	@NotBlank(message = "数据来源 can not blank!") 
+	private String source;
+
+	@ApiModelProperty(value = "备注") 
+	private String remark;
+
+}

+ 451 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/GspUpkeepCheckVO.java

@@ -0,0 +1,451 @@
+package com.prolog.cs.base.gsp.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.prolog.framework.core.annotation.Column;
+import com.prolog.framework.core.annotation.Ignore;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @Description 养护表
+ * @Author Xiong
+ * @Date 2021-05-20
+ */
+
+@Data
+@ApiModel
+public class GspUpkeepCheckVO implements Serializable {
+
+    private static final long serialVersionUID = 4612011526535896850L;
+
+    @ApiModelProperty(hidden = true, value = "ID", required = true)
+    private String id;
+
+    @ApiModelProperty(hidden = true, value = "CODE")
+    private String code;
+
+    @ApiModelProperty(hidden = true, value = "仓配中心ID")
+    private String dcId;
+
+    @ApiModelProperty(value = "仓ID")
+    private String warehouseId;
+
+    @ApiModelProperty(value = "货主ID")
+    private String cargoOwnerId;
+
+    @ApiModelProperty(value = "批次ID")
+    private String batchId;
+
+    @ApiModelProperty(hidden = true, value = "养护计划ID")
+    private String planId;
+
+    @ApiModelProperty(hidden = true, value = "养护计划CODE")
+    private String planCode;
+
+    @ApiModelProperty(value = "商品ID")
+    private String itemId;
+
+
+    @ApiModelProperty(value = "商品编号")
+    private String itemCode;
+
+    @ApiModelProperty(value = "商品名称")
+    private String itemName;
+
+    @ApiModelProperty(value = "批号")
+    private String lotNum;
+
+    @ApiModelProperty(hidden = true, value = "货位ID")
+    private String locatorId;
+
+    @ApiModelProperty(hidden = true, value = "货位编号")
+    private String locatorCode;
+
+    @ApiModelProperty(hidden = true, value = "货位")
+    private String locatorName;
+
+    @ApiModelProperty(hidden = true, value = "库存数量")
+    private String stockQty;
+
+    @ApiModelProperty(value = "养护数量")
+    private String upkeepQty;
+
+    @ApiModelProperty(hidden = true, value = "养护待处理数量")
+    private String pendingQty;
+
+    @ApiModelProperty(hidden = true, value = "类型:0=未分类 1=重点特殊药品,2=重点专管药品,3=重点其他药品,4=重点医疗器械,5=重点非药品,3=一般药品,4=一般器械,5=一般非药品")
+    private String itemType;
+
+    @ApiModelProperty(hidden = true, value = "养护员")
+    private String upkeepOperator;
+
+    @ApiModelProperty(hidden = true, value = "审核状态:0初始,1-正常无需复检,2-复检,3-复检完成,4-审核,5-审核完成,B -库存状态ERP审核驳回")
+    private String status;
+
+    @ApiModelProperty(hidden = true, value = "来源:0-自动;1手动")
+    private String sourceType;
+
+    @ApiModelProperty(hidden = true, value = "养护结论:0=待处理,1=合格,2=不合格")
+    private String upkeepConclusion;
+
+    @ApiModelProperty(hidden = true, value = "一级审核结论:0=待处理,1=合格,2=不合格")
+    private String checkConclusion;
+
+    @ApiModelProperty(hidden = true, value = "二级审核结论:1=合格,2=不合格")
+    private String recheckConclusion;
+
+    @ApiModelProperty(hidden = true, value = "最终结论:1=合格,2=不合格")
+    private String conclusion;
+
+    @ApiModelProperty(hidden = true, value = "处理意见")
+    private String processOpinion;
+
+    @ApiModelProperty(hidden = true, value = "审核员")
+    private String checkOperator;
+
+    @ApiModelProperty(hidden = true, value = "审核意见")
+    private String checkOpinion;
+
+    @ApiModelProperty(hidden = true, value = "复检员")
+    private String recheckOperator;
+
+    @ApiModelProperty(hidden = true, value = "复检意见")
+    private String recheckOpinion;
+
+    @ApiModelProperty(hidden = true, value = "外观(0=未选 1=已选)")
+    private Boolean checkWaiGuan;
+
+    @ApiModelProperty(hidden = true, value = "包装(0=未选 1=已选)")
+    private Boolean checkBaoZhuang;
+
+    @ApiModelProperty(hidden = true, value = "存储条件(0=未选 1=已选)")
+    private Boolean checkChenChuTiaoJian;
+
+    @ApiModelProperty(hidden = true, value = "翻跺(0=未选 1=已选)")
+    private Boolean checkFanDuo;
+
+    @ApiModelProperty(hidden = true, value = "除湿(0=未选 1=已选)")
+    private Boolean checkChuShi;
+
+    @ApiModelProperty(hidden = true, value = "加湿(0=未选 1=已选)")
+    private Boolean checkJiaShi;
+
+    @ApiModelProperty(hidden = true, value = "升温(0=未选 1=已选)")
+    private Boolean checkShenWen;
+
+    @ApiModelProperty(hidden = true, value = "降温(0=未选 1=已选)")
+    private Boolean checkJiangWen;
+
+    @ApiModelProperty(hidden = true, value = "通风(0=未选 1=已选)")
+    private Boolean checkTongFeng;
+
+    @ApiModelProperty(hidden = true, value = "除尘(0=未选 1=已选)")
+    private Boolean checkChuChen;
+
+    @ApiModelProperty(hidden = true, value = "质量状况:0=未确定 1=合格 2=不合格")
+    private String qualityStatus;
+
+    @ApiModelProperty(hidden = true, value = "温湿度状况")
+    private String thsTatus;
+
+    @ApiModelProperty(hidden = true, value = "养护待处理原因")
+    private String pendingReason;
+
+    @ApiModelProperty(hidden = true, value = "计划养护时间")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date planUpkeepDate;
+
+    @ApiModelProperty(hidden = true, value = "养护时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date upkeepDate;
+
+    @ApiModelProperty(hidden = true, value = "一检时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date checkDate;
+
+    @ApiModelProperty(hidden = true, value = "复检日期")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date recheckDate;
+
+    @ApiModelProperty(hidden = true, value = "备注")
+    private String remark;
+
+    @ApiModelProperty(hidden = true, value = "生产日期")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date pdateFrom;
+
+    @ApiModelProperty(hidden = true, value = "有效期至")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date validUntil;
+
+    @ApiModelProperty(value = "建筑物ID")
+    private String bldgId;
+
+    @ApiModelProperty(hidden = true, value = "养护类型:(0=一般 1=重点)")
+    private String upkeepType;
+
+    @ApiModelProperty(value = "生产厂家")
+    private String manufacturerName;
+
+    @ApiModelProperty(value = "上市许可持有人")
+    private String itemHealthListedLicensor;
+
+    @ApiModelProperty(value = "货主")
+    private String cargoOwnerName;
+
+    @ApiModelProperty(value = "建筑物")
+    private String bldgName;
+
+
+    @Ignore
+    @ApiModelProperty(value = "仓库")
+    private String warehouseName;
+
+
+    @Ignore
+    @ApiModelProperty(value = "生产日期")
+    private Date productionDate;
+
+    @Ignore
+    @ApiModelProperty(value = "有效期至日期")
+    private Date expiredDate;
+
+    @Ignore
+    @ApiModelProperty(value = "显示生产日期")
+    private String showProductionDate;
+
+    @Ignore
+    @ApiModelProperty(value = "显示有效期至日期")
+    private String showExpiredDate;
+
+    @Ignore
+    @ApiModelProperty(value = "下架库存状态,逻辑页面不显示")
+    private String outStockStatus;
+
+    @Ignore
+    @ApiModelProperty(value = "上架库存状态,逻辑页面不显示")
+    private String inStockStatus;
+
+    @ApiModelProperty(value = "整件数")
+    private BigDecimal caseQuantity;
+
+    @ApiModelProperty(value = "计划养护数量")
+    @Column(value = "PLAN_STOCK_QTY")
+    private String planStockQty;
+
+    /**
+     * 零散数
+     */
+    @ApiModelProperty(value = "零散数")
+    private BigDecimal oddPieceQuantity;
+
+    @ApiModelProperty(value = "数量")
+    private BigDecimal quantity;
+
+    /**
+     * 移出库位ID
+     */
+    @ApiModelProperty(value = "移出库位ID")
+    private String outLocatorId;
+
+    /**
+     * 移出库位ID
+     */
+    @ApiModelProperty(value = "移出库位名")
+    private String outLocatorName;
+
+    /**
+     * 移出容器ID
+     */
+    @ApiModelProperty(value = "移出容器ID")
+    private String outContainerCode = "N/A";
+
+    /**
+     * 移出货格
+     */
+    @ApiModelProperty(value = "移出货格")
+    private String outGoodsCaseCode = "N/A";
+
+    /**
+     * 移入库位ID
+     */
+    @ApiModelProperty(value = "移入库位ID")
+    private String inLocatorId;
+
+    /**
+     * 移入容器ID
+     */
+    private String inContainerCode = "N/A";
+
+    /**
+     * 移入货格
+     */
+    @ApiModelProperty(value = "移入货格")
+    private String inGoodsCaseCode = "N/A";
+
+    /**
+     * 移动原因
+     */
+    @ApiModelProperty(value = "移动原因")
+    private String reason;
+
+    @ApiModelProperty(value = "备注")
+    private String comments;
+
+    /**
+     * GSP 养护单ID
+     */
+    @ApiModelProperty(value = "养护单ID")
+    private String gspBillId;
+
+    /**
+     * GSP 养护单号
+     */
+    @ApiModelProperty(value = "养护单号")
+    private String gspBillNo;
+
+    /**
+     * GSP 养护子单号
+     */
+    @ApiModelProperty(value = "养护子单ID")
+    private String gspLineId;
+
+    @ApiModelProperty(value = "移入库别code")
+    private String inWhAreaCategory;
+
+    @ApiModelProperty(value = "移出库别code")
+    private String outWhAreaCategory;
+
+    @ApiModelProperty(value = "移出库别")
+    private String outWhAreaCategoryName;
+
+    /**
+     * GSP 养护子单号
+     */
+    @ApiModelProperty(value = "移入库别名")
+    private String inWhAreaCategoryName;
+
+    @Ignore
+    @ApiModelProperty(hidden = true, value = "移出库位类型")
+    private String whWarehouseLocatorType;
+
+    @ApiModelProperty("批准文号")
+    private String itemHealthApprovalNbr;
+
+    @ApiModelProperty(value = "商品大类(字典) (对应ERP药品大类)(oms增加)")
+    private String itemHealthCategoryName;
+
+    @ApiModelProperty(value = "预留字段")
+    private String warehouseRoomName;
+
+    @ApiModelProperty(value = "商品规格说明")
+    private String specification;
+
+    @ApiModelProperty(value = "包装数量")
+    private BigDecimal caseConversionRate;
+
+    @ApiModelProperty(value = "包装单位(字典)")
+    private String caseUom;
+
+    @ApiModelProperty(value = "注册证号")
+    private String itemHealthRegisterNbr;
+
+    @ApiModelProperty(value = "产地")
+    private String countryOriginName;
+
+    @ApiModelProperty(value = "规格(养护打印时放单纯的规格数据)")
+    private String spec;
+
+
+    /**
+     * 虫蛀(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "虫蛀(0=未选 1=已选)")
+    @Column(value = "CHECK_CHONG_ZHU")
+    private Boolean checkChongZhu;
+
+    /**
+     * 发霉(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "发霉(0=未选 1=已选)")
+    @Column(value = "CHECK_FA_MEI")
+    private Boolean checkFaMei;
+
+    /**
+     * 泛油(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "泛油(0=未选 1=已选)")
+    @Column(value = "CHECK_FAN_YOU")
+    private Boolean checkFanYou;
+
+    /**
+     * 潮解(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "潮解(0=未选 1=已选)")
+    @Column(value = "CHECK_CHAO_JIE")
+    private Boolean checkChaoJie;
+
+    /**
+     * 变色(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "变色(0=未选 1=已选)")
+    @Column(value = "CHECK_BIAN_SE")
+    private Boolean checkBianSe;
+
+    /**
+     * 上斗(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "上斗(0=未选 1=已选)")
+    @Column(value = "CHECK_SHANG_DOU")
+    private Boolean checkShangDou;
+
+    /**
+     * 破损(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "破损(0=未选 1=已选)")
+    @Column(value = "CHECK_PO_SUN")
+    private Boolean checkPoSun;
+
+    /**
+     * 破损(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "遮光(0=未选 1=已选)")
+    @Column(value = "CHECK_ZHE_GUANG")
+    private Boolean checkZheGuang;
+
+
+    /**
+     * 破损(0=未选 1=已选)
+     */
+    @ApiModelProperty(value = "避光(0=未选 1=已选)")
+    @Column(value = "CHECK_BI_GUANG")
+    private Boolean checkBiGuang;
+
+    @ApiModelProperty(value = "库区名")
+    private String warehouseAreaName;
+
+    @ApiModelProperty(value = "库别名")
+    private String warehouseAreaCategory;
+
+    @ApiModelProperty(value = "存储条件")
+    private String storeTemperature;
+
+    @ApiModelProperty(value = "库别名")
+    private String containerCode;
+
+    @ApiModelProperty(value = "是否已发出库指令(0-否;1-已发未达;2-已送达)")
+    private Integer outboundInstruct;
+
+}

+ 83 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/InfTaskOutBackDTO.java

@@ -0,0 +1,83 @@
+package com.prolog.cs.base.gsp.vo;
+
+import com.prolog.framework.core.annotation.Id;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
+@Data
+public class InfTaskOutBackDTO {
+
+    @Id
+    @ApiModelProperty(value = "主键id")
+    private String msgId;
+
+    @ApiModelProperty(value = "WMS单据任务号")
+    private String taskId;
+
+    @ApiModelProperty(value = "仓库主键id")
+    private String warehouseId;
+
+    @ApiModelProperty(value = "WMS大货位")
+    private String wmslocationCode;
+
+    @ApiModelProperty(value = "容器号")
+    private String containerNo;
+
+    @ApiModelProperty(value = "作业类型")
+    private String workType;
+
+    @ApiModelProperty(value = "业务类型")
+    private String businessType;
+
+    @ApiModelProperty(value = "明细ID")
+    private String seqNo;
+
+    @ApiModelProperty(value = "货格号")
+    private String locationNo;
+
+    @ApiModelProperty(value = "商品id")
+    private String itemId;
+
+    @ApiModelProperty(value = "批号ID")
+    private String lotId;
+
+    @ApiModelProperty(value = "包装ID")
+    private String packId;
+
+    @ApiModelProperty(value = "货主id")
+    private String ownerId;
+
+    @ApiModelProperty(value = "库存数量")
+    private BigDecimal inventoryQty;
+
+    @ApiModelProperty(value = "所有货格品批合计,养护和盘点需要填写")
+    private BigDecimal totalInventoryQty;//	Float	总库存数量	否		所有货格品批合计,养护和盘点需要填写
+
+    @ApiModelProperty(value = "实盘数量")
+    private BigDecimal countQty;
+
+    @ApiModelProperty(value = "数量")
+    private BigDecimal qty;
+
+    @ApiModelProperty(value = "源区域")
+    private String originalArea;
+
+    @ApiModelProperty(value = "源点位")
+    private String originalLocation;
+
+    @ApiModelProperty(value = "目标区域")
+    private String targetArea;
+
+    @ApiModelProperty(value = "目标点位")
+    private String targetLocation;
+
+    @ApiModelProperty(value = "回告类型 1:四向托盘回告,2:货架回告")
+    private String backType;
+
+    @ApiModelProperty(value = "养护明细")
+    private List<EisCheckBackDetailVo> itemList;
+}

+ 27 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/LossToOmsVo.java

@@ -0,0 +1,27 @@
+package com.prolog.cs.base.gsp.vo;
+
+import lombok.Data;
+
+@Data
+public class LossToOmsVo {
+    //单据编号
+    //盘点员
+    //单据日期
+    //行号
+    //商品内码
+    //报损报溢数量
+    //报损报溢原因
+    //批号
+    //生产日期
+    //有效期至
+    //库存状态
+    //类型 不合格报损为 3
+    //操作员
+    //审核员
+    //审核日期
+    //物流质管意见
+    //数量
+    //不合格品数量
+    //不合格原因
+    //不合格来源
+}

+ 54 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/RfGspUpkeepCheckVO.java

@@ -0,0 +1,54 @@
+package com.prolog.cs.base.gsp.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@ApiModel
+public class RfGspUpkeepCheckVO implements Serializable {
+
+    private static final long serialVersionUID = 4612011526535896850L;
+
+    @ApiModelProperty(value = "主键ID")
+    private String id;
+
+    @ApiModelProperty(value = "仓库ID")
+    private String warehouseId;
+
+    @ApiModelProperty(value = "仓库名称")
+    private String warehouseName;
+
+    @ApiModelProperty(value = "货主ID")
+    private String cargoOwnerId;
+
+    @ApiModelProperty(value = "货主名称")
+    private String cargoOwnerName;
+
+    @ApiModelProperty(value = "商品Id")
+    private String itemId;
+
+    @ApiModelProperty(value = "商品名称")
+    private String itemName;
+
+    @ApiModelProperty(value = "商品编码")
+    private String itemCode;
+
+    @ApiModelProperty(value = "库别")
+    private String warehouseAreaCategory;
+
+    @ApiModelProperty(value = "库别")
+    private String locatorId;
+
+    @ApiModelProperty(value = "货位")
+    private String locatorCode;
+
+    @ApiModelProperty(value = "批号")
+    private String lotNum;
+
+    @ApiModelProperty(value = "计划养护数量")
+    private String planStockQty;
+}
+

+ 55 - 0
upcloud-base-gsp/upcloud-base-gsp-facade/src/main/java/com/prolog/cs/base/gsp/vo/TaskFinishedConfirmSubListVO.java

@@ -0,0 +1,55 @@
+package com.prolog.cs.base.gsp.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * EIS出库任务回告子列表VO
+ *
+ * @author 鄢菁KingYan
+ * @date 2022/07/13
+ */
+@Data
+public class TaskFinishedConfirmSubListVO {
+    @ApiModelProperty(value = "仓库编号", required = true)
+    private String warehouseId;
+    @ApiModelProperty(value = "仓库编号", required = true)
+    private String ownerId;
+    @ApiModelProperty(value = "单据编号", required = true, notes = "出库单号,移库单号")
+    private String billNo;
+    @ApiModelProperty(value = "行号", required = true, notes = "有任务取任务的行号,无任务的业务取单明细的行号")
+    private String seqNo;
+    @ApiModelProperty(value = "作业类型", required = true)
+    private String workType;
+    @ApiModelProperty(value = "业务类型", required = true)
+    private String businessType;
+    @ApiModelProperty(value = "商品编号", required = true)
+    private String itemCode;
+    @ApiModelProperty(value = "商品名称", required = false)
+    private String itemName;
+    @ApiModelProperty(value = "数量", required = true, notes = "出库/移库/补货业务,按照需求数量;盘点按照EIS容器库存数;合托/养护默认0")
+    private BigDecimal qty;
+    @ApiModelProperty(value = "EIS源货位", required = false)
+    private String locCode;
+    @ApiModelProperty(value = "批号", required = true)
+    private String lotNo;
+    @ApiModelProperty(value = "生产日期", required = true)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date yieldDate;
+    @ApiModelProperty(value = "有效日期", required = true)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date expDate;
+    @ApiModelProperty(value = "出库口", required = true, notes = "EIS对应的出库站台号,与WMS做好对照")
+    private String OutboundPlatform;
+    @ApiModelProperty(value = "WMS出库货位", required = true, notes = "空托业务非必须")
+    private String wmslocationCode;
+    @ApiModelProperty(value = "指令ID", required = true, notes = "每行唯一")
+    private String msgId;
+}

+ 156 - 0
upcloud-base-gsp/upcloud-base-gsp-service/pom.xml

@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>upcloud-base-gsp</artifactId>
+        <groupId>com.prolog.upcloud</groupId>
+        <version>1.0.0.QINGNIU-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>upcloud-base-gsp-service</artifactId>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.prolog.upcloud</groupId>
+            <artifactId>upcloud-base-gsp-facade</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.prolog.framework</groupId>
+            <artifactId>plg-fx-starter</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>io.netty</groupId>
+                    <artifactId>netty-all</artifactId>
+                </exclusion>
+                <!--                <exclusion>-->
+                <!--                    <groupId>cn.easyproject</groupId>-->
+                <!--                    <artifactId>ojdbc7</artifactId>-->
+                <!--                </exclusion>-->
+                <exclusion>
+                    <groupId>com.aliyun.edb</groupId>
+                    <artifactId>edb-driver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-starter-logging</artifactId>
+                </exclusion>
+            </exclusions>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>1.2.49</version>
+            <!--            <scope>test</scope>-->
+        </dependency>
+        <dependency>
+            <groupId>com.prolog.framework</groupId>
+            <artifactId>plg-bz-common</artifactId>
+            <version>1.0.0.beta</version>
+        </dependency>
+        <dependency>
+            <groupId>com.prolog.upcloud</groupId>
+            <artifactId>item-facade</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.prolog.upcloud</groupId>
+            <artifactId>base-chain-facade</artifactId>
+            <version>1.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>com.prolog.upcloud</groupId>
+            <artifactId>wh-facade</artifactId>
+            <version>3.0.1-SNAPSHOT</version>
+            <exclusions>
+                <!--                <exclusion>-->
+                <!--                    <groupId>cn.easyproject</groupId>-->
+                <!--                    <artifactId>ojdbc7</artifactId>-->
+                <!--                </exclusion>-->
+                <exclusion>
+                    <groupId>com.aliyun.edb</groupId>
+                    <artifactId>edb-driver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>com.prolog.upcloud</groupId>
+            <artifactId>strategy-facade</artifactId>
+            <version>${project.version}</version>
+            <!--            <version>${project.version}</version>-->
+        </dependency>
+        <dependency>
+            <groupId>com.prolog.upcloud</groupId>
+            <artifactId>upcloud-base-inventory-facade</artifactId>
+            <version>${project.version}</version>
+            <!--            <version>${project.version}</version>-->
+        </dependency>
+        <dependency>
+            <groupId>com.prolog.upcloud</groupId>
+            <artifactId>upcloud-base-wh-operate-facade</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.prolog.cs</groupId>
+            <artifactId>data-exchange-client</artifactId>
+            <version>1.0.0.release</version>
+        </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-all</artifactId>
+            <version>1.10.19</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter-api</artifactId>
+            <version>5.7.1</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.3.1.RELEASE</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <!-- <classifier>exec</classifier> -->
+                    <executable>true</executable>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.8.0</version>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+
+</project>

+ 27 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/Application.java

@@ -0,0 +1,27 @@
+package com.prolog.cs.base.gsp;
+
+import com.prolog.framework.authority.annotation.EnablePrologResourceServer;
+import com.prolog.framework.bz.common.search.EnableSearchApi;
+import com.prolog.framework.log.aop.annotation.EnableUserLog;
+import com.prolog.framework.microservice.annotation.EnablePrologService;
+import org.mybatis.spring.annotation.MapperScan;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.SpringApplication;
+
+@EnableUserLog
+@EnablePrologService
+@EnablePrologResourceServer
+//@EnablePrologEmptySecurityServer
+@EnableSearchApi
+@MapperScan("com.prolog.cs.base.gsp.dao")
+public class Application {
+
+    private static Logger logger = LoggerFactory.getLogger(Application.class);
+
+    public static void main(String[] args) {
+        SpringApplication.run(Application.class, args);
+        logger.info("============= SpringBoot Start Success =============");
+    }
+
+}

+ 65 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/aspect/AceAspect.java

@@ -0,0 +1,65 @@
+package com.prolog.cs.base.gsp.aspect;
+
+import com.github.pagehelper.util.StringUtil;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.springframework.stereotype.Component;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * 日志和加密
+ *
+ */
+@Aspect
+@Component
+public class AceAspect {
+
+
+    private static final Logger logger = LogManager.getLogger("AceAspect");
+
+    ThreadLocal<Long> startTime = new ThreadLocal<>();
+
+    @Pointcut("execution(public * com.prolog.cs.base.gsp.controller..*.*(..)))")
+    public void webLog(){}
+
+//    @Before("webLog()")
+//    public void doBefore(JoinPoint joinPoint) throws Throwable {
+//        startTime.set(System.currentTimeMillis());
+//        // 接收到请求,记录请求内容
+//        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+//        HttpServletRequest request = attributes.getRequest();
+//
+//        // 记录下请求内容
+//        //logger.info("CLASS_METHOD : " + joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName());
+//        logger.info("IP: " + request.getRemoteAddr()+" URL:" + request.getRequestURL().toString()+" ARGS:" + Arrays.toString(joinPoint.getArgs()));
+//
+//    }
+
+    @Around("webLog()")
+    public Object doAround(ProceedingJoinPoint point) throws Throwable {
+        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        HttpServletRequest request = attributes.getRequest();
+        Object object= point.proceed();
+        if(request.getRequestURL()==null || StringUtil.isEmpty(request.getRequestURL().toString())){//不规范写法,导致url为空
+            return object;
+        }
+        String url = request.getRequestURL().toString();
+        //logger.info(" URL:" + request.getRequestURL().toString()+" 入参:" + Arrays.toString(point.getArgs())+" 返回:" + JSON.toJSONString(object));
+        return object;
+    }
+
+//    @AfterReturning(returning = "ret", pointcut = "webLog()")
+//    public void doAfterReturning(Object ret) throws Throwable {
+//        // 处理完请求,返回内容
+//        logger.info("SPEND TIME : " + (System.currentTimeMillis() - startTime.get())+" RESPONSE : " + ret);
+//    }
+
+
+}

+ 134 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/controller/GspQualityReviewController.java

@@ -0,0 +1,134 @@
+package com.prolog.cs.base.gsp.controller;
+
+
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.model.DxiGspQualityReviewD;
+import com.prolog.cs.base.gsp.model.DxiGspQualityReviewH;
+import com.prolog.cs.base.gsp.service.GspQualityReviewService;
+import com.prolog.cs.base.gsp.vo.GspQualityCheckMoveItemVo;
+import com.prolog.cs.base.gsp.vo.GspQualityCheckMoveVo;
+import com.prolog.cs.base.gsp.vo.GspUpkeepCheckVO;
+import com.prolog.cs.data.exchange.client.ExchangeSender;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.core.pojo.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
+
+/**
+ * @Description 质量复查管理
+ * @Date 2022-05-27
+ */
+
+@Slf4j
+@Api(tags = "质量复查管理")
+@RestController
+@RequestMapping("/gspQualityReview")
+public class GspQualityReviewController {
+
+	@Autowired
+	private GspQualityReviewService gspQualityReviewService;
+
+	/**
+	 * 分页查询质量复查列表
+	 */
+	@ApiOperation("分页查询质量复查单列表")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "branchcode", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "consignorcode", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "requestBilltype", required = false, dataType = "String"),
+			@ApiImplicitParam(name = "billno", required = false, dataType = "String"),
+			@ApiImplicitParam(name = "status", required = true, dataType = "String",defaultValue = "10初始单 40 复查单"),
+			@ApiImplicitParam(name = "pageSize",required = true, dataType = "Integer", defaultValue = "0"),
+			@ApiImplicitParam(name = "pageNum",required = true, dataType = "Integer", defaultValue = "10")
+	})
+	@GetMapping("/listPage")
+	public RestMessage<Page<DxiGspQualityReviewH>> listPage(@RequestParam("branchcode") String branchcode,
+															@RequestParam("consignorcode") String consignorcode,
+															 String requestBilltype,
+															 String billno,
+															@RequestParam("status") String status,
+															@RequestParam("pageSize") Integer pageSize,
+															@RequestParam("pageNum") Integer pageNum) throws Exception {
+		return RestMessage.newInstance(true, "success", gspQualityReviewService.listPage(branchcode,consignorcode,requestBilltype,billno,status,pageSize,pageNum));
+	}
+
+
+	/**
+	 * 主表单据id查询复查列表
+	 */
+	@GetMapping("/findDetailByBillId")
+	@ApiOperation("主表单据id查询复查列表")
+	public RestMessage<List<DxiGspQualityReviewD>> findDetailByBillId(@RequestParam String billId) throws Exception {
+		return RestMessage.newInstance(true, "success", gspQualityReviewService.findDetailByBillId(billId));
+	}
+
+
+	/**
+	 * 质量主管审核
+	 */
+	@ApiOperation("质量审核")
+	@PostMapping("/directorAudit")
+	public RestMessage<Object> directorAudit(@NotEmpty(message = "collection is empty")@RequestBody List<DxiGspQualityReviewD> list) throws Exception {
+		gspQualityReviewService.batchAudit(list);
+		return RestMessage.newInstance(true, "success", "");
+	}
+
+
+	/**
+	 * 质量主管审核
+	 */
+	/*@ApiOperation("质量经理审核")
+	@PostMapping("/managerAudit")
+	public RestMessage<Object> directorAudit(@NotEmpty(message = "collection is empty")@RequestBody List<DxiGspQualityReviewD> list) throws Exception {
+		gspQualityReviewService.batchAudit(list);
+		return RestMessage.newInstance(true, "success", "");
+	}*/
+
+
+
+	/**
+	 * 质量复检移库不合格品主表提取
+	 */
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "warehouseId", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "cargoOwnerId", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "requestBilltype", required = false, dataType = "String"),
+			@ApiImplicitParam(name = "billno", required = false, dataType = "String")
+	})
+	@ApiOperation("质量复检移库不合格品主表提取")
+	@GetMapping("/findQualityReview4MovePick")
+	public RestMessage<List<GspQualityCheckMoveVo>> findQualityReview4MovePick(@RequestParam("warehouseId") String warehouseId,
+																			   @RequestParam("cargoOwnerId") String cargoOwnerId,
+																			   String requestBilltype,
+																			   String billno){
+		List<GspQualityCheckMoveVo> qualityCheck4MovePick = gspQualityReviewService.findQualityReview4MovePick(warehouseId,cargoOwnerId,requestBilltype,billno);
+		return RestMessage.newInstance(true, "success", qualityCheck4MovePick);
+	}
+
+
+	/**
+	 * 质量复检移库不合格明细提取
+	 */
+	@ApiOperation("质量复检移库不合格明细提取")
+	@GetMapping("/findQualityReview4MoveItemPick")
+	public RestMessage<List<GspQualityCheckMoveItemVo>> findQualityReview4MoveItemPick(String billId){
+		return RestMessage.newInstance(true, "success", gspQualityReviewService.findQualityReview4MoveItemPick(billId));
+	}
+
+
+	@PostMapping("/confirmQualityReviewMove")
+	@ApiOperation(value = "质量复核移库确认")
+	public RestMessage confirmQualityReviewMove(@RequestBody String[] arrList){
+		gspQualityReviewService.confirmQualityReviewMove(arrList);
+		return RestMessage.newInstance(true, "success", null);
+	}
+
+}

+ 177 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/controller/GspUnqualifiedDestroyController.java

@@ -0,0 +1,177 @@
+package com.prolog.cs.base.gsp.controller;
+
+
+import com.prolog.cs.base.gsp.enums.GspUnqualifiedStatus;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedDestroy;
+import com.prolog.cs.base.gsp.service.GspUnqualifiedDestroyService;
+import com.prolog.cs.base.gsp.vo.GspUnqualifiedDestroyDVO;
+import com.prolog.cs.data.exchange.client.ExchangeSender;
+import com.prolog.cs.data.exchange.client.core.EtlMessage;
+import com.prolog.cs.data.exchange.client.core.EtlTypeConstants;
+import com.prolog.framework.bz.core.util.ObjectUtils;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.core.pojo.Page;
+import com.prolog.framework.log.aop.annotation.UserLog;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
+
+/**
+ * @Description 不合格品销毁管理
+ * @Date 2021-05-08 
+ */
+
+@Api(tags = "不合格品销毁管理")
+@RestController
+@RequestMapping("/gspUnqualifiedDestroy")
+public class GspUnqualifiedDestroyController {
+
+	@Autowired
+	private GspUnqualifiedDestroyService service;
+
+	@Autowired
+	private ExchangeSender exchangeSender;
+	
+	/**
+	 * 分页查询不合格品销毁提取列表
+	 */
+	@ApiOperation("分页查询不合格品销毁提取列表")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "warehouseId", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "cargoOwnerId", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "lossCode", required = false, dataType = "String"),
+			@ApiImplicitParam(name = "itemId", required = false, dataType = "String"),
+			@ApiImplicitParam(name = "pageSize", dataType = "Integer", defaultValue = "0"),
+			@ApiImplicitParam(name = "pageNum", dataType = "Integer", defaultValue = "10")
+	})
+	@GetMapping("/listPagePick")
+	public RestMessage<Page<GspUnqualifiedDestroyDVO>> listPagePick(@RequestParam String warehouseId,
+															 @RequestParam String cargoOwnerId,
+															 @RequestParam(required = false) String lossCode,
+															 @RequestParam(required = false) String itemId,
+															 @RequestParam Integer pageSize,
+															 @RequestParam Integer pageNum) throws Exception {
+		return RestMessage.newInstance(true, "success", service.listPagePick(warehouseId,cargoOwnerId,lossCode,itemId,pageSize,pageNum));
+	}
+	
+	/**
+	 * 不合格品销毁提取保存
+	 */
+	@ApiOperation("不合格品销毁提取保存")
+	@PostMapping("/add")
+	public RestMessage<Object> add(@RequestBody GspUnqualifiedDestroy gspUnqualifiedDestroy){
+		service.add(gspUnqualifiedDestroy);
+		return RestMessage.newInstance(true, "success", null);
+	}
+
+	/**
+	 * 批量删除待审核销毁申请
+	 */
+	@ApiOperation("批量删除待审核销毁申请")
+	@PostMapping("/delIds")
+	public RestMessage<Object> delIds(@NotEmpty(message = "请选择数据操作") @RequestBody List<String> pkIdList) {
+		service.delIds(pkIdList);
+		return RestMessage.newInstance(true, "success", "");
+	}
+
+	/**
+	 * 分页查询不合格品销毁列表
+	 */
+	@ApiOperation("分页查询不合格品销毁列表")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "warehouseId", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "cargoOwnerId", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "status", required = false, dataType = "String"),
+			@ApiImplicitParam(name = "pageSize", dataType = "Integer", defaultValue = "0"),
+			@ApiImplicitParam(name = "pageNum", dataType = "Integer", defaultValue = "10")
+	})
+	@GetMapping("/listPage")
+	public RestMessage<Page<GspUnqualifiedDestroy>> listPage(@RequestParam String warehouseId,
+														  @RequestParam String cargoOwnerId,
+														  @RequestParam String status,
+														  @RequestParam Integer pageSize,
+														  @RequestParam Integer pageNum) throws Exception {
+		return RestMessage.newInstance(true, "success", service.listPage(warehouseId,cargoOwnerId,status,pageSize,pageNum));
+	}
+
+	/**
+	 * 主表id查询销毁商品列表
+	 */
+	@ApiOperation("主表id查询销毁商品列表")
+	@GetMapping("/findDetailByMstId")
+	public RestMessage<List<GspUnqualifiedDestroyDVO>> findDetailByMstId(@RequestParam(required=false) String mstId){
+		return RestMessage.newInstance(true, "success", service.findDetailByMstId(mstId));
+	}
+
+	/**
+	 * 不合格品销毁批量审核通过接口
+	 */
+	@ApiOperation("不合格品销毁批量审核通过接口")
+	@PostMapping("/batchAuditYes")
+	public RestMessage<Object> batchAuditYes(
+			@NotEmpty(message = "collection is empty")
+			@RequestBody List<GspUnqualifiedDestroy> gspUnqualifiedDestroyDTOList) throws Exception {
+		service.batchUpdate(gspUnqualifiedDestroyDTOList, GspUnqualifiedStatus.WMS_AUDIT_YES.getStatus());
+		return RestMessage.newInstance(true, "success", "");
+	}
+
+
+	/**
+	 * 不合格品销毁批量审核驳回接口
+	 */
+	@ApiOperation("不合格品销毁批量审核驳回接口")
+	@PostMapping("/batchAuditNo")
+	public RestMessage<Object> batchAuditNo(@NotEmpty(message = "collection is empty")@RequestBody List<GspUnqualifiedDestroy> 
+														gspUnqualifiedDestroyDTOList) throws Exception {
+		service.batchUpdate(gspUnqualifiedDestroyDTOList, GspUnqualifiedStatus.WMS_AUDIT_NO.getStatus());
+		return RestMessage.newInstance(true, "success", "");
+	}
+
+	@UserLog
+	@ApiOperation(value = "获取详情(含销毁)")
+	@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "String")
+	@GetMapping("/getById")
+	public RestMessage<GspUnqualifiedDestroy> getById(String id) throws Exception
+	{
+		return RestMessage.newInstance(true, "查询成功", service.getById(id));
+	}
+
+	/**
+	 * 批量录入销毁信息
+	 */
+	@ApiOperation("批量录入销毁信息")
+	@PostMapping("/batchDestroy")
+	public RestMessage<Object> batchDestroy(@NotEmpty(message = "collection is empty")@RequestBody List<GspUnqualifiedDestroy> gspUnqualifiedDestroyDTOList) throws Exception {
+		for (GspUnqualifiedDestroy gspUnqualifiedDestroy : gspUnqualifiedDestroyDTOList) {
+			if (ObjectUtils.isNull(gspUnqualifiedDestroy.getDestroySituation())) {
+				return RestMessage.newInstance(false, "销毁后现场情况不能为空!", "");
+			}
+			if (ObjectUtils.isNull(gspUnqualifiedDestroy.getDestroyExecutor())) {
+				return RestMessage.newInstance(false, "销毁执行人不能为空!", "");
+			}
+			if (ObjectUtils.isNull(gspUnqualifiedDestroy.getDestroySupervisor())) {
+				return RestMessage.newInstance(false, "销毁监督人不能为空!", "");
+			}
+//			if (ObjectUtils.isNull(gspUnqualifiedDestroy.getNmpaOfficer())) {
+//				return RestMessage.newInstance(false, "药监部门人员不能为空!", "");
+//			}
+			if (ObjectUtils.isNull(gspUnqualifiedDestroy.getDestroyPic())) {
+				return RestMessage.newInstance(false, "销毁图片不能为空!", "");
+			}
+		}
+		service.batchUpdate(gspUnqualifiedDestroyDTOList, GspUnqualifiedStatus.DESTROY.getStatus());
+		String[] ids = gspUnqualifiedDestroyDTOList.stream().map(GspUnqualifiedDestroy::getId).toArray(String[]::new);
+		EtlMessage em = new EtlMessage();
+		em.setId(String.join(",",ids));
+		em.setEtlType(EtlTypeConstants.gsp_destroy_audit_w2o);
+		exchangeSender.send(em);
+		return RestMessage.newInstance(true, "success", "");
+	}
+	
+}

+ 141 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/controller/GspUnqualifiedLossController.java

@@ -0,0 +1,141 @@
+package com.prolog.cs.base.gsp.controller;
+
+
+import com.alibaba.fastjson.JSON;
+import com.prolog.cs.base.gsp.enums.GspUnqualifiedStatus;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedLoss;
+import com.prolog.cs.base.gsp.service.GspUnqualifiedLossService;
+import com.prolog.cs.base.gsp.vo.ErpUnqualifiedLossVo;
+import com.prolog.cs.base.gsp.vo.GspUnqualifiedLossDVO;
+import com.prolog.cs.data.exchange.client.ExchangeSender;
+import com.prolog.cs.data.exchange.client.core.EtlMessage;
+import com.prolog.cs.data.exchange.client.core.EtlTypeConstants;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.core.pojo.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
+
+/**
+ * @Description 不合格品破损管理
+ * @Date 2021-05-08
+ */
+
+@Slf4j
+@Api(tags = "不合格品破损管理")
+@RestController
+@RequestMapping("/gspUnqualifiedLoss")
+public class GspUnqualifiedLossController {
+
+	@Autowired
+	private GspUnqualifiedLossService gspUnqualifiedLossService;
+
+	@Autowired
+	private ExchangeSender exchangeSender;
+
+	/**
+	 * 不合格品破损提取保存
+	 */
+	@ApiOperation("不合格品破损提取保存")
+	@PostMapping("/add")
+    public RestMessage<Object> add(@RequestBody GspUnqualifiedLoss gspUnqualifiedLoss) throws Exception {
+        Boolean needErpAudit = gspUnqualifiedLossService.add(gspUnqualifiedLoss);
+
+        if (needErpAudit) {
+            // 如果需要 ERP 审核
+            EtlMessage em = new EtlMessage();
+            em.setId(gspUnqualifiedLoss.getId());
+            em.setEtlType(EtlTypeConstants.op_pl_w2o);
+            exchangeSender.send(em);
+        }
+        return RestMessage.newInstance(true, "success", null);
+    }
+
+	/**
+	 * 批量删除待审核破损申请
+	 */
+	@ApiOperation("批量删除待审核破损申请")
+	@PostMapping("/delIds")
+	public RestMessage<Object> delIds(@NotEmpty(message = "请选择数据操作") @RequestBody List<String> pkIdList) {
+		gspUnqualifiedLossService.delIds(pkIdList);
+		return RestMessage.newInstance(true, "success", "");
+	}
+
+	/**
+	 * 分页查询不合格品破损列表
+	 */
+	@ApiOperation("分页查询不合格品破损列表")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "warehouseId", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "cargoOwnerId", required = true, dataType = "String"),
+			@ApiImplicitParam(name = "status", required = false, dataType = "String"),
+			@ApiImplicitParam(name = "pageSize", dataType = "Integer", defaultValue = "0"),
+			@ApiImplicitParam(name = "pageNum", dataType = "Integer", defaultValue = "10")
+	})
+	@GetMapping("/listPage")
+	public RestMessage<Page<GspUnqualifiedLoss>> listPage(
+			@RequestParam String warehouseId,
+			@RequestParam String cargoOwnerId,
+			@RequestParam String status,
+			@RequestParam Integer pageSize,
+			@RequestParam Integer pageNum
+	) throws Exception {
+		return RestMessage.newInstance(true, "success", gspUnqualifiedLossService.listPage(warehouseId,cargoOwnerId,status,pageSize,pageNum));
+	}
+
+	/**
+	 * 主表id查询破损商品列表
+	 */
+	@ApiOperation("主表id查询破损商品列表")
+	@GetMapping("/findDetailByMstId")
+	public RestMessage<List<GspUnqualifiedLossDVO>> findDetailByMstId(@NotEmpty(message = "mstId is empty") @RequestParam String mstId){
+		return RestMessage.newInstance(true, "success", gspUnqualifiedLossService.findDetailByMstId(mstId));
+	}
+
+	/**
+	 * 不合格品破损批量审核通过
+	 */
+	@ApiOperation("不合格品破损批量审核通过")
+	@PostMapping("/batchAuditYes")
+	public RestMessage<Object> batchAuditYes(@NotEmpty(message = "collection is empty")@RequestBody List<GspUnqualifiedLoss> list) throws Exception {
+		gspUnqualifiedLossService.batchAudit(list, GspUnqualifiedStatus.WMS_AUDIT_YES.getStatus());
+		EtlMessage em = new EtlMessage();
+		String[] arr= list.stream().map(GspUnqualifiedLoss::getId).toArray(String[]::new);
+		log.info("调用EtlTypeConstants.gsp_pl_audit_w2o,入参为:" + JSON.toJSONString(arr));
+		em.setId(String.join(",",list.stream().map(GspUnqualifiedLoss::getId).toArray(String[]::new)));
+		em.setEtlType(EtlTypeConstants.gsp_pl_audit_w2o);
+		exchangeSender.send(em);
+		return RestMessage.newInstance(true, "success", "");
+	}
+
+	/**
+	 * 不合格品破损批量审核驳回
+	 */
+	@ApiOperation("不合格品破损批量审核驳回")
+	@PostMapping("/batchAuditNo")
+	public RestMessage<Object> batchAuditNo(@NotEmpty(message = "success")@RequestBody List<GspUnqualifiedLoss> list) throws Exception {
+		gspUnqualifiedLossService.batchAudit(list, GspUnqualifiedStatus.WMS_AUDIT_NO.getStatus());
+		return RestMessage.newInstance(true, "batchEditSuccess", "");
+	}
+
+
+	/**
+	 * 新奇康的库内不合格品报损采用ERP下发模式
+	 * WMS收到下发后直接记录数据,自动审核通过并扣减库存
+	 */
+	@ApiOperation("不合格品报损接收保存自动审核")
+	@PostMapping("/erp/add")
+	public RestMessage<Object> erpAdd(@RequestBody ErpUnqualifiedLossVo vo) throws Exception {
+		log.info("收到来自ERP的不合格品报损下传信息:{}", vo.toString());
+		gspUnqualifiedLossService.erpAdd(vo);
+		return RestMessage.newInstance(true, "success", null);
+	}
+
+}

+ 236 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/controller/GspUpkeepCheckController.java

@@ -0,0 +1,236 @@
+package com.prolog.cs.base.gsp.controller;
+
+
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheck;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheckPlan;
+import com.prolog.cs.base.gsp.service.GspUpkeepCheckPlanService;
+import com.prolog.cs.base.gsp.service.GspUpkeepCheckService;
+import com.prolog.cs.base.gsp.service.impl.AutoUpKeepTask;
+import com.prolog.cs.base.gsp.vo.GspUpkeepCheckVO;
+import com.prolog.cs.base.gsp.vo.InfTaskOutBackDTO;
+import com.prolog.cs.data.exchange.client.ExchangeSender;
+import com.prolog.cs.data.exchange.client.core.EtlMessage;
+import com.prolog.cs.data.exchange.client.core.EtlTypeConstants;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.core.exception.BizException;
+import com.prolog.framework.core.pojo.Page;
+import com.prolog.framework.log.aop.annotation.UserLog;
+import com.prolog.upcloud.base.inventory.model.WmsInvStockLot;
+import com.prolog.upcloud.base.inventory.vo.InfTaskOutBackVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotEmpty;
+import java.util.List;
+
+import static com.prolog.framework.common.message.RestMessage.doSuccess;
+
+/**
+ * @Description 质量管理
+ * @Date 2021-05-08
+ */
+
+@Api(tags = "质量管理")
+@RestController
+@RequestMapping("/gspUpkeepCheck")
+@Validated
+public class GspUpkeepCheckController {
+
+    @Autowired
+    private GspUpkeepCheckService gspUpkeepCheckService;
+
+    @Autowired
+    private GspUpkeepCheckPlanService gspUpkeepCheckPlanService;
+
+    @Autowired
+    private ExchangeSender exchangeSender;
+
+    @Autowired
+    private AutoUpKeepTask autoUpKeepTask;
+
+    @Autowired
+    private GspUpkeepCheckService gspkeepCheckService;
+
+    /**
+     * 库存锁定,新增复检单
+     */
+    @ApiOperation("库存锁定,新增复检单")
+    @PostMapping("/addStockLockCheck")
+    public RestMessage<Object> addStockLockCheck(@RequestBody List<WmsInvStockLot> wmsInvStockLots) {
+        gspkeepCheckService.batchAddStockLockDb(wmsInvStockLots);
+        return doSuccess(null);
+    }
+
+    /**
+     * 养护计划批量新增,养护记录批量新增
+     */
+    @ApiOperation("养护计划批量新增,养护记录批量新增")
+    @PostMapping("/batchAdd")
+    public RestMessage<Object> batchAdd(@Valid @NotEmpty(message = "参数不能为空") @RequestBody List<GspUpkeepCheck> list) {
+        gspUpkeepCheckService.batchAdd("0", list);
+        return doSuccess(null);
+    }
+
+    /**
+     * 养护记录批量修改(保存养护记录)
+     */
+    @ApiOperation("养护记录批量修改")
+    @PostMapping("/batchEdit")
+    public RestMessage<Object> batchEdit(@RequestBody List<GspUpkeepCheck> gspUpkeepCheckList) {
+        String[] arr = gspUpkeepCheckService.batchEdit(gspUpkeepCheckList, false);
+        toOMS(arr);
+        return RestMessage.newInstance(true, "success", null);
+    }
+
+    private void toOMS(String[] arr) {
+        if (arr != null) {
+            EtlMessage em = new EtlMessage();
+            em.setId(String.join(",", arr));
+            em.setEtlType(EtlTypeConstants.gsp_upkeep_w2o);
+            try {
+                exchangeSender.send(em);
+            } catch (Exception e) {
+                throw new BizException("同步OMS异常,请联系系统管理员");
+            }
+        }
+    }
+
+    /**
+     * 养护记录批量审核
+     */
+    @ApiOperation("养护记录批量审核")
+    @PostMapping("/batchCheck")
+    public RestMessage<Object> batchCheck(@RequestBody List<GspUpkeepCheck> gspUpkeepCheckList) {
+        String[] arr = gspUpkeepCheckService.batchEdit(gspUpkeepCheckList, true);
+        return RestMessage.newInstance(true, "success", null);
+    }
+
+    /**
+     * 分页查询养护列表(审核页面查询接口)
+     */
+    @ApiOperation("分页查询养护列表(审核页面查询接口)")
+    @ApiImplicitParams({@ApiImplicitParam(name = "warehouseId", required = true, dataType = "String"), @ApiImplicitParam(name = "cargoOwnerId", required = true, dataType = "String"), @ApiImplicitParam(name = "status", required = false, dataType = "String"), @ApiImplicitParam(name = "pageSize", dataType = "Integer", defaultValue = "0"), @ApiImplicitParam(name = "pageNum", dataType = "Integer", defaultValue = "10")})
+    @GetMapping("/listPage")
+    public RestMessage<Page<GspUpkeepCheckVO>> listPage(@RequestParam String warehouseId, @RequestParam String cargoOwnerId, @RequestParam String status, @RequestParam(required = false) String billtype, @RequestParam Integer pageSize, @RequestParam Integer pageNum) throws Exception {
+        return RestMessage.newInstance(true, "success", gspUpkeepCheckService.listPage(warehouseId, cargoOwnerId, status, billtype, pageSize, pageNum));
+    }
+
+    /**
+     * 根据养护计划ID,查询
+     */
+    @Deprecated
+    @ApiOperation("根据养护计划ID,查询")
+    @GetMapping("/findByPlanId")
+    public RestMessage<Page<GspUpkeepCheckVO>> findByPlanId(QueryDTO dto) {
+        return RestMessage.newInstance(true, "success", gspUpkeepCheckService.findUpkeepPage(dto));
+    }
+
+    /**
+     * 养护页面列表查询,查询
+     */
+    @ApiOperation("养护页面列表查询,查询")
+    @GetMapping("/findUpkeepPage")
+    public RestMessage<Page<GspUpkeepCheckVO>> findUpkeepPage(QueryDTO dto) {
+        return RestMessage.newInstance(true, "success", gspUpkeepCheckService.findUpkeepPage(dto));
+    }
+
+    /**
+     * 养护记录菜单,弹框接口:查询养护计划
+     */
+    @ApiOperation("养护记录菜单,弹框接口:查询养护计划")
+    @GetMapping("/findPlan")
+    public RestMessage<Page<GspUpkeepCheckPlan>> findPlan(@Valid QueryDTO dto) {
+        return RestMessage.newInstance(true, "success", gspUpkeepCheckPlanService.findPlan(dto));
+    }
+
+    /**
+     * 养护不合格品提取
+     */
+    @ApiOperation("养护不合格品提取")
+    @GetMapping("/findUpkeep4MovePick")
+    public RestMessage<List<GspUpkeepCheckPlan>> findUpkeep4MovePick(QueryDTO upkeepCheckDTO) {
+        //		if(upkeepCheckDTO==null || StringUtils.isBlank(upkeepCheckDTO.getWarehouseId()) || StringUtils.isBlank(upkeepCheckDTO.getCargoOwnerId())){
+        //			throw new ParameterException("入参错误");
+        //		}
+        List<GspUpkeepCheckPlan> upkeep4MovePick = gspUpkeepCheckPlanService.findUpkeepPlan4MovePick(upkeepCheckDTO);
+        return RestMessage.newInstance(true, "success", upkeep4MovePick);
+    }
+
+    /**
+     * 养护不合格品提取明细
+     */
+    @ApiOperation("养护不合格品提取明细")
+    @GetMapping("/findUpkeepItem4MovePick")
+    public RestMessage<List<GspUpkeepCheckVO>> findUpkeepItem4MovePick(String id) {
+        return RestMessage.newInstance(true, "success", gspUpkeepCheckService.findUpkeepItem4MovePick(id));
+    }
+
+    @PostMapping("/confirmUpkeepMove")
+    @ApiOperation(value = "养护移库确认")
+    public RestMessage<Object> confirmUpkeepMove(@RequestBody String[] arrList) {
+        gspUpkeepCheckService.confirmUpkeepMove(arrList);
+        return RestMessage.newInstance(true, "success", null);
+    }
+
+    @GetMapping("/getLocationNoByLineId")
+    @ApiOperation(value = "查询养护单的货格")
+    public RestMessage<String> getLocationNoByLineId(@RequestParam String lineId) {
+        return RestMessage.newInstance(true, "success", gspUpkeepCheckService.getLocationNoByLineId(lineId));
+    }
+
+
+
+    @GetMapping("/autoUpKeepTask")
+    @ApiOperation(value = "定时任务生成养护计划")
+    public RestMessage<Object> autoUpKeepTask(String warehouseId,String cargoOwnerId,String enterpriseId) {
+        autoUpKeepTask.autoUpKeepTask(warehouseId,cargoOwnerId,enterpriseId);
+        return RestMessage.newInstance(true, "success", null);
+    }
+
+    @UserLog("设备养护结果")
+    @ApiOperation("设备养护结果")
+    @PostMapping("/confirmDevice")
+    public RestMessage<Object> confirmDevice() {
+        gspUpkeepCheckService.confirmDevice();
+        return RestMessage.newInstance(true, "success", null);
+    }
+
+    @UserLog("调用EIS出库任务推送")
+    @ApiOperation("调用EIS出库任务推送-养护发送设备指令")
+    @PostMapping("/sendTaskToEis")
+    public RestMessage<Object> sendTaskToEis(@Valid @NotEmpty(message = "请勾选需要发送设备指令的养护记录信息") @RequestBody List<String> ids) {
+        gspUpkeepCheckService.sendTaskToEis(ids);
+        return doSuccess(null);
+    }
+
+    @ApiOperation(value = "出库任务回告")
+    @PostMapping("/callbackPushTask")
+    public RestMessage<Object> callbackPushTask(@RequestBody List<String> ids) {
+        gspUpkeepCheckService.callbackPushTask(ids);
+        return doSuccess(null);
+    }
+
+    @ApiOperation(value = "EIS出库任务回告-outbound服务调用,AGV货架和AGV托盘,四向库都走这个")
+    @PostMapping("/gspUpKeepOutBack")
+    public RestMessage<Object> gspUpKeepOutBack(@RequestBody List<InfTaskOutBackDTO> upkeepList) {
+        gspUpkeepCheckService.gspUpKeepOutBack(upkeepList);
+        return doSuccess(null);
+    }
+
+    /**
+     * 库存解锁复检不合格转gsp移库
+     */
+    @ApiOperation("库存解锁复检不合格转gsp移库")
+    @PostMapping("/addStockUnLock")
+    public RestMessage<Object> addStockUnLock(@RequestBody List<WmsInvStockLot> wmsInvStockLots) {
+        gspkeepCheckService.addStockUnLock(wmsInvStockLots);
+        return doSuccess(null);
+    }
+}

+ 124 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/controller/PrintController.java

@@ -0,0 +1,124 @@
+package com.prolog.cs.base.gsp.controller;
+
+import cn.hutool.core.collection.CollUtil;
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.dao.GspUpkeepCheckMapper;
+import com.prolog.cs.base.gsp.dao.GspUpkeepCheckPlanMapper;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheck;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheckPlan;
+import com.prolog.cs.base.gsp.service.GspUpkeepCheckPlanService;
+import com.prolog.cs.base.gsp.service.GspUpkeepCheckService;
+import com.prolog.cs.base.gsp.vo.GspUpkeepCheckVO;
+import com.prolog.framework.authority.core.dto.UserDTO;
+import com.prolog.framework.authority.user.UserTemplate;
+import com.prolog.framework.bz.common.print.PrintData;
+import com.prolog.framework.bz.common.print.ReportData;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.log.aop.annotation.UserLog;
+import com.prolog.framework.utils.DateUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import net.sf.cglib.beans.BeanMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.constraints.NotEmpty;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 打印控制类
+ *
+ * @author Xiong
+ */
+@Api(tags = "单据打印")
+@RestController
+@RequestMapping("/print")
+public class PrintController {
+
+    @Autowired
+    private UserTemplate userTemplate;
+
+    @Autowired
+    private GspUpkeepCheckMapper mapper;
+
+    @Autowired
+    private GspUpkeepCheckPlanMapper gspUpkeepCheckPlanMapper;
+
+    @Autowired
+    private GspUpkeepCheckService gspUpkeepCheckService;
+
+    @Autowired
+    private GspUpkeepCheckPlanService gspUpkeepCheckPlanService;
+
+    /**
+     * 养护打印
+     */
+    @ApiOperation("养护打印")
+    @GetMapping("/getGSPUpkeepPrintData")
+    @UserLog()
+    public RestMessage<Object> getGspYHPrintData(QueryDTO upkeepCheckDTO) {
+        UserDTO userDTO = userTemplate.getUserDTO();
+        if (upkeepCheckDTO.getEndTime() != null) {
+            Calendar calendar = new GregorianCalendar();
+            calendar.setTime(upkeepCheckDTO.getEndTime());
+            calendar.add(Calendar.DATE, 1);//1表示明天,-1表示昨天
+            upkeepCheckDTO.setEndTime(calendar.getTime());//这个时间就是第二天
+        }
+        GspUpkeepCheckPlan plan = gspUpkeepCheckPlanMapper.findById(upkeepCheckDTO.getPlanId(), GspUpkeepCheckPlan.class);
+        List<GspUpkeepCheck> list = mapper.findList(upkeepCheckDTO);
+        List<GspUpkeepCheckVO> gspUpkeepCheckVOS = gspUpkeepCheckService.spellGspUpkeepCheckVOSPage(list);
+
+        PrintData pd = new PrintData();
+        Map<String, List<GspUpkeepCheckVO>> collect = gspUpkeepCheckVOS.stream().collect(Collectors.groupingBy(x -> x.getItemHealthCategoryName()));
+        Set<Map.Entry<String, List<GspUpkeepCheckVO>>> entries = collect.entrySet();
+        List<ReportData> rdList = new ArrayList<ReportData>();
+        for (Map.Entry<String, List<GspUpkeepCheckVO>> entry : entries) {
+            // 组装报表头
+            ReportData rd = new ReportData();
+            Map<String, Object> head = new HashMap<>();
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
+            head.put("printDate", sdf.format(new Date()));
+            if (CollUtil.isNotEmpty(gspUpkeepCheckVOS)) {
+                head.put("cargoOwnerName", gspUpkeepCheckVOS.get(0).getCargoOwnerName());
+                head.put("warehouseName", gspUpkeepCheckVOS.get(0).getWarehouseName());
+            }
+            head.put("itemHealthCategoryName",entry.getKey());
+            head.put("enterpriseName",userDTO.getEnterpriseName());
+            head.put("billNo", plan.getCode());
+            head.put("operBy", userDTO.getNickname());
+            head.put("isProtected","普通");
+            if(plan.getIsProtected()!=null&&plan.getIsProtected()==1){
+                head.put("isProtected","重点");
+            }
+            List<Map<String, Object>> tableList = new ArrayList<Map<String, Object>>();
+            for (GspUpkeepCheckVO dto : entry.getValue()) {
+                dto.setShowExpiredDate(DateUtils.format(dto.getValidUntil(), "yyyy-MM-dd"));
+                // 格式化生产日期
+                dto.setShowProductionDate(DateUtils.format(dto.getPdateFrom(), "yyyy-MM-dd"));
+                dto.setQualityStatus("合格");
+                // 放单纯的规格数据
+                dto.setSpec(dto.getSpecification());
+                dto.setSpecification(dto.getItemName() + "/" + dto.getSpecification());
+                tableList.add(BeanMap.create(dto));
+                rd.setHead(head);
+                rd.setTable(tableList);
+                rdList.add(rd);
+            }
+        }
+        pd.setData(rdList);
+        return RestMessage.newInstance(true, "success", pd);
+    }
+
+    /**
+     * 批量删除待审核破损申请
+     */
+    @ApiOperation("更新养护打印次数")
+    @PostMapping("/updateGspYHPrintCount")
+    public RestMessage<Object> updateGspYHPrintCount(@NotEmpty(message = "请选择数据操作") @RequestBody String planId) {
+        gspUpkeepCheckPlanMapper.updateGspYHPrintCount(planId);
+        return RestMessage.newInstance(true, "success", null);
+    }
+
+}

+ 43 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/controller/RfGspUpkeepCheckController.java

@@ -0,0 +1,43 @@
+package com.prolog.cs.base.gsp.controller;
+
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.service.GspUpkeepCheckService;
+import com.prolog.cs.base.gsp.vo.GspUpkeepCheckVO;
+import com.prolog.cs.base.gsp.vo.RfGspUpkeepCheckVO;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.core.pojo.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * @Description 质量管理
+ * @Date 2021-05-08
+ */
+
+@Api(tags = "RF质量管理")
+@RestController
+@RequestMapping("/gspUpkeepCheck")
+public class RfGspUpkeepCheckController {
+
+    @Resource
+    private GspUpkeepCheckService gspUpkeepCheckService;
+
+
+    @ApiOperation("获取所有待养护记录")
+    @GetMapping("/rf/findUpkeepPage")
+    public RestMessage<Page<RfGspUpkeepCheckVO>> findUpkeepPageByRf(QueryDTO dto) {
+        return RestMessage.querySuccess(gspUpkeepCheckService.findUpkeepPageByRf(dto));
+    }
+
+    @ApiOperation("获取所有待养护记录")
+    @GetMapping("/rf/findUpkeepDtl")
+    public RestMessage<GspUpkeepCheckVO> findUpkeepDtlByRf(QueryDTO dto) {
+        return RestMessage.querySuccess(gspUpkeepCheckService.findUpkeepDtlByRf(dto));
+    }
+
+}

+ 43 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/core/ControllerExceptionAdvice.java

@@ -0,0 +1,43 @@
+package com.prolog.cs.base.gsp.core;
+
+import com.prolog.framework.common.message.RestMessage;
+import org.springframework.http.converter.HttpMessageNotReadableException;
+import org.springframework.validation.BindException;
+import org.springframework.validation.ObjectError;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+import javax.validation.ConstraintViolation;
+import javax.validation.ConstraintViolationException;
+import javax.validation.ValidationException;
+import java.util.Set;
+
+@RestControllerAdvice
+public class ControllerExceptionAdvice {
+
+    //某个字段为空
+    @ExceptionHandler({BindException.class})
+    public RestMessage<Object> methodArgumentNotValidExceptionHandler(BindException e) {
+        ObjectError objectError = e.getBindingResult().getAllErrors().get(0);
+        return RestMessage.newInstance(false, objectError.getDefaultMessage(), null);
+    }
+
+    @ExceptionHandler({ValidationException.class})
+    public RestMessage<Object> methodArgumentNotValidExceptionHandler(ValidationException e) {
+        return RestMessage.newInstance(false, e.getMessage(), null);
+    }
+
+    //列表参数没有传
+    @ExceptionHandler({ConstraintViolationException.class})
+    public RestMessage<Object> methodArgumentNotValidExceptionHandler(ConstraintViolationException e) {
+        Set<ConstraintViolation<?>> set = e.getConstraintViolations();
+        String result = set.stream().map(ConstraintViolation::getMessage).distinct().findFirst().orElse(null);
+        return RestMessage.newInstance(false, result == null ? "请求参数不能为空" : result, null);
+    }
+
+    //请求参数没用传
+    @ExceptionHandler({HttpMessageNotReadableException.class})
+    public RestMessage<Object> methodArgumentNotValidExceptionHandler() {
+        return RestMessage.newInstance(false, "请求参数不能为空", null);
+    }
+}

+ 14 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/DxiGspDestroyRequestRecordMapper.java

@@ -0,0 +1,14 @@
+package com.prolog.cs.base.gsp.dao;
+
+import com.prolog.framework.dao.mapper.BaseMapper;
+import com.prolog.cs.base.gsp.model.DxiGspDestroyRequestRecord;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description  
+ * @Date 2021-06-30 
+ */
+@Repository
+public interface DxiGspDestroyRequestRecordMapper extends BaseMapper<DxiGspDestroyRequestRecord> {
+
+}

+ 14 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/DxiGspGainslossesBillRecMapper.java

@@ -0,0 +1,14 @@
+package com.prolog.cs.base.gsp.dao;
+
+import com.prolog.framework.dao.mapper.BaseMapper;
+import com.prolog.cs.base.gsp.model.DxiGspGainslossesBillRec;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description  
+ * @Date 2021-06-30 
+ */
+@Repository
+public interface DxiGspGainslossesBillRecMapper extends BaseMapper<DxiGspGainslossesBillRec> {
+
+}

+ 14 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/DxiGspMaintenanceRecordMapper.java

@@ -0,0 +1,14 @@
+package com.prolog.cs.base.gsp.dao;
+
+import com.prolog.framework.dao.mapper.BaseMapper;
+import com.prolog.cs.base.gsp.model.DxiGspMaintenanceRecord;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description  
+ * @Date 2021-06-29 
+ */
+@Repository
+public interface DxiGspMaintenanceRecordMapper extends BaseMapper<DxiGspMaintenanceRecord> {
+
+}

+ 25 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/DxiGspQualityReviewDMapper.java

@@ -0,0 +1,25 @@
+package com.prolog.cs.base.gsp.dao;
+
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.model.DxiGspQualityReviewD;
+import com.prolog.cs.base.gsp.vo.GspQualityCheckMoveItemVo;
+import com.prolog.cs.base.gsp.vo.GspQualityCheckMoveVo;
+import com.prolog.framework.dao.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * @Description  
+ * @Date 2022-05-27
+ */
+@Repository
+public interface DxiGspQualityReviewDMapper extends BaseMapper<DxiGspQualityReviewD> {
+
+
+    List<GspQualityCheckMoveVo> findQualityReview4MovePick(@Param("warehouseId")String warehouseId,@Param("cargoOwnerId")String cargoOwnerId,
+                                                           @Param("requestBilltype")String requestBilltype, @Param("billno")String billno);
+
+    List<GspQualityCheckMoveItemVo> findQualityReview4MoveItemPick(@Param("billId")String billId);
+}

+ 26 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/DxiGspQualityReviewHMapper.java

@@ -0,0 +1,26 @@
+package com.prolog.cs.base.gsp.dao;
+
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.model.DxiGspQualityReviewH;
+import com.prolog.framework.dao.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * @Description  
+ * @Date 2022-05-27
+ */
+@Repository
+public interface DxiGspQualityReviewHMapper extends BaseMapper<DxiGspQualityReviewH> {
+
+
+    List<DxiGspQualityReviewH> findQualityReview4MovePick(QueryDTO upkeepCheckDTO);
+
+    List<DxiGspQualityReviewH> findNoEnd(@Param("branchcode")String branchcode,
+                                         @Param("consignorcode")String consignorcode,
+                                         @Param("requestBilltype")String requestBilltype,
+                                         @Param("billNo")String billNo,
+                                         @Param("status")String status);
+}

+ 14 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUnqualifiedDestroyDMapper.java

@@ -0,0 +1,14 @@
+package com.prolog.cs.base.gsp.dao;
+
+import com.prolog.framework.dao.mapper.BaseMapper;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedDestroyD;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description  
+ * @Date 2021-05-10 
+ */
+@Repository
+public interface GspUnqualifiedDestroyDMapper extends BaseMapper<GspUnqualifiedDestroyD> {
+
+}

+ 14 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUnqualifiedDestroyMapper.java

@@ -0,0 +1,14 @@
+package com.prolog.cs.base.gsp.dao;
+
+import com.prolog.framework.dao.mapper.BaseMapper;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedDestroy;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description  
+ * @Date 2021-05-10 
+ */
+@Repository
+public interface GspUnqualifiedDestroyMapper extends BaseMapper<GspUnqualifiedDestroy> {
+
+}

+ 24 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUnqualifiedLossDMapper.java

@@ -0,0 +1,24 @@
+package com.prolog.cs.base.gsp.dao;
+
+import com.prolog.cs.base.gsp.model.GspUnqualifiedLossD;
+import com.prolog.framework.dao.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @Description  
+ * @Date 2021-05-10 
+ */
+@Repository
+public interface GspUnqualifiedLossDMapper extends BaseMapper<GspUnqualifiedLossD> {
+    
+    List<GspUnqualifiedLossD> listPagePick(GspUnqualifiedLossD queryVO);
+    
+    Long updateDestroyingQty(@Param("id") String id, @Param("destroyingQty") BigDecimal destroyingQty);
+    
+    Long updateDestroyedQty(@Param("id") String id, @Param("destroyedQty") BigDecimal destroyedQty);
+
+}

+ 14 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUnqualifiedLossMapper.java

@@ -0,0 +1,14 @@
+package com.prolog.cs.base.gsp.dao;
+
+import com.prolog.framework.dao.mapper.BaseMapper;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedLoss;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description  
+ * @Date 2021-05-10 
+ */
+@Repository
+public interface GspUnqualifiedLossMapper extends BaseMapper<GspUnqualifiedLoss> {
+
+}

+ 14 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUnqualifiedStockMapper.java

@@ -0,0 +1,14 @@
+package com.prolog.cs.base.gsp.dao;
+
+import com.prolog.framework.dao.mapper.BaseMapper;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedStock;
+import org.springframework.stereotype.Repository;
+
+/**
+ * @Description  
+ * @Date 2021-05-17 
+ */
+@Repository
+public interface GspUnqualifiedStockMapper extends BaseMapper<GspUnqualifiedStock> {
+
+}

+ 24 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUpkeepCheckMapper.java

@@ -0,0 +1,24 @@
+package com.prolog.cs.base.gsp.dao;
+
+import cn.hutool.core.date.DateTime;
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheck;
+import com.prolog.cs.base.gsp.vo.RfGspUpkeepCheckVO;
+import com.prolog.framework.dao.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * @Description
+ * @Date 2021-05-10
+ */
+@Repository
+public interface GspUpkeepCheckMapper extends BaseMapper<GspUpkeepCheck> {
+    List<GspUpkeepCheck> findList(QueryDTO queryVO);
+
+    List<RfGspUpkeepCheckVO> findUpkeepPageByRf(QueryDTO queryDTO);
+
+    void updateOutboundInstructById(@Param("ids") List<String> ids, @Param("now") DateTime now);
+}

+ 21 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/GspUpkeepCheckPlanMapper.java

@@ -0,0 +1,21 @@
+package com.prolog.cs.base.gsp.dao;
+
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheckPlan;
+import com.prolog.framework.dao.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * @Description  
+ * @Date 2021-05-19 
+ */
+@Repository
+public interface GspUpkeepCheckPlanMapper extends BaseMapper<GspUpkeepCheckPlan> {
+
+    List<GspUpkeepCheckPlan> findList(QueryDTO queryVO);
+
+    Long updateGspYHPrintCount(@Param("id") String id);
+}

+ 10 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/dao/OmsInventoryOrderMapper.java

@@ -0,0 +1,10 @@
+package com.prolog.cs.base.gsp.dao;
+
+import com.prolog.cs.base.gsp.model.OmsInventoryOrder;
+import com.prolog.framework.dao.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface OmsInventoryOrderMapper extends BaseMapper<OmsInventoryOrder> {
+    
+}

+ 34 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/ChainClient.java

@@ -0,0 +1,34 @@
+package com.prolog.cs.base.gsp.resource;
+
+import com.prolog.cs.basic.chain.model.cargo.BaseCargoOwnerMst;
+import com.prolog.framework.common.message.RestMessage;
+import org.springframework.cloud.openfeign.FeignClient;
+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.RequestParam;
+
+import java.util.Map;
+
+@FeignClient(value = "${prolog.service.chain}")
+public interface ChainClient {
+
+	/**
+	 * 批量查询货主信息
+	 *
+	 * @return 货主信息
+	 */
+	@PostMapping("/baseCargoOwnerMst/v1.0/getByIds")
+	RestMessage<Map<String, BaseCargoOwnerMst>> getCargoOwnerMstByIds(@RequestBody String[] Ids);
+	
+		
+
+	/**
+	 * 批量查询货主信息
+	 *
+	 * @return 货主信息
+	 */
+	@GetMapping("/baseCargoOwnerMst/v1.0/infoById")
+	RestMessage<Map<String, Object>> cargoOwnerInfoById(@RequestParam("cargoOwnerId") String cargoOwnerId);
+
+}

+ 38 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/CommonClient.java

@@ -0,0 +1,38 @@
+package com.prolog.cs.base.gsp.resource;
+
+import com.prolog.cs.basic.chain.model.dict.BaseCommonDictType;
+import com.prolog.cs.basic.common.model.BaseCommonDict;
+import com.prolog.framework.common.message.RestMessage;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+import java.util.Map;
+
+@FeignClient(value = "${prolog.service.common}")
+public interface CommonClient {
+
+	/**
+	 * 服务调用,查询养护类型关联商品大类
+	 */
+	@GetMapping("/dict/findUpKeepDict")
+	public RestMessage<Map<String,String>> findUpKeepDict(@RequestParam("isProtected") Integer isProtected);
+
+	/**
+	 * 服务调用,查询养护类型关联商品大类
+	 */
+	@GetMapping("/dicttype")
+	public RestMessage<BaseCommonDictType> getDictTypeById(@RequestParam("id") String id);
+	
+	/**
+	 * 服务调用,查询养护类型关联商品大类
+	 */
+	@GetMapping("/dicttype/getDictTypeByCode")
+	public RestMessage<BaseCommonDictType> getDictTypeByCode(@RequestParam("code") String code);
+
+
+	@GetMapping("/dict/basic/type-list")
+	public RestMessage<List<BaseCommonDict>> getDictBasicListByCodes(@RequestParam("typeCode") String typeCode, @RequestParam("dictCodes") String[] dictCodes);
+
+}

+ 38 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/EisResource.java

@@ -0,0 +1,38 @@
+package com.prolog.cs.base.gsp.resource;
+
+import com.prolog.cs.base.gsp.vo.EisPushTaskVO;
+import com.prolog.cs.biz.outbound.model.dto.ContainerConfirmDto;
+import com.prolog.entity.vo.OutBoundRequestVO;
+import com.prolog.framework.common.message.RestMessage;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.List;
+
+@FeignClient(value = "${prolog.service.operate}")
+public interface EisResource {
+
+    /**
+     * EIS出库任务推送
+     *
+     * @return {@link RestMessage}<{@link Object}>
+     */
+    @PostMapping("/wms/v1.0/eis/pushTask")
+    RestMessage<Object> pushTask(@RequestBody List<EisPushTaskVO> list);
+
+
+    /**
+     * EIS作业完成确认接口
+     *
+     * @return {@link RestMessage}<{@link Object}>
+     */
+    @PostMapping("/wms/v1.0/eis/taskFinishedConfirm")
+    RestMessage<Object> taskFinishedConfirm(@RequestBody ContainerConfirmDto vo);
+
+    @ApiOperation("EIS出库任务推送")
+    @PostMapping("/wms/v1.0/eis/outBoundRequest")
+    RestMessage<Object> outBoundRequest(@RequestBody List<OutBoundRequestVO> list);
+
+}

+ 15 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/IntegrationResource.java

@@ -0,0 +1,15 @@
+package com.prolog.cs.base.gsp.resource;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.Map;
+
+@FeignClient(value = "${prolog.service.integration}")
+public interface IntegrationResource {
+
+    @PostMapping("/http/service")
+    String httpService(@RequestBody Map<String, Object> bodyData);
+
+}

+ 76 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/InventoryClient.java

@@ -0,0 +1,76 @@
+package com.prolog.cs.base.gsp.resource;
+
+import com.prolog.framework.bz.core.collection.ValidList;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.upcloud.base.inventory.model.WmsInvStockLot;
+import com.prolog.upcloud.base.inventory.vo.*;
+import com.prolog.upcloud.base.strategy.dto.stock.StockLocatorDTO;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+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.RequestParam;
+
+import java.util.List;
+
+@FeignClient(value = "${prolog.service.inventory}")
+public interface InventoryClient {
+
+	/**
+	 * 报废
+	 *
+	 * @param invStock 报废信息
+	 * @return 执行结果
+	 */
+	@PostMapping("/stock/v1/scarp")
+	RestMessage scrapStock(@RequestBody List<InvStockScarp> invStock);
+	
+	//报废取消
+	@PostMapping("/stock/v1/scarp/cancel")
+    RestMessage scrapCancel(@RequestBody InvStockCancel stockCancel);
+
+	/**
+	 * 报废确认
+	 *
+	 * @param check 报废单编码
+	 * @return 执行结果
+	 */
+	@PostMapping("/stock/v1/scarp/check")
+	@ApiOperation(value = "报废确认")
+    RestMessage scrapStockCheck(@RequestBody InvStockCheck check);
+	/**
+	 * 养护
+	 *
+	 * @param invStock 养护信息
+	 * @return 执行结果
+	 */
+	@PostMapping("/stock/v1/maintain")
+	@ApiOperation(value = "养护")
+	public RestMessage maintainStock( @RequestBody ValidList<InvStockMaintain> invStock);
+
+	@PostMapping("/stock/v1/maintain/cancel")
+	@ApiOperation(value = "养护取消")
+	public RestMessage maintainCancel(@RequestBody InvStockCancel stockCancel);
+
+	//查询商品库存批次基础信息列表
+	@GetMapping("/batch-number/v1/basic/list")
+	public RestMessage<List<BatchNumberListVO>> getBatchNumberBasicInfo(@RequestParam("batchIds") String[] batchIds);
+	
+	//获取多个商品批次库存
+	@PostMapping("/stock/v1/qty/avl-list")
+	public RestMessage<List<WmsInvStockQtyVO>> getAvailableQuantityList(@RequestBody List<WmsInvStockQtyQueryVO> qtyQueries);
+
+	@GetMapping("/stock-lot/v1/locators")
+	public RestMessage<List<StockLocatorDTO>> getItemLocators(@RequestParam("warehouseId") String warehouseId,
+															  @RequestParam("cargoOwnerId") String cargoOwnerId,
+															  @RequestParam("itemId") String itemId,
+															  @RequestParam(value = "status", required = false, defaultValue = "1") String status,
+															  @RequestParam(value = "subStatus", required = false, defaultValue = "1") String subStatus);
+
+	@PostMapping("/integration/v1/ask")
+	public RestMessage<?> askIntegration(@RequestBody AskIntegrationVo vo);
+
+	@PostMapping("stock/v1/updateLotStatus")
+	public RestMessage updateLotStatus(@RequestBody WmsInvStockLot wmsInvStockLot);
+}

+ 47 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/ItemClient.java

@@ -0,0 +1,47 @@
+package com.prolog.cs.base.gsp.resource;
+
+import com.prolog.cs.basic.item.model.BaseMtlItemMst;
+import com.prolog.cs.basic.item.model.vo.ItemBaseInfoVO;
+import com.prolog.framework.common.message.RestMessage;
+import org.springframework.cloud.openfeign.FeignClient;
+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.RequestParam;
+
+import java.util.List;
+import java.util.Set;
+
+@FeignClient(value = "${prolog.service.item}")
+public interface ItemClient {
+
+
+    /**
+     * 批量查询商品基础信息
+     *
+     * @return 商品基础信息
+     */
+    @GetMapping("/item/base/list")
+    RestMessage<List<ItemBaseInfoVO>> getItemBaseList(@RequestParam("itemIds") String[] itemIds);
+
+    /**
+     * 批量查询商品信息
+     *
+     * @return 商品信息
+     */
+    @PostMapping("/item/listbyids")
+    RestMessage<List<BaseMtlItemMst>> getListByIds(@RequestBody String[] itemIds);
+
+    /**
+     * 根据ID查询商品信息
+     *
+     * @return 商品信息
+     */
+    @GetMapping("/item/item-byid")
+    RestMessage<BaseMtlItemMst> getItemById(@RequestParam("itemId") String itemId);
+
+
+    @PostMapping("/item/getByItemCodes")
+    RestMessage<List<BaseMtlItemMst>> getByItemCodes(@RequestParam("cargoOwnerId") String cargoOwnerId, @RequestParam("itemCodes") Set<String> itemCode);
+
+}

+ 26 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/OperateClient.java

@@ -0,0 +1,26 @@
+package com.prolog.cs.base.gsp.resource;
+
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.upcloud.base.wh.operate.dto.ReplenishPassiveDTO;
+import com.prolog.upcloud.base.wh.operate.vo.ReplenishPassiveSaveVO;
+import com.prolog.upcloud.base.wh.operate.vo.WmsMoveSaveVO;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.List;
+
+@FeignClient(value = "${prolog.service.operate}")
+public interface OperateClient {
+
+    /**
+     * 新增移库单
+     *
+     * @param saveVO 被动补货信息
+     * @return
+     */
+    @PostMapping("/move/v1/add")
+    public RestMessage addMove(@RequestBody WmsMoveSaveVO saveVO);
+}

+ 20 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/PrestoClient.java

@@ -0,0 +1,20 @@
+package com.prolog.cs.base.gsp.resource;
+
+import com.prolog.framework.common.message.RestMessage;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.List;
+import java.util.Map;
+
+@FeignClient(value = "${prolog.service.presto}")
+public interface PrestoClient {
+	
+	/**
+	 *
+	 */
+	@PostMapping("/search")
+	RestMessage<List<Map>> search(@RequestBody Map map);
+
+}

+ 57 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/StrategyClient.java

@@ -0,0 +1,57 @@
+package com.prolog.cs.base.gsp.resource;
+
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.upcloud.base.strategy.dto.StrategyDTO;
+import com.prolog.upcloud.base.strategy.model.BusinessControl;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+@FeignClient("${prolog.service.strategy}")
+public interface StrategyClient {
+
+    /**
+     * 查询执行策略
+     *
+     * @param enterpriseId 企业id
+     * @param category     策略分类[上架:InStock,下架:OutStock,补货:Replenishment]
+     * @param cargoOwnerId 货主id
+     * @param warehouseId  仓库id
+     * @return 执行策略
+     */
+    @GetMapping("/strategy/v1/execute")
+    RestMessage<StrategyDTO> getStrategyDTO(@RequestParam("enterpriseId") String enterpriseId,
+                                            @RequestParam("category") String category,
+                                            @RequestParam("cargoOwnerId") String cargoOwnerId,
+                                            @RequestParam("warehouseId") String warehouseId);
+
+    /**
+     * 查询执行策略
+     *
+     * @param enterpriseId  企业id
+     * @param category      策略分类[上架:InStock,下架:OutStock,补货:Replenishment]
+     * @param cargoOwnerIds 货主id集合
+     * @param warehouseId   仓库id
+     * @return 执行策略
+     */
+    @GetMapping("/strategy/v1/execute/batch")
+    RestMessage<List<StrategyDTO>> getStrategyDTO(@RequestParam("enterpriseId") String enterpriseId,
+                                                  @RequestParam("category") String category,
+                                                  @RequestParam("cargoOwnerIds") String[] cargoOwnerIds,
+                                                  @RequestParam("warehouseId") String warehouseId);
+    
+    /**
+     * 查询执行策略
+     *
+     * @param enterpriseId  企业id
+     * @param warehouseId   仓库id
+     * @return 执行策略
+     */
+    @GetMapping("/registry/by-code")
+    RestMessage<BusinessControl> registryByCode(@RequestParam("regCode") String regCode,
+                                                @RequestParam("warehouseId") String warehouseId,
+                                                @RequestParam("cargoOwnerId") String cargoOwnerId,
+                                                @RequestParam("enterpriseId") String enterpriseId);
+}

+ 76 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/resource/WarehouseClient.java

@@ -0,0 +1,76 @@
+package com.prolog.cs.base.gsp.resource;
+
+import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseArea;
+import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseMst;
+import com.prolog.cs.basic.warehouse.model.dto.WmsWhBldgDTO;
+import com.prolog.cs.basic.warehouse.model.vo.WarehouseLocatorBasicInfo;
+import com.prolog.framework.common.message.RestMessage;
+import org.springframework.cloud.openfeign.FeignClient;
+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.RequestParam;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+@FeignClient(value = "${prolog.service.warehouse}")
+public interface WarehouseClient {
+
+    /**
+     * 批量查询仓库信息
+     *
+     * @return 仓库信息
+     */
+    @GetMapping("/warehouse")
+    RestMessage<BaseWmsWarehouseMst> warehouse(@RequestParam("id") String id);
+
+    /**
+     * 批量查询仓库信息
+     *
+     * @return 仓库信息
+     */
+    @PostMapping("/warehouse/mapbyids")
+    RestMessage<Map<String, BaseWmsWarehouseMst>> mapbyids(@RequestBody Set<String> warehouseIds);
+
+    /**
+     * 查询建筑物信息
+     *
+     * @return 建筑物信息
+     */
+    @GetMapping("/wmsWhBldg/findByPkId")
+    RestMessage<WmsWhBldgDTO> findBldgByPkId(@RequestParam("pkId") String pkId);
+
+    /**
+     * 批量查询建筑物基础信息
+     */
+    @GetMapping("/wmsWhBldg/basic/list")
+    RestMessage<List<WmsWhBldgDTO>> getBldgBasicInfoList(String[] bldgIds);
+
+    /**
+     * 批量查询库位基础信息
+     *
+     * @param locatorIds 库位编码集合
+     * @return 库位基础信息
+     */
+    @GetMapping("/locator/basic/list")
+    RestMessage<List<WarehouseLocatorBasicInfo>> getLocationBasicInfos(@RequestParam("locatorIds") String[] locatorIds);
+
+    /**
+     * 批量查询库位详细信息
+     *
+     * @param locatorIds 库位编码集合
+     * @return 库位详细信息
+     */
+    @GetMapping("/locator/detail/list")
+    RestMessage<List<HashMap<String, Object>>> getLocationDetailInfos(@RequestParam("locatorIds") String[] locatorIds);
+
+    @PostMapping("/warehouse/getByWarehouseCode")
+    RestMessage<Map<String, BaseWmsWarehouseMst>> getByWarehouseCode(Set<String> warehouseCode);
+
+
+    @GetMapping("/baseWmsWarehouseArea/basic/list")
+    RestMessage<List<BaseWmsWarehouseArea>> getWarehouseAreaBasicInfos(@RequestParam("warehouseAreaIds") String[] warehouseAreaIds);
+}

+ 149 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/AutoUpKeepTask.java

@@ -0,0 +1,149 @@
+package com.prolog.cs.base.gsp.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.netflix.hystrix.strategy.concurrency.HystrixRequestContext;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheck;
+import com.prolog.cs.base.gsp.resource.CommonClient;
+import com.prolog.cs.base.gsp.resource.PrestoClient;
+import com.prolog.cs.base.gsp.service.GspUpkeepCheckService;
+import com.prolog.cs.basic.chain.model.dict.BaseCommonDictType;
+import com.prolog.framework.authority.util.HystrixVarUtil;
+import com.prolog.framework.bz.common.search.SearchApi;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.core.exception.BizException;
+import com.prolog.framework.utils.JsonUtils;
+import com.prolog.framework.utils.ObjectUtils;
+import com.prolog.framework.utils.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.*;
+
+@Component
+public class AutoUpKeepTask {
+
+    private static Logger logger = LoggerFactory.getLogger(AutoUpKeepTask.class);
+
+    @Autowired
+    private CommonClient commonClient;
+
+    @Autowired
+    private PrestoClient prestoClient;
+
+    @Autowired
+    private GspUpkeepCheckService gspUpkeepCheckService;
+
+    @Resource
+    private SearchApi searchApi;
+
+    // 可配置自动养护定时任务的用户信息
+    @Value("${prolog.autoUpkeep.enterpriseId:106}")
+    private String autoEnterpriseId;
+
+    //@Scheduled(cron="0 20 01 00 * ?")//每月20号,凌晨1点执行 //@Scheduled(cron="0 0 1 * * ?")//每天,凌晨1点执行
+    public void autoUpKeepTask(String warehouseId,String cargoOwnerId,String enterpriseId) {
+        logger.info("自动养护开始warehouseId="+warehouseId);
+        try {
+            HystrixRequestContext context = HystrixRequestContext.initializeContext();
+            HystrixVarUtil.setUserKey("yj-test");
+            RestMessage<BaseCommonDictType> result = commonClient.getDictTypeById("606904192438767616");
+            //RestMessage<BaseCommonDictType> result=commonClient.getDictTypeByCode("GSP_YH_AUTO");
+            if (result != null && result.isSuccess() && result.getData() != null && result.getData().getIsEnable() != 1) {
+                return;
+            }
+//            Map mapBldg = new HashMap();
+//            Map params = new HashMap();
+//            params.put("warehouseId",warehouseId);
+//            params.put("cargoOwnerId",cargoOwnerId);
+//            mapBldg.put("num", "GSP_AUTO_UPKEEP_BLDGS");//GSP-自动养护,查询建筑物、货主
+//            mapBldg.put("params",params);
+//            RestMessage<List<Map>> bldgResult = prestoClient.search(mapBldg);
+//            if (bldgResult == null || !bldgResult.isSuccess() || bldgResult.getData() == null) {
+//                logger.info("数据为空" + JSON.toJSONString(bldgResult));
+//                return;
+//            }
+//            List<Map> list = bldgResult.getData();
+//
+//            // 支持选择仓库 - by Huanglh 2022-01-21
+//            if (!StringUtils.isBlank(warehouseId)) {
+//                for (Map map : list) {
+//                    if (warehouseId.equals(map.get("warehouseId").toString())) {
+//                        // 如果仓库匹配,则列表变为只有此条记录
+//                        list = Arrays.asList(map);
+//                        break;
+//                    }
+//                }
+//            }
+
+            Map<String, String> currentUser = new HashMap<>();
+            // 获取企业id
+            currentUser.put("enterpriseId", enterpriseId);
+//            for (int i = 0; i < list.size(); i++) {
+//                Map map = list.get(i);
+
+                Map sonMap = new HashMap();
+//                sonMap.put("warehouseId", map.get("warehouseId").toString());
+//                sonMap.put("cargoOwnerId", map.get("cargoOwnerId").toString());
+                //sonMap.put("bldgId", map.get("bldgId").toString());
+                sonMap.put("warehouseId", warehouseId);
+                sonMap.put("cargoOwnerId", cargoOwnerId);
+                // 查询中还需要企业id
+                sonMap.put("currentUser", currentUser);
+
+                Map importantMap = new HashMap();
+                importantMap.put("id", "yj_592105438389080064");//GSP-质量管理模块-重点养护菜单
+                importantMap.put("params", sonMap);
+                RestMessage<List<Map>> importantResult = prestoClient.search(importantMap);
+                //List<Map> importantResult = new ArrayList<>();
+//                try {
+//                    importantResult = searchApi.searchForMap("592105438389080064", sonMap);
+//                } catch (Exception e1) {
+//                    logger.info("查询重点养护计划失败,原因{}", e1);
+//                }
+//                if (!ObjectUtils.isNull(importantResult)) {
+//                    batchAddGspUpkeepCheckList(importantResult);
+//                }
+                if (importantResult != null && importantResult.isSuccess() && importantResult.getData() != null) {
+                    batchAddGspUpkeepCheckList(importantResult.getData());
+                }
+                Map normalMap = new HashMap();
+                normalMap.put("id", "yj_592360607987142656");//GSP-质量管理模块-一般养护计划菜单
+                normalMap.put("params", sonMap);
+//                List<Map> normalResult = new ArrayList<>();
+//                try {
+//                    normalResult = searchApi.searchForMap("592360607987142656", sonMap);
+//                } catch (Exception e1) {
+//                    logger.info("查询重点养护计划失败,原因{}", e1);
+//                }
+//                if (!ObjectUtils.isNull(normalResult)) {
+//                    batchAddGspUpkeepCheckList(normalResult);
+//                }
+                RestMessage<List<Map>> normalResult = prestoClient.search(normalMap);
+                if (normalResult != null && normalResult.isSuccess() && normalResult.getData() != null) {
+                    batchAddGspUpkeepCheckList(normalResult.getData());
+                }
+//            }
+            logger.info("自动养护结束warehouseId="+warehouseId);
+        } catch (Exception e) {
+            logger.info("自动养护异常warehouseId="+warehouseId,e);
+        }
+    }
+
+    @Transactional
+    public void batchAddGspUpkeepCheckList(List<Map> list) throws Exception {
+        List<GspUpkeepCheck> gspUpkeepCheckList = new ArrayList<>();
+        for (int i = 0; i < list.size(); i++) {
+            GspUpkeepCheck itemInfo = JsonUtils.parseJsonString(JsonUtils.toString(list.get(i)), new TypeReference<GspUpkeepCheck>() {
+            });
+            gspUpkeepCheckList.add(itemInfo);
+        }
+        gspUpkeepCheckService.batchAdd("1", gspUpkeepCheckList);
+    }
+
+}

+ 462 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/GspQualityReviewServiceImpl.java

@@ -0,0 +1,462 @@
+package com.prolog.cs.base.gsp.service.impl;
+
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.NumberUtil;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.util.StringUtil;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.dao.DxiGspQualityReviewDMapper;
+import com.prolog.cs.base.gsp.dao.DxiGspQualityReviewHMapper;
+import com.prolog.cs.base.gsp.enums.GspQualityReviewAuditStatus;
+import com.prolog.cs.base.gsp.enums.GspQualityReviewBillType;
+import com.prolog.cs.base.gsp.model.DxiGspQualityReviewD;
+import com.prolog.cs.base.gsp.model.DxiGspQualityReviewH;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheck;
+import com.prolog.cs.base.gsp.resource.InventoryClient;
+import com.prolog.cs.base.gsp.resource.ItemClient;
+import com.prolog.cs.base.gsp.resource.WarehouseClient;
+import com.prolog.cs.base.gsp.service.GspQualityReviewService;
+import com.prolog.cs.base.gsp.vo.GspQualityCheckMoveItemVo;
+import com.prolog.cs.base.gsp.vo.GspQualityCheckMoveVo;
+import com.prolog.cs.basic.item.model.BaseMtlItemHealth;
+import com.prolog.cs.basic.item.model.BaseMtlItemMst;
+import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseMst;
+import com.prolog.cs.data.exchange.client.ExchangeSender;
+import com.prolog.cs.data.exchange.client.core.EtlMessage;
+import com.prolog.cs.data.exchange.client.core.EtlTypeConstants;
+import com.prolog.framework.authority.core.dto.UserDTO;
+import com.prolog.framework.authority.user.UserTemplate;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.core.exception.BizException;
+import com.prolog.framework.core.pojo.Page;
+import com.prolog.framework.core.restriction.*;
+import com.prolog.framework.dao.util.PageUtils;
+import com.prolog.framework.toolkit.MapToolKit;
+import com.prolog.framework.utils.*;
+import com.prolog.upcloud.base.inventory.enums.StockStatusEnum;
+import com.prolog.upcloud.base.inventory.model.WmsInvStockLot;
+import com.prolog.upcloud.base.strategy.dto.stock.StockLocatorDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+
+@Slf4j
+@Service
+public class GspQualityReviewServiceImpl implements GspQualityReviewService {
+
+    @Autowired
+    private UserTemplate userTemplate;
+
+    @Autowired
+    private ItemClient itemClient;
+
+    @Autowired
+    private InventoryClient inventoryClient;
+
+    @Autowired
+    private WarehouseClient warehouseClient;
+
+    @Autowired
+    private DxiGspQualityReviewHMapper dxiGspQualityReviewHMapper;
+
+    @Autowired
+    private DxiGspQualityReviewDMapper dxiGspQualityReviewDMapper;
+
+    @Autowired
+    private ExchangeSender exchangeSender;
+
+
+    @Override
+    public Page<DxiGspQualityReviewH> listPage(String branchcode, String consignorcode, String requestBilltype, String billNo,String status, Integer pageSize, Integer pageNum) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<DxiGspQualityReviewH> list = dxiGspQualityReviewHMapper.findNoEnd(branchcode,consignorcode,requestBilltype,billNo,status);
+        return PageUtils.getPage(list);
+    }
+
+    @Override
+    public List<DxiGspQualityReviewD> findDetailByBillId(String billId) {
+        //String[] pendStatus = {GspQualityReviewAuditStatus.START.getStatus(),GspQualityReviewAuditStatus.REVIEW.getStatus()};
+        Criteria crtH = Criteria.forClass(DxiGspQualityReviewH.class);
+        Restriction rH =  Restrictions.eq("billid", billId);
+        crtH.setRestriction(rH);
+        List<DxiGspQualityReviewH> list = dxiGspQualityReviewHMapper.findByCriteria(crtH);
+        AssertUtils.isNotEmpty(list,"查询单据不存在");
+        DxiGspQualityReviewH dxiGspQualityReviewH = list.get(0);
+
+        String searchStatus = GspQualityReviewAuditStatus.START.getStatus();
+        if(GspQualityReviewAuditStatus.REVIEW.getStatus().equals(dxiGspQualityReviewH.getStatus())){
+            searchStatus = GspQualityReviewAuditStatus.REVIEW.getStatus();
+        }
+        Criteria crt = Criteria.forClass(DxiGspQualityReviewD.class);
+        Restriction r1 =  Restrictions.eq("billid", billId);
+        Restriction r2 =  Restrictions.in("endStatus",searchStatus);
+        crt.setOrder(Order.newInstance().asc("lastmodifydate"));
+        crt.setRestriction(Restrictions.and(r1,r2));
+        List<DxiGspQualityReviewD> byCriteria = dxiGspQualityReviewDMapper.findByCriteria(crt);
+
+
+
+
+        String consignorid = dxiGspQualityReviewH.getConsignorid();
+
+        Set<String> warhouseCode = Sets.newHashSet();
+        warhouseCode.add(dxiGspQualityReviewH.getBranchcode());
+        String warhouseId = null;
+        RestMessage<Map<String, BaseWmsWarehouseMst>> warehouseCodeMapRes = warehouseClient.getByWarehouseCode(warhouseCode);
+        if (!warehouseCodeMapRes.isSuccess() || CollectionUtil.isEmpty(warehouseCodeMapRes.getData())) {
+            throw new BizException("查询仓库信息失败");
+        }
+        Map<String, BaseWmsWarehouseMst> whData = warehouseCodeMapRes.getData();
+        for (String id : whData.keySet()) {
+            if(warhouseCode.iterator().next().equals(whData.get(id).getWarehouseCode())){
+                warhouseId = id;
+            }
+        }
+
+
+        Set<String> itemCodes = byCriteria.stream().map(DxiGspQualityReviewD::getItemcode).collect(Collectors.toSet());
+        //请求商品信息
+        RestMessage<List<BaseMtlItemMst>> itemResult = itemClient.getByItemCodes(consignorid,itemCodes);
+        if (!itemResult.isSuccess() || CollectionUtil.isEmpty(itemResult.getData())) {
+            throw new BizException("获取商品信息失败");
+        }
+
+
+        for (DxiGspQualityReviewD byCriterion : byCriteria) {
+            byCriterion.setRefBilltype("1".equals(dxiGspQualityReviewH.getRefBilltype())?"ERP对接":"2".equals(dxiGspQualityReviewH.getRefBilltype())?"SAP对接":"OMS录入");
+            byCriterion.setRequestBilltype(GspQualityReviewBillType.getByCode(dxiGspQualityReviewH.getRequestBilltype()));
+            byCriterion.setOperator(dxiGspQualityReviewH.getOperator());
+            byCriterion.setBillDate(dxiGspQualityReviewH.getBillDate());
+            byCriterion.setReviewReason(dxiGspQualityReviewH.getReviewReason());
+
+            //查询对应的库存信息
+            BaseMtlItemMst baseMtlItemMst = itemResult.getData().stream().filter(item ->byCriterion.getItemcode().equals(item.getItemCode())).findFirst().orElse(null);
+            if (baseMtlItemMst == null) {
+                throw new BizException("获取商品信息失败");
+            }
+            BaseMtlItemHealth baseMtlItemHealth = baseMtlItemMst.getBaseMtlItemHealth();
+            byCriterion.setItemHealthCategory(baseMtlItemHealth==null?"":baseMtlItemHealth.getItemHealthCategory());
+            byCriterion.setItemHealthListedLicensor(baseMtlItemHealth==null?"":baseMtlItemHealth.getItemHealthListedLicensor());
+            byCriterion.setItemHealthType(baseMtlItemHealth==null?"":baseMtlItemHealth.getItemHealthType());
+
+            RestMessage<List<StockLocatorDTO>> itemLocators = inventoryClient.getItemLocators(warhouseId, consignorid, baseMtlItemMst.getItemId(), null, null);
+            //RestMessage<List<StockLocatorDTO>> itemLocators = inventoryClient.getItemLocators("599581702716788736", "E23A4BUUPPW", "0021256304", null, null);
+            if (itemLocators.isSuccess() && !CollectionUtil.isEmpty(itemLocators.getData())) {
+                StockLocatorDTO stockLocatorDTO = itemLocators.getData().stream().filter(itemLocator -> itemLocator.getBatchNum().equals(byCriterion.getBatchNo())).findFirst().orElse(null);
+                if(stockLocatorDTO != null){
+                    BigDecimal availableQuantity = stockLocatorDTO.getAvailableQuantity();
+                    BigDecimal[] bigDecimals = availableQuantity.divideAndRemainder(new BigDecimal(byCriterion.getPackSize()));
+                    byCriterion.setCaseQuantity(bigDecimals[0]);
+                    byCriterion.setOddPieceQuantity(bigDecimals[1]);
+                    byCriterion.setStockQty(availableQuantity);
+                }
+            }
+            //byCriterion.setItemid(baseMtlItemMst.getItemId());
+
+            dxiGspQualityReviewDMapper.update(byCriterion);
+        }
+
+        Criteria crtUpdate = Criteria.forClass(DxiGspQualityReviewH.class);
+        Restriction updateEndStatus = Restrictions.eq("billid", list.get(0).getBillid());
+        crtUpdate.setRestriction(updateEndStatus);
+        dxiGspQualityReviewHMapper.updateMapByCriteria(MapUtils.put("warehouseId",warhouseId)
+                .put("lastmodifydate", new Date()).getMap(), crtUpdate);
+
+        return byCriteria;
+    }
+
+    @Override
+    public void batchAudit(List<DxiGspQualityReviewD> list) {
+
+        if(CollectionUtils.isEmpty(list)){
+            throw new BizException("操作失败");
+        }
+
+        UserDTO userDTO = userTemplate.getUserDTO();
+        if(userDTO == null){
+            throw new BizException("用户登录信息失效");
+        }
+        String username = userDTO.getUsername();
+        String qualityReviewHStaus = GspQualityReviewAuditStatus.WMS_AUDIT_YES.getStatus();
+
+
+        for (DxiGspQualityReviewD dxiGspQualityReviewD : list) {
+
+            if(!StringUtils.isBlank(dxiGspQualityReviewD.getAuditStausManager())){
+                dxiGspQualityReviewD.setAuditManager(username);
+                //质量经理审核
+                AssertUtils.isTrue(GspQualityReviewAuditStatus.REVIEW.getStatus().equals(dxiGspQualityReviewD.getAuditStausDirector()),"审核结论异常,质量主管意见不为待处理");
+                if(GspQualityReviewAuditStatus.WMS_AUDIT_NO.getStatus().equals(dxiGspQualityReviewD.getAuditStausManager()) && StringUtils.isBlank(dxiGspQualityReviewD.getReviewQty())){
+                    throw new BizException("不合格时必须填入数量");
+                }
+                dxiGspQualityReviewD.setAuditDateManager(new Date());
+
+                if(GspQualityReviewAuditStatus.WMS_AUDIT_NO.getStatus().equals(dxiGspQualityReviewD.getAuditStausManager())){
+                    dxiGspQualityReviewD.setEndStatus(GspQualityReviewAuditStatus.WMS_AUDIT_NO.getStatus());
+                    //不合格移库后回传结果到OMS
+                }
+
+                if(GspQualityReviewAuditStatus.WMS_AUDIT_YES.getStatus().equals(dxiGspQualityReviewD.getAuditStausManager())){
+                    dxiGspQualityReviewD.setEndStatus(GspQualityReviewAuditStatus.WMS_AUDIT_YES.getStatus());
+                    //合格直接回传结果到OMS
+                }
+
+            }else if(!StringUtils.isBlank(dxiGspQualityReviewD.getAuditStausDirector())){
+                //质量主管审核
+                dxiGspQualityReviewD.setAuditDirector(username);
+                AssertUtils.isNotTrue(dxiGspQualityReviewD.getAuditStausDirector() == GspQualityReviewAuditStatus.START.getStatus(),"审核状态异常");
+
+                AssertUtils.isNotTrue( (GspQualityReviewAuditStatus.WMS_AUDIT_NO.getStatus().equals(dxiGspQualityReviewD.getAuditStausDirector())
+                                || GspQualityReviewAuditStatus.REVIEW.getStatus().equals(dxiGspQualityReviewD.getAuditStausDirector()))
+                                && StringUtils.isBlank(dxiGspQualityReviewD.getReviewQty())
+                        ,"待处理或不合格时必须填入数量");
+
+                dxiGspQualityReviewD.setAuditDateDirector(new Date());
+
+                if(GspQualityReviewAuditStatus.REVIEW.getStatus().equals(dxiGspQualityReviewD.getAuditStausDirector())){
+                    //只有待审核时更新未40  其他都跟新未已审核20
+                    qualityReviewHStaus = GspQualityReviewAuditStatus.REVIEW.getStatus();
+                    dxiGspQualityReviewD.setEndStatus(GspQualityReviewAuditStatus.REVIEW.getStatus());
+                }
+
+                if(GspQualityReviewAuditStatus.WMS_AUDIT_NO.getStatus().equals(dxiGspQualityReviewD.getAuditStausDirector())){
+                    dxiGspQualityReviewD.setEndStatus(GspQualityReviewAuditStatus.WMS_AUDIT_NO.getStatus());
+                    //不合格移库后回传结果到OMS
+                }
+
+                if(GspQualityReviewAuditStatus.WMS_AUDIT_YES.getStatus().equals(dxiGspQualityReviewD.getAuditStausDirector())){
+                    dxiGspQualityReviewD.setEndStatus(GspQualityReviewAuditStatus.WMS_AUDIT_YES.getStatus());
+                    //合格直接回传结果到OMS
+                }
+            }else{
+                throw new BizException("审核状态为空");
+            }
+            //更新审核结果明细
+            dxiGspQualityReviewDMapper.update(dxiGspQualityReviewD);
+        }
+
+        Criteria crtUpdate = Criteria.forClass(DxiGspQualityReviewH.class);
+        Restriction updateEndStatus = Restrictions.eq("billid", list.get(0).getBillid());
+        crtUpdate.setRestriction(updateEndStatus);
+        dxiGspQualityReviewHMapper.updateMapByCriteria(MapUtils.put("status",qualityReviewHStaus)
+                .put("lastmodifydate", new Date()).put("lastmodifyby",userDTO.getUsername()).getMap(), crtUpdate);
+
+
+        //获取质量审核合格的发送OMS
+        List<DxiGspQualityReviewD> collect = list.stream().filter(refiewD -> GspQualityReviewAuditStatus.WMS_AUDIT_YES.getStatus().equals(refiewD.getEndStatus())).collect(Collectors.toList());
+
+        if(CollectionUtil.isNotEmpty(collect)){
+            for (DxiGspQualityReviewD dxiGspQualityReviewD : collect) {
+                toOMSMoved2(collect.get(0).getBillid(),dxiGspQualityReviewD.getLineid(),GspQualityReviewAuditStatus.WMS_AUDIT_YES.getStatus());
+            }
+        }
+    }
+
+    @Override
+    public List<GspQualityCheckMoveVo> findQualityReview4MovePick(String warehouseId,String cargoOwnerId,String requestBilltype, String billno) {
+        List<GspQualityCheckMoveVo> resultList = dxiGspQualityReviewDMapper.findQualityReview4MovePick(warehouseId,cargoOwnerId,requestBilltype,billno);
+        return resultList;
+    }
+
+
+
+    @Override
+    public List<GspQualityCheckMoveItemVo> findQualityReview4MoveItemPick(String billId) {
+
+        List<GspQualityCheckMoveItemVo> itemVos = dxiGspQualityReviewDMapper.findQualityReview4MoveItemPick(billId);
+        if(CollectionUtils.isEmpty(itemVos)){
+            return null;
+        }
+
+        Set<String> itemCodes = itemVos.stream().map(GspQualityCheckMoveItemVo::getItemCode).collect(Collectors.toSet());
+        //请求商品信息
+        RestMessage<List<BaseMtlItemMst>> itemResult = itemClient.getByItemCodes(itemVos.get(0).getCargoOwnerId(),itemCodes);
+        if (!itemResult.isSuccess() || CollectionUtil.isEmpty(itemResult.getData())) {
+            throw new BizException("获取商品信息失败");
+        }
+        for (GspQualityCheckMoveItemVo qcVo : itemVos) {
+            qcVo.setShowProductionDate(StringUtil.isNotEmpty(qcVo.getProductionDate())?qcVo.getProductionDate().replaceAll("-",""):"");
+            qcVo.setShowExpiredDate(StringUtil.isNotEmpty(qcVo.getExpiredDate())?qcVo.getExpiredDate().replaceAll("-",""):"");
+
+            qcVo.setRefBilltype("1".equals(qcVo.getRefBilltype())?"ERP对接":"2".equals(qcVo.getRefBilltype())?"SAP对接":"OMS录入");
+
+            BaseMtlItemMst baseMtlItemMst = itemResult.getData().stream().filter(item -> qcVo.getItemCode().equals(item.getItemCode())).findFirst().orElse(null);
+            if (baseMtlItemMst == null) {
+                throw new BizException("获取商品信息失败");
+            }
+            qcVo.setItemId(baseMtlItemMst.getItemId());
+
+            //查询对应的库存信息
+            RestMessage<List<StockLocatorDTO>> itemLocators = inventoryClient.getItemLocators(qcVo.getWarehouseId(), qcVo.getCargoOwnerId(), qcVo.getItemId(), null, null);
+            //RestMessage<List<StockLocatorDTO>> itemLocators = inventoryClient.getItemLocators("599581702716788736", "E23A4BUUPPW", "0021256304", null, null);
+            if (itemLocators.isSuccess() &&  CollectionUtil.isNotEmpty(itemLocators.getData())) {
+                StockLocatorDTO stockLocatorDTO = itemLocators.getData().stream().filter(itemLocator -> itemLocator.getBatchNum().equals(qcVo.getBatchNum())).findFirst().orElse(null);
+                if(stockLocatorDTO != null){
+                    BigDecimal availableQuantity = stockLocatorDTO.getAvailableQuantity();
+                    //BigDecimal[] bigDecimals = availableQuantity.divideAndRemainder(qcVo.getPackSize());
+                    //获取不合格移库数量
+                    if(StringUtils.isEmpty(qcVo.getExpiredDate()) || StringUtils.isEmpty(qcVo.getProductionDate())){
+                        qcVo.setProductionDate(DateUtils.format(stockLocatorDTO.getBatchProductionDate(),"yyyy-MM-dd hh:mm:ss"));
+                        qcVo.setExpiredDate(DateUtils.format(stockLocatorDTO.getBatchExpiredDate(),"yyyy-MM-dd hh:mm:ss"));
+                        qcVo.setShowProductionDate(stockLocatorDTO.getBatchProductionDateShow());
+                        qcVo.setShowExpiredDate(stockLocatorDTO.getBatchExpiredDateShow());
+
+                    }
+                    BigDecimal[] bigDecimals = qcVo.getReviewQty().divideAndRemainder(qcVo.getPackSize());
+                    qcVo.setCaseQuantity(bigDecimals[0]);
+                    qcVo.setOddPieceQuantity(bigDecimals[1]);
+                    qcVo.setBatchId(stockLocatorDTO.getBatchId());
+                    qcVo.setStockQty(availableQuantity);
+                    qcVo.setQuantity(qcVo.getReviewQty());
+                }else{
+                    throw new BizException("未获取到商品库存信息");
+                }
+            }
+
+            qcVo.setInStockStatus("2");
+            qcVo.setOutStockStatus("1");
+        }
+        return itemVos;
+    }
+
+    @Override
+    public void confirmQualityReviewMove(String[] arrList) {
+
+
+        Criteria crt = Criteria.forClass(DxiGspQualityReviewD.class);
+        Restriction restriction = Restrictions.in("lineid", arrList);
+        crt.setRestriction(restriction);
+        List<DxiGspQualityReviewD> byCriterias = dxiGspQualityReviewDMapper.findByCriteria(crt);
+        for (DxiGspQualityReviewD byCriteria : byCriterias) {
+            byCriteria.setReviewMovedQty(byCriteria.getReviewQty());
+            byCriteria.setLastmodifydate(new Date());
+            dxiGspQualityReviewDMapper.update(byCriteria);
+            toOMSMoved2(byCriteria.getBillid(),byCriteria.getLineid(),GspQualityReviewAuditStatus.WMS_AUDIT_NO.getStatus());
+        }
+    }
+
+
+    private void toOMSMoved2(String billid, String lineid , String status) {
+        if (!StringUtils.isBlank(lineid)) {
+            EtlMessage em = new EtlMessage();
+            em.setId(billid);
+            em.setEtlType(EtlTypeConstants.gsp_quality_review_w2o);
+            HashMap<String, String> omsMap = Maps.newHashMap();
+            omsMap.put("status",status);
+            omsMap.put("lineids",lineid);
+            omsMap.put("dtId",String.valueOf(SnowFlakeUtils.getId()));
+
+            em.setEtlData(omsMap);
+            try {
+                exchangeSender.send(em);
+            } catch (Exception e) {
+                //修改回传状态
+                Criteria crt = Criteria.forClass(DxiGspQualityReviewD.class);
+                crt.setRestriction(Restrictions.eq("lineid", lineid));
+                dxiGspQualityReviewDMapper.updateMapByCriteria(MapUtils.put("infStatus", "E").put("lastmodifydate", new Date()).getMap(), crt);
+                throw new BizException("同步OMS异常,请联系系统管理员");
+
+            }
+            //修改回传状态
+            Criteria crt = Criteria.forClass(DxiGspQualityReviewD.class);
+            crt.setRestriction(Restrictions.eq("lineid", lineid));
+            dxiGspQualityReviewDMapper.updateMapByCriteria(MapUtils.put("infStatus", "Y").put("lastmodifydate", new Date()).getMap(), crt);
+
+        }
+    }
+
+
+    private void toOMSMoved(String billid, String[] lineids , String status) {
+        if (lineids != null) {
+            EtlMessage em = new EtlMessage();
+            /*em.setId(billid);*/
+            em.setId("1");
+            em.setEtlType(EtlTypeConstants.gsp_quality_review_w2o);
+            HashMap<String, String> omsMap = Maps.newHashMap();
+           /* omsMap.put("status",status);
+            omsMap.put("lineids",String.join(",", lineids));*/
+            omsMap.put("status","20");
+            omsMap.put("lineids","1");
+            em.setEtlData(omsMap);
+            try {
+                exchangeSender.send(em);
+            } catch (Exception e) {
+                throw new BizException("同步OMS异常,请联系系统管理员");
+            }
+        }
+    }
+
+
+
+
+
+    //备份
+    public List<GspQualityCheckMoveItemVo> findQualityReview4MoveItemPickOri(String billId) {
+
+        List<GspQualityCheckMoveItemVo> itemVos = dxiGspQualityReviewDMapper.findQualityReview4MoveItemPick(billId);
+        if(itemVos==null){
+            return null;
+        }
+        //warhousehid
+        Set<String> codeIds = itemVos.stream().map(GspQualityCheckMoveItemVo::getWarehouseCode).collect(Collectors.toSet());
+        RestMessage<Map<String, BaseWmsWarehouseMst>> warehouseCodeMapRes = warehouseClient.getByWarehouseCode(codeIds);
+        if (!warehouseCodeMapRes.isSuccess() || CollectionUtil.isEmpty(warehouseCodeMapRes.getData())) {
+            throw new BizException("查询仓库信息失败");
+        }
+
+
+        Set<String> itemCodes = itemVos.stream().map(GspQualityCheckMoveItemVo::getItemCode).collect(Collectors.toSet());
+        //请求商品信息
+        RestMessage<List<BaseMtlItemMst>> itemResult = itemClient.getByItemCodes(itemVos.get(0).getCargoOwnerId(),itemCodes);
+        if (!itemResult.isSuccess() || CollectionUtil.isEmpty(itemResult.getData())) {
+            throw new BizException("获取商品信息失败");
+        }
+        for (GspQualityCheckMoveItemVo qcVo : itemVos) {
+            Map<String, BaseWmsWarehouseMst> whData = warehouseCodeMapRes.getData();
+            for (String id : whData.keySet()) {
+                if(qcVo.getWarehouseCode().equals(whData.get(id).getWarehouseCode())){
+                    qcVo.setWarehouseId(id);
+                }
+            }
+
+            BaseMtlItemMst baseMtlItemMst = itemResult.getData().stream().filter(item -> qcVo.getItemCode().equals(item.getItemCode())).findFirst().orElse(null);
+            if (baseMtlItemMst == null) {
+                throw new BizException("获取商品信息失败");
+            }
+            qcVo.setItemId(baseMtlItemMst.getItemId());
+            //查询对应的库存信息
+            RestMessage<List<StockLocatorDTO>> itemLocators = inventoryClient.getItemLocators(qcVo.getWarehouseId(), qcVo.getCargoOwnerId(), qcVo.getItemId(), null, null);
+            //RestMessage<List<StockLocatorDTO>> itemLocators = inventoryClient.getItemLocators("599581702716788736", "E23A4BUUPPW", "0021256304", null, null);
+            if (!itemLocators.isSuccess() || CollectionUtil.isEmpty(itemLocators.getData())) {
+                throw new BizException("获取商品库存信息失败");
+            }
+
+            StockLocatorDTO stockLocatorDTO = itemLocators.getData().stream().filter(itemLocator -> itemLocator.getBatchNum().equals(qcVo.getBatchNum())).findFirst().orElse(null);
+            if(stockLocatorDTO != null){
+                BigDecimal availableQuantity = stockLocatorDTO.getAvailableQuantity();
+                //BigDecimal[] bigDecimals = availableQuantity.divideAndRemainder(qcVo.getPackSize());
+                //获取不合格移库数量
+                BigDecimal[] bigDecimals = qcVo.getReviewQty().divideAndRemainder(qcVo.getPackSize());
+                qcVo.setCaseQuantity(bigDecimals[0]);
+                qcVo.setOddPieceQuantity(bigDecimals[1]);
+                qcVo.setBatchId(stockLocatorDTO.getBatchId());
+                qcVo.setStockQty(availableQuantity);
+            }
+
+            qcVo.setInStockStatus("2");
+            qcVo.setOutStockStatus("1");
+        }
+        return itemVos;
+    }
+
+
+}

+ 467 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/GspUnqualifiedDestroyServiceImpl.java

@@ -0,0 +1,467 @@
+package com.prolog.cs.base.gsp.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.collection.CollectionUtil;
+import com.github.pagehelper.PageHelper;
+import com.prolog.cs.base.gsp.dao.DxiGspDestroyRequestRecordMapper;
+import com.prolog.cs.base.gsp.dao.GspUnqualifiedDestroyDMapper;
+import com.prolog.cs.base.gsp.dao.GspUnqualifiedDestroyMapper;
+import com.prolog.cs.base.gsp.dao.GspUnqualifiedLossDMapper;
+import com.prolog.cs.base.gsp.enums.GspUnqualifiedStatus;
+import com.prolog.cs.base.gsp.model.DxiGspDestroyRequestRecord;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedDestroy;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedDestroyD;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedLossD;
+import com.prolog.cs.base.gsp.resource.ChainClient;
+import com.prolog.cs.base.gsp.resource.InventoryClient;
+import com.prolog.cs.base.gsp.resource.ItemClient;
+import com.prolog.cs.base.gsp.resource.WarehouseClient;
+import com.prolog.cs.base.gsp.service.GspUnqualifiedDestroyService;
+import com.prolog.cs.base.gsp.service.GspUnqualifiedLossService;
+import com.prolog.cs.base.gsp.vo.GspUnqualifiedDestroyDVO;
+import com.prolog.cs.base.gsp.vo.GspUnqualifiedLossDVO;
+import com.prolog.cs.basic.chain.model.cargo.BaseCargoOwnerMst;
+import com.prolog.cs.basic.item.model.BaseMtlItemHealth;
+import com.prolog.cs.basic.item.model.BaseMtlItemMst;
+import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseMst;
+import com.prolog.cs.basic.warehouse.model.vo.WarehouseLocatorBasicInfo;
+import com.prolog.framework.authority.core.dto.UserDTO;
+import com.prolog.framework.authority.user.UserTemplate;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.core.exception.BizException;
+import com.prolog.framework.core.exception.ParameterException;
+import com.prolog.framework.core.pojo.Page;
+import com.prolog.framework.core.restriction.Criteria;
+import com.prolog.framework.core.restriction.Order;
+import com.prolog.framework.core.restriction.Restriction;
+import com.prolog.framework.core.restriction.Restrictions;
+import com.prolog.framework.dao.util.PageUtils;
+import com.prolog.framework.utils.*;
+import com.prolog.upcloud.base.inventory.vo.BatchNumberListVO;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class GspUnqualifiedDestroyServiceImpl implements GspUnqualifiedDestroyService {
+
+	@Autowired
+	private GspUnqualifiedDestroyMapper mapper;
+
+	@Autowired
+	private GspUnqualifiedDestroyDMapper dMapper;
+
+    @Autowired
+    private GspUnqualifiedLossDMapper gspUnqualifiedLossDMapper;
+    
+	@Autowired
+	private UserTemplate userTemplate;
+
+	@Autowired
+	private ItemClient itemClient;
+
+	@Autowired
+	private WarehouseClient warehouseClient;
+
+	@Autowired
+	private ChainClient chainClient;
+	
+	@Autowired
+	private DxiGspDestroyRequestRecordMapper dxiGspDestroyRequestRecordMapper;
+	
+	@Autowired
+	private GspUnqualifiedLossService gspUnqualifiedLossService;
+
+	// 添加库存服务 feignClient - by Huanglh 2022-03-01
+	@Autowired
+	private InventoryClient inventoryClient;
+	
+	@Override
+	public Page<GspUnqualifiedDestroyDVO> listPagePick(String warehouseId, String cargoOwnerId, String lossCode, String itemId, Integer pageSize, Integer pageNum) {
+		UserDTO userDTO = userTemplate.getUserDTO();
+		String enterpriseId = userDTO.getEnterpriseId();
+		PageHelper.startPage(pageNum, pageSize);
+
+		GspUnqualifiedLossD gspUnqualifiedLossD=new GspUnqualifiedLossD();
+		gspUnqualifiedLossD.setCargoOwnerId(cargoOwnerId);
+		gspUnqualifiedLossD.setItemId(itemId);
+		gspUnqualifiedLossD.setLossCode(lossCode);
+		gspUnqualifiedLossD.setEnterpriseId(enterpriseId);
+		gspUnqualifiedLossD.setWarehouseId(warehouseId);
+		List<GspUnqualifiedLossD> list = gspUnqualifiedLossDMapper.listPagePick(gspUnqualifiedLossD);
+		if (CollUtil.isEmpty(list)){
+			return new Page<>();
+		}
+		//转换并组装
+		List<GspUnqualifiedDestroyDVO> listRet=new ArrayList<>();
+		for(GspUnqualifiedLossDVO lossD : gspUnqualifiedLossService.spellGspUnqualifiedLossDVOS(list)){
+			GspUnqualifiedDestroyDVO gspUnqualifiedDestroyDVO=new GspUnqualifiedDestroyDVO();
+			BeanUtils.copyProperties(lossD, gspUnqualifiedDestroyDVO);
+            gspUnqualifiedDestroyDVO.setRefBillId(lossD.getLossId());
+			gspUnqualifiedDestroyDVO.setRefBillCode(lossD.getCode());
+            gspUnqualifiedDestroyDVO.setRefLineId(lossD.getId());
+            String destroyQty = (new BigDecimal(lossD.getLossQty())).subtract(new BigDecimal(lossD.getDestroyingQty())).toString();
+			gspUnqualifiedDestroyDVO.setDestroyQty(destroyQty);
+			listRet.add(gspUnqualifiedDestroyDVO);
+		}
+		return PageUtils.getPage(listRet);
+	}
+
+	@Override
+	@Transactional
+	public void add(GspUnqualifiedDestroy dto) {
+		String warehouseId = dto.getWarehouseId();
+		if (StringUtils.isEmpty(warehouseId))
+			throw new ParameterException("仓库不能为空");
+		if (dto.getGspUnqualifiedDestroyDList()==null || dto.getGspUnqualifiedDestroyDList().size()==0)
+			throw new ParameterException("请选择商品");
+		// 必填字段校验
+		if (StringUtils.isEmpty(dto.getDestroyReason())) {
+			throw new ParameterException("销毁原因不能为空!");
+		}
+		if (StringUtils.isEmpty(dto.getTransportor())) {
+			throw new ParameterException("运输人员不能为空!");
+		}
+		if (StringUtils.isEmpty(dto.getDestroySite())) {
+			throw new ParameterException("销毁地点不能为空!");
+		}
+		if (StringUtils.isEmpty(dto.getDestroyMode())) {
+			throw new ParameterException("销毁方式不能为空!");
+		}
+
+		//请求仓库信息
+		BaseWmsWarehouseMst wmsWarehouseMst=null;
+		RestMessage<BaseWmsWarehouseMst> itemResultWarehouse = warehouseClient.warehouse(warehouseId);
+		if (itemResultWarehouse.isSuccess() && itemResultWarehouse.getData() != null) {
+			wmsWarehouseMst=itemResultWarehouse.getData();
+		}
+		if(wmsWarehouseMst==null){
+			throw new ParameterException("仓库不能为空");
+		}
+		UserDTO userDTO = userTemplate.getUserDTO();
+		String userId = userDTO.getId();
+		String userName = userDTO.getNickname();
+		String enterpriseId = userDTO.getEnterpriseId();
+		Date date = new Date();
+		String id = String.valueOf(SnowFlakeUtils.getId());
+		dto.setId(id);
+		String code = "XHD"+id.substring(id.length() - 8);
+		dto.setCode(code);
+		dto.setCreator(userId);
+		dto.setCreatorName(userName);
+		dto.setGmtCreate(date);
+		dto.setModifier(userId);
+		dto.setModifierName(userName);
+		dto.setGmtModified(date);
+		dto.setEnterpriseId(enterpriseId);
+		// 销毁没有ERP审批,状态需要直接设置为 ERP_AUDIT_YES
+		dto.setStatus(GspUnqualifiedStatus.OUT_AUDIT_YES.getStatus());
+		dto.setDcId(wmsWarehouseMst.getDcId());
+		mapper.save(dto);
+		// 不合格品信息
+		List<GspUnqualifiedDestroyD> dList = dto.getGspUnqualifiedDestroyDList();
+		
+		for (int i = 0; i < dList.size(); i++) {
+			GspUnqualifiedDestroyD dModel=dList.get(i);
+			String lossQty = dModel.getLossQty();
+			String destroyQty = dModel.getDestroyQty();
+			if((StringUtils.isBlank(lossQty) || StringUtils.isBlank(destroyQty)) ||
+					(new BigDecimal(lossQty)).compareTo(new BigDecimal(destroyQty))<0){
+				throw new BizException("销毁数量不能大于报损数量:第"+(i+1)+"行");
+			}
+			String sonId = String.valueOf(SnowFlakeUtils.getId());
+			dModel.setId(sonId);
+			dModel.setDestroyId(id);
+			dModel.setDestroyCode(code);
+			dModel.setRefBillId(dModel.getRefBillId());
+			dModel.setRefLineId(dModel.getRefLineId());
+			dModel.setDcId(wmsWarehouseMst.getDcId());
+			dModel.setWarehouseId(warehouseId);
+			dModel.setEnterpriseId(enterpriseId);
+			dModel.setCode(String.valueOf(SnowFlakeUtils.getId()));
+			if(StringUtils.isBlank(destroyQty)){
+                dModel.setDestroyQty(dModel.getUnqualifiedQty());
+            }
+			dModel.setCreator(userId);
+			dModel.setCreatorName(userName);
+			dModel.setGmtCreate(date);
+			dModel.setModifier(userId);
+			dModel.setModifierName(userName);
+			dModel.setGmtModified(date);
+			dMapper.save(dModel);
+			gspUnqualifiedLossDMapper.updateDestroyingQty(dModel.getRefLineId(), new BigDecimal(destroyQty));
+		}
+	}
+
+	@Override
+	@Transactional
+	public void delIds(List<String> pkIdList) {
+		// TODO
+		pkIdList.stream().forEach(p ->
+			this.mapper.deleteById(p,GspUnqualifiedDestroy.class));
+	}
+
+	@Override
+	public List<GspUnqualifiedDestroyDVO> findDetailByMstId(String mstId){
+		if(StringUtils.isBlank(mstId)){
+			return new ArrayList<>();
+		}
+		Criteria crt = Criteria.forClass(GspUnqualifiedDestroyD.class);
+		Restriction r1 = Restrictions.eq("destroyId",mstId);
+		crt.setOrder(Order.newInstance().asc("gmtCreate"));
+		crt.setRestriction(Restrictions.and(r1));
+		List<GspUnqualifiedDestroyD> list = dMapper.findByCriteria(crt);
+		return spellGspUnqualifiedDestroyDVOS(list);
+	}
+
+	//转换并组装
+	private List<GspUnqualifiedDestroyDVO> spellGspUnqualifiedDestroyDVOS(List<GspUnqualifiedDestroyD> list) {
+		List<GspUnqualifiedDestroyDVO> listRet=new ArrayList<>();
+		String[] itemIds = list.stream().map(GspUnqualifiedDestroyD::getItemId).distinct().toArray(String[]::new);
+		//请求商品信息
+		RestMessage<List<BaseMtlItemMst>> itemResult = itemClient.getListByIds(itemIds);
+		// 获取批次数组,查询库存服务批次信息 - by Huanglh 2022-03-01
+		String[] batchIds = list.stream().map(GspUnqualifiedDestroyD::getBatchId).distinct().toArray(String[]::new);
+		RestMessage<List<BatchNumberListVO>> batchNumberResult = inventoryClient.getBatchNumberBasicInfo(batchIds);
+		Map<String, BatchNumberListVO> batchNumberMap = new HashMap<>();
+		if (batchNumberResult.isSuccess() && CollectionUtil.isNotEmpty(batchNumberResult.getData())) {
+			batchNumberMap = batchNumberResult.getData().stream().collect(
+			Collectors.toMap(BatchNumberListVO::getBatchId, entity -> entity));
+		}
+
+		//查询货位信息,得到库别 库区
+		String[] locatorIdList = list.stream().map(GspUnqualifiedDestroyD::getLocatorId).toArray(String[]::new);
+		RestMessage<List<WarehouseLocatorBasicInfo>> locationBasicInfos = warehouseClient.getLocationBasicInfos(locatorIdList);
+		if (!locationBasicInfos.isSuccess() || locationBasicInfos.getData() == null) {
+			throw new BizException("查询货位关联信息失败!请重试或联系管理员!");
+		}
+		List<WarehouseLocatorBasicInfo>  warehouselocators = locationBasicInfos.getData();
+
+		for(GspUnqualifiedDestroyD gspUnqualifiedDestroyD:list){
+			GspUnqualifiedDestroyDVO gspUnqualifiedDestroyDVO=new GspUnqualifiedDestroyDVO();
+			BeanUtils.copyProperties(gspUnqualifiedDestroyD, gspUnqualifiedDestroyDVO);
+			if (itemResult.isSuccess() && itemResult.getData() != null) {
+				BaseMtlItemMst itemBaseInfoVO = itemResult.getData().stream().filter(item -> item.getItemId().
+						equals(gspUnqualifiedDestroyD.getItemId())).findFirst().orElse(null);
+				if (itemBaseInfoVO != null) {
+					BeanUtils.copyProperties(itemBaseInfoVO, gspUnqualifiedDestroyDVO);
+					gspUnqualifiedDestroyDVO.setCountryOriginName(itemBaseInfoVO.getCountryOriginId());
+					gspUnqualifiedDestroyDVO.setManufacturerName(itemBaseInfoVO.getManufacturerId());
+					gspUnqualifiedDestroyDVO.setCaseConversionRate(itemBaseInfoVO.getCaseConversionRate());
+					BaseMtlItemHealth baseMtlItemHealth = itemBaseInfoVO.getBaseMtlItemHealth();
+					if(baseMtlItemHealth!=null){
+						gspUnqualifiedDestroyDVO.setItemHealthSuperviseFlag(baseMtlItemHealth.getItemHealthSuperviseflag()==0?"否":"是");
+						gspUnqualifiedDestroyDVO.setItemHealthListedLicensor(baseMtlItemHealth.getItemHealthListedLicensor());
+						gspUnqualifiedDestroyDVO.setItemHealthCategory(baseMtlItemHealth.getItemHealthCategoryName());
+						gspUnqualifiedDestroyDVO.setItemHealthApprovalNbr(baseMtlItemHealth.getItemHealthApprovalNbr());
+						gspUnqualifiedDestroyDVO.setItemHealthRegisterNbr(baseMtlItemHealth.getItemHealthRegisterNbr());
+					}
+				}
+			}
+			// 将 生产日期,有效期 填入到 VO - by Huanglh 2022-03-01
+			if (batchNumberMap.containsKey(gspUnqualifiedDestroyD.getBatchId())) {
+				BatchNumberListVO batchNumberVO = batchNumberMap.get(gspUnqualifiedDestroyD.getBatchId());
+				gspUnqualifiedDestroyDVO.setBatchProductionDateShow(batchNumberVO.getBatchProductionDateShow());
+				gspUnqualifiedDestroyDVO.setBatchExpiredDateShow(batchNumberVO.getBatchExpiredDateShow());
+			}
+
+			//库区库别
+			for (WarehouseLocatorBasicInfo warehouselocator :warehouselocators) {
+				if(warehouselocator.getWarehouseLocatorId().equals(gspUnqualifiedDestroyDVO.getLocatorId())){
+					gspUnqualifiedDestroyDVO.setWarehouseAreaName(warehouselocator.getWarehouseAreaName());
+					gspUnqualifiedDestroyDVO.setWarehouseAreaCategoryName(warehouselocator.getWarehouseAreaCategoryName());
+				}
+			}
+
+			listRet.add(gspUnqualifiedDestroyDVO);
+		}
+		return listRet;
+	}
+
+	@Override
+	public Page<GspUnqualifiedDestroy> listPage(String warehouseId, String cargoOwnerId, String status, Integer pageSize, Integer pageNum) {
+		UserDTO userDTO = userTemplate.getUserDTO();
+		String enterpriseId = userDTO.getEnterpriseId();
+		PageHelper.startPage(pageNum, pageSize);
+
+		Criteria crt = Criteria.forClass(GspUnqualifiedDestroy.class);
+		Restriction r1 = Restrictions.eq("enterpriseId",enterpriseId);
+		Restriction r2 = Restrictions.eq("warehouseId",warehouseId);
+		Restriction r3 = Restrictions.eq("status",status);
+		Restriction r4 = StringUtils.isEmpty(cargoOwnerId)?null:Restrictions.eq("cargoOwnerId", cargoOwnerId);
+		crt.setOrder(Order.newInstance().desc("gmtCreate"));
+		crt.setRestriction(Restrictions.and(r1,r2,r3,r4));
+		List<GspUnqualifiedDestroy> list = mapper.findByCriteria(crt);
+		if(list==null || list.size()==0){
+			return PageUtils.getPage(list);
+		}
+		//请求仓库信息
+		String warehouseName=null;
+		RestMessage<BaseWmsWarehouseMst> itemResultWarehouse = warehouseClient.warehouse(warehouseId);
+		if (itemResultWarehouse.isSuccess() && itemResultWarehouse.getData() != null) {
+			warehouseName=itemResultWarehouse.getData().getWarehouseName();
+		}
+		//组合id
+		String[] locatorIds = list.stream().map(GspUnqualifiedDestroy::getCargoOwnerId).distinct().toArray(String[]::new);
+		//请求货位信息
+		RestMessage<Map<String, BaseCargoOwnerMst>> locatorResult = chainClient.getCargoOwnerMstByIds(locatorIds);
+		if(locatorResult==null || locatorResult.getData()==null){
+			throw new BizException("货主数据异常");
+		}
+		for(GspUnqualifiedDestroy gspUnqualifiedLoss:list){
+			gspUnqualifiedLoss.setWarehouseName(warehouseName);
+			if (locatorResult.getData().get(gspUnqualifiedLoss.getCargoOwnerId())!=null) {
+				gspUnqualifiedLoss.setCargoOwnerName(locatorResult.getData().get(gspUnqualifiedLoss.getCargoOwnerId()).getCargoOwnerName());
+			}
+		}
+		return PageUtils.getPage(list);
+	}
+	
+	@Override
+	public void batchUpdate(List<GspUnqualifiedDestroy> list, String status) throws Exception {
+		UserDTO userDTO = userTemplate.getUserDTO();
+		String userId = userDTO.getId();
+		String userName = userDTO.getNickname();
+		Date auditDate = new Date();
+		for (GspUnqualifiedDestroy gspUnqualifiedDestroyDTO : list) {
+			gspUnqualifiedDestroyDTO.setModifier(userId);
+			gspUnqualifiedDestroyDTO.setModifierName(userName);
+			gspUnqualifiedDestroyDTO.setGmtModified(auditDate);
+			if(!StringUtils.isEmpty(status)){
+				gspUnqualifiedDestroyDTO.setStatus(status);
+				if("20".equals(status) || "30".equals(status)){
+					gspUnqualifiedDestroyDTO.setAuditDate(auditDate);
+				}
+			}
+			oneAudit(gspUnqualifiedDestroyDTO,status,auditDate);
+		}
+	}
+
+	@Override
+	@Transactional
+	public void oneAudit(GspUnqualifiedDestroy gspUnqualifiedDestroyDTO, String status, Date auditDate) throws Exception {
+		this.mapper.updateWithValidate(gspUnqualifiedDestroyDTO, p -> ObjectUtils.isNotNull(p) && ObjectUtils.isNotNull(p.getValue()));
+		Criteria crt = Criteria.forClass(GspUnqualifiedDestroyD.class);
+		crt.setRestriction(Restrictions.eq("destroyId", gspUnqualifiedDestroyDTO.getId()));
+		dMapper.updateMapByCriteria(MapUtils.put("status", status).put("gmtModified", auditDate).getMap(), crt);
+		Criteria crtD = Criteria.forClass(GspUnqualifiedDestroyD.class);
+		Restriction r1 = Restrictions.eq("destroyId",gspUnqualifiedDestroyDTO.getId());
+		crtD.setRestriction(Restrictions.and(r1));
+		List<GspUnqualifiedDestroyD> dList = dMapper.findByCriteria(crtD);
+		if("30".equals(status)){
+			for (int i = 0; i < dList.size(); i++) {
+				GspUnqualifiedDestroyD gspUnqualifiedDestroyD = dList.get(i);
+				if(!StringUtils.isBlank(gspUnqualifiedDestroyD.getDestroyQty())){
+					BigDecimal destroyQty =new BigDecimal(gspUnqualifiedDestroyD.getDestroyQty());
+					gspUnqualifiedLossDMapper.updateDestroyedQty(gspUnqualifiedDestroyD.getRefLineId(), destroyQty);
+				}
+			}
+		}else if("40".equals(status)){
+			gspUnqualifiedDestroyDTO.setGspUnqualifiedDestroyDList(dList);
+			saveDxi(gspUnqualifiedDestroyDTO);
+		}
+	}
+
+	@Override
+	public GspUnqualifiedDestroy getById(String mstId) {
+		if (StringUtils.isEmpty(mstId))
+			throw new ParameterException("id不能为空");
+		return mapper.findById(mstId, GspUnqualifiedDestroy.class);
+	}
+
+    private void saveDxi(GspUnqualifiedDestroy model){
+		BaseWmsWarehouseMst wmsWarehouseMst=null;
+		List<GspUnqualifiedDestroyDVO> voList = spellGspUnqualifiedDestroyDVOS(model.getGspUnqualifiedDestroyDList());
+		for (int i = 0; i < voList.size(); i++) {
+			GspUnqualifiedDestroyDVO dModel=voList.get(i);
+			if(i==0){
+				RestMessage<BaseWmsWarehouseMst> itemResultWarehouse = warehouseClient.warehouse(dModel.getWarehouseId());
+				if (itemResultWarehouse.isSuccess() && itemResultWarehouse.getData() != null) {
+					wmsWarehouseMst=itemResultWarehouse.getData();
+				}
+			}
+			DxiGspDestroyRequestRecord owsModel=new DxiGspDestroyRequestRecord();
+			owsModel.setLineid(dModel.getId());//对接单据行号
+			owsModel.setSeqno(Integer.toString(i+1));//对接单据行号
+			owsModel.setBillid(model.getId());//单据ID
+			owsModel.setBillno(model.getCode());//销毁单号
+			owsModel.setBranchid(model.getWarehouseId());//申请仓库ID
+			if(wmsWarehouseMst!=null){
+				owsModel.setBranchcode(wmsWarehouseMst.getWarehouseCode());//申请仓库编码
+			}
+			owsModel.setBranchname(model.getWarehouseName());//申请仓库名称
+			owsModel.setConsignorid(model.getCargoOwnerId());//货主ID
+			//owsModel.setConsignorcode();//货主编码
+			owsModel.setConsignorname(model.getCargoOwnerName());//货主名称
+			owsModel.setRefBilltype("N/A");//单据来源类型 todo
+			owsModel.setDefectsItemType("N/A");//销毁商品类别 todo
+			owsModel.setItemid(dModel.getItemId());//商品ID
+			owsModel.setItemcode(dModel.getItemCode());//商品编码
+			owsModel.setItemname(dModel.getItemName());//商品名称
+//            owsModel.setItemSpecs();//商品规格
+//            owsModel.setManufacturer();//生产厂家
+//            owsModel.setParerntItemid();//父商品ID
+//            owsModel.setCategoryId();//商品类别ID--商品大类表ID
+//            owsModel.setTypeCode();//商品大类编码
+//            owsModel.setTypeName();//商品大类名称
+			owsModel.setLotNo(dModel.getLotNum());//批号
+			owsModel.setBatchNo(dModel.getBatchId());//批次号
+//            owsModel.setPdateFrom();//生产日期
+//            owsModel.setValidUntil();//有效期至
+//            owsModel.setPaperNo();//备案凭证号
+//            owsModel.setApprovalNumber();//批准文号
+//            owsModel.setProductionPlace();//产地
+//            owsModel.setBarcode();//商品条码
+//            owsModel.setPackSize();//包装数量
+//            owsModel.setPackUnits();//包装单位
+			owsModel.setDefectsReason(dModel.getUnqualifiedReason());//不合格原因
+			owsModel.setDestroyQty(dModel.getDestroyQty());//销毁数量
+			//owsModel.setDestroyReason(dModel.getd);//销毁原因
+			owsModel.setDestroySite(model.getDestroySite());//销毁地点
+			owsModel.setDestroyMode(model.getDestroyMode());//销毁方式
+			owsModel.setTransportFacility(model.getTransportTool());//运输工具
+			owsModel.setTransportPerson(model.getTransportor());//运输人员
+			owsModel.setDestroySiteCond(model.getDestroySituation());//销毁后现场情况
+			owsModel.setDestroyExecutor(model.getDestroyExecutor());//销毁执行人
+			owsModel.setDestroySupervisor(model.getDestroySupervisor());//销毁监督人
+			owsModel.setDapartmentStaff(model.getNmpaOfficer());//监管部门人员
+			owsModel.setBillDate(model.getGmtCreate());//发起申请日期
+			owsModel.setStatus("已销毁");//状态
+			owsModel.setRemark(model.getRemark());//备注
+			owsModel.setClosedReason(model.getNmpaOfficer());//作废原因
+			//		owsModel.setAttrStr1();//字符扩展属性1
+			//		owsModel.setAttrStr2();//字符扩展属性2
+			//		owsModel.setAttrStr3();//字符扩展属性3
+			//		owsModel.setAttrStr4();//字符扩展属性4
+			//		owsModel.setAttrStr5();//字符扩展属性5
+			//		owsModel.setAttrStr6();//字符扩展属性6
+			//		owsModel.setAttrStr7();//字符扩展属性7
+			//		owsModel.setAttrStr8();//字符扩展属性8
+			//		owsModel.setAttrStr9();//字符扩展属性9
+			//		owsModel.setAttrStr10();//字符扩展属性10
+			//		owsModel.setAttrSum1();//数字扩展属性1
+			//		owsModel.setAttrNum2();//数字扩展属性2
+			//		owsModel.setAttrNum3();//数字扩展属性3
+			//		owsModel.setAttrNum4();//数字扩展属性4
+			//		owsModel.setAttrNum5();//数字扩展属性5
+			//		owsModel.setAttrDte1();//日期属性扩展1
+			//		owsModel.setAttrDte2();//日期属性扩展2
+			//		owsModel.setAttrDte3();//日期属性扩展3
+			//		owsModel.setAttrDte4();//日期属性扩展4
+			//		owsModel.setAttrDte5();//日期属性扩展5
+			owsModel.setCreateby(model.getCreatorName());//录入员
+			owsModel.setCreatedate(model.getGmtCreate());//录入时间
+			owsModel.setLastmodifyby(model.getModifierName());//修改人
+			owsModel.setLastmodifydate(model.getGmtModified());//修改时间
+			owsModel.setEnterpriseid(model.getEnterpriseId());//企业ID
+			owsModel.setEnterprisename(userTemplate.getUserDTO().getEnterpriseName());//企业名称
+//			owsModel.setBilldate(model.getGmtCreate());
+			dxiGspDestroyRequestRecordMapper.save(owsModel);
+		}
+    }
+}

+ 871 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/GspUnqualifiedLossServiceImpl.java

@@ -0,0 +1,871 @@
+package com.prolog.cs.base.gsp.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.codingapi.tx.annotation.TxTransaction;
+import com.github.pagehelper.PageHelper;
+import com.prolog.cs.base.gsp.dao.DxiGspGainslossesBillRecMapper;
+import com.prolog.cs.base.gsp.dao.GspUnqualifiedLossDMapper;
+import com.prolog.cs.base.gsp.dao.GspUnqualifiedLossMapper;
+import com.prolog.cs.base.gsp.dao.OmsInventoryOrderMapper;
+import com.prolog.cs.base.gsp.enums.GspUnqualifiedStatus;
+import com.prolog.cs.base.gsp.model.DxiGspGainslossesBillRec;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedLoss;
+import com.prolog.cs.base.gsp.model.GspUnqualifiedLossD;
+import com.prolog.cs.base.gsp.model.OmsInventoryOrder;
+import com.prolog.cs.base.gsp.resource.*;
+import com.prolog.cs.base.gsp.service.GspUnqualifiedLossService;
+import com.prolog.cs.base.gsp.vo.ErpUnqualifiedLossVo;
+import com.prolog.cs.base.gsp.vo.GspUnqualifiedLossDVO;
+import com.prolog.cs.basic.chain.model.cargo.BaseCargoOwnerMst;
+import com.prolog.cs.basic.item.model.BaseMtlItemHealth;
+import com.prolog.cs.basic.item.model.BaseMtlItemMst;
+import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseMst;
+import com.prolog.cs.basic.warehouse.model.vo.WarehouseLocatorBasicInfo;
+import com.prolog.framework.authority.core.dto.UserDTO;
+import com.prolog.framework.authority.user.UserTemplate;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.core.exception.BizException;
+import com.prolog.framework.core.exception.ParameterException;
+import com.prolog.framework.core.pojo.Page;
+import com.prolog.framework.core.restriction.Criteria;
+import com.prolog.framework.core.restriction.Order;
+import com.prolog.framework.core.restriction.Restriction;
+import com.prolog.framework.core.restriction.Restrictions;
+import com.prolog.framework.dao.util.PageUtils;
+import com.prolog.framework.utils.*;
+import com.prolog.upcloud.base.inventory.vo.*;
+import com.prolog.upcloud.base.strategy.model.BusinessControl;
+import com.prolog.upcloud.base.wh.operate.vo.OmsInventoryResultVO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.*;
+
+@Slf4j
+@Service
+public class GspUnqualifiedLossServiceImpl implements GspUnqualifiedLossService {
+
+    @Autowired
+    private GspUnqualifiedLossMapper mapper;
+
+    @Autowired
+    private GspUnqualifiedLossDMapper dMapper;
+
+    @Autowired
+    private UserTemplate userTemplate;
+
+    @Autowired
+    private ItemClient itemClient;
+
+    @Autowired
+    private WarehouseClient warehouseClient;
+
+    @Autowired
+    private ChainClient chainClient;
+
+    @Autowired
+    private StrategyClient strategyClient;
+
+    @Autowired
+    private DxiGspGainslossesBillRecMapper dxiGspGainslossesBillRecMapper;
+
+    @Autowired
+    private InventoryClient inventoryClient;
+
+    @Autowired
+    private OmsInventoryOrderMapper omsInventoryOrderMapper;
+
+    // 业务控制参数识别号-是否开启erp审批 0: 关闭(默认,可不配置) 1: 开启
+    @Value("${prolog.unqualifiedLoss.erpAuditRegCode:LOSS_ERP_AUDIT_ON}")
+    private String erpAuditRegCode;
+
+    @Value("${oms.omsInventoryResultUrl}")
+    private String omsInventoryResultUrl;
+
+
+    @Value("${erp.erpInventoryCallbackUrl}")
+    private String erpInventoryCallbackUrl;
+
+
+    @Override
+    @Transactional
+    public Boolean add(GspUnqualifiedLoss model) {
+        //		if (StringUtils.isEmpty(model.getCargoOwnerId()))
+        //			throw new ParameterException("货主不能为空");
+        if (StringUtils.isEmpty(model.getWarehouseId()))
+            throw new ParameterException("仓库不能为空");
+        if (model.getGspUnqualifiedLossDList() == null || model.getGspUnqualifiedLossDList().size() == 0)
+            throw new ParameterException("请选择商品");
+
+        //请求仓库信息
+        BaseWmsWarehouseMst wmsWarehouseMst = null;
+        RestMessage<BaseWmsWarehouseMst> itemResultWarehouse = warehouseClient.warehouse(model.getWarehouseId());
+        if (itemResultWarehouse.isSuccess() && itemResultWarehouse.getData() != null) {
+            wmsWarehouseMst = itemResultWarehouse.getData();
+        }
+        if (wmsWarehouseMst == null) {
+            throw new ParameterException("仓库不能为空");
+        }
+        UserDTO userDTO = userTemplate.getUserDTO();
+        String userId = userDTO.getId();
+        String userName = userDTO.getNickname();
+        String enterpriseId = userDTO.getEnterpriseId();
+        Date date = new Date();
+
+        // 获取是否开启erp审核的配置,并配置是否开启erp审核
+        // 默认不开启(直接设置erp已审核通过状态)
+        String status = GspUnqualifiedStatus.OUT_AUDIT_YES.getStatus();
+        Boolean needErpAudit = this.isNeedErpAudit(model.getWarehouseId(), model.getCargoOwnerId(), enterpriseId);
+        if (needErpAudit) {
+            status = GspUnqualifiedStatus.START.getStatus();
+        }
+
+        model.setCreator(userId);
+        String id = String.valueOf(SnowFlakeUtils.getId());
+        model.setId(id);
+        String code = "BSD" + id.substring(id.length() - 8);
+        model.setCode(code);
+        model.setCreatorName(userName);
+        model.setGmtCreate(date);
+        model.setModifier(userId);
+        model.setModifierName(userName);
+        model.setGmtModified(date);
+        model.setEnterpriseId(enterpriseId);
+        model.setStatus(status);
+        model.setDcId(wmsWarehouseMst.getDcId());
+        model.setEnterpriseId(enterpriseId);
+        model.setSource("WMS");
+        mapper.save(model);
+        // 不合格品信息
+        List<GspUnqualifiedLossD> dList = model.getGspUnqualifiedLossDList();
+        List<InvStockScarp> invStockList = new ArrayList<>();
+        for (int i = 0; i < dList.size(); i++) {
+            GspUnqualifiedLossD dModel = dList.get(i);
+            String unqualifiedQty = dModel.getUnqualifiedQty();
+            String lossQty = dModel.getLossQty();
+            if ((StringUtils.isBlank(unqualifiedQty) || StringUtils.isBlank(lossQty)) ||
+              (new BigDecimal(unqualifiedQty)).compareTo(new BigDecimal(lossQty)) < 0) {
+                throw new BizException("报损数量不能大于不合格数量:第" + (i + 1) + "行");
+            }
+            String sonId = String.valueOf(SnowFlakeUtils.getId());
+            dModel.setId(sonId);
+            dModel.setDcId(wmsWarehouseMst.getDcId());
+            dModel.setWarehouseId(model.getWarehouseId());
+            dModel.setEnterpriseId(enterpriseId);
+            dModel.setLossId(id);
+            dModel.setLossCode(code);
+            if (StringUtils.isBlank(dModel.getLotNum()) && !StringUtils.isBlank(dModel.getManufacturerLotNum())) {
+                dModel.setLotNum(dModel.getManufacturerLotNum());
+            }
+            dModel.setStatus(status);
+            dModel.setDestroyingQty("0");
+            dModel.setDestroyedQty("0");
+            dModel.setCreator(userId);
+            dModel.setCreatorName(userName);
+            dModel.setGmtCreate(date);
+            dModel.setModifier(userId);
+            dModel.setModifierName(userName);
+            dModel.setGmtModified(date);
+            dModel.setSeqNo(Integer.toString((i + 1)));//对接单据行号
+            dMapper.save(dModel);
+            // 预占库存操作移动到审批动作中
+            InvStockScarp invStockScarp=new InvStockScarp();
+            invStockScarp.setBillId(id);
+            invStockScarp.setLineBillId(sonId);
+            invStockScarp.setWarehouseId(model.getWarehouseId());
+            InvStockScrapDetail invStockScrapDetail=new InvStockScrapDetail();
+            invStockScrapDetail.setBatchId(dModel.getBatchId());
+            invStockScrapDetail.setLocatorId(dModel.getLocatorId());
+            invStockScrapDetail.setQuantity(new BigDecimal(dModel.getLossQty()));
+            invStockScarp.setDetails((new ArrayList<InvStockScrapDetail>(){{add(invStockScrapDetail);}}));
+            invStockList.add(invStockScarp);
+        }
+
+        // 不做erp审核则无需保存
+        if (needErpAudit) {
+            saveDxiOrder(model);
+        }
+        RestMessage upKeepDictResult = inventoryClient.scrapStock(invStockList);
+        log.info("调用库存接口scrapStock,入参为:"+ JSON.toJSONString(invStockList)+",返回为:"+JSON.toJSONString(upKeepDictResult));
+        if (upKeepDictResult==null || !upKeepDictResult.isSuccess()) {
+            throw new BizException("调用库存异常:"+ (upKeepDictResult == null?"返回结果为null":upKeepDictResult.getMessage()));
+        }
+        return needErpAudit;
+    }
+
+
+    @Override
+    @Transactional
+    public void delIds(List<String> pkIdList) {
+        pkIdList.stream().forEach(p ->
+          this.mapper.deleteById(p, GspUnqualifiedLoss.class));
+    }
+
+    @Override
+    public Page<GspUnqualifiedLoss> listPage(String warehouseId, String cargoOwnerId, String status, Integer pageSize, Integer pageNum) {
+        UserDTO userDTO = userTemplate.getUserDTO();
+        String enterpriseId = userDTO.getEnterpriseId();
+
+        // 获取是否开启erp审核的配置,并配置是否开启erp审核
+        if (this.isNeedErpAudit(warehouseId, cargoOwnerId, enterpriseId)) {
+            // 需要放在 PageHelper 之前,防止被影响
+            // 需要erp审核时,刷新erp的审核状态
+            this.updateLossStatus(warehouseId, cargoOwnerId, enterpriseId);
+        }
+
+        PageHelper.startPage(pageNum, pageSize);
+        Criteria crt = Criteria.forClass(GspUnqualifiedLoss.class);
+        Restriction r1 = Restrictions.eq("enterpriseId", enterpriseId);
+        Restriction r2 = Restrictions.eq("warehouseId", warehouseId);
+        Restriction r3 = Restrictions.eq("status", status);
+        Restriction r4 = StringUtils.isEmpty(cargoOwnerId) ? null : Restrictions.eq("cargoOwnerId", cargoOwnerId);
+        crt.setOrder(Order.newInstance().desc("gmtCreate"));
+        crt.setRestriction(Restrictions.and(r1, r2, r3, r4));
+        List<GspUnqualifiedLoss> list = mapper.findByCriteria(crt);
+        //请求仓库信息
+        String warehouseName = null;
+        RestMessage<BaseWmsWarehouseMst> itemResultWarehouse = warehouseClient.warehouse(warehouseId);
+        if (itemResultWarehouse.isSuccess() && itemResultWarehouse.getData() != null) {
+            warehouseName = itemResultWarehouse.getData().getWarehouseName();
+        }
+        //组合id
+        String[] locatorIds = list.stream().map(GspUnqualifiedLoss::getCargoOwnerId).distinct().toArray(String[]::new);
+        //请求货位信息
+        RestMessage<Map<String, BaseCargoOwnerMst>> locatorResult = chainClient.getCargoOwnerMstByIds(locatorIds);
+        if (locatorResult == null || locatorResult.getData() == null) {
+            throw new BizException("货主数据异常");
+        }
+        for (GspUnqualifiedLoss gspUnqualifiedLoss : list) {
+            gspUnqualifiedLoss.setWarehouseName(warehouseName);
+            if (locatorResult.getData().get(gspUnqualifiedLoss.getCargoOwnerId()) != null) {
+                gspUnqualifiedLoss.setCargoOwnerName(locatorResult.getData().get(gspUnqualifiedLoss.getCargoOwnerId()).getCargoOwnerName());
+            }
+        }
+        return PageUtils.getPage(list);
+    }
+
+    /**
+     * 找出所有还是初始状态的汇总表数据,更新其ERP的审批状态
+     *
+     * @param warehouseId
+     * @param cargoOwnerId
+     * @param enterpriseId
+     */
+    private void updateLossStatus(String warehouseId, String cargoOwnerId, String enterpriseId) {
+        // 找出所有还是初始状态的汇总表数据
+        Criteria crt = Criteria.forClass(GspUnqualifiedLoss.class);
+        Restriction r1 = Restrictions.eq("enterpriseId", enterpriseId);
+        Restriction r2 = Restrictions.eq("warehouseId", warehouseId);
+        Restriction r3 = Restrictions.eq("status", GspUnqualifiedStatus.START.getStatus());
+        Restriction r4 = StringUtils.isEmpty(cargoOwnerId) ? null : Restrictions.eq("cargoOwnerId", cargoOwnerId);
+        crt.setRestriction(Restrictions.and(r1, r2, r3, r4));
+        List<GspUnqualifiedLoss> list = mapper.findByCriteria(crt);
+        String[] lossIds = list.stream().map(GspUnqualifiedLoss::getId).distinct().toArray(String[]::new);
+
+        if (ObjectUtils.isNotNull(lossIds)) {
+            // 找出汇总数据对应的ERP审批通过的明细数据
+            Criteria crtD = Criteria.forClass(GspUnqualifiedLossD.class);
+            Restriction rD1 = Restrictions.in("lossId", lossIds);
+            //			Restriction rD2 = Restrictions.eq("status", GspUnqualifiedStatus.ERP_AUDIT_YES.getStatus());
+            crtD.setRestriction(Restrictions.and(rD1));
+            List<GspUnqualifiedLossD> listD = dMapper.findByCriteria(crtD);
+            // 分辨ERP还未审核、审核部分或全部通过、全部审核都不通过的汇总数据
+            List<String> lossIdsErpYes = new ArrayList<>();
+            List<String> lossIdsErpNo = new ArrayList<>();
+            for (String lossId : lossIds) {
+                String tag = "";
+                for (GspUnqualifiedLossD gspUnqualifiedLossD : listD) {
+                    if (lossId.equals(gspUnqualifiedLossD.getLossId())) {
+                        // 还未审核
+                        if (gspUnqualifiedLossD.getStatus().equals(GspUnqualifiedStatus.START.getStatus())) {
+                            tag = "";
+                            break;
+                        }
+                        // 有审核通过的数据
+                        if (gspUnqualifiedLossD.getStatus().equals(GspUnqualifiedStatus.OUT_AUDIT_YES.getStatus())) {
+                            tag = "yes";
+                        }
+                        // 有审核驳回的数据
+                        if (gspUnqualifiedLossD.getStatus().equals(GspUnqualifiedStatus.OUT_AUDIT_NO.getStatus())) {
+                            if (!tag.equals("yes")) {
+                                tag = "no";
+                            }
+                        }
+                    }
+                }
+                if (tag.equals("yes")) {
+                    lossIdsErpYes.add(lossId);
+                }
+                if (tag.equals("no")) {
+                    lossIdsErpNo.add(lossId);
+                }
+            }
+
+            if (!lossIdsErpYes.isEmpty() || !lossIdsErpNo.isEmpty()) {
+                // 分别更新汇总单的状态
+                Criteria crtUpdate = Criteria.forClass(GspUnqualifiedLoss.class);
+                Restriction rYes = Restrictions.in("id", lossIdsErpYes.toArray(new String[lossIdsErpYes.size()]));
+                Restriction rNo = Restrictions.in("id", lossIdsErpNo.toArray(new String[lossIdsErpNo.size()]));
+                if (!lossIdsErpYes.isEmpty()) {
+                    // 更新ERP审核部分或全部通过的数据
+                    crtUpdate.setRestriction(rYes);
+                    mapper.updateMapByCriteria(MapUtils.put("status", GspUnqualifiedStatus.OUT_AUDIT_YES.getStatus())
+                      .put("gmtModified", new Date()).getMap(), crtUpdate);
+                }
+                if (!lossIdsErpNo.isEmpty()) {
+                    // 更新ERP审核全部驳回的数据
+                    crtUpdate.setRestriction(rNo);
+                    mapper.updateMapByCriteria(MapUtils.put("status", GspUnqualifiedStatus.OUT_AUDIT_NO.getStatus())
+                      .put("gmtModified", new Date()).getMap(), crtUpdate);
+                }
+            }
+        }
+    }
+
+    @Override
+    public List<GspUnqualifiedLossDVO> findDetailByMstId(String mstId) {
+        Criteria crt = Criteria.forClass(GspUnqualifiedLossD.class);
+        Restriction r1 = Restrictions.eq("lossId", mstId);
+        // 不显示ERP审批驳回的内容
+        Restriction r2 = Restrictions.ne("status", GspUnqualifiedStatus.OUT_AUDIT_NO.getStatus());
+        crt.setOrder(Order.newInstance().asc("gmtCreate"));
+        crt.setRestriction(Restrictions.and(r1, r2));
+        List<GspUnqualifiedLossD> list = dMapper.findByCriteria(crt);
+        List<GspUnqualifiedLossDVO> listRet = spellGspUnqualifiedLossDVOS(list);
+        return listRet;
+    }
+
+    @Override
+    public List<GspUnqualifiedLossDVO> spellGspUnqualifiedLossDVOS(List<GspUnqualifiedLossD> list) {
+        String[] itemIds = list.stream().map(GspUnqualifiedLossD::getItemId).distinct().toArray(String[]::new);
+        //请求商品信息
+        RestMessage<List<BaseMtlItemMst>> itemResult = itemClient.getListByIds(itemIds);
+        //转换并组装
+        List<GspUnqualifiedLossDVO> listRet = new ArrayList<>();
+        //组合id
+        String[] ownerIds = list.stream().map(GspUnqualifiedLossD::getCargoOwnerId).distinct().toArray(String[]::new);
+        //请求货位信息
+        RestMessage<Map<String, BaseCargoOwnerMst>> restMessage = chainClient.getCargoOwnerMstByIds(ownerIds);
+        //查询货位信息,得到库别 库区
+        String[] locatorIdList = list.stream().map(GspUnqualifiedLossD::getLocatorId).toArray(String[]::new);
+        RestMessage<List<WarehouseLocatorBasicInfo>> locationBasicInfos = warehouseClient.getLocationBasicInfos(locatorIdList);
+        if (!locationBasicInfos.isSuccess() || locationBasicInfos.getData() == null) {
+            throw new BizException("查询货位关联信息失败!请重试或联系管理员!");
+        }
+        List<WarehouseLocatorBasicInfo>  warehouselocators = locationBasicInfos.getData();
+
+
+        String[] batchIds = list.stream().map(GspUnqualifiedLossD::getBatchId).distinct().toArray(String[]::new);
+        RestMessage<List<BatchNumberListVO>> upKeepDictResult = inventoryClient.getBatchNumberBasicInfo(batchIds);
+        for (GspUnqualifiedLossD gspUnqualifiedLossD : list) {
+            GspUnqualifiedLossDVO gspUnqualifiedLossDVO = new GspUnqualifiedLossDVO();
+            if (upKeepDictResult != null && upKeepDictResult.isSuccess() && upKeepDictResult.getData() != null) {
+                for (int j = 0; j < upKeepDictResult.getData().size(); j++) {
+                    BatchNumberListVO batchNumberListVO = upKeepDictResult.getData().get(j);
+                    if (batchNumberListVO.getBatchId().equals(gspUnqualifiedLossD.getBatchId())) {
+                        gspUnqualifiedLossDVO.setExpiredDate(batchNumberListVO.getBatchExpiredDate());
+                        gspUnqualifiedLossDVO.setProductionDate(batchNumberListVO.getBatchProductionDate());
+                        gspUnqualifiedLossDVO.setBatchExpiredDateShow(batchNumberListVO.getBatchExpiredDateShow());
+                        gspUnqualifiedLossDVO.setBatchProductionDateShow(batchNumberListVO.getBatchProductionDateShow());
+                        gspUnqualifiedLossDVO.setLotNum(batchNumberListVO.getManufacturerLotNum());
+                    }
+                }
+            }
+            if (restMessage != null && restMessage.getData() != null) {
+                BaseCargoOwnerMst baseCargoOwnerMst = restMessage.getData().get(gspUnqualifiedLossD.getCargoOwnerId());
+                if (baseCargoOwnerMst != null) {
+                    gspUnqualifiedLossDVO.setCargoOwnerCode(baseCargoOwnerMst.getCargoOwnerCode());
+                    gspUnqualifiedLossDVO.setCargoOwnerName(baseCargoOwnerMst.getCargoOwnerName());
+                }
+            }
+            if (itemResult.isSuccess() && itemResult.getData() != null) {
+                BaseMtlItemMst itemBaseInfoVO = itemResult.getData().stream().filter(item -> item.getItemId().equals(gspUnqualifiedLossD.getItemId())).findFirst().orElse(null);
+                if (itemBaseInfoVO != null) {
+                    BeanUtils.copyProperties(itemBaseInfoVO, gspUnqualifiedLossDVO);
+                    gspUnqualifiedLossDVO.setCountryOriginName(itemBaseInfoVO.getCountryOriginId());
+                    gspUnqualifiedLossDVO.setManufacturerName(itemBaseInfoVO.getManufacturerId());
+                    gspUnqualifiedLossDVO.setCaseConversionRate(itemBaseInfoVO.getCaseConversionRate());
+                    BaseMtlItemHealth baseMtlItemHealth = itemBaseInfoVO.getBaseMtlItemHealth();
+                    if (baseMtlItemHealth != null) {
+                        gspUnqualifiedLossDVO.setItemHealthSuperviseFlag(baseMtlItemHealth.getItemHealthSuperviseflag() == 0 ? "否" : "是");
+                        gspUnqualifiedLossDVO.setItemHealthListedLicensor(baseMtlItemHealth.getItemHealthListedLicensor());
+                        gspUnqualifiedLossDVO.setItemHealthCategory(baseMtlItemHealth.getItemHealthCategoryName());
+                        gspUnqualifiedLossDVO.setItemHealthApprovalNbr(baseMtlItemHealth.getItemHealthApprovalNbr());
+                        gspUnqualifiedLossDVO.setItemHealthRegisterNbr(baseMtlItemHealth.getItemHealthRegisterNbr());
+                    }
+                }
+            }
+
+            BeanUtils.copyProperties(gspUnqualifiedLossD, gspUnqualifiedLossDVO);
+            //库区库别
+            for (WarehouseLocatorBasicInfo warehouselocator :warehouselocators) {
+                if(warehouselocator.getWarehouseLocatorId().equals(gspUnqualifiedLossDVO.getLocatorId())){
+                    gspUnqualifiedLossDVO.setWarehouseAreaName(warehouselocator.getWarehouseAreaName());
+                    gspUnqualifiedLossDVO.setWarehouseAreaCategoryName(warehouselocator.getWarehouseAreaCategoryName());
+                }
+            }
+            listRet.add(gspUnqualifiedLossDVO);
+        }
+        return listRet;
+    }
+
+    @TxTransaction
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void batchAudit(List<GspUnqualifiedLoss> list, String status) throws Exception {
+        UserDTO userDTO = userTemplate.getUserDTO();
+        String userId = userDTO.getId();
+        String userName = userDTO.getNickname();
+        Date auditDate = new Date();
+        for (GspUnqualifiedLoss gspUnqualifiedLoss : list) {
+            gspUnqualifiedLoss.setModifier(userId);
+            gspUnqualifiedLoss.setModifierName(userName);
+            gspUnqualifiedLoss.setGmtModified(auditDate);
+            gspUnqualifiedLoss.setAuditDate(auditDate);
+            gspUnqualifiedLoss.setStatus(status);
+            oneAudit(gspUnqualifiedLoss, status, auditDate);
+        }
+    }
+
+    @Override
+    @Transactional
+    @TxTransaction
+    public void oneAudit(GspUnqualifiedLoss gspUnqualifiedLoss, String status, Date auditDate) throws Exception {
+        this.mapper.updateWithValidate(gspUnqualifiedLoss, p -> ObjectUtils.isNotNull(p) && ObjectUtils.isNotNull(p.getValue()));
+        Criteria crt = Criteria.forClass(GspUnqualifiedLossD.class);
+        Restriction r1 = Restrictions.eq("lossId", gspUnqualifiedLoss.getId());
+        Restriction r2 = Restrictions.eq("status", GspUnqualifiedStatus.OUT_AUDIT_YES.getStatus());
+        crt.setRestriction(Restrictions.and(r1, r2));
+        List<GspUnqualifiedLossD> dList = dMapper.findByCriteria(crt);
+        if (dList == null || dList.size() == 0) {
+            return;
+        }
+        List<GspUnqualifiedLossD> dtoDList = gspUnqualifiedLoss.getGspUnqualifiedLossDList();
+        if(!"WMS".equals(gspUnqualifiedLoss.getSource()) && dtoDList !=null && dtoDList.size()>0){
+            crt.setRestriction(Restrictions.and(r1));
+            for (int i = 0; i < dList.size(); i++) {
+                GspUnqualifiedLossD gspUnqualifiedLossD = dList.get(i);
+                BigDecimal qty=BigDecimal.ZERO;
+                for (int j = 0; j < dtoDList.size(); j++) {
+                    GspUnqualifiedLossD unqualifiedLossD = dtoDList.get(j);
+                    if(unqualifiedLossD.getId().equals(gspUnqualifiedLossD.getLossId())){
+                        if(!StringUtils.isBlank(unqualifiedLossD.getLossQty())){
+                            qty=qty.add(new BigDecimal(unqualifiedLossD.getLossQty()));
+                        }
+                    }
+                }
+                if(qty.compareTo(new BigDecimal(gspUnqualifiedLossD.getLossQty()))!=0){
+                    throw new BizException("商品"+gspUnqualifiedLossD.getItemCode()+"报损数量不对,请核对");
+                }
+            }
+            for (int i = 0; i < dtoDList.size(); i++) {
+                GspUnqualifiedLossD gspUnqualifiedLossD = dtoDList.get(i);
+                if(StringUtils.isBlank(gspUnqualifiedLossD.getLocatorId())){
+                    throw new BizException("商品"+gspUnqualifiedLossD.getItemCode()+"请填写货位");
+                }
+                gspUnqualifiedLossD.setId(null);
+                gspUnqualifiedLossD.setStatus(status);
+            }
+            dMapper.deleteByCriteria(crt);
+            dMapper.saveBatch(dtoDList);
+            dList=dtoDList;
+        }else{
+            dMapper.updateMapByCriteria(MapUtils.put("status", status).put("gmtModified", auditDate).getMap(), crt);
+        }
+        gspUnqualifiedLoss.setGspUnqualifiedLossDList(dList);
+        if ("20".equals(status)) {
+            saveDxi(gspUnqualifiedLoss);
+            InvStockCheck check = new InvStockCheck();
+            check.setLineBillIds(dList.stream().map(GspUnqualifiedLossD::getId).toArray(String[]::new));
+            log.info("调用库存接口scrapStockCheck,入参为:" + JSON.toJSONString(check));
+            RestMessage restMessage = inventoryClient.scrapStockCheck(check);
+            log.info("调用库存接口scrapStockCheck,入参为:" + JSON.toJSONString(check) + ",返回为:" + JSON.toJSONString(restMessage));
+            if (restMessage == null || !restMessage.isSuccess()) {
+                throw new BizException("调用库存异常:" + restMessage.getMessage());
+            }
+            //回传erp
+            syncStockToErp(dList);
+        } else if ("30".equals(status)) {
+            InvStockCancel invStockCancel = new InvStockCancel();
+            String[] lienIds = dList.stream().map(GspUnqualifiedLossD::getId).toArray(String[]::new);
+            invStockCancel.setLineBillIds(lienIds);
+            log.info("调用库存接口scrapCancel,入参为:" + JSON.toJSONString(invStockCancel));
+            RestMessage restMessage = inventoryClient.scrapCancel(invStockCancel);
+            log.info("调用库存接口scrapCancel,入参为:" + JSON.toJSONString(invStockCancel) + ",返回为:" + JSON.toJSONString(restMessage));
+            if (restMessage == null || !restMessage.isSuccess()) {
+                throw new BizException("调用库存异常:" + restMessage.getMessage());
+            }
+        }
+    }
+
+    private void syncStockToErp(List<GspUnqualifiedLossD> dList) {
+        List<WmsInvStockQtyQueryVO> res = new ArrayList<>();
+        for (GspUnqualifiedLossD gspUnqualifiedLossD : dList) {
+            WmsInvStockQtyQueryVO wmsInvStockQtyQueryVO = new WmsInvStockQtyQueryVO();
+            BeanUtils.copyProperties(gspUnqualifiedLossD,wmsInvStockQtyQueryVO);
+            res.add(wmsInvStockQtyQueryVO);
+        }
+        RestMessage<List<WmsInvStockQtyVO>> restRet = inventoryClient.getAvailableQuantityList(res);
+        if (restRet != null && restRet.isSuccess() && restRet.getData() != null && restRet.getData().size() == res.size()) {
+            Date date = new Date();
+            for (WmsInvStockQtyVO datum : restRet.getData()) {
+                if (StringUtils.isEmpty(erpInventoryCallbackUrl)) {
+                    throw new BizException("损益结果回传ERP请求路径配置为空");
+                }
+                String url = erpInventoryCallbackUrl;
+                log.info("调用ERP损益结果回传接口URL:{}", url);
+                Map<String,Object> params = new HashMap<>();
+                params.put("goodSn",datum.getItemId());
+                params.put("fLot",datum.getBatchId());
+                params.put("stockNum",datum.getQuantity());
+                params.put("alterTime",date);
+                params.put("beforeWNo", datum.getWarehouseAreaCategory());
+                GspUnqualifiedLossD gspUnqualifiedLossD = dList.stream().filter(item -> datum.getItemId().equals(item.getItemId()) && datum.getBatchId().equals(item.getBatchId())).findFirst().orElse(null);
+                params.put("alterRemark",gspUnqualifiedLossD == null ? null :gspUnqualifiedLossD.getUnqualifiedReason());
+                log.info("调用ERP损益结果回传接口入参:{}", JSONUtil.toJsonStr(params));
+                String result = HttpUtil.post(url, JSONObject.toJSONString(params));
+                JSONObject parse = JSONObject.parseObject(result);
+                log.info("调用ERP损益结果回传接口返回参数:{}",parse);
+            }
+        }
+    }
+
+    private void saveDxi(GspUnqualifiedLoss model) {
+        List<GspUnqualifiedLossDVO> gspUnqualifiedLossDList = spellGspUnqualifiedLossDVOS(model.getGspUnqualifiedLossDList());
+        List<OmsInventoryResultVO> resultListVO = new ArrayList<>();
+        UserDTO userDTO = userTemplate.getUserDTO();
+        BaseWmsWarehouseMst wmsWarehouseMst = null;
+        List<InvStockScarp> invStockList = new ArrayList<>();
+        for (int i = 0; i < gspUnqualifiedLossDList.size(); i++) {
+            GspUnqualifiedLossDVO dDto = gspUnqualifiedLossDList.get(i);
+            if (i == 0) {
+                RestMessage<BaseWmsWarehouseMst> itemResultWarehouse = warehouseClient.warehouse(dDto.getWarehouseId());
+                if (itemResultWarehouse.isSuccess() && itemResultWarehouse.getData() != null) {
+                    wmsWarehouseMst = itemResultWarehouse.getData();
+                }
+            }
+            DxiGspGainslossesBillRec owsModel = new DxiGspGainslossesBillRec();
+            owsModel.setLineid(dDto.getId());//对接单据行号
+            owsModel.setSeqno(dDto.getSeqNo());//对接单据行号
+            owsModel.setBillid(model.getId());//单据ID
+            owsModel.setBillno(model.getCode());//单据编号
+            owsModel.setType("1");//单据类型,长度只能为1
+            owsModel.setStatus("1");//状态,长度只能为1
+            owsModel.setConsignorid(dDto.getCargoOwnerId());//货主ID
+            owsModel.setConsignorcode(dDto.getCargoOwnerCode());//货主编码
+            owsModel.setConsignorname(dDto.getCargoOwnerName());//货主名称
+            owsModel.setBranchid(model.getWarehouseId());//仓库ID
+            if (wmsWarehouseMst != null) {
+                owsModel.setBranchcode(wmsWarehouseMst.getWarehouseCode());//仓库编码
+            }
+            owsModel.setBranchname(model.getWarehouseName());//仓库名称
+            owsModel.setItemid(dDto.getItemId());//商品ID
+            owsModel.setItemname(dDto.getItemName());//商品名称
+            owsModel.setItemcode(dDto.getItemCode());//商品编码
+            //			owsModel.setPrice();//单价
+            owsModel.setAmount(dDto.getLossQty());//数量
+            //			owsModel.setPackAmount();//包装数量
+            //			owsModel.setPackUnit();//包装单位
+            //			owsModel.setTotalPrice();//总金额
+            //			owsModel.setSpec();//规格
+            //			owsModel.setPlace();//产地
+            owsModel.setManufacturer(dDto.getManufacturerName());//生产企业
+            owsModel.setProductionDate(dDto.getProductionDate());//生产日期
+            owsModel.setExpiredDate(dDto.getExpiredDate());//有效期至
+            if (StringUtils.isBlank(owsModel.getBatchNum())) {
+                owsModel.setBatchNum(StringUtils.isBlank(dDto.getLotNum()) ? "N/A" : dDto.getLotNum());//批号
+            }
+            //			owsModel.setApprovalNumber();//批准文号
+            if (StringUtils.isBlank(dDto.getOpinion())) {
+                owsModel.setReason("N/A");
+            } else {
+                owsModel.setReason(dDto.getOpinion());//原因
+            }
+            //			owsModel.setRefBilltype();//数据来源
+            //			owsModel.setAttrStr1();//扩展字段1
+            //			owsModel.setAttrStr2();//扩展字段2
+            //			owsModel.setAttrStr3();//扩展字段3
+            //			owsModel.setAttrStr4();//扩展字段4
+            //			owsModel.setAttrStr5();//扩展字段5
+            //			owsModel.setAttrStr6();//扩展字段6
+            //			owsModel.setAttrStr7();//扩展字段7
+            //			owsModel.setAttrStr8();//扩展字段8
+            //			owsModel.setAttrStr9();//扩展字段9
+            //			owsModel.setAttrStr10();//扩展字段10
+            //			owsModel.setAttrNum1();//扩展字段11
+            //			owsModel.setAttrNum2();//扩展字段12
+            //			owsModel.setAttrNum3();//扩展字段13
+            //			owsModel.setAttrNum4();//扩展字段14
+            //			owsModel.setAttrNum5();//扩展字段15
+            //			owsModel.setAttrDte1();//扩展字段16
+            //			owsModel.setAttrDte2();//扩展字段17
+            //			owsModel.setAttrDte3();//扩展字段18
+            //			owsModel.setAttrDte4();//扩展字段19
+            //			owsModel.setAttrDte5();//扩展字段20
+            owsModel.setCreatedate(model.getGmtCreate());//创建时间
+            owsModel.setCreateby(model.getCreatorName());//创建人
+            owsModel.setLastmodifydate(model.getGmtModified());//修改时间
+            owsModel.setLastmodifyby(model.getCreatorName());//修改人
+            owsModel.setEnterpriseid(userDTO.getEnterpriseId());//企业ID
+            owsModel.setEnterprisename(userDTO.getEnterpriseName());//企业名称
+            owsModel.setBilldate(model.getGmtCreate());
+            dxiGspGainslossesBillRecMapper.save(owsModel);
+
+            // 预占库存
+            InvStockScarp invStockScarp = new InvStockScarp();
+            invStockScarp.setBillId(model.getId());
+            invStockScarp.setLineBillId(dDto.getId());
+            invStockScarp.setWarehouseId(model.getWarehouseId());
+            InvStockScrapDetail invStockScrapDetail = new InvStockScrapDetail();
+            invStockScrapDetail.setBatchId(dDto.getBatchId());
+            invStockScrapDetail.setLocatorId(dDto.getLocatorId());
+            invStockScrapDetail.setQuantity(new BigDecimal(dDto.getLossQty()));
+            invStockScarp.setDetails((new ArrayList<InvStockScrapDetail>() {{
+                add(invStockScrapDetail);
+            }}));
+            invStockList.add(invStockScarp);
+
+            //回传OMS 通过接口平台
+            OmsInventoryResultVO resultVO = new OmsInventoryResultVO();
+            resultVO.setBillno(owsModel.getBillno());
+            resultVO.setBilldate(DateUtils.format(owsModel.getBilldate(),"yyyy-MM-dd HH:mm:ss"));
+            resultVO.setInventoryby(userDTO.getUsername());
+            resultVO.setSeqNo(owsModel.getSeqno());
+            resultVO.setItemcode(owsModel.getItemcode());
+            resultVO.setCausticQty(new BigDecimal(dDto.getUnqualifiedQty()));
+            resultVO.setCausticReason(owsModel.getReason());
+            resultVO.setLotNo(owsModel.getBatchNum());
+            resultVO.setPdateFrom(DateUtils.format(owsModel.getProductionDate(),"yyyy-MM-dd HH:mm:ss"));
+            resultVO.setValidUntil(DateUtils.format(owsModel.getExpiredDate(),"yyyy-MM-dd HH:mm:ss"));
+            resultVO.setCausticType("3");
+            resultVO.setQty(BigDecimal.ZERO);
+            resultVO.setOperatorName(userDTO.getUsername());
+            resultVO.setConfirmer(userDTO.getUsername());
+            resultVO.setAuditDate(DateUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
+            resultVO.setUnqualifiedQty(new BigDecimal(dDto.getUnqualifiedQty()));
+            resultVO.setUnqualifiedResource(dDto.getUnqualifiedReason());
+            resultVO.setUnqualifiedSource("0");
+            resultVO.setOpinion(dDto.getOpinion());
+            resultVO.setConsignorcode(owsModel.getConsignorcode());
+            resultVO.setBranchcode(owsModel.getBranchcode());
+            resultVO.setPenterpriseid(owsModel.getEnterpriseid());
+            resultVO.setItemid(owsModel.getItemid());
+            resultListVO.add(resultVO);
+        }
+//        RestMessage upKeepDictResult = inventoryClient.scrapStock(invStockList);
+//        log.info("调用库存接口scrapStock,入参为:" + JSON.toJSONString(invStockList) + ",返回为:" + JSON.toJSONString(upKeepDictResult));
+//        if (upKeepDictResult == null || !upKeepDictResult.isSuccess()) {
+//            throw new BizException("调用库存异常:" + upKeepDictResult.getMessage());
+//        }
+
+        try {
+            //回传OMS
+            RestMessage<?> msg = inventoryClient.askIntegration(new AskIntegrationVo("loss", resultListVO));
+            log.info("调用OMS结果成功:{}", JSONObject.toJSONString(msg));
+        }catch (Exception e){
+            log.error("调用OMS结果失败", e);
+        }
+    }
+
+    private void saveDxiOrder(GspUnqualifiedLoss model) {
+        List<GspUnqualifiedLossDVO> gspUnqualifiedLossDList = spellGspUnqualifiedLossDVOS(model.getGspUnqualifiedLossDList());
+        UserDTO userDTO = userTemplate.getUserDTO();
+        BaseWmsWarehouseMst wmsWarehouseMst = null;
+        List<OmsInventoryOrder> inoList = new ArrayList<>();
+        Date now = new Date();
+        for (int i = 0; i < gspUnqualifiedLossDList.size(); i++) {
+            GspUnqualifiedLossDVO dDto = gspUnqualifiedLossDList.get(i);
+            OmsInventoryOrder ino = new OmsInventoryOrder();
+            ino.setBillid(model.getId());//单据ID
+            ino.setBillno(model.getCode());//单据编号
+            ino.setBilldate(now);
+            ino.setType("3");
+            ino.setAmount(new BigDecimal(dDto.getLossQty()));
+            // 设置批次相关数据
+            ino.setAttrStr2(dDto.getBatchProductionDateShow()); // 显示生产日期
+            ino.setAttrStr3(dDto.getBatchExpiredDateShow()); // 显示有效期至
+            ino.setBatchNum(dDto.getLotNum()); // 批号
+            ino.setProductionDate(dDto.getProductionDate());
+            ino.setExpiredDate(dDto.getExpiredDate());
+            // 设置仓库相关数据
+            if (i == 0) {
+                RestMessage<BaseWmsWarehouseMst> itemResultWarehouse = warehouseClient.warehouse(dDto.getWarehouseId());
+                if (itemResultWarehouse.isSuccess() && itemResultWarehouse.getData() != null) {
+                    wmsWarehouseMst = itemResultWarehouse.getData();
+                }
+            }
+            ino.setBranchid(wmsWarehouseMst.getWarehouseId()); // 仓库id
+            ino.setBranchcode(wmsWarehouseMst.getWarehouseCode());
+            ino.setBranchname(wmsWarehouseMst.getWarehouseName()); // 仓库名称
+            // 还需要建筑物
+            //			String bldgName = dDto.getBldgName();
+            //			ino.setBuilding(dDto.get);
+            // 设置货主相关
+            ino.setConsignorid(dDto.getCargoOwnerId());
+            ino.setConsignorcode(dDto.getCargoOwnerCode());
+            ino.setConsignorname(dDto.getCargoOwnerName());
+            // 设置商品相关
+            ino.setItemid(dDto.getItemId());
+            ino.setItemcode(dDto.getItemCode());
+            ino.setItemname(dDto.getItemName());
+            ino.setApprovalNumber(dDto.getItemHealthApprovalNbr());
+            //ino.setPrice(dDto.getPiecePurchasePriceTi());
+            ino.setSpec(dDto.getSpecification());
+            ino.setPlace(dDto.getCountryOriginName());
+            ino.setManufacturer(dDto.getManufacturerName());
+            ino.setLineid(dDto.getId());
+            //			BigDecimal price = dDto.getPrice();
+            //			if (price != null) {
+            //				ino.setTotalPrice(price.multiply(wmsAdjustD.getPieceQuantity().abs()));
+            //			}
+            ino.setPackUnit(dDto.getCaseUom());
+            ino.setPackAmount(dDto.getCaseConversionRate());
+            ino.setStockstatus("202");//不合格
+            ino.setStatus("10"); // 初始状态创建中
+            ino.setDatasource("1"); // 来源wms
+            //			ino.setRemark(dDto.getComments());
+            //			ino.setBasenum(dDto.getPieceAccount());
+            //			ino.setExecnum(dDto.getPieceAccountFact());
+            //			Long lineNum = wmsAdjustD.getLineNum();
+            ino.setSeqno(dDto.getSeqNo());
+            ino.setEnterpriseid(userDTO.getEnterpriseId());
+            ino.setEnterprisename(userDTO.getEnterpriseName());
+            ino.setSalemanid(userDTO.getId());
+            ino.setCaozyid(userDTO.getId());
+            ino.setCreatedate(now);
+            ino.setCreateby(userDTO.getUsername());
+            ino.setLastmodifydate(now);
+            ino.setLastmodifyby(userDTO.getUsername());
+            ino.setIsDestroy("N"); // 默认不销毁
+            inoList.add(ino);
+        }
+        long saveBatch = omsInventoryOrderMapper.saveBatch(inoList);
+    }
+
+    /**
+     * 是否需要先提交Erp审核
+     *
+     * @param warehouseId
+     * @param cargoOwnerId
+     * @param enterpriseId
+     * @return
+     */
+    public Boolean isNeedErpAudit(String warehouseId, String cargoOwnerId, String enterpriseId) {
+        Boolean returnVal = true;// 默认审核
+
+        // 开启erp审核的值
+        String onVal = "0";
+        RestMessage<BusinessControl> res = strategyClient.registryByCode(this.erpAuditRegCode, warehouseId, cargoOwnerId, enterpriseId);
+
+        if (res.isSuccess() && ObjectUtils.isNotNull(res.getData())) {
+            BusinessControl data = res.getData();
+            if (!StringUtils.isBlank(data.getRegValue()) && data.getRegValue().equals(onVal)) {
+                returnVal = false;
+            }
+        }
+
+        return returnVal;
+    }
+
+    @Override
+    public Boolean erpAdd(ErpUnqualifiedLossVo vo) {
+        if (CollUtil.isEmpty(vo.getData().getBills())){
+            throw new BizException("单据为空");
+        }
+        for (ErpUnqualifiedLossVo.LossH bill : vo.getData().getBills()) {
+            BaseWmsWarehouseMst wmsWarehouseMst = null;
+            RestMessage<BaseWmsWarehouseMst> itemResultWarehouse = warehouseClient.warehouse(bill.getBranchid());
+            if (itemResultWarehouse.isSuccess() && itemResultWarehouse.getData() != null) {
+                wmsWarehouseMst = itemResultWarehouse.getData();
+            }
+            if (wmsWarehouseMst == null) {
+                throw new ParameterException("仓库不能为空");
+            }
+            if (CollUtil.isEmpty(bill.getDetails())){
+                throw new BizException("单号【" + bill.getBillno() + "】的明细为空!");
+            }
+            GspUnqualifiedLoss model = new GspUnqualifiedLoss();
+            model.setCreator("ERP");
+            String id = String.valueOf(SnowFlakeUtils.getId());
+            model.setId(id);
+            String code = "BSD" + id.substring(id.length() - 8);
+            model.setCode(code);
+            model.setCreatorName("ERP");
+            model.setGmtCreate(DateUtil.date());
+            model.setModifier("ERP");
+            model.setModifierName("ERP");
+            model.setGmtModified(DateUtil.date());
+            model.setEnterpriseId(bill.getEnterpriseid());
+            model.setStatus("10");
+            model.setDcId(wmsWarehouseMst.getDcId());
+            model.setSource("ERP");
+            int i = 1;
+            List<InvStockScarp> invStockList = new ArrayList<>();
+            for (ErpUnqualifiedLossVo.LossD detail : bill.getDetails()) {
+                GspUnqualifiedLossD dModel = new GspUnqualifiedLossD();
+                String unqualifiedQty = detail.getQty();
+                String lossQty = dModel.getLossQty();
+                if ((StringUtils.isBlank(unqualifiedQty) || StringUtils.isBlank(lossQty)) ||
+                        (new BigDecimal(unqualifiedQty)).compareTo(new BigDecimal(lossQty)) < 0) {
+                    throw new BizException("报损数量不能大于不合格数量:第" + (i + 1) + "行");
+                }
+                String sonId = String.valueOf(SnowFlakeUtils.getId());
+                dModel.setId(sonId);
+                dModel.setDcId(wmsWarehouseMst.getDcId());
+                dModel.setWarehouseId(model.getWarehouseId());
+                dModel.setEnterpriseId(bill.getEnterpriseid());
+                dModel.setLossId(id);
+                dModel.setLossCode(code);
+                if (StringUtils.isBlank(dModel.getLotNum()) && !StringUtils.isBlank(dModel.getManufacturerLotNum())) {
+                    dModel.setLotNum(dModel.getManufacturerLotNum());
+                }
+                dModel.setStatus("10");
+                dModel.setDestroyingQty("0");
+                dModel.setDestroyedQty("0");
+                dModel.setCreator("ERP");
+                dModel.setCreatorName("ERP");
+                dModel.setGmtCreate(DateUtil.date());
+                dModel.setModifier("ERP");
+                dModel.setModifierName("ERP");
+                dModel.setGmtModified(DateUtil.date());
+                dModel.setSeqNo(Integer.toString((i + 1)));//对接单据行号
+                dMapper.save(dModel);
+                //生成预占
+                InvStockScarp invStockScarp=new InvStockScarp();
+                invStockScarp.setBillId(id);
+                invStockScarp.setLineBillId(sonId);
+                invStockScarp.setWarehouseId(model.getWarehouseId());
+                InvStockScrapDetail invStockScrapDetail=new InvStockScrapDetail();
+                invStockScrapDetail.setBatchId(dModel.getBatchId());
+                invStockScrapDetail.setLocatorId(dModel.getLocatorId());
+                invStockScrapDetail.setQuantity(new BigDecimal(dModel.getLossQty()));
+                invStockScarp.setDetails((new ArrayList<InvStockScrapDetail>(){{add(invStockScrapDetail);}}));
+                invStockList.add(invStockScarp);
+                i ++;
+            }
+            RestMessage upKeepDictResult = inventoryClient.scrapStock(invStockList);
+            log.info("调用库存接口scrapStock,入参为:"+ JSON.toJSONString(invStockList)+",返回为:"+JSON.toJSONString(upKeepDictResult));
+            if (upKeepDictResult==null || !upKeepDictResult.isSuccess()) {
+                throw new BizException("调用库存异常:"+ (upKeepDictResult == null?"返回结果为null":upKeepDictResult.getMessage()));
+            }
+
+            //ERP下发自动审核通过
+            try {
+                this.oneAudit(model, "20", DateUtil.date());
+            }catch (Exception e){
+                log.error("库存处理异常!", e);
+            }
+        }
+        return true;
+    }
+}

+ 218 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/GspUpkeepCheckPlanServiceImpl.java

@@ -0,0 +1,218 @@
+package com.prolog.cs.base.gsp.service.impl;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.StrUtil;
+import com.google.common.collect.Maps;
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.dao.GspUpkeepCheckPlanMapper;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheckPlan;
+import com.prolog.cs.base.gsp.resource.ChainClient;
+import com.prolog.cs.base.gsp.resource.WarehouseClient;
+import com.prolog.cs.base.gsp.service.GspUpkeepCheckPlanService;
+import com.prolog.cs.base.gsp.utils.RestMsgHelper;
+import com.prolog.cs.basic.chain.model.cargo.BaseCargoOwnerMst;
+import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseMst;
+import com.prolog.cs.basic.warehouse.model.dto.WmsWhBldgDTO;
+import com.prolog.framework.authority.core.dto.UserDTO;
+import com.prolog.framework.authority.user.UserTemplate;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.core.pojo.Page;
+import com.prolog.framework.dao.util.PageUtils;
+import com.prolog.framework.utils.ObjectUtils;
+import com.prolog.framework.utils.StringUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+public class GspUpkeepCheckPlanServiceImpl implements GspUpkeepCheckPlanService {
+
+    @Autowired
+    private GspUpkeepCheckPlanMapper upkeepCheckPlanMapper;
+
+    @Autowired
+    private UserTemplate userTemplate;
+
+    @Autowired
+    private WarehouseClient warehouseClient;
+
+    @Autowired
+    private ChainClient chainClient;
+
+    @Override
+    public List<GspUpkeepCheckPlan> spellGspUpkeepCheckPlans(List<GspUpkeepCheckPlan> list) {
+        //转换并组装
+        //组合id
+        String[] cargoOwnerIds = list.stream().map(GspUpkeepCheckPlan::getCargoOwnerId).distinct().toArray(String[]::new);
+        //请求货位信息
+        RestMessage<Map<String, BaseCargoOwnerMst>> cargoOwnerResult = chainClient.getCargoOwnerMstByIds(cargoOwnerIds);
+        List<GspUpkeepCheckPlan> listRet = new ArrayList<>();
+        // 获取所有仓库信息 - by Huanglh 2022-02-10
+        Map<String, BaseWmsWarehouseMst> warehouseMstMap = new HashMap<>();
+        Set<String> warehouseIds = list.stream().map(GspUpkeepCheckPlan::getWarehouseId).collect(Collectors.toSet());
+        RestMessage<Map<String, BaseWmsWarehouseMst>> restMessage = warehouseClient.mapbyids(warehouseIds);
+        if (restMessage.isSuccess() && ObjectUtils.isNotNull(restMessage.getData())) {
+            warehouseMstMap = restMessage.getData();
+        }
+        String warehouseName = "";
+        for (int i = 0; i < list.size(); i++) {
+            GspUpkeepCheckPlan gspUpkeepCheckD = list.get(i);
+            if (i == 0) {
+                // 将循环调用接口改为循环外一次查所有后 Map 匹配 - by Huanglh 2022-02-10
+                if (warehouseMstMap.containsKey(gspUpkeepCheckD.getWarehouseId())) {
+                    warehouseName = warehouseMstMap.get(gspUpkeepCheckD.getWarehouseId()).getWarehouseName();
+                }
+            }
+            GspUpkeepCheckPlan gspUpkeepCheckVO = new GspUpkeepCheckPlan();
+            BeanUtils.copyProperties(gspUpkeepCheckD, gspUpkeepCheckVO);
+            if (cargoOwnerResult != null) {
+                Map<String, BaseCargoOwnerMst> data = cargoOwnerResult.getData();
+                if (data != null && data.get(gspUpkeepCheckD.getCargoOwnerId()) != null) {
+                    gspUpkeepCheckVO.setCargoOwnerName(data.get(gspUpkeepCheckD.getCargoOwnerId()).getCargoOwnerName());
+                }
+            }
+            listRet.add(gspUpkeepCheckVO);
+
+            gspUpkeepCheckVO.setWarehouseName(warehouseName);
+            //gspUpkeepCheckVO.setBldgName("曲靖康桥仓");
+        }
+        return listRet;
+    }
+
+    @Override
+    public Page<GspUpkeepCheckPlan> findPlan(QueryDTO dto) {
+
+        init4FindPlan(dto);
+        dto.setType("1");
+
+        PageUtils.startPage(dto.getPageNum(), dto.getPageSize());
+        List<GspUpkeepCheckPlan> list = upkeepCheckPlanMapper.findList(dto);
+
+        if (CollUtil.isEmpty(list)) {
+            return PageUtils.getPage(list);
+        }
+
+        packResult4FindPlan(list);
+        return PageUtils.getPage(list);
+    }
+
+    private void packResult4FindPlan(List<GspUpkeepCheckPlan> list) {
+        Map<String, WmsWhBldgDTO> bldMaps = Maps.newHashMap();
+        String[] bldgIds = list.stream().map(GspUpkeepCheckPlan::getBldgId).filter(StrUtil::isNotBlank).distinct().toArray(String[]::new);
+        if (bldgIds.length > 0) {
+            List<WmsWhBldgDTO> bldgDTOList = RestMsgHelper.unpack(warehouseClient.getBldgBasicInfoList(bldgIds));
+            if (CollUtil.isNotEmpty(bldgDTOList)) {
+                bldMaps = bldgDTOList.stream().collect(Collectors.toMap(WmsWhBldgDTO::getBldgId, entity -> entity));
+            }
+        }
+        String[] cargoOwnerIds = list.stream().map(GspUpkeepCheckPlan::getCargoOwnerId).distinct().toArray(String[]::new);
+        Map<String, BaseCargoOwnerMst> cargoOwnerMaps = Maps.newHashMap();
+        if (cargoOwnerIds.length > 0) {
+            cargoOwnerMaps = RestMsgHelper.unpack(chainClient.getCargoOwnerMstByIds(cargoOwnerIds));
+        }
+        Map<String, BaseWmsWarehouseMst> warehouseMstMap = new HashMap<>();
+        Set<String> warehouseIds = list.stream().map(GspUpkeepCheckPlan::getWarehouseId).collect(Collectors.toSet());
+        if (warehouseIds.size() > 0) {
+            warehouseMstMap = RestMsgHelper.unpack(warehouseClient.mapbyids(warehouseIds));
+        }
+
+        DateTime now = DateUtil.date();
+        UserDTO user = userTemplate.getUserDTO();
+        for (GspUpkeepCheckPlan plan : list) {
+            plan.setUpkeepTypeDesc(spellUpkeepType(plan.getUpkeepType()));
+            Optional.ofNullable(bldMaps.get(plan.getBldgId())).ifPresent(t -> plan.setBldgName(t.getBldgName()));
+            Optional.ofNullable(cargoOwnerMaps.get(plan.getCargoOwnerId())).ifPresent(t -> plan.setCargoOwnerName(t.getCargoOwnerName()));
+            Optional.ofNullable(warehouseMstMap.get(plan.getWarehouseId())).ifPresent(t -> plan.setWarehouseName(t.getWarehouseName()));
+            plan.setPrintDate(now);
+            plan.setOperBy(user.getNickname());
+        }
+    }
+
+    private void init4FindPlan(QueryDTO dto) {
+        UserDTO user = userTemplate.getUserDTO();
+        dto.initialPageWhenValueIsNull(user);
+        dto.setEnterpriseId(user.getEnterpriseId());
+        if (dto.getEndTime() != null) {
+            Calendar calendar = new GregorianCalendar();
+            calendar.setTime(dto.getEndTime());
+            calendar.add(Calendar.DATE, 1);//1表示明天,-1表示昨天
+            dto.setEndTime(calendar.getTime());//这个时间就是第二天
+        }
+    }
+
+    @Override
+    public List<GspUpkeepCheckPlan> findUpkeepPlan4MovePick(QueryDTO upkeepCheckDTO) {
+        upkeepCheckDTO.setType("2");
+        String warehouseName = getWarehouseName(upkeepCheckDTO.getWarehouseId());
+        String cargoOwnerName = getCargoOwnerName(upkeepCheckDTO.getCargoOwnerId());
+        List<GspUpkeepCheckPlan> planList = upkeepCheckPlanMapper.findList(upkeepCheckDTO);
+        String[] cargoOwnerIds = planList.stream().map(GspUpkeepCheckPlan::getCargoOwnerId).distinct().toArray(String[]::new);
+        RestMessage<Map<String, BaseCargoOwnerMst>> result = chainClient.getCargoOwnerMstByIds(cargoOwnerIds);
+
+        for (int i = 0; i < planList.size(); i++) {
+            GspUpkeepCheckPlan upkeepCheckPlan = planList.get(i);
+            upkeepCheckPlan.setWarehouseName(warehouseName);
+            if (result.isSuccess() && result.getData() != null) {
+                BaseCargoOwnerMst baseCargoOwnerMst = result.getData().get(upkeepCheckPlan.getCargoOwnerId());
+                if (baseCargoOwnerMst != null) {
+                    upkeepCheckPlan.setCargoOwnerName(baseCargoOwnerMst.getCargoOwnerName());
+                }
+            }
+        }
+        return planList;
+    }
+
+    @Override
+    public String spellUpkeepType(Integer upkeepType) {
+        if (upkeepType != null) {
+            //类型:0=未分类 1=重点特殊药品,2=重点专管药品,3=重点其他药品,4=重点医疗器械,
+            // 5=重点非药品,6=一般药品,7=一般器械,8=一般非药品
+            if (upkeepType == 1)
+                return "重点特殊药品";
+            if (upkeepType == 2)
+                return "重点专管药品";
+            if (upkeepType == 3)
+                return "重点其他药品";
+            if (upkeepType == 4)
+                return "重点医疗器械";
+            if (upkeepType == 5)
+                return "重点非药品";
+            if (upkeepType == 6)
+                return "一般药品";
+            if (upkeepType == 7)
+                return "一般器械";
+            if (upkeepType == 8)
+                return "一般非药品";
+        }
+        return null;
+    }
+
+    //请求仓库信息
+    private String getWarehouseName(String warehouseId) {
+        if (StringUtils.isBlank(warehouseId)) {
+            return null;
+        }
+        RestMessage<BaseWmsWarehouseMst> itemResultWarehouse = warehouseClient.warehouse(warehouseId);
+        if (itemResultWarehouse.isSuccess() && itemResultWarehouse.getData() != null) {
+            return itemResultWarehouse.getData().getWarehouseName();
+        }
+        return null;
+    }
+
+    //请求货主信息
+    private String getCargoOwnerName(String warehouseId) {
+        if (StringUtils.isBlank(warehouseId)) {
+            return null;
+        }
+        RestMessage<Map<String, BaseCargoOwnerMst>> result = chainClient.getCargoOwnerMstByIds(new String[]{warehouseId});
+        if (result.isSuccess() && result.getData() != null) {
+            return result.getData().get(warehouseId).getCargoOwnerName();
+        }
+        return null;
+    }
+}

+ 2102 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/GspUpkeepCheckServiceImpl.java

@@ -0,0 +1,2102 @@
+package com.prolog.cs.base.gsp.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.date.StopWatch;
+import cn.hutool.core.lang.Assert;
+import cn.hutool.core.util.IdUtil;
+import cn.hutool.core.util.ObjectUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.codingapi.tx.annotation.TxTransaction;
+import com.github.pagehelper.PageHelper;
+import com.google.common.collect.Lists;
+import com.prolog.cs.base.gsp.QueryDTO;
+import com.prolog.cs.base.gsp.dao.DxiGspMaintenanceRecordMapper;
+import com.prolog.cs.base.gsp.dao.GspUpkeepCheckMapper;
+import com.prolog.cs.base.gsp.dao.GspUpkeepCheckPlanMapper;
+import com.prolog.cs.base.gsp.model.DxiGspMaintenanceRecord;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheck;
+import com.prolog.cs.base.gsp.model.GspUpkeepCheckPlan;
+import com.prolog.cs.base.gsp.resource.*;
+import com.prolog.cs.base.gsp.service.GspUpkeepCheckService;
+import com.prolog.cs.base.gsp.utils.RestMsgHelper;
+import com.prolog.cs.base.gsp.vo.*;
+import com.prolog.cs.basic.chain.model.cargo.BaseCargoOwnerMst;
+import com.prolog.cs.basic.common.model.BaseCommonDict;
+import com.prolog.cs.basic.item.model.BaseMtlItemHealth;
+import com.prolog.cs.basic.item.model.BaseMtlItemMst;
+import com.prolog.cs.basic.item.model.vo.ItemBaseInfoVO;
+import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseArea;
+import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseMst;
+import com.prolog.cs.basic.warehouse.model.vo.WarehouseLocatorBasicInfo;
+import com.prolog.cs.biz.outbound.model.dto.ContainerConfirmDto;
+import com.prolog.cs.biz.outbound.model.dto.EisConfirmSubVo;
+import com.prolog.entity.vo.OperationCompleteItemVO;
+import com.prolog.entity.vo.OperationCompleteVO;
+import com.prolog.entity.vo.OutBoundRequestItemVO;
+import com.prolog.entity.vo.OutBoundRequestVO;
+import com.prolog.enums.OutBoundRequestEnum;
+import com.prolog.framework.authority.core.dto.UserDTO;
+import com.prolog.framework.authority.user.UserTemplate;
+import com.prolog.framework.bz.core.collection.ValidList;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.core.exception.BizException;
+import com.prolog.framework.core.exception.ParameterException;
+import com.prolog.framework.core.exception.PrologException;
+import com.prolog.framework.core.pojo.Page;
+import com.prolog.framework.core.restriction.Criteria;
+import com.prolog.framework.core.restriction.Order;
+import com.prolog.framework.core.restriction.Restriction;
+import com.prolog.framework.core.restriction.Restrictions;
+import com.prolog.framework.dao.util.PageUtils;
+import com.prolog.framework.toolkit.MapToolKit;
+import com.prolog.framework.utils.*;
+import com.prolog.inte.EisHandler;
+import com.prolog.upcloud.base.inventory.model.WmsInvStockLot;
+import com.prolog.upcloud.base.inventory.vo.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static com.prolog.cs.base.gsp.constant.EisConstant.*;
+import static com.prolog.cs.base.gsp.constant.MsgTemplate.DATA_OVERDUE;
+import static com.prolog.cs.base.gsp.constant.WhOperataConstant.PICK_MODE_DEVICE;
+
+@Service
+public class GspUpkeepCheckServiceImpl implements GspUpkeepCheckService {
+
+    private static Logger logger = LoggerFactory.getLogger(GspUpkeepCheckServiceImpl.class);
+
+    @Autowired
+    private GspUpkeepCheckMapper mapper;
+
+    @Autowired
+    private GspUpkeepCheckPlanMapper upkeepCheckPlanMapper;
+
+    @Autowired
+    private UserTemplate userTemplate;
+
+    @Autowired
+    private ItemClient itemClient;
+
+    @Autowired
+    private WarehouseClient warehouseClient;
+
+    @Autowired
+    private ChainClient chainClient;
+
+    @Autowired
+    private CommonClient commonClient;
+
+    @Autowired
+    private DxiGspMaintenanceRecordMapper dxiOmsMaintenanceRecordMapper;
+
+    @Autowired
+    private InventoryClient inventoryClient;
+
+    @Autowired
+    private AutoUpKeepTask autoUpKeepTask;
+
+    @Resource
+    private EisHandler eisHandler;
+
+    // 可配置自动养护定时任务的用户信息
+    @Value("${prolog.autoUpkeep.userId:599299328393220096}")
+    private String autoUserId;
+    @Value("${prolog.autoUpkeep.userName:昆中药WMS管理员}")
+    private String autoUserName;
+    @Value("${prolog.autoUpkeep.enterpriseId:106}")
+    private String autoEnterpriseId;
+
+    @Autowired
+    private IntegrationResource integrationResource;
+
+    // 设备下发配置 - by Huanglh 2022-03-01
+    @Value("${prolog.integration.sendDeviceId:}")
+    private String sendDeviceId;
+
+    @Value("${prolog.integration.sendWmsId:}")
+    private String sendWmsId;
+
+    @Value("${prolog.integration.updateDeviceId:}")
+    private String updateDeviceId;
+
+    @Value("${prolog.integration.updateDeviceOkId:}")
+    private String updateDeviceOkId;
+
+    @Value("${prolog.integration.token:}")
+    private String token;
+
+    @Value("${oms.dxiGspMaintenanceRecordUrl}")
+    private String dxiGspMaintenanceRecordUrl;
+    @Resource
+    private EisResource eisResource;
+
+    @Override
+    public void batchAdd(String source, List<GspUpkeepCheck> modelList) {
+        RestMessage<Map<String,String>> upKeepDictResult = commonClient.findUpKeepDict(0);
+        if (upKeepDictResult==null || !upKeepDictResult.isSuccess() || upKeepDictResult.getData() == null) {
+            throw new ParameterException("数据字典【GSP养护关联商品大类】配置错误,请联系管理员");
+        }
+        RestMessage<Map<String,String>> upKeepDictResultVip = commonClient.findUpKeepDict(1);
+        if (upKeepDictResultVip==null || !upKeepDictResultVip.isSuccess() || upKeepDictResultVip.getData() == null) {
+            throw new ParameterException("数据字典【GSP养护关联商品大类】配置错误,请联系管理员");
+        }
+        BaseWmsWarehouseMst wmsWarehouseMst=null;
+        String warehouseId = modelList.get(0).getWarehouseId();
+        RestMessage<BaseWmsWarehouseMst> itemResultWarehouse = warehouseClient.warehouse(warehouseId);
+        if (itemResultWarehouse.isSuccess() && itemResultWarehouse.getData() != null) {
+            wmsWarehouseMst=itemResultWarehouse.getData();
+        }
+        if (null == wmsWarehouseMst) {
+            throw new ParameterException("仓库不能为空");
+        }
+        //请求商品信息
+        String[] itemIds = modelList.stream().map(GspUpkeepCheck::getItemId).distinct().toArray(String[]::new);
+        RestMessage<List<BaseMtlItemMst>> itemResult = itemClient.getListByIds(itemIds);
+        if (itemResult==null || !itemResult.isSuccess() || itemResult.getData() == null) {
+            throw new ParameterException("获取商品资料异常,请联系管理员");
+        }
+        // 自动或手动的情况下,获取用户信息
+        UserDTO userDTO = this.getUpkeepUser(source);
+        for (int i = 1; i < 9; i++) {
+            List<GspUpkeepCheck> list = new ArrayList<>();
+            for (int j = 0; j < modelList.size(); j++) {
+                GspUpkeepCheck gspUpkeepCheck = modelList.get(j);
+                if (gspUpkeepCheck == null) {
+                    continue;
+                }
+                BaseMtlItemMst itemBaseInfoVO = itemResult.getData().stream().filter(item -> item.getItemId().equals(gspUpkeepCheck.getItemId())).findFirst().orElse(null);
+                if (itemBaseInfoVO == null || itemBaseInfoVO.getBaseMtlItemHealth() == null || StringUtils.isBlank(itemBaseInfoVO.getBaseMtlItemHealth().getItemHealthCategoryName())) {
+                    if (i == 3) {
+                        list.add(gspUpkeepCheck);
+                    }
+                } else {
+                    String itemHealthCategoryName = itemBaseInfoVO.getBaseMtlItemHealth().getItemHealthCategoryName();
+                    if(gspUpkeepCheck.getIsProtected()==null){
+                        if(itemBaseInfoVO.getBaseMtlItemHealth().getIsProtected()!=null){
+                            gspUpkeepCheck.setIsProtected(itemBaseInfoVO.getBaseMtlItemHealth().getIsProtected());
+                        }
+                    }
+                    if (gspUpkeepCheck.getIsProtected() == 1) {
+                        Integer upKeepType = parseUpKeepTypeVip(upKeepDictResultVip.getData().get(itemHealthCategoryName));
+                        if (i == 3 && (upKeepType == null || upKeepType == i || upKeepType < 6)) {
+                            list.add(gspUpkeepCheck);
+                        } else if (upKeepType != null && upKeepType == i) {
+                            list.add(gspUpkeepCheck);
+                        }
+                    } else {
+                        Integer integer = parseUpKeepType(upKeepDictResult.getData().get(itemHealthCategoryName));
+                        if (i == 6 && (integer == null || integer == i)) {
+                            list.add(gspUpkeepCheck);
+                        } else if (integer != null && integer == i) {
+                            list.add(gspUpkeepCheck);
+                        }
+                    }
+                }
+            }
+            logger.info("生成养护计划入参:{}", JSONUtil.toJsonStr(list));
+            batchAddDbPage(source,userDTO,wmsWarehouseMst,list,i);
+        }
+    }
+
+    private void addDbPage(List<GspUpkeepCheck> modelList, Map<String, String> upKeepDictResult, Map<String, String> upKeepDictResultVip, List<BaseMtlItemMst> itemList, int i, List<GspUpkeepCheck> list) {
+        for (int j = 0; j < modelList.size(); j++) {
+            GspUpkeepCheck gspUpkeepCheck = modelList.get(j);
+            if (gspUpkeepCheck == null) {
+                continue;
+            }
+            BaseMtlItemMst itemBaseInfoVO = itemList.stream().filter(item -> item.getItemId().equals(gspUpkeepCheck.getItemId())).findFirst().orElse(null);
+            if (itemBaseInfoVO == null || itemBaseInfoVO.getBaseMtlItemHealth() == null || StringUtils.isBlank(itemBaseInfoVO.getBaseMtlItemHealth().getItemHealthCategoryName())) {
+                if (i == 3) {
+                    list.add(gspUpkeepCheck);
+                }
+            } else {
+                String itemHealthCategoryName = itemBaseInfoVO.getBaseMtlItemHealth().getItemHealthCategoryName();
+                if (gspUpkeepCheck.getIsProtected() == null || gspUpkeepCheck.getIsProtected() == 1) {
+                    Integer upKeepType = parseUpKeepTypeVip(upKeepDictResultVip.get(itemHealthCategoryName));
+                    if (i == 3 && (upKeepType == null || upKeepType == i || upKeepType > 5)) {
+                        list.add(gspUpkeepCheck);
+                    } else if (upKeepType != null && upKeepType == i) {
+                        list.add(gspUpkeepCheck);
+                    }
+                } else {
+                    Integer integer = parseUpKeepType(upKeepDictResult.get(itemHealthCategoryName));
+                    if (i == 6 && (integer == null || integer == i)) {
+                        list.add(gspUpkeepCheck);
+                    } else if (integer != null && integer == i) {
+                        list.add(gspUpkeepCheck);
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * 获取用户信息,自动创建任务时,使用自己构建的用户DTO
+     *
+     * @param source
+     * @return
+     */
+    private UserDTO getUpkeepUser(String source) {
+        UserDTO userDTO;
+        if (source.equals("1")) {
+            // 自动情况下需要创建UserDTO
+            userDTO = new UserDTO();
+            RestMessage<List<BaseCommonDict>> autoGspConfig = commonClient.getDictBasicListByCodes("autoGspConfig", null);
+            if (null == autoGspConfig || CollUtil.isEmpty(autoGspConfig.getData())) {
+                throw new BizException("请配置自动养护字典项");
+            }
+            List<BaseCommonDict> dictList = autoGspConfig.getData();
+            userDTO.setId(dictList.stream().filter(x->x.getDictCode().equals("userId")).findFirst().orElse(null).getDictName());
+            userDTO.setNickname(dictList.stream().filter(x->x.getDictCode().equals("userName")).findFirst().orElse(null).getDictName());
+            userDTO.setEnterpriseId(dictList.stream().filter(x->x.getDictCode().equals("enterpriseId")).findFirst().orElse(null).getDictName());
+//            userDTO.setId(autoUserId);
+//            userDTO.setNickname(autoUserName);
+//            userDTO.setEnterpriseId(autoEnterpriseId);
+        } else {
+            userDTO = userTemplate.getUserDTO();
+        }
+        return userDTO;
+    }
+
+    public void batchAddDbPage(String source, UserDTO userDTO, BaseWmsWarehouseMst wmsWarehouseMst, List<GspUpkeepCheck> modelList, Integer upkeepType) {
+        int pageSize = 1000;
+        int size = modelList.size();
+        if (size < pageSize) {
+            batchAddDb(source, userDTO, wmsWarehouseMst, upkeepType, modelList);
+            return;
+        }
+        int pageNum = size % pageSize == 0 ? size / pageSize : size / pageSize + 1;
+        for (int i = 0; i < pageNum; i++) {
+            if (i != (pageNum - 1)) {
+                batchAddDb(source, userDTO, wmsWarehouseMst, upkeepType, modelList.subList(i * pageSize, i * pageSize + pageSize));
+            } else {
+                batchAddDb(source, userDTO, wmsWarehouseMst, upkeepType, modelList.subList(i * pageSize, size));
+            }
+        }
+    }
+
+    @Override
+    public void batchAddStockLockDb(List<WmsInvStockLot> wmsInvStockLots) {
+
+        UserDTO userDTO = this.getUpkeepUser("0");
+        String userId = userDTO.getId();
+        String userName = userDTO.getNickname();
+        Date date = new Date();
+        String enterpriseId = userDTO.getEnterpriseId();
+        Set<String> locids = new HashSet<>();
+        Set<String> itemids = new HashSet<>();
+        Set<String> warehouseIds = new HashSet<>();
+        for (WmsInvStockLot stockLot : wmsInvStockLots) {
+            locids.add(stockLot.getLocatorId());
+            itemids.add(stockLot.getItemId());
+            warehouseIds.add(stockLot.getWarehouseId());
+        }
+        Map<String, BaseWmsWarehouseMst> warehouseMstMap = new HashMap<>();
+        //批量查询仓信息
+        if (warehouseIds.size() > 0) {
+            warehouseMstMap = RestMsgHelper.unpack(warehouseClient.mapbyids(warehouseIds));
+        }
+        Map<String, WarehouseLocatorBasicInfo> locationMstMap = new HashMap<>();
+        //批量查询货位信息
+        if (locids.size() > 0) {
+            //获取货位信息
+            RestMessage<List<WarehouseLocatorBasicInfo>> locationBasicInfos = warehouseClient.getLocationBasicInfos(locids.toArray(new String[]{}));
+            if (!locationBasicInfos.isSuccess() || locationBasicInfos.getData() == null) {
+                throw new BizException("查询货位关联信息失败!请重试或联系管理员!");
+            }
+            for (WarehouseLocatorBasicInfo locinfo : locationBasicInfos.getData()) {
+                locationMstMap.put(locinfo.getWarehouseLocatorId(), locinfo);
+            }
+        }
+        Map<String, BaseMtlItemMst> litemMstMap = new HashMap<>();
+        //批量查询商品信息
+        if (itemids.size() > 0) {
+            RestMessage<List<BaseMtlItemMst>> itemResult = itemClient.getListByIds(itemids.toArray(new String[]{}));
+            if (!itemResult.isSuccess() || itemResult.getData() == null) {
+                throw new BizException("查询商品关联信息失败!请重试或联系管理员!");
+            }
+            for (BaseMtlItemMst iteminfo : itemResult.getData()) {
+                litemMstMap.put(iteminfo.getItemId(), iteminfo);
+            }
+        }
+        GspUpkeepCheckPlan plan = new GspUpkeepCheckPlan();
+        String planId = String.valueOf(SnowFlakeUtils.getId());
+        String code = "SDD" + planId.substring(planId.length() - 8);
+        plan.setId(planId);
+        plan.setCode(code);
+        plan.setCreator(userId);
+        plan.setCreatorName(userName);
+        plan.setGmtCreate(date);
+        plan.setModifier(userId);
+        plan.setModifierName(userName);
+        plan.setGmtModified(date);
+        plan.setDcId(warehouseMstMap.get(wmsInvStockLots.get(0).getWarehouseId()).getDcId());
+        plan.setEnterpriseId(enterpriseId);
+        plan.setWarehouseId(wmsInvStockLots.get(0).getWarehouseId());
+        //        plan.setBldgId(wmsInvStockLots.get(0).getBldgId());
+        plan.setStatus("4");
+        plan.setCargoOwnerId(wmsInvStockLots.get(0).getCargoOwnerId());
+        plan.setSource("1");//数据来源:0=手动 1=自动
+        plan.setPrintCount(0);
+        upkeepCheckPlanMapper.save(plan);
+        List<GspUpkeepCheck> gspUpkeepCheckList = new ArrayList<>();
+        for (WmsInvStockLot wmsInvStockLot : wmsInvStockLots) {
+            GspUpkeepCheck model = new GspUpkeepCheck();
+            String id = String.valueOf(SnowFlakeUtils.getId());
+            model.setId(id);
+            model.setCode("SDD" + id.substring(id.length() - 8));
+            model.setEnterpriseId(enterpriseId);
+            model.setPlanUpkeepDate(date);
+            model.setUpkeepDate(date);
+            model.setUpkeepType(6);
+            model.setPlanId(plan.getId());
+            model.setPlanCode(code);
+            model.setBatchId(wmsInvStockLot.getBatchId());
+            BaseWmsWarehouseMst baseWmsWarehouseMst = warehouseMstMap.get(wmsInvStockLot.getWarehouseId());
+            //获取仓信息
+            model.setDcId(baseWmsWarehouseMst.getDcId());
+            model.setWarehouseName(baseWmsWarehouseMst.getWarehouseName());
+            model.setWarehouseId(model.getWarehouseId());
+            model.setStockQty(model.getStockQty());
+            // 需要初始化养护数量(默认等于库存数量,解决空指针异常问题)
+            model.setUpkeepQty(model.getStockQty());
+            model.setPlanStockQty(model.getStockQty());
+            model.setCreator(userId);
+            model.setCreatorName(userName);
+            model.setGmtCreate(date);
+            model.setModifier(userId);
+            model.setModifierName(userName);
+            model.setGmtModified(date);
+            model.setStatus("4");
+            // 数据来源:0=手动 1=自动 - by Huanglh 2022-01-20
+            model.setSourceType("0");
+            model.setWarehouseId(wmsInvStockLot.getWarehouseId());
+            //获取商品资料
+            model.setUpkeepConclusion(0);
+            BaseMtlItemMst iteminfo = litemMstMap.get(wmsInvStockLot.getItemId());
+            model.setItemCode(iteminfo.getItemCode());
+            model.setItemId(wmsInvStockLot.getItemId());
+            model.setItemName(iteminfo.getItemName());
+            model.setCargoOwnerId(wmsInvStockLot.getCargoOwnerId());
+            model.setUpkeepQty(wmsInvStockLot.getQuantity().toString());
+            model.setStockQty(wmsInvStockLot.getQuantity().toString());
+            model.setLotNum(wmsInvStockLot.getBatchNum());
+            model.setUpkeepOperator(userDTO.getNickname());
+
+            //获取货位信息
+            WarehouseLocatorBasicInfo locatorBasicInfo = locationMstMap.get(wmsInvStockLot.getLocatorId());
+            model.setLocatorId(wmsInvStockLot.getLocatorId());
+            model.setLocatorCode(locatorBasicInfo.getWarehouseLocatorCode());
+            model.setLocatorName(locatorBasicInfo.getWarehouseLocatorName());
+            gspUpkeepCheckList.add(model);
+        }
+
+
+        mapper.saveBatch(gspUpkeepCheckList);
+    }
+
+    public void batchAddDb(String source, UserDTO userDTO, BaseWmsWarehouseMst wmsWarehouseMst, Integer upkeepType, List<GspUpkeepCheck> modelList) {
+        if (modelList == null || modelList.size() == 0) {
+            return;
+        }
+        String userId = userDTO.getId();
+        String userName = userDTO.getNickname();
+        String enterpriseId = userDTO.getEnterpriseId();
+        Date date = new Date();
+        GspUpkeepCheckPlan plan = new GspUpkeepCheckPlan();
+        String planId = String.valueOf(SnowFlakeUtils.getId());
+        String code = "YHD" + planId.substring(planId.length() - 8);
+        plan.setId(planId);
+        plan.setCode(code);
+        plan.setCreator(userId);
+        plan.setCreatorName(userName);
+        plan.setGmtCreate(date);
+        plan.setModifier(userId);
+        plan.setModifierName(userName);
+        plan.setGmtModified(date);
+        plan.setDcId(wmsWarehouseMst.getDcId());
+        plan.setEnterpriseId(enterpriseId);
+        plan.setWarehouseId(wmsWarehouseMst.getWarehouseId());
+        plan.setBldgId(modelList.get(0).getBldgId());
+        plan.setStatus("0");
+        plan.setCargoOwnerId(modelList.get(0).getCargoOwnerId());
+        plan.setSource(source);//数据来源:0=手动 1=自动
+        plan.setPrintCount(0);
+        plan.setIsProtected(modelList.get(0).getIsProtected());
+        if (plan.getIsProtected() == null && upkeepType != null) {
+            if (upkeepType < 6) {
+                plan.setIsProtected(1);
+            } else {
+                plan.setIsProtected(0);
+            }
+        }
+        plan.setUpkeepType(upkeepType);
+        upkeepCheckPlanMapper.save(plan);
+        for (int i = 0; i < modelList.size(); i++) {
+            GspUpkeepCheck model = modelList.get(i);
+            String id = String.valueOf(SnowFlakeUtils.getId());
+            model.setContainerCode(model.getContainerCode());
+            model.setId(id);
+            model.setCode("YHD" + id.substring(id.length() - 8));
+            model.setPlanId(planId);
+            model.setPlanCode(code);
+            model.setEnterpriseId(enterpriseId);
+            model.setPlanUpkeepDate(date);
+            model.setUpkeepDate(date);
+            //客户要求,没有的分类大类先划到其他里面
+            if (upkeepType != null) {
+                model.setUpkeepType(upkeepType);
+            } else {
+                if ("1".equals(model.getIsProtected())) {
+                    if (model.getUpkeepType() == null || model.getUpkeepType() > 5) {
+                        model.setUpkeepType(3);
+                    }
+                } else {
+                    if (model.getUpkeepType() == null || model.getUpkeepType() <= 5) {
+                        model.setUpkeepType(6);
+                    }
+                }
+            }
+            model.setDcId(wmsWarehouseMst.getDcId());
+            model.setWarehouseId(model.getWarehouseId());
+            model.setStockQty(model.getStockQty());
+            // 需要初始化养护数量(默认等于库存数量,解决空指针异常问题)
+            model.setUpkeepQty(model.getStockQty());
+            model.setPlanStockQty(model.getStockQty());
+            model.setCreator(userId);
+            model.setCreatorName(userName);
+            model.setGmtCreate(date);
+            model.setModifier(userId);
+            model.setModifierName(userName);
+            model.setGmtModified(date);
+            model.setStatus("0");
+            model.setUpkeepConclusion(0);
+            // 数据来源:0=手动 1=自动 - by Huanglh 2022-01-20
+            model.setSourceType(source);
+            mapper.save(model);
+        }
+        //pushDevice(sendDeviceId, modelList);
+    }
+
+    private void pushDevice(String interfaceId, List<GspUpkeepCheck> modelList) {
+        String[] locatorIdList = modelList.stream().map(GspUpkeepCheck::getLocatorId).toArray(String[]::new);
+        RestMessage<List<WarehouseLocatorBasicInfo>> locationBasicInfos = warehouseClient.getLocationBasicInfos(locatorIdList);
+        if (!locationBasicInfos.isSuccess() || locationBasicInfos.getData() == null) {
+            throw new BizException("查询货位关联信息失败!请重试或联系管理员!");
+        } else {
+            Set<String> set = locationBasicInfos.getData().stream().filter(t -> "Device".equals(t.getPickMode())).map(WarehouseLocatorBasicInfo::getWarehouseLocatorId).collect(Collectors.toSet());
+            List<GspUpkeepCheck> deviceList = modelList.stream().filter(t -> set.contains(t.getLocatorId())).collect(Collectors.toList());
+            logger.info("WmsReplenishH replenishH deviceList:" + JSONObject.toJSONString(deviceList));
+            if (deviceList != null && deviceList.size() > 0) {
+                askIntegration(interfaceId, deviceList);
+            }
+        }
+    }
+
+    private Integer parseUpKeepType(String upKeepType) {
+        if (StringUtils.isBlank(upKeepType)) {
+            return null;
+        }
+        switch (upKeepType) {
+//            case "GSP_YH_ZD_YaoPin_TeShu":
+//                return 1;
+//            case "GSP_YH_ZD_YaoPin_ZhuanGuan":
+//                return 2;
+//            case "GSP_YH_ZD_YaoPin_QiTa":
+//                return 3;
+//            case "GSP_YH_ZD_QiXie":
+//                return 4;
+//            case "GSP_YH_ZD_No_YaoPin":
+//                return 5;
+            case "GSP_YH_YaoPin":
+                return 6;
+            case "GSP_YH_QiXie":
+                return 7;
+            case "GSP_YH_No_YaoPin":
+                return 8;
+            default:
+                return 6;
+        }
+    }
+
+    private Integer parseUpKeepTypeVip(String upKeepType) {
+        if (StringUtils.isBlank(upKeepType)) {
+            return null;
+        }
+        switch (upKeepType) {
+            case "GSP_YH_ZD_YaoPin_TeShu":
+                return 1;
+            case "GSP_YH_ZD_YaoPin_ZhuanGuan":
+                return 2;
+            case "GSP_YH_ZD_YaoPin_QiTa":
+                return 3;
+            case "GSP_YH_ZD_QiXie":
+                return 4;
+            case "GSP_YH_ZD_No_YaoPin":
+                return 5;
+//            case "GSP_YH_YaoPin":
+//                return 6;
+//            case "GSP_YH_QiXie":
+//                return 7;
+//            case "GSP_YH_No_YaoPin":
+//                return 8;
+            default:
+                return 3;
+        }
+    }
+
+    @Override
+    public Page<GspUpkeepCheckVO> listPage(String warehouseId, String cargoOwnerId, String status, String billtype, Integer pageSize, Integer pageNum) {
+        UserDTO userDTO = userTemplate.getUserDTO();
+        String enterpriseId = userDTO.getEnterpriseId();
+        if ("-1".equals(warehouseId) && "-1".equals(cargoOwnerId)) {//手动执行定时任务,待优化
+            autoUpKeepTask.autoUpKeepTask(null,null,null);
+        }
+        Restriction r5 = null;
+        if (!StringUtils.isBlank(billtype)) {
+            r5 = Restrictions.like("code", billtype + "%");
+        }
+        PageHelper.startPage(pageNum, pageSize);
+        Criteria crt = Criteria.forClass(GspUpkeepCheck.class);
+        Restriction r1 = Restrictions.eq("enterpriseId", enterpriseId);
+        Restriction r2 = Restrictions.eq("warehouseId", warehouseId);
+        Restriction r3 = StringUtils.isEmpty(cargoOwnerId) ? null : Restrictions.eq("cargoOwnerId", cargoOwnerId);
+        Restriction r4 = Restrictions.eq("status", status);
+        crt.setOrder(Order.newInstance().asc("gmtCreate"));
+        crt.setRestriction(Restrictions.and(r1, r2, r3, r4, r5));
+        List<GspUpkeepCheck> list = mapper.findByCriteria(crt);
+        Page<GspUpkeepCheck> page = PageUtils.getPage(list);
+        Page<GspUpkeepCheckVO> pageResult = new Page<>();
+        BeanUtil.copyProperties(page, pageResult);
+        List<GspUpkeepCheckVO> result = spellGspUpkeepCheckVOS(list);
+        pageResult.setList(result);
+        return pageResult;
+        //return PageUtils.getPage(spellGspUpkeepCheckVOS(list));
+    }
+
+    @Override
+    public Page<GspUpkeepCheckVO> findUpkeepPage(QueryDTO dto) {
+        dto.initialPageWhenValueIsNull(userTemplate.getUserDTO());
+        PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
+        List<GspUpkeepCheck> list = getGspUpkeepChecks(dto);
+        if (CollUtil.isEmpty(list)) {
+            return PageUtils.getPage(Collections.emptyList());
+        }
+        Page<GspUpkeepCheck> page = PageUtils.getPage(list);
+        Page<GspUpkeepCheckVO> pageResult = new Page<>();
+        BeanUtil.copyProperties(page, pageResult);
+        List<GspUpkeepCheckVO> result = spellGspUpkeepCheckVOS(list);
+        pack4FindUpkeepPage(result);
+        pageResult.setList(result);
+        return pageResult;
+    }
+
+    private void pack4FindUpkeepPage(List<GspUpkeepCheckVO> result) {
+        List<WmsInvStockQtyQueryVO> qtyQueries = new ArrayList<>();
+        for (int i = 0; i < result.size(); i++) {
+            WmsInvStockQtyQueryVO wmsInvStockQtyQueryVO = new WmsInvStockQtyQueryVO();
+            BeanUtils.copyProperties(result.get(i), wmsInvStockQtyQueryVO);
+            wmsInvStockQtyQueryVO.setStatus("1");
+            wmsInvStockQtyQueryVO.setEnterpriseId(userTemplate.getUserDTO().getEnterpriseId());
+            qtyQueries.add(wmsInvStockQtyQueryVO);
+        }
+        RestMessage<List<WmsInvStockQtyVO>> restRet = inventoryClient.getAvailableQuantityList(qtyQueries);
+        if (restRet != null && restRet.isSuccess() && restRet.getData() != null && restRet.getData().size() == result.size()) {
+            for (int i = 0; i < result.size(); i++) {
+                GspUpkeepCheckVO gspUpkeepCheckVO = result.get(i);
+                WmsInvStockQtyVO wmsInvStockQtyVO = restRet.getData().stream().filter(x -> x.getBatchId().equals(gspUpkeepCheckVO.getBatchId()) && x.getLocatorId().equals(gspUpkeepCheckVO.getLocatorId())).findFirst().orElse(null);
+                if(wmsInvStockQtyVO!=null){
+                    String stockQty = wmsInvStockQtyVO.getAvailableQuantity().toString();
+                    gspUpkeepCheckVO.setStockQty(stockQty);
+                    gspUpkeepCheckVO.setUpkeepQty(stockQty);
+                }
+//                String stockQty = restRet.getData().get(i).getAvailableQuantity().toString();
+//                result.get(i).setStockQty(stockQty);
+//                result.get(i).setUpkeepQty(stockQty);
+            }
+        }
+    }
+
+
+    private List<GspUpkeepCheck> getGspUpkeepChecks(QueryDTO upkeepCheckDTO) {
+        Criteria crt = Criteria.forClass(GspUpkeepCheck.class);
+        Restriction r1 = Restrictions.eq("planId", upkeepCheckDTO.getId());
+        String upkeepType = upkeepCheckDTO.getUpkeepType();
+        Restriction r2 = StringUtils.isEmpty(upkeepType) ? null : Restrictions.eq("upkeepType", upkeepType);
+        Restriction r3 = Restrictions.eq("status", 0);
+        String itemHealthCategory = upkeepCheckDTO.getItemHealthCategory();
+        Restriction r4 = StringUtils.isEmpty(itemHealthCategory) ? null : Restrictions.eq("itemHealthCategory", itemHealthCategory);
+        String itemId = upkeepCheckDTO.getItemId();
+        Restriction r5 = StringUtils.isEmpty(itemId) ? null : Restrictions.eq("itemId", itemId);
+        crt.setOrder(Order.newInstance().asc("storeTemperature","locatorCode", "itemCode", "lotNum"));
+        crt.setRestriction(Restrictions.and(r1, r2, r3, r4, r5));
+        return mapper.findByCriteria(crt);
+    }
+
+    @Override
+    public List<GspUpkeepCheckVO> spellGspUpkeepCheckVOSPage(List<GspUpkeepCheck> list) {
+        if (list == null) {
+            return null;
+        }
+        int pageSize = 1000;
+        int size = list.size();
+        if (size < pageSize) {
+            return spellGspUpkeepCheckVOS(list);
+        }
+        int pageNum = size % pageSize == 0 ? size / pageSize : size / pageSize + 1;
+        List<GspUpkeepCheckVO> retList = new ArrayList<>();
+        for (int i = 0; i < pageNum; i++) {
+            if (i != (pageNum - 1)) {
+                retList.addAll(spellGspUpkeepCheckVOS(list.subList(i * pageSize, i * pageSize + pageSize)));
+            } else {
+                retList.addAll(spellGspUpkeepCheckVOS(list.subList(i * pageSize, size)));
+            }
+        }
+        return retList;
+    }
+
+    public List<GspUpkeepCheckVO> spellGspUpkeepCheckVOS(List<GspUpkeepCheck> list) {
+        if (CollUtil.isEmpty(list)) {
+            return Collections.emptyList();
+        }
+        String[] itemIds = list.stream().map(GspUpkeepCheck::getItemId).distinct().toArray(String[]::new);
+        //请求商品信息
+        RestMessage<List<BaseMtlItemMst>> itemResult = itemClient.getListByIds(itemIds);
+        //组合id
+        String[] locatorIds = list.stream().map(GspUpkeepCheck::getLocatorId).distinct().toArray(String[]::new);
+        //请求仓库信息,超长已经设置长度
+        RestMessage<List<WarehouseLocatorBasicInfo>> warehouseResult = warehouseClient.getLocationBasicInfos(locatorIds);
+        //组合id,转换并组装
+        String[] cargoOwnerIds = list.stream().map(GspUpkeepCheck::getCargoOwnerId).distinct().toArray(String[]::new);
+        //请求货位信息
+        RestMessage<Map<String, BaseCargoOwnerMst>> cargoOwnerResult = chainClient.getCargoOwnerMstByIds(cargoOwnerIds);
+        List<GspUpkeepCheckVO> listRet = new ArrayList<>();
+        for (GspUpkeepCheck gspUpkeepCheckD : list) {
+            GspUpkeepCheckVO gspUpkeepCheckVO = new GspUpkeepCheckVO();
+            BeanUtils.copyProperties(gspUpkeepCheckD, gspUpkeepCheckVO);
+            gspUpkeepCheckVO.setInContainerCode(gspUpkeepCheckD.getContainerCode());
+            gspUpkeepCheckVO.setPendingQty(gspUpkeepCheckD.getPendingQty() == null?"0":gspUpkeepCheckD.getPendingQty().toString());
+            gspUpkeepCheckVO.setRemark("检查外观,包装等质量状况。");
+            List<BaseMtlItemMst> resultData = itemResult.getData();
+            if (itemResult.isSuccess() && resultData != null) {
+                if (CollUtil.isNotEmpty(warehouseResult.getData())) {
+                    Optional<WarehouseLocatorBasicInfo> optional = warehouseResult.getData().stream().filter(y -> y.getWarehouseLocatorId().equals(gspUpkeepCheckD.getLocatorId())).findFirst();
+                    if (optional.isPresent()) {
+                        WarehouseLocatorBasicInfo locatorBasicInfo = optional.get();
+                        gspUpkeepCheckVO.setWarehouseName(locatorBasicInfo.getWarehouseName());
+                        gspUpkeepCheckVO.setLocatorCode(locatorBasicInfo.getWarehouseLocatorCode());
+                        gspUpkeepCheckVO.setLocatorName(locatorBasicInfo.getWarehouseLocatorName());
+                        gspUpkeepCheckVO.setWhWarehouseLocatorType(locatorBasicInfo.getWarehouseLocatorType());
+                        gspUpkeepCheckVO.setBldgName(locatorBasicInfo.getBldgName());
+                        gspUpkeepCheckVO.setOutWhAreaCategory(locatorBasicInfo.getWarehouseAreaCategory());
+                        gspUpkeepCheckVO.setOutWhAreaCategoryName(locatorBasicInfo.getWarehouseAreaCategoryName());
+                        gspUpkeepCheckVO.setWarehouseRoomName(locatorBasicInfo.getWarehouseRoomName());
+                        gspUpkeepCheckVO.setWarehouseAreaCategory(locatorBasicInfo.getWarehouseAreaCategory());
+                        gspUpkeepCheckVO.setWarehouseAreaName(locatorBasicInfo.getWarehouseAreaName());
+                    }
+                }
+                BaseMtlItemMst itemBaseInfoVO = resultData.stream().filter(item -> item.getItemId().equals(gspUpkeepCheckD.getItemId())).findFirst().orElse(null);
+                if (itemBaseInfoVO != null) {
+                    gspUpkeepCheckVO.setItemName(itemBaseInfoVO.getItemName());
+                    gspUpkeepCheckVO.setManufacturerName(itemBaseInfoVO.getManufacturerId());
+                    gspUpkeepCheckVO.setSpecification(itemBaseInfoVO.getSpecification());
+                    gspUpkeepCheckVO.setCaseUom(itemBaseInfoVO.getCaseUom());
+                    gspUpkeepCheckVO.setCaseConversionRate(itemBaseInfoVO.getCaseConversionRate());
+                    gspUpkeepCheckVO.setCountryOriginName(itemBaseInfoVO.getCountryOriginId());
+                    String upkeepQty = gspUpkeepCheckVO.getUpkeepQty();
+                    if ("0".equals(gspUpkeepCheckVO.getWhWarehouseLocatorType())) {
+                        gspUpkeepCheckVO.setCaseQuantity(new BigDecimal(upkeepQty).divide(itemBaseInfoVO.getCaseConversionRate(), RoundingMode.HALF_UP));
+                        gspUpkeepCheckVO.setOddPieceQuantity(BigDecimal.ZERO);
+                    } else {
+                        gspUpkeepCheckVO.setCaseQuantity(BigDecimal.ZERO);
+                        if (!StringUtils.isBlank(upkeepQty)) {
+                            gspUpkeepCheckVO.setOddPieceQuantity(new BigDecimal(upkeepQty));
+                        }
+                    }
+                    BaseMtlItemHealth baseMtlItemHealth = itemBaseInfoVO.getBaseMtlItemHealth();
+                    if (baseMtlItemHealth != null) {
+                        gspUpkeepCheckVO.setItemHealthCategoryName(baseMtlItemHealth.getItemHealthCategoryName());
+                        gspUpkeepCheckVO.setItemHealthApprovalNbr(baseMtlItemHealth.getItemHealthApprovalNbr());
+                        gspUpkeepCheckVO.setItemHealthListedLicensor(baseMtlItemHealth.getItemHealthListedLicensor());
+                        gspUpkeepCheckVO.setItemHealthApprovalNbr(baseMtlItemHealth.getItemHealthApprovalNbr());
+                        gspUpkeepCheckVO.setItemHealthRegisterNbr(baseMtlItemHealth.getItemHealthRegisterNbr());
+
+                    }
+                }
+            }
+            String cargoOwnerId = gspUpkeepCheckD.getCargoOwnerId();
+            if (cargoOwnerResult != null && cargoOwnerResult.getData() != null && cargoOwnerResult.getData().get(cargoOwnerId) != null) {
+                gspUpkeepCheckVO.setCargoOwnerName(cargoOwnerResult.getData().get(cargoOwnerId).getCargoOwnerName());
+            }
+            listRet.add(gspUpkeepCheckVO);
+        }
+        return listRet;
+    }
+
+    @Override
+    public List<GspUpkeepCheckVO> findUpkeepItem4MovePick(String id) {
+        Criteria crtD = Criteria.forClass(GspUpkeepCheck.class);
+        Restriction r11 = Restrictions.eq("planId", id);
+        Restriction r22 = Restrictions.in("conclusion", new String[]{"2","3"});//不合格,退货库
+        crtD.setOrder(Order.newInstance().asc("gmtCreate"));
+        crtD.setRestriction(Restrictions.and(r11, r22));
+        List<GspUpkeepCheck> list = mapper.findByCriteria(crtD);
+        List<GspUpkeepCheckVO> gspUpkeepCheckVOS = spellGspUpkeepCheckVOS1(list);
+        String[] batchIds = list.stream().map(GspUpkeepCheck::getBatchId).distinct().toArray(String[]::new);
+        RestMessage<List<BatchNumberListVO>> upKeepDictResult = inventoryClient.getBatchNumberBasicInfo(batchIds);
+        for (int i = 0; i < gspUpkeepCheckVOS.size(); i++) {
+            GspUpkeepCheckVO gspUpkeepCheckVO = gspUpkeepCheckVOS.get(i);
+            gspUpkeepCheckVO.setGspBillId(gspUpkeepCheckVO.getPlanId());
+            gspUpkeepCheckVO.setGspBillNo(gspUpkeepCheckVO.getPlanCode());
+            gspUpkeepCheckVO.setGspLineId(gspUpkeepCheckVO.getId());
+            if (upKeepDictResult != null && upKeepDictResult.isSuccess() && upKeepDictResult.getData() != null) {
+                List<BatchNumberListVO> data = upKeepDictResult.getData();
+                for (int j = 0; j < data.size(); j++) {
+                    BatchNumberListVO batchNumberListVO = data.get(j);
+                    if (batchNumberListVO.getBatchId().equals(gspUpkeepCheckVO.getBatchId())) {
+                        gspUpkeepCheckVO.setProductionDate(batchNumberListVO.getBatchProductionDate());
+                        gspUpkeepCheckVO.setExpiredDate(batchNumberListVO.getBatchExpiredDate());
+                        gspUpkeepCheckVO.setShowProductionDate(batchNumberListVO.getBatchProductionDateShow());
+                        gspUpkeepCheckVO.setShowExpiredDate(batchNumberListVO.getBatchExpiredDateShow());
+                    }
+                }
+            }
+            BigDecimal[] bigDecimals = new BigDecimal(gspUpkeepCheckVO.getPendingQty()).divideAndRemainder(gspUpkeepCheckVO.getCaseConversionRate());
+            gspUpkeepCheckVO.setCaseQuantity(bigDecimals[0]);
+            gspUpkeepCheckVO.setOddPieceQuantity(bigDecimals[1]);
+            if(gspUpkeepCheckVO.getConclusion().equals("3")){
+                gspUpkeepCheckVO.setInWhAreaCategory("THK");
+                gspUpkeepCheckVO.setInWhAreaCategoryName("退货库");
+                gspUpkeepCheckVO.setInStockStatus("4");
+                gspUpkeepCheckVO.setOutStockStatus("1");
+                gspUpkeepCheckVO.setOutLocatorId(gspUpkeepCheckVO.getLocatorId());
+                gspUpkeepCheckVO.setOutLocatorName(gspUpkeepCheckVO.getLocatorName());
+            }else if(gspUpkeepCheckVO.getConclusion().equals("2")){
+                gspUpkeepCheckVO.setInWhAreaCategory("NHK");
+                gspUpkeepCheckVO.setInWhAreaCategoryName("不合格库");
+                gspUpkeepCheckVO.setInStockStatus("2");
+                gspUpkeepCheckVO.setOutStockStatus("1");
+                gspUpkeepCheckVO.setOutLocatorId(gspUpkeepCheckVO.getLocatorId());
+                gspUpkeepCheckVO.setOutLocatorName(gspUpkeepCheckVO.getLocatorName());
+            }else {
+                throw new BizException("当前复核状态为合格,不可移库!");
+            }
+
+        }
+        return gspUpkeepCheckVOS;
+    }
+
+    public List<GspUpkeepCheckVO> spellGspUpkeepCheckVOS1(List<GspUpkeepCheck> list) {
+        if (CollUtil.isEmpty(list)) {
+            return Collections.emptyList();
+        }
+        String[] itemIds = list.stream().map(GspUpkeepCheck::getItemId).distinct().toArray(String[]::new);
+        //请求商品信息
+        RestMessage<List<BaseMtlItemMst>> itemResult = itemClient.getListByIds(itemIds);
+        //组合id
+        String[] locatorIds = list.stream().map(GspUpkeepCheck::getLocatorId).distinct().toArray(String[]::new);
+        //请求仓库信息,超长已经设置长度
+        RestMessage<List<WarehouseLocatorBasicInfo>> warehouseResult = warehouseClient.getLocationBasicInfos(locatorIds);
+        //组合id,转换并组装
+        String[] cargoOwnerIds = list.stream().map(GspUpkeepCheck::getCargoOwnerId).distinct().toArray(String[]::new);
+        //请求货位信息
+        RestMessage<Map<String, BaseCargoOwnerMst>> cargoOwnerResult = chainClient.getCargoOwnerMstByIds(cargoOwnerIds);
+        List<GspUpkeepCheckVO> listRet = new ArrayList<>();
+        for (GspUpkeepCheck gspUpkeepCheckD : list) {
+            GspUpkeepCheckVO gspUpkeepCheckVO = new GspUpkeepCheckVO();
+            BeanUtils.copyProperties(gspUpkeepCheckD, gspUpkeepCheckVO);
+            gspUpkeepCheckVO.setOutContainerCode(gspUpkeepCheckD.getContainerCode());
+            if (StrUtil.isNotBlank(gspUpkeepCheckD.getLocationNo())){
+                gspUpkeepCheckVO.setOutContainerCode(gspUpkeepCheckD.getLocationNo());
+                gspUpkeepCheckVO.setOutGoodsCaseCode(gspUpkeepCheckD.getLocationNo());
+            }
+            gspUpkeepCheckVO.setConclusion(gspUpkeepCheckD.getConclusion().toString());
+            gspUpkeepCheckVO.setUpkeepConclusion(gspUpkeepCheckD.getUpkeepConclusion().toString());
+            if(gspUpkeepCheckD.getCheckConclusion()!=null){
+                gspUpkeepCheckVO.setCheckConclusion(gspUpkeepCheckD.getCheckConclusion().toString());
+            }
+            if(gspUpkeepCheckD.getRecheckConclusion()!=null){
+                gspUpkeepCheckVO.setRecheckConclusion(gspUpkeepCheckD.getRecheckConclusion().toString());
+            }
+//            gspUpkeepCheckVO.setInContainerCode(gspUpkeepCheckD.getContainerCode());
+            gspUpkeepCheckVO.setPendingQty(gspUpkeepCheckD.getPendingQty().toString());
+            List<BaseMtlItemMst> resultData = itemResult.getData();
+            if (itemResult.isSuccess() && resultData != null) {
+                if (CollUtil.isNotEmpty(warehouseResult.getData())) {
+                    Optional<WarehouseLocatorBasicInfo> optional = warehouseResult.getData().stream().filter(y -> y.getWarehouseLocatorId().equals(gspUpkeepCheckD.getLocatorId())).findFirst();
+                    if (optional.isPresent()) {
+                        WarehouseLocatorBasicInfo locatorBasicInfo = optional.get();
+                        gspUpkeepCheckVO.setWarehouseName(locatorBasicInfo.getWarehouseName());
+                        gspUpkeepCheckVO.setLocatorName(locatorBasicInfo.getWarehouseLocatorName());
+                        gspUpkeepCheckVO.setWhWarehouseLocatorType(locatorBasicInfo.getWarehouseLocatorType());
+                        gspUpkeepCheckVO.setBldgName(locatorBasicInfo.getBldgName());
+                        gspUpkeepCheckVO.setOutWhAreaCategory(locatorBasicInfo.getWarehouseAreaCategory());
+                        gspUpkeepCheckVO.setOutWhAreaCategoryName(locatorBasicInfo.getWarehouseAreaCategoryName());
+                        gspUpkeepCheckVO.setWarehouseRoomName(locatorBasicInfo.getWarehouseRoomName());
+                        gspUpkeepCheckVO.setWarehouseAreaCategory(locatorBasicInfo.getWarehouseAreaCategory());
+                        gspUpkeepCheckVO.setWarehouseAreaName(locatorBasicInfo.getWarehouseAreaName());
+                    }
+                }
+                BaseMtlItemMst itemBaseInfoVO = resultData.stream().filter(item -> item.getItemId().equals(gspUpkeepCheckD.getItemId())).findFirst().orElse(null);
+                if (itemBaseInfoVO != null) {
+                    gspUpkeepCheckVO.setItemName(itemBaseInfoVO.getItemName());
+                    gspUpkeepCheckVO.setManufacturerName(itemBaseInfoVO.getManufacturerId());
+                    gspUpkeepCheckVO.setSpecification(itemBaseInfoVO.getSpecification());
+                    gspUpkeepCheckVO.setCaseUom(itemBaseInfoVO.getCaseUom());
+                    gspUpkeepCheckVO.setCaseConversionRate(itemBaseInfoVO.getCaseConversionRate());
+                    gspUpkeepCheckVO.setCountryOriginName(itemBaseInfoVO.getCountryOriginId());
+                    String upkeepQty = gspUpkeepCheckVO.getUpkeepQty();
+                    String pendingQty = gspUpkeepCheckVO.getPendingQty();
+                    if ("0".equals(gspUpkeepCheckVO.getWhWarehouseLocatorType())) {
+                        if(StringUtils.isEmpty(pendingQty)){
+                            gspUpkeepCheckVO.setCaseQuantity(new BigDecimal(upkeepQty).divide(itemBaseInfoVO.getCaseConversionRate(), RoundingMode.HALF_UP));
+                            gspUpkeepCheckVO.setOddPieceQuantity(BigDecimal.ZERO);
+                            gspUpkeepCheckVO.setQuantity(new BigDecimal(upkeepQty));
+                        }else{
+                            gspUpkeepCheckVO.setCaseQuantity(new BigDecimal(pendingQty).divide(itemBaseInfoVO.getCaseConversionRate(), RoundingMode.HALF_UP));
+                            gspUpkeepCheckVO.setOddPieceQuantity(BigDecimal.ZERO);
+                            gspUpkeepCheckVO.setUpkeepQty(pendingQty);
+                            gspUpkeepCheckVO.setQuantity(new BigDecimal(pendingQty));
+                        }
+                    } else {
+                        gspUpkeepCheckVO.setCaseQuantity(BigDecimal.ZERO);
+                        if (!StringUtils.isBlank(upkeepQty)) {
+                            gspUpkeepCheckVO.setOddPieceQuantity(new BigDecimal(upkeepQty));
+                            gspUpkeepCheckVO.setQuantity(new BigDecimal(upkeepQty));
+                        }
+                        if (!StringUtils.isBlank(pendingQty)) {
+                            gspUpkeepCheckVO.setOddPieceQuantity(new BigDecimal(pendingQty));
+                            gspUpkeepCheckVO.setUpkeepQty(pendingQty);
+                            gspUpkeepCheckVO.setQuantity(new BigDecimal(pendingQty));
+                        }
+                    }
+                    BaseMtlItemHealth baseMtlItemHealth = itemBaseInfoVO.getBaseMtlItemHealth();
+                    if (baseMtlItemHealth != null) {
+                        gspUpkeepCheckVO.setItemHealthCategoryName(baseMtlItemHealth.getItemHealthCategoryName());
+                        gspUpkeepCheckVO.setItemHealthApprovalNbr(baseMtlItemHealth.getItemHealthApprovalNbr());
+                        gspUpkeepCheckVO.setItemHealthListedLicensor(baseMtlItemHealth.getItemHealthListedLicensor());
+                        gspUpkeepCheckVO.setItemHealthApprovalNbr(baseMtlItemHealth.getItemHealthApprovalNbr());
+                        gspUpkeepCheckVO.setItemHealthRegisterNbr(baseMtlItemHealth.getItemHealthRegisterNbr());
+                    }
+                }
+            }
+            String cargoOwnerId = gspUpkeepCheckD.getCargoOwnerId();
+            if (cargoOwnerResult != null && cargoOwnerResult.getData() != null && cargoOwnerResult.getData().get(cargoOwnerId) != null) {
+                gspUpkeepCheckVO.setCargoOwnerName(cargoOwnerResult.getData().get(cargoOwnerId).getCargoOwnerName());
+            }
+            listRet.add(gspUpkeepCheckVO);
+        }
+        return listRet;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    @TxTransaction(isStart = true)
+    public String[] batchEdit(List<GspUpkeepCheck> gspUpkeepCheckList, boolean isCheck) {
+        String[] ids = gspUpkeepCheckList.stream().map(GspUpkeepCheck::getId).toArray(String[]::new);
+        Assert.notEmpty(ids, "主键ID不能为空");
+        List<GspUpkeepCheck> checks = mapper.findByIds(GspUpkeepCheck.class, ids, null);
+        Assert.notEmpty(checks, "获取数据失败,请刷新页面");
+        Map<String, List<GspUpkeepCheck>> checksMap = checks.stream().collect(Collectors.groupingBy(GspUpkeepCheck::getId));
+        Map<String, List<GspUpkeepCheck>> paramMap = gspUpkeepCheckList.stream().collect(Collectors.groupingBy(GspUpkeepCheck::getId));
+        // 数据填充
+        dataFilling(gspUpkeepCheckList, checks, paramMap, checksMap);
+        UserDTO userDTO = userTemplate.getUserDTO();
+        String userId = "EIS";
+        String userName = "EIS";
+        if (null != userDTO){
+            userId = userDTO.getId();
+            userName = userDTO.getNickname();
+        }
+        Date date = new Date();
+//        List<GspUpkeepCheck> toOMSList = new ArrayList<>();
+        List<GspUpkeepCheck> lockList = new ArrayList<>();
+        List<GspUpkeepCheck> cancelLockList = new ArrayList<>();
+        List<GspUpkeepCheck> toEisList = new ArrayList<>();
+        //查询货位信息,得到库别 库区
+        String[] locatorIdList = gspUpkeepCheckList.stream().map(GspUpkeepCheck::getLocatorId).toArray(String[]::new);
+        RestMessage<List<WarehouseLocatorBasicInfo>> locationBasicInfos = warehouseClient.getLocationBasicInfos(locatorIdList);
+        if (!locationBasicInfos.isSuccess() || locationBasicInfos.getData() == null) {
+            throw new BizException("查询货位关联信息失败!请重试或联系管理员!");
+        }
+        List<WarehouseLocatorBasicInfo>  warehouselocators = locationBasicInfos.getData();
+        // 校验托盘是否出库    MJK,AGVZ 支持不发送设备指令
+        checkIsConclusioned(checks, warehouselocators);
+        for (int i = 0; i < gspUpkeepCheckList.size(); i++) {
+            GspUpkeepCheck gspUpkeepCheck = gspUpkeepCheckList.get(i);
+            if (ObjectUtil.isEmpty(gspUpkeepCheck.getEnterpriseId())) gspUpkeepCheck.setEnterpriseId(userDTO.getEnterpriseId());
+            GspUpkeepCheck gspData = checks.stream().filter(check -> check.getId().equals(gspUpkeepCheck.getId())).findFirst().orElse(null);
+            if (null == gspData) {
+                throw new BizException("根据ID【" + gspUpkeepCheck.getId() + "】没有查询到养护记录!");
+            }
+            gspUpkeepCheck.setOutboundInstruct(gspData.getOutboundInstruct());
+
+            String stockQty = gspUpkeepCheck.getStockQty();
+            String upkeepQty = gspUpkeepCheck.getUpkeepQty();
+            if ((StringUtils.isBlank(stockQty) || StringUtils.isBlank(upkeepQty)) || (new BigDecimal(stockQty)).compareTo(new BigDecimal(upkeepQty)) < 0) {
+                throw new BizException("养护数量不能大于库存数量:第" + (i + 1) + "行");
+            }
+            gspUpkeepCheck.setModifier(userId);
+            gspUpkeepCheck.setModifierName(userName);
+            gspUpkeepCheck.setGmtModified(date);
+            if (!isCheck) {
+                Integer upkeepConclusion = gspUpkeepCheck.getUpkeepConclusion();
+                if (upkeepConclusion != null) {
+                    if (0 == upkeepConclusion) {
+                        if(gspUpkeepCheck.getPendingQty()==null||gspUpkeepCheck.getPendingQty().compareTo(BigDecimal.ZERO)==0){
+                            throw new BizException("养护结论待处理,待处理数量不能为0");
+                        }
+                        gspUpkeepCheck.setStatus("4");
+                    } else {
+                        if(gspUpkeepCheck.getPendingQty()==null||gspUpkeepCheck.getPendingQty().compareTo(BigDecimal.ZERO)>0){
+                            throw new BizException("养护结论合格,待处理数量不能大于0");
+                        }
+                        gspUpkeepCheck.setConclusion(upkeepConclusion);
+                        gspUpkeepCheck.setStatus("1");
+//                        toOMSList.add(gspUpkeepCheck);
+                    }
+                    if (1 != upkeepConclusion) {
+                        lockList.add(gspUpkeepCheck);
+                    }
+                    gspUpkeepCheck.setUpkeepOperator(userName);
+                    gspUpkeepCheck.setUpkeepDate(date);
+                }
+            } else {
+                //审核状态:0初始,1-正常无需质检,2-质检,3-质检无需复检,4-复检,5-复检完成,6-复检不合格待移库,7-发起移库完成,B -库存状态ERP审核驳回
+                Integer checkConclusion = gspUpkeepCheck.getCheckConclusion();
+                Integer recheckConclusion = gspUpkeepCheck.getRecheckConclusion();
+
+                if (recheckConclusion == null) {// 判断是否复检
+                    if ( null == checkConclusion || 0 == checkConclusion) {
+                        gspUpkeepCheck.setStatus("4");
+                    } else {
+                        gspUpkeepCheck.setStatus("4");
+                        gspUpkeepCheck.setConclusion(checkConclusion);
+//                        toOMSList.add(gspUpkeepCheck);
+                    }
+                    gspUpkeepCheck.setCheckOperator(userName);
+                    gspUpkeepCheck.setCheckDate(date);
+
+                } else {
+                    gspUpkeepCheck.setStatus("5");
+                    gspUpkeepCheck.setConclusion(recheckConclusion);
+//                    toOMSList.add(gspUpkeepCheck);
+                    gspUpkeepCheck.setRecheckOperator(userName);
+                    gspUpkeepCheck.setRecheckDate(date);
+                }
+                if ((recheckConclusion != null&& 1 == recheckConclusion) || (checkConclusion != null && 1 == checkConclusion)) {
+                    cancelLockList.add(gspUpkeepCheck);
+                }
+            }
+            boolean isAdd = false;
+            for (int j = 0; j < i; j++) {
+                GspUpkeepCheck gspUpkeepCheckDTOJ = gspUpkeepCheckList.get(j);
+                if (gspUpkeepCheckDTOJ.getId().equals(gspUpkeepCheck.getId())) {//同ID,则为拆分数据
+                    String id = String.valueOf(SnowFlakeUtils.getId());
+                    gspUpkeepCheck.setId(id);
+                    gspUpkeepCheck.setCode("YH" + id.substring(id.length() - 8));
+                    this.mapper.save(gspUpkeepCheck);
+                    isAdd = true;
+                }
+            }
+            if (!isAdd) {
+                this.mapper.updateWithValidate(gspUpkeepCheck, p -> ObjectUtils.isNotNull(p) && ObjectUtils.isNotNull(p.getValue()));
+            }
+            WarehouseLocatorBasicInfo basicInfo = warehouselocators.stream().filter(var -> gspUpkeepCheck.getLocatorId().equals(var.getWarehouseLocatorId())).findFirst().orElse(null);
+            if (null != basicInfo
+                    && (basicInfo.getWarehouseAreaCategory().equals("AGVZ") || basicInfo.getWarehouseAreaCategory().equals("MJK")
+                    || basicInfo.getWarehouseAreaCategory().equals("AGVSP") || basicInfo.getWarehouseAreaCategory().equals("AGVQX")
+                    || basicInfo.getWarehouseAreaCategory().equals("AGVZY"))
+                    && (gspUpkeepCheck.getStatus().equals("4") || gspUpkeepCheck.getStatus().equals("1"))
+            ) {
+                // 生成出库指令且托盘到位的 才需要回告 EIS 托盘回库
+                if (OUTBOUND_INSTRUCT_DELIVERY.equals(gspUpkeepCheck.getOutboundInstruct())) {
+                    //养护完成, 回告EIS托盘回库 MJK和AGVL内部盘点不出库
+                    toEisList.add(gspUpkeepCheck);
+                }
+            }
+        }
+        if (lockList.size() > 0) {
+            ValidList<InvStockMaintain> invStockList = new ValidList<>();
+            for (int i = 0; i < lockList.size(); i++) {
+                GspUpkeepCheck gspUpkeepCheck = lockList.get(i);
+                InvStockMaintain invStockMaintain = spellInvStockVO(gspUpkeepCheck);
+                invStockList.add(invStockMaintain);
+            }
+
+            logger.info("maintainStock:{}", JSON.toJSONString(invStockList));
+            RestMessage upKeepDictResult = inventoryClient.maintainStock(invStockList);
+            if (upKeepDictResult == null || !upKeepDictResult.isSuccess()) {
+                throw new PrologException("调用库存:" + upKeepDictResult.getMessage());
+            }
+        }
+        if (CollUtil.isNotEmpty(toEisList)){
+            this.workFinish(toEisList);
+        }
+        if (cancelLockList.size() > 0) {
+            String[] cancelIds = cancelLockList.stream().map(GspUpkeepCheck::getId).toArray(String[]::new);
+            InvStockCancel invStockCancel = new InvStockCancel();
+            invStockCancel.setLineBillIds(cancelIds);
+            RestMessage upKeepDictResult = inventoryClient.maintainCancel(invStockCancel);
+            if (upKeepDictResult == null || !upKeepDictResult.isSuccess()) {
+                throw new PrologException("调用库存:" + upKeepDictResult.getMessage());
+            }
+            // 迁移到设备养护结果的定时任务去同步
+            //            askIntegration(updateDeviceOkId, cancelLockList);
+        }
+//        ifHasDeviceThenHandleThem(gspUpkeepCheckList, warehouselocators);
+//        if (toOMSList.size() > 0) {
+//            dxiOmsMaintenanceRecordMapper.saveBatch(spellDxi(toOMSList));
+//            return toOMSList.stream().map(GspUpkeepCheck::getId).toArray(String[]::new);
+//        }
+        return null;
+    }
+
+    private void dataFilling(List<GspUpkeepCheck> gspUpkeepCheckList, List<GspUpkeepCheck> checks, Map<String, List<GspUpkeepCheck>> paramMap, Map<String, List<GspUpkeepCheck>> checksMap) {
+        for (GspUpkeepCheck check : checks) {
+            if (paramMap.containsKey(check.getId())) {
+                check.setOutWhAreaCategory(paramMap.get(check.getId()).get(0).getOutWhAreaCategory());
+            }
+        }
+        for (GspUpkeepCheck gspUpkeepCheck : gspUpkeepCheckList) {
+            if (checksMap.containsKey(gspUpkeepCheck.getId())) {
+                gspUpkeepCheck.setOutboundInstruct(checksMap.get(gspUpkeepCheck.getId()).get(0).getOutboundInstruct());
+            }
+        }
+    }
+
+    private void workFinish(List<GspUpkeepCheck> toEisList){
+        //通知托盘回库
+        String[] locationIds = toEisList.stream().map(GspUpkeepCheck::getLocatorId).distinct().toArray(String[]::new);
+        List<WarehouseLocatorBasicInfo> locations = RestMsgHelper.unpack(warehouseClient.getLocationBasicInfos(locationIds));
+        Assert.notEmpty(locations, "获取货位信息失败");
+        List<GspUpkeepCheck> needBackList = new ArrayList<>();
+        //只有AGV托盘库/四向库才需要回告作业完成(发送过设备指令的才需要回告作业完成)
+        for (GspUpkeepCheck gspUpkeepCheck : toEisList) {
+            GspUpkeepCheck byId = mapper.findById(gspUpkeepCheck.getId(), GspUpkeepCheck.class);
+            if(byId.getOutboundInstruct()!=null){
+                gspUpkeepCheck.setOutboundInstruct(byId.getOutboundInstruct());
+            }
+            WarehouseLocatorBasicInfo location = locations.stream().filter(x -> x.getWarehouseLocatorId().equals(gspUpkeepCheck.getLocatorId())).findFirst().orElse(null);
+            if(location!=null){
+                if(gspUpkeepCheck.getOutboundInstruct() != null && gspUpkeepCheck.getOutboundInstruct() != 0
+                        && (location.getWarehouseAreaCategory().equals("AGVZ") || location.getWarehouseAreaCategory().equals("MJK")
+                        || location.getWarehouseAreaCategory().equals("AGVSP") || location.getWarehouseAreaCategory().equals("AGVQX")
+                        || location.getWarehouseAreaCategory().equals("AGVZY"))){
+                    needBackList.add(gspUpkeepCheck);
+                }
+            }
+//            for (WarehouseLocatorBasicInfo location : locations) {
+//                if (gspUpkeepCheck.getLocatorId().equals(location.getWarehouseLocatorId())
+//                        && (location.getWarehouseAreaCategory().equals("AGVZ") || location.getWarehouseAreaCategory().equals("MJK"))
+//                ){
+//                    needBackList.add(gspUpkeepCheck);
+//                }
+//            }
+        }
+        if (CollUtil.isEmpty(needBackList)){
+            return;
+        }
+        List<BaseMtlItemMst> items = RestMsgHelper.unpack(itemClient.getListByIds(toEisList.stream().map(GspUpkeepCheck::getItemId).collect(Collectors.toSet()).toArray(new String[]{})));
+        if (CollUtil.isEmpty(items)){
+            throw new BizException("商品信息不存在!");
+        }
+        //通过托盘分组
+        Map<String, List<GspUpkeepCheck>> containerGroup = needBackList.stream().collect(Collectors.groupingBy(GspUpkeepCheck::getContainerCode));
+
+        List<OperationCompleteVO> list = new ArrayList<>();
+        for (String containerCode : containerGroup.keySet()) {
+            OperationCompleteVO operationCompleteVO = new OperationCompleteVO();
+            operationCompleteVO.setMsgId(IdUtil.fastSimpleUUID());
+            operationCompleteVO.setContainerNo(containerCode);
+            List<OperationCompleteItemVO> subList = new ArrayList<>();
+            //for (GspUpkeepCheck gspUpkeepCheck : containerGroup.get(containerCode)) {
+                GspUpkeepCheck gspUpkeepCheck = containerGroup.get(containerCode).get(0);
+                BaseMtlItemMst itemMst = items.stream().filter(var->gspUpkeepCheck.getItemId().equals(var.getItemId())).findFirst().orElse(null);
+                WarehouseLocatorBasicInfo locator = locations.stream().filter(var->var.getWarehouseLocatorId().equals(gspUpkeepCheck.getLocatorId())).findFirst().orElse(null);
+                if (null == itemMst){
+                    throw new BizException("商品信息不存在!");
+                }
+                if (null == locator){
+                    throw new BizException("查询货位信息失败!");
+                }
+                OperationCompleteItemVO operationCompleteItemVO = new OperationCompleteItemVO();
+                operationCompleteItemVO.setTaskId(gspUpkeepCheck.getPlanId());
+                operationCompleteItemVO.setItemId(gspUpkeepCheck.getItemId());
+                operationCompleteItemVO.setEnterpriseId(gspUpkeepCheck.getEnterpriseId());
+                operationCompleteItemVO.setWarehouseId(gspUpkeepCheck.getWarehouseId());
+                operationCompleteItemVO.setWorkType(OutBoundRequestEnum.INV_CONSERVE.getWorkType());
+                operationCompleteItemVO.setBusinessType(OutBoundRequestEnum.INV_CONSERVE.getBusinessType());
+                operationCompleteItemVO.setTaskLineId(gspUpkeepCheck.getId());
+                operationCompleteItemVO.setOwnerId(gspUpkeepCheck.getCargoOwnerId());
+//                List<BaseWmsWarehouseArea> area = RestMsgHelper.unpack(warehouseClient.getWarehouseAreaBasicInfos(new String[]{locator.getWarehouseAreaId()}));
+                operationCompleteItemVO.setWmsLocationCode("MJK".equals(locator.getWarehouseAreaCode()) ? "MJZ" : locator.getWarehouseAreaCode());
+                operationCompleteItemVO.setQty(gspUpkeepCheck.getPlanStockQty());
+                operationCompleteItemVO.setBillNo(gspUpkeepCheck.getPlanId());
+                subList.add(operationCompleteItemVO);
+//            }
+            operationCompleteVO.setSubList(subList);
+            list.add(operationCompleteVO);
+        }
+        eisHandler.operationComplete(list);
+    }
+
+    private void checkIsConclusioned(List<GspUpkeepCheck> checks, List<WarehouseLocatorBasicInfo> locations) {
+        //状态:0初始,1-正常无需质检,2-质检,3-质检无需复检,4-复检,5-复检完成,6-发起移库完成
+       for (GspUpkeepCheck check : checks) {
+            if (check.getUpkeepConclusion() > 0){
+                if (check.getStatus() != null){
+                    if (check.getStatus().equals("1")){
+                        throw new BizException("当前养护记录已被养护,请刷新记录");
+                    }
+                    if (check.getStatus().equals("3")){
+                        throw new BizException("当前养护记录已质检完成,请刷新记录");
+                    }
+                    if (check.getStatus().equals("5")){
+                        throw new BizException("当前养护记录已复检,请刷新记录");
+                    }
+                    if (check.getStatus().equals("6")){
+                        throw new BizException("当前养护记录已移库完成,请刷新记录");
+                    }
+                }
+            }
+        }
+
+        // 拣货方式 设备且非货架库
+        List<String> locatorIds = locations.stream().filter(t -> PICK_MODE_DEVICE.equals(t.getPickMode())).map(WarehouseLocatorBasicInfo::getWarehouseLocatorId).collect(Collectors.toList());
+
+        List<GspUpkeepCheck> areaNoSend = checks.stream().filter(d -> "MJK".equals(d.getOutWhAreaCategory())
+                        || "AGVZ".equals(d.getOutWhAreaCategory())
+                || "AGVSP".equals(d.getOutWhAreaCategory())
+                || "AGVQX".equals(d.getOutWhAreaCategory()))
+                .filter(d -> OUTBOUND_INSTRUCT_NO_SEND.equals(d.getOutboundInstruct()) || ObjectUtil.isNull(d.getOutboundInstruct())).collect(Collectors.toList());
+        //List<GspUpkeepCheck> areaNoSend = checks.stream().filter(d -> "MJK".equals(d.getOutWhAreaCategory()) || "AGVZ".equals(d.getOutWhAreaCategory())).filter(d -> OUTBOUND_INSTRUCT_NO_SEND.equals(d.getOutboundInstruct()) || ObjectUtil.isNull(d.getOutboundInstruct())).collect(Collectors.toList());
+        if (Objects.equals(areaNoSend.size(), checks.size())) {
+            return;
+        }
+        GspUpkeepCheck unSendCheckD = checks.stream().filter(d -> locatorIds.contains(d.getLocatorId()) && !OUTBOUND_INSTRUCT_DELIVERY.equals(d.getOutboundInstruct())).findFirst().orElse(null);
+        if (unSendCheckD != null) {
+            throw new PrologException(String.format("托盘号【%s】未出库不能养护录入操作", unSendCheckD.getContainerCode()));
+        }
+    }
+
+    private void ifHasDeviceThenHandleThem(List<GspUpkeepCheck> list, List<WarehouseLocatorBasicInfo> locations) {
+        String[] itemIds = list.stream().map(GspUpkeepCheck::getItemId).toArray(String[]::new);
+        List<BaseMtlItemMst> itemList = RestMsgHelper.unpack(itemClient.getListByIds(itemIds));
+        Assert.notEmpty(itemList, "获取商品信息失败");
+        List<GspUpkeepCheck> deviceList = list.stream().filter(d -> StrUtil.isNotBlank(d.getContainerCode()) && isDevice(d.getLocatorId(), locations)).collect(Collectors.toList());
+        if (CollUtil.isEmpty(deviceList)) {
+            return;
+        }
+        Map<String, List<GspUpkeepCheck>> collect = deviceList.stream().collect(Collectors.groupingBy(GspUpkeepCheck::getContainerCode));
+        for (String containerCode : collect.keySet()) {
+            if (CollUtil.isEmpty(collect.get(containerCode))){
+                continue;
+            }
+            ContainerConfirmDto vo = generateTaskFinishedConfirmSubListVO(containerCode,collect.get(containerCode),itemList,locations);
+            logger.info("- taskFinishedConfirm.params:{}", JSONObject.toJSONString(vo));
+            eisResource.taskFinishedConfirm(vo);
+        }
+    }
+
+    private boolean isDevice(String locationId, List<WarehouseLocatorBasicInfo> locations) {
+        return locations.stream().anyMatch(l -> l.getWarehouseLocatorId().equals(locationId) && PICK_MODE_DEVICE.equals(l.getPickMode()));
+    }
+
+    private ContainerConfirmDto generateTaskFinishedConfirmSubListVO(
+            String containerCode,
+            List<GspUpkeepCheck> dList,
+            List<BaseMtlItemMst> items,
+            List<WarehouseLocatorBasicInfo> locators
+    ) {
+        ContainerConfirmDto vo = new ContainerConfirmDto();
+        vo.setContainerNo(containerCode);
+        vo.setContainerType("3");
+
+        List<EisConfirmSubVo> confirmVOS = new ArrayList<>();
+        for (GspUpkeepCheck gspUpkeepCheck : dList) {
+            BaseMtlItemMst itemMst = items.stream().filter(var->gspUpkeepCheck.getItemId().equals(var.getItemId())).findFirst().orElse(null);
+            WarehouseLocatorBasicInfo locator = locators.stream().filter(var->var.getWarehouseLocatorId().equals(gspUpkeepCheck.getLocatorId())).findFirst().orElse(null);
+            if (null == itemMst){
+                throw new BizException("商品信息不存在!");
+            }
+            if (null == locator){
+                throw new BizException("查询货位信息失败!");
+            }
+            EisConfirmSubVo subVo = new EisConfirmSubVo();
+            subVo.setMsgId(IdUtil.fastSimpleUUID());
+            subVo.setTaskId(gspUpkeepCheck.getPlanId());
+            subVo.setSeqNo(gspUpkeepCheck.getId());
+            subVo.setBusinessType("40");
+            subVo.setWorkType("40");
+            subVo.setItemId(gspUpkeepCheck.getItemId());
+            subVo.setLotId(gspUpkeepCheck.getBatchId());
+            subVo.setOwnerId(gspUpkeepCheck.getCargoOwnerId());
+            String packId = "";
+            if (CollUtil.isNotEmpty(itemMst.getBaseMtlItemUomConversionsList())){
+                packId = itemMst.getBaseMtlItemUomConversionsList().get(0).getItemUomId();
+            }
+            subVo.setPackId(packId);
+            subVo.setWarehouseId("JXYJ");
+            subVo.setWmslocationCode(locator.getWarehouseLocatorCode());
+            subVo.setInventoryQty(new BigDecimal(gspUpkeepCheck.getStockQty()));
+            subVo.setCountQty(new BigDecimal(gspUpkeepCheck.getUpkeepQty()));
+            confirmVOS.add(subVo);
+        }
+        vo.setSubList(confirmVOS);
+        return vo;
+    }
+
+
+    private InvStockMaintain spellInvStockVO(GspUpkeepCheck gspUpkeepCheck) {
+        InvStockMaintain invStockMaintain = new InvStockMaintain();
+        invStockMaintain.setBillId(gspUpkeepCheck.getPlanId());
+        invStockMaintain.setLineBillId(gspUpkeepCheck.getId());
+        invStockMaintain.setWarehouseId(gspUpkeepCheck.getWarehouseId());
+        InvStockMaintainDetail invStockMaintainDetail = new InvStockMaintainDetail();
+        invStockMaintainDetail.setBatchId(gspUpkeepCheck.getBatchId());
+        invStockMaintainDetail.setLocatorId(gspUpkeepCheck.getLocatorId());
+        invStockMaintainDetail.setQuantity(new BigDecimal(gspUpkeepCheck.getUpkeepQty()));
+        if(gspUpkeepCheck.getPendingQty()!=null&&gspUpkeepCheck.getPendingQty().compareTo(BigDecimal.ZERO)>0){
+            invStockMaintainDetail.setQuantity(gspUpkeepCheck.getPendingQty());
+        }
+        invStockMaintain.setDetails(new ArrayList<InvStockMaintainDetail>() {{
+            add(invStockMaintainDetail);
+        }});
+        return invStockMaintain;
+    }
+
+    @Override
+    public void confirmDevice() {//0=初始化 1=正在作业 2=养护完成 3=养护WMS已接收 4=复检合格 5=复检不合格
+        try {
+            JSONObject JSONObject = askIntegration(sendWmsId, null);
+            List<GspUpkeepCheck> list = JSON.parseArray(JSON.toJSONString(JSONObject.getJSONArray("data")), GspUpkeepCheck.class);
+            logger.info("设备养护数据:" + JSON.toJSONString(JSONObject.getJSONArray("data")));
+            if (list != null && list.size() > 0) {
+                List<GspUpkeepCheck> checkList = new ArrayList<>();
+                List<GspUpkeepCheck> wmsList = new ArrayList<>();
+                for (int i = 0; i < list.size(); i++) {
+                    GspUpkeepCheck GspUpkeepCheck = list.get(i);
+                    // 当前的status是设备表的状态,提取出来后需要设置为 null
+                    String status = GspUpkeepCheck.getStatus();
+                    GspUpkeepCheck.setStatus(null);
+                    if (GspUpkeepCheck != null) {
+                        // wms回传agv已接收
+                        if (status.equals("2")) {
+                            // 检查养护结果,设置养护结论(设备养护不会拆分)
+                            Integer okNum = StringUtils.isBlank(GspUpkeepCheck.getOkQty()) ? 0 : Integer.valueOf(GspUpkeepCheck.getOkQty());
+                            Integer paddingNum = GspUpkeepCheck.getPendingQty() == null ? 0 : GspUpkeepCheck.getPendingQty().intValue();
+                            if ((okNum > 0 && paddingNum > 0) || (okNum.equals(0) && paddingNum.equals(0))) {
+                                // 同时存在合格和待处理的设备,提示错误
+                                throw new PrologException("设备养护同时存在/不存在合格和待处理的设备,养护id:" + GspUpkeepCheck.getId());
+                            }
+
+                            if (okNum > 0) {
+                                // 合格:合格数量大于 0
+                                GspUpkeepCheck.setUpkeepConclusion(1);
+                                GspUpkeepCheck.setConclusion(1);
+                                GspUpkeepCheck.setStatus("1");
+                            } else {
+                                // 待处理
+                                GspUpkeepCheck.setUpkeepConclusion(0);
+                                GspUpkeepCheck.setStatus("4");
+                            }
+
+                            this.mapper.updateWithValidate(GspUpkeepCheck, p -> ObjectUtils.isNotNull(p) && ObjectUtils.isNotNull(p.getValue()));
+                            wmsList.add(GspUpkeepCheck);
+                        } else {
+                            // 需要更新agv复检状态的数据
+                            checkList.add(GspUpkeepCheck);
+                        }
+                    }
+                }
+                // 复检数据处理
+                String[] ids = checkList.stream().map(GspUpkeepCheck::getId).distinct().toArray(String[]::new);
+                Criteria crtD = Criteria.forClass(GspUpkeepCheck.class);
+                Restriction r1 = Restrictions.in("id", ids);
+                Restriction r2 = Restrictions.isNotNull("conclusion");
+                crtD.setRestriction(Restrictions.and(r1, r2));
+                List<GspUpkeepCheck> checkResList = mapper.findByCriteria(crtD);
+
+                // wms已接收数据下传
+                if (wmsList.size() > 0) {
+                    askIntegration(updateDeviceId, wmsList);
+                }
+                // 复检数据下传
+                if (checkResList.size() > 0) {
+                    askIntegration(updateDeviceOkId, checkResList);
+                }
+            }
+        } catch (Exception e) {
+            logger.info("设备养护数据", e);
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    @TxTransaction(isStart = true)
+    public void sendTaskToEis(List<String> ids) {
+
+        List<GspUpkeepCheck> list = mapper.findByIds(GspUpkeepCheck.class, ids.toArray(), null);
+        Assert.notEmpty(list, DATA_OVERDUE);
+
+        checkIsRepeatPushTask(list);
+
+        List<WarehouseLocatorBasicInfo> deviceLocList = getDeviceListByUpkeepCheck(list);
+
+        updateOutboundInstruct2DB(list);
+
+        List<BaseMtlItemMst> items = RestMsgHelper.unpack(itemClient.getListByIds(list.stream().map(GspUpkeepCheck::getItemId).collect(Collectors.toSet()).toArray(new String[]{})));
+
+        pushTask2Eis(list, items, deviceLocList);
+    }
+
+    @Override
+    public Page<RfGspUpkeepCheckVO> findUpkeepPageByRf(QueryDTO dto) {
+        QueryDTO queryDTO = initDTO(dto);
+        PageUtils.startPage(dto.getPageNum(), dto.getPageSize());
+        List<RfGspUpkeepCheckVO> list = mapper.findUpkeepPageByRf(queryDTO);
+        if (CollUtil.isEmpty(list)) {
+            return PageUtils.getPage(list);
+        }
+
+        String[] locationIds = list.stream().map(RfGspUpkeepCheckVO::getLocatorId).distinct().toArray(String[]::new);
+        Assert.notEmpty(locationIds, "获取货位ID失败");
+        List<WarehouseLocatorBasicInfo> locations = RestMsgHelper.unpack(warehouseClient.getLocationBasicInfos(locationIds));
+        Assert.notEmpty(locations, "获取货位信息失败");
+        List<RfGspUpkeepCheckVO> resultList = Lists.newArrayList();
+        locations.stream().filter(l -> PICK_MODE_DEVICE.equals(l.getPickMode())).forEach(l -> resultList.addAll(getDeviceByLocation(l, list)));
+        if (CollUtil.isEmpty(resultList)) {
+            return PageUtils.getPage(list);
+        }
+
+        String[] cargoOwnerIds = resultList.stream().map(RfGspUpkeepCheckVO::getCargoOwnerId).toArray(String[]::new);
+        Map<String, BaseCargoOwnerMst> cargoOwnerMstMap = RestMsgHelper.unpack(chainClient.getCargoOwnerMstByIds(cargoOwnerIds));
+        String[] itemIds = resultList.stream().map(RfGspUpkeepCheckVO::getItemId).toArray(String[]::new);
+        List<BaseMtlItemMst> items = RestMsgHelper.unpack(itemClient.getListByIds(itemIds));
+        Set<String> warehouseIds = resultList.stream().map(RfGspUpkeepCheckVO::getWarehouseId).collect(Collectors.toSet());
+        Map<String, BaseWmsWarehouseMst> warehouseMstMap = RestMsgHelper.unpack(warehouseClient.mapbyids(warehouseIds));
+        for (RfGspUpkeepCheckVO vo : resultList) {
+            Optional.ofNullable(warehouseMstMap).flatMap(t -> Optional.ofNullable(t.get(vo.getWarehouseId()))).ifPresent(t2 -> vo.setWarehouseName(t2.getWarehouseName()));
+            Optional.ofNullable(cargoOwnerMstMap).flatMap(t -> Optional.ofNullable(t.get(vo.getCargoOwnerId()))).ifPresent(t2 -> vo.setCargoOwnerName(t2.getCargoOwnerName()));
+            items.stream().filter(i -> i.getItemId().equals(vo.getItemId())).findFirst().ifPresent(i -> {
+                vo.setItemName(i.getItemName());
+                vo.setItemCode(i.getItemCode());
+            });
+            locations.stream().filter(l -> l.getWarehouseLocatorId().equals(vo.getLocatorId())).findFirst().ifPresent(l -> {
+                vo.setWarehouseAreaCategory(l.getWarehouseAreaCategory());
+                vo.setLocatorCode(l.getWarehouseLocatorCode());
+            });
+        }
+        return PageUtils.getPage(resultList);
+    }
+
+    @Override
+    public GspUpkeepCheckVO findUpkeepDtlByRf(QueryDTO dto) {
+        initDTO(dto);
+        if (StrUtil.isBlank(dto.getId())) {
+            throw new PrologException("ID不能为空");
+        }
+        GspUpkeepCheck check = mapper.findById(dto.getId(), GspUpkeepCheck.class);
+        Assert.notNull(check, "获取详情失败");
+        List<GspUpkeepCheckVO> list = spellGspUpkeepCheckVOS(Collections.singletonList(check));
+        return list.get(0);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void callbackPushTask(List<String> ids) {
+        Assert.notEmpty(ids, "业务ID不能为空");
+        mapper.updateOutboundInstructById(ids, DateUtil.date());
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void gspUpKeepOutBack(List<InfTaskOutBackDTO> upkeepList) {
+        List<GspUpkeepCheck> editList = new ArrayList<>();
+        List<GspUpkeepCheck> checkList = new ArrayList<>();
+        for (InfTaskOutBackDTO infTaskOutBackVO : upkeepList) {
+            GspUpkeepCheck gspUpkeepCheck = mapper.findById(infTaskOutBackVO.getSeqNo(),GspUpkeepCheck.class);
+            gspUpkeepCheck.setOutboundInstruct(OUTBOUND_INSTRUCT_DELIVERY);
+            mapper.update(gspUpkeepCheck);
+            //判断养护的库别 AGVZ/MJK/AGVL
+            String locatorId = gspUpkeepCheck.getLocatorId();
+            RestMessage<List<WarehouseLocatorBasicInfo>> locationBasicInfos = warehouseClient.getLocationBasicInfos(new String[]{locatorId});
+            WarehouseLocatorBasicInfo basicInfo = locationBasicInfos.getData().get(0);
+            String warehouseAreaCategory = basicInfo.getWarehouseAreaCategory();
+            if (warehouseAreaCategory.equals("AGVZ")){
+                //更新状态为EIS出库
+            }else if (warehouseAreaCategory.equals("AGVL")){
+                //货格回告 需要拆分GspUpkeepCheck,并记录货格号
+                if (CollUtil.isEmpty(infTaskOutBackVO.getItemList())){
+                    throw new BizException("养护结论不能为空");
+                }
+                List<GspUpkeepCheck> saveList = new ArrayList<>();
+                for (EisCheckBackDetailVo detailVo : infTaskOutBackVO.getItemList()) {
+                    //根据结论拆分 gspUpkeepCheck
+                    GspUpkeepCheck tempCheck = new GspUpkeepCheck();
+                    BeanUtils.copyProperties(gspUpkeepCheck, tempCheck);
+                    tempCheck.setLocationNo(detailVo.getLocationNo());
+                    tempCheck.setUpkeepQty(detailVo.getInventoryQty().toString());
+                    tempCheck.setStockQty(detailVo.getInventoryQty().toString());
+                    tempCheck.setId(String.valueOf(SnowFlakeUtils.getId()));
+                    saveList.add(tempCheck);
+                    GspUpkeepCheck editCheck = new GspUpkeepCheck();
+                    BeanUtils.copyProperties(tempCheck, editCheck);
+                    editCheck.setUpkeepConclusion(Convert.toInt(detailVo.getYhResult()));
+                    editCheck.setUpkeepConclusion(editCheck.getUpkeepConclusion() == 3?0:editCheck.getUpkeepConclusion());
+                    if (editCheck.getUpkeepConclusion() != 1){
+                        editCheck.setPendingQty(detailVo.getInventoryQty());
+                    } else {
+                        editCheck.setPendingQty(BigDecimal.ZERO);
+                    }
+                    editCheck.setCheckFanDuo(StrUtil.isNotBlank(detailVo.getYhItem1()) && Convert.toInt(detailVo.getYhItem1(), 0) == 1);
+                    editCheck.setCheckChuShi(StrUtil.isNotBlank(detailVo.getYhItem2()) && Convert.toInt(detailVo.getYhItem2(), 0) == 1);
+                    editCheck.setCheckJiaShi(StrUtil.isNotBlank(detailVo.getYhItem3()) && Convert.toInt(detailVo.getYhItem3(), 0) == 1);
+                    editCheck.setCheckShenWen(StrUtil.isNotBlank(detailVo.getYhItem4()) && Convert.toInt(detailVo.getYhItem4(), 0) == 1);
+                    editCheck.setCheckJiangWen(StrUtil.isNotBlank(detailVo.getYhItem5()) && Convert.toInt(detailVo.getYhItem5(), 0) == 1);
+                    editCheck.setCheckTongFeng(StrUtil.isNotBlank(detailVo.getYhItem6()) && Convert.toInt(detailVo.getYhItem6(), 0) == 1);
+                    editCheck.setCheckChuChen(StrUtil.isNotBlank(detailVo.getYhItem7()) && Convert.toInt(detailVo.getYhItem7(), 0) == 1);
+                    editCheck.setCheckChongZhu(StrUtil.isNotBlank(detailVo.getYhItem9()) && Convert.toInt(detailVo.getYhItem9(), 0) == 1);
+                    editCheck.setCheckFaMei(StrUtil.isNotBlank(detailVo.getYhItem10()) && Convert.toInt(detailVo.getYhItem10(), 0) == 1);
+                    editCheck.setCheckChaoJie(StrUtil.isNotBlank(detailVo.getYhItem11()) && Convert.toInt(detailVo.getYhItem11(), 0) == 1);
+                    editCheck.setCheckZheGuang(StrUtil.isNotBlank(detailVo.getYhItem12()) && Convert.toInt(detailVo.getYhItem12(), 0) == 1);
+
+                    if (editCheck.getUpkeepConclusion() == 2){
+                        checkList.add(editCheck);
+                    }else {
+                        editList.add(editCheck);
+                    }
+                }
+                mapper.saveBatch(saveList);
+                mapper.deleteById(gspUpkeepCheck.getId(), GspUpkeepCheck.class);
+            }else if (warehouseAreaCategory.equals("MJK")){
+                //四向库回告 记录回告信息
+            }else {
+                throw new BizException("库别错误!");
+            }
+            if (CollUtil.isNotEmpty(editList)){
+                this.batchEdit(editList, false);
+            }
+            if (CollUtil.isNotEmpty(checkList)){
+                this.batchEdit(checkList, true);
+            }
+        }
+    }
+
+    @Override
+    public String getLocationNoByLineId(String lineId) {
+        GspUpkeepCheck byId = mapper.findById(lineId, GspUpkeepCheck.class);
+        if (byId == null){
+            return "";
+        }
+        if (StrUtil.isNotBlank(byId.getLocationNo())){
+            return byId.getLocationNo();
+        }
+        return "";
+    }
+
+    @TxTransaction
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void addStockUnLock(List<WmsInvStockLot> wmsInvStockLots) {
+        logger.info("库存解锁复检不合格转gsp移库=》{}",JSONObject.toJSONString(wmsInvStockLots));
+        UserDTO userDTO = this.getUpkeepUser("0");
+        String userId = userDTO.getId();
+        String userName = userDTO.getNickname();
+        Date date = new Date();
+        String enterpriseId = userDTO.getEnterpriseId();
+        Set<String> locids = new HashSet<>();
+        Set<String> itemids = new HashSet<>();
+        Set<String> warehouseIds = new HashSet<>();
+        for (WmsInvStockLot stockLot : wmsInvStockLots) {
+            locids.add(stockLot.getLocatorId());
+            itemids.add(stockLot.getItemId());
+            warehouseIds.add(stockLot.getWarehouseId());
+        }
+        Map<String, BaseWmsWarehouseMst> warehouseMstMap = new HashMap<>();
+        //批量查询仓信息
+        if (warehouseIds.size() > 0) {
+            warehouseMstMap = RestMsgHelper.unpack(warehouseClient.mapbyids(warehouseIds));
+        }
+        Map<String, WarehouseLocatorBasicInfo> locationMstMap = new HashMap<>();
+        //批量查询货位信息
+        if (locids.size() > 0) {
+            //获取货位信息
+            RestMessage<List<WarehouseLocatorBasicInfo>> locationBasicInfos = warehouseClient.getLocationBasicInfos(locids.toArray(new String[]{}));
+            if (!locationBasicInfos.isSuccess() || locationBasicInfos.getData() == null) {
+                throw new BizException("查询货位关联信息失败!请重试或联系管理员!");
+            }
+            for (WarehouseLocatorBasicInfo locinfo : locationBasicInfos.getData()) {
+                locationMstMap.put(locinfo.getWarehouseLocatorId(), locinfo);
+            }
+        }
+        Map<String, BaseMtlItemMst> litemMstMap = new HashMap<>();
+        //批量查询商品信息
+        if (itemids.size() > 0) {
+            RestMessage<List<BaseMtlItemMst>> itemResult = itemClient.getListByIds(itemids.toArray(new String[]{}));
+            if (!itemResult.isSuccess() || itemResult.getData() == null) {
+                throw new BizException("查询商品关联信息失败!请重试或联系管理员!");
+            }
+            for (BaseMtlItemMst iteminfo : itemResult.getData()) {
+                litemMstMap.put(iteminfo.getItemId(), iteminfo);
+            }
+        }
+        GspUpkeepCheckPlan plan = new GspUpkeepCheckPlan();
+        String planId = String.valueOf(SnowFlakeUtils.getId());
+        String code = "SDD" + planId.substring(planId.length() - 8);
+        plan.setId(planId);
+        plan.setCode(code);
+        plan.setCreator(userId);
+        plan.setCreatorName(userName);
+        plan.setGmtCreate(date);
+        plan.setModifier(userId);
+        plan.setModifierName(userName);
+        plan.setGmtModified(date);
+        plan.setDcId(warehouseMstMap.get(wmsInvStockLots.get(0).getWarehouseId()).getDcId());
+        plan.setEnterpriseId(enterpriseId);
+        plan.setWarehouseId(wmsInvStockLots.get(0).getWarehouseId());
+        //        plan.setBldgId(wmsInvStockLots.get(0).getBldgId());
+        plan.setStatus("4");
+        plan.setCargoOwnerId(wmsInvStockLots.get(0).getCargoOwnerId());
+        plan.setSource("1");//数据来源:0=手动 1=自动
+        plan.setPrintCount(0);
+        upkeepCheckPlanMapper.save(plan);
+        List<GspUpkeepCheck> gspUpkeepCheckList = new ArrayList<>();
+        for (WmsInvStockLot wmsInvStockLot : wmsInvStockLots) {
+            GspUpkeepCheck model = new GspUpkeepCheck();
+            String id = String.valueOf(SnowFlakeUtils.getId());
+            model.setId(id);
+            model.setCode("SDD" + id.substring(id.length() - 8));
+            model.setEnterpriseId(enterpriseId);
+            model.setPlanUpkeepDate(date);
+            model.setUpkeepDate(date);
+            model.setUpkeepType(6);
+            model.setPlanId(plan.getId());
+            model.setPlanCode(code);
+            model.setBatchId(wmsInvStockLot.getBatchId());
+            BaseWmsWarehouseMst baseWmsWarehouseMst = warehouseMstMap.get(wmsInvStockLot.getWarehouseId());
+            //获取仓信息
+            model.setDcId(baseWmsWarehouseMst.getDcId());
+            model.setWarehouseName(baseWmsWarehouseMst.getWarehouseName());
+            model.setWarehouseId(model.getWarehouseId());
+            model.setStockQty(wmsInvStockLot.getQuantity().toString());
+            // 需要初始化养护数量(默认等于库存数量,解决空指针异常问题)
+            model.setUpkeepQty(model.getStockQty());
+            model.setPlanStockQty(model.getStockQty());
+            model.setPendingQty(wmsInvStockLot.getQuantity());
+            model.setCreator(userId);
+            model.setCreatorName(userName);
+            model.setGmtCreate(date);
+            model.setModifier(userId);
+            model.setModifierName(userName);
+            model.setGmtModified(date);
+            model.setStatus("5");
+            // 数据来源:0=手动 1=自动 - by Huanglh 2022-01-20
+            model.setSourceType("0");
+            model.setWarehouseId(wmsInvStockLot.getWarehouseId());
+            //获取商品资料
+            model.setConclusion(2);
+            model.setUpkeepConclusion(2);
+            BaseMtlItemMst iteminfo = litemMstMap.get(wmsInvStockLot.getItemId());
+            model.setItemCode(iteminfo.getItemCode());
+            model.setItemId(wmsInvStockLot.getItemId());
+            model.setItemName(iteminfo.getItemName());
+            model.setCargoOwnerId(wmsInvStockLot.getCargoOwnerId());
+            model.setUpkeepQty(wmsInvStockLot.getQuantity().toString());
+            model.setStockQty(wmsInvStockLot.getQuantity().toString());
+            model.setLotNum(wmsInvStockLot.getBatchNum());
+            model.setUpkeepOperator(userDTO.getNickname());
+
+            //获取货位信息
+            WarehouseLocatorBasicInfo locatorBasicInfo = locationMstMap.get(wmsInvStockLot.getLocatorId());
+            model.setLocatorId(wmsInvStockLot.getLocatorId());
+            model.setLocatorCode(locatorBasicInfo.getWarehouseLocatorCode());
+            model.setLocatorName(locatorBasicInfo.getWarehouseLocatorName());
+            gspUpkeepCheckList.add(model);
+        }
+
+
+        mapper.saveBatch(gspUpkeepCheckList);
+
+    }
+
+    private List<RfGspUpkeepCheckVO> getDeviceByLocation(WarehouseLocatorBasicInfo locator, List<RfGspUpkeepCheckVO> list) {
+        return list.stream().filter(t -> t.getLocatorId().equals(locator.getWarehouseLocatorId())).collect(Collectors.toList());
+    }
+
+    private QueryDTO initDTO(QueryDTO dto) {
+        UserDTO user = userTemplate.getUserDTO();
+        if (dto == null) {
+            dto = new QueryDTO();
+        }
+        dto.initialPageWhenValueIsNull(user);
+        return dto;
+    }
+
+    private List<WarehouseLocatorBasicInfo> getDeviceListByUpkeepCheck(List<GspUpkeepCheck> list) {
+        String[] locationIds = list.stream().map(GspUpkeepCheck::getLocatorId).distinct().toArray(String[]::new);
+        List<WarehouseLocatorBasicInfo> locations = RestMsgHelper.unpack(warehouseClient.getLocationBasicInfos(locationIds));
+        Assert.notEmpty(locations, "获取货位信息失败");
+        //拣货方式 设备且非货架库
+        List<WarehouseLocatorBasicInfo> deviceLocList = locations.stream().filter(t -> PICK_MODE_DEVICE.equals(t.getPickMode())).collect(Collectors.toList());
+        Assert.notEmpty(deviceLocList, "勾选的养护记录中没有需要发送设备指令的记录");
+        return deviceLocList;
+    }
+
+    private void checkIsRepeatPushTask(List<GspUpkeepCheck> list) {
+        GspUpkeepCheck check = list.stream().filter(d -> d.getOutboundInstruct() != null && !OUTBOUND_INSTRUCT_NO_SEND.equals(d.getOutboundInstruct())).findFirst().orElse(null);
+        if (check != null) {
+            BaseMtlItemMst item = RestMsgHelper.unpack(itemClient.getItemById(check.getItemId()));
+            throw new PrologException(String.format("商品编码【%s】已发送指令,不能重复发送", item.getItemCode()));
+        }
+    }
+
+    private void pushTask2Eis(List<GspUpkeepCheck> list, List<BaseMtlItemMst> items, List<WarehouseLocatorBasicInfo> deviceLocList) {
+//        List<String> deviceLocId = deviceLocList.stream().map(WarehouseLocatorBasicInfo::getWarehouseLocatorId).collect(Collectors.toList());
+//        List<GspUpkeepCheck> gspUpkeepCheckList = list.stream().filter(t -> deviceLocId.contains(t.getLocatorId())).collect(Collectors.toList());
+//        List<EisPushTaskVO> params = new ArrayList<>(gspUpkeepCheckList.size());
+//        for (GspUpkeepCheck gspUpkeepCheck : gspUpkeepCheckList) {
+//            params.add(convert(gspUpkeepCheck, items, deviceLocList));
+//        }
+//        RestMsgHelper.unpack(inventoryClient.askIntegration(new AskIntegrationVo("outback", params)));
+
+        List<String> deviceLocId = deviceLocList.stream().map(WarehouseLocatorBasicInfo::getWarehouseLocatorId).collect(Collectors.toList());
+        List<GspUpkeepCheck> gspUpkeepCheckList = list.stream().filter(t -> deviceLocId.contains(t.getLocatorId())).collect(Collectors.toList());
+        List<OutBoundRequestVO> params = new ArrayList<>(gspUpkeepCheckList.size());
+        for (GspUpkeepCheck gspUpkeepCheck : gspUpkeepCheckList) {
+            params.add(convert(gspUpkeepCheck, items, deviceLocList));
+        }
+        //调用出库推送任务接口
+        com.prolog.common.RestMsgHelper.getData(eisResource.outBoundRequest(params));
+    }
+
+    private void updateOutboundInstruct2DB(List<GspUpkeepCheck> list) {
+        UserDTO user = userTemplate.getUserDTO();
+        DateTime now = DateUtil.date();
+        list.forEach(t -> {
+            t.setOutboundInstruct(OUTBOUND_INSTRUCT_UN_DELIVERY);
+            t.setGmtModified(now);
+            t.setModifierName(user.getNickname());
+            t.setModifier(user.getId());
+            mapper.update(t);
+        });
+    }
+
+//    private EisPushTaskVO convert(GspUpkeepCheck dInfo, List<BaseMtlItemMst> items, List<WarehouseLocatorBasicInfo> stereoLocations ){
+//        BaseMtlItemMst itemMst = items.stream().filter(var->dInfo.getItemId().equals(var.getItemId())).findFirst().orElse(null);
+//        WarehouseLocatorBasicInfo locator = stereoLocations.stream().filter(var->var.getWarehouseLocatorId().equals(dInfo.getLocatorId())).findFirst().orElse(null);
+//        if (null == itemMst){
+//            throw new BizException("商品信息不存在!");
+//        }
+//        if (null == locator){
+//            throw new BizException("查询货位信息失败!");
+//        }
+//        EisPushTaskVO vo = new EisPushTaskVO();
+//        vo.setMsgId(cn.hutool.core.util.IdUtil.fastSimpleUUID());
+//        vo.setTaskId(dInfo.getPlanId());
+//        vo.setWarehouseId("JXYJ");
+//        vo.setWorkType("40");
+//        vo.setBusinessType("40");
+//        vo.setPriority(10);
+//        vo.setSeqNo(dInfo.getId());
+//        vo.setOwnerId(dInfo.getCargoOwnerId());
+//        vo.setItemId(dInfo.getItemId());
+//        vo.setLotId(dInfo.getBatchId());
+//        String packId = "";
+//        vo.setContainerNo(dInfo.getContainerCode());
+//        if (CollUtil.isNotEmpty(itemMst.getBaseMtlItemUomConversionsList())){
+//            packId = itemMst.getBaseMtlItemUomConversionsList().get(0).getItemUomId();
+//        }
+//        vo.setPackId(packId);
+//        vo.setQty(null != dInfo.getStockQty()?new BigDecimal(dInfo.getStockQty()):BigDecimal.ZERO);
+//        vo.setOriginalArea("");
+//        vo.setOriginalLocation("");
+//        vo.setTargetLocation("");
+//        if (locator.getWarehouseAreaCategory().equals("AGVZ")) {
+//            vo.setWmslocationCode("AGVTP01");
+//            vo.setTargetArea("");
+//        }
+//        if (locator.getWarehouseAreaCategory().equals("AGVL")) {
+//            vo.setWmslocationCode("AGVHJ01");
+//            vo.setTargetArea("");
+//        }
+//        if (locator.getWarehouseAreaCategory().equals("MJK")) {
+//            vo.setWmslocationCode("SX01");
+//            vo.setTargetArea("");
+//        }
+//        //eisConvert.packCallOutTaskVOMove(dInfo);
+//        return vo;
+//    }
+    private OutBoundRequestVO convert(GspUpkeepCheck dInfo, List<BaseMtlItemMst> items, List<WarehouseLocatorBasicInfo> stereoLocations ){
+        BaseMtlItemMst itemMst = items.stream().filter(var->dInfo.getItemId().equals(var.getItemId())).findFirst().orElse(null);
+        WarehouseLocatorBasicInfo locator = stereoLocations.stream().filter(var->var.getWarehouseLocatorId().equals(dInfo.getLocatorId())).findFirst().orElse(null);
+        if (null == itemMst){
+            throw new BizException("商品信息不存在!");
+        }
+        if(StringUtils.isEmpty(itemMst.getItemCategoryCode())){
+            throw new BizException("商品对应的商品大类编号为空");
+        }
+        if (null == locator){
+            throw new BizException("查询货位信息失败!");
+        }
+        OutBoundRequestVO vo = new OutBoundRequestVO();
+        vo.setMsgId(IdUtil.fastSimpleUUID());
+        vo.setWarehouseId(dInfo.getWarehouseId());
+        vo.setGroupOrderPolicy("4");//按容器
+        List<OutBoundRequestItemVO> subList =new ArrayList<>();
+        OutBoundRequestItemVO outBoundRequestItemVO =new OutBoundRequestItemVO();
+        outBoundRequestItemVO.setWorkType(OutBoundRequestEnum.INV_CONSERVE.getWorkType());
+        outBoundRequestItemVO.setBusinessType(OutBoundRequestEnum.INV_CONSERVE.getBusinessType());
+        outBoundRequestItemVO.setWaveNo("");
+        outBoundRequestItemVO.setTaskId(dInfo.getPlanId());
+        outBoundRequestItemVO.setBillNo(dInfo.getPlanId());
+        outBoundRequestItemVO.setStr1("0");
+        outBoundRequestItemVO.setStr2("0");
+        outBoundRequestItemVO.setCompanyId(dInfo.getCargoOwnerId());
+        outBoundRequestItemVO.setCompanyName("");
+        if ("AGVL".equals(locator.getWarehouseAreaCode())) {
+            outBoundRequestItemVO.setItemId(dInfo.getItemId());
+            outBoundRequestItemVO.setLotId(dInfo.getBatchId());
+        } else {
+            outBoundRequestItemVO.setContainerNo(dInfo.getContainerCode());
+        }
+        outBoundRequestItemVO.setTaskLineId(dInfo.getId());
+        outBoundRequestItemVO.setPriority(10D);
+        outBoundRequestItemVO.setOwnerId(dInfo.getCargoOwnerId());
+        outBoundRequestItemVO.setEnterpriseId(dInfo.getEnterpriseId());
+//        List<BaseWmsWarehouseArea> area = RestMsgHelper.unpack(warehouseClient.getWarehouseAreaBasicInfos(new String[]{locator.getWarehouseAreaId()}));
+        outBoundRequestItemVO.setWmsLocationCode("MJK".equals(locator.getWarehouseAreaCode()) ? "MJZ" : locator.getWarehouseAreaCode());
+        outBoundRequestItemVO.setTargetArea("");
+        subList.add(outBoundRequestItemVO);
+        vo.setSubList(subList);
+        return vo;
+    }
+    private List<DxiGspMaintenanceRecord> spellDxi(List<GspUpkeepCheck> list) {
+        //组合id
+        String[] locatorIds = list.stream().map(GspUpkeepCheck::getLocatorId).distinct().toArray(String[]::new);
+        //请求仓库信息,超长已经设置长度
+        RestMessage<List<WarehouseLocatorBasicInfo>> warehouseResult = warehouseClient.getLocationBasicInfos(locatorIds);
+        List<DxiGspMaintenanceRecord> retList = new ArrayList<>();
+        List<BatchNumberListVO> batchNumberListVOList = null;
+        String[] batchIds = list.stream().map(GspUpkeepCheck::getBatchId).distinct().toArray(String[]::new);
+        RestMessage<List<BatchNumberListVO>> upKeepDictResult = inventoryClient.getBatchNumberBasicInfo(batchIds);
+        if (upKeepDictResult != null && upKeepDictResult.isSuccess() && upKeepDictResult.getData() != null) {
+            batchNumberListVOList = upKeepDictResult.getData();
+        }
+        //获取货主信息
+        String[] ids = list.stream().map(x -> x.getCargoOwnerId()).distinct().toArray(String[]::new);
+        RestMessage<Map<String, BaseCargoOwnerMst>> cargoOwnerMstByIds = chainClient.getCargoOwnerMstByIds(ids);
+        Map<String, BaseCargoOwnerMst> data = null;
+        if (cargoOwnerMstByIds != null && cargoOwnerMstByIds.isSuccess() && upKeepDictResult.getData() != null) {
+            data = cargoOwnerMstByIds.getData();
+        }
+        //获取商品信息
+        String[] itemIds = list.stream().map(x -> x.getItemId()).distinct().toArray(String[]::new);
+        RestMessage<List<ItemBaseInfoVO>> itemBaseList = itemClient.getItemBaseList(itemIds);
+        List<ItemBaseInfoVO> infoList = null;
+        if (itemBaseList != null && itemBaseList.isSuccess() && upKeepDictResult.getData() != null) {
+            infoList = itemBaseList.getData();
+        }
+        List<DxiGspMaintenanceRecordVO> recordVOList = new ArrayList<>();
+        UserDTO userDTO = userTemplate.getUserDTO();
+        if (null == userDTO){
+            userDTO = new UserDTO();
+            userDTO.setId("EIS");
+            userDTO.setNickname("EIS");
+        }
+        BaseWmsWarehouseMst wmsWarehouseMst = null;
+
+        for (int i = 0; i < list.size(); i++) {
+            GspUpkeepCheck dto = list.get(i);
+            ItemBaseInfoVO baseInfoVO = infoList.stream().filter(x -> x.getItemId().equals(dto.getItemId())).findFirst().orElse(null);
+            if (i == 0) {
+                RestMessage<BaseWmsWarehouseMst> itemResultWarehouse = warehouseClient.warehouse(dto.getWarehouseId());
+                if (itemResultWarehouse.isSuccess() && itemResultWarehouse.getData() != null) {
+                    wmsWarehouseMst = itemResultWarehouse.getData();
+                }
+            }
+            DxiGspMaintenanceRecord omsDto = new DxiGspMaintenanceRecord();
+            omsDto.setBillid(dto.getId());//单据ID
+            omsDto.setBillno(dto.getCode());//单据编号
+            omsDto.setBranchid(dto.getWarehouseId());//仓库ID
+            if (wmsWarehouseMst != null) {
+                omsDto.setBranchcode(wmsWarehouseMst.getWarehouseCode());
+                omsDto.setBranchname(wmsWarehouseMst.getWarehouseName());//仓库名称
+            }
+            omsDto.setConsignorid(dto.getCargoOwnerId());//货主ID
+            omsDto.setConsignorname(dto.getCargoOwnerName());//货主名称
+            omsDto.setLineid(dto.getId());//行ID
+            omsDto.setSeqno("1");//行号
+            omsDto.setBilldate(dto.getPlanUpkeepDate());//养护计划日期
+            omsDto.setItemid(dto.getItemId());//商品ID
+            omsDto.setItemcode(baseInfoVO.getItemCode());//商品编号
+            omsDto.setItemname(baseInfoVO.getItemName());//商品名称
+            omsDto.setLotno(dto.getLotNum());//批号
+            omsDto.setLocno(dto.getLocatorCode());//货位编号
+            omsDto.setStockqty(dto.getStockQty());//库存数量
+            Integer isProtected = dto.getIsProtected();
+            if (isProtected == null) {
+                omsDto.setItemtype("1");//养护商品类型
+            } else {
+                omsDto.setItemtype(isProtected.toString());//养护商品类型
+            }
+            omsDto.setStockstate(dto.getQualityStatus());
+            Integer conclusion = dto.getConclusion();
+            if ("1".equals(conclusion)) {//商品库存状态
+                omsDto.setStockstate("合格");
+            } else if ("2".equals(conclusion)) {
+                omsDto.setStockstate("不合格");
+            }
+            omsDto.setStatus(conclusion.toString());//养护审核状态
+            omsDto.setSourcetype("WMS");//养护数据来源
+            omsDto.setUpkeepoperator(dto.getUpkeepOperator());//养护员
+            omsDto.setProcessopinion(dto.getProcessOpinion());//处理意见
+            omsDto.setRecheckoperator(dto.getCheckOperator());//复检员
+            omsDto.setRecheckopinion(dto.getCheckOpinion());//复检意见
+            omsDto.setAuditoperator(dto.getRecheckOperator());//审核员
+            omsDto.setAuditopinion(dto.getRecheckOpinion());//审核意见
+            omsDto.setCheckoperation(spellUpkeepOperation(dto));
+            omsDto.setQualifiedqty(dto.getUpkeepQty());//养护数量
+            omsDto.setPendingqty(dto.getPendingQty() == null ? "0" : dto.getPendingQty().toString());//养护待处理数量
+            omsDto.setQualitystatus(dto.getQualityStatus());//质量状况
+            omsDto.setThstatus(dto.getThsTatus());//温湿度状况
+            omsDto.setPendingreason(dto.getPendingReason());//养护待处理原因
+            omsDto.setUpkeepdate(dto.getUpkeepDate());//养护时间
+            omsDto.setRecheckdate(dto.getRecheckDate());//复检日期
+            String remark = dto.getRemark();
+            omsDto.setRemark(remark);//备注
+            //		omsDto.setAttr_str1();//字符扩展属性1
+            if (batchNumberListVOList != null && batchNumberListVOList.size() > 0) {
+                BatchNumberListVO vo = batchNumberListVOList.stream().filter(item -> item.getBatchId().equals(dto.getBatchId())).findFirst().orElse(null);
+                if (vo != null) {
+                    omsDto.setAttrStr2(vo.getBatchProductionDateShow());
+                    omsDto.setAttrStr3(vo.getBatchExpiredDateShow());
+                }
+            }
+            //		omsDto.setAttr_num1();//字符扩展属性3
+            //		omsDto.setAttr_num2();//字符扩展属性4
+            //		omsDto.setAttr_dte1();//字符扩展属性5
+            //		omsDto.setAttr_dte2();//字符扩展属性6
+            omsDto.setCheckmemo("现场查看");
+            omsDto.setCreateby(userDTO.getUsername());//录入员
+            omsDto.setCreatedate(dto.getGmtCreate());//录入时间
+            omsDto.setLastmodifyby(dto.getModifierName());//修改人
+            omsDto.setLastmodifydate(dto.getGmtModified());//修改时间
+            omsDto.setEnterpriseid(userDTO.getEnterpriseId());//dto.getEnterpriseId();//企业ID
+            omsDto.setEnterprisename(userDTO.getEnterpriseName());//企业名称
+            if (!StringUtils.isBlank(remark) && "近效期".equals(remark)) {
+                omsDto.setIsneardate("是");
+            } else {
+                omsDto.setIsneardate("否");
+            }
+            Optional<WarehouseLocatorBasicInfo> optional = warehouseResult.getData().stream().filter(y -> y.getWarehouseLocatorId().equals(dto.getLocatorId())).findFirst();
+            if (optional.isPresent()) {
+                WarehouseLocatorBasicInfo locatorBasicInfo = optional.get();
+                omsDto.setBuilding(locatorBasicInfo.getBldgName());
+            }
+
+            retList.add(omsDto);
+
+            //封装OMS接口平台对象
+            DxiGspMaintenanceRecordVO recordVO = new DxiGspMaintenanceRecordVO();
+            recordVO.setBillno(dto.getCode());//单据编号
+            recordVO.setBilldate(DateUtils.format(dto.getPlanUpkeepDate(),"yyyy-MM-dd HH:mm:ss"));//养护计划日期
+            if (isProtected == null) {
+                recordVO.setMaintenanceType("1");//养护商品类型
+            } else {
+                recordVO.setMaintenanceType(isProtected.toString());//养护商品类型
+            }
+            if (wmsWarehouseMst != null) {
+                recordVO.setBranchcode(wmsWarehouseMst.getWarehouseCode());
+            }
+            if(data!=null){
+                BaseCargoOwnerMst baseCargoOwnerMst = data.get(dto.getCargoOwnerId());
+                recordVO.setConsignorcode(baseCargoOwnerMst!=null?baseCargoOwnerMst.getCargoOwnerCode():"");
+            }
+            recordVO.setItemcode(dto.getItemCode());
+            if(infoList!=null){
+                if(baseInfoVO!=null){
+                    recordVO.setCapacity(baseInfoVO.getSpecification());
+                    recordVO.setFsymbol(baseInfoVO.getItemHealthApprovalNbr());
+                    recordVO.setFfactory(baseInfoVO.getManufacturerName());
+                }
+                recordVO.setMaintenanceMeasure("现场查看");
+                recordVO.setLotNo(dto.getLotNum());
+                recordVO.setOnhandQuantity(dto.getStockQty());
+                if ("1".equals(conclusion)) {//养护结论
+                    recordVO.setMaintenanceResult("合格");
+                } else if ("2".equals(conclusion)) {
+                    recordVO.setMaintenanceResult("不合格");
+                }
+                recordVO.setMaintenanceby(dto.getUpkeepOperator());
+                recordVO.setAuditby(dto.getRecheckOperator());
+                recordVO.setAuditOpinion(dto.getRecheckOpinion());
+                recordVO.setMaintenanceNum(dto.getUpkeepQty());
+                recordVO.setPendingNum(dto.getPendingQty()!=null?dto.getPendingQty().toString():"0");
+                recordVO.setQualityState(dto.getQualityStatus());
+                recordVO.setHumitureState(dto.getThsTatus());
+                recordVO.setManageReason(dto.getPendingReason());
+                recordVO.setRecheckby(dto.getCheckOperator());
+                recordVO.setMaintenanceDate(null == dto.getUpkeepDate()?null:DateUtils.format(dto.getUpkeepDate(),"yyyy-MM-dd HH:mm:ss"));
+                recordVO.setRecheckDate(null == dto.getRecheckDate()?null:DateUtils.format(dto.getRecheckDate(),"yyyy-MM-dd HH:mm:ss"));
+                recordVO.setReviewOpinion(dto.getRecheckOpinion());
+                recordVO.setRemark(dto.getRemark());
+                recordVO.setItemid(dto.getItemId());
+                recordVO.setPenterpriseid(dto.getEnterpriseId());
+                recordVOList.add(recordVO);
+            }
+        }
+        //调用接口平台推送养护记录
+        try {
+            if(recordVOList.size()>0){
+                if (StringUtils.isEmpty(dxiGspMaintenanceRecordUrl)) {
+                    throw new BizException("请求路径配置为空");
+                }
+                System.out.println(JSON.toJSONString(recordVOList));
+                logger.info("养护回传OMS====>"+JSON.toJSONString(recordVOList));
+                String url = dxiGspMaintenanceRecordUrl;
+                String result = HttpUtil.post(url, JSONObject.toJSONString(recordVOList));
+                JSONObject parse = JSONObject.parseObject(result);
+            }
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return retList;
+    }
+
+    private String spellUpkeepOperation(GspUpkeepCheck dto) {
+        String checkOperation;
+        if (dto.getCheckFanDuo() != null && dto.getCheckFanDuo())
+            checkOperation = "Y,";
+        else
+            checkOperation = "N,";
+        if (dto.getCheckChuShi() != null && dto.getCheckChuShi())
+            checkOperation = checkOperation + "Y,";
+        else
+            checkOperation = checkOperation + "N,";
+        if (dto.getCheckJiaShi() != null && dto.getCheckJiaShi())
+            checkOperation = checkOperation + "Y,";
+        else
+            checkOperation = checkOperation + "N,";
+
+        if (dto.getCheckShenWen() != null && dto.getCheckShenWen())
+            checkOperation = checkOperation + "Y,";
+        else
+            checkOperation = checkOperation + "N,";
+
+        if (dto.getCheckJiangWen() != null && dto.getCheckJiangWen())
+            checkOperation = checkOperation + "Y,";
+        else
+            checkOperation = checkOperation + "N,";
+
+        if (dto.getCheckChuChen() != null && dto.getCheckChuChen())
+            checkOperation = checkOperation + "Y,";
+        else
+            checkOperation = checkOperation + "N,";
+
+        if (dto.getCheckWaiGuan() != null && dto.getCheckWaiGuan())
+            checkOperation = checkOperation + "Y,";
+        else
+            checkOperation = checkOperation + "N,";
+
+        if (dto.getCheckBaoZhuang() != null && dto.getCheckBaoZhuang())
+            checkOperation = checkOperation + "Y,";
+        else
+            checkOperation = checkOperation + "N,";
+
+        if (dto.getCheckChenChuTiaoJian() != null && dto.getCheckChenChuTiaoJian())
+            checkOperation = checkOperation + "Y,";
+        else
+            checkOperation = checkOperation + "N,";
+
+        if (dto.getCheckTongFeng() != null && dto.getCheckTongFeng())
+            checkOperation = checkOperation + "Y";
+        else
+            checkOperation = checkOperation + "N";
+        return checkOperation;
+    }
+
+    @Override
+    @Transactional
+    public void confirmUpkeepMove(String[] arrList) {
+        MapToolKit put = MapUtils.put("status", "6").put("gmtModified", new Date());
+        for (int i = 0; i < arrList.length; i++) {
+            mapper.updateMapById(arrList[i], put.getMap(), GspUpkeepCheck.class);
+        }
+    }
+
+    /**
+     * 调用接口平台
+     *
+     * @param interfaceId
+     * @param list
+     * @return
+     */
+    public JSONObject askIntegration(String interfaceId, List<GspUpkeepCheck> list) {
+        Map paramMap = MapUtils.put("token", token).put("interfaceId", interfaceId).getMap();
+        if (list != null) {
+            List paramList = new ArrayList<>();
+            String paramKey = "param";
+            // 需要依据接口来组织请求数据
+            for (GspUpkeepCheck upkeepCheck : list) {
+                if (interfaceId.equals(sendDeviceId)) {
+                    // wms-agv养护下传3
+                    // 生成计划时养护数和待处理数量都为0,养护人为空
+                    upkeepCheck.setUpkeepQty("0");
+                    upkeepCheck.setPendingQty(BigDecimal.ZERO);
+                    upkeepCheck.setUpkeepOperator("");
+
+                    paramKey = "resultData";
+                    paramList.add(upkeepCheck);
+                }
+
+                if (interfaceId.equals(updateDeviceId)) {
+                    // 养护WMS回传AGV状态3
+                    paramList.add(MapUtils.put("id", upkeepCheck.getId()).getMap());
+                }
+
+                if (interfaceId.equals(updateDeviceOkId)) {
+                    // 养护WMS回传AGV,待处理结论合格回传3
+                    Map paramM;
+                    if (upkeepCheck.getConclusion().equals("1")) {
+                        // 复检合格
+                        paramM = MapUtils.put("id", upkeepCheck.getId()).put("okQty", upkeepCheck.getUpkeepQty()).put("pendingQty", "0").put("status", "4").getMap();
+                    } else {
+                        // 复检不合格
+                        paramM = MapUtils.put("id", upkeepCheck.getId()).put("okQty", "0").put("pendingQty", upkeepCheck.getUpkeepQty()).put("status", "5").getMap();
+                    }
+                    paramList.add(paramM);
+                }
+            }
+            paramMap.put("data", MapUtils.put(paramKey, paramList).getMap());
+        }
+        logger.info("integrationResource.httpService入参为interfaceId:" + interfaceId + ",data:" + JSONObject.toJSONString(list));
+        String result = integrationResource.httpService(paramMap);
+        logger.info("integrationResource.httpService返回为interfaceId:" + interfaceId + ",result:" + result);
+        JSONObject json = JSONObject.parseObject(result);
+        if (json.containsKey("success") && !json.getBoolean("success")) {
+            throw new PrologException("接口平台调用错误:" + json);
+        }
+        return json;
+    }
+}

+ 70 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/eis/EisGspHandler.java

@@ -0,0 +1,70 @@
+package com.prolog.cs.base.gsp.service.impl.eis;
+
+import com.prolog.cs.base.gsp.service.MqGspProducer;
+import com.prolog.entity.dto.QueryContainerPositionDTO;
+import com.prolog.entity.vo.*;
+import com.prolog.inte.EisHandler;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+@Slf4j
+@Service
+public class EisGspHandler implements EisHandler {
+
+    @Resource
+    private MqGspProducer producer;
+
+
+    /**
+     * 出库任务推送
+     */
+    @Override
+    public void outBoundRequest(List<OutBoundRequestVO> list) {
+        producer.outBoundRequest(list);
+    }
+
+
+
+    /**
+     * 作业完成确认
+     */
+    @Override
+    public void operationComplete(List<OperationCompleteVO> list) {
+        producer.operationComplete(list);
+    }
+
+    /**
+     * 盘点审核信息推送
+     */
+    @Override
+    public void inventoryAudit(List<InventoryAuditVO> list) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * 托盘库存点位查询接口
+     */
+    @Override
+    public List<QueryContainerPositionDTO> queryContainerPosition(QueryContainerPositionVO vo) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * 盘点库存锁定
+     */
+    @Override
+    public void inventoryLock(List<InventoryLockVO> list) {
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * 容器借道下发
+     */
+    @Override
+    public void containerTailgatingRequest(List<ContainerTailgatingRequestVO> list) {
+        throw new UnsupportedOperationException();
+    }
+}

+ 82 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/mq/RabbitMqGspConsumerImpl.java

@@ -0,0 +1,82 @@
+package com.prolog.cs.base.gsp.service.impl.mq;
+
+import cn.hutool.core.lang.Assert;
+import cn.hutool.core.util.IdUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.prolog.cs.base.gsp.service.GspUpkeepCheckService;
+import com.prolog.cs.base.gsp.service.MqGspConsumer;
+import com.prolog.cs.base.gsp.service.MqGspProducer;
+import com.prolog.entity.vo.OutboundTaskCallbackItemVO;
+import com.prolog.entity.vo.OutboundTaskCallbackVO;
+import com.prolog.framework.core.exception.BizException;
+import com.prolog.upcloud.base.wh.operate.model.EisLog;
+import com.rabbitmq.client.Channel;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Exchange;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.QueueBinding;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import static com.prolog.constant.EisBusinessConstant.EIS;
+import static com.prolog.constant.EisInterfaceConstant.OUTBOUND_TASK_CALLBACK;
+import static com.prolog.constant.RabbitMqConstant.*;
+
+@Slf4j
+@Component
+public class RabbitMqGspConsumerImpl implements MqGspConsumer {
+
+    @Resource
+    private MqGspProducer producer;
+
+    @Resource
+    private GspUpkeepCheckService gspUpkeepCheckService;
+
+
+    @Override
+    @RabbitListener(bindings = @QueueBinding(exchange = @Exchange(EIS2WMS_GSP_TASK_CALLBACK_EXCHANGE), key = EIS2WMS_GSP_TASK_CALLBACK_ROUTING_KEY, value = @Queue(EIS2WMS_GSP_TASK_CALLBACK_QUEUE)))
+    public void gspTaskCallback(Message message, Channel channel) {
+        final String params = new String(message.getBody());
+        handleAndSaveLog(() -> {
+            OutboundTaskCallbackVO vo = JSONObject.parseObject(params, OutboundTaskCallbackVO.class);
+            List<String> ids = vo.getSubList().stream().map(OutboundTaskCallbackItemVO::getTaskLineId).distinct().collect(Collectors.toList());
+            Assert.notEmpty(ids, "任务行号不能为空");
+            gspUpkeepCheckService.callbackPushTask(ids);
+        }, params, OUTBOUND_TASK_CALLBACK);
+    }
+
+    public void handleAndSaveLog(WmsHandleFunctional func, String params, String url) {
+        EisLog eisLog = new EisLog();
+        eisLog.setId(IdUtil.fastSimpleUUID());
+        eisLog.setInitiator(EIS);
+        eisLog.setStatus(1);
+        eisLog.setUrl(url);
+        eisLog.setRequest(params);
+        eisLog.setGmtCreate(new Date());
+        try {
+            func.accept();
+        } catch (Exception e) {
+            eisLog.setStatus(2);
+            eisLog.setGmtModified(new Date());
+            eisLog.setResponse(e.getMessage());
+            producer.saveEisLog(eisLog);
+            log.error("", e);
+            return;
+        }
+        eisLog.setResponse("接收请求成功");
+        eisLog.setGmtModified(new Date());
+        producer.saveEisLog(eisLog);
+    }
+
+    @FunctionalInterface
+    public interface WmsHandleFunctional {
+        void accept() throws BizException;
+    }
+
+}

+ 38 - 0
upcloud-base-gsp/upcloud-base-gsp-service/src/main/java/com/prolog/cs/base/gsp/service/impl/mq/RabbitMqGspProducerImpl.java

@@ -0,0 +1,38 @@
+package com.prolog.cs.base.gsp.service.impl.mq;
+
+import com.alibaba.fastjson.JSONObject;
+import com.prolog.cs.base.gsp.service.MqGspProducer;
+import com.prolog.entity.vo.OperationCompleteVO;
+import com.prolog.entity.vo.OutBoundRequestVO;
+import com.prolog.upcloud.base.wh.operate.model.EisLog;
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+import static com.prolog.constant.RabbitMqConstant.*;
+
+@Service
+public class RabbitMqGspProducerImpl implements MqGspProducer {
+
+    @Resource
+    private RabbitTemplate rabbitTemplate;
+
+    @Override
+    public void outBoundRequest(List<OutBoundRequestVO> list) {
+        rabbitTemplate.convertAndSend(WMS2EIS_OUTBOUND_REQUEST_EXCHANGE, WMS2EIS_OUTBOUND_REQUEST_ROUTING_KEY, JSONObject.toJSONString(list));
+    }
+
+    @Override
+    public void operationComplete(List<OperationCompleteVO> list) {
+        rabbitTemplate.convertAndSend(WMS2EIS_OPERATION_COMPLETE_EXCHANGE, WMS2EIS_OPERATION_COMPLETE_ROUTING_KEY, JSONObject.toJSONString(list));
+    }
+
+    @Override
+    public void saveEisLog(EisLog eisLog) {
+        if (eisLog != null) {
+            rabbitTemplate.convertAndSend(WMS2EIS_SAVE_LOG_EXCHANGE, WMS2EIS_SAVE_LOG_ROUTING_KEY, JSONObject.toJSONString(eisLog));
+        }
+    }
+}

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott