Commit 2f07434e 孙克

原材料仓料箱出入库时不更新storagePos的Barcode字段, 通过status字段来区分是否在库

1 个父辈 802303cc
......@@ -465,7 +465,7 @@ public class BarcodeRule {
}
public CodeBean toCodeBean(String codeStr){
log.info("开始解析条码["+codeStr+"]");
log.debug("开始解析条码["+codeStr+"]");
CodeBean codeBean = new CodeBean();
codeBean.setCodeStr(codeStr);
//是否带有位置信息
......@@ -523,7 +523,7 @@ public class BarcodeRule {
codeArr = codeStr.split(separator,-1);
//条码与规则长度对应不上
if(codeArr.length != length){
log.info("条码["+codeStr+"]与规则【"+ruleStr+"】长度不同");
log.debug("条码["+codeStr+"]与规则【"+ruleStr+"】长度不同");
codeBean.setError("smfcore.error.barcode.wrongLength",new String[]{codeStr}, "条码[{0}]长度错误");
return codeBean;
}else{
......@@ -542,7 +542,7 @@ public class BarcodeRule {
}
if(Strings.isNullOrEmpty(reelId)){
log.info("条码解析失败,未找到RI字段");
log.debug("条码解析失败,未找到RI字段");
codeBean.setError("smfcore.error.barcode.noField",new String[]{"RI"},"条码解析失败,未找到{0}字段");
return codeBean;
}
......@@ -550,14 +550,14 @@ public class BarcodeRule {
String partNumber = partNumber_item.getStrValue(codeArr);
if(Strings.isNullOrEmpty(partNumber)){
log.info("条码解析失败,未找到PN字段");
log.debug("条码解析失败,未找到PN字段");
codeBean.setError("smfcore.error.barcode.noField",new String[]{"PN"}, "条码解析失败,未找到{0}字段");
return codeBean;
}
if(batch_item.hasThisField()) {
String batch = batch_item.getStrValue(codeArr);
if (batch.indexOf("-") == -1) {
log.info("条码解析失败,BATCH字段不合规则");
log.debug("条码解析失败,BATCH字段不合规则");
codeBean.setError("smfcore.error.barcode.noField", new String[]{"BATCH"}, "条码解析失败,未找到{0}字段");
return codeBean;
}
......@@ -576,13 +576,13 @@ public class BarcodeRule {
if(quantity_item.hasThisField()){
quantity = quantity_item.getIntValue(codeArr);
if(quantity == -1){
log.info("条码解析失败,未找到QTY 字段");
log.debug("条码解析失败,未找到QTY 字段");
codeBean.setError("smfcore.error.barcode.noField",new String[]{"QTY"},"条码解析失败,未找到{0}字段");
return codeBean;
}
if (quantity == 0) {
if (!(codeStr.startsWith("CS") || codeStr.startsWith("CM") || codeStr.startsWith("CB"))) {
log.info("条码解析失败,未找到QTY 字段");
log.debug("条码解析失败,未找到QTY 字段");
codeBean.setError("smfcore.error.barcode.noField", new String[]{"QTY"}, "条码解析失败,未找到{0}字段");
return codeBean;
}
......@@ -591,7 +591,7 @@ public class BarcodeRule {
Date produceDate= produceDate_item.getDateValue(codeArr);
if(produceDate_item.hasThisField() && produceDate == null){
log.info("条码解析失败,PRODATE字段不合规则");
log.debug("条码解析失败,PRODATE字段不合规则");
codeBean.setError("smfcore.error.barcode.noField",new String[]{"PRODATE"},"条码解析失败,未找到{0}字段");
return codeBean;
}
......@@ -629,7 +629,7 @@ public class BarcodeRule {
if (dateCode_item.hasThisField()) {
String dateCode = dateCode_item.getStrValue(codeArr);
if (dateCode.indexOf("-") == -1) {
log.info("条码解析失败,DATECODE字段不合规则");
log.debug("条码解析失败,DATECODE字段不合规则");
codeBean.setError("smfcore.error.barcode.noField", new String[]{"DATECODE"}, "条码解析失败,未找到{0}字段");
return codeBean;
}
......@@ -693,7 +693,7 @@ public class BarcodeRule {
codeArr = codeStr.split(separator, -1);
//条码与规则长度对应不上
if (codeArr.length != length) {
log.info("条码[" + codeStr + "]与规则【" + ruleStr + "】长度不同");
log.debug("条码[" + codeStr + "]与规则【" + ruleStr + "】长度不同");
return null;
} else {
codeArr = codeStr.split(separator, length);
......@@ -710,7 +710,7 @@ public class BarcodeRule {
reelId = reelId_item.getStrValue(codeArr);
}
if (Strings.isNullOrEmpty(reelId)) {
log.info("条码解析失败,未找到RI字段");
log.debug("条码解析失败,未找到RI字段");
//codeBean.setError("smfcore.error.barcode.noField",new String[]{"RI"},"条码解析失败,未找到{0}字段");
return null;
}
......@@ -721,7 +721,7 @@ public class BarcodeRule {
memo = memo_item.getStrValue(codeArr);
}
if (Strings.isNullOrEmpty(memo)){
log.info("条码解析失败,未找到MEMO字段");
log.debug("条码解析失败,未找到MEMO字段");
return null;
}
......@@ -729,7 +729,7 @@ public class BarcodeRule {
String partNumber = partNumber_item.getStrValue(codeArr);
if (Strings.isNullOrEmpty(partNumber)) {
log.info("条码解析失败,未找到PN字段");
log.debug("条码解析失败,未找到PN字段");
return null;
}
grLabel.setPartNumber(partNumber);
......@@ -737,7 +737,7 @@ public class BarcodeRule {
if (quantity_item.hasThisField()) {
quantity = quantity_item.getIntValue(codeArr);
if (quantity == -1) {
log.info("条码解析失败,未找到QTY 字段");
log.debug("条码解析失败,未找到QTY 字段");
return null;
}
}
......
......@@ -626,7 +626,7 @@ public class Barcode extends BasePo implements Serializable {
}
}
public void removeFromSubCodes(Barcode subCode){
public synchronized void removeFromSubCodes(Barcode subCode){
if(subCodeList != null && subCodeList.size() > 0){
boolean removeOk = subCodeList.removeIf(t -> t.getBarcode().equals(subCode.getBarcode()));
if(removeOk){
......
......@@ -410,6 +410,7 @@ public class CodeResolve {
*/
public Barcode resolveOneValideBarcode(String codeStr,int type) throws ValidateException{
if(org.apache.logging.log4j.util.Strings.isBlank(codeStr)){
log.info("未扫到条码");
throw new ValidateException("smfcore.error.barcode.empty","未扫到条码");
}
Collection<CodeBean> codeBeans = resolveCodeStr(codeStr, type);
......@@ -421,6 +422,7 @@ public class CodeResolve {
if(barcode == null){
barcode = barcodeFromRule;
}else{
log.info("从["+codeStr+"]中找到多个有效条码");
throw new ValidateException("smfcore.error.barcode.many","找到多个有效的条码",new String[]{codeStr});
}
}else{
......@@ -429,6 +431,7 @@ public class CodeResolve {
}
if(barcode == null){
log.info("从["+codeStr+"]中未找到有效的条码");
throw new ValidateException("smfcore.error.barcode.invalid", "未找到有效的条码",new String[]{codeStr});
}
return barcode;
......
......@@ -142,7 +142,7 @@ public class MessageUtils {
// log.info("获取资源[" + msgKey + "][" + defaultMsg + "][" + lanType + "]失败:未找到code[" + msgKey + "]对应语言[" + lanType + "]");
return msg.getMsg();
}
log.info("获取资源[" + msgKey + "][" + defaultMsg + "][" + lanType + "]失败:未找到code[" + msgKey + "]");
log.debug("获取资源[" + msgKey + "][" + defaultMsg + "][" + lanType + "]失败:未找到code[" + msgKey + "]");
}
return defaultMsg;
}
......
......@@ -90,7 +90,7 @@ public class BoxHandleUtil {
barcode.setUsedDate(new Date());
//仓位状态
barcode.setCheckOutDate(new Date(), "");
barcode.setPosName("");
//barcode.setPosName("");
barcode.setOrderItemId("");
barcode.setOrderId("");
barcode.setLockName("");
......@@ -98,8 +98,8 @@ public class BoxHandleUtil {
barcodeManager.save(barcode);
}
storagePos.setBarcode(null);
storagePos.setUsed(false);
//storagePos.setBarcode(null);
//storagePos.setUsed(false);
storagePosManager.save(storagePos);
log.info("出库完成,清空仓位: " + storagePos.getId() + "[" + storagePos.getPosName() + "]");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!