修改排序
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user