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 28ec5fb..5d545ff 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 @@ -1,9 +1,12 @@ package com.flossom.system.service.impl; +import java.util.Arrays; import java.util.List; +import com.flossom.common.core.domain.entity.SysTag; import com.flossom.common.core.domain.entity.WxInstrument; import com.flossom.common.core.domain.req.WxInstrumentReq; +import com.flossom.common.core.mapper.SysTagMapper; import com.flossom.common.core.mapper.WxInstrumentMapper; import com.flossom.common.core.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -22,6 +25,9 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { @Autowired private WxInstrumentMapper wxInstrumentMapper; + @Autowired + private SysTagMapper sysTagMapper; + /** * 查询仪器列 * @@ -69,6 +75,31 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { */ @Override public int updateWxInstrument(WxInstrument wxInstrument) { + // 处理小程序标签和企微标签 + if (wxInstrument.getMiniTagIds() != null) { + List tagIdList = Arrays.asList(wxInstrument.getMiniTagIds().split(",")); + StringBuilder tagNames = new StringBuilder(); + for (int i = 0; i < tagIdList.size(); i++) { + SysTag sysTag = sysTagMapper.selectDeptById(Long.valueOf(tagIdList.get(i))); + tagNames.append(sysTag.getTagName()); + if (i < tagIdList.size() - 1) { + tagNames.append(","); + } + } + wxInstrument.setMiniTagNames(tagNames.toString()); + } + if (wxInstrument.getWecomTagIds() != null) { + List tagIdList = Arrays.asList(wxInstrument.getWecomTagIds().split(",")); + StringBuilder tagNames = new StringBuilder(); + for (int i = 0; i < tagIdList.size(); i++) { + SysTag sysTag = sysTagMapper.selectDeptById(Long.valueOf(tagIdList.get(i))); + tagNames.append(sysTag.getTagName()); + if (i < tagIdList.size() - 1) { + tagNames.append(","); + } + } + wxInstrument.setWecomTagNames(tagNames.toString()); + } wxInstrument.setUpdateTime(DateUtils.getNowDate()); return wxInstrumentMapper.updateWxInstrument(wxInstrument); } diff --git a/flossom-ui/src/api/system/instrument.js b/flossom-ui/src/api/system/instrument.js index ef515ff..7cda1b4 100644 --- a/flossom-ui/src/api/system/instrument.js +++ b/flossom-ui/src/api/system/instrument.js @@ -42,3 +42,25 @@ export function delInstrument(id) { method: 'delete' }) } + +/* 获取小程序标签树 */ +export function getMiniProgramTagTree() { + return request({ + url: '/system/tagInfo/tagTree', + method: 'get', + params: { + type: 1 + } + }) +} + +/* 获取企微标签树 */ +export function getWecomTagTree() { + return request({ + url: '/system/tagInfo/tagTree', + method: 'get', + params: { + type: 2 + } + }) +} diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index eb8160d..d768114 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -102,13 +102,15 @@ size="mini" type="text" icon="el-icon-edit" + @click="editMiniProgramTags(scope.row)" >设置小程序可见标签 设置微信可见标签 + @click="editWecomTags(scope.row)" + >设置企微可见标签 - @@ -421,15 +423,61 @@ 取 消 + + + + + + + + + + + + + + + + + + + + + + + + + + + +