Blame view

src/main/java/com/zteits/oa/report/web/AsraOpController.java 3.17 KB
a68c5698   xiejianpeng   员工管理
1
  package com.zteits.oa.report.web;
159eaad1   王富生   集成swagger
2
  
2f6df64b   xiejianpeng   员工管理
3
4
  import com.alibaba.fastjson.JSONObject;
  import com.xiaoleilu.hutool.util.CollectionUtil;
1b9e8898   王富生   提交
5
6
  import com.zteits.oa.api.base.bean.BizResult;
  import com.zteits.oa.api.base.bean.PageBean;
7deb21f3   xiejianpeng   员工管理
7
  import com.zteits.oa.api.base.constants.SessionEnum;
1b9e8898   王富生   提交
8
9
  import com.zteits.oa.api.dto.asraop.AsraOpDTO;
  import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq;
2f6df64b   xiejianpeng   员工管理
10
11
12
13
  import com.zteits.oa.api.dto.asraoprelations.AsraOpRelationsDTO;
  import com.zteits.oa.api.dto.asraoprelations.param.AsraOpRelationsQueryReq;
  import com.zteits.oa.api.service.report.query.AsraOpQueryService;
  import com.zteits.oa.api.service.report.query.AsraOpRelationsQueryService;
159eaad1   王富生   集成swagger
14
  import io.swagger.annotations.Api;
2f6df64b   xiejianpeng   员工管理
15
16
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
a68c5698   xiejianpeng   员工管理
17
  import org.springframework.beans.factory.annotation.Autowired;
2f6df64b   xiejianpeng   员工管理
18
  import org.springframework.cglib.core.CollectionUtils;
a68c5698   xiejianpeng   员工管理
19
20
21
22
23
24
  import org.springframework.web.bind.annotation.RequestBody;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RestController;
  
  import javax.servlet.http.HttpServletRequest;
7deb21f3   xiejianpeng   员工管理
25
  import javax.servlet.http.HttpSession;
2f6df64b   xiejianpeng   员工管理
26
27
  import java.util.ArrayList;
  import java.util.List;
159eaad1   王富生   集成swagger
28
  
a68c5698   xiejianpeng   员工管理
29
  @Api(value = "日报系统-员工管理", description = "日报系统-员工管理")
159eaad1   王富生   集成swagger
30
  @RestController
a68c5698   xiejianpeng   员工管理
31
32
33
  @RequestMapping("/asraOp")
  public class AsraOpController {
  
2f6df64b   xiejianpeng   员工管理
34
35
36
37
38
  	private static final Logger logger = LoggerFactory.getLogger(AsraOpController.class);
  
  	@Autowired
  	private AsraOpQueryService asraOpQueryService;
  
1b9e8898   王富生   提交
39
  	@Autowired
2f6df64b   xiejianpeng   员工管理
40
41
42
43
44
  	private AsraOpRelationsQueryService asraOpRelationsQueryService;
  
  
  
  
159eaad1   王富生   集成swagger
45
  	
a68c5698   xiejianpeng   员工管理
46
47
  	@RequestMapping(value="/queryAsraOpPage",method = RequestMethod.POST)
  	public BizResult<PageBean<AsraOpDTO>> queryAsraOpPage(@RequestBody AsraOpQueryReq asraOpQueryReq, HttpServletRequest request){
2f6df64b   xiejianpeng   员工管理
48
49
  		logger.info("日报系统-员工管理-根据登录人分页查询员工信息入参:{}", JSONObject.toJSON(asraOpQueryReq));
  		/**1.根据当前登录人查询登录人下面管理的员工-缓存中获取*/
7deb21f3   xiejianpeng   员工管理
50
  		AsraOpDTO asraOpDTO = (AsraOpDTO)request.getSession().getAttribute(SessionEnum.USER_INFO.key());
2f6df64b   xiejianpeng   员工管理
51
  
9dc8e4e6   xiejianpeng   员工管理
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
  //		/**2.判断登录人是领导还是员工 ,2:员工,1:领导*/
  //		List<Long> opIdLists = new ArrayList<>();
  //		opIdLists.add(asraOpDTO.getId());
  //		if(asraOpDTO.getRoleId() == 1){
  //			/**如果是领导,获取领导下面的员工信息*/
  //			AsraOpRelationsQueryReq asraOpRelationsQueryReq = new AsraOpRelationsQueryReq();
  //			asraOpRelationsQueryReq.setParentId(asraOpDTO.getId());
  //			BizResult<List<AsraOpRelationsDTO>> listBizResult = asraOpRelationsQueryService.queryAsraOpRelations(asraOpRelationsQueryReq);
  //			if(listBizResult.isSuccess() && CollectionUtil.isNotEmpty(listBizResult.getData())){
  //				for(AsraOpRelationsDTO asraOpRelationsDTO : listBizResult.getData()){
  //					opIdLists.add(asraOpRelationsDTO.getOpId());
  //				}
  //			}
  //		}
  //		asraOpQueryReq.setOpIdLists(opIdLists);
  		asraOpQueryReq.setId(asraOpDTO.getId());
2f6df64b   xiejianpeng   员工管理
68
69
  		BizResult<PageBean<AsraOpDTO>>  result = asraOpQueryService.queryAsraOpForPage(asraOpQueryReq);
  		logger.info("日报系统-员工管理-根据登录人分页查询员工信息结果:{}", JSONObject.toJSON(result));
1b9e8898   王富生   提交
70
  		return result;
159eaad1   王富生   集成swagger
71
72
73
  	}
  
  }