plg-xiongt 4 долоо хоног өмнө
parent
commit
b569276dd2
100 өөрчлөгдсөн 4795 нэмэгдсэн , 125 устгасан
  1. 2 1
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-facade/src/main/java/com/prolog/cs/biz/inbound/constant/InboundBizConstant.java
  2. 2 2
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-facade/src/main/java/com/prolog/cs/biz/inbound/model/SupervisionCode.java
  3. 6 0
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-facade/src/main/java/com/prolog/cs/biz/inbound/service/rqc/RqcHeadersService.java
  4. 54 0
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-facade/src/main/java/com/prolog/cs/biz/inbound/vo/SupervisionCodeImportVo.java
  5. 1 1
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/controller/SupervisionCodeController.java
  6. 69 0
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/controller/SupervisionCodeExcelController.java
  7. 20 0
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/controller/rqc/RqcHeadersController.java
  8. 14 0
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/dao/rcv/RcvHeadersMapper.java
  9. 9 0
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/remote/BaseInventoryRemoteCaller.java
  10. 5 0
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/remote/BaseInventoryRemoteCallerFallBack.java
  11. 9 0
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/remote/OutboundCaller.java
  12. 581 0
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/service/impl/SupervisionCodeExcelHandler.java
  13. 12 2
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/service/impl/SupervisionCodeServiceImpl.java
  14. 266 2
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/service/impl/rqc/RqcHeadersServiceImpl.java
  15. 1 1
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/service/impl/task/TaskStraightServiceImpl.java
  16. 153 0
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/utils/ExcelUtil.java
  17. 9 2
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/utils/UploadCircubillUtil.java
  18. 56 2
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/resources/mappers/mysql/InRcvHeaders.xml
  19. BIN
      upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/resources/template/supervisionCodeTemplate.xlsx
  20. 130 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/model/EisMovePush.java
  21. 1 1
      upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/model/WmsMoveH.java
  22. 3 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/model/WmsReplenishH.java
  23. 68 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/vo/EisMovePushSubBeanVO.java
  24. 28 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/vo/EisMovePushVO.java
  25. 3 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/vo/MoveDListVO.java
  26. 8 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/vo/WmsMoveSaveVO.java
  27. 49 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/controller/EisMovePushController.java
  28. 17 1
      upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/controller/ReplenishController.java
  29. 19 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/dao/EisMovePushMapper.java
  30. 11 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/resource/StockResource.java
  31. 21 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/service/EisMovePushService.java
  32. 5 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/service/WmsReplenishService.java
  33. 435 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/service/impl/EisMovePushServiceImpl.java
  34. 33 2
      upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/service/impl/MoveServiceImpl.java
  35. 106 23
      upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/service/impl/ReplenishServiceImpl.java
  36. 6 2
      upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/service/impl/eis/WmsOperateHandler.java
  37. 11 0
      upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/resources/mappers/mysql/EisMovePushMapper.xml
  38. 2 2
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/OmsDoBillHDO.java
  39. 9 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/dto/BillPackageDTO.java
  40. 37 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/dto/EisStockContainerNoDTO.java
  41. 12 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/entity/BarcodeHDO.java
  42. 6 2
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/entity/OmsDoBillDDO.java
  43. 13 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/tms/TmsShipBillPackageItem.java
  44. 21 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/tms/TmsShipBillPackageItemDetail.java
  45. 14 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/vo/OmsBillDDVO.java
  46. 15 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/vo/ReceiveDoBillDetailVO.java
  47. 6 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/vo/ReceiveDoBillVO.java
  48. 2 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/vo/faceorder/FaceOrderAddVO.java
  49. 2 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/service/DoPringService.java
  50. 7 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/service/IOmsDoBillDService.java
  51. 2 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/service/WavesService.java
  52. 15 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/controller/OmsDoBillDController.java
  53. 3 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/controller/PickTaskAppController.java
  54. 7 2
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/controller/RFOutCheckController.java
  55. 8 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/controller/WavesController.java
  56. 2 2
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/controller/print/DoPringController.java
  57. 16 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/convert/TmsConvert.java
  58. 3 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/dao/BarcodeDMapper.java
  59. 3 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/resource/OperateResource.java
  60. 28 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/OmsDoBillDServiceImpl.java
  61. 58 6
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/OmsDoBillHServiceImpl.java
  62. 7 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/PackServiceImpl.java
  63. 88 8
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/PickTaskAppServiceImpl.java
  64. 26 6
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/PickTaskServiceImpl.java
  65. 65 1
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/WavesServiceImpl.java
  66. 7 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/WorkStageServiceImpl.java
  67. 1 1
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/faceorder/BaseFaceOrderHandler.java
  68. 2 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/faceorder/EmsKyFaceOrderHandler.java
  69. 5 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/faceorder/FaceOrderServiceImpl.java
  70. 99 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/print/DoPringServiceImpl.java
  71. 23 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/tms/TmsServiceImpl.java
  72. 17 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/resources/mappers/mysql/BarCodeDMapper.xml
  73. 2 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/resources/mappers/mysql/BarCodeHMapper.xml
  74. 0 1
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/resources/mappers/mysql/OmsBillHMapper.xml
  75. 2 2
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/resources/mappers/mysql/PickTaskDMapper.xml
  76. 1 0
      upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/resources/mappers/mysql/PickTaskMapper.xml
  77. 1 0
      upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/AGVpickDistribution/js/config.js
  78. 49 0
      upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/InventoryLocking/api.js
  79. 210 0
      upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/InventoryLocking/config.js
  80. 238 0
      upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/InventoryLocking/index.vue
  81. 4 5
      upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/serviceSettings.js
  82. 1 6
      upcloud-wms-qingniu-web/src/views/kzyWMS/QualityControl/inBoundSupervised/config/columns.js
  83. 19 6
      upcloud-wms-qingniu-web/src/views/kzyWMS/QualityControl/inBoundSupervised/config/searchItems.js
  84. 49 1
      upcloud-wms-qingniu-web/src/views/kzyWMS/QualityControl/inBoundSupervised/index.vue
  85. 9 19
      upcloud-wms-qingniu-web/src/views/kzyWMS/QualityControl/outBoundSupervised/config/columns.js
  86. 20 6
      upcloud-wms-qingniu-web/src/views/kzyWMS/QualityControl/outBoundSupervised/config/searchItems.js
  87. 10 1
      upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/api.js
  88. 148 0
      upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/components/api/index.js
  89. 741 0
      upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/components/scanCode.vue
  90. 141 0
      upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/components/workerLogin.vue
  91. 52 0
      upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/config/scanCode/gridform.js
  92. 48 0
      upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/config/scanCode/lefttable.js
  93. 60 0
      upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/config/scanCode/righttable.js
  94. 42 3
      upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/index.vue
  95. 1 0
      upcloud-wms-qingniu-web/src/views/kzyWMS/bound/replenishment/accord.vue
  96. 1 0
      upcloud-wms-qingniu-web/src/views/kzyWMS/bound/replenishment/config/accord.js
  97. 8 0
      upcloud-wms-qingniu-web/src/views/kzyWMS/outBound/api/api.js
  98. 32 1
      upcloud-wms-qingniu-web/src/views/kzyWMS/outBound/config/create1.js
  99. 51 1
      upcloud-wms-qingniu-web/src/views/kzyWMS/outBound/schedule/create.vue
  100. 1 1
      upcloud-wms-qingniu-web/vue.config.js

+ 2 - 1
upcloud-base-wh-inbound/upcloud-base-wh-inbound-facade/src/main/java/com/prolog/cs/biz/inbound/constant/InboundBizConstant.java

@@ -49,6 +49,7 @@ public class InboundBizConstant {
 
 	public final static String[] EIS_DEVICE_AREA_CODES = {"AGVL", "AGVSP", "AGVQX", "AGVZ", "MJK","AGVZY"};
 
-	public final static String[] EIS_PAPER_AREA_CODES = {"ZJK", "ZYK", "WLK", "NHK"};
+//	public final static String[] EIS_PAPER_AREA_CODES = {"ZJK", "ZYK", "WLK", "NHK"};
+	public final static String[] EIS_PAPER_AREA_CODES = {"ZJK", "ZYK", "WLK"};
 
 }

+ 2 - 2
upcloud-base-wh-inbound/upcloud-base-wh-inbound-facade/src/main/java/com/prolog/cs/biz/inbound/model/SupervisionCode.java

@@ -65,7 +65,7 @@ public class SupervisionCode implements Serializable {
 	@Column(value = "upload_flag")
 	private String uploadFlag;
 
-	@ApiModelProperty(value = "上传类型 0-入库 1-出库")
+	@ApiModelProperty(value = "上传类型 0-入库 1-出库 2-GSP销毁")
 	@Column(value = "upload_type")
 	private Integer uploadType;
 
@@ -73,7 +73,7 @@ public class SupervisionCode implements Serializable {
 	@Column(value = "down_flag")
 	private Integer downFlag;
 
-	@ApiModelProperty(value = "保存监管码操作类型 0-初始 1-入库 2-出库")
+	@ApiModelProperty(value = "保存监管码操作类型 0-初始 1-入库 2-出库 3-GSP销毁")
 	@Column(value = "save_type")
 	private Integer saveType;
 

+ 6 - 0
upcloud-base-wh-inbound/upcloud-base-wh-inbound-facade/src/main/java/com/prolog/cs/biz/inbound/service/rqc/RqcHeadersService.java

@@ -164,6 +164,8 @@ public interface RqcHeadersService {
 
     void outBoundUploadCircubill(OutBoundUploadCircubParamVO vo);
 
+	void uploadCircubillPC (List<String> srcCodes);
+
 	void uploadCircubillTimer();
 
 	void saveSupervisionCodeSmallTimer();
@@ -172,4 +174,8 @@ public interface RqcHeadersService {
 
 	void saveCusEntIdTimer();
 
+	void saveCusEntIdTimerV2();
+
+    void saveEntIdTimer();
+
 }

+ 54 - 0
upcloud-base-wh-inbound/upcloud-base-wh-inbound-facade/src/main/java/com/prolog/cs/biz/inbound/vo/SupervisionCodeImportVo.java

@@ -0,0 +1,54 @@
+package com.prolog.cs.biz.inbound.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Description
+ * @Date 2021-03-06
+ */
+
+@ApiModel
+@Data
+public class SupervisionCodeImportVo implements Serializable {
+
+	@ApiModelProperty(value = "监管码")
+	private String supervisionCode;
+
+	@ApiModelProperty(value = "企业ID")
+	private String enterpriseId;
+
+	@ApiModelProperty(value = "仓库编码")
+	private String warehouseCode;
+
+	@ApiModelProperty(value = "货主编码")
+	private String cargoOwnerCode;
+
+	@ApiModelProperty(value = "商品编码")
+	private String itemCode;
+
+	@ApiModelProperty(value = "商品名称")
+	private String itemName;
+
+	@ApiModelProperty(value = "包装级别(0大-2小-1中)")
+	private String packLevel;
+
+	@ApiModelProperty(value = "批号")
+	private String manufacturerLotNum;
+
+	@ApiModelProperty(value = "父编码")
+	private String parentCode;
+
+	@ApiModelProperty(value = "单号")
+	private String refBillNo;
+
+	@ApiModelProperty(value = "监管类型")
+	private String saveType;
+
+	@ApiModelProperty(value = "日期")
+	private String date;
+
+}

+ 1 - 1
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/controller/SupervisionCodeController.java

@@ -88,7 +88,7 @@ public class SupervisionCodeController {
 			if(subtract1.compareTo(BigDecimal.ZERO)<0){
 				throw new BizException("当前包装数量大于剩余数量");
 			}
-			if(StringUtils.isNotBlank(dto.getSource()) && "out".equals(dto.getSource())){
+			if(StringUtils.isNotBlank(dto.getSource()) && ("out".equals(dto.getSource()) || "GSP-XH".equals(dto.getSource()))){
 				//管码需要有商品+批号+监管码的校验
 				supervisionCodeService.checkSupervisionCode(dto);
 			}

+ 69 - 0
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/controller/SupervisionCodeExcelController.java

@@ -0,0 +1,69 @@
+package com.prolog.cs.biz.inbound.controller;
+
+import com.prolog.cs.biz.inbound.service.impl.SupervisionCodeExcelHandler;
+import com.prolog.framework.common.message.RestMessage;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.*;
+
+
+/**
+ * @Description // TODO
+ * @Date 2021-06-03
+ */
+
+@Api(tags = "监管码excel导入")
+@RestController
+@RequestMapping("/supervisionCodeExcel")
+public class SupervisionCodeExcelController {
+
+	@Autowired
+	private SupervisionCodeExcelHandler supervisionCodeExcelHandler;
+
+	@ResponseBody
+	@GetMapping(value = "/downloadTemplate")
+	@ApiOperation(value = "导出模板", notes = "导出模板")
+	public void downloadTemplate(HttpServletResponse response){
+		response.setContentType("application/vnd.ms-excel;charset=utf-8");
+		InputStream input = null;
+		OutputStream output = null;
+		try {
+			//文件在资源目录下的相对路径,路径必须不以“/”开头。如“static/a.txt”
+			input = SupervisionCodeExcelController.class.getClassLoader().getResourceAsStream("template/supervisionCodeTemplate.xlsx");
+			response.setHeader("Content-disposition", "attachment; filename=template.xlsx");
+			response.setContentType("application/x-msdownload;");
+			output = response.getOutputStream();
+			int count = 0;
+			byte[] by = new byte[1024];
+			while ((count = (input.read(by))) != -1) {
+				output.write(by, 0, count);
+				output.flush();
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		} finally {
+			try {
+				if (output != null) {
+					output.close();
+				}
+				if (input != null) {
+					input.close();
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	@ApiOperation(value = "青牛监管码导入")
+	@PostMapping("/importSupervisionCodes")
+	public RestMessage<?> importSupervisionCodes(@RequestParam MultipartFile file) throws Exception {
+		supervisionCodeExcelHandler.importSupervisionCodes(file);
+		return RestMessage.newInstance(true, "导入成功", "");
+	}
+}

+ 20 - 0
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/controller/rqc/RqcHeadersController.java

@@ -303,6 +303,13 @@ public class RqcHeadersController {
 		return RestMessage.newInstance(true, "成功", null);
 	}
 
+	@ApiOperation("上传监管码,失败监管码重新上传-PC页面触发")
+	@PostMapping("/uploadCircubillPC")
+	public RestMessage<Object> uploadCircubillPC(@RequestBody List<String> srcCodes) {
+		rqcHeadersService.uploadCircubillPC(srcCodes);
+		return RestMessage.newInstance(true, "上传成功", null);
+	}
+
 	@ApiOperation("定时任务上传监管码,接口平台配置定时任务调用")
 	@PostMapping("/uploadCircubillTimer")
 	public RestMessage<Object> uploadCircubillTimer() {
@@ -332,4 +339,17 @@ public class RqcHeadersController {
 		return RestMessage.newInstance(true, "成功", null);
 	}
 
+	@ApiOperation("定时任务 定时查询客户码上放心平台ID")
+	@PostMapping("/saveCusEntIdTimerV2")
+	public RestMessage<Object> saveCusEntIdTimerV2() {
+		rqcHeadersService.saveCusEntIdTimerV2();
+		return RestMessage.newInstance(true, "成功", null);
+	}
+
+	@ApiOperation("定时任务 将已获取码上监管平台id的客户entid保存到对应订单监管码表中")
+	@PostMapping("/saveEntIdTimer")
+	public RestMessage<Object> saveEntIdTimer() {
+		rqcHeadersService.saveEntIdTimer();
+		return RestMessage.newInstance(true, "成功", null);
+	}
 }

+ 14 - 0
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/dao/rcv/RcvHeadersMapper.java

@@ -50,6 +50,8 @@ public interface RcvHeadersMapper extends BaseMapper<RcvHeaders> {
 
 	List<SupervisionCode> findSupervisionCodes(@Param("srcCodes") List<String> srcCodes);
 
+	List<SupervisionCode> findSupervisionCodesPC(@Param("srcCodes") List<String> srcCodes);
+
 	List<SupervisionCode> findUnDownLoadSupervisionCode();
 
 	List<SupervisionCodeSmall> findUnToHisSupervisionCode();
@@ -81,4 +83,16 @@ public interface RcvHeadersMapper extends BaseMapper<RcvHeaders> {
 	List<String> findUnSaveEntIdSrcCodeForCustomer();
 
 	List<String> findUnSaveEntIdSrcCodeForSupplier();
+
+	String findOutBillType(@Param("billno")String billno);
+
+	void saveEntIdByShippId(@Param("eleccode")String eleccode, @Param("shippId")String shippId);
+
+	List<BaseSupplierMst> findUnSaveSupplierEntId();
+
+	void saveSupplierEntId(@Param("entId") String entId, @Param("supplierId") String supplierId);
+
+	List<SupervisionCode> getUnEntIdSupervisionCodes();
+
+
 }

+ 9 - 0
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/remote/BaseInventoryRemoteCaller.java

@@ -106,4 +106,13 @@ public interface BaseInventoryRemoteCaller {
 
     @PostMapping("stock/v1/qty/avl-list")
     public RestMessage<List<WmsInvStockQtyVO>> getAvailableQuantity(@RequestBody List<WmsInvStockQtyQueryVO> qtyQueryVO);
+
+    /**
+     * 批量查询批次信息
+     *
+     * @param manufacturerLotNums
+     * @return
+     */
+    @PostMapping("/batch-number/get-by-manufacturerLotNums")
+    RestMessage<List<WmsInvBatchNumbers>> getListByManufacturerLotNums( @RequestParam(value = "manufacturerLotNums") String manufacturerLotNums);
 }

+ 5 - 0
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/remote/BaseInventoryRemoteCallerFallBack.java

@@ -98,5 +98,10 @@ public class BaseInventoryRemoteCallerFallBack implements BaseInventoryRemoteCal
 		return RestMessage.doError("远程调用库存失败!请重试");
 	}
 
+	@Override
+	public RestMessage<List<WmsInvBatchNumbers>> getListByManufacturerLotNums(String manufacturerLotNums) {
+		return RestMessage.doError("远程调用库存失败!请重试");
+	}
+
 
 }

+ 9 - 0
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/remote/OutboundCaller.java

@@ -3,10 +3,13 @@ package com.prolog.cs.biz.inbound.remote;
 import com.prolog.cs.biz.inbound.dto.RelationCodeResultDTO;
 import com.prolog.cs.biz.inbound.vo.RelationCodeResultVO;
 import com.prolog.cs.biz.outbound.model.ContainerBindTaskVO;
+import com.prolog.cs.biz.outbound.model.OmsDoBillHDO;
+import com.prolog.cs.biz.outbound.model.entity.OmsDoBillDDO;
 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 org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 
@@ -21,4 +24,10 @@ public interface OutboundCaller {
 
 	@PostMapping("/supervisionCode/relationSupervisionCode")
 	public RestMessage<List<RelationCodeResultDTO>> relationSupervisionCode(@RequestBody List<RelationCodeResultVO> resultVOS);
+
+	@PostMapping("/outboundOrder/getDoBillHByBillNos")
+	RestMessage<List<OmsDoBillHDO>> getDoBillHByBillNos( @RequestParam("billNos") String[] billNos, @RequestParam("warehouseId") String warehouseId);
+
+	@PostMapping("/outboundOrderLine/getDoBillDByBillNos")
+	RestMessage<List<OmsDoBillDDO>> getDoBillDByBillIds (@RequestBody List<String> billIds);
 }

+ 581 - 0
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/service/impl/SupervisionCodeExcelHandler.java

@@ -0,0 +1,581 @@
+package com.prolog.cs.biz.inbound.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.prolog.cs.basic.chain.model.cargo.BaseCargoOwnerMst;
+import com.prolog.cs.basic.chain.model.customer.BaseCustomerMst;
+import com.prolog.cs.basic.chain.model.supplier.BaseSupplierMst;
+import com.prolog.cs.basic.item.model.BaseMtlItemMst;
+import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseMst;
+import com.prolog.cs.biz.inbound.dao.OmsAsnBillDMapper;
+import com.prolog.cs.biz.inbound.dao.OmsAsnBillHMapper;
+import com.prolog.cs.biz.inbound.dao.SupervisionCodeMapper;
+import com.prolog.cs.biz.inbound.dao.rcv.RcvHeadersMapper;
+import com.prolog.cs.biz.inbound.model.OmsAsnBillD;
+import com.prolog.cs.biz.inbound.model.OmsAsnBillH;
+import com.prolog.cs.biz.inbound.model.SupervisionCode;
+import com.prolog.cs.biz.inbound.remote.*;
+import com.prolog.cs.biz.inbound.utils.ExcelUtil;
+import com.prolog.cs.biz.inbound.vo.SupervisionCodeImportVo;
+import com.prolog.cs.biz.outbound.model.OmsDoBillHDO;
+import com.prolog.cs.biz.outbound.model.entity.OmsDoBillDDO;
+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.restriction.Criteria;
+import com.prolog.framework.core.restriction.FieldSelector;
+import com.prolog.framework.core.restriction.Restriction;
+import com.prolog.framework.core.restriction.Restrictions;
+import com.prolog.upcloud.base.inventory.model.WmsInvBatchNumbers;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.Callable;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.FutureTask;
+import java.util.stream.Collectors;
+
+@Component
+public class SupervisionCodeExcelHandler {
+
+    @Autowired
+    private UserTemplate userTemplate;
+    @Autowired
+    private ChainRemoteCaller chainRemoteCaller;
+    @Autowired
+    private BaseInventoryRemoteCaller baseInventoryRemoteCaller;
+    @Autowired
+    private BaseItemRemoteCaller baseItemRemoteCaller;
+    @Autowired
+    private BaseWmsWarehouseCaller baseWmsWarehouseCaller;
+    @Autowired
+    private OutboundCaller outboundCaller;
+    @Autowired
+    private OmsAsnBillHMapper omsAsnBillHMapper;
+    @Autowired
+    private OmsAsnBillDMapper omsAsnBillDMapper;
+    @Autowired
+    private RcvHeadersMapper rcvHeadersMapper;
+    @Autowired
+    private SupervisionCodeMapper supervisionCodeMapper;
+
+    public void importSupervisionCodes(MultipartFile file) {
+        if(file == null){
+            return;
+        }
+        UserDTO userDTO = userTemplate.getUserDTO();
+
+        try {
+            List<SupervisionCodeImportVo> listAll = ExcelUtil.importExcel(file.getInputStream(), SupervisionCodeImportVo.class);
+            checkParams(listAll);
+
+            List<SupervisionCode> supervisionCodes = new ArrayList<>();
+            List<List<SupervisionCodeImportVo>> partitionedList = Lists.partition(listAll, 2);
+
+            CountDownLatch latch = new CountDownLatch(partitionedList.size());
+
+            for (List<SupervisionCodeImportVo> list : partitionedList) {
+                handleSupervisionCodeRunable runable = new handleSupervisionCodeRunable(latch, list,supervisionCodes,userDTO);
+                FutureTask ft = new FutureTask(runable);
+                new Thread(ft).start();
+                try {
+                    Object o = ft.get();
+                    if(o != null){
+                        throw new BizException("上传错误:"+String.valueOf(o));
+                    }
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                } catch (ExecutionException e) {
+                    e.printStackTrace();
+                }
+            }
+            try {
+                // 等待所有线程处理完成
+                latch.await();
+                if(supervisionCodes.size() > 0){
+                    supervisionCodeMapper.saveBatch(supervisionCodes);
+                }
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    /**
+     * 校验入参
+     * @param list
+     */
+    private void checkParams(List<SupervisionCodeImportVo> list) {
+        for (int i = 0; i < list.size(); i++) {
+            SupervisionCodeImportVo vo = list.get(i);
+
+            if(StringUtils.isBlank(vo.getSupervisionCode())){
+                throw new BizException("第"+(i+1)+"行,监管码不能为空!");
+            }
+            if(StringUtils.isBlank(vo.getEnterpriseId())){
+                throw new BizException("第"+(i+1)+"行,企业ID不能为空!");
+            }
+            if(StringUtils.isBlank(vo.getWarehouseCode())){
+                throw new BizException("第"+(i+1)+"行,仓库编码不能为空!");
+            }
+            if(StringUtils.isBlank(vo.getCargoOwnerCode())){
+                throw new BizException("第"+(i+1)+"行,货主不能为空!");
+            }
+            if(StringUtils.isBlank(vo.getItemCode())){
+                throw new BizException("第"+(i+1)+"行,商品编码不能为空!");
+            }
+            if(StringUtils.isBlank(vo.getPackLevel())){
+                throw new BizException("第"+(i+1)+"行,包装级别不能为空!");
+            }
+            if(StringUtils.isBlank(vo.getManufacturerLotNum())){
+                throw new BizException("第"+(i+1)+"行,批号不能为空!");
+            }
+            if(StringUtils.isBlank(vo.getRefBillNo())){
+                throw new BizException("第"+(i+1)+"行,单号不能为空!");
+            }
+            if(StringUtils.isBlank(vo.getSaveType())){
+                throw new BizException("第"+(i+1)+"行,监管类型不能为空!");
+            }
+            if(StringUtils.isBlank(vo.getDate())){
+                throw new BizException("第"+(i+1)+"行,日期不能为空!");
+            }
+
+            if(!"1".equals(vo.getSaveType()) && !"2".equals(vo.getSaveType())){
+                throw new BizException("第"+(i+1)+"行,监管类型只能为1和2!");
+            }
+        }
+        List<String> supervisionCodes = list.stream().map(item -> item.getSupervisionCode()+";"+item.getSaveType()).collect(Collectors.toList());
+        List<String> duplicates = supervisionCodes.stream().filter(i -> Collections.frequency(supervisionCodes, i) > 1)
+                .distinct()
+                .collect(Collectors.toList());
+        if(duplicates != null && duplicates.size() > 0){
+            throw new BizException("监管码:"+JSON.toJSONString(duplicates)+"重复!");
+        }
+    }
+
+    /**
+     * 查询仓
+     * @param list
+     * @return
+     */
+    private List<BaseWmsWarehouseMst> getWarehouseMstList(List<SupervisionCodeImportVo> list){
+        Set<String> warehouseCodes = list.stream().map(x -> x.getWarehouseCode()).collect(Collectors.toSet());
+        List<BaseWmsWarehouseMst> warehouseMstList = null;
+        if(warehouseCodes.size()>0){
+            RestMessage<Map<String, BaseWmsWarehouseMst>> byWarehouseCode = baseWmsWarehouseCaller.getByWarehouseCode(warehouseCodes);
+            if(byWarehouseCode.getData()!=null&&byWarehouseCode.isSuccess()){
+                Map<String, BaseWmsWarehouseMst> warehouseMstMap = byWarehouseCode.getData();
+                warehouseMstList = new ArrayList<>(warehouseMstMap.values());
+                if(warehouseMstList.size()==0){
+                    throw new BizException("仓库信息查询失败");
+                }
+            }else{
+                throw new BizException("仓库信息查询失败");
+            }
+        }
+        return warehouseMstList;
+    }
+
+    /**
+     * 查询货主
+     * @param list
+     * @return
+     */
+    private Map<String, BaseCargoOwnerMst> getCargoMap(List<SupervisionCodeImportVo> list){
+        Set<String> cargoOwnerCodes = list.stream().filter(p -> StringUtils.isNotBlank(p.getCargoOwnerCode()))
+                .map(SupervisionCodeImportVo::getCargoOwnerCode).collect(Collectors.toSet());
+
+        RestMessage<Map<String, BaseCargoOwnerMst>> cargoMapRet = chainRemoteCaller.getByCode(cargoOwnerCodes);
+        if(cargoMapRet==null || !cargoMapRet.isSuccess()){
+            throw new BizException("获取货主失败!");
+        }
+        Map<String, BaseCargoOwnerMst> cargoMap = cargoMapRet.getData();
+        Map<String, BaseCargoOwnerMst> cargoCodeMap = Maps.newHashMap();
+        for (String cargoOwnerId : cargoMap.keySet()) {
+            BaseCargoOwnerMst baseCargoOwnerMst = cargoMap.get(cargoOwnerId);
+            cargoCodeMap.put(baseCargoOwnerMst.getCargoOwnerCode(),baseCargoOwnerMst);
+        }
+
+        return cargoCodeMap;
+    }
+
+    /**
+     * 查询批次
+     * @param list
+     * @return
+     */
+    private List<WmsInvBatchNumbers> getBatchNumbers(List<SupervisionCodeImportVo> list){
+        Set<String> manufacturerLotNums = list.stream().filter(p -> StringUtils.isNotBlank(p.getManufacturerLotNum()))
+                .map(SupervisionCodeImportVo::getManufacturerLotNum).collect(Collectors.toSet());
+
+        RestMessage<List<WmsInvBatchNumbers>> listByManufacturerLotNums = baseInventoryRemoteCaller.getListByManufacturerLotNums(String.join(",", manufacturerLotNums));
+        if(listByManufacturerLotNums == null || !listByManufacturerLotNums.isSuccess() || listByManufacturerLotNums.getData() == null || listByManufacturerLotNums.getData().size() <= 0){
+            throw new BizException("根据批次号:"+ JSON.toJSONString(manufacturerLotNums)+"查询批次失败");
+        }
+        List<WmsInvBatchNumbers> wmsInvBatchNumbers = listByManufacturerLotNums.getData();
+        return wmsInvBatchNumbers;
+    }
+
+    /**
+     * 获取商品信息
+     * @param list
+     * @return
+     */
+    private List<BaseMtlItemMst> getIitemMstList(List<SupervisionCodeImportVo> list,BaseCargoOwnerMst baseCargoOwnerMst){
+        Set<String> itemCodes = list.stream().map(x->x.getItemCode()).collect(Collectors.toSet());
+        //请求商品信息
+        List<BaseMtlItemMst> itemMstList = null;
+        RestMessage<List<BaseMtlItemMst>> itemResult = baseItemRemoteCaller.getByItemCodesE(baseCargoOwnerMst.getCargoOwnerId(),itemCodes,baseCargoOwnerMst.getEnterpriseId());
+        if(itemResult.getData()!=null&&itemResult.isSuccess()){
+            itemMstList = itemResult.getData();
+            if(itemMstList.size()==0){
+                throw new BizException("商品信息查询失败");
+            }
+        }
+        return itemMstList;
+    }
+
+    /**
+     * 查询出库单和入库单
+     * @param list
+     * @param baseWmsWarehouseMst
+     * @param omsDoBillHDOList
+     * @param asnBillHList
+     */
+    private void getRefBills(List<SupervisionCodeImportVo> list,BaseWmsWarehouseMst baseWmsWarehouseMst,List<OmsDoBillHDO> omsDoBillHDOList,List<OmsAsnBillH> asnBillHList){
+        Map<String, List<SupervisionCodeImportVo>> map = list.stream().collect(Collectors.groupingBy(SupervisionCodeImportVo::getSaveType));
+        for (Map.Entry<String, List<SupervisionCodeImportVo>> entry : map.entrySet()) {
+            String key = entry.getKey();
+            List<SupervisionCodeImportVo> value = entry.getValue();
+            Set<String> billNos = value.stream().map(SupervisionCodeImportVo::getRefBillNo).collect(Collectors.toSet());
+            if("1".equals(key)){
+                Criteria crt = Criteria.forClass(OmsAsnBillH.class);
+                crt.setRestriction(Restrictions.in("billno", billNos.toArray()));
+                asnBillHList.addAll(omsAsnBillHMapper.findByCriteria(crt));
+//                asnBillHList.addAll(omsAsnBillHMapper.findByIds(OmsAsnBillH.class, billNos.toArray(), null));
+                if(asnBillHList == null || asnBillHList.size() <= 0){
+                    throw new BizException("根据入库单编码:"+JSON.toJSONString(billNos)+"查询入库单失败!");
+                }
+
+            }else {
+                RestMessage<List<OmsDoBillHDO>> doBillHByBillNos = outboundCaller.getDoBillHByBillNos(billNos.toArray(new String[billNos.size()]), baseWmsWarehouseMst.getWarehouseId());
+                if(doBillHByBillNos == null || !doBillHByBillNos.isSuccess() || doBillHByBillNos.getData() == null || doBillHByBillNos.getData().size() <= 0){
+                    throw new BizException("根据出库单编码:"+JSON.toJSONString(billNos)+"查询出库单失败!");
+                }
+                omsDoBillHDOList.addAll(doBillHByBillNos.getData());
+            }
+        }
+
+    }
+
+    /**
+     * 查询出入库单明细
+     * @param omsDoBillHDOList
+     * @param asnBillHList
+     * @param omsDoBillDDOS
+     * @param omsAsnBillDS
+     */
+    private void getrefBillDetails(List<OmsDoBillHDO> omsDoBillHDOList, List<OmsAsnBillH> asnBillHList, List<OmsDoBillDDO> omsDoBillDDOS, List<OmsAsnBillD> omsAsnBillDS) {
+        if(omsDoBillHDOList.size() > 0){
+            List<String> doBillIds = omsDoBillHDOList.stream().map(OmsDoBillHDO::getBillid).distinct().collect(Collectors.toList());
+            RestMessage<List<OmsDoBillDDO>> doBillDByBillIds = outboundCaller.getDoBillDByBillIds(doBillIds);
+            if(doBillDByBillIds == null || !doBillDByBillIds.isSuccess() || doBillDByBillIds.getData() == null || doBillDByBillIds.getData().size() <= 0){
+                throw new BizException("根据出库单:"+JSON.toJSONString(doBillIds)+"查询入库单明细失败!");
+            }
+            omsDoBillDDOS.addAll(doBillDByBillIds.getData());
+        }
+
+        if(asnBillHList.size() > 0 ){
+            List<String> asnBillIds = asnBillHList.stream().map(OmsAsnBillH::getBillid).distinct().collect(Collectors.toList());
+            Criteria crt = Criteria.forClass(OmsAsnBillD.class);
+            Restriction r1 =  Restrictions.in("billid", asnBillIds.toArray());
+            crt.setRestriction(Restrictions.and(r1));
+            omsAsnBillDS.addAll(omsAsnBillDMapper.findByCriteria(crt));
+            if(omsAsnBillDS.size() <= 0){
+                throw new BizException("根据入库单:"+JSON.toJSONString(asnBillIds)+"查询出库单明细失败!");
+            }
+        }
+    }
+
+    /**
+     * 获取客户供应商列表
+     * @param omsDoBillHDOList
+     * @param asnBillHList
+     * @param supplierMsts
+     * @param customerMsts
+     */
+    private void getShippers(List<OmsDoBillHDO> omsDoBillHDOList,
+                     List<OmsAsnBillH> asnBillHList,
+                     List<BaseSupplierMst> supplierMsts,
+                     List<BaseCustomerMst> customerMsts
+                     ){
+        List<String> shipperIds = omsDoBillHDOList.stream().map(OmsDoBillHDO::getShipperid).distinct().collect(Collectors.toList());
+        shipperIds.addAll(asnBillHList.stream().map(OmsAsnBillH :: getShipperid).distinct().collect(Collectors.toList()));
+        supplierMsts.addAll(rcvHeadersMapper.findSupplierMstByIds(shipperIds));
+        customerMsts.addAll(rcvHeadersMapper.findCustomerMstByIds(shipperIds));
+    }
+
+    /**
+     * 转换为监管码对象
+     * @param list
+     * @param warehouseMstList
+     * @param cargoMap
+     * @param batchNumbers
+     * @param iitemMstList
+     * @param omsDoBillHDOList
+     * @param asnBillHList
+     * @param supplierMsts
+     * @param customerMsts
+     * @return
+     */
+    private List<SupervisionCode> convertSupervisionCodes(List<SupervisionCodeImportVo> list,
+                                                          List<BaseWmsWarehouseMst> warehouseMstList,
+                                                          Map<String, BaseCargoOwnerMst> cargoMap,
+                                                          List<WmsInvBatchNumbers> batchNumbers,
+                                                          List<BaseMtlItemMst> iitemMstList,
+                                                          List<OmsDoBillHDO> omsDoBillHDOList,
+                                                          List<OmsAsnBillH> asnBillHList,
+                                                          List<BaseSupplierMst> supplierMsts,
+                                                          List<BaseCustomerMst> customerMsts,
+                                                          List<OmsDoBillDDO> omsDoBillDDOS,
+                                                          List<OmsAsnBillD> omsAsnBillDS,
+                                                          UserDTO userDTO
+                                                          ) {
+        List<SupervisionCode> result = new ArrayList<>();
+        for (int i = 0; i < list.size(); i++) {
+
+            SupervisionCodeImportVo vo = list.get(i);
+
+            SupervisionCode supervisionCode = new SupervisionCode();
+            supervisionCode.setSupervisionCode(vo.getSupervisionCode());
+            supervisionCode.setEnterpriseId(vo.getEnterpriseId());
+
+            supervisionCode.setWarehouseCode(vo.getWarehouseCode());
+            BaseWmsWarehouseMst baseWmsWarehouseMst = warehouseMstList.stream().filter(item -> item.getWarehouseCode().equals(vo.getWarehouseCode())).findFirst().orElse(null);
+            if(baseWmsWarehouseMst == null){
+                throw new BizException("根据仓编码:"+vo.getWarehouseCode()+"查询仓失败!");
+            }
+            supervisionCode.setWarehouseId(baseWmsWarehouseMst.getWarehouseId());
+
+            BaseCargoOwnerMst baseCargoOwnerMst = cargoMap.get(vo.getCargoOwnerCode());
+            if(baseCargoOwnerMst == null){
+                throw new BizException("根据货主编码:"+vo.getCargoOwnerCode()+"查询货主失败!");
+            }
+            supervisionCode.setCargoOwnerCode(baseCargoOwnerMst.getCargoOwnerCode());
+            supervisionCode.setCargoOwnerId(baseCargoOwnerMst.getCargoOwnerId());
+
+            BaseMtlItemMst baseMtlItemMst = iitemMstList.stream().filter(item -> item.getItemCode().equals(vo.getItemCode())).findFirst().orElse(null);
+            if(baseCargoOwnerMst == null){
+                throw new BizException("根据商品编码:"+vo.getItemCode()+"查询商品资料失败!");
+            }
+            if(baseMtlItemMst.getBaseMtlItemHealth().getItemHealthSuperviseflag()!=1){
+                throw new BizException("商品:"+baseMtlItemMst.getItemCode()+"不扫监管码!");
+            }
+            supervisionCode.setItemId(baseMtlItemMst.getItemId());
+            supervisionCode.setItemCode(baseMtlItemMst.getItemCode());
+            supervisionCode.setItemName(baseMtlItemMst.getItemName());
+            supervisionCode.setPackSize(String.valueOf(baseMtlItemMst.getBaseMtlItemUomConversionsList().get(0).getConversionRate()));
+
+            if("1".equals(vo.getSaveType())){
+                OmsAsnBillH omsAsnBillH = asnBillHList.stream().filter(item -> item.getBillno().equals(vo.getRefBillNo())).findFirst().orElse(null);
+                if(omsAsnBillH == null){
+                    throw new BizException("根据入库单号:"+vo.getRefBillNo()+"查询入库单失败!");
+                }
+                if(!"1".equals(omsAsnBillH.getBilltype()) && !"2".equals(omsAsnBillH.getBilltype())){
+                    throw new BizException("入库单:"+vo.getRefBillNo()+"单据类型不正确!");
+                }
+                supervisionCode.setRefBillId(omsAsnBillH.getBillid());
+                supervisionCode.setSrcCode(omsAsnBillH.getBillno());
+                supervisionCode.setSrcId(omsAsnBillH.getBillid());
+                supervisionCode.setBillType(omsAsnBillH.getBilltype());
+
+                supervisionCode.setSupplierId(omsAsnBillH.getShipperid());
+                supervisionCode.setSupplierCode(omsAsnBillH.getShippercode());
+                supervisionCode.setCompanyCode(omsAsnBillH.getShippercode());
+                supervisionCode.setUploadShippId(omsAsnBillH.getShipperid());
+
+                supervisionCode.setSupervisionType("1".equals(omsAsnBillH.getBilltype()) ? 0 : 1);
+
+                OmsAsnBillD omsAsnBillD = omsAsnBillDS.stream().filter(item -> item.getBillid().equals(omsAsnBillH.getBillid()) && item.getItemid().equals(baseMtlItemMst.getItemId())).findFirst().orElse(null);
+                if(omsAsnBillD == null){
+                    throw new BizException("入库单:"+vo.getRefBillNo()+",商品:"+baseMtlItemMst.getItemCode()+"查询入库单明细失败!");
+                }
+                supervisionCode.setPieceQty(String.valueOf(omsAsnBillD.getItemQty()));
+                supervisionCode.setRefBillLineId(omsAsnBillD.getLineid());
+
+            }else {
+                OmsDoBillHDO omsDoBillHDO = omsDoBillHDOList.stream().filter(item -> item.getBillno().equals(vo.getRefBillNo())).findFirst().orElse(null);
+                if(omsDoBillHDO == null){
+                    throw new BizException("根据出库单号:"+vo.getRefBillNo()+"查询出库单失败!");
+                }
+                if(!"1".equals(omsDoBillHDO.getBilltype())){
+                    throw new BizException("出库单:"+vo.getRefBillNo()+"单据类型不正确!");
+                }
+                supervisionCode.setRefBillId(omsDoBillHDO.getBillid());
+                supervisionCode.setSrcCode(omsDoBillHDO.getBillno());
+                supervisionCode.setSrcId(omsDoBillHDO.getBillid());
+                supervisionCode.setBillType(omsDoBillHDO.getBilltype());
+
+                supervisionCode.setSupplierId(omsDoBillHDO.getShipperid());
+                supervisionCode.setSupplierCode(omsDoBillHDO.getShipperCode());
+                supervisionCode.setCompanyCode(omsDoBillHDO.getShipperCode());
+                supervisionCode.setUploadShippId(omsDoBillHDO.getShipperid());
+
+                supervisionCode.setSupervisionType(2);
+
+                OmsDoBillDDO omsDoBillDDO = omsDoBillDDOS.stream().filter(item -> item.getBillid().equals(omsDoBillHDO.getBillid()) && item.getItemid().equals(baseMtlItemMst.getItemId())).findFirst().orElse(null);
+                if(omsDoBillDDO == null){
+                    throw new BizException("出库单:"+vo.getRefBillNo()+",商品:"+baseMtlItemMst.getItemCode()+"查询出库单明细失败!");
+                }
+                supervisionCode.setPieceQty(String.valueOf(omsDoBillDDO.getItemQty()));
+                supervisionCode.setRefBillLineId(omsDoBillDDO.getLineid());
+            }
+            supervisionCode.setSaveType(Integer.valueOf(vo.getSaveType()));
+            supervisionCode.setUploadFlag("0");
+            supervisionCode.setUploadType("1".equals(vo.getSaveType()) ? 0 : 1);
+            supervisionCode.setDownFlag(0);
+            supervisionCode.setUploadTimes(0);
+
+            supervisionCode.setCodeType("1");
+            supervisionCode.setPackLevel(vo.getPackLevel());
+            supervisionCode.setStatus("10");
+            supervisionCode.setBillno(vo.getRefBillNo());
+
+            WmsInvBatchNumbers wmsInvBatchNumbers = batchNumbers.stream().filter(item -> item.getManufacturerLotNum().equals(vo.getManufacturerLotNum())).findFirst().orElse(null);
+            if(wmsInvBatchNumbers == null){
+                throw new BizException("根据批次号:"+vo.getManufacturerLotNum()+"查询批次失败!");
+            }
+            supervisionCode.setManufacturerLotNum(vo.getManufacturerLotNum());
+            supervisionCode.setProductionDate(wmsInvBatchNumbers.getBatchProductionDate());
+            supervisionCode.setExpiredDate(wmsInvBatchNumbers.getBatchExpiredDate());
+
+            supervisionCode.setCreator(userDTO.getUserBizModel().getEmployeeNo());
+            supervisionCode.setModifier(userDTO.getUserBizModel().getEmployeeNo());
+            supervisionCode.setCreatorName(userDTO.getNickname());
+            supervisionCode.setModifierName(userDTO.getNickname());
+            supervisionCode.setGmtCreate(new Date());
+            supervisionCode.setGmtModified(new Date());
+            supervisionCode.setUnlock(0);
+
+            BaseSupplierMst baseSupplierMst = supplierMsts.stream().filter(item -> item.getSupplierId().equals(supervisionCode.getSupplierId())).findFirst().orElse(null);
+            if(baseSupplierMst == null){
+                BaseCustomerMst baseCustomerMst = customerMsts.stream().filter(item -> item.getCustomerId().equals(supervisionCode.getSupplierId())).findFirst().orElse(null);
+                if(baseCustomerMst == null){
+                    throw new BizException("根据供应商/客户编码:"+supervisionCode.getSupplierCode()+"查询失败!");
+                }
+                supervisionCode.setEntId(baseCustomerMst.getEleccode());
+                supervisionCode.setUploadShippId(baseCustomerMst.getCustomerId());
+            }else {
+                supervisionCode.setEntId(baseSupplierMst.getEleccode());
+                supervisionCode.setUploadShippId(baseSupplierMst.getSupplierId());
+            }
+
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            try {
+                supervisionCode.setScanDate(simpleDateFormat.parse(vo.getDate()));
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+
+            result.add(supervisionCode);
+        }
+        return result;
+    }
+
+    /**
+     * 处理监管码对象
+     * @param list
+     * @param supervisionCodes
+     * @param userDTO
+     */
+    private void handleSupervisionCode(List<SupervisionCodeImportVo> list,List<SupervisionCode> supervisionCodes,UserDTO userDTO){
+
+        List<String> codes = list.stream().map(SupervisionCodeImportVo::getSupervisionCode).collect(Collectors.toList());
+        FieldSelector fs1 = FieldSelector.newInstance().include("supervisionCode");
+        Criteria criteria = Criteria.forClass(SupervisionCode.class);
+        criteria.restrictionBuilder()
+                .in("supervisionCode",codes.toArray());
+        criteria.buildRestriction();
+        List<SupervisionCode> extSupervisionCodeList = supervisionCodeMapper.findFieldsByCriteria(fs1,criteria);
+        if(extSupervisionCodeList != null && extSupervisionCodeList.size() > 0){
+            List<String> extCodes = new ArrayList<>();
+            for (SupervisionCode supervisionCode : extSupervisionCodeList) {
+                SupervisionCodeImportVo vo = list.stream().filter(item -> item.getSupervisionCode().equals(supervisionCode.getSupervisionCode()) && item.getSaveType().equals(supervisionCode.getSaveType())).findFirst().orElse(null);
+                if(vo != null){
+                    extCodes.add(vo.getSupervisionCode());
+                }
+            }
+            if(extCodes.size() > 0){
+                throw new BizException("监管码:"+JSON.toJSONString(extCodes)+"已上传,不能重复上传!");
+            }  
+        }
+        //查询仓
+        List<BaseWmsWarehouseMst> warehouseMstList = getWarehouseMstList(list);
+        //查询货主
+        Map<String, BaseCargoOwnerMst> cargoMap = getCargoMap(list);
+        //查询批次
+        List<WmsInvBatchNumbers> batchNumbers = getBatchNumbers(list);
+        //查询商品资料
+        List<BaseMtlItemMst> iitemMstList = getIitemMstList(list, cargoMap.get(list.get(0).getCargoOwnerCode()));
+        //查询出库单入库单
+        List<OmsDoBillHDO> omsDoBillHDOList = new ArrayList<>();
+        List<OmsAsnBillH> asnBillHList = new ArrayList<>();
+        getRefBills(list,warehouseMstList.get(0),omsDoBillHDOList,asnBillHList);
+        //查询出库单入库单明细
+        List<OmsDoBillDDO> omsDoBillDDOS = new ArrayList<>();
+        List<OmsAsnBillD> omsAsnBillDS = new ArrayList<>();
+        getrefBillDetails(omsDoBillHDOList,asnBillHList,omsDoBillDDOS,omsAsnBillDS);
+
+        //查询客户、供应商列表
+        List<BaseSupplierMst> supplierMsts = new ArrayList<>();
+        List<BaseCustomerMst> customerMsts = new ArrayList<>();
+        getShippers(omsDoBillHDOList,asnBillHList,supplierMsts,customerMsts);
+
+        supervisionCodes.addAll(convertSupervisionCodes(list,warehouseMstList,cargoMap,batchNumbers,iitemMstList,omsDoBillHDOList,asnBillHList,supplierMsts,customerMsts,omsDoBillDDOS,omsAsnBillDS,userDTO));
+    }
+
+    /**
+     * 异步线程
+     */
+    class handleSupervisionCodeRunable implements Callable {
+
+        private final CountDownLatch latch;
+        private List<SupervisionCodeImportVo> list;
+        private List<SupervisionCode> supervisionCodes;
+        private UserDTO userDTO;
+
+        public handleSupervisionCodeRunable(CountDownLatch latch, List<SupervisionCodeImportVo> list,List<SupervisionCode> supervisionCodes,UserDTO userDTO) {
+            this.latch = latch;
+            this.list = list;
+            this.supervisionCodes = supervisionCodes;
+            this.userDTO = userDTO;
+        }
+
+        @Override
+        public Object call() throws Exception {
+            String msg = null;
+            try {
+                handleSupervisionCode(list,supervisionCodes,userDTO);
+                latch.countDown();
+            }catch (Exception e){
+                e.printStackTrace();
+                msg  = e.getMessage();
+            }
+            return msg;
+        }
+    }
+
+}

+ 12 - 2
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/service/impl/SupervisionCodeServiceImpl.java

@@ -148,7 +148,7 @@ public class SupervisionCodeServiceImpl implements SupervisionCodeService {
 		dto.setUploadFlag("0");
 		dto.setDownFlag(0);
 		dto.setSaveType(1);//默认为入库,如果来源是出库,则类型为出库
-		if(ToolKits.isNotEmpty(dto.getSource()) && "out".equals(dto.getSource())){
+		if(ToolKits.isNotEmpty(dto.getSource()) && ("out".equals(dto.getSource())|| "GSP-XH".equals(dto.getSource()))){
 			dto.setSaveType(2);
 		}
 		dto.setUnlock(0);
@@ -538,7 +538,7 @@ public class SupervisionCodeServiceImpl implements SupervisionCodeService {
 		dto.setUploadFlag("0");
 		dto.setDownFlag(0);
 		dto.setSaveType(1);//默认为入库,如果来源是出库,则类型为出库
-		if(!ToolKits.isNotEmpty(dto.getSource()) && "out".equals(dto.getSource())){
+		if(ToolKits.isNotEmpty(dto.getSource()) && ("out".equals(dto.getSource()) || "GSP-XH".equals(dto.getSource()))){
 			dto.setSaveType(2);
 		}
 		if(StringUtils.isEmpty(dto.getCodeType())){
@@ -764,6 +764,16 @@ public class SupervisionCodeServiceImpl implements SupervisionCodeService {
 				throw new BizException("扫描的监管码重复");
 			}
 		}
+		if(dto.getSaveType() == 2){
+			Restriction r5 = Restrictions.eq("saveType", dto.getSaveType());
+			Restriction r6 = Restrictions.eq("codeType", dto.getCodeType());
+			Criteria criteria12 = Criteria.forClass(SupervisionCode.class);
+			criteria12.setRestriction(Restrictions.and(r1,r3,r5,r6));
+			if(mapper.findCountByCriteria(criteria12) > 0L){
+				throw new BizException("扫描的监管码重复");
+			}
+		}
+
 		if(StringUtils.isBlank(dto.getItemCode())){
 			String[] itemIds = {dto.getItemId()};
 			RestMessage<List<BaseMtlItemMst>> itemResult = baseItemRemoteCaller.getListByIds(new HashSet<>(Arrays.asList(itemIds)));

+ 266 - 2
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/service/impl/rqc/RqcHeadersServiceImpl.java

@@ -2816,6 +2816,7 @@ public class RqcHeadersServiceImpl extends BaseServiceImpl<RqcHeaders> implement
 //	}
 
     @Override
+	@Transactional
     public void uploadCircubillTimer() {
 		//查询src_code中所有ent_id不为空的数据,ent_id是在另外一个定时任务saveCusEntIdTimer中保存进去的,是从码上放心平台获取的客户或者供应商的企业ID
 		//一次上传10条,多了可能会影响性能
@@ -2873,7 +2874,8 @@ public class RqcHeadersServiceImpl extends BaseServiceImpl<RqcHeaders> implement
 				//根据srcCode分组,因为监管码平台是以billno为维度上传的,同一个billno只能上传一次
 				Map<String, List<SupervisionCode>> codeListByBillnoMap = codeList.stream().collect(Collectors.groupingBy(SupervisionCode::getSrcCode));
 				for (String billno : codeListByBillnoMap.keySet()) {
-
+					String inType = "1"; //默认采购入库 对应  102- "采购入库"
+					String outType = "1";//默认销售订单 对应   201- "销售出库"
 					List<SupervisionCode> supervisionCodes = codeListByBillnoMap.get(billno);
 					String eleccode = supervisionCodes.get(0).getEntId();
 
@@ -2894,6 +2896,17 @@ public class RqcHeadersServiceImpl extends BaseServiceImpl<RqcHeaders> implement
 						if(!flag){
 							continue;
 						}
+						if("2".equals(asnBillH.getBilltype())){ //销售退回单 对应  103- "退货入库"
+							inType="2";
+						}
+					}else if(uploadType == 1) {
+						//查询出库单对应的类型
+						String outBillType= rcvMapper.findOutBillType(billno);
+						if(ToolKits.isNotEmpty(outBillType) && "2".equals(outBillType)){//购进退出单 对应   202- "退货出库"
+							outType = "2";
+						}
+					}else if(uploadType == 2){
+
 					}
 
 					List<SupervisionCode> newSupervisionCodes = new ArrayList<>();
@@ -2926,7 +2939,7 @@ public class RqcHeadersServiceImpl extends BaseServiceImpl<RqcHeaders> implement
 						supervisionCodes = newSupervisionCodes;
 					}
 
-					Map returnMap = UploadCircubillUtil.uploadCircubillMsc(supervisionCodes,billno,"1","1","TaskTimer",refEntId,eleccode,serverUrl,appKey,appSecret,uploadType);
+					Map returnMap = UploadCircubillUtil.uploadCircubillMsc(supervisionCodes,billno,inType,outType,"TaskTimer",refEntId,eleccode,serverUrl,appKey,appSecret,uploadType);
 					Boolean isSuccess = (Boolean) returnMap.get("isSuccess");
 					String message = (String) returnMap.get("message");
 
@@ -2946,6 +2959,136 @@ public class RqcHeadersServiceImpl extends BaseServiceImpl<RqcHeaders> implement
 
     }
 
+	@Override
+	@Transactional
+	public void uploadCircubillPC(List<String> srcCodes) {
+		AssertUtils.notNull(srcCodes, "入参数据srcCodes不可为空!");
+		//以srcCode的维度查询监管码进行上传
+		logger.info("srcCodes="+JSON.toJSONString(srcCodes));
+		List<SupervisionCode> supervisionCodeList = rcvMapper.findSupervisionCodesPC(srcCodes);
+		if(ToolKits.isEmpty(supervisionCodeList)){
+			throw new BizException("未查询到可上传的监管码数据");
+		}
+		if(ToolKits.isNotEmpty(supervisionCodeList) && supervisionCodeList.size()> 0){
+			String enterpriseId = supervisionCodeList.get(0).getEnterpriseId();
+			//查询系统配置的参数
+			RestMessage<SysRegistry> restMessage = commonCaller.getRegistryInfo("refEntId",enterpriseId);
+			if (!restMessage.isSuccess()) {
+				throw new BizException("未查询到 refEntId 的系统配置参数:" + restMessage.getMessage());
+			}
+			SysRegistry data1 = restMessage.getData();
+			String refEntId = data1.getRegValue();
+
+			RestMessage<SysRegistry> restMessage3 = commonCaller.getRegistryInfo("serverUrl",enterpriseId);
+			if (!restMessage3.isSuccess()) {
+				throw new BizException("未查询到 serverUrl 的系统配置参数:" + restMessage.getMessage());
+			}
+			SysRegistry data3 = restMessage3.getData();
+			String serverUrl = data3.getRegValue();
+
+			RestMessage<SysRegistry> restMessage4 = commonCaller.getRegistryInfo("appKey",enterpriseId);
+			if (!restMessage4.isSuccess()) {
+				throw new BizException("未查询到 appKey 的系统配置参数:" + restMessage.getMessage());
+			}
+			SysRegistry data4 = restMessage4.getData();
+			String appKey = data4.getRegValue();
+
+			RestMessage<SysRegistry> restMessage5 = commonCaller.getRegistryInfo("appSecret",enterpriseId);
+			if (!restMessage5.isSuccess()) {
+				throw new BizException("未查询到 appSecret 的系统配置参数:" + restMessage.getMessage());
+			}
+			SysRegistry data5 = restMessage5.getData();
+			String appSecret = data5.getRegValue();
+
+			//根据上传类型uploadType分组 0-入库 1-出库
+			Map<Integer, List<SupervisionCode>> uploadTypeMap = supervisionCodeList.stream().collect(Collectors.groupingBy(SupervisionCode::getUploadType));
+			for (Integer uploadType : uploadTypeMap.keySet()) {
+				List<SupervisionCode> codeList = uploadTypeMap.get(uploadType);
+				//根据srcCode分组,因为监管码平台是以billno为维度上传的,同一个billno只能上传一次
+				Map<String, List<SupervisionCode>> codeListByBillnoMap = codeList.stream().collect(Collectors.groupingBy(SupervisionCode::getSrcCode));
+				for (String billno : codeListByBillnoMap.keySet()) {
+					String inType = "1"; //默认采购入库 对应  102- "采购入库"
+					String outType = "1";//默认销售订单 对应   201- "销售出库"
+					List<SupervisionCode> supervisionCodes = codeListByBillnoMap.get(billno);
+					String eleccode = supervisionCodes.get(0).getEntId();
+
+					//入库单需要校验整单上架完成再上传
+					//出库单再调用这个接口之前就已经校验是否整单完成了,因此可以直接上传
+					logger.info("uploadType =" +uploadType+"billno="+billno);
+					if(uploadType == 0) {
+						OmsAsnBillH asnBillH = MapperCustom.builder(omsAsnBillHMapper, OmsAsnBillH.class)
+								.andEq(OmsAsnBillH::getBillno, billno)
+								.findFirst();
+						if (ToolKits.isEmpty(asnBillH)) {
+							throw new BizException("入库单号billno"+ billno+"未查询到对应的入库单");
+						}
+
+						//检查billno对应的所有入库单明细是否全部上架完成,只有整单完成时才能进行上传
+						Boolean flag = this.checkIsFinish(asnBillH);
+						if(!flag){
+							throw new BizException("入库单号billno"+ billno+"还未全部上架完成,不能进行上传");
+						}
+						if("2".equals(asnBillH.getBilltype())){ //销售退回单 对应  103- "退货入库"
+							inType="2";
+						}
+					}else {
+						//查询出库单对应的类型
+						String outBillType= rcvMapper.findOutBillType(billno);
+						if(ToolKits.isNotEmpty(outBillType) && "2".equals(outBillType)){//购进退出单 对应   202- "退货出库"
+							outType = "2";
+						}
+					}
+
+					List<SupervisionCode> newSupervisionCodes = new ArrayList<>();
+					Set<String> parentSupervisionCodes = new HashSet<>();
+					//检查对应的上传监管码是否已经上传过,并且已经返回了失败
+					supervisionCodes.forEach(x -> {
+						if(x.getUploadFlag().equals("2") && ToolKits.isNotEmpty(x.getMessage()) && x.getMessage().contains("有上下级关联码")){
+							String[] split = x.getMessage().split("(上级)");
+							for (String s : split) {
+								String parentSupervisionCode  =  s.substring((s.length()-20));
+								//监管码都是20位,并且以8开头
+								if(parentSupervisionCode.length() == 20 && parentSupervisionCode.startsWith("8")){
+									parentSupervisionCodes.add(parentSupervisionCode);
+								}
+							}
+						}
+					});
+
+					if(!parentSupervisionCodes.isEmpty() && parentSupervisionCodes.size()>0){
+						supervisionCodes.forEach(x -> {
+							if(parentSupervisionCodes.contains(x.getSupervisionCode())){
+								newSupervisionCodes.add(x);
+							}
+						});
+					}
+
+					if(!newSupervisionCodes.isEmpty() && newSupervisionCodes.size()>0){
+						logger.info("上传的监管码中存在有上下级关联码"+JSON.toJSONString(newSupervisionCodes));
+						supervisionCodes.clear();
+						supervisionCodes = newSupervisionCodes;
+					}
+
+					Map returnMap = UploadCircubillUtil.uploadCircubillMsc(supervisionCodes,billno,inType,outType,"TaskTimer",refEntId,eleccode,serverUrl,appKey,appSecret,uploadType);
+					Boolean isSuccess = (Boolean) returnMap.get("isSuccess");
+					String message = (String) returnMap.get("message");
+
+					if(isSuccess){
+						//更新对应的监管码状态为 已上传成功
+						rcvMapper.updateUploadFlagV3(billno,"1",message);
+						logger.info("上传成功!");
+					}else {
+						//更新对应的监管码状态为 已上传失败,同时更新remark
+						rcvMapper.updateUploadFlagV3(billno,"2",message);
+						logger.info("上传失败!");
+					}
+				}
+			}
+		}
+
+
+	}
+
     private Boolean checkIsFinish(OmsAsnBillH asnBillH) {
         Boolean flag = true;
         Criteria crt = Criteria.forClass(OmsAsnBillD.class);
@@ -2966,6 +3109,7 @@ public class RqcHeadersServiceImpl extends BaseServiceImpl<RqcHeaders> implement
     }
 
 	@Override
+	@Transactional
 	public void saveSupervisionCodeSmallTimer() {
 		//查询所有监管码中,未保存子码的数据,只查保存类型是入库的,每次处理20条
 		List<SupervisionCode> supervisionCodeList = rcvMapper.findUnDownLoadSupervisionCode();
@@ -3349,4 +3493,124 @@ public class RqcHeadersServiceImpl extends BaseServiceImpl<RqcHeaders> implement
 			}
 		}
 	}
+
+	@Override
+	@Transactional
+	public void saveCusEntIdTimerV2() {
+		//查询eleccode为空的客户数据
+		List<BaseCustomerMst> customerMsts = rcvMapper.findUnSaveCusEntId();
+		if(customerMsts != null && customerMsts.size() > 0){
+			getCusEntId(customerMsts);
+		}
+
+		List<BaseSupplierMst> supplierMstList = rcvMapper.findUnSaveSupplierEntId();
+		if(supplierMstList != null && supplierMstList.size() > 0){
+			getSupplierEntId(supplierMstList);
+		}
+
+	}
+
+	@Override
+	public void saveEntIdTimer() {
+		List<SupervisionCode> supervisionCodes = rcvMapper.getUnEntIdSupervisionCodes();
+		for (SupervisionCode supervisionCode : supervisionCodes) {
+			rcvMapper.saveEntIdByShippId(supervisionCode.getEntId(),supervisionCode.getUploadShippId());
+		}
+	}
+
+	/**
+	 * 客户获取码上监管平台code
+	 * @param customerMsts
+	 */
+	private void getCusEntId(List<BaseCustomerMst> customerMsts){
+		if(customerMsts.size() > 0){
+			String enterpriseid = customerMsts.get(0).getEnterpriseId();
+			//查询系统配置的参数
+			RestMessage<SysRegistry> restMessage = commonCaller.getRegistryInfo("refEntId",enterpriseid);
+			if (!restMessage.isSuccess()) {
+				throw new RuntimeException("未查询到 refEntId 的系统配置参数:" + restMessage.getMessage());
+			}
+			SysRegistry data1 = restMessage.getData();
+			String refEntId = data1.getRegValue();
+
+			RestMessage<SysRegistry> restMessage3 = commonCaller.getRegistryInfo("serverUrl",enterpriseid);
+			if (!restMessage3.isSuccess()) {
+				throw new RuntimeException("未查询到 serverUrl 的系统配置参数:" + restMessage.getMessage());
+			}
+			SysRegistry data3 = restMessage3.getData();
+			String serverUrl = data3.getRegValue();
+
+			RestMessage<SysRegistry> restMessage4 = commonCaller.getRegistryInfo("appKey",enterpriseid);
+			if (!restMessage4.isSuccess()) {
+				throw new RuntimeException("未查询到 appKey 的系统配置参数:" + restMessage.getMessage());
+			}
+			SysRegistry data4 = restMessage4.getData();
+			String appKey = data4.getRegValue();
+
+			RestMessage<SysRegistry> restMessage5 = commonCaller.getRegistryInfo("appSecret",enterpriseid);
+			if (!restMessage5.isSuccess()) {
+				throw new RuntimeException("未查询到 appSecret 的系统配置参数:" + restMessage.getMessage());
+			}
+			SysRegistry data5 = restMessage5.getData();
+			String appSecret = data5.getRegValue();
+
+			for (BaseCustomerMst customerMst : customerMsts) {
+				String entId =  taobaoUtil.getentinfoV2(customerMst.getCustomerName(),refEntId,serverUrl,appKey,appSecret);
+				if(ToolKits.isNotEmpty(entId)){
+					rcvMapper.saveCusEntId(entId,customerMst.getCustomerId());
+					rcvMapper.saveEntIdByShippId(entId,customerMst.getCustomerId());
+				}else {
+					rcvMapper.saveCusEntId(null,customerMst.getCustomerId());
+				}
+			}
+		}
+	}
+
+	/**
+	 * 获取供应商码上监管平台code
+	 * @param supplierMstList
+	 */
+	private void getSupplierEntId(List<BaseSupplierMst> supplierMstList){
+		if(supplierMstList != null && supplierMstList.size() > 0){
+			String enterpriseid = supplierMstList.get(0).getEnterpriseId();
+			//查询系统配置的参数
+			RestMessage<SysRegistry> restMessage = commonCaller.getRegistryInfo("refEntId",enterpriseid);
+			if (!restMessage.isSuccess()) {
+				throw new RuntimeException("未查询到 refEntId 的系统配置参数:" + restMessage.getMessage());
+			}
+			SysRegistry data1 = restMessage.getData();
+			String refEntId = data1.getRegValue();
+
+			RestMessage<SysRegistry> restMessage3 = commonCaller.getRegistryInfo("serverUrl",enterpriseid);
+			if (!restMessage3.isSuccess()) {
+				throw new RuntimeException("未查询到 serverUrl 的系统配置参数:" + restMessage.getMessage());
+			}
+			SysRegistry data3 = restMessage3.getData();
+			String serverUrl = data3.getRegValue();
+
+			RestMessage<SysRegistry> restMessage4 = commonCaller.getRegistryInfo("appKey",enterpriseid);
+			if (!restMessage4.isSuccess()) {
+				throw new RuntimeException("未查询到 appKey 的系统配置参数:" + restMessage.getMessage());
+			}
+			SysRegistry data4 = restMessage4.getData();
+			String appKey = data4.getRegValue();
+
+			RestMessage<SysRegistry> restMessage5 = commonCaller.getRegistryInfo("appSecret",enterpriseid);
+			if (!restMessage5.isSuccess()) {
+				throw new RuntimeException("未查询到 appSecret 的系统配置参数:" + restMessage.getMessage());
+			}
+			SysRegistry data5 = restMessage5.getData();
+			String appSecret = data5.getRegValue();
+
+			for (BaseSupplierMst supplierMst : supplierMstList) {
+				String entId =  taobaoUtil.getentinfoV2(supplierMst.getSupplierName(),refEntId,serverUrl,appKey,appSecret);
+				if(ToolKits.isNotEmpty(entId)){
+					rcvMapper.saveSupplierEntId(entId,supplierMst.getSupplierId());
+					rcvMapper.saveEntIdByShippId(entId,supplierMst.getSupplierId());
+				}else {
+					rcvMapper.saveSupplierEntId(null,supplierMst.getSupplierId());
+				}
+			}
+		}
+	}
 }

+ 1 - 1
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/service/impl/task/TaskStraightServiceImpl.java

@@ -651,7 +651,7 @@ public class TaskStraightServiceImpl implements TaskStraightService {
 			BigDecimal piecePriceTe = ToolKits.isNotEmpty(asnBillD.getTniAmt())? asnBillD.getTniAmt() : new BigDecimal(1);
 			rcvLinesDTO.setPiecePriceTe(piecePriceTe);
 			if(!StringUtils.isEmpty(asnBillD.getValidUntil())){
-				Date parseDate = com.prolog.framework.utils.DateUtils.parse(asnBillD.getPdateFrom(), "yyyy-MM-dd hh:mm:ss");
+				Date parseDate = com.prolog.framework.utils.DateUtils.parse(asnBillD.getValidUntil(), "yyyy-MM-dd hh:mm:ss");
 				rcvLinesDTO.setBatchExpiredDate(parseDate);
 			}
 			rcvLinesDTO.setInStoreDay(baseMtlItemWms.getInStoreDay());

+ 153 - 0
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/utils/ExcelUtil.java

@@ -0,0 +1,153 @@
+package com.prolog.cs.biz.inbound.utils;
+
+
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
+import org.apache.poi.xssf.usermodel.XSSFRichTextString;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+@Service
+public class ExcelUtil {
+    private static final Logger logger = LoggerFactory.getLogger(ExcelUtil.class);
+
+
+    // 把一个字符串的第一个字母大写、效率是最高的、
+    private static String getMethodName(String fildeName){
+        byte[] items = fildeName.getBytes();
+        items[0] = (byte) ((char) items[0] - 'a' + 'A');
+        return new String(items);
+    }
+
+
+
+
+    public static <T> List<T> importExcel(InputStream inputStream, Class<T> sheetClass) {
+        try {
+            Workbook workbook = WorkbookFactory.create(inputStream);
+            List<T> dataList = importExcel(workbook, sheetClass);
+            return dataList;
+        } catch (IOException e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException(e);
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException(e);
+        }
+    }
+
+
+    public static <T> List<T> importExcel(Workbook workbook, Class<?> sheetClass) {
+        List<T> sheetDataList = importSheet(workbook, sheetClass);
+        return sheetDataList;
+    }
+
+    public static <T> List<T> importSheet(Workbook workbook, Class<?> sheetClass) {
+        try {
+            // sheet field
+            List<Field> fields = new ArrayList<Field>();
+            if (sheetClass.getDeclaredFields()!=null && sheetClass.getDeclaredFields().length>0) {
+                for (Field field: sheetClass.getDeclaredFields()) {
+                    if (Modifier.isStatic(field.getModifiers())) {
+                        continue;
+                    }
+                    fields.add(field);
+                }
+            }
+
+            if (fields==null || fields.size()==0) {
+                throw new RuntimeException(">>>>>>>>>>> xxl-excel error, data field can not be empty.");
+            }
+
+            // sheet data
+            Sheet sheet = workbook.getSheet("Sheet1");
+            if (sheet == null) {
+                return null;
+            }
+
+            Iterator<Row> sheetIterator = sheet.rowIterator();
+            int rowIndex = 0;
+            List<T> dataList = new ArrayList<T>();
+            while (sheetIterator.hasNext()) {
+                Row rowX = sheetIterator.next();
+                if (rowIndex > 0) {
+                    T rowObj = (T) sheetClass.newInstance();
+                    for (int i = 0; i < fields.size(); i++) {
+
+                        // cell
+                        Cell cell = rowX.getCell(i);
+                        if (cell == null) {
+                            continue;
+                        }
+
+                        // call val str
+                        cell.setCellType(CellType.STRING);
+                        String fieldValueStr = cell.getStringCellValue();       // cell.getCellTypeEnum()
+
+                        // java val
+                        Field field = fields.get(i);
+                        if (fieldValueStr == null) {
+                            continue;
+                        }
+
+                        // fill val
+                        field.setAccessible(true);
+                        field.set(rowObj, fieldValueStr);
+                    }
+                    dataList.add(rowObj);
+                }
+                rowIndex++;
+            }
+            return dataList;
+        } catch (IllegalAccessException e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException(e);
+        } catch (InstantiationException e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException(e);
+        }
+    }
+
+
+    public CellStyle setDefaultFormat(Sheet sheet, SXSSFWorkbook workbook, String[] headers){
+        // 设置表格默认列宽度为15个字节
+        sheet.setDefaultColumnWidth(15);
+        // 设置标题
+        CellStyle titleStyle = workbook.createCellStyle();
+        // 居中显示
+        titleStyle.setAlignment(HorizontalAlignment.CENTER_SELECTION);
+        // 标题字体
+        Font titleFont = workbook.createFont();
+        // 字体大小
+        titleStyle.setFont(titleFont);
+
+        CellStyle contentStyle = workbook.createCellStyle();
+        DataFormat dataFormat = workbook.createDataFormat();
+        contentStyle.setDataFormat(dataFormat.getFormat("@"));
+        contentStyle.setAlignment(HorizontalAlignment.CENTER_SELECTION);
+        Font contentFont = workbook.createFont();
+        contentStyle.setFont(contentFont);
+        contentStyle.setWrapText(true);
+
+        // 产生表格标题行
+        Row row = sheet.createRow(0);
+
+        for (int i = 0; i < headers.length; i++) {
+            Cell cell = row.createCell(i);
+            XSSFRichTextString text = new XSSFRichTextString(headers[i]);
+            cell.setCellValue(text);
+            cell.setCellStyle(titleStyle);
+        }
+        return contentStyle;
+    }
+
+}

+ 9 - 2
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/java/com/prolog/cs/biz/inbound/utils/UploadCircubillUtil.java

@@ -421,7 +421,7 @@ public class UploadCircubillUtil {
 						billType = 217L;
 						break;
 				}
-			}else {
+			}else if(uploadType == 0) {
 				switch (inType) {
 					case "1":
 						billType = 102L;
@@ -433,6 +433,8 @@ public class UploadCircubillUtil {
 						billType = 113L;
 						break;
 				}
+			}else if(uploadType == 2) {
+				billType = 205L;
 			}
 
 			TaobaoClient client = new DefaultTaobaoClient(serverUrl, appKey, appSecret);
@@ -451,11 +453,16 @@ public class UploadCircubillUtil {
 				req.setFromUserId(sendEnterpriseId);//发货企业
 				log.info("单据类型出库单,收货企业entId=" + eleccode);
 				req.setToUserId(eleccode);//收货企业
-			}else { //如果是入库单类型,发货企业为供应商对应的监管码企业ID,收货企业为江西青牛医药有限公司
+			}else if(uploadType == 0){ //如果是入库单类型,发货企业为供应商对应的监管码企业ID,收货企业为江西青牛医药有限公司
 				log.info("单据类型入库单,发货企业entId=" + eleccode);
 				req.setFromUserId(eleccode);//发货企业
 				log.info("单据类型入库单,收货企业entId=" + sendEnterpriseId);
 				req.setToUserId(sendEnterpriseId);//收货企业
+			}else if(uploadType == 2){
+				log.info("单据类型不合格品销毁,发货企业entId=" + eleccode);
+				req.setFromUserId(eleccode);//发货企业
+				log.info("单据类型不合格品销毁,收货企业entId=" + eleccode);
+				req.setToUserId(eleccode);//收货企业
 			}
 
 			req.setOperIcCode(appKey);//操作人标识(写appkey编号)

+ 56 - 2
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/resources/mappers/mysql/InRcvHeaders.xml

@@ -522,6 +522,17 @@
 		</foreach>
 	</select>
 
+	<select id="findSupervisionCodesPC" resultType="com.prolog.cs.biz.inbound.model.SupervisionCode">
+		select  id,enterprise_id as enterpriseId,ref_bill_id as refBillId,ref_bill_line_id as refBillLineId,upload_shipp_id as uploadShippId,
+		upload_type as uploadType,supervision_code as supervisionCode,message,upload_flag as uploadFlag,src_code as srcCode,ent_id as entId
+		from  wms_supervision_code where upload_flag  in ('0','2')  and upload_shipp_id is not null and upload_shipp_id !=''
+		and upload_type is  not null  and supervision_code is not null
+		and ent_id is not null and  src_code in
+		<foreach collection="srcCodes" close=")" index="index" item="item" open="(" separator=",">
+			#{item}
+		</foreach>
+	</select>
+
 	<select id="findUnDownLoadSupervisionCode" resultType="com.prolog.cs.biz.inbound.model.SupervisionCode">
 		select  id,enterprise_id as enterpriseId,warehouse_code as warehouseCode,supervision_code as supervisionCode,
 		item_id as itemId,item_code as itemCode,item_name as itemName,
@@ -565,7 +576,7 @@
 	<select id="findUnSaveCusEntId" resultType="com.prolog.cs.basic.chain.model.customer.BaseCustomerMst">
 		select save_times as saveTimes,customer_id as customerId ,customer_name as customerName ,enterprise_id as  enterpriseId
 		from  upcloud_base_chain_qingniu.base_customer_mst t
-		where eleccode is null or eleccode ='' ORDER BY save_times asc   limit 100
+		where eleccode is null or eleccode ='' ORDER BY save_times asc   limit 10
 	</select>
 
 	<update id="saveCusEntId" >
@@ -628,7 +639,9 @@
 		and upload_type is  not null  and supervision_code is not null
 		and not EXISTS (
 		select * from wms_supervision_code  s where s.SRC_CODE = t.SRC_CODE and s.ENT_ID is null
-		) limit 5
+		)
+		order by t.upload_times asc
+		limit 5
 	</select>
 
 
@@ -646,4 +659,45 @@
 		and ent_id is null and upload_type = 0  and exists (select  1 from upcloud_base_chain_qingniu.base_supplier_mst
 		where eleccode is not null and supplier_id = upload_shipp_id ) group by src_code limit 10
 	</select>
+
+	<select id="findOutBillType" resultType="java.lang.String">
+		select billtype from  upcloud_biz_outbound_qingniu.oms_do_bill_h where billno = #{billno} limit 1
+	</select>
+
+	<update id="saveEntIdByShippId" >
+		update  wms_supervision_code  set ent_id = #{eleccode},upload_shipp_id = #{shippId}
+		where upload_flag  in ('0','2')
+		and supervision_code is not null
+		and save_type = '1'
+		and ent_id is null
+		and  src_code in (
+			select oab.billno from oms_asn_bill_h oab where oab.SHIPPERID = #{shippId}
+		)
+	</update>
+
+	<select id="findUnSaveSupplierEntId" resultType="com.prolog.cs.basic.chain.model.supplier.BaseSupplierMst">
+		select supplier_id as supplierId,SUPPLIER_NAME as supplierName,attribute1,enterprise_id as  enterpriseId
+		from  upcloud_base_chain_qingniu.base_supplier_mst
+		where eleccode is null or eleccode ='' ORDER BY attribute1 asc   limit 10
+	</select>
+	<select id="getUnEntIdSupervisionCodes" resultType="com.prolog.cs.biz.inbound.model.SupervisionCode">
+		select bcm.CUSTOMER_ID as uploadShippId,bcm.eleccode as entId ,wsc.SCAN_DATE from wms_supervision_code wsc
+			join oms_asn_bill_h oabh on wsc.SRC_CODE = oabh.BILLNO
+			join upcloud_base_chain_qingniu.base_customer_mst bcm on oabh.SHIPPERID = bcm.CUSTOMER_ID
+		where  wsc.UPLOAD_FLAG  in ('0','1') and wsc.save_type = '1' and wsc.ent_id is null
+		and bcm.eleccode is not null
+		union
+		select bsm.SUPPLIER_ID as uploadShippId,bsm.eleccode as entId,wsc.SCAN_DATE from wms_supervision_code wsc
+			join oms_asn_bill_h oabh on wsc.SRC_CODE = oabh.BILLNO
+			join upcloud_base_chain_qingniu.base_supplier_mst bsm on oabh.SHIPPERID = bsm.SUPPLIER_ID
+		where  wsc.UPLOAD_FLAG  in ('0','1') and wsc.save_type = '1' and wsc.ent_id is null
+		and bsm.eleccode is not null
+		order by  SCAN_DATE desc
+		limit 10
+	</select>
+
+	<update id="saveSupplierEntId" >
+		update  upcloud_base_chain_qingniu.base_supplier_mst  set attribute1 = ifnull(attribute1,0)+1 ,eleccode = #{entId}
+		where supplier_id = #{supplierId}
+	</update>
 </mapper>

BIN
upcloud-base-wh-inbound/upcloud-base-wh-inbound-service/src/main/resources/template/supervisionCodeTemplate.xlsx


+ 130 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/model/EisMovePush.java

@@ -0,0 +1,130 @@
+package com.prolog.upcloud.base.wh.operate.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;
+
+/**
+ * @auther yb
+ * @create 2024-09-03 10:57:24
+ * @describe erp下传移库单实体类
+ */
+@Data
+@Table("eis_move_push")
+@ApiModel(value = "EisMovePush对象", description = "erp下传移库单")
+public class EisMovePush implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "接口唯一性id")
+    @Id
+    @Column("msg_id")
+    private String msgId;
+
+    @ApiModelProperty(value = "仓库编号")
+    @Column("warehouse_id")
+    private String warehouseId;
+
+    @ApiModelProperty(value = "货主编号")
+    @Column("owner_id")
+    private String ownerId;
+
+    @ApiModelProperty(value = "容器号")
+    @Column("container_no")
+    private String containerNo;
+
+    @ApiModelProperty(value = "货格号")
+    @Column("location_no")
+    private String locationNo;
+
+    @ApiModelProperty(value = "eis任务行号")
+    @Column("task_lineid")
+    private String taskLineid;
+
+    @ApiModelProperty(value = "商品id")
+    @Column("item_id")
+    private String itemId;
+
+    @ApiModelProperty(value = "批次id")
+    @Column("lot_id")
+    private String lotId;
+
+    @ApiModelProperty(value = "包装id")
+    @Column("pack_id")
+    private String packId;
+
+    @ApiModelProperty(value = "源区域")
+    @Column("original_area")
+    private String originalArea;
+
+    @ApiModelProperty(value = "目标区域")
+    @Column("target_area")
+    private String targetArea;
+
+    @ApiModelProperty(value = "数量(最小库存单位)")
+    @Column("inventory_qty")
+    private BigDecimal inventoryQty;
+
+    @ApiModelProperty(value = "员工号")
+    @Column("employee_id")
+    private String employeeId;
+
+    /**
+     * 移出库位ID
+     */
+    @ApiModelProperty(value = "移出库位ID")
+    @Column(value = "out_locator_id")
+    private String outLocatorId;
+
+    /**
+     * 移入库位ID
+     */
+    @ApiModelProperty(value = "移入库位ID")
+    @Column(value = "in_locator_id")
+    private String inLocatorId;
+
+    @ApiModelProperty(value = "移出建筑物")
+    @Column(value = "move_out_bldg")
+    private String moveOutBldg;
+
+    @ApiModelProperty(value = "移入建筑物")
+    @Column(value = "move_in_bldg")
+    private String moveInBldg;
+
+    /**
+     * 单位
+     */
+    @ApiModelProperty(value = "单位")
+    @Column(value = "uom")
+    private String uom;
+
+    /**
+     * 最大单位(箱单位)含量
+     */
+    @ApiModelProperty(value = "最大单位(箱单位)含量")
+    @Column(value = "case_conversion_rate")
+    private BigDecimal caseConversionRate;
+
+    /**
+     * 移库单汇总ID
+     */
+    @ApiModelProperty(value = "移库单汇总ID")
+    @Column(value = "move_header_id")
+    private String moveHeaderId;
+
+    @ApiModelProperty(value = "处理状态")
+    @Column("status")
+    private String status;
+
+    @ApiModelProperty(value = "处理次数")
+    @Column("handle_count")
+    private Integer handleCount;
+
+
+}

+ 1 - 1
upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/model/WmsMoveH.java

@@ -169,7 +169,7 @@ public class WmsMoveH extends BaseModel implements Serializable {
     /**
      * 扩展字段3
      */
-    @ApiModelProperty(value = "扩展字段3")
+    @ApiModelProperty(value = "来源:EIS")
     @Column(value = "ATTRIBUTE3")
     private String attribute3;
 

+ 3 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/model/WmsReplenishH.java

@@ -76,5 +76,8 @@ public class WmsReplenishH extends BaseModel implements Serializable {
     @Column(value = "wave_id")
     private String waveId;
 
+    @Column(value = "is_push_eis")
+    private String isPushEis;
+
     private static final long serialVersionUID = 1501150149373019112L;
 }

+ 68 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/vo/EisMovePushSubBeanVO.java

@@ -0,0 +1,68 @@
+package com.prolog.upcloud.base.wh.operate.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class EisMovePushSubBeanVO {
+
+    @ApiModelProperty(value = "货主编号")
+    private String ownerId;
+
+    @ApiModelProperty(value = "容器号")
+    private String containerNo;
+
+    @ApiModelProperty(value = "货格号")
+    private String locationNo;
+
+    @ApiModelProperty(value = "eis任务行号")
+    private String taskLineId;
+
+    @ApiModelProperty(value = "商品id")
+    private String itemId;
+
+    @ApiModelProperty(value = "批次id")
+    private String lotId;
+
+    @ApiModelProperty(value = "包装id")
+    private String packId;
+
+    @ApiModelProperty(value = "源区域")
+    private String originalArea;
+
+    @ApiModelProperty(value = "目标区域")
+    private String targetArea;
+
+    @ApiModelProperty(value = "数量(最小库存单位)")
+    private BigDecimal inventoryQty;
+
+    @ApiModelProperty(value = "员工号")
+    private String employeeId;
+
+    @ApiModelProperty(value = "源货位")
+    private String srcLocatorId;
+
+    @ApiModelProperty(value = "目标货位")
+    private String targetLocatorId;
+
+    /**
+     * 单位
+     */
+    @ApiModelProperty(value = "单位")
+    private String uom;
+
+    /**
+     * 最大单位(箱单位)含量
+     */
+    @ApiModelProperty(value = "最大单位(箱单位)含量")
+    private BigDecimal caseConversionRate;
+
+    @ApiModelProperty(value = "移出建筑物id")
+    private String outBldgId;
+
+    @ApiModelProperty(value = "移入建筑物id")
+    private String inBldgId;
+
+}

+ 28 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/vo/EisMovePushVO.java

@@ -0,0 +1,28 @@
+package com.prolog.upcloud.base.wh.operate.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @auther yb
+ * @create 2024-09-03 10:57:24
+ * @describe erp下传移库单实体类
+ */
+@Data
+@ApiModel(value = "EisMovePush对象", description = "erp下传移库单")
+public class EisMovePushVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "接口唯一性id")
+    private String msgId;
+
+    @ApiModelProperty(value = "仓库编号")
+    private String warehouseId;
+
+    private List<EisMovePushSubBeanVO> subList;
+}

+ 3 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/vo/MoveDListVO.java

@@ -370,4 +370,7 @@ public class MoveDListVO {
     @ApiModelProperty(value = "目标货位所在楼层")
     private String targetlocation;
 
+    @ApiModelProperty(value = "来源:EIS")
+    private String source;
+
 }

+ 8 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-facade/src/main/java/com/prolog/upcloud/base/wh/operate/vo/WmsMoveSaveVO.java

@@ -61,4 +61,12 @@ public class WmsMoveSaveVO {
 
     @ApiModelProperty(value = "移库明细")
     private List<@Valid WmsMoveDetailVO> moveDetails;
+
+    @ApiModelProperty(value = "移库单汇总id")
+    private String moveHeaderId;
+
+    private String msgId;
+
+    @ApiModelProperty(value = "来源:EIS")
+    private String source;
 }

+ 49 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/controller/EisMovePushController.java

@@ -0,0 +1,49 @@
+package com.prolog.upcloud.base.wh.operate.controller;
+
+
+import com.codingapi.tx.springcloud.feign.HystrixVarHelper;
+import com.prolog.common.RestMsgHelper;
+import com.prolog.entity.vo.OperationCompleteVO;
+import com.prolog.framework.common.message.RestMessage;
+import com.prolog.upcloud.base.wh.operate.service.EisMovePushService;
+import com.prolog.upcloud.base.wh.operate.vo.EisMovePushVO;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @auther yb
+ * @create 2024-09-03 10:40:20
+ * @describe erp下传移库单前端控制器
+ */
+@RestController
+@RequestMapping("/eis-move-push")
+public class EisMovePushController {
+
+    @Autowired
+    private EisMovePushService eisMovePushService;
+
+    @ApiOperation("接收eis下传不合格库移库")
+    @PostMapping("/receive")
+    public RestMessage<Object> receive(@RequestBody EisMovePushVO vo) {
+        return RestMsgHelper.run(() -> eisMovePushService.receive(vo));
+    }
+
+    @ApiOperation("将移库单中间表生成移库单")
+    @PostMapping("/auto/handleMove")
+    public RestMessage<Object> handleMove() {
+        List<String> moveHeaderIds = eisMovePushService.saveMove();
+        eisMovePushService.auditMove(moveHeaderIds);
+        HystrixVarHelper.setGroupId(null);
+        eisMovePushService.moveDownConfirm(moveHeaderIds);
+        eisMovePushService.releaseContainerCode(moveHeaderIds);
+        return RestMessage.doSuccess(null);
+    }
+
+}
+

+ 17 - 1
upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/controller/ReplenishController.java

@@ -168,9 +168,25 @@ public class ReplenishController extends BaseController {
     }
 
     @UserLog("根据波次id获取补货任务推送eis入参")
-    @ApiOperation("顺带补货")
+    @ApiOperation("根据波次id获取补货任务推送eis入参")
     @GetMapping("v1/getRepSendEisParamsByWaveId")
     public RestMessage<List<OutBoundRequestVO>> getRepSendEisParamsByWaveId(@RequestParam(value = "waveId") String waveId) {
         return RestMessage.doSuccess(wmsReplenishService.getRepSendEisParamsByWaveId(waveId));
     }
+
+    @UserLog("根据波次id更新补货任务是否推送eis")
+    @ApiOperation("changeRepIsSendEisByWaveId")
+    @GetMapping("v1/changeRepIsSendEisByWaveId")
+    public RestMessage changeRepIsSendEisByWaveId(@RequestParam(value = "waveId") String waveId) {
+        wmsReplenishService.changeRepIsSendEisByWaveId(waveId);
+        return RestMessage.doSuccess(null);
+    }
+
+    @UserLog("定时任务-推送补货任务到EIS")
+    @ApiOperation("定时任务-推送补货任务到EIS")
+    @PostMapping("/v1/auto-pushToEis")
+    public RestMessage<Object> autoPushToEis() {
+        wmsReplenishService.autoPushToEis();
+        return success();
+    }
 }

+ 19 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/dao/EisMovePushMapper.java

@@ -0,0 +1,19 @@
+package com.prolog.upcloud.base.wh.operate.dao;
+
+import com.prolog.framework.dao.mapper.BaseMapper;
+import com.prolog.upcloud.base.wh.operate.model.EisMovePush;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @auther yb
+ * @create 2024-09-03 10:40:20
+ * @describe erp下传移库单mapper类
+ */
+@Mapper
+public interface EisMovePushMapper extends BaseMapper<EisMovePush> {
+
+    List<EisMovePush> getUnCreateMoves(@Param("autoCreateMoveCount") Integer autoCreateMoveCount);
+}

+ 11 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/resource/StockResource.java

@@ -131,6 +131,17 @@ public interface StockResource {
     @GetMapping("/stock-lot/v1/locators")
     RestMessage<List<StockLocatorDTO>> getItemLocators(@RequestParam("warehouseId") String warehouseId, @RequestParam("cargoOwnerId") String cargoOwnerId, @RequestParam("itemId") String itemId, @RequestParam("status") String status);
 
+    /**
+     * 根据条件查询商品货位列表
+     *
+     * @param warehouseId  仓库
+     * @param cargoOwnerId 货主
+     * @param itemId       商品
+     * @return 货位列表
+     */
+    @GetMapping("/stock-lot/v2/locators")
+    RestMessage<List<StockLocatorDTO>> getItemLocatorsV2(@RequestParam("warehouseId") String warehouseId, @RequestParam("cargoOwnerId") String cargoOwnerId, @RequestParam("itemId") String itemId, @RequestParam("status") String status);
+
     /**
      * 查询多个商品可用库存信息
      *

+ 21 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/service/EisMovePushService.java

@@ -0,0 +1,21 @@
+package com.prolog.upcloud.base.wh.operate.service;
+
+import com.prolog.upcloud.base.wh.operate.vo.EisMovePushVO;
+
+import java.util.List; /**
+ * @auther yb
+ * @create 2024-09-03 10:40:20
+ * @describe erp下传移库单服务类
+ */
+public interface EisMovePushService {
+
+    void receive(EisMovePushVO vo);
+
+    List<String> saveMove();
+
+    void auditMove(List<String> moveHeaderIds);
+
+    void moveDownConfirm(List<String> moveHeaderIds);
+
+    void releaseContainerCode(List<String> moveHeaderIds);
+}

+ 5 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/service/WmsReplenishService.java

@@ -74,4 +74,9 @@ public interface WmsReplenishService {
     List<MarkTaskItemVO> exceedTask(List<MarkTaskItemVO> exceeds);
 
     List<OutBoundRequestVO> getRepSendEisParamsByWaveId(String waveId);
+
+    void changeRepIsSendEisByWaveId(String waveId);
+
+    void autoPushToEis();
+
 }

+ 435 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/service/impl/EisMovePushServiceImpl.java

@@ -0,0 +1,435 @@
+package com.prolog.upcloud.base.wh.operate.service.impl;
+
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.map.MapUtil;
+import com.alibaba.fastjson.JSON;
+import com.codingapi.tx.annotation.TxTransaction;
+import com.prolog.cs.basic.warehouse.model.BaseWmsWarehouseLocator;
+import com.prolog.cs.basic.warehouse.model.vo.ContainerQueryVO;
+import com.prolog.cs.basic.warehouse.model.vo.WarehouseLocatorBasicInfo;
+import com.prolog.cs.basic.warehouse.model.vo.WhLocatorQueryVO;
+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.restriction.Criteria;
+import com.prolog.framework.core.restriction.Restriction;
+import com.prolog.framework.core.restriction.Restrictions;
+import com.prolog.framework.utils.MapUtils;
+import com.prolog.upcloud.base.inventory.vo.BatchNumberListVO;
+import com.prolog.upcloud.base.inventory.vo.ByContainerVo;
+import com.prolog.upcloud.base.inventory.vo.WmsInvStockQtyQueryVO;
+import com.prolog.upcloud.base.inventory.vo.WmsInvStockQtyVO;
+import com.prolog.upcloud.base.strategy.model.BusinessControl;
+import com.prolog.upcloud.base.wh.operate.dao.EisMovePushMapper;
+import com.prolog.upcloud.base.wh.operate.dao.WmsMoveDMapper;
+import com.prolog.upcloud.base.wh.operate.dao.WmsMoveHMapper;
+import com.prolog.upcloud.base.wh.operate.enums.WmsMoveDStatus;
+import com.prolog.upcloud.base.wh.operate.model.EisMovePush;
+import com.prolog.upcloud.base.wh.operate.model.WmsMoveD;
+import com.prolog.upcloud.base.wh.operate.model.WmsMoveH;
+import com.prolog.upcloud.base.wh.operate.model.WmsReplenishD;
+import com.prolog.upcloud.base.wh.operate.resource.StockResource;
+import com.prolog.upcloud.base.wh.operate.resource.StrategyClient;
+import com.prolog.upcloud.base.wh.operate.resource.WarehouseClient;
+import com.prolog.upcloud.base.wh.operate.service.EisMovePushService;
+import com.prolog.upcloud.base.wh.operate.service.MoveService;
+import com.prolog.upcloud.base.wh.operate.utils.StringUtils;
+import com.prolog.upcloud.base.wh.operate.vo.*;
+import lombok.extern.slf4j.Slf4j;
+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.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @auther yb
+ * @create 2024-09-03 10:40:20
+ * @describe erp下传移库单服务实现类
+ */
+@Slf4j
+@Service
+public class EisMovePushServiceImpl implements EisMovePushService {
+
+    @Autowired
+    private EisMovePushMapper eisMovePushMapper;
+
+    @Autowired
+    private StrategyClient strategyResource;
+
+    @Autowired
+    private WarehouseClient warehouseClient;
+
+    @Autowired
+    private StockResource stockResource;
+
+    @Autowired
+    private MoveService moveService;
+
+    @Autowired
+    private WmsMoveDMapper moveDMapper;
+
+    @Autowired
+    private UserTemplate userTemplate;
+
+    @Autowired
+    private WarehouseClient warehouseResource;
+
+    @Override
+    public void receive(EisMovePushVO vo) {
+        if(vo == null || vo.getSubList() == null || vo.getSubList().size() <= 0){
+            return;
+        }
+        //校验入参
+        checkParam(vo);
+
+        //转换为中间表对象并写入中间表
+        List<EisMovePush> eisMovePushes = new ArrayList<>();
+        for (EisMovePushSubBeanVO subBeanVO : vo.getSubList()) {
+            EisMovePush eisMovePush = new EisMovePush();
+            BeanUtils.copyProperties(subBeanVO,eisMovePush);
+            eisMovePush.setMsgId(vo.getMsgId());
+            eisMovePush.setWarehouseId(vo.getWarehouseId());
+            eisMovePush.setOutLocatorId(subBeanVO.getSrcLocatorId());
+            eisMovePush.setInLocatorId(subBeanVO.getTargetLocatorId());
+            eisMovePush.setMoveOutBldg(subBeanVO.getOutBldgId());
+            eisMovePush.setMoveInBldg(subBeanVO.getInBldgId());
+            eisMovePush.setStatus("10");
+            eisMovePush.setHandleCount(0);
+            eisMovePushes.add(eisMovePush);
+        }
+        //写入中间表
+        eisMovePushMapper.saveBatch(eisMovePushes);
+    }
+
+    @Transactional
+    @TxTransaction
+    @Override
+    public List<String> saveMove() {
+
+        UserDTO userDTO = userTemplate.getUserDTO();
+        List<String> moveHeaderIds = new ArrayList<>();
+
+        Integer autoCreateMoveCount = 1; // 默认自动波次下发
+        RestMessage<Map<String, BusinessControl>> rest = strategyResource.getControlByCodes(new String[]{"auto_create_move_count"}, userDTO.getUserBizModel().getDefaultWarehouseId(), null, userDTO.getEnterpriseId(), null);
+        if (rest.isSuccess() && rest.getData() != null) {
+            Map<String,BusinessControl> conMap = rest.getData();
+            if (conMap.containsKey("auto_create_move_count")) {
+                autoCreateMoveCount = Integer.valueOf(conMap.get("auto_create_move_count").getRegValue());
+            }
+        }
+        List<EisMovePush> eisMovePushes = eisMovePushMapper.getUnCreateMoves(autoCreateMoveCount);
+        if(eisMovePushes != null && eisMovePushes.size() > 0){
+            List<WmsMoveSaveVO> moveSaveVOS = this.convertMoveVo(eisMovePushes);
+            for (WmsMoveSaveVO moveSaveVO : moveSaveVOS) {
+                moveService.saveMoveInfo(moveSaveVO);
+
+                EisMovePush eisMovePush = eisMovePushes.stream().filter(item -> item.getMsgId().equals(moveSaveVO.getMsgId())).findFirst().orElse(null);
+                if(eisMovePush != null){
+                    eisMovePushMapper.updateMapById(eisMovePush.getMsgId(), MapUtils.put("moveHeaderId",moveSaveVO.getMoveHeaderId()).put("status","20").getMap(),EisMovePush.class);
+                    moveHeaderIds.add(moveSaveVO.getMoveHeaderId());
+                }
+
+            }
+
+        }
+        return moveHeaderIds;
+    }
+
+    @Transactional
+    @Override
+    public void auditMove(List<String> moveHeaderIds) {
+        UserDTO user = userTemplate.getUserDTO();
+
+        Criteria crt = Criteria.forClass(WmsMoveD.class);
+        Restriction r1 = Restrictions.in("moveHeaderId", moveHeaderIds.toArray());
+        crt.setRestriction(Restrictions.and(r1));
+
+        Map<String, Object> modifyMap = MapUtil.newHashMap();
+        modifyMap.put("status", WmsMoveDStatus.WMS_AUDIT_PASS.getStatus());
+        //				}
+        modifyMap.put("gmtModified", DateUtil.date());
+        modifyMap.put("modifier", user.getId());
+        modifyMap.put("modifierName", user.getUsername());
+        moveDMapper.updateMapByCriteria(modifyMap, crt);
+
+//        Criteria crth = Criteria.forClass(WmsMoveH.class);
+//        crth.setRestriction(Restrictions.and(r1));
+//        moveHMapper.updateMapByCriteria(modifyMap,crth);
+
+        Criteria crt3 = Criteria.forClass(EisMovePush.class);
+        crt3.setRestriction(Restrictions.and(r1));
+        eisMovePushMapper.updateMapByCriteria(MapUtils.put("status", "30").getMap(),crt3);
+
+    }
+
+    @Transactional
+    @TxTransaction
+    @Override
+    public void moveDownConfirm(List<String> moveHeaderIds) {
+
+        Criteria crt = Criteria.forClass(WmsMoveD.class);
+        Restriction r1 = Restrictions.in("moveHeaderId", moveHeaderIds.toArray());
+        crt.setRestriction(Restrictions.and(r1));
+        List<WmsMoveD> moveDS = moveDMapper.findByCriteria(crt);
+        if(moveDS == null || moveDS.size() <= 0){
+            return;
+        }
+        for (WmsMoveD moveD : moveDS) {
+            MoveDListVO wmsMoveD = new MoveDListVO();
+            wmsMoveD.setMoveLineId(moveD.getMoveLineId());
+            wmsMoveD.setSource("EIS");
+            moveService.moveDownConfirm(wmsMoveD);
+        }
+
+        Criteria crt3 = Criteria.forClass(EisMovePush.class);
+        crt3.setRestriction(Restrictions.and(r1));
+        eisMovePushMapper.updateMapByCriteria(MapUtils.put("status", "40").getMap(),crt3);
+    }
+
+    @Transactional
+    @Override
+    public void releaseContainerCode(List<String> moveHeaderIds) {
+        UserDTO userDTO = userTemplate.getUserDTO();
+
+        Criteria criteria = Criteria.forClass(WmsMoveD.class);
+        criteria.restrictionBuilder()
+                .in("moveHeaderId", moveHeaderIds.toArray());
+        criteria.buildRestriction();
+        List<WmsMoveD> wmsMoveDS = moveDMapper.findByCriteria(criteria);
+        if(wmsMoveDS == null || wmsMoveDS.size() <= 0){
+            return;
+        }
+        List<String> containercodes = wmsMoveDS.stream().filter(item -> StringUtils.isNotBlank(item.getOutContainerCode())).map(WmsMoveD::getOutContainerCode).collect(Collectors.toList());
+        if(containercodes == null || containercodes.size() <= 0){
+            return;
+        }
+        ByContainerVo byContainerVo = new ByContainerVo();
+        byContainerVo.setContainerCodes(containercodes);
+        RestMessage<Map<String, List<WmsInvStockQtyVO>>> mapRestMessage = stockResource.listStockLotByContainerCode(byContainerVo);
+        log.info("定时任务处理不合格库移库-查询托盘库存返回结果:{}", JSON.toJSONString(mapRestMessage));
+        if(mapRestMessage == null || !mapRestMessage.isSuccess() ){
+            return;
+        }
+        List<String> emptyContainerCodes = new ArrayList<>();
+        if(mapRestMessage.getData() == null || mapRestMessage.getData().size() <= 0){
+            emptyContainerCodes = containercodes;
+        }else {
+            Map<String, List<WmsInvStockQtyVO>> map = mapRestMessage.getData();
+            for (String containercode : containercodes) {
+                if(!map.containsKey(containercode) || map.get(containercode) == null || map.get(containercode).size() <= 0){
+                    emptyContainerCodes.add(containercode);
+                }else {
+                    BigDecimal qtyTotal = map.get(containercode).stream().map(WmsInvStockQtyVO::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
+                    if(qtyTotal.compareTo(BigDecimal.ZERO) <= 0){
+                        emptyContainerCodes.add(containercode);
+                    }
+
+                }
+            }
+        }
+        if(emptyContainerCodes.size() > 0){
+            //释放容器
+            ContainerQueryVO containerQueryVO = new ContainerQueryVO();
+            containerQueryVO.setContainerCodeList(emptyContainerCodes);
+            containerQueryVO.setWarehouseId(userDTO.getUserBizModel().getDefaultWarehouseId());
+            log.info("定时任务处理不合格库移库释放容器入参:",JSON.toJSONString(containerQueryVO));
+            warehouseResource.release(containerQueryVO);
+        }
+
+
+    }
+
+    /**
+     * 校验入参
+     * @param vo
+     */
+    private void checkParam(EisMovePushVO vo) {
+        UserDTO userDTO = userTemplate.getUserDTO();
+
+        if(StringUtils.isBlank(vo.getMsgId())){
+            throw new ParameterException("msgId不能为空!");
+        }
+        if(StringUtils.isBlank(vo.getWarehouseId())){
+            throw new ParameterException("warehouseId不能为空!");
+        }
+
+        for (EisMovePushSubBeanVO subBeanVO : vo.getSubList()) {
+            if(StringUtils.isBlank(subBeanVO.getItemId())){
+                throw new ParameterException("itemid不能为空!");
+            }
+            if(StringUtils.isBlank(subBeanVO.getLotId())){
+                throw new ParameterException("lotid不能为空!");
+            }
+            if(StringUtils.isBlank(subBeanVO.getOriginalArea())){
+                throw new ParameterException("originalArea不能为空!");
+            }
+            if(StringUtils.isBlank(subBeanVO.getTargetArea())){
+                throw new ParameterException("targetArea不能为空!");
+            }
+            if("AGVL".equals(subBeanVO.getOriginalArea())){
+                subBeanVO.setContainerNo(null);
+            }else {
+                if(StringUtils.isBlank(subBeanVO.getContainerNo())){
+                    throw new ParameterException("containerNo不能为空!");
+                }
+            }
+            if(StringUtils.isBlank(subBeanVO.getTaskLineId())){
+                throw new ParameterException("taskLineId不能为空!");
+            }
+            if(StringUtils.isBlank(subBeanVO.getOwnerId())){
+                throw new ParameterException("ownerId不能为空!");
+            }
+            if(subBeanVO.getInventoryQty() == null || 0 == subBeanVO.getInventoryQty().intValue()){
+                throw new ParameterException("inventoryQty不能为空!");
+            }
+            if(subBeanVO.getOriginalArea().equals(subBeanVO.getTargetArea())){
+                throw new BizException("源库别和目标库别不能相同!");
+            }
+            if("MJZ".equals(subBeanVO.getOriginalArea())){
+                subBeanVO.setOriginalArea("MJK");
+            }
+            //校验是否重复下传
+            EisMovePush eisMovePush = eisMovePushMapper.findById(vo.getMsgId(),EisMovePush.class);
+            if(eisMovePush != null && StringUtils.isNotEmpty(eisMovePush.getMoveHeaderId())){
+                throw new BizException(eisMovePush.getMsgId()+"已经下传!");
+            }
+            if(eisMovePush != null){
+                eisMovePushMapper.deleteById(eisMovePush.getMsgId(),EisMovePush.class);
+            }
+
+        }
+        List<EisMovePushSubBeanVO> subList = vo.getSubList();
+        //根据库区查询货位
+        List<String> originalAreas = subList.stream().map(EisMovePushSubBeanVO::getOriginalArea).collect(Collectors.toList());
+        List<String> targetAreas = subList.stream().map(EisMovePushSubBeanVO::getTargetArea).collect(Collectors.toList());
+        originalAreas.addAll(targetAreas);
+
+        WhLocatorQueryVO whLocatorQueryVO = new WhLocatorQueryVO();
+        whLocatorQueryVO.setIncludeAreaCategory(originalAreas);
+        RestMessage<List<BaseWmsWarehouseLocator>> locatorListRmg = warehouseClient.locatorList(whLocatorQueryVO);
+        if(locatorListRmg == null || !locatorListRmg.isSuccess() || locatorListRmg.getData() == null || locatorListRmg.getData().size() <= 0){
+            throw new BizException("库区不存在!");
+        }
+
+        List<BaseWmsWarehouseLocator> warehouseLocators = locatorListRmg.getData();
+
+        String[] batchIds = subList.stream().map(EisMovePushSubBeanVO::getLotId).distinct().toArray(String[]::new);
+        RestMessage<List<BatchNumberListVO>> batchResult = stockResource.getBatchNumberBasicInfo(batchIds);
+        if (!batchResult.isSuccess() || CollectionUtil.isEmpty(batchResult.getData())) {
+            throw new BizException("获取批次信息失败");
+        }
+        List<BatchNumberListVO> batchNumbers = batchResult.getData();
+
+        List<WmsInvStockQtyQueryVO> qtyQueries = new ArrayList<>();
+        //根据商品、批次、货位查询库存
+        for (EisMovePushSubBeanVO subBeanVO : subList) {
+            WmsInvStockQtyQueryVO stockQtyQueryVO = new WmsInvStockQtyQueryVO();
+            stockQtyQueryVO.setEnterpriseId(userDTO.getEnterpriseId());
+            stockQtyQueryVO.setWarehouseId(vo.getWarehouseId());
+            stockQtyQueryVO.setItemId(subBeanVO.getItemId());
+            stockQtyQueryVO.setBatchId(subBeanVO.getLotId());
+            BaseWmsWarehouseLocator srcWarehouseLocator = warehouseLocators.stream().filter(item -> item.getWarehouseAreaCategory().equals(subBeanVO.getOriginalArea())).findFirst().orElse(null);
+            if(srcWarehouseLocator == null){
+                throw new BizException("源库区:"+subBeanVO.getOriginalArea()+"查询货位失败!");
+            }
+            subBeanVO.setSrcLocatorId(srcWarehouseLocator.getWarehouseLocatorId());
+            subBeanVO.setOutBldgId(srcWarehouseLocator.getBldgId());
+            stockQtyQueryVO.setLocatorId(srcWarehouseLocator.getWarehouseLocatorId());
+
+            BaseWmsWarehouseLocator targetWarehouseLocator = warehouseLocators.stream().filter(item -> item.getWarehouseAreaCategory().equals(subBeanVO.getTargetArea())).findFirst().orElse(null);
+            if(targetWarehouseLocator == null){
+                throw new BizException("目标库区:"+subBeanVO.getTargetArea()+"查询货位失败!");
+            }
+            subBeanVO.setTargetLocatorId(targetWarehouseLocator.getWarehouseLocatorId());
+            subBeanVO.setInBldgId(targetWarehouseLocator.getBldgId());
+
+            BatchNumberListVO batchNumberListVO = batchNumbers.stream().filter(item -> item.getBatchId().equals(subBeanVO.getLotId())).findFirst().orElse(null);
+            if(batchNumberListVO == null){
+                throw new BizException("批次:"+subBeanVO.getLotId()+"查询批次失败!");
+            }
+            subBeanVO.setUom(batchNumberListVO.getCaseUom());
+            subBeanVO.setCaseConversionRate(batchNumberListVO.getCaseConversionRate());
+
+            stockQtyQueryVO.setStatus("1");
+
+            qtyQueries.add(stockQtyQueryVO);
+        }
+        RestMessage<List<WmsInvStockQtyVO>> availableQuantityListMsg = stockResource.getAvailableQuantityListV2(qtyQueries);
+        if (!availableQuantityListMsg.isSuccess() || CollectionUtil.isEmpty(availableQuantityListMsg.getData())) {
+            throw new BizException("获取可用库存信息失败");
+        }
+        List<WmsInvStockQtyVO> availableQuantitys = availableQuantityListMsg.getData();
+        for (EisMovePushSubBeanVO subBeanVO : subList) {
+            List<WmsInvStockQtyVO> quantitysList;
+            if(StringUtils.isBlank(subBeanVO.getContainerNo())){
+                quantitysList = availableQuantitys.stream().filter(item -> item.getItemId().equals(subBeanVO.getItemId())
+                        && item.getLocatorId().equals(subBeanVO.getSrcLocatorId())
+                        && item.getBatchId().equals(subBeanVO.getLotId())).collect(Collectors.toList());
+            }else {
+                quantitysList = availableQuantitys.stream().filter(item -> item.getItemId().equals(subBeanVO.getItemId())
+                        && item.getLocatorId().equals(subBeanVO.getSrcLocatorId())
+                        && item.getBatchId().equals(subBeanVO.getLotId())
+                        && item.getContainerCode().equals(subBeanVO.getContainerNo())).collect(Collectors.toList());
+            }
+            if(quantitysList == null || quantitysList.size() <= 0){
+                throw new BizException("商品:"+subBeanVO.getItemId() + ",批次:"+subBeanVO.getLotId() + ",源库区:"+subBeanVO.getOriginalArea()+",容器:"+subBeanVO.getContainerNo()+"没有可用库存!");
+            }
+            BigDecimal availableQuantity = quantitysList.stream().map(WmsInvStockQtyVO::getAvailableQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
+            if(availableQuantity.compareTo(subBeanVO.getInventoryQty()) < 0){
+                throw new BizException("商品:"+subBeanVO.getItemId() + ",批次:"+subBeanVO.getLotId() + ",源库区:"+subBeanVO.getOriginalArea()+",容器:"+subBeanVO.getContainerNo()+"可用库存:"+availableQuantity+"小于移库数量:"+subBeanVO.getInventoryQty());
+            }
+        }
+
+    }
+
+    private List<WmsMoveSaveVO> convertMoveVo(List<EisMovePush> eisMovePushes) {
+        List<WmsMoveSaveVO> list = new ArrayList<>();
+        for (EisMovePush eisMovePush : eisMovePushes) {
+            WmsMoveSaveVO moveSaveVO = new WmsMoveSaveVO();
+            moveSaveVO.setMsgId(eisMovePush.getMsgId());
+            moveSaveVO.setWarehouseId(eisMovePush.getWarehouseId());
+            moveSaveVO.setCargoOwnerId(eisMovePush.getOwnerId());
+            moveSaveVO.setWarehouseWorkerId(eisMovePush.getEmployeeId());
+            moveSaveVO.setMoveInBldg(eisMovePush.getMoveInBldg());
+            moveSaveVO.setMoveOutBldg(eisMovePush.getMoveOutBldg());
+            moveSaveVO.setSource("EIS");
+
+            List<WmsMoveDetailVO> moveDetails = new ArrayList<>();
+
+            WmsMoveDetailVO moveDetailVO = new WmsMoveDetailVO();
+            moveDetailVO.setOutLocatorId(eisMovePush.getOutLocatorId());
+            moveDetailVO.setOutContainerCode(eisMovePush.getContainerNo());
+            moveDetailVO.setOutGoodsCaseCode(eisMovePush.getLocationNo());
+            moveDetailVO.setInLocatorId(eisMovePush.getInLocatorId());
+            moveDetailVO.setItemId(eisMovePush.getItemId());
+            moveDetailVO.setUom(eisMovePush.getUom());
+            moveDetailVO.setBatchId(eisMovePush.getLotId());
+            moveDetailVO.setCaseConversionRate(eisMovePush.getCaseConversionRate());
+
+            BigDecimal[] n = eisMovePush.getInventoryQty().divideAndRemainder(eisMovePush.getCaseConversionRate());
+            moveDetailVO.setCaseQuantity(n[0]);
+            moveDetailVO.setOddPieceQuantity(eisMovePush.getInventoryQty().subtract(moveDetailVO.getCaseQuantity().multiply(moveDetailVO.getCaseConversionRate())));
+
+            moveDetailVO.setOutStockStatus("1");
+            moveDetailVO.setInStockStatus("2");
+            moveDetailVO.setInwarehouseAreaCategory(eisMovePush.getTargetArea());
+            moveDetailVO.setOutwarehouseAreaCategory(eisMovePush.getOriginalArea());
+
+            moveDetails.add(moveDetailVO);
+
+            moveSaveVO.setMoveDetails(moveDetails);
+
+            list.add(moveSaveVO);
+        }
+        return list;
+    }
+}

+ 33 - 2
upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/service/impl/MoveServiceImpl.java

@@ -37,6 +37,7 @@ import com.prolog.cs.biz.inbound.constant.BizConstant;
 import com.prolog.cs.biz.inbound.dto.WhAreaCategoryContext;
 import com.prolog.cs.biz.outbound.model.dto.ContainerConfirmDto;
 import com.prolog.cs.biz.outbound.model.dto.EisConfirmSubVo;
+import com.prolog.cs.biz.outbound.model.entity.MoveTaskDO;
 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;
@@ -100,6 +101,7 @@ import com.prolog.upcloud.base.wh.operate.vo.*;
 import lombok.RequiredArgsConstructor;
 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;
@@ -203,6 +205,8 @@ public class MoveServiceImpl implements MoveService {
     private MqOperateProducer mqProducer;
     @Resource
     private EisHandler eisHandler;
+    @Autowired
+    private EisMovePushMapper eisMovePushMapper;
 
 
     /**
@@ -259,6 +263,7 @@ public class MoveServiceImpl implements MoveService {
         moveH.setPrintCount(0L);
         moveH.setCreatorName(user.getNickname());
         moveH.setModifierName(user.getNickname());
+        moveH.setAttribute3(saveVO.getSource());
         moveHMapper.save(moveH);
 
         AtomicLong lineNum = new AtomicLong(1);
@@ -360,7 +365,7 @@ public class MoveServiceImpl implements MoveService {
 
         // 只要是erp审核通过的状态,都需要发送agv下架命令
 //        excuteTransferOut(dList, moveH);
-
+        saveVO.setMoveHeaderId(moveH.getMoveHeaderId());
     }
 
     @Override
@@ -1403,6 +1408,7 @@ public class MoveServiceImpl implements MoveService {
                             moveDMapper.updateMapById(d.getLineId(), MapUtils.put("inLocatorId", moveD.getInLocatorId()).getMap(), WmsMoveD.class);
                             //更新预占信息
                             modifyLocatorIdList.add(d);
+
                         }
                     }
                 }
@@ -1501,6 +1507,8 @@ public class MoveServiceImpl implements MoveService {
             //回告Eis托盘回库
             ThreadUtil.execAsync(()-> {this.moveToEis(confirmParamsVO.getLineIds());});
         }
+        //如果是eis下传的移库单,则将移库单中间表状态改为50
+        handleEisPushMove(confirmParamsVO.getLineIds());
         return message;
     }
 
@@ -1553,7 +1561,7 @@ public class MoveServiceImpl implements MoveService {
         }
         WarehouseLocatorBasicInfo outLocator = locatorResult.getData().get(0);
         // 若选择审核的移库记录中【移出库别】=【设备库】,则推送盘点审核信息至EIS
-        if (PICK_MODE_DEVICE.equals(outLocator.getPickMode())) {
+        if (PICK_MODE_DEVICE.equals(outLocator.getPickMode()) && (StringUtils.isBlank(wmsMoveD.getSource()) || !"EIS".equals(wmsMoveD.getSource()))) {
             // 查询商品资料
             RestMessage<BaseMtlItemMst> rest = itemResource.item(moveTask.getItemId());
             if (!rest.isSuccess() || null == rest.getData()) {
@@ -4439,4 +4447,27 @@ public class MoveServiceImpl implements MoveService {
         throw new BizException("合托操作必须勾选两个托盘号进行合托");
     }
 
+    /**
+     * 处理eis下传移库单
+     * @param moveLineIds
+     */
+    private void handleEisPushMove(String[] moveLineIds){
+        FieldSelector fs1 = FieldSelector.newInstance().include("moveHeaderId");
+        List<WmsMoveD> wmsMoveDS = moveDMapper.findByIds(WmsMoveD.class, moveLineIds, fs1);
+        if(wmsMoveDS != null && wmsMoveDS.size() > 0){
+            List<String> moveHeadIds = wmsMoveDS.stream().map(WmsMoveD::getMoveHeaderId).collect(Collectors.toList());
+            List<WmsMoveH> wmsMoveHS = moveHMapper.findByIds(WmsMoveH.class, moveHeadIds.toArray(), null);
+            if(wmsMoveHS != null && wmsMoveHS.size() > 0){
+                List<WmsMoveH> moveHS = wmsMoveHS.stream().filter(item -> "EIS".equals(item.getAttribute3())).collect(Collectors.toList());
+                if(moveHS != null && moveHS.size() > 0){
+                    List<String> eisMoveHeaderIds = moveHS.stream().map(WmsMoveH::getMoveHeaderId).collect(Collectors.toList());
+                    Criteria ct = Criteria.forClass(EisMovePush.class);
+                    Restriction res = Restrictions.in("moveHeaderId",eisMoveHeaderIds.toArray());
+                    ct.setRestriction(res);
+                    eisMovePushMapper.updateMapByCriteria(MapUtils.put("status","50").getMap(),ct);
+                }
+            }
+        }
+    }
+
 }

+ 106 - 23
upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/service/impl/ReplenishServiceImpl.java

@@ -48,6 +48,8 @@ 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.FieldSelector;
+import com.prolog.framework.core.restriction.Restriction;
+import com.prolog.framework.core.restriction.Restrictions;
 import com.prolog.framework.dao.pagehelper.PageHelper;
 import com.prolog.framework.dao.util.PageUtils;
 import com.prolog.framework.utils.MapUtils;
@@ -675,7 +677,10 @@ public class ReplenishServiceImpl implements WmsReplenishService {
             ReplenishInitiativeSaveDetailVO detailVO = new ReplenishInitiativeSaveDetailVO();
             detailVO.setCargoOwnerId((String) map.get("cargoOwnerId"));
             detailVO.setItemId((String) map.get("itemId"));
-            detailVO.setPieceQuantity(new BigDecimal((Double) map.get("totalReplenishQuantity")));
+            Double totalReplenishNum = (Double) map.get("totalReplenishNum");
+            Double caseConversionRate = (Double) map.get("caseConversionRate");
+
+            detailVO.setPieceQuantity(new BigDecimal(totalReplenishNum * caseConversionRate));
             detailVO.setWarehouseAreaCategory((String) map.get("warehouseCategoryCode"));
             details.add(detailVO);
         }
@@ -732,7 +737,7 @@ public class ReplenishServiceImpl implements WmsReplenishService {
             }
             //查询补货明细同品同批同货位可用库存明细
 
-            BigDecimal alvQty = wmsInvStockQtyVOS.stream().filter(item -> item.getItemId().equals(replenishD.getItemId())
+            BigDecimal alvQty = wmsInvStockQtyVOS.stream().filter(item -> item != null && item.getItemId().equals(replenishD.getItemId())
                     && item.getLocatorId().equals(replenishD.getWhLocatorId())
                     && item.getBatchId().equals(replenishD.getBatchId())).map(WmsInvStockQtyVO::getAvailableQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
             if(exceed.getExceedQyt().compareTo(alvQty) > 0){
@@ -758,7 +763,16 @@ public class ReplenishServiceImpl implements WmsReplenishService {
         }
 
         stockResource.addQty(updateQtyVos);
-        outBoundClient.changeTaskQty(exceeds);
+        //修改补货出库单数量改为异步处理
+        new Thread(()-> {
+
+            try {
+                outBoundClient.changeTaskQty(exceeds);
+            }catch (Exception e) {
+                e.printStackTrace();
+                log.error("修改补货出库数量失败:{}", e.getMessage());
+            }
+        }).start();
 
         return exceedSubList;
     }
@@ -780,6 +794,9 @@ public class ReplenishServiceImpl implements WmsReplenishService {
         List<OutBoundRequestVO> list = new ArrayList<>();
         for (WmsReplenishH h : hs) {
             List<WmsReplenishD> replenishDS = dList.stream().filter(item -> item.getHeaderId().equals(h.getHeaderId())).collect(Collectors.toList());
+            if(replenishDS == null || replenishDS.size() <= 0){
+                continue;
+            }
             OutBoundRequestVO eisPushTaskV2VO = this.getEisPushTaskV2VO(h,replenishDS);
             list.add(eisPushTaskV2VO);
         }
@@ -805,6 +822,51 @@ public class ReplenishServiceImpl implements WmsReplenishService {
 //        return vo;
 //    }
 
+
+    @Override
+    public void changeRepIsSendEisByWaveId(String waveId) {
+        Criteria criteria = Criteria.forClass(WmsReplenishH.class);
+        criteria.setRestriction(Restrictions.eq("waveId", waveId));
+        hMapper.updateMapByCriteria(MapUtils.put("isPushEis","1").getMap(),criteria);
+    }
+
+    @Override
+    public void autoPushToEis() {
+        Criteria criteria = Criteria.forClass(WmsReplenishH.class);
+        Restriction r1 = Restrictions.eq("isPushEis", "");
+        Restriction r2 = Restrictions.isnull("isPushEis");
+        Restriction r3 = Restrictions.isNotNull("waveId");
+        criteria.setRestriction(Restrictions.or(r1,r2).and(r3));
+        List<WmsReplenishH> hs = hMapper.findByCriteria(criteria);
+        if(hs == null || hs.size() <= 0){
+            return;
+        }
+        List<String> headerIds = hs.stream().map(WmsReplenishH::getHeaderId).collect(Collectors.toList());
+        Criteria ctd = Criteria.forClass(WmsReplenishD.class);
+        ctd.restrictionBuilder().in("headerId", headerIds.toArray());
+        ctd.buildRestriction();
+        List<WmsReplenishD> dList = dMapper.findByCriteria(ctd);
+        if(dList == null || dList.size() <= 0){
+            return ;
+        }
+        List<OutBoundRequestVO> list = new ArrayList<>();
+        for (WmsReplenishH h : hs) {
+            List<WmsReplenishD> replenishDS = dList.stream().filter(item -> item.getHeaderId().equals(h.getHeaderId())).collect(Collectors.toList());
+            if(replenishDS == null || replenishDS.size() <= 0){
+                continue;
+            }
+            OutBoundRequestVO eisPushTaskV2VO = this.getEisPushTaskV2VO(h,replenishDS);
+            list.add(eisPushTaskV2VO);
+        }
+        log.info("通过波次id获取补货任务推送eis入参列表:{}",JSON.toJSONString(list));
+        eisHandler.outBoundRequest(list);
+
+        //更新推送标识
+        Criteria cthupdate = Criteria.forClass(WmsReplenishH.class);
+        cthupdate.setRestriction(Restrictions.in("headerId", headerIds.toArray()));
+        hMapper.updateMapByCriteria(MapUtils.put("isPushEis","1").getMap(),cthupdate);
+    }
+
     /**
      * 补货推送eis
      * @param wmsReplenishH
@@ -819,6 +881,7 @@ public class ReplenishServiceImpl implements WmsReplenishService {
         List<OutBoundRequestItemVO> subListBeans = new ArrayList<>();
 
         Set<String> itemIds = dList.stream().map(WmsReplenishD::getItemId).collect(Collectors.toSet());
+        log.info("补货推送eis,查询商品入参:{}",JSON.toJSONString(itemIds));
         List<BaseMtlItemMst> items = RestMsgHelper.unpack(itemResource.getListByIds(itemIds));
         if (CollUtil.isEmpty(items)) {
             throw new BizException("补货查询商品信息失败!");
@@ -832,7 +895,7 @@ public class ReplenishServiceImpl implements WmsReplenishService {
             OutBoundRequestItemVO subListBean = new OutBoundRequestItemVO();
             subListBean.setWorkType(OutBoundRequestEnum.INV_RTM.getWorkType());
             subListBean.setBusinessType(OutBoundRequestEnum.INV_RTM.getBusinessType());
-            subListBean.setTaskId(d.getHeaderId());
+            subListBean.setTaskId(d.getDetailId());
             subListBean.setBillNo(wmsReplenishH.getAutoBillNum());
             subListBean.setStr1("1");
             subListBean.setStr2("1");
@@ -878,29 +941,47 @@ public class ReplenishServiceImpl implements WmsReplenishService {
 
     private List<StockLocatorDTO> getStockLocators(ReplenishInitiativeSaveVO saveVO, Map<String, BigDecimal> locatorChooseQtyMap, ReplenishInitiativeSaveDetailVO detail, ItemBaseInfoVO itemBaseInfoVO, List<ReplenishRuleDTO> replenishRules) {
 
-        List<StockLocatorDTO> stockLocators = RestMsgHelper.unpack(stockResource.getItemLocators(saveVO.getWarehouseId(), detail.getCargoOwnerId(), detail.getItemId(), StockStatusEnum.QUALIFIED.getCode()));
-        Assert.notEmpty(stockLocators, "未找到商品【%s】库存信息", itemBaseInfoVO.getItemName());
-
-        String[] locationIds = stockLocators.stream().map(StockLocatorDTO::getLocatorId).distinct().toArray(String[]::new);
-        List<HashMap<String, Object>> locations = RestMsgHelper.unpack(warehouseClient.getLocationDetailInfos(locationIds));
-        Assert.notEmpty(locations, "获取货位消息失败");
-
-        Map<String, List<HashMap<String, Object>>> fixLocators = locations.stream().filter(l -> replenishRules.stream().map(ReplenishRuleDTO::getSrcWarehouseAreaId).collect(Collectors.toList()).contains(String.valueOf(l.get("warehouseAreaId")))).collect(Collectors.groupingBy(l -> String.valueOf(l.get("warehouseAreaId"))));
-        Assert.notEmpty(fixLocators, "没有适合补货策略的货位");
+        List<StockLocatorDTO> stockLocatorList = RestMsgHelper.unpack(stockResource.getItemLocatorsV2(saveVO.getWarehouseId(), detail.getCargoOwnerId(), detail.getItemId(), StockStatusEnum.QUALIFIED.getCode()));
+        Assert.notEmpty(stockLocatorList, "未找到商品【%s】库存信息", itemBaseInfoVO.getItemName());
+        Map<String, List<StockLocatorDTO>> stockMap = stockLocatorList.stream().collect(Collectors.groupingBy(StockLocatorDTO::getWarehouseAreaId));
+        List<StockLocatorDTO> locatorDTOList = new ArrayList<>();
 
         String[] areaIds = replenishRules.stream().sorted(Comparator.comparing(ReplenishRuleDTO::getSort)).map(ReplenishRuleDTO::getSrcWarehouseAreaId).distinct().toArray(String[]::new);
-        List<HashMap<String, Object>> maps = Collections.emptyList();
         for (String areaId : areaIds) {
-            maps = fixLocators.get(areaId);
-            if (CollUtil.isNotEmpty(maps)) {
+            if(!stockMap.containsKey(areaId)){
+                continue;
+            }
+            List<StockLocatorDTO> value = stockMap.get(areaId);
+            //校验库区可用库存数量是否大于补货数量
+            BigDecimal availableQuantitys = value.stream().map(StockLocatorDTO::getAvailableQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
+            if(availableQuantitys.compareTo(detail.getPieceQuantity()) >= 0 ){
+                locatorDTOList.clear();
+                locatorDTOList.addAll(value);
                 break;
             }
-        }
-
-        List<HashMap<String, Object>> finalMaps = maps;
-        List<StockLocatorDTO> result = stockLocators.stream().filter(s -> finalMaps.stream().map(m -> String.valueOf(m.get("warehouseLocatorId"))).collect(Collectors.toList()).contains(s.getLocatorId())).collect(Collectors.toList());
+            locatorDTOList.addAll(value);
+        }
+        Assert.notEmpty(locatorDTOList, "没有适合补货策略的货位");
+
+//        String[] locationIds = stockLocators.stream().map(StockLocatorDTO::getLocatorId).distinct().toArray(String[]::new);
+//        List<HashMap<String, Object>> locations = RestMsgHelper.unpack(warehouseClient.getLocationDetailInfos(locationIds));
+//        Assert.notEmpty(locations, "获取货位消息失败");
+//
+//        Map<String, List<HashMap<String, Object>>> fixLocators = locations.stream().filter(l -> replenishRules.stream().map(ReplenishRuleDTO::getSrcWarehouseAreaId).collect(Collectors.toList()).contains(String.valueOf(l.get("warehouseAreaId")))).collect(Collectors.groupingBy(l -> String.valueOf(l.get("warehouseAreaId"))));
+//        Assert.notEmpty(fixLocators, "没有适合补货策略的货位");
+//
+//        String[] areaIds = replenishRules.stream().sorted(Comparator.comparing(ReplenishRuleDTO::getSort)).map(ReplenishRuleDTO::getSrcWarehouseAreaId).distinct().toArray(String[]::new);
+//        List<HashMap<String, Object>> maps = Collections.emptyList();
+//        for (String areaId : areaIds) {
+//            maps = fixLocators.get(areaId);
+//            if (CollUtil.isNotEmpty(maps)) {
+//                break;
+//            }
+//        }
 
-        return result;
+//        List<HashMap<String, Object>> finalMaps = maps;
+//        List<StockLocatorDTO> result = stockLocators.stream().filter(s -> finalMaps.stream().map(m -> String.valueOf(m.get("warehouseLocatorId"))).collect(Collectors.toList()).contains(s.getLocatorId())).collect(Collectors.toList());
+        return locatorDTOList;
     }
 
     private List<StockLocatorDTO> getLimitLocators(ReplenishInitiativeSaveVO saveVO, UserDTO user, List<ReplenishRuleDTO> replenishRules, ReplenishInitiativeSaveDetailVO detail, List<StockLocatorDTO> stockLocators, ItemBaseInfoVO item) {
@@ -1223,8 +1304,10 @@ public class ReplenishServiceImpl implements WmsReplenishService {
                 .in("detailId", lineId.split(","));
         criteria.buildRestriction();
         List<WmsReplenishD> dList = dMapper.findByCriteria(criteria);
-        if (CollectionUtil.isEmpty(dList)) {
-            throw new BizException("未找到有效的补货单明细");
+        if (CollectionUtil.isEmpty(dList) && user == null) {
+            log.info("未找到有效的补货单明细或补货任务已完成!");
+            return;
+
         }
         //        List<WmsReplenishD> replenishDtls = getReplenishDltsByInParams(confirmParamsVO, dList);
         BigDecimal sumPieceQuantity = dList.stream().map(WmsReplenishD::getPieceQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);

+ 6 - 2
upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/java/com/prolog/upcloud/base/wh/operate/service/impl/eis/WmsOperateHandler.java

@@ -295,6 +295,10 @@ public class WmsOperateHandler implements WmsHandler {
         //缺货列表
         List<MarkTaskItemVO> lacks = subList.stream().filter(item -> item.getLackQty().compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList());
 
+        MarkTaskVO result = new MarkTaskVO();
+        result.setMsgId(vo.getMsgId());
+        result.setWarehouseId(vo.getWarehouseId());
+
         List<MarkTaskItemVO> exceedList = new ArrayList<>();
         if(exceeds != null && exceeds.size() > 0){
             Map<String, List<MarkTaskItemVO>> map = exceeds.stream().collect(Collectors.groupingBy(MarkTaskItemVO::getTaskLineId));
@@ -330,12 +334,12 @@ public class WmsOperateHandler implements WmsHandler {
 //                throw new BizException("BC品不允许超补!");
 //            }
             List<MarkTaskItemVO> exceedSubList = wmsReplenishService.exceedTask(exceedList);
-            vo.setExceedSubList(exceedSubList);
+            result.setExceedSubList(exceedSubList);
         }
         if(lacks != null && lacks.size() > 0){
 
         }
-        return vo;
+        return result;
     }
 
     private void checkMarkTaskVo(MarkTaskVO vo) {

+ 11 - 0
upcloud-base-wh-operate/upcloud-base-wh-operate-service/src/main/resources/mappers/mysql/EisMovePushMapper.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.prolog.upcloud.base.wh.operate.dao.EisMovePushMapper">
+
+
+    <select id="getUnCreateMoves" resultType="com.prolog.upcloud.base.wh.operate.model.EisMovePush">
+
+        select * from eis_move_push where status = '10' limit #{autoCreateMoveCount}
+
+    </select>
+</mapper>

+ 2 - 2
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/OmsDoBillHDO.java

@@ -293,7 +293,7 @@ public class OmsDoBillHDO implements Serializable {
     @Column(value = "attr_str6")
     private String attrStr6;
 
-    @ApiModelProperty(value = "出库清单模板 1: 通用版 2: 折后版 3:商品分类版")
+    @ApiModelProperty(value = "出库清单模板 1: 通用版 2: 折后版")
     @Column(value = "attr_str7")
     private String attrStr7;
 
@@ -325,7 +325,7 @@ public class OmsDoBillHDO implements Serializable {
     @Column(value = "attr_num4")
     private BigDecimal attrNum4;
 
-    @ApiModelProperty(value = "数字扩展属性5")
+    @ApiModelProperty(value = "打印次数")
     @Column(value = "attr_num5")
     private BigDecimal attrNum5;
 

+ 9 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/dto/BillPackageDTO.java

@@ -42,4 +42,13 @@ public class BillPackageDTO {
 	@ApiModelProperty(value = "重量")
 	private String weight;
 
+	@ApiModelProperty(value = "子单号")
+	private String subBillNo;
+
+	@ApiModelProperty(value = "母单号")
+	private String motherBillNo;
+
+	@ApiModelProperty(value = "面单类型")
+	private String waybillType;
+
 }

+ 37 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/dto/EisStockContainerNoDTO.java

@@ -0,0 +1,37 @@
+package com.prolog.cs.biz.outbound.model.dto;
+
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor
+@Data
+public class EisStockContainerNoDTO {
+
+
+    /**
+     * id : 85096a0b-7a44-11ef-bb7b-000c29fa62b5
+     * ownerId : 748963439141064888
+     * itemId : ssssslhbh002
+     * lotId : 1034453680906178560
+     * packId : 1006608585624522752
+     * useStockCount : 80
+     * preStockCount : 0
+     * stockCount : 80
+     * containerNo : 20000093
+     * containerSubNo : 20000093A101
+     * wmsAreaNo : AGVL
+     */
+
+    private String id;
+    private String ownerId;
+    private String itemId;
+    private String lotId;
+    private String packId;
+    private Integer useStockCount;
+    private Integer preStockCount;
+    private Integer stockCount;
+    private String containerNo;
+    private String containerSubNo;
+    private String wmsAreaNo;
+}

+ 12 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/entity/BarcodeHDO.java

@@ -168,6 +168,10 @@ public class BarcodeHDO extends BaseModel implements Serializable {
     @Column(value = "tms_push_count")
     private Integer tmsPushCount;
 
+    @ApiModelProperty(value = "序号")
+    @Column(value = "seqno")
+    private Integer seqno;
+
     public String getCancelFlag() {
         return cancelFlag;
     }
@@ -487,4 +491,12 @@ public class BarcodeHDO extends BaseModel implements Serializable {
     public void setTmsPushCount(Integer tmsPushCount) {
         this.tmsPushCount = tmsPushCount;
     }
+
+    public Integer getSeqno() {
+        return seqno;
+    }
+
+    public void setSeqno(Integer seqno) {
+        this.seqno = seqno;
+    }
 }

+ 6 - 2
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/entity/OmsDoBillDDO.java

@@ -239,7 +239,7 @@ public class OmsDoBillDDO implements Serializable {
 	@Column(value = "attr_str5")
 	private String attrStr5;
 
-	@ApiModelProperty(value = "字符扩展属性6") 
+	@ApiModelProperty(value = "打印类型")
 	@Column(value = "attr_str6")
 	private String attrStr6;
 
@@ -263,7 +263,7 @@ public class OmsDoBillDDO implements Serializable {
 	@Column(value = "attr_num1")
 	private BigDecimal attrNum1;
 
-	@ApiModelProperty(value = "数字扩展属性2") 
+	@ApiModelProperty(value = "数字扩展属性2")
 	@Column(value = "attr_num2")
 	private BigDecimal attrNum2;
 
@@ -429,4 +429,8 @@ public class OmsDoBillDDO implements Serializable {
 	@Ignore
 	@ApiModelProperty(value = "双人业务类型(0:正常 1:双人验收,默认正常)")
 	private Integer itemHealthIsDouble;
+
+	@Ignore
+	@ApiModelProperty(value = "整零标识(0整件,1散件)")
+	private Integer zsFlag;
 }

+ 13 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/tms/TmsShipBillPackageItem.java

@@ -3,6 +3,8 @@ package com.prolog.cs.biz.outbound.model.tms;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  * TMS包裹明细
  *
@@ -164,4 +166,15 @@ public class TmsShipBillPackageItem {
     @ApiModelProperty(value = "企业ID", required = true)
     private String enterpriseId;
 
+    @ApiModelProperty(value = "子单号")
+    private String subBillNo;
+
+    @ApiModelProperty(value = "母单号")
+    private String motherBillNo;
+
+    @ApiModelProperty(value = "面单类型")
+    private String waybillType;
+
+    private List<TmsShipBillPackageItemDetail> details;
+
 }

+ 21 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/tms/TmsShipBillPackageItemDetail.java

@@ -0,0 +1,21 @@
+package com.prolog.cs.biz.outbound.model.tms;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+public class TmsShipBillPackageItemDetail {
+
+    private String packageId;
+
+    private String packageCode;
+
+    private String itemCode;
+
+    private String itemName;
+
+    private BigDecimal pcs;
+
+    private BigDecimal qty;
+}

+ 14 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/vo/OmsBillDDVO.java

@@ -0,0 +1,14 @@
+package com.prolog.cs.biz.outbound.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class OmsBillDDVO {
+
+    @ApiModelProperty(value = "订单单明细表ID")
+    private String lineid;
+
+    @ApiModelProperty(value = "容器号/货格")
+    private String containerCode;
+}

+ 15 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/vo/ReceiveDoBillDetailVO.java

@@ -54,6 +54,21 @@ public class ReceiveDoBillDetailVO {
     @ApiModelProperty("有效期至")
     private String validUntil;
 
+    @ApiModelProperty("打印类型(1,线上药品;\n" +
+            "2,线上食品;\n" +
+            "3,线上器械;\n" +
+            "4,线上管控;\n" +
+            "5,线上其它\n" +
+            "6,线下药品;\n" +
+            "7,线下食品;\n" +
+            "8,线下器械;\n" +
+            "9,物料\n)")
+    private String printType;
+
     @ApiModelProperty("是否赠品")
     private String isGift;
+
+    private BigDecimal pcs;
+
+    private BigDecimal odd;
 }

+ 6 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/vo/ReceiveDoBillVO.java

@@ -165,6 +165,12 @@ public class ReceiveDoBillVO {
     @ApiModelProperty(value = "出库清单模板 1: 通用版 2: 折后版 3:商品分类版")
     private String printDetailMode;
 
+    @ApiModelProperty(value = "打印份数")
+    private Integer printNum;
+
+    @ApiModelProperty(value = "仓库地址")
+    private String branchAddress;
+
     @ApiModelProperty(value = "明细列表")
     private List<ReceiveDoBillDetailVO> detailList;
 

+ 2 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/model/vo/faceorder/FaceOrderAddVO.java

@@ -44,6 +44,8 @@ public class FaceOrderAddVO {
     //邮政快递包裹
     private String bizProductNo;
 
+    private Double weight;
+
     @Ignore
     private String lastFlag;
 

+ 2 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/service/DoPringService.java

@@ -8,8 +8,10 @@ public interface DoPringService {
     //void outDetailedPrint(String warehouseId, String consignorId, String billId, String printBillCode);
 
     Object outDetailedPrint(String warehouseId, String consignorId, String billId, String printBillCode);
+    Object outDetailedPrintV2(String warehouseId, String consignorId, String billId, String printBillCode);
 
     void outDetailedDownload(String warehouseId, String consignorId, String billId, String printBillCode, HttpServletResponse response, HttpServletRequest request);
+    void outDetailedDownloadV2(String warehouseId, String consignorId, String billId, String printBillCode, HttpServletResponse response, HttpServletRequest request);
 
     String outDetailedDownloadExtends(String type, String warehouseId, String consignorId, String billId, String printBillCode, HttpServletResponse response, HttpServletRequest request);
 

+ 7 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/service/IOmsDoBillDService.java

@@ -8,6 +8,7 @@ import com.prolog.cs.biz.outbound.model.SYZJPrintAgain;
 import com.prolog.cs.biz.outbound.model.dto.OmsDoBillDDTO;
 import com.prolog.cs.biz.outbound.model.dto.OmsDoBillHDTO;
 import com.prolog.cs.biz.outbound.model.entity.OmsDoBillDDO;
+import com.prolog.cs.biz.outbound.model.vo.OmsBillDDVO;
 import com.prolog.framework.core.pojo.Page;
 
 import java.util.List;
@@ -25,4 +26,10 @@ public interface IOmsDoBillDService {
     ScanCodeResultDTO scanSupervisionCode(String supervisionCode);
 
     List<RelationCodeResultDTO> relationSupervisionCode(List<RelationCodeResultVO> resultVOS);
+
+
+    List<OmsDoBillDDO> getDoBillDByBillIds(List<String> billIds);
+
+    void saveContainerCode(OmsBillDDVO omsBillDDVO);
+
 }

+ 2 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-facade/src/main/java/com/prolog/cs/biz/outbound/service/WavesService.java

@@ -85,4 +85,6 @@ public interface WavesService {
     Page<WaveDO> listWaveRepush(Map<String, Object> param);
 
     void hangupBill(List<String> taskLineIds);
+
+    List<EisStockContainerNoDTO> getEisStockContainerNos(String itemId, String lotId,Double itemQty,Integer zsFlag);
 }

+ 15 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/controller/OmsDoBillDController.java

@@ -3,6 +3,7 @@ package com.prolog.cs.biz.outbound.controller;
 import com.prolog.cs.biz.outbound.model.SYZJPrintAgain;
 import com.prolog.cs.biz.outbound.model.dto.OmsDoBillDDTO;
 import com.prolog.cs.biz.outbound.model.entity.OmsDoBillDDO;
+import com.prolog.cs.biz.outbound.model.vo.OmsBillDDVO;
 import com.prolog.cs.biz.outbound.service.IOmsDoBillDService;
 import com.prolog.framework.common.message.RestMessage;
 import com.prolog.framework.core.pojo.Page;
@@ -55,4 +56,18 @@ public class OmsDoBillDController {
         iOmsDoBillDService.PrintAgainZJ(list);
         return RestMessage.success("补打成功", null);
     }
+
+    @UserLog
+    @ApiOperation(value = "查询出库单行")
+    @PostMapping("/getDoBillDByBillNos")
+    public RestMessage<List<OmsDoBillDDO>> getDoBillDByBillIds (@RequestBody List<String> billIds) {
+        return RestMessage.success("操作成功", iOmsDoBillDService.getDoBillDByBillIds(billIds));
+    }
+    
+    @ApiOperation(value = "保存容器号")
+    @PostMapping("/saveContainerCode")
+    public RestMessage saveContainerCode(@RequestBody OmsBillDDVO omsBillDDVO) {
+        iOmsDoBillDService.saveContainerCode(omsBillDDVO);
+        return RestMessage.success("成功", null);
+    }
 }

+ 3 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/controller/PickTaskAppController.java

@@ -30,6 +30,7 @@ import com.prolog.framework.authority.util.HystrixVarUtil;
 import com.prolog.framework.common.message.RestMessage;
 import com.prolog.framework.core.exception.ParameterException;
 import com.prolog.framework.core.pojo.Page;
+import com.prolog.framework.lock.annotation.RepeatOperationLock;
 import com.prolog.framework.log.aop.annotation.UserLog;
 import com.prolog.framework.utils.MapUtils;
 import com.prolog.framework.utils.StringUtils;
@@ -315,6 +316,7 @@ public class PickTaskAppController {
     @ApiOperation(value = "整件-拣货确认")
     @PostMapping("/picktaskh-confirm")
     public RestMessage<?> pickTaskHConfirm(@RequestBody PickTaskDConfirmVO vo){
+        log.info("整件拣货确认入参:{}",JSON.toJSONString(vo));
         Map<String, Object> map = pickTaskAppService.pickTaskHConfirm(vo.getPickOrderId(), vo.getPickTaskDId(), vo.getPickTaskId(), vo.getPickQty(), vo.getRedReason(), vo.getRedType());
         Object data = map.get("printData");
         if(data != null){
@@ -415,6 +417,7 @@ public class PickTaskAppController {
 
     @UserLog
     @ApiOperation(value = "索取")
+    @RepeatOperationLock(timeOut = 5000)
     @ApiImplicitParam(name = "params", required = true, value = "{\"pickTaskType\":\"拣货类型(0:整件 1:零货 2:功能库房 3:整单)\",\"warehouseId\":\"仓id\",\"bldgId\":\"建筑物id\"}")
     @PostMapping("/v2/ask-pickorder")
     public RestMessage<?> askPickorder2(@RequestBody Map<String,Object> params){

+ 7 - 2
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/controller/RFOutCheckController.java

@@ -7,6 +7,8 @@ import com.netflix.hystrix.strategy.concurrency.HystrixRequestContext;
 import com.prolog.common.RestMsgHelper;
 import com.prolog.cs.basic.common.model.print.PrintParam;
 import com.prolog.cs.biz.outbound.dao.BarcodeHMapper;
+import com.prolog.cs.biz.outbound.dao.OmsDoBillHMapper;
+import com.prolog.cs.biz.outbound.model.OmsDoBillHDO;
 import com.prolog.cs.biz.outbound.model.dto.WavesCreateDTO;
 import com.prolog.cs.biz.outbound.model.dto.check.OuterCheckBarcodeDetailDTO;
 import com.prolog.cs.biz.outbound.model.dto.check.OuterTaskV2DTO;
@@ -74,6 +76,8 @@ public class RFOutCheckController {
     private JdKyFaceOrderHandler jdKyFaceOrderHandler;
     @Autowired
     private PrintLogService printLogService;
+    @Autowired
+    private OmsDoBillHMapper omsDoBillHMapper;
 
     @UserLog
     @ApiOperation(value = "外复核-待索取任务订单列表")
@@ -162,8 +166,9 @@ public class RFOutCheckController {
     @UserLog
     @ApiOperation(value = "打印出库清单")
     @GetMapping("/printOubDetail")
-    public RestMessage printOubDetail(@RequestParam("billId") String billId,@RequestParam("consignorId") String consignorId,@RequestParam("warehouseId") String warehouseId) {
-        pickTaskAppServiceImpl.printOutDetailList(billId,consignorId,warehouseId,"1");
+    public RestMessage printOubDetail(@RequestParam("billId") String billId) {
+        OmsDoBillHDO omsDoBillHDO = omsDoBillHMapper.findById(billId, OmsDoBillHDO.class);
+        pickTaskAppServiceImpl.printOutDetailListV2(billId,omsDoBillHDO.getAttrNum5().intValue(),omsDoBillHDO.getConsignorid(),omsDoBillHDO.getBranchid(),omsDoBillHDO.getAttrStr7());
         return RestMessage.success("操作成功", null);
     }
 

+ 8 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/controller/WavesController.java

@@ -35,6 +35,7 @@ import org.apache.ibatis.annotations.Param;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -404,4 +405,11 @@ public class WavesController {
         wavesService.hangupBill(taskLineIds);
         return RestMessage.success("挂起订单", null);
     }
+
+    @UserLog
+    @ApiOperation(value = "查询eis库存明细列表")
+    @GetMapping("/bill/getEisStockContainerNos")
+    public RestMessage<List<EisStockContainerNoDTO>> getEisStockContainerNos(@Param("itemId") String itemId,@Param("lotId") String lotId,@Param("itemQty") Double itemQty,@Param("zsFlag") Integer zsFlag) {
+        return RestMessage.success("操作成功", wavesService.getEisStockContainerNos(itemId,lotId,itemQty,zsFlag));
+    }
 }

+ 2 - 2
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/controller/print/DoPringController.java

@@ -48,7 +48,7 @@ public class DoPringController {
             @ApiImplicitParam(name = "printBillCode", value = "打印模板code", required = true)
     })
     public RestMessage<Object> outDetailedPrint(String warehouseId, String consignorId, String billId,String printBillCode) {
-        return RestMessage.newInstance(true, "outDetailedPrintSuccess", service.outDetailedPrint(warehouseId, consignorId, billId, printBillCode));
+        return RestMessage.newInstance(true, "outDetailedPrintSuccess", service.outDetailedPrintV2(warehouseId, consignorId, billId, printBillCode));
     }
 
     @UserLog
@@ -61,7 +61,7 @@ public class DoPringController {
             @ApiImplicitParam(name = "printBillCode", value = "打印模板code", required = true)
     })
     public RestMessage<Object> outDetailedDownload(String warehouseId, String consignorId, String billId, String printBillCode, HttpServletResponse response, HttpServletRequest request) {
-        service.outDetailedDownload(warehouseId, consignorId, billId, printBillCode,response,request);
+        service.outDetailedDownloadV2(warehouseId, consignorId, billId, printBillCode,response,request);
         return RestMessage.newInstance(true, "导出成功");
     }
 

+ 16 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/convert/TmsConvert.java

@@ -41,6 +41,19 @@ public interface TmsConvert {
     @Mapping(target = "totalPcs", source = "h.totPcs")
     @Mapping(target = "totalWeight", source = "h.totWeight")
     @Mapping(target = "totalVolume", source = "h.totVolume")
+//    @Mapping(target = "consigneeUnitCode", source = "h.shipperid")
+//    @Mapping(target = "consigneeUnitName", source = "h.shippername")
+//    @Mapping(target = "consigneeCode", source = "h.shipperCode")
+//    @Mapping(target = "consigneeName", source = "h.custPerson")
+    @Mapping(target = "consigneeContact", source = "h.custPerson")
+    @Mapping(target = "consigneePhoneNumber", source = "h.custPersonTel")
+    @Mapping(target = "consigneeProvince", source = "h.receiveProvinceNo")
+    @Mapping(target = "consigneeProvinceName", source = "h.receiveProvinceName")
+    @Mapping(target = "consigneeCity", source = "h.receiveCityNo")
+    @Mapping(target = "consigneeCityName", source = "h.receiveCityName")
+    @Mapping(target = "consigneeDistrict", source = "h.receiveDistrictNo")
+    @Mapping(target = "consigneeDistrictName", source = "h.receiveDistrictName")
+    @Mapping(target = "consigneeAddress", source = "h.receiveAddress")
     TmsShipBill parse2TmsShipBill(OmsDoBillHDO h);
 
     @Mapping(target = "cargoOwnerCode", source = "h.consignorcode")
@@ -77,6 +90,9 @@ public interface TmsConvert {
     @Mapping(target = "createperson", source = "bpd.checkerName")
     @Mapping(target = "orderId", source = "bpd.billId")
     @Mapping(target = "orderNo", source = "bpd.billNo")
+    @Mapping(target = "subBillNo", source = "bpd.subBillNo")
+    @Mapping(target = "motherBillNo", source = "bpd.motherBillNo")
+    @Mapping(target = "waybillType", source = "bpd.waybillType")
     TmsShipBillPackageItem parse2TmsShipBillPackageItem(BillPackageDTO bpd, int i);
 
 }

+ 3 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/dao/BarcodeDMapper.java

@@ -3,6 +3,7 @@ package com.prolog.cs.biz.outbound.dao;
 import com.prolog.cs.biz.outbound.model.dto.check.OuterCheckBarcodeDetailDTO;
 import com.prolog.cs.biz.outbound.model.entity.BarCodeDDO;
 import com.prolog.cs.biz.outbound.model.print.LclDetailTableVO;
+import com.prolog.cs.biz.outbound.model.tms.TmsShipBillPackageItemDetail;
 import com.prolog.framework.dao.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
@@ -60,4 +61,6 @@ public interface BarcodeDMapper extends BaseMapper<BarCodeDDO> {
     List<BarCodeDDO> getListByBarCodeIds(@Param("barcodeIds") List<String> barcodeIds);
 
     List<OuterCheckBarcodeDetailDTO> getBarcodeDetail(@Param("barCode") String barCode, @Param("warehouseId") String warehouseId);
+
+    List<TmsShipBillPackageItemDetail> getTmsShipBillPackageItemDetailByBarcodeId(@Param("barcodeId") String barcodeId);
 }

+ 3 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/resource/OperateResource.java

@@ -62,4 +62,7 @@ public interface OperateResource {
 
 	@GetMapping("/replenish/v1/getRepSendEisParamsByWaveId")
 	RestMessage<List<OutBoundRequestVO>> getRepSendEisParamsByWaveId(@RequestParam(value = "waveId") String waveId);
+
+	@GetMapping("/replenish/v1/changeRepIsSendEisByWaveId")
+	RestMessage<List<OutBoundRequestVO>> changeRepIsSendEisByWaveId(@RequestParam(value = "waveId") String waveId);
 }

+ 28 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/OmsDoBillDServiceImpl.java

@@ -15,6 +15,7 @@ import com.prolog.cs.biz.outbound.model.PickTaskD;
 import com.prolog.cs.biz.outbound.model.SYZJPrintAgain;
 import com.prolog.cs.biz.outbound.model.dto.OmsDoBillDDTO;
 import com.prolog.cs.biz.outbound.model.entity.OmsDoBillDDO;
+import com.prolog.cs.biz.outbound.model.vo.OmsBillDDVO;
 import com.prolog.cs.biz.outbound.resource.CommonClient;
 import com.prolog.cs.biz.outbound.resource.InventoryResource;
 import com.prolog.cs.biz.outbound.service.IOmsDoBillDService;
@@ -47,6 +48,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -377,5 +379,31 @@ public class OmsDoBillDServiceImpl implements IOmsDoBillDService {
         return relationCodeResultDTOS;
     }
 
+    @Override
+    public List<OmsDoBillDDO> getDoBillDByBillIds(List<String> billIds) {
+        if(billIds == null || billIds.size() <= 0){
+            return null;
+        }
+        Criteria crt = Criteria.forClass(OmsDoBillDDO.class);
+        Restriction r1 =  Restrictions.in("billid", billIds.toArray());
+        crt.setRestriction(Restrictions.and(r1));
+        List<OmsDoBillDDO> list = omsDoBillDMapper.findByCriteria(crt);
+        return list;
+    }
+
+    @Override
+    public void saveContainerCode(OmsBillDDVO omsBillDDVO) {
+        if(omsBillDDVO == null ){
+            throw new BizException("入参不能为空!");
+        }
+        if(StringUtils.isBlank(omsBillDDVO.getContainerCode())){
+            throw new BizException("容器/货格不能为空!");
+        }
+        if(StringUtils.isBlank(omsBillDDVO.getLineid())){
+            throw new BizException("订单明细id不能为空!");
+        }
+
+        omsDoBillDMapper.updateMapById(omsBillDDVO.getLineid(),MapUtils.put("containerCode",omsBillDDVO.getContainerCode()).getMap(),OmsDoBillDDO.class);
+    }
 
 }

+ 58 - 6
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/OmsDoBillHServiceImpl.java

@@ -75,6 +75,7 @@ import com.prolog.upcloud.base.inventory.vo.WmsInvStockQtyVO;
 import com.prolog.upcloud.base.strategy.model.BusinessControl;
 import lombok.SneakyThrows;
 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;
@@ -259,12 +260,10 @@ public class OmsDoBillHServiceImpl implements IOmsDoBillHService {
 
     @Override
     public List<OmsDoBillHDO> getDoBillHByBillNos(String[] billNos, String warehouseId) {
-        UserDTO user = userTemplate.getUserDTO();
         Criteria crt = Criteria.forClass(OmsDoBillHDO.class);
         Restriction r1 = Restrictions.in("billno", billNos);
         Restriction r2 = Restrictions.eq("branchid", warehouseId);
-        Restriction r3 = Restrictions.eq("enterpriseId", user.getEnterpriseId());
-        crt.setRestriction(Restrictions.and(r1, r2, r3));
+        crt.setRestriction(Restrictions.and(r1, r2));
         return omsDoBillHMapper.findByCriteria(crt);
     }
 
@@ -1271,6 +1270,10 @@ public class OmsDoBillHServiceImpl implements IOmsDoBillHService {
         saveBillList.addAll(updateBillList);
         if(saveBillList.size() > 0){
             for (ReceiveDoBillVO receiveDoBillVO : saveBillList) {
+                //整散分开
+                if("2".equals(receiveDoBillVO.getBillType())){
+                    getOriginList(receiveDoBillVO,itemMstList);
+                }
                 convertOmsBill(receiveDoBillVO,warehouseMstList,itemMstList,cargoOwnerMstList,customerMstList,supplierMstList,carrierMstList,batchNumbersList,hSaves,dSaves,supSaves,tmsShipBills, hisCustomer);
             }
         }
@@ -1495,6 +1498,10 @@ public class OmsDoBillHServiceImpl implements IOmsDoBillHService {
                     throw new BizException("printDetailMode段不能为空!");
                 }
 
+                if(receiveDoBillVO.getPrintNum() == null){
+                    throw new BizException("printNum段不能为空!");
+                }
+
                 if(StringUtils.isBlank(receiveDoBillVO.getReceiveAddress())){
                     throw new BizException("receiveAddress段不能为空!");
                 }
@@ -1535,6 +1542,9 @@ public class OmsDoBillHServiceImpl implements IOmsDoBillHService {
                         if(StringUtils.isBlank(detailVO.getIsGift())){
                             throw new BizException("isGift字段不能为空!");
                         }
+                        if(StringUtils.isBlank(detailVO.getPrintType())){
+                            throw new BizException("printType字段不能为空!");
+                        }
                     }
                 }
 
@@ -1747,6 +1757,9 @@ public class OmsDoBillHServiceImpl implements IOmsDoBillHService {
         omsDoBillHDO.setAttrStr4(rcvDoH.getIsPrintZj());
         omsDoBillHDO.setAttrStr5(rcvDoH.getIsPrintFp());
         omsDoBillHDO.setAttrStr7(rcvDoH.getPrintDetailMode());
+        omsDoBillHDO.setAttrNum5(new BigDecimal(rcvDoH.getPrintNum()));
+
+        omsDoBillHDO.setBranchAddress(rcvDoH.getBranchAddress());
 
         hSaves.add(omsDoBillHDO);
 
@@ -1799,8 +1812,8 @@ public class OmsDoBillHServiceImpl implements IOmsDoBillHService {
                 omsDoBillDDO.setItemVolume(volume);
                 omsDoBillDDO.setItemWeight(weight);
 
-                omsDoBillDDO.setItemOdd(qty.remainder(conversionRate));
-                omsDoBillDDO.setItemPcs(new BigDecimal(qty.divide(conversionRate,2,BigDecimal.ROUND_HALF_UP).intValue()));
+                omsDoBillDDO.setItemOdd(rcvDoD.getOdd());
+                omsDoBillDDO.setItemPcs(rcvDoD.getPcs());
 
                 omsDoBillDDO.setAttrStr5(baseMtlItemMst.getBaseMtlItemUomConversionsList().get(0).getUom());
 
@@ -1848,7 +1861,7 @@ public class OmsDoBillHServiceImpl implements IOmsDoBillHService {
                 if(wmsInvBatchNumbers == null){
                     throw new BizException("批次号:"+rcvDoD.getLotNo()+"不存在!");
                 }
-                omsDoBillDDO.setBatchNo(wmsInvBatchNumbers.getBatchNum());
+                omsDoBillDDO.setBatchNo(wmsInvBatchNumbers.getBatchId());
                 omsDoBillDDO.setLotNo(rcvDoD.getLotNo());
             }else {
                 omsDoBillDDO.setBatchNo(rcvDoD.getBatchNo());
@@ -1883,6 +1896,8 @@ public class OmsDoBillHServiceImpl implements IOmsDoBillHService {
                 omsDoBillDDO.setFreeQty(omsDoBillDDO.getItemQty());
             }
 
+            omsDoBillDDO.setAttrStr6(rcvDoD.getPrintType());
+
             dSaves.add(omsDoBillDDO);
             TmsShipBillItem shipBillItem = convert.parse2TmsShipBillItem(omsDoBillDDO,omsDoBillHDO);
             tmsShipBillItems.add(shipBillItem);
@@ -2228,6 +2243,7 @@ public class OmsDoBillHServiceImpl implements IOmsDoBillHService {
         barCodeHDO.setBldgId(pickTaskH.getBldgId());
         barCodeHDO.setBldgName(pickTaskH.getBldgName());
         ModelUtils.generateBaseData(barCodeHDO, userTemplate::getUserDTO);
+        barCodeHDO.setSeqno(1);
         barcodeHMapper.save(barCodeHDO);
         List<BarCodeDDO> barCodeDDOS = new ArrayList<>();
         for (PickTaskD pickTaskD : pickTaskDs) {
@@ -2295,4 +2311,40 @@ public class OmsDoBillHServiceImpl implements IOmsDoBillHService {
         }
     }
 
+    /**
+     * 整散分开
+     * @param receiveDoBillVO
+     */
+    private void getOriginList(ReceiveDoBillVO  receiveDoBillVO,List<BaseMtlItemMst> itemMstList){
+        List<ReceiveDoBillDetailVO> detailVOS = new ArrayList<>();
+        List<ReceiveDoBillDetailVO> detailList = receiveDoBillVO.getDetailList();
+        for (ReceiveDoBillDetailVO doBillDetailVO : detailList) {
+
+            //商品信息
+            BaseMtlItemMst baseMtlItemMst = itemMstList.stream().filter(x -> x.getItemCode().equals(doBillDetailVO.getItemCode())).findFirst().orElse(null);
+            if(baseMtlItemMst == null){
+                throw new BizException(doBillDetailVO.getItemCode() +"未匹配到商品信息!");
+            }
+            BigDecimal itemQty = new BigDecimal(doBillDetailVO.getItemQty());
+            //包装数量
+            BigDecimal conversionRate = baseMtlItemMst.getBaseMtlItemUomConversionsList().get(0).getConversionRate();
+            BigDecimal[] n = itemQty.divideAndRemainder(conversionRate);
+            if (n[1].compareTo(BigDecimal.ZERO) > 0) {
+
+                ReceiveDoBillDetailVO copy = new ReceiveDoBillDetailVO();
+                BeanUtils.copyProperties(doBillDetailVO,copy);
+                copy.setPcs(BigDecimal.ZERO);
+                copy.setOdd(itemQty.subtract(n[0].multiply(conversionRate)));
+                copy.setItemQty(String.valueOf(copy.getOdd()));
+                detailVOS.add(copy);
+            }
+            //整件部分
+            doBillDetailVO.setItemQty(String.valueOf(n[0].multiply(conversionRate)));
+            doBillDetailVO.setPcs(n[0]);
+            doBillDetailVO.setOdd(BigDecimal.ZERO);
+            detailVOS.add(doBillDetailVO);
+        }
+        receiveDoBillVO.setDetailList(detailVOS);
+    }
+
 }

+ 7 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/PackServiceImpl.java

@@ -158,6 +158,8 @@ public class PackServiceImpl implements PackService {
     @Resource
     private OmsDoBillHMapper omsDoBillHMapper;
     @Autowired
+    private OmsDoBillDMapper omsDoBillDMapper;
+    @Autowired
     private PrintLogService printLogService;
 
     /**
@@ -1035,6 +1037,10 @@ public class PackServiceImpl implements PackService {
         }else {
             eisParam.setLargeOrder(0);
         }
+        OmsDoBillDDO omsDoBillDDO = omsDoBillDMapper.findById(d.getSrcLineId(), OmsDoBillDDO.class);
+        if(omsDoBillDDO != null ){
+            eisParam.setContainerNo(omsDoBillDDO.getContainerCode());
+        }
         return eisParam;
     }
 
@@ -1465,6 +1471,7 @@ public class PackServiceImpl implements PackService {
         barCodeHDO.setCheckStatus("0");
         //2024.1.9与张剑、杨波同步零货只生成面单
         barCodeHDO.setBarcodeType("1");
+        barCodeHDO.setSeqno(1);
 //                    barCodeHDO.setStationCode(stationCode);
         return barCodeHDO;
     }

+ 88 - 8
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/PickTaskAppServiceImpl.java

@@ -3463,11 +3463,11 @@ public class PickTaskAppServiceImpl implements PickTaskAppService, StandardInter
             throw new BizException("查询无该包裹号,请确认!");
         }
         BarcodeHDO barcodeHDO = barcodeHDOS.get(0);
-        if(barcodeHDO.getIsMerged() != null && 1 == barcodeHDO.getIsMerged()){
+        if("0".equals(barcodeHDO.getType()) && barcodeHDO.getIsMerged() != null && 1 == barcodeHDO.getIsMerged()){
             if (!StringUtils.isBlank(barcodeHDO.getCheckStatus()) && Integer.valueOf(barcodeHDO.getCheckStatus()) >= 5){
                 throw new BizException("该包裹号已复核!");
             }
-            if(!"4".equals(barcodeHDO.getCheckStatus())){
+            if(!StringUtils.isBlank(barcodeHDO.getCheckStatus()) && !"4".equals(barcodeHDO.getCheckStatus())){
                 throw new BizException("该包裹号未做EIS复核!");
             }
         }
@@ -3616,7 +3616,8 @@ public class PickTaskAppServiceImpl implements PickTaskAppService, StandardInter
         if("1".equals(barcodeHDOS.get(0).getType()) || barcodeHDOS.get(0).getWeight() == null || barcodeHDOS.get(0).getWeight().compareTo(0d) == 0){
             //查询waveBilld的重量
             List<WaveBillDDO> waveBillDDOList = waveBillDMapper.findbyBarcode(vo.getBarcode());
-            BigDecimal totalWeight = waveBillDDOList.stream().map(item -> (item.getPickQty().multiply(item.getWeight())).divide(item.getConversionRate(),2,BigDecimal.ROUND_HALF_UP)).reduce(BigDecimal.ZERO, BigDecimal::add);
+//            BigDecimal totalWeight = waveBillDDOList.stream().map(item -> (item.getPickQty().multiply(item.getWeight())).divide(item.getConversionRate(),2,BigDecimal.ROUND_HALF_UP)).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal totalWeight = waveBillDDOList.get(0).getWeight();
             map.put("weight",totalWeight);
         }
         barcodeHMapper.updateMapByCriteria(map, crth);
@@ -4057,7 +4058,7 @@ public class PickTaskAppServiceImpl implements PickTaskAppService, StandardInter
             String[] pickTaskIdar = pickTaskIds.split(",");
             Criteria c2 = Criteria.forClass(PickTaskD.class);
             Restriction rt1 = Restrictions.in("pickTaskId", pickTaskIdar);
-            Restriction rt2 = Restrictions.lt("flowStatus", "7");
+            Restriction rt2 = Restrictions.lt("flowStatus", 7);
             c2.setRestriction(Restrictions.and(rt1, rt2));
             long count3 = pickTaskDMapper.findCountByCriteria(c2);
             if (count3 == 0) {
@@ -4190,8 +4191,16 @@ public class PickTaskAppServiceImpl implements PickTaskAppService, StandardInter
             throw new BizException("查询条码表汇总失败!");
         }
         if ("1".equals(omsDoBillHDO.getCarrierType()) || "3".equals(omsDoBillHDO.getCarrierType())) {
+            List<String> faceOrderNos = new ArrayList<>();
             //获取面单
-            List<String> faceOrderNos = getFaceOrder(omsDoBillHDO,barcodeHDOS,billDDOList,barCodeDDOS);
+            if("EMS".equals(omsDoBillHDO.getCarrierCode()) && barcodeHDOS.size() > 14){
+                List<List<BarcodeHDO>> partitionedList = Lists.partition(barcodeHDOS, 14);
+                for (List<BarcodeHDO> list : partitionedList) {
+                    faceOrderNos.addAll(getFaceOrder(omsDoBillHDO,list,billDDOList,barCodeDDOS));
+                }
+            }else {
+                faceOrderNos = getFaceOrder(omsDoBillHDO,barcodeHDOS,billDDOList,barCodeDDOS);
+            }
             //面单获取失败重新获取
             if(faceOrderNos == null || faceOrderNos.size() <= 0){
                 throw new BizException("获取面单失败!");
@@ -4842,6 +4851,69 @@ public class PickTaskAppServiceImpl implements PickTaskAppService, StandardInter
         }
     }
 
+    /**
+     * 打印出库清单
+     *
+     * @param billId
+     */
+    public void printOutDetailListV2(String billId,Integer printCount, String consignorId, String warehouseId,String printDetailMode) {
+        List<OmsDoBillDDO> omsDoBillDDOS = omsDoBillDMapper.findByMap(MapUtils.put("billid", billId).getMap(), OmsDoBillDDO.class);
+        if(omsDoBillDDOS == null || omsDoBillDDOS.size() <= 0){
+            throw new BizException("根据出库单:"+billId+"查询出库单失败!");
+        }
+        //获取打印模板通用参照
+        RestMessage<List<BaseCommonDict>> restMessage = commonClient.getDictBasicListByCodes("do_print_detail_model", null);
+        if(restMessage == null || !restMessage.isSuccess() || restMessage.getData() == null || restMessage.getData().size() <= 0 ){
+            throw new BizException("请先配置打印模板通用参照!");
+        }
+        List<BaseCommonDict> printDetailModels = restMessage.getData();
+        //打印列表
+        List<PrintParam> printParamList = new ArrayList<>();
+        //打印日志列表
+        List<PrintLog> printLogs = new ArrayList<>();
+        //常规、折后
+        String[] printDetailModes = printDetailMode.split(",");
+        //药品,食品,器械
+        Map<String, List<OmsDoBillDDO>> map = omsDoBillDDOS.stream().collect(Collectors.groupingBy(OmsDoBillDDO::getAttrStr6));
+        for (String detailMode : printDetailModes) {
+            for (Map.Entry<String, List<OmsDoBillDDO>> entry : map.entrySet()) {
+                String key = entry.getKey();
+
+                BaseCommonDict baseCommonDict = printDetailModels.stream().filter(item -> detailMode.equals(item.getAttr1())
+                        && Arrays.asList(item.getAttr2().split(",")).contains(key)).findFirst().get();
+                if(baseCommonDict == null){
+                    continue;
+                }
+
+                for (Integer i = 0; i < printCount; i++) {
+                    PrintParam printParam = new PrintParam();
+                    printParam.setConsignorId(consignorId);
+                    printParam.setPrintBillCode(baseCommonDict.getDictCode());
+                    printParam.setWarehouseId(warehouseId);
+                    printParam.setParams(MapUtils.put("billId", billId).put("attrStr6",key).getMap());
+
+                    printParamList.add(printParam);
+                }
+
+                PrintLog printLog = new PrintLog();
+                printLog.setBillno(billId);
+                printLog.setPrintCode(baseCommonDict.getDictCode());
+                printLogs.add(printLog);
+            }
+        }
+
+        log.info("打印出库清单-入参:{}",JSON.toJSONString(printParamList));
+        try {
+            RestMessage<?> restMessageCg = commonClient.executePrint(printParamList);
+            log.info("打印出库清单返回结果:{}", JSON.toJSONString(restMessageCg));
+            //记录打印日志
+            printLogService.saveBatch(printLogs);
+        }catch (Exception e){
+            e.printStackTrace();
+            log.info("打印出库清单-常规失败:{}",e.getMessage());
+        }
+    }
+
     /**
      * 打印质检报告单
      *
@@ -5188,6 +5260,7 @@ public class PickTaskAppServiceImpl implements PickTaskAppService, StandardInter
                 copy.setGmtCreate(new Date());
                 copy.setGmtModified(new Date());
                 copy.setBarcode(null);
+                copy.setSeqno(barcodeHDOS.size() + i+ 1);
                 barcodeHMapper.save(copy);
                 barcodeHDOList.add(copy);
 
@@ -5270,8 +5343,15 @@ public class PickTaskAppServiceImpl implements PickTaskAppService, StandardInter
         if(!isGet){
 
             if ("1".equals(carrierType)) {
+                if("EMS".equals(omsDoBillHDO.getCarrierCode()) && barcodeHDOList.size() > 14){
+                    List<List<BarcodeHDO>> partitionedList = Lists.partition(barcodeHDOList, 14);
+                    for (List<BarcodeHDO> list : partitionedList) {
+                        faceOrderNos.addAll(getFaceOrderHandler(omsDoBillHDO.getCarrierCode()).getFaceOrderNo(omsDoBillHDO, billDDOList, list.size()));
+                    }
+                }else {
+                    faceOrderNos = getFaceOrderHandler(omsDoBillHDO.getCarrierCode()).getFaceOrderNo(omsDoBillHDO, billDDOList, barcodeHDOList.size());
+                }
 
-                faceOrderNos = getFaceOrderHandler(omsDoBillHDO.getCarrierCode()).getFaceOrderNo(omsDoBillHDO, billDDOList, barcodeHDOList.size());
             }
             if("3".equals(carrierType)){
                 List<FaceOrderPickTaskDDTO> ddtos = new ArrayList<>();
@@ -5692,7 +5772,7 @@ public class PickTaskAppServiceImpl implements PickTaskAppService, StandardInter
 
             //判断订单对应的出库任务是否全部复核完成
             Criteria ctrh = Criteria.forClass(PickTaskH.class);
-            Restriction rt3 = Restrictions.lt("status", "10");
+            Restriction rt3 = Restrictions.lt("status", 10);
             ctrh.setRestriction(Restrictions.and(rt1,rt3));
             long count = pickTaskHMapper.findCountByCriteria(ctrh);
             if(count > 0){
@@ -5779,7 +5859,7 @@ public class PickTaskAppServiceImpl implements PickTaskAppService, StandardInter
         long count2 = pickTaskHS.stream().filter(item -> item.getPickTaskType() == 1 && "AGVL".equals(item.getWarehouseAreaCode())).count();
         if (count2 <= 0) {
             //打印出库清单
-            printOutDetailList(omsDoBillHDO.getBillno(), omsDoBillHDO.getConsignorid(), omsDoBillHDO.getBranchid(),omsDoBillHDO.getAttrStr7());
+            printOutDetailListV2(omsDoBillHDO.getBillno(),omsDoBillHDO.getAttrNum5().intValue(), omsDoBillHDO.getConsignorid(), omsDoBillHDO.getBranchid(),omsDoBillHDO.getAttrStr7());
             if("1".equals(omsDoBillHDO.getAttrStr4())){
                 //4.1若不包含,则在此处打印该订单下所有的首营资料、质检报告单;
                 //打印质检报告单

+ 26 - 6
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/PickTaskServiceImpl.java

@@ -3310,9 +3310,9 @@ public class PickTaskServiceImpl implements PickTaskService, StandardInterface<I
                     List<WmsInvStockQtyVO> voList = stockQtyVOList.stream().filter(s -> s.getItemId().equals(pickTaskD.getItemId()) && s.getManufacturerLotNum().equals(waveStorageDO.getManufactureLotNum())).collect(toList());
                     WmsInvStockQtyVO wmsInvStockQtyVO = null;
                     if (CollUtil.isNotEmpty(voList)) {
-                        wmsInvStockQtyVO = voList.stream().filter(w -> w.getAvailableQuantity().compareTo(vo.getRedQty().add(pickTaskD.getPickQty())) > 0).findFirst().orElse(null);
+                        wmsInvStockQtyVO = voList.stream().filter(w -> w.getAvailableQuantity().compareTo(vo.getRedQty()) >= 0).findFirst().orElse(null);
                     } else {
-                        wmsInvStockQtyVO = stockQtyVOList.stream().filter(w -> w.getAvailableQuantity().compareTo(vo.getRedQty()) > 0).findFirst().orElse(null);
+                        wmsInvStockQtyVO = stockQtyVOList.stream().filter(w -> w.getAvailableQuantity().compareTo(vo.getRedQty()) >= 0).findFirst().orElse(null);
                     }
                     log.info("updateStock2,重新匹配库存数据:{}",JSON.toJSONString(wmsInvStockQtyVO));
                     if (null != wmsInvStockQtyVO) {
@@ -3381,6 +3381,7 @@ public class PickTaskServiceImpl implements PickTaskService, StandardInterface<I
                         eisParam.setBillNo(newPickTaskD.getSrcId());
                         eisParam.setStr1("1");
                         eisParam.setStr2("1");
+                        eisParam.setLargeOrder(0);
                         eisParam.setCompanyId(waveBillDO.getShipperId());
                         eisParam.setCompanyName(waveBillDO.getShipperName());
                         eisParam.setContainerNo("N/A".equals(newWaveStorageDO.getContainerCode()) ? "" : newWaveStorageDO.getContainerCode());
@@ -5555,6 +5556,7 @@ public class PickTaskServiceImpl implements PickTaskService, StandardInterface<I
         if (omsDoBillHDO == null) {
             throw new BizException("查询oms订单汇总失败!");
         }
+        long barcodeCount = barcodeHMapper.findCountByMap(MapUtils.put("billGroupId", pickTaskH.getBillGroupId()).getMap(), BarcodeHDO.class);
         Set<String> omsDoBillLineIds = pickTaskDs.stream().map(PickTaskD::getSrcLineId).collect(Collectors.toSet());
         List<OmsDoBillDDO> omsDoBillDDOS = omsDoBillDMapper.findByIds(OmsDoBillDDO.class, omsDoBillLineIds.toArray(), null);
         if(omsDoBillDDOS == null || omsDoBillDDOS.size() <= 0){
@@ -5596,6 +5598,7 @@ public class PickTaskServiceImpl implements PickTaskService, StandardInterface<I
                 }
                 barCodeHDO.setWeight(totalWeight.doubleValue());
             }
+            barCodeHDO.setSeqno((int) barcodeCount + 1);
             barcodeHMapper.save(barCodeHDO);
             List<BarCodeDDO> barCodeDDOS = new ArrayList<>();
             for (PickTaskD pickTaskD : pickTaskDs) {
@@ -5658,6 +5661,7 @@ public class PickTaskServiceImpl implements PickTaskService, StandardInterface<I
                         throw new BizException("匹配出库单明细失败!");
                     }
                     barCodeHDO.setWeight(omsDoBillDDO.getItemWeight().doubleValue());
+                    barCodeHDO.setSeqno((int)barcodeCount + i+1);
                     barcodeHMapper.save(barCodeHDO);
 
                     BarCodeDDO barCodeDDO = new BarCodeDDO();
@@ -5891,6 +5895,12 @@ public class PickTaskServiceImpl implements PickTaskService, StandardInterface<I
 
         //封装待更新参数
         List<PickTaskD> pendingTasks = this.warpPendingTasks(list, tasks);
+        if(pendingTasks == null){
+            map.put("isLfz","0");
+            map.put("msg","任务已经拣货确认完成!");
+            map.put("taskHIds",String.join(",",tasks.stream().map(PickTaskD :: getPickTaskId).distinct().collect(Collectors.toList())));
+            return map;
+        }
 
         //获取出库预占
         String[] storageIds = pendingTasks.stream().map(PickTaskD::getWaveStorageId).distinct().toArray(String[]::new);
@@ -5933,7 +5943,11 @@ public class PickTaskServiceImpl implements PickTaskService, StandardInterface<I
             if(omsDoBillDDO == null){
                 throw new BizException("根据订单明细id:"+pickTaskD.getSrcLineId()+"查询失败!");
             }
-            BigDecimal packTypeNum = omsDoBillDDO.getPackTypeNum();
+            WaveBillDDO waveBillDDO = waveBillDMapper.findById(pickTaskD.getBillDId(), WaveBillDDO.class);
+            if(waveBillDDO == null){
+                throw new BizException("根据波次订单明细id:"+pickTaskD.getBillDId()+"查询失败!");
+            }
+            BigDecimal packTypeNum = waveBillDDO.getCaseConversionRate();
             BigDecimal pickQty = new BigDecimal(taskVO.getInventoryQty());
             int pcs = pickQty.divide(packTypeNum).intValue();
             PickTaskH pickTaskH = pickTaskHMapper.findById(pickTaskD.getPickTaskId(), PickTaskH.class);
@@ -5945,7 +5959,7 @@ public class PickTaskServiceImpl implements PickTaskService, StandardInterface<I
                 throw new BizException("根据订单id:"+pickTaskD.getSrcId()+"查询失败!");
             }
             //如果订单明细全部零发整
-            BigDecimal qty = pickQty.add(taskVO.getLackQty() == null ? BigDecimal.ZERO : new BigDecimal(taskVO.getLackQty()));
+            BigDecimal qty = pickQty.add(pickTaskD.getPickQty());
             if(qty.compareTo(pickTaskD.getQty()) == 0){
                 //删除原有的barcode
                 List<BarCodeDDO> barCodeDDOS = barcodeDMapper.findByMap(MapUtils.put("wmsPickTaskDId", pickTaskD.getPickTaskDId()).getMap(), BarCodeDDO.class);
@@ -6216,7 +6230,11 @@ public class PickTaskServiceImpl implements PickTaskService, StandardInterface<I
     public List<PickTaskD> warpPendingTasks(List<CompleteTaskVO> list, List<PickTaskD> tasks) {
 
         PickTaskD pickedTaskD = tasks.stream().filter(t -> Integer.parseInt(t.getFlowStatus()) >= Integer.parseInt(TASK_CONFIRMED.getCode())).findFirst().orElse(null);
-        cn.hutool.core.lang.Assert.isNull(pickedTaskD, "任务【{}】不可重复拣货", pickedTaskD != null ? pickedTaskD.getPickTaskDId() : "");
+        if(pickedTaskD != null){
+            log.info("任务【{}】不可重复拣货",pickedTaskD.getPickTaskDId());
+            return null;
+        }
+//        cn.hutool.core.lang.Assert.isNull(pickedTaskD, "任务【{}】不可重复拣货", pickedTaskD != null ? pickedTaskD.getPickTaskDId() : "");
 
         String[] employeeNos = list.stream().map(CompleteTaskVO::getEmployeeId).distinct().toArray(String[]::new);
         PickTaskD taskD = tasks.get(0);
@@ -6743,7 +6761,7 @@ public class PickTaskServiceImpl implements PickTaskService, StandardInterface<I
         //2.2.2.2,则根据拣货任务的实际拣货数量打印出库清单,发票(pdf,需要调上游系统接口,获取url),以及该订单下所有明细的质检报告单;
         //打印出库清单
         if(omsDoBillHDO.getAttrNum4() == null || BigDecimal.ZERO.compareTo(omsDoBillHDO.getAttrNum4()) == 0){
-            pickTaskAppService.printOutDetailList(omsDoBillHDO.getBillno(), omsDoBillHDO.getConsignorid(), omsDoBillHDO.getBranchid(),omsDoBillHDO.getAttrStr7());
+            pickTaskAppService.printOutDetailListV2(omsDoBillHDO.getBillno(),omsDoBillHDO.getAttrNum5().intValue(), omsDoBillHDO.getConsignorid(), omsDoBillHDO.getBranchid(),omsDoBillHDO.getAttrStr7());
         }
 //        //获取发票
 //        List<String> invoice = pickTaskAppService.getInvoice(omsDoBillHDO.getBillno());
@@ -7245,6 +7263,7 @@ public class PickTaskServiceImpl implements PickTaskService, StandardInterface<I
     private List<String> lfzSavebarcodes(PickTaskH pickTaskH,OmsDoBillHDO omsDoBillHDO,PickTaskD pickTaskD,OmsDoBillDDO omsDoBillDDO,int js){
         List<BarcodeHDO> barCodeHDOs = new ArrayList<>();
         List<BarCodeDDO> barCodeDDOs = new ArrayList<>();
+        long barcodeCount = barcodeHMapper.findCountByMap(MapUtils.put("billGroupId", pickTaskH.getBillGroupId()).getMap(), BarcodeHDO.class);
         for (int i = 0; i < js; i++) {
             BarcodeHDO barCodeHDO = new BarcodeHDO();
             barCodeHDO.setId(UUIDUtils.generateWithoutSeperator());
@@ -7288,6 +7307,7 @@ public class PickTaskServiceImpl implements PickTaskService, StandardInterface<I
             barCodeDDO.setItemId(omsDoBillDDO.getItemid());
             barCodeDDO.setIsPiece(0);
             barCodeDDO.setQty(omsDoBillDDO.getPackTypeNum());
+            barCodeHDO.setSeqno((int)barcodeCount + i+1);
             barCodeDDOs.add(barCodeDDO);
         }
 

+ 65 - 1
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/WavesServiceImpl.java

@@ -1,7 +1,10 @@
 package com.prolog.cs.biz.outbound.service.impl;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpResponse;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.github.pagehelper.PageHelper;
 import com.prolog.cs.basic.chain.model.customer.BaseCustomerSitesAll;
@@ -38,6 +41,7 @@ import com.prolog.framework.core.exception.PrologException;
 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.function.annotation.Flow;
 import com.prolog.function.annotation.FuncImpl;
@@ -53,6 +57,7 @@ import com.prolog.upcloud.base.inventory.vo.WmsInvStockQtyVO;
 import com.prolog.upcloud.base.strategy.model.BillSortRuleVO;
 import com.prolog.upcloud.base.strategy.model.BusinessControl;
 import com.prolog.upcloud.base.wh.operate.vo.ReplenishPreVO;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.ObjectUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -73,6 +78,7 @@ import java.util.stream.Collectors;
 
 import static com.prolog.cs.biz.outbound.model.BILL_STATUS.BATCH_LIMIT;
 
+@Slf4j
 @Service
 @PrologInterface(key="test",name="订单测试接口",type = InterfaceType.Send)
 public class WavesServiceImpl implements WavesService, StandardInterface<InterfaceBill,Object> {
@@ -535,7 +541,7 @@ public class WavesServiceImpl implements WavesService, StandardInterface<Interfa
     public String autoCreateWave() {
         // 先查询待创建波次数据;
         BillQueryDTO billQueryDTO = new BillQueryDTO();
-//        billQueryDTO.setBilltype("1"); // 只创建销售出库单;
+        billQueryDTO.setBilltype("1"); // 只创建销售出库单;
         List<OmsDoBillHDO> omsBill = omsDoBillHMapper.findOmsBill(billQueryDTO, null);
         if (CollUtil.isEmpty(omsBill)) {
             logger.info("没有待创建波次的数据");
@@ -1365,6 +1371,10 @@ public class WavesServiceImpl implements WavesService, StandardInterface<Interfa
                     omsDoBillHDO.setBillTypeName("购进退出");
                 } else if (omsDoBillHDO.getBilltype().equals("5")) {
                     omsDoBillHDO.setBillTypeName("质检出库");
+                }else if (omsDoBillHDO.getBilltype().equals("18")) {
+                    omsDoBillHDO.setBillTypeName("领料出库");
+                }else if (omsDoBillHDO.getBilltype().equals("19")) {
+                    omsDoBillHDO.setBillTypeName("质检出库");
                 }
             }
             if (null != omsDoBillHDO.getStatus()) {
@@ -1488,6 +1498,11 @@ public class WavesServiceImpl implements WavesService, StandardInterface<Interfa
                     x.setStockStatusName("退货");
                 }
             }
+            if(x.getItemOdd().compareTo(BigDecimal.ZERO) > 0){
+                x.setZsFlag(1);
+            }else {
+                x.setZsFlag(0);
+            }
         }
         return PageUtils.getPage(list);
     }
@@ -1711,6 +1726,55 @@ public class WavesServiceImpl implements WavesService, StandardInterface<Interfa
 
     }
 
+    @Override
+    public List<EisStockContainerNoDTO> getEisStockContainerNos(String itemId, String lotId,Double itemQty,Integer zsFlag) {
+        if(StringUtils.isBlank(itemId)){
+            throw new BizException("商品id不能为空!");
+        }
+        Map<String,Object> map =  MapUtils.put("itemId", itemId).put("lotId", lotId).getMap();
+        RestMessage<Object> restMessage = this.askIntegration("EisStockContainerNo", map);
+        if(restMessage != null && restMessage.isSuccess()){
+            Object data = restMessage.getData();
+            String jsonString = JSON.toJSONString(data);
+            List<EisStockContainerNoDTO> list = JSON.parseArray(jsonString,EisStockContainerNoDTO.class);
+            List<EisStockContainerNoDTO> containerNoDTOS = list.stream().filter(item -> item.getUseStockCount() >= itemQty).collect(Collectors.toList());
+            if(containerNoDTOS != null && containerNoDTOS.size() > 0){
+                if(1 == zsFlag ){
+                    return containerNoDTOS.stream().filter(item -> "AGVL".equals(item.getWmsAreaNo())).collect(Collectors.toList());
+                }else {
+                    return containerNoDTOS.stream().filter(item -> !"AGVL".equals(item.getWmsAreaNo())).collect(Collectors.toList());
+                }
+            }
+            return containerNoDTOS;
+        }
+
+        return null;
+    }
+
+    /**
+     * 调用接口平台
+     * @param interfaceId 接口地址
+     * @param param 参数
+     * @return 调用结果
+     */
+    private RestMessage<Object> askIntegration(String interfaceId, Object param){
+        RestMessage<List<BaseCommonDict>> billtypeList = commonClient.getDictBasicListByCodes("integrationUrl", null);
+        if (!billtypeList.isSuccess() || CollUtil.isEmpty(billtypeList.getData())){
+            log.error("接口平台地址未配置,请在通用参照中增加配置 integrationUrl");
+            return RestMessage.doError("integration未配置, 请求EIS/OMS失败");
+        }
+        BaseCommonDict dict = billtypeList.getData().stream().filter(var -> var.getDictCode().equals(interfaceId)).findFirst().orElse(null);
+        if (null == dict){
+            log.error("接口平台地址未配置,请在通用参照中增加配置integrationUrl的配置项: " + interfaceId);
+            return RestMessage.doError("integration未配置, 请求EIS/OMS失败");
+        }
+        String paramJson = JSONObject.toJSONString(param);
+        log.info("开始请求第三方接口:[{}], pram = 【{}】", dict.getDictName(), paramJson);
+        HttpResponse response = HttpRequest.post(dict.getDictName()).body(paramJson).execute();
+        log.info("结束请求第三方接口:[{}], 返回的结果为:【{}】", dict.getDictName(), response.body());
+        return JSONObject.parseObject(response.body(), new com.alibaba.fastjson.TypeReference<RestMessage<Object>>(){});
+    }
+
     /**
      * 自动预补货
      */

+ 7 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/WorkStageServiceImpl.java

@@ -426,6 +426,13 @@ public class WorkStageServiceImpl implements WorkStageService {
         }
         eisOutBoundHandler.outBoundRequest(list);
         stringRedisTemplate.delete(outBoundRequestWaveId);
+
+        try {
+            operateResource.changeRepIsSendEisByWaveId(waveId);
+        }catch (Exception e){
+            e.printStackTrace();
+            log.info("更改补货任务是否推送eis标识失败!");
+        }
     }
 
     private List<StockWaveResultDetailVO> extractedBatchLimit(StockWaveResultVO waveResult) {

+ 1 - 1
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/faceorder/BaseFaceOrderHandler.java

@@ -55,7 +55,7 @@ public abstract class BaseFaceOrderHandler {
                 faceOrderAddVO.setOneBillNum(String.valueOf(count-1));
             }
             faceOrderAddVO.setBizProductNo("1");
-
+            faceOrderAddVO.setWeight(omsDoBillHDO.getTotWeight().doubleValue());
         }
         if("YUNDA".equals(carrierCode)){
             carrierCode = "YUNDAPROD";

+ 2 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/faceorder/EmsKyFaceOrderHandler.java

@@ -70,6 +70,8 @@ public class EmsKyFaceOrderHandler extends KyBaseFaceOrderHandler{
         faceOrderAddVO.setCargoDetailList(cargoDetailListBeans);
         faceOrderAddVO.setBizProductNo("1");
 
+        faceOrderAddVO.setWeight(omsDoBillHDO.getTotWeight().doubleValue());
+
         return JSONObject.toJSONString(faceOrderAddVO);
     }
 

+ 5 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/faceorder/FaceOrderServiceImpl.java

@@ -148,6 +148,11 @@ public class FaceOrderServiceImpl implements FaceOrderService {
             case "JD":
                 omsDoBillHDO.setCarrierType("3");
         }
+        if("JD".equals(convert.getNewCarrierCode())){
+            omsDoBillHDO.setCarrierType("3");
+        }else {
+            omsDoBillHDO.setCarrierType("1");
+        }
         omsDoBillHDO.setCarrierCode(convert.getNewCarrierCode());
         long update1 = omsDoBillHMapper.update(omsDoBillHDO);
         if (update1 <= 0) throw new BizException("更新订单承运商编码与类型失败");

+ 99 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/print/DoPringServiceImpl.java

@@ -2,6 +2,7 @@ package com.prolog.cs.biz.outbound.service.impl.print;
 
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSON;
+import com.prolog.cs.basic.common.model.BaseCommonDict;
 import com.prolog.cs.basic.common.model.print.PrintInfo;
 import com.prolog.cs.basic.common.model.print.PrintParam;
 import com.prolog.cs.basic.item.model.BaseMtlItemMst;
@@ -17,6 +18,7 @@ import com.prolog.cs.biz.outbound.resource.ItemClient;
 import com.prolog.cs.biz.outbound.service.DoPringService;
 import com.prolog.cs.biz.outbound.service.PrintLogService;
 import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.core.exception.BizException;
 import com.prolog.framework.core.exception.PrologException;
 import com.prolog.framework.core.restriction.FieldSelector;
 import com.prolog.framework.utils.CollectionUtils;
@@ -201,6 +203,48 @@ public class DoPringServiceImpl implements DoPringService {
         return restMessage;
     }
 
+    @Override
+    public Object outDetailedPrintV2(String warehouseId, String consignorId, String billId, String printBillCode) {
+        List<PickTaskD> pickTaskDList = pickTaskDMapper.findByMap(MapUtils.put("srcId", billId).getMap(), PickTaskD.class);
+        if(pickTaskDList.isEmpty()) {
+            throw new PrologException("当前订单未生成任务,没有打印数据");
+        }
+
+        RestMessage<List<BaseCommonDict>> printTypeListRmg = commonClient.getDictBasicListByCodes("WMS_PRINT", null);
+        if(printTypeListRmg == null || !printTypeListRmg.isSuccess() || printTypeListRmg.getData() == null || printTypeListRmg.getData().size() <= 0){
+            throw new BizException("请配置通用参照:WMS_PRINT");
+        }
+        List<BaseCommonDict> printTypes = printTypeListRmg.getData();
+        BaseCommonDict baseCommonDict = printTypes.stream().filter(item -> item.getDictCode().equals(printBillCode)).findFirst().orElse(null);
+        if(baseCommonDict == null){
+            throw new BizException(printBillCode+"打印类型不存在!");
+        }
+        RestMessage<List<BaseCommonDict>> printModelListRmg = commonClient.getDictBasicListByCodes("do_print_detail_model", null);
+        if(printModelListRmg == null || !printModelListRmg.isSuccess() || printModelListRmg.getData() == null || printModelListRmg.getData().size() <= 0){
+            throw new BizException("请配置通用参照:do_print_detail_model");
+        }
+        List<BaseCommonDict> printModels = printModelListRmg.getData();
+        BaseCommonDict commonDict = printModels.stream().filter(item -> item.getAttr1().equals(baseCommonDict.getAttr1()) && Arrays.asList(item.getAttr2().split(",")).contains(baseCommonDict.getAttr2())).findFirst().orElse(null);
+        if(commonDict == null){
+            throw new BizException(printBillCode+"打印类型配置错误!");
+        }
+
+        PrintParam printParam = new PrintParam();
+        printParam.setPrintBillCode(commonDict.getDictCode());
+        printParam.setParams(MapUtils.put("billId", billId).put("attrStr6",baseCommonDict.getAttr2()).getMap());
+
+        //printParamList.add(printParam);
+        log.info("打印出库清单入参:{}", JSON.toJSONString(printParam));
+        RestMessage<?> restMessage = commonClient.getPrintInfo(printParam);
+        //保存打印记录
+        printLogService.save(billId,printBillCode,restMessage.isSuccess());
+        if(!restMessage.isSuccess()) {
+            throw new RuntimeException("打印失败:" + restMessage.getMessage());
+        }
+        log.info("打印出库清单返回结果:{}", JSON.toJSONString(restMessage));
+
+        return restMessage;
+    }
 
     @Override
     public void outDetailedDownload(String warehouseId, String consignorId, String billId, String printBillCode, HttpServletResponse response,HttpServletRequest request) {
@@ -252,7 +296,62 @@ public class DoPringServiceImpl implements DoPringService {
 
     }
 
+    @Override
+    public void outDetailedDownloadV2(String warehouseId, String consignorId, String billId, String printBillCode, HttpServletResponse response, HttpServletRequest request) {
+
+        List<PickTaskD> pickTaskDList = pickTaskDMapper.findByMap(MapUtils.put("srcId", billId).getMap(), PickTaskD.class);
+        if(pickTaskDList.isEmpty()) {
+            throw new PrologException("当前订单未生成任务,没有打印数据");
+        }
 
+        RestMessage<List<BaseCommonDict>> printTypeListRmg = commonClient.getDictBasicListByCodes("WMS_PRINT", null);
+        if(printTypeListRmg == null || !printTypeListRmg.isSuccess() || printTypeListRmg.getData() == null || printTypeListRmg.getData().size() <= 0){
+            throw new BizException("请配置通用参照:WMS_PRINT");
+        }
+        List<BaseCommonDict> printTypes = printTypeListRmg.getData();
+        BaseCommonDict baseCommonDict = printTypes.stream().filter(item -> item.getDictCode().equals(printBillCode)).findFirst().orElse(null);
+        if(baseCommonDict == null){
+            throw new BizException(printBillCode+"打印类型不存在!");
+        }
+        RestMessage<List<BaseCommonDict>> printModelListRmg = commonClient.getDictBasicListByCodes("do_print_detail_model", null);
+        if(printModelListRmg == null || !printModelListRmg.isSuccess() || printModelListRmg.getData() == null || printModelListRmg.getData().size() <= 0){
+            throw new BizException("请配置通用参照:do_print_detail_model");
+        }
+        List<BaseCommonDict> printModels = printModelListRmg.getData();
+        BaseCommonDict commonDict = printModels.stream().filter(item -> item.getAttr1().equals(baseCommonDict.getAttr1()) && Arrays.asList(item.getAttr2().split(",")).contains(baseCommonDict.getAttr2())).findFirst().orElse(null);
+        if(commonDict == null){
+            throw new BizException(printBillCode+"打印类型配置错误!");
+        }
+
+        PrintParam printParam = new PrintParam();
+        printParam.setPrintBillCode(commonDict.getDictCode());
+        printParam.setParams(MapUtils.put("billId", billId).put("attrStr6",baseCommonDict.getAttr2()).getMap());
+        printParam.setProcessType(2);
+        //printParamList.add(printParam);
+
+        log.info("打印出库清单入参:{}", JSON.toJSONString(printParam));
+        RestMessage<PrintInfo> restMessage = commonClient.executePrintSingle(printParam);
+        if(restMessage==null || !restMessage.isSuccess() || restMessage.getData()==null) {
+            throw new PrologException("打印失败:" + restMessage.getMessage());
+        }
+        log.info("打印出库清单返回结果:{}", JSON.toJSONString(restMessage));
+
+        try {
+            Thread.sleep(4000);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+
+        PrintInfo data = restMessage.getData();
+        List<String> pdfUrl = data.getPdfUrl();
+        if(CollectionUtil.isNotEmpty(pdfUrl)){
+            download(response, request,pdfUrl.get(0));
+
+            //toDownload(pdfUrl.get(0), response);
+        }else {
+            throw new PrologException("下载文件失败,文件生成异常");
+        }
+    }
 
     @Override
     public String outDetailedDownloadExtends(String type, String warehouseId, String consignorId, String billId, String printBillCode, HttpServletResponse response,HttpServletRequest request) {

+ 23 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/java/com/prolog/cs/biz/outbound/service/impl/tms/TmsServiceImpl.java

@@ -3,14 +3,18 @@ package com.prolog.cs.biz.outbound.service.impl.tms;
 import cn.hutool.core.collection.CollUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.prolog.cs.biz.outbound.convert.TmsConvert;
+import com.prolog.cs.biz.outbound.dao.BarcodeDMapper;
 import com.prolog.cs.biz.outbound.dao.BarcodeHMapper;
 import com.prolog.cs.biz.outbound.model.dto.BillPackageDTO;
 import com.prolog.cs.biz.outbound.model.tms.TmsShipBillPackage;
 import com.prolog.cs.biz.outbound.model.tms.TmsShipBillPackageItem;
+import com.prolog.cs.biz.outbound.model.tms.TmsShipBillPackageItemDetail;
 import com.prolog.cs.biz.outbound.service.TmsService;
 import com.prolog.cs.biz.outbound.service.impl.platform.InterfacePlatform;
 import com.prolog.cs.biz.outbound.utils.TransactionHelper;
 import com.prolog.framework.common.message.RestMessage;
+import com.prolog.framework.utils.MapUtils;
+import com.prolog.framework.utils.StringUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -35,6 +39,8 @@ public class TmsServiceImpl implements TmsService {
 
 	@Autowired
 	private InterfacePlatform ip;
+	@Autowired
+	private BarcodeDMapper barcodeDMapper;
 
 	@Override
 	public void pushPackage() {
@@ -42,6 +48,13 @@ public class TmsServiceImpl implements TmsService {
 		if (CollUtil.isEmpty(list)) {
 			return;
 		}
+		for (BillPackageDTO billPackageDTO : list) {
+			if(!StringUtils.isBlank(billPackageDTO.getSubBillNo())){
+				billPackageDTO.setWaybillType("2");
+			}else {
+				billPackageDTO.setWaybillType("1");
+			}
+		}
 		pushPackageAndUpdateStatus(list);
 	}
 
@@ -90,7 +103,17 @@ public class TmsServiceImpl implements TmsService {
 			if (size == i) {
 				packageItem.setLastPackage("1");
 			}
+
+			List<TmsShipBillPackageItemDetail> details =  barcodeDMapper.getTmsShipBillPackageItemDetailByBarcodeId(dto.getBarcodeId());
+			for (TmsShipBillPackageItemDetail detail : details) {
+				detail.setPackageCode(packageItem.getPackageCode());
+			}
+			packageItem.setDetails(details);
+
 			packageItems.add(packageItem);
+
+
+
 			i++;
 		}
 

+ 17 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/resources/mappers/mysql/BarCodeDMapper.xml

@@ -197,5 +197,22 @@
             wbh.barcode = #{barCode}
             and wbh.warehouse_id = #{warehouseId}
     </select>
+    <select id="getTmsShipBillPackageItemDetailByBarcodeId"
+            resultType="com.prolog.cs.biz.outbound.model.tms.TmsShipBillPackageItemDetail">
+        select
+            wwbd.item_id ,
+            wwbd.item_code as itemCode,
+            wwbd.item_name as itemName,
+            wptd.pick_qty as qty,
+            floor(wptd.pick_qty / wwbd.conversion_rate) as pcs
+        from
+            wms_barcode_d wbd
+        join wms_pick_task_d wptd on
+            wbd.wms_pick_task_d_id = wptd.pick_task_d_id
+        join wms_wave_bill_d wwbd on
+            wptd.bill_d_id = wwbd.id
+        where
+            wbd.barcode_id = #{barcodeId}
+    </select>
 
 </mapper>

+ 2 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/resources/mappers/mysql/BarCodeHMapper.xml

@@ -806,7 +806,9 @@
         select bh.id barcodeId,bh.barcode, bh.check_time_2 checkTime2, bh.checker_name_2 checkerName, bh.lcl_no lclNo, bh.check_status checkStatus
         , oh.p_enterprisename enterpriseName, oh.p_enterpriseid enterpriseId, oh.billno, oh.billid, oh.consignorcode
         , oh.consignorname, oh.ship_bill_no shipBillNo, oh.consignorid,bh.weight,0 as volume,0 as height
+        ,wfo.waybill_code as subBillNo,wfo.parent_waybill_code as motherBillNo
         from wms_barcode_h bh join oms_do_bill_h oh on bh.bill_group_id = oh.billid
+        join wms_face_order wfo on bh.barcode = wfo.waybill_code
         where  1=1
         and  bh.check_status <![CDATA[<]]> 6
         and bh.bill_group_id  not in (select wptd.src_id  from wms_pick_task_d wptd where wptd.flow_status <![CDATA[<]]> 7 and wptd.src_id is not null )

+ 0 - 1
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/resources/mappers/mysql/OmsBillHMapper.xml

@@ -50,7 +50,6 @@
         LEFT JOIN WMS_WAVE_BILL bill ON bill.src_id = omsbill.billid
         WHERE omsbill.IS_CANCELLED IS null
         and (omsbill.CON_CHANGE_STATUS is null or omsbill.CON_CHANGE_STATUS= '0')
-        and billtype = '1'
         <if test="billQueryDTO.status == null or billQueryDTO.status == '' or billQueryDTO.status == '10'">
             and bill.id IS NULL
         </if>

+ 2 - 2
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/resources/mappers/mysql/PickTaskDMapper.xml

@@ -958,7 +958,7 @@
         where status <![CDATA[ < ]]> 2)
         and bill_group_id not in (select src_id
         from wms_pick_task_d
-        where flow_status <![CDATA[ < ]]> 3 and src_id is not null)
+        where flow_status <![CDATA[ < ]]> '3' and src_id is not null)
         and bill_group_id in (
         select bill_group_id from wms_barcode_h where 1=1 and barcode is not null and barcode != '' and ifnull(check_status,0) = 4
         )
@@ -968,7 +968,7 @@
         and bill_group_id not in (
         select billno from oms_do_bill_h where ifnull(attr_num2,0) <![CDATA[ > ]]> #{times}
         )
-        and status = 2
+        and status = '2'
         and pick_task_type = 1
         order by gmt_create asc
         limit 1

+ 1 - 0
upcloud-base-wh-outbound/upcloud-base-wh-outbound-service/src/main/resources/mappers/mysql/PickTaskMapper.xml

@@ -3924,6 +3924,7 @@
         LEFT JOIN WMS_WAVE_BILL wwb on s.BILL_ID =wwb.id
         LEFT JOIN WMS_MOVE_TASK v on v.BILL_D_ID= m.id
         where WPTH.ENTERPRISE_ID = #{enterpriseId} and WPTH.WAREHOUSE_ID= #{warehouseId}
+        and wpth.type='0'
         <if test="bldgId != null and bldgId != ''">
             and wpth.bldg_id = #{bldgId}
         </if>

+ 1 - 0
upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/AGVpickDistribution/js/config.js

@@ -617,6 +617,7 @@ export const noteConfirmItem = function (that) {
       required: true,
       className: "input-md",
       itemHeight: "60px",
+      value: "2",
       options: [
         // 1.首营/质检报告单  2.发票/出库清单
         {

+ 49 - 0
upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/InventoryLocking/api.js

@@ -0,0 +1,49 @@
+/*
+ * @Date: 2022-06-10 09:46:42
+ * @LastEditors: 陈禹琨 chenyukun@prolog-int.com
+ * @LastEditTime: 2024-10-10 13:04:06
+ * @FilePath: /upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/InventoryLocking/api.js
+ * @Description: cyk
+ */
+
+import request from "@/utils/request";
+import qs from "qs";
+import { QN_BASEURL, EIS_DISMANTLE } from "../serviceSettings";
+const baseUrl = EIS_DISMANTLE;
+export function lockContainerStockDetail(data) {
+  return request({
+    url: baseUrl + "/api/v1/page/lockContainerStockDetail",
+    method: "post",
+    // data,
+    params: data,
+  });
+}
+
+// /api/v1/page/lockContainerStockDetail
+
+export function containerLock(data) {
+  return request({
+    url: baseUrl + "/api/v1/page/containerLock",
+    method: "post",
+    // data,
+    params: data,
+  });
+}
+
+export function containerListLock(data) {
+  return request({
+    url: baseUrl + "/api/v1/page/containerListLock",
+    method: "post",
+    // data,
+    data: data,
+  });
+}
+
+export function containerUnLock(data) {
+  return request({
+    url: baseUrl + "/api/v1/page/containerUnLock",
+    method: "post",
+    // data,
+    data: data,
+  });
+}

+ 210 - 0
upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/InventoryLocking/config.js

@@ -0,0 +1,210 @@
+/*
+ * @Author: 陈禹琨 cyk910622@163.com
+ * @Date: 2022-06-10 09:46:42
+ * @LastEditors: 陈禹琨 chenyukun@prolog-int.com
+ * @LastEditTime: 2024-09-14 11:03:02
+ * @FilePath: /upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/InventoryLocking/config.js
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+import { EIS_DISMANTLE } from "../serviceSettings";
+const baseUrl = EIS_DISMANTLE;
+const config = {
+  remoteUrl: {
+    url: baseUrl + "/api/v1/page/lockStockPage",
+    headers: {
+      "Content-Type": "application/JSON",
+    },
+    method: "post",
+  },
+  items: [
+    {
+      span: 8,
+      type: "input",
+      name: "itemName",
+      label: "商品名称",
+      value: "",
+    },
+    // {
+    //   span: 8,
+    //   type: 'select',
+    //   name: 'isMode',
+    //   label: '库区',
+    //   value: '',
+    //   options: [
+    //     { value: 0, label: '否' },
+    //     { value: 1, label: '是' },
+    //   ],
+    // },
+    {
+      span: 8,
+      type: "input",
+      name: "lotNo",
+      label: "批号",
+      value: "",
+    },
+    {
+      span: 8,
+      type: "input",
+      name: "containerNo",
+      label: "托盘/货位",
+      value: "",
+    },
+    {
+      span: 8,
+      type: "select",
+      name: "isLock",
+      label: "是否锁定",
+      value: "",
+      options: [
+        // 全部/有锁定/无锁定
+        { value: "", label: "全部" },
+        { value: 1, label: "有锁定" },
+        { value: 0, label: "无锁定" },
+      ],
+    },
+
+    {
+      span: 6,
+      type: "buttonGroup",
+      style: { textAlign: "center", marginLeft: "50px" },
+      options: [
+        {
+          value: "查询",
+          icon: "search",
+          btnType: "primary",
+          style: "margin-right:10px",
+          htmlType: "submit",
+        },
+        {
+          value: "重置",
+          icon: "redo",
+          style: "margin-right:50px",
+          on: {
+            click: (event, form) => {
+              console.log(form);
+              form.resetFields();
+            },
+          },
+        },
+      ],
+    },
+  ],
+  columns: [
+    {
+      dataIndex: "containerNo",
+      key: "containerNo",
+      align: "center",
+      ellipsis: true,
+      title: "托盘/货位",
+    },
+
+    // barCode
+
+    // {
+    //   title: '库区',
+    //   key: 'count',
+    //   ellipsis: true,
+    //   dataIndex: 'count',
+    //   align: 'center',
+    //   //   ...remote('eis_cfg_auto_carry_task_type'),
+    // },
+    {
+      title: "商品编号",
+      dataIndex: "itemCode",
+      align: "center",
+      ellipsis: true,
+      key: "itemCode",
+      //   customRender(text) {
+      //     // 状态 0空闲 10入库中 20出库中 30回库中
+      //     text == 0 && (text = "空闲");
+      //     text == 10 && (text = "入库中");
+      //     text == 20 && (text = "出库中");
+      //     text == 30 && (text = "回库中");
+      //     text == 88 && (text = "出库到位");
+      //     return text;
+      //   },
+    },
+    {
+      title: "商品名称",
+      dataIndex: "itemName",
+      align: "center",
+      key: "itemName",
+    },
+    {
+      title: "批号",
+      dataIndex: "lotCode",
+      align: "center",
+      key: "lotCode",
+    },
+    {
+      title: "库存数量",
+      dataIndex: "stockCount",
+      align: "center",
+      key: "stockCount",
+    },
+    {
+      title: "锁定数量",
+      dataIndex: "lockCount",
+      align: "center",
+      key: "lockCount",
+    },
+    {
+      title: "非指定命中数量",
+      dataIndex: "unSpecifiedCount",
+      align: "center",
+      key: "unSpecifiedCount",
+    },
+    {
+      title: "指定命中数量",
+      dataIndex: "specifiedCount",
+      align: "center",
+      key: "specifiedCount",
+    },
+  ],
+  Modelitems: [
+    {
+      span: 8,
+      type: "input",
+      disabled: true,
+      name: "containerNo",
+      label: "托盘/货位",
+      value: "",
+    },
+    {
+      span: 8,
+      type: "input",
+      name: "itemName",
+      disabled: true,
+      label: "商品名称",
+      value: "",
+    },
+    {
+      span: 8,
+      type: "input",
+      name: "lotCode",
+      disabled: true,
+      label: "批号",
+      value: "",
+    },
+    {
+      span: 8,
+      type: "input",
+      name: "stockCount",
+      disabled: true,
+      label: "库存数量",
+      value: "",
+    },
+    {
+      span: 8,
+      type: "number",
+      name: "lockQty",
+      label: "锁定数量",
+      min: 0,
+      step: 0,
+      required: true,
+      value: "",
+    },
+  ],
+};
+export default config;

+ 238 - 0
upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/InventoryLocking/index.vue

@@ -0,0 +1,238 @@
+<template>
+  <div>
+    <p-spin size="small" :spinning="spinning">
+      <p-card title="EIS库存锁定">
+        <template slot="extra">
+          <a-space>
+            <p-button type="primary" style="margin-right: 10px" @click="containerUnLockFun">解锁</p-button>
+            <p-button type="primary" style="margin-right: 10px" @click="lockContainerStockDetailFun">部分锁定</p-button>
+            <p-button type="primary" style="margin-right: 10px" @click="containerListLockFun">全部锁定</p-button>
+          </a-space>
+        </template>
+        <p-grid-form :label-col="{ span: 8 }" :span="8" :items="config.items" @submit="hanlderSubmit" />
+        <p-table
+          ref="table"
+          row-key="containerNo"
+          bordered
+          hasRowSelectCheck
+          :columns="config.columns"
+          :remoteUrl="config.remoteUrl"
+          :remoteData="remoteData"
+          :rowSelectType="2"
+          @selectChange="selectChange"
+          :data-source="List"
+        />
+      </p-card>
+
+      <p-modal title="部分锁定" okText="确认锁定" width="50%" :visible="visible" :confirm-loading="confirmLoading" @ok="handleOk" @cancel="handleCancel">
+        <p-grid-form :label-col="{ span: 8 }" ref="model" :span="8" :items="config.Modelitems" />
+      </p-modal>
+    </p-spin>
+  </div>
+</template>
+
+<script>
+// import TableSheet from '@/views/kzyWMS/components/table-sheet/index.vue'
+import config from "./config.js";
+// import { diffOption } from '@/views/kzyWMS/utils'
+import { lockContainerStockDetail, containerLock, containerListLock, containerUnLock } from "./api";
+const token = sessionStorage.getItem("token");
+import { EIS_DISMANTLE } from "../serviceSettings";
+const baseUrl = EIS_DISMANTLE;
+
+export default {
+  components: {
+    // 'p-table-sheet': TableSheet,
+  },
+  data() {
+    return {
+      SubList: [],
+      spinning: false,
+      config,
+      data: [],
+      List: [],
+      detailData: {},
+      type: true,
+      remoteData: {},
+      visible: false,
+      visiblesetTemplate: false,
+      errinfo: {},
+      text: {},
+      confirmLoading: false,
+      items: [
+        {
+          type: "input",
+          name: "modeType",
+          required: true,
+          label: "模板货架名称",
+          value: "",
+        },
+      ],
+      selectedRows: [],
+    };
+  },
+  mounted() {
+    // this.getinfo()
+  },
+  created() {
+    // diffOption(this.config.columns).then((res) => {
+    //   this.config.columns = res
+    // })
+  },
+  methods: {
+    handleCancel() {
+      this.visible = false;
+    },
+
+    async containerUnLockFun() {
+      if (this.selectedRows.length == 0) {
+        this.$message.error("请选择数据!");
+        return;
+      }
+      let data = this.selectedRows.map((i) => i.containerNo);
+
+      try {
+        this.spinning = true;
+        let res = await containerUnLock(data);
+        this.spinning = false;
+        if (res.success) {
+          console.log(res, "===");
+          this.$message.success("解锁成功");
+          this.selectedRows = [];
+          this.remoteData = { ...this.remoteData };
+        } else {
+          this.$exception(res);
+        }
+      } catch (error) {
+        this.$exception(error);
+      }
+    },
+    async containerListLockFun() {
+      if (this.selectedRows.length == 0) {
+        this.$message.error("请选择数据!");
+        return;
+      }
+      let data = this.selectedRows.map((i) => i.containerNo);
+
+      try {
+        this.spinning = true;
+        let res = await containerListLock(data);
+        this.spinning = false;
+        if (res.success) {
+          console.log(res, "===");
+          this.$message.success("锁定成功");
+          this.selectedRows = [];
+          this.remoteData = { ...this.remoteData };
+        } else {
+          this.$exception(res);
+        }
+      } catch (error) {
+        this.$exception(error);
+      }
+    },
+    handleOk(e) {
+      this.$refs.model.form.validateFields(async (err, value) => {
+        if (!err) {
+          console.log(value);
+          try {
+            this.spinning = true;
+
+            let res = await containerLock(value);
+            this.spinning = false;
+            if (res.success) {
+              this.visible = false;
+              this.$message.success("锁定成功");
+              this.remoteData = { ...this.remoteData };
+            } else {
+              this.$exception(res);
+            }
+          } catch (error) {
+            this.$exception(error);
+          }
+          //
+        }
+      });
+    },
+    async lockContainerStockDetailFun() {
+      if (this.selectedRows.length != 1) {
+        this.$message.error("必须选择一条数据!");
+        return;
+      }
+      let data = {
+        containerNo: this.selectedRows[0].containerNo,
+      };
+      try {
+        this.spinning = true;
+        let res = await lockContainerStockDetail(data);
+        this.spinning = false;
+        if (res.success) {
+          console.log(res, "===");
+          this.visible = true;
+          this.$nextTick(() => {
+            this.$refs.model.form.resetFields();
+            this.$refs.model.form.setFieldsValue(res.data);
+          });
+        } else {
+          this.$exception(res);
+        }
+      } catch (error) {
+        this.$exception(error);
+      }
+    },
+    async mergeContainerDetailFun(id) {
+      console.log(id, "===");
+      try {
+        this.spinning = true;
+        let res = await mergeContainerDetail({ id });
+        this.spinning = false;
+        if (res.success) {
+          console.log(res, "===");
+          this.SubList = res.data;
+        } else {
+          this.$exception(res);
+        }
+      } catch (error) {
+        this.$exception(error);
+      }
+    },
+    selectChange(selectedRowKeys, selectedRows) {
+      console.log(selectedRows);
+      this.selectedRows = selectedRows;
+    },
+    clickRow(event, activeID, rowRecord) {
+      this.mergeContainerDetailFun(rowRecord.id);
+    },
+
+    doneBefore(res) {
+      //   console.log(res)
+      return res;
+    },
+    hanlderSubmit(e, form) {
+      e.preventDefault();
+      form.validateFields((error, values) => {
+        console.log(error, values, "valuesvaluesvaluesvaluesvalues");
+        // this.queryName = values.name
+        // this.queryType = values.type
+        // this.getlistCompanyByAuthId()
+        if (!error) {
+          this.remoteData = { ...this.remoteData, ...values };
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.errinfo {
+  padding: 10px;
+  width: 100%;
+  height: 200px;
+  line-height: 50px;
+  font-size: 20px;
+  color: #fff;
+  font-weight: bolder;
+  text-align: center;
+  background: rgb(145, 143, 144);
+}
+</style>

+ 4 - 5
upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/serviceSettings.js

@@ -1,11 +1,10 @@
 /*
  * @Date: 2022-06-30 16:58:22
  * @LastEditors: 陈禹琨 chenyukun@prolog-int.com
- * @LastEditTime: 2023-09-13 10:31:25
- * @FilePath: /eis-3.0-fe-pc/src/views/EIS/project/qingniuEIS/serviceSettings.js
+ * @LastEditTime: 2024-10-10 13:06:39
+ * @FilePath: /upcloud-wms-qingniu-web/src/views/EIS/project/qingniuEIS/serviceSettings.js
  * @Description: cyk
  */
 
-
-export const QN_BASEURL = '/qneis_'
-
+export const QN_BASEURL = "/qneis_";
+export const EIS_DISMANTLE = "/eis_master";

+ 1 - 6
upcloud-wms-qingniu-web/src/views/kzyWMS/QualityControl/inBoundSupervised/config/columns.js

@@ -11,12 +11,7 @@ export const columns = function (self) {
         { dataIndex: 'supplierOrShipperName', title: '单位名称', width: 100 },
         { dataIndex: 'scanDate', title: '操作时间', width: 150 },
         {
-          dataIndex: 'supervisionType', title: '监管类型', width: 100,
-          customRender(text) {
-            text == '0' && (text = '采购入库')
-            text == '1' && (text = '销售退货')
-            return text
-          },
+          dataIndex: 'supervisionTypeName', title: '监管类型', width: 100,
         },
         { dataIndex: 'supervisionCode', title: '监管码', width: 150 },
         { dataIndex: 'uploadFlag', title: '上传状态', width: 150 },

+ 19 - 6
upcloud-wms-qingniu-web/src/views/kzyWMS/QualityControl/inBoundSupervised/config/searchItems.js

@@ -10,7 +10,19 @@ let grid = {
   span: 8,
   labelCol: { span: 6 }
 }
-
+const remote = (type) => {
+  return {
+    remoteUrl: {
+      url: upcloud_base_common + `/dict/listbytype/?dicttypeCodes=${type}`,
+      method: "post",
+    },
+    replaceFields: {
+      label: "dictName",
+      value: "dictCode",
+    },
+    autoLoad: true,
+  };
+};
 export const searchItems = function(self) {
   return [
     ...genWarehouseAuthSearchModal(1, true, false, null, changecargoOwnerfun, grid, null),
@@ -93,11 +105,12 @@ export const searchItems = function(self) {
       name: 'supervisionType',
       label: '监管类型',
       required: true,
-      value:'',
-      options: [
-        {label: "采购入库", value: "0"},
-        {label: "销售退货", value: "1"},
-      ],
+      value: '',
+      ...remote('in_supervision_type'),
+      // options: [
+      //   {label: "采购入库", value: "0"},
+      //   {label: "销售退货", value: "1"},
+      // ],
       ...grid
     },
     {

+ 49 - 1
upcloud-wms-qingniu-web/src/views/kzyWMS/QualityControl/inBoundSupervised/index.vue

@@ -28,7 +28,7 @@ import { columns } from './config/columns'
 import { findSrcCodes, addItem, updateItem, delItems, queryWorkstationList, outboundExport, uploadCircubillPC } from './api'
 import { diffOption, forSelectText } from '@/views/kzyWMS/utils/index.js'
 import { sorter } from '../../utils/sort'
-import { SERVICE_DATA_API_BASE } from '@/config/serviceSettings'
+import { SERVICE_DATA_API_BASE, upcloud_base_wh_inbound } from '@/config/serviceSettings'
 import { getCargoOwner } from '../../utils/index'
 export default {
   components: {
@@ -45,6 +45,31 @@ export default {
       spinning: false,
       tableEtraBtns: [
         // { label: '新增', click: () => { this.showItem() } },
+        {
+          label: '下载模板',
+          click: () => {
+            this.downloadList()
+          },
+        },
+        {
+          el: 'upload',
+          label: "批量导入",
+          action: upcloud_base_wh_inbound + "/supervisionCodeExcel/importSupervisionCodes",
+          handleChange(info) {
+            if (info.file.status !== "uploading") {
+              console.log(info.file, info.fileList);
+            }
+            if (info.file.status === "done" && info.file.response.success) {
+              that.$message.success(`${info.file.name} 上传成功`);
+            } else if (info.file.status === "error") {
+              that.$message.error(`${info.file.name}上传失败.`);
+              that.$exception(info.file.response);
+            } else if (info.file.status === "done" && !info.file.response.success) {
+              that.$message.error(`${info.file.name} 上传失败`);
+              that.$exception(info.file.response);
+            }
+          },
+        },
         {
           label: '批量导出',
           click: () => {
@@ -150,6 +175,29 @@ export default {
       data.params = { ...data.params, ...value }
       return data
     },
+    // 下载模板
+    downloadList(){
+      this.axios({
+        method: "get",
+        url: upcloud_base_wh_inbound + "/supervisionCodeExcel/downloadTemplate",
+        headers: { "Content-Type": "application/json" },
+        // data: JSON.stringify(this.exportData.exportParams),s
+        responseType: "blob",
+      }).then((_res) => {
+        let blob = new Blob([_res]);
+        let downloadElement = document.createElement("a");
+        let href = window.URL.createObjectURL(blob); //创建下载的链接
+        downloadElement.href = href;
+        downloadElement.download = "入库监管码导出模板.xls"; //下载后文件名
+        document.body.appendChild(downloadElement);
+        downloadElement.click(); //点击下载
+        document.body.removeChild(downloadElement); //下载完成移除元素
+        window.URL.revokeObjectURL(href); //释放掉blob对象
+      })
+      .finally(() => {
+        //   this.iconLoading = false;
+      });
+    },
     allList() {
       // 全部导出
       this.$refs.searchTable.$refs.form.form.validateFields((errors, values) => {

+ 9 - 19
upcloud-wms-qingniu-web/src/views/kzyWMS/QualityControl/outBoundSupervised/config/columns.js

@@ -11,30 +11,20 @@ export const columns = function (self) {
         { dataIndex: 'supplierOrShipperName', title: '单位名称', width: 100 },
         { dataIndex: 'scanDate', title: '操作时间', width: 150 },
         {
-          dataIndex: 'supervisionType', title: '监管类型', width: 100,
-          customRender(text) {
-            text == '2' && (text = '销售出库')
-            text == '3' && (text = '指定批号销售')
-            text == '5' && (text = '退回越库')
-            text == '6' && (text = '越库发货')
-            text == '7' && (text = 'KK')
-            text == '8' && (text = '合格品采退')
-            text == '9' && (text = '退货库采退')
-            return text
-          },
+          dataIndex: 'supervisionTypeName', title: '监管类型', width: 100,
         },
         { dataIndex: 'supervisionCode', title: '监管码', width: 150 },
         { dataIndex: 'uploadFlag', title: '上传状态', width: 150 },
         { dataIndex: 'uploadtimes', title: '上传次数', width: 150 },
         { dataIndex: 'message', title: '上传返回信息', width: 150 },
         { dataIndex: 'refBillId', title: '单据编号', width: 100 },
-        // {
-        //     title: '操作',
-        //     dataIndex: 'operator',
-        //     key: 'operator',
-        //     fixed: 'right',
-        //     width: 100,
-        //     scopedSlots: { customRender: 'operator' }
-        // }
+        {
+            title: '操作',
+            dataIndex: 'operator',
+            key: 'operator',
+            fixed: 'right',
+            width: 100,
+            scopedSlots: { customRender: 'operator' }
+        }
     ]
 };

+ 20 - 6
upcloud-wms-qingniu-web/src/views/kzyWMS/QualityControl/outBoundSupervised/config/searchItems.js

@@ -11,7 +11,19 @@ let grid = {
   labelCol:{span:6},
   wrapperCol:{span:14},
 }
-
+const remote = (type) => {
+  return {
+    remoteUrl: {
+      url: upcloud_base_common + `/dict/listbytype/?dicttypeCodes=${type}`,
+      method: "post",
+    },
+    replaceFields: {
+      label: "dictName",
+      value: "dictCode",
+    },
+    autoLoad: true,
+  };
+};
 export const searchItems = function(self) {
   return [
     ...genWarehouseAuthSearchModal(1, true, false, null, changecargoOwnerfun, grid, null),
@@ -81,11 +93,13 @@ export const searchItems = function(self) {
       name: 'supervisionType',
       label: '监管类型',
       required: true,
-      value:'',
-      options: [
-        {label: "销售订单", value: "2"},
-        {label: "购进退出单", value: "3"},
-      ],
+      value: '',
+      ...remote('out_supervision_type'),
+      // options: [
+      //   {label: "销售订单", value: "2"},
+      //   {label: "购进退出单", value: "3"},
+      //   {label: "销退出库", value: "4"},
+      // ],
       ...grid
     },
     {

+ 10 - 1
upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/api.js

@@ -13,7 +13,8 @@ export const api = {
   DestroybatchAuditNo: upcloud_base_gsp + '/gspUnqualifiedDestroy/batchAuditNo',
   DestroydelIds: upcloud_base_gsp + '/gspUnqualifiedDestroy/delIds',
   batchDestroy: upcloud_base_gsp + '/gspUnqualifiedDestroy/batchDestroy',
-  DestroygetById: upcloud_base_gsp + '/gspUnqualifiedDestroy/getById'
+  DestroygetById: upcloud_base_gsp + '/gspUnqualifiedDestroy/getById',
+  getGspUnqualifiedDestroySupervises: upcloud_base_gsp + '/gspUnqualifiedDestroy/getGspUnqualifiedDestroySupervises'
 }
 
 // /gspUnqualifiedLoss/batchAuditConfirm
@@ -117,3 +118,11 @@ export function DestroyAdd(parameter) {
     data: parameter
   })
 }
+
+export function getGspUnqualifiedDestroySupervises(parameter) {
+  return request({
+    method: 'get',
+    url: api.getGspUnqualifiedDestroySupervises,
+    params: parameter
+  })
+}

+ 148 - 0
upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/components/api/index.js

@@ -0,0 +1,148 @@
+// import request from "@/utils/request";
+import request, { axios } from "@/utils/request";
+import qs from "qs";
+import { upcloud_base_wh_inbound, upcloud_base_common, upcloud_base_strategy, upcloud_base_gsp } from "@/config/serviceSettings";
+
+export const api = {
+  findCodesByAllRefBillLineId: upcloud_base_wh_inbound + "/supervisionCode/findCodesByAllRefBillLineId",
+  delIds: upcloud_base_wh_inbound + "/supervisionCode/delIds",
+  addItem: upcloud_base_wh_inbound + "/rqcHeaders/addWithRelated",
+  taskSplit: upcloud_base_wh_inbound + "/rqcHeaders/taskSplit",
+  doException: upcloud_base_wh_inbound + "/rqcHeaders/doException",
+  getPreList: upcloud_base_wh_inbound + "/wmsInRqcSample/v1/get-prelist",
+  batchAdd: upcloud_base_wh_inbound + "/wmsInRqcSample/v1/batchAdd",
+  addSupervisionCode: upcloud_base_gsp + "/supervisionCode/addSupervisionCode",
+  findCodesByBill: upcloud_base_wh_inbound + "/supervisionCode/findCodesByBill",
+  isSupervised: upcloud_base_wh_inbound + "/supervisionCode/isSupervised",
+  extractSelectedRqcTask: upcloud_base_wh_inbound + "/rqcHeaders/extractSelectedRqcTask",
+  deleteCodesByBill: upcloud_base_wh_inbound + "/supervisionCode/deleteCodesByBill",
+};
+
+export function addItem(parameter) {
+  return request({
+    method: "post",
+    url: api.addItem,
+    data: parameter,
+  });
+}
+
+export function taskSplit(parameter) {
+  return request({
+    method: "post",
+    url: api.taskSplit,
+    data: parameter,
+  });
+}
+
+export function doException(parameter) {
+  return request({
+    method: "post",
+    url: api.doException,
+    data: parameter,
+  });
+}
+//获取预抽样集合
+export function getPreList(parameter) {
+  return request({
+    method: "post",
+    url: api.getPreList,
+    data: parameter,
+  });
+}
+//抽检
+export function batchAdd(parameter) {
+  return request({
+    method: "post",
+    url: api.batchAdd,
+    data: parameter,
+  });
+}
+//扫描监管码
+export function addSupervisionCode(parameter) {
+  return request({
+    method: "post",
+    url: api.addSupervisionCode,
+    data: parameter,
+  });
+}
+
+// 获取已扫码监管码列表
+export function findCodesByBill(parameter) {
+  return request({
+    method: "get",
+    url: api.findCodesByBill,
+    contentType: "x-www-form-urlencoded",
+    params: parameter,
+  });
+}
+// 是否完成扫描监管码
+export function isSupervised(parameter) {
+  return request({
+    method: "post",
+    url: api.isSupervised,
+    data: parameter,
+  });
+}
+// 更新监管码数据
+export function extractSelectedRqcTask(parameter) {
+  return request({
+    method: "post",
+    url: upcloud_base_wh_inbound + "/supervisionCode/querySupervisionCodedList",
+    data: parameter,
+  });
+}
+// 字典
+export function getDicts(parameter) {
+  return request({
+    method: "post",
+    url: upcloud_base_common + "/dict/listbytype",
+    params: parameter,
+    replaceFields: {
+      value: "dictCode",
+      label: "dictName",
+    },
+  });
+}
+
+// 获取入库结论-策略
+export const getStockStatusOptions = (params) => {
+  return axios.get(upcloud_base_strategy + "/strategy/v1/execute", { params });
+};
+export const IS_AGV = () => {
+  return axios.post(upcloud_base_common + "/dict/listbytype?dicttypeCodes=IS_AGV");
+};
+
+// remoteUrl: { url: upcloud_base_strategy + "/strategy/v1/execute", method: "get" },
+
+export function strategyExecute(data) {
+  return request({
+    method: "get",
+    url: upcloud_base_strategy + "/strategy/v1/execute",
+    params: data,
+  });
+}
+
+export function findCodesByAllRefBillLineId(parameter) {
+  return request({
+    method: "post",
+    url: api.findCodesByAllRefBillLineId,
+    // contentType: 'x-www-form-urlencoded',
+    data: parameter,
+  });
+}
+
+export function delIds(parameter) {
+  return request({
+    method: "post",
+    url: api.delIds,
+    data: parameter,
+  });
+}
+
+export function deleteCodesByBill(parameter) {
+  return request({
+    method: "post",
+    url: api.deleteCodesByBill,
+    data: parameter,
+  });
+}

+ 741 - 0
upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/components/scanCode.vue

@@ -0,0 +1,741 @@
+<template>
+  <div>
+    <p-modal
+      title="监管码扫描"
+      :visible="modelVal"
+      :dialogStyle="{ top: '50px' }"
+      :draggable="true"
+      :width="'98%'"
+      @cancel="handleCancel"
+      :destroyOnClose="true"
+      :footer="null"
+    >
+      <div style="overflow-x: auto; width: 100%">
+        <p-grid-form ref="gridItems" :items="gridItems" :labelCol="{ span: 5 }" :span="4" @submit="hanlderIsLock">
+        </p-grid-form>
+        <p-grid-form ref="showFormItems" :items="showFormItems" :labelCol="{ span: 5 }" :span="4"> </p-grid-form>
+      </div>
+      <a-row>
+        <div>
+          <a-col :span="12" class="left-a">
+            <p-grid-form :items="leftItems" ref="leftItems" :labelCol="{ span: 5 }" :span="4"> </p-grid-form>
+            <p-table
+              :id="$route.meta.menuId + '_48817'"
+              ref="tableA"
+              :columns="columns"
+              :has-row-count="true"
+              row-key="taskRqcId"
+              :data-source.sync="tableA"
+              :rowClassName="rowClassName"
+              :selectedRowKeys.sync="scanlist"
+              @clickRow="clickRowTrue"
+              dragle
+              auto-width
+              :scroll="{ y: 200, x: 200 }"
+              :rowSelectType="false"
+              border
+            >
+            </p-table>
+          </a-col>
+        </div>
+
+        <div>
+          <a-col :span="2" class="left-a" style="overflow-x: auto; winth: 100%">
+            <a-button style="margin: 10px" @click="radioBtn">重新选择规则</a-button>
+            <div label="packLevel">
+              <a-radio-group @change="radioPack" v-model="packLevel" :disabled="radioDisabled">
+                <a-radio value="0" style="margin: 10px"> 大包装 </a-radio>
+                <a-radio value="1" style="margin: 10px"> 中包装 </a-radio>
+                <a-radio value="2" style="margin: 10px"> 小包装 </a-radio>
+              </a-radio-group>
+            </div>
+          </a-col>
+        </div>
+
+        <div>
+          <a-col :span="10" class="left-a">
+            <p-grid-form
+              ref="rightItems"
+              :items="rightItems"
+              :labelCol="{ span: 5 }"
+              :span="4"
+              @submit="hanlderSubmit"
+              style="margin: 20px"
+            >
+            </p-grid-form>
+            <p-spin :spinning="loadding">
+              <p-table
+                :id="$route.meta.menuId + '_12935'"
+                ref="tableB"
+                :columns="tableColumns"
+                :has-row-count="true"
+                dragle
+                auto-width
+                :data-source.sync="tableB"
+                :pagination="false"
+                rowKey="supervisionCode"
+                :scroll="{ y: 200, x: 200 }"
+                style="margin-top: 20px"
+                :rowSelectType="false"
+                border
+              >
+                <template slot="operation" slot-scope="text, record">
+                  <a @click="del(record)">删除</a>
+                </template>
+              </p-table>
+              <a-pagination
+                show-size-changer
+                :total="page.totalCount"
+                :show-total="(total) => `共 ${total} 条`"
+                @showSizeChange="onShowSizeChange"
+                @change="pageChange"
+              />
+            </p-spin>
+          </a-col>
+        </div>
+      </a-row>
+    </p-modal>
+    <workerLogin
+      :loginVisible="loginVisible"
+      :isSupervisedData="isSupervisedData"
+      @loginResult="loginResult"
+      @handleCancel="handleCancels"
+    ></workerLogin>
+  </div>
+</template>
+<script>
+import { setFormItems, showFormItems } from "../config/scanCode/gridform";
+import { leftItems, tableColumnsConfig } from "../config/scanCode/lefttable";
+import { rightItems, tableColumns } from "../config/scanCode/righttable";
+import { addSupervisionCode, findCodesByBill, findCodesByAllRefBillLineId, delIds, deleteCodesByBill } from "./api";
+import workerLogin from "./workerLogin.vue";
+
+export default {
+  components: { workerLogin },
+
+  props: {
+    value: {
+      type: Boolean,
+      default: false,
+    },
+    scanTable: {
+      type: Array,
+      default: [],
+    },
+  },
+  data() {
+    return {
+      loadding: false,
+      page: {
+        pageNum: 1,
+        pageSize: 10,
+        totalCount: 0,
+      },
+      modelVal: false,
+      gridItems: setFormItems,
+      showFormItems: showFormItems,
+      leftItems: leftItems(this),
+      columns: tableColumnsConfig,
+      rightItems: rightItems(this),
+      tableColumns: tableColumns,
+      tableAIndex: 0,
+      tableA: [],
+      tableB: [],
+      scanlist: [],
+      packLevel: "0",
+      selectRow: {},
+      loginVisible: false,
+      radioDisabled: true,
+      rows: {},
+      stage: 0,
+      isSupervisedData: {},
+    };
+  },
+  created() {},
+  mounted() {
+    //   this.$refs[refName][0].focus()
+  },
+  watch: {
+    value(bool) {
+      console.log(bool);
+      if (bool) {
+        this.modelVal = bool;
+        this.$nextTick(() => {
+          this.$refs.rightItems.form.focusByName("supervisionCode");
+          console.log();
+        });
+        this.tableA = [];
+        this.tableB = [];
+        if (this.scanTable.length == 0) {
+          this.$message.error("该单所有商品,无需扫描药品追溯码");
+          this.$emit("successScanCode", true);
+        } else if (this.scanTable) {
+          this.tableA = [...this.scanTable];
+          this.$nextTick(() => {
+            this.$refs.gridItems.form.setFieldsValue(this.tableA[0]);
+            this.$refs.gridItems.form.setFieldsValue({ refBillId: this.tableA[0].refBillId });
+            this.$refs.gridItems.form.setFieldsValue({ refBillLineId: this.tableA[0].refBillLineId });
+            console.log(this.scanTable);
+            this.clickRowTrue(null, null, this.tableA[0]);
+            this.billNum();
+            // 数量 < 大包装数 (规格取小包装数)
+            let res = this.tableA[0];
+            this.$nextTick(() => {
+              if (+res.pieceQty < +res.maxSu) {
+                this.packLevel = "2";
+              } else {
+                this.packLevel = "0";
+              }
+            });
+          });
+        }
+      }
+    },
+  },
+  computed: {
+    rowIndex() {
+      return this.tableAIndex;
+    },
+  },
+  methods: {
+    onDelAll() {
+      let self = this
+      this.$confirm({
+        title: '确定要全部删除吗?',
+        onOk() {
+          deleteCodesByBill([self.tableA[self.tableAIndex].refBillLineId]).then(res => {
+            if (res.success) {
+              self.clickRow(null, null, self.tableA[self.tableAIndex], true);
+              self.$message.success('操作成功')
+            } else {
+              self.$message.error(res.message)
+            }
+          })
+        }
+      })
+    },
+    pageChange(pageNum, pageSize) {
+      this.page.pageNum = pageNum;
+      this.page.pageSize = pageSize;
+      this.getTableBInfo(this.tableA[this.rowIndex], true);
+    },
+    onShowSizeChange(current, pageSize) {
+      this.page.pageNum = current;
+      this.page.pageSize = pageSize;
+      this.getTableBInfo(this.tableA[this.rowIndex], true);
+    },
+    async getTableBInfo(row, type) {
+      let otherSelectBillList = this.tableA.map((i) => {
+        return { refBillId: i.refBillId, refBillLineId: i.refBillLineId };
+      });
+      this.loadding = true;
+      try {
+        let res = await findCodesByAllRefBillLineId({
+          userId:this.$store.state.user.info.userId,
+          refBillId: row.refBillId,
+          refBillLineId: row.refBillLineId,
+          otherSelectBillList,
+          ...this.page,
+        });
+        this.loadding = false;
+        if (res.success) {
+          let { maxScanedQty, middleScanedQty, minScanedQty, isUnLock } = res.data;
+          if (isUnLock) {
+            this.$message.warning("此商品已全部扫描完成");
+            this.modelVal = false;
+            this.tableAIndex = 0;
+            this.$emit("successScanCode", true);
+            //   billComplete
+            this.$emit("input", false);
+            return
+          }
+          console.log(res, "=====");
+          //   this.$refs.leftItems.form.setFieldsValue({ maxSu: 0, middleSu: 0, minSu: 0 })
+          this.tableB = res.data?.superviseCodesModal;
+
+          //  返回已扫监管码数据
+          // if ( this.tableB?.length!=0) {
+          //   this.$emit('detail',this.tableB)
+          // }
+
+          this.page.totalCount = parseInt(res.data.totalCount) || 0;
+          this.billNum();
+          console.log(this.tableB);
+          this.$refs.leftItems.form.setFieldsValue({
+            maxScanedQty: parseInt(maxScanedQty),
+            middleScanedQty: parseInt(middleScanedQty),
+            minScanedQty: parseInt(minScanedQty),
+          });
+          let val = +this.packLevel;
+          this.radioCheck(val);
+
+          const num = this.$refs.leftItems.form.getFieldsValue().customBillNum
+
+          
+          if (res.data.billComplete && type) {
+            this.$message.warning("此商品已全部扫描完成");
+            this.modelVal = false;
+            this.tableAIndex = 0;
+            this.$emit("successScanCode", true);
+            //   billComplete
+            this.$emit("input", false);
+          }
+        } else {
+          this.$exception(res);
+        }
+      } catch (error) {
+        this.loadding = false;
+        this.$exception(error);
+      }
+    },
+    del(text) {
+      let that = this;
+      console.log(text);
+      this.$confirm({
+        title: "确定是否要删除?",
+        content: "",
+        async onOk() {
+          that.loadding = true;
+          let res = await delIds([text.id]);
+          that.loadding = false;
+          if (res.success) {
+            that.$message.success("删除成功");
+            // that.remoteParams = { ...that.remoteParams }
+
+            if (text.packLevel == "0") {
+              that.$nextTick(() => {
+                that.$refs.leftItems.form.setFieldsValue({
+                  maxScanedQty: +that.$refs.leftItems.form.getFieldsValue().maxScanedQty - 1,
+                });
+              });
+            } else if (text.packLevel == "1") {
+              that.$nextTick(() => {
+                that.$refs.leftItems.form.setFieldsValue({
+                  middleScanedQty: +that.$refs.leftItems.form.getFieldsValue().middleScanedQty - 1,
+                });
+              });
+            } else if (text.packLevel == "2") {
+              that.$nextTick(() => {
+                that.$refs.leftItems.form.setFieldsValue({
+                  minScanedQty: +that.$refs.leftItems.form.getFieldsValue().minScanedQty - 1,
+                });
+              });
+            }
+            console.log(that.tableA, that.tableAIndex, "4444444444444");
+
+            that.clickRow(null, null, that.tableA[that.tableAIndex], true);
+          } else {
+            that.$exception(res);
+          }
+        },
+        onCancel() {},
+      });
+    },
+    rowClassName(record) {
+      if (this.rowIndex > this.tableA.length) return;
+      return record.taskRqcId == this.tableA[this.rowIndex]?.taskRqcId ? "clickRowStyl" : "";
+    },
+    handleCancel(e) {
+      this.modelVal = false;
+      this.tableAIndex = 0;
+      this.$emit("input", false);
+      this.tableB = [];
+      // this.destroyOnClose = true
+    },
+    handleCancels() {
+      this.loginVisible = false;
+    },
+    loginResult(data, value) {
+      this.loginVisible = false;
+      this.$message.success("解锁成功!");
+      this.tableAIndex = 0;
+      this.modelVal = false; //关闭监管码弹窗
+      this.$emit("input", false);
+      this.loginVisible = data
+      const params = {
+        stage: this.stage,
+        creator: data.userId,
+        creatorName: data.username,
+        refBillId: this.scanTable[0].refBillId,
+        refBillLineId: this.scanTable[0].refBillLineId,
+        unlock: 1,
+        // 是否解锁插入
+        isUnlock: 1,
+      };
+      addSupervisionCode(params).then((res) => {
+        if (!res.success) {
+          this.$message.error(message);
+          return;
+        }
+        this.$message.success("解锁成功!");
+        this.tableAIndex = 0;
+        this.modelVal = false; //关闭监管码弹窗
+      });
+    },
+    // 解锁
+    hanlderIsLock(e, form) {
+      e.preventDefault();
+      this.loginVisible = true;
+      let warehouse = this.$store.state.user.warehouse;
+      this.isSupervisedData = {
+        specialWorkType: "入库监管码解锁",
+        warehouseId: warehouse.warehouseId,
+        refBillId: this.selectRow.refBillId,
+        refBillLineId: this.selectRow.refBillLineId
+      };
+    },
+    //剩余数量
+    getNum() {
+      var num = this.$refs.leftItems.form.getFieldsValue().customBillNum;
+      console.log(num,'num');
+      if (num == 0) {
+        this.$refs.leftItems.form.setFieldsValue({
+          customBillNum: 0,
+        });
+        this.$message.warning("此商品已全部扫描完成");
+        this.tableAIndex = 0;
+        this.modelVal = false;
+        return;
+      }
+    },
+    //回车事件
+
+    hanlderSubmit(e, form) {
+      e.preventDefault();
+      let code = this.$refs.rightItems.form.getFieldsValue().supervisionCode;
+      let testCode = /^\d{20}$/.test(code);
+      if (!testCode) {
+        this.$message.warning(this.$lang("请检查药品追溯码,格式必须长度为20位"));
+        this.$refs.rightItems.form.resetFields(); //监管码输入异常需要清空输入框
+        return;
+      }
+      var a = 0;
+      console.log(this.tableB);
+      this.tableB &&
+        this.tableB.forEach((t) => {
+          if (t.supervisionCode == code) {
+            a = 1;
+            this.$message.warning(this.$lang("请检查药品追溯码,该条码已经存在"));
+            this.$refs.rightItems.form.resetFields(); //监管码输入异常需要清空输入框
+            this.getNum();
+          }
+        });
+      if (a == 1) return;
+      console.log(this.tableA, this.rowIndex);
+
+      this.selectRow.packLevel = this.packLevel;
+      let packLevel = this.selectRow.packLevel;
+      let result = this.$refs.leftItems.form.getFieldsValue();
+      // let { maxSu,maxScanedQty, middleSu, middleScanedQty, minSu, minScanedQty } = ref
+      let maxSu = +result.maxSu || 0;
+      let maxScanedQty = +result.maxScanedQty || 0;
+      let middleSu = +result.middleSu || 0;
+      let middleScanedQty = +result.middleScanedQty || 0;
+      let minScanedQty = +result.minScanedQty || 0;
+      let minSu = +result.minSu || 1;
+      let map = {
+        0: maxSu || 0,
+        1: middleSu || 0,
+        2: minSu || 0,
+      };
+
+      if ((maxSu == 0 || !maxSu) && packLevel == 0) {
+        this.$message.warning(this.$lang("大包装数量为空,请维护!"));
+        return;
+      }
+      if ((middleSu == 0 || !middleSu) && packLevel == 1) {
+        this.$message.warning(this.$lang("中包装数量为空,请维护!"));
+        return;
+      }
+      if ((minSu == 0 || !minSu) && packLevel == 2) {
+        this.$message.warning(this.$lang("小包装数量为空,请维护!"));
+        return;
+      }
+
+      let total = this.selectRow.pieceQty - (maxSu * maxScanedQty + middleSu * middleScanedQty + minScanedQty * minSu);
+      console.log(this.selectRow, total, map[packLevel]);
+      if (total < map[packLevel]) {
+        this.$message.warning("包装数大于商品数量,请重新选择包装!");
+        return;
+      }
+      //   return
+      let forItem = this.$refs.showFormItems.form.getFieldsValue();
+      const params = { supervisionCode: code, ...this.selectRow, ...forItem };
+      console.log(this.selectRow);
+      params.refBillId = this.selectRow.refBillId;
+      params.refBillLineId = this.selectRow.refBillLineId;
+      params.businessType = 0;
+      if (this.selectRow.packLevel == "0") {
+        params.packSize = this.selectRow.maxSu;
+      } else if (this.selectRow.packLevel == "1") {
+        params.packSize = this.selectRow.middleSu;
+      } else if (this.selectRow.packLevel == "2") {
+        params.packSize = this.selectRow.minSu;
+      }
+
+      // 扫码阶段:0=入库质检 1=PC拣货 2=PC内复核 3=PC外复核 4=补录 5=PDA拣货 6=PDA内复核 7=PDA外复核
+      params.stage = this.stage;
+      params.billType = this.selectRow.rcvType;
+      let otherSelectBillList = this.tableA.map((i) => {
+        return { refBillId: i.refBillId, refBillLineId: i.refBillLineId };
+      });
+      params.otherSelectBillList = otherSelectBillList;
+
+      this.loadding = true;
+      addSupervisionCode(params).then((res) => {
+        this.loadding = false;
+        this.$refs.rightItems.form.resetFields();
+        if (!res.success) {
+          this.$exception(res);
+          return;
+        }
+        this.$message.success("扫描成功!");
+        if (!res.data) {
+          return;
+        }
+        // this.$refs.leftItems.form.setFieldsValue({
+        //   superviseCodesModal: [],
+        // });
+        // this.$message.success(res.message)
+        this.billNum();
+        var num = this.$refs.leftItems.form.getFieldsValue().customBillNum;
+        // if (num == 0 || num < 0) {
+        //   this.$refs.leftItems.form.setFieldsValue({
+        //     customBillNum: 0
+        //   })
+        //   console.log('aaa')
+        //   this.$message.warning('此商品已全部扫描完成')
+        //   this.modelVal = false
+        //   this.tableAIndex = 0
+        //   this.$emit('successScanCode', true)
+        //   //   billComplete
+        //   this.$emit('input', false)
+        //   return
+        // } else {
+        //0大包装,1中包装,2小包装
+        if (res.data.billComplete) {
+          this.$message.warning("此商品已全部扫描完成");
+          this.modelVal = false;
+          this.tableAIndex = 0;
+          this.$emit("successScanCode", true);
+          //   billComplete
+          this.$emit("input", false);
+          this.modelVal = false; //关闭监管码弹窗
+          return;
+        }
+
+        if (num == 1) {
+          // 当前行商品已经扫描完成
+          this.tableAIndex += 1;
+          if (this.tableAIndex < this.tableA.length) {
+            this.$message.warning(`第${this.tableAIndex}行商品已扫描完成!`);
+            console.log(this.tableA[this.tableAIndex]);
+            this.clickRow(null, null, this.tableA[this.tableAIndex]);
+            return;
+          }
+        }
+        if (this.packLevel == "0") {
+          this.$nextTick(() => {
+            this.$refs.leftItems.form.setFieldsValue({
+              maxScanedQty: +this.$refs.leftItems.form.getFieldsValue().maxScanedQty + 1,
+            });
+          });
+        } else if (this.packLevel == "1") {
+          this.$nextTick(() => {
+            this.$refs.leftItems.form.setFieldsValue({
+              middleScanedQty: +this.$refs.leftItems.form.getFieldsValue().middleScanedQty + 1,
+            });
+          });
+        } else if (this.packLevel == "2") {
+          this.$nextTick(() => {
+            this.$refs.leftItems.form.setFieldsValue({
+              minScanedQty: +this.$refs.leftItems.form.getFieldsValue().minScanedQty + 1,
+            });
+          });
+        }
+
+        if (num == 1) {
+          this.clickRow(null, null, this.tableA[this.tableAIndex - 1], true);
+        } else {
+          this.clickRow(null, null, this.tableA[this.tableAIndex], true);
+        }
+        //   this.$refs.tableB.createRow(0, {
+        //     supervisionCode: code,
+        //     itemName: this.selectRow.itemName
+        //   })
+        //取左边table的长度,判断当前index是否是最后一条
+        //最后一条时剩余数量为0,自动关闭弹框
+        var index = this.tableA.length;
+        let that = this;
+        console.log(this.rows);
+        // if (this.rows._row_count == index) {
+        //   setTimeout(() => {
+        //     let customBillNum2 = that.$refs.leftItems.form.getFieldsValue().customBillNum
+        //     // 监测剩余数量,0自动关闭弹框
+        //     if (customBillNum2 == 0) {
+        //       that.$refs.leftItems.form.setFieldsValue({
+        //         customBillNum: 0
+        //       })
+        //       that.$message.warning('此商品已全部扫描完成')
+        //       that.modelVal = false
+        //       that.tableAIndex = 0
+        //       that.$emit('successScanCode', true)
+        //       that.$emit('input', false)
+        //       return
+        //     }
+        //   }, 2000)
+        // }
+        // }
+      });
+    },
+
+    async clickRow(selectedRowKeys, key, row, bool) {
+      this.tableAIndex =
+        this.tableA.findIndex((item) => item.taskRqcId == key) >= 0
+          ? this.tableA.findIndex((item) => item.taskRqcId == key)
+          : this.tableAIndex;
+      if (this.tableAIndex == this.tableA.length) {
+        this.tableAIndex = this.tableAIndex - 1 
+      }
+      this.$refs.tableA.reload(); //更新高亮
+      this.rows = row;
+      this.$nextTick(() => {
+        let val = +this.packLevel;
+        //删除和添加时不重新赋值
+        !bool && this.$refs.leftItems.form.setFieldsValue(this.rows) && this.radioCheck(val);
+        console.log(row, "row");
+        this.$refs.showFormItems.form.setFieldsValue(row);
+      });
+      this.selectRow = row;
+
+      this.getTableBInfo(row, true);
+    },
+
+    async clickRowTrue(selectedRowKeys, key, row) {
+      //   let ref = this.$refs.showFormItems.form.getFieldsValue()
+      //   this.$refs.leftItems.form.setFieldsValue(ref)
+      this.tableAIndex =
+        this.tableA.findIndex((item) => item.taskRqcId == key) >= 0
+          ? this.tableA.findIndex((item) => item.taskRqcId == key)
+          : this.tableAIndex;
+      this.$refs.tableA.reload(); //更新高亮
+      this.rows = row;
+      this.$nextTick(() => {
+        let val = +this.packLevel;
+        //删除和添加时不重新赋值
+        this.$refs.leftItems.form.setFieldsValue(this.rows);
+        this.radioCheck(val);
+        console.log(row, "row");
+        this.$refs.showFormItems.form.setFieldsValue(row);
+      });
+      this.selectRow = row;
+      this.$nextTick(() => {
+        if (+row.pieceQty < +row.maxSu) {
+          this.packLevel = "2";
+        } else {
+          this.packLevel = "0";
+        }
+      })
+      this.getTableBInfo(row, true);
+    },
+    //规则
+    radioPack(p1) {
+      //(数量 pieceQty /大包装数 maxSu) +  数量 pieceQty % 大包装数 maxSu
+      //(数量 pieceQty /中包装数 middleSu +  数量 pieceQty % 中包装数 middleSu
+      if (p1.target.value) {
+        this.radioDisabled = true;
+      }
+      let val = +this.packLevel;
+      this.radioCheck(val);
+      //   this.billNum()
+    },
+    //单选框校验规则
+    radioCheck(val) {
+      //大包装
+      //应扫 shouldScanQty (数量 pieceQty /包装数 maxSu) +  数量 pieceQty % 包装数 maxSu
+      //剩余 customBillNum (应扫-(应扫大包装 + 应扫中包装 + 应扫小包装))
+      this.$nextTick(() => {
+        let ref = this.$refs.showFormItems.form.getFieldsValue();
+        let result = this.$refs.leftItems.form.getFieldsValue();
+        console.log(ref);
+        console.log(this.selectRow);
+        if (!this.selectRow) return;
+        // let { maxSu,maxScanedQty, middleSu, middleScanedQty, minSu, minScanedQty } = ref
+        let maxSu = +result.maxSu || 0;
+        let maxScanedQty = +result.maxScanedQty || 0;
+        let middleSu = +result.middleSu || 0;
+        let middleScanedQty = +result.middleScanedQty || 0;
+        let minScanedQty = +result.minScanedQty || 0;
+        let minSu = +result.minSu || 1;
+        let total = this.selectRow.pieceQty - (maxSu * maxScanedQty + middleSu * middleScanedQty + minScanedQty * minSu);
+        console.log(total,'total');
+        if (val == 0 && !maxSu) {
+          this.$message.warn("商品无该包装规格数据,请联系管理员完善商品基础数据");
+          return;
+        }
+        if (val == 1 && !middleSu) {
+          this.$message.warn("商品无该包装规格数据,请联系管理员完善商品基础数据");
+          return;
+        }
+        if (val == 2 && !minSu) {
+          this.$message.warn("商品无该包装规格数据,请联系管理员完善商品基础数据");
+          return;
+        }
+
+        this.$refs.leftItems.form.setFieldsValue({
+          shouldScanQty: this.selectRow.pieceQty,
+          customBillNum: total,
+        });
+        // if (val == 0 && maxSu) {
+        //   a = parseInt(total / maxSu) + (total % maxSu);
+        //   console.log("剩余", a);
+        //   this.$refs.leftItems.form.setFieldsValue({
+        //     shouldScanQty: parseInt(total / maxSu) + (total % maxSu) + maxScanedQty + middleScanedQty + minScanedQty,
+        //     customBillNum: a,
+        //   });
+        // } else if (val == 1 && middleSu) {
+        //   a = parseInt(total / middleSu) + (total % middleSu);
+        //   console.log("剩余", a);
+        //   this.$refs.leftItems.form.setFieldsValue({
+        //     shouldScanQty:
+        //       parseInt(total / middleSu) + (total % middleSu) + maxScanedQty + middleScanedQty + minScanedQty,
+        //     customBillNum: a,
+        //   });
+        // } else if (val == 2 && minSu) {
+        //   a = parseInt(total / minSu) + (total % minSu);
+        //   console.log("剩余", a);
+        //   this.$refs.leftItems.form.setFieldsValue({
+        //     // shouldScanQty: a + maxScanedQty + minScanedQty + middleScanedQty,
+        //     shouldScanQty: parseInt(total / minSu) + (total % minSu) + maxScanedQty + middleScanedQty + minScanedQty,
+        //     customBillNum: a,
+        //   });
+        // }
+      });
+    },
+    // 剩余数量取值
+    billNum() {
+      let val = +this.packLevel;
+      this.radioCheck(val);
+    },
+    //重新选择规则
+    radioBtn() {
+      this.radioDisabled = false;
+    },
+  },
+};
+</script>
+<style lang="less" scoped>
+.left-a {
+  border: 1px solid #dcdfe6;
+  height: 400px;
+}
+
+/deep/.clickRowStyl {
+  td {
+    background-color: #00b4ed !important;
+  }
+}
+/deep/.p-table tr.active > td {
+  background: #00b4ed !important;
+}
+</style>

+ 141 - 0
upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/components/workerLogin.vue

@@ -0,0 +1,141 @@
+<template>
+  <div ref="workerLogin">
+    <a-modal
+      title="解锁"
+      :visible="loginVisible"
+      :confirm-loading="confirmLoading"
+      @ok="loginevent"
+      @cancel="handleCancel"
+    >
+      <p style="margin-top: 30px; margin-bottom: 25px; padding-right: 60px">
+        <a-form class="plg-login" :form="loginform" @submit.prevent="loginevent">
+          <a-form-item label="用户名" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+            <div class="input-wrapper">
+              <a-input
+                class="input"
+                size="large"
+                type="text"
+                autocomplete="false"
+                placeholder="请输入用户名"
+                v-decorator="[
+                  'workercode',
+                  { rules: [{ required: true, message: '请输入用户名' }], validateTrigger: 'change' },
+                ]"
+              >
+              </a-input>
+            </div>
+          </a-form-item>
+          <a-form-item label="密码" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+            <div class="input-wrapper">
+              <a-input
+                class="input"
+                size="large"
+                type="password"
+                autocomplete="false"
+                placeholder="请输入密码"
+                v-decorator="[
+                  'workpassword',
+                  { rules: [{ required: true, message: '请输入密码' }], validateTrigger: 'change' },
+                ]"
+              >
+              </a-input>
+            </div>
+          </a-form-item>
+          <a-form-item label="解锁原因" :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
+            <div class="input-wrapper">
+              <a-textarea
+                class="input"
+                size="large"
+                autocomplete="false"
+                placeholder="请输入解锁原因"
+                v-decorator="[
+                  'unlockReason',
+                  { rules: [{ required: true, message: '请输入解锁原因' }], validateTrigger: 'change' },
+                ]"
+              >
+              </a-textarea>
+            </div>
+          </a-form-item>
+        </a-form>
+      </p>
+    </a-modal>
+  </div>
+</template>
+
+<script>
+import { mapState, mapActions, mapGetters } from 'vuex'
+export default {
+  name: 'workerLogin',
+  components: {},
+  props: {
+    loginVisible: {
+      type: Boolean,
+      default: false,
+    },
+    isSupervisedData: {
+      type: Object,
+      default() {
+        return {}
+      },
+    },
+  },
+  data() {
+    return {
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 18 },
+      },
+      confirmLoading: false,
+      loginform: this.$form.createForm(this),
+      refsss: null,
+    }
+  },
+  created() {},
+  mounted() {},
+  computed: {
+    ...mapState({
+      chekUser: (state) => state.outBound.checkPerson,
+      stationCode: (state) => state.outBound.stationCode,
+      businesstype: (state) => state.outBound.businesstype,
+      worktype: (state) => state.outBound.worktype,
+      warehouseId: (state) => state.outBound.warehouseId,
+    }),
+    ...mapGetters({
+      warehouse: 'warehouse',
+    }),
+  },
+  watch: {},
+  methods: {
+    ...mapActions(['CheckLoginIn']),
+    loginevent() {
+      this.loginform.validateFields((err, values) => {
+        if (!err) {
+          values.warehouseId = this.isSupervisedData.warehouseId
+          values.specialWorkType = this.isSupervisedData.specialWorkType
+          values.refBillId = this.isSupervisedData.refBillId
+          values.refBillLineId = this.isSupervisedData.refBillLineId
+          // values.stationCode = this.stationCode
+          // values.warehouseId = this.warehouseId
+          this.confirmLoading = true
+          this.CheckLoginIn(values)
+            .then((res) => {
+              this.$message.success('操作成功')
+              this.confirmLoading = false
+              this.$emit('loginResult', false, res)
+              this.loginform.resetFields()
+            })
+            .catch((error) => {
+              this.$message.error('解锁失败')
+              this.confirmLoading = false
+            })
+        }
+      })
+    },
+    handleCancel() {
+      this.$emit('handleCancel', false)
+    },
+  },
+}
+</script>
+
+<style></style>

+ 52 - 0
upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/config/scanCode/gridform.js

@@ -0,0 +1,52 @@
+/*
+ * @Date: 2021-09-24 16:52:07
+ * @LastEditors: 陈禹琨 cyk910622@163.com
+ * @LastEditTime: 2022-08-18 17:43:00
+ * @FilePath: \upcloud-base-fe-wms\src\views\kzyWMS\inBound\quality\billEditor\config\scanCode\gridform.js
+ * @Description: cyk
+ */
+// let grid = {
+//   labelCol: { span: 4 },
+// // };
+// refBillId =rcvHeadId
+// refBillLineId=rcvLineId
+
+export const setFormItems = [
+  // { type: 'input', name: 'mtlOwnerName', label: '货主名称', value: '', },
+  { type: "input", name: "refBillId", label: "单据编号", value: "" },
+  // { type: 'input', name: 'businessType', label: '业务类型', value: '', disabled:true },
+  {
+    type: "buttonGroup",
+    options: [
+      {
+        value: "解锁",
+        icon: "unlock",
+        btnType: "primary",
+        htmlType: "submit",
+      },
+      {
+        value: "清空",
+        icon: "redo",
+        style: "margin-left:10px",
+        on: {
+          click(event, form) {
+            form.resetFields();
+          },
+        },
+      },
+    ],
+  },
+];
+
+export const showFormItems = [
+  { type: "input", name: "refBillLineId", label: "单据编号", value: "", disabled: true },
+  { type: "input", name: "containerCode", label: "容器号", value: "", disabled: true },
+  { type: "input", name: "itemName", label: "商品名称", value: "", disabled: true },
+  { type: "input", name: "manufacturerName", label: "生产厂家", value: "", disabled: true },
+  { type: "input", name: "maxSu", label: "大包装数", value: "", disabled: true },
+  { type: "input", name: "maxScanedQty", label: "实扫大包装数", value: "", disabled: true, hidden: true },
+  { type: "input", name: "middleSu", label: "中包装数", value: "", disabled: true, placeholder: "空" },
+  { type: "input", name: "middleScanedQty", label: "实扫中包装数", value: "", disabled: true, hidden: true },
+  { type: "input", name: "minSu", label: "小包装数", value: "", disabled: true, hidden: true },
+  { type: "input", name: "minScanedQty", label: "实扫小包装数", value: "", disabled: true, hidden: true },
+];

+ 48 - 0
upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/config/scanCode/lefttable.js

@@ -0,0 +1,48 @@
+/*
+ * @Date: 2022-03-07 09:19:27
+ * @LastEditors: 陈禹琨 cyk910622@163.com
+ * @LastEditTime: 2022-07-19 11:53:12
+ * @FilePath: \upcloud-base-fe-wms\src\views\kzyWMS\inBound\quality\billEditor\config\scanCode\lefttable.js
+ * @Description: cyk
+ */
+let grid = {
+    labelCol: { span: 9 },
+    span: 6
+  }
+  export function leftItems(self) {
+    let _this = self
+    return [
+      { type: 'input', name: 'maxSu', label: '大包装个数', ...grid, value: 0, disabled: true, hidden: true },
+      { type: 'input', name: 'middleSu', label: '中包装个数', ...grid, value: 0, disabled: true,hidden: true  },
+      { type: 'input', name: 'shouldScanQty', label: '应扫', ...grid, value: 0, disabled: true ,},
+      { type: 'input', name: 'maxScanedQty', label: '实扫大包装数', ...grid, value: 0, disabled: true },
+      { type: 'input', name: 'middleScanedQty', label: '实扫中包装数', ...grid, value: 0, disabled: true },
+      { type: 'input', name: 'minScanedQty', label: '实扫小包装数', ...grid, value: 0, disabled: true },
+      { type: 'number', name: 'customBillNum', label: '剩余', ...grid, value: 0, disabled: true }
+    ]
+  }
+  
+  export const tableColumnsConfig = [
+    { title: 'itemId', dataIndex: 'itemId', key: 'itemId', width: 80, type: 'txt', hidden: true },
+    { title: 'taskRqcId', dataIndex: 'taskRqcId', key: 'taskRqcId', width: 80, type: 'txt', hidden: true },
+    { title: 'rcvHeadId', dataIndex: 'rcvHeadId', key: 'rcvHeadId', width: 80, type: 'txt', hidden: true },
+    { title: 'rcvLineId', dataIndex: 'rcvLineId', key: 'rcvLineId', width: 80, type: 'txt', hidden: true },
+    { title: 'cargoOwnerCode', dataIndex: 'cargoOwnerCode', key: 'cargoOwnerCode', width: 80, type: 'txt', hidden: true },
+    { title: '容器号', dataIndex: 'containerCode', key: 'containerCode', width: 80, type: 'txt' },
+    { title: '库别', dataIndex: 'warehouseAreaCategoryName', key: 'warehouseAreaCategoryName', width: 80, type: 'txt' },
+    { title: '库位', dataIndex: 'locatorCode', key: 'locatorCode', width: 80, type: 'txt' },
+    { title: '批号', dataIndex: 'manufacturerLotNum', key: 'manufacturerLotNum', width: 80, type: 'txt' },
+    { title: '商品名称', dataIndex: 'itemName', key: 'itemName', width: 160, type: 'txt' },
+    { title: '商品编号', dataIndex: 'itemCode', key: 'itemCode', width: 120, type: 'txt' },
+    { title: '规格', dataIndex: 'specification', key: 'specification', width: 80, type: 'txt' },
+    { title: '数量', dataIndex: 'pieceQty', key: 'pieceQty', width: 80, type: 'txt' },
+    { title: '订单编号', dataIndex: 'srcCode', key: 'srcCode', width: 120, type: 'txt' },
+    { title: '包装单位', dataIndex: 'uom', key: 'uom', width: 80, type: 'txt' },
+    { title: '件数', dataIndex: 'caseQty', key: 'caseQty', width: 60, type: 'txt' },
+    { title: '零散数', dataIndex: 'oddPieceQty', key: 'oddPieceQty', width: 80, type: 'txt' },
+    { title: '中包装', dataIndex: 'middleSu', key: 'middleSu', width: 80, type: 'txt' },
+    { title: '大包装', dataIndex: 'maxSu', key: 'maxSu', width: 80, type: 'txt' },
+    { title: '生产厂家', dataIndex: 'manufacturerName', key: 'manufacturerName', width: 80, type: 'txt' },
+    { title: '标准托盘量', dataIndex: 'palletStdQuantity', key: 'palletStdQuantity', width: 80, type: 'txt' }
+  ]
+  

+ 60 - 0
upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/config/scanCode/righttable.js

@@ -0,0 +1,60 @@
+/*
+ * @Date: 2021-09-24 16:52:07
+ * @LastEditors: 陈禹琨 cyk910622@163.com
+ * @LastEditTime: 2022-07-25 16:32:11
+ * @FilePath: \upcloud-base-fe-wms\src\views\kzyWMS\inBound\quality\billEditor\config\scanCode\righttable.js
+ * @Description: cyk
+ */
+let grid = {
+    labelCol: { span: 5 },
+    span: 13
+  }
+  export function rightItems(self) {
+    let _this = self
+    return [
+      { type: 'input', name: 'supervisionCode', label: '扫描监管码', ...grid, value: '' },
+      {
+        type: "buttonGroup",
+        options: [
+          {
+            value: "全部删除",
+            btnType: "danger",
+            on: {
+              click(event, form) {
+                self.onDelAll();
+              },
+            },
+          },
+        ],
+      },
+    ]
+  }
+  
+  export const tableColumns = [
+    { title: 'id', dataIndex: 'id', key: 'id', type: 'txt', hidden: true },
+    {
+      title: '监管/防窜码',
+      dataIndex: 'supervisionCode',
+      key: 'supervisionCode',
+  
+      type: 'txt',
+      ellipsis: true
+    },
+    { title: '商品名称', dataIndex: 'itemName', key: 'itemName', type: 'txt', ellipsis: true },
+    {
+      title: '包装级别',
+      dataIndex: 'packLevel',
+      key: 'packLevel',
+      type: 'txt',
+      ellipsis: true,
+      customRender(text) {
+        console.log(text)
+        text == 0 && (text = '大包装')
+        text == 1 && (text = '中包装')
+        text == 2 && (text = '小包装')
+        return text
+      }
+    },
+    { title: '操作', key: 'operation', scopedSlots: { customRender: 'operation' }, align: 'center' }
+  ]
+  

+ 42 - 3
upcloud-wms-qingniu-web/src/views/kzyWMS/UnacceptedProduct/destroyApply/index.vue

@@ -10,7 +10,8 @@
         <!-- <p-button type="primary" v-if="!keyType" @click="del">删除</p-button> -->
         <a-space>
           <!-- <p-button type="primary" @click="showModal">提取</p-button> -->
-          <p-button type="primary" v-if="keyType" @click="handleOk">保存</p-button>
+          <p-button type="primary" @click="getScan">采集监管码</p-button>
+          <p-button type="primary" class="ml-10" v-if="keyType" @click="handleOk">保存</p-button>
         </a-space>
       </div>
       <!-- <p-card :title="title"> -->
@@ -91,19 +92,25 @@
         <!-- </p-card> -->
       </div>
     </p-card>
+    <scanCode v-model="scanVisible" :scanTable="scanTableList" @detail="onDetail" @successScanCode="successScanCode" />
   </p-spin>
 </template>
 
 <script>
-import { DestroyAdd, DestroydelIds } from '../api.js'
+import { DestroyAdd, DestroydelIds, getGspUnqualifiedDestroySupervises } from '../api.js'
 import MainTable from '../components/mainTable'
 import tablecolumns from './config/tableconfjg'
 import pick from 'lodash.pick'
 import { setCargoOwner } from '@/views/kzyWMS/utils/setCargoOwner'
 import { getBusiness } from '@/views/kzyWMS/api/business' // 系统参数接口
+import scanCode from './components/scanCode.vue'
 export default {
   data() {
     return {
+      superviseList:[],      // 监管码数据
+      isScanCodeOk:false, // 是否扫描监管码全部完成
+      scanVisible: false, // 监管码弹框
+      scanTableList:[],   // 传入监管码弹框数据
       spinning:false,
       noTitleKey: 'tab1',
       key: 'tab1',
@@ -131,7 +138,7 @@ export default {
   },
   mixins: [setCargoOwner],
   components: {
-    MainTable
+    MainTable, scanCode
   },
   created() {
     getBusiness().then(res => {
@@ -142,6 +149,13 @@ export default {
     this.SetWarehouse()
   },
   methods: {
+    onDetail(data) {
+      console.log(data,'data');
+      this.superviseList = data
+    },
+    successScanCode(val) {
+      this.isScanCodeOk = val;
+    },
     selectedRowsfun(selectedRowKeys, selectedRow) {
       console.log(selectedRow)
       this.selectedRow = selectedRow
@@ -190,6 +204,12 @@ export default {
               this.$refs[this.tablecolumns.modalItems.ModalItemsOpinion.ref].form.resetFields()
               this.ModalData = []
               this.ModalItemsParams = { ...value }
+              if (res.data) {
+                this.scanTableList = res.data.map(item => item.isSupervise !== 0)
+                if (this.scanTableList.length !== 0) {
+                  this.scanVisible = true;
+                }
+              }
               //   this.$refs.maintable.Sub()
               this.$message.success('保存成功')
             } else {
@@ -238,6 +258,25 @@ export default {
 
       //   this.visible = true
     },
+    getScan() {
+      let par = {
+        warehouseId: this.$store.state.user.warehouse.warehouseId,
+        cargoOwnerId: '',
+        billid: ''
+      }
+      this.spinning = true
+      getGspUnqualifiedDestroySupervises(par).then(res => {
+        this.spinning = false
+        if (res.success) {
+          if (res.data) {
+            this.scanTableList = res.data
+            this.scanVisible = true;
+          }
+        } else {
+          this.$message.error(res.message)
+        }
+      })
+    },
     handleOk(e) {
       this.save()
     },

+ 1 - 0
upcloud-wms-qingniu-web/src/views/kzyWMS/bound/replenishment/accord.vue

@@ -125,6 +125,7 @@ export default {
   },
 
   created() {
+    this.getSwatichValue(this.$store.getters.warehouse.warehouseId);
     this.columns = sorter(columns);
     this.columns2 = sorter(columns2);
   },

+ 1 - 0
upcloud-wms-qingniu-web/src/views/kzyWMS/bound/replenishment/config/accord.js

@@ -90,6 +90,7 @@ const columns =  [
   ]
 const columns2 =  [
     { type: "txt", dataIndex: 'cargoOwnerName', title: '货主名称', key: 'cargoOwnerName' },
+    { type: "txt", dataIndex: 'itemHealthIndustry', title: '行业线', key: 'itemHealthIndustry' },
     { type: "txt",dataIndex: 'itemHealthCategoryName', title: '商品分类', key: 'itemHealthCategoryName' },
     { type: "txt",dataIndex: 'itemName', title: '商品名称', key: 'itemName' },
     { type: "txt", dataIndex: 'itemCode', title: '商品编码', key: 'itemCode' },

+ 8 - 0
upcloud-wms-qingniu-web/src/views/kzyWMS/outBound/api/api.js

@@ -294,3 +294,11 @@ export function getSwatichValue(params) {
     params: params,
   });
 }
+
+export function saveContainerCode(data) {
+  return request({
+    url: upcloud_base_wh_outbound + "/outboundOrderLine/saveContainerCode",
+    method: "post",
+    data,
+  });
+}

+ 32 - 1
upcloud-wms-qingniu-web/src/views/kzyWMS/outBound/config/create1.js

@@ -1,7 +1,37 @@
 import { remote, remote2 } from "./remote";
 import moment from "moment";
 import { genBranchAuthSearchModal, genCargoownerAuthSearchModal, genCustomerSearchModal } from "@/views/kzyWMS/SearchModal";
-import { upcloud_base_common, upcloud_base_inventory, upcloud_base_chain } from "@/config/serviceSettings";
+import { upcloud_base_common, upcloud_base_inventory, upcloud_base_chain, upcloud_base_wh_outbound } from "@/config/serviceSettings";
+
+const containerData = {
+  type: 'searchModal',
+  name: 'containerCode',
+  label: '容器号',
+  required: true,
+  remoteUrl: { url: upcloud_base_wh_outbound + '/wave/bill/getEisStockContainerNos', method: 'get' },
+  rowKey: 'id',
+  targetValueKey: 'containerCode',
+  required: true, 
+  remoteBefore(p1, p2) {
+    console.log(p1,'p1');
+    console.log(p2, 'p2');
+    p1.columns
+    // let data = p2.data
+    // // p2.data.itemId = 
+    // // p2.data.lotId = 
+    // delete data.pageNum;
+    // delete data.pageSize;
+    return p2; 
+  },
+  tableConfig: {
+    columns: [
+      {
+        dataIndex: 'containerSubNo',
+        title: '容器号'
+      },
+    ]
+  },
+}
 
 // 批号弹窗
 const getLOTItems = (changeFun, remoteBeforeFun, modalOpenChange) => {
@@ -754,6 +784,7 @@ const singleColumns = (self) => {
     { type: "txt", dataIndex: "packUnits", title: "包装单位", width: 150 },
     { type: "txt", dataIndex: "lotNo", title: "批号", width: 150 },
     { type: "txt", dataIndex: "pdateFrom", title: "生产日期", width: 150 },
+    { type: "txt", dataIndex: "containerCode", title: "容器号", width: 150, scopedSlots: { customRender: "container" }, },
     // { type: "txt", dataIndex: "locatorId", title: "货位", width: 150, scopedSlots: { customRender: "locatorslot" } },
     // { type: "txt", dataIndex: "containerCode", title: "托盘", width: 150 },
 

+ 51 - 1
upcloud-wms-qingniu-web/src/views/kzyWMS/outBound/schedule/create.vue

@@ -73,7 +73,27 @@
         bordered
       >
         <a-table-column data-index="sysCarrierCode" title="系统承运商编码" />
-
+        <template slot="container" slot-scope="text, record">
+          <p-search-modal
+                v-if="record.billtype == '2'"
+                title="容器号"
+                :v-model="record.containerCode"
+                :target-click="true"
+                :remoteUrl="{ url: upcloud_base_wh_outbound + `/wave/bill/getEisStockContainerNos?itemId=${record.itemid}&lotId=${record.batchNo}&itemQty=${record.itemQty}&zsFlag=${record.zsFlag}`, method: 'get' }"
+                targetValueKey="containerSubNo"
+                rowKey="id"
+                :tableConfig="{
+                  columns: [
+                    { dataIndex: 'containerSubNo', title: '容器号' },
+                    { dataIndex: 'useStockCount', title: '库存数量' },
+                  ]
+                }"
+                :pagination="false"
+                :remoteBefore="remoteBefore"
+                @change="(event, value) => onChange(record, event, value)"
+              />
+              <span v-else>{{ record.containerCode }}</span>
+        </template>
         <template slot="action" slot-scope="text, record">
           <!-- <a style="margin: 0 5px" @click.stop="saveItemDet(record)">保存</a> -->
           <a style="margin: 0 5px" v-action:view @click.stop="itemDet(record)">商品详情</a>
@@ -108,6 +128,7 @@ import {
   getConfig,
   updateByCode,
   getSwatichValue,
+  saveContainerCode,
 } from "../api/api.js";
 import { diffOption } from "@/views/kzyWMS/utils/index.js";
 import { sorter } from "@/views/kzyWMS/utils/sort.js";
@@ -123,6 +144,8 @@ export default {
   components: { HCdetailDialog, itemDetail, workerLogin, detailspilt },
   data() {
     return {
+      row: {},
+      upcloud_base_wh_outbound,
       regValue: "1",
       items: null,
       loginVisible: false,
@@ -193,6 +216,29 @@ export default {
     },
   },
   methods: {
+    onChange(row, event, value) {
+      console.log(row,'row');
+      row.containerCode = value
+      let par = {
+        lineid: row.lineid,
+        containerCode: row.containerCode,
+      }
+      saveContainerCode(par).then(res => {
+        if (res.success) {
+          this.$message.success(res.message)
+          this.clickRow(null,null,this.row)
+        } else {
+          this.$message.error(res.message)
+        }
+      })
+    },
+    remoteBefore(p1,p2) {
+      console.log(p1,'p1');
+      console.log(p2, 'p2');
+      delete p2.params.pageNum
+      delete p2.params.pageSize
+      return p2; 
+    },
     async getSwatichValue(warehouseId) {
       //   console.log(warehouseId, "warehouseId===");
       if (!warehouseId) return;
@@ -424,6 +470,7 @@ export default {
       this.loginVisible = false;
     },
     async clickRow(event, activeID, row) {
+      this.row = row
       this.$refs.logTable.vLoading = true;
 
       this.spinning = true;
@@ -436,6 +483,9 @@ export default {
       //   redomsItembillQuery(params)
       if (res.success) {
         const { list } = res.data;
+        list.forEach(item => {
+          item.billtype = row.billtype
+        })
         this.singleData = list;
       }
       this.spinning = false;

+ 1 - 1
upcloud-wms-qingniu-web/vue.config.js

@@ -163,7 +163,7 @@ const vueConfig = {
         },
       },
         "^/qneis_": {
-          target: "http://192.168.41.208:10019",
+          target: "http://192.168.40.96:10019",
           pathRewrite: {
             "^/qneis_": "",
           },