andy vor 3 Jahren
Ursprung
Commit
3d2fe7c00b

+ 3 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/LineCallController.java

@@ -41,13 +41,10 @@ public class LineCallController {
         agvCallDTO.setLocationFrom(lineCallForm.getLocationFrom());
         agvCallDTO.setLocationTo(lineCallForm.getLocationTo());
         agvCallDTO.setSku(lineCallForm.getSku());
-        if (!StringUtils.isEmpty(lineCallForm.getQty())) {
-            agvCallDTO.setQty(Double.parseDouble(lineCallForm.getQty()));
-        }
+        agvCallDTO.setWarehouseId(1);
+        agvCallDTO.setQty(lineCallForm.getQty());
         agvCallDTO.setSupplier(lineCallForm.getSupplier());
-        if (!StringUtils.isEmpty(lineCallForm.getWeight())) {
-            agvCallDTO.setWeight(Double.parseDouble(lineCallForm.getWeight()));
-        }
+        agvCallDTO.setWeight(lineCallForm.getWeight());
         agvCallDTO.setWarehouseId(1);
         LotattDTO lotattDTO = new LotattDTO();
         List<LineCallDetailsForm> lineCallDetailsForms = lineCallForm.getLineCallDetailsFormList();

+ 10 - 2
ruoyi-admin/src/test/java/com/ruoyi/admin/test/base/WarehouseTest.java

@@ -7,6 +7,7 @@ import com.ruoyi.ams.business.IBusinessService;
 import com.ruoyi.ams.config.service.LocationAllocationStrategy;
 import com.ruoyi.base.domain.BaseLocationInfo;
 import com.ruoyi.base.domain.BaseWarehouse;
+import com.ruoyi.base.mapper.BaseSkuMapper;
 import com.ruoyi.base.service.IBaseWarehouseService;
 import com.ruoyi.base.service.SysIdsequenceService;
 import org.junit.Test;
@@ -15,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -34,6 +36,8 @@ public class WarehouseTest {
     private IBusinessService businessService;
     @Autowired
     private SysIdsequenceService sysIdsequenceService;
+    @Autowired
+    private BaseSkuMapper baseSkuMapper;
 
     @Test
     public void test() {
@@ -55,7 +59,11 @@ public class WarehouseTest {
 
     @Test
     public void test2() {
-        String str = sysIdsequenceService.generateId("ASNNO");
-        System.out.println(str);
+        //String str = sysIdsequenceService.generateId("ASNNO");
+        //System.out.println(str);
+        List<String> arr = new ArrayList<>();
+        arr.add("1");
+        arr.add("2");
+        baseSkuMapper.selectBaseSkuBySkuTypeList(null);
     }
 }

+ 9 - 12
ruoyi-ui/src/views/ams/lineCall/index.vue

@@ -102,13 +102,13 @@
     <!-- 添加或修改流程配置头对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="物料" prop="skuType" v-if="form.skuTypeFlag !== 'Hidden'">
-          <el-select style="width: 100%" v-model="form.skuType" placeholder="请选择物料" clearable size="small">
+        <el-form-item label="物料" prop="sku" v-if="form.skuTypeFlag !== 'Hidden'">
+          <el-select style="width: 100%" v-model="form.sku" placeholder="请选择物料" clearable size="small">
             <el-option
               v-for="dict in skuTypeCombo"
-              :key="dict.itemCode"
-              :label="dict.itemName"
-              :value="dict.itemCode"
+              :key="dict.sku"
+              :label="dict.desc1"
+              :value="dict.sku"
             />
           </el-select>
         </el-form-item>
@@ -196,7 +196,7 @@
     flowConfigLotatt
   } from "@/api/ams/flowConfig";
   import {choseFlow, exec} from "@/api/ams/lineCall";
-  import {querySkuTypeDict} from "@/api/base/skuType";
+  import {querySkuDict} from "@/api/base/baseSku";
   import {querySupplierDict} from "@/api/base/supplier";
   import {treeselect} from "@/api/base/locationInfo";
   import {inputTag} from "@/utils/combo/dict";
@@ -279,7 +279,7 @@
         this.form = {
           id: null,
           flowName: null,
-          skuType: '',
+          sku: '',
           skuTypeFlag: 'Choice',
           qty: null,
           qtyFlag: 'Choice',
@@ -336,6 +336,7 @@
           this.form.qtyFlag = response.qtyFlag
           this.form.weightFlag = response.weightFlag
           this.form.supplierFlag = response.supplierFlag
+          this.skuTypeCombo = response.skuList;
           this.open = true;
           this.title = "线边呼叫";
         });
@@ -379,6 +380,7 @@
               lineCallDetailsFormList.push(obj)
             }
             this.form.lineCallDetailsFormList = lineCallDetailsFormList
+            console.log(this.form)
             exec(this.form).then(response => {
               if (response.code === 200) {
                 this.$modal.msgSuccess("执行成功");
@@ -424,11 +426,6 @@
         return data.label.indexOf(value) !== -1;
       },
       init() {
-        // 初始化物料分类
-        querySkuTypeDict().then(response => {
-          this.skuTypeCombo = response.data;
-        });
-
         // 初始化供应商
         querySupplierDict().then(response => {
           this.supplierCombo = response.data;

+ 8 - 0
warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java

@@ -54,6 +54,14 @@ public class BusinessServiceImpl implements IBusinessService {
                 //1.分配库位
                 BaseLocationInfo locationFrom = baseLocationInfoService.selectBaseLocationInfoById(Long.parseLong(agvCallDTO.getLocationFrom()));
                 InWarehouseDTO inWarehouseDTO = new InWarehouseDTO();
+                inWarehouseDTO.setWarehouseId((long)agvCallDTO.getWarehouseId());
+                inWarehouseDTO.setSku(agvCallDTO.getSku());
+                inWarehouseDTO.setLocationTo(agvCallDTO.getLocationTo());
+                inWarehouseDTO.setLocationFrom(agvCallDTO.getLocationFrom());
+                inWarehouseDTO.setQty(agvCallDTO.getQty());
+                inWarehouseDTO.setSupplier(agvCallDTO.getSupplier());
+                inWarehouseDTO.setWeight(agvCallDTO.getWeight());
+                inWarehouseDTO.setLotattDTO(agvCallDTO.getLotattDTO());
                 BaseLocationInfo locationInfo = inLocationAllocation(inWarehouseDTO);
                 if (locationInfo == null) {
                     throw new RuntimeException("没有可以分配的库位");

+ 2 - 0
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/impl/InvLotLocIdServiceImpl.java

@@ -137,6 +137,8 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService
         BeanUtils.copyProperties(lotattDTO,invLotAtt);
         String lotnum = sysIdsequenceService.generateId("LOTNUMBER");
         invLotAtt.setLotnum(lotnum);
+        invLotAtt.setSku(sku);
+        invLotAtt.setCustomerId(customerId);
         invLotAtt.setCreateTime(DateUtils.getNowDate());
         invLotAttMapper.insertInvLotAtt(invLotAtt);
 

+ 6 - 6
warewms-ams/src/main/java/com/ruoyi/ams/lineCall/domain/form/LineCallForm.java

@@ -10,8 +10,8 @@ import java.util.List;
 public class LineCallForm {
 
     private String sku;
-    private String qty;
-    private String weight;
+    private Double qty;
+    private Double weight;
     private String supplier;
     private String locationFrom;
     private String locationTo;
@@ -25,19 +25,19 @@ public class LineCallForm {
         this.sku = sku;
     }
 
-    public String getQty() {
+    public Double getQty() {
         return qty;
     }
 
-    public void setQty(String qty) {
+    public void setQty(Double qty) {
         this.qty = qty;
     }
 
-    public String getWeight() {
+    public Double getWeight() {
         return weight;
     }
 
-    public void setWeight(String weight) {
+    public void setWeight(Double weight) {
         this.weight = weight;
     }
 

+ 10 - 3
warewms-ams/src/main/java/com/ruoyi/ams/lineCall/service/impl/LineCallServiceImpl.java

@@ -8,10 +8,12 @@ import com.ruoyi.base.domain.BaseLocationInfo;
 import com.ruoyi.base.domain.BaseSku;
 import com.ruoyi.base.service.IBaseLocationInfoService;
 import com.ruoyi.base.service.IBaseSkuService;
+import com.ruoyi.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -36,9 +38,14 @@ public class LineCallServiceImpl implements ILineCallService {
         if (flowConfigHeaderVO == null) {
             throw new RuntimeException(String.format("ID:%d的流程不存在", flowConfigId));
         }
-        BaseSku skuQuery = new BaseSku();
-        skuQuery.setSkuType(flowConfigHeaderVO.getSkuType());
-        List<BaseSku> skuList = baseSkuService.selectBaseSkuList(skuQuery);
+        List<BaseSku> skuList;
+        if (!StringUtils.isEmpty(flowConfigHeaderVO.getSkuType())) {
+            List<String> arr = Arrays.asList(flowConfigHeaderVO.getSkuType().split(","));
+            skuList = baseSkuService.selectBaseSkuBySkuTypeList(arr);
+        } else {
+            skuList = baseSkuService.selectBaseSkuBySkuTypeList(null);
+        }
+
         //返回前端的字典
         List<BaseLocationInfo> locationFromList = new ArrayList<>();
         List<BaseLocationInfo> locationToList = new ArrayList<>();

+ 7 - 0
warewms-base/src/main/java/com/ruoyi/base/mapper/BaseSkuMapper.java

@@ -58,4 +58,11 @@ public interface BaseSkuMapper
      * @return 结果
      */
      int deleteBaseSkuByCustomerIds(String[] customerIds);
+
+    /**
+     * 根据物料类型查询物料
+     * @param list
+     * @return
+     */
+     List<BaseSku> selectBaseSkuBySkuTypeList(List<String> list);
 }

+ 7 - 0
warewms-base/src/main/java/com/ruoyi/base/service/IBaseSkuService.java

@@ -58,4 +58,11 @@ public interface IBaseSkuService
      * @return 结果
      */
      int deleteBaseSkuByCustomerId(String customerId);
+
+    /**
+     * 物料类型查询物料
+     * @param list
+     * @return
+     */
+     List<BaseSku> selectBaseSkuBySkuTypeList(List<String> list);
 }

+ 5 - 0
warewms-base/src/main/java/com/ruoyi/base/service/impl/BaseSkuServiceImpl.java

@@ -93,4 +93,9 @@ public class BaseSkuServiceImpl implements IBaseSkuService
     {
         return baseSkuMapper.deleteBaseSkuByCustomerId(customerId);
     }
+
+    @Override
+    public List<BaseSku> selectBaseSkuBySkuTypeList(List<String> list) {
+        return baseSkuMapper.selectBaseSkuBySkuTypeList(list);
+    }
 }

Datei-Diff unterdrückt, da er zu groß ist
+ 12 - 0
warewms-base/src/main/resources/mapper/base/BaseSkuMapper.xml