Commit 8699530d authored by tianbo's avatar tianbo

app-警情处置对象

parent f8449fec
......@@ -46,5 +46,6 @@ public class OrgUsrzhDto {
private String companyPhoto;
@ApiModelProperty(value = "管理类别")
private String managementType;
@ApiModelProperty(value = "重点单位数量")
private Integer keySiteCount;
}
......@@ -254,6 +254,7 @@
a.biz_org_name bizOrgName,
a.build_name buildName,
a.build_id buildId,
c.keySiteCount,
( 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 'companyFemaleEmployees' THEN b.field_value ELSE "" END ) AS 'companyFemaleEmployees',
......@@ -266,6 +267,7 @@
FROM
cb_org_usr a
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
a.biz_org_name = #{bizOrgName}
</select>
......
......@@ -64,5 +64,15 @@ public enum AlertStageEnums {
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 {
Aircraft queryByaircraftModel(String seq);
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;
import com.alibaba.fastjson.JSONObject;
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.AlertCalledZhDto;
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.entity.AlertCalled;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;
import java.util.Map;
......@@ -55,4 +55,20 @@ public interface IAlertCalledService {
Integer AlertCalledcountTime(int type);
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 {
@GetMapping(value = "/getOrgUsrzhDto/{id}")
@ApiOperation(httpMethod = "GET", value = "根据灾情id处置对象单位详情", notes = "根据灾情id处置对象单位详情")
public ResponseModel<OrgusrDataxDto> getOrgUsrzhDto(@PathVariable Long id) {
AlertCalled AlertCalled=iAlertCalledService.getAlertCalledById(id);
String buildId=null;
OrgusrDataxDto orgusrDataxDto=new OrgusrDataxDto();
if(AlertCalled.getUnitInvolved()!=null&&!"".equals(AlertCalled.getUnitInvolved())) {
List<OrgUsrzhDto> orgUsrzhDto= iOrgUsrService.getOrgUsrzhDto( AlertCalled.getUnitInvolved());
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){
buildId=orgUsrzhDto.get(0).getBuildId()==null?null:orgUsrzhDto.get(0).getBuildId();
AlertCalled AlertCalled = iAlertCalledService.getAlertCalledById(id);
String buildId = null;
OrgusrDataxDto orgusrDataxDto = new OrgusrDataxDto();
if (AlertCalled.getUnitInvolved() != null && !"".equals(AlertCalled.getUnitInvolved())) {
List<OrgUsrzhDto> orgUsrzhDto = iOrgUsrService.getOrgUsrzhDto(AlertCalled.getUnitInvolved());
orgusrDataxDto.setOrgUsrzhDto(orgUsrzhDto != null && orgUsrzhDto.size() > 0 ? orgUsrzhDto.get(0) : null);
if (orgUsrzhDto != null && orgUsrzhDto.size() > 0 && orgUsrzhDto.get(0) != null) {
buildId = orgUsrzhDto.get(0).getBuildId();
}
}
}
//现场照片 待完成,
//平面图。待完成orgUsrzhDto.getBuildId()
if(buildId!=null) {
List<Map<String,Object>> list= equipFeignClient.findImgByFileCategory(buildId,"fourImg").getResult();
List<String> url=new ArrayList<>();
if(list!=null&&list.size()>0) {
list.stream().forEach(map->{
url.add(map.get("filePath").toString());
});
}
orgusrDataxDto.setPlanePicture(url);
if (buildId != null) {
List<Map<String, Object>> list = equipFeignClient.findImgByFileCategory(buildId, "fourImg").getResult();
List<String> url = new ArrayList<>();
if (list != null && list.size() > 0) {
list.stream().forEach(map -> {
url.add(map.get("filePath").toString());
});
}
orgusrDataxDto.setPlanePicture(url);
}
return ResponseHelper.buildResponse(orgusrDataxDto);
return ResponseHelper.buildResponse(orgusrDataxDto);
}
......@@ -999,7 +996,7 @@ public class CommandController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "PUT", value = "app-更新车辆状态", notes = "app-更新车辆状态")
@PutMapping(value = "/app/carStatus")
public ResponseModel<Boolean> updateCarStatus(CarStatusInfoDto carStatusInfoDto) {
public ResponseModel<Boolean> updateCarStatus(@RequestParam CarStatusInfoDto carStatusInfoDto) {
try {
equipFeignClient.updateCarStatus(Lists.newArrayList(carStatusInfoDto));
} catch (Exception e) {
......@@ -1008,4 +1005,27 @@ public class CommandController extends BaseController {
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 {
@GetMapping(value = "/getAircraftDetailsByAlertId/{id}")
@ApiOperation(httpMethod = "GET", value = "根据灾情id 查询最新的航班信息", notes = "根据灾情id 查询最新的航班信息")
public ResponseModel<Map<String, Object>> getAircraftDetailsByAlertId(@PathVariable Long 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);
return ResponseHelper.buildResponse(aircraftServiceImpl.queryAircraftInfo(id));
}
/**
......
......@@ -6,6 +6,9 @@ import java.util.List;
import java.util.Map;
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.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -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.feign.systemctl.Systemctl;
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
@Autowired
AircraftMapper aircraftMapper;
@Autowired
IotFeignClient iotFeignClient;
@Autowired
private AlertFormValueServiceImpl iAlertFormValueService;
/**
* <pre>
* 保存
......@@ -265,4 +276,34 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
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));
}
}
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