Commit 6d6187b8 LN

增加库别验证

1 个父辈 6f439f44
......@@ -90,4 +90,8 @@ public class StoragePosDto implements Serializable {
@ApiModelProperty("禁用信息")
private String msg;
@ApiModelProperty("库别")
private String wareHouseCode;
}
......@@ -99,7 +99,7 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
StoragePos findBoxPNInStorages(List<String> storageIdList, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType ) ;
StoragePos findEmptyBoxToPutIn(List<String> storageIdList, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType ,String boxType,int maxCount) ;
StoragePos findEmptyBoxToPutIn(List<String> storageIdList, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType ,String boxType,int maxCount,String wareHouseCode) ;
StoragePos findEmptyBoxToPut(List<String> storageIdList, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType );
StoragePos findEmptyBoxToPut(List<String> storageIdList, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType,String wareHouseCode );
}
......@@ -928,7 +928,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
}
@Override
public StoragePos findEmptyBoxToPutIn(List<String> storageIdList, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType , String boxType, int maxCount) {
public StoragePos findEmptyBoxToPutIn(List<String> storageIdList, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType , String boxType, int maxCount,String wareHouseCode) {
String regex="^"+boxType+".*";
......@@ -940,6 +940,9 @@ public class StoragePosManagerImpl implements IStoragePosManager {
c.and("barcode").exists(true);//已使用有料箱
c.and("barcode.barcode").regex(pattern);
c.and("barcode.status").is(BARCODE_STATUS.IN_STORE);
if(ObjectUtil.isNotEmpty(wareHouseCode)){
c.and("wareHouseCode").is(wareHouseCode);
}
if (storageIdList != null) {
c = c.and("storageId").in(storageIdList);
}
......@@ -960,7 +963,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
@Override
public StoragePos findEmptyBoxToPut(List<String> storageIdList, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType ) {
public StoragePos findEmptyBoxToPut(List<String> storageIdList, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType ,String wareHouseCode ) {
Criteria c = Criteria.where("id").nin(excludePosIds);
......@@ -970,6 +973,9 @@ public class StoragePosManagerImpl implements IStoragePosManager {
c.and("barcode.maxSubNum").gt(0);//最大格口大于0
c.and("barcode.status").is(BARCODE_STATUS.IN_STORE);
c.and("barcode.subListNum").lt("barcode.maxSubNum"); // 添加判断条件
if(ObjectUtil.isNotEmpty(wareHouseCode)){
c.and("wareHouseCode").is(wareHouseCode);
}
if (storageIdList != null) {
c = c.and("storageId").in(storageIdList);
......
......@@ -176,6 +176,13 @@ public class SpBoxPutInManagerImpl implements ISpBoxPutInManager {
if (spareNoDetail == null) {
throw new Exception(codeBarcode.getPartNumber() + "没有入退库需求,请检查是否存在或者不符合入退库数量");
}
}else{
//TODO 判断此料箱是否有posName,如果没有的话不能手动入库
StoragePos pos = storagePosManager.getByBarcode(boxBarcode.getBarcode());
if(pos==null){
throw new Exception(codeBarcode.getPartNumber() + "无库别料箱不允许手动入库");
}
}
// 寻找空库位
......
......@@ -183,6 +183,9 @@ public class SpareNoCache {
}
log.info("开始执行 入库单 [" + orderNo + "] ");
if(ObjectUtil.isEmpty(baseNo.getWhCode())){
baseNo.setWhCode("");
}
Map<String,StoragePos> needOutPos = new HashMap<>();
List<String> storageIdList = new ArrayList<>();
......@@ -237,12 +240,17 @@ public class SpareNoCache {
needOutPos.values()) {
int subCount = exPos.getBarcode().getMaxSubNum();
if (exPos.getBarcode().getSubCodeList().size() < subCount) {
//验证库别
if(exPos.getWareHouseCode().equals(baseNo.getWhCode())){
emptyPos = exPos;
break;
}
}
}
Barcode emptyBox = null;
//TODO 查找空格口是必须要是同一个库别的
if (emptyPos != null) {
//使用此格口
emptyBox = emptyPos.getBarcode();
......@@ -266,10 +274,10 @@ public class SpareNoCache {
for (String type :
boxTypes) {
if(type==""){
emptyPos = storagePosManager.findEmptyBoxToPut(storageIdList, excludePosIds, dataCache.getCheckOutType());
emptyPos = storagePosManager.findEmptyBoxToPut(storageIdList, excludePosIds, dataCache.getCheckOutType(),baseNo.getWhCode().trim());
}else{
int count = SpBoxUtil.GetBoxSubCount(type);
emptyPos = storagePosManager.findEmptyBoxToPutIn(storageIdList, excludePosIds, dataCache.getCheckOutType(), type, count);
emptyPos = storagePosManager.findEmptyBoxToPutIn(storageIdList, excludePosIds, dataCache.getCheckOutType(), type, count,baseNo.getWhCode().trim());
}
emptyBox = emptyPos.getBarcode();
if (emptyPos != null) {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!