perf: 可自定义加减返回的数据结构成员

dev
huangfeng 11 months ago
parent 72aee9c5bb
commit 7285ede61c

@ -118,10 +118,13 @@ public class TerminalExtController extends BaseController {
public ResponseReult<PageInfo<View_Dy_Line_Tower_Terminals>> listWithAll(Integer dyId, Integer lineId, Integer towerId, String search,
Integer isonline, Integer protocol, Integer devType, String cmdid,
Long start, Long end,
Integer channelId, Integer activityId,
Integer channelId, Integer activityId, String dataFlag,
Integer pageNum, Integer pageSize) {
pageNum = this.initPageNum(pageNum);
pageSize = this.initPageSize(pageSize);
if (dataFlag == null) {
dataFlag = "";
}
long cost = System.currentTimeMillis();
PageInfo<View_Dy_Line_Tower_Terminals> result = this.getTerminalPage(dyId, lineId, towerId, search, cmdid,
isonline, protocol, devType, activityId,
@ -131,19 +134,31 @@ public class TerminalExtController extends BaseController {
if (!CollectionUtils.isEmpty(result.getList())) {
cost = System.currentTimeMillis();
for (View_Dy_Line_Tower_Terminals terminal : result.getList()) {
TerminalGpsModel last = gpsService.getTermLastGPSPosition(terminal.getId())
.getData();
terminal.setLastGps(last);
PhotoDayModel photoInfo = photoService.getDayModel(terminal.getId(), channelId, start, end);
terminal.setPhotoInfo(photoInfo);
TerminalStatus status = terminalStatusDao.selectByPrimaryKey(terminal.getId());
terminal.setWorkingStatus(status);
TerminalPositions positions = terminalPositionsDao.selectByPrimaryKey(terminal.getId());
terminal.setPositions(positions);
long rebootCount = infoHistoryService.count(terminal.getId(), start, end);
terminal.setRebootCount(rebootCount);
TerminalBasicInfoHistory info = infoHistoryService.getLast(terminal.getId());
terminal.setLastInfo(info);
if (dataFlag.contains("G")) {
TerminalGpsModel last = gpsService.getTermLastGPSPosition(terminal.getId())
.getData();
terminal.setLastGps(last);
}
if (dataFlag.contains("P")) {
PhotoDayModel photoInfo = photoService.getDayModel(terminal.getId(), channelId, start, end);
terminal.setPhotoInfo(photoInfo);
}
if (dataFlag.contains("S")) {
TerminalStatus status = terminalStatusDao.selectByPrimaryKey(terminal.getId());
terminal.setWorkingStatus(status);
}
if (dataFlag.contains("O")) {
TerminalPositions positions = terminalPositionsDao.selectByPrimaryKey(terminal.getId());
terminal.setPositions(positions);
}
if (dataFlag.contains("C")) {
long rebootCount = infoHistoryService.count(terminal.getId(), start, end);
terminal.setRebootCount(rebootCount);
}
if (dataFlag.contains("B")) {
TerminalBasicInfoHistory info = infoHistoryService.getLast(terminal.getId());
terminal.setLastInfo(info);
}
}
cost = System.currentTimeMillis() - cost;
log.info("listWithAll cost=" + cost);

Loading…
Cancel
Save