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());