|
|
@@ -1372,8 +1372,7 @@ public class ProductOrderService {
|
|
|
// ===== 1. 修改价格 =====
|
|
|
Integer newUnitPrice = params.get("unitPrice") != null ? ((Number) params.get("unitPrice")).intValue() : null;
|
|
|
if (newUnitPrice != null && newUnitPrice >= 0) {
|
|
|
- int oldPrice = order.getUnitPrice() != null ? order.getUnitPrice() : 0;
|
|
|
- int oldTotal = order.getTotalAmount() != null ? order.getTotalAmount() : 0;
|
|
|
+ int oldTotal = order.getTotalAmount() != null ? order.getTotalAmount() : 0;
|
|
|
order.setUnitPrice(newUnitPrice);
|
|
|
int newTotal = newUnitPrice * (order.getQuantity() != null ? order.getQuantity() : 1);
|
|
|
order.setTotalAmount(newTotal);
|
|
|
@@ -1382,6 +1381,7 @@ public class ProductOrderService {
|
|
|
order.setMoneyAmount(Math.max(moneyAmount, 0));
|
|
|
hasChange = true;
|
|
|
if (oldTotal != newTotal) {
|
|
|
+ if (changeLog.length() > 0) changeLog.append(";");
|
|
|
changeLog.append(String.format("价格:%d元 → %d元", oldTotal / 100, newTotal / 100));
|
|
|
}
|
|
|
}
|
|
|
@@ -1409,6 +1409,7 @@ public class ProductOrderService {
|
|
|
int oldMethod = order.getDeliveryMethod() != null ? order.getDeliveryMethod() : 1;
|
|
|
order.setDeliveryMethod(newDeliveryMethod);
|
|
|
hasChange = true;
|
|
|
+ if (changeLog.length() > 0) changeLog.append(";");
|
|
|
changeLog.append(String.format("配送方式:%d → %d", oldMethod, newDeliveryMethod));
|
|
|
}
|
|
|
}
|
|
|
@@ -1447,6 +1448,7 @@ public class ProductOrderService {
|
|
|
familyCouponMapper.insert(fc);
|
|
|
}
|
|
|
hasChange = true;
|
|
|
+ if (changeLog.length() > 0) changeLog.append(";");
|
|
|
changeLog.append(String.format("新增优惠券:减免%d元", couponValue / 100));
|
|
|
}
|
|
|
|
|
|
@@ -1473,6 +1475,7 @@ public class ProductOrderService {
|
|
|
productOrderGiftMapper.insert(orderGift);
|
|
|
|
|
|
hasChange = true;
|
|
|
+ if (changeLog.length() > 0) changeLog.append(";");
|
|
|
changeLog.append(String.format("新增赠品:%s x%d",
|
|
|
giftProductName != null ? giftProductName : "赠品", quantity));
|
|
|
}
|