andy 3 éve
szülő
commit
faebb09e71

+ 20 - 17
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/LineCallController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.web.controller.warewms.ams;
 
+import com.alibaba.fastjson.JSON;
 import com.ruoyi.ams.config.domain.dto.AgvCallDTO;
 import com.ruoyi.ams.config.domain.dto.LotattDTO;
 import com.ruoyi.ams.business.IBusinessService;
@@ -34,26 +35,28 @@ public class LineCallController {
     }
 
     @PostMapping("exec")
-    public AjaxResult exec(@RequestBody LineCallForm lineCallForm) {
+    public AjaxResult exec(@RequestBody List<LineCallForm> lineCallForm) {
         List<AgvCallDTO> list = new ArrayList<>();
-        AgvCallDTO agvCallDTO = new AgvCallDTO();
-        agvCallDTO.setLocationFrom(lineCallForm.getLocationFrom());
-        agvCallDTO.setLocationTo(lineCallForm.getLocationTo());
-        agvCallDTO.setSku(lineCallForm.getSku());
-        agvCallDTO.setWarehouseId(1L);//没用暂时写死
-        agvCallDTO.setQty(lineCallForm.getQty());
-        agvCallDTO.setSupplier(lineCallForm.getSupplier());
-        agvCallDTO.setWeight(lineCallForm.getWeight());
-        agvCallDTO.setId(lineCallForm.getId());
-        LotattDTO lotattDTO = new LotattDTO();
-        List<LineCallDetailsForm> lineCallDetailsForms = lineCallForm.getLineCallDetailsFormList();
-        if (lineCallDetailsForms != null && lineCallDetailsForms.size() > 0) {
-            for (LineCallDetailsForm detailsForm : lineCallDetailsForms) {
-                lotattDTO.setAttr(detailsForm.getLotattId(), detailsForm.getLotattValue());
+        for(LineCallForm lform : lineCallForm) {
+            AgvCallDTO agvCallDTO = new AgvCallDTO();
+            agvCallDTO.setLocationFrom(lform.getLocationFrom());
+            agvCallDTO.setLocationTo(lform.getLocationTo());
+            agvCallDTO.setSku(lform.getSku());
+            agvCallDTO.setWarehouseId(1L);//没用暂时写死
+            agvCallDTO.setQty(lform.getQty());
+            agvCallDTO.setSupplier(lform.getSupplier());
+            agvCallDTO.setWeight(lform.getWeight());
+            agvCallDTO.setId(lform.getId());
+            LotattDTO lotattDTO = new LotattDTO();
+            List<LineCallDetailsForm> lineCallDetailsForms = lform.getLineCallDetailsFormList();
+            if (lineCallDetailsForms != null && lineCallDetailsForms.size() > 0) {
+                for (LineCallDetailsForm detailsForm : lineCallDetailsForms) {
+                    lotattDTO.setAttr(detailsForm.getLotattId(), detailsForm.getLotattValue());
+                }
             }
+            agvCallDTO.setLotattDTO(lotattDTO);
+            list.add(agvCallDTO);
         }
-        agvCallDTO.setLotattDTO(lotattDTO);
-        list.add(agvCallDTO);
         return businessService.agvCall(list);
     }
 }

+ 5 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/LotattConfigController.java

@@ -101,6 +101,11 @@ public class LotattConfigController extends BaseController {
         return AjaxResult.success(lotattConfigService.queryLotattConfigList());
     }
 
+    @GetMapping("/queryLotattConfigListActive")
+    public AjaxResult queryLotattConfigListActive() {
+        return AjaxResult.success(lotattConfigService.queryLotattConfigListActive());
+    }
+
     @GetMapping("/lotattConfigComboDict")
     public AjaxResult lotattConfigComboDict() {
         return AjaxResult.success(lotattConfigService.lotattConfigComboDict());

+ 9 - 0
ruoyi-ui/src/api/ams/flowConfig.js

@@ -52,6 +52,15 @@ export function listLotattConfig(query) {
   })
 }
 
+// 查询所有显示批次属性配置明细
+export function queryLotattConfigListActive(query) {
+  return request({
+    url: '/ams/config/queryLotattConfigListActive',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询流程配置中的批次属性
 export function flowConfigLotatt(id) {
   return request({

+ 3 - 0
ruoyi-ui/src/api/ams/wcsTask.js

@@ -43,6 +43,7 @@ export function delWcsTask(taskNo) {
   })
 }
 
+//完成任务
 export function completeWcsTask(taskNo) {
   return request({
     url: '/ams/wcsTask/taskComplete/' + taskNo,
@@ -50,6 +51,7 @@ export function completeWcsTask(taskNo) {
   })
 }
 
+//取消任务
 export function taskCancel(taskNo) {
   return request({
     url: '/ams/wcsTask/taskCancel/' + taskNo,
@@ -57,6 +59,7 @@ export function taskCancel(taskNo) {
   })
 }
 
+//库存清空
 export function invDisposition(taskNo, result) {
   return request({
     url: '/ams/wcsTask/invDisposition',

+ 7 - 6
ruoyi-ui/src/views/ams/flowConfig/index.vue

@@ -323,7 +323,7 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <!--<el-divider content-position="center">批次属性信息</el-divider>
+        <el-divider content-position="center">批次属性信息</el-divider>
         <el-table :data="flowConfigDetailsList" :row-class-name="rowFlowConfigDetailsIndex" @selection-change="handleFlowConfigDetailsSelectionChange" ref="flowConfigDetails">
           <el-table-column label="序号" align="center" prop="index" width="50"/>
           <el-table-column label="批次属性" prop="lotattId">
@@ -344,7 +344,7 @@
             </template>
           </el-table-column>
           <el-table-column label="备注" prop="remark"></el-table-column>
-        </el-table>-->
+        </el-table>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -355,7 +355,7 @@
 </template>
 
 <script>
-import { listFlowConfig, getFlowConfig, delFlowConfig, addFlowConfig, updateFlowConfig, listLotattConfig } from "@/api/ams/flowConfig";
+import { listFlowConfig, getFlowConfig, delFlowConfig, addFlowConfig, updateFlowConfig, queryLotattConfigListActive } from "@/api/ams/flowConfig";
 import { querySkuTypeDict } from "@/api/base/skuType";
 import { treeselectLocationZone } from "@/api/base/locationZone";
 import { querySupplierDict } from "@/api/base/supplier";
@@ -507,7 +507,7 @@ export default {
       this.open = true;
       this.title = "添加流程配置";
       // 加载批次属性明细
-      listLotattConfig(this.queryParams).then(response => {
+      queryLotattConfigListActive(this.queryParams).then(response => {
         this.flowConfigDetailsList = response.data;
       });
 
@@ -552,6 +552,7 @@ export default {
       }
       this.$refs["form"].validate(valid => {
         if (valid) {
+          this.form.flowConfigDetailsList = this.flowConfigDetailsList;
           if (this.form.id != null) {
             updateFlowConfig(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
@@ -619,7 +620,7 @@ export default {
     },
     qtyRangeChange(e) {
       // 范围变更检测
-      if (e !== '') {
+      if (e !== '' && e !== null) {
         let r = /^\d+(\.\d+)?$/  //小数
         let flag = r.test(e);
         if (flag) {
@@ -635,7 +636,7 @@ export default {
     },
     weightRangeChange(e) {
       // 范围变更检测
-      if (e !== '') {
+      if (e !== '' && e !== null) {
         let r = /^\d+(\.\d+)?$/  //小数
         let flag = r.test(e);
         if (flag) {

+ 2 - 0
ruoyi-ui/src/views/ams/inv/locationView/index.vue

@@ -39,6 +39,8 @@
           <div v-if="!item.locationNo" style="background-color: #fff;"><!--空格没有的库位--></div>
           <div class="div" v-else-if="item.stockStatus === '10'" style="background-color: yellow">
             <div style="text-align: center;font-weight: bold;">{{item.locationNo}}</div>
+            <div v-if="item.sku">物料:{{item.sku}}</div>
+            <div v-if="item.sku">数量:{{item.qty}}</div>
           </div>
           <div class="div" v-else style="background-color: #ebf0f4">
             <div style="text-align: center;font-weight: bold;">{{item.locationNo}}</div>

+ 135 - 80
ruoyi-ui/src/views/ams/lineCall/index.vue

@@ -16,52 +16,6 @@
       </el-form-item>
     </el-form>
 
-    <!--<el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['ams:flowConfig:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['ams:flowConfig:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['ams:flowConfig:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['ams:flowConfig:export']"
-        >导出</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>-->
-
     <el-table v-loading="loading" :data="flowConfigList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="编号" align="center" prop="id"/>
@@ -117,7 +71,7 @@
             <el-option
               v-for="dict in skuTypeCombo"
               :key="dict.sku"
-              :label="dict.desc1"
+              :label="dict.sku + '-' + dict.desc1"
               :value="dict.sku"
             />
           </el-select>
@@ -128,7 +82,7 @@
         <el-form-item label="重量" prop="weight" v-if="form.weightFlag !== 'Hidden'">
           <el-input v-model="form.weight" :placeholder="`输入范围${form.weightMin}-${form.weightMax}`" type="number"/>
         </el-form-item>
-        <el-form-item label="供应商" prop="supplier" v-if="form.supplierFlag !== 'Hidden'">
+        <!--<el-form-item label="供应商" prop="supplier" v-if="form.supplierFlag !== 'Hidden'">
           <el-select style="width: 100%" v-model="form.supplier" placeholder="请选择供应商" clearable size="small">
             <el-option
               v-for="dict in supplierCombo"
@@ -137,7 +91,7 @@
               :value="dict.supplierId"
             />
           </el-select>
-        </el-form-item>
+        </el-form-item>-->
         <div style="cursor: pointer;" @click="showHidden">
           <el-divider content-position="center">批次属性信息</el-divider>
         </div>
@@ -146,37 +100,31 @@
           <el-table-column label="序号" align="center" prop="index" width="50"/>
           <el-table-column label="批次属性" prop="lotattId">
             <template slot-scope="scope">
-              {{scope.row.lotattName}}
+              <div style="display: inline-block;width: 10px;color:red;">
+                <div v-show="scope.row.lotattFlag === 'Required'">*</div>
+              </div>
+              <div style="display: inline-block;width: 185px;">
+                {{scope.row.lotattName}}
+              </div>
             </template>
           </el-table-column>
           <el-table-column label="属性值" prop="lotattValue">
             <template slot-scope="scope">
               <div v-if="scope.row.inputType === 'Text'">
-                <div style="display: inline-block;width: 25px;color:red;">
-                  <div v-show="scope.row.lotattFlag === 'Required'">*</div>
-                </div>
-                <div style="display: inline-block;width: 185px;"><el-input v-model="scope.row.lotattValue" placeholder=""/></div>
+                <el-input v-model="scope.row.lotattValue" placeholder=""/>
               </div>
               <div v-if="scope.row.inputType === 'DateBox'">
-                <div style="display: inline-block;width: 25px;color:red;">
-                  <div v-show="scope.row.lotattFlag === 'Required'">*</div>
-                </div>
-                <div style="display: inline-block;width: 185px;"><el-date-picker v-model="scope.row.lotattValue" type="date" placeholder="" style="width: 100%" value-format="yyyy-MM-dd"/></div>
+                <el-date-picker v-model="scope.row.lotattValue" type="date" placeholder="" style="width: 100%" value-format="yyyy-MM-dd"/>
               </div>
               <div v-if="scope.row.inputType === 'ComboBox'">
-                <div style="display: inline-block;width: 25px;color:red;">
-                  <div v-show="scope.row.lotattFlag === 'Required'">*</div>
-                </div>
-                <div style="display: inline-block;width: 185px;">
-                  <el-select v-model="scope.row.lotattValue" placeholder="请选择" clearable size="small" style="width: 100%">
-                    <el-option
-                      v-for="dict in dict.type[scope.row.inputScope]"
-                      :key="dict.value"
-                      :label="dict.label"
-                      :value="dict.value"
-                    />
-                  </el-select>
-                </div>
+                <el-select v-model="scope.row.lotattValue" placeholder="请选择" clearable size="small" style="width: 100%">
+                  <el-option
+                    v-for="dict in dict.type[scope.row.inputScope]"
+                    :key="dict.value"
+                    :label="dict.label"
+                    :value="dict.value"
+                  />
+                </el-select>
               </div>
             </template>
           </el-table-column>
@@ -191,10 +139,37 @@
             />
           </el-select>
         </el-form-item>
+        <div style="cursor: pointer;">
+          <el-divider content-position="center">呼叫明细</el-divider>
+        </div>
+        <el-table :data="subData" :row-class-name="rowFlowConfigDetailsIndex"
+                  @selection-change="handleFlowConfigDetailsSelectionChange" ref="flowConfigDetails">
+          <el-table-column label="操作">
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-delete"
+                @click="delDetail(scope.$index)"
+                v-hasPermi="['ams:flowConfig:edit']"
+              >删除</el-button>
+            </template>
+          </el-table-column>
+          <el-table-column label="物料" prop="sku" width="200"/>
+          <el-table-column label="数量" prop="qty"/>
+          <el-table-column label="重量" prop="weight"/>
+          <el-table-column
+            v-for="(item, index) in tableOption"
+            :key="index"
+            :label="item.label"
+            align="center" :prop="item.prop" width="200">
+          </el-table-column>
+        </el-table>
       </el-form>
       <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="addDetail">添 加</el-button>
         <el-button type="primary" @click="submitForm">执 行</el-button>
-        <el-button @click="cancel">取 消</el-button>
+        <el-button type="primary" @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
   </div>
@@ -219,6 +194,7 @@
   import {querySupplierDict} from "@/api/base/supplier";
   import {treeselect} from "@/api/base/locationInfo";
   import {inputTag} from "@/utils/combo/dict";
+  import { lotattConfigList } from "@/api/ams/config";
 
   export default {
     name: "FlowConfig",
@@ -268,14 +244,28 @@
         locationToOptions: undefined,
         locationFromCombo: undefined,
         locationToCombo: undefined,
-        attShowFlag: false
+        attShowFlag: false,
+        tableOption: [],
+        subData: []
       };
     },
     created() {
+      this.initLotatt();
       this.init();
       this.getList();
     },
     methods: {
+      initLotatt() {
+        lotattConfigList().then(response => {
+          let data = response.data
+          for(let i=0;i<data.length;i++) {
+            let obj = new Object();
+            obj.label = data[i].lotattName
+            obj.prop = data[i].lotattId
+            this.tableOption.push(obj)
+          }
+        })
+      },
       /** 查询流程配置头列表 */
       getList() {
         this.loading = true;
@@ -371,37 +361,37 @@
 
           if (this.form.locationFromFlag === 'Required') {
             this.rules.locationFrom = [
-              {required: true, message: "起始库位不能为空", trigger: "blur"}
+              {required: true, message: "*", trigger: "blur"}
             ]
           }
 
           if (this.form.skuTypeFlag === 'Required') {
             this.rules.sku = [
-              {required: true, message: "物料不能为空", trigger: "blur"}
+              {required: true, message: "*", trigger: "blur"}
             ]
           }
 
           if (this.form.qtyFlag === 'Required') {
             this.rules.qty = [
-              {required: true, message: "数量不能为空", trigger: "blur"}
+              {required: true, message: "*", trigger: "blur"}
             ]
           }
 
           if (this.form.weightFlag === 'Required') {
             this.rules.weight = [
-              {required: true, message: "重量不能为空", trigger: "blur"}
+              {required: true, message: "*", trigger: "blur"}
             ]
           }
 
           if (this.form.supplierFlag === 'Required') {
             this.rules.supplier = [
-              {required: true, message: "供应商不能为空", trigger: "blur"}
+              {required: true, message: "*", trigger: "blur"}
             ]
           }
 
           if (this.form.locationToFlag === 'Required') {
             this.rules.locationTo = [
-              {required: true, message: "目标库位不能为空", trigger: "blur"}
+              {required: true, message: "*", trigger: "blur"}
             ]
           }
 
@@ -474,8 +464,11 @@
               obj.lotattValue = this.flowConfigDetailsList[i].lotattValue
               lineCallDetailsFormList.push(obj)
             }
+            if(this.subData.length == 0) {
+              this.addDetail()
+            }
             this.form.lineCallDetailsFormList = lineCallDetailsFormList
-            exec(this.form).then(response => {
+            exec(this.subData).then(response => {
               if (response.code === 200) {
                 this.$modal.msgSuccess("执行成功");
                 this.open = false;
@@ -535,6 +528,68 @@
       },
       digClose () {
         this.rules = {}
+      },
+      addDetail () {
+        this.$refs["relForm"].validate(valid => {
+          if (valid) {
+            if (this.form.skuTypeFlag === 'Required' && this.form.skuType === '') {
+              this.$modal.msgError("物料必须选择");
+              return
+            }
+            if (this.form.qtyFlag === 'Required' && this.form.qty === null) {
+              this.$modal.msgError("数量必须输入");
+              return
+            } else if (this.form.qtyFlag === 'Required' && (this.form.qtyMin != null || this.form.qtyMax != null)) {
+              if (this.form.qty < this.form.qtyMin) {
+                this.$modal.msgError("数量小于范围:" + this.form.qtyMin);
+                return
+              }
+              if (this.form.qty > this.form.qtyMax) {
+                this.$modal.msgError("数量大于范围:" + this.form.qtyMax);
+                return
+              }
+            }
+            if (this.form.weightFlag === 'Required' && this.form.weight === null) {
+              this.$modal.msgError("重量必须输入");
+              return
+            } else if (this.form.weightFlag === 'Required' && (this.form.weightMin != null || this.form.weightMax != null)) {
+              if (this.form.weight < this.form.weightMin) {
+                this.$modal.msgError("重量小于范围:" + this.form.weightMin);
+                return
+              }
+              if (this.form.weight > this.form.weightMax) {
+                this.$modal.msgError("重量大于范围:" + this.form.weightMax);
+                return
+              }
+            }
+            if (this.form.supplierFlag === 'Required' && this.form.supplier === null) {
+              this.$modal.msgError("供应商必须输入");
+              return
+            }
+            if (this.form.locationFromFlag === 'Required' && this.form.locationFrom === null) {
+              this.$modal.msgError("必须选择起点位置");
+              return
+            }
+            if (this.form.locationToFlag === 'Required' && this.form.locationTo === null) {
+              this.$modal.msgError("必须选择终点位置");
+              return
+            }
+            if (this.flowConfigDetailsList.length > 0) {
+              for (let i = 0; i < this.flowConfigDetailsList.length; i++) {
+                if (this.flowConfigDetailsList[i].lotattFlag === 'Required') {
+                  if(this.flowConfigDetailsList[i].lotattValue === '' || this.flowConfigDetailsList[i].lotattValue === null) {
+                    this.$modal.msgError(this.flowConfigDetailsList[i].lotattName+"必须输入");
+                    return
+                  }
+                }
+              }
+            }
+            this.subData.push(this.form)
+          }
+        });
+      },
+      delDetail (index) {
+        this.subData.splice(index, 1)
       }
     }
   };

+ 47 - 38
warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java

@@ -61,48 +61,57 @@ public class BusinessServiceImpl implements IBusinessService {
     @Transactional
     @Override
     public AjaxResult agvCall(List<AgvCallDTO> agvCallDTOList) {
-        for (AgvCallDTO agvCallDTO : agvCallDTOList) {
-            BaseLocationInfo locationFrom = null;
-            BaseLocationInfo locationTo = null;
+        AgvCallDTO agvCallDTO = new AgvCallDTO();
+        for (AgvCallDTO agvCall : agvCallDTOList) {
+            agvCallDTO.setLocationFrom(agvCall.getLocationFrom());
+            agvCallDTO.setLocationTo(agvCall.getLocationTo());
+            agvCallDTO.setId(agvCall.getId());
+            agvCallDTO.setWarehouseId(agvCall.getWarehouseId());
+            agvCallDTO.setLotattDTO(agvCall.getLotattDTO());
+            break;
+        }
 
-            //查询所属流程
-            FlowConfigHeaderVO flowConfigHeaderVO = flowConfigHeaderService.selectFlowConfigHeaderById(agvCallDTO.getId());
-            AsnSoStrategy asnSoStrategy = asnSoStrategyMapper.selectAsnSoStrategy();
-            if (flowConfigHeaderVO == null) {
-                log.info("-----------指令查询不到对应的流程:" + JSON.toJSONString(agvCallDTO));
-                continue;
-            }
-            List<BaseLocationInfo> locationFromList = this.convertLocation(agvCallDTO.getLocationFrom(), agvCallDTO.getWarehouseId());
-            List<BaseLocationInfo> locationToList = this.convertLocation(agvCallDTO.getLocationTo(), agvCallDTO.getWarehouseId());
+        BaseLocationInfo locationFrom = null;
+        BaseLocationInfo locationTo = null;
 
-            if (flowConfigHeaderVO.getFlowType().equals("ASN")) {
-                locationFrom = this.zoneLocationAllocation(locationFromList, "locationFrom", "ASN", asnSoStrategy, agvCallDTO);
-                locationTo = this.zoneLocationAllocation(locationToList, "locationTo", "ASN", asnSoStrategy, agvCallDTO);
-                //2.初始化库存
-                invLotLocIdService.initInv(agvCallDTO.getLocationFrom(), agvCallDTO.getSku(), Constant.CUSTOMER_ID, agvCallDTO.getQty(), agvCallDTO.getLotattDTO());
-            } else if (flowConfigHeaderVO.getFlowType().equals("SO")) {
-                locationFrom = this.zoneLocationAllocation(locationFromList, "locationFrom", "SO", asnSoStrategy, agvCallDTO);
-                locationTo = this.zoneLocationAllocation(locationToList, "locationTo", "SO", asnSoStrategy, agvCallDTO);
-            } else if (flowConfigHeaderVO.getFlowType().equals("MV")) {
-                locationFrom = this.zoneLocationAllocation(locationFromList, "locationFrom", "MV", asnSoStrategy, agvCallDTO);
-                locationTo = this.zoneLocationAllocation(locationToList, "locationTo", "MV", asnSoStrategy, agvCallDTO);
-            }
+        //查询所属流程
+        FlowConfigHeaderVO flowConfigHeaderVO = flowConfigHeaderService.selectFlowConfigHeaderById(agvCallDTO.getId());
+        AsnSoStrategy asnSoStrategy = asnSoStrategyMapper.selectAsnSoStrategy();
+        if (flowConfigHeaderVO == null) {
+            log.info("-----------指令查询不到对应的流程:" + JSON.toJSONString(agvCallDTOList));
+            return AjaxResult.error("指令查询不到对应的流程");
+        }
+        List<BaseLocationInfo> locationFromList = this.convertLocation(agvCallDTO.getLocationFrom(), agvCallDTO.getWarehouseId());
+        List<BaseLocationInfo> locationToList = this.convertLocation(agvCallDTO.getLocationTo(), agvCallDTO.getWarehouseId());
 
-            String taskNo = System.currentTimeMillis() + "";
-            WcsTask wcsTask = new WcsTask();
-            wcsTask.setTaskNo(taskNo);
-            wcsTask.setAreaFrom(locationFrom.getZoneId().toString());
-            wcsTask.setLocationFrom(locationFrom.getId().toString());
-            wcsTask.setAreaTo(locationTo.getZoneId() + "");
-            wcsTask.setLocationTo(locationTo.getId().toString());
-            wcsTask.setState(9L);
-            wcsTask.setPriority(1L);
-            wcsTask.setCreateDate(new Date());
-            wcsTask.setBusinessType("01");
-            wcsTask.setTaskType("");
-            return businessService.addTask(wcsTask);
+        if (flowConfigHeaderVO.getFlowType().equals("ASN")) {
+            locationFrom = this.zoneLocationAllocation(locationFromList, "locationFrom", "ASN", asnSoStrategy, agvCallDTO);
+            locationTo = this.zoneLocationAllocation(locationToList, "locationTo", "ASN", asnSoStrategy, agvCallDTO);
+            //2.初始化库存
+            for (AgvCallDTO agvCall : agvCallDTOList) {
+                invLotLocIdService.initInv(agvCallDTO.getLocationFrom(), agvCall.getSku(), Constant.CUSTOMER_ID, agvCall.getQty(), agvCall.getLotattDTO());
+            }
+        } else if (flowConfigHeaderVO.getFlowType().equals("SO")) {
+            locationFrom = this.zoneLocationAllocation(locationFromList, "locationFrom", "SO", asnSoStrategy, agvCallDTO);
+            locationTo = this.zoneLocationAllocation(locationToList, "locationTo", "SO", asnSoStrategy, agvCallDTO);
+        } else if (flowConfigHeaderVO.getFlowType().equals("MV")) {
+            locationFrom = this.zoneLocationAllocation(locationFromList, "locationFrom", "MV", asnSoStrategy, agvCallDTO);
+            locationTo = this.zoneLocationAllocation(locationToList, "locationTo", "MV", asnSoStrategy, agvCallDTO);
         }
-        return AjaxResult.error("无效的指令");
+
+        String taskNo = System.currentTimeMillis() + "";
+        WcsTask wcsTask = new WcsTask();
+        wcsTask.setTaskNo(taskNo);
+        wcsTask.setAreaFrom(locationFrom.getZoneId().toString());
+        wcsTask.setLocationFrom(locationFrom.getId().toString());
+        wcsTask.setAreaTo(locationTo.getZoneId() + "");
+        wcsTask.setLocationTo(locationTo.getId().toString());
+        wcsTask.setState(9L);
+        wcsTask.setPriority(1L);
+        wcsTask.setCreateDate(new Date());
+        wcsTask.setBusinessType("01");
+        wcsTask.setTaskType("");
+        return businessService.addTask(wcsTask);
     }
 
     @Transactional

+ 2 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/mapper/LotattConfigMapper.java

@@ -66,6 +66,8 @@ public interface LotattConfigMapper {
      */
     List<LotattConfigVO> queryLotattConfigList();
 
+    List<LotattConfigVO> queryLotattConfigListActive();
+
     /**
      * 查询自定义批次属性所用到的字典表
      * @return

+ 2 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/service/ILotattConfigService.java

@@ -66,6 +66,8 @@ public interface ILotattConfigService
      */
     List<LotattConfigVO> queryLotattConfigList();
 
+    List<LotattConfigVO> queryLotattConfigListActive();
+
     /**
      * 查询自定义批次属性用到的字典表
      * @return

+ 5 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/service/impl/LotattConfigServiceImpl.java

@@ -101,6 +101,11 @@ public class LotattConfigServiceImpl implements ILotattConfigService
         return lotattConfigMapper.queryLotattConfigList();
     }
 
+    @Override
+    public List<LotattConfigVO> queryLotattConfigListActive() {
+        return lotattConfigMapper.queryLotattConfigListActive();
+    }
+
     @Override
     public List<String> lotattConfigComboDict() {
         return lotattConfigMapper.lotattConfigComboDict();

+ 4 - 4
warewms-ams/src/main/resources/mapper/ams/FlowConfigHeaderMapper.xml

@@ -239,9 +239,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </insert>
 
     <select id="selectLotattDetails" parameterType="Long" resultMap="FlowConfigLotattVOResult">
-        select d.lotatt_id,d.required_tag lotatt_flag,d.lotatt_name,d.input_type,d.input_scope,
-        d.default_value lotatt_value
-        from lotatt_config d
-        where d.required_tag &lt;&gt; 'Hidden'
+        select d.lotatt_id,d.lotatt_flag,l.lotatt_name,l.input_type,l.input_scope,l.default_value lotatt_value
+        from flow_config_details d
+        left join lotatt_config l on d.lotatt_id = l.lotatt_id
+        where d.header_id = #{id} and d.lotatt_flag &lt;&gt; 'Hidden'
     </select>
 </mapper>

+ 3 - 1
warewms-ams/src/main/resources/mapper/ams/InvLotLocIdMapper.xml

@@ -270,12 +270,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectInvLocIdLotattList" resultMap="InvLotLocIdLotattResult">
         select
         inv.location_id,sk.sku,sk.desc1 sku_name,b.location_no,inv.qty,inv.qtyallocated
-        ,att.lotnum, att.customer_id, lotatt01, lotatt02, lotatt03, lotatt04, lotatt05, lotatt06, lotatt07, lotatt08, lotatt09, lotatt10, lotatt11, lotatt12, lotatt13, lotatt14, lotatt15, lotatt16, lotatt17, lotatt18
+        ,att.lotnum, att.customer_id, lotatt01, lotatt02, lotatt03, lotatt04,lot05_dict.dict_label lotatt05, supp.supplier_name lotatt06, lotatt07, lotatt08, lotatt09, lotatt10, lotatt11, lotatt12, lotatt13, lotatt14, lotatt15, lotatt16, lotatt17, lotatt18
         from inv_lot_loc_id inv
         left join inv_lot_att att on inv.lotnum = att.lotnum
         left join base_location_info b on inv.location_id = b.id
         left join base_sku sk on inv.sku = sk.sku
         left join base_sku_type skt on sk.sku_type = skt.item_code
+        left join (select dict_label,dict_value from sys_dict_data where dict_type = 'ams_inv_quality') lot05_dict on att.lotatt05 = lot05_dict.dict_value
+        left join (select * from base_supplier) supp on att.lotatt06 = supp.supplier_id
         <where>
             <if test="zoneId != null  and zoneId != ''"> and b.zone_id = #{zoneId}</if>
             <if test="sku != null  and sku != ''"> and (sk.sku like concat('%', #{sku}, '%') or sk.desc1 like concat('%', #{sku}, '%'))</if>

+ 5 - 0
warewms-ams/src/main/resources/mapper/ams/LotattConfigMapper.xml

@@ -114,6 +114,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where status = '0'
     </select>
 
+    <select id="queryLotattConfigListActive" resultMap="LotattConfigVOResult">
+        select lotatt_id,lotatt_name,required_tag lotatt_flag, input_type, input_scope, default_value from lotatt_config
+        where status = '0' and required_tag <![CDATA[ <> ]]> 'Hidden'
+    </select>
+
     <select id="lotattConfigComboDict" resultType="string">
         select input_scope from lotatt_config where input_type = 'ComboBox' and input_scope is not null group by input_scope
     </select>