修改排序

This commit is contained in:
wuchunlei
2024-09-26 14:55:19 +08:00
parent d8acf99237
commit cb9e0adbf9
5 changed files with 46 additions and 13 deletions

View File

@@ -15,8 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.awt.*;
import java.util.Map;
@Slf4j
@@ -80,13 +78,25 @@ public class CouponController {
wrapper.orderByAsc(CouponHistory::getStatus);
wrapper.orderByDesc(CouponHistory::getCreateTime);
Page<CouponHistory> couponList = couponHistoryService.page(new Page<>(page, limit), wrapper);
for (CouponHistory ch:couponList.getRecords()){
ch.setCouponEntity(couponService.getByIdSetRange(ch.getCouponId()));
}
return R.ok().put("couponList",couponList);
}
//用户优惠劵详情
@RequestMapping("/getCouponHistoryInfo")
public R getCouponHistoryInfo(@RequestBody Map<String,Object> params){
CouponHistory CouponHistory = couponHistoryService.getById(Integer.parseInt(params.get("id").toString()));
CouponEntity couponEntity = couponService.setRangeList(couponService.getByIdSetRange(CouponHistory.getCouponId()));
CouponHistory.setCouponEntity(couponEntity);
return R.ok().put("couponHistory",CouponHistory);
}
//优惠劵详情
@RequestMapping("/getCouponInfo")
public R getCouponInfo(@RequestBody Map<String,Object> params){
CouponEntity couponEntity = couponService.getById(Integer.parseInt(params.get("id").toString()));
CouponEntity couponEntity = couponService.getByIdSetRange(Integer.parseInt(params.get("id").toString()));
couponService.setRangeList(couponEntity);
return R.ok().put("couponEntity",couponEntity);
}