Przeglądaj źródła

码盘明细增加规格

zhangxin 1 rok temu
rodzic
commit
f88fb7b6b5

+ 23 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/pda/PdaController.java

@@ -42,15 +42,18 @@ import com.ruoyi.ams.order.service.IWmsDocOrderHeaderService;
 import com.ruoyi.ams.order.vo.CheckOutVO;
 import com.ruoyi.ams.order.vo.PickingListVO;
 import com.ruoyi.ams.quality.service.QualityInspectionService;
+import com.ruoyi.ams.stock.dto.PalletOutOfWarehouseDTO;
 import com.ruoyi.ams.stock.service.StockTakeRecordService;
 import com.ruoyi.base.constant.Constant;
 import com.ruoyi.base.domain.BaseLocationInfo;
+import com.ruoyi.base.domain.BaseSku;
 import com.ruoyi.base.domain.form.BasLocationForm;
 import com.ruoyi.base.domain.vo.CodeSkuRelationshipSoVO;
 import com.ruoyi.base.domain.vo.CodeSkuRelationshipVO;
 import com.ruoyi.base.form.SnCheckForm;
 import com.ruoyi.base.form.SnCheckSoForm;
 import com.ruoyi.base.service.IBaseLocationInfoService;
+import com.ruoyi.base.service.IBaseSkuService;
 import com.ruoyi.base.service.ICodeSkuRelationshipService;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.domain.AjaxResult;
@@ -115,6 +118,9 @@ public class PdaController {
     @Autowired
     private IBaseLocationInfoService baseLocationInfoService;
 
+    @Autowired
+    private IBaseSkuService baseSkuService;
+
     @Autowired
     private StockTakeRecordService stockTakeRecordService;
 
@@ -390,11 +396,14 @@ public class PdaController {
         List<WmsDocAsnDetails> detailsList = wmsDocAsnHeaderService.selectStockingList(stockingListForm.getAsnNoList());
         List<stockingDetail> stockingDetailList = new ArrayList<>();
         stockingDetail stockingDetail = null;
+        List<BaseSku> baseSkuList = baseSkuService.queryActiveSkuList(detailsList.stream().map(WmsDocAsnDetails::getSku).collect(Collectors.toList()));
+        Map<String, String> baseSkuMap = baseSkuList.stream().collect(Collectors.toMap(BaseSku::getSku, BaseSku::getModel));
         for (WmsDocAsnDetails wmsDocAsnDetails : detailsList) {
             stockingDetail = new stockingDetail();
             WmsDocAsnHeader wmsDocAsnHeader = wmsDocAsnHeaderService.selectWmsDocAsnHeaderByAsnNo(wmsDocAsnDetails.getAsnNo());
             stockingDetail.setErpNo(wmsDocAsnHeader.getAsnReference1());
             stockingDetail.setSku(wmsDocAsnDetails.getSku());
+            stockingDetail.setModel(baseSkuMap.get(wmsDocAsnDetails.getSku()));
             stockingDetail.setQty(wmsDocAsnDetails.getExpectedQty().toString());
             if (wmsDocAsnDetails.getReceivedQty().compareTo(BigDecimal.ZERO) == 0) {
                 stockingDetail.setReceivingQty("0");
@@ -410,6 +419,8 @@ public class PdaController {
     public static class stockingDetail {
         private String erpNo;
         private String sku;
+
+        private String model;
         private String qty;
         private String receivingQty;
 
@@ -421,6 +432,14 @@ public class PdaController {
             this.erpNo = erpNo;
         }
 
+        public String getModel() {
+            return model;
+        }
+
+        public void setModel(String model) {
+            this.model = model;
+        }
+
         public String getSku() {
             return sku;
         }
@@ -615,13 +634,13 @@ public class PdaController {
 
     /**
      * PDA盘点托盘出库
-     * @param palletNos
+     * @param palletOutOfWarehouseDTO
      * @return
      */
     @PostMapping("/stockTake/palletOutOfWarehouse")
-    public AjaxResult palletOutOfWarehouse(@RequestParam String palletNos) {
-        List<String> palletNoList = JSONArray.parseArray(palletNos, String.class);
-        stockTakeRecordService.palletOutOfWarehouse(palletNoList);
+    public AjaxResult palletOutOfWarehouse(@RequestBody PalletOutOfWarehouseDTO palletOutOfWarehouseDTO) {
+//        List<String> palletNoList = JSONArray.parseArray(palletNos, String.class);
+        stockTakeRecordService.palletOutOfWarehouse(palletOutOfWarehouseDTO);
         return AjaxResult.success();
     }