添加日志

20230922-ljl-fixBug
ljl 1 year ago
parent 449394d5b4
commit c64ac0d12e

@ -434,6 +434,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
private void dsPurchaseOrderOutStorageAndUpdateRemark(ShopBO shopBO, PurchaseOrderDTO purchaseOrderInfo, OpOrder opOrder, PurchaseOrder purchaseOrder) {
if (checkPurchaseOrderStatusCanOutStorage(purchaseOrderInfo, opOrder)) {
outstorageService.dsPurchaseAutoOutStorage(shopBO, opOrder, purchaseOrder);
} else {
log.info("checkPurchaseOrderStatusCanOutStorageFail");
}
if (checkNeedBuildPurchaseOrderRemark(purchaseOrderInfo, purchaseOrder)) {
buildAndUpdateNewPurchaseOrderRemark(shopBO, opOrder);
@ -570,15 +572,17 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
String appChineseName = AppConst.appChineseName;
Pattern p = Pattern.compile("【(" + appChineseName + "|0.0)[^】]*】");
Matcher m = p.matcher(oldRemark);
boolean hasMatch = false;
StringBuffer newRemarkBuffer = new StringBuffer(oldRemark.length());
while (m.find()) {
hasMatch = true;
// m.appendReplacement(newRemarkBuffer, purchaseOrderRemark);
m.appendReplacement(newRemarkBuffer, purchaseOrderRemark);
}
m.appendTail(newRemarkBuffer);
String newRemark = newRemarkBuffer.toString();
// String newRemark = oldRemark.replaceAll("【(" + appChineseName + "|0.0)[^】]*】", purchaseOrderRemark);
if (!hasMatch) {
newRemark = oldRemark + purchaseOrderRemark;
}
@ -738,6 +742,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
}
private boolean checkPurchaseOrderStatusCanOutStorage(PurchaseOrderDTO purchaseOrderInfo, OpOrder opOrder) {
log.info("checkPurchaseOrderStatusCanOutStorage:purchaseOrderInfo" + purchaseOrderInfo);
log.info("checkPurchaseOrderStatusCanOutStorage:orderStatus" + opOrder);
if (!purchaseOrderInfo.getPurchaseOrderStatus().equals(PurchaseOrderConst.PURCHASE_ORDER_STATUS_HAS_SEND)) {
return false;
}

@ -256,23 +256,28 @@ public class OutstorageServiceImpl implements OutstorageService {
@Override
public void dsPurchaseAutoOutStorage(ShopBO shopBO, OpOrder opOrder, PurchaseOrder purchaseOrder) {
log.info("dsPurchaseAutoOutStorage_begin_" + opOrder.getOrderId());
DsPurchaseSetting dsPurchaseSetting = dsPurchaseSettingService.getShopSetting(opOrder.getShopId());
if (purchaseOrder.getItems() == null) {
List<PurchaseOrderItem> items = purchaseOrderItemService.getRelatePurchaseOrderItemsByPurchaseOrderId(purchaseOrder.getPurchaseOrderId());
purchaseOrder.setItems(items);
}
log.info("getOrderStatus: " + opOrder.getOrderStatus());
// try {
try {
if (opOrder.getOrderStatus().equals(OrderConst.ORDER_STATUS_WAIT_SELLER_SEND_GOODS)) {
log.info("dsPurchaseAutoOutStorage: dsOrderOutStorage" + opOrder.getOrderId());
dsOrderOutStorage(shopBO, opOrder, purchaseOrder, dsPurchaseSetting);
} else if (opOrder.getOrderStatus().equals(OrderConst.ORDER_STATUS_WAIT_BUYER_CONFIRM_GOODS) || opOrder.getOrderStatus().equals(OrderConst.ORDER_STATUS_PART_DELIVERY)) {
log.info("dsPurchaseAutoOutStorage: dsOrderOutStorageOrUpdateOutStorageLogistics" + opOrder.getOrderId());
dsOrderOutStorageOrUpdateOutStorageLogistics(shopBO, opOrder, purchaseOrder, dsPurchaseSetting);
} else {
log.error("dsPurchaseAutoOutStorageNotNeed_" + opOrder.getOrderId());
throw new RuntimeException("订单状态未达到发货条件");
}
// } catch (RuntimeException e) {
// opOrderOutstorageHistoryService.addOrderOutstorageHistory(shopBO.getShopId(), opOrder.getOrderId(), );;
// }
} catch (RuntimeException e) {
log.error("dsPurchaseAutoOutStorageError_" + opOrder.getOrderId(), e);
opOrderOutstorageHistoryService.addOrderOutstorageHistory(shopBO.getShopId(), Collections.singletonList(opOrder.getOrderId()), 0, purchaseOrder.getPurchaseOrderWaybillCode(), LogisticsConst.outstorageSourceDsAuto, 0, ResultDTO.fail(e.getMessage()));;
}
}
private void dsOrderOutStorage(ShopBO shopBO, OpOrder opOrder, PurchaseOrder purchaseOrder, DsPurchaseSetting dsPurchaseSetting) {

Loading…
Cancel
Save