Commit 5471fc39 zshaohui

1.外仓工单出库修改

2.立臻料号问题修改
1 个父辈 07b04f6e
...@@ -928,7 +928,7 @@ public class LiteOrderCache { ...@@ -928,7 +928,7 @@ public class LiteOrderCache {
if (pos == null){ if (pos == null){
pos = storagePosManager.findPartNumberInStorages(availableStorageIds, pn, excludeIds, checkoutType, warehouseCode, brand,false); pos = storagePosManager.findPartNumberInStorages(availableStorageIds, pn, excludeIds, checkoutType, warehouseCode, brand,false);
}*/ }*/
StoragePos pos = getStoragePosByPartNumberAndBrand(allStoragePosList,pn,excludeIds); StoragePos pos = getStoragePosByPartNumberAndBrand(allStoragePosList, pn, excludeIds, warehouseCode, brand);
log.info("查询库位时间结束"); log.info("查询库位时间结束");
if (pos == null) { if (pos == null) {
log.info(orderItem.getOrderId() + "厂商:" + warehouseCode + ",供应商:" + brand + ",料号:" + pn + "未找到存在库位,跳过"); log.info(orderItem.getOrderId() + "厂商:" + warehouseCode + ",供应商:" + brand + ",料号:" + pn + "未找到存在库位,跳过");
...@@ -944,23 +944,22 @@ public class LiteOrderCache { ...@@ -944,23 +944,22 @@ public class LiteOrderCache {
//调用批量禁用料接口 //调用批量禁用料接口
List<String> batchCheckList = new ArrayList<>(); List<String> batchCheckList = new ArrayList<>();
try { try {
if (alreadyCheckBox != null && !alreadyCheckBox.isEmpty()){ if (alreadyCheckBox != null && !alreadyCheckBox.isEmpty()) {
if (alreadyCheckBox.contains(barcode.getBarcode())){ if (alreadyCheckBox.contains(barcode.getBarcode())) {
} else {
log.info("当前料箱已经校验过:" + barcode.getBarcode()); log.info("当前料箱已经校验过:" + barcode.getBarcode());
} else {
batchCheckList = lizhenApi.batchCheck(subCodeList); batchCheckList = lizhenApi.batchCheck(subCodeList);
if (batchCheckList == null || batchCheckList.isEmpty()){ if (batchCheckList == null || batchCheckList.isEmpty()) {
alreadyCheckBox.add(barcode.getBarcode()); alreadyCheckBox.add(barcode.getBarcode());
} }
} }
} else { } else {
batchCheckList = lizhenApi.batchCheck(subCodeList); batchCheckList = lizhenApi.batchCheck(subCodeList);
if (batchCheckList == null || batchCheckList.isEmpty()){ if (batchCheckList == null || batchCheckList.isEmpty()) {
alreadyCheckBox.add(barcode.getBarcode()); alreadyCheckBox.add(barcode.getBarcode());
} }
} }
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -1024,7 +1023,7 @@ public class LiteOrderCache { ...@@ -1024,7 +1023,7 @@ public class LiteOrderCache {
outNumCount = outNumCount + subCode.getAmount(); outNumCount = outNumCount + subCode.getAmount();
} }
} }
log.info("保存barcode时间开始--"+barcode.getBarcode()); log.info("保存barcode时间开始--" + barcode.getBarcode());
if (subCodeIds != null && !subCodeIds.isEmpty()) { if (subCodeIds != null && !subCodeIds.isEmpty()) {
Query query = new Query(Criteria.where("id").in(subCodeIds)); Query query = new Query(Criteria.where("id").in(subCodeIds));
Update update = new Update().set("isOut", true).set("orderItemId", orderItem.getId()); Update update = new Update().set("isOut", true).set("orderItemId", orderItem.getId());
...@@ -1054,7 +1053,7 @@ public class LiteOrderCache { ...@@ -1054,7 +1053,7 @@ public class LiteOrderCache {
task.setType(OP.CHECKOUT); task.setType(OP.CHECKOUT);
task.setCreator(SecurityUtils.getCurrentUsername()); task.setCreator(SecurityUtils.getCurrentUsername());
task.setStatus(OP_STATUS.WAIT.name()); task.setStatus(OP_STATUS.WAIT.name());
if (storage.isVirtual()){ if (storage.isVirtual()) {
task.setExtendType(ExtendType.VIRTUAL_CHECKOUT); task.setExtendType(ExtendType.VIRTUAL_CHECKOUT);
} else { } else {
task.setExtendType(ExtendType.STORAGE_CHECKOUT); task.setExtendType(ExtendType.STORAGE_CHECKOUT);
...@@ -1166,7 +1165,7 @@ public class LiteOrderCache { ...@@ -1166,7 +1165,7 @@ public class LiteOrderCache {
} }
public StoragePos getStoragePosByPartNumberAndBrand(List<StoragePos> allStoragePosList, String partNumber, List<String> excludeIdList) { public StoragePos getStoragePosByPartNumberAndBrand(List<StoragePos> allStoragePosList, String partNumber, List<String> excludeIdList,String warehouseCode,String brand) {
StoragePos storagePos = null; StoragePos storagePos = null;
//先找到符合partNumber数据 //先找到符合partNumber数据
...@@ -1193,6 +1192,16 @@ public class LiteOrderCache { ...@@ -1193,6 +1192,16 @@ public class LiteOrderCache {
/*if (barcode.getExpireDate() == null) { /*if (barcode.getExpireDate() == null) {
barcode.setExpireDate(new Date()); barcode.setExpireDate(new Date());
}*/ }*/
if (StringUtils.isNotBlank(warehouseCode)){
if (!warehouseCode.equals(barcode.getWarehouseCode())){
continue;
}
}
if (StringUtils.isNotBlank(brand)){
if (!brand.equals(barcode.getProvider())){
continue;
}
}
barcodeList.add(barcode); barcodeList.add(barcode);
} }
} }
...@@ -1200,8 +1209,9 @@ public class LiteOrderCache { ...@@ -1200,8 +1209,9 @@ public class LiteOrderCache {
//按排序找到最先过期入库的partNumber //按排序找到最先过期入库的partNumber
if (barcodeList != null && !barcodeList.isEmpty()) { if (barcodeList != null && !barcodeList.isEmpty()) {
List<String> posNameList = barcodeList.stream().sorted(Comparator.comparing(Barcode::getExpireDate, Comparator.nullsFirst(Date::compareTo)).reversed()).map(item -> item.getPosName()).distinct().collect(Collectors.toList()); barcodeList = barcodeList.stream().sorted(Comparator.comparing(Barcode::getCreateDate)).collect(Collectors.toList());
for (String posName : posNameList) { for (Barcode barcode : barcodeList) {
String posName = barcode.getPosName();
for (StoragePos pos : storagePosList) { for (StoragePos pos : storagePosList) {
if (StringUtils.isNotBlank(posName)) { if (StringUtils.isNotBlank(posName)) {
if (posName.startsWith(pos.getBarcode().getBarcode())) { if (posName.startsWith(pos.getBarcode().getBarcode())) {
......
...@@ -102,7 +102,7 @@ public class LizhenApi extends DefaultSmfApiListener { ...@@ -102,7 +102,7 @@ public class LizhenApi extends DefaultSmfApiListener {
String result = HttpHelper.postJson(brandQtyUrl, paramMap); String result = HttpHelper.postJson(brandQtyUrl, paramMap);
log.info("brandQty-" + partnumber + ":请求结果为:" + result); log.info("brandQty-" + partnumber + ":请求结果为:" + result);
JSONObject jsonObject = JsonUtil.toObj(result, JSONObject.class); JSONObject jsonObject = JsonUtil.toObj(result, JSONObject.class);
String msgtx = jsonObject.getString("MSGTX"); String msgtx = jsonObject.getString("MSGTY");
if ("S".equals(msgtx)) { if ("S".equals(msgtx)) {
JSONObject dataObject = jsonObject.getJSONObject("DATA"); JSONObject dataObject = jsonObject.getJSONObject("DATA");
if (dataObject != null) { if (dataObject != null) {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!