Commit e53ac3b1 authored by 李松's avatar 李松

修改大屏应急处置详情接口

parent 5ac98081
...@@ -16,7 +16,6 @@ import org.apache.ibatis.annotations.Select; ...@@ -16,7 +16,6 @@ import org.apache.ibatis.annotations.Select;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* 警情接警填报记录 Mapper 接口 * 警情接警填报记录 Mapper 接口
...@@ -101,7 +100,7 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> { ...@@ -101,7 +100,7 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
* @param * @param
* @return * @return
*/ */
Page<List<AlertCalledQueryDto>> getAlertCalledRecords(IPage<AlertCalledQueryDto> page, @Param("dto")AlertCalledQueryDto dto); Page<AlertCalledQueryDto> getAlertCalledRecords(IPage<AlertCalledQueryDto> page, @Param("dto")AlertCalledQueryDto dto, @Param("orgCode") String orgCode);
Map<String, Integer> getTodayEmergencyCount(String regionCode); Map<String, Integer> getTodayEmergencyCount(String regionCode);
...@@ -146,4 +145,6 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> { ...@@ -146,4 +145,6 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
Map<String, Long> getMyBacklog(String groupCode); Map<String, Long> getMyBacklog(String groupCode);
String getDictName(@Param("id") String id); String getDictName(@Param("id") String id);
String getOrgCodeByCompanyCode(String companyCode);
} }
...@@ -648,7 +648,7 @@ ...@@ -648,7 +648,7 @@
<select id="getDictName" resultType="java.lang.String"> <select id="getDictName" resultType="java.lang.String">
SELECT name from cb_data_dictionary where sequence_nbr = #{id} limit 1 SELECT name from cb_data_dictionary where sequence_nbr = #{id} limit 1
</select> </select>
<select id="getAlertCalledRecords" resultType="java.util.List"> <select id="getAlertCalledRecords" resultType="com.yeejoin.amos.boot.module.elevator.api.dto.AlertCalledQueryDto">
SELECT SELECT
a.sequence_nbr AS sequenceNbr, a.sequence_nbr AS sequenceNbr,
a.work_order_number AS workOrderNumber, a.work_order_number AS workOrderNumber,
...@@ -657,7 +657,7 @@ ...@@ -657,7 +657,7 @@
a.call_time AS callTime, a.call_time AS callTime,
a.emergency_call AS emergencyCall, a.emergency_call AS emergencyCall,
a.device_id AS deviceId, a.device_id AS deviceId,
ibjui.ADDRESS AS elevatorAddress, (SELECT ibjui.ADDRESS from idx_biz_jg_use_info ibjui where ibjui.RECORD = a.equipment_id) as elevatorAddress,
CONCAT(a.city,a.district) AS address, CONCAT(a.city,a.district) AS address,
a.alarm_type AS alertType, a.alarm_type AS alertType,
a.alert_source AS alertSource, a.alert_source AS alertSource,
...@@ -673,64 +673,59 @@ ...@@ -673,64 +673,59 @@
END AS alertStatus END AS alertStatus
FROM FROM
tz_alert_called a tz_alert_called a
LEFT JOIN idx_biz_jg_other_info ibjoi ON ibjoi.CODE96333 = a.device_id
LEFT JOIN idx_biz_jg_use_info ibjui ON ibjoi.RECORD = ibjui.RECORD
WHERE a.is_delete = 0 and a.father_alert is null WHERE a.is_delete = 0 and a.father_alert is null
and a.skill_group = #{groupCode} and a.biz_org_code like concat(#{orgCode}, '%')
<if test="workOrderNumber != null and workOrderNumber != ''"> <if test="dto.workOrderNumber != null and dto.workOrderNumber != ''">
AND a.work_order_number like AND a.work_order_number like
CONCAT(CONCAT('%',#{workOrderNumber}),'%') CONCAT(CONCAT('%',#{dto.workOrderNumber}),'%')
</if> </if>
<if test="creator != null and creator != ''"> <if test="dto.creator != null and dto.creator != ''">
AND a.rec_user_name like AND a.rec_user_name like
CONCAT(CONCAT('%',#{creator}),'%') CONCAT(CONCAT('%',#{dto.creator}),'%')
</if> </if>
<if test="emergency != null and emergency != ''"> <if test="dto.emergency != null and dto.emergency != ''">
AND a.emergency_person like AND a.emergency_person like
CONCAT(CONCAT('%',#{emergency}),'%') CONCAT(CONCAT('%',#{dto.emergency}),'%')
</if> </if>
<if test="emergencyTimeStart != null "> <if test="dto.emergencyTimeStart != null ">
and #{emergencyTimeStart} <![CDATA[ <= ]]> and #{dto.emergencyTimeStart} <![CDATA[ <= ]]>
a.call_time a.call_time
</if> </if>
<if test="emergencyTimeEnd != null "> <if test="dto.emergencyTimeEnd != null ">
and a.call_time <![CDATA[ <= ]]> and a.call_time <![CDATA[ <= ]]>
#{emergencyTimeEnd} #{dto.emergencyTimeEnd}
</if> </if>
<if test="emergencyCall != null and emergencyCall != ''"> <if test="dto.emergencyCall != null and dto.emergencyCall != ''">
AND a.emergency_call like AND a.emergency_call like
CONCAT(CONCAT('%',#{emergencyCall}),'%') CONCAT(CONCAT('%',#{dto.emergencyCall}),'%')
</if> </if>
<if test="deviceId != null and deviceId != ''"> <if test="dto.deviceId != null and dto.deviceId != ''">
AND a.device_id like CONCAT(CONCAT('%',#{deviceId}),'%') AND a.device_id like CONCAT(CONCAT('%',#{dto.deviceId}),'%')
</if> </if>
<if test="elevatorAddress != null and elevatorAddress != ''"> <if test="dto.elevatorAddress != null and dto.elevatorAddress != ''">
AND ibjui.ADDRESS like AND ibjui.ADDRESS like
CONCAT(CONCAT('%',#{elevatorAddress}),'%') CONCAT(CONCAT('%',#{dto.elevatorAddress}),'%')
</if> </if>
<if test="district != null and district != ''"> <if test="dto.district != null and dto.district != ''">
AND a.district like AND a.district like
CONCAT(CONCAT('%',#{district}),'%') CONCAT(CONCAT('%',#{dto.district}),'%')
</if> </if>
<if test="alertType != null and alertType != ''"> <if test="dto.alertType != null and dto.alertType != ''">
AND a.alarm_type_code = #{alertType} AND a.alarm_type_code = #{dto.alertType}
</if> </if>
<if test="alertSource != null and alertSource != ''"> <if test="dto.alertSource != null and dto.alertSource != ''">
AND a.alert_source_code = #{alertSource} AND a.alert_source_code = #{dto.alertSource}
</if>
<if test="alertStage != null and alertStage != ''">
AND a.alert_stage_code = #{alertStage}
</if> </if>
<if test="alertStatus != null and alertStatus != ''"> <if test="dto.alertStage != null and dto.alertStage != ''">
AND a.alert_status = #{alertStatus} AND a.alert_stage_code = #{dto.alertStage}
</if> </if>
<if test="ids != null and ids.size>0"> <if test="dto.alertStatus != null and dto.alertStatus != ''">
AND a.sequence_nbr in AND a.alert_status = #{dto.alertStatus}
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
</if> </if>
ORDER BY ORDER BY a.call_time desc
</select>
<select id="getOrgCodeByCompanyCode" resultType="java.lang.String">
select org_code from privilege_company where company_code = #{companyCode} limit 1
</select> </select>
</mapper> </mapper>
......
...@@ -849,4 +849,18 @@ public class AlertCalledController extends BaseController { ...@@ -849,4 +849,18 @@ public class AlertCalledController extends BaseController {
public ResponseModel<Object> getCallRecords(@PathVariable Long id) { public ResponseModel<Object> getCallRecords(@PathVariable Long id) {
return ResponseHelper.buildResponse(iAlertCalledService.getCallRecords(id)); return ResponseHelper.buildResponse(iAlertCalledService.getCallRecords(id));
} }
@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<AlertCalledQueryDto>();
page.setCurrent(pageNum);
page.setSize(pageSize);
return ResponseHelper.buildResponse(iAlertCalledService.getAlertCalledRecords(page, alertCalledQueryDto, cityCode));
}
} }
...@@ -15,6 +15,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils; ...@@ -15,6 +15,7 @@ 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.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto; import com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto;
import com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto;
import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService; import com.yeejoin.amos.boot.module.common.api.service.ISourceFileService;
import com.yeejoin.amos.boot.module.elevator.api.dto.*; import com.yeejoin.amos.boot.module.elevator.api.dto.*;
import com.yeejoin.amos.boot.module.elevator.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.elevator.api.entity.AlertCalled;
...@@ -62,6 +63,7 @@ import java.time.LocalDateTime; ...@@ -62,6 +63,7 @@ import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.alibaba.fastjson.JSON.parseArray; import static com.alibaba.fastjson.JSON.parseArray;
...@@ -996,54 +998,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -996,54 +998,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return map; return map;
} }
public Object getFollowRecords(Long id) { private static Map<String, String> regionCodeOrgCodeMap = new ConcurrentHashMap<>();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
HashMap<String, Object> result = new HashMap<>();
ArrayList<Map<String, Object>> group = new ArrayList<>();
DispatchSaveFeedbackDto dispatchSaveFeedbackDto = dispatchPaperServiceImpl.getDispatchSaveFeedbackDtoByAlertId(id);
Map<String, Object> objectMap = Bean.BeantoMap(dispatchSaveFeedbackDto);
// 救援回访
HashMap<String, Object> rescueFollow = new HashMap<>();
List<FormValue> jsonData = getJsonData(rescueFollowJson);
jsonData.forEach(formValue -> {
Object o = objectMap.get(formValue.getKey());
if (!ObjectUtils.isEmpty(o)) {
formValue.setValue(o.toString());
}
});
rescueFollow.put("columns", 2);
rescueFollow.put("datas", jsonData);
rescueFollow.put("renderType", "basic");
rescueFollow.put("key", "rescueFollow");
rescueFollow.put("displayName", "救援回访");
group.add(rescueFollow);
// 维修反馈
HashMap<String, Object> repairFollow = new HashMap<>();
List<FormValue> repairJson = getJsonData(repairFollowJson);
repairJson.forEach(f -> {
Object o = objectMap.get(f.getKey());
if (!ObjectUtils.isEmpty(o)) {
f.setValue(o.toString());
if ("feedbackFinishTime".equals(f.getKey())) {
f.setValue(simpleDateFormat.format(dispatchSaveFeedbackDto.getFeedbackFinishTime()));
}
if ("fixResult".equals(f.getKey())) {
f.setValue(this.getBaseMapper().getDictName(dispatchSaveFeedbackDto.getFixResult()));
}
if ("errorResult".equals(f.getKey())) {
f.setValue(this.getBaseMapper().getDictName(dispatchSaveFeedbackDto.getErrorResult()));
}
}
});
repairFollow.put("columns", 2);
repairFollow.put("datas", repairJson);
repairFollow.put("renderType", "basic");
repairFollow.put("key", "repairFollow");
repairFollow.put("displayName", "维修反馈");
group.add(repairFollow);
result.put("subs", group);
return result;
}
public Object getDispatchRecord(Long id) { public Object getDispatchRecord(Long id) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -1193,7 +1148,60 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -1193,7 +1148,60 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
return map; return map;
} }
public Object getFollowRecords(Long id) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
HashMap<String, Object> result = new HashMap<>();
ArrayList<Map<String, Object>> group = new ArrayList<>();
DispatchSaveFeedbackDto dispatchSaveFeedbackDto = dispatchPaperServiceImpl.getDispatchSaveFeedbackDtoByAlertId(id);
Map<String, Object> objectMap = Bean.BeantoMap(dispatchSaveFeedbackDto);
// 救援回访
HashMap<String, Object> rescueFollow = new HashMap<>();
List<FormValue> jsonData = getJsonData(rescueFollowJson);
jsonData.forEach(formValue -> {
Object o = objectMap.get(formValue.getKey());
if (!ObjectUtils.isEmpty(o)) {
formValue.setValue(o.toString());
if ("saveFeedbackTime".equals(formValue.getKey())) {
formValue.setValue(simpleDateFormat.format(dispatchSaveFeedbackDto.getSaveFeedbackTime()));
}
}
});
rescueFollow.put("columns", 2);
rescueFollow.put("datas", jsonData);
rescueFollow.put("renderType", "basic");
rescueFollow.put("key", "rescueFollow");
rescueFollow.put("displayName", "救援回访");
group.add(rescueFollow);
// 维修反馈
HashMap<String, Object> repairFollow = new HashMap<>();
List<FormValue> repairJson = getJsonData(repairFollowJson);
repairJson.forEach(f -> {
Object o = objectMap.get(f.getKey());
if (!ObjectUtils.isEmpty(o)) {
f.setValue(o.toString());
if ("feedbackFinishTime".equals(f.getKey())) {
f.setValue(simpleDateFormat.format(dispatchSaveFeedbackDto.getFeedbackFinishTime()));
}
if ("fixResult".equals(f.getKey())) {
f.setValue(this.getBaseMapper().getDictName(dispatchSaveFeedbackDto.getFixResult()));
}
if ("errorResult".equals(f.getKey())) {
f.setValue(this.getBaseMapper().getDictName(dispatchSaveFeedbackDto.getErrorResult()));
}
}
});
repairFollow.put("columns", 2);
repairFollow.put("datas", repairJson);
repairFollow.put("renderType", "basic");
repairFollow.put("key", "repairFollow");
repairFollow.put("displayName", "维修反馈");
group.add(repairFollow);
result.put("subs", group);
return result;
}
public Object getDetail(Long id) { public Object getDetail(Long id) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
HashMap<String, Object> keyinfoData = new HashMap<>(); HashMap<String, Object> keyinfoData = new HashMap<>();
// 基本信息 // 基本信息
List<FormValue> jsonData = getJsonData(emergencyInformation); List<FormValue> jsonData = getJsonData(emergencyInformation);
...@@ -1204,9 +1212,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -1204,9 +1212,12 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
Object o = objectMap.get(f.getKey()); Object o = objectMap.get(f.getKey());
if (!ObjectUtils.isEmpty(o)) { if (!ObjectUtils.isEmpty(o)) {
f.setValue(o.toString()); f.setValue(o.toString());
if ("callTime".equals(f.getKey())){
f.setValue(simpleDateFormat.format(alertCalledFormVo.getAlertCalledDto().getCallTime()));
}
} }
dynamicFormAlert.add(f);
}); });
jsonData.addAll(dynamicFormAlert);
// 使用单位信息 // 使用单位信息
// 获取根据警情获取电梯信息 // 获取根据警情获取电梯信息
Map<String, Object> map = elevatorServiceImpl.selectByAlertId(id); Map<String, Object> map = elevatorServiceImpl.selectByAlertId(id);
...@@ -1260,13 +1271,31 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -1260,13 +1271,31 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
qrcode2.put("value", alertCalledFormVo.getAlertCalledDto().getDeviceId()); qrcode2.put("value", alertCalledFormVo.getAlertCalledDto().getDeviceId());
} }
datas.put("datas", records); datas.put("datas", records);
keyinfoData.put("keyParams", dynamicFormAlert); datas.put("title", "处置记录");
datas.put("renderType", "timeline");
keyinfoData.put("keyParams", jsonData);
keyinfoData.put("infoRecords", datas); keyinfoData.put("infoRecords", datas);
keyinfoData.put("qrcode", qrcode); keyinfoData.put("qrcode", qrcode);
keyinfoData.put("qrcode2", qrcode2); keyinfoData.put("qrcode2", qrcode2);
return keyinfoData; return keyinfoData;
} }
public Page<AlertCalledQueryDto> getAlertCalledRecords(Page<AlertCalledQueryDto> page, AlertCalledQueryDto alertCalledQueryDto, String cityCode){
String orgCode = getAndSetOrgCode(cityCode);
return alertCalledMapper.getAlertCalledRecords(page,alertCalledQueryDto, orgCode);
}
public String getAndSetOrgCode(String cityCode) {
String orgCode = regionCodeOrgCodeMap.get(cityCode);
if (orgCode == null) {
orgCode = this.getBaseMapper().getOrgCodeByCompanyCode(cityCode);
if (orgCode != null) {
regionCodeOrgCodeMap.put(cityCode, orgCode);
}
}
return orgCode;
}
private List<FormValue> getJsonData(Resource resource) { private List<FormValue> getJsonData(Resource resource) {
String json; String json;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"type": "text" "type": "text"
}, },
{ {
"key": "feedbackFinishTime", "key": "saveFeedbackTime",
"label": "回访时间", "label": "回访时间",
"type": "text" "type": "text"
}, },
......
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