Commit 1b9e8898fd237f3e15806854058ee636d3208deb

Authored by 王富生
1 parent af4b39db

提交

Showing 26 changed files with 1774 additions and 5 deletions
src/main/java/com/zteits/oa/api/base/bean/AppBaseRequest.java 0 → 100644
  1 +package com.zteits.oa.api.base.bean;
  2 +
  3 +/**
  4 + *
  5 + *
  6 + * Copyright: Copyright (c) 2017 ZTE-ITS
  7 + *
  8 + * @ClassName: AppBaseRequest.java
  9 + * @Description:
  10 + * @version: v1.0.0
  11 + * @author: wangbiao
  12 + * @date: 2017年9月14日 下午12:01:36
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + *---------------------------------------------------------*
  16 + * 2017年9月14日 wangbiao v1.0.0 创建
  17 + */
  18 +public class AppBaseRequest extends BaseInfo {
  19 +
  20 +
  21 + private String app_id;//平台分配的app_id
  22 + private String salt;//随机数生成的盐值
  23 + private String deviceInfo;//设备唯一编号
  24 + private String sign_type;//签名的摘要算法
  25 + private String sign;//签名
  26 + private String token;
  27 + private String sysCode;
  28 +
  29 +
  30 + public String getSysCode() {
  31 + return sysCode;
  32 + }
  33 + public void setSysCode(String sysCode) {
  34 + this.sysCode = sysCode;
  35 + }
  36 + public String getApp_id() {
  37 + return app_id;
  38 + }
  39 + public void setApp_id(String app_id) {
  40 + this.app_id = app_id;
  41 + }
  42 + public String getSalt() {
  43 + return salt;
  44 + }
  45 + public void setSalt(String salt) {
  46 + this.salt = salt;
  47 + }
  48 + public String getDeviceInfo() {
  49 + return deviceInfo;
  50 + }
  51 + public void setDeviceInfo(String deviceInfo) {
  52 + this.deviceInfo = deviceInfo;
  53 + }
  54 + public String getSign_type() {
  55 + return sign_type;
  56 + }
  57 + public void setSign_type(String sign_type) {
  58 + this.sign_type = sign_type;
  59 + }
  60 + public String getSign() {
  61 + return sign;
  62 + }
  63 + public void setSign(String sign) {
  64 + this.sign = sign;
  65 + }
  66 + public String getToken() {
  67 + return token;
  68 + }
  69 + public void setToken(String token) {
  70 + this.token = token;
  71 + }
  72 +
  73 +}
src/main/java/com/zteits/oa/api/base/bean/BaiscDTO.java 0 → 100644
  1 +package com.zteits.oa.api.base.bean;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +public class BaiscDTO implements Serializable{
  6 +
  7 + /**
  8 + *
  9 + */
  10 + private static final long serialVersionUID = 5502485571704282738L;
  11 +
  12 +
  13 +
  14 +
  15 +
  16 +
  17 +}
src/main/java/com/zteits/oa/api/base/bean/BaseInfo.java 0 → 100644
  1 +package com.zteits.oa.api.base.bean;
  2 +
  3 +import java.io.Serializable;
  4 +import java.util.UUID;
  5 +
  6 +public class BaseInfo implements Serializable {
  7 +
  8 + private static final long serialVersionUID = -189054095924156774L;
  9 +
  10 + /**
  11 + * 请求编号,全局唯一,必须给
  12 + */
  13 + private String requestId;
  14 +
  15 + /**
  16 + * 调用本次业务的请求编号,全局唯一,必须给
  17 + */
  18 + private String preRequestId;
  19 +
  20 + /**
  21 + * 当前页.
  22 + */
  23 + private int pageNum = 0;
  24 +
  25 + /**
  26 + * 每页的数量.
  27 + */
  28 + private int pageSize = 10;
  29 +
  30 + public BaseInfo() {
  31 + super();
  32 + }
  33 +
  34 + public BaseInfo(int pageNum, int pageSize) {
  35 + super();
  36 + this.pageNum = pageNum;
  37 + this.pageSize = pageSize;
  38 + }
  39 +
  40 + public String getRequestId() {
  41 + if (requestId == null || requestId == "") {
  42 + requestId = UUID.randomUUID().toString().toUpperCase().replace("-", "");
  43 + }
  44 + return requestId;
  45 +
  46 + }
  47 +
  48 + public void setPreRequestId(String preRequestId) {
  49 + this.preRequestId = preRequestId;
  50 + }
  51 +
  52 + public void setRequestId(String requestId) {
  53 + this.requestId = requestId;
  54 + }
  55 +
  56 + public int getPageNum() {
  57 + return pageNum;
  58 + }
  59 +
  60 + public int getPageSize() {
  61 + return pageSize;
  62 + }
  63 +
  64 + public void setPageNum(int pageNum) {
  65 + this.pageNum = pageNum;
  66 + }
  67 +
  68 + public void setPageSize(int pageSize) {
  69 + this.pageSize = pageSize;
  70 + }
  71 +}
src/main/java/com/zteits/oa/api/base/bean/BaseRequest.java 0 → 100644
  1 +package com.zteits.oa.api.base.bean;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +/**
  6 + * 所有入参数父类.<br/>
  7 + *
  8 + * Copyright: Copyright (c) 2017 zteits
  9 + *
  10 + * @ClassName: BaseQuery.java
  11 + * @Description:
  12 + * @version: v1.0.0
  13 + * @author: wangfs
  14 + * @date: 2017年4月21日 上午10:56:03
  15 + * Modification History:
  16 + * Date Author Version Description
  17 + * ---------------------------------------------------------*
  18 + * 2017年4月21日 wangfs v1.0.0 创建
  19 + */
  20 +public class BaseRequest implements Serializable {
  21 +
  22 + private static final long serialVersionUID = -189054095924156774L;
  23 + /**
  24 + * 基本信息,baseRequest中需要存放的公共基础信息全部放到BaseInfo中
  25 + */
  26 + private BaseInfo baseRequest = new BaseInfo();
  27 +
  28 + /**系统编码,必须给 */
  29 + protected String sysCode;
  30 + /**
  31 + * 操作人ID
  32 + */
  33 + protected Long sOpId;
  34 + /**
  35 + * 操作人名称
  36 + */
  37 + protected String sOpName;
  38 +
  39 +
  40 +
  41 + public BaseRequest() {
  42 + super();
  43 + }
  44 +
  45 +
  46 + public BaseRequest(String sysCode) {
  47 + super();
  48 + this.sysCode = sysCode;
  49 + }
  50 +
  51 +
  52 + public BaseRequest(BaseInfo baseRequest, String sysCode) {
  53 + super();
  54 + this.baseRequest = baseRequest;
  55 + this.sysCode = sysCode;
  56 + }
  57 +
  58 + public BaseRequest(BaseInfo baseRequest) {
  59 + super();
  60 + this.baseRequest = baseRequest;
  61 + }
  62 +
  63 + public String getSysCode() {
  64 + return sysCode;
  65 + }
  66 +
  67 + public void setSysCode(String sysCode) {
  68 + this.sysCode = sysCode;
  69 + }
  70 +
  71 + public Long getsOpId() {
  72 + return sOpId;
  73 + }
  74 +
  75 + public void setsOpId(Long sOpId) {
  76 + this.sOpId = sOpId;
  77 + }
  78 +
  79 + public BaseInfo getBaseRequest() {
  80 + if (baseRequest == null) {
  81 + baseRequest = new BaseInfo();
  82 + }
  83 + return baseRequest;
  84 + }
  85 +
  86 + public void setBaseRequest(BaseInfo baseRequest) {
  87 + this.baseRequest = baseRequest;
  88 + }
  89 +
  90 + public String getsOpName() {
  91 + return sOpName;
  92 + }
  93 +
  94 + public void setsOpName(String sOpName) {
  95 + this.sOpName = sOpName;
  96 + }
  97 +
  98 + @Override
  99 + public String toString() {
  100 + return "BaseRequest{" +
  101 + "baseRequest=" + baseRequest +
  102 + ", sysCode='" + sysCode + '\'' +
  103 + ", " +
  104 + '}';
  105 + }
  106 +}
src/main/java/com/zteits/oa/api/base/bean/BizResult.java 0 → 100644
  1 +package com.zteits.oa.api.base.bean;
  2 +
  3 +import com.zteits.oa.api.base.constants.ErrorType;
  4 +
  5 +/**
  6 + * 统一返回结果集
  7 + *
  8 + * Copyright: Copyright (c) 2017 zteits
  9 + *
  10 + * @ClassName: BizResult.java
  11 + * @Description:
  12 + * @version: v1.0.0
  13 + * @author: liuzl
  14 + * @date: 2017年4月24日 下午6:17:24
  15 + * Modification History:
  16 + * Date Author Version Description
  17 + *---------------------------------------------------------*
  18 + * 2017年4月24日 liuzl v1.0.0 创建
  19 + */
  20 +public class BizResult<T> extends ResultBean<ErrorCode, T>{
  21 +
  22 + private static final long serialVersionUID = 1L;
  23 +
  24 + public BizResult() {
  25 + super();
  26 + }
  27 +
  28 + public BizResult(ErrorCode errType, String errMsg) {
  29 + super(errType, errMsg);
  30 + }
  31 +
  32 + public BizResult(ErrorType errType, String errMsg) {
  33 + super(errType, errMsg);
  34 + }
  35 +
  36 + public BizResult(ErrorType errType) {
  37 + super(errType);
  38 + }
  39 +
  40 + public BizResult(T data) {
  41 + super(data);
  42 + this.errCode=ErrorType.BIZ_SUCCESS;
  43 + this.errMsg = ErrorType.BIZ_SUCCESS.getMsg();
  44 +
  45 + }
  46 +
  47 + public BizResult(ErrorType errType, String errMsg, T data) {
  48 + super(errType, errMsg, data);
  49 + }
  50 +
  51 + public void setErrorInfo(ErrorType errType, String errMsg){
  52 + this.errCode = errType;
  53 + this.errMsg = errMsg;
  54 + this.success = false;
  55 + }
  56 +
  57 +}
src/main/java/com/zteits/oa/api/base/bean/ErrorCode.java 0 → 100644
  1 +package com.zteits.oa.api.base.bean;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +/**
  6 + * 错误编码公共接口
  7 + *
  8 + * Copyright: Copyright (c) 2017 zteits
  9 + *
  10 + * @ClassName: ErrorCode.java
  11 + * @Description:
  12 + * @version: v1.0.0
  13 + * @author: liuzl
  14 + * @date: 2017年4月24日 下午6:30:43
  15 + * Modification History:
  16 + * Date Author Version Description
  17 + *---------------------------------------------------------*
  18 + * 2017年4月24日 liuzl v1.0.0 创建
  19 + */
  20 +public interface ErrorCode extends Serializable{
  21 + /**
  22 + * 错误码
  23 + * @return
  24 + */
  25 + String getCode();
  26 + /**
  27 + * 错误信息
  28 + * @return
  29 + */
  30 + String getMsg();
  31 +}
src/main/java/com/zteits/oa/api/base/bean/PDABaseRequest.java 0 → 100644
  1 +package com.zteits.oa.api.base.bean;
  2 +
  3 +/**
  4 + * PDA请求头
  5 + *
  6 + * Copyright: Copyright (c) 2017 ZTE-ITS
  7 + *
  8 + * @ClassName: PDABaseRequest.java
  9 + * @version: v1.0.0
  10 + * @author: wangfei
  11 + * @date: 2017年9月18日
  12 + * Modification History:
  13 + * Date Author Version Description
  14 + *---------------------------------------------------------*
  15 + * 2017年9月18日 wangfei v1.0.0 创建
  16 + */
  17 +public class PDABaseRequest extends BaseInfo {
  18 +
  19 + private static final long serialVersionUID = -189054095924156774L;
  20 +
  21 + private String app_id;//平台分配的app_id
  22 + private String salt;//随机数生成的盐值
  23 + private String deviceInfo;//设备唯一编号
  24 + private String sign_type;//签名的摘要算法
  25 + private String sign;//签名
  26 + private String token;
  27 + private String sysCode;
  28 +
  29 +
  30 + public String getSysCode() {
  31 + return sysCode;
  32 + }
  33 + public void setSysCode(String sysCode) {
  34 + this.sysCode = sysCode;
  35 + }
  36 + public String getApp_id() {
  37 + return app_id;
  38 + }
  39 + public void setApp_id(String app_id) {
  40 + this.app_id = app_id;
  41 + }
  42 + public String getSalt() {
  43 + return salt;
  44 + }
  45 + public void setSalt(String salt) {
  46 + this.salt = salt;
  47 + }
  48 + public String getDeviceInfo() {
  49 + return deviceInfo;
  50 + }
  51 + public void setDeviceInfo(String deviceInfo) {
  52 + this.deviceInfo = deviceInfo;
  53 + }
  54 + public String getSign_type() {
  55 + return sign_type;
  56 + }
  57 + public void setSign_type(String sign_type) {
  58 + this.sign_type = sign_type;
  59 + }
  60 + public String getSign() {
  61 + return sign;
  62 + }
  63 + public void setSign(String sign) {
  64 + this.sign = sign;
  65 + }
  66 + public String getToken() {
  67 + return token;
  68 + }
  69 + public void setToken(String token) {
  70 + this.token = token;
  71 + }
  72 +
  73 +}
src/main/java/com/zteits/oa/api/base/bean/PageBean.java 0 → 100644
  1 +package com.zteits.oa.api.base.bean;
  2 +
  3 +
  4 +import java.io.Serializable;
  5 +import java.util.ArrayList;
  6 +import java.util.List;
  7 +
  8 +/**
  9 + * 分页查询结果分装PageInfo<T>.<br/>
  10 + *
  11 + * @author wangfs
  12 + * @param <T>
  13 + */
  14 +public class PageBean<T> implements Serializable {
  15 +
  16 +
  17 +
  18 + /**
  19 + *
  20 + */
  21 + private static final long serialVersionUID = -8295317993394764660L;
  22 + /** 数据. */
  23 + private List<T> dataList;
  24 + /** 当前页. */
  25 + private Integer pageNum;
  26 + /** 每页显示条数. */
  27 + private Integer pageSize;
  28 + /** 总条数. */
  29 + private Integer pageTotals;
  30 + /** 总页页数. */
  31 + private Integer pages;
  32 + /** 排序. */
  33 + private String orderBy;
  34 + /** 是否查询总条数 true:查询,false:不查询. */
  35 + private boolean isCount;
  36 + /** 当设置为true的时候,如果pagesize设置为0,就不执行分页,返回全部结果. */
  37 + private boolean pageSizeZero;
  38 + /** 是否查询成功. */
  39 + private boolean success;
  40 +
  41 + public PageBean() {
  42 +
  43 + }
  44 +
  45 + /**
  46 + *
  47 + * @param pageNo
  48 + * @param pageSize
  49 + */
  50 + public PageBean(Integer pageNum, Integer pageSize) {
  51 + if (pageNum == 1 && pageSize.equals(Integer.MAX_VALUE)) {
  52 + pageSize = 0;
  53 + }
  54 + this.pageNum = pageNum;
  55 + this.pageSize = pageSize;
  56 + }
  57 +
  58 + public boolean getPageSizeZero() {
  59 + return pageSizeZero;
  60 + }
  61 +
  62 + public void setPageSizeZero(boolean pageSizeZero) {
  63 + this.pageSizeZero = pageSizeZero;
  64 + }
  65 +
  66 + public boolean getSuccess() {
  67 + return success;
  68 + }
  69 +
  70 + public void setSuccess(boolean success) {
  71 + this.success = success;
  72 + }
  73 +
  74 + public List<T> getDataList() {
  75 + if(null == dataList){
  76 + dataList = new ArrayList<>();
  77 + }
  78 + return dataList;
  79 + }
  80 +
  81 + public void setDataList(List<T> dataList) {
  82 + this.dataList = dataList;
  83 + }
  84 +
  85 + public boolean getIsCount() {
  86 + return isCount;
  87 + }
  88 +
  89 + public void setIsCount(boolean isCount) {
  90 + this.isCount = isCount;
  91 + }
  92 +
  93 + public Integer getPageNum() {
  94 + return pageNum;
  95 + }
  96 +
  97 + public void setPageNum(Integer pageNum) {
  98 + if (pageNum < 0 || pageNum > Integer.MAX_VALUE) {
  99 + this.pageNum = 1;
  100 + }
  101 + this.pageNum = pageNum;
  102 + }
  103 +
  104 + public Integer getPageSize() {
  105 + return pageSize;
  106 + }
  107 +
  108 + public void setPageSize(Integer pageSize) {
  109 + this.pageSize = pageSize;
  110 + }
  111 +
  112 + public Integer getPageTotals() {
  113 + return pageTotals;
  114 + }
  115 +
  116 + public void setPageTotals(Integer pageTotals) {
  117 + this.pageTotals = pageTotals;
  118 + if (pageTotals == -1) {
  119 + this.pages = 1;
  120 + return;
  121 + }
  122 + if (this.pageSize > 0) {
  123 + this.pages = (int) (pageTotals / this.pageSize + ((pageTotals % this.pageSize == 0) ? 0 : 1));
  124 + } else {
  125 + this.pages = 0;
  126 + }
  127 + }
  128 +
  129 + public Integer getPages() {
  130 + return pages;
  131 + }
  132 +
  133 + public void setPages(Integer pages) {
  134 + this.pages = pages;
  135 + }
  136 +
  137 + public String getOrderBy() {
  138 + return orderBy;
  139 + }
  140 +
  141 + public void setOrderBy(String orderBy) {
  142 + this.orderBy = orderBy;
  143 + }
  144 +
  145 + @Override
  146 + public String toString() {
  147 + return "PageBean [dataList=" + dataList + ", pageNum=" + pageNum + ", pageSize=" + pageSize + ", pageTotals="
  148 + + pageTotals + ", pages=" + pages + ", orderBy=" + orderBy + ", isCount=" + isCount + ", pageSizeZero="
  149 + + pageSizeZero + ", success=" + success + "]";
  150 + }
  151 +
  152 +}
0 \ No newline at end of file 153 \ No newline at end of file
src/main/java/com/zteits/oa/api/base/bean/PageUtil.java 0 → 100644
  1 +package com.zteits.oa.api.base.bean;
  2 +
  3 +import com.zteits.oa.api.base.constants.PageSizeEnum;
  4 +
  5 +/**
  6 + * Copyright: Copyright (c) 2018 zteits
  7 + *
  8 + * @ClassName: com.clouds.common.utils.page
  9 + * @Description: 分页工具类
  10 + * @version: v1.0.0
  11 + * @author: atao
  12 + * @date: 2018/2/28 下午5:31
  13 + * Modification History:
  14 + * Date Author Version Description
  15 + * ---------------------------------------------------------*
  16 + * 2018/2/28 atao v1.0.0 创建
  17 + */
  18 +public class PageUtil {
  19 +
  20 + /**
  21 + * 校验pageSize,如不符合条件,将pageSize 重新赋值
  22 + *
  23 + * @param sizeEnum 进行校验的 sizeEnum 枚举值
  24 + * @param req 基础分页请求
  25 + * @return 正确的pageSize
  26 + * @Author: atao
  27 + * @Date: 2018/2/28 下午5:34
  28 + */
  29 + public static int pageSizeValidate(PageSizeEnum sizeEnum, BaseRequest req) {
  30 +
  31 + int pageSize = req.getBaseRequest().getPageSize();
  32 + //校验分页条数最小值
  33 + pageSize = pageSize < sizeEnum.getMinValue() ? sizeEnum.getMinValue()
  34 + : pageSize;
  35 + //校验分页条数最大值
  36 + pageSize = pageSize > sizeEnum.getMaxValue() ? sizeEnum.getMaxValue()
  37 + : pageSize;
  38 +
  39 + req.getBaseRequest().setPageSize(pageSize);
  40 + return pageSize;
  41 + }
  42 +
  43 + /**
  44 + * 校验pageSize,如不符合条件,将pageSize 重新赋值
  45 + *
  46 + * @param sizeEnum 进行校验的 sizeEnum 枚举值
  47 + * @param pageSize 待校验的pageSize
  48 + * @return
  49 + * @Author: atao
  50 + * @Date: 2018/2/28 下午5:34
  51 + */
  52 + public static int pageSizeValidate(PageSizeEnum sizeEnum, int pageSize) {
  53 +
  54 + //校验分页条数最小值
  55 + pageSize = pageSize < sizeEnum.getMinValue() ? sizeEnum.getMinValue()
  56 + : pageSize;
  57 + //校验分页条数最大值
  58 + pageSize = pageSize > sizeEnum.getMaxValue() ? sizeEnum.getMaxValue()
  59 + : pageSize;
  60 +
  61 + return pageSize;
  62 + }
  63 +}
src/main/java/com/zteits/oa/api/base/bean/ResultBean.java 0 → 100644
  1 +package com.zteits.oa.api.base.bean;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +
  6 +public class ResultBean<CODE extends ErrorCode,DATA> implements Serializable {
  7 +
  8 + /**
  9 + *
  10 + */
  11 + private static final long serialVersionUID = 1L;
  12 +
  13 + boolean success;
  14 + String errMsg;
  15 + DATA data;
  16 + CODE errCode;
  17 + String helpMsg;
  18 +
  19 + public ResultBean() {
  20 + success = true;
  21 + }
  22 + public ResultBean(DATA data) {
  23 + this.data = data;
  24 + success = true;
  25 + }
  26 + public ResultBean(boolean success, DATA data) {
  27 + this.data = data;
  28 + this.success = success;
  29 + }
  30 + public ResultBean(CODE errCode) {
  31 + this.errCode = errCode;
  32 + this.success = false;
  33 + }
  34 + public ResultBean(CODE errCode,String errMsg) {
  35 + this.errCode = errCode;
  36 + this.errMsg = errMsg;
  37 + this.success = false;
  38 + }
  39 +
  40 + public ResultBean(CODE errCode,String errMsg, DATA data) {
  41 + this.errCode = errCode;
  42 + this.errMsg = errMsg;
  43 + this.data = data;
  44 + this.success = false;
  45 + }
  46 +
  47 + public ResultBean(boolean success, CODE errCode,String errMsg, DATA data) {
  48 + this.errCode = errCode;
  49 + this.errMsg = errMsg;
  50 + this.data = data;
  51 + this.success = success;
  52 + }
  53 +
  54 + /**
  55 + * 重新初始化bean的所有属性
  56 + */
  57 + public void initSuccess(DATA data) {
  58 + init(true, null, null, data);
  59 + }
  60 + /**
  61 + * 重新初始化bean的所有属性
  62 + */
  63 + public void initError(CODE errCode) {
  64 + init(false, errCode, null, null);
  65 + }
  66 + /**
  67 + * 重新初始化bean的所有属性
  68 + */
  69 + public void initError(CODE errCode,String errMsg) {
  70 + init(false, errCode, errMsg, null);
  71 + }
  72 +
  73 + /**
  74 + * 重新初始化bean的所有属性
  75 + */
  76 + public void initError(String errMsg) {
  77 + init(false, null, errMsg, null);
  78 + }
  79 +
  80 + /**
  81 + * 重新初始化bean的所有属性
  82 + */
  83 + public void initError(CODE errCode,String errMsg, DATA data) {
  84 + init(false, errCode, errMsg, data);
  85 + }
  86 +
  87 + /**
  88 + * 重新初始化bean的所有属性
  89 + */
  90 + public void init(boolean success, CODE errCode,String errMsg, DATA data) {
  91 + this.errCode = errCode;
  92 + this.errMsg = errMsg;
  93 + this.data = data;
  94 + this.success = success;
  95 + }
  96 +
  97 + public boolean isSuccess() {
  98 + return success;
  99 + }
  100 +
  101 + public void setSuccess(boolean success) {
  102 + this.success = success;
  103 + }
  104 +
  105 + public String getErrMsg() {
  106 + return errMsg;
  107 + }
  108 +
  109 + public void setErrMsg(String errMsg) {
  110 + this.errMsg = errMsg;
  111 + }
  112 +
  113 + public DATA getData() {
  114 + return data;
  115 + }
  116 +
  117 + public void setData(DATA user) {
  118 + this.data = user;
  119 +
  120 +
  121 + }
  122 + public ErrorCode getErrCode() {
  123 + return errCode;
  124 + }
  125 + public void setErrCode(CODE errCode) {
  126 + this.errCode = errCode;
  127 + }
  128 + /**
  129 + * @return the helpMsg
  130 + */
  131 + public String getHelpMsg() {
  132 + return helpMsg;
  133 + }
  134 + /**
  135 + * @param helpMsg the helpMsg to set
  136 + */
  137 + public void setHelpMsg(String helpMsg) {
  138 + this.helpMsg = helpMsg;
  139 + }
  140 + @Override
  141 + public String toString() {
  142 + return "ResultBean [success=" + success + ", errMsg=" + errMsg + ", data=" + data + ", errCode=" + errCode
  143 + + ", helpMsg=" + helpMsg + "]";
  144 + }
  145 +
  146 +}
src/main/java/com/zteits/oa/api/base/constants/BasicEnum.java 0 → 100644
  1 +package com.zteits.oa.api.base.constants;
  2 +
  3 +public enum BasicEnum {
  4 +
  5 + /**系统编码定义*/
  6 + SYS_CODE("0001_SYS", "系统编码");
  7 +
  8 + private String value;
  9 + private String desc;
  10 +
  11 + BasicEnum(String value, String desc) {
  12 + this.value = value;
  13 + this.desc = desc;
  14 + }
  15 +
  16 + public String getValue() {
  17 + return value;
  18 + }
  19 +
  20 + public void setValue(String value) {
  21 + this.value = value;
  22 + }
  23 +
  24 + public String getDesc() {
  25 + return desc;
  26 + }
  27 +
  28 + public void setDesc(String desc) {
  29 + this.desc = desc;
  30 + }
  31 +
  32 +
  33 +}
src/main/java/com/zteits/oa/api/base/constants/ErrorType.java 0 → 100644
  1 +package com.zteits.oa.api.base.constants;
  2 +
  3 +import com.zteits.oa.api.base.bean.ErrorCode;
  4 +
  5 +public enum ErrorType implements ErrorCode {
  6 +
  7 + AUTH_PASS_ERROR("2000", "账号密码不匹配"),
  8 + AUTH_ROLE_EMPTY("2001", "账号无有效角色"),
  9 + AUTH_IMGCODE_ERROR("2002", "验证码错误"),
  10 + AUTH_TOKEN_NOT_EXISTS("2003", "授权令牌不存在或已失效"),
  11 + AUTH_TOKEN_ILLEGAL("2004", "授权令牌不合法"),
  12 + AUTH_TOKEN_AUTH_FAIL("2005", "无此权限"),
  13 + AUTH_PASS_WRONG_NUM_OVER("2006","密码输错次数超限,"),
  14 + AUTH_RES_EMPTY("2007","账号无有效资源"),
  15 + AUTH_ORG_EMPTY("2008","账号无有效在组织"),
  16 + AUTH_PL_NOS_EMPTY("2010","用户没有关联停车场"),
  17 + AUTH_STATE_ILLEGALITY("2009","账号状态异常"),
  18 + SYSTEM_ERROR("1000", "抱歉,服务暂时不可用,请稍后重试。"),
  19 + APP_ERROR("1001", "应用错误"),
  20 + BIZ_ERROR("1002", "业务错误:%s"),
  21 + PARAMM_NULL("1003", "入参不能为空:[%s]"),
  22 + OBJECT_NOT_EXISTS("1004", "对象不存在:[%s]"),
  23 + OBJECT_BELONG_ERROR("1005", "对象归属错误:[%s]"),
  24 + RESOURCE_NOT_EXISTS("1006", "访问的资源不存在"),
  25 + PARAM_NOT_VALID("1007", "参数校验失败:%s"),
  26 + CREATE_PAY_ORDER_FAIL("1008","生成支付单信息失败"),
  27 + CREATE_SIGIN_FAIL("1009","支付单签名失败"),
  28 + CACHE_NOT_EXISTS("1010","在缓存中不存在[%s]"),
  29 + SEND_MESSAGE_ERROR("1011","发送验证码失败"),
  30 + /***验证码不匹配*/
  31 + SEND_VERIFI_CODE_ERROR("1012","验证码不匹配"),
  32 + /**验证码失效*/
  33 + SEND_VERIFI_CODE_LESS("1013","验证码失效"),
  34 + PARK_LOT_NOT_EXISTS("1014","停车场记录不存在:%s"),
  35 + PARK_SEND_FAIL("1015","通知失败"),
  36 + PASS_NOT_MATCH("1016","两次密码不一致"),
  37 + CUST_INFO_HAS_EXISTS("1017","客户已存在"),
  38 + UPDATE_ROLE_ORGID_ERROR("1017","跟新角色组织Id失败"),
  39 + ADD_ROLE_ORG("1018","请在用户菜单 为用户分配组织,然后为用户分配角色"),
  40 + ONLY_UPLOAD_EXCLE("1019","只能上传xlsx或者lsx格式文件"),
  41 + NO_DATA_FOR_EXCLE("1020","请在excle添加数据后上传"),
  42 + SAVE_EXCLE_FAIL("1021","批量导入excle失败"),
  43 + EXCLE_COLM_ERROR("1022","excle模板错误"),
  44 + SYSTEM_UPDATING("1023","抱歉,服务正在升级,请稍后重试!"),
  45 + INTERFACE_NOT_SUPPORT("1024","抱歉,该功能已经更新,请升级至最新版本。"),
  46 + CALL_THIRD_SERVICE_EXCEPTION("1025","调用第三方服务异常"),
  47 + /*********PARK域**********/
  48 + SAVE_PARK_ERROR("3000","保存停车场信息错误!"),
  49 + ALREADY_EXISTS("3001","当前编号[%s]在该停车场中已存在"),
  50 + EQPNO_EXISTS("3002","当前地磁编号已存在"),
  51 + PDANO_EXISTS("3003","当前PDA编号已存在"),
  52 + CHARGER_CODE_EXISTS("3004","该收费员账号已经存在,请重新输入"),
  53 + NOT_ALLOW_DEL_BERTH("3005","泊位已经关联地磁或有在停车辆,不允许删除"),
  54 + NOT_ALLOW_DEL_BERTH_AREA("3006","泊位区间下已经有泊位,请先删除泊位"),
  55 + NOT_ALLOW_DEL_AREA_BLOCK("3007","该办事处下面有停车场,不允许删除"),
  56 + NOT_ALLOW_DEL_PARK("3008","停车场下面已经有泊位区间,请先删除泊位区间"),
  57 + NOT_ALLOW_DEL_EMPLOYEE_GROUP("3009","收费组下面有收费员,不允许删除"),
  58 + BERTHS_ALREADY_RENT("3010","该车位已经被租用"),
  59 + NOT_ALLOW_CANCEL("3011","该车位不允许取消"),
  60 + GREATER_THEN_MAX_CANCEL_TIME("3012","超过最大取消次数"),
  61 + DATA_ALREADY_MODIFYED("3013","数据已经被其他业务修改,请重新查询"),
  62 + /***********PARK域********/
  63 + /*********PAY域**********/
  64 + ACCOUNT_NO_RECRET_NOT("4000","个人账户没有开通免密支付!"),
  65 + ACCOUNT_NO_MONEY("4001","个人账户余额不足!"),
  66 + NOTFUND_CUSTID_BY_CARNO("4002","该车牌暂未被绑定,无法找到对应客户"),
  67 + REFUND_FEE_FAIL("4003","退款失败"),
  68 + ACCOUNT_NO_FIND("4004","未找到个人账户信息!"),
  69 + NOTFUND_PAY_ORDER("4005","没有找到支付单信息"),
  70 + CUST_SIGN_ERROR("4006","签到失败"),
  71 + SYS_COMMON_ERROR("4007","码表查询失败"),
  72 + NOTFOUND_COUPON("4008","根据卡劵编码[%s]没有获取到响应的卡劵信息!"),
  73 + COUPON_NOTREST("4009","当前卡劵[%s]剩余数量不足!"),
  74 + UPDATE_COUPON_FAIL("4010","修改卡劵[%s]信息失败!"),
  75 + SAVE_COUPON_PERSON("4011","保存个人卡劵失败!"),
  76 + CUST_CARD_NO_NUM("4012","卡券已经售完!"),
  77 + PAY_ORDER_BACK("4013","补缴的单子为空!"),
  78 + THIRDPART_APPID_NOT_EXISTS("4014","appId不存在"),
  79 + PAY_TYPE_ERROR("4015","支付方式不正确"),
  80 + CREAT_PAYORDER_ERROR("4016","支付方式不正确"),
  81 + INVOICE_FEE_ERROR("4017","手机端开票金额计算有误"),
  82 + NOT_PAYED_ORDER("4018","有未支付单"),
  83 + ALREADY_OUT_PARK("4019","已经出场,无需重复操作"),
  84 + /***********PAY域********/
  85 + /***********ORDER域*************/
  86 + NOT_FOUND_PAY_ORDER("5000","未找到支付单"),
  87 +
  88 +
  89 + /**********Bill域***************/
  90 + NOT_FOUND_VIP_CARD("6000","未根据个人卡券编码找到卡信息"),
  91 + VIP_CARD_NO_MONEY("6001","卡余额不足"),
  92 + /**********Bill域****************/
  93 +
  94 + BIZ_SUCCESS("8888", "成功");
  95 +
  96 + private String code;
  97 + private String msg;
  98 +
  99 + private ErrorType(String code, String msg) {
  100 + this.code = code;
  101 + this.msg = msg;
  102 + }
  103 +
  104 + @Override
  105 + public String getCode() {
  106 + return this.code;
  107 + }
  108 +
  109 + @Override
  110 + public String getMsg() {
  111 + return this.msg;
  112 + }
  113 +
  114 +}
src/main/java/com/zteits/oa/api/base/constants/PageSizeEnum.java 0 → 100644
  1 +package com.zteits.oa.api.base.constants;
  2 +
  3 +/**
  4 + * Copyright: Copyright (c) 2018 zteits
  5 + *
  6 + * @ClassName: com.clouds.common.constants.pagequery
  7 + * @Description: 分页查询最大查询的值
  8 + * @version: v1.0.0
  9 + * @author: atao
  10 + * @date: 2018/2/27 下午2:39
  11 + * Modification History:
  12 + * Date Author Version Description
  13 + * ---------------------------------------------------------*
  14 + * 2018/2/27 atao v1.0.0 创建
  15 + */
  16 +public enum PageSizeEnum {
  17 +
  18 + PAGE_SIZE_BASE(1, 1000, "分页查询每页最小数量值");
  19 +
  20 + /**
  21 + * 最小值
  22 + */
  23 + Integer minValue;
  24 +
  25 + /**
  26 + * 最大值
  27 + */
  28 + Integer maxValue;
  29 + String desc;
  30 +
  31 + PageSizeEnum(Integer minValue, Integer maxValue, String desc) {
  32 + this.minValue = minValue;
  33 + this.maxValue = maxValue;
  34 + this.desc = desc;
  35 + }
  36 +
  37 + public Integer getMinValue() {
  38 + return minValue;
  39 + }
  40 +
  41 + public Integer getMaxValue() {
  42 + return maxValue;
  43 + }
  44 +
  45 + public String getDesc() {
  46 + return desc;
  47 + }
  48 +}
src/main/java/com/zteits/oa/api/base/exception/AppException.java 0 → 100644
  1 +package com.zteits.oa.api.base.exception;
  2 +
  3 +import com.zteits.oa.api.base.bean.ErrorCode;
  4 +import com.zteits.oa.api.base.constants.ErrorType;
  5 +
  6 +/**
  7 + * Copyright: Copyright (c) 2017 zteits
  8 + *
  9 + * @ClassName: AppException.java
  10 + * @Description:
  11 + * @version: v1.0.0
  12 + * @author: liuzl
  13 + * @date: 2017年4月24日 下午4:51:41
  14 + * Modification History:
  15 + * Date Author Version Description
  16 + * ---------------------------------------------------------*
  17 + * 2017年4月24日 liuzl v1.0.0 创建
  18 + *
  19 + *
  20 + * 应用级异常
  21 + */
  22 +public class AppException extends RuntimeException {
  23 +
  24 + private static final long serialVersionUID = 1L;
  25 + /**
  26 + * 错误编码
  27 + */
  28 + protected ErrorCode errCode;
  29 +
  30 + /**
  31 + * 错误信息
  32 + */
  33 + protected String errMsg;
  34 +
  35 + /**
  36 + * 无参构造函数
  37 + */
  38 + public AppException() {
  39 + super();
  40 + }
  41 +
  42 + public AppException(ErrorCode errCode, String... errMsg) {
  43 + super(errCode.getMsg());
  44 + this.errCode = errCode;
  45 + setErrMsg(errMsg,true);
  46 + }
  47 +
  48 + public AppException(ErrorCode errCode, String errMsg,Boolean isTransfer) {
  49 + super(errMsg);
  50 + this.errCode = errCode;
  51 + setErrMsg(new String[]{errMsg},isTransfer);
  52 + }
  53 +
  54 + public AppException(Throwable cause) {
  55 + super(cause);
  56 + this.errCode = ErrorType.SYSTEM_ERROR;
  57 + this.errMsg = cause.getMessage();
  58 + }
  59 +
  60 + /**
  61 + * 构造函数
  62 + *
  63 + * @param cause 异常
  64 + */
  65 + public AppException(ErrorCode errCode, Throwable cause, String... errMsg) {
  66 + super(errCode.getCode() + errCode.getMsg(), cause);
  67 + this.errCode = errCode;
  68 + setErrMsg(errMsg,true);
  69 + }
  70 +
  71 + public ErrorCode getErrCode() {
  72 + return errCode;
  73 + }
  74 +
  75 + public void setErrCode(ErrorCode errCode) {
  76 + this.errCode = errCode;
  77 + }
  78 +
  79 + public String getErrMsg() {
  80 + return this.errMsg;
  81 + }
  82 +
  83 + public void setErrMsg(String[] errMsg,Boolean isTransfer) {
  84 +
  85 + if (null != errMsg &&errMsg.length>0) {
  86 + if(errCode.getMsg().contains("%s") && isTransfer){
  87 + this.errMsg = String.format(errCode.getMsg(), errMsg);
  88 + }else{
  89 + StringBuffer sf = new StringBuffer();
  90 + for (String msg : errMsg) {
  91 + sf.append(msg+";");
  92 + }
  93 + this.errMsg = sf.toString();
  94 + }
  95 + }else{
  96 + this.errMsg = errCode.getMsg();
  97 + }
  98 +
  99 + }
  100 +
  101 + public static void main(String[] args) {
  102 + String str = "ERRCode:1004--对象不存在:[%s]";
  103 + if (str.contains("%s")){
  104 + System.out.println("包含");
  105 + }
  106 + }
  107 +
  108 +}
src/main/java/com/zteits/oa/api/base/exception/BizException.java 0 → 100644
  1 +package com.zteits.oa.api.base.exception;
  2 +
  3 +import com.zteits.oa.api.base.bean.ErrorCode;
  4 +import com.zteits.oa.api.base.constants.ErrorType;
  5 +
  6 +/**
  7 + *
  8 + *
  9 + * Copyright: Copyright (c) 2017 zteits
  10 + *
  11 + * @ClassName: BizException.java
  12 + * @Description:
  13 + * @version: v1.0.0
  14 + * @author: liuzl
  15 + * @date: 2017年4月24日 下午4:54:54
  16 + * Modification History:
  17 + * Date Author Version Description
  18 + *---------------------------------------------------------*
  19 + * 2017年4月24日 liuzl v1.0.0 创建
  20 + *
  21 + * 业务异常
  22 + */
  23 +public class BizException extends AppException{
  24 +
  25 + private static final long serialVersionUID = 1L;
  26 +
  27 +
  28 + /**
  29 + * 无参构造函数
  30 + */
  31 + public BizException() {
  32 + super();
  33 + }
  34 +
  35 + public BizException(ErrorType errorType) {
  36 + super(errorType);
  37 + }
  38 +
  39 + public BizException(ErrorCode errorCode, String ... errMsg) {
  40 + super(errorCode, errMsg);
  41 + }
  42 + /**
  43 + * 封装异常
  44 + * @param errorCode
  45 + * @param errMsg
  46 + * @param isTransfer 是否转换异常信息,如果为false,则直接使用errMsg信息
  47 + */
  48 + public BizException(ErrorCode errorCode, String errMsg,Boolean isTransfer) {
  49 + super(errorCode, errMsg,isTransfer);
  50 + }
  51 +
  52 + public BizException(ErrorType errorType, String ... errMsg) {
  53 + super(errorType, errMsg);
  54 + }
  55 +
  56 + public BizException(ErrorType errCode, Throwable cause,String ... errMsg) {
  57 + super(errCode,cause, errMsg);
  58 + }
  59 +
  60 +}
src/main/java/com/zteits/oa/api/dto/asraop/AsraOpDTO.java 0 → 100644
  1 +package com.zteits.oa.api.dto.asraop;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import com.zteits.oa.api.base.bean.BaiscDTO;
  6 +/**
  7 + * 工时系统操作员DTO.<br/>
  8 + *
  9 + * Copyright: Copyright (c) 2017 ZTE-ITS
  10 + *
  11 + * @ClassName: AmountUtils.java
  12 + * @Description:
  13 + * @version: v1.0.0
  14 + * @author: wangfs
  15 + * @date: 2018年7月30日
  16 + * Modification History:
  17 + * Date Author Version Description
  18 + *---------------------------------------------------------*
  19 + * 2018年7月30日 wangfs v1.0.0 创建
  20 + */
  21 +public class AsraOpDTO extends BaiscDTO{
  22 + /**
  23 + *
  24 + */
  25 + private static final long serialVersionUID = -1744089914187990069L;
  26 +
  27 + /**主键*/
  28 + private Long id;
  29 +
  30 + /**登录工号*/
  31 + private String loginCode;
  32 +
  33 + /**登录密码*/
  34 + private String loginPassword;
  35 +
  36 + /**操作员姓名*/
  37 + private String opName;
  38 +
  39 + /**员工邮箱*/
  40 + private String email;
  41 +
  42 + /**角色ID*/
  43 + private Long roleId;
  44 +
  45 + /**地市ID*/
  46 + private Long cityId;
  47 +
  48 + /**地市名称*/
  49 + private String cityName;
  50 +
  51 + /**上级领导id 领导:-1*/
  52 + private Long parentId;
  53 +
  54 + /**是否邮件提醒 1:是,0:否*/
  55 + private Integer isRemindEmail;
  56 +
  57 + /**数据状态:1有效,0无效,2:锁定*/
  58 + private Integer dataState;
  59 +
  60 + /**创建人ID*/
  61 + private String createEmpid;
  62 +
  63 + /**创建人*/
  64 + private String createEmpName;
  65 +
  66 + /**创建时间*/
  67 + private Date createDate;
  68 +
  69 + /**修改人*/
  70 + private String modfiyEmpid;
  71 +
  72 + /**修改人*/
  73 + private String modfiyEmpName;
  74 +
  75 + /**修改时间*/
  76 + private Date modfiyDate;
  77 +
  78 + /**描述*/
  79 + private String remark;
  80 +
  81 + /**获取主键*/
  82 + public Long getId() {
  83 + return id;
  84 + }
  85 +
  86 + /**设置主键*/
  87 + public void setId(Long id) {
  88 + this.id = id;
  89 + }
  90 +
  91 + /**获取登录工号*/
  92 + public String getLoginCode() {
  93 + return loginCode;
  94 + }
  95 +
  96 + /**设置登录工号*/
  97 + public void setLoginCode(String loginCode) {
  98 + this.loginCode = loginCode == null ? null : loginCode.trim();
  99 + }
  100 +
  101 + /**获取登录密码*/
  102 + public String getLoginPassword() {
  103 + return loginPassword;
  104 + }
  105 +
  106 + /**设置登录密码*/
  107 + public void setLoginPassword(String loginPassword) {
  108 + this.loginPassword = loginPassword == null ? null : loginPassword.trim();
  109 + }
  110 +
  111 + /**获取操作员姓名*/
  112 + public String getOpName() {
  113 + return opName;
  114 + }
  115 +
  116 + /**设置操作员姓名*/
  117 + public void setOpName(String opName) {
  118 + this.opName = opName == null ? null : opName.trim();
  119 + }
  120 +
  121 + /**获取员工邮箱*/
  122 + public String getEmail() {
  123 + return email;
  124 + }
  125 +
  126 + /**设置员工邮箱*/
  127 + public void setEmail(String email) {
  128 + this.email = email == null ? null : email.trim();
  129 + }
  130 +
  131 + /**获取角色ID*/
  132 + public Long getRoleId() {
  133 + return roleId;
  134 + }
  135 +
  136 + /**设置角色ID*/
  137 + public void setRoleId(Long roleId) {
  138 + this.roleId = roleId;
  139 + }
  140 +
  141 + /**获取地市ID*/
  142 + public Long getCityId() {
  143 + return cityId;
  144 + }
  145 +
  146 + /**设置地市ID*/
  147 + public void setCityId(Long cityId) {
  148 + this.cityId = cityId;
  149 + }
  150 +
  151 + /**获取地市名称*/
  152 + public String getCityName() {
  153 + return cityName;
  154 + }
  155 +
  156 + /**设置地市名称*/
  157 + public void setCityName(String cityName) {
  158 + this.cityName = cityName == null ? null : cityName.trim();
  159 + }
  160 +
  161 + /**获取上级领导id 领导:-1*/
  162 + public Long getParentId() {
  163 + return parentId;
  164 + }
  165 +
  166 + /**设置上级领导id 领导:-1*/
  167 + public void setParentId(Long parentId) {
  168 + this.parentId = parentId;
  169 + }
  170 +
  171 + /**获取是否邮件提醒 1:是,0:否*/
  172 + public Integer getIsRemindEmail() {
  173 + return isRemindEmail;
  174 + }
  175 +
  176 + /**设置是否邮件提醒 1:是,0:否*/
  177 + public void setIsRemindEmail(Integer isRemindEmail) {
  178 + this.isRemindEmail = isRemindEmail;
  179 + }
  180 +
  181 + /**获取数据状态:1有效,0无效,2:锁定*/
  182 + public Integer getDataState() {
  183 + return dataState;
  184 + }
  185 +
  186 + /**设置数据状态:1有效,0无效,2:锁定*/
  187 + public void setDataState(Integer dataState) {
  188 + this.dataState = dataState;
  189 + }
  190 +
  191 + /**获取创建人ID*/
  192 + public String getCreateEmpid() {
  193 + return createEmpid;
  194 + }
  195 +
  196 + /**设置创建人ID*/
  197 + public void setCreateEmpid(String createEmpid) {
  198 + this.createEmpid = createEmpid == null ? null : createEmpid.trim();
  199 + }
  200 +
  201 + /**获取创建人*/
  202 + public String getCreateEmpName() {
  203 + return createEmpName;
  204 + }
  205 +
  206 + /**设置创建人*/
  207 + public void setCreateEmpName(String createEmpName) {
  208 + this.createEmpName = createEmpName == null ? null : createEmpName.trim();
  209 + }
  210 +
  211 + /**获取创建时间*/
  212 + public Date getCreateDate() {
  213 + return createDate;
  214 + }
  215 +
  216 + /**设置创建时间*/
  217 + public void setCreateDate(Date createDate) {
  218 + this.createDate = createDate;
  219 + }
  220 +
  221 + /**获取修改人*/
  222 + public String getModfiyEmpid() {
  223 + return modfiyEmpid;
  224 + }
  225 +
  226 + /**设置修改人*/
  227 + public void setModfiyEmpid(String modfiyEmpid) {
  228 + this.modfiyEmpid = modfiyEmpid == null ? null : modfiyEmpid.trim();
  229 + }
  230 +
  231 + /**获取修改人*/
  232 + public String getModfiyEmpName() {
  233 + return modfiyEmpName;
  234 + }
  235 +
  236 + /**设置修改人*/
  237 + public void setModfiyEmpName(String modfiyEmpName) {
  238 + this.modfiyEmpName = modfiyEmpName == null ? null : modfiyEmpName.trim();
  239 + }
  240 +
  241 + /**获取修改时间*/
  242 + public Date getModfiyDate() {
  243 + return modfiyDate;
  244 + }
  245 +
  246 + /**设置修改时间*/
  247 + public void setModfiyDate(Date modfiyDate) {
  248 + this.modfiyDate = modfiyDate;
  249 + }
  250 +
  251 + /**获取描述*/
  252 + public String getRemark() {
  253 + return remark;
  254 + }
  255 +
  256 + /**设置描述*/
  257 + public void setRemark(String remark) {
  258 + this.remark = remark == null ? null : remark.trim();
  259 + }
  260 +
  261 + @Override
  262 + public String toString() {
  263 + return "AsraOpDTO [id=" + id + ", loginCode=" + loginCode + ", loginPassword=" + loginPassword + ", opName="
  264 + + opName + ", email=" + email + ", roleId=" + roleId + ", cityId=" + cityId + ", cityName=" + cityName
  265 + + ", parentId=" + parentId + ", isRemindEmail=" + isRemindEmail + ", dataState=" + dataState
  266 + + ", createEmpid=" + createEmpid + ", createEmpName=" + createEmpName + ", createDate=" + createDate
  267 + + ", modfiyEmpid=" + modfiyEmpid + ", modfiyEmpName=" + modfiyEmpName + ", modfiyDate=" + modfiyDate
  268 + + ", remark=" + remark + "]";
  269 + }
  270 +
  271 +}
src/main/java/com/zteits/oa/api/dto/asraop/param/AsraOpQueryReq.java 0 → 100644
  1 +package com.zteits.oa.api.dto.asraop.param;
  2 +
  3 +import com.zteits.oa.api.base.bean.BaseRequest;
  4 +
  5 +public class AsraOpQueryReq extends BaseRequest{
  6 +
  7 + /**
  8 + *
  9 + */
  10 + private static final long serialVersionUID = 7249746348000980054L;
  11 +
  12 + /**登录工号*/
  13 + private String loginCode;
  14 +
  15 + /**操作员姓名*/
  16 + private String opName;
  17 +
  18 + /**员工邮箱*/
  19 + private String email;
  20 +
  21 + public String getLoginCode() {
  22 + return loginCode;
  23 + }
  24 +
  25 + public void setLoginCode(String loginCode) {
  26 + this.loginCode = loginCode;
  27 + }
  28 +
  29 + public String getOpName() {
  30 + return opName;
  31 + }
  32 +
  33 + public void setOpName(String opName) {
  34 + this.opName = opName;
  35 + }
  36 +
  37 + public String getEmail() {
  38 + return email;
  39 + }
  40 +
  41 + public void setEmail(String email) {
  42 + this.email = email;
  43 + }
  44 +
  45 + @Override
  46 + public String toString() {
  47 + return "AsraOpQueryReq [loginCode=" + loginCode + ", opName=" + opName + ", email=" + email + "]";
  48 + }
  49 +
  50 +
  51 +}
src/main/java/com/zteits/oa/api/service/report/query/AsraOpRueryService.java 0 → 100644
  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 +
  8 +/**
  9 + * 员工查询service.<br/>
  10 + *
  11 + * Copyright: Copyright (c) 2017 ZTE-ITS
  12 + *
  13 + * @ClassName: AmountUtils.java
  14 + * @Description:
  15 + * @version: v1.0.0
  16 + * @author: wangfs
  17 + * @date: 2018年7月30日
  18 + * Modification History:
  19 + * Date Author Version Description
  20 + *---------------------------------------------------------*
  21 + * 2018年7月30日 wangfs v1.0.0 创建
  22 + */
  23 +
  24 +
  25 +
  26 +public interface AsraOpRueryService {
  27 +
  28 + /**
  29 + * 分页查询工时系统员工信息.<br/>
  30 + * @param asraOpQueryReq
  31 + * @return
  32 + * 2018年7月30日 wangfs.<br/>
  33 + */
  34 + BizResult<PageBean<AsraOpDTO>> queryAsraOpForPage(AsraOpQueryReq asraOpQueryReq);
  35 +}
src/main/java/com/zteits/oa/report/biz/AsraOpRueryServiceImpl.java 0 → 100644
  1 +package com.zteits.oa.report.biz;
  2 +
  3 +import org.slf4j.Logger;
  4 +import org.slf4j.LoggerFactory;
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.stereotype.Service;
  7 +
  8 +import com.alibaba.fastjson.JSONObject;
  9 +import com.github.pagehelper.PageInfo;
  10 +import com.zteits.oa.api.base.bean.BizResult;
  11 +import com.zteits.oa.api.base.bean.PageBean;
  12 +import com.zteits.oa.api.dto.asraop.AsraOpDTO;
  13 +import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq;
  14 +import com.zteits.oa.api.service.report.query.AsraOpRueryService;
  15 +import com.zteits.oa.report.dao.AsraOpDao;
  16 +import com.zteits.oa.report.domain.AsraOp;
  17 +import com.zteits.oa.util.pagepaper.PageBeanUtil;
  18 +/**
  19 + * 工时系统操作员实现类.<br/>
  20 + *
  21 + * Copyright: Copyright (c) 2017 ZTE-ITS
  22 + *
  23 + * @ClassName: AmountUtils.java
  24 + * @Description:
  25 + * @version: v1.0.0
  26 + * @author: wangfs
  27 + * @date: 2018年7月30日
  28 + * Modification History:
  29 + * Date Author Version Description
  30 + *---------------------------------------------------------*
  31 + * 2018年7月30日 wangfs v1.0.0 创建
  32 + */
  33 +@Service("")
  34 +public class AsraOpRueryServiceImpl implements AsraOpRueryService {
  35 +
  36 + private static final Logger logger = LoggerFactory.getLogger(AsraOpRueryServiceImpl.class);
  37 + @Autowired
  38 + private AsraOpDao asraOpDao;
  39 + /**
  40 + * 分页查询工时系统员工信息.<br/>
  41 + * @param asraOpQueryReq
  42 + * @return
  43 + * 2018年7月30日 wangfs.<br/>
  44 + */
  45 + @Override
  46 + public BizResult<PageBean<AsraOpDTO>> queryAsraOpForPage(AsraOpQueryReq asraOpQueryReq) {
  47 + logger.info("---begin查询分页员工信息..入参={}",JSONObject.toJSON(asraOpQueryReq));
  48 + PageBean<AsraOpDTO> pageBean = new PageBean<AsraOpDTO>();
  49 + PageInfo<AsraOp> pageInfo = asraOpDao.queryAsraOpForPage(asraOpQueryReq);
  50 + PageBeanUtil.copyProperties(pageInfo, pageBean, AsraOpDTO.class);
  51 + logger.info("---end查询分页员工信息..");
  52 + return new BizResult<PageBean<AsraOpDTO>>(pageBean);
  53 + }
  54 +
  55 +}
src/main/java/com/zteits/oa/report/dao/AsraOpDao.java 0 → 100644
  1 +package com.zteits.oa.report.dao;
  2 +
  3 +import com.github.pagehelper.PageInfo;
  4 +import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq;
  5 +import com.zteits.oa.report.domain.AsraOp;
  6 +
  7 +public interface AsraOpDao {
  8 +
  9 + /**
  10 + * 分页查询工时系统员工信息.<br/>
  11 + * @param asraOpQueryReq
  12 + * @return
  13 + * 2018年7月30日 wangfs.<br/>
  14 + */
  15 + PageInfo<AsraOp> queryAsraOpForPage(AsraOpQueryReq asraOpQueryReq);
  16 +}
src/main/java/com/zteits/oa/report/dao/impl/AsraOpDaoImpl.java 0 → 100644
  1 +package com.zteits.oa.report.dao.impl;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.stereotype.Component;
  7 +
  8 +import com.github.pagehelper.PageHelper;
  9 +import com.github.pagehelper.PageInfo;
  10 +import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq;
  11 +import com.zteits.oa.report.dao.AsraOpDao;
  12 +import com.zteits.oa.report.domain.AsraOp;
  13 +import com.zteits.oa.report.mapper.smapper.AsraOpSmapper;
  14 +@Component
  15 +public class AsraOpDaoImpl implements AsraOpDao {
  16 +
  17 + @Autowired
  18 + private AsraOpSmapper asraOpSmapper;
  19 + /**
  20 + * 分页查询工时系统员工信息.<br/>
  21 + * @param asraOpQueryReq
  22 + * @return
  23 + * 2018年7月30日 wangfs.<br/>
  24 + */
  25 + @Override
  26 + public PageInfo<AsraOp> queryAsraOpForPage(AsraOpQueryReq asraOpQueryReq) {
  27 + //1.设置分页
  28 + PageHelper.startPage(asraOpQueryReq.getBaseRequest().getPageNum(), asraOpQueryReq.getBaseRequest().getPageSize());
  29 + //2.查询数据
  30 + List<AsraOp> list = asraOpSmapper.queryAsraOpForList(asraOpQueryReq);
  31 + return new PageInfo<AsraOp>(list);
  32 + }
  33 +
  34 +}
src/main/java/com/zteits/oa/report/mapper/smapper/AsraOpSmapper.java 0 → 100644
  1 +package com.zteits.oa.report.mapper.smapper;
  2 +
  3 +import java.util.List;
  4 +
  5 +import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq;
  6 +import com.zteits.oa.report.domain.AsraOp;
  7 +
  8 +public interface AsraOpSmapper {
  9 +
  10 + /**
  11 + * 查询操作员list.<br/>
  12 + * @param asraOpQueryReq
  13 + * @return
  14 + * 2018年7月30日 wangfs.<br/>
  15 + */
  16 + List<AsraOp> queryAsraOpForList(AsraOpQueryReq asraOpQueryReq);
  17 +}
src/main/java/com/zteits/oa/report/web/demo/DemoController.java
@@ -2,22 +2,31 @@ package com.zteits.oa.report.web.demo; @@ -2,22 +2,31 @@ package com.zteits.oa.report.web.demo;
2 2
3 import javax.servlet.http.HttpServletRequest; 3 import javax.servlet.http.HttpServletRequest;
4 4
  5 +import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.web.bind.annotation.RequestBody; 6 import org.springframework.web.bind.annotation.RequestBody;
6 import org.springframework.web.bind.annotation.RequestMapping; 7 import org.springframework.web.bind.annotation.RequestMapping;
7 import org.springframework.web.bind.annotation.RequestMethod; 8 import org.springframework.web.bind.annotation.RequestMethod;
8 import org.springframework.web.bind.annotation.RestController; 9 import org.springframework.web.bind.annotation.RestController;
9 10
  11 +import com.zteits.oa.api.base.bean.BizResult;
  12 +import com.zteits.oa.api.base.bean.PageBean;
  13 +import com.zteits.oa.api.dto.asraop.AsraOpDTO;
  14 +import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq;
  15 +import com.zteits.oa.api.service.report.query.AsraOpRueryService;
  16 +
10 import io.swagger.annotations.Api; 17 import io.swagger.annotations.Api;
11 18
12 @Api(value = "swagger测试", description = "swagger测") 19 @Api(value = "swagger测试", description = "swagger测")
13 @RestController 20 @RestController
14 @RequestMapping("/demo") 21 @RequestMapping("/demo")
15 public class DemoController { 22 public class DemoController {
  23 + @Autowired
  24 + private AsraOpRueryService asraOpRueryService;
16 25
17 @RequestMapping(value="/demo",method = RequestMethod.POST) 26 @RequestMapping(value="/demo",method = RequestMethod.POST)
18 - public String test(@RequestBody String param, HttpServletRequest request){  
19 -  
20 - return param; 27 + public BizResult<PageBean<AsraOpDTO>> test(@RequestBody AsraOpQueryReq asraOpQueryReq, HttpServletRequest request){
  28 + BizResult<PageBean<AsraOpDTO>> result = asraOpRueryService.queryAsraOpForPage(asraOpQueryReq);
  29 + return result;
21 } 30 }
22 31
23 } 32 }
src/main/java/com/zteits/oa/util/pagepaper/PageBeanUtil.java 0 → 100644
  1 +package com.zteits.oa.util.pagepaper;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +import org.springframework.beans.BeanUtils;
  7 +
  8 +import com.github.pagehelper.PageInfo;
  9 +import com.zteits.oa.api.base.bean.PageBean;
  10 +
  11 +/**
  12 + * 分页插件结果转换工具类.<br/>
  13 + *
  14 + * Copyright: Copyright (c) 2017 zteits
  15 + *
  16 + * @ClassName: PageBeanUtil.java
  17 + * @Description:
  18 + * @version: v1.0.0
  19 + * @author: wangfs
  20 + * @date: 2017年4月19日 下午4:03:33
  21 + * Modification History:
  22 + * Date Author Version Description
  23 + *---------------------------------------------------------*
  24 + * 2017年4月19日 wangfs v1.0.0 创建
  25 + */
  26 +public class PageBeanUtil {
  27 +
  28 + /**
  29 + * 将PageInfo 转换成PageBean.<br/>
  30 + * @param form PageInfo<R> 对象.<br/>
  31 + * @param to PageBean<L> 对象.<br/>
  32 + * @param clazz
  33 + */
  34 + public static<R,L> void copyProperties(PageInfo<R> form,PageBean<L> to,Class<L> clazz){
  35 + if(form != null && to != null && clazz != null){
  36 + List<L> list = new ArrayList<L>();
  37 + if(!org.springframework.util.CollectionUtils.isEmpty(form.getList())){
  38 + for(R source:form.getList()){
  39 + if(source == null){
  40 + continue;
  41 + }
  42 + try {
  43 + L target = clazz.newInstance();
  44 + BeanUtils.copyProperties(source, target);
  45 + list.add(target);
  46 + } catch (InstantiationException e) {
  47 + e.printStackTrace();
  48 + } catch (IllegalAccessException e) {
  49 + e.printStackTrace();
  50 + }
  51 + }
  52 + to.setDataList(list);
  53 + to.setPageNum(form.getPageNum());
  54 + to.setPageSize(form.getPageSize());
  55 + to.setPages(form.getPages());
  56 + to.setPageTotals(Integer.valueOf(String.valueOf(form.getTotal())));
  57 + }else{
  58 + to.setDataList(list);
  59 + to.setPageNum(form.getPageNum());
  60 + to.setPageSize(form.getPageSize());
  61 + to.setPages(form.getPages());
  62 + to.setPageTotals(Integer.valueOf(String.valueOf(form.getTotal())));
  63 + }
  64 + }else{
  65 + try {
  66 + throw new Exception("源对象,目标对象,clazz 不能为空!");
  67 + } catch (Exception e) {
  68 + e.printStackTrace();
  69 + }
  70 + }
  71 + }
  72 +
  73 +
  74 +
  75 +
  76 +}
src/main/resources/logback-spring.xml
  1 +
1 <configuration> 2 <configuration>
  3 +
  4 + <!-- <include resource="org/springframework/boot/logging/logback/base.xml"/>-->
  5 + <logger name="com.zteits.oa.report.web" level="info"/>
  6 + <logger name="com.zteits.oa.report.mapper" level="debug"/>
  7 +
  8 +
2 <appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender"> 9 <appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
3 <file>${LOG_PATH}/${LOG_FILE}</file> 10 <file>${LOG_PATH}/${LOG_FILE}</file>
4 <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> 11 <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
5 <!-- rollover daily --> 12 <!-- rollover daily -->
6 - <fileNamePattern>${logging.path}${logging.file}-%d{yyyy-MM-dd}.%i.log</fileNamePattern> 13 + <fileNamePattern>${LOG_FILE}-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
7 <!-- each file should be at most 1GB, keep 60 days worth of history, but at most 20GB --> 14 <!-- each file should be at most 1GB, keep 60 days worth of history, but at most 20GB -->
8 <maxFileSize>1GB</maxFileSize> 15 <maxFileSize>1GB</maxFileSize>
9 <maxHistory>60</maxHistory> 16 <maxHistory>60</maxHistory>
@@ -27,7 +34,7 @@ @@ -27,7 +34,7 @@
27 <charset>UTF-8</charset> 34 <charset>UTF-8</charset>
28 </encoder> 35 </encoder>
29 </appender> 36 </appender>
30 - <root level="INFO"> 37 + <root level="info">
31 <appender-ref ref="ROLLING" /> 38 <appender-ref ref="ROLLING" />
32 <appender-ref ref="STDOUT"/> 39 <appender-ref ref="STDOUT"/>
33 </root> 40 </root>
src/main/resources/mybatis/smapper/AsraOpSmapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.zteits.oa.report.mapper.smapper.AsraOpSmapper">
  4 + <resultMap id="BaseResultMap" type="com.zteits.oa.report.domain.AsraOp">
  5 + <id column="id" jdbcType="BIGINT" property="id" />
  6 + <result column="login_code" jdbcType="VARCHAR" property="loginCode" />
  7 + <result column="login_password" jdbcType="VARCHAR" property="loginPassword" />
  8 + <result column="op_name" jdbcType="VARCHAR" property="opName" />
  9 + <result column="email" jdbcType="VARCHAR" property="email" />
  10 + <result column="role_id" jdbcType="BIGINT" property="roleId" />
  11 + <result column="city_id" jdbcType="BIGINT" property="cityId" />
  12 + <result column="city_name" jdbcType="VARCHAR" property="cityName" />
  13 + <result column="parent_id" jdbcType="BIGINT" property="parentId" />
  14 + <result column="is_remind_email" jdbcType="INTEGER" property="isRemindEmail" />
  15 + <result column="data_state" jdbcType="INTEGER" property="dataState" />
  16 + <result column="create_empid" jdbcType="VARCHAR" property="createEmpid" />
  17 + <result column="create_emp_name" jdbcType="VARCHAR" property="createEmpName" />
  18 + <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  19 + <result column="modfiy_empid" jdbcType="VARCHAR" property="modfiyEmpid" />
  20 + <result column="modfiy_emp_name" jdbcType="VARCHAR" property="modfiyEmpName" />
  21 + <result column="modfiy_date" jdbcType="TIMESTAMP" property="modfiyDate" />
  22 + <result column="remark" jdbcType="VARCHAR" property="remark" />
  23 + </resultMap>
  24 + <sql id="Base_Column_List">
  25 + id, login_code, login_password, op_name, email, role_id, city_id, city_name, parent_id,
  26 + is_remind_email, data_state, create_empid, create_emp_name, create_date, modfiy_empid,
  27 + modfiy_emp_name, modfiy_date, remark
  28 + </sql>
  29 +
  30 + <select id="queryAsraOpForList" parameterType="com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq" resultMap="BaseResultMap">
  31 + select
  32 + <include refid="Base_Column_List" />
  33 + from asra_op
  34 + where 1=1
  35 + <if test="loginCode != null and loginCode !=''">
  36 + and login_code = #{loginCode,jdbcType=VARCHAR}
  37 + </if>
  38 + <if test="opName != null and opName != ''">
  39 + and op_name = #{opName,jdbcType=VARCHAR}
  40 + </if>
  41 + <if test="email != null and email != ''">
  42 + and email = #{email,jdbcType=VARCHAR}
  43 + </if>
  44 + </select>
  45 +
  46 + </mapper>
0 \ No newline at end of file 47 \ No newline at end of file