Commit 9dc8e4e6ef98f8cedbca4a7751c4c2e8d1896a7b
1 parent
7deb21f3
员工管理
Showing
4 changed files
with
145 additions
and
24 deletions
src/main/java/com/zteits/oa/report/web/AsraOpController.java
@@ -49,21 +49,22 @@ public class AsraOpController { | @@ -49,21 +49,22 @@ public class AsraOpController { | ||
49 | /**1.根据当前登录人查询登录人下面管理的员工-缓存中获取*/ | 49 | /**1.根据当前登录人查询登录人下面管理的员工-缓存中获取*/ |
50 | AsraOpDTO asraOpDTO = (AsraOpDTO)request.getSession().getAttribute(SessionEnum.USER_INFO.key()); | 50 | AsraOpDTO asraOpDTO = (AsraOpDTO)request.getSession().getAttribute(SessionEnum.USER_INFO.key()); |
51 | 51 | ||
52 | - /**2.判断登录人是领导还是员工 ,2:员工,1:领导*/ | ||
53 | - List<Long> opIdLists = new ArrayList<>(); | ||
54 | - opIdLists.add(asraOpDTO.getId()); | ||
55 | - if(asraOpDTO.getRoleId() == 1){ | ||
56 | - /**如果是领导,获取领导下面的员工信息*/ | ||
57 | - AsraOpRelationsQueryReq asraOpRelationsQueryReq = new AsraOpRelationsQueryReq(); | ||
58 | - asraOpRelationsQueryReq.setParentId(asraOpDTO.getId()); | ||
59 | - BizResult<List<AsraOpRelationsDTO>> listBizResult = asraOpRelationsQueryService.queryAsraOpRelations(asraOpRelationsQueryReq); | ||
60 | - if(listBizResult.isSuccess() && CollectionUtil.isNotEmpty(listBizResult.getData())){ | ||
61 | - for(AsraOpRelationsDTO asraOpRelationsDTO : listBizResult.getData()){ | ||
62 | - opIdLists.add(asraOpRelationsDTO.getOpId()); | ||
63 | - } | ||
64 | - } | ||
65 | - } | ||
66 | - asraOpQueryReq.setOpIdLists(opIdLists); | 52 | +// /**2.判断登录人是领导还是员工 ,2:员工,1:领导*/ |
53 | +// List<Long> opIdLists = new ArrayList<>(); | ||
54 | +// opIdLists.add(asraOpDTO.getId()); | ||
55 | +// if(asraOpDTO.getRoleId() == 1){ | ||
56 | +// /**如果是领导,获取领导下面的员工信息*/ | ||
57 | +// AsraOpRelationsQueryReq asraOpRelationsQueryReq = new AsraOpRelationsQueryReq(); | ||
58 | +// asraOpRelationsQueryReq.setParentId(asraOpDTO.getId()); | ||
59 | +// BizResult<List<AsraOpRelationsDTO>> listBizResult = asraOpRelationsQueryService.queryAsraOpRelations(asraOpRelationsQueryReq); | ||
60 | +// if(listBizResult.isSuccess() && CollectionUtil.isNotEmpty(listBizResult.getData())){ | ||
61 | +// for(AsraOpRelationsDTO asraOpRelationsDTO : listBizResult.getData()){ | ||
62 | +// opIdLists.add(asraOpRelationsDTO.getOpId()); | ||
63 | +// } | ||
64 | +// } | ||
65 | +// } | ||
66 | +// asraOpQueryReq.setOpIdLists(opIdLists); | ||
67 | + asraOpQueryReq.setId(asraOpDTO.getId()); | ||
67 | BizResult<PageBean<AsraOpDTO>> result = asraOpQueryService.queryAsraOpForPage(asraOpQueryReq); | 68 | BizResult<PageBean<AsraOpDTO>> result = asraOpQueryService.queryAsraOpForPage(asraOpQueryReq); |
68 | logger.info("日报系统-员工管理-根据登录人分页查询员工信息结果:{}", JSONObject.toJSON(result)); | 69 | logger.info("日报系统-员工管理-根据登录人分页查询员工信息结果:{}", JSONObject.toJSON(result)); |
69 | return result; | 70 | return result; |
src/main/java/com/zteits/oa/report/web/vo/EasyUIDataGridVO.java
0 → 100644
1 | +package com.zteits.oa.report.web.vo; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.List; | ||
5 | + | ||
6 | +/** | ||
7 | + * Copyright: Copyright (c) 2017 zteits | ||
8 | + * | ||
9 | + * @ClassName: JqGridDisplayVO.java | ||
10 | + * @Description: JqGrid 对应前台数据传输格式 | ||
11 | + * @version: v1.0.0 | ||
12 | + * @author: zhaowg | ||
13 | + * @date: 2017年5月12日 上午11:20:33 | ||
14 | + * Modification History: | ||
15 | + * Date Author Version Description | ||
16 | + *---------------------------------------------------------* | ||
17 | + * 2017年5月12日 zhaowg v1.0.0 创建 | ||
18 | + */ | ||
19 | +public class EasyUIDataGridVO<T> implements Serializable{ | ||
20 | + | ||
21 | + private static final long serialVersionUID = 1L; | ||
22 | + //总页数 | ||
23 | + private Integer total; | ||
24 | + | ||
25 | + //包含实际数据的数组 | ||
26 | + private List<T> rows; | ||
27 | + | ||
28 | + public Integer getTotal() { | ||
29 | + return total; | ||
30 | + } | ||
31 | + | ||
32 | + public void setTotal(Integer total) { | ||
33 | + this.total = total; | ||
34 | + } | ||
35 | + | ||
36 | + public List<T> getRows() { | ||
37 | + return rows; | ||
38 | + } | ||
39 | + | ||
40 | + public void setRows(List<T> rows) { | ||
41 | + this.rows = rows; | ||
42 | + } | ||
43 | + | ||
44 | +} |
src/main/java/com/zteits/oa/report/web/vo/JqGridDisplayVO.java
0 → 100644
1 | +package com.zteits.oa.report.web.vo; | ||
2 | + | ||
3 | +import java.io.Serializable; | ||
4 | +import java.util.List; | ||
5 | + | ||
6 | +/** | ||
7 | + * Copyright: Copyright (c) 2017 zteits | ||
8 | + * | ||
9 | + * @ClassName: JqGridDisplayVO.java | ||
10 | + * @Description: JqGrid 对应前台数据传输格式 | ||
11 | + * @version: v1.0.0 | ||
12 | + * @author: zhaowg | ||
13 | + * @date: 2017年5月12日 上午11:20:33 | ||
14 | + * Modification History: | ||
15 | + * Date Author Version Description | ||
16 | + *---------------------------------------------------------* | ||
17 | + * 2017年5月12日 zhaowg v1.0.0 创建 | ||
18 | + */ | ||
19 | +public class JqGridDisplayVO<T> implements Serializable{ | ||
20 | + | ||
21 | + private static final long serialVersionUID = 1L; | ||
22 | + //总页数 | ||
23 | + private Integer total; | ||
24 | + | ||
25 | + //当前页 | ||
26 | + private Integer page; | ||
27 | + | ||
28 | + //总记录条数 | ||
29 | + private Integer records; | ||
30 | + | ||
31 | + //包含实际数据的数组 | ||
32 | + private List<T> rows; | ||
33 | + | ||
34 | + public Integer getTotal() { | ||
35 | + return total; | ||
36 | + } | ||
37 | + | ||
38 | + public void setTotal(Integer total) { | ||
39 | + this.total = total; | ||
40 | + } | ||
41 | + | ||
42 | + public Integer getPage() { | ||
43 | + return page; | ||
44 | + } | ||
45 | + | ||
46 | + public void setPage(Integer page) { | ||
47 | + this.page = page; | ||
48 | + } | ||
49 | + | ||
50 | + public Integer getRecords() { | ||
51 | + return records; | ||
52 | + } | ||
53 | + | ||
54 | + public void setRecords(Integer records) { | ||
55 | + this.records = records; | ||
56 | + } | ||
57 | + | ||
58 | + public List<T> getRows() { | ||
59 | + return rows; | ||
60 | + } | ||
61 | + | ||
62 | + public void setRows(List<T> rows) { | ||
63 | + this.rows = rows; | ||
64 | + } | ||
65 | + | ||
66 | +} |
src/main/resources/mybatis/smapper/AsraOpSmapper.xml
@@ -27,21 +27,31 @@ | @@ -27,21 +27,31 @@ | ||
27 | </sql> | 27 | </sql> |
28 | 28 | ||
29 | <select id="queryAsraOpForList" parameterType="com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq" resultMap="BaseResultMap"> | 29 | <select id="queryAsraOpForList" parameterType="com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq" resultMap="BaseResultMap"> |
30 | - select | ||
31 | - <include refid="Base_Column_List" /> | ||
32 | - from asra_op | ||
33 | - where 1=1 | 30 | + select |
31 | + ap.id id, | ||
32 | + ap.login_code loginCode, | ||
33 | + ap.op_name opName, | ||
34 | + ap.email email, | ||
35 | + ap.role_id roleId, | ||
36 | + ap.city_id cityId, | ||
37 | + ap.city_name cityName, | ||
38 | + ap.is_remind_email isRemindEmail | ||
39 | + from asra_op ap,asra_op_relations apr | ||
40 | + where 1=1 and ap.id = apr.op_id | ||
41 | + <if test="id != null "> | ||
42 | + and apr.parent_id = #{id} or ap.id = #{id} | ||
43 | + </if> | ||
34 | <if test="loginCode != null and loginCode !=''"> | 44 | <if test="loginCode != null and loginCode !=''"> |
35 | - and login_code = #{loginCode,jdbcType=VARCHAR} | 45 | + and ap.login_code = #{loginCode,jdbcType=VARCHAR} |
36 | </if> | 46 | </if> |
37 | <if test="opName != null and opName != ''"> | 47 | <if test="opName != null and opName != ''"> |
38 | - and op_name ike concat('${opName}','%') | 48 | + and ap.op_name ike concat('${opName}','%') |
39 | </if> | 49 | </if> |
40 | <if test="email != null and email != ''"> | 50 | <if test="email != null and email != ''"> |
41 | - and email = #{email,jdbcType=VARCHAR} | 51 | + and ap.email = #{email,jdbcType=VARCHAR} |
42 | </if> | 52 | </if> |
43 | - <if test="opIdLists != null and opIdLists.size >0"> | ||
44 | - and id in | 53 | + <if test="opIdLists != null"> |
54 | + and ap.id in | ||
45 | <foreach collection="opIdLists" item="opId" open="(" close=")" separator="," > | 55 | <foreach collection="opIdLists" item="opId" open="(" close=")" separator="," > |
46 | #{opId} | 56 | #{opId} |
47 | </foreach> | 57 | </foreach> |