xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/controller/XpAppUserCouponController.java
@@ -308,7 +308,7 @@ @PostMapping("/api/v1/appUserCoupon/saveInfo") @ApiOperation(value = "活动发放优惠券", tags = {"管理后台-活动发放优惠券"}) public R<String> sendSave(@RequestBody UseUserCouponDto dto) { xpAppUserCouponService.saveInfo(dto); xpAppUserCouponService.saveInfo_activity(dto); return R.ok(); } /** xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/IXpAppUserCouponService.java
@@ -71,8 +71,9 @@ */ NavigationCouponPickerVo navigationCouponPicker(Long userId, NavigationCouponPickerRequest request); @Async("couponSendExecutor") boolean saveInfo(UseUserCouponDto dto); boolean saveInfo_activity(UseUserCouponDto dto); /** * 发送优惠券 xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpAppUserCouponServiceImpl.java
@@ -203,7 +203,7 @@ @Async("couponSendExecutor") @Override public boolean saveInfo(UseUserCouponDto dto) { public boolean saveInfo_activity(UseUserCouponDto dto) { R<XpCoupon> coupon = xpCouponClient.getCouponById(dto.getCouponId()); if (coupon != null) { XpCoupon xpCoupon = coupon.getData(); @@ -224,7 +224,19 @@ xpAppUserCoupon.setOpenCityId("0"); xpAppUserCoupon.setTimeJson("[{\"time\": [\"00:00-23:59\"], \"type\": 3, \"typeStr\": 0}]"); baseMapper.insert(xpAppUserCoupon); sendMsg(xpAppUserCoupon.getAppUserId(), xpCoupon, xpAppUserCoupon.getExpirationTime()); //发送微信通知 SendSubscribeMessageVo vo = new SendSubscribeMessageVo(); vo.setUserId(xpAppUserCoupon.getAppUserId()); vo.setTemplateId(MessageTemplateEnum.B.getTemplateId()); String json = MessageTemplateEnum.B.getRemarks(); json = json.replace("活动名称", dto.getActivityName()); json = json.replace("开始时间", dto.getActivityStartTime().toString() ); json = json.replace("结束时间", dto.getActivityEndTime().toString() ); json = json.replace("温馨提示", dto.getActivityRemarks()); vo.setJson(json); subscribeMessageClient.sendSubscribeMessage(vo); } } return true; xp-robotaxi-api/src/main/java/com/xiaopeng/api/dto/account/UseUserCouponDto.java
@@ -6,6 +6,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.time.LocalDateTime; import java.util.List; @Data @@ -37,4 +38,13 @@ @ApiModelProperty(value = "活动id") private Long activityId; @ApiModelProperty(value = "活动名称") private String activityName; @ApiModelProperty(value = "活动开始时间") private LocalDateTime activityStartTime; @ApiModelProperty(value = "活动开始时间") private LocalDateTime activityEndTime; @ApiModelProperty(value = "活动备注") private String activityRemarks; }