Commit c1b34cfb authored by kongfm's avatar kongfm

Merge remote-tracking branch 'origin/developer' into developer

parents 52869a15 d21c49d5
...@@ -74,6 +74,9 @@ public class FireEquipmentSignalLogDto extends BaseDto { ...@@ -74,6 +74,9 @@ public class FireEquipmentSignalLogDto extends BaseDto {
@ApiModelProperty(value = "装备所属消防系统code(冗余字段)") @ApiModelProperty(value = "装备所属消防系统code(冗余字段)")
private String systemMrids; private String systemMrids;
@ApiModelProperty(value = "装备所属消防系统名称(冗余字段)")
private String systemNames;
@ApiModelProperty(value = "装备定义code(冗余字段)") @ApiModelProperty(value = "装备定义code(冗余字段)")
private String equipmentDefinitionMrid; private String equipmentDefinitionMrid;
...@@ -100,4 +103,16 @@ public class FireEquipmentSignalLogDto extends BaseDto { ...@@ -100,4 +103,16 @@ public class FireEquipmentSignalLogDto extends BaseDto {
@ApiModelProperty(value = "是否为告警信号数据") @ApiModelProperty(value = "是否为告警信号数据")
private Boolean isAlarm; private Boolean isAlarm;
@ApiModelProperty(value = "保护对象code")
private String protectedObjectMrid;
@ApiModelProperty(value = "保护对象名称")
private String protectedObjectName;
@ApiModelProperty(value = "换流站负责人")
private String stationChargePerson;
@ApiModelProperty(value = "负责人联系电话")
private String chargePersonPhone;
} }
...@@ -130,6 +130,11 @@ public class FireEquipmentSignalLog extends BaseEntity { ...@@ -130,6 +130,11 @@ public class FireEquipmentSignalLog extends BaseEntity {
private String systemMrids; private String systemMrids;
/** /**
* 装备所属消防系统名称(冗余字段)
*/
private String systemNames;
/**
* 装备定义code(冗余字段) * 装备定义code(冗余字段)
*/ */
@TableField("equipment_definition_mrid") @TableField("equipment_definition_mrid")
...@@ -169,4 +174,14 @@ public class FireEquipmentSignalLog extends BaseEntity { ...@@ -169,4 +174,14 @@ public class FireEquipmentSignalLog extends BaseEntity {
*/ */
private Boolean isAlarm; private Boolean isAlarm;
/**
*保护对象code
*/
private String protectedObjectMrid;
/**
*保护对象名称
*/
private String protectedObjectName;
} }
...@@ -25,7 +25,12 @@ ...@@ -25,7 +25,12 @@
</choose> </choose>
a.station_code, a.station_code,
a.lat as sourceLat, a.lat as sourceLat,
a.lng as sourceLng a.lng as sourceLng,
a.protected_object_mrid,
a.protected_object_name,
a.system_names,
s.station_charge_person,
s.charge_person_phone
from from
asf_fire_equipment_signal_log a, asf_fire_equipment_signal_log a,
asf_fire_station_info s asf_fire_station_info s
......
...@@ -58,4 +58,12 @@ public class FireBuildingController extends BaseController { ...@@ -58,4 +58,12 @@ public class FireBuildingController extends BaseController {
@ApiParam(value = "换流站code") @PathVariable String stationCode) { @ApiParam(value = "换流站code") @PathVariable String stationCode) {
return ResponseHelper.buildResponse(fireBuildingServiceImpl.buildingTree(stationCode)); return ResponseHelper.buildResponse(fireBuildingServiceImpl.buildingTree(stationCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "stationBuildingTree")
@ApiOperation(httpMethod = "GET", value = "换流站建筑树", notes = "换流站建筑树")
public ResponseModel stationBuildingTree (@ApiParam(value = "换流站code")
@RequestParam(value = "stationCode", required = false) String stationCode) {
return ResponseHelper.buildResponse(fireBuildingServiceImpl.stationBuildingTree(stationCode));
}
} }
...@@ -51,6 +51,7 @@ public class FireVideoController extends BaseController { ...@@ -51,6 +51,7 @@ public class FireVideoController extends BaseController {
@ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current, @ApiParam(value = "当前页", required = true) @RequestParam(value = "current") int current,
@ApiParam(value = "页大小", required = true) @RequestParam(value = "size") int size, @ApiParam(value = "页大小", required = true) @RequestParam(value = "size") int size,
@ApiParam(value = "换流站code", required = true) @PathVariable String stationCode, @ApiParam(value = "换流站code", required = true) @PathVariable String stationCode,
@ApiParam(value = "摄像头编码") @RequestParam(value = "videoMrid", required = false) String videoMrid,
@ApiParam(value = "所在建筑,多个用逗号分隔") @RequestParam(value = "buildingMrids", required = false) String buildingMrids) { @ApiParam(value = "所在建筑,多个用逗号分隔") @RequestParam(value = "buildingMrids", required = false) String buildingMrids) {
List<String> buildingMridList = new ArrayList<>(); List<String> buildingMridList = new ArrayList<>();
//根节点id(全部建筑时使用,本来可以不送来实现过滤,但是地图前端不支持) //根节点id(全部建筑时使用,本来可以不送来实现过滤,但是地图前端不支持)
...@@ -61,7 +62,8 @@ public class FireVideoController extends BaseController { ...@@ -61,7 +62,8 @@ public class FireVideoController extends BaseController {
Page<FireVideoDto> page = new Page<>(); Page<FireVideoDto> page = new Page<>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(fireVideoServiceImpl.queryForFireVideoPage(page, name, stationCode, buildingMridList)); String code = ("-1").equals(stationCode) ? "" : stationCode;
return ResponseHelper.buildResponse(fireVideoServiceImpl.queryForFireVideoPage(page, name, code, buildingMridList, videoMrid));
} }
} }
...@@ -15,6 +15,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -15,6 +15,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -48,6 +49,30 @@ public class FireBuildingServiceImpl extends BaseService<FireBuildingDto, FireBu ...@@ -48,6 +49,30 @@ public class FireBuildingServiceImpl extends BaseService<FireBuildingDto, FireBu
} }
private List<FireBuildingDto> getChildren(String mrid, List<FireBuildingDto> dtoList) { private List<FireBuildingDto> getChildren(String mrid, List<FireBuildingDto> dtoList) {
return dtoList.stream().filter(d -> StringUtils.isNotBlank(d.getParentMrid()) && d.getParentMrid().equals(mrid)).peek(s -> s.setChildren(this.getChildren(s.getMrid(), dtoList))).sorted(Comparator.comparing(BaseDto::getCreateDate)).collect(Collectors.toList()); return dtoList.stream().filter(d -> StringUtils.isNotBlank(d.getParentMrid()) && d.getParentMrid().equals(mrid)).
peek(s -> s.setChildren(this.getChildren(s.getMrid(), dtoList))).
sorted(Comparator.comparing(BaseDto::getCreateDate)).collect(Collectors.toList());
}
public List<FireBuildingDto> stationBuildingTree(String stationCode) {
List<FireBuildingDto> dtoList = this.queryForList("create_date", true, stationCode);
// 根据换流站code分组list
Map<String, List<FireBuildingDto>> stationMap = dtoList.stream().collect(Collectors.groupingBy(f -> f.getStationName()+"_"+f.getStationCode()));
return stationMap.keySet().stream().map(key -> {
FireBuildingDto parentNode = new FireBuildingDto();
String[] temp = key.split("_");
String name = temp[0];
String code = temp[1];
parentNode.setStationCode(code);
parentNode.setStationName(name);
parentNode.setId(code);
parentNode.setType("station");
parentNode.setName(name);
List<FireBuildingDto> childrenNode = stationMap.get(key).stream().filter(d -> StringUtils.isBlank(d.getParentMrid()) || "0".equals(d.getParentMrid()) || "-1".equals(d.getParentMrid())).
peek(s -> s.setChildren(this.getChildren(s.getMrid(), dtoList))).
sorted(Comparator.comparing(BaseDto::getCreateDate)).collect(Collectors.toList());
parentNode.setChildren(childrenNode);
return parentNode;
}).collect(Collectors.toList());
} }
} }
\ No newline at end of file
...@@ -23,8 +23,9 @@ public class FireVideoServiceImpl extends BaseService<FireVideoDto, FireVideo, F ...@@ -23,8 +23,9 @@ public class FireVideoServiceImpl extends BaseService<FireVideoDto, FireVideo, F
/** /**
* 分页查询 * 分页查询
*/ */
public Page<FireVideoDto> queryForFireVideoPage(Page<FireVideoDto> page, @Condition(Operator.like) String name, String stationCode, @Condition(Operator.in) List<String> buildingMrid) { public Page<FireVideoDto> queryForFireVideoPage(Page<FireVideoDto> page, @Condition(Operator.like) String name, String stationCode, @Condition(Operator.in) List<String> buildingMrid,
return this.queryForPage(page, "create_date", false, name, stationCode, buildingMrid); @Condition(Operator.like) String mrid) {
return this.queryForPage(page, "create_date", false, name, stationCode, buildingMrid, mrid);
} }
} }
\ No newline at end of file
...@@ -197,12 +197,13 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -197,12 +197,13 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
//提交隐患 //提交隐患
// jsonObject = remoteWorkFlowService.excute(instance.getString("id"), null); // jsonObject = remoteWorkFlowService.excute(instance.getString("id"), null);
// JSONObject task = jsonObject.getJSONObject("data"); // JSONObject task = jsonObject.getJSONObject("data");
latentDangerBo.setInstanceId(instance.getString("id")); latentDangerBo.setInstanceId(instance.getString("id") == null ? " ":instance.getString("id"));
JSONObject flowJson = new JSONObject(); JSONObject flowJson = new JSONObject();
flowJson.put("photoUrls", latentDangerParam.getPhotoUrls()); flowJson.put("photoUrls", latentDangerParam.getPhotoUrls());
LatentDangerFlowRecordBo record = saveFlowRecord(instance.getString("id"), "提交隐患", userId, departmentId, flowJson, dangerId, role, LatentDangerExcuteTypeEnum.填写隐患完成.getName(), latentDangerParam.getRemark()); LatentDangerFlowRecordBo record = saveFlowRecord(instance.getString("id"), "提交隐患", userId, departmentId, flowJson, dangerId, role, LatentDangerExcuteTypeEnum.填写隐患完成.getName(), latentDangerParam.getRemark());
latentDangerBo.setCurrentFlowRecordId(record.getId()); latentDangerBo.setCurrentFlowRecordId(record.getId());
latentDangerMapper.update(latentDangerBo); latentDangerMapper.update(latentDangerBo);
sendMessage(latentDangerBo, LatentDangerExcuteTypeEnum.填写隐患完成, null, sendMessage(latentDangerBo, LatentDangerExcuteTypeEnum.填写隐患完成, null,
"隐患排查与治理", this.getNextExecuteUsers(latentDangerBo.getInstanceId()), userRealName, departmentName); "隐患排查与治理", this.getNextExecuteUsers(latentDangerBo.getInstanceId()), userRealName, departmentName);
try { try {
...@@ -374,17 +375,17 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -374,17 +375,17 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
Integer level, String position, LatentDangerTypeEnum dangerTypeEnum, Integer level, String position, LatentDangerTypeEnum dangerTypeEnum,
String photoUrls, Long checkInputId, Long structureId, String structureName, String instanceKey) { String photoUrls, Long checkInputId, Long structureId, String structureName, String instanceKey) {
LatentDangerBo latentDangerBo = new LatentDangerBo(); LatentDangerBo latentDangerBo = new LatentDangerBo();
latentDangerBo.setInstanceId(instanceId); latentDangerBo.setInstanceId(instanceId == null ? " ":instanceId);
latentDangerBo.setProblemDescription(problemDescription); latentDangerBo.setProblemDescription(problemDescription == null ? " ":problemDescription);
latentDangerBo.setRemark(remark); latentDangerBo.setRemark(remark == null ? " ":remark);
latentDangerBo.setDangerState(LatentDangerStateEnum.待评审.getCode()); latentDangerBo.setDangerState(LatentDangerStateEnum.待评审.getCode());
latentDangerBo.setDiscovererUserId(userId); latentDangerBo.setDiscovererUserId(userId == null ? " ": remark);
latentDangerBo.setDiscovererDepartmentId(departmentId); latentDangerBo.setDiscovererDepartmentId(departmentId == null ? " ": departmentId);
latentDangerBo.setBusinessKey(businessKey); latentDangerBo.setBusinessKey(businessKey == null ? " ":businessKey);
latentDangerBo.setOrgCode(orgCode); latentDangerBo.setOrgCode(orgCode == null ? " ":orgCode);
latentDangerBo.setDangerName(dangerName); latentDangerBo.setDangerName(dangerName == null ? " ":dangerName);
latentDangerBo.setDangerLevel(level); latentDangerBo.setDangerLevel(level);
latentDangerBo.setDangerPosition(position); latentDangerBo.setDangerPosition(position == null ? " ":position);
latentDangerBo.setDangerType(dangerTypeEnum.getCode()); latentDangerBo.setDangerType(dangerTypeEnum.getCode());
StringBuilder photoUrlsB = new StringBuilder(); StringBuilder photoUrlsB = new StringBuilder();
if (org.apache.commons.lang3.StringUtils.isNotBlank(photoUrls)) { if (org.apache.commons.lang3.StringUtils.isNotBlank(photoUrls)) {
...@@ -396,11 +397,11 @@ public class LatentDangerServiceImpl implements ILatentDangerService { ...@@ -396,11 +397,11 @@ public class LatentDangerServiceImpl implements ILatentDangerService {
} }
} }
} }
latentDangerBo.setPhotoUrls(photoUrlsB.toString()); latentDangerBo.setPhotoUrls(photoUrlsB.toString() == null ? " ":photoUrlsB.toString());
latentDangerBo.setCheckInputId(checkInputId); latentDangerBo.setCheckInputId(checkInputId);
latentDangerBo.setStructureId(structureId); latentDangerBo.setStructureId(structureId);
latentDangerBo.setStructureName(structureName); latentDangerBo.setStructureName(structureName == null ? " ":structureName);
latentDangerBo.setInstanceKey(instanceKey); latentDangerBo.setInstanceKey(instanceKey == null ? " ":instanceKey);
latentDangerMapper.save(latentDangerBo); latentDangerMapper.save(latentDangerBo);
return latentDangerBo; return latentDangerBo;
} }
......
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