Commit 35fadfeb by 徐高华

Merge branch 'feature/xgh/240820' into 'developer'

Feature/xgh/240820

See merge request !2124
parents 4f0fe973 3108b3a5
......@@ -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) ;
}
......@@ -30,6 +30,7 @@ import com.gic.haoban.manage.service.entity.TabOpenStaff;
import com.gic.haoban.manage.service.pojo.QwOpenResultInitBO;
import com.gic.haoban.manage.service.service.OpenStaffService;
import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.haoban.manage.service.util.CustomSwitcher;
import com.gic.haoban.manage.service.util.OpenUtils;
import com.gic.redis.data.util.RedisUtil;
import com.github.pagehelper.PageHelper;
......@@ -223,8 +224,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 +269,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 +321,13 @@ public class OpenStaffServiceImpl implements OpenStaffService {
}
return true ;
}
@Override
public String getDeverType(String wxEnterpriseId) {
if(StringUtils.isBlank(wxEnterpriseId)) {
return null ;
}
return CustomSwitcher.qywx_open_type.get(wxEnterpriseId) ;
}
}
......@@ -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());
......
......@@ -8,6 +8,9 @@ import java.util.Map;
@SwitcherNamespace("BUZ.qywx.open")
public class CustomSwitcher {
@Switcher
public static Map<String,String> qywx_open_type ;
/**
* 积分触不通知会员名单
*/
......
......@@ -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