Commit b3b9aa50 by java-李谡

bug修改,微会议密码encode,航线论证统计算法修改

parent c50ec7d5
...@@ -61,7 +61,7 @@ public class StatisticalService extends BaseService<StatisticalDao> { ...@@ -61,7 +61,7 @@ public class StatisticalService extends BaseService<StatisticalDao> {
} else { } else {
Integer day = dao.getDay(e); Integer day = dao.getDay(e);
if (day != null) { if (day != null) {
if (day > 180) { if (day > 180 && Integer.parseInt(e.getExpiryDate()) > 180) {
day = 180 - day; day = 180 - day;
e.setExpiryDate(day + ""); e.setExpiryDate(day + "");
} else { } else {
......
...@@ -91,12 +91,14 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -91,12 +91,14 @@ public class UserService extends CurdService<UserDao, UserEntity> {
UserEntity UserEntity = dao.getUser(entity); UserEntity UserEntity = dao.getUser(entity);
return UserEntity; return UserEntity;
} }
public LoginUserEntity findUserByLoginName(String loginName) { public LoginUserEntity findUserByLoginName(String loginName) {
LoginBean bean = new LoginBean(); LoginBean bean = new LoginBean();
bean.setLoginName(loginName); bean.setLoginName(loginName);
LoginUserEntity userEntity = dao.findUserByLoginName(bean); LoginUserEntity userEntity = dao.findUserByLoginName(bean);
return userEntity; return userEntity;
} }
public LoginUserEntity findUserByLoginName(LoginBean bean) { public LoginUserEntity findUserByLoginName(LoginBean bean) {
LoginUserEntity userEntity = dao.findUserByLoginName(bean); LoginUserEntity userEntity = dao.findUserByLoginName(bean);
return userEntity; return userEntity;
...@@ -118,13 +120,14 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -118,13 +120,14 @@ public class UserService extends CurdService<UserDao, UserEntity> {
// HASH_INTERATIONS); // HASH_INTERATIONS);
// return Encodes.encodeHex(salt) + Encodes.encodeHex(hashPassword); // return Encodes.encodeHex(salt) + Encodes.encodeHex(hashPassword);
// } // }
/** /**
* 根据用户类型查询用户列表 * 根据用户类型查询用户列表
* *
* @author renmb
* @time 2016年8月31日
* @param userType * @param userType
* @return * @return
* @author renmb
* @time 2016年8月31日
*/ */
public List<UserListEntity> findUserByType(String userType, String keywords) { public List<UserListEntity> findUserByType(String userType, String keywords) {
UserByTypeBean bean = new UserByTypeBean(); UserByTypeBean bean = new UserByTypeBean();
...@@ -136,13 +139,13 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -136,13 +139,13 @@ public class UserService extends CurdService<UserDao, UserEntity> {
/** /**
* 获取指定条数的用户列表 * 获取指定条数的用户列表
* *
* @author renmb
* @time 2016年10月28日
* @param userType * @param userType
* @param pageSize * @param pageSize
* @param keywords * @param keywords
* @param huaweiStatus * @param huaweiStatus
* @return * @return
* @author renmb
* @time 2016年10月28日
*/ */
public List<UserListEntity> findTopUserByType(String userType, int pageSize, String keywords, String huaweiStatus) { public List<UserListEntity> findTopUserByType(String userType, int pageSize, String keywords, String huaweiStatus) {
UserByTypeBean bean = new UserByTypeBean(); UserByTypeBean bean = new UserByTypeBean();
...@@ -156,12 +159,12 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -156,12 +159,12 @@ public class UserService extends CurdService<UserDao, UserEntity> {
/** /**
* 分页查询用户列表 * 分页查询用户列表
* *
* @author renmb
* @time 2016年9月9日
* @param userType * @param userType
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @return * @return
* @author renmb
* @time 2016年9月9日
*/ */
public PageEntity<UserListEntity> findUserByType(String userType, int pageNo, int pageSize, String huaweiStatus) { public PageEntity<UserListEntity> findUserByType(String userType, int pageNo, int pageSize, String huaweiStatus) {
UserByTypeBean bean = new UserByTypeBean(); UserByTypeBean bean = new UserByTypeBean();
...@@ -194,27 +197,27 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -194,27 +197,27 @@ public class UserService extends CurdService<UserDao, UserEntity> {
/** /**
* 分页查询用户列表(通过用户Id) * 分页查询用户列表(通过用户Id)
* *
* @author renmb
* @time 2016年9月9日
* @param userType * @param userType
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @return * @return
* @author renmb
* @time 2016年9月9日
*/ */
public PageEntity<UserListEntity> findUserByTypeAndOffice(String userType,int pageNo, int pageSize, public PageEntity<UserListEntity> findUserByTypeAndOffice(String userType, int pageNo, int pageSize,
String huaweiStatus, List<String> officeIds, String companyId,Integer type) { String huaweiStatus, List<String> officeIds, String companyId, Integer type) {
UserByTypeBean bean = new UserByTypeBean(); UserByTypeBean bean = new UserByTypeBean();
bean.setHuaweiStatus(huaweiStatus); bean.setHuaweiStatus(huaweiStatus);
bean.setUserType(userType); bean.setUserType(userType);
PageInfo<UserListEntity> pageInfo = null; PageInfo<UserListEntity> pageInfo = null;
// 必须紧贴dao的查询方法 // 必须紧贴dao的查询方法
if(type == 0){// 分级第一个接口 if (type == 0) {// 分级第一个接口
bean.setCompanyId(companyId); bean.setCompanyId(companyId);
PageHelper.startPage(pageNo, pageSize); PageHelper.startPage(pageNo, pageSize);
pageInfo = new PageInfo<UserListEntity>(dao.findOuterUser(bean)); pageInfo = new PageInfo<UserListEntity>(dao.findOuterUser(bean));
}else{ } else {
if(checkIsCompany(companyId) && "0".equals(userType)){// 判断 companyId是否为公司id if (checkIsCompany(companyId) && "0".equals(userType)) {// 判断 companyId是否为公司id
officeIds.add("0"); officeIds.add("0");
bean.setCompanyId(companyId); bean.setCompanyId(companyId);
} }
...@@ -241,10 +244,10 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -241,10 +244,10 @@ public class UserService extends CurdService<UserDao, UserEntity> {
/** /**
* 修改某个席位的登录信息 * 修改某个席位的登录信息
* *
* @author renmb
* @time 2017年3月22日
* @param seatloginBean * @param seatloginBean
* @return * @return
* @author renmb
* @time 2017年3月22日
*/ */
@Transactional(readOnly = false) @Transactional(readOnly = false)
public boolean updateUserSeat(SeatLoginBean seatloginBean) { public boolean updateUserSeat(SeatLoginBean seatloginBean) {
...@@ -252,13 +255,14 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -252,13 +255,14 @@ public class UserService extends CurdService<UserDao, UserEntity> {
Integer count = dao.updateUserSeat(seatloginBean); Integer count = dao.updateUserSeat(seatloginBean);
return count != null && count != 0; return count != null && count != 0;
} }
/** /**
* 退出席位登录 * 退出席位登录
* *
* @author renmb
* @time 2017年3月29日
* @param seatloginBean * @param seatloginBean
* @return * @return
* @author renmb
* @time 2017年3月29日
*/ */
@Transactional(readOnly = false) @Transactional(readOnly = false)
public boolean updateSeatUserLogout(SeatLoginBean seatloginBean) { public boolean updateSeatUserLogout(SeatLoginBean seatloginBean) {
...@@ -266,26 +270,28 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -266,26 +270,28 @@ public class UserService extends CurdService<UserDao, UserEntity> {
Integer count = dao.updateSeatUserLogout(seatloginBean); Integer count = dao.updateSeatUserLogout(seatloginBean);
return count != null && count != 0; return count != null && count != 0;
} }
/** /**
* 清空用户之前的席位登录信息 * 清空用户之前的席位登录信息
* *
* @author renmb
* @time 2017年3月22日
* @param seatloginBean * @param seatloginBean
* @return * @return
* @author renmb
* @time 2017年3月22日
*/ */
@Transactional(readOnly = false) @Transactional(readOnly = false)
public boolean updateUserSeatLoginEmpty(SeatLoginBean seatloginBean) { public boolean updateUserSeatLoginEmpty(SeatLoginBean seatloginBean) {
Integer count = dao.updateUserSeatLoginEmpty(seatloginBean); Integer count = dao.updateUserSeatLoginEmpty(seatloginBean);
return count != null && count != 0; return count != null && count != 0;
} }
/** /**
* 修改用户头像 * 修改用户头像
* *
* @author renmb
* @time 2016年9月7日
* @param bean * @param bean
* @return * @return
* @author renmb
* @time 2016年9月7日
*/ */
@Transactional(readOnly = false) @Transactional(readOnly = false)
public boolean updateUserPhoto(UserPhotoBean bean) { public boolean updateUserPhoto(UserPhotoBean bean) {
...@@ -304,7 +310,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -304,7 +310,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
return dao.getUserSeat(seatloginBean); return dao.getUserSeat(seatloginBean);
} }
public UserSeatMobileBean getUserSeatMobileBean(SeatLoginBean seatloginBean){ public UserSeatMobileBean getUserSeatMobileBean(SeatLoginBean seatloginBean) {
return dao.getUserSeatMobileBean(seatloginBean); return dao.getUserSeatMobileBean(seatloginBean);
} }
...@@ -320,12 +326,12 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -320,12 +326,12 @@ public class UserService extends CurdService<UserDao, UserEntity> {
public boolean validateServerPassword(LoginBean loginBean) { public boolean validateServerPassword(LoginBean loginBean) {
long startTime = System.nanoTime();// 开始计时时间 long startTime = System.nanoTime();// 开始计时时间
try { try {
if(GConstants.getBoolean("use.new.login.api", false)){// 使用新的登录地址,默认使用旧地址 if (GConstants.getBoolean("use.new.login.api", false)) {// 使用新的登录地址,默认使用旧地址
boolean isSuccess = HTTPClientUtil.callLogin(loginBean.getLoginName(), loginBean.getPassword());// 进行秘密校验 boolean isSuccess = HTTPClientUtil.callLogin(loginBean.getLoginName(), loginBean.getPassword());// 进行秘密校验
long endTime = System.nanoTime();// 结束计时时间 long endTime = System.nanoTime();// 结束计时时间
long duration = endTime - startTime; long duration = endTime - startTime;
LOG.debug("[UserService login][validateServerPassword]["+isSuccess+"]总共用时:" + Util.getDurationTime(duration)); LOG.info("[UserService login][validateServerPassword][" + isSuccess + "]总共用时:" + Util.getDurationTime(duration));
return isSuccess; return isSuccess;
} }
StringBuilder buf = new StringBuilder(GConstants.getValue("hn.api.base.url", "https://dsp.jdair.net")); StringBuilder buf = new StringBuilder(GConstants.getValue("hn.api.base.url", "https://dsp.jdair.net"));
...@@ -334,9 +340,9 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -334,9 +340,9 @@ public class UserService extends CurdService<UserDao, UserEntity> {
buf.append("&loginId="); buf.append("&loginId=");
buf.append(URLEncoder.encode(loginBean.getLoginName(), "UTF-8")); buf.append(URLEncoder.encode(loginBean.getLoginName(), "UTF-8"));
buf.append("&password="); buf.append("&password=");
buf.append(loginBean.getPassword()); buf.append(URLEncoder.encode(loginBean.getPassword(), "UTF-8"));
LOG.info("密码encode后;"+URLEncoder.encode(loginBean.getPassword(),"UTF-8"));
LOG.debug("[UserService login][validateServerPassword][URL]:" + buf.toString()); LOG.info("[UserService login][validateServerPassword][URL]:" + buf.toString());
HCFetcher fetcher = HCFetcher.getInstance(); HCFetcher fetcher = HCFetcher.getInstance();
FetchEntity entity = fetcher.get(buf.toString()); FetchEntity entity = fetcher.get(buf.toString());
...@@ -346,12 +352,12 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -346,12 +352,12 @@ public class UserService extends CurdService<UserDao, UserEntity> {
} }
if (entity != null) { if (entity != null) {
String text = entity.getContent("UTF-8"); String text = entity.getContent("UTF-8");
LOG.debug("[UserService validateServerPassword][result]:" + text); LOG.info("[UserService validateServerPassword][result]:" + text);
JSONObject response = JSON.parseObject(text); JSONObject response = JSON.parseObject(text);
if (response.get("result") == null) { if (response.get("result") == null) {
long endTime = System.nanoTime(); long endTime = System.nanoTime();
long duration = endTime - startTime; long duration = endTime - startTime;
LOG.debug("[UserService login][validateServerPassword][FAILD]总共用时:" + Util.getDurationTime(duration)); LOG.info("[UserService login][validateServerPassword][FAILD]总共用时:" + Util.getDurationTime(duration));
return false; return false;
} }
JSONObject result = response.getJSONObject("result"); JSONObject result = response.getJSONObject("result");
...@@ -359,7 +365,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -359,7 +365,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
long endTime = System.nanoTime(); long endTime = System.nanoTime();
long duration = endTime - startTime; long duration = endTime - startTime;
LOG.debug("[UserService login][validateServerPassword][SUCCESS]总共用时:" + Util.getDurationTime(duration)); LOG.info("[UserService login][validateServerPassword][SUCCESS]总共用时:" + Util.getDurationTime(duration));
return true; return true;
} }
} }
...@@ -371,9 +377,10 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -371,9 +377,10 @@ public class UserService extends CurdService<UserDao, UserEntity> {
} }
long endTime = System.nanoTime(); long endTime = System.nanoTime();
long duration = endTime - startTime; long duration = endTime - startTime;
LOG.debug("[UserService validateServerPassword][FAILD]总共用时:" + Util.getDurationTime(duration)); LOG.info("[UserService validateServerPassword][FAILD]总共用时:" + Util.getDurationTime(duration));
return false; return false;
} }
/** /**
* 验证远程Server密码 ,如果登陆成功,则更新数据库的字段 * 验证远程Server密码 ,如果登陆成功,则更新数据库的字段
* *
...@@ -390,12 +397,12 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -390,12 +397,12 @@ public class UserService extends CurdService<UserDao, UserEntity> {
// DESPlus desPlus = new DESPlus(); // DESPlus desPlus = new DESPlus();
// buf.append(loginBean.getLoginName()).append("&password=").append(desPlus.encrypt(loginBean.getPassword())); // buf.append(loginBean.getLoginName()).append("&password=").append(desPlus.encrypt(loginBean.getPassword()));
if(GConstants.getBoolean("use.new.login.api", false)){// 使用新的登录地址,默认使用旧地址 if (GConstants.getBoolean("use.new.login.api", false)) {// 使用新的登录地址,默认使用旧地址
boolean isSuccess = HTTPClientUtil.callLogin(loginBean.getLoginName(), loginBean.getPassword());// 进行秘密校验 boolean isSuccess = HTTPClientUtil.callLogin(loginBean.getLoginName(), loginBean.getPassword());// 进行秘密校验
long endTime = System.nanoTime();// 结束计时时间 long endTime = System.nanoTime();// 结束计时时间
long duration = endTime - startTime; long duration = endTime - startTime;
LOG.debug("[UserService login][validateServerPassword]["+isSuccess+"]总共用时:" + Util.getDurationTime(duration)); LOG.debug("[UserService login][validateServerPassword][" + isSuccess + "]总共用时:" + Util.getDurationTime(duration));
return isSuccess; return isSuccess;
} }
StringBuilder buf = new StringBuilder(GConstants.JDAIR_BASE_API StringBuilder buf = new StringBuilder(GConstants.JDAIR_BASE_API
...@@ -630,7 +637,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -630,7 +637,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
public Integer updateUserDeviceInfo(UserLoginLogEntity deviceInfoEntity) { public Integer updateUserDeviceInfo(UserLoginLogEntity deviceInfoEntity) {
if(StringUtils.isNotEmpty(deviceInfoEntity.getDeviceToken())){// 解绑非空的设备绑定 if (StringUtils.isNotEmpty(deviceInfoEntity.getDeviceToken())) {// 解绑非空的设备绑定
dao.unBindDeviceUserInfo(deviceInfoEntity);// 解绑绑定此设备的用户 dao.unBindDeviceUserInfo(deviceInfoEntity);// 解绑绑定此设备的用户
} }
...@@ -646,34 +653,36 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -646,34 +653,36 @@ public class UserService extends CurdService<UserDao, UserEntity> {
} }
public Integer addLoginLog(UserLoginLogEntity loginInfoEntity) { public Integer addLoginLog(UserLoginLogEntity loginInfoEntity) {
if(StringUtils.isEmpty(loginInfoEntity.getSeatId())) if (StringUtils.isEmpty(loginInfoEntity.getSeatId()))
loginInfoEntity.setSeatId(""); loginInfoEntity.setSeatId("");
loginInfoEntity.setId(IdWorker.getNextNumId()); loginInfoEntity.setId(IdWorker.getNextNumId());
return dao.addLoginLog(loginInfoEntity); return dao.addLoginLog(loginInfoEntity);
} }
public Integer updateUserLoginInfo(UserLoginLogEntity loginInfoEntity) { public Integer updateUserLoginInfo(UserLoginLogEntity loginInfoEntity) {
return dao.updateUserLoginInfo(loginInfoEntity); return dao.updateUserLoginInfo(loginInfoEntity);
} }
private boolean checkIsCompany(String companyId){ private boolean checkIsCompany(String companyId) {
boolean flag = false; boolean flag = false;
UserByTypeBean bean = new UserByTypeBean(); UserByTypeBean bean = new UserByTypeBean();
bean.setCompanyId(companyId); bean.setCompanyId(companyId);
String parentsId = dao.checkIsCompany(bean); String parentsId = dao.checkIsCompany(bean);
if("0".equals(parentsId)){ if ("0".equals(parentsId)) {
flag = true; flag = true;
} }
return flag; return flag;
} }
/** /**
* 修改用户的修为值班电话 * 修改用户的修为值班电话
* *
* @author renmb
* @time 2017年1月18日
* @param seatloginBean * @param seatloginBean
* @return * @return
* @author renmb
* @time 2017年1月18日
*/ */
@Transactional(readOnly = false) @Transactional(readOnly = false)
public boolean updateUserSeatMobile(UserSeatMobileBean seatloginBean) { public boolean updateUserSeatMobile(UserSeatMobileBean seatloginBean) {
...@@ -682,14 +691,13 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -682,14 +691,13 @@ public class UserService extends CurdService<UserDao, UserEntity> {
} }
/** /**
* * @param bean
* @author zhanglg * @author zhanglg
* @time 2017年2月22日 * @time 2017年2月22日
* @param bean
*/ */
public void updateOuterUser(OuterUserBean bean) { public void updateOuterUser(OuterUserBean bean) {
dao.updateOuterUser( bean); dao.updateOuterUser(bean);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment