From e257ecef7fd22761495f08770550c7b3dec7ac2a Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Wed, 10 Jan 2024 11:45:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E5=8F=AF=E8=A7=81=E6=A0=87=E7=AD=BE=E5=92=8C=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BC=81=E5=BE=AE=E5=8F=AF=E8=A7=81=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxInstrumentServiceImpl.java | 31 +++++ flossom-ui/src/api/system/instrument.js | 22 +++ .../src/views/system/instrument/index.vue | 128 ++++++++++++++++-- 3 files changed, 170 insertions(+), 11 deletions(-) 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 @@ 取 消 + + + + + + + + + + + + + + + + + + + + + + + + + + + +