parent
0933f0fbbb
commit
c384d2c74c
|
|
@ -28,6 +28,11 @@ public class FundBudgetController extends AbstractCommonFileController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileAssociationsService fileService;
|
private FileAssociationsService fileService;
|
||||||
|
|
||||||
|
@Operation(description = "根据年份查询")
|
||||||
|
@GetMapping("/get/{year}")
|
||||||
|
public R<FundBudget> get(@PathVariable("year") String year){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Operation(description = "分页")
|
@Operation(description = "分页")
|
||||||
@PostMapping("/page")
|
@PostMapping("/page")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.gunshi.project.ss.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.file.model.FileDescriptor;
|
||||||
|
import com.gunshi.file.model.FileDescriptorAutoMapper;
|
||||||
|
import com.gunshi.file.service.MinioService;
|
||||||
|
import com.gunshi.project.ss.entity.vo.ImgVo;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Tag(name = "大屏-管理用房-图片")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(value="/screen/manageHouseImg")
|
||||||
|
public class ManageHouseImgController extends AbstractCommonFileController{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FileDescriptorAutoMapper fileDescriptorAutoMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MinioService minioService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
public R<ImgVo> get(){
|
||||||
|
LambdaQueryWrapper<FileDescriptor> queryWrapper = new LambdaQueryWrapper<FileDescriptor>();
|
||||||
|
queryWrapper.eq(FileDescriptor::getGroupId,getGroupId());
|
||||||
|
List<FileDescriptor> list = fileDescriptorAutoMapper.selectList(queryWrapper);
|
||||||
|
ImgVo imgVo = new ImgVo();
|
||||||
|
imgVo.setFiles(list);
|
||||||
|
return R.ok(imgVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/del/{id}")
|
||||||
|
public R<Boolean> del(@PathVariable("id") String id){
|
||||||
|
LambdaQueryWrapper<FileDescriptor> queryWrapper = new LambdaQueryWrapper<FileDescriptor>();
|
||||||
|
queryWrapper.eq(FileDescriptor::getGroupId,getGroupId());
|
||||||
|
queryWrapper.eq(FileDescriptor::getFileId,id);
|
||||||
|
FileDescriptor fileDescriptor = fileDescriptorAutoMapper.selectOne(queryWrapper);
|
||||||
|
if(fileDescriptor != null){
|
||||||
|
try {
|
||||||
|
minioService.delete("gs-ss",fileDescriptor.getFilePath());
|
||||||
|
fileDescriptorAutoMapper.delete(queryWrapper);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGroupId() {
|
||||||
|
return "manageHouseImg";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.gunshi.project.ss.entity.vo;
|
||||||
|
|
||||||
|
import com.gunshi.file.model.FileDescriptor;
|
||||||
|
import com.gunshi.project.ss.model.FileAssociations;
|
||||||
|
import jakarta.validation.constraints.PositiveOrZero;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ImgVo {
|
||||||
|
|
||||||
|
|
||||||
|
private List<FileDescriptor> files;
|
||||||
|
}
|
||||||
|
|
@ -45,10 +45,10 @@ public class WholeCycleVo {
|
||||||
private Date dispatchTime;
|
private Date dispatchTime;
|
||||||
|
|
||||||
@Schema(description = "调度规程文件Id集合")
|
@Schema(description = "调度规程文件Id集合")
|
||||||
private List<Long> dispatchFileIds;
|
private List<String> dispatchFileIds;
|
||||||
|
|
||||||
@Schema(description = "应急预案文件Id集合")
|
@Schema(description = "应急预案文件Id集合")
|
||||||
private List<Long> emergencyFileIds;
|
private List<String> emergencyFileIds;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description="应急预案")
|
@Schema(description="应急预案")
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ public class WholeCycleService {
|
||||||
res.setDispatchTime(dispatcher.getPrepTime());
|
res.setDispatchTime(dispatcher.getPrepTime());
|
||||||
}
|
}
|
||||||
List<FileAssociations> dispatcherFile = fileService.getFiles("ResPlanB", dispatcher.getId().toString());
|
List<FileAssociations> dispatcherFile = fileService.getFiles("ResPlanB", dispatcher.getId().toString());
|
||||||
List<Long> dispatcherIds = dispatcherFile.stream().map(o -> o.getFileId()).collect(Collectors.toList());
|
List<String> dispatcherIds = dispatcherFile.stream().map(o -> o.getFileId().toString()).collect(Collectors.toList());
|
||||||
res.setDispatchFileIds(dispatcherIds);
|
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();
|
||||||
|
|
@ -94,7 +94,7 @@ public class WholeCycleService {
|
||||||
res.setEmergencyTime(emergency.getPrepTime());
|
res.setEmergencyTime(emergency.getPrepTime());
|
||||||
}
|
}
|
||||||
List<FileAssociations> emergencyFile = fileService.getFiles("ResPlanB", emergency.getId().toString());
|
List<FileAssociations> emergencyFile = fileService.getFiles("ResPlanB", emergency.getId().toString());
|
||||||
List<Long> emergencyFileIds = emergencyFile.stream().map(o -> o.getFileId()).collect(Collectors.toList());
|
List<String> emergencyFileIds = emergencyFile.stream().map(o -> o.getFileId().toString()).collect(Collectors.toList());
|
||||||
res.setEmergencyFileIds(emergencyFileIds);
|
res.setEmergencyFileIds(emergencyFileIds);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue