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 {
......
...@@ -41,7 +41,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -41,7 +41,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
/** /**
* 通过CODE获取用户ID * 通过CODE获取用户ID
* *
* @param userCode * @param userCode
* @return * @return
*/ */
...@@ -60,7 +60,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -60,7 +60,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
/** /**
* 注册用户 * 注册用户
* *
* @param entity * @param entity
* @return * @return
*/ */
...@@ -71,7 +71,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -71,7 +71,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
/** /**
* 插入验证码 * 插入验证码
* *
* @param telephone * @param telephone
* @param verifyCode * @param verifyCode
* @return * @return
...@@ -83,7 +83,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -83,7 +83,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
/** /**
* 用户登录 * 用户登录
* *
* @param entity * @param entity
* @return * @return
*/ */
...@@ -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();
...@@ -135,14 +138,14 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -135,14 +138,14 @@ 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();
...@@ -155,13 +158,13 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -155,13 +158,13 @@ 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();
...@@ -193,30 +196,30 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -193,30 +196,30 @@ 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);
} }
bean.setOfficeId(officeIds); bean.setOfficeId(officeIds);
PageHelper.startPage(pageNo, pageSize); PageHelper.startPage(pageNo, pageSize);
...@@ -240,11 +243,11 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -240,11 +243,11 @@ 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) {
...@@ -299,12 +305,12 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -299,12 +305,12 @@ public class UserService extends CurdService<UserDao, UserEntity> {
seatloginBean.setSeatId(seatId); seatloginBean.setSeatId(seatId);
return dao.getUserSeat(seatloginBean); return dao.getUserSeat(seatloginBean);
} }
public UserSeatEntity getSeatsEntity(SeatLoginBean seatloginBean) { public UserSeatEntity getSeatsEntity(SeatLoginBean seatloginBean) {
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,24 +340,24 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -334,24 +340,24 @@ 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());
if (entity == null) {// 再次重新尝试获取内容 if (entity == null) {// 再次重新尝试获取内容
entity = fetcher.get(buf.toString()); entity = fetcher.get(buf.toString());
} }
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,24 +365,25 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -359,24 +365,25 @@ 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;
} }
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
// if (fetcher != null) {fetcher.shutdown();} // if (fetcher != null) {fetcher.shutdown();}
} }
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密码 ,如果登陆成功,则更新数据库的字段
* *
* @return 验证成功返回true * @return 验证成功返回true
*/ */
@Transactional(readOnly = false) @Transactional(readOnly = false)
...@@ -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
...@@ -406,15 +413,15 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -406,15 +413,15 @@ public class UserService extends CurdService<UserDao, UserEntity> {
buf.append("&loginId=").append(URLEncoder.encode(loginBean.getLoginName(), "UTF-8")).append("&password=").append(encrypt); buf.append("&loginId=").append(URLEncoder.encode(loginBean.getLoginName(), "UTF-8")).append("&password=").append(encrypt);
LOG.debug("[UserService login][validateServerPassword][URL]:" + buf.toString()); LOG.debug("[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());
if (entity == null) {// 再次重新尝试获取内容 if (entity == null) {// 再次重新尝试获取内容
entity = fetcher.get(buf.toString()); entity = fetcher.get(buf.toString());
} }
if (entity != null) { if (entity != null) {
// {"result":{"message":"succ","viewMessage":"成功","resultCode":"1000"},"data":{"messageCount":0,"mess":"用户chl.zhou登录成功"}} // {"result":{"message":"succ","viewMessage":"成功","resultCode":"1000"},"data":{"messageCount":0,"mess":"用户chl.zhou登录成功"}}
// Map<String, Object> response = JSON.parseObject(entity.getContent("UTF-8"), // Map<String, Object> response = JSON.parseObject(entity.getContent("UTF-8"),
// new TypeReference<Map<String, Object>>() { // new TypeReference<Map<String, Object>>() {
// }); // });
...@@ -429,7 +436,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -429,7 +436,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
} }
// @SuppressWarnings("unchecked") // @SuppressWarnings("unchecked")
// Map<String, String> result = (Map<String, String>) response.get("result"); // Map<String, String> result = (Map<String, String>) response.get("result");
JSONObject result = response.getJSONObject("result"); JSONObject result = response.getJSONObject("result");
if ("1000".equals(result.getString("resultCode"))) { // 远程服务器登陆成功,更改数据库密码 if ("1000".equals(result.getString("resultCode"))) { // 远程服务器登陆成功,更改数据库密码
/* /*
...@@ -449,7 +456,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -449,7 +456,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
} }
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} finally { } finally {
// if (fetcher != null) {fetcher.shutdown();} // if (fetcher != null) {fetcher.shutdown();}
...@@ -460,7 +467,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -460,7 +467,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
return false; return false;
} }
public PageEntity<UserListEntity> getUserList(UserListBean bean) { public PageEntity<UserListEntity> getUserList(UserListBean bean) {
PageInfo<UserListEntity> pageInfo = null; PageInfo<UserListEntity> pageInfo = null;
// 必须紧贴dao的查询方法 // 必须紧贴dao的查询方法
...@@ -485,7 +492,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -485,7 +492,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
public PageEntity<UserListEntity> searchUserInfo(SearchUserBean bean) { public PageEntity<UserListEntity> searchUserInfo(SearchUserBean bean) {
PageInfo<UserListEntity> pageInfo = null; PageInfo<UserListEntity> pageInfo = null;
// if(bean.getOfficeIds() != null && // if(bean.getOfficeIds() != null &&
// checkIsCompany(bean.getOfficeId()) && // checkIsCompany(bean.getOfficeId()) &&
// "0".equals(bean.getType())){// 判断 companyId是否为公司id // "0".equals(bean.getType())){// 判断 companyId是否为公司id
...@@ -495,7 +502,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -495,7 +502,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
// 必须紧贴dao的查询方法 // 必须紧贴dao的查询方法
PageHelper.startPage(bean.getPageNo(), bean.getPageSize()); PageHelper.startPage(bean.getPageNo(), bean.getPageSize());
pageInfo = new PageInfo<UserListEntity>(dao.getUserInfo(bean)); pageInfo = new PageInfo<UserListEntity>(dao.getUserInfo(bean));
if (pageInfo.getPages() < bean.getPageNo()) {// 页码大于总页数,则返回NULL if (pageInfo.getPages() < bean.getPageNo()) {// 页码大于总页数,则返回NULL
return null; return null;
} }
...@@ -515,7 +522,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -515,7 +522,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
/** /**
* 得到用户席位相关信息,为用户的时候,席位相关的信息为空,type为USER,反正也是 * 得到用户席位相关信息,为用户的时候,席位相关的信息为空,type为USER,反正也是
* *
* @param bean * @param bean
* @return * @return
*/ */
...@@ -580,7 +587,7 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -580,7 +587,7 @@ public class UserService extends CurdService<UserDao, UserEntity> {
buf.append("&loginId=").append("yan_zhang3").append("&password=").append(miwen); buf.append("&loginId=").append("yan_zhang3").append("&password=").append(miwen);
System.out.println(buf.toString()); System.out.println(buf.toString());
// FetchEntity entity = HCFetcher.getInstance().post(buf.toString(), null); // FetchEntity entity = HCFetcher.getInstance().post(buf.toString(), null);
// if (entity.isSuccess()) { // if (entity.isSuccess()) {
// System.out.println(entity.getContent("UTF-8")); // System.out.println(entity.getContent("UTF-8"));
...@@ -630,8 +637,8 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -630,8 +637,8 @@ 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);// 解绑绑定此设备的用户
} }
return dao.insertUserDeviceInfo(deviceInfoEntity); return dao.insertUserDeviceInfo(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,15 +691,14 @@ public class UserService extends CurdService<UserDao, UserEntity> { ...@@ -682,15 +691,14 @@ public class UserService extends CurdService<UserDao, UserEntity> {
} }
/** /**
*
* @author zhanglg
* @time 2017年2月22日
* @param bean * @param bean
* @author zhanglg
* @time 2017年2月22日
*/ */
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