Commit 5471fc39 zshaohui

1.外仓工单出库修改

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