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