From 89c042bfa617a0d6a5e53fc267c4174e32c06eec Mon Sep 17 00:00:00 2001 From: elliott <382696293@qq.com> Date: Thu, 18 Jan 2024 15:35:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=A8=A1=E5=BC=8F=E5=85=B3?= =?UTF-8?q?=E8=81=94=E6=A0=87=E7=AD=BE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/mapper/WxModeTagMapper.java | 8 + .../main/resources/mapper/WxModeTagMapper.xml | 4 + .../system/controller/SysTagController.java | 5 +- .../system/service/IWxModeTagService.java | 8 + .../service/impl/WxModeTagServiceImpl.java | 5 + .../src/views/system/userInstrument/index.vue | 247 ++++++++++++++---- 6 files changed, 230 insertions(+), 47 deletions(-) diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxModeTagMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxModeTagMapper.java index b82aeeb..41c0a99 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxModeTagMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxModeTagMapper.java @@ -68,4 +68,12 @@ public interface WxModeTagMapper * @return 结果 */ public int deleteWxModeTagByModeId(Long modeId); + + /** + * 删除模式与标签关联 + * + * @param tagId 标签ID + * @return 结果 + */ + public int deleteWxModeTagByTagId(Long tagId); } diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxModeTagMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxModeTagMapper.xml index 28b3c64..f207724 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxModeTagMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxModeTagMapper.xml @@ -86,6 +86,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from wx_mode_tag where mode_id = #{modeId} + + delete from wx_mode_tag where mode_id = #{tagId} + + delete from wx_mode_tag where id in diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/SysTagController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/SysTagController.java index 8991be8..151c559 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/SysTagController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/SysTagController.java @@ -44,6 +44,8 @@ public class SysTagController extends BaseController { private IWxUserTagService userTagService; @Autowired private ISiteInfoService siteInfoService; + @Autowired + private IWxModeTagService wxModeTagService; /** * 获取标签列表 */ @@ -125,7 +127,8 @@ public class SysTagController extends BaseController { wxScriptTagService.deleteWxScriptTagByTagId(id); // 删除站点关联标签 siteInfoService.deleteSiteInfoByTagId(id); - // 删除用户标签 + // 删除模式关联标签 + wxModeTagService.deleteWxModeTagByTagId(id); // if (tagService.checkDeptExistUser(id)) // { // return warn("标签存在用户,不允许删除"); diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxModeTagService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxModeTagService.java index c83681a..886dc96 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxModeTagService.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxModeTagService.java @@ -59,4 +59,12 @@ public interface IWxModeTagService * @return 结果 */ public int deleteWxModeTagById(Long id); + + /** + * 删除模式与标签关联信息 + * + * @param tagId 标签ID + * @return 结果 + */ + public int deleteWxModeTagByTagId(Long tagId); } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxModeTagServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxModeTagServiceImpl.java index 898f061..b5b47e4 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxModeTagServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxModeTagServiceImpl.java @@ -94,4 +94,9 @@ public class WxModeTagServiceImpl implements IWxModeTagService { return wxModeTagMapper.deleteWxModeTagById(id); } + + @Override + public int deleteWxModeTagByTagId(Long tagId) { + return wxModeTagMapper.deleteWxModeTagByTagId(tagId); + } } diff --git a/flossom-ui/src/views/system/userInstrument/index.vue b/flossom-ui/src/views/system/userInstrument/index.vue index 61d5acd..fb9b9ee 100644 --- a/flossom-ui/src/views/system/userInstrument/index.vue +++ b/flossom-ui/src/views/system/userInstrument/index.vue @@ -98,51 +98,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + 确认 + + + + @@ -326,6 +301,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -347,6 +377,8 @@ export default { id: "", serial: "", }, + // 批量操作类型-下拉项选择 + batchOperateValue: null, // 序列号标题 serialTitle: "换绑序列号", // 序列号弹窗 @@ -379,6 +411,28 @@ export default { title: "", // 是否显示弹出层 open: false, + allFields: false, + exportFieldList: { + id: null, + nickname: null, + credit: null, + expireCredit: null, + unionid: null, + mobile: null, + province: null, + city: null, + area: null, + birthday: null, + devicesNum: null, + devicesName: null, + createTime: null, + wecomTags: null, + miniProgramTags: null, + }, + exportFieldsForm: { + userIdList: null, + exportFields: null, + }, // 查询参数 queryParams: { pageNum: 1, @@ -403,6 +457,8 @@ export default { pageSize: 10, userInstrumentId: null, }, + // 导出数据选择字段 + exportFieldsVisible: false, // 表单参数 form: {}, // 表单校验 @@ -645,7 +701,106 @@ export default { this.guaranteeOpen = false; this.getList(); }); - } + }, + // 批量操作 + batchOperate() { + if (this.batchOperateValue == null) { + this.$message.error("请选择您的操作"); + return; + } + if (this.batchOperateValue == 1) { + if (this.ids.length == 0) { + this.$message.error("请选择数据"); + return + } + } + this.exportFieldsVisible = true; + }, + // 取消操作 + cancelExportFieldsDialog() { + this.allFields = false; + this.exportFieldsVisible = false + this.exportFieldList = { + id: null, + nickname: null, + credit: null, + expireCredit: null, + unionid: null, + mobile: null, + province: null, + city: null, + area: null, + birthday: null, + devicesNum: null, + devicesName: null, + createTime: null, + wecomTags: null, + miniProgramTags: null, + } + }, + // 批量操作 + submitBatchOperate() { + // 导出用户数据 + if (this.batchOperateValue == 1) { + let exportFields = Object.values(this.exportFieldList).filter(val => val != null); + if (exportFields.length == 0) { + this.$modal.msgError("请选择导出字段"); + return; + } + this.exportFieldsForm.userIdList = this.ids; + this.exportFieldsForm.exportFields = exportFields; + this.download('/system/member/batchExport', { + ...this.exportFieldsForm + }, `微信会员_${new Date().getTime()}.xlsx`); + this.cancelExportFieldsDialog(); + } + if (this.batchOperateValue == 2) { + let exportFields = Object.values(this.exportFieldList).filter(val => val != null); + if (exportFields.length == 0) { + this.$modal.msgError("请选择导出字段"); + return; + } + this.download('/system/member/allExport', { + ...Object.assign({}, this.queryParams, {exportFields: exportFields}) + }, `微信会员_${new Date().getTime()}.xlsx`) + this.cancelExportFieldsDialog(); + } + }, + isExportAllFields() { + if (this.allFields) { + this.exportFieldList.nickname = "nickname"; + this.exportFieldList.id = "id"; + this.exportFieldList.credit = "credit"; + this.exportFieldList.expireCredit = "expireCredit"; + this.exportFieldList.unionid = "unionid"; + this.exportFieldList.mobile = "mobile"; + this.exportFieldList.province = "province"; + this.exportFieldList.city = "city"; + this.exportFieldList.area = "area"; + this.exportFieldList.birthday = "birthday"; + this.exportFieldList.devicesNum = "devicesNum"; + this.exportFieldList.devicesName = "devicesName"; + this.exportFieldList.createTime = "createTime"; + this.exportFieldList.wecomTags = "wecomTags"; + this.exportFieldList.miniProgramTags = "miniProgramTags"; + } else { + this.exportFieldList.nickname = null; + this.exportFieldList.id = null; + this.exportFieldList.credit = null; + this.exportFieldList.expireCredit = null; + this.exportFieldList.unionid = null; + this.exportFieldList.mobile = null; + this.exportFieldList.province = null; + this.exportFieldList.city = null; + this.exportFieldList.area = null; + this.exportFieldList.birthday = null; + this.exportFieldList.devicesNum = null; + this.exportFieldList.devicesName = null; + this.exportFieldList.createTime = null; + this.exportFieldList.wecomTags = null; + this.exportFieldList.miniProgramTags = null; + } + }, } };