Commit 7a1154e6 by 徐高华

托管mac

parent 2ba2eb9f
...@@ -27,9 +27,11 @@ public interface OpenStaffService { ...@@ -27,9 +27,11 @@ public interface OpenStaffService {
* @param qwUserId * @param qwUserId
* @return * @return
*/ */
String autoLogin(Long openStaffId , Long qwUserId) ; String autoLogin(Long openStaffId , Long qwUserId ,String wxEnterpriseId) ;
void openStaffTimer(); void openStaffTimer();
void openStaffServiceTimer(); void openStaffServiceTimer();
String getDeverType(String wxEnterpriseId) ;
} }
...@@ -223,8 +223,8 @@ public class OpenStaffServiceImpl implements OpenStaffService { ...@@ -223,8 +223,8 @@ public class OpenStaffServiceImpl implements OpenStaffService {
} }
@Override @Override
public String autoLogin(Long openStaffId, Long qwUserId) { public String autoLogin(Long openStaffId, Long qwUserId , String wxEnterpriseId) {
ServiceResponse<QwOpenResultInitBO> initResp = OpenUtils.init(qwUserId, false); ServiceResponse<QwOpenResultInitBO> initResp = OpenUtils.init(qwUserId, false ,this.getDeverType(wxEnterpriseId));
log.info("自动登录-初始化={},{}", qwUserId, JSONObject.toJSONString(initResp)); log.info("自动登录-初始化={},{}", qwUserId, JSONObject.toJSONString(initResp));
if (initResp.isSuccess() && StringUtils.isNotBlank(initResp.getResult().getUuid())) { if (initResp.isSuccess() && StringUtils.isNotBlank(initResp.getResult().getUuid())) {
QwOpenResultInitBO bo = initResp.getResult(); QwOpenResultInitBO bo = initResp.getResult();
...@@ -268,7 +268,7 @@ public class OpenStaffServiceImpl implements OpenStaffService { ...@@ -268,7 +268,7 @@ public class OpenStaffServiceImpl implements OpenStaffService {
boolean isLogin = OpenUtils.isLogin(uuid); boolean isLogin = OpenUtils.isLogin(uuid);
// 未登录 // 未登录
if (!isLogin) { if (!isLogin) {
String autLogin = this.autoLogin(item.getOpenStaffId(), item.getQwUserId()); String autLogin = this.autoLogin(item.getOpenStaffId(), item.getQwUserId(), item.getWxEnterpriseId());
if (null == autLogin) { if (null == autLogin) {
this.logout(uuid, "定时检查异", 0, OpenStaffOfflineEnum.OFFLINE2.getDesc()); this.logout(uuid, "定时检查异", 0, OpenStaffOfflineEnum.OFFLINE2.getDesc());
} }
...@@ -320,4 +320,13 @@ public class OpenStaffServiceImpl implements OpenStaffService { ...@@ -320,4 +320,13 @@ public class OpenStaffServiceImpl implements OpenStaffService {
} }
return true ; return true ;
} }
@Override
public String getDeverType(String wxEnterpriseId) {
if(StringUtils.isBlank(wxEnterpriseId)) {
return null ;
}
return null;
}
} }
...@@ -214,7 +214,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -214,7 +214,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
log.info("重新初始化"); log.info("重新初始化");
this.openStaffService.logout(openStaff.getUuid(), "重新初始化", 0, null); this.openStaffService.logout(openStaff.getUuid(), "重新初始化", 0, null);
// 自动登录 // 自动登录
String newUuid = this.openStaffService.autoLogin(openStaff.getOpenStaffId(),openStaff.getQwUserId()) ; String newUuid = this.openStaffService.autoLogin(openStaff.getOpenStaffId(),openStaff.getQwUserId(),openStaff.getWxEnterpriseId()) ;
if(null != newUuid) { if(null != newUuid) {
log.info("自动登录成功"); log.info("自动登录成功");
openStaff.setAuthTime(new Date()); openStaff.setAuthTime(new Date());
...@@ -246,7 +246,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -246,7 +246,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
openStaff = this.openStaffService.save(openStaff); openStaff = this.openStaffService.save(openStaff);
return ServiceResponse.success(null); return ServiceResponse.success(null);
} }
ServiceResponse<QwOpenResultInitBO> resp = OpenUtils.init(qwUserId,true); ServiceResponse<QwOpenResultInitBO> resp = OpenUtils.init(qwUserId,true , this.openStaffService.getDeverType(qdto.getWxEnterpriseId()));
log.info("resp={}", JSONObject.toJSONString(resp)); log.info("resp={}", JSONObject.toJSONString(resp));
QwOpenResultInitBO init = resp.getResult(); QwOpenResultInitBO init = resp.getResult();
openStaff.setUuid(init.getUuid()); openStaff.setUuid(init.getUuid());
......
...@@ -23,11 +23,14 @@ public class OpenUtils { ...@@ -23,11 +23,14 @@ public class OpenUtils {
return CustomSwitcher.qywx_open_host ; return CustomSwitcher.qywx_open_host ;
} }
public static ServiceResponse<QwOpenResultInitBO> init(Long qwUserId, boolean qrcodeFlag) { public static ServiceResponse<QwOpenResultInitBO> init(Long qwUserId, boolean qrcodeFlag , String deverType) {
JSONObject initJson = new JSONObject(); JSONObject initJson = new JSONObject();
if (null != qwUserId) { if (null != qwUserId) {
initJson.put("vid", qwUserId); initJson.put("vid", qwUserId);
} }
if(null != deverType) {
initJson.put("deverType",deverType) ;
}
String initStr = HttpClient.sendPostJSON(String.format(getHost(), "init"), initJson.toJSONString(), "utf-8"); String initStr = HttpClient.sendPostJSON(String.format(getHost(), "init"), initJson.toJSONString(), "utf-8");
logger.info("企微初始化,req={},{}", initJson.toJSONString(), initStr); logger.info("企微初始化,req={},{}", initJson.toJSONString(), initStr);
QwOpenResultBO initResult = result(initStr); QwOpenResultBO initResult = result(initStr);
......
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