| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.activity.entity.BodySideAppointment; |
| | | import com.dsh.activity.entity.IntroduceRewards; |
| | | import com.dsh.activity.feignclient.account.AppUserClient; |
| | | import com.dsh.activity.feignclient.model.IntrduceOfUserRequest; |
| | | import com.dsh.activity.feignclient.model.PurchaseRecordVo; |
| | | import com.dsh.activity.feignclient.other.model.Store; |
| | |
| | | @Autowired |
| | | private IntroduceUserService introduceUserService; |
| | | |
| | | |
| | | private final SimpleDateFormat mat = new SimpleDateFormat("MM-dd HH:mm"); |
| | | |
| | | /** |
| | |
| | | Date date = new Date(); |
| | | List<IntroduceVO> introduceVOS = idrService.listAll(query); |
| | | for (IntroduceVO introduceVO : introduceVOS) { |
| | | |
| | | Date startTime = introduceVO.getStartTime(); |
| | | Date endTime = introduceVO.getEndTime(); |
| | | if (date.after(startTime) && date.before(endTime)) { |
| | |
| | | } |
| | | |
| | | @PostMapping("/base/introduce/getGiftList") |
| | | public Integer getGiftList(@RequestBody String cityCode){ |
| | | List<IntroduceRewards> list = idrService.list(new LambdaQueryWrapper<IntroduceRewards>().eq(IntroduceRewards::getCityCode,cityCode).le(IntroduceRewards::getStartTime,new Date()).ge(IntroduceRewards::getEndTime,new Date())); |
| | | int sum = list.stream().mapToInt(IntroduceRewards::getGiveClass).sum(); |
| | | return sum; |
| | | @ResponseBody |
| | | public IntroduceRewards getGiftList(@RequestBody String cityCode){ |
| | | List<IntroduceRewards> list = idrService.list(new LambdaQueryWrapper<IntroduceRewards>() |
| | | .eq(IntroduceRewards::getCityCode,cityCode) |
| | | .le(IntroduceRewards::getStartTime,new Date()) |
| | | .ge(IntroduceRewards::getEndTime,new Date()) |
| | | .orderByDesc(IntroduceRewards::getInsertTime) |
| | | .last("LIMIT 1")); |
| | | if (list.size()>0){ |
| | | return list.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | } |