分页查询排队列表
This commit is contained in:
parent
3257f125c7
commit
c658ec7993
@ -83,13 +83,13 @@ public class StorePink implements Serializable {
|
||||
@ApiModelProperty(value = "是否虚拟拼团")
|
||||
private Boolean is_virtual;
|
||||
|
||||
@ApiModelProperty(value = "队列类型: 1-会员队列, 2-会馆队列")
|
||||
@ApiModelProperty(value = "队列类型: 1-黔行, 2-茅香")
|
||||
private Integer queueType;
|
||||
|
||||
@ApiModelProperty(value = "当前队列的排队序号")
|
||||
private Integer queueNo;
|
||||
|
||||
@ApiModelProperty(value = "排队免单进度(1.00表示100%)")
|
||||
@ApiModelProperty(value = "拼团进度(1.00表示100%)")
|
||||
private BigDecimal queueProgress;
|
||||
|
||||
@ApiModelProperty(value = "排队码编号(年月日时分秒+六位随机数)")
|
||||
|
||||
@ -22,7 +22,7 @@ public class StorePinkSearchRequest implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@ApiModelProperty(value = "状态1进行中2已完成3未完成")
|
||||
@ApiModelProperty(value = "状态1排队中2已达成待领取3已领取")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "today,yesterday,lately7,lately30,month,year,/yyyy-MM-dd hh:mm:ss,yyyy-MM-dd hh:mm:ss/")
|
||||
@ -34,8 +34,9 @@ public class StorePinkSearchRequest implements Serializable {
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "队列类型: 1-会员队列, 2-会馆队列")
|
||||
@ApiModelProperty(value = "队列类型: 1-黔行, 2-茅香")
|
||||
private Integer queueType;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "是否已取消:0-未取消,1-已取消")
|
||||
private Integer isRefund;
|
||||
}
|
||||
|
||||
@ -23,16 +23,16 @@ public class StorePinkAdminListResponse {
|
||||
@ApiModelProperty(value = "拼团总人数")
|
||||
private Integer people;
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private String addTime;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
@ApiModelProperty(value = "领取时间")
|
||||
private String stopTime;
|
||||
|
||||
@ApiModelProperty(value = "团长id 0为团长")
|
||||
private Integer kId;
|
||||
|
||||
@ApiModelProperty(value = "状态1进行中2已完成3未完成")
|
||||
@ApiModelProperty(value = "状态1排队中2已达成待领取3已领取")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称")
|
||||
@ -59,9 +59,12 @@ public class StorePinkAdminListResponse {
|
||||
@ApiModelProperty(value = "当前队列的排队序号")
|
||||
private Integer queueNo;
|
||||
|
||||
@ApiModelProperty(value = "排队免单进度(1.00表示100%)")
|
||||
@ApiModelProperty(value = "拼团进度(1.00表示100%)")
|
||||
private BigDecimal queueProgress;
|
||||
|
||||
@ApiModelProperty(value = "排队码编号(年月日时分秒+六位随机数)")
|
||||
private String queueCode;
|
||||
|
||||
@ApiModelProperty(value = "是否已取消:0-未取消,1-已取消")
|
||||
private Integer isRefund;
|
||||
}
|
||||
|
||||
@ -98,6 +98,27 @@ public class StorePinkServiceImpl extends ServiceImpl<StorePinkMapper, StorePink
|
||||
@Override
|
||||
public PageInfo<StorePinkAdminListResponse> getList(StorePinkSearchRequest request, PageParamRequest pageParamRequest) {
|
||||
|
||||
if (ObjectUtil.isNotNull(request.getStatus())) {
|
||||
if (ObjectUtil.isNotNull(request.getIsRefund()) && request.getIsRefund().equals(1)) {
|
||||
throw new YztException("查询进行中/已完成等状态的拼团时,只能查询未取消的记录,isRefund 不能为 1");
|
||||
}
|
||||
}
|
||||
if (ObjectUtil.isNotNull(request.getIsRefund()) && request.getIsRefund().equals(1) && ObjectUtil.isNotNull(request.getStatus())) {
|
||||
throw new YztException("查询已取消拼团记录时,status 参数必须为空");
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotNull(request.getIsRefund())
|
||||
&& !request.getIsRefund().equals(0)
|
||||
&& !request.getIsRefund().equals(1)) {
|
||||
throw new YztException("isRefund 参数只能为 0(未取消)或 1(已取消)");
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNull(request.getQueueType())) {
|
||||
throw new YztException("队列类型不能为空");
|
||||
}
|
||||
if (!request.getQueueType().equals(1) && !request.getQueueType().equals(2)) {
|
||||
throw new YztException("队列类型参数错误");
|
||||
}
|
||||
// 1. 先根据 phone / name 查询符合条件的用户 IDs
|
||||
List<Integer> filteredUids = null;
|
||||
|
||||
@ -123,6 +144,14 @@ public class StorePinkServiceImpl extends ServiceImpl<StorePinkMapper, StorePink
|
||||
if (ObjectUtil.isNotNull(request.getStatus())) {
|
||||
lqw.eq(StorePink::getStatus, request.getStatus());
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotNull(request.getIsRefund())) {
|
||||
if (request.getIsRefund().equals(0)) {
|
||||
lqw.eq(StorePink::getIsRefund, false);
|
||||
} else if (request.getIsRefund().equals(1)) {
|
||||
lqw.eq(StorePink::getIsRefund, true);
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotBlank(request.getDateLimit())) {
|
||||
DateLimitUtilVo dateLimit = YztDateUtil.getDateLimit(request.getDateLimit());
|
||||
lqw.between(StorePink::getAddTime, YztDateUtil.dateStr2Timestamp(dateLimit.getStartTime(), Constants.DATE_TIME_TYPE_BEGIN), YztDateUtil.dateStr2Timestamp(dateLimit.getEndTime(), Constants.DATE_TIME_TYPE_END));
|
||||
@ -150,6 +179,11 @@ public class StorePinkServiceImpl extends ServiceImpl<StorePinkMapper, StorePink
|
||||
List<StorePinkAdminListResponse> list = storePinks.stream().map(pink -> {
|
||||
StorePinkAdminListResponse storePinkResponse = new StorePinkAdminListResponse();
|
||||
BeanUtils.copyProperties(pink, storePinkResponse);
|
||||
if (pink.getIsRefund() == null || !pink.getIsRefund()) {
|
||||
storePinkResponse.setIsRefund(0);
|
||||
} else {
|
||||
storePinkResponse.setIsRefund(1);
|
||||
}
|
||||
Integer countPeople = getCountByKidAndCid(pink.getCid(), pink.getId());
|
||||
storePinkResponse.setCountPeople(countPeople);
|
||||
storePinkResponse.setAddTime(YztDateUtil.timestamp2DateStr(pink.getAddTime()*1000L, Constants.DATE_FORMAT));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user