Commit 7a1154e6 by 徐高华

托管mac

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