Commit 13d057a5 by 墨竹

fix:bug修改

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