mq增加事务

This commit is contained in:
19991905653 2024-03-27 09:15:10 +08:00
parent 9c90074614
commit 9e7cf9e56a
2 changed files with 6 additions and 0 deletions

View File

@ -143,6 +143,9 @@ public class DutyService {
shopUserDutyPay.setAmount(orderInfo.getOrderAmount());
shopUserDutyPayMapper.insert(shopUserDutyPay);
}
// for (TbOrderDetail orderDetail : list){
//
// }
} else if (type.equals("return")) {
BigDecimal amount = jsonObject.getBigDecimal("amount");
if (Objects.isNull(shopUserDuty)) {

View File

@ -263,6 +263,9 @@ public class OrderService {
List<TbOrderDetail> orderDetails = new ArrayList<>();
String masterId = "";
int orderId = 0;
if (list.size()<1 || list.isEmpty()){
return Result.fail(CARTEXIST);
}
for (TbCashierCart cashierCart : list) {
TbProductSkuWithBLOBs tbProduct = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getSkuId()));
totalAmount = totalAmount.add(cashierCart.getTotalAmount());