Commit 8cfdb28c by fudahua

清楚关联关系

parent cf139e51
......@@ -23,4 +23,6 @@ public interface MemberUnionidRelatedApiService {
void freshWxFrend(String wxEnterpriseId, String wxUserId);
public void cleanByCid(String cid);
}
......@@ -20,6 +20,8 @@ public interface MemberUnionidRelatedMapper {
int updateByPrimaryKey(MemberUnionidRelated record);
int cleanByCid(String cid);
MemberUnionidRelated getByUnionId(@Param("wxUserId")String wxUserId, @Param("unionid")String unionid);
void deleteByUnionidAndUserId(@Param("externalUserid")String externalUserid,@Param("wxUserId") String wxUserId);
......
......@@ -18,4 +18,6 @@ public interface MemberUnionRelatedService {
void update(MemberUnionidRelatedDTO exsitDTO);
void clean(String cid);
}
......@@ -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
}
}
@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);
}
}
}
......@@ -184,6 +184,17 @@
where member_unionid_related_id = #{memberUnionidRelatedId,jdbcType=VARCHAR}
</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
<include refid="Base_Column_List" />
......
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.web.controller;
import com.gic.haoban.common.utils.EntityUtil;
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.qo.QywxXcxSendMessageQo;
import com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO;
......@@ -24,6 +25,9 @@ public class TestController extends WebBaseController {
@Autowired
private QywxSuiteApiService qywxSuiteApiService;
@Autowired
private MemberUnionidRelatedApiService memberUnionidRelatedApiService;
@RequestMapping("/send-message-test")
public HaobanResponse testSendMessage(QywxXcxSendMessageQo qo) {
QywxXcxSendMessageDTO messageDTO = EntityUtil.changeEntityByOrika(QywxXcxSendMessageDTO.class, qo);
......@@ -39,4 +43,10 @@ public class TestController extends WebBaseController {
return resultResponse(HaoBanErrCode.ERR_0);
}
}
@RequestMapping("/clean-out")
public HaobanResponse cleanMessage(String cid) {
memberUnionidRelatedApiService.cleanByCid(cid);
return resultResponse(HaoBanErrCode.ERR_1);
}
}
......@@ -52,6 +52,8 @@
<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.MemberUnionidRelatedApiService" id="memberUnionidRelatedApiService"/>
<dubbo:reference interface="com.gic.wechat.token.api.service.QywxTokenManageService" id="qywxTokenManageService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.DealSyncOperationApiService"
......
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