From 45a1cd5ed1b9c0b8f0b65c740608e6e8cec64ffe Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Tue, 9 Jan 2024 17:00:11 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BB=AA=E5=99=A8=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/domain/entity/WxInstrument.java | 26 +- .../core/domain/req/WxInstrumentSaveReq.java | 388 ++++++++++++++++++ .../controller/WxInstrumentController.java | 34 +- .../src/views/system/instrument/index.vue | 126 ++++-- 4 files changed, 524 insertions(+), 50 deletions(-) create mode 100644 flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java index 31f2fc0..87004da 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/entity/WxInstrument.java @@ -1,5 +1,7 @@ package com.flossom.common.core.domain.entity; +import java.time.LocalDateTime; +import java.time.LocalTime; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; @@ -74,14 +76,14 @@ public class WxInstrument extends BaseEntity { /** * 额外打卡时间开始 */ - @JsonFormat(pattern = "yyyy-MM-dd") - private Date startTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime startTime; /** * 额外打卡时间结束 */ - @JsonFormat(pattern = "yyyy-MM-dd") - private Date endTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime endTime; /** * 标签ID(xxxx,xxxx,xxx) @@ -116,8 +118,8 @@ public class WxInstrument extends BaseEntity { /** * 护理时长 */ - @JsonFormat(pattern = "yyyy-MM-dd") - private Date nursingTime; + @JsonFormat(pattern = "HH:mm:ss") + private LocalTime nursingTime; /** * iot版本 @@ -264,19 +266,19 @@ public class WxInstrument extends BaseEntity { return extraClockCredit; } - public void setStartTime(Date startTime) { + public void setStartTime(LocalDateTime startTime) { this.startTime = startTime; } - public Date getStartTime() { + public LocalDateTime getStartTime() { return startTime; } - public void setEndTime(Date endTime) { + public void setEndTime(LocalDateTime endTime) { this.endTime = endTime; } - public Date getEndTime() { + public LocalDateTime getEndTime() { return endTime; } @@ -328,11 +330,11 @@ public class WxInstrument extends BaseEntity { return sceneNames; } - public void setNursingTime(Date nursingTime) { + public void setNursingTime(LocalTime nursingTime) { this.nursingTime = nursingTime; } - public Date getNursingTime() { + public LocalTime getNursingTime() { return nursingTime; } diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java new file mode 100644 index 0000000..335ab96 --- /dev/null +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/domain/req/WxInstrumentSaveReq.java @@ -0,0 +1,388 @@ +package com.flossom.common.core.domain.req; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.flossom.common.core.web.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.Date; +import java.util.List; + +/** + * 仪器列对象 wx_instrument 保存对象 + * + * @author flossom + * @date 2024-01-06 + */ +public class WxInstrumentSaveReq { + + /** + * 仪器ID + */ + private Long id; + + /** + * 仪器名称 + */ + @NotBlank(message = "请输入仪器名称") + @Length(min = 1, message = "请输入仪器名称") + private String name; + + /** + * 仪器:1、普通仪器 2、iot仪器 + */ + @NotBlank(message = "请选择仪器类型") + private Integer type; + + /** + * iot仪器特有:仪器型号 + */ + @NotBlank(message = "请输入仪器型号") + @Length(min = 1, message = "请输入仪器型号") + private String model; + + /** + * 仪器封面(图片地址) + */ + @NotBlank(message = "请上传仪器封面") + private String banner; + + /** + * 仪器logo图(图片地址) + */ + @NotBlank(message = "请上传仪器logo") + private String logo; + + /** + * 序列号位置图片(图片地址) + */ + @NotBlank(message = "请上传仪器序列号图片") + private String serial; + + /** + * 保修日期 + */ + @NotNull(message = "请输入保修日期") + private Long guarantee; + + /** + * 日常打卡获得积分 + */ + @NotNull(message = "请输入日常打卡获得积分") + private Long dailyClockCredit; + + /** + * 额外打卡奖励积分 + */ + private Long extraClockCredit; + + /** + * 是否开启额外打卡奖励 + */ + @NotNull(message = "请选择是否开启额外打卡奖励") + private Long isExtraClock; + + @NotNull(message = "请选择额外打卡时间范围") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private List extraClockTimeRange; + + /** + * 场景ID(xxxx,xxxx,xxx) + */ + private String sceneIds; + + /** + * 场景名称(xxx,xxx,xxx) + */ + private String sceneNames; + + /** + * 护理时长 + */ + @NotNull(message = "请选择护理时间") + @JsonFormat(pattern = "HH:mm:ss") + private LocalTime nursingTime; + + /** + * iot版本 + */ + private String iotVersion; + + /** + * iot升级数据文件 + */ + private String iotUpgradeData; + + /** + * 是否开启扫机身码:0、关闭 1、开启 + */ + private Integer isScanCode; + + /** + * 是否支持购买:0、不支持 1、支持 + */ + @NotNull(message = "请选择是否支持购买") + private Integer isPurchase; + + /** + * 商城小程序appid + */ + private String shoppingAppid; + + /** + * 商城小程序path + */ + private String shoppingPath; + + /** + * 蓝牙连接中图片 + */ + private String bluetoothConnecting; + + /** + * 蓝牙关闭图片 + */ + private String bluetoothClosed; + + /** + * iot版本升级说明 + */ + private String iotVersionUpgrade; + + /** + * 排序:值越大,排序越前 + */ + @NotNull(message = "请输入排序") + private Long sortNo; + + /** + * 手动绑定介绍图片 + */ + private String manualCodeBinding; + + /** + * 扫码绑定介绍图片 + */ + private String scanCodeBinding; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model; + } + + public String getBanner() { + return banner; + } + + public void setBanner(String banner) { + this.banner = banner; + } + + public String getLogo() { + return logo; + } + + public void setLogo(String logo) { + this.logo = logo; + } + + public String getSerial() { + return serial; + } + + public void setSerial(String serial) { + this.serial = serial; + } + + public Long getGuarantee() { + return guarantee; + } + + public void setGuarantee(Long guarantee) { + this.guarantee = guarantee; + } + + public Long getDailyClockCredit() { + return dailyClockCredit; + } + + public void setDailyClockCredit(Long dailyClockCredit) { + this.dailyClockCredit = dailyClockCredit; + } + + public Long getExtraClockCredit() { + return extraClockCredit; + } + + public void setExtraClockCredit(Long extraClockCredit) { + this.extraClockCredit = extraClockCredit; + } + + public Long getIsExtraClock() { + return isExtraClock; + } + + public void setIsExtraClock(Long isExtraClock) { + this.isExtraClock = isExtraClock; + } + + public List getExtraClockTimeRange() { + return extraClockTimeRange; + } + + public void setExtraClockTimeRange(List extraClockTimeRange) { + this.extraClockTimeRange = extraClockTimeRange; + } + + public String getSceneIds() { + return sceneIds; + } + + public void setSceneIds(String sceneIds) { + this.sceneIds = sceneIds; + } + + public String getSceneNames() { + return sceneNames; + } + + public void setSceneNames(String sceneNames) { + this.sceneNames = sceneNames; + } + + public LocalTime getNursingTime() { + return nursingTime; + } + + public void setNursingTime(LocalTime nursingTime) { + this.nursingTime = nursingTime; + } + + public String getIotVersion() { + return iotVersion; + } + + public void setIotVersion(String iotVersion) { + this.iotVersion = iotVersion; + } + + public String getIotUpgradeData() { + return iotUpgradeData; + } + + public void setIotUpgradeData(String iotUpgradeData) { + this.iotUpgradeData = iotUpgradeData; + } + + public Integer getIsScanCode() { + return isScanCode; + } + + public void setIsScanCode(Integer isScanCode) { + this.isScanCode = isScanCode; + } + + public Integer getIsPurchase() { + return isPurchase; + } + + public void setIsPurchase(Integer isPurchase) { + this.isPurchase = isPurchase; + } + + public String getShoppingAppid() { + return shoppingAppid; + } + + public void setShoppingAppid(String shoppingAppid) { + this.shoppingAppid = shoppingAppid; + } + + public String getShoppingPath() { + return shoppingPath; + } + + public void setShoppingPath(String shoppingPath) { + this.shoppingPath = shoppingPath; + } + + public String getBluetoothConnecting() { + return bluetoothConnecting; + } + + public void setBluetoothConnecting(String bluetoothConnecting) { + this.bluetoothConnecting = bluetoothConnecting; + } + + public String getBluetoothClosed() { + return bluetoothClosed; + } + + public void setBluetoothClosed(String bluetoothClosed) { + this.bluetoothClosed = bluetoothClosed; + } + + public String getIotVersionUpgrade() { + return iotVersionUpgrade; + } + + public void setIotVersionUpgrade(String iotVersionUpgrade) { + this.iotVersionUpgrade = iotVersionUpgrade; + } + + public Long getSortNo() { + return sortNo; + } + + public void setSortNo(Long sortNo) { + this.sortNo = sortNo; + } + + public String getManualCodeBinding() { + return manualCodeBinding; + } + + public void setManualCodeBinding(String manualCodeBinding) { + this.manualCodeBinding = manualCodeBinding; + } + + public String getScanCodeBinding() { + return scanCodeBinding; + } + + public void setScanCodeBinding(String scanCodeBinding) { + this.scanCodeBinding = scanCodeBinding; + } +} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java index 7dde24e..a60cfb7 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java @@ -2,12 +2,16 @@ package com.flossom.system.controller; import com.flossom.common.core.domain.entity.WxInstrument; import com.flossom.common.core.domain.req.WxInstrumentReq; +import com.flossom.common.core.domain.req.WxInstrumentSaveReq; +import com.flossom.common.core.exception.ServiceException; +import com.flossom.common.core.utils.StringUtils; import com.flossom.common.core.web.controller.BaseController; import com.flossom.common.core.web.domain.AjaxResult; import com.flossom.common.core.web.page.TableDataInfo; import com.flossom.common.log.annotation.Log; import com.flossom.common.log.enums.BusinessType; import com.flossom.common.security.annotation.RequiresPermissions; +import com.flossom.common.security.utils.SecurityUtils; import com.flossom.system.service.IWxInstrumentService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -61,7 +65,35 @@ public class WxInstrumentController extends BaseController { @RequiresPermissions("system:instrument:add") @Log(title = "仪器列", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody WxInstrument wxInstrument) { + public AjaxResult add(@RequestBody WxInstrumentSaveReq wxInstrumentSaveReq) { + // 开启额外打开奖励 + if (wxInstrumentSaveReq.getIsExtraClock() == 1) { + if (wxInstrumentSaveReq.getExtraClockCredit() == null + || wxInstrumentSaveReq.getExtraClockTimeRange() == null + || wxInstrumentSaveReq.getExtraClockTimeRange().size() != 2) { + throw new ServiceException("请输入额外打卡奖励或者选择额外打卡时间"); + } + } + + // 仪器类型:IOT仪器 + if (wxInstrumentSaveReq.getType() == 2) { + if (StringUtils.isBlank(wxInstrumentSaveReq.getModel())) { + throw new ServiceException("请选择仪器类型"); + } + } + + // 支持购买 + if (wxInstrumentSaveReq.getIsPurchase() == 1) { + if (StringUtils.isBlank(wxInstrumentSaveReq.getShoppingAppid()) + || StringUtils.isBlank(wxInstrumentSaveReq.getShoppingPath())) { + throw new ServiceException("请输入购买商城APPID和商城PATH"); + } + } + WxInstrument wxInstrument = new WxInstrument(); + BeanUtils.copyProperties(wxInstrumentSaveReq, wxInstrument); + wxInstrument.setStartTime(wxInstrumentSaveReq.getExtraClockTimeRange().get(0)); + wxInstrument.setEndTime(wxInstrumentSaveReq.getExtraClockTimeRange().get(1)); + wxInstrument.setCreateBy(SecurityUtils.getUsername()); return toAjax(wxInstrumentService.insertWxInstrument(wxInstrument)); } diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index e51e292..b009e2d 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -613,54 +613,54 @@ export default { scanCodeBinding: null, }; /* 仪器封面 */ - this.bannerFile= { + this.bannerFile = { uploadHide: false, - dialogImageUrl: '', - dialogVisible: false, - disabled: false, - fileList: [], - }, + dialogImageUrl: '', + dialogVisible: false, + disabled: false, + fileList: [], + } /* 仪器logo */ - this.logoFile= { + this.logoFile = { uploadHide: false, - dialogImageUrl: '', - dialogVisible: false, - disabled: false, - fileList: [], - }, + dialogImageUrl: '', + dialogVisible: false, + disabled: false, + fileList: [], + } /* 序列号图片 */ - this.serialFile= { + this.serialFile = { uploadHide: false, - dialogImageUrl: '', - dialogVisible: false, - disabled: false, - fileList: [], - }, + dialogImageUrl: '', + dialogVisible: false, + disabled: false, + fileList: [], + } /* 手写绑定介绍视频/图片 */ - this.manualFile= { + this.manualFile = { uploadHide: false, - fileList: [], - }, + fileList: [], + } /* 扫码绑定介绍视频/图片 */ - this.scanFile= { + this.scanFile = { uploadHide: false, - fileList: [], - }, + fileList: [], + } /* iot升级数据文件 */ - this.iotUpgradeFile= { + this.iotUpgradeFile = { uploadHide: false, - fileList: [], - }, + fileList: [], + } /* 蓝牙连接文件 */ - this.bluetoothConnectFile= { + this.bluetoothConnectFile = { uploadHide: false, - fileList: [], - }, + fileList: [], + } /* 蓝牙断开连接文件 */ - this.bluetoothClosedFile= { + this.bluetoothClosedFile = { uploadHide: false, - fileList: [], - }, + fileList: [], + } // this.form.iotVersionUpgrade = null, this.resetForm("form"); }, @@ -692,6 +692,59 @@ export default { const id = row.id || this.ids getInstrument(id).then(response => { this.form = response.data; + // 仪器封面回显 + this.bannerFile = { + uploadHide: true, + dialogImageUrl: this.form.banner, + dialogVisible: false, + disabled: false, + fileList: [{name: '', url: this.form.banner}], + } + /* 仪器logo */ + this.logoFile = { + uploadHide: true, + dialogImageUrl: this.form.logo, + dialogVisible: false, + disabled: false, + fileList: [{name: '', url: this.form.logo}], + } + /* 序列号图片 */ + this.serialFile = { + uploadHide: true, + dialogImageUrl: this.form.serial, + dialogVisible: false, + disabled: false, + fileList: [{name: '', url: this.form.serial}], + } + /* 手写绑定介绍视频/图片 */ + this.manualFile = { + uploadHide: true, + fileList: [{name: '手写绑定介绍视频/图片', url: this.form.manualCodeBinding}], + } + /* 扫码绑定介绍视频/图片 */ + this.scanFile = { + uploadHide: true, + fileList: [{name: '扫码绑定介绍视频/图片', url: this.form.scanCodeBinding}], + } + /* iot升级数据文件 */ + this.iotUpgradeFile = { + uploadHide: true, + fileList: [{name: 'iot升级数据文件', url: this.form.iotUpgradeData}], + } + /* 蓝牙连接文件 */ + this.bluetoothConnectFile = { + uploadHide: true, + fileList: [{name: '蓝牙连接文件', url: this.form.bluetoothConnecting}], + } + /* 蓝牙断开连接文件 */ + this.bluetoothClosedFile = { + uploadHide: false, + fileList: [{name: '蓝牙断开连接文件', url: this.form.bluetoothClosed}], + } + // 额外打卡时间 + if (this.form.isExtraClock == 1) { + this.form.extraClockTimeRange = [response.data.startTime, response.data.endTime]; + } this.open = true; this.title = "修改仪器列"; }); @@ -701,19 +754,18 @@ export default { this.$refs["form"].validate(valid => { if (valid) { if (this.form.id != null) { - this.$modal.msgSuccess("修改成功"); + this.$modal.msgSuccess("修改成功"); // updateInstrument(this.form).then(response => { // this.$modal.msgSuccess("修改成功"); // this.open = false; // this.getList(); // }); } else { - console.log(this.form) - /*addInstrument(this.form).then(response => { + addInstrument(this.form).then(response => { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); - });*/ + }); } } }); From 83b3448e36a5d20b1e9fa80e54f2ddbc47e934da Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Tue, 9 Jan 2024 17:16:41 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BB=AA=E5=99=A8=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E5=88=87=E6=8D=A2=EF=BC=8C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WxInstrumentController.java | 8 ++++++ .../src/views/system/instrument/index.vue | 25 ++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java index a60cfb7..42f320b 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java @@ -73,6 +73,9 @@ public class WxInstrumentController extends BaseController { || wxInstrumentSaveReq.getExtraClockTimeRange().size() != 2) { throw new ServiceException("请输入额外打卡奖励或者选择额外打卡时间"); } + } else { + wxInstrumentSaveReq.setExtraClockCredit(null); + wxInstrumentSaveReq.setExtraClockTimeRange(null); } // 仪器类型:IOT仪器 @@ -80,6 +83,8 @@ public class WxInstrumentController extends BaseController { if (StringUtils.isBlank(wxInstrumentSaveReq.getModel())) { throw new ServiceException("请选择仪器类型"); } + } else { + wxInstrumentSaveReq.setModel(null); } // 支持购买 @@ -88,6 +93,9 @@ public class WxInstrumentController extends BaseController { || StringUtils.isBlank(wxInstrumentSaveReq.getShoppingPath())) { throw new ServiceException("请输入购买商城APPID和商城PATH"); } + } else { + wxInstrumentSaveReq.setShoppingAppid(null); + wxInstrumentSaveReq.setShoppingPath(null); } WxInstrument wxInstrument = new WxInstrument(); BeanUtils.copyProperties(wxInstrumentSaveReq, wxInstrument); diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index b009e2d..0ae8837 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -295,7 +295,7 @@ + inactive-color="#DCDCDC" @change="isExtraClockChange"> @@ -313,7 +313,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -900,6 +900,25 @@ export default { this.$message.error('图片插入失败') } }, + /* 是否开启额外打卡奖励 */ + isExtraClockChange() { + if (this.form.isExtraClock == 0) { + this.form.extraClockCredit = 0; + this.form.extraClockTimeRange = []; + } + }, + /* 仪器类型切换 */ + typeChange() { + if (this.form.type == 1) { + this.form.model = "WL200"; + } + }, + isPurchaseChang() { + if (this.form.isPurchase == 0) { + this.form.shoppingAppid = null; + this.form.shoppingPath = null; + } + } } }; From dfc896f3418be7488c6c7cc7fd9984106849cc50 Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Tue, 9 Jan 2024 17:39:02 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E9=9A=90=E8=97=8F=E4=BB=AA=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/WxInstrumentMapper.xml | 2 +- .../com/flossom/system/controller/WxInstrumentController.java | 2 +- flossom-ui/src/views/system/instrument/index.vue | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml index ccb6342..edd4fec 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml @@ -234,7 +234,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from wx_instrument where id in + UPDATE wx_instrument SET status = 1 where id in #{id} diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java index 42f320b..95fb830 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java @@ -116,7 +116,7 @@ public class WxInstrumentController extends BaseController { } /** - * 删除仪器列 + * 隐藏仪器 */ @RequiresPermissions("system:instrument:remove") @Log(title = "仪器列", businessType = BusinessType.DELETE) diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index 0ae8837..2dd7da5 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -773,11 +773,11 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const ids = row.id || this.ids; - this.$modal.confirm('是否确认删除仪器列编号为"' + ids + '"的数据项?').then(function () { + this.$modal.confirm('是否确认隐藏仪器列编号为"' + ids + '"的数据项?').then(function () { return delInstrument(ids); }).then(() => { this.getList(); - this.$modal.msgSuccess("删除成功"); + this.$modal.msgSuccess("隐藏成功"); }).catch(() => { }); }, From f7ba81403726979fe296805bfd6fbe1d82909bb8 Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Tue, 9 Jan 2024 17:50:21 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E9=9A=90=E8=97=8F=E4=BB=AA=E5=99=A8?= =?UTF-8?q?=E4=B8=8E=E8=A7=A3=E7=BB=91=E4=BB=AA=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/mapper/WxInstrumentMapper.java | 2 +- .../src/main/resources/mapper/WxInstrumentMapper.xml | 7 ++----- .../system/controller/WxInstrumentController.java | 6 +++--- .../flossom/system/service/IWxInstrumentService.java | 2 +- .../system/service/impl/WxInstrumentServiceImpl.java | 4 ++-- flossom-ui/src/views/system/instrument/index.vue | 12 +++++++++++- 6 files changed, 20 insertions(+), 13 deletions(-) diff --git a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentMapper.java b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentMapper.java index c2ad68b..45a6971 100644 --- a/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentMapper.java +++ b/flossom-common/flossom-common-core/src/main/java/com/flossom/common/core/mapper/WxInstrumentMapper.java @@ -60,7 +60,7 @@ public interface WxInstrumentMapper { * @param ids 需要删除的数据主键集合 * @return 结果 */ - public int deleteWxInstrumentByIds(Long[] ids); + public int deleteWxInstrumentByIds(Long id); } diff --git a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml index edd4fec..e8e048f 100644 --- a/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml +++ b/flossom-common/flossom-common-core/src/main/resources/mapper/WxInstrumentMapper.xml @@ -233,10 +233,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" delete from wx_instrument where id = #{id} - - UPDATE wx_instrument SET status = 1 where id in - - #{id} - + + UPDATE wx_instrument SET status = IF(status = 1, 0, 1) where id = #{id} \ No newline at end of file diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java index 95fb830..489568b 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/controller/WxInstrumentController.java @@ -120,8 +120,8 @@ public class WxInstrumentController extends BaseController { */ @RequiresPermissions("system:instrument:remove") @Log(title = "仪器列", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) { - return toAjax(wxInstrumentService.deleteWxInstrumentByIds(ids)); + @DeleteMapping("/{id}") + public AjaxResult remove(@PathVariable Long id) { + return toAjax(wxInstrumentService.deleteWxInstrumentByIds(id)); } } diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentService.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentService.java index af37334..5f26939 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentService.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/IWxInstrumentService.java @@ -58,7 +58,7 @@ public interface IWxInstrumentService { * @param ids 需要删除的仪器列主键集合 * @return 结果 */ - public int deleteWxInstrumentByIds(Long[] ids); + public int deleteWxInstrumentByIds(Long 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 5547f71..28ec5fb 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 @@ -80,8 +80,8 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { * @return 结果 */ @Override - public int deleteWxInstrumentByIds(Long[] ids) { - return wxInstrumentMapper.deleteWxInstrumentByIds(ids); + public int deleteWxInstrumentByIds(Long id) { + return wxInstrumentMapper.deleteWxInstrumentByIds(id); } /** diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index 2dd7da5..eb8160d 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -128,8 +128,18 @@ icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:instrument:remove']" + v-if="scope.row.status == 0" >隐藏 + 解除隐藏 + @@ -772,7 +782,7 @@ export default { }, /** 删除按钮操作 */ handleDelete(row) { - const ids = row.id || this.ids; + const ids = row.id; this.$modal.confirm('是否确认隐藏仪器列编号为"' + ids + '"的数据项?').then(function () { return delInstrument(ids); }).then(() => { 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 5/5] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=8F=AF=E8=A7=81=E6=A0=87=E7=AD=BE=E5=92=8C=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=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 @@ 取 消 + + + + + + + + + + + + + + + + + + + + + + + + + + + +