Commit 19c5eb98 authored by lisong's avatar lisong

添加字段

parent 83f735df
......@@ -69,9 +69,13 @@ public class RescueProcessDto extends BaseDto {
@ApiModelProperty(value = "是否伤亡")
private Boolean casualtiesStatus;
@ApiModelProperty(value = "伤亡情况")
@ApiModelProperty(value = "受伤人数")
private String casualtiesInfo;
@ApiModelProperty(value = "死亡人数")
private String dieNum;
@ApiModelProperty(value = "是否救援成功")
private Boolean rescueStatus;
......
......@@ -89,12 +89,18 @@ public class RescueProcess extends BaseEntity {
private Boolean casualtiesStatus;
/**
* 伤亡情况
* 受伤人数
*/
@TableField("casualties_info")
private String casualtiesInfo;
/**
* 死亡人数
*/
@TableField("die_num")
private String dieNum;
/**
* 是否救援成功
*/
@TableField("rescue_status")
......
package com.yeejoin.amos.boot.module.elevator.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
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.elevator.api.dto.DispatchPaperFormDto;
import com.yeejoin.amos.boot.module.elevator.api.dto.DispatchTaskDto;
import com.yeejoin.amos.boot.module.elevator.api.dto.RescueProcessDto;
......@@ -60,6 +63,8 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
@Autowired
AlertCalledServiceImpl iAlertCalledService;
@Autowired
RedisUtils redisUtils;
/**
* 分页查询
*/
......@@ -173,6 +178,11 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchTask.getAlertId(),"PQ", dispatchTask.getSequenceNbr(),sendUser);
}
} else {
if (Boolean.TRUE.equals(rescueProcessDto.getCasualtiesStatus())){
updateMessage(rescueProcessDto, "injured_num");
updateMessage(rescueProcessDto, "die_num");
redisUtils.del(RedisKey.TZS_ALERTCALLED_ID+rescueProcessDto.getAlertId());
}
rescueProcessDto.setDispatchTime(null);
rescueProcessDto.setDispatchStatus(null);
rescueProcessDto.setDispatchUserId(null);
......@@ -253,6 +263,19 @@ public class RescueProcessServiceImpl extends BaseService<RescueProcessDto,Rescu
return flag;
}
private void updateMessage(RescueProcessDto rescueProcessDto, String fieldCode){
LambdaQueryWrapper<AlertFormValue> lambda = new QueryWrapper<AlertFormValue>().lambda();
lambda.eq(AlertFormValue::getAlertCalledId, rescueProcessDto.getAlertId());
lambda.eq(AlertFormValue::getFieldCode, fieldCode);
List<AlertFormValue> alertFormValues = iAlertFormValueService.getBaseMapper().selectList(lambda);
AlertFormValue alertFormValue = alertFormValues.get(0);
if ("die_num".equals(fieldCode)){
alertFormValue.setFieldValue(rescueProcessDto.getDieNum());
}else {
alertFormValue.setFieldValue(rescueProcessDto.getCasualtiesInfo());
}
iAlertFormValueService.updateById(alertFormValue);
}
@Override
public Boolean updateByAlertId(RescueProcessDto rescueProcessDto) {
QueryWrapper<RescueProcess> templateQueryWrapper = new QueryWrapper<>();
......
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