7290d1b5 张雷

积木报表权限修改

1 个父辈 4ea7e99a
...@@ -733,7 +733,7 @@ public class SysDepartController { ...@@ -733,7 +733,7 @@ public class SysDepartController {
733 @ApiOperation("积木报表机构树") 733 @ApiOperation("积木报表机构树")
734 @GetMapping(value = "/jimu/tree") 734 @GetMapping(value = "/jimu/tree")
735 public List<DepartTree> jimuDepartTree(DepartTree departTree) { 735 public List<DepartTree> jimuDepartTree(DepartTree departTree) {
736 List<DepartTree> list = sysDepartService.getJimuDepartTree(departTree.getPid()); 736 List<DepartTree> list = sysDepartService.getJimuDepartTree(departTree);
737 return list; 737 return list;
738 } 738 }
739 } 739 }
......
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
6 import com.skua.modules.system.entity.SysDepart; 6 import com.skua.modules.system.entity.SysDepart;
7 import com.skua.modules.system.vo.DepartTree; 7 import com.skua.modules.system.vo.DepartTree;
8 import com.skua.modules.system.vo.SysDeptUserVO; 8 import com.skua.modules.system.vo.SysDeptUserVO;
9 import com.skua.tool.annotation.Anonymous;
9 import org.apache.ibatis.annotations.Param; 10 import org.apache.ibatis.annotations.Param;
10 import org.apache.ibatis.annotations.Select; 11 import org.apache.ibatis.annotations.Select;
11 12
...@@ -137,11 +138,24 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> { ...@@ -137,11 +138,24 @@ public interface SysDepartMapper extends BaseMapper<SysDepart> {
137 138
138 String getDepartTreeByParentDepartId(@Param("parentDepartId")String parentDepartId); 139 String getDepartTreeByParentDepartId(@Param("parentDepartId")String parentDepartId);
139 140
140 List<DepartTree> getJimuDepartTree(@Param("pid") String pid);
141
142 String getChildDepartId(@Param("departIds") String departIds); 141 String getChildDepartId(@Param("departIds") String departIds);
143 142
144 List<SysDeptUserVO> queryDeptAndUserTreeList(@Param("departId") String departId); 143 List<SysDeptUserVO> queryDeptAndUserTreeList(@Param("departId") String departId);
145 144
146 List<SysDeptUserVO> queryDeptAndSystemTreeList(@Param("departId") String departId); 145 List<SysDeptUserVO> queryDeptAndSystemTreeList(@Param("departId") String departId);
146
147 @Anonymous
148 List<DepartTree> getJimuDepartTree(@Param("pid") String pid);
149
150 @Anonymous
151 List<DepartTree> getJimuDepartTreeFY(@Param("pid") String pid, @Param("departIds") String departIds);
152
153 @Anonymous
154 List<DepartTree> getJimuDepartTreeL(@Param("pid") String pid, @Param("departIds") String departIds);
155
156 @Anonymous
157 List<DepartTree> getJimuDepartTreeELSE(@Param("departIds") String departIds);
158
159 @Anonymous
160 SysDepart getById(@Param("pid") String pid);
147 } 161 }
......
...@@ -202,6 +202,40 @@ ...@@ -202,6 +202,40 @@
202 where parent_id = #{pid} 202 where parent_id = #{pid}
203 ORDER BY depart_order 203 ORDER BY depart_order
204 </select> 204 </select>
205
206 <select id="getJimuDepartTreeFY" resultType="com.skua.modules.system.vo.DepartTree">
207 select id,parent_id AS pid,depart_name AS title,id AS value from sys_depart
208 where parent_id = #{pid}
209 and id in (select parent_id from sys_depart where id IN
210 <foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">
211 '${item}'
212 </foreach>)
213 ORDER BY depart_order
214 </select>
215
216 <select id="getJimuDepartTreeL" resultType="com.skua.modules.system.vo.DepartTree">
217 select id,parent_id AS pid,depart_name AS title,id AS value from sys_depart
218 where parent_id = #{pid}
219 and id IN
220 <foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">
221 '${item}'
222 </foreach>
223 ORDER BY depart_order
224 </select>
225
226 <select id="getJimuDepartTreeELSE" resultType="com.skua.modules.system.vo.DepartTree">
227 select id,parent_id AS pid,depart_name AS title,id AS value from sys_depart
228 where id IN
229 <foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">
230 '${item}'
231 </foreach>
232 ORDER BY depart_order
233 </select>
234
235 <select id="getById" resultType="com.skua.modules.system.entity.SysDepart">
236 select * from sys_depart where id = #{pid}
237 </select>
238
205 <select id="getChildDepartId" resultType="java.lang.String"> 239 <select id="getChildDepartId" resultType="java.lang.String">
206 SELECT 240 SELECT
207 GROUP_CONCAT( id SEPARATOR ',' ) AS depart_ids 241 GROUP_CONCAT( id SEPARATOR ',' ) AS depart_ids
......
...@@ -175,7 +175,7 @@ public interface ISysDepartService extends IService<SysDepart>{ ...@@ -175,7 +175,7 @@ public interface ISysDepartService extends IService<SysDepart>{
175 */ 175 */
176 String getDepartTreeByParentDepartId(String parentDepartId); 176 String getDepartTreeByParentDepartId(String parentDepartId);
177 177
178 List<DepartTree> getJimuDepartTree(String pid); 178 List<DepartTree> getJimuDepartTree(DepartTree departTree);
179 179
180 String getChildDepartId(String departIds); 180 String getChildDepartId(String departIds);
181 181
......
...@@ -8,9 +8,12 @@ import com.skua.core.constant.CommonConstant; ...@@ -8,9 +8,12 @@ import com.skua.core.constant.CommonConstant;
8 import com.skua.core.context.BaseContextHandler; 8 import com.skua.core.context.BaseContextHandler;
9 import com.skua.core.service.ISequenceService; 9 import com.skua.core.service.ISequenceService;
10 import com.skua.core.util.ConvertUtils; 10 import com.skua.core.util.ConvertUtils;
11 import com.skua.core.util.JwtUtil;
11 import com.skua.core.util.YouBianCodeUtil; 12 import com.skua.core.util.YouBianCodeUtil;
12 import com.skua.modules.system.entity.SysDepart; 13 import com.skua.modules.system.entity.SysDepart;
14 import com.skua.modules.system.entity.SysUser;
13 import com.skua.modules.system.mapper.SysDepartMapper; 15 import com.skua.modules.system.mapper.SysDepartMapper;
16 import com.skua.modules.system.mapper.SysUserMapper;
14 import com.skua.modules.system.model.DepartIdModel; 17 import com.skua.modules.system.model.DepartIdModel;
15 import com.skua.modules.system.model.SysDepartTreeModel; 18 import com.skua.modules.system.model.SysDepartTreeModel;
16 import com.skua.modules.system.service.ISysDepartService; 19 import com.skua.modules.system.service.ISysDepartService;
...@@ -36,6 +39,8 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart ...@@ -36,6 +39,8 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
36 private SysDepartMapper sysDepartMapper; 39 private SysDepartMapper sysDepartMapper;
37 @Autowired 40 @Autowired
38 private ISequenceService sequenceService; 41 private ISequenceService sequenceService;
42 @Autowired
43 private SysUserMapper sysUserMapper;
39 44
40 /*** 45 /***
41 * 查询子集所有的部门 46 * 查询子集所有的部门
...@@ -464,11 +469,29 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart ...@@ -464,11 +469,29 @@ public class SysDepartServiceImpl extends ServiceImpl<SysDepartMapper, SysDepart
464 } 469 }
465 470
466 @Override 471 @Override
467 public List<DepartTree> getJimuDepartTree(String pid) { 472 public List<DepartTree> getJimuDepartTree(DepartTree departTree) {
468 if(ConvertUtils.isEmpty(pid)){ 473 List<DepartTree> list = new ArrayList<>();
469 pid = ""; 474 String pid = "";
475 String departIds = "";
476 if(ConvertUtils.isNotEmpty(departTree.getPid())){
477 if(ConvertUtils.isNotEmpty(departTree.getToken())){
478 SysUser user = sysUserMapper.getUserByName(JwtUtil.getUsername(departTree.getToken()));
479 if(user!=null){
480 departIds = sysUserMapper.queryDepartIdsByUserId(user.getId());
481 }
482 }
483 pid = departTree.getPid();
484 SysDepart depart = sysDepartMapper.getById(pid);
485 if("-1".equals(depart.getDepartType())){
486 list = sysDepartMapper.getJimuDepartTreeFY(pid,departIds);
487 }else if("0".equals(depart.getDepartType())){
488 list = sysDepartMapper.getJimuDepartTreeL(pid,departIds);
489 }else {
490 list = new ArrayList<>();
491 }
492 }else{
493 list = sysDepartMapper.getJimuDepartTree(pid);
470 } 494 }
471 List<DepartTree> list = sysDepartMapper.getJimuDepartTree(pid);
472 return list; 495 return list;
473 } 496 }
474 497
......
...@@ -13,6 +13,7 @@ public class DepartTree{ ...@@ -13,6 +13,7 @@ public class DepartTree{
13 private String value;//实际查询用到的值 13 private String value;//实际查询用到的值
14 /**下拉树显示的文本值*/ 14 /**下拉树显示的文本值*/
15 private String title;//下拉树显示的文本值 15 private String title;//下拉树显示的文本值
16 16 /**TOKEN*/
17 private String token;//TOKEN
17 18
18 } 19 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!