From 1f852e8e90168a30fc9b2493bcb861bdbd8a52e8 Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Thu, 18 Jan 2024 14:55:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=AA=E5=99=A8=E7=AE=A1=E7=90=86-=E5=B8=A6n?= =?UTF-8?q?ew=E6=A0=87=E8=AF=86=E7=9A=84=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/domain/req/WxInstrumentSaveReq.java | 13 +++++ .../service/impl/WxInstrumentServiceImpl.java | 17 +++++++ .../src/views/system/instrument/index.vue | 47 ++++++++++++++++--- 3 files changed, 70 insertions(+), 7 deletions(-) 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 index 5aff9b6..71dac62 100644 --- 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 @@ -225,6 +225,11 @@ public class WxInstrumentSaveReq { */ private List modeIdsValue; + /** + * 带new标识的模式 + */ + private List newModeIdList; + public Long getId() { return id; } @@ -528,4 +533,12 @@ public class WxInstrumentSaveReq { public void setBluetoothConnectFailContent(String bluetoothConnectFailContent) { this.bluetoothConnectFailContent = bluetoothConnectFailContent; } + + public List getNewModeIdList() { + return newModeIdList; + } + + public void setNewModeIdList(List newModeIdList) { + this.newModeIdList = newModeIdList; + } } 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 ffcf61b..3efed1a 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 @@ -90,6 +90,13 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { .map(WxInstrumentMode::getModeId) .map(Long::intValue) .collect(Collectors.toList())); + + wxInstrumentSaveReq.setNewModeIdList(wxInstrumentModes.stream() + .filter(im -> im.getIsNew() == 1) + .map(WxInstrumentMode::getModeId) + .map(Long::intValue) + .collect(Collectors.toList()) + ); } return wxInstrumentSaveReq; } @@ -183,6 +190,11 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { wxInstrumentMode.setInstrumentId(wxInstrument.getId()); wxInstrumentMode.setModeId(modeIdList.get(i).longValue()); wxInstrumentMode.setModeSort(i); + if (wxInstrumentSaveReq.getNewModeIdList() != null && wxInstrumentSaveReq.getNewModeIdList().size() > 0) { + if (wxInstrumentSaveReq.getNewModeIdList().contains(modeIdList.get(i))) { + wxInstrumentMode.setIsNew(1); + } + } wxInstrumentMode.setStatus(Status.OK.getCode()); wxInstrumentMode.setCreateBy(SecurityUtils.getUsername()); wxInstrumentMode.setCreateTime(DateUtils.getNowDate()); @@ -285,6 +297,11 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { wxInstrumentMode.setInstrumentId(wxInstrumentSaveReq.getId()); wxInstrumentMode.setModeId(modeIdList.get(i).longValue()); wxInstrumentMode.setModeSort(i); + if (wxInstrumentSaveReq.getNewModeIdList() != null && wxInstrumentSaveReq.getNewModeIdList().size() > 0) { + if (wxInstrumentSaveReq.getNewModeIdList().contains(modeIdList.get(i))) { + wxInstrumentMode.setIsNew(1); + } + } wxInstrumentMode.setStatus(Status.OK.getCode()); wxInstrumentMode.setCreateBy(SecurityUtils.getUsername()); wxInstrumentMode.setCreateTime(DateUtils.getNowDate()); diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index 2575c74..9394bea 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -470,7 +470,7 @@ + + + 0) { + let temp = []; + for (let i = 0; i < this.form.modeIdsValue.length; i++) { + let filterModeArr = this.mode.modeIdsOptions.filter((item) => item.id == this.form.modeIdsValue[i]) + temp.push(filterModeArr[0]); + } + this.newModeOptionList = temp; + } }) }) }, @@ -1944,9 +1968,6 @@ export default { this.mode.modeSortVisible = true; } }, - openModeIdDialog2() { - console.log(this.form.modeIdsValue); - }, handleCloseMode() { this.mode.modeIdsValueTemp = []; this.mode.sortMode = []; @@ -1960,6 +1981,18 @@ export default { this.form.modeIdsValue = newSort; this.handleCloseMode() }, + modeIdsValueChang() { + let temp = []; + if (this.form.modeIdsValue.length > 0) { + for (let i = 0; i < this.form.modeIdsValue.length; i++) { + let filterModeArr = this.mode.modeIdsOptions.filter((item) => item.id == this.form.modeIdsValue[i]) + temp.push(filterModeArr[0]); + } + } + this.newModeOptionList = temp; + }, + + }, }