| @@ -91,15 +91,13 @@ public class WxOrderController extends BaseController { | |||||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | ||||
| String couponChannelIdStr = paramMap.get("couponChannelId"); | String couponChannelIdStr = paramMap.get("couponChannelId"); | ||||
| String couponIdStr = paramMap.get("couponId"); | String couponIdStr = paramMap.get("couponId"); | ||||
| /* | |||||
| // TODO 修改支持banner图,获取不到couponChannelId问题 | |||||
| if (StringUtils.isBlank(couponChannelIdStr)) { | if (StringUtils.isBlank(couponChannelIdStr)) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | ||||
| } | } | ||||
| */ | |||||
| Long couponChannelId = 0L, couponId = 0L; | Long couponChannelId = 0L, couponId = 0L; | ||||
| if (!StringUtils.isBlank(couponChannelIdStr)) { | |||||
| if (StringUtils.isNotBlank(couponChannelIdStr)) { | |||||
| try { | try { | ||||
| couponChannelId = Long.valueOf(couponChannelIdStr); | couponChannelId = Long.valueOf(couponChannelIdStr); | ||||
| } catch (NumberFormatException e) { | } catch (NumberFormatException e) { | ||||
| @@ -136,7 +134,7 @@ public class WxOrderController extends BaseController { | |||||
| WxCUser user = getUser(); | WxCUser user = getUser(); | ||||
| try { | try { | ||||
| WxOrder order = wxOrderService.saveOrder(user, couponId); | |||||
| WxOrder order = wxOrderService.saveOrder(user, couponChannelId, couponId); | |||||
| return new ResultData(order); | return new ResultData(order); | ||||
| } catch (MallinkException e) { | } catch (MallinkException e) { | ||||
| logger.error(e.getMessage()); | logger.error(e.getMessage()); | ||||
| @@ -29,7 +29,7 @@ public interface WxOrderService { | |||||
| * @param couponId | * @param couponId | ||||
| * @return 订单id | * @return 订单id | ||||
| */ | */ | ||||
| WxOrder saveOrder(WxCUser user, Long couponId); | |||||
| WxOrder saveOrder(WxCUser user, Long couponChannelId, Long couponId); | |||||
| /** | /** | ||||
| * 免费券订单接口 | * 免费券订单接口 | ||||
| @@ -69,6 +69,9 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| @Autowired | @Autowired | ||||
| WxCUserTagsService wxCUserTagsService; | WxCUserTagsService wxCUserTagsService; | ||||
| @Autowired | |||||
| WxCouponActionLogService wxCouponActionLogService; | |||||
| @Override | @Override | ||||
| public PageInfo<WxOrder> listAsPage(WxOrder record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxOrder> listAsPage(WxOrder record, Integer pageIndex, Integer pageSize) { | ||||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxOrderMapper.findList(record)); | return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxOrderMapper.findList(record)); | ||||
| @@ -209,7 +212,7 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| @Override | @Override | ||||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | ||||
| public WxOrder saveOrder(WxCUser user, Long couponId) { | |||||
| public WxOrder saveOrder(WxCUser user, Long couponChannelId, Long couponId) { | |||||
| // 检查用户 | // 检查用户 | ||||
| if (user == null) { | if (user == null) { | ||||
| logger.error("用户不存在"); | logger.error("用户不存在"); | ||||
| @@ -283,6 +286,15 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| throw new MallinkException(ErrorCode.ORDER_SAVE_ERR); | throw new MallinkException(ErrorCode.ORDER_SAVE_ERR); | ||||
| } | } | ||||
| // couponActionLog | |||||
| try { | |||||
| wxCouponActionLogService.addOne(user.getTenantId(), couponId, orderNumber, EnumCouponSendSendType.ACTIVE.getCode(), couponChannelId); | |||||
| } catch (Exception e) { | |||||
| logger.error("保存订单:" + e.getMessage()); | |||||
| throw new MallinkException(ErrorCode.ORDER_SAVE_ERR); | |||||
| } | |||||
| return record; | return record; | ||||
| } | } | ||||