'提交代码'

dev-discount
199901012 4 years ago
parent 2aea8d4fbc
commit dfe1c8a124
  1. 2
      hai-bweb/src/main/java/com/bweb/controller/HighCouponController.java
  2. 4
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  3. 4
      hai-service/src/main/java/com/hai/common/pay/util/SignatureUtil.java
  4. 2
      hai-service/src/main/java/com/hai/common/pay/util/sdk/WXPayRequest.java
  5. 5
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  6. 20
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java

@ -451,7 +451,7 @@ public class HighCouponController {
highCouponCode.setSalesCode(generateCode.couponSalesCode(coupon.getMerchantId(), couponId)); highCouponCode.setSalesCode(generateCode.couponSalesCode(coupon.getMerchantId(), couponId));
highCouponCode.setSalesEndTime(salesEndTimeC.getTime()); highCouponCode.setSalesEndTime(salesEndTimeC.getTime());
highCouponCode.setUseEndTime(useEndTimeC.getTime()); highCouponCode.setUseEndTime(useEndTimeC.getTime());
highCouponCode.setStatus(1); // 状态:1.待销售 2.未使用 3.已使用 highCouponCode.setStatus(1); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
highCouponCode.setCreateTime(new Date()); highCouponCode.setCreateTime(new Date());
highCouponCode.setOperatorId(userInfoModel.getSecUser().getId()); highCouponCode.setOperatorId(userInfoModel.getSecUser().getId());
highCouponCode.setOperatorName(userInfoModel.getSecUser().getUserName()); highCouponCode.setOperatorName(userInfoModel.getSecUser().getUserName());

@ -71,9 +71,7 @@ public class HighOrderController {
SessionObject sessionObject = userCenter.getSessionObject(request); SessionObject sessionObject = userCenter.getSessionObject(request);
HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject(); HighUserModel userInfoModel = (HighUserModel) sessionObject.getObject();
if (highOrder.getPayModel() == null if (highOrder.getHighChildOrderList() == null
|| highOrder.getPayType() == null
|| highOrder.getHighChildOrderList() == null
|| highOrder.getHighChildOrderList().size() == 0 || highOrder.getHighChildOrderList().size() == 0
) { ) {
log.error("HighOrderController --> addOrder() error!", "参数错误"); log.error("HighOrderController --> addOrder() error!", "参数错误");

@ -1,7 +1,7 @@
package com.hai.common.pay.util; package com.hai.common.pay.util;
import com.shinwoten.train.common.pay.entity.WechatPayReturnParam; import com.hai.common.pay.entity.WechatPayReturnParam;
import com.shinwoten.train.common.pay.entity.WechatReturn; import com.hai.common.pay.entity.WechatReturn;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.dom4j.DocumentException; import org.dom4j.DocumentException;
import org.slf4j.Logger; import org.slf4j.Logger;

@ -24,7 +24,7 @@ import java.net.UnknownHostException;
import java.security.KeyStore; import java.security.KeyStore;
import java.security.SecureRandom; import java.security.SecureRandom;
import static com.shinwoten.train.common.pay.util.sdk.WXPayConstants.USER_AGENT; import static com.hai.common.pay.util.sdk.WXPayConstants.USER_AGENT;
public class WXPayRequest { public class WXPayRequest {
private WXPayConfig config; private WXPayConfig config;

@ -42,8 +42,13 @@ public class HighOrderServiceImpl implements HighOrderService {
} }
@Override @Override
@Transactional(propagation= Propagation.REQUIRES_NEW)
public void updateOrder(HighOrder highOrder) { public void updateOrder(HighOrder highOrder) {
highOrderMapper.updateByPrimaryKey(highOrder);
for (HighChildOrder childOrder : highOrder.getHighChildOrderList()) {
highChildOrderMapper.updateByPrimaryKey(childOrder);
}
} }
@Override @Override

@ -1,6 +1,10 @@
package com.hai.service.pay.impl; package com.hai.service.pay.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder; import com.hai.entity.HighOrder;
import com.hai.service.HighOrderService; import com.hai.service.HighOrderService;
import com.hai.service.pay.PayService; import com.hai.service.pay.PayService;
@ -9,6 +13,7 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -30,10 +35,25 @@ public class GoodsOrderServiceImpl implements PayService {
return; return;
} }
if (payType.equals("WechatPay")) { if (payType.equals("WechatPay")) {
// 查询订单信息
HighOrder order = highOrderService.getOrderByOrderNo(map.get("out_trade_no")); HighOrder order = highOrderService.getOrderByOrderNo(map.get("out_trade_no"));
if (order == null) { if (order == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.NOT_FOUND_ORDER, "");
}
order.setPaySerialNo(map.get("transaction_id")); // 支付流水号
order.setPayRealPrice(new BigDecimal(map.get("total_fee")).divide(new BigDecimal("100"))); // 实付金额
order.setPayTime(new Date()); // 支付时间
order.setPayModel(2); // 支付模式:1 金币,2 第三方平台,3 混合
order.setPayType(2); // 支付方式: 1:支付宝 2:微信 3:金币
order.setOrderStatus(2); // 订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
for (HighChildOrder highChildOrder : order.getHighChildOrderList()) {
highChildOrder.setChildOrdeStatus(2); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
} }
highOrderService.updateOrder(order);
} }
} }
} }

Loading…
Cancel
Save