Commit b39d4acb by songyinghui

feat: 数据修复

parent 5eddaed5
......@@ -121,5 +121,7 @@ public interface TabHaobanInteractRecordMapper {
*/
int memberAuthorized(@Param("memberId") String memberId, @Param("unionId") String unionId);
List<TabHaobanInteractRecord> queryInteractRecordWithMemberIdINull();
}
......@@ -5,10 +5,10 @@
<import resource="classpath:gic-haoban-init.xml" />
<import resource="classpath*:redis-init.xml"/>
<import resource="classpath*:kafka-setting.xml"/>
<!-- <import resource="classpath*:kafka-setting.xml"/>-->
<import resource="classpath:dubbo-haoban-manage-service.xml" />
<import resource="classpath:dubbo-setting-test.xml"/>
<import resource="classpath:jdbc-haoban-manage-service.xml" />
<import resource="classpath*:log-record-init.xml" />
<import resource="classpath*:kafka-setting-data.xml" />
<!-- <import resource="classpath*:kafka-setting-data.xml" />-->
</beans>
\ No newline at end of file
......@@ -325,5 +325,12 @@
where union_id = #{unionId} and delete_flag = 0
</update>
<select id="queryInteractRecordWithMemberIdINull" resultMap="TabHaobanInteractRecordMap">
select <include refid="baseSql"/>
from tab_haoban_interact_record
where
member_id is null or member_id = ''
</select>
</mapper>
......@@ -116,8 +116,8 @@ public class GroupMessageServiceTest {
qywxMomentInfoQDTO.setEndTime(1681906519L);
qywxMomentInfoQDTO.setCreatorId("wo59NLDQAAbjSBA575NouC1pUYQgCOtw");
qywxMomentInfoQDTO.setPageSize(20);
ServiceResponse<QywxMomentRespDTO> serviceResponse = qywxSuiteApiService.queryQywxMomentList(qywxMomentInfoQDTO);
System.out.println(JSON.toJSONString(serviceResponse));
// ServiceResponse<QywxMomentRespDTO> serviceResponse = qywxSuiteApiService.queryQywxMomentList(qywxMomentInfoQDTO);
// System.out.println(JSON.toJSONString(serviceResponse));
}
@Test
......
......@@ -10,12 +10,19 @@ import com.gic.haoban.manage.api.enums.content.MaterialInteractRecordEventType;
import com.gic.haoban.manage.api.enums.content.TriggerCustomerChannelType;
import com.gic.haoban.manage.api.service.content.InteractRecordApiService;
import com.gic.haoban.manage.service.dao.mapper.chat.GroupChatPlanOwnerLogMapper;
import com.gic.haoban.manage.service.dao.mapper.content.TabHaobanInteractRecordMapper;
import com.gic.haoban.manage.service.entity.content.TabHaobanInteractRecord;
import com.gic.haoban.manage.service.pojo.bo.content.InteractRecordBO;
import com.gic.haoban.manage.service.pojo.bo.content.MemberAttrChangeBO;
import com.gic.haoban.manage.service.pojo.bo.content.message.InteractRecordMessageBO;
import com.gic.haoban.manage.service.pojo.qo.content.InteractRecordQO;
import com.gic.haoban.manage.service.service.content.InteractRecordService;
import com.gic.haoban.manage.service.service.content.message.InteractRecordMessageService;
import com.gic.member.api.dto.info.MemberBaseInfoDTO;
import com.gic.member.api.dto.info.MemberSummaryInfoDTO;
import com.gic.member.api.dto.info.qo.QueryMemberInfoDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -33,6 +40,7 @@ import java.util.UUID;
* @Description
* @Version
**/
@Slf4j
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:applicationContext-conf.xml"})
public class InteractRecordTest {
......@@ -40,9 +48,13 @@ public class InteractRecordTest {
@Autowired
private InteractRecordService interactRecordService;
@Autowired
private TabHaobanInteractRecordMapper interactRecordMapper;
@Autowired
private InteractRecordMessageService interactRecordMessageService;
@Autowired
InteractRecordApiService interactRecordApiService;
@Autowired
private com.gic.member.api.service.MemberOutApiService memberOutApiService;
String eid = "ff8080815dacd3a2015dacd3ef5c0000";
......@@ -105,4 +117,34 @@ public class InteractRecordTest {
memberAttrChangeBO.setOpt(MemberAttrChangeBO.MemberChangeOpt.MINI_APP_AUTHORIZED.getCode());
interactRecordApiService.memberChangeMQ(JSON.toJSONString(memberAttrChangeBO));
}
@Test
public void queryTest() {
List<TabHaobanInteractRecord> interactRecords = interactRecordMapper.queryInteractRecordWithMemberIdINull();
if (CollectionUtils.isEmpty(interactRecords)) {
return;
}
for (TabHaobanInteractRecord interactRecord : interactRecords) {
String unionId = interactRecord.getUnionId();
QueryMemberInfoDTO queryMemberInfoDTO = QueryMemberInfoDTO
.queryByUnionId(unionId, interactRecord.getEnterpriseId())
.setMemberBaseInfoDTO(true)
.setMemberPersonalInfoDTO(false);
ServiceResponse<MemberSummaryInfoDTO> serviceResponse = memberOutApiService.queryMemberInfo(queryMemberInfoDTO);
if (!serviceResponse.isSuccess() || serviceResponse.getResult() == null) {
log.info("企业id:{}, unionId: {} 不存在会员信息", interactRecord.getEnterpriseId(), unionId);
continue;
}
MemberBaseInfoDTO memberBaseInfoDTO = serviceResponse.getResult().getMemberBaseInfoDTO();
if (memberBaseInfoDTO == null) {
log.info("企业id:{}, unionId: {} 不存在会员信息", interactRecord.getEnterpriseId(), unionId);
continue;
}
String memberId = memberBaseInfoDTO.getMemberId();
interactRecordService.memberAuthorized(memberId, unionId);
}
}
}
......@@ -124,8 +124,8 @@ public class NotityTest {
articleInfo.setPicurl("https://platform-1251519181.cos.ap-shanghai.myqcloud.com/image/newdmwltest/enterprise_common-e1e8b3d46fdb4486ad545aae6cba67a1.png");
messageDTO.setArticleMessages(Arrays.asList(articleInfo));
boolean b = qywxSuiteApiService.sendMessage(corpid, config.getWxSuiteid(), messageDTO);
System.out.println(b);
//boolean b = qywxSuiteApiService.sendMessage(corpid, config.getWxSuiteid(), messageDTO);
//System.out.println(b);
}
@Test
......@@ -138,7 +138,7 @@ public class NotityTest {
search.setSuiteid(config.getWxSuiteid());
search.setChatType("single");
Date date = DateUtils.addDays(new Date(), -1);
ServiceResponse<QywxGroupMsgResp> serviceResponse = qywxSuiteApiService.queryQywxGroupMessageList(search);
//ServiceResponse<QywxGroupMsgResp> serviceResponse = qywxSuiteApiService.queryQywxGroupMessageList(search);
}
......
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