Commit 2ff2619c LN

xrayUpdateAmount 点料完成接口

1 个父辈 389298f7
...@@ -708,13 +708,24 @@ public class DeviceController { ...@@ -708,13 +708,24 @@ public class DeviceController {
public ResultBean xrayUpdateAmount(HttpServletRequest request) { public ResultBean xrayUpdateAmount(HttpServletRequest request) {
String amountStr = request.getParameter("amount"); String amountStr = request.getParameter("amount");
String barcodeStr = request.getParameter("barcode"); String barcodeStr = request.getParameter("barcode");
log.info("点料信息:barcode:"+barcodeStr+",amount为:"+amountStr); boolean needResolve = false;
String offlineMode = request.getParameter("offlineMode");
if (ObjectUtil.isNotEmpty(offlineMode) && offlineMode.equalsIgnoreCase("true")) {
needResolve = true;
}
log.info("点料信息:barcode:" + barcodeStr + ",amount为:" + amountStr);
if (StringUtils.isNotBlank(barcodeStr)) { if (StringUtils.isNotBlank(barcodeStr)) {
Barcode barcode = barcodeManager.findByBarcode(barcodeStr); Barcode barcode = barcodeManager.findByBarcode(barcodeStr);
if (needResolve && barcode == null) {
//解析条码
barcode = codeResolve.resolveOneValideBarcode(barcodeStr);
}
if (barcode != null) { if (barcode != null) {
int oldQty = barcode.getAmount(); int oldQty = barcode.getAmount();
int qty=NumberUtil.parseInt(amountStr); int qty = NumberUtil.parseInt(amountStr);
barcode.setAmount(qty); barcode.setAmount(qty);
barcode.setOriAmount(oldQty); barcode.setOriAmount(oldQty);
barcode.setXrayCount(barcode.getXrayCount() + 1); barcode.setXrayCount(barcode.getXrayCount() + 1);
...@@ -737,14 +748,14 @@ public class DeviceController { ...@@ -737,14 +748,14 @@ public class DeviceController {
} else { } else {
loadingUtil.xRayEndUpdateItem(barcode.getBarcode(), qty, INITEM_STATUS.XRayFail); loadingUtil.xRayEndUpdateItem(barcode.getBarcode(), qty, INITEM_STATUS.XRayFail);
ResultBean<Object> resultBean= ResultBean.newErrorResult(1, "smfcore.micron.operationFailure", "操作失败"); ResultBean<Object> resultBean = ResultBean.newErrorResult(1, "smfcore.micron.operationFailure", "操作失败");
resultBean.setData(barcode.getXrayCount()); resultBean.setData(barcode.getXrayCount());
return resultBean; return resultBean;
} }
} catch (ApiException api) { } catch (ApiException api) {
loadingUtil.xRayEndUpdateItem(barcode.getBarcode(), qty, INITEM_STATUS.XRayFail); loadingUtil.xRayEndUpdateItem(barcode.getBarcode(), qty, INITEM_STATUS.XRayFail);
ResultBean<Object> resultBean= ResultBean.newErrorResult(1, api.getMsgKey(),api.getMessage()); ResultBean<Object> resultBean = ResultBean.newErrorResult(1, api.getMsgKey(), api.getMessage());
resultBean.setData(barcode.getXrayCount()); resultBean.setData(barcode.getXrayCount());
return resultBean; return resultBean;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!