فهرست منبع

设置全局组织机构管理

MS-QJVSRANLTYEO\Administrator 4 سال پیش
والد
کامیت
0cf618babe

+ 14 - 9
Yijia-SaaS/yijia-customer/src/main/java/com/yijia/customer/controller/CustomerGradeSettingController.java

@@ -3,8 +3,10 @@ package com.yijia.customer.controller;
 import java.util.Arrays;
 import java.util.List;
 
+import com.yijia.common.core.domain.entity.SysDept;
 import com.yijia.common.core.domain.model.LoginUser;
 import com.yijia.common.utils.SecurityUtils;
+import com.yijia.system.service.ISysDeptService;
 import com.yijia.system.service.ISysUserService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -37,8 +39,9 @@ public class CustomerGradeSettingController extends BaseController
 {
     @Autowired
     private ICustomerGradeSettingService customerGradeSettingService;
+
     @Autowired
-    private ISysUserService sysUserService;
+    private ISysDeptService deptService;
     /**
      * 查询客户优惠等级设置列表
      */
@@ -46,11 +49,12 @@ public class CustomerGradeSettingController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(CustomerGradeSetting customerGradeSetting)
     {
-        LoginUser currentUser = SecurityUtils.getLoginUser();
-        String selectDeptid= sysUserService.getUserRoleDeptId(currentUser);
-        if(selectDeptid !=null && selectDeptid!=""){
-            List<String> list = Arrays.asList(selectDeptid.split(","));
+        if(customerGradeSetting!=null &&customerGradeSetting.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(customerGradeSetting.getStationId());
+            List<String> list = deptService.selectDeptId(dept);
             customerGradeSetting.setStationIdList(list);
+            customerGradeSetting.setStationId(null);
         }
         startPage();
         List<CustomerGradeSetting> list = customerGradeSettingService.selectCustomerGradeSettingList(customerGradeSetting);
@@ -65,11 +69,12 @@ public class CustomerGradeSettingController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(CustomerGradeSetting customerGradeSetting)
     {
-        LoginUser currentUser = SecurityUtils.getLoginUser();
-        String selectDeptid= sysUserService.getUserRoleDeptId(currentUser);
-        if(selectDeptid !=null && selectDeptid!=""){
-            List<String> list = Arrays.asList(selectDeptid.split(","));
+        if(customerGradeSetting!=null &&customerGradeSetting.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(customerGradeSetting.getStationId());
+            List<String> list = deptService.selectDeptId(dept);
             customerGradeSetting.setStationIdList(list);
+            customerGradeSetting.setStationId(null);
         }
         List<CustomerGradeSetting> list = customerGradeSettingService.selectCustomerGradeSettingList(customerGradeSetting);
         ExcelUtil<CustomerGradeSetting> util = new ExcelUtil<CustomerGradeSetting>(CustomerGradeSetting.class);

+ 13 - 9
Yijia-SaaS/yijia-customer/src/main/java/com/yijia/customer/controller/CustomerManageController.java

@@ -1,9 +1,11 @@
 package com.yijia.customer.controller;
+import com.yijia.common.core.domain.entity.SysDept;
 import com.yijia.common.core.domain.model.LoginUser;
 import com.yijia.common.utils.SecurityUtils;
 import com.yijia.common.utils.poi.ExcelUtil;
 import com.yijia.customer.domain.CustomerManage;
 import com.yijia.customer.service.ICustomerManageService;
+import com.yijia.system.service.ISysDeptService;
 import com.yijia.system.service.ISysUserService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -38,7 +40,7 @@ public class CustomerManageController extends BaseController
     @Autowired
     private ICustomerManageService customerManageService;
     @Autowired
-    private ISysUserService sysUserService;
+    private ISysDeptService deptService;
     /**
      * 查询客户管理列表
      */
@@ -46,11 +48,12 @@ public class CustomerManageController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(CustomerManage customerManage)
     {
-        LoginUser currentUser = SecurityUtils.getLoginUser();
-        String selectDeptid= sysUserService.getUserRoleDeptId(currentUser);
-        if(selectDeptid !=null && selectDeptid!=""){
-            List<String> list = Arrays.asList(selectDeptid.split(","));
+        if(customerManage!=null &&customerManage.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(customerManage.getStationId());
+            List<String> list = deptService.selectDeptId(dept);
             customerManage.setStationIdList(list);
+            customerManage.setStationId(null);
         }
         startPage();
         List<CustomerManage> list = customerManageService.selectCustomerManageList(customerManage);
@@ -65,11 +68,12 @@ public class CustomerManageController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(CustomerManage customerManage)
     {
-        LoginUser currentUser = SecurityUtils.getLoginUser();
-        String selectDeptid= sysUserService.getUserRoleDeptId(currentUser);
-        if(selectDeptid !=null && selectDeptid!=""){
-            List<String> list = Arrays.asList(selectDeptid.split(","));
+        if(customerManage!=null &&customerManage.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(customerManage.getStationId());
+            List<String> list = deptService.selectDeptId(dept);
             customerManage.setStationIdList(list);
+            customerManage.setStationId(null);
         }
         List<CustomerManage> list = customerManageService.selectCustomerManageList(customerManage);
         ExcelUtil<CustomerManage> util = new ExcelUtil<CustomerManage>(CustomerManage.class);

+ 1 - 0
Yijia-SaaS/yijia-customer/src/main/resources/mapper/customer/CustomerGradeSettingMapper.xml

@@ -63,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 </foreach>
             </if>
         </where>
+        order by  id desc
     </select>
 
     <select id="selectCustomerGradeSettingById" parameterType="Long" resultMap="CustomerGradeSettingResult">

+ 1 - 0
Yijia-SaaS/yijia-customer/src/main/resources/mapper/customer/CustomerManageMapper.xml

@@ -77,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 </foreach>
             </if>
         </where>
+        order by  id desc
     </select>
     
     <select id="selectCustomerManageById" parameterType="Long" resultMap="CustomerManageResult">