处理问题
This commit is contained in:
parent
d038ae066d
commit
020a201381
@ -158,41 +158,7 @@ public class DataRealServiceImpl extends AbstractService implements IDataRealSer
|
||||
@Override
|
||||
public List<DataRealDTO> list(Map<String, Object> params) {
|
||||
List<DataRealDTO> dataRealDTOs = dataMinuteDao.list(params);
|
||||
|
||||
Set<String> enterpriseIdSet = new HashSet<>();
|
||||
Set<String> instrumentIdSet = new HashSet<>();
|
||||
|
||||
for (DataRealDTO dataRealDTO : dataRealDTOs) {
|
||||
enterpriseIdSet.add(dataRealDTO.getEnterpriseId());
|
||||
instrumentIdSet.add(dataRealDTO.getInstrumentId());
|
||||
}
|
||||
|
||||
List<EnterprisePO> enterprisePOs = enterpriseService.listPO(new ArrayList<>(enterpriseIdSet));
|
||||
List<InstrumentPO> instrumentPOs = instrumentService.listPO(new ArrayList<>(instrumentIdSet));
|
||||
List<PollPO> pollPOs = pollService.listPO(new HashMap<>());
|
||||
|
||||
for (DataRealDTO dataRealDTO : dataRealDTOs) {
|
||||
for (EnterprisePO enterprisePO : enterprisePOs) {
|
||||
if (StringUtils.equals(dataRealDTO.getEnterpriseId(), enterprisePO.getEnterpriseId())) {
|
||||
dataRealDTO.setEnterpriseName(enterprisePO.getEnterpriseName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (InstrumentPO instrumentPO : instrumentPOs) {
|
||||
if (StringUtils.equals(dataRealDTO.getInstrumentId(), instrumentPO.getInstrumentId())) {
|
||||
dataRealDTO.setInstrumentName(instrumentPO.getInstrumentName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (PollPO pollPO : pollPOs) {
|
||||
if (StringUtils.equals(dataRealDTO.getPollId(), pollPO.getPollNo()) ||
|
||||
StringUtils.equals(dataRealDTO.getPollId(), pollPO.getPollNoOld())) {
|
||||
dataRealDTO.setPollName(pollPO.getPollName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setDataRealInfo(dataRealDTOs);
|
||||
return dataRealDTOs;
|
||||
}
|
||||
|
||||
@ -300,4 +266,43 @@ public class DataRealServiceImpl extends AbstractService implements IDataRealSer
|
||||
return listLastData;
|
||||
}
|
||||
|
||||
private void setDataRealInfo(List<DataRealDTO> dataRealDTOs) {
|
||||
if (dataRealDTOs.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Set<String> enterpriseIdSet = new HashSet<>();
|
||||
Set<String> instrumentIdSet = new HashSet<>();
|
||||
|
||||
for (DataRealDTO dataRealDTO : dataRealDTOs) {
|
||||
enterpriseIdSet.add(dataRealDTO.getEnterpriseId());
|
||||
instrumentIdSet.add(dataRealDTO.getInstrumentId());
|
||||
}
|
||||
|
||||
List<EnterprisePO> enterprisePOs = enterpriseService.listPO(new ArrayList<>(enterpriseIdSet));
|
||||
List<InstrumentPO> instrumentPOs = instrumentService.listPO(new ArrayList<>(instrumentIdSet));
|
||||
List<PollPO> pollPOs = pollService.listPO(new HashMap<>());
|
||||
|
||||
for (DataRealDTO dataRealDTO : dataRealDTOs) {
|
||||
for (EnterprisePO enterprisePO : enterprisePOs) {
|
||||
if (StringUtils.equals(dataRealDTO.getEnterpriseId(), enterprisePO.getEnterpriseId())) {
|
||||
dataRealDTO.setEnterpriseName(enterprisePO.getEnterpriseName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (InstrumentPO instrumentPO : instrumentPOs) {
|
||||
if (StringUtils.equals(dataRealDTO.getInstrumentId(), instrumentPO.getInstrumentId())) {
|
||||
dataRealDTO.setInstrumentName(instrumentPO.getInstrumentName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (PollPO pollPO : pollPOs) {
|
||||
if (StringUtils.equals(dataRealDTO.getPollId(), pollPO.getPollNo()) ||
|
||||
StringUtils.equals(dataRealDTO.getPollId(), pollPO.getPollNoOld())) {
|
||||
dataRealDTO.setPollName(pollPO.getPollName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -263,12 +263,6 @@
|
||||
<if test="keywords != null and keywords != ''">
|
||||
AND (
|
||||
t1.poll_id LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR
|
||||
jt1.enterprise_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR
|
||||
jt2.instrument_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
OR
|
||||
jt3.poll_name LIKE CONCAT('%', #{keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
|
@ -18,7 +18,7 @@
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item search-item-width-100" placeholder="输入关键字">
|
||||
<input type="text" id="keywords" class="layui-input search-item search-item-width-200" placeholder="输入污染物因子编码">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item search-item-width-100" placeholder="开始时间" readonly>
|
||||
|
Loading…
Reference in New Issue
Block a user