Selaa lähdekoodia

1.成品下线复称在裹膜之后
2.空托上线代码优化
3.测试修改

k 1 vuosi sitten
vanhempi
commit
818e42f8ad

+ 31 - 4
ruoyi-admin/src/main/java/com/ruoyi/nieyan/controller/pda/PdaAgvCallController.java

@@ -184,6 +184,10 @@ public class PdaAgvCallController {
         String createUser = agvCallForm.getCreateUser();
         Boolean theWrapped = agvCallForm.getTheWrapped(); // 是否裹膜
         Boolean theWeighing = agvCallForm.getTheWeighing(); // 是否复称
+        // 如果裹膜,就先不去称重
+        if (theWrapped) {
+            theWeighing = false;
+        }
         List<AgvCallItemDTO> agvCallItemDTOList = agvCallForm.getAgvCallItemDTOList();
         return theWrapped ?
                 agvCallProxyService.productsDownLineLSN(locationFrom, locationTo, createUser
@@ -211,6 +215,10 @@ public class PdaAgvCallController {
         String createUser = agvCallForm.getCreateUser();
         Boolean theWrapped = agvCallForm.getTheWrapped();
         Boolean theWeighing = agvCallForm.getTheWeighing();
+        // 如果裹膜,就先不去称重
+        if (theWrapped) {
+            theWeighing = false;
+        }
         List<AgvCallItemDTO> agvCallItemDTOList = agvCallForm.getAgvCallItemDTOList();
         return theWrapped ?
                 agvCallProxyService.productsDownLineLHN(locationFrom, locationTo, createUser
@@ -233,10 +241,10 @@ public class PdaAgvCallController {
         String locationFrom = agvCallForm.getLocationFrom();
         String locationTo = agvCallForm.getLocationTo();
         String createUser = agvCallForm.getCreateUser();
-        Boolean theWeighing = agvCallForm.getTheWeighing();
+//        Boolean theWeighing = agvCallForm.getTheWeighing();
         return agvCallProxyService.productsDownLineWrappingFilmLSN(locationFrom, locationTo
                 , createUser
-                , theWeighing);
+                , null);
     }
 
     /**
@@ -252,10 +260,10 @@ public class PdaAgvCallController {
         String locationFrom = agvCallForm.getLocationFrom();
         String locationTo = agvCallForm.getLocationTo();
         String createUser = agvCallForm.getCreateUser();
-        Boolean theWeighing = agvCallForm.getTheWeighing();
+//        Boolean theWeighing = agvCallForm.getTheWeighing();
         return agvCallProxyService.productsDownLineWrappingFilmLHN(locationFrom, locationTo
                 , createUser
-                , theWeighing);
+                , false);
     }
 
     /**
@@ -318,4 +326,23 @@ public class PdaAgvCallController {
         return invLotLocIdService.accessoriesMove(invLotLocIdMoveForm);
     }
 
+    /**
+     * 库存清理
+     *
+     * @param agvCallForm
+     * @return
+     */
+    @ApiOperation("库存清理")
+    @PostMapping("clear")
+    public AjaxResult clear(@RequestBody AgvCallForm agvCallForm) {
+        if (StringUtils.isEmpty(agvCallForm.getLocationFrom())) {
+            return AjaxResult.error("起始库位为空!");
+        }
+        String locationFrom = agvCallForm.getLocationFrom();
+        String locationTo = agvCallForm.getLocationTo();
+        String createUser = agvCallForm.getCreateUser();
+        return invLotLocIdService.clear(locationFrom, Constant.WAREHOUSE_ID
+                , createUser);
+    }
+
 }

+ 9 - 9
ruoyi-ui/src/views/ams/task/index.vue

@@ -148,15 +148,15 @@
           v-hasPermi="['ams:wcsTask:add']"
         >新增</el-button>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleCharge"
-        >充电任务</el-button>
-      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="primary"-->
+<!--          plain-->
+<!--          icon="el-icon-plus"-->
+<!--          size="mini"-->
+<!--          @click="handleCharge"-->
+<!--        >充电任务</el-button>-->
+<!--      </el-col>-->
       <!--<el-col :span="1.5">
         <el-button
           type="success"

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

@@ -153,13 +153,21 @@ public class BusinessServiceImpl implements IBusinessService {
                     wcsTaskList.addAll(this.genTask(locationFrom, locationTo, flowConfigHeaderVO, agvCallDTO, token));
 
                 } else if (flowConfigHeaderVO.getFlowType().equals("SO")) {
-                    AgvCallItemDTO agvCall = agvCallDTO.getAgvCallItemDTOList().get(0);
-                    List<BaseLocationInfo> locationFromList = this.convertLocation(paramLocationFrom, agvCallDTO.getWarehouseId(), null);
+                    List<BaseLocationInfo> locationFromListEnd = new ArrayList<>();
+                    boolean isLocation = baseLocationInfoService.checkIsLocation(paramLocationFrom, Constant.WAREHOUSE_ID);
+                    if (isLocation) {
+                        BaseLocationInfo info = baseLocationInfoService.selectBaseLocationInfoByIdOrNo(paramLocationFrom, Constant.WAREHOUSE_ID);
+                        locationFromListEnd.add(info);
+                    }
+                    if (locationFromListEnd.size() == 0) {
+                        AgvCallItemDTO agvCall = agvCallDTO.getAgvCallItemDTOList().get(0);
+                        HashMap<String, String> hashMap = JSON.parseObject(JSON.toJSONString(agvCall.getLotattDTO()), HashMap.class);
+                        List<BaseLocationInfo> locationFromList = baseLocationInfoMapper.selectSortedLocationLotattListByZoneIdListOrderBy(zoneIdList
+                                , agvCallDTO.getWarehouseId(), hashMap, agvCall.getSku(), "inv.create_time");
+                        locationFromListEnd = locationFromList;
+                    }
                     List<BaseLocationInfo> locationToList = this.convertLocation(paramLocationTo, agvCallDTO.getWarehouseId(), null);
-//                    HashMap<String, String> hashMap = JSON.parseObject(JSON.toJSONString(agvCall.getLotattDTO()), HashMap.class);
-//                    List<BaseLocationInfo> locationFromList = baseLocationInfoMapper.selectSortedLocationLotattListByZoneIdListOrderBy(zoneIdList
-//                            , agvCallDTO.getWarehouseId(), hashMap, agvCall.getSku(), "inv.create_time");
-                    locationFrom = this.zoneLocationAllocation(locationFromList, "locationFrom", "SO", asnSoStrategy, token);
+                    locationFrom = this.zoneLocationAllocation(locationFromListEnd, "locationFrom", "SO", asnSoStrategy, token);
                     locationTo = this.zoneLocationAllocation(locationToList, "locationTo", "SO", asnSoStrategy, token);
                     wcsTaskList.addAll(this.genTask(locationFrom, locationTo, flowConfigHeaderVO, agvCallDTO, token));
 
@@ -179,6 +187,7 @@ public class BusinessServiceImpl implements IBusinessService {
             }
             return AjaxResult.success("任务下发成功");
         } catch (Exception e) {
+            log.error("任务下发失败!",e);
             redisCache.unlockCacheObject(token); // 异常捕获的话就不能释放锁
             throw new ServiceException(e.getMessage(), token);
         }
@@ -300,11 +309,11 @@ public class BusinessServiceImpl implements IBusinessService {
             locationInfo = checkTheSameColumnLocation(locationInfoList, token, false);
             if (locationInfo == null) {
                 if (type.equals("ASN")) { // 入库
-                    fromMsg = "入库起始点没有可以分配的库存!";
+                    fromMsg = "起始点没有可以分配的库存!";
                 } else if (type.equals("SO")) { // 出库
-                    fromMsg = "出库起始点没有可以分配的库存!";
+                    fromMsg = "起始点没有可以分配的库存!";
                 } else { //移库
-                    fromMsg = "搬运起始点没有可以分配的库位";
+                    fromMsg = "起始点没有可以分配的库位";
                 }
                 throw new ServiceException(fromMsg, token);
             }
@@ -314,11 +323,11 @@ public class BusinessServiceImpl implements IBusinessService {
             locationInfo = checkTheSameColumnLocation(locationInfoList, token, true);
             if (locationInfo == null) {
                 if (type.equals("ASN")) { // 入库
-                    toMsg = "入库目标点没有可以分配的库位";
+                    toMsg = "目标点没有可以分配的库位";
                 } else if (type.equals("SO")) { // 出库
-                    toMsg = "出库目标点没有可以分配的库位";
+                    toMsg = "目标点没有可以分配的库位";
                 } else { //移库
-                    toMsg = "搬运目标点没有可以分配的库位";
+                    toMsg = "目标点没有可以分配的库位";
                 }
                 throw new ServiceException(toMsg, token);
             }
@@ -439,7 +448,8 @@ public class BusinessServiceImpl implements IBusinessService {
             wcsTask.setExt8(token.toString());
             wcsTask.setExt7(flowConfigHeaderVO.getId().toString());
             // 是否复称
-//            wcsTask.setExt3(agvCallDTO == null ? "" : agvCallDTO.getTheWeighing() ? "0001" : "0000");
+            wcsTask.setExt3(agvCallDTO.getTheWeighing() == null ? "0000"
+                    : agvCallDTO.getTheWeighing() ? "0001" : "0000");
             wcsTask.setExtParam(agvCallDTO.getExtParam());
             wcsTaskList.add(wcsTask);
             businessService.addTask(wcsTask);

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

@@ -358,7 +358,7 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
         // 是否任务空闲
         Boolean isIdle = baseLocationInfoService.verifyLocationIsIdle(locationId, warehouseId);
         if (!isIdle) {
-            return AjaxResult.error("库位需要空闲状态!" + locationId);
+            return AjaxResult.error("库位需要空闲状态!" + baseLocationInfo.getLocationNo());
         }
         // 获取库存
         List<InvLotLocId> invLotLocIdList = selectInvLotLocIdList(id);

+ 51 - 2
warewms-ams/src/main/java/com/ruoyi/ams/nieyan/service/AgvCallProxyService.java

@@ -3,7 +3,10 @@ package com.ruoyi.ams.nieyan.service;
 import com.ruoyi.ams.business.IBusinessService;
 import com.ruoyi.ams.config.domain.dto.AgvCallDTO;
 import com.ruoyi.ams.config.domain.dto.AgvCallItemDTO;
+import com.ruoyi.ams.inv.domain.vo.InvLotLocIdLotattVO;
+import com.ruoyi.ams.inv.service.IInvLotLocIdService;
 import com.ruoyi.base.constant.Constant;
+import com.ruoyi.base.service.IBaseLocationInfoService;
 import com.ruoyi.common.core.domain.AjaxResult;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,6 +28,10 @@ public class AgvCallProxyService {
 
     @Autowired
     private IBusinessService iBusinessService;
+    @Autowired
+    private IInvLotLocIdService invLotLocIdService;
+    @Autowired
+    private IBaseLocationInfoService baseLocationInfoService;
 
 
     /**
@@ -58,6 +65,10 @@ public class AgvCallProxyService {
      * @return
      */
     public AjaxResult emptyFeedingLSN(String locationFrom, String locationTo, String createUser) {
+        // 1.释放目标点库存2.将目标点更改为无货
+        invLotLocIdService.deleteInvLotLocIdById(Long.valueOf(locationTo));
+        baseLocationInfoService.unOccupyLocation(Long.valueOf(locationTo), Constant.WAREHOUSE_ID, createUser);
+        // 1.起始点创建空托库存2.生成任务
         AgvCallDTO agvCallDTO = new AgvCallDTO();
         agvCallDTO.setLocationFrom(locationFrom);
         agvCallDTO.setLocationTo(locationTo);
@@ -79,6 +90,10 @@ public class AgvCallProxyService {
      * @return
      */
     public AjaxResult emptyFeedingLHN(String locationFrom, String locationTo, String createUser) {
+        // 1.释放目标点库存2.将目标点更改为无货
+        invLotLocIdService.deleteInvLotLocIdById(Long.valueOf(locationTo));
+        baseLocationInfoService.unOccupyLocation(Long.valueOf(locationTo), Constant.WAREHOUSE_ID, createUser);
+        // 1.起始点创建空托库存2.生成任务
         AgvCallDTO agvCallDTO = new AgvCallDTO();
         agvCallDTO.setLocationFrom(locationFrom);
         agvCallDTO.setLocationTo(locationTo);
@@ -230,6 +245,19 @@ public class AgvCallProxyService {
      */
     public AjaxResult productsDownLineWrappingFilmLSN(String locationFrom, String locationTo, String createUser
             , Boolean theWeighing) {
+        // 查出裹膜位的库存
+        List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattByLocationId(Long.valueOf(locationFrom));
+        if (invLotLocIdLotattVOList.size() > 0) {
+            InvLotLocIdLotattVO invLotLocIdLotattVO = invLotLocIdLotattVOList.get(0);
+            if (invLotLocIdLotattVO.getLotatt12() != null
+                    && invLotLocIdLotattVO.getLotatt12().equals(Constant.IS_YES.Y.name())) {
+                theWeighing = true;
+            }else {
+                theWeighing = false;
+            }
+        }else {
+            return AjaxResult.error("裹膜点无货!");
+        }
         AgvCallDTO agvCallDTO = new AgvCallDTO();
         agvCallDTO.setLocationFrom(locationFrom);
         agvCallDTO.setLocationTo(locationTo);
@@ -292,6 +320,19 @@ public class AgvCallProxyService {
      */
     public AjaxResult productsDownLineWrappingFilmLHN(String locationFrom, String locationTo, String createUser
             , Boolean theWeighing) {
+        // 查出裹膜位的库存
+        List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattByLocationId(Long.valueOf(locationFrom));
+        if (invLotLocIdLotattVOList.size() > 0) {
+            InvLotLocIdLotattVO invLotLocIdLotattVO = invLotLocIdLotattVOList.get(0);
+            if (invLotLocIdLotattVO.getLotatt12() != null
+                    && invLotLocIdLotattVO.getLotatt12().equals(Constant.IS_YES.Y.name())) {
+                theWeighing = true;
+            }else {
+                theWeighing = false;
+            }
+        }else{
+            return AjaxResult.error("裹膜点无货!");
+        }
         AgvCallDTO agvCallDTO = new AgvCallDTO();
         agvCallDTO.setLocationFrom(locationFrom);
         agvCallDTO.setLocationTo(locationTo);
@@ -309,7 +350,11 @@ public class AgvCallProxyService {
      * @return
      */
     public AjaxResult productsOutboundLSN(String locationFrom, String locationTo, String createUser) {
-        // todo 判断起始库位库存需要位合格
+        // todo 判断起始库位库存需要是合格
+        List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattByLocationId(Long.valueOf(locationFrom));
+        if (invLotLocIdLotattVOList.size() == 0) {
+            return AjaxResult.error("所选库位无库存!");
+        }
         AgvCallDTO agvCallDTO = new AgvCallDTO();
         agvCallDTO.setLocationFrom(locationFrom);
         agvCallDTO.setLocationTo(locationTo);
@@ -326,7 +371,11 @@ public class AgvCallProxyService {
      * @return
      */
     public AjaxResult productsOutboundLHN(String locationFrom, String locationTo, String createUser) {
-        // todo 判断起始库位库存需要位合格
+        // todo 判断起始库位库存需要是合格
+        List<InvLotLocIdLotattVO> invLotLocIdLotattVOList = invLotLocIdService.selectInvLocIdLotattByLocationId(Long.valueOf(locationFrom));
+        if (invLotLocIdLotattVOList.size() == 0) {
+            return AjaxResult.error("所选库位无库存!");
+        }
         AgvCallDTO agvCallDTO = new AgvCallDTO();
         agvCallDTO.setLocationFrom(locationFrom);
         agvCallDTO.setLocationTo(locationTo);

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

@@ -375,8 +375,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectInvLocIdLotattByLocationId" resultMap="InvLotLocIdLotattResult">
         select
-            inv.location_id,sk.sku,sk.desc1 sku_name,b.location_no,inv.qty,inv.qtyallocated
-            ,att.lotnum, att.customer_id, lotatt01, lotatt02, lotatt03, lotatt04,qua.dict_label lotatt05, lotatt06, lotatt07, lotatt08, lotatt09, lotatt10, lotatt11, lotatt12, lotatt13, lotatt14, lotatt15, lotatt16, lotatt17, lotatt18
+            inv.location_id,inv.sku,sk.desc1 sku_name,b.location_no,inv.qty,inv.qtyallocated
+            ,att.lotnum, att.customer_id, lotatt01, lotatt02, lotatt03, lotatt04,qua.dict_label lotatt05
+             , lotatt06, lotatt07, lotatt08, lotatt09, lotatt10, lotatt11, lotatt12, lotatt13, lotatt14
+             , lotatt15, lotatt16, lotatt17, lotatt18
         from inv_lot_loc_id inv
         left join inv_lot_att att on inv.lotnum = att.lotnum
         left join base_location_info b on inv.location_id = b.id