Commit b3b9aa50 by java-李谡

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

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