diff --git a/src/main/java/com/zteits/oa/api/base/constants/ErrorType.java b/src/main/java/com/zteits/oa/api/base/constants/ErrorType.java
index 1b73694..a2fcbd1 100644
--- a/src/main/java/com/zteits/oa/api/base/constants/ErrorType.java
+++ b/src/main/java/com/zteits/oa/api/base/constants/ErrorType.java
@@ -4,7 +4,8 @@ import com.zteits.oa.api.base.bean.ErrorCode;
public enum ErrorType implements ErrorCode {
- AUTH_PASS_ERROR("2000", "账号密码不匹配"),
+ AUTH_LOGIN_ERROR("1999", "登录账号不匹配"),
+ AUTH_PASS_ERROR("2000", "登录密码不匹配"),
AUTH_ROLE_EMPTY("2001", "账号无有效角色"),
AUTH_IMGCODE_ERROR("2002", "验证码错误"),
AUTH_TOKEN_NOT_EXISTS("2003", "授权令牌不存在或已失效"),
diff --git a/src/main/java/com/zteits/oa/api/base/constants/SessionEnum.java b/src/main/java/com/zteits/oa/api/base/constants/SessionEnum.java
new file mode 100644
index 0000000..507fc52
--- /dev/null
+++ b/src/main/java/com/zteits/oa/api/base/constants/SessionEnum.java
@@ -0,0 +1,38 @@
+package com.zteits.oa.api.base.constants;
+
+/**
+ * Copyright: Copyright (c) 2017 zteits
+ *
+ * @ClassName: com.clouds.common.constants
+ * @Description: 存在session里面变量
+ * @version: v1.0.0
+ * @author: atao
+ * @date: 2017/6/21 上午11:08
+ * Modification History:
+ * Date Author Version Description
+ * ---------------------------------------------------------*
+ * 2017/6/21 atao v1.0.0 创建
+ */
+public enum SessionEnum {
+ //验证码
+ IMAGE_CODE("imageCode"),
+ //user 与 session 关联关系
+ USER_SESSION_REL("user:session"),
+ //user 对象
+ USER_INFO("user:info"),
+ //登录密码输错次数
+ PASS_WRONG_NUM("pass:wrong:num");
+
+
+
+ private String key;
+
+ SessionEnum(String key) {
+ this.key = key;
+ }
+
+ public String key() {
+ return this.key;
+ }
+
+}
diff --git a/src/main/java/com/zteits/oa/api/dto/asraop/LoginOathRes.java b/src/main/java/com/zteits/oa/api/dto/asraop/LoginOathRes.java
new file mode 100644
index 0000000..f897663
--- /dev/null
+++ b/src/main/java/com/zteits/oa/api/dto/asraop/LoginOathRes.java
@@ -0,0 +1,108 @@
+package com.zteits.oa.api.dto.asraop;
+
+import java.io.Serializable;
+
+/**
+ * 登陆授权response.
+ *
+ * Copyright: Copyright (c) 2017 ZTE-ITS
+ *
+ * @ClassName: AmountUtils.java
+ * @Description:
+ * @version: v1.0.0
+ * @author: wangfs
+ * @date: 2018年7月31日 Modification History: Date Author Version Description
+ * ---------------------------------------------------------* 2018年7月31日
+ * wangfs v1.0.0 创建
+ */
+public class LoginOathRes implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 5163928629505501899L;
+ /**
+ * 认证令牌 必填
+ */
+ private String accessToken;
+ /**
+ * 认证令牌过期时间 必填
+ */
+ private Long expiresIn;
+ /**
+ * 用户ID
+ */
+ private Long opId;
+
+ /**登录工号*/
+ private String loginCode;
+
+ /**
+ * 用户名
+ *
+ * @return
+ */
+ private String userName;
+
+
+
+ /** 角色ID */
+ private Long roleId;
+ /** 地市ID */
+ private Long cityId;
+ /** 地市名称 */
+ private String cityName;
+ public String getAccessToken() {
+ return accessToken;
+ }
+ public void setAccessToken(String accessToken) {
+ this.accessToken = accessToken;
+ }
+ public Long getExpiresIn() {
+ return expiresIn;
+ }
+ public void setExpiresIn(Long expiresIn) {
+ this.expiresIn = expiresIn;
+ }
+ public String getUserName() {
+ return userName;
+ }
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+ public Long getOpId() {
+ return opId;
+ }
+ public void setOpId(Long opId) {
+ this.opId = opId;
+ }
+ public String getLoginCode() {
+ return loginCode;
+ }
+ public void setLoginCode(String loginCode) {
+ this.loginCode = loginCode;
+ }
+ public Long getRoleId() {
+ return roleId;
+ }
+ public void setRoleId(Long roleId) {
+ this.roleId = roleId;
+ }
+ public Long getCityId() {
+ return cityId;
+ }
+ public void setCityId(Long cityId) {
+ this.cityId = cityId;
+ }
+ public String getCityName() {
+ return cityName;
+ }
+ public void setCityName(String cityName) {
+ this.cityName = cityName;
+ }
+
+
+
+
+
+}
diff --git a/src/main/java/com/zteits/oa/api/dto/asraop/param/AsraOpQueryReq.java b/src/main/java/com/zteits/oa/api/dto/asraop/param/AsraOpQueryReq.java
index e6f69c4..516e505 100644
--- a/src/main/java/com/zteits/oa/api/dto/asraop/param/AsraOpQueryReq.java
+++ b/src/main/java/com/zteits/oa/api/dto/asraop/param/AsraOpQueryReq.java
@@ -9,14 +9,21 @@ public class AsraOpQueryReq extends BaseRequest{
*/
private static final long serialVersionUID = 7249746348000980054L;
+ /**主键*/
+ private Long id;
+
/**登录工号*/
private String loginCode;
+
+ /**登录密码*/
+ private String loginPassword;
/**操作员姓名*/
private String opName;
/**员工邮箱*/
private String email;
+
public String getLoginCode() {
return loginCode;
@@ -42,9 +49,20 @@ public class AsraOpQueryReq extends BaseRequest{
this.email = email;
}
- @Override
- public String toString() {
- return "AsraOpQueryReq [loginCode=" + loginCode + ", opName=" + opName + ", email=" + email + "]";
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getLoginPassword() {
+ return loginPassword;
+ }
+
+ public void setLoginPassword(String loginPassword) {
+ this.loginPassword = loginPassword;
}
diff --git a/src/main/java/com/zteits/oa/api/dto/asraop/param/LoginOauthReq.java b/src/main/java/com/zteits/oa/api/dto/asraop/param/LoginOauthReq.java
new file mode 100644
index 0000000..bbec4e7
--- /dev/null
+++ b/src/main/java/com/zteits/oa/api/dto/asraop/param/LoginOauthReq.java
@@ -0,0 +1,46 @@
+package com.zteits.oa.api.dto.asraop.param;
+
+import java.io.Serializable;
+
+
+public class LoginOauthReq implements Serializable{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -5932514971605837490L;
+
+ /**登陆账号.*/
+ private String loginCode;
+
+ /**密码.*/
+ private String passWord;
+
+
+
+ public String getLoginCode() {
+ return loginCode;
+ }
+
+ public void setLoginCode(String loginCode) {
+ this.loginCode = loginCode == null ? null : loginCode.trim();
+ }
+
+ public String getPassWord() {
+ return passWord;
+ }
+
+ public void setPassWord(String passWord) {
+ this.passWord = passWord == null ? null : passWord.trim();
+ }
+
+ @Override
+ public String toString() {
+ return "LoginOauthReq [loginCode=" + loginCode + ", passWord=" + passWord + "]";
+ }
+
+
+
+
+
+}
diff --git a/src/main/java/com/zteits/oa/api/service/report/query/AsraOpRueryService.java b/src/main/java/com/zteits/oa/api/service/report/query/AsraOpRueryService.java
index 15912b7..82a9c86 100644
--- a/src/main/java/com/zteits/oa/api/service/report/query/AsraOpRueryService.java
+++ b/src/main/java/com/zteits/oa/api/service/report/query/AsraOpRueryService.java
@@ -32,4 +32,12 @@ public interface AsraOpRueryService {
* 2018年7月30日 wangfs.
*/
BizResult> queryAsraOpForPage(AsraOpQueryReq asraOpQueryReq);
+ /**
+ * 获取员工信息.
+ * @param asraOpQueryRe
+ * @return
+ * 2018年7月31日 wangfs.
+ */
+ BizResult queryAsraOp(AsraOpQueryReq asraOpQueryRe);
+
}
diff --git a/src/main/java/com/zteits/oa/configuration/WebMvcConfig.java b/src/main/java/com/zteits/oa/configuration/WebMvcConfig.java
index d339220..055b2ab 100644
--- a/src/main/java/com/zteits/oa/configuration/WebMvcConfig.java
+++ b/src/main/java/com/zteits/oa/configuration/WebMvcConfig.java
@@ -24,19 +24,19 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
/**
* 实现登陆拦截.
*/
- @Override
- public void addInterceptors(InterceptorRegistry registry) {
- InterceptorRegistration addInterceptor = null;//registry.addInterceptor();
-
- addInterceptor.excludePathPatterns("/error");
-
- addInterceptor.excludePathPatterns("/login**");
-
- addInterceptor.addPathPatterns("/**");
-
-
-
- }
+// @Override
+// public void addInterceptors(InterceptorRegistry registry) {
+// InterceptorRegistration addInterceptor = null;//registry.addInterceptor();
+//
+// addInterceptor.excludePathPatterns("/error");
+//
+// addInterceptor.excludePathPatterns("/login**");
+//
+// addInterceptor.addPathPatterns("/**");
+//
+//
+//
+// }
}
diff --git a/src/main/java/com/zteits/oa/report/biz/AsraOpRueryServiceImpl.java b/src/main/java/com/zteits/oa/report/biz/AsraOpRueryServiceImpl.java
index f23c7fc..a90c758 100644
--- a/src/main/java/com/zteits/oa/report/biz/AsraOpRueryServiceImpl.java
+++ b/src/main/java/com/zteits/oa/report/biz/AsraOpRueryServiceImpl.java
@@ -2,6 +2,7 @@ package com.zteits.oa.report.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;
@@ -51,5 +52,20 @@ public class AsraOpRueryServiceImpl implements AsraOpRueryService {
logger.info("---end查询分页员工信息..");
return new BizResult>(pageBean);
}
+ /**
+ * 获取员工信息.
+ * @param asraOpQueryRe
+ * @return
+ * 2018年7月31日 wangfs.
+ */
+ @Override
+ public BizResult queryAsraOp(AsraOpQueryReq asraOpQueryRe) {
+ AsraOpDTO asraOpDTO = new AsraOpDTO();
+ AsraOp queryAsraOp = asraOpDao.queryAsraOp(asraOpQueryRe);
+ if(queryAsraOp != null){
+ BeanUtils.copyProperties(queryAsraOp, asraOpDTO);
+ }
+ return new BizResult(asraOpDTO);
+ }
}
diff --git a/src/main/java/com/zteits/oa/report/dao/AsraOpDao.java b/src/main/java/com/zteits/oa/report/dao/AsraOpDao.java
index 5f4ca0c..649ad83 100644
--- a/src/main/java/com/zteits/oa/report/dao/AsraOpDao.java
+++ b/src/main/java/com/zteits/oa/report/dao/AsraOpDao.java
@@ -1,6 +1,8 @@
package com.zteits.oa.report.dao;
import com.github.pagehelper.PageInfo;
+import com.zteits.oa.api.base.bean.BizResult;
+import com.zteits.oa.api.dto.asraop.AsraOpDTO;
import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq;
import com.zteits.oa.report.domain.AsraOp;
@@ -13,4 +15,12 @@ public interface AsraOpDao {
* 2018年7月30日 wangfs.
*/
PageInfo queryAsraOpForPage(AsraOpQueryReq asraOpQueryReq);
+
+ /**
+ * 获取员工信息.
+ * @param asraOpQueryRe
+ * @return
+ * 2018年7月31日 wangfs.
+ */
+ AsraOp queryAsraOp(AsraOpQueryReq asraOpQueryRe);
}
diff --git a/src/main/java/com/zteits/oa/report/dao/impl/AsraOpDaoImpl.java b/src/main/java/com/zteits/oa/report/dao/impl/AsraOpDaoImpl.java
index 5d4e883..28ade5a 100644
--- a/src/main/java/com/zteits/oa/report/dao/impl/AsraOpDaoImpl.java
+++ b/src/main/java/com/zteits/oa/report/dao/impl/AsraOpDaoImpl.java
@@ -4,18 +4,26 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq;
import com.zteits.oa.report.dao.AsraOpDao;
import com.zteits.oa.report.domain.AsraOp;
+import com.zteits.oa.report.domain.AsraOpExample;
+import com.zteits.oa.report.domain.AsraOpExample.Criteria;
+import com.zteits.oa.report.mapper.AsraOpMapper;
import com.zteits.oa.report.mapper.smapper.AsraOpSmapper;
@Component
public class AsraOpDaoImpl implements AsraOpDao {
@Autowired
private AsraOpSmapper asraOpSmapper;
+
+ @Autowired
+ private AsraOpMapper asraOpMapper;
/**
* 分页查询工时系统员工信息.
* @param asraOpQueryReq
@@ -30,5 +38,28 @@ public class AsraOpDaoImpl implements AsraOpDao {
List list = asraOpSmapper.queryAsraOpForList(asraOpQueryReq);
return new PageInfo(list);
}
+
+ /**
+ * 获取员工信息.
+ * @param asraOpQueryRe
+ * @return
+ * 2018年7月31日 wangfs.
+ */
+ @Override
+ public AsraOp queryAsraOp(AsraOpQueryReq asraOpQueryRe) {
+ AsraOpExample example = new AsraOpExample();
+ Criteria criteria = example.createCriteria();
+ if(!StringUtils.isEmpty(asraOpQueryRe.getLoginCode())){
+ criteria.andLoginCodeEqualTo(asraOpQueryRe.getLoginCode());
+ }
+ if(!StringUtils.isEmpty(asraOpQueryRe.getLoginPassword())){
+ criteria.andLoginPasswordEqualTo(asraOpQueryRe.getLoginPassword());
+ }
+ if(asraOpQueryRe.getId() != null){
+ criteria.andIdEqualTo(asraOpQueryRe.getId());
+ }
+ List list = asraOpMapper.selectByExample(example);
+ return CollectionUtils.isEmpty(list) ? new AsraOp() : list.get(0);
+ }
}
diff --git a/src/main/java/com/zteits/oa/report/domain/AsraOp.java b/src/main/java/com/zteits/oa/report/domain/AsraOp.java
index 142898d..ee8b586 100644
--- a/src/main/java/com/zteits/oa/report/domain/AsraOp.java
+++ b/src/main/java/com/zteits/oa/report/domain/AsraOp.java
@@ -27,9 +27,6 @@ public class AsraOp {
/**地市名称*/
private String cityName;
- /**上级领导id 领导:-1*/
- private Long parentId;
-
/**是否邮件提醒 1:是,0:否*/
private Integer isRemindEmail;
@@ -137,16 +134,6 @@ public class AsraOp {
this.cityName = cityName == null ? null : cityName.trim();
}
- /**获取上级领导id 领导:-1*/
- public Long getParentId() {
- return parentId;
- }
-
- /**设置上级领导id 领导:-1*/
- public void setParentId(Long parentId) {
- this.parentId = parentId;
- }
-
/**获取是否邮件提醒 1:是,0:否*/
public Integer getIsRemindEmail() {
return isRemindEmail;
diff --git a/src/main/java/com/zteits/oa/report/domain/AsraOpExample.java b/src/main/java/com/zteits/oa/report/domain/AsraOpExample.java
index 090711c..ddca246 100644
--- a/src/main/java/com/zteits/oa/report/domain/AsraOpExample.java
+++ b/src/main/java/com/zteits/oa/report/domain/AsraOpExample.java
@@ -635,66 +635,6 @@ public class AsraOpExample {
return (Criteria) this;
}
- public Criteria andParentIdIsNull() {
- addCriterion("parent_id is null");
- return (Criteria) this;
- }
-
- public Criteria andParentIdIsNotNull() {
- addCriterion("parent_id is not null");
- return (Criteria) this;
- }
-
- public Criteria andParentIdEqualTo(Long value) {
- addCriterion("parent_id =", value, "parentId");
- return (Criteria) this;
- }
-
- public Criteria andParentIdNotEqualTo(Long value) {
- addCriterion("parent_id <>", value, "parentId");
- return (Criteria) this;
- }
-
- public Criteria andParentIdGreaterThan(Long value) {
- addCriterion("parent_id >", value, "parentId");
- return (Criteria) this;
- }
-
- public Criteria andParentIdGreaterThanOrEqualTo(Long value) {
- addCriterion("parent_id >=", value, "parentId");
- return (Criteria) this;
- }
-
- public Criteria andParentIdLessThan(Long value) {
- addCriterion("parent_id <", value, "parentId");
- return (Criteria) this;
- }
-
- public Criteria andParentIdLessThanOrEqualTo(Long value) {
- addCriterion("parent_id <=", value, "parentId");
- return (Criteria) this;
- }
-
- public Criteria andParentIdIn(List values) {
- addCriterion("parent_id in", values, "parentId");
- return (Criteria) this;
- }
-
- public Criteria andParentIdNotIn(List values) {
- addCriterion("parent_id not in", values, "parentId");
- return (Criteria) this;
- }
-
- public Criteria andParentIdBetween(Long value1, Long value2) {
- addCriterion("parent_id between", value1, value2, "parentId");
- return (Criteria) this;
- }
-
- public Criteria andParentIdNotBetween(Long value1, Long value2) {
- addCriterion("parent_id not between", value1, value2, "parentId");
- return (Criteria) this;
- }
-
public Criteria andIsRemindEmailIsNull() {
addCriterion("is_remind_email is null");
return (Criteria) this;
diff --git a/src/main/java/com/zteits/oa/report/web/OAuthController.java b/src/main/java/com/zteits/oa/report/web/OAuthController.java
new file mode 100644
index 0000000..633a374
--- /dev/null
+++ b/src/main/java/com/zteits/oa/report/web/OAuthController.java
@@ -0,0 +1,106 @@
+package com.zteits.oa.report.web;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.StringUtils;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.zteits.oa.api.base.bean.BizResult;
+import com.zteits.oa.api.base.constants.ErrorType;
+import com.zteits.oa.api.base.constants.SessionEnum;
+import com.zteits.oa.api.dto.asraop.AsraOpDTO;
+import com.zteits.oa.api.dto.asraop.LoginOathRes;
+import com.zteits.oa.api.dto.asraop.param.AsraOpQueryReq;
+import com.zteits.oa.api.dto.asraop.param.LoginOauthReq;
+import com.zteits.oa.api.service.report.query.AsraOpRueryService;
+import com.zteits.oa.util.MD5Utils;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+@Api("用户登录授权")
+@RestController
+@RequestMapping("/oauth")
+public class OAuthController {
+ private static final Logger logger = LoggerFactory.getLogger(OAuthController.class);
+
+ @Autowired
+ private AsraOpRueryService asraOpRueryService;
+
+ @Autowired
+ private HttpServletRequest request;
+
+ @ApiOperation("用户登录")
+ @PostMapping("/login")
+ public BizResult login(@RequestBody LoginOauthReq req ) throws Exception {
+ BizResult result = this._login(req);
+ return result;
+ }
+ /**
+ * 登陆验证.
+ * @param req
+ * @return
+ * 2018年7月31日 wangfs.
+ */
+ private BizResult _login(LoginOauthReq req ){
+ BizResult result = new BizResult();
+ LoginOathRes loginOathRes = new LoginOathRes();
+ String loginCode = req.getLoginCode();
+ String passWord = req.getPassWord();
+ if(StringUtils.isEmpty(loginCode) || StringUtils.isEmpty(passWord)) {
+ logger.info("校验登录信息,用户名 或者 登录密码为空!");
+ result.setErrorInfo(ErrorType.PARAMM_NULL, "用户名 或者 登录密码为空");
+ }
+ AsraOpQueryReq asraOpQueryRe = new AsraOpQueryReq();
+ AsraOpDTO asraOpDTO = new AsraOpDTO();
+ boolean isCheckSuccess = false;
+ //1.判断登录账号/密码
+ asraOpQueryRe.setLoginCode(loginCode);
+ BizResult asraOpReult = asraOpRueryService.queryAsraOp(asraOpQueryRe);
+ if(asraOpReult != null && asraOpReult.getData() != null){
+ asraOpDTO = asraOpReult.getData();
+ if(StringUtils.isEmpty(asraOpDTO.getLoginCode())){
+ logger.info("{}登录账号不存在",loginCode);
+ result.setErrorInfo(ErrorType.AUTH_LOGIN_ERROR, "登录账号不存在!");
+ }else{
+ if(!asraOpDTO.getLoginPassword().equalsIgnoreCase(MD5Utils.enMD5(passWord))){
+ logger.info("{}登录账号输入的密码不正确",loginCode);
+ result.setErrorInfo(ErrorType.AUTH_PASS_ERROR, "登录密码不匹配!");
+ }else{
+ isCheckSuccess = true;
+ }
+ }
+
+ }else{
+ result.setErrorInfo(ErrorType.BIZ_ERROR, "用户登录失败");
+ }
+
+
+ if(isCheckSuccess){
+ HttpSession session = request.getSession();
+ session.setAttribute(SessionEnum.USER_INFO.key(), asraOpDTO);
+ logger.info("---获取到的session_id={}",session.getId());
+ loginOathRes.setOpId(asraOpDTO.getId());
+ loginOathRes.setLoginCode(loginCode);
+ loginOathRes.setUserName(asraOpDTO.getOpName());
+ loginOathRes.setCityId(asraOpDTO.getCityId());
+ loginOathRes.setCityName(asraOpDTO.getCityName());
+ loginOathRes.setAccessToken(session.getId());
+ result.setData(loginOathRes);
+ result.setErrorInfo(ErrorType.BIZ_SUCCESS, "登录成功");
+ }
+
+
+ return result;
+ }
+
+
+
+}
diff --git a/src/main/java/com/zteits/oa/report/web/demo/DemoController.java b/src/main/java/com/zteits/oa/report/web/demo/DemoController.java
deleted file mode 100644
index 90af109..0000000
--- a/src/main/java/com/zteits/oa/report/web/demo/DemoController.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.zteits.oa.report.web.demo;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.beans.factory.annotation.Autowired;
-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 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;
-import com.zteits.oa.api.service.report.query.AsraOpRueryService;
-
-import io.swagger.annotations.Api;
-
-@Api(value = "swagger测试", description = "swagger测")
-@RestController
-@RequestMapping("/demo")
-public class DemoController {
- @Autowired
- private AsraOpRueryService asraOpRueryService;
-
- @RequestMapping(value="/demo",method = RequestMethod.POST)
- public BizResult> test(@RequestBody AsraOpQueryReq asraOpQueryReq, HttpServletRequest request){
- BizResult> result = asraOpRueryService.queryAsraOpForPage(asraOpQueryReq);
- return result;
- }
-
-}
diff --git a/src/main/java/com/zteits/oa/util/MD5Utils.java b/src/main/java/com/zteits/oa/util/MD5Utils.java
new file mode 100644
index 0000000..8c756c4
--- /dev/null
+++ b/src/main/java/com/zteits/oa/util/MD5Utils.java
@@ -0,0 +1,50 @@
+package com.zteits.oa.util;
+
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+/**
+ *
+ * Copyright: Copyright (c) 2017 ZTE-ITS
+ *
+ * @ClassName: MD5Utils.java
+ * @Description:
+ * @version: v1.0.0
+ * @author: wangbiao
+ * @date: 2017年4月21日 下午4:12:16
+ * Modification History:
+ * Date Author Version Description
+ *---------------------------------------------------------*
+ * 2017年4月21日 wangbiao v1.0.0 创建
+ */
+public class MD5Utils {
+ public final static String enMD5(String s) {
+ char hexDigits[]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
+ try {
+ byte[] btInput = s.getBytes();
+ // 获得MD5摘要算法的 MessageDigest 对象
+ MessageDigest mdInst = MessageDigest.getInstance("MD5");
+ // 使用指定的字节更新摘要
+ mdInst.update(btInput);
+ // 获得密文
+ byte[] md = mdInst.digest();
+ // 把密文转换成十六进制的字符串形式
+ int j = md.length;
+ char str[] = new char[j * 2];
+ int k = 0;
+ for (int i = 0; i < j; i++) {
+ byte byte0 = md[i];
+ str[k++] = hexDigits[byte0 >>> 4 & 0xf];
+ str[k++] = hexDigits[byte0 & 0xf];
+ }
+ return new String(str);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ public static void main(String[] args) {
+ System.out.println(MD5Utils.enMD5("123qwe"));
+ }
+
+}
diff --git a/src/main/resources/generator/generatorConfig.xml b/src/main/resources/generator/generatorConfig.xml
index 86501d3..761b5d0 100644
--- a/src/main/resources/generator/generatorConfig.xml
+++ b/src/main/resources/generator/generatorConfig.xml
@@ -54,7 +54,7 @@
-
+
diff --git a/src/main/resources/mybatis/mapper/AsraOpMapper.xml b/src/main/resources/mybatis/mapper/AsraOpMapper.xml
index aa0321d..384fd33 100644
--- a/src/main/resources/mybatis/mapper/AsraOpMapper.xml
+++ b/src/main/resources/mybatis/mapper/AsraOpMapper.xml
@@ -10,7 +10,6 @@
-
@@ -80,9 +79,9 @@
- id, login_code, login_password, op_name, email, role_id, city_id, city_name, parent_id,
- is_remind_email, data_state, create_empid, create_emp_name, create_date, modfiy_empid,
- modfiy_emp_name, modfiy_date, remark
+ id, login_code, login_password, op_name, email, role_id, city_id, city_name, is_remind_email,
+ data_state, create_empid, create_emp_name, create_date, modfiy_empid, modfiy_emp_name,
+ modfiy_date, remark