Commit c1e83b30 authored by H2T's avatar H2T

通话记录表添加警情状态和code字段,警情报送显示多提添加警情修改记录表

parent 9346e468
......@@ -45,4 +45,16 @@ public class VoiceRecordLog extends BaseEntity {
@TableField("deal_times")
private Integer dealTimes;
/**
* 警情阶段code
*/
@TableField("alert_stage_code")
private String alertStageCode;
/**
* 警情阶段
*/
@TableField("alert_stage")
private String alertStage;
}
......@@ -164,7 +164,7 @@ public class AlertCalledController extends BaseController {
alertFormRecordDto.setInjuredNum(Integer.parseInt(formMap.getOrDefault("injured_num", "0")));
alertFormRecordDto.setDieNum(Integer.parseInt(formMap.getOrDefault("die_num", "0")));
alertFormRecordDto.setTrappedFloorNum(Integer.parseInt(formMap.getOrDefault("trapped_floor_num", "0")));
alertFormRecordDto.setIsLight("是".equals(formMap.get("is_light")) ? 1 : 0);
alertFormRecordDto.setIsLight("是".equals(formMap.getOrDefault("is_light","是")) ? 1 : 0);
alertFormRecordDto.setDescription((String) formMap.getOrDefault("desc", ""));
alertFormRecordDto.setSourcesInfo(SourcesInfoEnum.Submit.getCode().toString());
alertFormRecordService.saveAlertFormRecord(alertFormRecordDto);
......
......@@ -180,14 +180,17 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
}
} else {
if (Boolean.TRUE.equals(rescueProcessDto.getCasualtiesStatus())){
updateMessage(rescueProcessDto, "injured_num");
updateMessage(rescueProcessDto, "die_num");
try {
//更新警情历史记录表
AlertCalledFormDto calledFormDto = iAlertCalledService.getAlertCalledFormDto(rescueProcessDto.getAlertId());
List<FormValue> dynamicFormAlert = calledFormDto.getDynamicFormAlert();
HashMap<String, String> formMap = new HashMap<>();
dynamicFormAlert.forEach(x->formMap.put(x.getKey(),x.getValue()));
if (!formMap.get("injured_num").equals(rescueProcessDto.getCasualtiesInfo()) || !formMap.get("die_num").equals(rescueProcessDto.getDieNum())){
//更新动态表单
updateMessage(rescueProcessDto, "injured_num");
updateMessage(rescueProcessDto, "die_num");
AlertCalledDto alertCalledDto = calledFormDto.getAlertCalledDto();
AlertFormRecordDto alertFormRecordDto = new AlertFormRecordDto();
alertFormRecordDto.setAlertCalledId(rescueProcessDto.getAlertId());
......@@ -201,7 +204,9 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
alertFormRecordDto.setInjuredNum(Integer.valueOf(rescueProcessDto.getCasualtiesInfo()));
alertFormRecordDto.setDieNum(Integer.valueOf(rescueProcessDto.getDieNum()));
alertFormRecordDto.setSourcesInfo(SourcesInfoEnum.Process.getCode().toString());
alertFormRecordDto.setIsLight("是".equals(formMap.getOrDefault("is_light", "是"))? 1 : 0);
alertFormRecordService.saveAlertFormRecord(alertFormRecordDto);
}
}catch (Exception e){
e.printStackTrace();
}
......
......@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.elevator.biz.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.elevator.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.elevator.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.elevator.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.elevator.api.dto.VoiceRecordFileDto;
......@@ -73,12 +74,16 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,V
@Override
public void publishRecord(final VoiceRecordFileDto model) {
AlertCalledFormDto alertCalledFormDto = iAlertCalledService.getAlertCalledFormDto(model.getAlertId());
AlertCalledDto alertCalledDto = alertCalledFormDto.getAlertCalledDto();
// 保存到日志表中
VoiceRecordLog log = new VoiceRecordLog();
log.setAlertId(model.getAlertId());
log.setConnectId(model.getConnectId());
log.setIsDeal(false);
log.setDealTimes(0);
log.setAlertStage(alertCalledDto.getAlertStage());
log.setAlertStageCode(alertCalledDto.getAlertStageCode());
iVoiceRecordLogServiceImpl.save(log);
}
......
......@@ -143,13 +143,13 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
for(Map.Entry<String,String> file : downloadFile.entrySet()) {
model.setFilePath(file.getKey());
}
AlertCalledFormDto alertDto = iAlertCalledService.selectAlertCalledByIdNoCache(model.getAlertId());
if(alertDto == null || alertDto.getAlertCalledDto() == null) {
this.updateById(l);
continue;
}
model.setAlertStage(alertDto.getAlertCalledDto().getAlertStage());
model.setAlertStageCode(alertDto.getAlertCalledDto().getAlertStageCode());
// AlertCalledFormDto alertDto = iAlertCalledService.selectAlertCalledByIdNoCache(model.getAlertId());
// if(alertDto == null || alertDto.getAlertCalledDto() == null) {
// this.updateById(l);
// continue;
// }
model.setAlertStage(l.getAlertStage());
model.setAlertStageCode(l.getAlertStageCode());
model.setSourceId(-1l);
voiceRecordFileServiceImpl.createWithModel(model);
JSONObject json = new JSONObject();
......
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