diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java index 472fdc1..1bc877b 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/SysTagMapper.java @@ -117,4 +117,6 @@ public interface SysTagMapper { public int deleteDeptById(Long id); List selectSecondTagByType(@Param("type") Integer type); + + List selectByIdList(@Param("tagIdList") List tagIdList); } diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml index 1e0fa92..ca8909e 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/SysTagMapper.xml @@ -99,7 +99,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ORDER BY order_num asc - + + + insert into sys_tag( id, parent_id, diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java index 4220795..527b107 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java @@ -5,18 +5,13 @@ import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; -import com.flossom.common.core.domain.entity.SysTag; -import com.flossom.common.core.domain.entity.WxInstrument; -import com.flossom.common.core.domain.entity.WxInstrumentFileRelate; -import com.flossom.common.core.domain.entity.WxInstrumentMode; +import com.flossom.common.core.domain.entity.*; import com.flossom.common.core.domain.req.WxInstrumentReq; import com.flossom.common.core.domain.req.WxInstrumentSaveReq; import com.flossom.common.core.enums.InstrumentFileClassifyEnum; import com.flossom.common.core.enums.Status; -import com.flossom.common.core.mapper.SysTagMapper; -import com.flossom.common.core.mapper.WxInstrumentFileRelateMapper; -import com.flossom.common.core.mapper.WxInstrumentMapper; -import com.flossom.common.core.mapper.WxInstrumentModeMapper; +import com.flossom.common.core.enums.TagTypeStatusEnum; +import com.flossom.common.core.mapper.*; import com.flossom.common.core.utils.DateUtils; import com.flossom.common.core.utils.StringUtils; import com.flossom.common.security.utils.SecurityUtils; @@ -47,6 +42,9 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { @Autowired private WxInstrumentModeMapper wxInstrumentModeMapper; + @Autowired + private WxInstrumentTagMapper wxInstrumentTagMapper; + /** * 查询仪器列 * @@ -114,7 +112,30 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { @Override public List selectWxInstrumentPage(WxInstrumentReq wxInstrumentReq) { - return wxInstrumentMapper.selectWxInstrumentPage(wxInstrumentReq); + List wxInstruments = wxInstrumentMapper.selectWxInstrumentPage(wxInstrumentReq); + if (wxInstruments != null && wxInstruments.size() > 0) { + for (WxInstrument wxInstrument : wxInstruments) { + WxInstrumentTag query = new WxInstrumentTag(); + query.setInstrumentId(wxInstrument.getId()); + List wxInstrumentTagList = wxInstrumentTagMapper.selectWxInstrumentTagList(query); + if (wxInstrumentTagList != null && wxInstrumentTagList.size() > 0) { + List tagIdList = wxInstrumentTagList.stream().map(WxInstrumentTag::getTagId).collect(Collectors.toList()); + List sysTagList = sysTagMapper.selectByIdList(tagIdList); + + String miniProgramTags = sysTagList.stream() + .filter(tag -> Integer.valueOf(tag.getType()) == TagTypeStatusEnum.MINI_PROGRAM.getCode()) + .map(SysTag::getTagName) + .collect(Collectors.joining(",")); + wxInstrument.setMiniTagNames(miniProgramTags); + String wecomTags = sysTagList.stream() + .filter(tag -> Integer.valueOf(tag.getType()) == TagTypeStatusEnum.ENTERPRISE_WECHAT.getCode()) + .map(SysTag::getTagName) + .collect(Collectors.joining(",")); + wxInstrument.setWecomTagNames(wecomTags); + } + } + } + return wxInstruments; } /** diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index dd014b4..4f63d37 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -129,7 +129,7 @@ 设置企微可见标签 + >设置外部可见标签