默认分页大小
订单列表 订单类型为0时 该参数置为空值 查询订单 传参内容修改
This commit is contained in:
@@ -57,8 +57,8 @@ public class TbOrderInfoController {
|
||||
@PostMapping("/date")
|
||||
@Log("查询订单")
|
||||
@ApiOperation("查询订单")
|
||||
public ResponseEntity<Object> queryTbOrderInfo(@RequestBody TbOrderInfoQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbOrderInfoService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
public ResponseEntity<Object> queryTbOrderInfo(@RequestBody TbOrderInfoQueryCriteria criteria){
|
||||
return new ResponseEntity<>(tbOrderInfoService.queryAllPage(criteria),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/payCount")
|
||||
|
||||
@@ -55,6 +55,13 @@ public class TbOrderInfoQueryCriteria{
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String shopId;
|
||||
|
||||
private Integer pageSize;
|
||||
|
||||
private Integer page;
|
||||
|
||||
private String sort;
|
||||
|
||||
/** BETWEEN */
|
||||
@Query(type = Query.Type.BETWEEN)
|
||||
private List<Long> createdAt;
|
||||
|
||||
@@ -142,11 +142,11 @@ public class TbShopUser implements Serializable {
|
||||
|
||||
@Column(name = "`created_at`")
|
||||
@ApiModelProperty(value = "createdAt")
|
||||
private Date createdAt;
|
||||
private Long createdAt;
|
||||
|
||||
@Column(name = "`updated_at`")
|
||||
@ApiModelProperty(value = "updatedAt")
|
||||
private Date updatedAt;
|
||||
private Long updatedAt;
|
||||
|
||||
@Column(name = "`mini_open_id`")
|
||||
@ApiModelProperty(value = "小程序openId")
|
||||
|
||||
@@ -29,7 +29,9 @@ import cn.ysk.cashier.vo.TbOrderPayCountVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -54,7 +56,13 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
||||
private final TbOrderDetailRepository tbOrderDetailRepository;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(TbOrderInfoQueryCriteria criteria, Pageable pageable) {
|
||||
public Map<String, Object> queryAllPage(TbOrderInfoQueryCriteria criteria) {
|
||||
Pageable pageable = PageRequest.of(criteria.getPage(), criteria.getPageSize(), Sort.by(Sort.Direction.DESC, "createdAt"));
|
||||
if(criteria!=null){
|
||||
if (criteria.getOrderType().equals("0")) {
|
||||
criteria.setOrderType(null);
|
||||
}
|
||||
}
|
||||
Page<TbOrderInfo> page = tbOrderInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable);
|
||||
List<TbOrderInfoVo> orderInfoVoList = new ArrayList<>();
|
||||
for (TbOrderInfo tbOrderInfo : page.getContent()) {
|
||||
|
||||
@@ -37,10 +37,9 @@ public interface TbOrderInfoService {
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(TbOrderInfoQueryCriteria criteria, Pageable pageable);
|
||||
Map<String,Object> queryAllPage(TbOrderInfoQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据支付类型统计
|
||||
|
||||
@@ -11,6 +11,9 @@ spring:
|
||||
time-zone: GMT+8
|
||||
default-property-inclusion: always
|
||||
data:
|
||||
web:
|
||||
pageable:
|
||||
default-page-size: 10
|
||||
redis:
|
||||
repositories:
|
||||
enabled: false
|
||||
|
||||
Reference in New Issue
Block a user