|
@@ -94,7 +94,7 @@ public class OrderHandler {
|
|
|
private MQServiceProxy mQservice;
|
|
|
@Autowired
|
|
|
private ProductInfoService productInfoService;
|
|
|
-
|
|
|
+
|
|
|
|
|
|
* 支付前,调用方法
|
|
|
* @param request
|
|
@@ -318,6 +318,8 @@ public class OrderHandler {
|
|
|
item.setItemProductColor(cartDto.getProductColor());
|
|
|
item.setItemProductChildType(cartDto.getProductChildType());
|
|
|
item.setItemIsSource(cartDto.getCartIsSource());
|
|
|
+ item.setItemProductType(cartDto.getProductType());
|
|
|
+ item.setItemProductChildType(cartDto.getProductChildType());
|
|
|
list.add(item);
|
|
|
}
|
|
|
|
|
@@ -338,6 +340,8 @@ public class OrderHandler {
|
|
|
item.setItemProductChildType(gift.getGiftChildType());
|
|
|
item.setItemIsSource(1);
|
|
|
item.setItemGiftSource(cartDto.getCartColorId());
|
|
|
+ item.setItemProductType(cartDto.getProductType());
|
|
|
+ item.setItemProductChildType(cartDto.getProductChildType());
|
|
|
list.add(item);
|
|
|
}
|
|
|
}
|
|
@@ -398,15 +402,13 @@ public class OrderHandler {
|
|
|
}
|
|
|
|
|
|
|
|
|
- int balancePayAmount=temp.getBalancePayAmount();
|
|
|
- if(balancePayAmount>0 && member.getUserIncome()>balancePayAmount){
|
|
|
- mustPay=total-temp.getBalancePayAmount()>0?total-temp.getBalancePayAmount():0;
|
|
|
- }else if(balancePayAmount>0 && member.getUserIncome()<balancePayAmount){
|
|
|
- msg.setMessage(ResultInfo.NO_ENOUGH_FOR_PAY);
|
|
|
- return msg;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
order.setSalesYetAmount(total);
|
|
|
order.setSalesRateAmount(0);
|
|
@@ -427,7 +429,6 @@ public class OrderHandler {
|
|
|
boolean flag = false;
|
|
|
try {
|
|
|
flag = cartService.addOrderAndSaveOrderItem(order, list, cartIds);
|
|
|
-
|
|
|
|
|
|
if(hasCoupon){
|
|
|
couponItem.setCouponUseStatus(7);
|
|
@@ -436,6 +437,7 @@ public class OrderHandler {
|
|
|
} catch (Exception e) {
|
|
|
flag = false;
|
|
|
System.out.println("====插入订单列表信息失败====");
|
|
|
+ e.printStackTrace();
|
|
|
msg.setMessage(ResultInfo.paramFormatError);
|
|
|
return msg;
|
|
|
}
|
|
@@ -446,7 +448,6 @@ public class OrderHandler {
|
|
|
|
|
|
|
|
|
PayResult result = payService.requestPay(order.getSalesOpenid(), order.getSalesOrderid(), mustPay, list.get(0).getItemProductName() + "...", NameUtils.WECHAT_ORDER_BACK);
|
|
|
-
|
|
|
if (result.isPaySuccess()) {
|
|
|
dto.setInfo(result.getPayData());
|
|
|
dto.setSuccess(true);
|
|
@@ -459,7 +460,6 @@ public class OrderHandler {
|
|
|
msg.setMessage(ResultInfo.ERRORINFO);
|
|
|
msg.setData(dto);
|
|
|
msg.setStatus(false);
|
|
|
-
|
|
|
return msg;
|
|
|
}
|
|
|
} else if(flag && mustPay==0){
|
|
@@ -481,26 +481,25 @@ public class OrderHandler {
|
|
|
if(hasCoupon){
|
|
|
couponItem.setCouponUseStatus(2);
|
|
|
int i=couponItemService.updateCouponItemById(couponItem);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
|
- if(balancePayAmount>0){
|
|
|
- member.setUserIncome(-balancePayAmount);
|
|
|
- memberService.updateUserIncomeByOpenId(member);
|
|
|
-
|
|
|
-
|
|
|
- CashLog log=new CashLog();
|
|
|
- log.setCashLogsIntroduction("订单支出");
|
|
|
- log.setCashLogsNum(balancePayAmount);
|
|
|
- log.setCashLogsOpenid(member.getUserOpenid());
|
|
|
- log.setCashLogsType(2);
|
|
|
- log.setCashLogsResType(3);
|
|
|
- log.setCashLogsOrderid(order.getSalesOrderid());
|
|
|
- log.setCashLogsCreateDate(nowDate);
|
|
|
- cashLogService.addCashLog(log);
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
rebackServices.loadSingleOrderReward(order);
|
|
|
productInfoService.updateProductNumList(order.getSalesOrderid());
|
|
@@ -525,8 +524,6 @@ public class OrderHandler {
|
|
|
dto.setOrderId(order.getSalesOrderid());
|
|
|
msg.setData(dto);
|
|
|
msg.setStatus(true);
|
|
|
-
|
|
|
-
|
|
|
return msg;
|
|
|
}
|
|
|
|