Commit 5314df7b zshaohui

1.每个料仓的尺寸 外侧库位预留5个能用的

1 个父辈 7e7b300f
......@@ -34,10 +34,11 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
StoragePos findPartNumberInStorages(List<String> storageIdList, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType);
StoragePos findPartNumberInStorages(List<String> storageIdList,String labelId, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType);
StoragePos findPartNumberInStorages(List<String> storageIdList,String labelId, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType,Map<String,String> appendDate);
StoragePos findPartNumberInStorages(List<String> storageIdList, String labelId, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType);
StoragePos findPartNumberInStoragesBox(List<String> storageIdList,String labelId, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType,Map<String,String> appendDate);
StoragePos findPartNumberInStorages(List<String> storageIdList, String labelId, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType, Map<String, String> appendDate);
StoragePos findPartNumberInStoragesBox(List<String> storageIdList, String labelId, String pn, Collection<String> excludePosIds, CHECKOUT_TYPE checkOutType, Map<String, String> appendDate);
List<StoragePos> findByQuery(Query query, Pageable pageable);
......@@ -49,7 +50,7 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds, String lastPosId) throws ValidateException;
StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds, String lastPosId,String needMovePosName,String endStr) throws ValidateException;
StoragePos getEmptyPosByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds, String lastPosId, String needMovePosName, String endStr) throws ValidateException;
StoragePos getEmptyPosByStorage(Storage storage, int size, int height, Collection<String> excludePosIds) throws ValidateException;
......@@ -65,13 +66,13 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
void clearStoragePosLabel(String id);
void updatePosLabel(String[] posIds, String labelId,String labelName);
void updatePosLabel(String[] posIds, String labelId, String labelName);
void clearLockPos(String lockId);
StoragePos autoFindNextEmptyPos(Storage storage, Collection<String> excludePosIds,StoragePos currentPos);
StoragePos autoFindNextEmptyPos(Storage storage, Collection<String> excludePosIds, StoragePos currentPos);
public void updateBarcodeMsd(String pn,String msl,String thickness);
public void updateBarcodeMsd(String pn, String msl, String thickness);
List<StoragePos> findPosList(String storageId, List<String> posNames);
......@@ -87,17 +88,19 @@ public interface IStoragePosManager extends IBaseManager<StoragePos> {
List<StoragePos> findPosByIdList(List<String> idList);
StoragePos findMpnInStorages(List<String> availableStorageIds, String mpn, Collection<String> excludePosIds, CHECKOUT_TYPE checkoutType,Map<String,String> appendData);
StoragePos findMpnInStorages(List<String> availableStorageIds, String mpn, Collection<String> excludePosIds, CHECKOUT_TYPE checkoutType, Map<String, String> appendData);
List<StoragePos> findExpiredOrSluggishBarcode(Date date,int type);
List<StoragePos> findExpiredOrSluggishBarcode(Date date, int type);
List<StoragePos> findExistPosList(String id, List<String> list);
StoragePos getAndCreatePos(String storageId,String posName);
StoragePos getAndCreatePos(String storageId, String posName);
StoragePos findByStorageName(String code);
StoragePos findOne(Query query);
Sort getSortByCheckOutType(CHECKOUT_TYPE checkoutType);
Sort getSortByCheckOutType(CHECKOUT_TYPE checkoutType);
int getRemainPosCountByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds, String lastPosId, String endStr) throws ValidateException;
}
......@@ -885,4 +885,39 @@ public class StoragePosManagerImpl implements IStoragePosManager {
public StoragePos findOne(Query query) {
return storagePosDao.findOne(query);
}
@Override
public int getRemainPosCountByStorage(Storage storage, Barcode barcode, Collection<String> excludePosIds,String lastPosId,String endStr) throws ValidateException {
Criteria c = Criteria.where("storageId").is(storage.getId());
COMPATIBLE_TYPE compatibleType = storage.getCompatibleType();
if (compatibleType == COMPATIBLE_TYPE.EXACT_MATCH) {//完全匹配
c = c.and("w").is(barcode.getPlateSize()).and("h").is(barcode.getHeight());
} else if (compatibleType == COMPATIBLE_TYPE.FULLY_COMPATIBLE) {//同厚度兼容
c = c.and("w").gte(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//除7寸外,完全兼容
} else if (compatibleType == COMPATIBLE_TYPE.SIZE_COMPATIBLE) {//同尺寸兼容
c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度等于料盘宽度,高度大于等于料盘高度
}
c = c.and("enabled").is(true)//可用
.and("used").is(false);//未使用
//去除的仓位
if (excludePosIds != null && !excludePosIds.isEmpty()) {
c = c.and("id").nin(excludePosIds);
}
if (StringUtils.isNotEmpty(endStr)) {
String regex = "" + endStr + "$";
c.and("posName").regex(Pattern.compile(regex));
}
Query query = new Query(c);
query.with(Sort.by(Sort.Direction.ASC, "w").and(Sort.by(Sort.Direction.ASC, "h")).and(Sort.by(Sort.Direction.DESC, "priority")));
return storagePosDao.countByQuery(query);
}
}
......@@ -799,7 +799,7 @@ public class TaskService {
}
if (availbleStorageList.isEmpty()) {
throw new ValidateException("smfcore.noValidStorage", "料仓列表中未找到可用的料仓");
throw new ValidateException("smfcore.noValidStorage", "[{0}]料仓列表中未找到可用的料仓",new String[]{barcode.getBarcode()});
}
availbleStorageList.sort(new Comparator<Storage>() {
......@@ -916,7 +916,7 @@ public class TaskService {
}
if (availbleStorageList.isEmpty()) {
throw new ValidateException("smfcore.noValidStorage", "料仓列表中未找到可用的料仓");
throw new ValidateException("smfcore.noValidStorage", "[{0}]料仓列表中未找到可用的料仓",new String[]{barcode.getBarcode()});
}
availbleStorageList.sort(new Comparator<Storage>() {
......
......@@ -166,19 +166,19 @@ public class JkemController {
List<String> newCidList = new ArrayList<>();
List<Storage> newStorageList = new ArrayList<>();
MJPartNumber mjPartNumber = partNumberManager.findByJkemPartNumber(barcode.getPartNumber());
if (mjPartNumber != null){
log.info(barcode.getBarcode()+"查询到的信息为:"+JSON.toJSONString(mjPartNumber));
if (mjPartNumber != null) {
log.info(barcode.getBarcode() + "查询到的信息为:" + JSON.toJSONString(mjPartNumber));
int msd = mjPartNumber.getMsd();
if (msd == 1){
if (msd == 1) {
for (String cid : cidList) {
if (msdCidList.contains(cid)){
if (msdCidList.contains(cid)) {
newCidList.add(cid);
Storage storage = dataCache.getStorage(cid);
newStorageList.add(storage);
}
}
if (newCidList == null || newCidList.isEmpty()){
throw new ValidateException("smf.barcode.msd.validate","该物料需要MSD管控不能在本料仓入库");
if (newCidList == null || newCidList.isEmpty()) {
throw new ValidateException("smf.barcode.msd.validate", "该物料需要MSD管控不能在本料仓入库");
}
} else {
newCidList.addAll(cidList);
......@@ -189,6 +189,22 @@ public class JkemController {
newStorageList.addAll(storageList);
}
//判断对应的尺寸,外侧的库位,是否保留5个
List<String> findCidList = new ArrayList<>();
List<Storage> findNewStorageList = new ArrayList<>();
for (Storage storage : newStorageList) {
int count = storagePosManager.getRemainPosCountByStorage(storage, barcode, taskService.excludePosIds(), "", "_F");
if (count > 5) {
findCidList.add(storage.getCid());
findNewStorageList.add(storage);
} else {
log.info(storage.getCid()+"对应的尺寸:"+barcode.getPlateSize()+"x"+barcode.getHeight()+"外侧库位数量小于等于5个,忽略不入库");
}
}
if (findNewStorageList == null || findNewStorageList.isEmpty()){
throw new ValidateException("smfcore.noValidStorage", "[{0}]料仓列表中未找到可用的料仓",new String[]{barcode.getBarcode()});
}
for (DataLog dataLog : taskService.getQueueTasks()) {
// if(!dataLog.isPackageReel()){
......@@ -242,7 +258,7 @@ public class JkemController {
if (loopCount >= 10) {
log.info(barcode.getBarcode() + "已循环查找10次 直接跳出循环");
}
pos = taskService.findEmptyPosForPutIn(newStorageList, barcode, rfid, lastPosId);
pos = taskService.findEmptyPosForPutIn(findNewStorageList, barcode, rfid, lastPosId);
if (pos == null) {
break;
}
......@@ -265,7 +281,7 @@ public class JkemController {
reelLocInfo.setCid(dataCache.getStorageById(pos.getStorageId()).getCid());
reelLocInfo.setLockPosName(pos.getPosName());
reelLocInfo.setLockPosId(pos.getId());
ReelLockPosUtil.addReelLockPosInfo(reelLocInfo, newCidList);
ReelLockPosUtil.addReelLockPosInfo(reelLocInfo, findCidList);
// needRemoveReelLockPosIdList.add(pos.getId());
pos = null;
}
......@@ -301,7 +317,7 @@ public class JkemController {
reelLocInfo.setCid(theStorage.getCid());
reelLocInfo.setLockPosName(pos.getPosName());
reelLocInfo.setLockPosId(pos.getId());
reelLocInfo = ReelLockPosUtil.addReelLockPosInfo(reelLocInfo, newCidList);
reelLocInfo = ReelLockPosUtil.addReelLockPosInfo(reelLocInfo, findCidList);
if (reelLocInfo == null) {
errorMsg = "[" + barcode.getBarcode() + "]库位[" + reelLocInfo.getLockPosName() + "]已被锁定,暂停入库";
lineMsg = errorMsg;
......
......@@ -79,7 +79,7 @@ smfcore.user=\u7528\u6237\u7BA1\u7406
smfcore.peoples=\u7528\u6237\u7BA1\u7406
smfcore.role=\u89D2\u8272\u7BA1\u7406
smfcore.menuNotExist=\u83DC\u5355{0}\u4E0D\u5B58\u5728
smfcore.noValidStorage=\u6599\u4ED3\u5217\u8868\u4E2D\u672A\u627E\u5230\u53EF\u7528\u7684\u6599\u4ED3
smfcore.noValidStorage=[{0}]\u6599\u4ED3\u5217\u8868\u4E2D\u672A\u627E\u5230\u53EF\u7528\u7684\u6599\u4ED3
smfcore.error.barcode.exist=[{0}}]\u5DF2\u5728{1}}[{2}}]\u4E2D
smfcore.barcodeSetting=\u6761\u7801\u8BBE\u7F6E
smfcore.posNotExist=\u4ED3\u4F4D\u4E0D\u5B58\u5728
......
......@@ -80,7 +80,7 @@ smfcore.user=Users
smfcore.peoples=Users
smfcore.role=Authority
smfcore.menuNotExist=Menu{0} does not exist
smfcore.noValidStorage=No available bin found in bin list
smfcore.noValidStorage=[{0}]No available bin found in bin list
smfcore.error.barcode.exist=[{0}}] is already in {1}}[{2}}]
smfcore.barcodeSetting=MA.ID Setting
smfcore.posNotExist=Positions do not exist
......
......@@ -77,7 +77,7 @@ smfcore.user=\u30E6\u30FC\u30B6\u30FC\u7BA1\u7406
smfcore.peoples=\u30E6\u30FC\u30B6\u30FC\u7BA1\u7406
smfcore.role=\u5F79\u5272\u7BA1\u7406
smfcore.menuNotExist=\u30E1\u30CB\u30E5\u30FC{0}\u304C\u5B58\u5728\u3057\u306A\u3044
smfcore.noValidStorage=\u30D3\u30F3\u30EA\u30B9\u30C8\u306B\u5229\u7528\u53EF\u80FD\u306A\u30D3\u30F3\u304C\u898B\u3064\u304B\u3089\u306A\u3044
smfcore.noValidStorage=[{0}]\u30D3\u30F3\u30EA\u30B9\u30C8\u306B\u5229\u7528\u53EF\u80FD\u306A\u30D3\u30F3\u304C\u898B\u3064\u304B\u3089\u306A\u3044
smfcore.error.barcode.exist=[0}}]\u306F\u3059\u3067\u306B{1}[{2}}\u306B\u5165\u3063\u3066\u3044\u307E\u3059\u3002
smfcore.barcodeSetting=\u30D0\u30FC\u30B3\u30FC\u30C9\u8A2D\u5B9A
smfcore.posNotExist=\u30E9\u30A4\u30D6\u30E9\u30EA\u30FC\u30B9\u30DA\u30FC\u30B9\u304C\u5B58\u5728\u3057\u306A\u3044
......
......@@ -79,7 +79,7 @@ smfcore.user=\u7528\u6237\u7BA1\u7406
smfcore.peoples=\u7528\u6237\u7BA1\u7406
smfcore.role=\u89D2\u8272\u7BA1\u7406
smfcore.menuNotExist=\u83DC\u5355{0}\u4E0D\u5B58\u5728
smfcore.noValidStorage=\u6599\u4ED3\u5217\u8868\u4E2D\u672A\u627E\u5230\u53EF\u7528\u7684\u6599\u4ED3
smfcore.noValidStorage=[{0}]\u6599\u4ED3\u5217\u8868\u4E2D\u672A\u627E\u5230\u53EF\u7528\u7684\u6599\u4ED3
smfcore.error.barcode.exist=[{0}}]\u5DF2\u5728{1}}[{2}}]\u4E2D
smfcore.barcodeSetting=\u6761\u7801\u8BBE\u7F6E
smfcore.posNotExist=\u4ED3\u4F4D\u4E0D\u5B58\u5728
......
......@@ -78,7 +78,7 @@ smfcore.user=\u7528\u6236\u7BA1\u7406
smfcore.peoples=\u7528\u6236\u7BA1\u7406
smfcore.role=\u89D2\u8272\u7BA1\u7406
smfcore.menuNotExist=\u83DC\u55AE{0}\u4E0D\u5B58\u5728
smfcore.noValidStorage=\u6599\u5009\u5217\u8868\u4E2D\u672A\u627E\u5230\u53EF\u7528\u7684\u6599\u5009
smfcore.noValidStorage=[{0}]\u6599\u5009\u5217\u8868\u4E2D\u672A\u627E\u5230\u53EF\u7528\u7684\u6599\u5009
smfcore.error.barcode.exist=[{0}}]\u5DF2\u5728{1}}[{2}}]\u4E2D
smfcore.barcodeSetting=\u689D\u78BC\u8A2D\u7F6E
smfcore.posNotExist=\u5EAB\u4F4D\u4E0D\u5B58\u5728
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!