Commit 9f19ead7 authored by kongfm's avatar kongfm

更新tzs 接警记录导出

parent f33df8f8
package com.yeejoin.amos.boot.module.tzs.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* 接警记录导出
*/
@Data
@ApiModel(value="AlertCalledRecordDto", description="接警记录导出Dto类")
public class AlertCalledRecordDto {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "接警时间", index = 0)
@ApiModelProperty(value = "接警时间")
private Date callTime;
@ExcelProperty(value = "报警类型", index = 1)
@ApiModelProperty(value = "报警类型")
private String type;
@ExcelProperty(value = "警情来源", index = 2)
@ApiModelProperty(value = "警情来源")
private String alertSource;
@ExcelProperty(value = "警情类型", index = 3)
@ApiModelProperty(value = "警情类型")
private String alarmType;
@ExcelProperty(value = "警情地址", index = 4)
@ApiModelProperty(value = "警情地址")
private String address;
@ExcelIgnore
@ApiModelProperty(value = "接警开始时间")
private Date callTimeStart;
@ExcelIgnore
@ApiModelProperty(value = "接警结束时间")
private Date callTimeEnd;
}
...@@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -78,4 +81,20 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> { ...@@ -78,4 +81,20 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
List<WechatMyBusinessListDto> getBussinessListByPhonePager(@Param("phone") String phone, @Param("bussinessCode") String bussinessCode, @Param("current") Long current); List<WechatMyBusinessListDto> getBussinessListByPhonePager(@Param("phone") String phone, @Param("bussinessCode") String bussinessCode, @Param("current") Long current);
/**
* 根据条件返回接警记录信息
* @param callTimeStart
* @param callTimeEnd
* @param type
* @param alertSource
* @param alarmType
* @return
*/
List<AlertCalledRecordDto> queryAlertRecordListByQueryDto(
String callTimeStart,
String callTimeEnd,
String type,
String alertSource,
String alarmType);
} }
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
...@@ -76,4 +77,15 @@ public interface IAlertCalledService { ...@@ -76,4 +77,15 @@ public interface IAlertCalledService {
WechatMyBussinessDto getBussinessInfoById(Long alertId); WechatMyBussinessDto getBussinessInfoById(Long alertId);
List<WechatMyBusinessListDto> getBussinessListByPhonePager(String phone, String bussinessCode, Long current); List<WechatMyBusinessListDto> getBussinessListByPhonePager(String phone, String bussinessCode, Long current);
/**
* 根据条件筛选 接警记录
* @param callTimeStart
* @param callTimeEnd
* @param type
* @param alertSource
* @param alarmType
* @return
*/
List<AlertCalledRecordDto> queryAlertRecordListByQueryDto(String callTimeStart,String callTimeEnd, String type, String alertSource, String alarmType);
} }
...@@ -188,7 +188,7 @@ ...@@ -188,7 +188,7 @@
a.device_id AS deviceId, a.device_id AS deviceId,
e.address AS e.address AS
elevatorAddress, elevatorAddress,
a.region_code AS address, a.address AS address,
a.alarm_type AS alertType, a.alarm_type AS alertType,
a.alert_source AS alertSource, a.alert_source AS alertSource,
a.alert_stage AS alertStage, a.alert_stage AS alertStage,
...@@ -227,8 +227,8 @@ ...@@ -227,8 +227,8 @@
#{emergencyTimeEnd} #{emergencyTimeEnd}
</if> </if>
<if test="workOrderNumber != null and workOrderNumber != ''"> <if test="workOrderNumber != null and workOrderNumber != ''">
and call_time <![CDATA[ <= ]]> and a.work_order_number like
#{endDate} CONCAT(CONCAT('%',#{workOrderNumber}),'%')
</if> </if>
<if test="emergencyCall != null and emergencyCall != ''"> <if test="emergencyCall != null and emergencyCall != ''">
AND a.emergency_call like AND a.emergency_call like
...@@ -482,6 +482,42 @@ ...@@ -482,6 +482,42 @@
ORDER BY a.rec_date desc ORDER BY a.rec_date desc
limit #{current},5 limit #{current},5
</select> </select>
<select id="queryAlertRecordListByQueryDto" resultType="com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto">
SELECT
a.call_time AS callTime,
a.type ,
a.alert_source AS alertSource,
a.alarm_type AS alarmType,
a.address
FROM
tz_alert_called a
LEFT JOIN tcb_elevator e ON e.sequence_nbr = a.equipment_id
WHERE 1=1
<if test="callTimeStart != null ">
and #{callTimeStart} <![CDATA[ <= ]]>
a.call_time
</if>
<if test="callTimeEnd != null ">
and a.call_time <![CDATA[ <= ]]>
#{callTimeEnd}
</if>
<if test="type != null and type != ''">
and a.type = #{type}
</if>
<if test="alertSource != null and alertSource != ''">
AND a.alert_source = #{alertSource}
</if>
<if test="alarmType != null and alarmType != ''">
AND a.alarm_type = #{alarmType}
</if>
</select>
</mapper> </mapper>
...@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCallInfoDto; ...@@ -18,6 +18,7 @@ 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.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto; import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto; import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto;
...@@ -469,7 +470,7 @@ public class AlertCalledController extends BaseController { ...@@ -469,7 +470,7 @@ public class AlertCalledController extends BaseController {
return ResponseHelper.buildResponse(result); return ResponseHelper.buildResponse(result);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "导出警情事件记录", notes = "导出警情事件记录") @ApiOperation(value = "导出警情事件记录", notes = "导出警情事件记录")
@GetMapping("/exportSelectRecord") @GetMapping("/exportSelectRecord")
public void exportAlertCalled(AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) { public void exportAlertCalled(AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) {
...@@ -492,6 +493,22 @@ public class AlertCalledController extends BaseController { ...@@ -492,6 +493,22 @@ public class AlertCalledController extends BaseController {
ExcelUtil.createTemplate(response, fileName, "警情事件记录", list, AlertCalledQueryDto.class, null, false); ExcelUtil.createTemplate(response, fileName, "警情事件记录", list, AlertCalledQueryDto.class, null, false);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "导出接警记录信息", notes = "导出接警记录信息")
@GetMapping("/exportAlertRecord")
public void exportAlertRecord(AlertCalledRecordDto alertCalledQueryDto, HttpServletResponse response) {
List<AlertCalledRecordDto> list = iAlertCalledService.queryAlertRecordListByQueryDto(
alertCalledQueryDto.getCallTimeStart() == null ? null
: DateUtils.date2LongStr(alertCalledQueryDto.getCallTimeStart()),
alertCalledQueryDto.getCallTimeEnd() == null ? null
: DateUtils.date2LongStr(alertCalledQueryDto.getCallTimeEnd()),
alertCalledQueryDto.getType(),
alertCalledQueryDto.getAlertSource(),
alertCalledQueryDto.getAlarmType());
String fileName = "接警记录" + System.currentTimeMillis();
ExcelUtil.createTemplate(response, fileName, "接警记录", list, AlertCalledRecordDto.class, null, false);
}
/** /**
* 冻结工单-维修 * 冻结工单-维修
* *
......
...@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto; ...@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledRecordDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerInfoDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertHandlerInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto; import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto;
...@@ -354,6 +355,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -354,6 +355,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return baseMapper.getBussinessListByPhonePager(phone, bussinessCode, current*5); return baseMapper.getBussinessListByPhonePager(phone, bussinessCode, current*5);
} }
@Override
public List<AlertCalledRecordDto> queryAlertRecordListByQueryDto(String callTimeStart, String callTimeEnd, String type, String alertSource, String alarmType) {
List<AlertCalledRecordDto> list = alertCalledMapper.queryAlertRecordListByQueryDto(callTimeStart,callTimeEnd,type,alertSource,alarmType);
return list;
}
private void dataInit(AlertHandlerInfoDto alertHandlerInfoDto, String process,String answerThePolice, String report, String notice, String arrive, String complete,String returnVisit) { private void dataInit(AlertHandlerInfoDto alertHandlerInfoDto, String process,String answerThePolice, String report, String notice, String arrive, String complete,String returnVisit) {
alertHandlerInfoDto.setAbProcess(process); alertHandlerInfoDto.setAbProcess(process);
alertHandlerInfoDto.setAcAnswerThePolice(answerThePolice); alertHandlerInfoDto.setAcAnswerThePolice(answerThePolice);
......
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