Commit ebdea481 LN

增加13/15尺寸兼容

1 个父辈 23047cfc
...@@ -16,7 +16,11 @@ public enum COMPATIBLE_TYPE { ...@@ -16,7 +16,11 @@ public enum COMPATIBLE_TYPE {
/** /**
* 同尺寸兼容 * 同尺寸兼容
*/ */
SIZE_COMPATIBLE("storage.match.sizeCompatible"); SIZE_COMPATIBLE("storage.match.sizeCompatible"),
/**
* 13/15寸兼容
*/
W13_15_COMPATIBLE("storage.match.w13_15Compatible");
COMPATIBLE_TYPE(String key) { COMPATIBLE_TYPE(String key) {
......
...@@ -75,9 +75,14 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -75,9 +75,14 @@ public class StoragePosManagerImpl implements IStoragePosManager {
private List<InventoryItem> lockInventory(int type,String... storageIds){ private List<InventoryItem> lockInventory(int type,String... storageIds){
//被锁定的仓位 //被锁定的仓位
//TODO:这里还需要去掉被指定批次锁定的,因为出错,暂时不加了.. // //TODO:这里还需要去掉被指定批次锁定的,因为出错,暂时不加了..
Criteria c = Criteria.where("barcode").exists(true).and("storageId").in(storageIds) // Criteria c = Criteria.where("barcode").exists(true).and("storageId").in(storageIds)
.andOperator(Criteria.where("canCheckOutTime").gt(System.currentTimeMillis())); // .andOperator(Criteria.where("canCheckOutTime").gt(System.currentTimeMillis()));
Criteria newC = Criteria.where("barcode.lockId").exists(true).ne("");
Criteria c = Criteria.where("barcode").exists(true)
.and("storageId").in(storageIds)
// .andOperator(Criteria.where("canCheckOutTime").gt(System.currentTimeMillis()))
.andOperator(newC);
if(type != -1){ if(type != -1){
c = c.and("barcode.type").is(type); c = c.and("barcode.type").is(type);
} }
...@@ -412,6 +417,13 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -412,6 +417,13 @@ public class StoragePosManagerImpl implements IStoragePosManager {
c = c.and("w").gte(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度大于等于料盘宽度,高度大于等于料盘高度 c = c.and("w").gte(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度大于等于料盘宽度,高度大于等于料盘高度
}else if(compatibleType == COMPATIBLE_TYPE.SIZE_COMPATIBLE){//同尺寸兼容 }else if(compatibleType == COMPATIBLE_TYPE.SIZE_COMPATIBLE){//同尺寸兼容
c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度等于料盘宽度,高度大于等于料盘高度 c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度等于料盘宽度,高度大于等于料盘高度
}else if(compatibleType==COMPATIBLE_TYPE.W13_15_COMPATIBLE){
//13/15寸兼容,如果是13寸盘,可以放15寸,其他按照同尺寸兼容
if(barcode.getPlateSize()==13){
c = c.and("w").in(barcode.getPlateSize(),15).and("h").gte(barcode.getHeight());
}else{
c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度等于料盘宽度,高度大于等于料盘高度
}
} }
c = c.and("enabled").is(true)//可用 c = c.and("enabled").is(true)//可用
...@@ -449,6 +461,13 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -449,6 +461,13 @@ public class StoragePosManagerImpl implements IStoragePosManager {
} else if (compatibleType == COMPATIBLE_TYPE.SIZE_COMPATIBLE) {//同尺寸兼容 } else if (compatibleType == COMPATIBLE_TYPE.SIZE_COMPATIBLE) {//同尺寸兼容
c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度等于料盘宽度,高度大于等于料盘高度 c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度等于料盘宽度,高度大于等于料盘高度
}else if(compatibleType==COMPATIBLE_TYPE.W13_15_COMPATIBLE){
//13/15寸兼容,如果是13寸盘,可以放15寸,其他按照同尺寸兼容
if(barcode.getPlateSize()==13){
c = c.and("w").in(barcode.getPlateSize(),15).and("h").gte(barcode.getHeight());
}else{
c = c.and("w").is(barcode.getPlateSize()).and("h").gte(barcode.getHeight());//宽度等于料盘宽度,高度大于等于料盘高度
}
} }
c = c.and("enabled").is(true)//可用 c = c.and("enabled").is(true)//可用
...@@ -492,6 +511,13 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -492,6 +511,13 @@ public class StoragePosManagerImpl implements IStoragePosManager {
} else if (compatibleType == COMPATIBLE_TYPE.SIZE_COMPATIBLE) {//同尺寸兼容 } else if (compatibleType == COMPATIBLE_TYPE.SIZE_COMPATIBLE) {//同尺寸兼容
c = c.and("w").is(size).and("h").gte(height);//宽度等于料盘宽度,高度大于等于料盘高度 c = c.and("w").is(size).and("h").gte(height);//宽度等于料盘宽度,高度大于等于料盘高度
}else if(compatibleType==COMPATIBLE_TYPE.W13_15_COMPATIBLE) {
//13/15寸兼容,如果是13寸盘,可以放15寸,其他同尺寸兼容
if (size == 13) {
c = c.and("w").in(size, 15).and("h").gte(height);
} else {
c = c.and("w").is(size).and("h").gte(height);//宽度等于料盘宽度,高度大于等于料盘高度
}
} }
c = c.and("enabled").is(true)//可用 c = c.and("enabled").is(true)//可用
...@@ -557,7 +583,7 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -557,7 +583,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
@Override @Override
public void clearLockPos(String lockId) { public void clearLockPos(String lockId) {
Query query = new Query( Criteria.where("barcode.lockId").is(lockId)); Query query = new Query( Criteria.where("barcode.lockId").is(lockId));
storagePosDao.updateMulti(query, Update.update("barcode.lockId","")); storagePosDao.updateMulti(query, Update.update("barcode.lockId",null));
} }
...@@ -576,6 +602,13 @@ public class StoragePosManagerImpl implements IStoragePosManager { ...@@ -576,6 +602,13 @@ public class StoragePosManagerImpl implements IStoragePosManager {
} else if (compatibleType == COMPATIBLE_TYPE.SIZE_COMPATIBLE) {//同尺寸兼容 } else if (compatibleType == COMPATIBLE_TYPE.SIZE_COMPATIBLE) {//同尺寸兼容
c = c.and("w").is(currentPos.getW()).and("h").gte(currentPos.getH());//宽度等于料盘宽度,高度大于等于料盘高度 c = c.and("w").is(currentPos.getW()).and("h").gte(currentPos.getH());//宽度等于料盘宽度,高度大于等于料盘高度
}else if(compatibleType==COMPATIBLE_TYPE.W13_15_COMPATIBLE) {
//13/15寸兼容,如果是13寸盘,可以放15寸,其他同尺寸兼容
if (currentPos.getW() == 13) {
c = c.and("w").in(currentPos.getW(), 15).and("h").gte(currentPos.getH());
} else {
c = c.and("w").is(currentPos.getW()).and("h").gte(currentPos.getH());//宽度等于料盘宽度,高度大于等于料盘高度
}
} }
c = c.and("enabled").is(true)//可用 c = c.and("enabled").is(true)//可用
......
...@@ -231,6 +231,15 @@ public class Storage extends BasePo implements Serializable { ...@@ -231,6 +231,15 @@ public class Storage extends BasePo implements Serializable {
if(w == PosW && h <= posH){ if(w == PosW && h <= posH){
return true; return true;
} }
}else if(compatibleType==COMPATIBLE_TYPE.W13_15_COMPATIBLE) {
//13,15寸兼容
if (w == 13) {
if ((w == PosW || 15 == PosW) && h <= posH) {
return true;
}
} else if(w == PosW && h <= posH){//默认同尺寸兼容
return true;
}
} }
return false; return false;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!