Commit b0ae4667 by 徐高华

企微托管账号

parent 5284bab4
...@@ -15,7 +15,7 @@ public interface OpenStaffService { ...@@ -15,7 +15,7 @@ public interface OpenStaffService {
public TabOpenStaff getByUUID(String uuid) ; public TabOpenStaff getByUUID(String uuid) ;
public void logout(String uuid, String loginRemark) ; public void logout(String uuid, String loginRemark, int step) ;
ServiceResponse<Page<OpenStaffDTO>> page(OpenStaffPageQDTO qdto, BasePageInfo basePageInfo); ServiceResponse<Page<OpenStaffDTO>> page(OpenStaffPageQDTO qdto, BasePageInfo basePageInfo);
......
...@@ -56,13 +56,13 @@ public class OpenStaffServiceImpl implements OpenStaffService { ...@@ -56,13 +56,13 @@ public class OpenStaffServiceImpl implements OpenStaffService {
} }
@Override @Override
public void logout(String uuid , String loginRemark) { public void logout(String uuid , String loginRemark , int step) {
TabOpenStaff openStaff = this.getByUUID(uuid) ; TabOpenStaff openStaff = this.getByUUID(uuid) ;
if(null == openStaff) { if(null == openStaff) {
return ; return ;
} }
OpenUtils.logout(uuid); OpenUtils.logout(uuid);
openStaff.setStep(0); openStaff.setStep(step);
openStaff.setStatusFlag(2); openStaff.setStatusFlag(2);
openStaff.setValidFlag(0); openStaff.setValidFlag(0);
openStaff.setValidQrcodeFlag(0); openStaff.setValidQrcodeFlag(0);
......
...@@ -92,7 +92,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -92,7 +92,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
} }
this.openStaffMapper.updateLoginStep(openStaff.getOpenStaffId(),step) ; this.openStaffMapper.updateLoginStep(openStaff.getOpenStaffId(),step) ;
if(QwOpenStepEnum.isFail(step)) { if(QwOpenStepEnum.isFail(step)) {
this.openStaffService.logout(uuid,"企微返回退出/登录超时"); this.openStaffService.logout(uuid,"企微返回退出/登录超时",0);
} }
return ServiceResponse.success(); return ServiceResponse.success();
} }
...@@ -106,13 +106,13 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -106,13 +106,13 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
String wxEnterpriseId = openStaff.getWxEnterpriseId() ; String wxEnterpriseId = openStaff.getWxEnterpriseId() ;
List<String> backWxEnterpriseIdList = this.wxEnterpriseService.getWxEnterpriseIdByName(corpName) ; List<String> backWxEnterpriseIdList = this.wxEnterpriseService.getWxEnterpriseIdByName(corpName) ;
if(CollectionUtils.isEmpty(backWxEnterpriseIdList) || backWxEnterpriseIdList.size()>1 || !backWxEnterpriseIdList.get(0).equals(wxEnterpriseId)) { if(CollectionUtils.isEmpty(backWxEnterpriseIdList) || backWxEnterpriseIdList.size()>1 || !backWxEnterpriseIdList.get(0).equals(wxEnterpriseId)) {
this.openStaffService.logout(uuid,"授权登录账号与当前账号不一致"); this.openStaffService.logout(uuid,"授权登录账号与当前账号不一致",10);
log.info("登录的企业不对={},{}",uuid,corpName); log.info("登录的企业不对={},{}",uuid,corpName);
return ServiceResponse.failure("9999","登录错误") ; return ServiceResponse.failure("9999","登录错误") ;
} }
TabOpenStaff staff = this.openStaffMapper.getByQwUserId(qwUserId) ; TabOpenStaff staff = this.openStaffMapper.getByQwUserId(qwUserId) ;
if(null != staff && staff.getWxEnterpriseId().equals(wxEnterpriseId)) { if(null != staff && staff.getWxEnterpriseId().equals(wxEnterpriseId)) {
this.openStaffService.logout(uuid,"只能托管一个企微企业"); this.openStaffService.logout(uuid,"只能托管一个企微企业",0);
log.info("只能托管一个企业={},{}",uuid,corpName); log.info("只能托管一个企业={},{}",uuid,corpName);
return ServiceResponse.failure("9999","只能托管一个企业") ; return ServiceResponse.failure("9999","只能托管一个企业") ;
} }
...@@ -129,7 +129,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -129,7 +129,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
@Override @Override
public ServiceResponse<Void> logout(String uuid) { public ServiceResponse<Void> logout(String uuid) {
this.openStaffService.logout(uuid,null); this.openStaffService.logout(uuid,null,0);
return ServiceResponse.success(); return ServiceResponse.success();
} }
...@@ -180,7 +180,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService { ...@@ -180,7 +180,7 @@ public class OpenStaffApiServiceImpl implements OpenStaffApiService {
} }
qwUserId = openStaff.getQwUserId() ; qwUserId = openStaff.getQwUserId() ;
log.info("重新初始化,退出登录"); log.info("重新初始化,退出登录");
this.openStaffService.logout(openStaff.getUuid(),"重新初始化,退出登录"); this.openStaffService.logout(openStaff.getUuid(),"重新初始化,退出登录",0);
} }
if(null == openStaff) { if(null == openStaff) {
openStaff = new TabOpenStaff() ; openStaff = new TabOpenStaff() ;
......
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