浏览代码

后台接口

chunping 3 年之前
父节点
当前提交
fbce82da8f

+ 31 - 18
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/ChannelMgrController.java

@@ -11,9 +11,11 @@ import com.qs.mp.channel.domain.vo.ChannelVO;
 import com.qs.mp.channel.service.IChannelOrderService;
 import com.qs.mp.channel.service.IChannelService;
 import com.qs.mp.channel.service.IChannelUserRelService;
+import com.qs.mp.common.annotation.Log;
 import com.qs.mp.common.constant.UserConstants;
 import com.qs.mp.common.core.domain.AjaxResult;
 import com.qs.mp.common.core.page.TableDataInfo;
+import com.qs.mp.common.enums.BusinessType;
 import com.qs.mp.common.enums.ChannelRoleEnum;
 import com.qs.mp.common.enums.ErrorCodeEnum;
 import com.qs.mp.system.domain.SysUser;
@@ -31,6 +33,7 @@ import java.util.Map;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Component;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -51,16 +54,16 @@ public class ChannelMgrController extends BaseApiController {
 
 	@Autowired
 	private IChannelService channelService;
-	
+
 	@Autowired
 	private IChannelUserRelService channelUserRelService;
-	
+
 	@Autowired
 	private IChannelOrderService channelOrderService;
-	
+
 	@Autowired
 	private ISysUserService userService;
-	
+
 	@Autowired
 	private MapperFacade mapperFacade;
 
@@ -70,6 +73,7 @@ public class ChannelMgrController extends BaseApiController {
 	 * @return
 	 */
 	@PostMapping("/tree")
+	@PreAuthorize("@ss.hasPermi('business:channel:list')")
 	public AjaxResult treeChannel(@RequestBody Channel channel) {
 		List<ChannelVO> list = new ArrayList<ChannelVO>();
 		QueryWrapper<Channel> queryWrapper = new QueryWrapper<>();
@@ -97,14 +101,15 @@ public class ChannelMgrController extends BaseApiController {
 		}
 		return AjaxResult.success(list);
 	}
-	
-	
+
+
 	/**
 	 * 查询所有渠道列表
 	 *
 	 * @return
 	 */
 	@PostMapping("/listAll")
+	@PreAuthorize("@ss.hasPermi('business:channel:list')")
 	public AjaxResult listAllChannel() {
 		List<Channel> list = new ArrayList<Channel>();
 		LambdaQueryWrapper<Channel> queryWrapper = new LambdaQueryWrapper<Channel>();
@@ -113,14 +118,15 @@ public class ChannelMgrController extends BaseApiController {
 		list = channelService.list(queryWrapper);
 		return AjaxResult.success(list);
 	}
-	
-	
+
+
 	/**
 	 * 获取我的下级渠道列表信息,支持翻页
 	 *
 	 * @return
 	 */
 	@PostMapping("/list")
+	@PreAuthorize("@ss.hasPermi('business:channel:list')")
 	public TableDataInfo listChannel(@RequestBody Channel channel) {
 		List<ChannelVO> list = new ArrayList<ChannelVO>();
 		startPage();
@@ -151,15 +157,17 @@ public class ChannelMgrController extends BaseApiController {
 		}
 		return getDataTable(list);
 	}
-	
-	
+
+
 	/**
 	 * 渠道管理新增一级渠道信息
 	 * @param
 	 * @return
 	 */
+	@Log(title = "新增渠道", businessType = BusinessType.INSERT)
 	@ApiOperation(value = "新增子渠道信息", notes = "渠道端新增子渠道")
 	@PostMapping("/create")
+	@PreAuthorize("@ss.hasPermi('business:channel:add')")
 	public AjaxResult channelCreate(@Validated @RequestBody ChannelParam channelParam) {
 		if (channelParam.getChannelId() != null && channelParam.getChannelId() != 0) {
 			return AjaxResult.error("该渠道已存在");
@@ -182,7 +190,7 @@ public class ChannelMgrController extends BaseApiController {
 //		if(null != channel.getParentId() && channel.getParentId() != 0) {
 //			Channel parentChannel = channelService.getById(channel.getParentId());
 //			if(null != parentChannel) {
-//				 if(null != parentChannel.getCommRate() 
+//				 if(null != parentChannel.getCommRate()
 //						 && channel.getCommRate().compareTo(parentChannel.getCommRate()) > 0) {
 //					 return AjaxResult.error("佣金比例不能高于父渠道的佣金比例");
 //				 }
@@ -204,7 +212,7 @@ public class ChannelMgrController extends BaseApiController {
 		} catch (Exception e) {
 			return AjaxResult.error("渠道'" + channel.getName() + "'新增失败" + e.getMessage());
 		}
-		
+
 		return AjaxResult.success("渠道'" + channel.getName() + "'新增成功");
 	}
 
@@ -213,8 +221,10 @@ public class ChannelMgrController extends BaseApiController {
 	 * @param
 	 * @return
 	 */
+	@Log(title = "修改渠道", businessType = BusinessType.UPDATE)
 	@ApiOperation(value = "编辑子渠道信息", notes = "渠道端编辑子渠道")
 	@PostMapping("/update")
+	@PreAuthorize("@ss.hasPermi('business:channel:edit')")
 	public AjaxResult channelUpdate(@Validated @RequestBody ChannelParam channelParam) {
 		if (null == channelParam || null == channelParam.getChannelId()) {
 			return error(ErrorCodeEnum.ERROR_CODE_1001);
@@ -250,7 +260,7 @@ public class ChannelMgrController extends BaseApiController {
 		// 3.校验佣金比例,不能高于其父渠道的佣金比例,不能低于其子渠道的最大佣金比例
 //		Channel parentChannel = channelService.getById(oldChannel.getParentId());
 //		if(null != parentChannel) {
-//			 if(null != parentChannel.getCommRate() 
+//			 if(null != parentChannel.getCommRate()
 //					 && channel.getCommRate().compareTo(parentChannel.getCommRate()) > 0) {
 //				 return AjaxResult.error("佣金比例不能高于父渠道的佣金比例");
 //			 }
@@ -277,15 +287,17 @@ public class ChannelMgrController extends BaseApiController {
 		}
 		return AjaxResult.success("渠道'" + channel.getName() + "'编辑成功");
 	}
-	
-	
+
+
 	/**
 	 * 停用、启用渠道
 	 * @param
 	 * @return
 	 */
+	@Log(title = "启停渠道", businessType = BusinessType.UPDATE)
 	@ApiOperation(value = "停用、启用渠道信息", notes = "渠道管理编辑子渠道")
 	@PostMapping("/status")
+	@PreAuthorize("@ss.hasPermi('business:channel:edit')")
 	public AjaxResult channelStatus(@RequestBody JSONObject jsonObject) {
 		String channelId = jsonObject.containsKey("channelId")?jsonObject.get("channelId").toString():"";
 		String status = jsonObject.containsKey("status")?jsonObject.get("status").toString():"";
@@ -300,8 +312,8 @@ public class ChannelMgrController extends BaseApiController {
 		}
 		return AjaxResult.success("操作成功");
 	}
-	
-	
+
+
 	/**
 	 * 查询渠道详情
 	 * @param
@@ -309,6 +321,7 @@ public class ChannelMgrController extends BaseApiController {
 	 */
 	@ApiOperation(value = "查询渠道详情信息", notes = "渠道管理编辑子渠道查询渠道详情")
 	@PostMapping("/detail")
+	@PreAuthorize("@ss.hasPermi('business:channel:query')")
 	public AjaxResult getChannelDetail(@RequestBody JSONObject jsonObject) {
 		String channelId = (null != jsonObject && jsonObject.containsKey("channelId"))?jsonObject.getString("channelId"):"";
 		if (StringUtils.isBlank(channelId)) {
@@ -333,5 +346,5 @@ public class ChannelMgrController extends BaseApiController {
 	    channelVO.setOperData(channelOperDataVO);
 		return AjaxResult.success(channelVO);
 	}
-	
+
 }

+ 9 - 5
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/ChannelOrderMgrController.java

@@ -28,6 +28,7 @@ import ma.glasnost.orika.MapperFacade;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -35,7 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 
 @RestController
-@RequestMapping("/api/v1/admin/channel/order")
+@RequestMapping("/api/v1/mp/admin/channel/order")
 @Api(tags = "渠道订单管理接口")
 @AllArgsConstructor
 public class ChannelOrderMgrController extends BaseApiController {
@@ -45,7 +46,7 @@ public class ChannelOrderMgrController extends BaseApiController {
 
   @Autowired
   private IChannelOrderItemService channelOrderItemService;
-  
+
   @Autowired
   private IChannelOrderDetailService channelOrderDetailService;
 
@@ -60,6 +61,7 @@ public class ChannelOrderMgrController extends BaseApiController {
    */
   @PostMapping("/list")
   @ApiOperation(value = "订单列表" , notes = "获取所有订单信息")
+  @PreAuthorize("@ss.hasPermi('order:channel:list')")
   public TableDataInfo list(@RequestBody JSONObject param) {
    // Long channelId = SecurityUtils.getLoginUser().getChannelId();
     Integer status = param.getInteger("status");
@@ -84,13 +86,14 @@ public class ChannelOrderMgrController extends BaseApiController {
    */
   @PostMapping("/detail")
   @ApiOperation(value = "订单详情" , notes = "在订单列表页面查看详情")
+  @PreAuthorize("@ss.hasPermi('order:channel:query')")
   public AjaxResult query(@RequestBody ChannelOrder order) {
     if(null == order || StringUtils.isBlank(order.getOrderId())) {
     	return error(ErrorCodeEnum.ERROR_CODE_1001);
-    }    
+    }
     LambdaQueryWrapper<ChannelOrder> queryWrapper = new LambdaQueryWrapper<ChannelOrder>();
     queryWrapper.eq(ChannelOrder::getOrderId, order.getOrderId());
-    
+
     ChannelOrder channelOrder = channelOrderService.getOne(queryWrapper);
     ChannelOrderVO channelOrderVO = mapperFacade.map(channelOrder, ChannelOrderVO.class);
     channelOrderVO.setItems(channelOrderItemService.list(new LambdaQueryWrapper<ChannelOrderItem>()
@@ -98,13 +101,14 @@ public class ChannelOrderMgrController extends BaseApiController {
     return AjaxResult.success(channelOrderVO);
   }
 
-  
+
 
   /**
    * 订单发货
    */
   @PostMapping("/ship")
   @ApiOperation(value = "订单发货" , notes = "在订单发货页面提交")
+  @PreAuthorize("@ss.hasPermi('order:channel:ship')")
   public AjaxResult ship(@RequestBody ChannelOrderShipParam shipParam) {
 		if(null == shipParam || StringUtils.isBlank(shipParam.getOrderId())) {
 			return error(ErrorCodeEnum.ERROR_CODE_1001);

+ 1 - 1
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/ChannelWithdrawMgrController.java

@@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 
 @RestController
-@RequestMapping("/api/v1/admin/channel/withdraw")
+@RequestMapping("/api/v1/mp/admin/channel/withdraw")
 @Api(tags = "渠道提现申请管理接口")
 @AllArgsConstructor
 public class ChannelWithdrawMgrController extends BaseApiController {

+ 17 - 4
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/CouponMgrController.java

@@ -20,9 +20,11 @@ import com.qs.mp.admin.service.ICouponTicketService;
 import com.qs.mp.admin.service.ITicketBoxService;
 import com.qs.mp.channel.domain.Channel;
 import com.qs.mp.channel.service.IChannelService;
+import com.qs.mp.common.annotation.Log;
 import com.qs.mp.common.constant.UserConstants;
 import com.qs.mp.common.core.domain.AjaxResult;
 import com.qs.mp.common.core.page.TableDataInfo;
+import com.qs.mp.common.enums.BusinessType;
 import com.qs.mp.common.enums.CouponStatusEnum;
 import com.qs.mp.common.enums.CouponUseAreaEnum;
 import com.qs.mp.common.enums.ErrorCodeEnum;
@@ -44,6 +46,7 @@ import java.util.stream.Collectors;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Component;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -89,6 +92,7 @@ public class CouponMgrController extends BaseApiController {
 	 * @return
 	 */
 	@PostMapping("/list")
+	@PreAuthorize("@ss.hasPermi('business:coupon:list')")
 	public TableDataInfo listCoupon(@RequestBody Coupon coupon) {
 		List<Coupon> list = new ArrayList<Coupon>();
 		startPage();
@@ -111,6 +115,7 @@ public class CouponMgrController extends BaseApiController {
 	 * @return
 	 */
 	@PostMapping(value = "/detail")
+	@PreAuthorize("@ss.hasPermi('business:coupon:query')")
 	public AjaxResult getCouponDetail(@RequestBody JSONObject jsonObject) {
 		String couponId = jsonObject.getString("couponId");
 		if (StringUtils.isBlank(couponId)){
@@ -160,12 +165,14 @@ public class CouponMgrController extends BaseApiController {
 	}
 
 	/**
-	 * 新增代金券信息
+	 * 新增优惠券信息
 	 * @param
 	 * @return
 	 */
-	@ApiOperation(value = "新增代金券信息", notes = "代金券端新增代金券")
+	@Log(title = "新增优惠券", businessType = BusinessType.INSERT)
+	@ApiOperation(value = "新增优惠券信息", notes = "新增优惠券")
 	@PostMapping("/create")
+	@PreAuthorize("@ss.hasPermi('business:coupon:add')")
 	public AjaxResult couponCreate(@Validated @RequestBody CouponParam couponParam) {
 		if (StringUtils.isNotBlank(couponParam.getCouponId())) {
 			return AjaxResult.error("该代金券已存在");
@@ -212,8 +219,10 @@ public class CouponMgrController extends BaseApiController {
 	 * @param
 	 * @return
 	 */
+	@Log(title = "修改优惠券", businessType = BusinessType.UPDATE)
 	@ApiOperation(value = "编辑代金券信息", notes = "代金券端编辑代金券")
 	@PostMapping("/update")
+	@PreAuthorize("@ss.hasPermi('business:coupon:edit')")
 	public AjaxResult couponUpdate(@Validated @RequestBody CouponParam couponParam) {
 		if (null == couponParam || StringUtils.isBlank(couponParam.getCouponId())) {
 			return error(ErrorCodeEnum.ERROR_CODE_1001);
@@ -255,11 +264,13 @@ public class CouponMgrController extends BaseApiController {
 
 
 	/**
-	 * 停用、启用代金
+	 * 上下架优惠
 	 * @param
 	 * @return
 	 */
-	@ApiOperation(value = "停用、启用代金券信息", notes = "代金券管理编辑代金券")
+	@Log(title = "上下架优惠券", businessType = BusinessType.UPDATE)
+	@PreAuthorize("@ss.hasPermi('business:coupon:on')")
+	@ApiOperation(value = "上下架优惠券信息", notes = "优惠券管理编辑代金券")
 	@PostMapping("/status")
 	public AjaxResult couponStatus(@RequestBody JSONObject jsonObject) {
 		String couponId = jsonObject.getString("couponId");
@@ -283,7 +294,9 @@ public class CouponMgrController extends BaseApiController {
 	 * @param
 	 * @return
 	 */
+	@Log(title = "删除优惠券", businessType = BusinessType.DELETE)
 	@PostMapping(value = "/remove")
+	@PreAuthorize("@ss.hasPermi('business:coupon:remove')")
 	public AjaxResult removeCoupon(@RequestBody JSONObject jsonObject) {
 		String couponId = jsonObject.getString("couponId");
 	    if (StringUtils.isBlank(couponId)){

+ 15 - 2
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/GoodsMgrController.java

@@ -11,8 +11,10 @@ import com.qs.mp.admin.domain.param.GoodsQueryParam;
 import com.qs.mp.admin.domain.vo.GoodsVO;
 import com.qs.mp.admin.service.IGoodsService;
 import com.qs.mp.admin.service.IGoodsSkuService;
+import com.qs.mp.common.annotation.Log;
 import com.qs.mp.common.core.domain.AjaxResult;
 import com.qs.mp.common.core.page.TableDataInfo;
+import com.qs.mp.common.enums.BusinessType;
 import com.qs.mp.common.enums.ErrorCodeEnum;
 import com.qs.mp.common.enums.GoodsStatusEnum;
 import com.qs.mp.common.utils.LogUtil;
@@ -31,6 +33,7 @@ import ma.glasnost.orika.MapperFacade;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Component;
 import org.springframework.util.CollectionUtils;
 import org.springframework.validation.annotation.Validated;
@@ -66,6 +69,7 @@ public class GoodsMgrController extends BaseApiController {
 	 * @return
 	 */
 	@PostMapping("/list")
+	@PreAuthorize("@ss.hasPermi('business:goods:list')")
 	public TableDataInfo list(@RequestBody GoodsQueryParam queryParam) {
 		startPage();
 		QueryWrapper<Goods> queryWrapper = new QueryWrapper<Goods>();
@@ -97,6 +101,7 @@ public class GoodsMgrController extends BaseApiController {
 	 * @return
 	 */
 	@PostMapping(value = "/detail")
+	@PreAuthorize("@ss.hasPermi('business:goods:query')")
 	public AjaxResult getGoodsDetail(@RequestBody JSONObject jsonObject) {
 		Long goodsId = jsonObject.getLong("goodsId");
 	    if (null == goodsId || 0 == goodsId){
@@ -126,8 +131,10 @@ public class GoodsMgrController extends BaseApiController {
 	 * @param
 	 * @return
 	 */
+	@Log(title = "新增商品", businessType = BusinessType.INSERT)
 	@ApiOperation(value = "新增商品信息", notes = "后台商品管理新增商品")
 	@PostMapping("/create")
+	@PreAuthorize("@ss.hasPermi('business:goods:add')")
 	public AjaxResult goodsCreate(@Validated @RequestBody GoodsParam goodsParam) {
 		Goods goods = mapperFacade.map(goodsParam, Goods.class);
 		// 1、校验名称是否重复(商品表)
@@ -176,8 +183,10 @@ public class GoodsMgrController extends BaseApiController {
 	 * @param
 	 * @return
 	 */
+	@Log(title = "修改商品", businessType = BusinessType.UPDATE)
 	@ApiOperation(value = "编辑商品信息", notes = "后台商品管理修改商品信息")
 	@PostMapping("/update")
+	@PreAuthorize("@ss.hasPermi('business:goods:edit')")
 	public AjaxResult goodsUpdate(@Validated @RequestBody GoodsParam goodsParam) {
 		if (null == goodsParam || null == goodsParam.getGoodsId() || 0 == goodsParam.getGoodsId()) {
 			return error(ErrorCodeEnum.ERROR_CODE_1001);
@@ -285,12 +294,14 @@ public class GoodsMgrController extends BaseApiController {
 
 
 	/**
-	 * 停用、启用商品
+	 * 上下架商品
 	 * @param
 	 * @return
 	 */
-	@ApiOperation(value = "停用、启用商品", notes = "停用、启用商品")
+	@Log(title = "上下架商品", businessType = BusinessType.UPDATE)
+	@ApiOperation(value = "上下架商品", notes = "上下架商品")
 	@PostMapping("/status")
+	@PreAuthorize("@ss.hasPermi('business:goods:on')")
 	public AjaxResult goodsStatus(@RequestBody JSONObject jsonObject) {
 		String goodsId = jsonObject.getString("goodsId");
 
@@ -314,7 +325,9 @@ public class GoodsMgrController extends BaseApiController {
 	 * @param
 	 * @return
 	 */
+	@Log(title = "删除商品", businessType = BusinessType.DELETE)
 	@PostMapping(value = "/remove")
+	@PreAuthorize("@ss.hasPermi('business:goods:remove')")
 	public AjaxResult removeGoods(@RequestBody JSONObject jsonObject) {
 		Long goodsId = jsonObject.getLong("goodsId");
 	    if (null == goodsId || 0 == goodsId){

+ 26 - 15
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/SaleSiteMgrController.java

@@ -13,9 +13,11 @@ import com.qs.mp.channel.domain.vo.ChannelVO;
 import com.qs.mp.channel.service.IChannelOrderService;
 import com.qs.mp.channel.service.IChannelService;
 import com.qs.mp.channel.service.IChannelUserRelService;
+import com.qs.mp.common.annotation.Log;
 import com.qs.mp.common.constant.UserConstants;
 import com.qs.mp.common.core.domain.AjaxResult;
 import com.qs.mp.common.core.page.TableDataInfo;
+import com.qs.mp.common.enums.BusinessType;
 import com.qs.mp.common.enums.ChannelRoleEnum;
 import com.qs.mp.common.enums.ErrorCodeEnum;
 import com.qs.mp.system.domain.SysUser;
@@ -32,6 +34,7 @@ import java.util.Map;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Component;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -52,16 +55,16 @@ public class SaleSiteMgrController extends BaseApiController {
 
 	@Autowired
 	private IChannelService channelService;
-	
+
 	@Autowired
 	private IChannelUserRelService channelUserRelService;
-	
+
 	@Autowired
 	private IChannelOrderService channelOrderService;
-	
+
 	@Autowired
 	private ISysUserService userService;
-	
+
 	@Autowired
 	private MapperFacade mapperFacade;
 
@@ -72,6 +75,7 @@ public class SaleSiteMgrController extends BaseApiController {
 	 * @return
 	 */
 	@PostMapping("/list")
+	@PreAuthorize("@ss.hasPermi('business:salesite:list')")
 	public TableDataInfo listChannel(@RequestBody Channel channel) {
 		List<ChannelVO> list = new ArrayList<ChannelVO>();
 		startPage();
@@ -103,15 +107,17 @@ public class SaleSiteMgrController extends BaseApiController {
 		}
 		return getDataTable(list);
 	}
-	
-	
+
+
 	/**
 	 * 新增经销商信息
 	 * @param
 	 * @return
 	 */
+	@Log(title = "新增经销商", businessType = BusinessType.INSERT)
 	@ApiOperation(value = "新增经销商信息", notes = "经销商端新增经销商")
 	@PostMapping("/create")
+	@PreAuthorize("@ss.hasPermi('business:salesite:add')")
 	public AjaxResult channelCreate(@Validated @RequestBody SaleSiteParam channelParam) {
 		if (channelParam.getChannelId() != null && channelParam.getChannelId() != 0) {
 			return AjaxResult.error("该经销商已存在");
@@ -134,7 +140,7 @@ public class SaleSiteMgrController extends BaseApiController {
 		if(null != channel.getParentId() && channel.getParentId() != 0) {
 			Channel parentChannel = channelService.getById(channel.getParentId());
 			if(null != parentChannel) {
-				 if(null != parentChannel.getCommRate() 
+				 if(null != parentChannel.getCommRate()
 						 && channel.getCommRate().compareTo(parentChannel.getCommRate()) > 0) {
 					 return AjaxResult.error("佣金比例不能高于父经销商的佣金比例");
 				 }
@@ -143,7 +149,7 @@ public class SaleSiteMgrController extends BaseApiController {
 			}else {
 				return AjaxResult.error("父经销商不存在");
 			}
-			
+
 		}else {
 			channel.setLevel(1);
 			channel.setChannelNo("");
@@ -154,7 +160,7 @@ public class SaleSiteMgrController extends BaseApiController {
 		} catch (Exception e) {
 			return AjaxResult.error("经销商'" + channel.getName() + "'新增失败" + e.getMessage());
 		}
-		
+
 		return AjaxResult.success("经销商'" + channel.getName() + "'新增成功");
 	}
 
@@ -163,8 +169,10 @@ public class SaleSiteMgrController extends BaseApiController {
 	 * @param
 	 * @return
 	 */
+	@Log(title = "修改经销商", businessType = BusinessType.UPDATE)
 	@ApiOperation(value = "编辑经销商信息", notes = "经销商端编辑经销商")
 	@PostMapping("/update")
+	@PreAuthorize("@ss.hasPermi('business:salesite:edit')")
 	public AjaxResult channelUpdate(@Validated @RequestBody ChannelParam channelParam) {
 		if (null == channelParam || null == channelParam.getChannelId()) {
 			return error(ErrorCodeEnum.ERROR_CODE_1001);
@@ -200,7 +208,7 @@ public class SaleSiteMgrController extends BaseApiController {
 		// 3.校验佣金比例,不能高于其父经销商的佣金比例,不能低于其子经销商的最大佣金比例
 		Channel parentChannel = channelService.getById(oldChannel.getParentId());
 		if(null != parentChannel) {
-			 if(null != parentChannel.getCommRate() 
+			 if(null != parentChannel.getCommRate()
 					 && channel.getCommRate().compareTo(parentChannel.getCommRate()) > 0) {
 				 return AjaxResult.error("佣金比例不能高于父经销商的佣金比例");
 			 }
@@ -216,15 +224,17 @@ public class SaleSiteMgrController extends BaseApiController {
 		}
 		return AjaxResult.success("经销商'" + channel.getName() + "'编辑成功");
 	}
-	
-	
+
+
 	/**
 	 * 停用、启用经销商
 	 * @param
 	 * @return
 	 */
+	@Log(title = "经销商启用停用", businessType = BusinessType.UPDATE)
 	@ApiOperation(value = "停用、启用经销商信息", notes = "经销商管理编辑经销商")
 	@PostMapping("/status")
+	@PreAuthorize("@ss.hasPermi('business:salesite:edit')")
 	public AjaxResult channelStatus(@RequestBody JSONObject jsonObject) {
 		String channelId = jsonObject.containsKey("channelId")?jsonObject.get("channelId").toString():"";
 		String status = jsonObject.containsKey("status")?jsonObject.get("status").toString():"";
@@ -247,8 +257,8 @@ public class SaleSiteMgrController extends BaseApiController {
 		}
 		return AjaxResult.success("操作成功");
 	}
-	
-	
+
+
 	/**
 	 * 查询经销商详情
 	 * @param
@@ -256,6 +266,7 @@ public class SaleSiteMgrController extends BaseApiController {
 	 */
 	@ApiOperation(value = "查询经销商详情信息", notes = "经销商管理编辑子经销商查询经销商详情")
 	@PostMapping("/detail")
+	@PreAuthorize("@ss.hasPermi('business:salesite:query')")
 	public AjaxResult getChannelDetail(@RequestBody JSONObject jsonObject) {
 		String channelId = (null != jsonObject && jsonObject.containsKey("channelId"))?jsonObject.getString("channelId"):"";
 		if (StringUtils.isBlank(channelId)) {
@@ -281,5 +292,5 @@ public class SaleSiteMgrController extends BaseApiController {
 	    channelVO.setOperData(channelOperDataVO);
 		return AjaxResult.success(channelVO);
 	}
-	
+
 }

+ 11 - 2
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/TicketBoxMgrController.java

@@ -90,6 +90,7 @@ public class TicketBoxMgrController extends BaseApiController {
 	 * @return
 	 */
 	@PostMapping("/list")
+	@PreAuthorize("@ss.hasPermi('business:ticket:list')")
 	public TableDataInfo list(@RequestBody TicketBox ticketBox) {
 		startPage();
 		List<TicketBox> list = ticketBoxService.list(new QueryWrapper<>());
@@ -102,8 +103,10 @@ public class TicketBoxMgrController extends BaseApiController {
 	 * @param
 	 * @return
 	 */
+	@Log(title = "盲票新增", businessType = BusinessType.INSERT)
 	@ApiOperation(value = "新增盲票", notes = "管理端创建盲票")
 	@PostMapping("/create")
+	@PreAuthorize("@ss.hasPermi('business:ticket:add')")
 	public AjaxResult create(@Validated @RequestBody TicketBoxCreateParam param) {
 		if (param.getType() == TicketTypeEnum.OFFLINE) {
 			if (param.getPkgSalePrice() == null || param.getPkgSalePrice() == 0) {
@@ -123,8 +126,10 @@ public class TicketBoxMgrController extends BaseApiController {
 	 * @param
 	 * @return
 	 */
+	@Log(title = "盲票上下架", businessType = BusinessType.UPDATE)
 	@ApiOperation(value = "盲票上下架", notes = "管理端盲票上下架")
 	@PostMapping("/put")
+	@PreAuthorize("@ss.hasPermi('business:ticket:on')")
 	public AjaxResult putOnOff(@RequestBody TicketBox param) {
 		if (StringUtils.isBlank(param.getBoxId()) || param.getStatus() == null) {
 				return AjaxResult.error("参数缺失");
@@ -155,8 +160,10 @@ public class TicketBoxMgrController extends BaseApiController {
 	 * @param
 	 * @return
 	 */
+	@Log(title = "盲票删除", businessType = BusinessType.DELETE)
 	@ApiOperation(value = "盲票删除", notes = "管理端盲票删除")
 	@PostMapping("/remove")
+	@PreAuthorize("@ss.hasPermi('business:ticket:remove')")
 	public AjaxResult remove(@RequestBody TicketBox param) {
 		if (StringUtils.isBlank(param.getBoxId())) {
 			return AjaxResult.error("参数缺失");
@@ -169,8 +176,9 @@ public class TicketBoxMgrController extends BaseApiController {
 		return AjaxResult.success("删除成功");
 	}
 
-	@Log(title = "盲票导出", businessType = BusinessType.EXPORT)
+	/*@Log(title = "盲票导出", businessType = BusinessType.EXPORT)
 	@PostMapping("/export")
+	@PreAuthorize("@ss.hasPermi('business:ticket:export')")
 	public AjaxResult exportTicket(@RequestBody BathIdParam ids) {
 		if (null == ids || null == ids.getIds() || ids.getIds().size() == 0) {
 			return AjaxResult.error("请选择需要导出的盲票组");
@@ -254,11 +262,12 @@ public class TicketBoxMgrController extends BaseApiController {
 		} catch (Exception e) {
 			return AjaxResult.error("导入失败,请联系管理员");
 		}
-	}
+	}*/
 
 
 	@Log(title = "导出印刷", businessType = BusinessType.EXPORT)
 	@PostMapping("/exportDraw")
+	@PreAuthorize("@ss.hasPermi('business:ticket:export')")
 	public AjaxResult exportDraw(@RequestBody BathIdParam ids) {
 		if (null == ids || null == ids.getIds() || ids.getIds().size() == 0) {
 			return AjaxResult.error("请选择需要导出的盲票组");

+ 5 - 1
mp-admin/src/main/java/com/qs/mp/web/controller/api/admin/UserDeliverOrderMgrController.java

@@ -51,13 +51,14 @@ import ma.glasnost.orika.MapperFacade;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 @RestController
-@RequestMapping("/api/v1/admin/deliver/order")
+@RequestMapping("/api/v1/mp/admin/deliver/order")
 @Api(tags = "用户提货订单接口")
 @AllArgsConstructor
 public class UserDeliverOrderMgrController extends BaseApiController {
@@ -88,6 +89,7 @@ public class UserDeliverOrderMgrController extends BaseApiController {
 	 */
 	@PostMapping("/list")
 	@ApiOperation(value = "用户提货订单列表", notes = "获取用户提货订单列表")
+	@PreAuthorize("@ss.hasPermi('order:deliver:list')")
 	public TableDataInfo list(@RequestBody UserDeliverOrderQueryParam queryParam) {
 		startPage();
 		QueryWrapper<UserDeliverOrder> queryWrapper = new QueryWrapper<UserDeliverOrder>();
@@ -112,6 +114,7 @@ public class UserDeliverOrderMgrController extends BaseApiController {
 	 */
 	@PostMapping("/detail")
 	@ApiOperation(value = "订单详情", notes = "在订单列表页面查看详情")
+	@PreAuthorize("@ss.hasPermi('order:deliver:query')")
 	public AjaxResult query(@RequestBody UserDeliverOrder order) {
 		if (null == order || StringUtils.isBlank(order.getOrderId())) {
 			return error(ErrorCodeEnum.ERROR_CODE_1001);
@@ -130,6 +133,7 @@ public class UserDeliverOrderMgrController extends BaseApiController {
 	 */
 	@PostMapping("/ship")
 	@ApiOperation(value = "订单发货", notes = "在订单发货页面提交")
+	@PreAuthorize("@ss.hasPermi('order:deliver:ship')")
 	public AjaxResult ship(@RequestBody UserDeliverOrderShipParam shipParam) {
 		if(null == shipParam || StringUtils.isBlank(shipParam.getOrderId())) {
 			return error(ErrorCodeEnum.ERROR_CODE_1001);

+ 0 - 65
mp-service/src/main/java/com/qs/mp/user/domain/UserCouponVerifyLog.java

@@ -1,65 +0,0 @@
-package com.qs.mp.user.domain;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import java.io.Serializable;
-import java.util.Date;
-import lombok.Data;
-
-/**
- * @describe 优惠券核销记录实体类
- * @auther quanshu
- * @create 2022-03-07 20:45:43
- */
-@TableName("mp_user_coupon_verify_log")
-@Data
-public class UserCouponVerifyLog implements Serializable {
-
-  private static final long serialVersionUID = 1L;
-
-  /**
-   * 主键
-   */
-  @TableId(value = "id", type = IdType.AUTO)
-  private Long id;
-
-  /**
-   * 用户优惠券ID
-   */
-  @TableField("user_coupon_id")
-  private Long userCouponId;
-
-  /**
-   * 优惠券ID
-   */
-  @TableField("coupon_id")
-  private String couponId;
-
-  /**
-   * 核销时间
-   */
-  @TableField("verify_time")
-  private Date verifyTime;
-
-  /**
-   * 核销用户
-   */
-  @TableField("verify_user")
-  private String verifyUser;
-
-  /**
-   * 创建时间
-   */
-  @TableField("created_time")
-  private Date createdTime;
-
-  /**
-   * 更新时间
-   */
-  @TableField("updated_time")
-  private Date updatedTime;
-
-
-}

+ 0 - 13
mp-service/src/main/java/com/qs/mp/user/mapper/UserCouponVerifyLogMapper.java

@@ -1,13 +0,0 @@
-package com.qs.mp.user.mapper;
-
-import com.qs.mp.user.domain.UserCouponVerifyLog;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
- * @auther quanshu
- * @create 2022-03-07 20:45:43
- * @describe 优惠券核销记录mapper类
- */
-public interface UserCouponVerifyLogMapper extends BaseMapper<UserCouponVerifyLog> {
-
-}

+ 0 - 16
mp-service/src/main/java/com/qs/mp/user/service/IUserCouponVerifyLogService.java

@@ -1,16 +0,0 @@
-package com.qs.mp.user.service;
-
-import com.qs.mp.user.domain.UserCouponVerifyLog;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * <p>
- * 优惠券核销记录 服务类
- * </p>
- *
- * @author quanshu
- * @since 2022-03-07
- */
-public interface IUserCouponVerifyLogService extends IService<UserCouponVerifyLog> {
-
-}

+ 0 - 20
mp-service/src/main/java/com/qs/mp/user/service/impl/UserCouponVerifyLogServiceImpl.java

@@ -1,20 +0,0 @@
-package com.qs.mp.user.service.impl;
-
-import com.qs.mp.user.domain.UserCouponVerifyLog;
-import com.qs.mp.user.mapper.UserCouponVerifyLogMapper;
-import com.qs.mp.user.service.IUserCouponVerifyLogService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * 优惠券核销记录 服务实现类
- * </p>
- *
- * @author quanshu
- * @since 2022-03-07
- */
-@Service
-public class UserCouponVerifyLogServiceImpl extends ServiceImpl<UserCouponVerifyLogMapper, UserCouponVerifyLog> implements IUserCouponVerifyLogService {
-
-}

+ 0 - 21
mp-service/src/main/resources/mapper/user/UserCouponVerifyLogMapper.xml

@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.qs.mp.user.mapper.UserCouponVerifyLogMapper">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.qs.mp.user.domain.UserCouponVerifyLog">
-        <id column="id" property="id" />
-        <result column="user_coupon_id" property="userCouponId" />
-        <result column="coupon_id" property="couponId" />
-        <result column="verify_time" property="verifyTime" />
-        <result column="verify_user" property="verifyUser" />
-        <result column="created_time" property="createdTime" />
-        <result column="updated_time" property="updatedTime" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, user_coupon_id, coupon_id, verify_time, verify_user, created_time, updated_time
-    </sql>
-
-</mapper>