Commit 13d057a5 by 墨竹

fix:bug修改

parent da9bb241
......@@ -17,15 +17,16 @@ public interface WxApplicationMapper {
TabHaobanWxApplication selectByWxEnterpriseIdAndApplicationType(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("applicationType") int applicationType);
int cancelWxApplication(@Param("wxEnterpriseId") String wxEnterpriseId, @Param("suiteId") String suiteId);
int cancelWxApplication(@Param("corpId") String corpId, @Param("suiteId") String suiteId);
/**
* 选择通过公司id
*
* @param corpid corpid
* @return {@link TabHaobanWxApplication }
* @param corpid corpid
* @param applicationType 应用程序类型
* @return {@link TabHaobanWxApplication}
* @author mozhu
* @date 2021-12-21 22:00:54
*/
TabHaobanWxApplication selectByCorpId(@Param("corpid") String corpid);
TabHaobanWxApplication selectByCorpId(@Param("corpid") String corpid,@Param("applicationType") Integer applicationType);
}
\ No newline at end of file
......@@ -12,7 +12,26 @@ public interface WxApplicationService {
TabHaobanWxApplication selectByWxEnterpriseIdAndApplicationType(String wxEnterpriseId, int applicationType);
int cancalWxApplication(String wxEnterpriseId, String suiteId);
int cancalWxApplication(String corpId, String suiteId);
/**
* 选择通过公司id
*
* @param corpid corpid
* @return {@link TabHaobanWxApplication }
* @author mozhu
* @date 2022-01-10 14:28:09
*/
TabHaobanWxApplication selectByCorpId(String corpid);
/**
* 选择通过公司id和应用程序类型
*
* @param corpId 公司标识
* @param applicationType 应用程序类型
* @return {@link TabHaobanWxApplication }
* @author mozhu
* @date 2022-01-10 14:28:03
*/
TabHaobanWxApplication selectByCorpIdAndApplicationType(String corpId, int applicationType);
}
......@@ -45,14 +45,18 @@ public class WxApplicationServiceImpl implements WxApplicationService {
}
@Override
public int cancalWxApplication(String wxEnterpriseId, String suiteId) {
return this.mapper.cancelWxApplication(wxEnterpriseId, suiteId);
public int cancalWxApplication(String corpId, String suiteId) {
return this.mapper.cancelWxApplication(corpId, suiteId);
}
@Override
public TabHaobanWxApplication selectByCorpId(String corpid) {
return mapper.selectByCorpId(corpid);
return mapper.selectByCorpId(corpid,null);
}
@Override
public TabHaobanWxApplication selectByCorpIdAndApplicationType(String corpId, int applicationType) {
return mapper.selectByCorpId(corpId,applicationType);
}
}
......@@ -736,7 +736,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
public MemberUnionidRelatedDTO getMemberUnionidRelatedDTONew(MemberUnionidRelatedDTO dto) {
log.info("【新增外部联系人回调】dto={}", JSON.toJSONString(dto));
String corpId = dto.getCorpid();
TabHaobanWxApplication tabHaobanWxApplication = wxApplicationMapper.selectByCorpId(corpId);
TabHaobanWxApplication tabHaobanWxApplication = wxApplicationMapper.selectByCorpId(corpId,null);
if (tabHaobanWxApplication == null) {
log.info("查询tab_haoban_wx_application为空:{}", corpId);
return null;
......
......@@ -17,14 +17,12 @@ import org.springframework.stereotype.Service;
* Created by tgs on 2020/2/22.
*/
@Service("wxApplicationApiService")
public class WxApplicationApiServiceImpl implements WxApplicationApiService{
public class WxApplicationApiServiceImpl implements WxApplicationApiService {
private static final Logger log = LogManager.getLogger(WxApplicationApiServiceImpl.class);
@Autowired
private WxApplicationService wxApplicationService;
@Autowired
private WxEnterpriseApiService wxEnterpriseApiService;
@Autowired
private WxEnterpriseService wxEnterpriseService;
@Override
......@@ -35,14 +33,12 @@ public class WxApplicationApiServiceImpl implements WxApplicationApiService{
@Override
public void cancelSuite(String corpId, String suiteId) {
WxEnterpriseDTO enterprise = this.wxEnterpriseApiService.getEnterpriseBycorpId(corpId);
if(enterprise != null){
int i = this.wxApplicationService.cancalWxApplication(enterprise.getWxEnterpriseId(), suiteId);
log.info("取消授权结果:{}", i);
TabHaobanWxApplication wxApplication = this.wxApplicationService.selectByWxEnterpriseIdAndApplicationType(enterprise.getWxEnterpriseId(), 2);
if (wxApplication == null) { //如果取消好办小程序应用授权,临时解除绑定
this.wxEnterpriseService.unbind(enterprise.getWxEnterpriseId());
}
int i = this.wxApplicationService.cancalWxApplication(corpId, suiteId);
log.info("取消授权结果:{}", i);
TabHaobanWxApplication wxApplication = this.wxApplicationService.selectByCorpIdAndApplicationType(corpId, 2);
if (wxApplication != null) {
//如果取消好办小程序应用授权,临时解除绑定
this.wxEnterpriseService.unbind(wxApplication.getWxEnterpriseId());
}
log.info("企业未绑定过,{}", corpId);
}
......
......@@ -126,7 +126,7 @@ public class QywxClerkSyncOperation implements BaseSyncOperation {
dealSyncOperationApiService.cleanDiffrence(wxEnterpriseId, taskId);
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getOne(wxEnterpriseId);
String corpid = wxEnterpriseDTO.getCorpid();
TabHaobanWxApplication tabHaobanWxApplication = wxApplicationMapper.selectByCorpId(corpid);
TabHaobanWxApplication tabHaobanWxApplication = wxApplicationMapper.selectByCorpId(corpid,null);
logger.info("同步通讯录完成,批量处理wx_user_id,corpid:{}", corpid);
if (corpid.length() > 20) {
//批量处理wx_user_id to wx_open_user_id
......
......@@ -185,16 +185,20 @@
<update id="cancelWxApplication">
update tab_haoban_wx_application
set status_flag = 0
where wx_enterprise_id = #{wxEnterpriseId}
where corpid = #{corpId}
and site_id = #{suiteId}
and status_flag = 1
</update>
<select id="selectByCorpId" resultMap="BaseResultMap" parameterType="java.lang.String">
<select id="selectByCorpId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_wx_application
where corpid = #{corpid,jdbcType=VARCHAR} and status_flag = 1 limit 1
where corpid = #{corpid,jdbcType=VARCHAR} and status_flag = 1
<if test="applicationType != null ">
and application_type = #{applicationType}
</if>
limit 1
</select>
</mapper>
\ No newline at end of file
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