Commit 0b979bf4 authored by chenzhao's avatar chenzhao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents 1d68e515 bc4e45b9
...@@ -65,7 +65,7 @@ public class EquipmentSpecificAlarm extends BaseEntity { ...@@ -65,7 +65,7 @@ public class EquipmentSpecificAlarm extends BaseEntity {
@TableField("frequency") @TableField("frequency")
private int frequency; private int frequency;
@ApiModelProperty(value = "报警状态:1报警0恢复") @ApiModelProperty(value = "报警状态:1报警0恢复 -> 1-报警 0-正常")
@TableField("status") @TableField("status")
private int status; private int status;
......
...@@ -525,7 +525,7 @@ public class TopographyController extends AbstractBaseController { ...@@ -525,7 +525,7 @@ public class TopographyController extends AbstractBaseController {
alarm = list.get(0); alarm = list.get(0);
equipmentSpecific.setStatus(alarm.getStatus()); equipmentSpecific.setStatus(alarm.getStatus());
} else { } else {
equipmentSpecific.setStatus(null); equipmentSpecific.setStatus(0);
} }
equipmentSpecific.setFullqrCode("01#" + equipmentSpecific.getQrCode()); equipmentSpecific.setFullqrCode("01#" + equipmentSpecific.getQrCode());
String sysName = this.getSystemNameBySpeId(equipmentSpecific); String sysName = this.getSystemNameBySpeId(equipmentSpecific);
......
...@@ -808,20 +808,20 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -808,20 +808,20 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
}); });
} }
List<Map<String, Object>> collect = new ArrayList<>(); // List<Map<String, Object>> collect = new ArrayList<>();
if (null != totalCarList && totalCarList.size() > 0) { // if (null != totalCarList && totalCarList.size() > 0) {
List<StatusDto> statusByIds1 = powerTransferCompanyResourcesMapper.findStatusByIds(carIdList); // List<StatusDto> statusByIds1 = powerTransferCompanyResourcesMapper.findStatusByIds(carIdList);
Map<Long, String> statusMap = statusByIds1.stream().collect(Collectors.toMap(StatusDto::getCardId, StatusDto::getCarStatus)); // Map<Long, String> statusMap = statusByIds1.stream().collect(Collectors.toMap(StatusDto::getCardId, StatusDto::getCarStatus));
collect = totalCarList.stream().map(item -> { // collect = totalCarList.stream().map(item -> {
item.put("carState", statusMap.get(Long.valueOf((String) item.get("id")))); // item.put("carState", statusMap.get(Long.valueOf((String) item.get("id"))));
return item; // return item;
}).collect(Collectors.toList()); // }).collect(Collectors.toList());
} // }
//
//到场车辆信息 // //到场车辆信息
List<Map<String, Object>> arrivedCarList = collect.stream() // List<Map<String, Object>> arrivedCarList = collect.stream()
.filter(c -> FireCarStatusEnum.到场.getCode().equals(c.get("carState"))) // .filter(c -> FireCarStatusEnum.到场.getCode().equals(c.get("carState")))
.collect(Collectors.toList()); // .collect(Collectors.toList());
JSONObject resourceStatistics = new JSONObject(); JSONObject resourceStatistics = new JSONObject();
...@@ -834,7 +834,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -834,7 +834,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
dutyPersonCount(carIdList, arrivedCarIdList, resourceStatistics); dutyPersonCount(carIdList, arrivedCarIdList, resourceStatistics);
// 车载器材统计 // 车载器材统计
fireAgentOnCarCount(totalCarList, arrivedCarIdList, resourceStatistics, "equipment", "equip", arrivedCarList); fireAgentOnCarCount(totalCarList, arrivedCarIdList, resourceStatistics, "equipment", "equip");
// 车载药剂统计 车载水量统计 // 车载药剂统计 车载水量统计
...@@ -927,54 +927,52 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -927,54 +927,52 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
resourceStatistics.put("person", person); resourceStatistics.put("person", person);
} }
public void fireAgentOnCarCount(List<Map<String, Object>> totalCarList, List<Long> arrivedCarIdList, public void fireAgentOnCarCount(List<Map<String, Object>> totalCarList, List<Long> arrivedCarList,
JSONObject resourceStatistics, String equipType, String jsonKey, List<Map<String, Object>> arrivedCarList) { JSONObject resourceStatistics, String equipType, String jsonKey) {
double agentCountArrived = 0;
double agentCountAll = 0;
if (null != totalCarList && totalCarList.size()>0) {
agentCountAll = totalCarList.stream().mapToDouble(
car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
.filter(res -> equipType.equals(res.get("equipType")))
.mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount")) ? "0" : c.get("equipCount").toString())).sum() : 0)
.sum();
if (null != arrivedCarList && arrivedCarList.size()>0) {
agentCountArrived = arrivedCarList.stream().mapToDouble(
car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
.filter(res -> equipType.equals(res.get("equipType")))
.mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount")) ? "0" : c.get("equipCount").toString())).sum() : 0)
.sum();
}
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("total", agentCountAll);
jsonObject.put("count", agentCountArrived);
resourceStatistics.put(jsonKey, jsonObject);
// //
// JSONObject jsonObject = new JSONObject(); // double agentCountArrived = 0;
// if(totalCarList!=null&&totalCarList.size()>0){ // double agentCountAll = 0;
// double agentCountAll = totalCarList.stream().mapToDouble( // if (null != totalCarList && totalCarList.size()>0) {
// agentCountAll = totalCarList.stream().mapToDouble(
// car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream() // car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
// .filter(res -> equipType.equals(res.get("equipType"))) // .filter(res -> equipType.equals(res.get("equipType")))
// .mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount") ) ? "0" : c.get("equipCount").toString())).sum() : 0) // .mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount")) ? "0" : c.get("equipCount").toString())).sum() : 0)
// .sum(); // .sum();
// if (null != arrivedCarList && arrivedCarList.size()>0) {
// agentCountArrived = arrivedCarList.stream().mapToDouble(
// car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
// .filter(res -> equipType.equals(res.get("equipType")))
// .mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount")) ? "0" : c.get("equipCount").toString())).sum() : 0)
// .sum();
// }
// }
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("total", agentCountAll);
// jsonObject.put("count", agentCountArrived);
// resourceStatistics.put(jsonKey, jsonObject);
JSONObject jsonObject = new JSONObject();
if(totalCarList!=null&&totalCarList.size()>0){
double agentCountAll = totalCarList.stream().mapToDouble(
car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
.filter(res -> equipType.equals(res.get("equipType")))
.mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount") ) ? "0" : c.get("equipCount").toString())).sum() : 0)
.sum();
// double agentCountArrived = arrivedCarList.stream().mapToDouble( // double agentCountArrived = arrivedCarList.stream().mapToDouble(
// car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream() // car -> car.get("resourceList") != null ? ((List<Map<String, Object>>) car.get("resourceList")).stream()
// .filter(res -> equipType.equals(res.get("equipType"))) // .filter(res -> equipType.equals(res.get("equipType")))
// .mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount") ) ? "0" : c.get("equipCount").toString())).sum() : 0) // .mapToDouble(c -> Double.parseDouble(ValidationUtil.isEmpty(c.get("equipCount") ) ? "0" : c.get("equipCount").toString())).sum() : 0)
// .sum(); // .sum();
jsonObject.put("total", agentCountAll);
jsonObject.put("count", agentCountAll);
}else{
jsonObject.put("total", 0);
jsonObject.put("count", 0);
}
// resourceStatistics.put(jsonKey, jsonObject);
// jsonObject.put("total", agentCountAll);
// jsonObject.put("count", agentCountAll);
// }else{
// jsonObject.put("total", 0);
// jsonObject.put("count", 0);
// }
//
// resourceStatistics.put(jsonKey, jsonObject);
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment