Commit 5ab70fb8 authored by kongfm's avatar kongfm

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents 7269594a 253632d9
......@@ -140,6 +140,6 @@ public interface EquipFeignClient {
* @return
*/
@RequestMapping(value = "//building/video/page", method = RequestMethod.GET)
ResponseModel<Page<Map<String, Object>>> getVideo( @RequestParam int current, @RequestParam int size, @RequestParam Long buildingId);
ResponseModel<Page<Map<String, Object>>> getVideo( @RequestParam Page page, @RequestParam Long buildingId);
}
package com.yeejoin.amos.boot.module.tzs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author litw
* @date 2021-08-09.
*/
@Data
@ApiModel(value="AlertCallInfoDto", description="初始化表单数据")
public class AlertCallInfoDto {
@ApiModelProperty(value = "警情工单编号")
private String workOrderNumber;
@ApiModelProperty(value = "接警时间")
private String callTime;
@ApiModelProperty(value = "接警人Id")
private String recUserId;
@ApiModelProperty(value = "接警人")
private String recUserName;
}
......@@ -126,4 +126,15 @@ public class AlertCalledDto extends BaseDto {
@ApiModelProperty(value = "警情地址")
private String alertAddress;
/**
* 工单编号
*/
@ApiModelProperty("工单编号")
private String workOrderNumber;
@ApiModelProperty(value = "接警时间str")
private String callTimeStr;
@ApiModelProperty(value = "接警人")
protected String recUserName;
}
......@@ -162,6 +162,12 @@ public class AlertCalled extends BaseEntity {
@TableField("org_code")
private String orgCode;
/**
* 工单编号
*/
@TableField("work_order_number")
private String workOrderNumber;
@TableField("city")
@ApiModelProperty(value = "所属地市")
private String city;
......@@ -195,6 +201,8 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "是否处警")
private Boolean isFatherAlert = false;
@TableField(exist=false)
@ApiModelProperty(value = "接警时间str")
private String callTimeStr;
}
......@@ -204,4 +204,10 @@ public class AlertCalledVo extends BaseEntity {
@ApiModelProperty(value = "响应级别")
private String responseLevel;
/**
* 工单编号
*/
@ApiModelProperty("工单编号")
private String workOrderNumber;
}
......@@ -5,10 +5,10 @@
<select id="queryAlertStatusCount" resultType="java.util.Map">
SELECT
count( 1 ) calledCount,
sum( CASE WHEN father_alert = null THEN 1 ELSE 0 END ) majorAlertCount
sum( CASE WHEN alarm_type_code = 'KRJY' THEN 1 ELSE 0 END ) sleepyIncidentCount
sum( CASE WHEN alarm_type_code = 'GZWX' THEN 1 ELSE 0 END ) faultRescueCount
sum( CASE WHEN alarm_type_code = 'TSZX' l THEN 1 ELSE 0 END ) suggestionsCount
sum( CASE WHEN father_alert = null THEN 1 ELSE 0 END ) majorAlertCount,
sum( CASE WHEN alarm_type_code = 'KRJY' THEN 1 ELSE 0 END ) sleepyIncidentCount,
sum( CASE WHEN alarm_type_code = 'GZWX' THEN 1 ELSE 0 END ) faultRescueCount,
sum( CASE WHEN alarm_type_code = 'TSZX' THEN 1 ELSE 0 END ) suggestionsCount
FROM
tz_alert_called
WHERE 1 = 1
......@@ -18,9 +18,6 @@
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> #{endDate}
</if>
<if test="alarmTypeCode != null and alarmTypeCode != ''">
and alarm_type_code = #{alarmTypeCode}
</if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode}
or rec_user_id = #{recUserId}
......
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService;
......@@ -809,8 +810,13 @@ public class CommandController extends BaseController {
@TycloudOperation( needAuth = true,ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getVideo", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "分页获取视频", notes = "分页获取视频")
public ResponseModel<Object> getVideo(Integer current, Integer size)throws Exception {
ResponseModel<Page<Map<String, Object>>> date= equipFeignClient.getVideo(current,size,0l);
public ResponseModel<Object> getVideo(long current, long size)throws Exception {
Page page = new Page(current, size);
List<OrderItem> list= OrderItem.ascs("id");
page.setOrders(list);
ResponseModel<Page<Map<String, Object>>> date= equipFeignClient.getVideo(page,0l);
return ResponseHelper.buildResponse(date!=null?date.getResult():null);
}
......
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.ExcelDto;
import com.yeejoin.amos.boot.module.common.api.dto.FormValue;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.api.feign.IotFeignClient;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.AircraftListTreeDto;
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.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AircraftServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertFormValueServiceImpl;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl;
import io.swagger.annotations.Api;
......@@ -28,10 +34,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
......@@ -51,6 +54,9 @@ public class AircraftController extends BaseController {
DataSourcesImpl dataSourcesImpl;
@Autowired
IotFeignClient iotFeignClient;
@Autowired
private AlertFormValueServiceImpl iAlertFormValueService;
/**
* 新增航空器信息
*
......@@ -195,7 +201,37 @@ public class AircraftController extends BaseController {
}
}
return ResponseHelper.buildResponse(map1);
}
}
/**
*
* 通过航班号,查询最新的航班信息
*
* **/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@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.getDynamicFlightInfo(num);
if(dataModel!=null) {
map= dataModel.getResult();
}
return ResponseHelper.buildResponse(map);
}
}
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.SystemClock;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
......@@ -10,6 +11,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCallInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
......@@ -128,6 +130,7 @@ public class AlertCalledController extends BaseController {
}
/**
* 根据id查询
*
......@@ -141,6 +144,48 @@ public class AlertCalledController extends BaseController {
return ResponseHelper.buildResponse(iAlertCalledService.selectAlertCalledById(id));
}
/**
* 生成工单编号报警人及报警时间
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getWorkOderNumber")
@ApiOperation(httpMethod = "GET",value = "生成工单编号报警人及报警时间", notes = "生成工单编号报警人及报警时间")
public ResponseModel<AlertCallInfoDto> selectOne() throws ParseException {
String workOrderNumber = nextId();
AlertCallInfoDto alertCallInfoDto = new AlertCallInfoDto();
alertCallInfoDto.setCallTime(DateUtils.stampToDate(System.currentTimeMillis(),"yyyy-MM-dd HH:mm:ss "));
alertCallInfoDto.setWorkOrderNumber(workOrderNumber);
alertCallInfoDto.setRecUserId(getUserInfo().getUserId());
alertCallInfoDto.setRecUserName(getUserInfo().getUserName());
return ResponseHelper.buildResponse(alertCallInfoDto);
}
/**
* 获取下一个 工单编号
*
* @return 下一个 工单编号
*/
public synchronized String nextId() throws ParseException {
String number = DateUtils.stampToDate(SystemClock.now(),"yyyy-MM-dd HH:mm:ss SSS");
String newNumber = number.replace("-","").replace(" ","").replace(":","");
ReginParams reginParams =
JSONObject.parseObject(null != redisUtils.get(buildKey(getToken())) ?
redisUtils.get(buildKey(getToken())).toString() : null, ReginParams.class);
// Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.dateFormat(new Date(),"")+" 00:00:00",
// DateUtils.dateFormat(new Date(),"")+" 23:59:59",reginParams.getCompany().getOrgCode(),
// reginParams.getUserModel().getUserId());
Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.dateFormat(new Date(),"")+" 00:00:00",
DateUtils.dateFormat(new Date(),"")+" 23:59:59",null,
null);
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(newNumber);
String workOrderNumber = stringBuilder.append(map.get("calledCount") == null ? "1" : String.valueOf(Integer.parseInt(map.get("calledCount").toString()) + 1)).toString() ;
return workOrderNumber;
}
/**
* 警情统计
......@@ -148,7 +193,7 @@ public class AlertCalledController extends BaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/alert-statistics")
@GetMapping(value = "/alertStatistics")
@ApiOperation(httpMethod = "GET",value = "警情统计", notes = "警情统计")
public ResponseModel<AlarmStatisticsVo> alertStatistics() throws ParseException {
ReginParams reginParams =
......
......@@ -31,7 +31,6 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -134,10 +133,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
AlertCalled alertCalled = BeanDtoVoUtils.convert(alertCalledObjsDto.getAlertCalledDto(),AlertCalled.class);
alertCalled.setCallTime(new Date());
alertCalled.setCallTime(DateUtils.longStr2Date(alertCalled.getCallTimeStr()));
// 判断是否归并警情
if (alertCalled.getFatherAlert() == null) {
if (alertCalled.getFatherAlert() != null) {
// 警情归并,设置当前警情状态为结束。
alertCalled.setAlertStatus(true);
alertCalled.setAlertStage(AlertStageEnums.JJ.getValue());
......@@ -150,18 +149,14 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
// 填充警情主键
alertFormValuelist.stream().forEach(alertFormValue -> {
alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr());
if(AlertStageEnums.GZWX.toString().equals(alertCalled.getAlarmTypeCode()) ){
alertFormValue.setAlertTypeCode(AlertStageEnums.GZWX.getCode());
}
if(AlertStageEnums.TSZX.toString().equals(alertCalled.getAlarmTypeCode()) ) {
alertFormValue.setAlertTypeCode(AlertStageEnums.TSZX.getCode());
}
if(AlertStageEnums.KRJY.toString().equals(alertCalled.getAlarmTypeCode()) ) {
alertFormValue.setAlertTypeCode(AlertStageEnums.KRJY.getCode());
}
alertFormValue.setAlertTypeCode(alertCalled.getAlarmTypeCode());
});
// 保存动态表单数据
iAlertFormValueService.saveBatch(alertFormValuelist);
// 警情基本信息
AlertCalled alertCalledFather = this.getById(alertCalled.getFatherAlert());
alertCalledObjsDto.setAlertCalledDto(BeanDtoVoUtils.convert(alertCalledFather,AlertCalledDto.class));
} else {
// 警情报送
// ****************************************************待确认开发
......@@ -178,17 +173,9 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
// 填充警情主键
alertFormValuelist.stream().forEach(alertFormValue -> {
alertFormValue.setAlertCalledId(alertCalled.getSequenceNbr());
if(AlertStageEnums.GZWX.toString().equals(alertCalled.getAlarmTypeCode()) ){
alertFormValue.setAlertTypeCode(AlertStageEnums.GZWX.getCode());
}
if(AlertStageEnums.TSZX.toString().equals(alertCalled.getAlarmTypeCode()) ) {
alertFormValue.setAlertTypeCode(AlertStageEnums.TSZX.getCode());
}
if(AlertStageEnums.KRJY.toString().equals(alertCalled.getAlarmTypeCode()) ) {
alertFormValue.setAlertTypeCode(AlertStageEnums.KRJY.getCode());
}
alertFormValue.setAlertTypeCode(alertCalled.getAlarmTypeCode());
});
if(AlertStageEnums.KRJY.toString().equals(alertCalled.getAlarmTypeCode()) ) {
if(AlertStageEnums.KRJY.getCode().equals(alertCalled.getAlarmTypeCode()) ) {
//困人救援创建警情时创建救援过程信息
rescueProcessServiceImpl.getProcessByAlertId(alertCalled.getSequenceNbr());
}
......
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