Przeglądaj źródła

优化营销管理,获取当前登录人的油站信息

MS-QJVSRANLTYEO\Administrator 4 lat temu
rodzic
commit
284634954f

+ 14 - 18
yijia-market/src/main/java/com/yijia/market/controller/MarkertPlanController.java

@@ -44,46 +44,45 @@ public class MarkertPlanController extends BaseController
     /**
      * 查询营销方案列表
      */
-    @PreAuthorize("@ss.hasPermi('market:plan:list')")
     @GetMapping("/list")
     public TableDataInfo list(MarkertPlan markertPlan)
     {
-        if(markertPlan!=null &&markertPlan.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(markertPlan.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             markertPlan.setStationIdList(list);
             markertPlan.setStationId(null);
         }
         startPage();
-        List<MarkertPlan> list = markertPlanService.selectMarkertPlanList(markertPlan);
-        return getDataTable(list);
+        List<MarkertPlan> planList = markertPlanService.selectMarkertPlanList(markertPlan);
+        return getDataTable(planList);
     }
 
     /**
      * 导出营销方案列表
      */
-    @PreAuthorize("@ss.hasPermi('market:plan:export')")
     @Log(title = "营销方案", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(MarkertPlan markertPlan)
     {
-        if(markertPlan!=null &&markertPlan.getStationId()!=null){
-            SysDept dept =new SysDept();
-            dept.setDeptId(markertPlan.getStationId());
-            List<String> list = deptService.selectDeptId(dept);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = deptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
             markertPlan.setStationIdList(list);
             markertPlan.setStationId(null);
         }
-        List<MarkertPlan> list = markertPlanService.selectMarkertPlanList(markertPlan);
+        List<MarkertPlan> planList = markertPlanService.selectMarkertPlanList(markertPlan);
         ExcelUtil<MarkertPlan> util = new ExcelUtil<MarkertPlan>(MarkertPlan.class);
-        return util.exportExcel(list, "plan");
+        return util.exportExcel(planList, "plan");
     }
 
     /**
      * 获取营销方案详细信息
      */
-    @PreAuthorize("@ss.hasPermi('market:plan:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
     {
@@ -93,7 +92,6 @@ public class MarkertPlanController extends BaseController
     /**
      * 新增营销方案
      */
-    @PreAuthorize("@ss.hasPermi('market:plan:add')")
     @Log(title = "营销方案", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody MarkertPlan markertPlan)
@@ -104,7 +102,6 @@ public class MarkertPlanController extends BaseController
     /**
      * 修改营销方案
      */
-    @PreAuthorize("@ss.hasPermi('market:plan:edit')")
     @Log(title = "营销方案", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody MarkertPlan markertPlan)
@@ -115,7 +112,6 @@ public class MarkertPlanController extends BaseController
     /**
      * 删除营销方案
      */
-    @PreAuthorize("@ss.hasPermi('market:plan:remove')")
     @Log(title = "营销方案", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)

+ 0 - 6
yijia-market/src/main/java/com/yijia/market/controller/MarketCouponController.java

@@ -41,7 +41,6 @@ public class MarketCouponController extends BaseController
     /**
      * 查询优惠劵管理列表
      */
-    @PreAuthorize("@ss.hasPermi('market:coupon:list')")
     @GetMapping("/list")
     public TableDataInfo list(MarketCoupon marketCoupon)
     {
@@ -58,7 +57,6 @@ public class MarketCouponController extends BaseController
     /**
      * 导出优惠劵管理列表
      */
-    @PreAuthorize("@ss.hasPermi('market:coupon:export')")
     @Log(title = "优惠劵管理", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(MarketCoupon marketCoupon)
@@ -71,7 +69,6 @@ public class MarketCouponController extends BaseController
     /**
      * 获取优惠劵管理详细信息
      */
-    @PreAuthorize("@ss.hasPermi('market:coupon:query')")
     @GetMapping(value = "/{couponId}")
     public AjaxResult getInfo(@PathVariable("couponId") Long couponId)
     {
@@ -81,7 +78,6 @@ public class MarketCouponController extends BaseController
     /**
      * 新增优惠劵管理
      */
-    @PreAuthorize("@ss.hasPermi('market:coupon:add')")
     @Log(title = "优惠劵管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody MarketCoupon marketCoupon)
@@ -92,7 +88,6 @@ public class MarketCouponController extends BaseController
     /**
      * 修改优惠劵管理
      */
-    @PreAuthorize("@ss.hasPermi('market:coupon:edit')")
     @Log(title = "优惠劵管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody MarketCoupon marketCoupon)
@@ -103,7 +98,6 @@ public class MarketCouponController extends BaseController
     /**
      * 删除优惠劵管理
      */
-    @PreAuthorize("@ss.hasPermi('market:coupon:remove')")
     @Log(title = "优惠劵管理", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{couponIds}")
     public AjaxResult remove(@PathVariable Long[] couponIds)