|
@@ -1,12 +1,14 @@
|
|
|
package com.ruoyi.ams.config.service;
|
|
|
|
|
|
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.LocationPriorityDetailsVO;
|
|
|
import com.ruoyi.ams.config.domain.vo.LocationPriorityHeaderVO;
|
|
|
import com.ruoyi.ams.config.mapper.LocationPriorityHeaderMapper;
|
|
|
import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
|
|
|
import com.ruoyi.base.domain.BaseLocationInfo;
|
|
|
+import com.ruoyi.base.domain.LotattVO;
|
|
|
import com.ruoyi.base.domain.vo.BaseLocationLotattVO;
|
|
|
import com.ruoyi.base.mapper.BaseLocationInfoMapper;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -99,6 +101,22 @@ public class LocationAllocationStrategy {
|
|
|
lotatt.put(vo.getLotattId(), vo.getLotattValue());
|
|
|
}
|
|
|
}
|
|
|
+ //如果策略配置了入库的属性那么选择相同属性的库位进行存放
|
|
|
+ if (lotatt.size() > 0 && inWarehouseDTO.getLotattDTO() != null) {
|
|
|
+ LotattDTO lotattDTO = inWarehouseDTO.getLotattDTO();
|
|
|
+ lotattDTO.getAttr();
|
|
|
+ boolean isSame = true;
|
|
|
+ for (Map.Entry<String, String> attEntry : lotatt.entrySet()) {
|
|
|
+ if (lotattDTO.getAttr().get(attEntry.getKey()) != null) {
|
|
|
+ if (!lotattDTO.getAttr().get(attEntry.getKey()).equals(attEntry.getValue())) {
|
|
|
+ isSame = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isSame == false) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
//将同一列的库位排序好
|
|
|
Integer parallelCount = 0;
|
|
@@ -138,8 +156,13 @@ public class LocationAllocationStrategy {
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
- // TODO 优先寻找匹配批次属性的库存库位进行存放
|
|
|
- if (lotatt.size() > 0 && b.getLotattVO() != null) { //指定了批次属性的需要对相同批次属性的库存进行匹配
|
|
|
+ // TODO 如果库存中已存在批次属性那么存放相同批次属性的物料
|
|
|
+ /*if (lotatt.size() > 0) { //指定了批次属性的需要对相同批次属性的库存进行匹配
|
|
|
+ //如果没有批次属性查询是否有待搬运的属性
|
|
|
+ if (b.getLotattVO() == null) {
|
|
|
+ LotattVO lotattVO = baseLocationInfoMapper.selectInvLotattById(b.getId());
|
|
|
+ b.setLotattVO(lotattVO);
|
|
|
+ }
|
|
|
b.initLotatt();
|
|
|
boolean isSame = true;
|
|
|
for (Map.Entry<String, String> attEntry : lotatt.entrySet()) {
|
|
@@ -150,7 +173,7 @@ public class LocationAllocationStrategy {
|
|
|
if (isSame == false) {
|
|
|
continue;
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
if (currentLocation == null) {
|
|
|
if (b.getIsEmpty().equals("Y") && b.getStockStatus().equals("00")) {
|