新增管理全周期,文件ID
parent
29edabb199
commit
0933f0fbbb
|
|
@ -11,6 +11,7 @@ import jakarta.validation.constraints.NotNull;
|
|||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WholeCycleVo {
|
||||
|
|
@ -43,10 +44,18 @@ public class WholeCycleVo {
|
|||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
|
||||
private Date dispatchTime;
|
||||
|
||||
@Schema(description = "调度规程文件Id集合")
|
||||
private List<Long> dispatchFileIds;
|
||||
|
||||
@Schema(description = "应急预案文件Id集合")
|
||||
private List<Long> emergencyFileIds;
|
||||
|
||||
|
||||
@Schema(description="应急预案")
|
||||
// @Size(max = 0,message = "批复时间最大长度要小于 0")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
|
||||
private Date emergencyTime;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ public class ResPlanB implements Serializable {
|
|||
|
||||
@TableField(value = "is_available")
|
||||
@Schema(description = "是否有效 0 无效 1有效")
|
||||
private Integer isAvailable;
|
||||
private Integer isAvailable = 1;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class WholeCycleService {
|
||||
|
|
@ -26,6 +29,9 @@ public class WholeCycleService {
|
|||
@Autowired
|
||||
private ResPlanBService resPlanBService;//type 1 防汛预案 type2 调度规程
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
|
||||
public WholeCycleVo get() {
|
||||
WholeCycleVo res = new WholeCycleVo();
|
||||
|
|
@ -77,7 +83,9 @@ public class WholeCycleService {
|
|||
}else{
|
||||
res.setDispatchTime(dispatcher.getPrepTime());
|
||||
}
|
||||
|
||||
List<FileAssociations> dispatcherFile = fileService.getFiles("ResPlanB", dispatcher.getId().toString());
|
||||
List<Long> dispatcherIds = dispatcherFile.stream().map(o -> o.getFileId()).collect(Collectors.toList());
|
||||
res.setDispatchFileIds(dispatcherIds);
|
||||
//应急预案
|
||||
ResPlanB emergency = resPlanBService.lambdaQuery().eq(ResPlanB::getType, 1).eq(ResPlanB::getIsAvailable, 1).orderByDesc(ResPlanB::getPrepTime).last("limit 1").one();
|
||||
if(emergency == null){
|
||||
|
|
@ -85,6 +93,9 @@ public class WholeCycleService {
|
|||
}else{
|
||||
res.setEmergencyTime(emergency.getPrepTime());
|
||||
}
|
||||
List<FileAssociations> emergencyFile = fileService.getFiles("ResPlanB", emergency.getId().toString());
|
||||
List<Long> emergencyFileIds = emergencyFile.stream().map(o -> o.getFileId()).collect(Collectors.toList());
|
||||
res.setEmergencyFileIds(emergencyFileIds);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue