SysCodeServiceImpl.java
2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.zteits.sys.biz;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.apache.commons.lang3.StringUtils;
import com.alibaba.fastjson.JSONObject;
import com.zteits.clouds.api.apibase.bean.BizResult;
import com.zteits.clouds.api.apibase.constants.ErrorType;
import com.zteits.clouds.api.apibase.exception.BizException;
import com.zteits.clouds.api.dto.sys.SysCodeDTO;
import com.zteits.clouds.api.dto.sys.param.SysCodeQueryRequest;
import com.zteits.clouds.api.service.sys.SysCodeService;
import com.zteits.sys.dao.SysCodeDao;
import com.zteits.sys.domain.SysCode;
/**
* 系统编码dubbo服务实现类
*
* Copyright: Copyright (c) 2017 zteits
*
* @ClassName: SysCodeServiceImpl.java
* @Description:
* @version: v1.0.0
* @author: langlw
* @date: 2017年8月11日 上午10:40:33
* Modification History:
* Date Author Version Description
*---------------------------------------------------------*
* 2017年8月11日 langlw v1.0.0 创建
*/
@Service("com.zteits.sys.biz.SysCodeServiceImpl")
public class SysCodeServiceImpl implements SysCodeService {
private static final Logger logger=LoggerFactory.getLogger(SysCodeServiceImpl.class);
@Autowired
private SysCodeDao sysCodeDao;
@Override
public BizResult<SysCodeDTO> querySysBySysCode(SysCodeQueryRequest sysCodeQueryRequest){
if(sysCodeQueryRequest==null || StringUtils.isEmpty(sysCodeQueryRequest.getSysCode())){
throw new BizException(ErrorType.BIZ_ERROR, "系统编码入参不能为空");
}
SysCodeDTO sysCodeDTO=new SysCodeDTO();
SysCode sysCode=sysCodeDao.selectSysBySysCode(sysCodeQueryRequest.getSysCode());
if(null != sysCode){
BeanUtils.copyProperties(sysCode, sysCodeDTO);
logger.info("调用dubbo服务 返回sysCodeDTO={}"+JSONObject.toJSONString(sysCodeDTO));
}
return new BizResult<>(sysCodeDTO);
}
}