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

Loading…
Cancel
Save