|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.biutag.supervision.controller.work; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
@ -9,8 +10,10 @@ import com.biutag.supervision.pojo.entity.AlarmNotification;
|
|
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
|
import com.biutag.supervision.pojo.enums.NotificationType; |
|
|
|
|
import com.biutag.supervision.pojo.param.AlarmParam; |
|
|
|
|
import com.biutag.supervision.service.AlarmFileService; |
|
|
|
|
import com.biutag.supervision.service.AlarmNotificationService; |
|
|
|
|
import com.biutag.supervision.service.SupDepartService; |
|
|
|
|
import com.biutag.supervision.util.JSON; |
|
|
|
|
import jakarta.validation.Valid; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
@ -35,6 +38,8 @@ public class AlarmNotificationController {
|
|
|
|
|
|
|
|
|
|
private final AlarmNotificationService notificationService; |
|
|
|
|
|
|
|
|
|
private final AlarmFileService alarmFileService; |
|
|
|
|
|
|
|
|
|
private final SupDepartService departService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -72,6 +77,17 @@ public class AlarmNotificationController {
|
|
|
|
|
if(!res) { |
|
|
|
|
return Result.failed(5000, "回复失败"); |
|
|
|
|
} |
|
|
|
|
if (CollectionUtil.isNotEmpty(data.getReplyFiles())) { |
|
|
|
|
List<AlarmFile> files = data.getReplyFiles().stream().map(item -> { |
|
|
|
|
AlarmFile alarmFile = new AlarmFile(); |
|
|
|
|
alarmFile.setAlarmId(data.getId()); |
|
|
|
|
alarmFile.setFileName(item.getFileName()); |
|
|
|
|
alarmFile.setPath(item.getFilePath()); |
|
|
|
|
alarmFile.setCrtTime(LocalDateTime.now()); |
|
|
|
|
return alarmFile; |
|
|
|
|
}).toList(); |
|
|
|
|
alarmFileService.saveBatch(files); |
|
|
|
|
} |
|
|
|
|
return Result.success(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|