Merge remote-tracking branch 'origin/master'

20230922-ljl-fixBug
qiushengjie 1 year ago
commit d18625a751

@ -27,6 +27,7 @@ import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.TransactionStatus;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.MatchResult;
import java.util.regex.Matcher;
@ -916,6 +917,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
HashMap<Long, Integer> purchaseNumMap = buildPurchaseOrderItemsPurchaseNum(skuIdAndOpOrderChildMap, needRebuildSkuIds, realPurchaseNumMap);
HashMap<Long, Double> purchasePriceMap = buildPurchaseOrderItemsPurchasePrice(skuIdAndOpOrderChildMap, needRebuildSkuIds, (double) 0, purchaseNumMap);
TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition);
try {
PurchaseOrder purchaseOrder = buildPurchaseOrderByDto(purchaseOrderDto, oldPurchaseOrder, opOrder);
log.info("savePurchaseOrderInfoSavePurchaseOrder" + purchaseOrder);
if (purchaseOrder.getPurchaseOrderId() != null && purchaseOrder.getPurchaseOrderId() > 0) {
@ -982,6 +985,10 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
purchaseOrderCancelLogService.insertSelective(log);
}
}
dataSourceTransactionManager.commit(transactionStatus);
} catch (Throwable e) {
dataSourceTransactionManager.rollback(transactionStatus);
}
updateOpOrderFilterPurchaseStatus(opOrder.getOrderId(), null);
opOrderDsService.updateOpOrderDsFilterStatus(opOrder.getOrderId(), purchaseOrderDto.getPurchasePlatform());
}
@ -1007,11 +1014,17 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
Date purchaseOrderSendTime = null;
Date purchaseOrderStartTime = null;
System.out.println("purchaseOrderDto: " + purchaseOrderDto);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
if (StringUtils.isNotBlank(purchaseOrderDto.getPurchaseOrderStartTime())) {
purchaseOrderStartTime = DateUtils.parseDate(purchaseOrderDto.getPurchaseOrderStartTime(), new String[]{"yyyy-MM-dd HH:mm:ss"});
purchaseOrderStartTime = dateFormat.parse(purchaseOrderDto.getPurchaseOrderStartTime());
}
if (StringUtils.isNotBlank(purchaseOrderDto.getPurchaseOrderSendTime())) {
purchaseOrderSendTime = DateUtils.parseDate(purchaseOrderDto.getPurchaseOrderSendTime(), new String[]{"yyyy-MM-dd HH:mm:ss"});
purchaseOrderSendTime = dateFormat.parse(purchaseOrderDto.getPurchaseOrderSendTime());
}
} catch (java.text.ParseException e) {
throw new RuntimeException("时间格式错误");
}
String purchaseStatus = purchaseOrderDto.getPurchaseOrderStatus();

Loading…
Cancel
Save