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 {
@TableField("frequency")
private int frequency;
@ApiModelProperty(value = "报警状态:1报警0恢复")
@ApiModelProperty(value = "报警状态:1报警0恢复 -> 1-报警 0-正常")
@TableField("status")
private int status;
......
......@@ -525,7 +525,7 @@ public class TopographyController extends AbstractBaseController {
alarm = list.get(0);
equipmentSpecific.setStatus(alarm.getStatus());
} else {
equipmentSpecific.setStatus(null);
equipmentSpecific.setStatus(0);
}
equipmentSpecific.setFullqrCode("01#" + equipmentSpecific.getQrCode());
String sysName = this.getSystemNameBySpeId(equipmentSpecific);
......
......@@ -808,20 +808,20 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
});
}
List<Map<String, Object>> collect = new ArrayList<>();
if (null != totalCarList && totalCarList.size() > 0) {
List<StatusDto> statusByIds1 = powerTransferCompanyResourcesMapper.findStatusByIds(carIdList);
Map<Long, String> statusMap = statusByIds1.stream().collect(Collectors.toMap(StatusDto::getCardId, StatusDto::getCarStatus));
collect = totalCarList.stream().map(item -> {
item.put("carState", statusMap.get(Long.valueOf((String) item.get("id"))));
return item;
}).collect(Collectors.toList());
}
//到场车辆信息
List<Map<String, Object>> arrivedCarList = collect.stream()
.filter(c -> FireCarStatusEnum.到场.getCode().equals(c.get("carState")))
.collect(Collectors.toList());
// List<Map<String, Object>> collect = new ArrayList<>();
// if (null != totalCarList && totalCarList.size() > 0) {
// List<StatusDto> statusByIds1 = powerTransferCompanyResourcesMapper.findStatusByIds(carIdList);
// Map<Long, String> statusMap = statusByIds1.stream().collect(Collectors.toMap(StatusDto::getCardId, StatusDto::getCarStatus));
// collect = totalCarList.stream().map(item -> {
// item.put("carState", statusMap.get(Long.valueOf((String) item.get("id"))));
// return item;
// }).collect(Collectors.toList());
// }
//
// //到场车辆信息
// List<Map<String, Object>> arrivedCarList = collect.stream()
// .filter(c -> FireCarStatusEnum.到场.getCode().equals(c.get("carState")))
// .collect(Collectors.toList());
JSONObject resourceStatistics = new JSONObject();
......@@ -834,7 +834,7 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
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
resourceStatistics.put("person", person);
}
public void fireAgentOnCarCount(List<Map<String, Object>> totalCarList, List<Long> arrivedCarIdList,
JSONObject resourceStatistics, String equipType, String jsonKey, List<Map<String, Object>> arrivedCarList) {
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);
public void fireAgentOnCarCount(List<Map<String, Object>> totalCarList, List<Long> arrivedCarList,
JSONObject resourceStatistics, String equipType, String jsonKey) {
//
// JSONObject jsonObject = new JSONObject();
// if(totalCarList!=null&&totalCarList.size()>0){
// double agentCountAll = totalCarList.stream().mapToDouble(
// 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)
// .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();
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(
// 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.put("total", agentCountAll);
jsonObject.put("count", agentCountAll);
}else{
jsonObject.put("total", 0);
jsonObject.put("count", 0);
}
//
// jsonObject.put("total", agentCountAll);
// jsonObject.put("count", agentCountAll);
// }else{
// jsonObject.put("total", 0);
// jsonObject.put("count", 0);
// }
//
// resourceStatistics.put(jsonKey, jsonObject);
resourceStatistics.put(jsonKey, jsonObject);
}
@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