Commit 8699530d authored by tianbo's avatar tianbo

app-警情处置对象

parent f8449fec
...@@ -46,5 +46,6 @@ public class OrgUsrzhDto { ...@@ -46,5 +46,6 @@ public class OrgUsrzhDto {
private String companyPhoto; private String companyPhoto;
@ApiModelProperty(value = "管理类别") @ApiModelProperty(value = "管理类别")
private String managementType; private String managementType;
@ApiModelProperty(value = "重点单位数量")
private Integer keySiteCount;
} }
...@@ -254,6 +254,7 @@ ...@@ -254,6 +254,7 @@
a.biz_org_name bizOrgName, a.biz_org_name bizOrgName,
a.build_name buildName, a.build_name buildName,
a.build_id buildId, a.build_id buildId,
c.keySiteCount,
( SELECT v.biz_org_name FROM cb_org_usr v WHERE v.sequence_nbr = a.parent_id ) parentName, ( SELECT v.biz_org_name FROM cb_org_usr v WHERE v.sequence_nbr = a.parent_id ) parentName,
max( CASE b.field_code WHEN 'businessCategory' THEN b.field_value_label ELSE "" END ) AS 'businessCategory', max( CASE b.field_code WHEN 'businessCategory' THEN b.field_value_label ELSE "" END ) AS 'businessCategory',
max( CASE b.field_code WHEN 'companyFemaleEmployees' THEN b.field_value ELSE "" END ) AS 'companyFemaleEmployees', max( CASE b.field_code WHEN 'companyFemaleEmployees' THEN b.field_value ELSE "" END ) AS 'companyFemaleEmployees',
...@@ -266,6 +267,7 @@ ...@@ -266,6 +267,7 @@
FROM FROM
cb_org_usr a cb_org_usr a
LEFT JOIN cb_dynamic_form_instance b ON a.sequence_nbr = b.instance_id LEFT JOIN cb_dynamic_form_instance b ON a.sequence_nbr = b.instance_id
LEFT JOIN (select belong_id, count(*) keySiteCount from cb_key_site group by belong_id) c on c.belong_id = a.sequence_nbr
WHERE WHERE
a.biz_org_name = #{bizOrgName} a.biz_org_name = #{bizOrgName}
</select> </select>
......
...@@ -64,5 +64,15 @@ public enum AlertStageEnums { ...@@ -64,5 +64,15 @@ public enum AlertStageEnums {
this.value = value; this.value = value;
} }
public static AlertStageEnums getEnum(String code)
{
for (AlertStageEnums stage : AlertStageEnums.values())
{
if (stage.getCode().equals(code))
{
return stage;
}
}
return null;
}
} }
...@@ -19,5 +19,20 @@ public interface IAircraftService { ...@@ -19,5 +19,20 @@ public interface IAircraftService {
Aircraft queryByaircraftModel(String seq); Aircraft queryByaircraftModel(String seq);
List<AircraftListTreeDto> getAircraft(); List<AircraftListTreeDto> getAircraft();
/**
* 根据警情id查询航班信息
*
* @param alertId
* @return
*/
Map<String, Object> queryAircraftInfo(Long alertId);
/**
* 根据航空器型号查询航空器信息
*
* @param aircraftModel
* @return
*/
Aircraft queryAircraftInfoByModel(String aircraftModel);
} }
package com.yeejoin.amos.boot.module.jcs.api.service; package com.yeejoin.amos.boot.module.jcs.api.service;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData; import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledTodyDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledTodyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledZhDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel; import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -55,4 +55,20 @@ public interface IAlertCalledService { ...@@ -55,4 +55,20 @@ public interface IAlertCalledService {
Integer AlertCalledcountTime(int type); Integer AlertCalledcountTime(int type);
List<AlertCalledTodyDto> getTodayAlertCalled(); List<AlertCalledTodyDto> getTodayAlertCalled();
/**
* app-根据警情id获取处置对象
*
* @param alertId
* @return
*/
List<JSONObject> queryDisposalObjectList(String alertId);
/**
* app-根据警情id查询警情详情
*
* @param id
* @return
*/
Map<String, Object> queryAlertCalledById(Long id);
} }
...@@ -781,35 +781,32 @@ public class CommandController extends BaseController { ...@@ -781,35 +781,32 @@ public class CommandController extends BaseController {
@GetMapping(value = "/getOrgUsrzhDto/{id}") @GetMapping(value = "/getOrgUsrzhDto/{id}")
@ApiOperation(httpMethod = "GET", value = "根据灾情id处置对象单位详情", notes = "根据灾情id处置对象单位详情") @ApiOperation(httpMethod = "GET", value = "根据灾情id处置对象单位详情", notes = "根据灾情id处置对象单位详情")
public ResponseModel<OrgusrDataxDto> getOrgUsrzhDto(@PathVariable Long id) { public ResponseModel<OrgusrDataxDto> getOrgUsrzhDto(@PathVariable Long id) {
AlertCalled AlertCalled=iAlertCalledService.getAlertCalledById(id); AlertCalled AlertCalled = iAlertCalledService.getAlertCalledById(id);
String buildId=null; String buildId = null;
OrgusrDataxDto orgusrDataxDto=new OrgusrDataxDto(); OrgusrDataxDto orgusrDataxDto = new OrgusrDataxDto();
if(AlertCalled.getUnitInvolved()!=null&&!"".equals(AlertCalled.getUnitInvolved())) { if (AlertCalled.getUnitInvolved() != null && !"".equals(AlertCalled.getUnitInvolved())) {
List<OrgUsrzhDto> orgUsrzhDto= iOrgUsrService.getOrgUsrzhDto( AlertCalled.getUnitInvolved()); List<OrgUsrzhDto> orgUsrzhDto = iOrgUsrService.getOrgUsrzhDto(AlertCalled.getUnitInvolved());
orgusrDataxDto.setOrgUsrzhDto(orgUsrzhDto!=null&&orgUsrzhDto.size()>0?orgUsrzhDto.get(0):null); orgusrDataxDto.setOrgUsrzhDto(orgUsrzhDto != null && orgUsrzhDto.size() > 0 ? orgUsrzhDto.get(0) : null);
// buildId=orgUsrzhDto!=null&&orgUsrzhDto.size()>0?orgUsrzhDto.get(0).getBuildId():null; if (orgUsrzhDto != null && orgUsrzhDto.size() > 0 && orgUsrzhDto.get(0) != null) {
if(orgUsrzhDto!=null&&orgUsrzhDto.size()>0&&orgUsrzhDto.get(0)!=null){ buildId = orgUsrzhDto.get(0).getBuildId();
buildId=orgUsrzhDto.get(0).getBuildId()==null?null:orgUsrzhDto.get(0).getBuildId();
} }
} }
//现场照片 待完成, //现场照片 待完成,
//平面图。待完成orgUsrzhDto.getBuildId() //平面图。待完成orgUsrzhDto.getBuildId()
if(buildId!=null) { if (buildId != null) {
List<Map<String,Object>> list= equipFeignClient.findImgByFileCategory(buildId,"fourImg").getResult(); List<Map<String, Object>> list = equipFeignClient.findImgByFileCategory(buildId, "fourImg").getResult();
List<String> url=new ArrayList<>(); List<String> url = new ArrayList<>();
if(list!=null&&list.size()>0) { if (list != null && list.size() > 0) {
list.stream().forEach(map->{ list.stream().forEach(map -> {
url.add(map.get("filePath").toString()); url.add(map.get("filePath").toString());
}); });
} }
orgusrDataxDto.setPlanePicture(url); orgusrDataxDto.setPlanePicture(url);
} }
return ResponseHelper.buildResponse(orgusrDataxDto); return ResponseHelper.buildResponse(orgusrDataxDto);
} }
...@@ -999,7 +996,7 @@ public class CommandController extends BaseController { ...@@ -999,7 +996,7 @@ public class CommandController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "app-更新车辆状态", notes = "app-更新车辆状态") @ApiOperation(httpMethod = "PUT", value = "app-更新车辆状态", notes = "app-更新车辆状态")
@PutMapping(value = "/app/carStatus") @PutMapping(value = "/app/carStatus")
public ResponseModel<Boolean> updateCarStatus(CarStatusInfoDto carStatusInfoDto) { public ResponseModel<Boolean> updateCarStatus(@RequestParam CarStatusInfoDto carStatusInfoDto) {
try { try {
equipFeignClient.updateCarStatus(Lists.newArrayList(carStatusInfoDto)); equipFeignClient.updateCarStatus(Lists.newArrayList(carStatusInfoDto));
} catch (Exception e) { } catch (Exception e) {
...@@ -1008,4 +1005,27 @@ public class CommandController extends BaseController { ...@@ -1008,4 +1005,27 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(true); return ResponseHelper.buildResponse(true);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "app-警情详情-处置对象", notes = "app-警情详情-处置对象")
@GetMapping(value = "/app/disposalObject")
public ResponseModel<List<JSONObject>> queryDisposalObject(@RequestParam String alertId) {
List<JSONObject> resultList;
try {
resultList = iAlertCalledService.queryDisposalObjectList(alertId);
} catch (Exception e) {
throw new BaseException("获取处置对象异常", "", e.getMessage());
}
return ResponseHelper.buildResponse(resultList);
}
/**
* app-根据id查询警情详情
**/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "alertCalled/{id}")
@ApiOperation(httpMethod = "GET", value = "app-根据id查询灾情详情", notes = "app-根据id查询灾情详情")
public ResponseModel<Object> selectByAlertCalledId(@PathVariable Long id) {
return ResponseHelper.buildResponse(iAlertCalledService.queryAlertCalledById(id));
}
} }
\ No newline at end of file
...@@ -228,27 +228,7 @@ public class AircraftController extends BaseController { ...@@ -228,27 +228,7 @@ public class AircraftController extends BaseController {
@GetMapping(value = "/getAircraftDetailsByAlertId/{id}") @GetMapping(value = "/getAircraftDetailsByAlertId/{id}")
@ApiOperation(httpMethod = "GET", value = "根据灾情id 查询最新的航班信息", notes = "根据灾情id 查询最新的航班信息") @ApiOperation(httpMethod = "GET", value = "根据灾情id 查询最新的航班信息", notes = "根据灾情id 查询最新的航班信息")
public ResponseModel<Map<String, Object>> getAircraftDetailsByAlertId(@PathVariable Long id) { public ResponseModel<Map<String, Object>> getAircraftDetailsByAlertId(@PathVariable Long id) {
return ResponseHelper.buildResponse(aircraftServiceImpl.queryAircraftInfo(id));
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", id);
// 警情动态表单数据
List<KeyValueLabel> listdate = new ArrayList<>();
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
String num = null;
if (list != null && list.size() > 0) {
for (AlertFormValue alertFormValue : list) {
if ("flightNumber".equals(alertFormValue.getFieldCode())) {
num = alertFormValue.getFieldValue();
}
}
}
Map<String, Object> map = new HashedMap();
ResponseModel<Map<String, Object>> dataModel = iotFeignClient.findImgByDynamicFlightId(num);
if (dataModel != null) {
map = dataModel.getResult();
}
return ResponseHelper.buildResponse(map);
} }
/** /**
......
...@@ -6,6 +6,9 @@ import java.util.List; ...@@ -6,6 +6,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -31,6 +34,7 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IAircraftService; ...@@ -31,6 +34,7 @@ import com.yeejoin.amos.boot.module.jcs.api.service.IAircraftService;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.FileInfoModel; import com.yeejoin.amos.feign.systemctl.model.FileInfoModel;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
/** /**
...@@ -45,6 +49,13 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc ...@@ -45,6 +49,13 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
@Autowired @Autowired
AircraftMapper aircraftMapper; AircraftMapper aircraftMapper;
@Autowired
IotFeignClient iotFeignClient;
@Autowired
private AlertFormValueServiceImpl iAlertFormValueService;
/** /**
* <pre> * <pre>
* 保存 * 保存
...@@ -265,4 +276,34 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc ...@@ -265,4 +276,34 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
return aircraftMapper.getAircraft(); return aircraftMapper.getAircraft();
} }
@Override
public Map<String, Object> queryAircraftInfo(Long alertId) {
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("alert_called_id", alertId);
// 警情动态表单数据
List<KeyValueLabel> listdate = new ArrayList<>();
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
String num = null;
if (list != null && list.size() > 0) {
for (AlertFormValue alertFormValue : list) {
if ("flightNumber".equals(alertFormValue.getFieldCode())) {
num = alertFormValue.getFieldValue();
break;
}
}
}
Map<String, Object> map = new HashedMap();
ResponseModel<Map<String, Object>> dataModel = iotFeignClient.findImgByDynamicFlightId(num);
if (dataModel != null) {
map = dataModel.getResult();
}
return map;
}
@Override
public Aircraft queryAircraftInfoByModel(String aircraftModel) {
return this.baseMapper.selectOne(new LambdaQueryWrapper<Aircraft>().eq(Aircraft::getAircraftModel, aircraftModel));
}
} }
...@@ -14,12 +14,13 @@ import com.yeejoin.amos.boot.biz.common.constants.BizConstant; ...@@ -14,12 +14,13 @@ import com.yeejoin.amos.boot.biz.common.constants.BizConstant;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue; import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.dto.OrgUsrzhDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData; import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.boot.module.common.api.feign.JcsControlServerClient; import com.yeejoin.amos.boot.module.common.api.feign.JcsControlServerClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.WaterResourceServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCalledObjsDto;
...@@ -29,6 +30,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto; ...@@ -29,6 +30,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto; import com.yeejoin.amos.boot.module.jcs.api.dto.ControllerEquipDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel; import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertLocationLog; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertLocationLog;
...@@ -48,6 +50,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -48,6 +50,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -102,6 +105,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -102,6 +105,15 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
@Value("${redis.cache.failure.time}") @Value("${redis.cache.failure.time}")
private long time; private long time;
@Autowired
private OrgUsrServiceImpl iOrgUsrService;
@Autowired
AircraftServiceImpl aircraftService;
@Autowired
AlertFormValueServiceImpl alertFormValueService;
private static int comparingByGroupVal(Map<String, Object> map, Map<String, Object> map2, String key) { private static int comparingByGroupVal(Map<String, Object> map, Map<String, Object> map2, String key) {
int result = 0; int result = 0;
if (map.get(key) instanceof Date) { if (map.get(key) instanceof Date) {
...@@ -398,6 +410,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -398,6 +410,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
map.put("title", "【" + alertCalled.getAlertType() + "】" + alertCalled.getAddress()); map.put("title", "【" + alertCalled.getAlertType() + "】" + alertCalled.getAddress());
queryWrapper.eq("alert_called_id", id); queryWrapper.eq("alert_called_id", id);
// 警情动态表单数据 // 警情动态表单数据
List<KeyValueLabel> listdate = new ArrayList<>(); List<KeyValueLabel> listdate = new ArrayList<>();
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper); List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
...@@ -411,16 +424,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -411,16 +424,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
listdate.add(new KeyValueLabel("联系人", "contactUser", alertCalled.getContactUser())); listdate.add(new KeyValueLabel("联系人", "contactUser", alertCalled.getContactUser()));
listdate.add(new KeyValueLabel("联系电话", "contactPhone", alertCalled.getContactPhone())); listdate.add(new KeyValueLabel("联系电话", "contactPhone", alertCalled.getContactPhone()));
listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone())); listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
list.stream().forEach(AlertFormValue -> { list.stream().forEach(alertFormValue -> {
String valueCode = AlertFormValue.getFieldValueCode(); String valueCode = alertFormValue.getFieldValueCode();
if(null == valueCode) { if(null == valueCode) {
valueCode = AlertFormValue.getFieldValue(); valueCode = alertFormValue.getFieldValue();
} }
listdate.add(new KeyValueLabel(AlertFormValue.getFieldName(), AlertFormValue.getFieldCode(),valueCode)); listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), valueCode));
}); });
map.put("data", listdate); map.put("data", listdate);
return map;
return map;
} }
@Override @Override
...@@ -597,4 +610,144 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal ...@@ -597,4 +610,144 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
throw new RuntimeException("警情定位失败!"); throw new RuntimeException("警情定位失败!");
} }
} }
@Override
public Map<String, Object> queryAlertCalledById(Long id) {
// 警情基本信息
AlertCalled alertCalled = this.getById(id);
QueryWrapper<AlertFormValue> queryWrapper = new QueryWrapper<>();
Map<String, Object> map = new HashMap<String, Object>();
map.put("title", "【" + alertCalled.getAlertType() + "】" + alertCalled.getAddress());
queryWrapper.eq("alert_called_id", id);
// 警情动态表单数据
List<KeyValueLabel> listdate = new ArrayList<>();
List<AlertFormValue> list = iAlertFormValueService.list(queryWrapper);
listdate.add(new KeyValueLabel("接警时间", "callTime", alertCalled.getCallTime()));
listdate.add(new KeyValueLabel("警情地点", "address", alertCalled.getAddress()));
listdate.add(new KeyValueLabel("警情类型", "alertType", alertCalled.getAlertType()));
listdate.add(new KeyValueLabel("警情阶段", "alertStage", alertCalled.getAlertStage()));
listdate.add(new KeyValueLabel("警情等级", "responseLevel", "无"));
listdate.add(new KeyValueLabel("被困人数", "trappedNum", alertCalled.getTrappedNum()));
listdate.add(new KeyValueLabel("伤亡人数", "casualtiesNum", alertCalled.getCasualtiesNum()));
listdate.add(new KeyValueLabel("联系人", "contactUser", alertCalled.getContactUser()));
listdate.add(new KeyValueLabel("联系电话", "contactPhone", alertCalled.getContactPhone()));
listdate.add(new KeyValueLabel("联系人电话", "contactPhone", alertCalled.getContactPhone()));
list.stream().forEach(alertFormValue -> {
String valueCode = alertFormValue.getFieldValueCode();
if (null == valueCode) {
valueCode = alertFormValue.getFieldValue();
}
listdate.add(new KeyValueLabel(alertFormValue.getFieldName(), alertFormValue.getFieldCode(), valueCode));
if ("fireTime".equals(alertFormValue.getFieldCode())) {
map.put("occurrenceTime", alertFormValue.getFieldValue());
}
});
map.put("data", listdate);
// app警情首页使用alarmDetailInfo,alarmContactInfo
if (!AlertStageEnums.YBHZ.getCode().equals(alertCalled.getAlertTypeCode())) {
map.put("occurrenceTime", alertCalled.getCallTime());
}
map.put("alertType", alertCalled.getAlertType());
map.put("address", alertCalled.getAddress());
map.put("contactUser", alertCalled.getContactUser());
map.put("contactPhone", alertCalled.getContactPhone());
map.put("callTime", alertCalled.getCallTime());
return map;
}
@Override
public List<JSONObject> queryDisposalObjectList(String alertId) {
AlertCalled alertCalled = this.getById(Long.valueOf(alertId));
String alertTypeCode = alertCalled.getAlertTypeCode();
AlertStageEnums alertStage = AlertStageEnums.getEnum(alertTypeCode);
List<JSONObject> resultList = Lists.newArrayList();
if (alertStage != null) {
switch (alertStage) {
case YBHZ:
case TFSJ:
case QTJQ:
resultList = queryDisposalObjectUnit(alertCalled);
break;
case HKJY:
case LYXC:
case ZJBZ:
resultList = queryDisposalObjectAircraft(alertCalled);
default:
break;
}
}
return resultList;
}
private List<JSONObject> queryDisposalObjectUnit(AlertCalled alertCalled) {
List<JSONObject> resultList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(alertCalled.getUnitInvolved())) {
List<OrgUsrzhDto> unitInvolvedDto = iOrgUsrService.getOrgUsrzhDto(alertCalled.getUnitInvolved());
JSONObject a1 = new JSONObject();
a1.put("name", "单位名称");
a1.put("value", ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getBizOrgName() : "");
JSONObject a2 = new JSONObject();
a2.put("name", "单位性质");
a2.put("value", ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getCompanyNature() :
"");
JSONObject a3 = new JSONObject();
a3.put("name", "单位电话");
a3.put("value", ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getCompanyPhone() :
"");
JSONObject a4 = new JSONObject();
a4.put("name", "单位地址");
a4.put("value", ValidationUtil.isEmpty(unitInvolvedDto.get(0)) ? unitInvolvedDto.get(0).getCompanyLocation() :
"");
JSONObject a5 = new JSONObject();
a5.put("name", "重点部位数量");
a5.put("value", ValidationUtil.isEmpty(unitInvolvedDto.get(0).getKeySiteCount()) ? 0 : unitInvolvedDto.get(0).getKeySiteCount() + "个");
resultList.add(a1);
resultList.add(a2);
resultList.add(a3);
resultList.add(a4);
resultList.add(a5);
}
return resultList;
}
private List<JSONObject> queryDisposalObjectAircraft(AlertCalled alertCalled) {
// 警情动态表单数据
List<AlertFormValue> list = alertFormValueService.getzqlist(alertCalled.getSequenceNbr());
Aircraft aircraft = new Aircraft();
for (AlertFormValue alertFormValue : list) {
if ("aircraftModel".equals(alertFormValue.getFieldCode())) {
String aircraftModel = alertFormValue.getFieldValue();
aircraft = aircraftService.queryAircraftInfoByModel(aircraftModel);
break;
}
}
List<JSONObject> resultList = Lists.newArrayList();
if (!ValidationUtil.isEmpty(aircraft)) {
JSONObject a1 = new JSONObject();
a1.put("name", "飞机型号");
a1.put("value", aircraft.getAircraftModel());
JSONObject a2 = new JSONObject();
a2.put("name", "发动机类型");
a2.put("value", aircraft.getEngineType());
JSONObject a3 = new JSONObject();
a3.put("name", "发动机数量");
a3.put("value", aircraft.getEnginesmNum());
JSONObject a4 = new JSONObject();
a4.put("name", "燃油类型");
a4.put("value", aircraft.getFuelType());
JSONObject a5 = new JSONObject();
a5.put("name", "主要燃烧物质");
a5.put("value", aircraft.getCombustionMaterial());
resultList.add(a1);
resultList.add(a2);
resultList.add(a3);
resultList.add(a4);
resultList.add(a5);
}
return resultList;
}
} }
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