Browse Source

区域到区域修改

andy 3 years ago
parent
commit
3ea2e2ea80

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

@@ -111,17 +111,24 @@
     <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">
+          <el-col :span="8">
             <el-form-item label="流程名称" prop="flowName">
               <el-input v-model="form.flowName" placeholder="请输入流程名称" />
             </el-form-item>
           </el-col>
-          <el-col :span="12">
+          <el-col :span="8">
             <el-form-item label="操作类型" prop="flowType">
-              <el-input v-model="form.flowType" placeholder="请输入流程操作类型" />
+              <el-select style="width: 100%" v-model="form.flowType" placeholder="请选操作类型" clearable size="small">
+                <el-option
+                  v-for="dict in flowTypeDict"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="12">
+          <el-col :span="8">
             <el-form-item label="备注" prop="remark">
               <el-input v-model="form.remark" placeholder="请输入内容" />
             </el-form-item>
@@ -417,7 +424,12 @@ export default {
       qtyStart: null,
       qtyEnd: null,
       weightStart: null,
-      weightEnd: null
+      weightEnd: null,
+      flowTypeDict: [
+        {label : '入库', value : 'ASN'},
+        {label : '出库', value : 'SO'},
+        {label : '移库', value : 'MV'}
+      ]
     };
   },
   created() {
@@ -444,6 +456,7 @@ export default {
       this.form = {
         id: null,
         flowName: null,
+        flowType: null,
         skuType: null,
         skuTypeFlag: 'Choice',
         qty: null,
@@ -605,7 +618,6 @@ export default {
       return data.label.indexOf(value) !== -1;
     },
     qtyRangeChange(e) {
-      console.log(e)
       // 范围变更检测
       if (e !== '') {
         let r = /^\d+(\.\d+)?$/  //小数

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

@@ -420,7 +420,7 @@
             if (this.form.qtyFlag === 'Required' && this.form.qty === null) {
               this.$modal.msgError("数量必须输入");
               return
-            } else if (this.form.qtyMin != null || this.form.qtyMax != null){
+            } 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
@@ -433,7 +433,7 @@
             if (this.form.weightFlag === 'Required' && this.form.weight === null) {
               this.$modal.msgError("重量必须输入");
               return
-            } else if (this.form.weightMin != null || this.form.weightMax != null) {
+            } 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

+ 106 - 23
warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java

@@ -72,31 +72,20 @@ public class BusinessServiceImpl implements IBusinessService {
                 log.info("-----------指令查询不到对应的流程:" + JSON.toJSONString(agvCallDTO));
                 continue;
             }
-            //起始库位逻辑---------------------------》
             List<BaseLocationInfo> locationFromList = this.convertLocation(agvCallDTO.getLocationFrom(), agvCallDTO.getWarehouseId());
-            //目标库位逻辑---------------------------》
             List<BaseLocationInfo> locationToList = this.convertLocation(agvCallDTO.getLocationTo(), agvCallDTO.getWarehouseId());
 
-            if (locationFromList.size() > 0) { //多个库位为库区
-
-            } else { //单个库位为指定
-                locationFrom = locationFromList.get(0);
-            }
-
-            if (locationToList.size() > 0) { //多个库位为库区
-                //分配可以使用的库位
-
-            } else {
-                //单个库位为指定
-                locationTo = locationToList.get(0);
-            }
-
-            //如果起始库位为入库区域则生成库存
-            if (locationFrom.getZoneId() == Constant.ZONE_TYPE.ZONE_IN.getValue()) {
+            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 {
-
+            } 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);
             }
 
             String taskNo = System.currentTimeMillis() + "";
@@ -207,10 +196,106 @@ public class BusinessServiceImpl implements IBusinessService {
         }
     }
 
+    @Override
+    public BaseLocationInfo zoneLocationAllocation(List<BaseLocationInfo> locationInfoList, String locationType, String type, AsnSoStrategy asnSoStrategy, AgvCallDTO agvCallDTO) {
+        BaseLocationInfo locationInfo = null;
+        if (type.equals("ASN")) {
+            //入库
+            if (locationType.equals("locationFrom")) {
+                for (BaseLocationInfo b : locationInfoList) {
+                    if (!b.getStockStatus().equals("00")) {
+                        continue;
+                    }
+                    locationInfo = b;
+                    break;
+                }
+                if (locationInfo == null) {
+                    throw new RuntimeException("没有可以分配的库位");
+                }
+            } else {
+                if (locationInfoList != null && locationInfoList.size() > 0) {
+                    locationInfo = locationAllocationStrategy.filterLockLocation(locationInfoList);
+                } else {
+                    InWarehouseDTO inWarehouseDTO = new InWarehouseDTO();
+                    inWarehouseDTO.setWarehouseId(agvCallDTO.getWarehouseId());
+                    inWarehouseDTO.setSku(agvCallDTO.getSku());
+                    inWarehouseDTO.setLocationTo(agvCallDTO.getLocationTo());
+                    inWarehouseDTO.setLocationFrom(agvCallDTO.getLocationFrom());
+                    inWarehouseDTO.setQty(agvCallDTO.getQty());
+                    inWarehouseDTO.setSupplier(agvCallDTO.getSupplier());
+                    inWarehouseDTO.setWeight(agvCallDTO.getWeight());
+                    inWarehouseDTO.setLotattDTO(agvCallDTO.getLotattDTO());
+                    locationInfo = inLocationAllocation(inWarehouseDTO);
+                }
+                if (locationInfo == null) {
+                    throw new RuntimeException("没有可以分配的库位");
+                }
+                return locationInfo;
+            }
+        } else if (type.equals("SO")) {
+            //起始库位
+            if (locationType.equals("locationFrom")) {
+                //指定库位
+                if (locationInfoList != null && locationInfoList.size() > 0) {
+                    List<Long> locationList = new ArrayList<>();
+                    for (BaseLocationInfo b : locationInfoList) {
+                        locationList.add(b.getId());
+                    }
+                    List<BaseLocationLotattVO> locationLotattVOList = baseLocationInfoMapper.selectSortedLocationLotattListByLocationIdList(locationList, agvCallDTO.getWarehouseId(), agvCallDTO.getLotattDTO().getAttr());
+                    OutWarehouseDTO outWarehouseDTO = new OutWarehouseDTO();
+                    outWarehouseDTO.setSku(agvCallDTO.getSku());
+                    outWarehouseDTO.setQty(agvCallDTO.getQty());
+                    outWarehouseDTO.setWeight(agvCallDTO.getWeight());
+                    outWarehouseDTO.setSupplier(agvCallDTO.getSupplier());
+                    outWarehouseDTO.setLotattDTO(agvCallDTO.getLotattDTO());
+                    outWarehouseDTO.setWarehouseId(agvCallDTO.getWarehouseId());
+                    locationInfo = locationAllocationStrategy.filterLockInv(locationLotattVOList, outWarehouseDTO, asnSoStrategy);
+                } else {
+                    OutWarehouseDTO outWarehouseDTO = new OutWarehouseDTO();
+                    outWarehouseDTO.setSku(agvCallDTO.getSku());
+                    outWarehouseDTO.setQty(agvCallDTO.getQty());
+                    outWarehouseDTO.setWeight(agvCallDTO.getWeight());
+                    outWarehouseDTO.setSupplier(agvCallDTO.getSupplier());
+                    outWarehouseDTO.setLotattDTO(agvCallDTO.getLotattDTO());
+                    outWarehouseDTO.setWarehouseId(agvCallDTO.getWarehouseId());
+                    locationInfo = outInvAllocation(outWarehouseDTO);
+                }
+                if (locationInfo == null) {
+                    throw new RuntimeException("没有可分配的库存");
+                }
+                return locationInfo;
+            } else { //目标库位
+                for (BaseLocationInfo b : locationInfoList) {
+                    if (!b.getStockStatus().equals("00")) {
+                        continue;
+                    }
+                    locationInfo = b;
+                    break;
+                }
+                if (locationInfo == null) {
+                    throw new RuntimeException("没有可以分配的库位");
+                }
+            }
+        } else {
+            //移库
+            for (BaseLocationInfo b : locationInfoList) {
+                if (!b.getStockStatus().equals("00")) {
+                    continue;
+                }
+                locationInfo = b;
+                break;
+            }
+            if (locationInfo == null) {
+                throw new RuntimeException("没有可以分配的库位");
+            }
+        }
+        return locationInfo;
+    }
+
     @Override
     public List<BaseLocationInfo> convertLocation(String locationNoOrZoneId, Long warehouseId) {
         List<BaseLocationInfo> locationInfoList = new ArrayList<>();
-        if (!"".equals(locationNoOrZoneId)) {
+        if (!StringUtils.isEmpty(locationNoOrZoneId)) {
             String[] arr = locationNoOrZoneId.split(",");
             for (String obj : arr) {
                 boolean isLocation = baseLocationInfoService.checkIsLocation(obj, warehouseId);
@@ -222,8 +307,6 @@ public class BusinessServiceImpl implements IBusinessService {
                     locationInfoList.addAll(infoList);
                 }
             }
-        } else {
-
         }
         return locationInfoList;
     }

+ 16 - 0
warewms-ams/src/main/java/com/ruoyi/ams/business/IBusinessService.java

@@ -1,5 +1,6 @@
 package com.ruoyi.ams.business;
 
+import com.ruoyi.ams.config.domain.AsnSoStrategy;
 import com.ruoyi.ams.config.domain.dto.AgvCallDTO;
 import com.ruoyi.ams.config.domain.dto.InWarehouseDTO;
 import com.ruoyi.ams.config.domain.dto.OutWarehouseDTO;
@@ -20,6 +21,7 @@ public interface IBusinessService {
 
     /**
      * AGV呼叫业务
+     *
      * @param agvCallDTOList
      * @return
      */
@@ -27,6 +29,7 @@ public interface IBusinessService {
 
     /**
      * 入库库位分配
+     *
      * @param inWarehouseDTO
      * @return
      */
@@ -34,10 +37,21 @@ public interface IBusinessService {
 
     /**
      * 出库库存分配
+     *
      * @return
      */
     BaseLocationInfo outInvAllocation(OutWarehouseDTO outWarehouseDTO);
 
+    /**
+     * 区域多库位分配
+     *
+     * @param locationInfoList 库位列表
+     * @param type 入库还是出库
+     * @param asnSoStrategy 策略对象
+     * @return
+     */
+    BaseLocationInfo zoneLocationAllocation(List<BaseLocationInfo> locationInfoList, String locationType, String type, AsnSoStrategy asnSoStrategy, AgvCallDTO agvCallDTO);
+
     /***
      *  根据id转换库位列表(如果是库位id直接返回库位如果是区域id则返回相应的库位)
      * @param locationNoOrZoneId 库位id或者区域id
@@ -48,12 +62,14 @@ public interface IBusinessService {
 
     /**
      * 新增任务
+     *
      * @param wcsTask
      */
     AjaxResult addTask(WcsTask wcsTask);
 
     /**
      * 下发任务
+     *
      * @param wcsTask
      * @return
      */

+ 13 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/domain/FlowConfigHeader.java

@@ -26,6 +26,10 @@ public class FlowConfigHeader extends BaseEntity {
      */
     @Excel(name = "流程名称")
     private String flowName;
+    /**
+     * 操作类型
+     */
+    private String flowType;
 
     /**
      * 物料类型
@@ -309,11 +313,20 @@ public class FlowConfigHeader extends BaseEntity {
         this.remark = remark;
     }
 
+    public String getFlowType() {
+        return flowType;
+    }
+
+    public void setFlowType(String flowType) {
+        this.flowType = flowType;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                 .append("id", getId())
                 .append("flowName", getFlowName())
+                .append("flowType", getFlowType())
                 .append("skuType", getSkuType())
                 .append("skuTypeFlag", getSkuTypeFlag())
                 .append("qty", getQty())

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

@@ -21,6 +21,8 @@ public class FlowConfigForm {
      */
     private String flowName;
 
+    private String flowType;
+
     /**
      * 物料类型
      */
@@ -286,4 +288,12 @@ public class FlowConfigForm {
     public void setRemark(String remark) {
         this.remark = remark;
     }
+
+    public String getFlowType() {
+        return flowType;
+    }
+
+    public void setFlowType(String flowType) {
+        this.flowType = flowType;
+    }
 }

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

@@ -22,6 +22,8 @@ public class FlowConfigHeaderVO extends BaseEntity {
     @Excel(name = "流程名称")
     private String flowName;
 
+    private String flowType;
+
     /** 物料类型 */
     @Excel(name = "物料类型")
     private String skuType;
@@ -280,6 +282,14 @@ public class FlowConfigHeaderVO extends BaseEntity {
         this.locationToStrategyFlag = locationToStrategyFlag;
     }
 
+    public String getFlowType() {
+        return flowType;
+    }
+
+    public void setFlowType(String flowType) {
+        this.flowType = flowType;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

+ 10 - 0
warewms-ams/src/main/java/com/ruoyi/ams/config/domain/vo/FlowConfigVO.java

@@ -21,6 +21,8 @@ public class FlowConfigVO extends BaseEntity {
     /** 流程名称 */
     private String flowName;
 
+    private String flowType;
+
     /** 物料类型 */
     private Long[] skuType;
 
@@ -249,4 +251,12 @@ public class FlowConfigVO extends BaseEntity {
     public void setLocationToStrategyFlag(String locationToStrategyFlag) {
         this.locationToStrategyFlag = locationToStrategyFlag;
     }
+
+    public String getFlowType() {
+        return flowType;
+    }
+
+    public void setFlowType(String flowType) {
+        this.flowType = flowType;
+    }
 }

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

@@ -203,7 +203,7 @@ public class FlowConfigHeaderServiceImpl implements IFlowConfigHeaderService {
             return AjaxResult.error("该流程名称已存在");
         }
 
-        List<String> headerLocationFrom = new ArrayList<>();
+        /*List<String> headerLocationFrom = new ArrayList<>();
         List<String> headerLocationTo = new ArrayList<>();
         List<FlowConfigHeader> headerList = flowConfigHeaderMapper.selectFlowConfigHeaderList(null);
         if (headerList != null && headerList.size() > 0) {
@@ -212,7 +212,7 @@ public class FlowConfigHeaderServiceImpl implements IFlowConfigHeaderService {
                 headerLocationTo.add(header.getLocationTo() + ",");
             }
         }
-        /*if (headerLocationFrom.size() > 0) {
+        if (headerLocationFrom.size() > 0) {
             List<String> currentLocationFrom = Arrays.asList(flowConfigForm.getLocationFrom());
             if (headerLocationFrom.containsAll(currentLocationFrom)) {
                 return AjaxResult.error("起始区域不能重复");

+ 14 - 0
warewms-ams/src/main/java/com/ruoyi/ams/lineCall/service/impl/LineCallServiceImpl.java

@@ -5,8 +5,10 @@ import com.ruoyi.ams.config.mapper.FlowConfigHeaderMapper;
 import com.ruoyi.ams.lineCall.domain.vo.LineCallVO;
 import com.ruoyi.ams.lineCall.service.ILineCallService;
 import com.ruoyi.base.domain.BaseLocationInfo;
+import com.ruoyi.base.domain.BaseLocationZone;
 import com.ruoyi.base.domain.BaseSku;
 import com.ruoyi.base.service.IBaseLocationInfoService;
+import com.ruoyi.base.service.IBaseLocationZoneService;
 import com.ruoyi.base.service.IBaseSkuService;
 import com.ruoyi.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,6 +31,8 @@ public class LineCallServiceImpl implements ILineCallService {
     @Autowired
     private IBaseLocationInfoService baseLocationInfoService;
     @Autowired
+    private IBaseLocationZoneService baseLocationZoneService;
+    @Autowired
     private IBaseSkuService baseSkuService;
 
     @Override
@@ -62,6 +66,16 @@ public class LineCallServiceImpl implements ILineCallService {
                 locationFromList.add(b);
             } else {
                 //如果是区域把区域内的库位查询出来
+                BaseLocationZone zoneQuery = baseLocationZoneService.selectBaseLocationZoneByZoneId(Long.parseLong(s));
+
+                BaseLocationInfo locZone = new BaseLocationInfo();
+                locZone.setId(Long.parseLong(s));
+                locZone.setLocationNo("-"+zoneQuery.getZoneName());
+                locZone.setZoneId(Long.parseLong(s));
+                locZone.setWarehouseId(warehouseId);
+                locZone.setStockStatus("00");
+                locationFromList.add(locZone);
+
                 BaseLocationInfo query = new BaseLocationInfo();
                 query.setWarehouseId(warehouseId);
                 query.setZoneId(Long.parseLong(s));

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

@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="FlowConfigHeader" id="FlowConfigHeaderResult">
         <result property="id"    column="id"    />
         <result property="flowName"    column="flow_name"    />
+        <result property="flowType"    column="flow_type"    />
         <result property="skuType"    column="sku_type"    />
         <result property="skuTypeFlag"    column="sku_type_flag"    />
         <result property="qty"    column="qty"    />
@@ -36,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="FlowConfigHeader" id="FlowConfigHeaderVOResult">
         <result property="id"    column="id"    />
         <result property="flowName"    column="flow_name"    />
+        <result property="flowType"    column="flow_type"    />
         <result property="skuType"    column="sku_type"    />
         <result property="skuTypeFlag"    column="sku_type_flag"    />
         <result property="qty"    column="qty"    />
@@ -90,7 +92,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,location_from_strategy_flag ,location_to_strategy_flag   from flow_config_header
+        select id, flow_name,flow_type, 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">
@@ -108,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     
     <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,
+        select a.id, a.flow_name,a.flow_type, 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.location_from_strategy_flag,a.location_to_strategy_flag
         from flow_config_header a
@@ -121,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into flow_config_header
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="flowName != null">flow_name,</if>
+            <if test="flowType != null">flow_type,</if>
             <if test="skuType != null">sku_type,</if>
             <if test="skuTypeFlag != null">sku_type_flag,</if>
             <if test="qty != null">qty,</if>
@@ -148,6 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="flowName != null">#{flowName},</if>
+            <if test="flowType != null">#{flowType},</if>
             <if test="skuType != null">#{skuType},</if>
             <if test="skuTypeFlag != null">#{skuTypeFlag},</if>
             <if test="qty != null">#{qty},</if>
@@ -179,6 +183,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update flow_config_header
         <trim prefix="SET" suffixOverrides=",">
             <if test="flowName != null">flow_name = #{flowName},</if>
+            <if test="flowType != null">flow_type = #{flowType},</if>
             <if test="skuType != null">sku_type = #{skuType},</if>
             <if test="skuTypeFlag != null">sku_type_flag = #{skuTypeFlag},</if>
             <if test="qty != null">qty = #{qty},</if>

+ 2 - 0
warewms-base/src/main/java/com/ruoyi/base/mapper/BaseLocationInfoMapper.java

@@ -97,6 +97,8 @@ public interface BaseLocationInfoMapper {
      */
     List<BaseLocationLotattVO> selectSortedLocationLotattListByZoneIdList(@Param("zoneId") List<Long> zoneId,@Param("warehouseId")Long warehouseId,@Param("lotatt") Map<String, String> lotatt);
 
+    List<BaseLocationLotattVO> selectSortedLocationLotattListByLocationIdList(@Param("locationId") List<Long> locationId,@Param("warehouseId")Long warehouseId,@Param("lotatt") Map<String, String> lotatt);
+
     LotattVO selectInvLotattById(@Param("id") Long id);
 
     /**

+ 32 - 0
warewms-base/src/main/resources/mapper/base/BaseLocationInfoMapper.xml

@@ -412,4 +412,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="lotatt.lotatt18 != null and lotatt.lotatt18 != ''"> and att.lotatt18 = #{lotatt.lotatt18}</if>
         order by lpad(row_no, 11, '0'),row_index,lpad(shift_no, 11, '0'),shift_index,lpad(col_no, 11, '0'),col_index
     </select>
+
+    <select id="selectSortedLocationLotattListByLocationIdList" parameterType="BaseLocationInfo" resultMap="BaseLocationInfoLotattResult">
+        select b.id, b.warehouse_id, b.zone_id, b.location_no, b.location_barcode, b.row_no, b.row_index, b.col_no, b.col_index, b.shift_no,
+        b.shift_index, b.stock_status, b.is_empty, b.bind_sku, b.location_type,  b.rack_id,  b.agv_station,  b.folded_tag,  b.folded_count,
+        b.userdefine1, b.userdefine2, b.userdefine3, b.userdefine4,  b.userdefine5,  b.userdefine6,  b.userdefine7,  b.userdefine8,
+        b.userdefine9, b.userdefine10, b.create_by, b.create_time,  b.update_by,  b.update_time,  b.remark, inv.sku, inv.qty, height_limit, weight_limit, att.*
+        from base_location_info b left join inv_lot_loc_id inv on b.id = inv.location_id
+        left join inv_lot_att att on inv.lotnum = att.lotnum
+        where warehouse_id = #{warehouseId} and inv.sku is not null and id in
+        <foreach item="item" collection="locationId" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        <if test="lotatt.lotatt01 != null and lotatt.lotatt01 != ''"> and att.lotatt01 = #{lotatt.lotatt01}</if>
+        <if test="lotatt.lotatt02 != null and lotatt.lotatt02 != ''"> and att.lotatt02 = #{lotatt.lotatt02}</if>
+        <if test="lotatt.lotatt03 != null and lotatt.lotatt03 != ''"> and att.lotatt03 = #{lotatt.lotatt03}</if>
+        <if test="lotatt.lotatt04 != null and lotatt.lotatt04 != ''"> and att.lotatt04 = #{lotatt.lotatt04}</if>
+        <if test="lotatt.lotatt05 != null and lotatt.lotatt05 != ''"> and att.lotatt05 = #{lotatt.lotatt05}</if>
+        <if test="lotatt.lotatt06 != null and lotatt.lotatt06 != ''"> and att.lotatt06 = #{lotatt.lotatt06}</if>
+        <if test="lotatt.lotatt07 != null and lotatt.lotatt07 != ''"> and att.lotatt07 = #{lotatt.lotatt07}</if>
+        <if test="lotatt.lotatt08 != null and lotatt.lotatt08 != ''"> and att.lotatt08 = #{lotatt.lotatt08}</if>
+        <if test="lotatt.lotatt09 != null and lotatt.lotatt09 != ''"> and att.lotatt09 = #{lotatt.lotatt09}</if>
+        <if test="lotatt.lotatt10 != null and lotatt.lotatt10 != ''"> and att.lotatt10 = #{lotatt.lotatt10}</if>
+        <if test="lotatt.lotatt11 != null and lotatt.lotatt11 != ''"> and att.lotatt11 = #{lotatt.lotatt11}</if>
+        <if test="lotatt.lotatt12 != null and lotatt.lotatt12 != ''"> and att.lotatt12 = #{lotatt.lotatt12}</if>
+        <if test="lotatt.lotatt13 != null and lotatt.lotatt13 != ''"> and att.lotatt13 = #{lotatt.lotatt13}</if>
+        <if test="lotatt.lotatt14 != null and lotatt.lotatt14 != ''"> and att.lotatt14 = #{lotatt.lotatt14}</if>
+        <if test="lotatt.lotatt15 != null and lotatt.lotatt15 != ''"> and att.lotatt15 = #{lotatt.lotatt15}</if>
+        <if test="lotatt.lotatt16 != null and lotatt.lotatt16 != ''"> and att.lotatt16 = #{lotatt.lotatt16}</if>
+        <if test="lotatt.lotatt17 != null and lotatt.lotatt17 != ''"> and att.lotatt17 = #{lotatt.lotatt17}</if>
+        <if test="lotatt.lotatt18 != null and lotatt.lotatt18 != ''"> and att.lotatt18 = #{lotatt.lotatt18}</if>
+        order by lpad(row_no, 11, '0'),row_index,lpad(shift_no, 11, '0'),shift_index,lpad(col_no, 11, '0'),col_index
+    </select>
 </mapper>