dev-discount
胡锐 4 years ago
commit e4f0d1cd64
  1. 16
      hai-cweb/src/main/java/com/cweb/controller/HighOrderController.java
  2. 4
      hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java
  3. 8
      hai-service/src/main/java/com/hai/common/pay/entity/WeChatPayReqInfo.java
  4. 5
      hai-service/src/main/java/com/hai/service/impl/HighOrderServiceImpl.java
  5. 2
      hai-service/src/main/java/com/hai/service/pay/impl/GoodsOrderServiceImpl.java

@ -167,6 +167,22 @@ public class HighOrderController {
}
}
@RequestMapping(value = "/cancelOrder", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "取消订单")
public ResponseData cancelOrder(@RequestParam(name = "orderId", required = true) Long orderId) {
try {
highOrderService.cancelOrder(orderId);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighOrderController --> cancelOrder() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/getUserOrderList", method = RequestMethod.GET)
@ResponseBody

@ -129,8 +129,10 @@ public class OrderController {
int total_fee = MathUtils.objectConvertBigDecimal(map.get("payPrice")).multiply(new BigDecimal("100")).intValue();
WeChatPayReqInfo weChatPayReqInfo = new WeChatPayReqInfo();
weChatPayReqInfo.setAppid(SysConst.getSysConfig().getWxAppId()); //公众号id
weChatPayReqInfo.setOpenid(openId);
weChatPayReqInfo.setMch_id(SysConst.getSysConfig().getWxMchId()); //商户号
weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxMchId()); //子商户号
weChatPayReqInfo.setOpenid(openId);
weChatPayReqInfo.setNonce_str(nonce_str); //随机字符串
weChatPayReqInfo.setBody(map.get("body").toString()); //商品描述
weChatPayReqInfo.setOut_trade_no(map.get("orderNo").toString()); //商户订单号

@ -9,6 +9,7 @@ public class WeChatPayReqInfo implements Serializable {
private static final long serialVersionUID = -7642108447915413137L;
private String appid; // 公众号id 必填
private String mch_id; // 商户号 必填
private String sub_mch_id; // 微信支付分配的子商户号 必填
private String nonce_str; // 随机字符串 必填
private String sign; // 签名 必填
private String device_info; // 设备号 可以为终端设备号(门店号或收银设备ID),PC网页或公众号内支付可以传"WEB"
@ -202,4 +203,11 @@ public class WeChatPayReqInfo implements Serializable {
this.scene_info = scene_info;
}
public String getSub_mch_id() {
return sub_mch_id;
}
public void setSub_mch_id(String sub_mch_id) {
this.sub_mch_id = sub_mch_id;
}
}

@ -142,6 +142,7 @@ public class HighOrderServiceImpl implements HighOrderService {
if (highChildOrder.getGoodsType() == 1) {
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId());
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
code.setReceiveTime(new Date());
highCouponCodeService.updateCouponCode(code);
// 卡卷关联用户
@ -150,6 +151,7 @@ public class HighOrderServiceImpl implements HighOrderService {
highUserCoupon.setCouponId(code.getCouponId());
highUserCoupon.setUserId(highOrder.getMemId());
highUserCoupon.setCouponCodeId(code.getId());
highUserCoupon.setCreateTime(new Date());
highUserCoupon.setUseEndTime(code.getUseEndTime());
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponMapper.insert(highUserCoupon);
@ -230,7 +232,7 @@ public class HighOrderServiceImpl implements HighOrderService {
@Override
public List<HighOrder> getCloseOrder() {
return null;
return highOrderMapperExt.getCloseOrder();
}
@Override
@ -266,6 +268,7 @@ public class HighOrderServiceImpl implements HighOrderService {
if (highChildOrder.getGoodsType() == 1) {
// 查询卡卷详情
HighCouponCode couponCode = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId());
couponCode.setChildOrderId(null);
couponCode.setStatus(1); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
highCouponCodeService.updateCouponCode(couponCode);
}

@ -67,6 +67,7 @@ public class GoodsOrderServiceImpl implements PayService {
highChildOrder.setChildOrdeStatus(2); // 子订单状态:1 待支付 2 已支付 3.已完成 4. 已退款 5.已取消
HighCouponCode code = highCouponCodeService.getCouponCodeByOrderId(highChildOrder.getId());
code.setStatus(2); // 状态:1.待销售 2.未使用 3.已使用 99.预支付
code.setReceiveTime(new Date());
highCouponCodeService.updateCouponCode(code);
// 卡卷关联用户
@ -75,6 +76,7 @@ public class GoodsOrderServiceImpl implements PayService {
highUserCoupon.setCouponId(code.getCouponId());
highUserCoupon.setUserId(order.getMemId());
highUserCoupon.setCouponCodeId(code.getId());
highUserCoupon.setCreateTime(new Date());
highUserCoupon.setUseEndTime(code.getUseEndTime());
highUserCoupon.setStatus(1); // 状态 0:已过期 1:未使用 2:已使用
highUserCouponMapper.insert(highUserCoupon);

Loading…
Cancel
Save