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));
}
} }
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