提交代码

master
胡锐 6 months ago
parent 999f083d6a
commit 58aa47a77f
  1. 9
      order/src/main/java/com/order/controller/business/OrderCouponController.java
  2. 1
      service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java
  3. 4
      service/src/main/java/com/hfkj/service/coupon/BsOrderCouponService.java
  4. 10
      service/src/main/java/com/hfkj/service/coupon/impl/BsOrderCouponServiceImpl.java
  5. 4
      service/src/main/java/com/hfkj/service/order/OrderCancelService.java
  6. 8
      service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java

@ -36,11 +36,14 @@ public class OrderCouponController {
@RequestMapping(value="/queryDetail",method = RequestMethod.GET) @RequestMapping(value="/queryDetail",method = RequestMethod.GET)
@ResponseBody @ResponseBody
@ApiOperation(value = "查询交易订单详情") @ApiOperation(value = "查询交易订单详情")
public ResponseData queryDetail(@RequestParam(value = "orderChildOrderNo" , required = true) String orderChildOrderNo) { public ResponseData queryDetail(@RequestParam(value = "orderChildNo" , required = true) String orderChildNo) {
try { try {
Map<String,Object> param = new HashMap<>(); Map<String,Object> param = new HashMap<>();
param.put("orderNo", orderCouponService.getListByChildOrderNo(orderChildOrderNo)); param.put("order", orderCouponService.getDetailByChildOrderNo(orderChildNo));
param.put("goods", null);
Map<String,Object> goodsParam = new HashMap<>();
goodsParam.put("orderChildNo", orderChildNo);
param.put("goods", orderCouponService.getOrderList(goodsParam));
return ResponseMsgUtil.success(param); return ResponseMsgUtil.success(param);

@ -44,6 +44,7 @@ public interface BsOrderCouponMapperExt {
" LEFT JOIN bs_order_coupon b on a.coupon_order_id = b.id" + " LEFT JOIN bs_order_coupon b on a.coupon_order_id = b.id" +
" WHERE 1 = 1" + " WHERE 1 = 1" +
" <if test='param.orderNo != null'> and b.order_no like concat('%',#{param.orderNo},'%') </if>" + " <if test='param.orderNo != null'> and b.order_no like concat('%',#{param.orderNo},'%') </if>" +
" <if test='param.orderChildNo != null'> and b.child_order_no = #{param.orderChildNo} </if>" +
" <if test='param.userPhone != null'> and b.user_phone like concat('%',#{param.userPhone},'%') </if>" + " <if test='param.userPhone != null'> and b.user_phone like concat('%',#{param.userPhone},'%') </if>" +
" <if test='param.payType != null'> and b.pay_type = #{param.payType}</if>" + " <if test='param.payType != null'> and b.pay_type = #{param.payType}</if>" +
" <if test='param.tradeStatus != null'> and b.status = #{param.tradeStatus}</if>" + " <if test='param.tradeStatus != null'> and b.status = #{param.tradeStatus}</if>" +

@ -22,10 +22,10 @@ public interface BsOrderCouponService {
/** /**
* 查询卡券订单 * 查询卡券订单
* @param orderChildOrderNo 子订单号 * @param orderChildNo 子订单号
* @return * @return
*/ */
List<BsOrderCoupon> getListByChildOrderNo(String orderChildOrderNo); BsOrderCoupon getDetailByChildOrderNo(String orderChildNo);
/** /**
* 查询卡券订单 * 查询卡券订单

@ -37,10 +37,14 @@ public class BsOrderCouponServiceImpl implements BsOrderCouponService {
} }
@Override @Override
public List<BsOrderCoupon> getListByChildOrderNo(String orderChildOrderNo) { public BsOrderCoupon getDetailByChildOrderNo(String orderChildNo) {
BsOrderCouponExample example = new BsOrderCouponExample(); BsOrderCouponExample example = new BsOrderCouponExample();
example.createCriteria().andChildOrderNoEqualTo(orderChildOrderNo); example.createCriteria().andChildOrderNoEqualTo(orderChildNo);
return orderCouponMapper.selectByExample(example); List<BsOrderCoupon> list = orderCouponMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
} }
@Override @Override

@ -66,14 +66,12 @@ public class OrderCancelService {
// 实物 // 实物
} else if (goodsMsg.getType() == 2) { } else if (goodsMsg.getType() == 2) {
// 虚拟 // 虚拟
List<BsOrderCoupon> orderCouponList = orderCouponService.getListByChildOrderNo(orderChild.getChildOrderNo()); BsOrderCoupon orderCoupon = orderCouponService.getDetailByChildOrderNo(orderChild.getChildOrderNo());
for(BsOrderCoupon orderCoupon : orderCouponList) {
orderCoupon.setCancelTime(new Date()); orderCoupon.setCancelTime(new Date());
orderCoupon.setStatus(OrderChildStatusEnum.status5.getCode()); orderCoupon.setStatus(OrderChildStatusEnum.status5.getCode());
orderCouponService.editData(orderCoupon); orderCouponService.editData(orderCoupon);
} }
} }
}
} }

@ -90,8 +90,7 @@ public class OrderPaySuccessService {
*/ */
public void productVpd(OrderModel order, BsOrderChild childOrder) throws Exception { public void productVpd(OrderModel order, BsOrderChild childOrder) throws Exception {
// 查询卡券订单 // 查询卡券订单
List<BsOrderCoupon> orderCouponList = orderCouponService.getListByChildOrderNo(childOrder.getChildOrderNo()); BsOrderCoupon orderCoupon = orderCouponService.getDetailByChildOrderNo(childOrder.getChildOrderNo());
for (BsOrderCoupon orderCoupon : orderCouponList) {
// 查询卡券订单的卡密 // 查询卡券订单的卡密
List<BsOrderCouponNo> couponNoList = orderCouponNoService.getListByCouponOrderId(orderCoupon.getId()); List<BsOrderCouponNo> couponNoList = orderCouponNoService.getListByCouponOrderId(orderCoupon.getId());
for (BsOrderCouponNo couponNo : couponNoList) { for (BsOrderCouponNo couponNo : couponNoList) {
@ -131,7 +130,7 @@ public class OrderPaySuccessService {
} }
} else if (vpd.getSource() == GoodsVpdSourceEnum.type6.getCode()) { } else if (vpd.getSource() == GoodsVpdSourceEnum.type6.getCode()) {
/* // 派发停车券 /* // 派发停车券
ApiBlxCoupon apiBlxCoupon = apiBlxCouponService.findBlxCoupon(coupon.getCouponKey()); ApiBlxCoupon apiBlxCoupon = apiBlxCouponService.findBlxCoupon(coupon.getCouponKey());
if (apiBlxCoupon == null || apiBlxCoupon.getCouponStatus() != 1) { if (apiBlxCoupon == null || apiBlxCoupon.getCouponStatus() != 1) {
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前卡券不可购买"); throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前卡券不可购买");
@ -195,7 +194,4 @@ public class OrderPaySuccessService {
orderCoupon.setPaySerialNo(order.getPaySerialNo()); orderCoupon.setPaySerialNo(order.getPaySerialNo());
orderCouponService.editData(orderCoupon); orderCouponService.editData(orderCoupon);
} }
}
} }

Loading…
Cancel
Save