Commit 5233bd75 zshaohui

1.条码测试,返回规则名称

1 个父辈 face64b8
...@@ -253,15 +253,23 @@ public class BarcodeController { ...@@ -253,15 +253,23 @@ public class BarcodeController {
public ResultBean getBarCodeInfo(@RequestBody Map<String, String> paramMap) { public ResultBean getBarCodeInfo(@RequestBody Map<String, String> paramMap) {
//获取条码内容 //获取条码内容
String codeStr = paramMap.get("code"); String codeStr = paramMap.get("code");
if(ObjectUtil.isEmpty(codeStr)){ if (ObjectUtil.isEmpty(codeStr)) {
codeStr=""; codeStr = "";
} }
List<BarcodeRule> barcodeRuleList = codeResolve.getBarcodeRuleList(); Settings settings = dataCache.getSettings();
if (barcodeRuleList != null && !barcodeRuleList.isEmpty()) { Map<String, BarcodeRuleDetail> barcodeRuleMap = settings.getBarcodeRuleMap();
for (BarcodeRule barcodeRule : barcodeRuleList) { if (barcodeRuleMap != null && !barcodeRuleMap.isEmpty()) {
for (BarcodeRuleDetail detail : barcodeRuleMap.values()) {
String rule = detail.getRule();
if (StringUtils.isNotEmpty(rule)) {
BarcodeRule barcodeRule = BarcodeRule.newRule(rule);
CodeBean codeBean = barcodeRule.toCodeBean(codeStr); CodeBean codeBean = barcodeRule.toCodeBean(codeStr);
if (codeBean.getBarcode() != null) { if (codeBean.getBarcode() != null) {
return ResultBean.newOkResult(codeBean.getBarcode()); Barcode barcode = codeBean.getBarcode();
BarcodeDto barcodeDto = barcodeMapper.toDto(barcode);
barcodeDto.setOtherField1(detail.getRuleName());
return ResultBean.newOkResult(barcodeDto);
}
} }
} }
} else { } else {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!