|
|
@@ -1476,6 +1476,7 @@ public class StoreOrderScrmController extends AppBaseController {
|
|
|
String prescribeOrder = "";
|
|
|
BigDecimal payPrice = BigDecimal.ZERO;
|
|
|
BigDecimal payMoneyRes = BigDecimal.ZERO;
|
|
|
+ BigDecimal payDelivery = BigDecimal.ZERO;
|
|
|
List<FsStoreOrderScrm> orders = orderService.getStoreOrderByCombinationId(param.getCombinationOrderId());
|
|
|
for (int i = 0; i < orders.size(); i++) {
|
|
|
|
|
|
@@ -1487,9 +1488,6 @@ public class StoreOrderScrmController extends AppBaseController {
|
|
|
}
|
|
|
|
|
|
//判断修改订单校验
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
FsUser user = userService.selectFsUserById(orders.get(i).getUserId());
|
|
|
if (user != null) {
|
|
|
//已改价处理
|
|
|
@@ -1524,8 +1522,15 @@ public class StoreOrderScrmController extends AppBaseController {
|
|
|
} else if (param.getPayType().equals(3)) {
|
|
|
//货到付款
|
|
|
orders.get(i).setPayType("3");
|
|
|
- orders.get(i).setPayDelivery(orders.get(i).getPayPrice());
|
|
|
- orders.get(i).setPayMoney(BigDecimal.ZERO);
|
|
|
+// orders.get(i).setPayDelivery(orders.get(i).getPayPrice());
|
|
|
+// orders.get(i).setPayMoney(BigDecimal.ZERO);
|
|
|
+ BigDecimal amount=redisCache.getCacheObject("orderAmount:"+orders.get(i).getId());
|
|
|
+ BigDecimal payMoney = BigDecimal.ZERO;
|
|
|
+ if (amount != null){
|
|
|
+ payMoney=amount;
|
|
|
+ }
|
|
|
+ orders.get(i).setPayMoney(payMoney);
|
|
|
+ orders.get(i).setPayDelivery(orders.get(i).getPayPrice().subtract(payMoney) );
|
|
|
}
|
|
|
if (orders.get(i).getIsPrescribe() ==1){
|
|
|
if (prescribeOrder.length()<=1){
|
|
|
@@ -1540,6 +1545,7 @@ public class StoreOrderScrmController extends AppBaseController {
|
|
|
}
|
|
|
payMoneyRes = NumberUtil.add(orders.get(i).getPayMoney(), payMoneyRes);
|
|
|
payPrice = NumberUtil.add(payPrice, orders.get(i).getPayPrice());
|
|
|
+ payDelivery = payDelivery.add(orders.get(i).getPayDelivery());
|
|
|
} else {
|
|
|
return R.error("用户不存在");
|
|
|
}
|
|
|
@@ -1552,6 +1558,7 @@ public class StoreOrderScrmController extends AppBaseController {
|
|
|
orderRes.setCreateTime(orders.get(0).getCreateTime());
|
|
|
orderRes.setPayPrice(payPrice);
|
|
|
orderRes.setPayMoney(payMoneyRes);
|
|
|
+ orderRes.setPayDelivery(payDelivery);
|
|
|
orderRes.setCombinationOrderId(param.getCombinationOrderId());
|
|
|
// return R.ok().put("order", orderRes);
|
|
|
return R.ok().put("order", orderRes).put("prescribeOrder",prescribeOrder);
|