Просмотр исходного кода

//tt product

release_toaliyun_real
xhxu 3 лет назад
Родитель
Сommit
cccec8df2d
3 измененных файлов: 26 добавлений и 6 удалений
  1. +3
    -0
      mallinkService/src/main/java/com/iformall/service/WxPayOrderService.java
  2. +21
    -4
      mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java
  3. +2
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java

+ 3
- 0
mallinkService/src/main/java/com/iformall/service/WxPayOrderService.java Просмотреть файл

@@ -36,6 +36,9 @@ public interface WxPayOrderService {
*/ */
ResultData createPayOrder(WxAppinfo appInfo, WxCUserBasicInfo user, WxPayOrder record, EnumPayWay payWay,PayExtraParam params,boolean isCreatePay); ResultData createPayOrder(WxAppinfo appInfo, WxCUserBasicInfo user, WxPayOrder record, EnumPayWay payWay,PayExtraParam params,boolean isCreatePay);


PayAdapterResult createPayOrder(WxAppinfo appInfo, WxCUserBasicInfo user,WxPayOrder record,WxComposeOrder composeOrder,
String productName, EnumPayWay payWay,PayExtraParam params,boolean isCreatePay);

/** /**
* 刷卡支付订单 * 刷卡支付订单
* *


+ 21
- 4
mallinkService/src/main/java/com/iformall/service/impl/WxOrderServiceImpl.java Просмотреть файл

@@ -34,6 +34,8 @@ import com.iformall.service.order.entity.WxComposeOrder;
import com.iformall.service.order.util.OrderHelper; import com.iformall.service.order.util.OrderHelper;


import com.iformall.service.pay.PayServiceFactory; import com.iformall.service.pay.PayServiceFactory;
import com.iformall.service.pay.entity.PayExtraParam;
import com.iformall.service.pay.service.pay.entity.PayAdapterResult;
import com.iformall.utils.*; import com.iformall.utils.*;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -914,7 +916,7 @@ public class WxOrderServiceImpl implements WxOrderService {
* *
* @param user * @param user
* @param coupon * @param coupon
* @param couponIdStr
* @param
*/ */
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
public StockReduceResult stockReduce(boolean allowUnPayOrder,WxCUserBasicInfo user, WxCoupon coupon, WxCouponChannel couponChannel,int number) { public StockReduceResult stockReduce(boolean allowUnPayOrder,WxCUserBasicInfo user, WxCoupon coupon, WxCouponChannel couponChannel,int number) {
@@ -2770,7 +2772,8 @@ public class WxOrderServiceImpl implements WxOrderService {
RedisTemplate<String, WxCUserBasicInfo> cUserBasicInfoRedisTemplate; RedisTemplate<String, WxCUserBasicInfo> cUserBasicInfoRedisTemplate;
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class})
public WxComposeOrder savePlatPushOrderForCoupon(TenantEntity tenantEntity,boolean allowUnPayOrder,EnumComposeOrder composeOrderType,WxCUserBasicInfo user,String allExtParam,List<PlatPushOrderSaveDto> platPushOrderList,EnumPayWay payWay) {
public WxComposeOrder savePlatPushOrderForCoupon(TenantEntity tenantEntity,boolean allowUnPayOrder,EnumComposeOrder composeOrderType,
WxCUserBasicInfo user,String allExtParam,List<PlatPushOrderSaveDto> platPushOrderList,EnumPayWay payWay) throws Exception {
WxOrderServiceImpl proxy = (WxOrderServiceImpl) AopContext.currentProxy(); WxOrderServiceImpl proxy = (WxOrderServiceImpl) AopContext.currentProxy();
// 防止同一用户重复下单,1秒内 // 防止同一用户重复下单,1秒内
String key = new StringBuilder().append("savePlatPushOrder:").append(user.getId()).toString(); String key = new StringBuilder().append("savePlatPushOrder:").append(user.getId()).toString();
@@ -2786,9 +2789,11 @@ public class WxOrderServiceImpl implements WxOrderService {
WxComposeOrder composeOrder = orderAdapterService.createDBMainOrderByPushOrder(tenantEntity,user, allExtParam,platPushOrderList, payWay); WxComposeOrder composeOrder = orderAdapterService.createDBMainOrderByPushOrder(tenantEntity,user, allExtParam,platPushOrderList, payWay);
Date orderDate = new Date(); Date orderDate = new Date();
WxOrder lastOrder = null; WxOrder lastOrder = null;
WxCoupon lastCoupon = null;
for (int i = 0 ; i < platPushOrderList.size(); i ++) { for (int i = 0 ; i < platPushOrderList.size(); i ++) {
PlatPushOrderSaveDto orderdto = platPushOrderList.get(i); PlatPushOrderSaveDto orderdto = platPushOrderList.get(i);
lastCoupon = orderdto.getWxCoupon();

Map<Long,WxCouponChannel> couponChannelMap = composeOrder.getCouponChannelMap(); Map<Long,WxCouponChannel> couponChannelMap = composeOrder.getCouponChannelMap();
Long couponChannelId = orderdto.getCouponChannelId(); Long couponChannelId = orderdto.getCouponChannelId();
WxCouponChannel couponChannel = couponChannelMap.get(couponChannelId); WxCouponChannel couponChannel = couponChannelMap.get(couponChannelId);
@@ -2824,7 +2829,19 @@ public class WxOrderServiceImpl implements WxOrderService {
if (EnumComposeOrder.isSingle(composeOrderType.getCode())) { if (EnumComposeOrder.isSingle(composeOrderType.getCode())) {
composeOrder.setSingleOrder(lastOrder); composeOrder.setSingleOrder(lastOrder);
} }
return composeOrder;
WxPayOrder record = new WxPayOrder();
record.updateTenantInfo(tenantEntity);
record.setOrderId(composeOrder.getMainOrderId());
record.setComposeOrder(composeOrder.getComposeOrderType());
record.setOpenId((String) composeOrder.getMainOrder().getExpParamValue("open_id"));
String productName = orderAdapterService.getPayProductName(lastCoupon);
WxAppinfo cAppInfo = wxAppinfoService.getCAppInfo(tenantEntity, payWay.getPlat());
PayAdapterResult payResult = wxPayOrderService.createPayOrder(cAppInfo, user, record,composeOrder,productName, payWay, new PayExtraParam("openId",record.getOpenId()),false);
if(payResult.isSuccess()){
return composeOrder;
}else{
throw new Exception(payResult.getMsg());
}
} }




+ 2
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxPayOrderServiceImpl.java Просмотреть файл

@@ -322,8 +322,8 @@ public class WxPayOrderServiceImpl implements WxPayOrderService {
} }
return wxCoupon; return wxCoupon;
} }
private PayAdapterResult createPayOrder(WxAppinfo appInfo, WxCUserBasicInfo user,WxPayOrder record,WxComposeOrder composeOrder,
@Override
public PayAdapterResult createPayOrder(WxAppinfo appInfo, WxCUserBasicInfo user,WxPayOrder record,WxComposeOrder composeOrder,
String productName, EnumPayWay payWay,PayExtraParam params,boolean isCreatePay) { String productName, EnumPayWay payWay,PayExtraParam params,boolean isCreatePay) {
IdWorker idworker = IdWorker.get(); IdWorker idworker = IdWorker.get();
EnumPayShare isShare = EnumPayShare.NO; EnumPayShare isShare = EnumPayShare.NO;


Загрузка…
Отмена
Сохранить