Commit ea45f266 authored by tianbo's avatar tianbo

feat:大屏应急接口迁移至统计服务

parent 4197d376
...@@ -22,11 +22,6 @@ ...@@ -22,11 +22,6 @@
<artifactId>amos-boot-module-jg-api</artifactId> <artifactId>amos-boot-module-jg-api</artifactId>
<version>${amos-boot-biz.version}</version> <version>${amos-boot-biz.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-96333-api</artifactId>
<version>${amos-boot-biz.version}</version>
</dependency>
</dependencies> </dependencies>
......
package com.yeejoin.amos.boot.module.statistics.api.mapper; package com.yeejoin.amos.boot.module.statistics.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.biz.common.dto.CountDto; import com.yeejoin.amos.boot.biz.common.dto.CountDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto; import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamForDetailDto;
import com.yeejoin.amos.boot.module.common.api.entity.AlertStatistics; import com.yeejoin.amos.boot.module.common.api.entity.AlertStatistics;
import com.yeejoin.amos.boot.module.ymt.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.Elevator;
import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -48,4 +51,13 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> { ...@@ -48,4 +51,13 @@ public interface AlertStatisticsMapper extends BaseMapper<AlertStatistics> {
Page<Map<String, Object>> alertRecordForPage(@Param("page") Page<Map<String, Object>> page, Page<Map<String, Object>> alertRecordForPage(@Param("page") Page<Map<String, Object>> page,
@Param("dto") DPFilterParamForDetailDto dto, @Param("dto") DPFilterParamForDetailDto dto,
@Param("orgCode") String orgCode); @Param("orgCode") String orgCode);
Map<String, Object> selectUseUnitByAlertId(String sequenceNbr);
Map<String,Object> selectElevator(@Param("elevator") Elevator elevator);
List<Map<String, Object>> selectMtByAlertId(String sequenceNbr);
Page<AlertCalledQueryDto> getAlertCalledRecords(IPage<AlertCalledQueryDto> page, @Param("dto")AlertCalledQueryDto dto, @Param("orgCode") String orgCode);
} }
...@@ -264,4 +264,148 @@ ...@@ -264,4 +264,148 @@
ORDER BY rec_date DESC ORDER BY rec_date DESC
</select> </select>
<select id="selectUseUnitByAlertId" resultType="java.util.Map">
SELECT
ibjui.SAFETY_MANAGER AS manager,
ibjui.PHONE AS managerPhone,
ibjui.USE_UNIT_NAME as useUnitName,
tbei.address AS address,
tbei.sequence_nbr AS unitId
FROM
idx_biz_jg_use_info ibjui
LEFT JOIN tz_base_enterprise_info tbei ON ibjui.USE_UNIT_CREDIT_CODE = tbei.use_code
WHERE
RECORD = #{sequenceNbr}
</select>
<select id="selectElevator" resultType="java.util.Map">
SELECT
jui.RECORD AS sequenceNbr,
ifnull ( joi.CODE96333, null ) AS rescueCode,
ifnull ( joi.SUPERVISORY_CODE, null ) AS registerCode,
ifnull ( jui.USE_UNIT_NAME, null ) AS useUnit,
ifnull ( jui.EQU_STATE,'')AS useStatus,
ifnull ( ( SELECT NAME FROM cb_data_dictionary WHERE code = jui.USE_PLACE and type = 'ADDRESS' ), null ) AS useSiteCategory,
ifnull ( jui.ADDRESS, null ) AS address,
ifnull ( jui.PROVINCE_NAME, null ) AS province,
ifnull ( jui.CITY_NAME, null ) AS city,
ifnull ( jui.COUNTY_NAME, null ) AS district,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'latitude', null ) AS latitude,
ifnull ( jui."LONGITUDE_LATITUDE"::json->> 'longitude', null ) AS longitude,
ifnull(jui.FACTORY_USE_SITE_STREET, '') AS street,
concat(jui.PROVINCE, '#',jui.CITY, '#',jui.COUNTY) AS regionCode,
jsi.ORG_BRANCH_CODE as orgCode
FROM
idx_biz_jg_use_info jui
LEFT JOIN idx_biz_jg_other_info joi ON jui.RECORD = joi.RECORD
LEFT JOIN idx_biz_jg_register_info jri ON jri.RECORD = jui.RECORD
LEFT JOIN idx_biz_jg_supervision_info jsi ON jsi.RECORD = jui.RECORD
WHERE
jri.EQU_LIST = '3000'
<if test="elevator.rescueCode!=null and elevator.rescueCode!='' ">
AND joi.CODE96333 = #{elevator.rescueCode}
</if>
<if test="elevator.registerCode!=null and elevator.registerCode!='' ">
AND joi.SUPERVISORY_CODE = #{elevator.registerCode}
</if>
<if test="elevator.originalId!=null and elevator.originalId!='' ">
AND jui.RECORD = #{elevator.originalId}
</if>
</select>
<select id="selectMtByAlertId" resultType="java.util.Map">
SELECT
SEQUENCE_NBR AS sequenceNbr,
ME_MASTER AS userName1,
ME_MASTER_PHONE AS phone1,
ME_MASTER1 AS userName2,
ME_MASTER1_PHONE AS phone2,
'' AS address,
ME_UNIT_NAME AS unitName,
ME_UNIT_CREDIT_CODE AS useCode
FROM
idx_biz_jg_maintenance_record_info ibjmri
where
ibjmri.RECORD = #{sequenceNbr}
order by ibjmri.INFORM_START desc
limit 1
</select>
<select id="getAlertCalledRecords" resultType="com.yeejoin.amos.boot.module.ymt.api.dto.AlertCalledQueryDto">
SELECT
a.sequence_nbr AS sequenceNbr,
a.work_order_number AS workOrderNumber,
a.rec_user_name AS creator,
a.emergency_person AS emergency,
a.call_time AS callTime,
a.emergency_call AS emergencyCall,
a.device_id AS deviceId,
ibjui.ADDRESS as elevatorAddress,
CONCAT(a.city,a.district) AS address,
a.alarm_type AS alertType,
a.alert_source AS alertSource,
a.alert_stage AS alertStage,
CASE
a.alert_status
WHEN 0 THEN
'未完成'
WHEN 1 THEN
'完成'
ELSE
''
END AS alertStatus
FROM
tz_alert_called a
left join idx_biz_jg_use_info ibjui on ibjui.RECORD = a.equipment_id
WHERE a.is_delete = 0 and a.father_alert is null
and a.biz_org_code like concat(#{orgCode}, '%')
<if test="dto.workOrderNumber != null and dto.workOrderNumber != ''">
AND a.work_order_number like
CONCAT(CONCAT('%',#{dto.workOrderNumber}),'%')
</if>
<if test="dto.creator != null and dto.creator != ''">
AND a.rec_user_name like
CONCAT(CONCAT('%',#{dto.creator}),'%')
</if>
<if test="dto.emergency != null and dto.emergency != ''">
AND a.emergency_person like
CONCAT(CONCAT('%',#{dto.emergency}),'%')
</if>
<if test="dto.emergencyTimeStart != null ">
and #{dto.emergencyTimeStart} <![CDATA[ <= ]]>
a.call_time
</if>
<if test="dto.emergencyTimeEnd != null ">
and a.call_time <![CDATA[ <= ]]>
#{dto.emergencyTimeEnd}
</if>
<if test="dto.emergencyCall != null and dto.emergencyCall != ''">
AND a.emergency_call like
CONCAT(CONCAT('%',#{dto.emergencyCall}),'%')
</if>
<if test="dto.deviceId != null and dto.deviceId != ''">
AND a.device_id like CONCAT(CONCAT('%',#{dto.deviceId}),'%')
</if>
<if test="dto.elevatorAddress != null and dto.elevatorAddress != ''">
AND ibjui.ADDRESS like
CONCAT(CONCAT('%',#{dto.elevatorAddress}),'%')
</if>
<if test="dto.district != null and dto.district != ''">
AND a.district like
CONCAT(CONCAT('%',#{dto.district}),'%')
</if>
<if test="dto.alertType != null and dto.alertType != ''">
AND a.alarm_type_code = #{dto.alertType}
</if>
<if test="dto.alertSource != null and dto.alertSource != ''">
AND a.alert_source_code = #{dto.alertSource}
</if>
<if test="dto.alertStage != null and dto.alertStage != ''">
AND a.alert_stage_code = #{dto.alertStage}
</if>
<if test="dto.alertStatus != null and dto.alertStatus != ''">
AND a.alert_status = #{dto.alertStatus}
</if>
ORDER BY a.call_time desc
</select>
</mapper> </mapper>
package com.yeejoin.amos.boot.module.statistcs.biz.controller; package com.yeejoin.amos.boot.module.statistcs.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.EmergencyBizServiceImpl; import com.yeejoin.amos.boot.module.statistcs.biz.service.impl.EmergencyBizServiceImpl;
import com.yeejoin.amos.boot.module.ymt.api.dto.AlertCalledQueryDto;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -36,4 +34,63 @@ public class EmergencyBizController { ...@@ -36,4 +34,63 @@ public class EmergencyBizController {
public ResponseModel<Object> getDetail(@PathVariable Long id) { public ResponseModel<Object> getDetail(@PathVariable Long id) {
return ResponseHelper.buildResponse(emergencyBizService.getDetail(id)); return ResponseHelper.buildResponse(emergencyBizService.getDetail(id));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/basicDetail/{id}")
@ApiOperation(httpMethod = "GET", value = "根据id获取救援信息", notes = "根据id获取救援信息")
public ResponseModel<Object> getBasicDetail(@PathVariable Long id) {
return ResponseHelper.buildResponse(emergencyBizService.getBasicDetail(id));
}
/**
* 应急大屏使用
*
* @param id 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/dispatchRecord/{id}")
@ApiOperation(httpMethod = "GET", value = "根据id获取调派信息", notes = "根据id获取调派信息")
public ResponseModel<Object> getDispatchRecord(@PathVariable Long id) {
return ResponseHelper.buildResponse(emergencyBizService.getDispatchRecord(id));
}
/**
* 应急大屏使用
*
* @param id 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/followRecords/{id}")
@ApiOperation(httpMethod = "GET", value = "根据id获取回访信息", notes = "根据id获取回访信息")
public ResponseModel<Object> getFollowRecords(@PathVariable Long id) {
return ResponseHelper.buildResponse(emergencyBizService.getFollowRecords(id));
}
/**
* 应急大屏使用
*
* @param id 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/callRecords/{id}")
@ApiOperation(httpMethod = "GET", value = "根据id获取通话记录信息", notes = "根据id获取通话记录信息")
public ResponseModel<Object> getCallRecords(@PathVariable Long id, @RequestParam int number, @RequestParam int size) {
return ResponseHelper.buildResponse(emergencyBizService.getCallRecords(id, number, size));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "应急大屏使用", notes = "查询警情事件记录")
@GetMapping("/selectRecord/dp")
public ResponseModel<Page<AlertCalledQueryDto>> getAlertCalledRecords(AlertCalledQueryDto alertCalledQueryDto,
@RequestParam(value = "pageNum") int pageNum,
@RequestParam(value = "pageSize") int pageSize,
@RequestParam(value = "cityCode") String cityCode) {
Page<AlertCalledQueryDto> page = new Page<>();
page.setCurrent(pageNum);
page.setSize(pageSize);
return ResponseHelper.buildResponse(emergencyBizService.getAlertCalledRecords(page, alertCalledQueryDto, cityCode));
}
} }
package com.yeejoin.amos.boot.module.statistcs.biz.utils; package com.yeejoin.amos.boot.module.statistcs.biz.utils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.elevator.api.dto.FormValue; import com.yeejoin.amos.boot.module.ymt.api.dto.FormValue;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import java.io.IOException; import java.io.IOException;
......
[
{
"dataIndex": "unitName",
"width": "33%",
"align": "left",
"title": "维保单位",
"key": "AA6DE857-C788-494F-8F16-2ECFC7E34528"
},
{
"dataIndex": "address",
"width": "33%",
"align": "left",
"title": "地址",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA"
},
{
"dataIndex": "userName1",
"width": "15%",
"align": "left",
"title": "主要负责人",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA2"
},
{
"dataIndex": "phone1",
"width": "15%",
"align": "left",
"title": "主要负责人电话",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA3"
}
]
\ No newline at end of file
[
{
"dataIndex": "orgType",
"width": "15%",
"align": "left",
"title": "响应级别",
"key": "AA6DE857-C788-494F-8F16-2ECFC7E34528"
},
{
"dataIndex": "responseOrgName",
"width": "26%",
"align": "left",
"title": "单位名称",
"key": "D1CB84A4-E037-446A-9469-65B76E381585"
},
{
"dataIndex": "responseUserName",
"width": "10%",
"align": "left",
"title": "联系人",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA"
},
{
"dataIndex": "responseUserTel",
"width": "15%",
"align": "left",
"title": "联系电话",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA1"
},
{
"dataIndex": "dispatchTime",
"width": "15%",
"align": "left",
"title": "派遣时间",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA2"
},
{
"dataIndex": "arriveTime",
"width": "15%",
"align": "left",
"title": "到达时间",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA3"
}
]
\ No newline at end of file
[
{
"dataIndex": "name",
"width": "23%",
"align": "left",
"title": "名称",
"key": "AA6DE857-C788-494F-8F16-2ECFC7E34528"
},
{
"dataIndex": "address",
"width": "33%",
"align": "left",
"title": "地址",
"key": "D1CB84A4-E037-446A-9469-65B76E381585"
},
{
"dataIndex": "distance",
"width": "20%",
"align": "left",
"title": "距离",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA"
},
{
"dataIndex": "rescueLeader",
"width": "10%",
"align": "left",
"title": "救援负责人",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA1"
},
{
"dataIndex": "rescueLeaderPhone",
"width": "10%",
"align": "left",
"title": "电话",
"key": "611DAF3D-5B79-466C-BEF2-CC91580091FA2"
}
]
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"dataConfig": { "dataConfig": {
"api": { "api": {
"httpMethod":"GET", "httpMethod":"GET",
"apiPath":"/elevator/alert-called/detail/{sequenceNbr}" "apiPath":"/statistics/dp/biz/emergency/detail/{sequenceNbr}"
} }
} }
}, },
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
"dataConfig": { "dataConfig": {
"api": { "api": {
"httpMethod":"GET", "httpMethod":"GET",
"apiPath":"/elevator/alert-called/basicDetail/{sequenceNbr}" "apiPath":"/statistics/dp/biz/emergency/basicDetail/{sequenceNbr}"
} }
} }
}, },
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"dataConfig": { "dataConfig": {
"api": { "api": {
"httpMethod":"GET", "httpMethod":"GET",
"apiPath":"/elevator/alert-called/dispatchRecord/{sequenceNbr}" "apiPath":"/statistics/dp/biz/emergency/dispatchRecord/{sequenceNbr}"
} }
} }
}, },
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
"dataConfig": { "dataConfig": {
"api": { "api": {
"httpMethod":"GET", "httpMethod":"GET",
"apiPath":"/elevator/alert-called/followRecords/{sequenceNbr}" "apiPath":"/statistics/dp/biz/emergency/followRecords/{sequenceNbr}"
} }
} }
}, },
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
"dataConfig": { "dataConfig": {
"api": { "api": {
"httpMethod":"GET", "httpMethod":"GET",
"apiPath":"/elevator/alert-called/callRecords/{sequenceNbr}", "apiPath":"/statistics/dp/biz/emergency/callRecords/{sequenceNbr}",
"params": { "params": {
"number": 1, "number": 1,
"size": 10 "size": 10
......
[
{
"key": "dispatchStatus",
"label": "派遣状态",
"type": "text"
},
{
"key": "dispatchUserName",
"label": "派遣人",
"type": "text"
},
{
"key": "dispatchTime",
"label": "派遣时间",
"type": "text"
},
{
"key": "arriveStatus",
"label": "到达状态",
"type": "text"
},
{
"key": "arriveTime",
"label": "到达时间",
"type": "text"
},
{
"key": "arriveUserName",
"label": "记录人",
"type": "text"
},
{
"key": "arriveFeedbackType",
"label": "反馈方式",
"type": "text"
},
{
"key": "casualtiesStatus",
"label": "伤亡状态",
"type": "text"
},
{
"key": "casualtiesInfo",
"label": "受伤人数",
"type": "text"
},
{
"key": "dieNum",
"label": "死亡人数",
"type": "text"
},
{
"key": "rescueStatus",
"label": "救援状态",
"type": "text"
},
{
"key": "rescueTime",
"label": "完成时间",
"type": "text"
},
{
"key": "rescueUserName",
"label": "记录人",
"type": "text"
},
{
"key": "rescueFeedbackType",
"label": "反馈方式",
"type": "text"
},
{
"key": "isTimeout",
"label": "是否超时",
"type": "text"
},
{
"key": "arriveUseTime",
"label": "救援时长",
"type": "text"
}
]
\ No newline at end of file
[
{
"key": "responseUserName",
"label": "维保响应人",
"type": "text"
},
{
"key": "responseUserTel",
"label": "响应电话",
"type": "text"
},
{
"key": "feedbackType",
"label": "反馈方式",
"type": "text"
},
{
"key": "fixResult",
"label": "维修结果",
"type": "text"
},
{
"key": "feedbackFinishTime",
"label": "维修完成时间",
"type": "text"
},
{
"key": "saveFeedbackUser",
"label": "维修回访人",
"type": "text"
},
{
"key": "errorResult",
"label": "故障原因",
"type": "text"
},
{
"key": "fixRemark",
"label": "备注",
"type": "text"
}
]
\ No newline at end of file
[
{
"key": "emergency",
"label": "救援人",
"type": "text"
},
{
"key": "emergencyCall",
"label": "救援电话",
"type": "text"
},
{
"key": "saveFeedbackTime",
"label": "回访时间",
"type": "text"
},
{
"key": "feedbackUname",
"label": "救援回访人",
"type": "text"
},
{
"key": "saveFeedbackResult",
"label": "回访结果",
"type": "text"
}
]
\ No newline at end of file
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