Commit 57267675 by 徐高华

链接

parent b5c1c40e
package com.gic.haoban.manage.service.dao.mapper.hm; package com.gic.haoban.manage.service.dao.mapper.hm;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
...@@ -38,9 +38,10 @@ public class HmLinkChatServiceImpl implements HmLinkChatService { ...@@ -38,9 +38,10 @@ public class HmLinkChatServiceImpl implements HmLinkChatService {
log.info("保存群链接={}",JSON.toJSONString(list)); log.info("保存群链接={}",JSON.toJSONString(list));
List<HmLinkChatDTO> updateList = list.stream().filter(dto -> null != dto.getLinkChatId()) List<HmLinkChatDTO> updateList = list.stream().filter(dto -> null != dto.getLinkChatId())
.collect(Collectors.toList()); .collect(Collectors.toList());
List<Long> notDelIdList = updateList.stream().map(dto -> dto.getChatHmId()).collect(Collectors.toList());
log.info("不删除={},{}",linkId,notDelIdList);
this.hmLinkChatMapper.delete(linkId, notDelIdList);
if (CollectionUtils.isNotEmpty(updateList)) { if (CollectionUtils.isNotEmpty(updateList)) {
List<Long> notDelIdList = updateList.stream().map(dto -> dto.getChatHmId()).collect(Collectors.toList());
this.hmLinkChatMapper.delete(linkId, notDelIdList);
for (HmLinkChatDTO item : updateList) { for (HmLinkChatDTO item : updateList) {
TabHmLinkChat entity = EntityUtil.changeEntityByJSON(TabHmLinkChat.class, item); TabHmLinkChat entity = EntityUtil.changeEntityByJSON(TabHmLinkChat.class, item);
this.hmLinkChatMapper.update(entity); this.hmLinkChatMapper.update(entity);
......
...@@ -15,6 +15,7 @@ import com.gic.commons.util.EntityUtil; ...@@ -15,6 +15,7 @@ import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils; import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.util.ToolUtil; import com.gic.commons.util.ToolUtil;
import com.gic.commons.util.UniqueIdUtils; import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.api.dto.hm.HmLinkChatDTO;
import com.gic.haoban.manage.api.dto.hm.HmLinkDTO; import com.gic.haoban.manage.api.dto.hm.HmLinkDTO;
import com.gic.haoban.manage.api.dto.hm.HmLinkStoreDTO; import com.gic.haoban.manage.api.dto.hm.HmLinkStoreDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmLinkSearchQDTO; import com.gic.haoban.manage.api.dto.qdto.hm.HmLinkSearchQDTO;
...@@ -150,6 +151,12 @@ public class HmLinkServiceImpl implements HmLinkService { ...@@ -150,6 +151,12 @@ public class HmLinkServiceImpl implements HmLinkService {
} }
// 群活码 // 群活码
if(dto.getLinkType()==HmLinkTypeEnum.CHAT_HM_LINK_TYPE.getLinkType()) { if(dto.getLinkType()==HmLinkTypeEnum.CHAT_HM_LINK_TYPE.getLinkType()) {
int index = 0 ;
for(HmLinkChatDTO item : dto.getLinkChatList()) {
item.setWxEnterpriseId(dto.getWxEnterpriseId());
item.setEnterpriseId(dto.getEnterpriseId());
item.setSortNum(index++);
}
this.hmLinkChatService.save(linkId, dto.getLinkChatList()) ; this.hmLinkChatService.save(linkId, dto.getLinkChatList()) ;
} }
return dto.getLinkCode(); return dto.getLinkCode();
......
...@@ -60,8 +60,7 @@ ...@@ -60,8 +60,7 @@
<!-- =====================删除==================== --> <!-- =====================删除==================== -->
<update id="delete"> <update id="delete">
UPDATE tab_haoban_hm_link_chat SET delete_flag = 1 WHERE link_id = UPDATE tab_haoban_hm_link_chat SET delete_flag = 1 , update_time =now() WHERE link_id = {linkId}
{linkId}
<if test="null != idList and idList.size > 0"> <if test="null != idList and idList.size > 0">
and link_chat_id in and link_chat_id in
<foreach collection="idList" item="item" separator="," index="index" <foreach collection="idList" item="item" separator="," index="index"
......
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