Forráskód Böngészése

路径规划,库位分配代码

andy 3 éve
szülő
commit
70042adb67

+ 3 - 13
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/LocationPriorityHeaderController.java

@@ -2,6 +2,8 @@ package com.ruoyi.web.controller.warewms.ams;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.ams.config.domain.vo.LocationPriorityHeaderVO;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -42,22 +44,10 @@ public class LocationPriorityHeaderController extends BaseController
     public TableDataInfo list(LocationPriorityHeader locationPriorityHeader)
     {
         startPage();
-        List<LocationPriorityHeader> list = locationPriorityHeaderService.selectLocationPriorityHeaderList(locationPriorityHeader);
+        List<LocationPriorityHeaderVO> list = locationPriorityHeaderService.selectLocationPriorityHeaderList(locationPriorityHeader);
         return getDataTable(list);
     }
 
-    /**
-     * 导出路径规划列表
-     */
-    @PreAuthorize("@ss.hasPermi('ams:locationPriority:export')")
-    @Log(title = "路径规划", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, LocationPriorityHeader locationPriorityHeader)
-    {
-        List<LocationPriorityHeader> list = locationPriorityHeaderService.selectLocationPriorityHeaderList(locationPriorityHeader);
-        ExcelUtil<LocationPriorityHeader> util = new ExcelUtil<LocationPriorityHeader>(LocationPriorityHeader.class);
-        util.exportExcel(response, list, "路径规划数据");
-    }
 
     /**
      * 获取路径规划详细信息

+ 14 - 25
ruoyi-ui/src/views/ams/locationPriority/index.vue

@@ -49,16 +49,6 @@
           v-hasPermi="['ams:locationPriority: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:locationPriority:export']"
-        >导出</el-button>
-      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -66,8 +56,13 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="id" />
       <el-table-column label="路径规划名称" align="center" prop="flowName" />
-      <el-table-column label="所属区域" align="center" prop="locationZone" />
-      <el-table-column label="状态" align="center" prop="status" />
+      <el-table-column label="所属区域" align="center" prop="locationZoneName" />
+      <el-table-column label="状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <div v-if="scope.row.status === 0">启用</div>
+          <div v-if="scope.row.status === 1">禁用</div>
+        </template>
+      </el-table-column>
       <el-table-column label="备注" align="center" prop="remark" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -160,14 +155,7 @@
           </el-col>
           <el-col :span="12">
             <el-form-item label="并行数量" prop="parallelCount">
-              <el-select v-model="form.parallelCount" placeholder="请选择" clearable size="small" style="width: 100%">
-                <el-option
-                  v-for="dict in dict.type.sys_yes_no"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                />
-              </el-select>
+              <el-input v-model="form.parallelCount" :disabled="form.parallelFlag !== 'Y'" placeholder="请输入并行数量" />
             </el-form-item>
           </el-col>
         </el-row>
@@ -360,12 +348,12 @@ export default {
         id: null,
         flowName: null,
         locationZone: null,
-        mixedFlag: null,
-        parallelFlag: null,
+        mixedFlag: 'N',
+        parallelFlag: 'N',
         parallelCount: null,
-        outerFlag: null,
-        periodFlag: null,
-        sameLotattFlag: null,
+        outerFlag: 'N',
+        periodFlag: 'N',
+        sameLotattFlag: 'N',
         status: 0,
         userdefine1: null,
         userdefine2: null,
@@ -417,6 +405,7 @@ export default {
       const id = row.id || this.ids
       getLocationPriority(id).then(response => {
         this.form = response.data;
+        this.form.locationZone = parseInt(this.form.locationZone)
         this.locationPriorityDetailsList = response.data.locationPriorityDetailsList;
         this.open = true;
         this.title = "修改路径规划";

+ 33 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/domain/form/LineCallForm.java

@@ -0,0 +1,33 @@
+package com.ruoyi.ams.config.domain.form;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/2/27
+ */
+public class LineCallForm {
+    private String sku;
+    private Double qty;
+    private Double weight;
+    private String supplier;
+    private String locationFrom;
+    private String locationTo;
+    private String lotatt01;
+    private String lotatt02;
+    private String lotatt03;
+    private String lotatt04;
+    private String lotatt05;
+    private String lotatt06;
+    private String lotatt07;
+    private String lotatt08;
+    private String lotatt09;
+    private String lotatt10;
+    private String lotatt11;
+    private String lotatt12;
+    private String lotatt13;
+    private String lotatt14;
+    private String lotatt15;
+    private String lotatt16;
+    private String lotatt17;
+    private String lotatt18;
+}

+ 85 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/domain/vo/LocationPriorityDetailsVO.java

@@ -0,0 +1,85 @@
+package com.ruoyi.ams.config.domain.vo;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/2/27
+ */
+public class LocationPriorityDetailsVO extends BaseEntity {
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 父id
+     */
+    private Long headerId;
+
+    /**
+     * 批次属性
+     */
+    private String lotattId;
+
+    /**
+     * 批次属性名称
+     */
+    private String lotattName;
+
+    /**
+     * 是否显示
+     */
+    private String lotattValue;
+
+    private String inputType;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getHeaderId() {
+        return headerId;
+    }
+
+    public void setHeaderId(Long headerId) {
+        this.headerId = headerId;
+    }
+
+    public String getLotattId() {
+        return lotattId;
+    }
+
+    public void setLotattId(String lotattId) {
+        this.lotattId = lotattId;
+    }
+
+    public String getLotattName() {
+        return lotattName;
+    }
+
+    public void setLotattName(String lotattName) {
+        this.lotattName = lotattName;
+    }
+
+    public String getLotattValue() {
+        return lotattValue;
+    }
+
+    public void setLotattValue(String lotattValue) {
+        this.lotattValue = lotattValue;
+    }
+
+    public String getInputType() {
+        return inputType;
+    }
+
+    public void setInputType(String inputType) {
+        this.inputType = inputType;
+    }
+}

+ 209 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/domain/vo/LocationPriorityHeaderVO.java

@@ -0,0 +1,209 @@
+package com.ruoyi.ams.config.domain.vo;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+
+import java.util.List;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/2/27
+ */
+public class LocationPriorityHeaderVO extends BaseEntity {
+    /** 编号 */
+    private Long id;
+
+    /** 路径规划名称 */
+    private String flowName;
+
+    /** 所属区域 */
+    private Long locationZone;
+
+    private String locationZoneName;
+
+    /** 是否混放 */
+    private String mixedFlag;
+
+    /** 是否并行 */
+    private String parallelFlag;
+
+    /** 并行数量 */
+    private Long parallelCount;
+
+    /** 外围优先 */
+    private String outerFlag;
+
+    /** 近效期 */
+    private String periodFlag;
+
+    /** 同属性出库 */
+    private String sameLotattFlag;
+
+    /** 状态 */
+    private Long status;
+
+    /** 自定义字段1 */
+    private String userdefine1;
+
+    /** 自定义字段2 */
+    private String userdefine2;
+
+    /** 自定义字段3 */
+    private String userdefine3;
+
+    /** 自定义字段4 */
+    private String userdefine4;
+
+    /** 自定义字段5 */
+    private String userdefine5;
+
+    /** 物料 */
+    private String sku;
+
+    /** 路径规划信息 */
+    private List<LocationPriorityDetailsVO> locationPriorityDetailsList;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getFlowName() {
+        return flowName;
+    }
+
+    public void setFlowName(String flowName) {
+        this.flowName = flowName;
+    }
+
+    public Long getLocationZone() {
+        return locationZone;
+    }
+
+    public void setLocationZone(Long locationZone) {
+        this.locationZone = locationZone;
+    }
+
+    public String getLocationZoneName() {
+        return locationZoneName;
+    }
+
+    public void setLocationZoneName(String locationZoneName) {
+        this.locationZoneName = locationZoneName;
+    }
+
+    public String getMixedFlag() {
+        return mixedFlag;
+    }
+
+    public void setMixedFlag(String mixedFlag) {
+        this.mixedFlag = mixedFlag;
+    }
+
+    public String getParallelFlag() {
+        return parallelFlag;
+    }
+
+    public void setParallelFlag(String parallelFlag) {
+        this.parallelFlag = parallelFlag;
+    }
+
+    public Long getParallelCount() {
+        return parallelCount;
+    }
+
+    public void setParallelCount(Long parallelCount) {
+        this.parallelCount = parallelCount;
+    }
+
+    public String getOuterFlag() {
+        return outerFlag;
+    }
+
+    public void setOuterFlag(String outerFlag) {
+        this.outerFlag = outerFlag;
+    }
+
+    public String getPeriodFlag() {
+        return periodFlag;
+    }
+
+    public void setPeriodFlag(String periodFlag) {
+        this.periodFlag = periodFlag;
+    }
+
+    public String getSameLotattFlag() {
+        return sameLotattFlag;
+    }
+
+    public void setSameLotattFlag(String sameLotattFlag) {
+        this.sameLotattFlag = sameLotattFlag;
+    }
+
+    public Long getStatus() {
+        return status;
+    }
+
+    public void setStatus(Long status) {
+        this.status = status;
+    }
+
+    public String getUserdefine1() {
+        return userdefine1;
+    }
+
+    public void setUserdefine1(String userdefine1) {
+        this.userdefine1 = userdefine1;
+    }
+
+    public String getUserdefine2() {
+        return userdefine2;
+    }
+
+    public void setUserdefine2(String userdefine2) {
+        this.userdefine2 = userdefine2;
+    }
+
+    public String getUserdefine3() {
+        return userdefine3;
+    }
+
+    public void setUserdefine3(String userdefine3) {
+        this.userdefine3 = userdefine3;
+    }
+
+    public String getUserdefine4() {
+        return userdefine4;
+    }
+
+    public void setUserdefine4(String userdefine4) {
+        this.userdefine4 = userdefine4;
+    }
+
+    public String getUserdefine5() {
+        return userdefine5;
+    }
+
+    public void setUserdefine5(String userdefine5) {
+        this.userdefine5 = userdefine5;
+    }
+
+    public String getSku() {
+        return sku;
+    }
+
+    public void setSku(String sku) {
+        this.sku = sku;
+    }
+
+    public List<LocationPriorityDetailsVO> getLocationPriorityDetailsList() {
+        return locationPriorityDetailsList;
+    }
+
+    public void setLocationPriorityDetailsList(List<LocationPriorityDetailsVO> locationPriorityDetailsList) {
+        this.locationPriorityDetailsList = locationPriorityDetailsList;
+    }
+}

+ 3 - 2
warewms-ams/src/main/java/com/ruoyi/ams/config/mapper/LocationPriorityHeaderMapper.java

@@ -3,6 +3,7 @@ package com.ruoyi.ams.config.mapper;
 import java.util.List;
 import com.ruoyi.ams.config.domain.LocationPriorityHeader;
 import com.ruoyi.ams.config.domain.LocationPriorityDetails;
+import com.ruoyi.ams.config.domain.vo.LocationPriorityHeaderVO;
 
 /**
  * 路径规划Mapper接口
@@ -18,7 +19,7 @@ public interface LocationPriorityHeaderMapper
      * @param id 路径规划主键
      * @return 路径规划
      */
-     LocationPriorityHeader selectLocationPriorityHeaderById(Long id);
+    LocationPriorityHeaderVO selectLocationPriorityHeaderById(Long id);
 
     /**
      * 查询路径规划列表
@@ -26,7 +27,7 @@ public interface LocationPriorityHeaderMapper
      * @param locationPriorityHeader 路径规划
      * @return 路径规划集合
      */
-     List<LocationPriorityHeader> selectLocationPriorityHeaderList(LocationPriorityHeader locationPriorityHeader);
+     List<LocationPriorityHeaderVO> selectLocationPriorityHeaderList(LocationPriorityHeader locationPriorityHeader);
 
     /**
      * 新增路径规划

+ 21 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/service/IBusinessService.java

@@ -0,0 +1,21 @@
+package com.ruoyi.ams.config.service;
+
+import com.ruoyi.base.domain.BaseLocationInfo;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: andy.qu
+ * Date: 2022/2/27
+ */
+public interface IBusinessService {
+
+    /**
+     * 入库库位分配
+     * @param sku
+     * @return
+     */
+    BaseLocationInfo inLocationAllocation(String sku);
+
+
+    BaseLocationInfo invAllocation();
+}

+ 3 - 2
warewms-ams/src/main/java/com/ruoyi/ams/config/service/ILocationPriorityHeaderService.java

@@ -2,6 +2,7 @@ package com.ruoyi.ams.config.service;
 
 import java.util.List;
 import com.ruoyi.ams.config.domain.LocationPriorityHeader;
+import com.ruoyi.ams.config.domain.vo.LocationPriorityHeaderVO;
 
 /**
  * 路径规划Service接口
@@ -17,7 +18,7 @@ public interface ILocationPriorityHeaderService
      * @param id 路径规划主键
      * @return 路径规划
      */
-     LocationPriorityHeader selectLocationPriorityHeaderById(Long id);
+    LocationPriorityHeaderVO selectLocationPriorityHeaderById(Long id);
 
     /**
      * 查询路径规划列表
@@ -25,7 +26,7 @@ public interface ILocationPriorityHeaderService
      * @param locationPriorityHeader 路径规划
      * @return 路径规划集合
      */
-     List<LocationPriorityHeader> selectLocationPriorityHeaderList(LocationPriorityHeader locationPriorityHeader);
+     List<LocationPriorityHeaderVO> selectLocationPriorityHeaderList(LocationPriorityHeader locationPriorityHeader);
 
     /**
      * 新增路径规划

+ 4 - 2
warewms-ams/src/main/java/com/ruoyi/ams/config/service/impl/LocationPriorityHeaderServiceImpl.java

@@ -1,6 +1,8 @@
 package com.ruoyi.ams.config.service.impl;
 
 import java.util.List;
+
+import com.ruoyi.ams.config.domain.vo.LocationPriorityHeaderVO;
 import com.ruoyi.common.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -31,7 +33,7 @@ public class LocationPriorityHeaderServiceImpl implements ILocationPriorityHeade
      * @return 路径规划
      */
     @Override
-    public LocationPriorityHeader selectLocationPriorityHeaderById(Long id)
+    public LocationPriorityHeaderVO selectLocationPriorityHeaderById(Long id)
     {
         return locationPriorityHeaderMapper.selectLocationPriorityHeaderById(id);
     }
@@ -43,7 +45,7 @@ public class LocationPriorityHeaderServiceImpl implements ILocationPriorityHeade
      * @return 路径规划
      */
     @Override
-    public List<LocationPriorityHeader> selectLocationPriorityHeaderList(LocationPriorityHeader locationPriorityHeader)
+    public List<LocationPriorityHeaderVO> selectLocationPriorityHeaderList(LocationPriorityHeader locationPriorityHeader)
     {
         return locationPriorityHeaderMapper.selectLocationPriorityHeaderList(locationPriorityHeader);
     }

+ 13 - 5
warewms-ams/src/main/resources/mapper/ams/LocationPriorityHeaderMapper.xml

@@ -4,10 +4,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.ams.config.mapper.LocationPriorityHeaderMapper">
     
-    <resultMap type="LocationPriorityHeader" id="LocationPriorityHeaderResult">
+    <resultMap type="locationPriorityHeaderVO" id="LocationPriorityHeaderResult">
         <result property="id"    column="id"    />
         <result property="flowName"    column="flow_name"    />
         <result property="locationZone"    column="location_zone"    />
+        <result property="locationZoneName"    column="location_zone_name"    />
         <result property="mixedFlag"    column="mixed_flag"    />
         <result property="parallelFlag"    column="parallel_flag"    />
         <result property="parallelCount"    column="parallel_count"    />
@@ -28,15 +29,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="sku"    column="sku"    />
     </resultMap>
 
-    <resultMap id="LocationPriorityHeaderLocationPriorityDetailsResult" type="LocationPriorityHeader" extends="LocationPriorityHeaderResult">
+    <resultMap id="LocationPriorityHeaderLocationPriorityDetailsResult" type="LocationPriorityHeaderVO" extends="LocationPriorityHeaderResult">
         <collection property="locationPriorityDetailsList" notNullColumn="sub_id" javaType="java.util.List" resultMap="LocationPriorityDetailsResult" />
     </resultMap>
 
-    <resultMap type="LocationPriorityDetails" id="LocationPriorityDetailsResult">
+    <resultMap type="LocationPriorityDetailsVO" id="LocationPriorityDetailsResult">
         <result property="id"    column="sub_id"    />
         <result property="headerId"    column="sub_header_id"    />
         <result property="lotattId"    column="sub_lotatt_id"    />
         <result property="lotattValue"    column="sub_lotatt_value"    />
+        <result property="lotattName"    column="sub_lotatt_name"    />
+        <result property="inputType"    column="sub_input_type"    />
         <result property="createBy"    column="sub_create_by"    />
         <result property="createTime"    column="sub_create_time"    />
         <result property="updateBy"    column="sub_update_by"    />
@@ -49,7 +52,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectLocationPriorityHeaderList" parameterType="LocationPriorityHeader" resultMap="LocationPriorityHeaderResult">
-        <include refid="selectLocationPriorityHeaderVo"/>
+        <!-- <include refid="selectLocationPriorityHeaderVo"/> -->
+        select h.id, h.flow_name, h.location_zone, z.zone_name location_zone_name, h.mixed_flag, h.parallel_flag, h.parallel_count, h.outer_flag, h.period_flag, h.same_lotatt_flag, h.status, h.userdefine1, h.userdefine2, h.userdefine3, h.userdefine4, h.userdefine5, h.create_by, h.create_time, h.update_by, h.update_time, h.remark, h.sku
+        from location_priority_header h
+        left join base_location_zone z on h.location_zone = z.zone_id
         <where>  
             <if test="flowName != null  and flowName != ''"> and flow_name like concat('%', #{flowName}, '%')</if>
             <if test="locationZone != null  and locationZone != ''"> and location_zone = #{locationZone}</if>
@@ -60,9 +66,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     
     <select id="selectLocationPriorityHeaderById" parameterType="Long" resultMap="LocationPriorityHeaderLocationPriorityDetailsResult">
         select a.id, a.flow_name, a.location_zone, a.mixed_flag, a.parallel_flag, a.parallel_count, a.outer_flag, a.period_flag, a.same_lotatt_flag, a.status, a.userdefine1, a.userdefine2, a.userdefine3, a.userdefine4, a.userdefine5, a.create_by, a.create_time, a.update_by, a.update_time, a.remark, a.sku,
- b.id as sub_id, b.header_id as sub_header_id, b.lotatt_id as sub_lotatt_id, b.lotatt_value as sub_lotatt_value, 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
+ b.id as sub_id, b.header_id as sub_header_id, b.lotatt_id as sub_lotatt_id,c.lotatt_name as sub_lotatt_name, b.lotatt_value as sub_lotatt_value, 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,
+        c.input_type as sub_input_type
         from location_priority_header a
         left join location_priority_details b on b.header_id = a.id
+        left join lotatt_config c on b.lotatt_id = c.lotatt_id
         where a.id = #{id}
     </select>