Commit 5dabe5bb sunke

条码解析添加MSL解析

1 个父辈 788296b6
......@@ -42,6 +42,8 @@ public class Barcode extends BaseMongoBean {
private int height;
private String provider;
private String batch;
private String msl;
//备用字段1(配套单号))或 family
private String otherField1;
//备用字段2 (产品型号)
......@@ -540,6 +542,14 @@ public class Barcode extends BaseMongoBean {
this.onlySingleOut = onlySingleOut;
}
public String getMsl() {
return msl;
}
public void setMsl(String msl) {
this.msl = msl;
}
// public void setNoChangeField(Barcode oldBarcode){
// if(oldBarcode != null){
// this.expireDate = oldBarcode.getExpireDate();
......
......@@ -21,7 +21,8 @@ import java.util.Date;
* PRODATE为生产日期xxPRODATEyyyyMMdd
* EXPDATE为过期日期xxxEXPDATEyyyyMMdd
* SP 为供应商,
* BATCH 为批次,
* BATCH 为批次
* MSL 为MSL等级
*
*
* 其中必须含有PN和 RI, QTY为空时使用产品档案的封装数量,如果字段前或者后有无用字符,可使用 x(一个字符) 替代
......@@ -112,6 +113,12 @@ public class BarcodeRule {
}
}
if(!newRule.msl_item.hasThisField()){
if(newRule.msl_item.matchRule(fieldValue, i)){
log.info("MSL: 为" + newRule.msl_item.toString());
}
}
if(!newRule.produceDate_item.hasThisField()){
if(newRule.produceDate_item.matchRule(fieldValue,i)){
......@@ -176,6 +183,7 @@ public class BarcodeRule {
private RuleItem expireDay_item = new RuleItem("EXPD");
private RuleItem supplier_item = new RuleItem("SP");
private RuleItem batch_item = new RuleItem("BATCH");
private RuleItem msl_item = new RuleItem("MSL");
private class RuleItem{
private RuleItem(String ruleName) {
......@@ -474,6 +482,7 @@ public class BarcodeRule {
}
}
String supplier = supplier_item.getStrValue(codeArr);
String msl = msl_item.getStrValue(codeArr);
//南瑞使用整个条码作为唯一码
if(DataCache.isProductionFor(DataCache.CUSTOMER.NANRUI)){
......@@ -490,6 +499,7 @@ public class BarcodeRule {
b.setProvider(supplier);
b.setPlateSize(reelWidth);
b.setHeight(reelHeight);
b.setMsl(msl);
codeBean.setBarcode(b);
return codeBean;
......@@ -544,7 +554,7 @@ public class BarcodeRule {
codeStr = ")》@06@120S002@P8908018028@1PBLM18PG121SH1D@31PBLM18PG121SH1D@12V690588124@10VJPN-AM@2P@20P@6D192400@14D210205@30PY@Z1@K0@16K0@V97294419@3SS191908055X1Z@Q4000NAR000@20T1@1TAM961458E@2T@1Z@@";
// codeStr = "=1+0x0-0x0=A0002";
//阳光电源
rule = "[RI]_PN_PRODATEyyMMdd_QTYxxxx";
rule = "[RI]_PN_3_QTYxxxx";
//rule = "[RI]_PN_PRODATEyyMMdd_QTY[0:5:4]";
codeStr = "4500065747_CS000069_180101_030000041";
codeStr = "4500089600_DC000045_190528_003000006";
......@@ -558,7 +568,7 @@ public class BarcodeRule {
System.out.println("RI:"+b.getBarcode());
System.out.println("Amount:"+b.getAmount());
System.out.println("BATCH:"+b.getBatch());
System.out.println("PRODATE:"+b.getProduceDate());
System.out.println("MSL:"+b.getMsl());
System.out.println("EXPDATE:"+b.getExpireDate());
}else{
log.info("解析失败");
......
......@@ -936,7 +936,7 @@ public class TaskService implements ITaskService {
statusBean.setMsg("");
//料柜
if(storage.isCabinet() || storage.isShelf() || storage.isAccShelf()){
if(storage.isCabinet() || storage.isShelf() || storage.isAccShelf() || storage.isCodeShelf()){
String cardResult = statusBean.getFromData("cardResult");
if(!Strings.isNullOrEmpty(cardResult)){
//写入卡片完成,后续再加密解密,暂就先使用用户名=授权码
......
......@@ -176,6 +176,8 @@
${pos.barcode.partNumber}
</display:column>
<display:column property="barcode.provider" titleKey="barcode.provider"/>
<display:column titleKey="inOutList.type">
<c:if test="${pos.barcode.type == 0 || empty pos.barcode.type}"><fmt:message key="inOutList.type.component"/></c:if>
<c:if test="${pos.barcode.type == 1}"><fmt:message key="inOutList.type.solder"/></c:if>
......@@ -183,7 +185,8 @@
<c:if test="${pos.barcode.type == 3}"><fmt:message key="inOutList.type.others"/></c:if>
<c:if test="${pos.barcode.type == 4}"><fmt:message key="inOutList.type.fixture"/></c:if>
</display:column>
<display:column property="barcode.barcode" titleKey="barcode.barcode"/>
<display:column property="barcode.barcode" titleKey="barcode.barcode" sortable="true" sortProperty="barcode.barcode"/>
<display:column property="barcode.msl" titleKey="component.msl" sortable="true" sortProperty="barcode.msl"/>
<%--<display:column property="barcode.inFixture" titleKey="storagePosFind.inFixture"/>--%>
<display:column property="barcode.batch" titleKey="barcode.batch" sortable="true" sortProperty="barcode.batch"/>
<%--<display:column property="barcode.providerNumber" titleKey="component.providerNumber"/>--%>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!