|
@@ -3,15 +3,12 @@ package com.ruoyi.ams.business;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.ruoyi.ams.common.Constant;
|
|
|
import com.ruoyi.ams.config.domain.AsnSoStrategy;
|
|
|
-import com.ruoyi.ams.config.domain.LocationPriorityHeader;
|
|
|
import com.ruoyi.ams.config.domain.dto.AgvCallDTO;
|
|
|
import com.ruoyi.ams.config.domain.dto.InWarehouseDTO;
|
|
|
import com.ruoyi.ams.config.domain.dto.LotattDTO;
|
|
|
import com.ruoyi.ams.config.domain.dto.OutWarehouseDTO;
|
|
|
import com.ruoyi.ams.config.domain.vo.FlowConfigHeaderVO;
|
|
|
-import com.ruoyi.ams.config.domain.vo.LocationPriorityHeaderVO;
|
|
|
import com.ruoyi.ams.config.mapper.AsnSoStrategyMapper;
|
|
|
-import com.ruoyi.ams.config.mapper.LocationPriorityHeaderMapper;
|
|
|
import com.ruoyi.ams.config.service.IFlowConfigHeaderService;
|
|
|
import com.ruoyi.ams.config.service.ILocationPriorityHeaderService;
|
|
|
import com.ruoyi.ams.config.service.LocationAllocationStrategy;
|
|
@@ -44,8 +41,6 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
@Autowired
|
|
|
private IBaseLocationInfoService baseLocationInfoService;
|
|
|
@Autowired
|
|
|
- private ILocationPriorityHeaderService locationPriorityHeaderService;
|
|
|
- @Autowired
|
|
|
private LocationAllocationStrategy locationAllocationStrategy;
|
|
|
@Autowired
|
|
|
private InvLotLocIdMapper invLotLocIdMapper;
|
|
@@ -69,33 +64,38 @@ public class BusinessServiceImpl implements IBusinessService {
|
|
|
for (AgvCallDTO agvCallDTO : agvCallDTOList) {
|
|
|
BaseLocationInfo locationFrom = null;
|
|
|
BaseLocationInfo locationTo = null;
|
|
|
+
|
|
|
//查询所属流程
|
|
|
FlowConfigHeaderVO flowConfigHeaderVO = flowConfigHeaderService.selectFlowConfigHeaderById(agvCallDTO.getId());
|
|
|
+ AsnSoStrategy asnSoStrategy = asnSoStrategyMapper.selectAsnSoStrategy();
|
|
|
if (flowConfigHeaderVO == null) {
|
|
|
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()) {
|
|
|
//2.初始化库存
|
|
|
invLotLocIdService.initInv(agvCallDTO.getLocationFrom(), agvCallDTO.getSku(), Constant.CUSTOMER_ID, agvCallDTO.getQty(), agvCallDTO.getLotattDTO());
|
|
|
- }
|
|
|
-
|
|
|
- //目标库位逻辑---------------------------》
|
|
|
- List<BaseLocationInfo> locationToList = this.convertLocation(agvCallDTO.getLocationTo(), agvCallDTO.getWarehouseId());
|
|
|
- if (locationToList.size() > 0) { //多个库位为库区
|
|
|
- //分配可以使用的库位
|
|
|
-
|
|
|
- } else { //单个库位为指定
|
|
|
+ } else {
|
|
|
|
|
|
}
|
|
|
|