andy 3 éve
szülő
commit
f934ec6d2b

+ 0 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/LineCallController.java

@@ -1,6 +1,5 @@
 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;

+ 1 - 1
ruoyi-ui/src/views/ams/inv/invLotLocId/index.vue

@@ -72,7 +72,7 @@
     </el-row>-->
 
     <el-table v-loading="loading" :data="invLotLocIdList" @selection-change="handleSelectionChange">
-      <el-table-column label="lotnum" align="center" prop="lotnum" width="200"/>
+      <!--<el-table-column label="lotnum" align="center" prop="lotnum" width="200"/>-->
       <el-table-column label="物料" align="center" prop="sku" width="200"/>
       <el-table-column label="物料名称" align="center" prop="skuName" width="200"/>
       <el-table-column label="库位" align="center" prop="locationNo" width="200"/>

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

@@ -167,7 +167,7 @@
         </el-table>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="addDetail">添 加</el-button>
+        <el-button v-if="showAddDetails" type="primary" @click="addDetail">添 加</el-button>
         <el-button type="primary" @click="submitForm">执 行</el-button>
         <el-button type="primary" @click="cancel">取 消</el-button>
       </div>
@@ -246,7 +246,8 @@
         locationToCombo: undefined,
         attShowFlag: false,
         tableOption: [],
-        subData: []
+        subData: [],
+        showAddDetails: true
       };
     },
     created() {
@@ -306,7 +307,8 @@
           updateBy: null,
           updateTime: null,
           remark: null,
-          lineCallDetailsFormList: null
+          lineCallDetailsFormList: null,
+          flowType: null
         };
         this.flowConfigDetailsList = [];
         this.resetForm("form");
@@ -357,6 +359,7 @@
           this.form.supplierFlag = response.supplierFlag
           this.form.locationFromFlag = response.locationFromFlag
           this.form.locationToFlag = response.locationToFlag
+          this.form.flowType = response.flowType
           this.skuTypeCombo = response.skuList;
           this.form.id = response.id
 
@@ -396,6 +399,12 @@
             ]
           }
 
+          if (this.form.flowType === 'ASN') {
+            this.showAddDetails = true
+          } else {
+            this.showAddDetails = false
+          }
+
           this.open = true;
           this.title = row.flowName;
         });

+ 3 - 1
warewms-ams/src/main/java/com/ruoyi/ams/business/BusinessServiceImpl.java

@@ -101,8 +101,10 @@ public class BusinessServiceImpl implements IBusinessService {
                 invLotLocIdService.initInv(locationFrom.getId().toString(), 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);
@@ -276,7 +278,7 @@ public class BusinessServiceImpl implements IBusinessService {
                 return locationInfo;
             } else { //目标库位
                 for (BaseLocationInfo b : locationInfoList) {
-                    if (!b.getStockStatus().equals("00")) {
+                    if (!b.getStockStatus().equals("00") || !b.getIsEmpty().equals("Y")) {
                         continue;
                     }
                     locationInfo = b;

+ 13 - 0
warewms-ams/src/main/java/com/ruoyi/ams/inv/mapper/InvLotLocIdMapper.java

@@ -115,5 +115,18 @@ public interface InvLotLocIdMapper
      */
     int updateInvLotLocIdLocationId(@Param("locationFrom") Long locationFrom,@Param("locationTo") Long locationTo);
 
+    /**
+     * 清除库位库存信息
+     * @param locationId
+     * @return
+     */
     int clearInvByLocationId(@Param("locationId") Long locationId);
+
+    /**
+     * 根据物料查询库位库存信息
+     * @param sku
+     * @param lotattDTO
+     * @return
+     */
+    Double queryInvBySku(@Param("sku") String sku, @Param("lotattDTO") LotattDTO lotattDTO);
 }

+ 12 - 2
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/IInvLotLocIdService.java

@@ -90,6 +90,7 @@ public interface IInvLotLocIdService {
 
     /**
      * 根据库位id查询库位库存包含批次属性
+     *
      * @param locationId
      * @return
      */
@@ -97,9 +98,18 @@ public interface IInvLotLocIdService {
 
     /**
      * 库存转移
+     *
      * @param locationFrom 起始点位
-     * @param locationTo 目标点位
+     * @param locationTo   目标点位
+     * @return
+     */
+    int stockTransfer(Long locationFrom, Long locationTo);
+
+    /**
+     * 根据物料编号和批次属性查询库存数量
+     * @param sku
+     * @param lotattDTO
      * @return
      */
-    int stockTransfer(Long locationFrom,Long locationTo);
+    Double queryInvBySku(String sku, LotattDTO lotattDTO);
 }

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

@@ -177,4 +177,9 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
     public int stockTransfer(Long locationFrom, Long locationTo) {
         return invLotLocIdMapper.updateInvLotLocIdLocationId(locationFrom, locationTo);
     }
+
+    @Override
+    public Double queryInvBySku(String sku, LotattDTO lotattDTO) {
+        return null;
+    }
 }

+ 9 - 0
warewms-ams/src/main/java/com/ruoyi/ams/lineCall/domain/vo/LineCallVO.java

@@ -30,6 +30,7 @@ public class LineCallVO {
     private String locationFromFlag;
     private List<BaseLocationInfo> locationTo;
     private String locationToFlag;
+    private String flowType;
 
     public List<BaseSku> getSkuList() {
         return skuList;
@@ -166,4 +167,12 @@ public class LineCallVO {
     public void setId(Long id) {
         this.id = id;
     }
+
+    public String getFlowType() {
+        return flowType;
+    }
+
+    public void setFlowType(String flowType) {
+        this.flowType = flowType;
+    }
 }

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

@@ -151,6 +151,7 @@ public class LineCallServiceImpl implements ILineCallService {
         lineCallVO.setWeightFlag(flowConfigHeaderVO.getWeightFlag());
         lineCallVO.setSupplierFlag(flowConfigHeaderVO.getSupplierFlag());
         lineCallVO.setId(flowConfigHeaderVO.getId());
+        lineCallVO.setFlowType(flowConfigHeaderVO.getFlowType());
         return lineCallVO;
     }
 }

+ 33 - 0
warewms-ams/src/main/resources/mapper/ams/InvLotLocIdMapper.xml

@@ -309,4 +309,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="clearInvByLocationId">
        delete from inv_lot_loc_id where location_id = #{locationId}
     </update>
+
+    <select id="queryInvBySku" resultType="double">
+        select
+        count(inv.qty) qty
+        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 base_location_zone bz on b.zone_id = bz.zone_id
+        <where>
+            <if test="sku != null  and sku != ''"> and sk.sku = #{sku}</if>
+            <if test="lotattDTO.lotatt01 != null  and lotattDTO.lotatt01 != ''"> and att.lotatt01 = #{lotattDTO.lotatt01}</if>
+            <if test="lotattDTO.lotatt02 != null  and lotattDTO.lotatt02 != ''"> and att.lotatt02 = #{lotattDTO.lotatt02}</if>
+            <if test="lotattDTO.lotatt03 != null  and lotattDTO.lotatt03 != ''"> and att.lotatt03 = #{lotattDTO.lotatt03}</if>
+            <if test="lotattDTO.lotatt04 != null  and lotattDTO.lotatt04 != ''"> and att.lotatt04 = #{lotattDTO.lotatt04}</if>
+            <if test="lotattDTO.lotatt05 != null  and lotattDTO.lotatt05 != ''"> and att.lotatt05 = #{lotattDTO.lotatt05}</if>
+            <if test="lotattDTO.lotatt06 != null  and lotattDTO.lotatt06 != ''"> and att.lotatt06 = #{lotattDTO.lotatt06}</if>
+            <if test="lotattDTO.lotatt07 != null  and lotattDTO.lotatt07 != ''"> and att.lotatt07 = #{lotattDTO.lotatt07}</if>
+            <if test="lotattDTO.lotatt08 != null  and lotattDTO.lotatt08 != ''"> and att.lotatt08 = #{lotattDTO.lotatt08}</if>
+            <if test="lotattDTO.lotatt09 != null  and lotattDTO.lotatt09 != ''"> and att.lotatt09 = #{lotattDTO.lotatt09}</if>
+            <if test="lotattDTO.lotatt10 != null  and lotattDTO.lotatt10 != ''"> and att.lotatt10 = #{lotattDTO.lotatt10}</if>
+            <if test="lotattDTO.lotatt11 != null  and lotattDTO.lotatt11 != ''"> and att.lotatt11 = #{lotattDTO.lotatt11}</if>
+            <if test="lotattDTO.lotatt12 != null  and lotattDTO.lotatt12 != ''"> and att.lotatt12 = #{lotattDTO.lotatt12}</if>
+            <if test="lotattDTO.lotatt13 != null  and lotattDTO.lotatt13 != ''"> and att.lotatt13 = #{lotattDTO.lotatt13}</if>
+            <if test="lotattDTO.lotatt14 != null  and lotattDTO.lotatt14 != ''"> and att.lotatt14 = #{lotattDTO.lotatt14}</if>
+            <if test="lotattDTO.lotatt15 != null  and lotattDTO.lotatt15 != ''"> and att.lotatt15 = #{lotattDTO.lotatt15}</if>
+            <if test="lotattDTO.lotatt16 != null  and lotattDTO.lotatt16 != ''"> and att.lotatt16 = #{lotattDTO.lotatt16}</if>
+            <if test="lotattDTO.lotatt17 != null  and lotattDTO.lotatt17 != ''"> and att.lotatt17 = #{lotattDTO.lotatt17}</if>
+            <if test="lotattDTO.lotatt18 != null  and lotattDTO.lotatt18 != ''"> and att.lotatt18 = #{lotattDTO.lotatt18}</if>
+        </where>
+        and bz.userdefine1 = 'INV'
+    </select>
 </mapper>