Browse Source

bug修复

andy 3 years ago
parent
commit
cc06439e30

+ 6 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/FlowConfigHeaderController.java

@@ -72,7 +72,12 @@ public class FlowConfigHeaderController extends BaseController {
         FlowConfigVO flowConfigVO = new FlowConfigVO();
         BeanUtils.copyProperties(headerVO, flowConfigVO);
         if (!StringUtils.isEmpty(headerVO.getSkuType())) {
-            flowConfigVO.setSkuType(headerVO.getSkuType().split(","));
+            String[] arr = headerVO.getSkuType().split(",");
+            Long[] arr2 = new Long[arr.length];
+            for (int i = 0; i < arr.length; i++) {
+                arr2[i] = Long.parseLong(arr[i]);
+            }
+            flowConfigVO.setSkuType(arr2);
         }
         if (!StringUtils.isEmpty(headerVO.getSupplier())) {
             flowConfigVO.setSupplierRange(headerVO.getSupplier().split(","));

+ 8 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/base/BaseLocationZoneController.java

@@ -113,4 +113,12 @@ public class BaseLocationZoneController extends BaseController
         query.setStatus("0");
         return AjaxResult.success(baseLocationZoneService.selectBaseLocationZoneList(query));
     }
+
+    /**
+     * 获取库位下拉树列表
+     */
+    @GetMapping("/treeselect")
+    public AjaxResult treeselect() {
+        return AjaxResult.success(baseLocationZoneService.buildLocationTreeSelect());
+    }
 }

+ 6 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/base/BaseSkuTypeController.java

@@ -1,8 +1,10 @@
 package com.ruoyi.web.controller.warewms.base;
 
+import java.util.ArrayList;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.web.vo.DictVO;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -47,7 +49,7 @@ public class BaseSkuTypeController extends BaseController {
      * 导出物料分类列表
      */
     @PreAuthorize("@ss.hasPermi('base:skuType:export')")
-    @Log(title = "物料分类" , businessType = BusinessType.EXPORT)
+    @Log(title = "物料分类", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
     public void export(HttpServletResponse response, BaseSkuType baseSkuType) {
         List<BaseSkuType> list = baseSkuTypeService.selectBaseSkuTypeList(baseSkuType);
@@ -68,7 +70,7 @@ public class BaseSkuTypeController extends BaseController {
      * 新增物料分类
      */
     @PreAuthorize("@ss.hasPermi('base:skuType:add')")
-    @Log(title = "物料分类" , businessType = BusinessType.INSERT)
+    @Log(title = "物料分类", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody BaseSkuType baseSkuType) {
         return toAjax(baseSkuTypeService.insertBaseSkuType(baseSkuType));
@@ -78,7 +80,7 @@ public class BaseSkuTypeController extends BaseController {
      * 修改物料分类
      */
     @PreAuthorize("@ss.hasPermi('base:skuType:edit')")
-    @Log(title = "物料分类" , businessType = BusinessType.UPDATE)
+    @Log(title = "物料分类", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody BaseSkuType baseSkuType) {
         return toAjax(baseSkuTypeService.updateBaseSkuType(baseSkuType));
@@ -88,7 +90,7 @@ public class BaseSkuTypeController extends BaseController {
      * 删除物料分类
      */
     @PreAuthorize("@ss.hasPermi('base:skuType:remove')")
-    @Log(title = "物料分类" , businessType = BusinessType.DELETE)
+    @Log(title = "物料分类", businessType = BusinessType.DELETE)
     @DeleteMapping("/{itemCodes}")
     public AjaxResult remove(@PathVariable String[] itemCodes) {
         return toAjax(baseSkuTypeService.deleteBaseSkuTypeByItemCodes(itemCodes));

+ 15 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/vo/DictVO.java

@@ -0,0 +1,15 @@
+package com.ruoyi.web.vo;
+
+import lombok.Data;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/8/18
+ * Description:
+ */
+@Data
+public class DictVO {
+    Integer itemCode;
+    String itemName;
+}

+ 8 - 0
ruoyi-ui/src/api/base/locationZone.js

@@ -50,3 +50,11 @@ export function queryLocationZoneDict() {
     method: 'get',
   })
 }
+
+// 查询部门下拉树结构
+export function treeselectLocationZone() {
+  return request({
+    url: '/base/locationZone/treeselect',
+    method: 'get'
+  })
+}

+ 15 - 0
ruoyi-ui/src/utils/combo/dict.js

@@ -43,6 +43,21 @@ export const inputTag = [
   }
 ]
 
+export const yesOrNoTag = [
+  {
+    label: '可选',
+    value: 'Choice'
+  },
+  {
+    label: '必填',
+    value: 'Required'
+  },
+  {
+    label: '隐藏',
+    value: 'Hidden'
+  }
+]
+
 
 
 

+ 44 - 11
ruoyi-ui/src/views/ams/flowConfig/index.vue

@@ -108,7 +108,7 @@
     />
 
     <!-- 添加或修改流程配置头对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
+    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="100px">
         <el-row>
           <el-col :span="12">
@@ -151,7 +151,7 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="数量范围" prop="qtyRange">
-              <el-input v-model="form.qtyRange" placeholder="请输入数量范围"/>
+              <el-input v-model="form.qtyRange" placeholder="数据格式:1-5" @change="rangeChange"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -175,7 +175,7 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="重量范围" prop="weightRange">
-              <el-input v-model="form.weightRange" placeholder="请输入重量范围"/>
+              <el-input v-model="form.weightRange" placeholder="数据格式:1-5"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -235,7 +235,7 @@
           </el-col>
         </el-row>
         <el-row>
-          <el-col :span="12">
+          <el-col :span="10">
             <el-form-item label="起点范围" prop="locationFrom">
               <treeselect
                 :multiple="true"
@@ -246,10 +246,7 @@
                 :show-count="true" placeholder="请选择起点范围" />
             </el-form-item>
           </el-col>
-          <el-col :span="12">
-            <!--<el-form-item label="对接设备" prop="locationFromDevice">-->
-              <!--<el-input v-model="form.locationFromDevice" placeholder="请输入起点是否对接设备" />-->
-            <!--</el-form-item>-->
+          <el-col :span="8">
             <el-form-item label="是否显示" prop="locationFromFlag">
               <el-select style="width: 100%" v-model="form.locationFromFlag" placeholder="是否显示" size="small">
                 <el-option
@@ -261,9 +258,21 @@
               </el-select>
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="启用策略" prop="locationFromStrategyFlag">
+              <el-select style="width: 100%" v-model="form.locationFromStrategyFlag" size="small">
+                <el-option
+                  v-for="dict in dict.type.sys_yes_no"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
         </el-row>
         <el-row>
-          <el-col :span="12">
+          <el-col :span="10">
             <el-form-item label="终点范围" prop="locationTo">
               <treeselect
                 :multiple="true"
@@ -274,7 +283,7 @@
                 :show-count="true" placeholder="请选择终点范围" />
             </el-form-item>
           </el-col>
-          <el-col :span="12">
+          <el-col :span="8">
             <!--<el-form-item label="对接设备" prop="locationToDevice">-->
               <!--<el-input v-model="form.locationToDevice" placeholder="请输入终点是否对接设备" />-->
             <!--</el-form-item>-->
@@ -289,6 +298,18 @@
               </el-select>
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="启用策略" prop="locationToStrategyFlag">
+              <el-select style="width: 100%" v-model="form.locationToStrategyFlag" size="small">
+                <el-option
+                  v-for="dict in dict.type.sys_yes_no"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
         </el-row>
         <!--<el-divider content-position="center">批次属性信息</el-divider>
         <el-table :data="flowConfigDetailsList" :row-class-name="rowFlowConfigDetailsIndex" @selection-change="handleFlowConfigDetailsSelectionChange" ref="flowConfigDetails">
@@ -324,6 +345,7 @@
 <script>
 import { listFlowConfig, getFlowConfig, delFlowConfig, addFlowConfig, updateFlowConfig, listLotattConfig } from "@/api/ams/flowConfig";
 import { querySkuTypeDict } from "@/api/base/skuType";
+import { treeselectLocationZone } from "@/api/base/locationZone";
 import { querySupplierDict } from "@/api/base/supplier";
 import { treeselect } from "@/api/base/locationInfo";
 import { inputTag } from "@/utils/combo/dict";
@@ -333,6 +355,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 export default {
   name: "FlowConfig",
   components: { Treeselect },
+  dicts: ['sys_yes_no'],
   data() {
     return {
       // 遮罩层
@@ -426,9 +449,11 @@ export default {
         locationFrom: null,
         locationFromFlag: 'Choice',
         locationFromDevice: null,
+        locationFromStrategyFlag: 'N',
         locationTo: null,
         locationToFlag: 'Choice',
         locationToDevice: null,
+        locationToStrategyFlag: 'N',
         createBy: null,
         createTime: null,
         updateBy: null,
@@ -546,6 +571,14 @@ export default {
       if (!value) return true;
       return data.label.indexOf(value) !== -1;
     },
+    rangeChange(e) {
+      // 范围变更检测
+      if (e !== '') {
+        let r = /^\+?[1-9][0-9]*$/;  //正整数
+        let flag = r.test(e);
+        this.form.qtyRange = '1-' + e
+      }
+    },
     init() {
       // 初始化物料分类
       querySkuTypeDict().then(response => {
@@ -558,7 +591,7 @@ export default {
       });
 
       // 初始化库位
-      treeselect().then(response => {
+      treeselectLocationZone().then(response => {
         this.locationFromOptions = response.data;
         this.locationToOptions = response.data;
       });

+ 79 - 32
ruoyi-ui/src/views/ams/lineCall/index.vue

@@ -100,8 +100,18 @@
     />
 
     <!-- 添加或修改流程配置头对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+    <el-dialog ref="digEdit" :title="title" :visible.sync="open" width="700px" append-to-body @open="digOpen" destroy-on-close @close="digClose">
+      <el-form ref="relForm" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="起点位置" prop="locationFrom" v-if="form.locationFromFlag !== 'Hidden'">
+          <el-select style="width: 100%" v-model="form.locationFrom" placeholder="请选择起点位置" clearable size="small">
+            <el-option
+              v-for="dict in locationFromCombo"
+              :key="dict.id"
+              :label="dict.locationNo"
+              :value="dict.id"
+            />
+          </el-select>
+        </el-form-item>
         <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
@@ -113,10 +123,10 @@
           </el-select>
         </el-form-item>
         <el-form-item label="数量" prop="qty" v-if="form.qtyFlag !== 'Hidden'">
-          <el-input v-model="form.qty" placeholder="请输入数量" type="number"/>
+          <el-input v-model="form.qty" :placeholder="`输入范围${form.qtyMin}-${form.qtyMax}`" type="number"/>
         </el-form-item>
         <el-form-item label="重量" prop="weight" v-if="form.weightFlag !== 'Hidden'">
-          <el-input v-model="form.weight" placeholder="请输入重量" type="number"/>
+          <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-select style="width: 100%" v-model="form.supplier" placeholder="请选择供应商" clearable size="small">
@@ -128,28 +138,10 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="起点位置" prop="locationFrom" v-if="form.locationFromFlag !== 'Hidden'">
-          <el-select style="width: 100%" v-model="form.locationFrom" placeholder="请选择起点位置" clearable size="small">
-            <el-option
-              v-for="dict in locationFromCombo"
-              :key="dict.id"
-              :label="dict.locationNo"
-              :value="dict.id"
-            />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="终点位置" prop="locationTo" v-if="form.locationToFlag !== 'Hidden'">
-          <el-select style="width: 100%" v-model="form.locationTo" placeholder="请选择终点位置" clearable size="small">
-            <el-option
-              v-for="dict in locationToCombo"
-              :key="dict.id"
-              :label="dict.locationNo"
-              :value="dict.id"
-            />
-          </el-select>
-        </el-form-item>
-        <el-divider content-position="center">批次属性信息</el-divider>
-        <el-table :data="flowConfigDetailsList" :row-class-name="rowFlowConfigDetailsIndex"
+        <div style="cursor: pointer;" @click="showHidden">
+          <el-divider content-position="center">批次属性信息</el-divider>
+        </div>
+        <el-table v-show="attShowFlag" :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">
@@ -178,6 +170,16 @@
             </template>
           </el-table-column>
         </el-table>
+        <el-form-item label="终点位置" prop="locationTo" v-if="form.locationToFlag !== 'Hidden'">
+          <el-select style="width: 100%" v-model="form.locationTo" placeholder="请选择终点位置" clearable size="small">
+            <el-option
+              v-for="dict in locationToCombo"
+              :key="dict.id"
+              :label="dict.locationNo"
+              :value="dict.id"
+            />
+          </el-select>
+        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">执 行</el-button>
@@ -237,11 +239,7 @@
         // 表单参数
         form: {},
         // 表单校验
-        rules: {
-          flowName: [
-            {required: true, message: "流程名称不能为空", trigger: "blur"}
-          ],
-        },
+        rules: {},
         defaultProps: {
           children: "children",
           label: "label"
@@ -252,7 +250,8 @@
         locationFromOptions: undefined,
         locationToOptions: undefined,
         locationFromCombo: undefined,
-        locationToCombo: undefined
+        locationToCombo: undefined,
+        attShowFlag: false
       };
     },
     created() {
@@ -351,6 +350,43 @@
           this.form.locationFromFlag = response.locationFromFlag
           this.form.locationToFlag = response.locationToFlag
           this.skuTypeCombo = response.skuList;
+
+          if (this.form.locationFromFlag === 'Required') {
+            this.rules.locationFrom = [
+              {required: true, message: "起始库位不能为空", trigger: "blur"}
+            ]
+          }
+
+          if (this.form.skuTypeFlag === 'Required') {
+            this.rules.sku = [
+              {required: true, message: "物料不能为空", trigger: "blur"}
+            ]
+          }
+
+          if (this.form.qtyFlag === 'Required') {
+            this.rules.qty = [
+              {required: true, message: "数量不能为空", trigger: "blur"}
+            ]
+          }
+
+          if (this.form.weightFlag === 'Required') {
+            this.rules.weight = [
+              {required: true, message: "重量不能为空", trigger: "blur"}
+            ]
+          }
+
+          if (this.form.supplierFlag === 'Required') {
+            this.rules.supplier = [
+              {required: true, message: "供应商不能为空", trigger: "blur"}
+            ]
+          }
+
+          if (this.form.locationToFlag === 'Required') {
+            this.rules.locationTo = [
+              {required: true, message: "目标库位不能为空", trigger: "blur"}
+            ]
+          }
+
           this.open = true;
           this.title = row.flowName;
         });
@@ -470,6 +506,17 @@
         querySupplierDict().then(response => {
           this.supplierCombo = response.data;
         });
+      },
+      showHidden () {
+        this.attShowFlag = !this.attShowFlag
+      },
+      digOpen () {
+        this.$nextTick( () => {
+          this.$refs.relForm.validate();
+        })
+      },
+      digClose () {
+        this.rules = {}
       }
     }
   };

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

@@ -61,6 +61,8 @@ public class BusinessServiceImpl implements IBusinessService {
     public AjaxResult agvCall(List<AgvCallDTO> agvCallDTOList) {
         for (AgvCallDTO agvCallDTO : agvCallDTOList) {
             if (!StringUtils.isEmpty(agvCallDTO.getLocationFrom()) && StringUtils.isEmpty(agvCallDTO.getLocationTo())) {
+                //TODO 判断是库位还是区域如果是区域需要进行库位分配
+
                 //如果起始库位不为空、目标库位为空则表示为入库
                 //1.分配库位
                 BaseLocationInfo locationFrom = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(agvCallDTO.getLocationFrom(), agvCallDTO.getWarehouseId());

+ 137 - 102
warewms-ams/src/main/java/com/ruoyi/ams/config/domain/FlowConfigHeader.java

@@ -1,6 +1,7 @@
 package com.ruoyi.ams.config.domain;
 
 import java.util.List;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -8,219 +9,251 @@ import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 流程配置头对象 flow_config_header
- * 
+ *
  * @author ruoyi
  * @date 2022-02-16
  */
-public class FlowConfigHeader extends BaseEntity
-{
+public class FlowConfigHeader extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 主键 */
+    /**
+     * 主键
+     */
     private Long id;
 
-    /** 流程名称 */
+    /**
+     * 流程名称
+     */
     @Excel(name = "流程名称")
     private String flowName;
 
-    /** 物料类型 */
+    /**
+     * 物料类型
+     */
     @Excel(name = "物料类型")
     private String skuType;
 
-    /** 物料类型是否显示 */
+    /**
+     * 物料类型是否显示
+     */
     @Excel(name = "物料类型是否显示")
     private String skuTypeFlag;
 
-    /** 数量 */
+    /**
+     * 数量
+     */
     @Excel(name = "数量")
     private Long qty;
 
     @Excel(name = "数量范围")
     private String qtyRange;
 
-    /** 数量是否显示 */
+    /**
+     * 数量是否显示
+     */
     @Excel(name = "数量是否显示")
     private String qtyFlag;
 
-    /** 重量 */
+    /**
+     * 重量
+     */
     @Excel(name = "重量")
     private Long weight;
 
     @Excel(name = "重量范围")
     private String weightRange;
 
-    /** 重量是否显示 */
+    /**
+     * 重量是否显示
+     */
     @Excel(name = "重量是否显示")
     private String weightFlag;
 
-    /** 供应商 */
+    /**
+     * 供应商
+     */
     @Excel(name = "供应商")
     private String supplier;
 
     @Excel(name = "供应商范围")
     private String supplierRange;
 
-    /** 供应商是否显示 */
+    /**
+     * 供应商是否显示
+     */
     @Excel(name = "供应商是否显示")
     private String supplierFlag;
 
-    /** 起点范围 */
+    /**
+     * 起点范围
+     */
     @Excel(name = "起点范围")
     private String locationFrom;
 
     private String locationFromFlag;
 
-    /** 起点是否对接设备 */
+    /**
+     * 起点是否对接设备
+     */
     @Excel(name = "起点是否对接设备")
     private String locationFromDevice;
 
-    /** 终点范围 */
+    private String locationFromStrategyFlag;
+
+    /**
+     * 终点范围
+     */
     @Excel(name = "终点范围")
     private String locationTo;
 
     private String locationToFlag;
 
-    /** 终点是否对接设备 */
+    /**
+     * 终点是否对接设备
+     */
     @Excel(name = "终点是否对接设备")
     private String locationToDevice;
 
-    /** 流程配置体信息 */
+    private String locationToStrategyFlag;
+
+    public String getLocationFromStrategyFlag() {
+        return locationFromStrategyFlag;
+    }
+
+    public void setLocationFromStrategyFlag(String locationFromStrategyFlag) {
+        this.locationFromStrategyFlag = locationFromStrategyFlag;
+    }
+
+    public String getLocationToStrategyFlag() {
+        return locationToStrategyFlag;
+    }
+
+    public void setLocationToStrategyFlag(String locationToStrategyFlag) {
+        this.locationToStrategyFlag = locationToStrategyFlag;
+    }
+
+    /**
+     * 流程配置体信息
+     */
     private List<FlowConfigDetails> flowConfigDetailsList;
 
-    public void setId(Long id) 
-    {
+    public void setId(Long id) {
         this.id = id;
     }
 
-    public Long getId() 
-    {
+    public Long getId() {
         return id;
     }
-    public void setFlowName(String flowName) 
-    {
+
+    public void setFlowName(String flowName) {
         this.flowName = flowName;
     }
 
-    public String getFlowName() 
-    {
+    public String getFlowName() {
         return flowName;
     }
-    public void setSkuType(String skuType) 
-    {
+
+    public void setSkuType(String skuType) {
         this.skuType = skuType;
     }
 
-    public String getSkuType() 
-    {
+    public String getSkuType() {
         return skuType;
     }
-    public void setSkuTypeFlag(String skuTypeFlag) 
-    {
+
+    public void setSkuTypeFlag(String skuTypeFlag) {
         this.skuTypeFlag = skuTypeFlag;
     }
 
-    public String getSkuTypeFlag() 
-    {
+    public String getSkuTypeFlag() {
         return skuTypeFlag;
     }
-    public void setQty(Long qty) 
-    {
+
+    public void setQty(Long qty) {
         this.qty = qty;
     }
 
-    public Long getQty() 
-    {
+    public Long getQty() {
         return qty;
     }
-    public void setQtyFlag(String qtyFlag) 
-    {
+
+    public void setQtyFlag(String qtyFlag) {
         this.qtyFlag = qtyFlag;
     }
 
-    public String getQtyFlag() 
-    {
+    public String getQtyFlag() {
         return qtyFlag;
     }
-    public void setWeight(Long weight) 
-    {
+
+    public void setWeight(Long weight) {
         this.weight = weight;
     }
 
-    public Long getWeight() 
-    {
+    public Long getWeight() {
         return weight;
     }
-    public void setWeightFlag(String weightFlag) 
-    {
+
+    public void setWeightFlag(String weightFlag) {
         this.weightFlag = weightFlag;
     }
 
-    public String getWeightFlag() 
-    {
+    public String getWeightFlag() {
         return weightFlag;
     }
-    public void setSupplier(String supplier) 
-    {
+
+    public void setSupplier(String supplier) {
         this.supplier = supplier;
     }
 
-    public String getSupplier() 
-    {
+    public String getSupplier() {
         return supplier;
     }
-    public void setSupplierFlag(String supplierFlag) 
-    {
+
+    public void setSupplierFlag(String supplierFlag) {
         this.supplierFlag = supplierFlag;
     }
 
-    public String getSupplierFlag() 
-    {
+    public String getSupplierFlag() {
         return supplierFlag;
     }
-    public void setLocationFrom(String locationFrom) 
-    {
+
+    public void setLocationFrom(String locationFrom) {
         this.locationFrom = locationFrom;
     }
 
-    public String getLocationFrom() 
-    {
+    public String getLocationFrom() {
         return locationFrom;
     }
-    public void setLocationFromDevice(String locationFromDevice) 
-    {
+
+    public void setLocationFromDevice(String locationFromDevice) {
         this.locationFromDevice = locationFromDevice;
     }
 
-    public String getLocationFromDevice() 
-    {
+    public String getLocationFromDevice() {
         return locationFromDevice;
     }
-    public void setLocationTo(String locationTo) 
-    {
+
+    public void setLocationTo(String locationTo) {
         this.locationTo = locationTo;
     }
 
-    public String getLocationTo() 
-    {
+    public String getLocationTo() {
         return locationTo;
     }
-    public void setLocationToDevice(String locationToDevice) 
-    {
+
+    public void setLocationToDevice(String locationToDevice) {
         this.locationToDevice = locationToDevice;
     }
 
-    public String getLocationToDevice() 
-    {
+    public String getLocationToDevice() {
         return locationToDevice;
     }
 
-    public List<FlowConfigDetails> getFlowConfigDetailsList()
-    {
+    public List<FlowConfigDetails> getFlowConfigDetailsList() {
         return flowConfigDetailsList;
     }
 
-    public void setFlowConfigDetailsList(List<FlowConfigDetails> flowConfigDetailsList)
-    {
+    public void setFlowConfigDetailsList(List<FlowConfigDetails> flowConfigDetailsList) {
         this.flowConfigDetailsList = flowConfigDetailsList;
     }
 
@@ -266,29 +299,31 @@ public class FlowConfigHeader extends BaseEntity
 
     @Override
     public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("flowName", getFlowName())
-            .append("skuType", getSkuType())
-            .append("skuTypeFlag", getSkuTypeFlag())
-            .append("qty", getQty())
-            .append("qtyFlag", getQtyFlag())
-            .append("weight", getWeight())
-            .append("weightFlag", getWeightFlag())
-            .append("supplier", getSupplier())
-            .append("supplierFlag", getSupplierFlag())
-            .append("locationFrom", getLocationFrom())
-            .append("locationFromFlag", getLocationFromFlag())
-            .append("locationFromDevice", getLocationFromDevice())
-            .append("locationTo", getLocationTo())
-            .append("locationToFlag", getLocationToFlag())
-            .append("locationToDevice", getLocationToDevice())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .append("flowConfigDetailsList", getFlowConfigDetailsList())
-            .toString();
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("flowName", getFlowName())
+                .append("skuType", getSkuType())
+                .append("skuTypeFlag", getSkuTypeFlag())
+                .append("qty", getQty())
+                .append("qtyFlag", getQtyFlag())
+                .append("weight", getWeight())
+                .append("weightFlag", getWeightFlag())
+                .append("supplier", getSupplier())
+                .append("supplierFlag", getSupplierFlag())
+                .append("locationFrom", getLocationFrom())
+                .append("locationFromFlag", getLocationFromFlag())
+                .append("locationFromDevice", getLocationFromDevice())
+                .append("locationFromStrategyFlag", getLocationFromStrategyFlag())
+                .append("locationTo", getLocationTo())
+                .append("locationToFlag", getLocationToFlag())
+                .append("locationToDevice", getLocationToDevice())
+                .append("locationToStrategyFlag", getLocationToStrategyFlag())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .append("flowConfigDetailsList", getFlowConfigDetailsList())
+                .toString();
     }
 }

+ 21 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/domain/form/FlowConfigForm.java

@@ -78,6 +78,8 @@ public class FlowConfigForm {
      * 起点是否对接设备
      */
     private String locationFromDevice;
+    // 是否启用策略
+    private String locationFromStrategyFlag;
 
     /**
      * 终点范围
@@ -91,6 +93,9 @@ public class FlowConfigForm {
      */
     private String locationToDevice;
 
+    // 是否启用策略
+    private String locationToStrategyFlag;
+
     /**
      * 流程配置体信息
      */
@@ -255,4 +260,20 @@ public class FlowConfigForm {
     public String[] getSupplierRange() {
         return supplierRange;
     }
+
+    public String getLocationFromStrategyFlag() {
+        return locationFromStrategyFlag;
+    }
+
+    public void setLocationFromStrategyFlag(String locationFromStrategyFlag) {
+        this.locationFromStrategyFlag = locationFromStrategyFlag;
+    }
+
+    public String getLocationToStrategyFlag() {
+        return locationToStrategyFlag;
+    }
+
+    public void setLocationToStrategyFlag(String locationToStrategyFlag) {
+        this.locationToStrategyFlag = locationToStrategyFlag;
+    }
 }

+ 20 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/domain/vo/FlowConfigHeaderVO.java

@@ -70,6 +70,8 @@ public class FlowConfigHeaderVO extends BaseEntity {
     @Excel(name = "起点是否对接设备")
     private String locationFromDevice;
 
+    private String locationFromStrategyFlag;
+
     /** 终点范围 */
     @Excel(name = "终点范围")
     private String locationTo;
@@ -80,6 +82,8 @@ public class FlowConfigHeaderVO extends BaseEntity {
     @Excel(name = "终点是否对接设备")
     private String locationToDevice;
 
+    private String locationToStrategyFlag;
+
     /** 流程配置体信息 */
     private List<FlowConfigDetailsVO> flowConfigDetailsList;
 
@@ -260,6 +264,22 @@ public class FlowConfigHeaderVO extends BaseEntity {
         this.supplierRange = supplierRange;
     }
 
+    public String getLocationFromStrategyFlag() {
+        return locationFromStrategyFlag;
+    }
+
+    public void setLocationFromStrategyFlag(String locationFromStrategyFlag) {
+        this.locationFromStrategyFlag = locationFromStrategyFlag;
+    }
+
+    public String getLocationToStrategyFlag() {
+        return locationToStrategyFlag;
+    }
+
+    public void setLocationToStrategyFlag(String locationToStrategyFlag) {
+        this.locationToStrategyFlag = locationToStrategyFlag;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 4 - 3
warewms-ams/src/main/java/com/ruoyi/ams/config/domain/vo/FlowConfigVO.java

@@ -1,5 +1,6 @@
 package com.ruoyi.ams.config.domain.vo;
 
+import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.domain.BaseEntity;
 
 import java.util.List;
@@ -21,7 +22,7 @@ public class FlowConfigVO extends BaseEntity {
     private String flowName;
 
     /** 物料类型 */
-    private String[] skuType;
+    private Long[] skuType;
 
     /** 物料类型是否显示 */
     private String skuTypeFlag;
@@ -85,11 +86,11 @@ public class FlowConfigVO extends BaseEntity {
         this.flowName = flowName;
     }
 
-    public String[] getSkuType() {
+    public Long[] getSkuType() {
         return skuType;
     }
 
-    public void setSkuType(String[] skuType) {
+    public void setSkuType(Long[] skuType) {
         this.skuType = skuType;
     }
 

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

@@ -21,9 +21,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="locationFrom"    column="location_from"    />
         <result property="locationFromFlag"    column="location_from_flag"    />
         <result property="locationFromDevice"    column="location_from_device"    />
+        <result property="locationFromStrategyFlag"    column="location_from_strategy_flag"    />
         <result property="locationTo"    column="location_to"    />
         <result property="locationToFlag"    column="location_to_flag"    />
         <result property="locationToDevice"    column="location_to_device"    />
+        <result property="locationToStrategyFlag"    column="location_to_strategy_flag"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
@@ -48,9 +50,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="locationFrom"    column="location_from"    />
         <result property="locationFromFlag"    column="location_from_flag"    />
         <result property="locationFromDevice"    column="location_from_device"    />
+        <result property="locationFromStrategyFlag"    column="location_from_strategy_flag"    />
         <result property="locationTo"    column="location_to"    />
         <result property="locationToFlag"    column="location_to_flag"    />
         <result property="locationToDevice"    column="location_to_device"    />
+        <result property="locationToStrategyFlag"    column="location_to_strategy_flag"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
@@ -86,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectFlowConfigHeaderVo">
-        select id, flow_name, sku_type, sku_type_flag, qty, qty_flag, weight, weight_flag, supplier, supplier_flag, location_from,location_from_flag, location_from_device, location_to,location_to_flag, location_to_device, create_by, create_time, update_by, update_time, remark from flow_config_header
+        select id, flow_name, sku_type, sku_type_flag, qty, qty_flag, weight, weight_flag, supplier, supplier_flag, location_from,location_from_flag, location_from_device, location_to,location_to_flag, location_to_device, create_by, create_time, update_by, update_time, remark,location_from_strategy_flag ,location_to_strategy_flag   from flow_config_header
     </sql>
 
     <select id="selectFlowConfigHeaderList" parameterType="FlowConfigHeader" resultMap="FlowConfigHeaderResult">
@@ -105,8 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <select id="selectFlowConfigHeaderById" parameterType="Long" resultMap="FlowConfigHeaderFlowConfigDetailsResult">
         select a.id, a.flow_name, a.sku_type, a.sku_type_flag, a.qty, a.qty_flag, a.weight, a.weight_flag, a.supplier, a.supplier_flag, a.location_from,a.location_from_flag, a.location_from_device, a.location_to,a.location_to_flag, a.location_to_device, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
-        a.qty_range,a.weight_range,a.supplier_range,
- b.id as sub_id, b.header_id as sub_header_id, b.lotatt_id as sub_lotatt_id,cf.lotatt_name as sub_lotatt_name, b.lotatt_flag as sub_lotatt_flag, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time, b.remark as sub_remark
+        a.qty_range,a.weight_range,a.supplier_range,b.id as sub_id, b.header_id as sub_header_id, b.lotatt_id as sub_lotatt_id,cf.lotatt_name as sub_lotatt_name, b.lotatt_flag as sub_lotatt_flag, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time, b.remark as sub_remark,
+        a.location_from_strategy_flag,a.location_to_strategy_flag
         from flow_config_header a
         left join flow_config_details b on b.header_id = a.id
         left join lotatt_config cf on b.lotatt_id = cf.lotatt_id
@@ -131,9 +135,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="locationFrom != null">location_from,</if>
             <if test="locationFromFlag != null">location_from_flag,</if>
             <if test="locationFromDevice != null">location_from_device,</if>
+            <if test="locationFromStrategyFlag != null">location_from_strategy_flag,</if>
             <if test="locationTo != null">location_to,</if>
             <if test="locationToFlag != null">location_to_flag,</if>
             <if test="locationToDevice != null">location_to_device,</if>
+            <if test="locationToStrategyFlag != null">location_to_strategy_flag,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -156,9 +162,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="locationFrom != null">#{locationFrom},</if>
             <if test="locationFromFlag != null">#{locationFromFlag},</if>
             <if test="locationFromDevice != null">#{locationFromDevice},</if>
+            <if test="locationFromStrategyFlag != null">#{locationFromStrategyFlag},</if>
             <if test="locationTo != null">#{locationTo},</if>
             <if test="locationToFlag != null">#{locationToFlag},</if>
             <if test="locationToDevice != null">#{locationToDevice},</if>
+            <if test="locationToStrategyFlag != null">#{locationToStrategyFlag},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -182,9 +190,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="locationFrom != null">location_from = #{locationFrom},</if>
             <if test="locationFromFlag != null">location_from_flag = #{locationFromFlag},</if>
             <if test="locationFromDevice != null">location_from_device = #{locationFromDevice},</if>
+            <if test="locationFromStrategyFlag != null">location_from_strategy_flag = #{locationFromStrategyFlag},</if>
             <if test="locationTo != null">location_to = #{locationTo},</if>
             <if test="locationToFlag != null">location_to_flag = #{locationToFlag},</if>
             <if test="locationToDevice != null">location_to_device = #{locationToDevice},</if>
+            <if test="locationToStrategyFlag != null">location_to_strategy_flag = #{locationToStrategyFlag},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>

+ 17 - 0
warewms-base/src/main/java/com/ruoyi/base/service/IBaseLocationZoneService.java

@@ -2,6 +2,8 @@ package com.ruoyi.base.service;
 
 import java.util.List;
 import com.ruoyi.base.domain.BaseLocationZone;
+import com.ruoyi.base.domain.vo.BasLocationTreeSelectVO;
+import com.ruoyi.base.domain.vo.TreeSelectVO;
 
 /**
  * 库区Service接口
@@ -58,4 +60,19 @@ public interface IBaseLocationZoneService
      * @return 结果
      */
      int deleteBaseLocationZoneByZoneId(Long zoneId);
+
+    /**
+     * 构建前端所需要下拉树结构
+     *
+     * @return 下拉树结构列表
+     */
+    List<TreeSelectVO> buildLocationTreeSelect();
+
+    /**
+     * 构建前端所需要树结构
+     *
+     * @param zoneId 库位列表
+     * @return 树结构列表
+     */
+    List<BasLocationTreeSelectVO> buildLocationTree(Long zoneId);
 }

+ 34 - 1
warewms-base/src/main/java/com/ruoyi/base/service/impl/BaseLocationZoneServiceImpl.java

@@ -1,6 +1,12 @@
 package com.ruoyi.base.service.impl;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
+
+import com.ruoyi.base.domain.BaseLocationInfo;
+import com.ruoyi.base.domain.vo.BasLocationTreeSelectVO;
+import com.ruoyi.base.domain.vo.TreeSelectVO;
 import com.ruoyi.common.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -15,7 +21,7 @@ import com.ruoyi.base.service.IBaseLocationZoneService;
  * @date 2022-02-15
  */
 @Service
-public class BaseLocationZoneServiceImpl implements IBaseLocationZoneService 
+public class BaseLocationZoneServiceImpl implements IBaseLocationZoneService
 {
     @Autowired
     private BaseLocationZoneMapper baseLocationZoneMapper;
@@ -93,4 +99,31 @@ public class BaseLocationZoneServiceImpl implements IBaseLocationZoneService
     {
         return baseLocationZoneMapper.deleteBaseLocationZoneByZoneId(zoneId);
     }
+
+    @Override
+    public List<TreeSelectVO> buildLocationTreeSelect() {
+        List<BasLocationTreeSelectVO> locationTrees = buildLocationTree(0L);
+        return locationTrees.stream().map(TreeSelectVO::new).collect(Collectors.toList());
+    }
+
+    @Override
+    public List<BasLocationTreeSelectVO> buildLocationTree(Long zoneId) {
+        // 查询区域,库位树把区域也组装进去
+        BaseLocationZone queryZone = new BaseLocationZone();
+        queryZone.setStatus("0");
+        List<BaseLocationZone> zoneList = baseLocationZoneMapper.selectBaseLocationZoneList(queryZone);
+        List<BasLocationTreeSelectVO> locationTreeSelectVOList = new ArrayList<>();
+        //循环遍历每个区域的库位
+        for (BaseLocationZone zone : zoneList) {
+            BasLocationTreeSelectVO parent = new BasLocationTreeSelectVO();
+            List<BasLocationTreeSelectVO> children = new ArrayList<>();
+            BaseLocationInfo query = new BaseLocationInfo();
+            query.setZoneId(zone.getZoneId());
+            parent.setId(zone.getZoneId());
+            parent.setTreeName(zone.getZoneName());
+            parent.setChildren(children);
+            locationTreeSelectVOList.add(parent);
+        }
+        return locationTreeSelectVOList;
+    }
 }