| | |
| | | import com.xiaopeng.account.model.vo.XpAppUserCouponVo; |
| | | import com.xiaopeng.account.service.IXpAppUserCouponService; |
| | | import com.xiaopeng.account.util.holiday.HolidayUtil; |
| | | import com.xiaopeng.api.dto.account.UserResourcesDto; |
| | | import com.xiaopeng.api.dto.account.UcUserInfo; |
| | | import com.xiaopeng.api.feignClient.account.UserResourcesClient; |
| | | import com.xiaopeng.api.feignClient.operation.XpCouponClient; |
| | | import com.xiaopeng.api.feignClient.operation.XpWhiteListClient; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.concurrent.CompletableFuture; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | /** |
| | | * 获取用户优惠券列表 |
| | | * |
| | | * @param query |
| | | * @param uid |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取用户优惠券数量total |
| | | * |
| | | * @param uid |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 领取优惠券 |
| | | * |
| | | * @param dto |
| | | * @param uid |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 时间规则 |
| | | * |
| | | * @param couponList |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | } |
| | | for (String phone : dto.getPhone()) { |
| | | UserResourcesDto userByMobile = userResourcesClient.getUserByMobile(phone); |
| | | UcUserInfo userByMobile = userResourcesClient.getUserByMobile(phone); |
| | | if (userByMobile != null) { |
| | | Long uid = JSONObject.parseObject(userByMobile.getData().toString()).getLong("uid"); |
| | | Long uid = userByMobile.getUid(); |
| | | XpAppUserCoupon xpAppUserCoupon = new XpAppUserCoupon(); |
| | | xpAppUserCoupon.setFullMoney(xpCoupon.getConditionalAmount()); |
| | | xpAppUserCoupon.setMoney(xpCoupon.getAmount()); |
| | | xpAppUserCoupon.setCouponId(dto.getCouponId()); |
| | | xpAppUserCoupon.setAppUserId(uid); |
| | | xpAppUserCoupon.setExpirationTime(LocalDateTime.now().plusDays(100)); |
| | | xpAppUserCoupon.setStatus(1); |
| | | xpAppUserCoupon.setCouponType(xpCoupon.getCouponType()); |
| | | xpAppUserCoupon.setPhone(phone); |
| | | |
| | | xpAppUserCoupon.setCouponName(xpCoupon.getCouponName()); |
| | | xpAppUserCoupon.setOpenCityId("0"); |
| | | xpAppUserCoupon.setTimeJson("[{\"time\": [\"00:00-23:59\"], \"type\": 3, \"typeStr\": 0}]"); |
| | | baseMapper.insert(xpAppUserCoupon); |
| | | } else { |
| | | Long uid = 1L; |
| | | XpAppUserCoupon xpAppUserCoupon = new XpAppUserCoupon(); |
| | | xpAppUserCoupon.setFullMoney(xpCoupon.getConditionalAmount()); |
| | | xpAppUserCoupon.setMoney(xpCoupon.getAmount()); |
| | |
| | | xpAppUserCoupon.setCouponId(dto.getCouponId()); |
| | | xpAppUserCoupon.setAppUserId(uid); |
| | | xpAppUserCoupon.setExpirationTime(LocalDateTime.now().plusDays(100)); |
| | | xpAppUserCoupon.setStatus(1); |
| | | xpAppUserCoupon.setStatus(0); |
| | | xpAppUserCoupon.setCouponType(xpCoupon.getCouponType()); |
| | | xpAppUserCoupon.setPhone(phone); |
| | | |
| | |
| | | |
| | | /** |
| | | * 是否在运营内 |
| | | * |
| | | * @param timeJson 规则json字符串 |
| | | * @return |
| | | */ |