Commit 4b2bb18a188ea3a204d876f1145b8456ffb0aaa1

Authored by xiejianpeng
1 parent d0a6a58f

登录权限处理

src/main/java/com/zteits/oa/api/dto/asraop/param/AsraOpQueryReq.java
@@ -30,6 +30,16 @@ public class AsraOpQueryReq extends BaseRequest{ @@ -30,6 +30,16 @@ public class AsraOpQueryReq extends BaseRequest{
30 /**员工idlist*/ 30 /**员工idlist*/
31 private List<Long> opIdLists; 31 private List<Long> opIdLists;
32 32
  33 + /**员工idlist*/
  34 + private List<Long> opParentIdLists;
  35 +
  36 + public List<Long> getOpParentIdLists() {
  37 + return opParentIdLists;
  38 + }
  39 +
  40 + public void setOpParentIdLists(List<Long> opParentIdLists) {
  41 + this.opParentIdLists = opParentIdLists;
  42 + }
33 43
34 public List<Long> getOpIdLists() { 44 public List<Long> getOpIdLists() {
35 return opIdLists; 45 return opIdLists;
src/main/java/com/zteits/oa/api/service/report/query/AsraOpRelationsQueryService.java deleted
1 -package com.zteits.oa.api.service.report.query;  
2 -  
3 -import com.zteits.oa.api.base.bean.BizResult;  
4 -import com.zteits.oa.api.base.bean.PageBean;  
5 -import com.zteits.oa.api.dto.asraop.AsraOpDTO;  
6 -import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq;  
7 -import com.zteits.oa.api.dto.asraoprelations.AsraOpRelationsDTO;  
8 -import com.zteits.oa.api.dto.asraoprelations.param.AsraOpRelationsQueryReq;  
9 -  
10 -import java.util.List;  
11 -  
12 -/**  
13 - * 员工关系表查询service.<br/>  
14 - *  
15 - * Copyright: Copyright (c) 2017 ZTE-ITS  
16 - *  
17 - * @ClassName: AmountUtils.java  
18 - * @Description:  
19 - * @version: v1.0.0  
20 - * @author: wangfs  
21 - * @date: 2018年7月30日  
22 - * Modification History:  
23 - * Date Author Version Description  
24 - *---------------------------------------------------------*  
25 - * 2018年7月30日 xiejp v1.0.0 创建  
26 - */  
27 -public interface AsraOpRelationsQueryService {  
28 -  
29 - /**  
30 - * 根据登录工号查询管理的员工信息  
31 - * @param  
32 - * @return  
33 - * @Author: xiejianpeng  
34 - * @Date: 2018/7/31 10:33  
35 - *  
36 - */  
37 - BizResult<List<AsraOpRelationsDTO>> queryAsraOpRelations(AsraOpRelationsQueryReq asraOpRelationsQueryReq);  
38 -}  
src/main/java/com/zteits/oa/report/biz/AsraOpRelationsQueryServiceImpl.java deleted
1 -package com.zteits.oa.report.biz;  
2 -  
3 -import com.xiaoleilu.hutool.util.CollectionUtil;  
4 -import com.zteits.oa.api.base.bean.BizResult;  
5 -import com.zteits.oa.api.dto.asraoprelations.AsraOpRelationsDTO;  
6 -import com.zteits.oa.api.dto.asraoprelations.param.AsraOpRelationsQueryReq;  
7 -import com.zteits.oa.api.service.report.query.AsraOpRelationsQueryService;  
8 -import com.zteits.oa.report.domain.AsraOpRelations;  
9 -import org.springframework.beans.BeanUtils;  
10 -import org.springframework.beans.factory.annotation.Autowired;  
11 -import org.springframework.stereotype.Service;  
12 -  
13 -import java.util.ArrayList;  
14 -import java.util.List;  
15 -  
16 -/**  
17 - * Copyright: Copyright (c) 2018 zteits  
18 - *  
19 - * @Description:  
20 - * @version: v1.0.0  
21 - * @author: xiejianpeng  
22 - * @date: 2018/7/31 11  
23 - * Modification History:  
24 - * Date Author Version Description  
25 - * ---------------------------------------------------------*  
26 - * 2018/7/31 xiejianpeng v1.0.0 创建  
27 - */  
28 -@Service  
29 -public class AsraOpRelationsQueryServiceImpl implements AsraOpRelationsQueryService {  
30 -  
31 - //@Autowired  
32 - //private AsraOpRelationsDao asraOpRelationsDao;  
33 -  
34 - @Override  
35 - public BizResult<List<AsraOpRelationsDTO>> queryAsraOpRelations(AsraOpRelationsQueryReq asraOpRelationsQueryReq) {  
36 -  
37 - List<AsraOpRelationsDTO> asraOpRelationsDTOs = new ArrayList<>();  
38 - List<AsraOpRelations> asraOpRelationsList = null;//asraOpRelationsDao.queryAsraOpRelations(asraOpRelationsQueryReq.getParentId());  
39 - if(CollectionUtil.isNotEmpty(asraOpRelationsList)) {  
40 - BeanUtils.copyProperties(asraOpRelationsList, asraOpRelationsDTOs, AsraOpRelationsDTO.class);  
41 - }  
42 - return new BizResult<>(asraOpRelationsDTOs);  
43 - }  
44 -}  
src/main/java/com/zteits/oa/report/dao/impl/AsraDailyDaoImpl.java
@@ -8,14 +8,11 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -8,14 +8,11 @@ import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.stereotype.Component; 8 import org.springframework.stereotype.Component;
9 9
10 import com.xiaoleilu.hutool.date.DateUtil; 10 import com.xiaoleilu.hutool.date.DateUtil;
11 -import com.xiaoleilu.hutool.util.CollectionUtil;  
12 import com.zteits.oa.api.dto.asradaily.param.AsraDailyForTotalNumAndDetailReq; 11 import com.zteits.oa.api.dto.asradaily.param.AsraDailyForTotalNumAndDetailReq;
13 import com.zteits.oa.api.dto.asradaily.param.AsraDailyQueryReq; 12 import com.zteits.oa.api.dto.asradaily.param.AsraDailyQueryReq;
14 import com.zteits.oa.report.dao.AsraDailyDao; 13 import com.zteits.oa.report.dao.AsraDailyDao;
15 import com.zteits.oa.report.domain.AsraDaily; 14 import com.zteits.oa.report.domain.AsraDaily;
16 import com.zteits.oa.report.domain.AsraDailyExample; 15 import com.zteits.oa.report.domain.AsraDailyExample;
17 -import com.zteits.oa.report.domain.AsraOpRelations;  
18 -import com.zteits.oa.report.domain.AsraOpRelationsExample;  
19 import com.zteits.oa.report.domain.sdo.AsraDailyDO; 16 import com.zteits.oa.report.domain.sdo.AsraDailyDO;
20 import com.zteits.oa.report.domain.sdo.AsraDailyOpNumForCurrentDayDO; 17 import com.zteits.oa.report.domain.sdo.AsraDailyOpNumForCurrentDayDO;
21 import com.zteits.oa.report.mapper.AsraDailyMapper; 18 import com.zteits.oa.report.mapper.AsraDailyMapper;
@@ -72,21 +69,6 @@ public class AsraDailyDaoImpl implements AsraDailyDao{ @@ -72,21 +69,6 @@ public class AsraDailyDaoImpl implements AsraDailyDao{
72 AsraDailyOpNumForCurrentDayDO asraDailyOpNumForCurrentDayDO = new AsraDailyOpNumForCurrentDayDO(); 69 AsraDailyOpNumForCurrentDayDO asraDailyOpNumForCurrentDayDO = new AsraDailyOpNumForCurrentDayDO();
73 List<Long> opList = new ArrayList<>(); 70 List<Long> opList = new ArrayList<>();
74 int employeeTotal = 0; 71 int employeeTotal = 0;
75 -// //1.总人数获取  
76 -// AsraOpRelationsExample example = new AsraOpRelationsExample();  
77 -// example.createCriteria().andParentIdEqualTo(request.getOpId());  
78 -// //List<AsraOpRelations> selectByExample = asraOpRelationsMapper.selectByExample(example);  
79 -// int employeeTotal = (CollectionUtil.isNotEmpty(selectByExample) ? selectByExample.size() +1 : 1);  
80 -// asraDailyOpNumForCurrentDayDO.setEmployeeTotal(employeeTotal);  
81 -// //获取员工人数  
82 -// if(CollectionUtil.isNotEmpty(selectByExample)){  
83 -// for(AsraOpRelations op:selectByExample){  
84 -// if(op == null){  
85 -// continue;  
86 -// }  
87 -// opList.add(op.getOpId());  
88 -// }  
89 -// }  
90 opList.add(request.getOpId());//查询自己id 72 opList.add(request.getOpId());//查询自己id
91 //2.查询今日日报填写人数 73 //2.查询今日日报填写人数
92 AsraDailyExample exampleTwo = new AsraDailyExample(); 74 AsraDailyExample exampleTwo = new AsraDailyExample();
src/main/java/com/zteits/oa/report/domain/AsraOpRelations.java deleted
1 -package com.zteits.oa.report.domain;  
2 -  
3 -public class AsraOpRelations {  
4 - /**主键*/  
5 - private Long id;  
6 -  
7 - /**父级ID*/  
8 - private Long parentId;  
9 -  
10 - /**员工ID*/  
11 - private Long opId;  
12 -  
13 - /**数据状态:1有效,0无效,2:锁定*/  
14 - private Integer dataState;  
15 -  
16 - /**获取主键*/  
17 - public Long getId() {  
18 - return id;  
19 - }  
20 -  
21 - /**设置主键*/  
22 - public void setId(Long id) {  
23 - this.id = id;  
24 - }  
25 -  
26 - /**获取父级ID*/  
27 - public Long getParentId() {  
28 - return parentId;  
29 - }  
30 -  
31 - /**设置父级ID*/  
32 - public void setParentId(Long parentId) {  
33 - this.parentId = parentId;  
34 - }  
35 -  
36 - /**获取员工ID*/  
37 - public Long getOpId() {  
38 - return opId;  
39 - }  
40 -  
41 - /**设置员工ID*/  
42 - public void setOpId(Long opId) {  
43 - this.opId = opId;  
44 - }  
45 -  
46 - /**获取数据状态:1有效,0无效,2:锁定*/  
47 - public Integer getDataState() {  
48 - return dataState;  
49 - }  
50 -  
51 - /**设置数据状态:1有效,0无效,2:锁定*/  
52 - public void setDataState(Integer dataState) {  
53 - this.dataState = dataState;  
54 - }  
55 -}  
56 \ No newline at end of file 0 \ No newline at end of file
src/main/java/com/zteits/oa/report/domain/AsraOpRelationsExample.java deleted
1 -package com.zteits.oa.report.domain;  
2 -  
3 -import java.util.ArrayList;  
4 -import java.util.List;  
5 -  
6 -public class AsraOpRelationsExample {  
7 - protected String orderByClause;  
8 -  
9 - protected boolean distinct;  
10 -  
11 - protected List<Criteria> oredCriteria;  
12 -  
13 - public AsraOpRelationsExample() {  
14 - oredCriteria = new ArrayList<Criteria>();  
15 - }  
16 -  
17 - public void setOrderByClause(String orderByClause) {  
18 - this.orderByClause = orderByClause;  
19 - }  
20 -  
21 - public String getOrderByClause() {  
22 - return orderByClause;  
23 - }  
24 -  
25 - public void setDistinct(boolean distinct) {  
26 - this.distinct = distinct;  
27 - }  
28 -  
29 - public boolean isDistinct() {  
30 - return distinct;  
31 - }  
32 -  
33 - public List<Criteria> getOredCriteria() {  
34 - return oredCriteria;  
35 - }  
36 -  
37 - public void or(Criteria criteria) {  
38 - oredCriteria.add(criteria);  
39 - }  
40 -  
41 - public Criteria or() {  
42 - Criteria criteria = createCriteriaInternal();  
43 - oredCriteria.add(criteria);  
44 - return criteria;  
45 - }  
46 -  
47 - public Criteria createCriteria() {  
48 - Criteria criteria = createCriteriaInternal();  
49 - if (oredCriteria.size() == 0) {  
50 - oredCriteria.add(criteria);  
51 - }  
52 - return criteria;  
53 - }  
54 -  
55 - protected Criteria createCriteriaInternal() {  
56 - Criteria criteria = new Criteria();  
57 - return criteria;  
58 - }  
59 -  
60 - public void clear() {  
61 - oredCriteria.clear();  
62 - orderByClause = null;  
63 - distinct = false;  
64 - }  
65 -  
66 - protected abstract static class GeneratedCriteria {  
67 - protected List<Criterion> criteria;  
68 -  
69 - protected GeneratedCriteria() {  
70 - super();  
71 - criteria = new ArrayList<Criterion>();  
72 - }  
73 -  
74 - public boolean isValid() {  
75 - return criteria.size() > 0;  
76 - }  
77 -  
78 - public List<Criterion> getAllCriteria() {  
79 - return criteria;  
80 - }  
81 -  
82 - public List<Criterion> getCriteria() {  
83 - return criteria;  
84 - }  
85 -  
86 - protected void addCriterion(String condition) {  
87 - if (condition == null) {  
88 - throw new RuntimeException("Value for condition cannot be null");  
89 - }  
90 - criteria.add(new Criterion(condition));  
91 - }  
92 -  
93 - protected void addCriterion(String condition, Object value, String property) {  
94 - if (value == null) {  
95 - throw new RuntimeException("Value for " + property + " cannot be null");  
96 - }  
97 - criteria.add(new Criterion(condition, value));  
98 - }  
99 -  
100 - protected void addCriterion(String condition, Object value1, Object value2, String property) {  
101 - if (value1 == null || value2 == null) {  
102 - throw new RuntimeException("Between values for " + property + " cannot be null");  
103 - }  
104 - criteria.add(new Criterion(condition, value1, value2));  
105 - }  
106 -  
107 - public Criteria andIdIsNull() {  
108 - addCriterion("id is null");  
109 - return (Criteria) this;  
110 - }  
111 -  
112 - public Criteria andIdIsNotNull() {  
113 - addCriterion("id is not null");  
114 - return (Criteria) this;  
115 - }  
116 -  
117 - public Criteria andIdEqualTo(Long value) {  
118 - addCriterion("id =", value, "id");  
119 - return (Criteria) this;  
120 - }  
121 -  
122 - public Criteria andIdNotEqualTo(Long value) {  
123 - addCriterion("id <>", value, "id");  
124 - return (Criteria) this;  
125 - }  
126 -  
127 - public Criteria andIdGreaterThan(Long value) {  
128 - addCriterion("id >", value, "id");  
129 - return (Criteria) this;  
130 - }  
131 -  
132 - public Criteria andIdGreaterThanOrEqualTo(Long value) {  
133 - addCriterion("id >=", value, "id");  
134 - return (Criteria) this;  
135 - }  
136 -  
137 - public Criteria andIdLessThan(Long value) {  
138 - addCriterion("id <", value, "id");  
139 - return (Criteria) this;  
140 - }  
141 -  
142 - public Criteria andIdLessThanOrEqualTo(Long value) {  
143 - addCriterion("id <=", value, "id");  
144 - return (Criteria) this;  
145 - }  
146 -  
147 - public Criteria andIdIn(List<Long> values) {  
148 - addCriterion("id in", values, "id");  
149 - return (Criteria) this;  
150 - }  
151 -  
152 - public Criteria andIdNotIn(List<Long> values) {  
153 - addCriterion("id not in", values, "id");  
154 - return (Criteria) this;  
155 - }  
156 -  
157 - public Criteria andIdBetween(Long value1, Long value2) {  
158 - addCriterion("id between", value1, value2, "id");  
159 - return (Criteria) this;  
160 - }  
161 -  
162 - public Criteria andIdNotBetween(Long value1, Long value2) {  
163 - addCriterion("id not between", value1, value2, "id");  
164 - return (Criteria) this;  
165 - }  
166 -  
167 - public Criteria andParentIdIsNull() {  
168 - addCriterion("parent_id is null");  
169 - return (Criteria) this;  
170 - }  
171 -  
172 - public Criteria andParentIdIsNotNull() {  
173 - addCriterion("parent_id is not null");  
174 - return (Criteria) this;  
175 - }  
176 -  
177 - public Criteria andParentIdEqualTo(Long value) {  
178 - addCriterion("parent_id =", value, "parentId");  
179 - return (Criteria) this;  
180 - }  
181 -  
182 - public Criteria andParentIdNotEqualTo(Long value) {  
183 - addCriterion("parent_id <>", value, "parentId");  
184 - return (Criteria) this;  
185 - }  
186 -  
187 - public Criteria andParentIdGreaterThan(Long value) {  
188 - addCriterion("parent_id >", value, "parentId");  
189 - return (Criteria) this;  
190 - }  
191 -  
192 - public Criteria andParentIdGreaterThanOrEqualTo(Long value) {  
193 - addCriterion("parent_id >=", value, "parentId");  
194 - return (Criteria) this;  
195 - }  
196 -  
197 - public Criteria andParentIdLessThan(Long value) {  
198 - addCriterion("parent_id <", value, "parentId");  
199 - return (Criteria) this;  
200 - }  
201 -  
202 - public Criteria andParentIdLessThanOrEqualTo(Long value) {  
203 - addCriterion("parent_id <=", value, "parentId");  
204 - return (Criteria) this;  
205 - }  
206 -  
207 - public Criteria andParentIdIn(List<Long> values) {  
208 - addCriterion("parent_id in", values, "parentId");  
209 - return (Criteria) this;  
210 - }  
211 -  
212 - public Criteria andParentIdNotIn(List<Long> values) {  
213 - addCriterion("parent_id not in", values, "parentId");  
214 - return (Criteria) this;  
215 - }  
216 -  
217 - public Criteria andParentIdBetween(Long value1, Long value2) {  
218 - addCriterion("parent_id between", value1, value2, "parentId");  
219 - return (Criteria) this;  
220 - }  
221 -  
222 - public Criteria andParentIdNotBetween(Long value1, Long value2) {  
223 - addCriterion("parent_id not between", value1, value2, "parentId");  
224 - return (Criteria) this;  
225 - }  
226 -  
227 - public Criteria andOpIdIsNull() {  
228 - addCriterion("op_id is null");  
229 - return (Criteria) this;  
230 - }  
231 -  
232 - public Criteria andOpIdIsNotNull() {  
233 - addCriterion("op_id is not null");  
234 - return (Criteria) this;  
235 - }  
236 -  
237 - public Criteria andOpIdEqualTo(Long value) {  
238 - addCriterion("op_id =", value, "opId");  
239 - return (Criteria) this;  
240 - }  
241 -  
242 - public Criteria andOpIdNotEqualTo(Long value) {  
243 - addCriterion("op_id <>", value, "opId");  
244 - return (Criteria) this;  
245 - }  
246 -  
247 - public Criteria andOpIdGreaterThan(Long value) {  
248 - addCriterion("op_id >", value, "opId");  
249 - return (Criteria) this;  
250 - }  
251 -  
252 - public Criteria andOpIdGreaterThanOrEqualTo(Long value) {  
253 - addCriterion("op_id >=", value, "opId");  
254 - return (Criteria) this;  
255 - }  
256 -  
257 - public Criteria andOpIdLessThan(Long value) {  
258 - addCriterion("op_id <", value, "opId");  
259 - return (Criteria) this;  
260 - }  
261 -  
262 - public Criteria andOpIdLessThanOrEqualTo(Long value) {  
263 - addCriterion("op_id <=", value, "opId");  
264 - return (Criteria) this;  
265 - }  
266 -  
267 - public Criteria andOpIdIn(List<Long> values) {  
268 - addCriterion("op_id in", values, "opId");  
269 - return (Criteria) this;  
270 - }  
271 -  
272 - public Criteria andOpIdNotIn(List<Long> values) {  
273 - addCriterion("op_id not in", values, "opId");  
274 - return (Criteria) this;  
275 - }  
276 -  
277 - public Criteria andOpIdBetween(Long value1, Long value2) {  
278 - addCriterion("op_id between", value1, value2, "opId");  
279 - return (Criteria) this;  
280 - }  
281 -  
282 - public Criteria andOpIdNotBetween(Long value1, Long value2) {  
283 - addCriterion("op_id not between", value1, value2, "opId");  
284 - return (Criteria) this;  
285 - }  
286 -  
287 - public Criteria andDataStateIsNull() {  
288 - addCriterion("data_state is null");  
289 - return (Criteria) this;  
290 - }  
291 -  
292 - public Criteria andDataStateIsNotNull() {  
293 - addCriterion("data_state is not null");  
294 - return (Criteria) this;  
295 - }  
296 -  
297 - public Criteria andDataStateEqualTo(Integer value) {  
298 - addCriterion("data_state =", value, "dataState");  
299 - return (Criteria) this;  
300 - }  
301 -  
302 - public Criteria andDataStateNotEqualTo(Integer value) {  
303 - addCriterion("data_state <>", value, "dataState");  
304 - return (Criteria) this;  
305 - }  
306 -  
307 - public Criteria andDataStateGreaterThan(Integer value) {  
308 - addCriterion("data_state >", value, "dataState");  
309 - return (Criteria) this;  
310 - }  
311 -  
312 - public Criteria andDataStateGreaterThanOrEqualTo(Integer value) {  
313 - addCriterion("data_state >=", value, "dataState");  
314 - return (Criteria) this;  
315 - }  
316 -  
317 - public Criteria andDataStateLessThan(Integer value) {  
318 - addCriterion("data_state <", value, "dataState");  
319 - return (Criteria) this;  
320 - }  
321 -  
322 - public Criteria andDataStateLessThanOrEqualTo(Integer value) {  
323 - addCriterion("data_state <=", value, "dataState");  
324 - return (Criteria) this;  
325 - }  
326 -  
327 - public Criteria andDataStateIn(List<Integer> values) {  
328 - addCriterion("data_state in", values, "dataState");  
329 - return (Criteria) this;  
330 - }  
331 -  
332 - public Criteria andDataStateNotIn(List<Integer> values) {  
333 - addCriterion("data_state not in", values, "dataState");  
334 - return (Criteria) this;  
335 - }  
336 -  
337 - public Criteria andDataStateBetween(Integer value1, Integer value2) {  
338 - addCriterion("data_state between", value1, value2, "dataState");  
339 - return (Criteria) this;  
340 - }  
341 -  
342 - public Criteria andDataStateNotBetween(Integer value1, Integer value2) {  
343 - addCriterion("data_state not between", value1, value2, "dataState");  
344 - return (Criteria) this;  
345 - }  
346 - }  
347 -  
348 - public static class Criteria extends GeneratedCriteria {  
349 -  
350 - protected Criteria() {  
351 - super();  
352 - }  
353 - }  
354 -  
355 - public static class Criterion {  
356 - private String condition;  
357 -  
358 - private Object value;  
359 -  
360 - private Object secondValue;  
361 -  
362 - private boolean noValue;  
363 -  
364 - private boolean singleValue;  
365 -  
366 - private boolean betweenValue;  
367 -  
368 - private boolean listValue;  
369 -  
370 - private String typeHandler;  
371 -  
372 - public String getCondition() {  
373 - return condition;  
374 - }  
375 -  
376 - public Object getValue() {  
377 - return value;  
378 - }  
379 -  
380 - public Object getSecondValue() {  
381 - return secondValue;  
382 - }  
383 -  
384 - public boolean isNoValue() {  
385 - return noValue;  
386 - }  
387 -  
388 - public boolean isSingleValue() {  
389 - return singleValue;  
390 - }  
391 -  
392 - public boolean isBetweenValue() {  
393 - return betweenValue;  
394 - }  
395 -  
396 - public boolean isListValue() {  
397 - return listValue;  
398 - }  
399 -  
400 - public String getTypeHandler() {  
401 - return typeHandler;  
402 - }  
403 -  
404 - protected Criterion(String condition) {  
405 - super();  
406 - this.condition = condition;  
407 - this.typeHandler = null;  
408 - this.noValue = true;  
409 - }  
410 -  
411 - protected Criterion(String condition, Object value, String typeHandler) {  
412 - super();  
413 - this.condition = condition;  
414 - this.value = value;  
415 - this.typeHandler = typeHandler;  
416 - if (value instanceof List<?>) {  
417 - this.listValue = true;  
418 - } else {  
419 - this.singleValue = true;  
420 - }  
421 - }  
422 -  
423 - protected Criterion(String condition, Object value) {  
424 - this(condition, value, null);  
425 - }  
426 -  
427 - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {  
428 - super();  
429 - this.condition = condition;  
430 - this.value = value;  
431 - this.secondValue = secondValue;  
432 - this.typeHandler = typeHandler;  
433 - this.betweenValue = true;  
434 - }  
435 -  
436 - protected Criterion(String condition, Object value, Object secondValue) {  
437 - this(condition, value, secondValue, null);  
438 - }  
439 - }  
440 -}  
441 \ No newline at end of file 0 \ No newline at end of file
src/main/java/com/zteits/oa/report/web/AsraOpController.java
1 package com.zteits.oa.report.web; 1 package com.zteits.oa.report.web;
2 2
3 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
4 -import com.xiaoleilu.hutool.util.CollectionUtil;  
5 import com.zteits.oa.api.base.bean.BizResult; 4 import com.zteits.oa.api.base.bean.BizResult;
6 import com.zteits.oa.api.base.bean.PageBean; 5 import com.zteits.oa.api.base.bean.PageBean;
7 import com.zteits.oa.api.base.constants.SessionEnum; 6 import com.zteits.oa.api.base.constants.SessionEnum;
8 import com.zteits.oa.api.dto.asraop.AsraOpDTO; 7 import com.zteits.oa.api.dto.asraop.AsraOpDTO;
9 import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq; 8 import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq;
10 -import com.zteits.oa.api.dto.asraoprelations.AsraOpRelationsDTO;  
11 -import com.zteits.oa.api.dto.asraoprelations.param.AsraOpRelationsQueryReq;  
12 import com.zteits.oa.api.service.report.query.AsraOpQueryService; 9 import com.zteits.oa.api.service.report.query.AsraOpQueryService;
13 -import com.zteits.oa.api.service.report.query.AsraOpRelationsQueryService;  
14 import com.zteits.oa.report.web.vo.EasyUIDataGridVO; 10 import com.zteits.oa.report.web.vo.EasyUIDataGridVO;
15 import io.swagger.annotations.Api; 11 import io.swagger.annotations.Api;
16 import org.slf4j.Logger; 12 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory; 13 import org.slf4j.LoggerFactory;
18 import org.springframework.beans.factory.annotation.Autowired; 14 import org.springframework.beans.factory.annotation.Autowired;
19 -import org.springframework.cglib.core.CollectionUtils;  
20 import org.springframework.web.bind.annotation.RequestBody; 15 import org.springframework.web.bind.annotation.RequestBody;
21 import org.springframework.web.bind.annotation.RequestMapping; 16 import org.springframework.web.bind.annotation.RequestMapping;
22 import org.springframework.web.bind.annotation.RequestMethod; 17 import org.springframework.web.bind.annotation.RequestMethod;
23 import org.springframework.web.bind.annotation.RestController; 18 import org.springframework.web.bind.annotation.RestController;
24 19
25 import javax.servlet.http.HttpServletRequest; 20 import javax.servlet.http.HttpServletRequest;
26 -import javax.servlet.http.HttpSession;  
27 -import java.util.ArrayList;  
28 -import java.util.List;  
29 21
30 @Api(value = "日报系统-员工管理", description = "日报系统-员工管理") 22 @Api(value = "日报系统-员工管理", description = "日报系统-员工管理")
31 @RestController 23 @RestController
@@ -38,15 +30,12 @@ public class AsraOpController extends BizController { @@ -38,15 +30,12 @@ public class AsraOpController extends BizController {
38 private AsraOpQueryService asraOpQueryService; 30 private AsraOpQueryService asraOpQueryService;
39 31
40 32
41 -  
42 -  
43 -  
44 @RequestMapping(value="/queryAsraOpPage",method = RequestMethod.POST) 33 @RequestMapping(value="/queryAsraOpPage",method = RequestMethod.POST)
45 public BizResult<EasyUIDataGridVO<AsraOpDTO>> queryAsraOpPage(@RequestBody AsraOpQueryReq asraOpQueryReq, HttpServletRequest request) throws IllegalAccessException, InstantiationException { 34 public BizResult<EasyUIDataGridVO<AsraOpDTO>> queryAsraOpPage(@RequestBody AsraOpQueryReq asraOpQueryReq, HttpServletRequest request) throws IllegalAccessException, InstantiationException {
46 logger.info("日报系统-员工管理-根据登录人分页查询员工信息入参:{}", JSONObject.toJSON(asraOpQueryReq)); 35 logger.info("日报系统-员工管理-根据登录人分页查询员工信息入参:{}", JSONObject.toJSON(asraOpQueryReq));
47 /**1.根据当前登录人查询登录人下面管理的员工-缓存中获取*/ 36 /**1.根据当前登录人查询登录人下面管理的员工-缓存中获取*/
48 AsraOpDTO asraOpDTO = (AsraOpDTO)request.getSession().getAttribute(SessionEnum.USER_INFO.key()); 37 AsraOpDTO asraOpDTO = (AsraOpDTO)request.getSession().getAttribute(SessionEnum.USER_INFO.key());
49 - asraOpQueryReq.setId(asraOpDTO.getId()); 38 + asraOpQueryReq.setOpIdLists(asraOpDTO.getOpIds());
50 BizResult<PageBean<AsraOpDTO>> result = asraOpQueryService.queryAsraOpForPage(asraOpQueryReq); 39 BizResult<PageBean<AsraOpDTO>> result = asraOpQueryService.queryAsraOpForPage(asraOpQueryReq);
51 logger.info("日报系统-员工管理-根据登录人分页查询员工信息结果:{}", JSONObject.toJSON(result)); 40 logger.info("日报系统-员工管理-根据登录人分页查询员工信息结果:{}", JSONObject.toJSON(result));
52 return returnJqGridData(result, AsraOpDTO.class); 41 return returnJqGridData(result, AsraOpDTO.class);
src/main/java/com/zteits/oa/report/web/OAuthController.java
@@ -6,6 +6,8 @@ import java.util.List; @@ -6,6 +6,8 @@ import java.util.List;
6 import javax.servlet.http.HttpServletRequest; 6 import javax.servlet.http.HttpServletRequest;
7 import javax.servlet.http.HttpSession; 7 import javax.servlet.http.HttpSession;
8 8
  9 +import com.xiaoleilu.hutool.util.CollectionUtil;
  10 +import com.zteits.oa.api.base.bean.PageBean;
9 import org.slf4j.Logger; 11 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory; 12 import org.slf4j.LoggerFactory;
11 import org.springframework.beans.factory.annotation.Autowired; 13 import org.springframework.beans.factory.annotation.Autowired;
@@ -92,8 +94,10 @@ public class OAuthController { @@ -92,8 +94,10 @@ public class OAuthController {
92 94
93 List<Long> opIds = new ArrayList<>(); 95 List<Long> opIds = new ArrayList<>();
94 opIds.add(asraOpDTO.getId()); 96 opIds.add(asraOpDTO.getId());
  97 + List<Long> opParentIds = new ArrayList<>();
  98 + opParentIds.add(asraOpDTO.getId());
95 /**递归查询员工ids.*/ 99 /**递归查询员工ids.*/
96 - opIds = queryOpTreeByOpId(asraOpDTO.getParentId(),opIds); 100 + opIds = queryOpTreeByOpId(opParentIds,opIds);
97 logger.info("---获取到的opIds={}",JSONObject.toJSON(opIds)); 101 logger.info("---获取到的opIds={}",JSONObject.toJSON(opIds));
98 asraOpDTO.setOpIds(opIds); 102 asraOpDTO.setOpIds(opIds);
99 HttpSession session = request.getSession(); 103 HttpSession session = request.getSession();
@@ -115,7 +119,7 @@ public class OAuthController { @@ -115,7 +119,7 @@ public class OAuthController {
115 } 119 }
116 /** 120 /**
117 * 退出登录 121 * 退出登录
118 - * @param req 122 + * @param
119 * @return 123 * @return
120 * 2018年7月31日 wangfs.<br/> 124 * 2018年7月31日 wangfs.<br/>
121 */ 125 */
@@ -135,27 +139,35 @@ public class OAuthController { @@ -135,27 +139,35 @@ public class OAuthController {
135 139
136 /** 140 /**
137 * 递归查询员工id.<br/> 141 * 递归查询员工id.<br/>
138 - * @param parentOpId 142 + * @param
139 * @param opList 143 * @param opList
140 * @return 144 * @return
141 * 2018年8月2日 wangfs.<br/> 145 * 2018年8月2日 wangfs.<br/>
142 */ 146 */
143 - private List<Long> queryOpTreeByOpId(Long parentOpId,List<Long> opList){  
144 - if(parentOpId != null && !parentOpId.equals(-1L)){ 147 + private List<Long> queryOpTreeByOpId(List<Long> queryOpList,List<Long> opList){
  148 + if(queryOpList != null && CollectionUtil.isNotEmpty(queryOpList)){
145 AsraOpQueryReq asraOpQueryRe = new AsraOpQueryReq(); 149 AsraOpQueryReq asraOpQueryRe = new AsraOpQueryReq();
146 - asraOpQueryRe.setId(parentOpId);  
147 - BizResult<AsraOpDTO> asraOpReult = asraOpQueryService.queryAsraOp(asraOpQueryRe); 150 + asraOpQueryRe.setOpParentIdLists(queryOpList);
  151 + asraOpQueryRe.getBaseRequest().setPageNum(1);
  152 + asraOpQueryRe.getBaseRequest().setPageSize(0);
  153 + BizResult<PageBean<AsraOpDTO>> asraOpReult = asraOpQueryService.queryAsraOpForPage(asraOpQueryRe);
148 if(asraOpReult != null && asraOpReult.getData() != null){ 154 if(asraOpReult != null && asraOpReult.getData() != null){
149 - AsraOpDTO data = asraOpReult.getData();  
150 - if(data != null){  
151 - opList.add(data.getId()); 155 + queryOpList.clear();
  156 + List<AsraOpDTO> data = asraOpReult.getData().getDataList();
  157 + if(CollectionUtil.isNotEmpty(data)){
  158 + for(AsraOpDTO dto:data){
  159 + queryOpList.add(dto.getId());
  160 + opList.add(dto.getId());
  161 + }
152 } 162 }
153 - queryOpTreeByOpId(data.getParentId(),opList); 163 + queryOpTreeByOpId(queryOpList,opList);
154 } 164 }
155 } 165 }
156 -  
157 return opList; 166 return opList;
158 } 167 }
159 - 168 +
  169 +
  170 +
  171 +
160 172
161 } 173 }
src/main/resources/mybatis/smapper/AsraOpSmapper.xml
@@ -19,43 +19,43 @@ @@ -19,43 +19,43 @@
19 <result column="modfiy_emp_name" jdbcType="VARCHAR" property="modfiyEmpName" /> 19 <result column="modfiy_emp_name" jdbcType="VARCHAR" property="modfiyEmpName" />
20 <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" /> 20 <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
21 <result column="remark" jdbcType="VARCHAR" property="remark" /> 21 <result column="remark" jdbcType="VARCHAR" property="remark" />
  22 + <result column="parent_id" jdbcType="BIGINT" property="parentId" />
22 </resultMap> 23 </resultMap>
23 <sql id="Base_Column_List"> 24 <sql id="Base_Column_List">
24 - id, login_code, login_password, op_name, email, role_id, city_id, city_name,  
25 - is_remind_email, data_state, create_empid, create_emp_name, create_date, modfiy_empid,  
26 - modfiy_emp_name, modfiy_date, remark 25 + id, login_code, login_password, op_name, email, role_id, city_id, city_name, is_remind_email,
  26 + data_state, create_empid, create_emp_name, create_date, modfiy_empid, modfiy_emp_name,
  27 + modfiy_date, remark, parent_id
27 </sql> 28 </sql>
28 29
29 - <select id="queryAsraOpForList" parameterType="com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq" resultType="com.zteits.oa.api.dto.asraop.AsraOpDTO"> 30 + <select id="queryAsraOpForList" parameterType="com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq" resultMap="BaseResultMap">
30 select 31 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 left join asra_op_relations apr on ap.id = apr.op_id 32 + <include refid="Base_Column_List" />
  33 + from asra_op
40 where 1=1 34 where 1=1
41 <if test="id != null "> 35 <if test="id != null ">
42 - and (apr.parent_id = #{id} or ap.id = #{id}) 36 + id = #{id}
43 </if> 37 </if>
44 <if test="loginCode != null and loginCode !=''"> 38 <if test="loginCode != null and loginCode !=''">
45 - and ap.login_code = #{loginCode,jdbcType=VARCHAR} 39 + and login_code = #{loginCode,jdbcType=VARCHAR}
46 </if> 40 </if>
47 <if test="opName != null and opName != ''"> 41 <if test="opName != null and opName != ''">
48 - and ap.op_name like concat('%','${opName}','%') 42 + and op_name like concat('%','${opName}','%')
49 </if> 43 </if>
50 <if test="email != null and email != ''"> 44 <if test="email != null and email != ''">
51 - and ap.email = #{email,jdbcType=VARCHAR} 45 + and email = #{email,jdbcType=VARCHAR}
52 </if> 46 </if>
53 <if test="opIdLists != null"> 47 <if test="opIdLists != null">
54 - and ap.id in 48 + and id in
55 <foreach collection="opIdLists" item="opId" open="(" close=")" separator="," > 49 <foreach collection="opIdLists" item="opId" open="(" close=")" separator="," >
56 #{opId} 50 #{opId}
57 </foreach> 51 </foreach>
58 </if> 52 </if>
  53 + <if test="opParentIdLists != null">
  54 + and parent_id in
  55 + <foreach collection="opParentIdLists" item="opId" open="(" close=")" separator="," >
  56 + #{opId}
  57 + </foreach>
  58 + </if>
59 </select> 59 </select>
60 60
61 </mapper> 61 </mapper>
62 \ No newline at end of file 62 \ No newline at end of file