二次版本提交

This commit is contained in:
hzj
2025-07-31 09:37:36 +08:00
parent b2ff27b15c
commit 6c88c54982
7 changed files with 18 additions and 9 deletions

View File

@@ -19,5 +19,5 @@ import java.util.List;
public interface PqDeviceMapper extends BaseMapper<PqDevice> {
List<DeviceDTO> queryListByIds(@Param("ids") List<Integer> ids);
Page<DeviceDTO> selectDeviceDTOPage(Page<DeviceDTO> pqsEventdetailPage, @Param("searchValue") String searchValue,@Param("devIndexs") List<Integer> devIndexs, @Param("state") Integer state);
Page<DeviceDTO> selectDeviceDTOPage(Page<DeviceDTO> pqsEventdetailPage, @Param("searchValue") String searchValue,@Param("devIndexs") List<Integer> devIndexs, @Param("state") String state);
}

View File

@@ -62,14 +62,19 @@
pq_device.status status,
PQ_SUBSTATION.sub_index stationId,
PQ_SUBSTATION.name stationName,
PQ_GDINFORMATION.Name gdName
PQ_GDINFORMATION.Name gdName,
PQS_DICDATA.DIC_Name MANUFACTURER_Name
from
pq_device,
PQ_SUBSTATION,
PQ_GDINFORMATION
PQ_GDINFORMATION,
PQ_DEVICEDETAIL,
PQS_DICDATA
where
pq_device.SUB_INDEX = PQ_SUBSTATION.SUB_INDEX
and pq_device.GD_INDEX =PQ_GDINFORMATION.GD_INDEX
and PQ_DEVICEDETAIL.dev_index =pq_device.dev_index
and PQ_DEVICEDETAIL.MANUFACTURER = PQS_DICDATA.DIC_INDEX
<if test="searchValue!= null and searchValue!= ''">
AND (
pq_device.name LIKE '%' || #{searchValue} || '%'

View File

@@ -23,6 +23,7 @@ public class DeviceDTO {
private LocalDateTime updateTime;
private String devFlag;
private String ip;
private String manufacturerName;
//通讯状态
private Integer runFlag=0;
//装置通讯状态0中断1正常

View File

@@ -19,5 +19,5 @@ public interface PqDeviceService extends IService<PqDevice>{
List<DeviceDTO> queryListByIds(List<Integer> lineIds);
Page<DeviceDTO> selectDeviceDTOPage(Page<DeviceDTO> pqsEventdetailPage, String searchValue, List<Integer> devIndexs, Integer state);
Page<DeviceDTO> selectDeviceDTOPage(Page<DeviceDTO> pqsEventdetailPage, String searchValue, List<Integer> devIndexs, String state);
}

View File

@@ -26,7 +26,7 @@ public class PqDeviceServiceImpl extends ServiceImpl<PqDeviceMapper, PqDevice> i
}
@Override
public Page<DeviceDTO> selectDeviceDTOPage(Page<DeviceDTO> pqsEventdetailPage, String searchValue, List<Integer> devIndexs, Integer state) {
public Page<DeviceDTO> selectDeviceDTOPage(Page<DeviceDTO> pqsEventdetailPage, String searchValue, List<Integer> devIndexs, String state) {
return this.baseMapper.selectDeviceDTOPage(pqsEventdetailPage,searchValue,devIndexs,state);
}
}

View File

@@ -29,7 +29,7 @@ public class LargeScreenCountParam extends BaseParam {
private Integer eventDeep;
@ApiModelProperty(name="t通讯状态",value="0.离线 1.在线")
private Integer state;
private String state;
private Integer sendResult;
@JsonFormat(pattern = "yyyy-MM-dd")

View File

@@ -1084,15 +1084,18 @@ public class LargeScreenCountServiceImpl implements LargeScreenCountService {
pqLineList = pqLineList.stream().filter(temp->deptslineIds.contains(temp.getLineIndex())).collect(Collectors.toList());
List<Integer> devIndexs = pqLineList.stream().map(PqLine::getDevIndex).collect(Collectors.toList());
List<PqsOnlinerate> list = pqsOnlinerateService.lambdaQuery().in(PqsOnlinerate::getDevIndex,devIndexs).between(PqsOnlinerate::getTimeid, startTime, endTime).list();
//在运总数
List<PqDevice> pqDeviceList = pqDeviceService.lambdaQuery().in(PqDevice::getDevIndex, devIndexs).eq(PqDevice::getDevflag, 0).list();
List<Integer> runDevList = pqDeviceList.stream().map(PqDevice::getDevIndex).collect(Collectors.toList());
List<PqsOnlinerate> list = pqsOnlinerateService.lambdaQuery().in(PqsOnlinerate::getDevIndex,runDevList).between(PqsOnlinerate::getTimeid, startTime, endTime).list();
pqsEventdetailPage = pqDeviceService.selectDeviceDTOPage(pqsEventdetailPage,largeScreenCountParam.getSearchValue(),devIndexs,largeScreenCountParam.getState());
pqsEventdetailPage = pqDeviceService.selectDeviceDTOPage(pqsEventdetailPage,largeScreenCountParam.getSearchValue(),runDevList,largeScreenCountParam.getState());
if(!CollectionUtils.isEmpty(list)){
for (DeviceDTO record : pqsEventdetailPage.getRecords()) {
List<PqsOnlinerate> tempList = list.stream().filter(temp -> Objects.equals(temp.getDevIndex(), record.getDevId())).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(tempList)){
double asDouble = tempList.stream().mapToDouble(temp -> {
return Double.valueOf(temp.getOnlinemin()) / (temp.getOfflinemin() + temp.getOnlinemin());
return Double.valueOf(temp.getOnlinemin()*100) / (temp.getOfflinemin() + temp.getOnlinemin());
}).average().getAsDouble();
record.setOnLineRate(new BigDecimal(asDouble).setScale(2, RoundingMode.UP).doubleValue());