Commit 8cfdb28c by fudahua

清楚关联关系

parent cf139e51
...@@ -23,4 +23,6 @@ public interface MemberUnionidRelatedApiService { ...@@ -23,4 +23,6 @@ public interface MemberUnionidRelatedApiService {
void freshWxFrend(String wxEnterpriseId, String wxUserId); void freshWxFrend(String wxEnterpriseId, String wxUserId);
public void cleanByCid(String cid);
} }
...@@ -20,6 +20,8 @@ public interface MemberUnionidRelatedMapper { ...@@ -20,6 +20,8 @@ public interface MemberUnionidRelatedMapper {
int updateByPrimaryKey(MemberUnionidRelated record); int updateByPrimaryKey(MemberUnionidRelated record);
int cleanByCid(String cid);
MemberUnionidRelated getByUnionId(@Param("wxUserId")String wxUserId, @Param("unionid")String unionid); MemberUnionidRelated getByUnionId(@Param("wxUserId")String wxUserId, @Param("unionid")String unionid);
void deleteByUnionidAndUserId(@Param("externalUserid")String externalUserid,@Param("wxUserId") String wxUserId); void deleteByUnionidAndUserId(@Param("externalUserid")String externalUserid,@Param("wxUserId") String wxUserId);
......
...@@ -18,4 +18,6 @@ public interface MemberUnionRelatedService { ...@@ -18,4 +18,6 @@ public interface MemberUnionRelatedService {
void update(MemberUnionidRelatedDTO exsitDTO); void update(MemberUnionidRelatedDTO exsitDTO);
void clean(String cid);
} }
...@@ -56,4 +56,8 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService ...@@ -56,4 +56,8 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
} }
@Override
public void clean(String cid) {
mapper.cleanByCid(cid);
}
} }
...@@ -636,4 +636,16 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -636,4 +636,16 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
} }
} }
@Override
public void cleanByCid(String cid) {
if (StringUtils.isNotBlank(cid)) {
TabHaobanWxEnterprise wxEnterprise = wxEnterpriseService.getEnterpriseBycorpId(cid);
if (null != wxEnterprise) {
memberUnionRelatedService.clean(wxEnterprise.getCorpid());
}
}else {
memberUnionRelatedService.clean(null);
}
}
} }
...@@ -183,6 +183,17 @@ ...@@ -183,6 +183,17 @@
add_create_time = #{addCreateTime,jdbcType=VARCHAR} add_create_time = #{addCreateTime,jdbcType=VARCHAR}
where member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR} where member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR}
</update> </update>
<update id="cleanByCid" parameterType="String" >
update tab_haoban_member_unionid_related
set
status_flag = 0,
update_time=now()
where member_id is null
<if test="cid !=null">
wx_enterprise_id = #{cid}
</if>
</update>
<select id="getByUnionId" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="getByUnionId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select select
......
...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.web.controller; ...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.web.controller;
import com.gic.haoban.common.utils.EntityUtil; import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.QywxXcxSendMessageQo; import com.gic.haoban.manage.web.qo.QywxXcxSendMessageQo;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO; import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
...@@ -24,6 +25,9 @@ public class TestController extends WebBaseController { ...@@ -24,6 +25,9 @@ public class TestController extends WebBaseController {
@Autowired @Autowired
private QywxSuiteApiService qywxSuiteApiService; private QywxSuiteApiService qywxSuiteApiService;
@Autowired
private MemberUnionidRelatedApiService memberUnionidRelatedApiService;
@RequestMapping("/send-message-test") @RequestMapping("/send-message-test")
public HaobanResponse testSendMessage(QywxXcxSendMessageQo qo) { public HaobanResponse testSendMessage(QywxXcxSendMessageQo qo) {
QywxXcxSendMessageDTO messageDTO = EntityUtil.changeEntityByOrika(QywxXcxSendMessageDTO.class, qo); QywxXcxSendMessageDTO messageDTO = EntityUtil.changeEntityByOrika(QywxXcxSendMessageDTO.class, qo);
...@@ -39,4 +43,10 @@ public class TestController extends WebBaseController { ...@@ -39,4 +43,10 @@ public class TestController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_0); return resultResponse(HaoBanErrCode.ERR_0);
} }
} }
@RequestMapping("/clean-out")
public HaobanResponse cleanMessage(String cid) {
memberUnionidRelatedApiService.cleanByCid(cid);
return resultResponse(HaoBanErrCode.ERR_1);
}
} }
...@@ -51,6 +51,8 @@ ...@@ -51,6 +51,8 @@
<dubbo:reference interface="com.gic.haoban.manage.api.service.AuditSettingApiService" id="auditSettingApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.AuditSettingApiService" id="auditSettingApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.DictApiService" id="dictApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.DictApiService" id="dictApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.HelpApiService" id="helpApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.HelpApiService" id="helpApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService" id="memberUnionidRelatedApiService"/>
<dubbo:reference interface="com.gic.wechat.token.api.service.QywxTokenManageService" id="qywxTokenManageService"/> <dubbo:reference interface="com.gic.wechat.token.api.service.QywxTokenManageService" id="qywxTokenManageService"/>
......
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