修复订单多选查询
This commit is contained in:
@@ -270,7 +270,7 @@ dubbo:
|
|||||||
bxg:
|
bxg:
|
||||||
shop:
|
shop:
|
||||||
# API_URL: http://192.168.10.113:48080/bxgApp
|
# API_URL: http://192.168.10.113:48080/bxgApp
|
||||||
API_URL: http://6fa9fbb0.cpolar.top
|
API_URL: http://675b568e.r6.cpolar.top
|
||||||
SITE_URL: http://192.168.10.113:48080/bxgApp
|
SITE_URL: http://192.168.10.113:48080/bxgApp
|
||||||
UNI_SITE_URL: http://192.168.10.113:48080/bxgApp
|
UNI_SITE_URL: http://192.168.10.113:48080/bxgApp
|
||||||
ADMIN_API_URL: http://192.168.10.113:48080/bxg
|
ADMIN_API_URL: http://192.168.10.113:48080/bxg
|
||||||
|
|||||||
+8
@@ -37,6 +37,7 @@ import co.yixiang.modules.activity.service.mapper.YxStoreVisitMapper;
|
|||||||
import co.yixiang.modules.activity.vo.CombinationQueryVo;
|
import co.yixiang.modules.activity.vo.CombinationQueryVo;
|
||||||
import co.yixiang.modules.activity.vo.StoreCombinationVo;
|
import co.yixiang.modules.activity.vo.StoreCombinationVo;
|
||||||
import co.yixiang.modules.activity.vo.YxStoreCombinationQueryVo;
|
import co.yixiang.modules.activity.vo.YxStoreCombinationQueryVo;
|
||||||
|
import co.yixiang.modules.product.domain.YxStoreProduct;
|
||||||
import co.yixiang.modules.product.domain.YxStoreProductAttrValue;
|
import co.yixiang.modules.product.domain.YxStoreProductAttrValue;
|
||||||
import co.yixiang.modules.product.service.YxStoreProductAttrService;
|
import co.yixiang.modules.product.service.YxStoreProductAttrService;
|
||||||
import co.yixiang.modules.product.service.YxStoreProductAttrValueService;
|
import co.yixiang.modules.product.service.YxStoreProductAttrValueService;
|
||||||
@@ -83,6 +84,8 @@ public class YxStoreCombinationServiceImpl extends BaseServiceImpl<YxStoreCombin
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IGenerator generator;
|
private IGenerator generator;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private YxStoreProductService yxStoreProductService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private YxStorePinkMapper yxStorePinkMapper;
|
private YxStorePinkMapper yxStorePinkMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -239,6 +242,11 @@ public class YxStoreCombinationServiceImpl extends BaseServiceImpl<YxStoreCombin
|
|||||||
|
|
||||||
List<YxStoreCombinationDto> combinationDTOS = generator.convert(page.getList(),YxStoreCombinationDto.class);
|
List<YxStoreCombinationDto> combinationDTOS = generator.convert(page.getList(),YxStoreCombinationDto.class);
|
||||||
for (YxStoreCombinationDto combinationDTO : combinationDTOS) {
|
for (YxStoreCombinationDto combinationDTO : combinationDTOS) {
|
||||||
|
//这里把商品的售价放入到拼团的原价中,方便后台列表查看
|
||||||
|
YxStoreProduct yxStoreProduct=yxStoreProductService.getById(combinationDTO.getProductId());
|
||||||
|
if (ObjectUtil.isNotEmpty(yxStoreProduct)){
|
||||||
|
combinationDTO.setProductPrice(yxStoreProduct.getPrice());
|
||||||
|
};
|
||||||
//参与人数
|
//参与人数
|
||||||
combinationDTO.setCountPeopleAll(yxStorePinkMapper.selectCount(new LambdaQueryWrapper<YxStorePink>()
|
combinationDTO.setCountPeopleAll(yxStorePinkMapper.selectCount(new LambdaQueryWrapper<YxStorePink>()
|
||||||
.eq(YxStorePink::getCid,combinationDTO.getId())));
|
.eq(YxStorePink::getCid,combinationDTO.getId())));
|
||||||
|
|||||||
+10
@@ -31,9 +31,11 @@ import co.yixiang.modules.activity.service.mapper.YxStoreSeckillMapper;
|
|||||||
import co.yixiang.modules.activity.vo.SeckillConfigVo;
|
import co.yixiang.modules.activity.vo.SeckillConfigVo;
|
||||||
import co.yixiang.modules.activity.vo.StoreSeckillVo;
|
import co.yixiang.modules.activity.vo.StoreSeckillVo;
|
||||||
import co.yixiang.modules.activity.vo.YxStoreSeckillQueryVo;
|
import co.yixiang.modules.activity.vo.YxStoreSeckillQueryVo;
|
||||||
|
import co.yixiang.modules.product.domain.YxStoreProduct;
|
||||||
import co.yixiang.modules.product.domain.YxStoreProductAttrValue;
|
import co.yixiang.modules.product.domain.YxStoreProductAttrValue;
|
||||||
import co.yixiang.modules.product.service.YxStoreProductAttrService;
|
import co.yixiang.modules.product.service.YxStoreProductAttrService;
|
||||||
import co.yixiang.modules.product.service.YxStoreProductReplyService;
|
import co.yixiang.modules.product.service.YxStoreProductReplyService;
|
||||||
|
import co.yixiang.modules.product.service.YxStoreProductService;
|
||||||
import co.yixiang.modules.product.service.dto.FromatDetailDto;
|
import co.yixiang.modules.product.service.dto.FromatDetailDto;
|
||||||
import co.yixiang.modules.product.service.dto.ProductFormatDto;
|
import co.yixiang.modules.product.service.dto.ProductFormatDto;
|
||||||
import co.yixiang.modules.product.service.dto.ProductResultDto;
|
import co.yixiang.modules.product.service.dto.ProductResultDto;
|
||||||
@@ -103,6 +105,9 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private YxStoreSeckillService yxStoreSeckillService;
|
private YxStoreSeckillService yxStoreSeckillService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private YxStoreProductService yxStoreProductService;
|
||||||
@Override
|
@Override
|
||||||
public SeckillConfigVo getStoreSeckil() {
|
public SeckillConfigVo getStoreSeckil() {
|
||||||
//获取秒杀配置
|
//获取秒杀配置
|
||||||
@@ -417,6 +422,11 @@ public class YxStoreSeckillServiceImpl extends BaseServiceImpl<YxStoreSeckillMap
|
|||||||
PageInfo<YxStoreSeckill> page = new PageInfo<>(queryAll(criteria));
|
PageInfo<YxStoreSeckill> page = new PageInfo<>(queryAll(criteria));
|
||||||
List<YxStoreSeckillDto> storeSeckillDTOS = generator.convert(page.getList(),YxStoreSeckillDto.class);
|
List<YxStoreSeckillDto> storeSeckillDTOS = generator.convert(page.getList(),YxStoreSeckillDto.class);
|
||||||
for (YxStoreSeckillDto storeSeckillDTO : storeSeckillDTOS){
|
for (YxStoreSeckillDto storeSeckillDTO : storeSeckillDTOS){
|
||||||
|
//这里把商品的售价放入到秒杀的原价中,方便后台列表
|
||||||
|
YxStoreProduct yxStoreProduct=yxStoreProductService.getById(storeSeckillDTO.getProductId());
|
||||||
|
if (ObjectUtil.isNotEmpty(yxStoreProduct)){
|
||||||
|
storeSeckillDTO.setOtPrice(yxStoreProduct.getPrice());
|
||||||
|
}
|
||||||
String statusStr = OrderUtil.checkActivityStatus(storeSeckillDTO.getStartTime(),
|
String statusStr = OrderUtil.checkActivityStatus(storeSeckillDTO.getStartTime(),
|
||||||
storeSeckillDTO.getStopTime(), storeSeckillDTO.getStatus());
|
storeSeckillDTO.getStopTime(), storeSeckillDTO.getStatus());
|
||||||
storeSeckillDTO.setStatusStr(statusStr);
|
storeSeckillDTO.setStatusStr(statusStr);
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public class StoreOrderController {
|
|||||||
Map<String,Object> map;
|
Map<String,Object> map;
|
||||||
String[] orderTypeList=orderType.split(",");
|
String[] orderTypeList=orderType.split(",");
|
||||||
if(orderTypeList.length>1){//多选方法
|
if(orderTypeList.length>1){//多选方法
|
||||||
map=yxStoreOrderService.queryManyType(orderTypeList, pageable,criteria);
|
map=yxStoreOrderService.queryManyType(orderTypeList, pageable,criteria,orderStatus);
|
||||||
}else {
|
}else {
|
||||||
YxStoreOrderQueryCriteria newCriteria = this.handleQuery(criteria,orderStatus,orderType);
|
YxStoreOrderQueryCriteria newCriteria = this.handleQuery(criteria,orderStatus,orderType);
|
||||||
map=yxStoreOrderService.queryAll(newCriteria, pageable);
|
map=yxStoreOrderService.queryAll(newCriteria, pageable);
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ public interface YxStoreOrderService extends BaseService<YxStoreOrder>{
|
|||||||
* @param pageable 分页参数
|
* @param pageable 分页参数
|
||||||
* @return Map<String,Object>
|
* @return Map<String,Object>
|
||||||
*/
|
*/
|
||||||
Map<String,Object> queryManyType(String[] typeList, Pageable pageable,YxStoreOrderQueryCriteria criteria);
|
Map<String,Object> queryManyType(String[] typeList, Pageable pageable,YxStoreOrderQueryCriteria criteria,String orderStatus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询数据分页
|
* 查询数据分页
|
||||||
|
|||||||
+96
-33
@@ -110,6 +110,7 @@ import java.math.BigDecimal;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.function.Consumer;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@@ -2409,78 +2410,140 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<StoreOrderMapper, Y
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryManyType(String[] typeList, Pageable pageable,YxStoreOrderQueryCriteria criteria) {
|
public Map<String, Object> queryManyType(String[] typeList, Pageable pageable,YxStoreOrderQueryCriteria criteria,String orderStatus) {
|
||||||
LambdaQueryWrapper<YxStoreOrder> queryWrapper =new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<YxStoreOrder> queryWrapper =new LambdaQueryWrapper<>();
|
||||||
if(StringUtils.isNotBlank(criteria.getOrderId())){
|
if(StringUtils.isNotBlank(criteria.getOrderId())){
|
||||||
queryWrapper.and(wrapper->{
|
queryWrapper.like(YxStoreOrder::getOrderId,criteria.getOrderId());
|
||||||
wrapper.like(YxStoreOrder::getOrderId,criteria.getOrderId());
|
|
||||||
});
|
|
||||||
// queryWrapper.like(YxStoreOrder::getOrderId,criteria.getOrderId());
|
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(criteria.getUserPhone())){
|
if(StringUtils.isNotBlank(criteria.getUserPhone())){
|
||||||
queryWrapper.and(wrapper->{
|
queryWrapper.like(YxStoreOrder::getUserPhone,criteria.getUserPhone());
|
||||||
wrapper.like(YxStoreOrder::getUserPhone,criteria.getUserPhone());
|
|
||||||
});
|
|
||||||
// queryWrapper.like(YxStoreOrder::getUserPhone,criteria.getUserPhone());
|
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(criteria.getUserAddress())){
|
if(StringUtils.isNotBlank(criteria.getUserAddress())){
|
||||||
queryWrapper.like(YxStoreOrder::getUserAddress,criteria.getUserAddress());
|
queryWrapper.like(YxStoreOrder::getUserAddress,criteria.getUserAddress()); //地址模糊查询
|
||||||
}
|
}
|
||||||
for (String orderType:typeList){
|
if (StrUtil.isNotEmpty(orderStatus)){ //选择了订单状态
|
||||||
|
switch (orderStatus) {
|
||||||
|
case "0": //未支付
|
||||||
|
queryWrapper.and((wrapper)->{
|
||||||
|
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_0.getValue())
|
||||||
|
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue())
|
||||||
|
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "1": //未发货(待审核)
|
||||||
|
queryWrapper.and((wrapper)->{
|
||||||
|
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
|
||||||
|
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_0.getValue())
|
||||||
|
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "5": //拣货中(通过审核,原未发货)
|
||||||
|
queryWrapper.and((wrapper)->{
|
||||||
|
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
|
||||||
|
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_5.getValue())
|
||||||
|
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "2": //待收货
|
||||||
|
queryWrapper.and((wrapper)->{
|
||||||
|
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
|
||||||
|
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_1.getValue())
|
||||||
|
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
queryWrapper.and((wrapper)->{
|
||||||
|
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
|
||||||
|
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_2.getValue())
|
||||||
|
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "4":
|
||||||
|
queryWrapper.and((wrapper)->{
|
||||||
|
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
|
||||||
|
.eq(YxStoreOrder::getStatus,OrderInfoEnum.STATUS_3.getValue())
|
||||||
|
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "-1":
|
||||||
|
queryWrapper.and((wrapper)->{
|
||||||
|
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
|
||||||
|
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_1.getValue());
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "-2":
|
||||||
|
queryWrapper.and((wrapper)->{
|
||||||
|
wrapper.eq(YxStoreOrder::getPaid,OrderInfoEnum.PAY_STATUS_1.getValue())
|
||||||
|
.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_2.getValue());
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case "-9":
|
||||||
|
queryWrapper.and((wrapper)->{
|
||||||
|
wrapper.eq(YxStoreOrder::getRefundStatus,OrderInfoEnum.REFUND_STATUS_0.getValue());
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//时间
|
||||||
|
if (ObjectUtil.isNotEmpty(criteria.getCreateTime())){
|
||||||
|
queryWrapper.between(YxStoreOrder::getCreateTime,criteria.getCreateTime().get(0),criteria.getCreateTime().get(1));
|
||||||
|
}
|
||||||
|
queryWrapper.and(wrapper->{
|
||||||
|
for (String orderType:typeList){ //筛选了订单类型
|
||||||
switch (orderType) {
|
switch (orderType) {
|
||||||
case "1": //普通
|
case "1": //普通
|
||||||
// criteria.setBargainId(0);
|
wrapper.or((wrapper1)->{
|
||||||
// criteria.setCombinationId(0);
|
wrapper1.eq(YxStoreOrder::getBargainId,0)
|
||||||
// criteria.setSeckillId(0);
|
|
||||||
queryWrapper .or((wrapper)->{
|
|
||||||
wrapper.eq(YxStoreOrder::getBargainId,0)
|
|
||||||
.eq(YxStoreOrder::getCombinationId,0)
|
.eq(YxStoreOrder::getCombinationId,0)
|
||||||
.eq(YxStoreOrder::getSeckillId,0);
|
.eq(YxStoreOrder::getSeckillId,0);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "2": //拼团
|
case "2": //拼团
|
||||||
// criteria.setNewCombinationId(0);
|
// criteria.setNewCombinationId(0);
|
||||||
queryWrapper.or((wrapper)->{
|
wrapper.or((wrapper1)->{
|
||||||
wrapper.ne(YxStoreOrder::getCombinationId,0);
|
wrapper1.ne(YxStoreOrder::getCombinationId,0);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "3": //秒杀
|
case "3": //秒杀
|
||||||
// criteria.setNewSeckillId(0);
|
// criteria.setNewSeckillId(0);
|
||||||
queryWrapper.or((wrapper)->{
|
wrapper.or((wrapper1)->{
|
||||||
wrapper.ne(YxStoreOrder::getSeckillId,0);
|
wrapper1.ne(YxStoreOrder::getSeckillId,0);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "4": //砍价
|
case "4": //砍价
|
||||||
// criteria.setNewBargainId(0);
|
// criteria.setNewBargainId(0);
|
||||||
queryWrapper.or((wrapper)->{
|
wrapper.or((wrapper1)->{
|
||||||
wrapper.ne(YxStoreOrder::getBargainId,0);
|
wrapper1.ne(YxStoreOrder::getBargainId,0);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "5": //核销
|
case "5": //核销
|
||||||
// criteria.setShippingType(2);
|
// criteria.setShippingType(2);
|
||||||
queryWrapper.or((wrapper)->{
|
wrapper.or((wrapper1)->{
|
||||||
wrapper.ne(YxStoreOrder::getShippingType,2);
|
wrapper1.ne(YxStoreOrder::getShippingType,2);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "6": //积分
|
case "6": //积分
|
||||||
// criteria.setPayIntegral(new BigDecimal("0.00"));
|
// criteria.setPayIntegral(new BigDecimal("0.00"));
|
||||||
queryWrapper.or((wrapper)->{
|
wrapper.or((wrapper1)->{
|
||||||
wrapper.gt(YxStoreOrder::getPayIntegral,new BigDecimal("0.00"));
|
wrapper1.gt(YxStoreOrder::getPayIntegral,new BigDecimal("0.00"));
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
getPage(pageable);
|
getPage(pageable);
|
||||||
PageInfo<YxStoreOrder> page = new PageInfo<>(storeOrderMapper.selectList(queryWrapper));
|
PageInfo<YxStoreOrder> page = new PageInfo<>(storeOrderMapper.selectList(queryWrapper));
|
||||||
List<YxStoreOrderDto> storeOrderDTOS = new ArrayList<>();
|
// List<YxStoreOrderDto> storeOrderDTOS = new ArrayList<>();
|
||||||
for (YxStoreOrder yxStoreOrder : page.getList()) {
|
// for (YxStoreOrder yxStoreOrder : page.getList()) {
|
||||||
this.orderList(storeOrderDTOS, yxStoreOrder);
|
// this.orderList(storeOrderDTOS, yxStoreOrder);
|
||||||
}
|
// }
|
||||||
// List<YxStoreOrderDto> list=this.newAssemble(page.getList());
|
List<YxStoreOrderDto> list=this.newAssemble(page.getList());
|
||||||
Map<String, Object> map = new LinkedHashMap<>(2);
|
Map<String, Object> map = new LinkedHashMap<>(2);
|
||||||
map.put("content", storeOrderDTOS);
|
// map.put("content", storeOrderDTOS);
|
||||||
// map.put("content", list);
|
map.put("content", list);
|
||||||
map.put("totalElements", page.getTotal());
|
map.put("totalElements", page.getTotal());
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user