From 6e0c8e6592bfc033bd57e1e674e9176db57e666c Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Thu, 28 Mar 2024 14:17:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=86=9C=E5=B8=83=E6=B7=BB=E5=8A=A0=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxInstrumentServiceImpl.java | 46 ++++++------------- 1 file changed, 14 insertions(+), 32 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 ba6ab95..e4eba8e 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 @@ -284,22 +284,13 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { wxInstrumentMode.setInstrumentId(wxInstrument.getId()); wxInstrumentMode.setModeId(modeList.get(i).longValue()); wxInstrumentMode.setModeSort(i); - wxInstrumentMode.setIsNew(0); - wxInstrumentMode.setLiningId(liningId); - wxInstrumentMode.setStatus(Status.OK.getCode()); - wxInstrumentMode.setCreateBy(SecurityUtils.getUsername()); - wxInstrumentMode.setCreateTime(DateUtils.getNowDate()); - wxInstrumentModeMapper.insertWxInstrumentMode(wxInstrumentMode); - } - } - List newModeIdList = wxLining.getNewModeIdList(); - if (newModeIdList != null && newModeIdList.size() > 0) { - for (int i = 0; i < newModeIdList.size(); i++) { - WxInstrumentMode wxInstrumentMode = new WxInstrumentMode(); - wxInstrumentMode.setInstrumentId(wxInstrument.getId()); - wxInstrumentMode.setModeId(modeIdList.get(i).longValue()); - wxInstrumentMode.setModeSort(i); - wxInstrumentMode.setIsNew(1); + if (wxLining.getNewModeIdList() != null && wxLining.getNewModeIdList().size() > 0) { + if (wxLining.getNewModeIdList().contains(modeList.get(i))) { + wxInstrumentMode.setIsNew(1); + } + }else { + wxInstrumentMode.setIsNew(0); + } wxInstrumentMode.setLiningId(liningId); wxInstrumentMode.setStatus(Status.OK.getCode()); wxInstrumentMode.setCreateBy(SecurityUtils.getUsername()); @@ -439,22 +430,13 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { wxInstrumentMode.setInstrumentId(wxInstrument.getId()); wxInstrumentMode.setModeId(modeList.get(i).longValue()); wxInstrumentMode.setModeSort(i); - wxInstrumentMode.setIsNew(0); - wxInstrumentMode.setLiningId(liningId); - wxInstrumentMode.setStatus(Status.OK.getCode()); - wxInstrumentMode.setCreateBy(SecurityUtils.getUsername()); - wxInstrumentMode.setCreateTime(DateUtils.getNowDate()); - wxInstrumentModeMapper.insertWxInstrumentMode(wxInstrumentMode); - } - } - List newModeIdList = wxLining.getNewModeIdList(); - if (newModeIdList != null && newModeIdList.size() > 0) { - for (int i = 0; i < newModeIdList.size(); i++) { - WxInstrumentMode wxInstrumentMode = new WxInstrumentMode(); - wxInstrumentMode.setInstrumentId(wxInstrument.getId()); - wxInstrumentMode.setModeId(newModeIdList.get(i).longValue()); - wxInstrumentMode.setModeSort(i); - wxInstrumentMode.setIsNew(1); + if (wxLining.getNewModeIdList() != null && wxLining.getNewModeIdList().size() > 0) { + if (wxLining.getNewModeIdList().contains(modeList.get(i))) { + wxInstrumentMode.setIsNew(1); + } + }else { + wxInstrumentMode.setIsNew(0); + } wxInstrumentMode.setLiningId(liningId); wxInstrumentMode.setStatus(Status.OK.getCode()); wxInstrumentMode.setCreateBy(SecurityUtils.getUsername());