Commit 4a07258e zshaohui

缓存上一次请求信息

1 个父辈 53e27817
...@@ -1202,7 +1202,7 @@ public class CDeviceController { ...@@ -1202,7 +1202,7 @@ public class CDeviceController {
} }
public static Map<String,String> lastOutBarcodeMap = Maps.newConcurrentMap(); public static Map<String, String> lastSeqMap = Maps.newConcurrentMap();
@ApiOperation("物料出库(新接口)") @ApiOperation("物料出库(新接口)")
@RequestMapping("/reelFromBox") @RequestMapping("/reelFromBox")
...@@ -1213,30 +1213,26 @@ public class CDeviceController { ...@@ -1213,30 +1213,26 @@ public class CDeviceController {
String code = paramMap.get("code"); //条码编号 String code = paramMap.get("code"); //条码编号
String currentLoc = paramMap.get("currentLoc"); //当前位置 String currentLoc = paramMap.get("currentLoc"); //当前位置
String stacker = paramMap.get("stacker");//条码编号 String stacker = paramMap.get("stacker");//条码编号
String requestSeq = paramMap.get("seq");
log.info("物料放到料串上,通知出库,隔口号为:" + boxPar + ",条码信息为:" + code + "当前位置为:" + currentLoc + "条码编号为:" + stacker); log.info("物料放到料串上,通知出库,隔口号为:" + boxPar + ",条码信息为:" + code + "当前位置为:" + currentLoc + "条码编号为:" + stacker+",请求id为:"+requestSeq);
String lastOutBarcode = lastOutBarcodeMap.get(boxPar); //如果顺序相同,直返返回ok
if (StringUtils.isEmpty(lastOutBarcode)){ if (StringUtils.isNotEmpty(requestSeq)) {
if (StringUtils.isEmpty(code)){ String lastSeq = lastSeqMap.get(boxPar);
lastOutBarcodeMap.put(boxPar,"noCode"); if (StringUtils.isNotEmpty(lastSeq)) {
}else { if (lastSeq.equals(requestSeq)) {
lastOutBarcodeMap.put(boxPar,code); log.info(boxPar+"与上一次请求的序列号:"+requestSeq+"相同,直接返回ok");
} return ResultBean.newOkResult("");
} else { } else {
if (StringUtils.isEmpty(code)){ lastSeqMap.put(boxPar, requestSeq);
if (lastOutBarcode.equals("noCode")){
log.info(boxPar+"上一次没扫到条码,与当前传入的一致,直接返回ok");
return ResultBean.newOkResult(new HashMap<>());
}
}else {
if (lastOutBarcode.equals(code)) {
log.info(boxPar+"上一次扫到的为:"+lastOutBarcode+",与当前传入的条码:"+code+"一致,直接返回ok");
return ResultBean.newOkResult(new HashMap<>());
} }
} else {
lastSeqMap.put(boxPar,requestSeq);
} }
} }
Barcode alearyOutBarcode = null; Barcode alearyOutBarcode = null;
try { try {
if (StringUtils.isEmpty(code)) { if (StringUtils.isEmpty(code)) {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!