Commit a047eb78 authored by chenzhao's avatar chenzhao

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

parents e9c3a1cb 257d6796
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;
}
......@@ -33,4 +33,10 @@ public class WechatMyBusinessListDto {
@ApiModelProperty(value = "业务状态")
private String bussinessStatus;
@ApiModelProperty(value = "上报时间")
private Date reportTime;
@ApiModelProperty(value = "完成时间")
private Date finishTime;
}
......@@ -32,4 +32,10 @@ public class WechatMyTaskListDto {
@ApiModelProperty(value = "派遣时间")
private Date dispatchTime;
@ApiModelProperty(value = "上报时间")
private Date reportTime;
@ApiModelProperty(value = "完成时间")
private Date finishTime;
}
......@@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
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.AlertCalledRecordDto;
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.WechatMyTaskListDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
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.Map;
......@@ -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);
/**
* 根据条件返回接警记录信息
* @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;
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.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.WechatMyBusinessListDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
......@@ -76,4 +77,15 @@ public interface IAlertCalledService {
WechatMyBussinessDto getBussinessInfoById(Long alertId);
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 @@
a.device_id AS deviceId,
e.address AS
elevatorAddress,
a.region_code AS address,
a.address AS address,
a.alarm_type AS alertType,
a.alert_source AS alertSource,
a.alert_stage AS alertStage,
......@@ -227,8 +227,8 @@
#{emergencyTimeEnd}
</if>
<if test="workOrderNumber != null and workOrderNumber != ''">
and call_time <![CDATA[ <= ]]>
#{endDate}
and a.work_order_number like
CONCAT(CONCAT('%',#{workOrderNumber}),'%')
</if>
<if test="emergencyCall != null and emergencyCall != ''">
AND a.emergency_call like
......@@ -471,7 +471,9 @@
a.alert_status as taskStatus,
e.address,
a.call_time as dispatchTime,
a.alert_stage as bussinessStatus
a.alert_stage as bussinessStatus,
a.call_time as reportTime,
p.feedback_finish_time as finishTime
from tz_alert_called a
LEFT JOIN tcb_elevator e on e.sequence_nbr = a.equipment_id
LEFT JOIN tz_dispatch_paper p on p.alert_id = a.sequence_nbr
......@@ -482,6 +484,42 @@
ORDER BY a.rec_date desc
limit #{current},5
</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>
......@@ -78,7 +78,9 @@
a.alarm_type as taskType,
a.alert_status as taskStatus,
e.address,
p.dispatch_time as dispatch_time
p.dispatch_time as dispatch_time,
a.call_time as reportTime,
p.feedback_finish_time as finishTime
from tz_dispatch_task t
LEFT JOIN tz_alert_called a on a.sequence_nbr = t.alert_id
LEFT JOIN tcb_elevator e on e.sequence_nbr = a.equipment_id
......
......@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
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.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.MaintenanceCompanyServiceImpl;
......@@ -18,6 +19,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.AlertCalledObjsDto;
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.ESAlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.ESAlertCalledRequestDto;
......@@ -410,7 +412,16 @@ public class AlertCalledController extends BaseController {
String sort) {
queryWrapper.eq("is_delete", 0);
queryWrapper.orderByDesc("call_time");
if(sort!=null) { // 排序失效
String[] date= sort.split(",");
if(date[1].equals("ascend")) {
queryWrapper.orderByAsc(RedisKey.humpToLine(date[0]));
}else {
queryWrapper.orderByDesc(RedisKey.humpToLine(date[0]));
}
}else {
queryWrapper.orderByDesc("call_time");
}
if (!ValidationUtil.isEmpty(alertCalled.getIsAuxiliaryScreen())) {
if (!ValidationUtil.isEmpty(alertCalled.getCallTimeStart())
......@@ -469,7 +480,7 @@ public class AlertCalledController extends BaseController {
return ResponseHelper.buildResponse(result);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(value = "导出警情事件记录", notes = "导出警情事件记录")
@GetMapping("/exportSelectRecord")
public void exportAlertCalled(AlertCalledQueryDto alertCalledQueryDto, HttpServletResponse response) {
......@@ -492,6 +503,22 @@ public class AlertCalledController extends BaseController {
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;
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.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.AlertHandlerInfoDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertPaperInfoDto;
......@@ -354,6 +355,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
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) {
alertHandlerInfoDto.setAbProcess(process);
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