|
|
@ -272,8 +272,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { |
|
|
|
|
|
|
|
//3.封装数据并返回
|
|
|
|
resultList.forEach(re -> list.stream().filter(l -> re.getGridId().equals(l.getId())).forEach(s -> re.setGridName(s.getGridName()))); |
|
|
|
NumberFormat numberFormat = NumberFormat.getInstance(); |
|
|
|
numberFormat.setMaximumFractionDigits(NumConstant.ONE); |
|
|
|
//NumberFormat numberFormat = NumberFormat.getInstance();
|
|
|
|
//numberFormat.setMaximumFractionDigits(NumConstant.ZERO);
|
|
|
|
resultList.forEach(re -> { |
|
|
|
/*String totalTime = "0分钟"; |
|
|
|
if (re.getTimeNum() > NumConstant.ZERO) { |
|
|
@ -282,11 +282,43 @@ public class EpmetUserServiceImpl implements EpmetUserService { |
|
|
|
totalTime = (hour < 1 ? "" : hour + "小时") + (minute < 1 ? "" : minute + "分钟"); |
|
|
|
} |
|
|
|
re.setTotalTime(totalTime == "" ? "0分钟" : totalTime);*/ |
|
|
|
re.setTotalTime(re.getTimeNum() < 1 ? BigDecimal.ZERO + "h" : new BigDecimal(numberFormat.format((float) re.getTimeNum() / (float) 3600)) + "h"); |
|
|
|
//re.setTotalTime(re.getTimeNum() < 1 ? BigDecimal.ZERO + "h" : new BigDecimal(numberFormat.format((float) re.getTimeNum() / (float) 3600)) + "h");
|
|
|
|
re.setTotalTime(re.getTimeNum() / 60 + "分钟"); |
|
|
|
list.stream().filter(l -> re.getGridId().equals(l.getId())).forEach(s -> re.setGridName(s.getGridName())); |
|
|
|
}); |
|
|
|
|
|
|
|
return resultList; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 个人中心-网格员巡查记录 |
|
|
|
* @author sun |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<PersonalPatrolListResultDTO> personalPatrolList(String staffId) { |
|
|
|
LinkedList<PersonalPatrolListResultDTO> resultList = new LinkedList<>(); |
|
|
|
//1.汇总查询当前工作人员所有巡查记录数据
|
|
|
|
StaffListResultDTO resultDTO = staffPatrolRecordDao.selectPersonalPatrolList(staffId); |
|
|
|
if (null == resultDTO) { |
|
|
|
return resultList; |
|
|
|
} |
|
|
|
//2.封装数据并返回
|
|
|
|
NumberFormat numberFormat = NumberFormat.getInstance(); |
|
|
|
numberFormat.setMaximumFractionDigits(NumConstant.ZERO); |
|
|
|
PersonalPatrolListResultDTO personal1 = new PersonalPatrolListResultDTO(); |
|
|
|
personal1.setKey("总次数"); |
|
|
|
personal1.setValue(resultDTO.getPatrolTotal().toString()); |
|
|
|
resultList.add(personal1); |
|
|
|
PersonalPatrolListResultDTO personal2 = new PersonalPatrolListResultDTO(); |
|
|
|
personal2.setKey("总时长"); |
|
|
|
personal2.setValue(resultDTO.getTimeNum() / 60 + "分钟"); |
|
|
|
resultList.add(personal2); |
|
|
|
PersonalPatrolListResultDTO personal3 = new PersonalPatrolListResultDTO(); |
|
|
|
personal3.setKey("事件数"); |
|
|
|
personal3.setValue(resultDTO.getReportProjectCount().toString()); |
|
|
|
resultList.add(personal3); |
|
|
|
|
|
|
|
return resultList; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|