Commit 5624d9c9 authored by tangwei's avatar tangwei

修改bug

parent 14af413e
package com.yeejoin.amos.boot.module.command.api.dto;
public class videoDataDto {
private String code;
private String msg;
private String data;
}
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.api.service; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
/** /**
* 航空器信息接口类 * 航空器信息接口类
...@@ -11,4 +12,5 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto; ...@@ -11,4 +12,5 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
*/ */
public interface IAircraftService { public interface IAircraftService {
AircraftDto queryByAircraftSeq(String agencyCode, Long seq); AircraftDto queryByAircraftSeq(String agencyCode, Long seq);
Aircraft queryByaircraftModel(String seq);
} }
package com.yeejoin.amos.boot.module.command.biz.controller; package com.yeejoin.amos.boot.module.command.biz.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -25,7 +26,14 @@ import io.swagger.annotations.ApiParam; ...@@ -25,7 +26,14 @@ import io.swagger.annotations.ApiParam;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.DateUtil; import org.typroject.tyboot.core.foundation.utils.DateUtil;
...@@ -39,6 +47,8 @@ import javax.servlet.http.HttpServletResponse; ...@@ -39,6 +47,8 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -101,7 +111,11 @@ public class CommandController extends BaseController { ...@@ -101,7 +111,11 @@ public class CommandController extends BaseController {
@Autowired @Autowired
IPowerTransferCompanyService powerTransferCompanyService; IPowerTransferCompanyService powerTransferCompanyService;
@Value("${video.url}")
private String videoUrl;
@Autowired @Autowired
IDutyPersonService iDutyPersonService; IDutyPersonService iDutyPersonService;
/** /**
...@@ -502,7 +516,7 @@ public class CommandController extends BaseController { ...@@ -502,7 +516,7 @@ public class CommandController extends BaseController {
* *
* **/ * **/
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "statistics/{id}") @GetMapping(value = "statistics/{id}")
@ApiOperation(httpMethod = "GET", value = "火灾现场统计", notes = "火灾现场统计") @ApiOperation(httpMethod = "GET", value = "火灾现场统计", notes = "火灾现场统计")
public ResponseModel<Object> getStatistics(@PathVariable Long id) { public ResponseModel<Object> getStatistics(@PathVariable Long id) {
...@@ -519,7 +533,7 @@ public class CommandController extends BaseController { ...@@ -519,7 +533,7 @@ public class CommandController extends BaseController {
* </PRE> * </PRE>
* 到场力量统计 * 到场力量统计
*/ */
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "getpower/{id}") @GetMapping(value = "getpower/{id}")
@ApiOperation(httpMethod = "GET", value = "到场力量统计", notes = "到场力量统计") @ApiOperation(httpMethod = "GET", value = "到场力量统计", notes = "到场力量统计")
public ResponseModel<Object> getpower(@PathVariable Long id) { public ResponseModel<Object> getpower(@PathVariable Long id) {
...@@ -535,7 +549,7 @@ public class CommandController extends BaseController { ...@@ -535,7 +549,7 @@ public class CommandController extends BaseController {
* </PRE> * </PRE>
* 到场力量统计列表 * 到场力量统计列表
*/ */
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "getPowerDataList/{id}") @GetMapping(value = "getPowerDataList/{id}")
@ApiOperation(httpMethod = "GET", value = "到场力量统计列表", notes = "到场力量统计列表") @ApiOperation(httpMethod = "GET", value = "到场力量统计列表", notes = "到场力量统计列表")
public ResponseModel<Object> getPowerDataList(@PathVariable Long id) { public ResponseModel<Object> getPowerDataList(@PathVariable Long id) {
...@@ -547,7 +561,7 @@ public class CommandController extends BaseController { ...@@ -547,7 +561,7 @@ public class CommandController extends BaseController {
* 力量统计当前灾情阶段 * 力量统计当前灾情阶段
* *
* */ * */
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "getstate/{id}") @GetMapping(value = "getstate/{id}")
@ApiOperation(httpMethod = "GET", value = "获取灾情当前阶段", notes = "获取灾情当前阶段") @ApiOperation(httpMethod = "GET", value = "获取灾情当前阶段", notes = "获取灾情当前阶段")
public ResponseModel<Object> getstate(@PathVariable Long id) { public ResponseModel<Object> getstate(@PathVariable Long id) {
...@@ -576,7 +590,7 @@ public class CommandController extends BaseController { ...@@ -576,7 +590,7 @@ public class CommandController extends BaseController {
* </PRE> * </PRE>
* 到场力量 列表统计 * 到场力量 列表统计
*/ */
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "getPowerCompanyCountDtocount/{id}") @GetMapping(value = "getPowerCompanyCountDtocount/{id}")
@ApiOperation(httpMethod = "GET", value = "到场力量 列表统计", notes = "到场力量 列表统计") @ApiOperation(httpMethod = "GET", value = "到场力量 列表统计", notes = "到场力量 列表统计")
public ResponseModel<Object> getPowerCompanyCountDtocount(@PathVariable Long id) { public ResponseModel<Object> getPowerCompanyCountDtocount(@PathVariable Long id) {
...@@ -591,7 +605,7 @@ public class CommandController extends BaseController { ...@@ -591,7 +605,7 @@ public class CommandController extends BaseController {
* *
* @return * @return
*/ */
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/lookHtmlText", produces = "application/json;charset=UTF-8") @GetMapping(value = "/lookHtmlText", produces = "application/json;charset=UTF-8")
@ApiOperation(value = "查看文件内容", notes = "查看文件内容") @ApiOperation(value = "查看文件内容", notes = "查看文件内容")
public ResponseModel<Object> lookHtmlText( HttpServletResponse response,@RequestParam(value = "fileUrl")String fileUrl ,@RequestParam(value = "product")String product,@RequestParam(value = "appKey")String appKey,@RequestParam(value = "token")String token /* @PathVariable String fileName */) public ResponseModel<Object> lookHtmlText( HttpServletResponse response,@RequestParam(value = "fileUrl")String fileUrl ,@RequestParam(value = "product")String product,@RequestParam(value = "appKey")String appKey,@RequestParam(value = "token")String token /* @PathVariable String fileName */)
...@@ -653,7 +667,8 @@ public class CommandController extends BaseController { ...@@ -653,7 +667,8 @@ public class CommandController extends BaseController {
if("aircraftModel".equals(alertFormValue.getFieldCode())) { if("aircraftModel".equals(alertFormValue.getFieldCode())) {
String aircraftModel=alertFormValue.getFieldValueCode(); String aircraftModel=alertFormValue.getFieldValueCode();
if(aircraftModel!=null&&!"".equals(aircraftModel)) { if(aircraftModel!=null&&!"".equals(aircraftModel)) {
AircraftDto aircraftDto=aircraftService.queryByAircraftSeq(RequestContext.getAgencyCode(),Long.valueOf(aircraftModel));
AircraftDto aircraftDto=aircraftService.queryByAircraftSeq(RequestContext.getAgencyCode(),aircraftService.queryByaircraftModel(aircraftModel).getSequenceNbr());
//现场照片 待完成, //现场照片 待完成,
return ResponseHelper.buildResponse(aircraftDto); return ResponseHelper.buildResponse(aircraftDto);
...@@ -664,7 +679,7 @@ public class CommandController extends BaseController { ...@@ -664,7 +679,7 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getOrgUsrzhDto/{id}") @GetMapping(value = "/getOrgUsrzhDto/{id}")
@ApiOperation(httpMethod = "GET", value = "处置对象单位详情", notes = "处置对象单位详情") @ApiOperation(httpMethod = "GET", value = "处置对象单位详情", notes = "处置对象单位详情")
public ResponseModel<OrgusrDataxDto> getOrgUsrzhDto(@PathVariable Long id) { public ResponseModel<OrgusrDataxDto> getOrgUsrzhDto(@PathVariable Long id) {
...@@ -675,10 +690,8 @@ public class CommandController extends BaseController { ...@@ -675,10 +690,8 @@ public class CommandController extends BaseController {
//现场照片 待完成, //现场照片 待完成,
//平面图。待完成orgUsrzhDto.getBuildId() //平面图。待完成orgUsrzhDto.getBuildId()
if(orgUsrzhDto.getBuildId()!=null) { if(orgUsrzhDto!=null&&orgUsrzhDto.getBuildId()!=null) {
List<Map<String,Object>> list= equipFeignClient.findImgByFileCategory(orgUsrzhDto.getBuildId(),"fourImg").getResult(); List<Map<String,Object>> list= equipFeignClient.findImgByFileCategory(orgUsrzhDto.getBuildId(),"fourImg").getResult();
List<String> url=new ArrayList<>(); List<String> url=new ArrayList<>();
if(list!=null&&list.size()>0) { if(list!=null&&list.size()>0) {
...@@ -695,7 +708,7 @@ public class CommandController extends BaseController { ...@@ -695,7 +708,7 @@ public class CommandController extends BaseController {
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/AlertCalledcountTime") @GetMapping(value = "/AlertCalledcountTime")
@ApiOperation(httpMethod = "GET", value = "执勤动态警情信息统计", notes = "执勤动态警情信息统计") @ApiOperation(httpMethod = "GET", value = "执勤动态警情信息统计", notes = "执勤动态警情信息统计")
public ResponseModel<Object> AlertCalledcountTime() { public ResponseModel<Object> AlertCalledcountTime() {
...@@ -705,13 +718,11 @@ public class CommandController extends BaseController { ...@@ -705,13 +718,11 @@ public class CommandController extends BaseController {
listdate.add(new KeyValueLabel("当月警情数量","",iAlertCalledService.AlertCalledcountTime(2))); listdate.add(new KeyValueLabel("当月警情数量","",iAlertCalledService.AlertCalledcountTime(2)));
listdate.add(new KeyValueLabel("昨天警情数量","",iAlertCalledService.AlertCalledcountTime(4))); listdate.add(new KeyValueLabel("昨天警情数量","",iAlertCalledService.AlertCalledcountTime(4)));
listdate.add(new KeyValueLabel("今天警情数量","",iAlertCalledService.AlertCalledcountTime(3))); listdate.add(new KeyValueLabel("今天警情数量","",iAlertCalledService.AlertCalledcountTime(3)));
return ResponseHelper.buildResponse(listdate); return ResponseHelper.buildResponse(listdate);
} }
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getTodayPowerTransferCompany") @GetMapping(value = "/getTodayPowerTransferCompany")
@ApiOperation(httpMethod = "GET", value = "当天力量调派", notes = "当天力量调派") @ApiOperation(httpMethod = "GET", value = "当天力量调派", notes = "当天力量调派")
public ResponseModel<Object> getTodayPowerTransferCompany() { public ResponseModel<Object> getTodayPowerTransferCompany() {
...@@ -719,7 +730,7 @@ public class CommandController extends BaseController { ...@@ -719,7 +730,7 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(powerTransferCompanyService.getTodayPowerTransferCompany()); return ResponseHelper.buildResponse(powerTransferCompanyService.getTodayPowerTransferCompany());
} }
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getTodayAlertCalled") @GetMapping(value = "/getTodayAlertCalled")
@ApiOperation(httpMethod = "GET", value = "当天接警记录", notes = "当天接警记录") @ApiOperation(httpMethod = "GET", value = "当天接警记录", notes = "当天接警记录")
public ResponseModel<Object> getTodayAlertCalled() { public ResponseModel<Object> getTodayAlertCalled() {
...@@ -727,7 +738,7 @@ public class CommandController extends BaseController { ...@@ -727,7 +738,7 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(iAlertCalledService.getTodayAlertCalled()); return ResponseHelper.buildResponse(iAlertCalledService.getTodayAlertCalled());
} }
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getFireTeamCountList") @GetMapping(value = "/getFireTeamCountList")
@ApiOperation(httpMethod = "GET", value = "执勤力量", notes = "执勤力量") @ApiOperation(httpMethod = "GET", value = "执勤力量", notes = "执勤力量")
public ResponseModel<Object> getFireTeamCountList() { public ResponseModel<Object> getFireTeamCountList() {
...@@ -735,7 +746,7 @@ public class CommandController extends BaseController { ...@@ -735,7 +746,7 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(iFireTeamService.getFireTeamCountList()); return ResponseHelper.buildResponse(iFireTeamService.getFireTeamCountList());
} }
@TycloudOperation(needAuth = false,ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = true,ApiLevel = UserType.AGENCY)
@ApiOperation("当天值班人信息列表") @ApiOperation("当天值班人信息列表")
@GetMapping("/getonDuty/list") @GetMapping("/getonDuty/list")
public ResponseModel listOnDutyPerson() { public ResponseModel listOnDutyPerson() {
...@@ -762,7 +773,7 @@ public class CommandController extends BaseController { ...@@ -762,7 +773,7 @@ public class CommandController extends BaseController {
@TycloudOperation( needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "fireCar/list") @GetMapping(value = "fireCar/list")
@ApiOperation(httpMethod = "GET", value = "车辆资源", notes = "车辆资源") @ApiOperation(httpMethod = "GET", value = "车辆资源", notes = "车辆资源")
public ResponseModel<List<Map<String,Object>>> getTeamCarList(RequestData par) { public ResponseModel<List<Map<String,Object>>> getTeamCarList(RequestData par) {
...@@ -771,15 +782,32 @@ public class CommandController extends BaseController { ...@@ -771,15 +782,32 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(list); return ResponseHelper.buildResponse(list);
} }
@TycloudOperation( needAuth = true, ApiLevel = UserType.AGENCY)
@GetMapping(value = "/testPostApi")
@ApiOperation(httpMethod = "GET", value = "视频地址", notes = "视频地址")
public Object testPost(Integer pageNum, Integer pageSize) throws URISyntaxException {
RestTemplate restTemplate = new RestTemplate();
URI uri = new URI(videoUrl+"artemis/api/resource/v1/camera/advance/cameraList");
HttpHeaders headers = new HttpHeaders();
// headers.add("Authorization", "APPCODE " + appCode);
//添加参数,因为HttpEntity里面的参数是MultiValueMap类型的,所以使用这个map集合
MultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
map.add("pageSize", 100);
map.add("pageNo", 1);
//添加请求的实体类,这里第一个参数是要发送的参数,第二个参数是请求头里的数据
HttpEntity<Object> requestEntity = new HttpEntity<Object>(map, headers);
ResponseEntity<String> exchange = restTemplate.exchange(uri, HttpMethod.POST, requestEntity, String.class);
JSONObject jsonObject = JSON.parseObject(exchange.getBody());
System.out.println(jsonObject);
return jsonObject;
}
} }
\ No newline at end of file
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -15,9 +17,12 @@ import org.typroject.tyboot.core.rdbms.annotation.Operator; ...@@ -15,9 +17,12 @@ import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.DataNotFound; import org.typroject.tyboot.core.restful.exception.instance.DataNotFound;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto; import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft; import com.yeejoin.amos.boot.module.jcs.api.entity.Aircraft;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.enums.AircraftFileTypeEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.AircraftFileTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AircraftMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.AircraftMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAircraftService; import com.yeejoin.amos.boot.module.jcs.api.service.IAircraftService;
...@@ -240,4 +245,13 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc ...@@ -240,4 +245,13 @@ public class AircraftServiceImpl extends BaseService<AircraftDto, Aircraft, Airc
public List<AircraftDto> queryAircraftDtoForList(@Condition(Operator.eq) Boolean isDelete) { public List<AircraftDto> queryAircraftDtoForList(@Condition(Operator.eq) Boolean isDelete) {
return this.queryForList("", false, isDelete); return this.queryForList("", false, isDelete);
} }
@Override
public Aircraft queryByaircraftModel(String seq) {
QueryWrapper<Aircraft> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("aircraftModel", seq);
// 警情动态表单数据
Aircraft aircraft = this.getOne(queryWrapper);
return aircraft;
}
} }
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