Browse Source

Merge branch 'dev'

dev
sunyuchao 4 years ago
parent
commit
a765e7fd92
  1. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

@ -491,6 +491,11 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
//2.查询网格信息并赋值 //2.查询网格信息并赋值
Map<String, CustomerGridDTO> map = new HashMap<>(); Map<String, CustomerGridDTO> map = new HashMap<>();
for (PcworkRecordListResultDTO.StaffPatrol r : result.getList()) { for (PcworkRecordListResultDTO.StaffPatrol r : result.getList()) {
//秒变小时分钟
Integer minutes = r.getTotalTimeNum() / 60;
String patrolDuration = (minutes / 60 > 0 ? minutes / 60 + "小时" : "") + (minutes % 60 > 0 ? minutes % 60 + "分钟" : "0分钟");
r.setTotalTime(patrolDuration);
if (map.containsKey(r.getGridId())) { if (map.containsKey(r.getGridId())) {
r.setGridName(map.get(r.getGridId()).getGridName()); r.setGridName(map.get(r.getGridId()).getGridName());
continue; continue;
@ -512,12 +517,6 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
r.setGridName(resultGrid.getData().getGridName()); r.setGridName(resultGrid.getData().getGridName());
map.put(r.getGridId(), resultGrid.getData()); map.put(r.getGridId(), resultGrid.getData());
} }
//秒变小时分钟
Integer minutes = r.getTotalTimeNum() / 60;
String patrolDuration = (minutes / 60 > 0 ? minutes / 60 + "小时" : "") + (minutes % 60 > 0 ? minutes % 60 + "分钟" : "0分钟");
r.setTotalTime(patrolDuration);
} }
//3.封装数据并返回 //3.封装数据并返回
resultDTO.setTotal((int)result.getTotal()); resultDTO.setTotal((int)result.getTotal());

Loading…
Cancel
Save