Commit 0032eb91 张少辉

1.上架/下架 转换成 短的条码

2.退库问题修改
1 个父辈 7c5c3db0
...@@ -247,8 +247,6 @@ public class Barcode extends BasePo implements Serializable { ...@@ -247,8 +247,6 @@ public class Barcode extends BasePo implements Serializable {
private String receiptOrder; private String receiptOrder;
private String checkOutOrder;
//物料描述 //物料描述
private String description; private String description;
......
...@@ -122,9 +122,11 @@ public class CodeResolve { ...@@ -122,9 +122,11 @@ public class CodeResolve {
if((codeBeanFromRule.getBarcode()!=null)&&(codeBeanFromRule.getBarcode().getPartNumber()!=null)) { if((codeBeanFromRule.getBarcode()!=null)&&(codeBeanFromRule.getBarcode().getPartNumber()!=null)) {
if (!barcode.getPartNumber().equals(codeBeanFromRule.getBarcode().getPartNumber())) { if (!barcode.getPartNumber().equals(codeBeanFromRule.getBarcode().getPartNumber())) {
try { try {
if (barcode.getBarcode().length() != 6) {
log.warn("[" + barcode.getBarcode() + "]重新设置PN[" + barcode.getPartNumber() + "]为[" + codeBeanFromRule.getBarcode().getPartNumber() + "]"); log.warn("[" + barcode.getBarcode() + "]重新设置PN[" + barcode.getPartNumber() + "]为[" + codeBeanFromRule.getBarcode().getPartNumber() + "]");
//barcode.setPartNumber(codeBeanFromRule.getBarcode().getPartNumber()); barcode.setPartNumber(codeBeanFromRule.getBarcode().getPartNumber());
//barcode = barcodeManager.save(barcode); barcode = barcodeManager.save(barcode);
}
} catch (Exception ve) { } catch (Exception ve) {
log.error("重新设置PN出错", ve); log.error("重新设置PN出错", ve);
} }
......
...@@ -4,6 +4,7 @@ import com.neotel.smfcore.common.bean.ResultBean; ...@@ -4,6 +4,7 @@ import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.ReelLockPosUtil; import com.neotel.smfcore.common.utils.ReelLockPosUtil;
import com.neotel.smfcore.common.utils.SecurityUtils; import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.utils.CodeResolve; import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import com.neotel.smfcore.core.device.enums.OP; import com.neotel.smfcore.core.device.enums.OP;
...@@ -57,6 +58,15 @@ public class MaterialOperationController { ...@@ -57,6 +58,15 @@ public class MaterialOperationController {
Barcode barcode; Barcode barcode;
try { try {
// 检查code长度是否≥6(第一位+最后五位需要至少6位字符)
if (code.length() >= 6) {
// 提取第一位字符(转为String方便拼接)
String firstChar = String.valueOf(code.charAt(0));
// 提取最后五位字符(substring从指定索引截取到末尾)
String lastFiveChars = code.substring(code.length() - 5);
// 拼接新的code
code = firstChar + lastFiveChars;
}
barcode = codeResolve.resolveOneValideBarcode(code); barcode = codeResolve.resolveOneValideBarcode(code);
} catch (ValidateException e) { } catch (ValidateException e) {
log.error("[人工上架] code: {} 条码解析失败: {}", code, e.getMessage()); log.error("[人工上架] code: {} 条码解析失败: {}", code, e.getMessage());
...@@ -135,6 +145,15 @@ public class MaterialOperationController { ...@@ -135,6 +145,15 @@ public class MaterialOperationController {
Barcode barcode; Barcode barcode;
try { try {
// 检查code长度是否≥6(第一位+最后五位需要至少6位字符)
if (code.length() >= 6) {
// 提取第一位字符(转为String方便拼接)
String firstChar = String.valueOf(code.charAt(0));
// 提取最后五位字符(substring从指定索引截取到末尾)
String lastFiveChars = code.substring(code.length() - 5);
// 拼接新的code
code = firstChar + lastFiveChars;
}
barcode = codeResolve.resolveOneValideBarcode(code); barcode = codeResolve.resolveOneValideBarcode(code);
} catch (ValidateException e) { } catch (ValidateException e) {
log.error("[人工下架] code: {} 条码解析失败: {}", code, e.getMessage()); log.error("[人工下架] code: {} 条码解析失败: {}", code, e.getMessage());
......
...@@ -53,8 +53,8 @@ public class MomoApi extends BaseSmfApiListener { ...@@ -53,8 +53,8 @@ public class MomoApi extends BaseSmfApiListener {
if (StringUtils.isNotEmpty(receiptOrder)){ if (StringUtils.isNotEmpty(receiptOrder)){
stockIn(barcode); stockIn(barcode);
} else { } else {
if (StringUtils.isNotEmpty(barcode.getCheckOutOrder())){ if (StringUtils.isNotEmpty(barcode.getStockoutNo())){
stockReturn(task); stockReturn(barcode);
} }
} }
} }
...@@ -83,40 +83,36 @@ public class MomoApi extends BaseSmfApiListener { ...@@ -83,40 +83,36 @@ public class MomoApi extends BaseSmfApiListener {
} }
} }
public void stockReturn(DataLog task) { public void stockReturn(Barcode barcode) {
/*Map<String, Object> paramMap = new HashMap<>(); Map<String, Object> paramMap = new HashMap<>();
paramMap.put("ReturnDate", DateUtil.toDateString(task.getUpdateDate(), "yyyy/MM/dd HH:mm:ss")); paramMap.put("ReturnDate", DateUtil.toDateString(new Date(), "yyyy/MM/dd HH:mm:ss"));
paramMap.put("StockReturn", task.getStockReturn()); paramMap.put("StockReturn", barcode.getStockoutNo());
List<Map<String, Object>> Details = new ArrayList<>(); List<Map<String, Object>> Details = new ArrayList<>();
Map<String, Object> detailMap = new HashMap<>(); Map<String, Object> detailMap = new HashMap<>();
detailMap.put("ProductName", task.getProductName()); detailMap.put("ProductName", barcode.getDescription());
detailMap.put("ProductNo", task.getPartNumber()); detailMap.put("ProductNo", barcode.getPartNumber());
detailMap.put("Qty", task.getQty()); detailMap.put("Qty", barcode.getLastStockOutNum());
List<Map<String, Object>> RKContainer = new ArrayList<>(); List<Map<String, Object>> RKContainer = new ArrayList<>();
Map<String, Object> rkContainerMap = new HashMap<>(); Map<String, Object> rkContainerMap = new HashMap<>();
rkContainerMap.put("CQty", task.getNum()); rkContainerMap.put("CQty", barcode.getAmount());
if (StringUtils.isNotEmpty(task.getContainer())) { if (StringUtils.isNotEmpty(barcode.getPidBarcode())) {
rkContainerMap.put("Container", task.getContainer()); rkContainerMap.put("Container", barcode.getPidBarcode());
} else { } else {
rkContainerMap.put("Container", task.getBarcode()); rkContainerMap.put("Container", barcode.getBarcode());
} }
RKContainer.add(rkContainerMap); RKContainer.add(rkContainerMap);
detailMap.put("RKContainer", RKContainer); detailMap.put("RKContainer", RKContainer);
detailMap.put("StockreturnNoLine", task.getStockreturnNoLine()); detailMap.put("StockreturnNoLine", barcode.getStockoutNoLine());
Details.add(detailMap); Details.add(detailMap);
paramMap.put("Details", Details); paramMap.put("Details", Details);
log.info("接口6:MOM接收WMS的退库结果,请求参数为:" + JSON.toJSONString(paramMap)); log.info("接口6:MOM接收WMS的退库结果,请求参数为:" + JSON.toJSONString(paramMap));
try { try {
String resultStr = HttpHelper.postJson(stockReturnUrl, paramMap); String resultStr = HttpHelper.postJson(stockReturnUrl, paramMap);
log.info("接口6:MOM接收WMS的退库结果,返回参数为:" + resultStr); log.info("接口6:MOM接收WMS的退库结果,返回参数为:" + resultStr);
} catch (ApiException e) { } catch (ApiException e) {
log.error("接口6:MOM接收WMS的退库结果,请求异常:", e); log.error("接口6:MOM接收WMS的退库结果,请求异常:", e);
}*/ }
} }
......
...@@ -67,6 +67,11 @@ public class BoxUtil { ...@@ -67,6 +67,11 @@ public class BoxUtil {
} }
public static void intoPos(DataLog opTask) { public static void intoPos(DataLog opTask) {
//更新缓存中的库存信息
opTask.setStatus(OP_STATUS.FINISHED.name());
taskService.updateFinishedTask(opTask);
//已完成,加入库存,并且从完成队列中清除 //已完成,加入库存,并且从完成队列中清除
StoragePos storagePos = storagePosManager.get(opTask.getPosId()); StoragePos storagePos = storagePosManager.get(opTask.getPosId());
//二维码状态 //二维码状态
...@@ -91,9 +96,6 @@ public class BoxUtil { ...@@ -91,9 +96,6 @@ public class BoxUtil {
storagePos.setUsed(true); storagePos.setUsed(true);
storagePos.setCanCheckOutTime(System.currentTimeMillis()); storagePos.setCanCheckOutTime(System.currentTimeMillis());
storagePosManager.save(storagePos); storagePosManager.save(storagePos);
//更新缓存中的库存信息
opTask.setStatus(OP_STATUS.FINISHED.name());
taskService.updateFinishedTask(opTask);
taskService.removeFinishedTask(opTask); taskService.removeFinishedTask(opTask);
} }
......
...@@ -64,7 +64,7 @@ app: ...@@ -64,7 +64,7 @@ app:
type: "" type: ""
menu: menu:
show: inList show:
hide: hide:
smd: smd:
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!