bug
This commit is contained in:
@@ -127,6 +127,22 @@ public class BuyOrderController {
|
|||||||
return R.ok().put("page",userOrderList);
|
return R.ok().put("page",userOrderList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户订单各个状态的数量
|
||||||
|
* @param map
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getUserOrderStatusNum")
|
||||||
|
public R getUserOrderStatusNum(@RequestBody Map<String,Object> map){
|
||||||
|
Integer userId = Integer.valueOf(map.get("userId").toString());
|
||||||
|
List<BuyOrder> userOrderStatusNum = buyOrderService.getUserOrderStatusNum(userId);
|
||||||
|
Map<String, Integer> m = new HashMap<>();
|
||||||
|
for (BuyOrder b : userOrderStatusNum){
|
||||||
|
m.put(b.getOrderStatus().toString(),b.getStatusNum());
|
||||||
|
}
|
||||||
|
return R.ok().put("map",m);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单详情
|
* 订单详情
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.peanut.modules.book.controller;
|
package com.peanut.modules.book.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.peanut.common.utils.R;
|
import com.peanut.common.utils.R;
|
||||||
import com.peanut.modules.book.entity.PointCategoryEntity;
|
import com.peanut.modules.book.entity.PointCategoryEntity;
|
||||||
@@ -50,6 +51,12 @@ public class PointController {
|
|||||||
@RequestMapping("/delPointCategory")
|
@RequestMapping("/delPointCategory")
|
||||||
public R delPointCategory(@RequestBody Map<String,Object> map){
|
public R delPointCategory(@RequestBody Map<String,Object> map){
|
||||||
Integer id = Integer.valueOf(map.get("pointCategoryId").toString());
|
Integer id = Integer.valueOf(map.get("pointCategoryId").toString());
|
||||||
|
LambdaQueryWrapper<PointEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(PointEntity::getPointCategoryId,id);
|
||||||
|
List<PointEntity> list = pointService.list(wrapper);
|
||||||
|
if(list.size()>0){
|
||||||
|
return R.error("此分类下存在文章,请先清空文章后再尝试删除!");
|
||||||
|
}
|
||||||
pointCategoryService.removeById(id);
|
pointCategoryService.removeById(id);
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,6 @@ import java.util.List;
|
|||||||
public interface BuyOrderDao extends BaseMapper<BuyOrder> {
|
public interface BuyOrderDao extends BaseMapper<BuyOrder> {
|
||||||
List<BuyOrder> orderList(BuyOrderListRequestVo requestVo);
|
List<BuyOrder> orderList(BuyOrderListRequestVo requestVo);
|
||||||
|
|
||||||
// Page<BuyOrder> testPage(Page<BuyOrder> page);
|
List<BuyOrder> orderStatusNum(Integer userId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,4 +6,6 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface PointCategoryDao extends MPJBaseMapper<PointCategoryEntity> {
|
public interface PointCategoryDao extends MPJBaseMapper<PointCategoryEntity> {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ public class BuyOrder implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer statusNum;
|
||||||
/**
|
/**
|
||||||
* 收货人姓名
|
* 收货人姓名
|
||||||
*/
|
*/
|
||||||
@@ -178,5 +181,8 @@ public class BuyOrder implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private MyUserEntity user;
|
private MyUserEntity user;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<ExpressOrder> expressList;
|
||||||
|
|
||||||
private int addressModified;
|
private int addressModified;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,4 +43,7 @@ public class PointEntity implements Serializable {
|
|||||||
|
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryString;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ public interface BuyOrderService extends IService<BuyOrder> {
|
|||||||
|
|
||||||
Page<BuyOrder> getUserOrderList(UserOrderDto userOrderDto);
|
Page<BuyOrder> getUserOrderList(UserOrderDto userOrderDto);
|
||||||
|
|
||||||
|
List<BuyOrder> getUserOrderStatusNum(Integer userId);
|
||||||
|
|
||||||
BuyOrderResponseVo orderDetail(String orderSn);
|
BuyOrderResponseVo orderDetail(String orderSn);
|
||||||
|
|
||||||
Map<String, Object> decomposeShipment(BuyOrderListRequestVo requestVo);
|
Map<String, Object> decomposeShipment(BuyOrderListRequestVo requestVo);
|
||||||
|
|||||||
@@ -398,7 +398,12 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
b.setProductList(buyOrderProducts);
|
b.setProductList(buyOrderProducts);
|
||||||
b.setTimestamp(b.getCreateTime().getTime()/1000);
|
b.setTimestamp(b.getCreateTime().getTime()/1000);
|
||||||
//获取包裹信息
|
//获取包裹信息
|
||||||
// getOrderByOS()
|
List<Integer> collect = buyOrderProductService.list(new LambdaQueryWrapper<BuyOrderProduct>().eq(BuyOrderProduct::getOrderId, b.getOrderId()).gt(BuyOrderProduct::getExpressOrderId, 0))
|
||||||
|
.stream().map(BuyOrderProduct::getExpressOrderId).collect(Collectors.toList());
|
||||||
|
if(collect.size()>0){
|
||||||
|
List<ExpressOrder> expressOrders = expressOrderDao.selectList(new LambdaQueryWrapper<ExpressOrder>().in(ExpressOrder::getId, collect));
|
||||||
|
b.setExpressList(expressOrders);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return buyOrderPage;
|
return buyOrderPage;
|
||||||
@@ -522,6 +527,22 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
|
|||||||
return setBuyOrderInfo(buyOrder);
|
return setBuyOrderInfo(buyOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BuyOrder> getUserOrderStatusNum(Integer userId) {
|
||||||
|
List<BuyOrder> buyOrders = this.getBaseMapper().orderStatusNum(userId);
|
||||||
|
return buyOrders;
|
||||||
|
|
||||||
|
// LambdaQueryWrapper<BuyOrder> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
// List<Integer> status = new ArrayList<>();
|
||||||
|
// status.add(0);
|
||||||
|
// status.add(1);
|
||||||
|
// status.add(2);
|
||||||
|
// status.add(3);
|
||||||
|
// wrapper.s
|
||||||
|
// wrapper.in(BuyOrder::getOrderStatus,status);
|
||||||
|
// wrapper.groupBy(BuyOrder::getOrderStatus);
|
||||||
|
// List<BuyOrder> list = list(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组装快递鸟专用我方订单号,应对同一订单号,他们生成的快递订单号是一个
|
* 组装快递鸟专用我方订单号,应对同一订单号,他们生成的快递订单号是一个
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.peanut.modules.book.dao.PointCategoryDao;
|
import com.peanut.modules.book.dao.PointCategoryDao;
|
||||||
import com.peanut.modules.book.dao.PointDao;
|
import com.peanut.modules.book.dao.PointDao;
|
||||||
import com.peanut.modules.book.entity.PointCategoryEntity;
|
import com.peanut.modules.book.entity.PointCategoryEntity;
|
||||||
@@ -39,6 +40,10 @@ public class PointServiceImpl extends ServiceImpl<PointDao, PointEntity> impleme
|
|||||||
Page<PointEntity> pointEntityPage = getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
|
Page<PointEntity> pointEntityPage = getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
|
||||||
for (PointEntity p : pointEntityPage.getRecords()){
|
for (PointEntity p : pointEntityPage.getRecords()){
|
||||||
p.setImageList(JSON.parseArray(p.getImages(),String.class));
|
p.setImageList(JSON.parseArray(p.getImages(),String.class));
|
||||||
|
PointCategoryEntity c_category = pointCategoryDao.selectById(p.getPointCategoryId());
|
||||||
|
System.out.println(c_category);
|
||||||
|
PointCategoryEntity f_category = pointCategoryDao.selectById(c_category.getPid());
|
||||||
|
p.setCategoryString(f_category.getTitle()+" > "+c_category.getTitle());
|
||||||
}
|
}
|
||||||
return pointEntityPage;
|
return pointEntityPage;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,18 @@
|
|||||||
and del_flag = 0
|
and del_flag = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="orderStatusNum" resultType="com.peanut.modules.book.entity.BuyOrder">
|
||||||
|
select *,count(*) as statusNum
|
||||||
|
from buy_order
|
||||||
|
where
|
||||||
|
user_id = #{userId}
|
||||||
|
and del_flag = 0
|
||||||
|
and order_status in (0,1,2,3)
|
||||||
|
group by
|
||||||
|
order_status
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="orderList" resultType="com.peanut.modules.book.entity.BuyOrder"
|
<select id="orderList" resultType="com.peanut.modules.book.entity.BuyOrder"
|
||||||
parameterType="com.peanut.modules.book.vo.request.BuyOrderListRequestVo" resultMap="buyOrderMap">
|
parameterType="com.peanut.modules.book.vo.request.BuyOrderListRequestVo" resultMap="buyOrderMap">
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
Reference in New Issue
Block a user