Commit 0bda093e zshaohui

根据条码信息获取条码规则

1 个父辈 380b6519
......@@ -841,6 +841,8 @@ public class BarcodeRule {
rule="EXPDATEyyMMdd[12:0:-1]|BATCH[2:0:-1]|QTY[2:0:-1]|RI[2:0:-1]|PN[1:0:-1]|MPN[-1:0:2]";
// rule="PN[1:0:-1]|BATCH[2:0:-1]|LOT[2:0:-1]|QTY[2_7Q:0:-1]|RI[1:0:-1]|SP[3:0:-1]|PRODATEyyyyMMdd[2:0:-1]|xxx";
codeStr = "L00002019090199951797;E2019-09-01 0365;B8C.R2003.V81506072019090103000;R506072019102200356";
rule = "BATCH;PRODATEyyyy-MM-dd[1:10:-1];QTY[27:4:-1]SP[13:5:-1]PN[1:12:-1];RI";
BarcodeRule br = BarcodeRule.newRule(rule);
Barcode b = br.toCodeBean(codeStr).getBarcode();
if(b != null){
......@@ -881,7 +883,7 @@ public class BarcodeRule {
}
private static String toCodeRule(String codeStr, Map<String,String> fieldValueMap){
public static String toCodeRule(String codeStr, Map<String,String> fieldValueMap){
String separator = findSeparator(codeStr);
String[] codeArr = new String[]{codeStr};
if(!Strings.isNullOrEmpty(separator)){
......
......@@ -17,6 +17,7 @@ import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.utils.QrcodeUtils;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.system.service.po.Settings;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import com.neotel.smfcore.security.bean.FileProperties;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -181,12 +182,12 @@ public class BarcodeController {
}
/*@ApiOperation("根据条码信息获取条码规则")
@ApiOperation("根据条码信息获取条码规则")
@PostMapping(value = "getBarcodeRule")
public ResultBean getBarcodeRule(@RequestBody Map<String, String> paramMap) {
String ruleStr = BarcodeRule.toCodeRule(paramMap.get("codeStr"), paramMap);
return ResultBean.newOkResult(ruleStr);
}*/
}
protected String handleBarcode(String fileURL) throws Exception {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!