bug
This commit is contained in:
@@ -127,6 +127,22 @@ public class BuyOrderController {
|
||||
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;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.PointCategoryEntity;
|
||||
@@ -50,6 +51,12 @@ public class PointController {
|
||||
@RequestMapping("/delPointCategory")
|
||||
public R delPointCategory(@RequestBody Map<String,Object> map){
|
||||
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);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user