Commit dba34d27 by fudahua

好办企业解绑操作

parent 492de1b8
...@@ -27,5 +27,7 @@ public interface WxEnterpriseService { ...@@ -27,5 +27,7 @@ public interface WxEnterpriseService {
int delete(String wxEnterpriseId); int delete(String wxEnterpriseId);
int unbind(String wxEnterpriseId);
TabHaobanWxEnterprise getEnterpriseBycorpIdNoStatus(String corpid); TabHaobanWxEnterprise getEnterpriseBycorpIdNoStatus(String corpid);
} }
...@@ -71,12 +71,21 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService { ...@@ -71,12 +71,21 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
} }
@Override @Override
public TabHaobanWxEnterprise getEnterpriseBycorpIdNoStatus(String corpId) { public int unbind(String wxEnterpriseId) {
List<TabHaobanWxEnterprise> list = this.mapper.getEnterpriseBycorpIdNoStatus(corpId); TabHaobanWxEnterprise enterprise = new TabHaobanWxEnterprise();
if(CollectionUtils.isNotEmpty(list)){ enterprise.setWxEnterpriseId(wxEnterpriseId);
return list.get(0); enterprise.setStatusFlag(2);
} enterprise.setUpdateTime(new Date());
return null; return this.mapper.updateByPrimaryKeySelective(enterprise);
} }
@Override
public TabHaobanWxEnterprise getEnterpriseBycorpIdNoStatus(String corpId) {
List<TabHaobanWxEnterprise> list = this.mapper.getEnterpriseBycorpIdNoStatus(corpId);
if (CollectionUtils.isNotEmpty(list)) {
return list.get(0);
}
return null;
}
} }
...@@ -40,8 +40,8 @@ public class WxApplicationApiServiceImpl implements WxApplicationApiService{ ...@@ -40,8 +40,8 @@ public class WxApplicationApiServiceImpl implements WxApplicationApiService{
int i = this.wxApplicationService.cancalWxApplication(enterprise.getWxEnterpriseId(), suiteId); int i = this.wxApplicationService.cancalWxApplication(enterprise.getWxEnterpriseId(), suiteId);
log.info("取消授权结果:{}", i); log.info("取消授权结果:{}", i);
TabHaobanWxApplication wxApplication = this.wxApplicationService.selectByWxEnterpriseIdAndApplicationType(enterprise.getWxEnterpriseId(), 2); TabHaobanWxApplication wxApplication = this.wxApplicationService.selectByWxEnterpriseIdAndApplicationType(enterprise.getWxEnterpriseId(), 2);
if(wxApplication == null){ //如果取消好办小程序应用授权,删除企业 if (wxApplication == null) { //如果取消好办小程序应用授权,临时解除绑定
this.wxEnterpriseService.delete(enterprise.getWxEnterpriseId()); this.wxEnterpriseService.unbind(enterprise.getWxEnterpriseId());
} }
} }
log.info("企业未绑定过,{}", corpId); log.info("企业未绑定过,{}", corpId);
......
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