Commit 57267675 by 徐高华

链接

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