| | |
| | | import com.dsh.activity.feignclient.account.model.AppUser; |
| | | import com.dsh.activity.feignclient.model.CouponStuAvailableVo; |
| | | import com.dsh.activity.feignclient.model.QueryUserCouponByIdAndUserId; |
| | | import com.dsh.activity.feignclient.other.SiteClient; |
| | | import com.dsh.activity.feignclient.other.StoreClient; |
| | | import com.dsh.activity.feignclient.other.model.Store; |
| | | import com.dsh.activity.model.CouponListVo; |
| | | import com.dsh.activity.model.GrantCoupon; |
| | | import com.dsh.activity.model.SendCouponReq; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api |
| | |
| | | private StudentClient studentClient; |
| | | @Autowired |
| | | private VipDetailService vipDetailService; |
| | | @Autowired |
| | | private StoreClient storeClient; |
| | | @Autowired |
| | | private SiteClient siteClient; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/userCoupon/updateUserCouponStatus/{id}/{storeId}/{siteId}") |
| | | public void updateUserCouponStatus(@PathVariable("id") Long id,@PathVariable("storeId") Integer storeId,@PathVariable("siteId") Integer siteId) { |
| | | |
| | | UserCoupon userCoupon = userCouponService.getOne(new LambdaQueryWrapper<UserCoupon>().eq(UserCoupon::getId, id)); |
| | | userCoupon.setStatus(2); |
| | | if (userCoupon.getIsVipGrant()!=null && userCoupon.getIsVipGrant()==1){ |
| | | VipDetail vipDetailServiceById = vipDetailService.getById(userCoupon.getVipDetailId()); |
| | | vipDetailServiceById.setStatus(2); |
| | | List<Store> stores = storeClient.queryStoreByIds(Collections.singletonList(vipDetailServiceById.getUseStoreId())); |
| | | Store store = stores.get(0); |
| | | vipDetailServiceById.setUseSiteId(siteId); |
| | | vipDetailServiceById.setUseStoreId(storeId); |
| | | vipDetailServiceById.setOperatorId(store.getOperatorId()); |
| | | vipDetailServiceById.setUseTime(new Date()); |
| | | vipDetailService.updateById(vipDetailServiceById); |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private ICouponService couponService; |
| | | |