Blame view

src/main/java/com/zteits/oa/report/biz/AsraOpQueryServiceImpl.java 3.29 KB
1b9e8898   王富生   提交
1
2
  package com.zteits.oa.report.biz;
  
b1704d7c   王富生   提交
3
4
5
  import java.util.ArrayList;
  import java.util.List;
  
1b9e8898   王富生   提交
6
7
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
900781d3   王富生   提交
8
  import org.springframework.beans.BeanUtils;
1b9e8898   王富生   提交
9
10
11
12
13
14
15
16
17
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Service;
  
  import com.alibaba.fastjson.JSONObject;
  import com.github.pagehelper.PageInfo;
  import com.zteits.oa.api.base.bean.BizResult;
  import com.zteits.oa.api.base.bean.PageBean;
  import com.zteits.oa.api.dto.asraop.AsraOpDTO;
  import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq;
2f6df64b   xiejianpeng   员工管理
18
  import com.zteits.oa.api.service.report.query.AsraOpQueryService;
1b9e8898   王富生   提交
19
20
  import com.zteits.oa.report.dao.AsraOpDao;
  import com.zteits.oa.report.domain.AsraOp;
b1704d7c   王富生   提交
21
  import com.zteits.oa.util.ListCopyUtil;
1b9e8898   王富生   提交
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  import com.zteits.oa.util.pagepaper.PageBeanUtil;
  /**
   * 工时系统操作员实现类.<br/>
   * 
   * Copyright: Copyright (c) 2017  ZTE-ITS
   * 
   * @ClassName: AmountUtils.java
   * @Description: 
   * @version: v1.0.0
   * @author: wangfs
   * @date: 2018730
   * Modification History:
   * Date             Author          Version            Description
   *---------------------------------------------------------*
   * 2018730      wangfs           v1.0.0               创建
   */
b1704d7c   王富生   提交
38
  @Service("com.zteits.oa.report.biz.AsraOpQueryServiceImpl")
2f6df64b   xiejianpeng   员工管理
39
  public class AsraOpQueryServiceImpl implements AsraOpQueryService {
1b9e8898   王富生   提交
40
  
2f6df64b   xiejianpeng   员工管理
41
  	private static final Logger logger = LoggerFactory.getLogger(AsraOpQueryServiceImpl.class);
1b9e8898   王富生   提交
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
  	@Autowired
  	private AsraOpDao asraOpDao;
  	/**
  	 * 分页查询工时系统员工信息.<br/>
  	 * @param asraOpQueryReq
  	 * @return
  	 * 2018730  wangfs.<br/>
  	 */
  	@Override
  	public BizResult<PageBean<AsraOpDTO>> queryAsraOpForPage(AsraOpQueryReq asraOpQueryReq) {
  		logger.info("---begin查询分页员工信息..入参={}",JSONObject.toJSON(asraOpQueryReq));
  		PageBean<AsraOpDTO> pageBean = new PageBean<AsraOpDTO>();
  		PageInfo<AsraOp> pageInfo = asraOpDao.queryAsraOpForPage(asraOpQueryReq);
  		PageBeanUtil.copyProperties(pageInfo, pageBean, AsraOpDTO.class);
  		logger.info("---end查询分页员工信息..");
  		return new BizResult<PageBean<AsraOpDTO>>(pageBean);
  	}
900781d3   王富生   提交
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
  	/**
  	 * 获取员工信息.<br/>
  	 * @param asraOpQueryRe
  	 * @return
  	 * 2018731  wangfs.<br/>
  	 */
  	@Override
  	public BizResult<AsraOpDTO> queryAsraOp(AsraOpQueryReq asraOpQueryRe) {
  		AsraOpDTO asraOpDTO = new AsraOpDTO();
  		AsraOp queryAsraOp = asraOpDao.queryAsraOp(asraOpQueryRe);
  		if(queryAsraOp != null){
  			BeanUtils.copyProperties(queryAsraOp, asraOpDTO);
  		}
  		return new BizResult<AsraOpDTO>(asraOpDTO);
  	}
1b9e8898   王富生   提交
74
  
2f6df64b   xiejianpeng   员工管理
75
76
77
78
79
80
81
82
83
  
  	@Override
  	public BizResult<AsraOpDTO> queryAsraOpByLoginCode(AsraOpQueryReq asraOpQueryReq) {
  		AsraOpDTO asraOpDTO = new AsraOpDTO();
  		AsraOp asraOp = asraOpDao.queryAsraOpByLoginCode(asraOpQueryReq.getLoginCode());
  		BeanUtils.copyProperties(asraOp,asraOpDTO);
  		return new BizResult<>(asraOpDTO);
  	}
  
b1704d7c   王富生   提交
84
85
86
87
88
89
90
91
92
93
94
95
96
97
  	/**
  	 * 通过员工父级Id获取员工信息.<br/>
  	 * @param asraOpQueryRe
  	 * @return
  	 * 2018731  wangfs.<br/>
  	 */
  	@Override
  	public BizResult<List<AsraOpDTO>> queryAsraOpByParentId(AsraOpQueryReq asraOpQueryRe) {
  		List<AsraOpDTO> listDTO = new ArrayList<>();
  		List<AsraOp> list = asraOpDao.queryAsraOpByParentId(asraOpQueryRe);
  		ListCopyUtil.listCopyProperties(list, listDTO, AsraOpDTO.class);
  		return new BizResult<List<AsraOpDTO>>(listDTO);
  	}
  
1b9e8898   王富生   提交
98
  }