Commit 2f07434e 孙克

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

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