|
@@ -11,6 +11,8 @@ import com.ym.mec.biz.dal.entity.Subject;
|
|
|
import com.ym.mec.biz.dal.entity.SubjectGoodsMapper;
|
|
|
import com.ym.mec.biz.dal.enums.YesOrNoEnum;
|
|
|
import com.ym.mec.biz.dal.page.SubjectQueryInfo;
|
|
|
+import com.ym.mec.biz.dal.wrapper.InstrumentWrapper;
|
|
|
+import com.ym.mec.biz.dal.wrapper.SubjectWrapper;
|
|
|
import com.ym.mec.biz.service.SubjectService;
|
|
|
import com.ym.mec.common.dal.BaseDAO;
|
|
|
import com.ym.mec.common.page.PageInfo;
|
|
@@ -252,4 +254,31 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject> implem
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<SubjectWrapper.Subject> queryList(SubjectWrapper.SubjectQuery query) {
|
|
|
+ query.setPage(1);
|
|
|
+ query.setRows(9999);
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ MapUtil.populateMap(params, query);
|
|
|
+
|
|
|
+ PageInfo<SubjectWrapper.Subject> subjectIPage = this.selectPage(query);
|
|
|
+ List<SubjectWrapper.Subject> records = subjectIPage.getRows();
|
|
|
+ if (org.apache.commons.collections.CollectionUtils.isEmpty(records)) {
|
|
|
+ return records;
|
|
|
+ }
|
|
|
+ String instrumentIds = query.getInstrumentIds();
|
|
|
+ List<Long> instrumentIdList = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotEmpty(instrumentIds)) {
|
|
|
+ List<Long> collect = Arrays.stream(instrumentIds.split(",")).map(Long::valueOf).distinct().collect(Collectors.toList());
|
|
|
+ instrumentIdList.addAll(collect);
|
|
|
+ }
|
|
|
+ if (!instrumentIdList.isEmpty()) {
|
|
|
+ records.forEach(record -> {
|
|
|
+ List<InstrumentWrapper.Instrument> instruments = record.getInstruments();
|
|
|
+ instruments.removeIf(next -> !instrumentIdList.contains(next.getId()));
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return records;
|
|
|
+ }
|
|
|
}
|