Commit 76de39f3 by 徐高华

test

parent efe68d43
......@@ -39,4 +39,6 @@ public interface GroupChatMapper {
public List<TabGroupChat> listAllNeedInit();
public List<TabGroupChat> list(GroupChatSearchQDTO qdto);
public void updateChatEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("enterpriseId")String enterpriseId, @Param("groupChatIdList")List<Long> groupChatIdList);
}
\ No newline at end of file
......@@ -76,7 +76,7 @@ public class GroupChatServiceImpl implements GroupChatService {
@Autowired
private ChatNoticeMapper chatNoticeMapper;
@Autowired
private StaffClerkRelationService staffClerkRelationService ;
private StaffClerkRelationService staffClerkRelationService;
// 每次拉取成员数
private int pageSize = 10;
// 每次拉取群数
......@@ -165,10 +165,11 @@ public class GroupChatServiceImpl implements GroupChatService {
@Override
public void updateChatEnterpriseId(String wxEnterpriseId, String enterpriseId, List<Long> groupChatIdList) {
this.groupChatMapper.updateChatEnterpriseId(wxEnterpriseId, enterpriseId, groupChatIdList);
// 更新后重新同步群数据
}
@Override
......@@ -338,7 +339,7 @@ public class GroupChatServiceImpl implements GroupChatService {
Long groupChatId = chat.getGroupChatId();
String wxEnterpriseId = chat.getWxEnterpriseId();
String enterpriseId = chat.getEnterpriseId();
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(qwDTO.getWxEnterpriseId(),
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterpriseId,
SecretTypeEnum.CUSTOMIZED_APP.getVal());
if (null == secretSetting) {
logger.info("没有配置代开应用");
......@@ -357,25 +358,27 @@ public class GroupChatServiceImpl implements GroupChatService {
TabHaobanStaff staff = this.staffMapper.selectByUserIdAndEnterpriseId(owner, wxEnterpriseId);
if (null != staff) {
chat.setStaffId(staff.getStaffId());
}else {
} else {
logger.info("群主未关联好办,不同步群成员,userid={}", owner);
}
if(StringUtils.isBlank(enterpriseId)) {
logger.info("开始匹配群的gic商户id,staffid={}",staff.getStaffId());
List<StaffClerkRelationDTO> clerkList = this.staffClerkRelationService.listByStaffId(wxEnterpriseId, staff.getStaffId()) ;
if(CollectionUtils.isNotEmpty(clerkList)) {
Set<String> enterpriseIdSet = clerkList.stream().map(dto->dto.getEnterpriseId()).collect(Collectors.toSet()) ;
logger.info("成员关联导购数={},商户={}",clerkList.size(),enterpriseIdSet);
if(enterpriseIdSet.size()==1) {
if (StringUtils.isBlank(enterpriseId)) {
logger.info("开始匹配群的gic商户id,staffid={}", staff.getStaffId());
List<StaffClerkRelationDTO> clerkList = this.staffClerkRelationService.listByStaffId(wxEnterpriseId,
staff.getStaffId());
if (CollectionUtils.isNotEmpty(clerkList)) {
Set<String> enterpriseIdSet = clerkList.stream().map(dto -> dto.getEnterpriseId())
.collect(Collectors.toSet());
logger.info("成员关联导购数={},商户={}", clerkList.size(), enterpriseIdSet);
if (enterpriseIdSet.size() == 1) {
enterpriseId = clerkList.get(0).getEnterpriseId();
}
}
}
logger.info("更新群信息={}", JSON.toJSONString(chat));
this.groupChatMapper.update(chat);
if(null == staff) {
logger.info("不同步群成员信息,群主未关联好办,owner={}",owner);
return ;
if (null == staff) {
logger.info("不同步群成员信息,群主未关联好办,owner={}", owner);
return;
}
if (!syncMember) {
logger.info("不同步群成员信息");
......
......@@ -106,8 +106,7 @@
<!-- ==================更新 ========== -->
<update id="update"
parameterType="com.gic.haoban.manage.service.entity.chat.TabGroupChat">
<update id="update" parameterType="com.gic.haoban.manage.service.entity.chat.TabGroupChat">
<![CDATA[
UPDATE tab_haoban_group_chat SET
enterprise_id = #{enterprieId},
......@@ -166,4 +165,14 @@
<select id="listAllNeedInit" resultMap="result-map-tabHaobanGroupChat">
select <include refid="Base_Column_List" /> from tab_haoban_group_chat where create_time > DATE_ADD(NOW(),INTERVAL -7 day) and init_flag = 0
</select>
<select id="list">
select * from ta_haoban_group_chat
</select>
<update id="updateChatEnterpriseId">
update tab_haoban_group_chat set enterprise_id = #{enterpriseId} where wx_enterprise_id=#{wxEnterpriseId}
<if test="null "></if>
</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