master
parent
cac3a422ab
commit
6ecaa362b9
|
|
@ -1,5 +1,5 @@
|
|||
$src="./target/gunshi-project-xyt-1.0-SNAPSHOT.jar"
|
||||
$dst_dir="~/gunshiApp/tsg"
|
||||
$src="./target/gunshi-project-hsz-1.0-SNAPSHOT.jar"
|
||||
$dst_dir="~/gunshiApp/hsz"
|
||||
$dst_host="10.0.41.112"
|
||||
$dst_port=22
|
||||
$user="root"
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
services:
|
||||
xyt:
|
||||
hsz:
|
||||
image: openjdk:21
|
||||
container_name: tsg
|
||||
container_name: hsz
|
||||
restart: no
|
||||
network_mode: host
|
||||
volumes:
|
||||
- /root/gunshiApp/xyt:/app
|
||||
- /root/gunshiApp/hsz:/app
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
environment:
|
||||
- SPRING_PROFILES_ACTIVE=dev
|
||||
- TZ=Asia/Shanghai
|
||||
command: java -jar /app/gunshi-project-xyt-1.0-SNAPSHOT.jar
|
||||
command: java -jar /app/gunshi-project-hsz-1.0-SNAPSHOT.jar
|
||||
4
pom.xml
4
pom.xml
|
|
@ -10,7 +10,7 @@
|
|||
<version>1.4-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>gunshi-project-xyt</artifactId>
|
||||
<artifactId>gunshi-project-hsz</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<description>
|
||||
麻城小玉潭水库系统
|
||||
|
|
@ -231,7 +231,7 @@
|
|||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<mainClass>com.gunshi.project.xyt.Main</mainClass>
|
||||
<mainClass>com.gunshi.project.hsz.Main</mainClass>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package com.gunshi.project.hsz;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.conf.EnableMPP;
|
||||
import com.gunshi.core.annotation.GunShiApplication;
|
||||
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
|
||||
import io.swagger.v3.oas.annotations.servers.Server;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
|
||||
@OpenAPIDefinition(
|
||||
servers = {
|
||||
@Server(
|
||||
url = "http://localhost:24105/gunshiApp/hsz",
|
||||
description = "本地测试环境"
|
||||
),
|
||||
@Server(
|
||||
url = "http://local.gunshiiot.com:18083/gunshiApp/hsz",
|
||||
description = "线上测试环境"
|
||||
)
|
||||
}
|
||||
)
|
||||
@GunShiApplication
|
||||
@MapperScan(basePackages = {"com.gunshi.**.mapper", "com.gunshi.**.model"})
|
||||
@Slf4j
|
||||
@EnableMPP
|
||||
@EnableCaching
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Main.class, args);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.gunshi.project.hsz.config;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.core.result.exception.ressolver.E500UnknownExceptionResolver;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/7/10.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@RestControllerAdvice
|
||||
@Order
|
||||
@Slf4j
|
||||
public class MyE500UnknownExceptionResolver extends E500UnknownExceptionResolver {
|
||||
|
||||
public R<String> resolve(Exception exception) {
|
||||
log.error("系统未知异常,错误信息: " + exception.getMessage(), exception);
|
||||
if (exception instanceof AccessDeniedException || exception.getMessage().contains("获取用户信息异常")) {
|
||||
return R.error(405, "登录状态失效,请重新登录");
|
||||
}
|
||||
return R.error(500, "系统未知异常,错误信息: " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.gunshi.project.hsz.config;
|
||||
|
||||
import org.springdoc.core.models.GroupedOpenApi;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by wanyan on 2024/7/8
|
||||
*
|
||||
* @author wanyan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Configuration
|
||||
public class OpenApiConfig {
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi openApi() {
|
||||
String[] packagesToScan = {
|
||||
"com.gunshi.project.hsz.controller",
|
||||
};
|
||||
return GroupedOpenApi.builder()
|
||||
.group("hsz")
|
||||
.packagesToScan(packagesToScan)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.GunShiCoreProperties;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.core.session.entity.SessionUser;
|
||||
import com.gunshi.file.model.FileDescriptor;
|
||||
import com.gunshi.file.service.IFileService;
|
||||
import com.gunshi.file.service.LoginFileService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 类描述
|
||||
*
|
||||
* @author lyf
|
||||
* @version 1.0.0
|
||||
* @since 2024-03-12
|
||||
*/
|
||||
public abstract class AbstractCommonFileController implements ICommonFileController {
|
||||
|
||||
@Override
|
||||
public R<FileDescriptor> uploadSingle(MultipartFile file, String groupId, String businessType, Long userId, HttpServletRequest request) throws Exception {
|
||||
return ICommonFileController.super.uploadSingle(file, getGroupId(), getBusinessType(), userId, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个文件上传
|
||||
*
|
||||
* @param file 文件
|
||||
* @param userId 上传者userId
|
||||
*/
|
||||
@Operation(summary = "单个文件上传,不需要groupId和businessType")
|
||||
@PostMapping(path = "/file/upload/singleSimple", consumes = "multipart/form-data")
|
||||
@Override
|
||||
public R<FileDescriptor> uploadSingle(
|
||||
@Parameter(description = "文件") @RequestPart("file") MultipartFile file,
|
||||
@Parameter(description = "上传者用户id", hidden = true) @RequestParam(value = "userId", required = false) Long userId,
|
||||
@Parameter(hidden = true) HttpServletRequest request) throws Exception {
|
||||
|
||||
if (userId == null) {
|
||||
SessionUser sessionUser = checkLogin(request);
|
||||
if (sessionUser == null) {
|
||||
return R.error(400, "未登录", null);
|
||||
}
|
||||
userId = sessionUser.getUserId();
|
||||
}
|
||||
|
||||
FileDescriptor fd = new FileDescriptor();
|
||||
fd.setBusinessType(getBusinessType());
|
||||
fd.setGroupId(getGroupId());
|
||||
fd.setUserId(userId);
|
||||
fd.setAccessGroup(getService().getAccessGroup());
|
||||
fd.setFilePath(generateFilePath(getProperty().getAppCode(), getBusinessType(), userId, getGroupId(), file.getOriginalFilename()));
|
||||
fd.setFileName(file.getOriginalFilename());
|
||||
fd.setFileLength(file.getSize());
|
||||
|
||||
getService().upload(fd, file.getInputStream());
|
||||
|
||||
return R.ok(fd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBusinessType() {
|
||||
return "common";
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private LoginFileService service;
|
||||
|
||||
@Autowired
|
||||
private GunShiCoreProperties properties;
|
||||
|
||||
// @Autowired
|
||||
// private BaseSessionService sessionService;
|
||||
|
||||
@Override
|
||||
public IFileService getService() {
|
||||
return service;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SessionUser checkLogin(HttpServletRequest request) {
|
||||
// String token = sessionService.getToken(request);
|
||||
// return sessionService.getSessionUser(token);
|
||||
SessionUser user = new SessionUser();
|
||||
user.setUserId(1L);
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GunShiCoreProperties getProperty() {
|
||||
return properties;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.AppVersionRecord;
|
||||
import com.gunshi.project.hsz.service.AppVersionRecordService;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 描述: APP版本记录
|
||||
* author: xusan
|
||||
* date: 2024-11-12 10:14:50
|
||||
*/
|
||||
@Tag(name = "APP版本记录")
|
||||
@RestController
|
||||
@RequestMapping(value="/appVersionRecord")
|
||||
public class AppVersionRecordController {
|
||||
|
||||
@Autowired
|
||||
private AppVersionRecordService service;
|
||||
|
||||
@PostMapping("/upload")
|
||||
public R upload(@RequestParam("file") MultipartFile file, @RequestParam("version") String version, @RequestParam("versionDesc") String versionDesc) throws Exception
|
||||
{
|
||||
Map<String,String> map = new HashMap<>();
|
||||
if (!file.isEmpty())
|
||||
{
|
||||
String url = FileUploadUtils.upload(RuoYiConfig.getUploadPath(),file,null);
|
||||
if (service.insertData(version,versionDesc,url))
|
||||
{
|
||||
map.put("url", url);
|
||||
return R.ok(map);
|
||||
}
|
||||
}
|
||||
return R.error(400,"上传失败");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "最新记录")
|
||||
@GetMapping("/latest")
|
||||
public R<AppVersionRecord> latest() {
|
||||
return R.ok(service.getLatest());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.AssessCategory;
|
||||
import com.gunshi.project.hsz.service.AssessCategoryService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 考核类目
|
||||
* author: xusan
|
||||
* date: 2024-09-03 17:46:30
|
||||
*/
|
||||
@Tag(name = "考核类目")
|
||||
@RestController
|
||||
@RequestMapping(value="/assessCategory")
|
||||
public class AssessCategoryController {
|
||||
|
||||
@Autowired
|
||||
private AssessCategoryService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AssessCategory> insert(@Validated(Insert.class) @RequestBody AssessCategory dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AssessCategory> update(@Validated(Update.class) @RequestBody AssessCategory dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<AssessCategory>> list() {
|
||||
return R.ok(service.lambdaQuery().orderByAsc(AssessCategory::getOrderIndex).list());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.dto.InspectItemDto;
|
||||
import com.gunshi.project.hsz.entity.so.AttCctvBasePage;
|
||||
import com.gunshi.project.hsz.model.AssessIndicator;
|
||||
import com.gunshi.project.hsz.service.AssessIndicatorService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
/**
|
||||
* 描述: 考核指标
|
||||
* author: xusan
|
||||
* date: 2024-09-03 17:46:56
|
||||
*/
|
||||
@Tag(name = "考核指标")
|
||||
@RestController
|
||||
@RequestMapping(value="/assessIndicator")
|
||||
public class AssessIndicatorController {
|
||||
|
||||
@Autowired
|
||||
private AssessIndicatorService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AssessIndicator> insert(@Validated(Insert.class) @RequestBody AssessIndicator dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AssessIndicator> update(@Validated(Update.class) @RequestBody AssessIndicator dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "启停")
|
||||
@PostMapping("/startStop")
|
||||
public R<String> startStop(@RequestBody InspectItemDto dto) {
|
||||
return R.ok(service.startStop(dto));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<AssessIndicator>> page(@RequestBody @Validated AttCctvBasePage page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
@Operation(summary = "选择指标")
|
||||
@PostMapping("/choose")
|
||||
public R<Page<AssessIndicator>> choosePage(@RequestBody @Validated AttCctvBasePage page) {
|
||||
return R.ok(service.choosePage(page));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.db.dto.MonthRangeSo;
|
||||
import com.gunshi.project.hsz.entity.so.AssessTaskPageSo;
|
||||
import com.gunshi.project.hsz.entity.vo.AssessResultVo;
|
||||
import com.gunshi.project.hsz.model.AssessTask;
|
||||
import com.gunshi.project.hsz.service.AssessTaskService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 描述: 考核任务
|
||||
* author: xusan
|
||||
* date: 2024-09-05 14:19:04
|
||||
*/
|
||||
@Tag(name = "考核任务")
|
||||
@RestController
|
||||
@RequestMapping(value="/assessTask")
|
||||
public class AssessTaskController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private AssessTaskService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AssessTask> insert(@Validated(Insert.class) @RequestBody AssessTask dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AssessTask> update(@Validated(Update.class) @RequestBody AssessTask dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "详情")
|
||||
@GetMapping("/detail/{id}")
|
||||
public R<AssessTask> detail(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.detail(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "考核任务清单")
|
||||
@PostMapping("/list/page")
|
||||
public R<Page<AssessTask>> listPage(@Validated @RequestBody AssessTaskPageSo page) {
|
||||
return R.ok(service.listPage(page));
|
||||
}
|
||||
|
||||
@Operation(summary = "启动")
|
||||
@GetMapping("/start/{id}")
|
||||
public R<String> start(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.start(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "我的待办")
|
||||
@PostMapping("/myTodo/page")
|
||||
public R<Page<AssessTask>> myTodo(@Validated @RequestBody AssessTaskPageSo page) {
|
||||
return R.ok(service.myTodo(page));
|
||||
}
|
||||
|
||||
@Operation(summary = "我的已办")
|
||||
@PostMapping("/myDone/page")
|
||||
public R<Page<AssessTask>> myDone(@Validated @RequestBody AssessTaskPageSo page) {
|
||||
return R.ok(service.myDone(page));
|
||||
}
|
||||
|
||||
@Operation(summary = "审核通过")
|
||||
@GetMapping("/pass/{id}")
|
||||
public R<String> pass(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.pass(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "作废")
|
||||
@GetMapping("/cancel/{id}")
|
||||
public R<String> cancel(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.cancel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "驳回评分")
|
||||
@GetMapping("/reject/{id}")
|
||||
public R<String> reject(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.reject(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "考核结果")
|
||||
@GetMapping("/result/{id}")
|
||||
public R<List<AssessResultVo>> result(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.result(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "考核结果导出")
|
||||
@GetMapping("/result/export")
|
||||
public void resultExport(@RequestParam("id") @Parameter(description = "考核任务id") Long id, HttpServletResponse response) {
|
||||
service.resultExport(id,response);
|
||||
}
|
||||
|
||||
@Operation(summary = "人员考核结果")
|
||||
@PostMapping("/result/stat")
|
||||
public R<List<AssessTask>> resultStat(@Validated @RequestBody MonthRangeSo monthRangeSo) {
|
||||
return R.ok(service.resultStat(monthRangeSo));
|
||||
}
|
||||
|
||||
@Operation(summary = "等级统计")
|
||||
@PostMapping("/level/stat")
|
||||
public R<Map<Integer,Long>> levelStat(@Validated @RequestBody MonthRangeSo monthRangeSo) {
|
||||
return R.ok(service.levelStat(monthRangeSo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "assessTask";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.db.dto.MonthRangeSo;
|
||||
import com.gunshi.project.hsz.entity.so.AssessTaskPageSo;
|
||||
import com.gunshi.project.hsz.entity.vo.AssessRatingVo;
|
||||
import com.gunshi.project.hsz.entity.vo.AssessRectifyVo;
|
||||
import com.gunshi.project.hsz.entity.vo.AssessScoreVo;
|
||||
import com.gunshi.project.hsz.model.AssessTeamRating;
|
||||
import com.gunshi.project.hsz.service.AssessTeamRatingService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 描述: 考核评分详情
|
||||
* author: xusan
|
||||
* date: 2024-09-05 14:20:04
|
||||
*/
|
||||
@Tag(name = "考核评分详情")
|
||||
@RestController
|
||||
@RequestMapping(value="/assessTeamRating")
|
||||
public class AssessTeamRatingController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private AssessTeamRatingService service;
|
||||
|
||||
|
||||
@Operation(summary = "完成评分")
|
||||
@PostMapping("/score")
|
||||
public R<Boolean> score(@Validated @RequestBody AssessScoreVo vo) {
|
||||
return R.ok(service.score(vo));
|
||||
}
|
||||
|
||||
@Operation(summary = "保存评分")
|
||||
@PostMapping("/saveScore")
|
||||
public R<Boolean> saveScore(@Validated @RequestBody AssessScoreVo vo) {
|
||||
return R.ok(service.saveScore(vo));
|
||||
}
|
||||
|
||||
@Operation(summary = "我的待办/已办-查看评分详情")
|
||||
@GetMapping("/do/detail/{teamId}")
|
||||
public R<List<AssessRatingVo>> doDetail(@Schema(name = "teamId") @PathVariable("teamId") Long teamId) {
|
||||
return R.ok(service.doDetail(teamId));
|
||||
}
|
||||
|
||||
@Operation(summary = "考核任务清单-查看评分详情")
|
||||
@GetMapping("/scoreDetail/{objectId}")
|
||||
public R<Map<Long,List<AssessRatingVo>>> scoreDetail(@Schema(name = "objectId") @PathVariable("objectId") Long objectId) {
|
||||
return R.ok(service.scoreDetail(objectId));
|
||||
}
|
||||
|
||||
@Operation(summary = "考核问题整改")
|
||||
@PostMapping("/list/page")
|
||||
public R<Page<AssessRectifyVo>> listPage(@Validated @RequestBody AssessTaskPageSo page) {
|
||||
return R.ok(service.listPage(page));
|
||||
}
|
||||
|
||||
@Operation(summary = "整改")
|
||||
@PostMapping("/rectify")
|
||||
public R<String> rectify(@Validated @RequestBody AssessTeamRating rating) {
|
||||
return R.ok(service.rectify(rating));
|
||||
}
|
||||
|
||||
@Operation(summary = "整改统计")
|
||||
@PostMapping("/rectify/stat")
|
||||
public R<Map<Integer,Long>> rectifyStat(@Validated @RequestBody MonthRangeSo monthRangeSo) {
|
||||
return R.ok(service.rectifyStat(monthRangeSo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "assessTeamRating";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.dto.InspectItemDto;
|
||||
import com.gunshi.project.hsz.entity.so.AttCctvBasePage;
|
||||
import com.gunshi.project.hsz.model.AssessIndicator;
|
||||
import com.gunshi.project.hsz.model.AssessTemplate;
|
||||
import com.gunshi.project.hsz.service.AssessTemplateService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 考核模板
|
||||
* author: xusan
|
||||
* date: 2024-09-04 13:42:40
|
||||
*/
|
||||
@Tag(name = "考核模板")
|
||||
@RestController
|
||||
@RequestMapping(value="/assessTemplate")
|
||||
public class AssessTemplateController {
|
||||
|
||||
@Autowired
|
||||
private AssessTemplateService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AssessTemplate> insert(@Validated(Insert.class) @RequestBody AssessTemplate dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AssessTemplate> update(@Validated(Update.class) @RequestBody AssessTemplate dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "启停")
|
||||
@PostMapping("/startStop")
|
||||
public R<String> startStop(@RequestBody InspectItemDto dto) {
|
||||
return R.ok(service.startStop(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/listByType/{templateFreq}")
|
||||
public R<List<AssessTemplate>> listByType(@Schema(name = "templateFreq") @PathVariable("templateFreq") Integer templateFreq) {
|
||||
return R.ok(service.listByType(templateFreq));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<AssessTemplate>> page(@RequestBody @Validated AttCctvBasePage page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据模板id查询模板详情")
|
||||
@GetMapping("/detail/{id}")
|
||||
public R<AssessTemplate> detail(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.getById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据模板id查询关联的指标")
|
||||
@GetMapping("/queryIndicators/{id}")
|
||||
public R<List<AssessIndicator>> queryIndicators(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.queryIndicators(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,187 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.AttCctvBasePage;
|
||||
import com.gunshi.project.hsz.entity.vo.CctvControlVo;
|
||||
import com.gunshi.project.hsz.model.AttCctvBase;
|
||||
import com.gunshi.project.hsz.model.CctvBMenu;
|
||||
import com.gunshi.project.hsz.service.AttCctvBaseService;
|
||||
import com.gunshi.project.hsz.service.CctvBMenuService;
|
||||
import com.gunshi.project.hsz.util.OkHttpUtil;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 视频基本信息表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "视频基本信息表")
|
||||
@RestController
|
||||
@RequestMapping(value="/attCctvBase")
|
||||
public class AttCctvBaseController {
|
||||
|
||||
@Autowired
|
||||
private AttCctvBaseService service;
|
||||
|
||||
@Autowired
|
||||
private CctvBMenuService menuService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttCctvBase> insert(@Validated(Insert.class) @RequestBody AttCctvBase dto) {
|
||||
dto.setId(IdWorker.getId());
|
||||
dto.setCreateTime(new Date());
|
||||
if (StringUtils.isNotBlank(dto.getName()) && service.lambdaQuery().eq(AttCctvBase::getName,dto.getName())
|
||||
.count() > 0){
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
if (Objects.nonNull(dto.getMenuId()) && menuService.lambdaQuery().eq(CctvBMenu::getId,dto.getMenuId())
|
||||
.count() == 0
|
||||
){
|
||||
throw new IllegalArgumentException("当前视频点目录不存在");
|
||||
}
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttCctvBase> update(@Validated(Update.class) @RequestBody AttCctvBase dto) {
|
||||
|
||||
if (Objects.isNull(service.getById(dto.getId()))){
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getName()) && service.lambdaQuery().eq(AttCctvBase::getName,dto.getName())
|
||||
.ne(AttCctvBase::getId,dto.getId())
|
||||
.count() > 0){
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
|
||||
if (Objects.nonNull(dto.getMenuId()) && menuService.lambdaQuery().eq(CctvBMenu::getId,dto.getMenuId())
|
||||
.count() == 0
|
||||
){
|
||||
throw new IllegalArgumentException("当前视频点目录不存在");
|
||||
}
|
||||
dto.setCreateTime(null);
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))){
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<AttCctvBase>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<AttCctvBase>> page(@RequestBody @Validated AttCctvBasePage page) {
|
||||
LambdaQueryWrapper<AttCctvBase> query = Wrappers.lambdaQuery();
|
||||
|
||||
if (ObjectUtils.isNotNull(page.getCode())) {
|
||||
query.like(AttCctvBase::getIndexCode, page.getCode());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getMenuId())) {
|
||||
query.eq(AttCctvBase::getMenuId, page.getMenuId());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getName())) {
|
||||
query.like(AttCctvBase::getName, page.getName());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getType())) {
|
||||
query.eq(AttCctvBase::getType, Integer.valueOf(page.getType()));
|
||||
}
|
||||
query.orderByDesc(AttCctvBase::getCreateTime);
|
||||
Page<AttCctvBase> basePage = service.page(page.getPageSo().toPage(), query);
|
||||
List<AttCctvBase> records = basePage.getRecords();
|
||||
if (CollectionUtils.isNotEmpty(records)){
|
||||
List<CctvBMenu> list = menuService.list();
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
Map<Long, List<String>> listMap = list.stream().
|
||||
collect(Collectors.groupingBy(CctvBMenu::getId, Collectors.mapping(CctvBMenu::getName, Collectors.toList())));
|
||||
|
||||
records.forEach(item -> {
|
||||
if (Objects.nonNull(item.getMenuId())){
|
||||
item.setMenuName(listMap.get(item.getMenuId()).getFirst());
|
||||
}
|
||||
});
|
||||
}
|
||||
basePage.setRecords(records);
|
||||
}
|
||||
return R.ok(basePage);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取预览地址")
|
||||
@GetMapping("/preview/{indexCode}")
|
||||
public R<String> preview(@PathVariable("indexCode") String indexCode) {
|
||||
String api = "http://223.75.53.141:81/isc/liveAddressLimited?cameraIndexCode=%s&protocol=ws&token=111";
|
||||
OkHttpClient client = OkHttpUtil.build();
|
||||
String ret = null;
|
||||
try {
|
||||
Response resp = client.newCall(new Request.Builder().url(String.format(api, indexCode)).build()).execute();
|
||||
String respStr = resp.body().string();
|
||||
ObjectMapper om = new ObjectMapper();
|
||||
Map map = om.readValue(respStr, Map.class);
|
||||
ret = map.get("data").toString();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return R.ok(ret);
|
||||
}
|
||||
|
||||
@Operation(summary = "云台控制")
|
||||
@PostMapping("/control")
|
||||
public R<String> control(@RequestBody CctvControlVo vo) {
|
||||
String indexCode = vo.getIndexCode();
|
||||
Integer action = vo.getAction();
|
||||
Integer speed = vo.getSpeed();
|
||||
String command = vo.getCommand();
|
||||
String api = "http://223.75.53.141:81/isc/controlling?cameraIndexCode="+indexCode+"&action="+action+"&speed="+speed+"&command="+command+"&token=111";
|
||||
OkHttpClient client = OkHttpUtil.build();
|
||||
String ret = null;
|
||||
try {
|
||||
Response resp = client.newCall(new Request.Builder().url(api).build()).execute();
|
||||
ret = resp.body().string();
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return R.ok(ret);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.hsz.model.AttDamBase;
|
||||
import com.gunshi.project.hsz.service.AttDamBaseService;
|
||||
import com.gunshi.project.hsz.service.AttResBaseService;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 大坝表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "大坝表")
|
||||
@RestController
|
||||
@RequestMapping(value="/attDamBase")
|
||||
public class AttDamBaseController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private AttDamBaseService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Autowired
|
||||
private AttResBaseService resService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttDamBase> insert(@Validated(Insert.class) @RequestBody AttDamBase dto) {
|
||||
if (StringUtils.isNotBlank(dto.getResCode()) && Objects.isNull(resService.getById(dto.getResCode()))){
|
||||
throw new RuntimeException("当前水库不存在");
|
||||
}
|
||||
dto.setDamCode(IdWorker.get32UUID());
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getDamCode());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttDamBase> update(@Validated(Update.class) @RequestBody AttDamBase dto) {
|
||||
if (StringUtils.isNotBlank(dto.getResCode()) && Objects.isNull(resService.getById(dto.getResCode()))){
|
||||
throw new RuntimeException("当前水库不存在");
|
||||
}
|
||||
if (Objects.isNull(service.getById(dto.getDamCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getDamCode());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
boolean data = service.removeById(id);
|
||||
if (data){
|
||||
fileService.deleteFile(getGroupId(),id.toString());
|
||||
}
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<AttDamBase>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "获取主副坝,拦洪坝信息")
|
||||
@GetMapping("/info")
|
||||
public R<List<AttDamBase>> info(@Schema(name = "isMain",description = "是否主坝(0否 1是 2拦洪坝)") @RequestParam(name = "isMain") Integer isMain) {
|
||||
return R.ok(service.lambdaQuery().eq(AttDamBase::getIsMain,isMain).list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<AttDamBase>> page(@RequestBody @Validated GeneralDataPage page) {
|
||||
LambdaQueryWrapper<AttDamBase> query = Wrappers.lambdaQuery();
|
||||
|
||||
if (ObjectUtils.isNotNull(page.getCode())){
|
||||
query.like(AttDamBase::getDamCode, page.getCode());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getName())){
|
||||
query.like(AttDamBase::getDamName, page.getName());
|
||||
}
|
||||
return R.ok(service.page(page.getPageSo().toPage(),query));
|
||||
}
|
||||
@Operation(summary = "查看详情")
|
||||
@GetMapping("/get/{id}")
|
||||
public R<AttDamBase> page(@PathVariable("id") Serializable id) {
|
||||
AttDamBase data = service.getById(id);
|
||||
if (Objects.nonNull(data)){
|
||||
data.setFiles(fileService.getFiles(getGroupId(),data.getDamCode()));
|
||||
}
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "attDamBase";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.hsz.entity.vo.ProfilePressTreeVo;
|
||||
import com.gunshi.project.hsz.model.AttDamProfile;
|
||||
import com.gunshi.project.hsz.service.AttDamProfileService;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 监测断面信息表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "监测断面信息表")
|
||||
@RestController
|
||||
@RequestMapping(value="/attDamProfile")
|
||||
public class AttDamProfileController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private AttDamProfileService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttDamProfile> insert(@Validated(Insert.class) @RequestBody AttDamProfile dto) {
|
||||
if (Objects.nonNull(service.getById(dto.getProfileCode()))) {
|
||||
throw new IllegalArgumentException("当前编号已存在");
|
||||
}else{
|
||||
dto.setProfileCode(String.valueOf(IdWorker.getId()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getProfileName())){
|
||||
if (service.lambdaQuery().eq(AttDamProfile::getProfileName,dto.getProfileName()).count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
}
|
||||
|
||||
boolean result = service.save(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getProfileCode());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttDamProfile> update(@Validated(Update.class) @RequestBody AttDamProfile dto) {
|
||||
if (Objects.isNull(service.getById(dto.getProfileCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(dto.getProfileName())){
|
||||
if (service.lambdaQuery().eq(AttDamProfile::getProfileName,dto.getProfileName())
|
||||
.ne(AttDamProfile::getProfileCode,dto.getProfileCode())
|
||||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getProfileCode());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<AttDamProfile>> list() {
|
||||
LambdaQueryWrapper<AttDamProfile> wq = new LambdaQueryWrapper();
|
||||
wq.orderByAsc(AttDamProfile::getProfileCode);
|
||||
List<AttDamProfile> list = service.list(wq);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "断面渗压树")
|
||||
@PostMapping("/tree")
|
||||
public R<List<ProfilePressTreeVo>> tree() {
|
||||
return R.ok(service.tree());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<AttDamProfile>> page(@RequestBody @Validated GeneralDataPage page) {
|
||||
LambdaQueryWrapper<AttDamProfile> query = Wrappers.lambdaQuery();
|
||||
|
||||
if (ObjectUtils.isNotNull(page.getName())) {
|
||||
query.like(AttDamProfile::getProfileName, page.getName());
|
||||
}
|
||||
|
||||
Page<AttDamProfile> data = service.page(page.getPageSo().toPage(), query);
|
||||
data.getRecords().forEach(o -> o.setFiles(
|
||||
fileService.getFiles(getGroupId(),o.getProfileCode())
|
||||
));
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "AttDamProfile";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.vo.GateMonitorDataVo;
|
||||
import com.gunshi.project.hsz.model.AttGateB;
|
||||
import com.gunshi.project.hsz.service.AttGateBService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 水闸基本情况调查表
|
||||
* author: xusan
|
||||
* date: 2024-09-26 10:44:06
|
||||
*/
|
||||
@Tag(name = "水闸基本情况调查表")
|
||||
@RestController
|
||||
@RequestMapping(value="/attGateB")
|
||||
public class AttGateBController {
|
||||
|
||||
@Autowired
|
||||
private AttGateBService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttGateB> insert(@Validated(Insert.class) @RequestBody AttGateB dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttGateB> update(@Validated(Update.class) @RequestBody AttGateB dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<AttGateB>> list() {
|
||||
return R.ok(service.queryList());
|
||||
}
|
||||
|
||||
@Operation(summary = "监测数据")
|
||||
@GetMapping("/data")
|
||||
public R<List<GateMonitorDataVo>> dataList(@Schema(name = "gateCode",description = "水闸编码") @RequestParam("gateCode") String gateCode) {
|
||||
return R.ok(service.dataList(gateCode));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.hsz.model.AttGateValve;
|
||||
import com.gunshi.project.hsz.service.AttGateValveService;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 闸阀信息表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "闸阀信息表")
|
||||
@RestController
|
||||
@RequestMapping(value="/attGateValve")
|
||||
public class AttGateValveController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private AttGateValveService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttGateValve> insert(@Validated(Insert.class) @RequestBody AttGateValve dto) {
|
||||
dto.setValveCode(IdWorker.get32UUID());
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getValveCode());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttGateValve> update(@Validated(Update.class) @RequestBody AttGateValve dto) {
|
||||
if (Objects.isNull(service.getById(dto.getValveCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getValveCode());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
boolean data = service.removeById(id);
|
||||
if (data){
|
||||
fileService.deleteFile(getGroupId(),id.toString());
|
||||
}
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<AttGateValve>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<AttGateValve>> page(@RequestBody @Validated GeneralDataPage page) {
|
||||
LambdaQueryWrapper<AttGateValve> query = Wrappers.lambdaQuery();
|
||||
|
||||
if (ObjectUtils.isNotNull(page.getCode())){
|
||||
query.like(AttGateValve::getValveCode, page.getCode());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getName())){
|
||||
query.like(AttGateValve::getValveName, page.getName());
|
||||
}
|
||||
query.orderByDesc(AttGateValve::getCreateTime);
|
||||
return R.ok(service.page(page.getPageSo().toPage(),query));
|
||||
}
|
||||
|
||||
@Operation(summary = "详情")
|
||||
@GetMapping("/detail")
|
||||
public R<AttGateValve> detail(@Schema(name = "valveCode",description = "闸阀编码") @RequestParam("valveCode") String valveCode) {
|
||||
return R.ok(service.getById(valveCode));
|
||||
}
|
||||
|
||||
@Operation(summary = "查看详情")
|
||||
@GetMapping("/get/{id}")
|
||||
public R<AttGateValve> getDetail(@PathVariable("id") Serializable id) {
|
||||
AttGateValve data = service.getById(id);
|
||||
if (Objects.nonNull(data)){
|
||||
data.setFiles(fileService.getFiles(getGroupId(),data.getValveCode()));
|
||||
}
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "attGateValve";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.hsz.model.AttMeaWeir;
|
||||
import com.gunshi.project.hsz.service.AttMeaWeirService;
|
||||
import com.gunshi.project.hsz.service.StAddvcdDService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 量水堰表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "量水堰表")
|
||||
@RestController
|
||||
@RequestMapping(value="/attMeaWeir")
|
||||
public class AttMeaWeirController {
|
||||
|
||||
@Autowired
|
||||
private AttMeaWeirService service;
|
||||
|
||||
@Autowired
|
||||
private StAddvcdDService stAddvcdDService;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttMeaWeir> insert(@Validated(Insert.class) @RequestBody AttMeaWeir dto) {
|
||||
dto.setWeirCode(IdWorker.get32UUID());
|
||||
dto.setCreateTime(new Date());
|
||||
if (StringUtils.isNotBlank(dto.getAdcd()) && Objects.isNull(stAddvcdDService.getById(dto.getAdcd()))){
|
||||
throw new IllegalArgumentException("当前行政区划不存在");
|
||||
}
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttMeaWeir> update(@Validated(Update.class) @RequestBody AttMeaWeir dto) {
|
||||
if (Objects.isNull(service.getById(dto.getWeirCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(dto.getAdcd()) && Objects.isNull(stAddvcdDService.getById(dto.getAdcd()))){
|
||||
throw new IllegalArgumentException("当前行政区划不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<AttMeaWeir>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<AttMeaWeir>> page(@RequestBody @Validated GeneralDataPage page) {
|
||||
LambdaQueryWrapper<AttMeaWeir> query = Wrappers.lambdaQuery();
|
||||
|
||||
if (ObjectUtils.isNotNull(page.getCode())) {
|
||||
query.like(AttMeaWeir::getWeirCode, page.getCode());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getName())) {
|
||||
query.like(AttMeaWeir::getWeirName, page.getName());
|
||||
}
|
||||
query.orderByDesc(AttMeaWeir::getCreateTime);
|
||||
return R.ok(service.page(page.getPageSo().toPage(), query));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.AttResBase;
|
||||
import com.gunshi.project.hsz.model.FileAssociations;
|
||||
import com.gunshi.project.hsz.service.AttResBaseService;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 水库基本信息表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "水库基本信息表")
|
||||
@RestController
|
||||
@RequestMapping(value="/attResBase")
|
||||
public class AttResBaseController extends AbstractCommonFileController {
|
||||
|
||||
@Autowired
|
||||
private AttResBaseService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttResBase> insert(@Validated(Insert.class) @RequestBody AttResBase dto) {
|
||||
if (Objects.nonNull(service.getById(dto.getResCode()))) {
|
||||
throw new IllegalArgumentException("当前编号已存在");
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getResName())){
|
||||
if (service.lambdaQuery().eq(AttResBase::getResName,dto.getResName()).count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
}
|
||||
boolean result = service.save(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getResCode());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttResBase> update(@Validated(Update.class) @RequestBody AttResBase dto) {
|
||||
if (Objects.isNull(service.getById(dto.getResCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(dto.getResName())){
|
||||
if (service.lambdaQuery()
|
||||
.eq(AttResBase::getResName,dto.getResName())
|
||||
.ne(AttResBase::getResCode,dto.getResCode())
|
||||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getResCode());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
boolean data = service.removeById(id);
|
||||
if (data){
|
||||
fileService.deleteFile(getGroupId(),id.toString());
|
||||
}
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<AttResBase>> list() {
|
||||
List<AttResBase> list = service.lambdaQuery().list();
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
list.forEach(o -> o.setFiles(fileService.getFiles(getGroupId(),o.getResCode())));
|
||||
}
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "设计图纸和资料文件上传")
|
||||
@PostMapping("/updateFile")
|
||||
public R<AttResBase> updateFile(@Validated(Update.class) @RequestBody AttResBase dto) {
|
||||
if (Objects.isNull(service.getById(dto.getResCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
List<FileAssociations> files = dto.getFiles();
|
||||
fileService.saveFileNotDel(files, getGroupId(), dto.getResCode(),"1");
|
||||
return R.ok(dto);
|
||||
}
|
||||
|
||||
@Operation(summary = "设计图纸和资料列表")
|
||||
@GetMapping("/fileList/{resCode}")
|
||||
public R<List<FileAssociations>> list(@PathVariable("resCode") String resCode) {
|
||||
List<FileAssociations> files = fileService.getFiles(getGroupId(), resCode);
|
||||
if (CollectionUtils.isEmpty(files)){
|
||||
return R.ok(files);
|
||||
}
|
||||
List<FileAssociations> datas = files.stream().filter(o -> "1".equals(o.getType()))
|
||||
.collect(Collectors.toList());
|
||||
return R.ok(datas);
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<AttResBase>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "attResBase";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.AttResBuilding;
|
||||
import com.gunshi.project.hsz.model.FileAssociations;
|
||||
import com.gunshi.project.hsz.service.AttResBuildingService;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 水库基本信息表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "水库基本信息表")
|
||||
@RestController
|
||||
@RequestMapping(value="/attResBuilding")
|
||||
public class AttResBuildingController extends AbstractCommonFileController {
|
||||
|
||||
@Autowired
|
||||
private AttResBuildingService attResBuildingService;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttResBuilding> update(@Validated(Update.class) @RequestBody AttResBuilding dto) {
|
||||
// if (Objects.isNull(attResBuildingService.getById(dto.getId()))) {
|
||||
// throw new IllegalArgumentException("当前数据不存在");
|
||||
// }
|
||||
boolean result = attResBuildingService.updateById(dto);
|
||||
// if (result){
|
||||
// fileService.saveFile(dto.getFiles(), getGroupId(), dto.getResCode());
|
||||
// }
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@GetMapping("/info")
|
||||
public R<AttResBuilding> info() {
|
||||
List<AttResBuilding> list = attResBuildingService.list();
|
||||
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
AttResBuilding byId = list.stream().findFirst().orElse(null);
|
||||
//boolean result = attResBuildingService.updateById(dto);
|
||||
// if (result){
|
||||
// fileService.saveFile(dto.getFiles(), getGroupId(), dto.getResCode());
|
||||
// }
|
||||
return R.ok(byId);
|
||||
}
|
||||
|
||||
// @Operation(summary = "设计图纸和资料文件上传")
|
||||
// @PostMapping("/updateFile")
|
||||
// public R<AttResBase> updateFile(@Validated(Update.class) @RequestBody AttResBase dto) {
|
||||
// if (Objects.isNull(service.getById(dto.getResCode()))) {
|
||||
// throw new IllegalArgumentException("当前数据不存在");
|
||||
// }
|
||||
// List<FileAssociations> files = dto.getFiles();
|
||||
// fileService.saveFileNotDel(files, getGroupId(), dto.getResCode(),"1");
|
||||
// return R.ok(dto);
|
||||
// }
|
||||
|
||||
@Operation(summary = "设计图纸和资料列表")
|
||||
@GetMapping("/fileList/{resCode}")
|
||||
public R<List<FileAssociations>> list(@PathVariable("resCode") String resCode) {
|
||||
List<FileAssociations> files = fileService.getFiles(getGroupId(), resCode);
|
||||
if (CollectionUtils.isEmpty(files)){
|
||||
return R.ok(files);
|
||||
}
|
||||
List<FileAssociations> datas = files.stream().filter(o -> "1".equals(o.getType()))
|
||||
.collect(Collectors.toList());
|
||||
return R.ok(datas);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "attResBase";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.hsz.model.AttSpillwayBase;
|
||||
import com.gunshi.project.hsz.service.AttSpillwayBaseService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 溢洪道
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "溢洪道")
|
||||
@RestController
|
||||
@RequestMapping(value="/attSpillwayBase")
|
||||
public class AttSpillwayBaseController {
|
||||
|
||||
@Autowired
|
||||
private AttSpillwayBaseService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttSpillwayBase> insert(@Validated(Insert.class) @RequestBody AttSpillwayBase dto) {
|
||||
dto.setCode(String.valueOf(IdWorker.getId()));
|
||||
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttSpillwayBase> update(@Validated(Update.class) @RequestBody AttSpillwayBase dto) {
|
||||
if (Objects.isNull(service.getById(dto.getCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<AttSpillwayBase>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<AttSpillwayBase>> page(@RequestBody @Validated GeneralDataPage page) {
|
||||
LambdaQueryWrapper<AttSpillwayBase> query = Wrappers.lambdaQuery();
|
||||
if (ObjectUtils.isNotNull(page.getCode())){
|
||||
query.like(AttSpillwayBase::getCode, page.getCode());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getName())){
|
||||
query.like(AttSpillwayBase::getName, page.getName());
|
||||
}
|
||||
return R.ok(service.page(page.getPageSo().toPage(),query));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.AttWaterItem;
|
||||
import com.gunshi.project.hsz.service.AttWaterItemService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 水质整编展示项目表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "水质整编展示项目表")
|
||||
@RestController
|
||||
@RequestMapping(value="/attWaterItem")
|
||||
public class AttWaterItemController {
|
||||
|
||||
@Autowired
|
||||
private AttWaterItemService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<AttWaterItem> insert(@Validated(Insert.class) @RequestBody AttWaterItem dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttWaterItem> update(@Validated(Update.class) @RequestBody AttWaterItem dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<AttWaterItem>> list() {
|
||||
LambdaQueryWrapper<AttWaterItem> wrapper = new QueryWrapper<AttWaterItem>().lambda()
|
||||
.eq(true, AttWaterItem::getIsEnable, "0")
|
||||
.orderBy(true, true, AttWaterItem::getSort);
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<AttWaterItem>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.BroadcastStation;
|
||||
import com.gunshi.project.hsz.service.BroadcastStationService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述:
|
||||
* author: xusan
|
||||
* date: 2024-09-25 10:12:34
|
||||
*/
|
||||
@Tag(name = "广播站")
|
||||
@RestController
|
||||
@RequestMapping(value="/broadcastStation")
|
||||
public class BroadcastStationController {
|
||||
|
||||
@Autowired
|
||||
private BroadcastStationService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<BroadcastStation> insert(@Validated(Insert.class) @RequestBody BroadcastStation dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<BroadcastStation> update(@Validated(Update.class) @RequestBody BroadcastStation dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<BroadcastStation>> list() {
|
||||
return R.ok(service.lambdaQuery().orderByAsc(BroadcastStation::getOrderIndex).list());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.BroadcastTemplate;
|
||||
import com.gunshi.project.hsz.service.BroadcastTemplateService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述:
|
||||
* author: xusan
|
||||
* date: 2024-09-25 10:12:13
|
||||
*/
|
||||
@Tag(name = "广播模板")
|
||||
@RestController
|
||||
@RequestMapping(value="/broadcastTemplate")
|
||||
public class BroadcastTemplateController {
|
||||
|
||||
@Autowired
|
||||
private BroadcastTemplateService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<BroadcastTemplate> insert(@Validated(Insert.class) @RequestBody BroadcastTemplate dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<BroadcastTemplate>> list() {
|
||||
return R.ok(service.lambdaQuery().orderByAsc(BroadcastTemplate::getOrderIndex).list());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.BroadcastWarnPageSo;
|
||||
import com.gunshi.project.hsz.model.BroadcastWarn;
|
||||
import com.gunshi.project.hsz.service.BroadcastWarnService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 描述:
|
||||
* author: xusan
|
||||
* date: 2024-09-25 10:12:51
|
||||
*/
|
||||
@Tag(name = "广播预警")
|
||||
@RestController
|
||||
@RequestMapping(value="/broadcastWarn")
|
||||
public class BroadcastWarnController {
|
||||
|
||||
@Autowired
|
||||
private BroadcastWarnService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<Boolean> insert(@Validated(Insert.class) @RequestBody BroadcastWarn dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<BroadcastWarn>> page(@Validated @RequestBody BroadcastWarnPageSo page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.CctvBMenu;
|
||||
import com.gunshi.project.hsz.service.CctvBMenuService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 视频点目录
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "视频点目录")
|
||||
@RestController
|
||||
@RequestMapping(value="/cctvBMenu")
|
||||
public class CctvBMenuController {
|
||||
|
||||
@Autowired
|
||||
private CctvBMenuService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<CctvBMenu> insert(@Validated(Insert.class) @RequestBody CctvBMenu dto) {
|
||||
if (Objects.isNull(dto.getParentId())){
|
||||
dto.setParentId(0L);
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getName()) && service.lambdaQuery().eq(CctvBMenu::getName,dto.getName())
|
||||
.count() > 0){
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
dto.setId(IdWorker.getId());
|
||||
if (Objects.isNull(dto.getOrderIndex())){
|
||||
CctvBMenu one = service.lambdaQuery()
|
||||
.select(CctvBMenu::getOrderIndex)
|
||||
.orderByDesc(CctvBMenu::getOrderIndex)
|
||||
.one();
|
||||
if (Objects.nonNull(one)){
|
||||
dto.setOrderIndex(one.getOrderIndex() + 1);
|
||||
}
|
||||
}
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<CctvBMenu> update(@Validated(Update.class) @RequestBody CctvBMenu dto) {
|
||||
if (StringUtils.isNotBlank(dto.getName()) && service.lambdaQuery().eq(CctvBMenu::getName,dto.getName())
|
||||
.ne(CctvBMenu::getId,dto.getId())
|
||||
.count() > 0){
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<CctvBMenu>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "树")
|
||||
@GetMapping("/tree")
|
||||
public R<List<CctvBMenu>> tree() {
|
||||
return R.ok(service.tree());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<CctvBMenu>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.service.DeptempService;
|
||||
import com.ruoyi.common.constant.HttpStatus;
|
||||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Tag(name = "dept")
|
||||
@RestController
|
||||
@RequestMapping(value="/deptemp")
|
||||
public class DeptempController {
|
||||
|
||||
@Autowired
|
||||
private DeptempService deptempService;
|
||||
|
||||
@GetMapping("/deptlist")
|
||||
public R<List<SysDept>> deptlist(SysDept dept)
|
||||
{
|
||||
List<SysDept> depts = deptempService.selectDeptList(dept);
|
||||
return R.ok(depts);
|
||||
}
|
||||
|
||||
@GetMapping("/userlist")
|
||||
public TableDataInfo userlist(SysUser user)
|
||||
{
|
||||
PageUtils.startPage();
|
||||
List<SysUser> list = deptempService.selectUserList(user);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
private TableDataInfo getDataTable(List<?> list)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(list);
|
||||
rspData.setTotal(new PageInfo(list).getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.DispatchRecordPageSo;
|
||||
import com.gunshi.project.hsz.model.DispatchRecord;
|
||||
import com.gunshi.project.hsz.service.DispatchRecordService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 调度记录
|
||||
* author: xusan
|
||||
* date: 2024-10-09 09:56:28
|
||||
*/
|
||||
@Tag(name = "调度记录")
|
||||
@RestController
|
||||
@RequestMapping(value="/dispatchRecord")
|
||||
public class DispatchRecordController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private DispatchRecordService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<DispatchRecord> insert(@Validated(Insert.class) @RequestBody DispatchRecord dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<DispatchRecord> update(@Validated(Update.class) @RequestBody DispatchRecord dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@PostMapping("/del")
|
||||
public R<Boolean> del(@RequestBody @Validated List<Long> ids) {
|
||||
return R.ok(service.delData(ids));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<DispatchRecord>> page(@RequestBody @Validated DispatchRecordPageSo page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
@Operation(summary = "导出")
|
||||
@PostMapping("/export")
|
||||
public void export(@RequestBody @Validated DispatchRecordPageSo page, HttpServletResponse response) {
|
||||
service.export(page,response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "dispatchRecord";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.FileAssociations;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 文件关联业务表
|
||||
* author: xusan
|
||||
* date: 2024-07-17 10:09:40
|
||||
*/
|
||||
@Tag(name = "文件关联业务表")
|
||||
@RestController
|
||||
@RequestMapping(value="/fileAssociations")
|
||||
public class FileAssociationsController {
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<FileAssociations> insert(@Validated(Insert.class) @RequestBody FileAssociations dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<FileAssociations> update(@Validated(Update.class) @RequestBody FileAssociations dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<FileAssociations>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<FileAssociations>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.ForecastK;
|
||||
import com.gunshi.project.hsz.service.ForecastKService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 预报_前期影响雨量折减系数表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预报_前期影响雨量折减系数表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastK")
|
||||
public class ForecastKController {
|
||||
|
||||
@Autowired
|
||||
private ForecastKService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastK> insert(@Validated(Insert.class) @RequestBody ForecastK dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastK> update(@Validated(Update.class) @RequestBody ForecastK dto) {
|
||||
ForecastK oldK = service.getById(dto.getMonth());
|
||||
if (Objects.isNull(oldK)) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
dto.setChtm(oldK.getChtm());
|
||||
dto.setUpdateTime(new Date());
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastK>> list(@RequestBody @Validated ForecastK forecastK) {
|
||||
QueryWrapper<ForecastK> wrapper = new QueryWrapper<ForecastK>();
|
||||
if(StringUtils.isNotBlank(forecastK.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastK.getIsAsc()) ? false : forecastK.getIsAsc(), forecastK.getOrderField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastK>> page(@RequestBody @Validated ForecastK forecastK) {
|
||||
QueryWrapper<ForecastK> wrapper = new QueryWrapper<ForecastK>();
|
||||
if(StringUtils.isNotBlank(forecastK.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastK.getIsAsc()) ? false : forecastK.getIsAsc(), forecastK.getOrderField());
|
||||
}
|
||||
return R.ok(service.page(forecastK.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "批量保存")
|
||||
@PostMapping("/saveBatch")
|
||||
public R<Boolean> saveBatch(@RequestBody List<ForecastK> dtos) {
|
||||
boolean result = false;
|
||||
if (CollectionUtils.isNotEmpty(dtos)) {
|
||||
boolean remove = service.remove(new QueryWrapper<>());
|
||||
if (remove) {
|
||||
result = service.saveBatch(dtos);
|
||||
}
|
||||
}
|
||||
return R.ok(result);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.ForecastPPaR;
|
||||
import com.gunshi.project.hsz.service.ForecastPPaRService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 预报_降雨径流关系表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预报_降雨径流关系表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastPPaR")
|
||||
public class ForecastPPaRController {
|
||||
|
||||
@Autowired
|
||||
private ForecastPPaRService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastPPaR> insert(@Validated(Insert.class) @RequestBody ForecastPPaR dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastPPaR> update(@Validated(Update.class) @RequestBody ForecastPPaR dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<String[]>> list() {
|
||||
List<String[]> PPaRList = service.handleList();
|
||||
return R.ok(PPaRList);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastPPaR>> page(@RequestBody @Validated ForecastPPaR forecastPPaR) {
|
||||
QueryWrapper<ForecastPPaR> wrapper = new QueryWrapper<ForecastPPaR>();
|
||||
if(StringUtils.isNotBlank(forecastPPaR.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastPPaR.getIsAsc()) ? false : forecastPPaR.getIsAsc(), forecastPPaR.getOrderField());
|
||||
}
|
||||
return R.ok(service.page(forecastPPaR.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "批量保存")
|
||||
@PostMapping("/saveBatch")
|
||||
public R<Boolean> saveBatch(@RequestBody List<String[]> PPaRList) {
|
||||
if (PPaRList.size() == 0) {
|
||||
throw new IllegalArgumentException("数据格式不正确");
|
||||
}
|
||||
boolean result = service.handleSaveBatch(PPaRList);
|
||||
return R.ok(result);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.ForecastPa;
|
||||
import com.gunshi.project.hsz.service.ForecastPaService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 预报_土壤含水量表
|
||||
* author: cxw
|
||||
* date: 2024-08-02 12:23:07
|
||||
*/
|
||||
@Tag(name = "预报_土壤含水量表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastPa")
|
||||
public class ForecastPaController {
|
||||
|
||||
@Autowired
|
||||
private ForecastPaService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastPa> insert(@Validated(Insert.class) @RequestBody ForecastPa dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastPa> update(@Validated(Update.class) @RequestBody ForecastPa dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastPa>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastPa>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.vo.ForecastResultVo;
|
||||
import com.gunshi.project.hsz.model.ForecastProject;
|
||||
import com.gunshi.project.hsz.model.ForecastResults;
|
||||
import com.gunshi.project.hsz.service.ForecastProjectService;
|
||||
import com.gunshi.project.hsz.service.ForecastResultsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 预报_预测方案管理表
|
||||
* author: cxw
|
||||
* date: 2024-08-05 11:41:45
|
||||
*/
|
||||
@Tag(name = "预报_预测方案管理表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastProject")
|
||||
public class ForecastProjectController {
|
||||
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Autowired
|
||||
private ForecastProjectService service;
|
||||
|
||||
@Autowired
|
||||
private ForecastResultsService forecastResultsService;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastProject> insert(@Validated(Insert.class) @RequestBody ForecastProject dto) {
|
||||
dto.setId(IdWorker.getId());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastProject> update(@Validated(Update.class) @RequestBody ForecastProject dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
boolean b = service.removeById(id);
|
||||
// 级联删除
|
||||
if(b){
|
||||
forecastResultsService.remove(new QueryWrapper<ForecastResults>().eq("project_id", id));
|
||||
}
|
||||
return R.ok(b);
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastProject>> list(@RequestBody @Validated ForecastProject forecastProject) {
|
||||
QueryWrapper<ForecastProject> wrapper = new QueryWrapper<ForecastProject>()
|
||||
.like(ObjectUtils.isNotNull(forecastProject.getName()), "name", forecastProject.getName())
|
||||
.like(ObjectUtils.isNotNull(forecastProject.getType()), "type", forecastProject.getType())
|
||||
.ge(ObjectUtils.isNotNull(forecastProject.getStartTm()), "forecast_tm", forecastProject.getStartTm())
|
||||
.le(ObjectUtils.isNotNull(forecastProject.getEndTm()), "forecast_tm", forecastProject.getEndTm());
|
||||
if(StringUtils.isNotBlank(forecastProject.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastProject.getIsAsc()) ? false : forecastProject.getIsAsc(), forecastProject.getOrderField());
|
||||
}
|
||||
List<ForecastProject> list = service.list(wrapper);
|
||||
if (list.size() > 0) {
|
||||
for (ForecastProject fp : list) {
|
||||
if (StringUtils.isNotEmpty(fp.getUserId()) && fp.getUserId().contains("_")) {
|
||||
fp.setUserId(fp.getUserId().substring(fp.getUserId().indexOf("_") + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastProject>> page(@RequestBody @Validated ForecastProject forecastProject) {
|
||||
QueryWrapper<ForecastProject> wrapper = new QueryWrapper<ForecastProject>()
|
||||
.like(ObjectUtils.isNotNull(forecastProject.getName()), "name", forecastProject.getName())
|
||||
.like(ObjectUtils.isNotNull(forecastProject.getType()), "type", forecastProject.getType())
|
||||
.ge(ObjectUtils.isNotNull(forecastProject.getStartTm()), "forecast_tm", forecastProject.getStartTm())
|
||||
.le(ObjectUtils.isNotNull(forecastProject.getEndTm()), "forecast_tm", forecastProject.getEndTm());
|
||||
if(StringUtils.isNotBlank(forecastProject.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastProject.getIsAsc()) ? false : forecastProject.getIsAsc(), forecastProject.getOrderField());
|
||||
}
|
||||
Page<ForecastProject> page = service.page(forecastProject.getPageSo().toPage(), wrapper);
|
||||
if (page.getRecords().size() > 0) {
|
||||
for (ForecastProject fp : page.getRecords()) {
|
||||
if (StringUtils.isNotEmpty(fp.getUserId()) && fp.getUserId().contains("_")) {
|
||||
fp.setUserId(fp.getUserId().substring(fp.getUserId().indexOf("_") + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok(page);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "保存人工交互洪水预报结果")
|
||||
@PostMapping("/saveHumanForecastResults")
|
||||
public R<ForecastProject> saveHumanForecastResults(@RequestBody @Validated ForecastProject forecastProject) throws ParseException {
|
||||
if (CollectionUtils.isEmpty(forecastProject.getVoList())) {
|
||||
throw new IllegalArgumentException("数据格式不正确");
|
||||
}
|
||||
forecastProject.setId(IdWorker.getId());
|
||||
boolean result = service.save(forecastProject);
|
||||
if (result) {
|
||||
service.saveForecastResults(forecastProject);
|
||||
}
|
||||
return R.ok(result ? forecastProject : null);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "根据方案id查看方案洪水预报结果")
|
||||
@GetMapping("/getForecastProjectResults")
|
||||
public R<ForecastProject> getForecastProjectResults(@Schema(name = "projectId", description = "预测方案id") @RequestParam("projectId") String projectId) {
|
||||
ForecastProject forecastProject = service.getById(projectId);
|
||||
if (Objects.isNull(forecastProject)) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
List<ForecastResults> resultList = forecastResultsService.list(new QueryWrapper<ForecastResults>().eq("project_id", projectId).orderBy(true, true, "tm"));
|
||||
if (CollectionUtils.isNotEmpty(resultList)) {
|
||||
List<ForecastResultVo> vos = resultList.stream()
|
||||
.map(result -> {
|
||||
ForecastResultVo vo = new ForecastResultVo();
|
||||
vo.setTm(sdf.format(result.getTm()));
|
||||
vo.setYcRkQValue(result.getYcRkQValue());
|
||||
vo.setRealRkQValue(result.getRealRkQValue());
|
||||
vo.setYcCkQValue(result.getYcCkQValue());
|
||||
vo.setRealCkQValue(result.getRealCkQValue());
|
||||
vo.setYcSwHValue(result.getYcSwHValue());
|
||||
vo.setRealSwHValue(result.getRealSwHValue());
|
||||
BigDecimal ycSwHValue = result.getYcSwHValue() == null ? BigDecimal.ZERO : result.getYcSwHValue();
|
||||
BigDecimal realSwHValue = result.getRealSwHValue() == null ? BigDecimal.ZERO : result.getRealSwHValue();
|
||||
vo.setSwHDValue(ycSwHValue.subtract(realSwHValue));// 处理预测与实测水位差
|
||||
vo.setDrp(result.getDrp());
|
||||
vo.setIspreDrp(result.getIspreDrp());
|
||||
vo.setR(result.getR());
|
||||
vo.setFlLowLimLev(result.getFlLowLimLev());
|
||||
vo.setCurrentYdgdyjz(result.getCurrentYdgdyjz());
|
||||
vo.setPa(result.getPa());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
forecastProject.setVoList(vos);
|
||||
forecastResultsService.handleVoList(forecastProject);
|
||||
}
|
||||
return R.ok(forecastProject);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.vo.ForecastResultVo;
|
||||
import com.gunshi.project.hsz.model.ForecastProject;
|
||||
import com.gunshi.project.hsz.model.ForecastResults;
|
||||
import com.gunshi.project.hsz.model.ForecastTask;
|
||||
import com.gunshi.project.hsz.service.ForecastResultsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 预报_预测结果表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预报_预测结果表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastResults")
|
||||
public class ForecastResultsController {
|
||||
|
||||
@Autowired
|
||||
private ForecastResultsService service;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastResults> insert(@Validated(Insert.class) @RequestBody ForecastResults dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastResults> update(@Validated(Update.class) @RequestBody ForecastResults dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastResults>> list(@RequestBody @Validated ForecastResults forecastResults) {
|
||||
QueryWrapper<ForecastResults> wrapper = new QueryWrapper<ForecastResults>();
|
||||
if(StringUtils.isNotBlank(forecastResults.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastResults.getIsAsc()) ? false : forecastResults.getIsAsc(), forecastResults.getOrderField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastResults>> page(@RequestBody @Validated ForecastResults forecastResults) {
|
||||
QueryWrapper<ForecastResults> wrapper = new QueryWrapper<>();
|
||||
if(StringUtils.isNotBlank(forecastResults.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastResults.getIsAsc()) ? false : forecastResults.getIsAsc(), forecastResults.getOrderField());
|
||||
}
|
||||
return R.ok(service.page(forecastResults.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取人工交互洪水预报结果")
|
||||
@PostMapping("/getHumanForecastResult")
|
||||
public R<ForecastProject> getHumanForecastResult(@RequestBody ForecastTask forecastTask) {
|
||||
ForecastProject forecastProject = new ForecastProject();
|
||||
List<ForecastResultVo> voList = service.getHumanForecastResult(forecastTask);
|
||||
forecastProject.setType("2");
|
||||
forecastProject.setForecastTm(forecastTask.getForecastTime());
|
||||
forecastProject.setProjectTm(forecastTask.getNowTime());
|
||||
forecastProject.setStartTm(forecastTask.getStartTime());
|
||||
forecastProject.setEndTm(forecastTask.getEndTime());
|
||||
forecastProject.setForecastPeriod(forecastTask.getForecastPeriod());
|
||||
forecastProject.setForecastWarm(forecastTask.getForecastWarm());
|
||||
forecastProject.setVoList(voList);
|
||||
if (CollectionUtils.isNotEmpty(voList)) {
|
||||
service.handleVoList(forecastProject);
|
||||
}
|
||||
return R.ok(forecastProject);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.ForecastTask;
|
||||
import com.gunshi.project.hsz.schedule.TaskGroupHandler;
|
||||
import com.gunshi.project.hsz.service.ForecastTaskService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 预报_预测自动任务管理表
|
||||
* author: cxw
|
||||
* date: 2024-08-05 11:41:45
|
||||
*/
|
||||
@Tag(name = "预报_预测自动任务管理表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastTask")
|
||||
public class ForecastTaskController {
|
||||
|
||||
@Autowired
|
||||
private ForecastTaskService service;
|
||||
|
||||
@Autowired
|
||||
private TaskGroupHandler taskGroupHandler;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastTask> insert(@Validated(Insert.class) @RequestBody ForecastTask dto) {
|
||||
dto.setId(IdWorker.getId());
|
||||
boolean result = service.save(dto);
|
||||
if (result) {
|
||||
taskGroupHandler.addCronJob(String.valueOf(dto.getId()), dto);
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastTask> update(@Validated(Update.class) @RequestBody ForecastTask dto) {
|
||||
ForecastTask oldTask = service.getById(dto.getId());
|
||||
if (Objects.isNull(oldTask)) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
dto.setChtm(oldTask.getChtm());
|
||||
dto.setUpdateTm(new Date());
|
||||
boolean result = service.updateById(dto);
|
||||
if (result) {
|
||||
// 先删除,再重新添加
|
||||
taskGroupHandler.removeCronJob(String.valueOf(dto.getId()));
|
||||
taskGroupHandler.addCronJob(String.valueOf(dto.getId()), dto);
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
boolean b = service.removeById(id);
|
||||
if (b) {
|
||||
taskGroupHandler.removeCronJob((String) id);
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastTask>> list(@RequestBody @Validated ForecastTask forecastTask) {
|
||||
QueryWrapper<ForecastTask> wrapper = new QueryWrapper<ForecastTask>()
|
||||
.in("status", "0", "1")// 只返回启用和暂停的
|
||||
.like(ObjectUtils.isNotNull(forecastTask.getName()), "name", forecastTask.getName());
|
||||
if(StringUtils.isNotBlank(forecastTask.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastTask.getIsAsc()) ? false : forecastTask.getIsAsc(), forecastTask.getOrderField());
|
||||
}
|
||||
List<ForecastTask> list = service.list(wrapper);
|
||||
if (list.size() > 0) {
|
||||
for (ForecastTask task : list) {
|
||||
if (StringUtils.isNotEmpty(task.getUserId()) && task.getUserId().contains("_")) {
|
||||
task.setUserName(task.getUserId().substring(task.getUserId().indexOf("_") + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastTask>> page(@RequestBody @Validated ForecastTask forecastTask) {
|
||||
QueryWrapper<ForecastTask> wrapper = new QueryWrapper<ForecastTask>()
|
||||
.in("status", "0", "1")// 只返回启用和暂停的
|
||||
.like(ObjectUtils.isNotNull(forecastTask.getName()), "name", forecastTask.getName());
|
||||
if(StringUtils.isNotBlank(forecastTask.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastTask.getIsAsc()) ? false : forecastTask.getIsAsc(), forecastTask.getOrderField());
|
||||
}
|
||||
Page<ForecastTask> page = service.page(forecastTask.getPageSo().toPage(), wrapper);
|
||||
if (page.getRecords().size() > 0) {
|
||||
for (ForecastTask task : page.getRecords()) {
|
||||
if (StringUtils.isNotEmpty(task.getUserId()) && task.getUserId().contains("_")) {
|
||||
task.setUserName(task.getUserId().substring(task.getUserId().indexOf("_") + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok(page);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.ForecastU;
|
||||
import com.gunshi.project.hsz.service.ForecastUService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 预报_时段单位线表
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预报_时段单位线表")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastU")
|
||||
public class ForecastUController {
|
||||
|
||||
@Autowired
|
||||
private ForecastUService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastU> insert(@Validated(Insert.class) @RequestBody ForecastU dto) {
|
||||
dto.setId(IdWorker.getId());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastU> update(@Validated(Update.class) @RequestBody ForecastU dto) {
|
||||
ForecastU oldU = service.getById(dto.getId());
|
||||
if (Objects.isNull(oldU)) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
dto.setChtm(oldU.getChtm());
|
||||
dto.setUpdateTime(new Date());
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastU>> list(@RequestBody @Validated ForecastU forecastU) {
|
||||
QueryWrapper<ForecastU> wrapper = new QueryWrapper<ForecastU>();
|
||||
if(StringUtils.isNotBlank(forecastU.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastU.getIsAsc()) ? false : forecastU.getIsAsc(), forecastU.getOrderField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastU>> page(@RequestBody @Validated ForecastU forecastU) {
|
||||
QueryWrapper<ForecastU> wrapper = new QueryWrapper<ForecastU>();
|
||||
if(StringUtils.isNotBlank(forecastU.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastU.getIsAsc()) ? false : forecastU.getIsAsc(), forecastU.getOrderField());
|
||||
}
|
||||
return R.ok(service.page(forecastU.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "批量保存")
|
||||
@PostMapping("/saveBatch")
|
||||
public R<Boolean> saveBatch(@RequestBody List<ForecastU> dtos) {
|
||||
boolean result = false;
|
||||
if (CollectionUtils.isNotEmpty(dtos)) {
|
||||
boolean remove = service.remove(new QueryWrapper<>());
|
||||
if (remove) {
|
||||
for (ForecastU u : dtos) {
|
||||
u.setId(IdWorker.getId());
|
||||
}
|
||||
result = service.saveBatch(dtos);
|
||||
}
|
||||
}
|
||||
return R.ok(result);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.ForecastU;
|
||||
import com.gunshi.project.hsz.model.ForecastUseparam;
|
||||
import com.gunshi.project.hsz.service.ForecastUService;
|
||||
import com.gunshi.project.hsz.service.ForecastUseparamService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 预报_通用参数管理
|
||||
* author: cxw
|
||||
* date: 2024-07-30 10:02:24
|
||||
*/
|
||||
@Tag(name = "预报_通用参数管理")
|
||||
@RestController
|
||||
@RequestMapping(value="/forecastUseparam")
|
||||
public class ForecastUseparamController {
|
||||
|
||||
@Autowired
|
||||
private ForecastUseparamService service;
|
||||
|
||||
@Autowired
|
||||
private ForecastUService forecastUService;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ForecastUseparam> insert(@Validated(Insert.class) @RequestBody ForecastUseparam dto) {
|
||||
dto.setId(IdWorker.getId());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ForecastUseparam> update(@Validated(Update.class) @RequestBody ForecastUseparam dto) {
|
||||
ForecastUseparam oldData = service.getById(dto.getId());
|
||||
if (Objects.isNull(oldData)) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
dto.setChtm(oldData.getChtm());
|
||||
dto.setUpdateTime(new Date());
|
||||
boolean result = service.updateById(dto);
|
||||
// 修改计算单位线的参数时,需要重新计算一次
|
||||
if (result && (dto.getParamCode().equals("cymj") || dto.getParamCode().equals("hdc") || dto.getParamCode().equals("hdpj") || dto.getParamCode().equals("dt") || dto.getParamCode().equals("h")) && !dto.getParamValue().equals(oldData.getParamValue())) {
|
||||
// 承雨面积areaF:"cymj", 河道长lengthL:"hdc", 河道坡降j:"hdpj", 时段∆t:"dt", h毫米净雨:"h"
|
||||
QueryWrapper<ForecastUseparam> qw = new QueryWrapper<ForecastUseparam>().in("param_code", "cymj", "hdc", "hdpj", "dt", "h");
|
||||
List<Map<String, Object>> uMaps = service.listMaps(qw);
|
||||
Map<String, String> uMap = uMaps.stream().collect(Collectors.toMap(map -> (String) map.get("param_code"), map -> (String) map.get("param_value")));
|
||||
if (uMap.containsKey("cymj") && StringUtils.isNotEmpty(uMap.get("cymj"))
|
||||
&& uMap.containsKey("hdc") && StringUtils.isNotEmpty(uMap.get("hdc"))
|
||||
&& uMap.containsKey("hdpj") && StringUtils.isNotEmpty(uMap.get("hdpj"))
|
||||
&& uMap.containsKey("dt") && StringUtils.isNotEmpty(uMap.get("dt"))) {
|
||||
List<BigDecimal> uParam = service.calcU(new BigDecimal(uMap.get("cymj")),
|
||||
new BigDecimal(uMap.get("hdc")),
|
||||
new BigDecimal(uMap.get("hdpj")),
|
||||
Double.valueOf(uMap.get("dt")),
|
||||
StringUtils.isNotEmpty(uMap.get("h")) ? new BigDecimal(uMap.get("h")) : BigDecimal.ONE, StringUtils.isNotEmpty(uMap.get("swfq")) ? uMap.get("swfq") : "I");
|
||||
if (CollectionUtils.isNotEmpty(uParam)) {
|
||||
forecastUService.remove(new UpdateWrapper<>());
|
||||
List<ForecastU> uList = new ArrayList<>();
|
||||
Date date = new Date();
|
||||
for (BigDecimal u : uParam) {
|
||||
ForecastU forecastU = new ForecastU();
|
||||
forecastU.setId(IdWorker.getId());
|
||||
forecastU.setUValue(u);
|
||||
forecastU.setChtm(date);
|
||||
forecastU.setUpdateTime(date);
|
||||
uList.add(forecastU);
|
||||
}
|
||||
forecastUService.saveBatch(uList);
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ForecastUseparam>> list(@RequestBody @Validated ForecastUseparam forecastUseparam) {
|
||||
QueryWrapper<ForecastUseparam> wrapper = new QueryWrapper<ForecastUseparam>();
|
||||
if(StringUtils.isNotBlank(forecastUseparam.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastUseparam.getIsAsc()) ? false : forecastUseparam.getIsAsc(), forecastUseparam.getOrderField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ForecastUseparam>> page(@RequestBody @Validated ForecastUseparam forecastUseparam) {
|
||||
QueryWrapper<ForecastUseparam> wrapper = new QueryWrapper<ForecastUseparam>();
|
||||
if(StringUtils.isNotBlank(forecastUseparam.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(forecastUseparam.getIsAsc()) ? false : forecastUseparam.getIsAsc(), forecastUseparam.getOrderField());
|
||||
}
|
||||
return R.ok(service.page(forecastUseparam.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.GatePore;
|
||||
import com.gunshi.project.hsz.service.GatePoreService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 闸孔信息表
|
||||
* author: xusan
|
||||
* date: 2024-09-26 10:44:57
|
||||
*/
|
||||
@Tag(name = "闸孔信息表")
|
||||
@RestController
|
||||
@RequestMapping(value="/gatePore")
|
||||
public class GatePoreController {
|
||||
|
||||
@Autowired
|
||||
private GatePoreService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<GatePore> insert(@Validated(Insert.class) @RequestBody GatePore dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<GatePore> update(@Validated(Update.class) @RequestBody GatePore dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过stcd获取闸孔开度")
|
||||
@GetMapping("/listByStcd")
|
||||
public R<List<GatePore>> list(@Schema(name = "stcd",description = "测站编码") @RequestParam("stcd") String stcd) {
|
||||
return R.ok(service.lambdaQuery().eq(GatePore::getStcd,stcd).orderByAsc(GatePore::getGateNumber).list());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.GateValveCctvRelPage;
|
||||
import com.gunshi.project.hsz.entity.vo.GateValveCctvRelVo;
|
||||
import com.gunshi.project.hsz.model.GateValveCctvRel;
|
||||
import com.gunshi.project.hsz.service.GateValveCctvRelService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 闸阀关联视频点
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "闸阀关联视频点")
|
||||
@RestController
|
||||
@RequestMapping(value="/gateValveCctvRel")
|
||||
public class GateValveCctvRelController {
|
||||
|
||||
@Autowired
|
||||
private GateValveCctvRelService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<GateValveCctvRel> insert(@Validated(Insert.class)@RequestBody GateValveCctvRel dto) {
|
||||
if (service.lambdaQuery()
|
||||
.eq(GateValveCctvRel::getValveCode,dto.getValveCode())
|
||||
.eq(GateValveCctvRel::getIndexCode,dto.getIndexCode())
|
||||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前编号已关联");
|
||||
}
|
||||
dto.setId(IdWorker.getId());
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<GateValveCctvRel> update(@Validated(Update.class) @RequestBody GateValveCctvRel dto) {
|
||||
if (Objects.isNull(service.getById(dto.getId()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
if (service.lambdaQuery()
|
||||
.eq(GateValveCctvRel::getValveCode,dto.getValveCode())
|
||||
.eq(GateValveCctvRel::getIndexCode,dto.getIndexCode())
|
||||
.ne(GateValveCctvRel::getId,dto.getId())
|
||||
.count() > 0) {
|
||||
throw new IllegalArgumentException("当前编号已关联");
|
||||
}
|
||||
dto.setCreateTime(null);
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<GateValveCctvRelVo>> list(@RequestParam(value = "valveCode",required = false) @Parameter(description = "闸阀编码") String valveCode) {
|
||||
return R.ok(service.queryList(valveCode));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<GateValveCctvRelVo>> page(@RequestBody GateValveCctvRelPage page) {
|
||||
return R.ok(service.pages(page));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.GateHisPageSo;
|
||||
import com.gunshi.project.hsz.entity.vo.GateStautsVo;
|
||||
import com.gunshi.project.hsz.model.GateValveR;
|
||||
import com.gunshi.project.hsz.service.GateValveRService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 闸阀开关历史表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "闸阀开关历史表")
|
||||
@RestController
|
||||
@RequestMapping(value="/gateValveR")
|
||||
public class GateValveRController {
|
||||
|
||||
@Autowired
|
||||
private GateValveRService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<GateValveR> insert(@Validated(Insert.class) @RequestBody GateValveR dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<GateValveR> update(@Validated(Update.class) @RequestBody GateValveR dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<GateValveR>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<GateStautsVo>> page(@RequestBody GateHisPageSo so) {
|
||||
return R.ok(service.pageQuery(so));
|
||||
}
|
||||
|
||||
@Operation(summary = "导出")
|
||||
@PostMapping("/export")
|
||||
public void export(@RequestBody GateHisPageSo so, HttpServletResponse response) {
|
||||
service.export(so,response);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,181 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
|
||||
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
|
||||
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.GateHisPageSo;
|
||||
import com.gunshi.project.hsz.entity.vo.GateStautsVo;
|
||||
import com.gunshi.project.hsz.entity.vo.GateValveOplogVo;
|
||||
import com.gunshi.project.hsz.model.GateValveKey;
|
||||
import com.gunshi.project.hsz.model.GateValveOplog;
|
||||
import com.gunshi.project.hsz.model.GateValveReal;
|
||||
import com.gunshi.project.hsz.service.GateValveRealService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.poi.ss.usermodel.FillPatternType;
|
||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 闸阀开关表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "闸阀开关表")
|
||||
@RestController
|
||||
@RequestMapping(value="/gateValveReal")
|
||||
public class GateValveRealController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GateValveRealController.class);
|
||||
|
||||
|
||||
@Autowired
|
||||
private GateValveRealService service;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<GateValveReal> insert(@Validated(Insert.class) @RequestBody GateValveReal dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<GateValveReal> update(@Validated(Update.class) @RequestBody GateValveReal dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<GateStautsVo>> list() {
|
||||
return R.ok(service.gateStatusList());
|
||||
}
|
||||
|
||||
@Operation(summary = "通过闸阀查询实时流量")
|
||||
@GetMapping("/realQ")
|
||||
public R<BigDecimal> realQ(@RequestParam("valveCode") @Parameter(description = "闸阀编码") String valveCode) {
|
||||
return R.ok(service.realQ(valveCode));
|
||||
}
|
||||
|
||||
@Operation(summary = "调节闸阀")
|
||||
@PostMapping("/control")
|
||||
public R<String> control(@RequestBody GateValveKey gateValveKey) {
|
||||
return R.ok(service.control(gateValveKey));
|
||||
}
|
||||
|
||||
@Operation(summary = "闸阀操作日志-分页")
|
||||
@PostMapping("/log/page")
|
||||
public R<Page<GateValveOplogVo>> logPage(@RequestBody GateHisPageSo so) {
|
||||
return R.ok(service.logPage(so));
|
||||
}
|
||||
|
||||
@Operation(summary = "闸阀操作日志-导出")
|
||||
@PostMapping("/log/exp")
|
||||
public void logexp(@RequestBody GateHisPageSo so, HttpServletResponse response) {
|
||||
so.getPageSo().setPageSize(1000000);
|
||||
Page<GateValveOplogVo> gateValveOplogVoPage = service.logPage(so);
|
||||
|
||||
try {
|
||||
// 设置响应
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
String fileName = URLEncoder.encode("闸阀操作日志_" + System.currentTimeMillis(), "UTF-8")
|
||||
.replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
|
||||
// 自定义表头样式
|
||||
WriteCellStyle headStyle = new WriteCellStyle();
|
||||
headStyle.setFillForegroundColor(IndexedColors.SKY_BLUE.getIndex());
|
||||
headStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
|
||||
|
||||
// 自定义内容样式
|
||||
WriteCellStyle contentStyle = new WriteCellStyle();
|
||||
contentStyle.setWrapped(true); // 自动换行
|
||||
List<List<String>> headlist= Arrays.asList(
|
||||
Arrays.asList("闸阀名称"),
|
||||
Arrays.asList("操作人"),
|
||||
Arrays.asList("操作时间"),
|
||||
Arrays.asList("操作内容"),
|
||||
Arrays.asList("设定开度"),
|
||||
Arrays.asList("操作前开度")
|
||||
);
|
||||
// 构建导出器
|
||||
EasyExcel.write(response.getOutputStream())
|
||||
.head(headlist) // 自定义表头
|
||||
.registerWriteHandler(new HorizontalCellStyleStrategy(headStyle, contentStyle))
|
||||
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) // 自动列宽
|
||||
.sheet("闸阀操作日志")
|
||||
.doWrite(gateValveOplogVoPage.getRecords());
|
||||
}catch (Exception e){
|
||||
log.error("导出异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "闸阀操作日志-分页")
|
||||
@PostMapping("/log/loglist")
|
||||
public R<List<GateValveOplogVo>> loglist(@RequestBody GateHisPageSo so) {
|
||||
List<GateStautsVo> gateStautsVos = service.gateStatusList();
|
||||
if(CollectionUtil.isEmpty(gateStautsVos)){
|
||||
return R.ok(null);
|
||||
}
|
||||
List<GateValveOplogVo> collect = gateStautsVos.stream().map(e -> {
|
||||
GateValveOplogVo vo = new GateValveOplogVo();
|
||||
GateValveOplog loginfo = service.loginfo(e.getValveCode());
|
||||
if(Objects.nonNull(loginfo)){
|
||||
BeanUtils.copyProperties(loginfo, vo);
|
||||
}
|
||||
vo.setValveCode(e.getValveCode());
|
||||
vo.setValveName(e.getValveName());
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
return R.ok(collect);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "闸阀操作日志-导出")
|
||||
@PostMapping("/log/export")
|
||||
public void logExport(@RequestBody GateHisPageSo so, HttpServletResponse response) {
|
||||
service.logExport(so,response);
|
||||
}
|
||||
|
||||
@Operation(summary = "预计可供水时间")
|
||||
@GetMapping("/supply/time")
|
||||
public R<Map<BigDecimal, String>> supplyTime(@RequestParam(value = "year",required = false) @Parameter(description = "年份") Integer year,@RequestParam(value = "month",required = false) @Parameter(description = "月份") Integer month) {
|
||||
return R.ok(service.supplyTime(year,month));
|
||||
}
|
||||
|
||||
@Operation(summary = "预测来水量")
|
||||
@GetMapping("/predict/water")
|
||||
public R<BigDecimal> predictWater(@RequestParam(value = "year") @Parameter(description = "年份") Integer year, @RequestParam(value = "month") @Parameter(description = "月份") Integer month) {
|
||||
return R.ok(service.predictWater(year,month));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.db.dao.BaseDao;
|
||||
import com.gunshi.db.dao.IMapper;
|
||||
import com.gunshi.project.hsz.service.AbstractModelWithAttachService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 通用按id删除
|
||||
*
|
||||
* @author lyf
|
||||
* @version 1.0.0
|
||||
* @since 2024-01-31
|
||||
*/
|
||||
public interface ICommonDeleteByIdWithAttach<Model extends AbstractModelWithAttachService.GetFileIds, AutoMapper extends IMapper<Model>, AutoDao extends BaseDao<AutoMapper, Model>,
|
||||
AttachModel, AttachModelAutoMapper extends IMapper<AttachModel>, AttachModelAutoDao extends BaseDao<AttachModelAutoMapper, AttachModel>> {
|
||||
|
||||
AbstractModelWithAttachService<Model,AutoMapper,AutoDao,AttachModel, AttachModelAutoMapper, AttachModelAutoDao> getModelService();
|
||||
|
||||
Serializable getId(Serializable id);
|
||||
|
||||
@Operation(summary = "按id删除")
|
||||
@GetMapping("/deleteById/{id}")
|
||||
default R<Boolean> commonDeleteById(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(getModelService().removeById(getId(id)));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.file.controller.IFileController;
|
||||
import com.gunshi.file.model.FileDescriptor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* 类描述
|
||||
*
|
||||
* @author lyf
|
||||
* @version 1.0.0
|
||||
* @since 2024-03-12
|
||||
*/
|
||||
public interface ICommonFileController extends IFileController {
|
||||
|
||||
String getGroupId();
|
||||
|
||||
String getBusinessType();
|
||||
|
||||
R<FileDescriptor> uploadSingle(
|
||||
@Parameter(description = "文件") @RequestPart("file") MultipartFile file,
|
||||
@Parameter(description = "上传者用户id", hidden = true) @RequestParam(value = "userId", required = false) Long userId,
|
||||
@Parameter(hidden = true) HttpServletRequest request) throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.db.dao.BaseDao;
|
||||
import com.gunshi.db.dao.IMapper;
|
||||
import com.gunshi.project.hsz.service.AbstractModelWithAttachService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* 类描述
|
||||
*
|
||||
* @author lyf
|
||||
* @version 1.0.0
|
||||
* @since 2024-03-19
|
||||
*/
|
||||
public interface ICommonInsertWithAttach<Model extends AbstractModelWithAttachService.GetFileIds, AutoMapper extends IMapper<Model>, AutoDao extends BaseDao<AutoMapper, Model>,
|
||||
AttachModel, AttachModelAutoMapper extends IMapper<AttachModel>, AttachModelAutoDao extends BaseDao<AttachModelAutoMapper, AttachModel>> {
|
||||
AbstractModelWithAttachService<Model,AutoMapper,AutoDao,AttachModel, AttachModelAutoMapper, AttachModelAutoDao> getModelService();
|
||||
|
||||
void customSetFieldForInsert(Model model);
|
||||
|
||||
@Operation(summary = "实体类新增")
|
||||
@PostMapping("/insert")
|
||||
default R<Model> commonInsert(@Validated(Insert.class) @RequestBody Model model) {
|
||||
customSetFieldForInsert(model);
|
||||
boolean result = getModelService().save(model);
|
||||
return R.ok(result ? model : null);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.db.dao.BaseDao;
|
||||
import com.gunshi.db.dao.IMapper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类描述
|
||||
*
|
||||
* @author lyf
|
||||
* @version 1.0.0
|
||||
* @since 2024-03-19
|
||||
*/
|
||||
public interface ICommonQueryAttach<AttachModel, IdType, AutoMapper extends IMapper<AttachModel>, AutoDao extends BaseDao<AutoMapper, AttachModel>> {
|
||||
AutoDao getAttachAutoDao();
|
||||
|
||||
String getAttachBzIdName();
|
||||
|
||||
IdType getId(Serializable id);
|
||||
|
||||
@Operation(summary = "按id查询")
|
||||
@GetMapping("/attach/getById/{id}")
|
||||
default R<AttachModel> commonGetAttachById(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(getAttachAutoDao().getById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "按bzId查询")
|
||||
@GetMapping("/attach/getByBzId/{bzId}")
|
||||
default R<List<AttachModel>> commonGetAttachByBzId(@Schema(name = "bzId") @PathVariable("bzId") Serializable bzId) {
|
||||
return R.ok(getAttachAutoDao().list(new QueryWrapper<AttachModel>().eq(getAttachBzIdName(), getId(bzId))));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表查询")
|
||||
@GetMapping("/attach/find")
|
||||
default R<List<AttachModel>> commonFind(@Schema(name = "bzId") @PathVariable("bzId") Serializable bzId) {
|
||||
return R.ok(getAttachAutoDao().list(new QueryWrapper<AttachModel>().eq(getAttachBzIdName(), getId(bzId))));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.db.dao.BaseDao;
|
||||
import com.gunshi.db.dao.IMapper;
|
||||
import com.gunshi.project.hsz.service.AbstractModelWithAttachService;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* 通用实体类新增
|
||||
*
|
||||
* @author lyf
|
||||
* @version 1.0.0
|
||||
* @since 2024-02-19
|
||||
*/
|
||||
public interface ICommonUpdateByIdWithAttach<Model extends AbstractModelWithAttachService.GetFileIds, AutoMapper extends IMapper<Model>, AutoDao extends BaseDao<AutoMapper, Model>,
|
||||
AttachModel, AttachModelAutoMapper extends IMapper<AttachModel>, AttachModelAutoDao extends BaseDao<AttachModelAutoMapper, AttachModel>> {
|
||||
|
||||
AbstractModelWithAttachService<Model,AutoMapper,AutoDao,AttachModel, AttachModelAutoMapper, AttachModelAutoDao> getModelService();
|
||||
|
||||
void customSetFieldForUpdate(Model model);
|
||||
|
||||
@Operation(summary = "实体类修改")
|
||||
@PostMapping("/update")
|
||||
default R<Model> commonUpdateById(@Validated(Update.class) @RequestBody Model model) {
|
||||
customSetFieldForUpdate(model);
|
||||
boolean result = getModelService().updateById(model);
|
||||
return R.ok(result ? model : null);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,151 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.file.model.FileDescriptor;
|
||||
import com.gunshi.project.hsz.entity.vo.HomeIaCBsnssinfoVo;
|
||||
import com.gunshi.project.hsz.model.FileAssociations;
|
||||
import com.gunshi.project.hsz.model.IaCBsnssinfo;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.service.IaCBsnssinfoService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 防治区企事业单位汇总表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "防治区企事业单位汇总表")
|
||||
@RestController
|
||||
@RequestMapping(value="/iaCBsnssinfo")
|
||||
public class IaCBsnssinfoController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private IaCBsnssinfoService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<IaCBsnssinfo> insert(@Validated(Insert.class) @RequestBody IaCBsnssinfo dto) {
|
||||
if (Objects.nonNull(service.getById(dto.getEicd()))) {
|
||||
throw new IllegalArgumentException("当前编号已存在");
|
||||
}
|
||||
if (StringUtils.isNotBlank(dto.getName())){
|
||||
if (service.lambdaQuery().eq(IaCBsnssinfo::getName,dto.getName()).count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
}
|
||||
|
||||
boolean result = service.save(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getEicd());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<IaCBsnssinfo> update(@Validated(Update.class) @RequestBody IaCBsnssinfo dto) {
|
||||
if (Objects.isNull(service.getById(dto.getEicd()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getEicd());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
boolean data = service.removeById(id);
|
||||
|
||||
if (data){
|
||||
fileService.deleteFile(getGroupId(),id.toString());
|
||||
}
|
||||
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<IaCBsnssinfo>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<IaCBsnssinfo>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
@Operation(summary = "详情和行政区划数据查询")
|
||||
@PostMapping("/getDetailsAndAddvcdDataList")
|
||||
public R<List<HomeIaCBsnssinfoVo>> getDetailsAndMonitoringDataList() {
|
||||
List<HomeIaCBsnssinfoVo> list = service.getDetailsAndMonitoringDataLis();
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
list.forEach(o -> o.setFiles(fileService.getFiles(getGroupId(),o.getEicd())));
|
||||
}
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "上传相关图片文件")
|
||||
@PostMapping(path = "/setImgFile", consumes = "multipart/form-data")
|
||||
public R setImgFile(@Parameter(description = "文件") @RequestPart("files") MultipartFile[] files) throws Exception {
|
||||
|
||||
for (MultipartFile file : files) {
|
||||
|
||||
String fileName = file.getOriginalFilename();
|
||||
String eicd = fileName.split("\\.")[0];
|
||||
|
||||
FileDescriptor fd = new FileDescriptor();
|
||||
fd.setBusinessType(getBusinessType());
|
||||
fd.setGroupId(getGroupId());
|
||||
fd.setUserId(1L);
|
||||
fd.setAccessGroup(getService().getAccessGroup());
|
||||
fd.setFilePath(generateFilePath(getProperty().getAppCode(), getBusinessType(), 1L, getGroupId(), fileName));
|
||||
fd.setFileName(fileName);
|
||||
fd.setFileLength(file.getSize());
|
||||
|
||||
getService().upload(fd, file.getInputStream());
|
||||
|
||||
FileAssociations fileAssociations = new FileAssociations();
|
||||
fileAssociations.setFileId(fd.getFileId());
|
||||
|
||||
fileService.saveFile(Lists.newArrayList(fileAssociations), getGroupId(), eicd);
|
||||
}
|
||||
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "iaCBsnssinfo";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.vo.HomeIaCDanadVo;
|
||||
import com.gunshi.project.hsz.model.IaCDanad;
|
||||
import com.gunshi.project.hsz.service.IaCDanadService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 危险区基本情况调查成果汇总表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "危险区基本情况调查成果汇总表")
|
||||
@RestController
|
||||
@RequestMapping(value="/iaCDanad")
|
||||
public class IaCDanadController {
|
||||
|
||||
@Autowired
|
||||
private IaCDanadService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<IaCDanad> insert(@Validated(Insert.class) @RequestBody IaCDanad dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<IaCDanad> update(@Validated(Update.class) @RequestBody IaCDanad dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "详情")
|
||||
@GetMapping("/detail/{id}")
|
||||
public R<HomeIaCDanadVo> detail(@Schema(name = "id") @PathVariable("id") String id) {
|
||||
return R.ok(service.detail(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<IaCDanad>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<IaCDanad>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "详情和行政区划数据查询")
|
||||
@PostMapping("/getDetailsAndAddvcdDataList")
|
||||
public R<List<HomeIaCDanadVo>> getDetailsAndMonitoringDataList() {
|
||||
return R.ok(service.getDetailsAndMonitoringDataLis());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.file.model.FileDescriptor;
|
||||
import com.gunshi.project.hsz.entity.vo.HomeIaCFlrvvlgVo;
|
||||
import com.gunshi.project.hsz.model.FileAssociations;
|
||||
import com.gunshi.project.hsz.model.IaCFlrvvlg;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.service.IaCFlrvvlgService;
|
||||
import com.gunshi.project.hsz.service.StAddvcdDService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 重要沿河村落居民户调查成果表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "重要沿河村落居民户调查成果表")
|
||||
@RestController
|
||||
@RequestMapping(value="/iaCFlrvvlg")
|
||||
public class IaCFlrvvlgController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private IaCFlrvvlgService service;
|
||||
|
||||
@Autowired
|
||||
private StAddvcdDService stAddvcdDService;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<IaCFlrvvlg> insert(@Validated(Insert.class) @RequestBody IaCFlrvvlg dto) {
|
||||
if (Objects.isNull(stAddvcdDService.getById(dto.getAdcd()))) {
|
||||
throw new RuntimeException("请输入正确的行政区划代码");
|
||||
}
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<IaCFlrvvlg> update(@Validated(Update.class) @RequestBody IaCFlrvvlg dto) {
|
||||
|
||||
if (Objects.isNull( service.getById(dto.getAvrcd()))){
|
||||
throw new RuntimeException("请输入正确的沿河村落居民户编码");
|
||||
}
|
||||
if (Objects.isNull(stAddvcdDService.getById(dto.getAdcd()))) {
|
||||
throw new RuntimeException("请输入正确的行政区划代码");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(stAddvcdDService.getById(id))) {
|
||||
throw new RuntimeException("请输入正确的行政区划代码");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<IaCFlrvvlg>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<IaCFlrvvlg>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "详情和行政区划数据查询")
|
||||
@PostMapping("/getDetailsAndAddvcdDataList")
|
||||
public R<List<HomeIaCFlrvvlgVo>> getDetailsAndMonitoringDataList() {
|
||||
return R.ok(service.getDetailsAndMonitoringDataLis());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "上传相关图片文件")
|
||||
@PostMapping(path = "/setImgFile", consumes = "multipart/form-data")
|
||||
public R setImgFile(@Parameter(description = "文件") @RequestPart("files") MultipartFile[] files) throws Exception {
|
||||
|
||||
for (MultipartFile file : files) {
|
||||
|
||||
String fileName = file.getOriginalFilename();
|
||||
String eicd = fileName.split("\\.")[0];
|
||||
|
||||
FileDescriptor fd = new FileDescriptor();
|
||||
fd.setBusinessType(getBusinessType());
|
||||
fd.setGroupId(getGroupId());
|
||||
fd.setUserId(1L);
|
||||
fd.setAccessGroup(getService().getAccessGroup());
|
||||
fd.setFilePath(generateFilePath(getProperty().getAppCode(), getBusinessType(), 1L, getGroupId(), fileName));
|
||||
fd.setFileName(fileName);
|
||||
fd.setFileLength(file.getSize());
|
||||
|
||||
getService().upload(fd, file.getInputStream());
|
||||
|
||||
FileAssociations fileAssociations = new FileAssociations();
|
||||
fileAssociations.setFileId(fd.getFileId());
|
||||
|
||||
fileService.saveFile(Lists.newArrayList(fileAssociations), getGroupId(), eicd);
|
||||
}
|
||||
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "iaCFlrvvlg";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.dto.InspectItemDto;
|
||||
import com.gunshi.project.hsz.entity.so.AttCctvBasePage;
|
||||
import com.gunshi.project.hsz.model.InspectItem;
|
||||
import com.gunshi.project.hsz.service.InspectItemService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 描述: 巡检项
|
||||
* author: xusan
|
||||
* date: 2024-08-29 09:58:10
|
||||
*/
|
||||
@Tag(name = "巡检项")
|
||||
@RestController
|
||||
@RequestMapping(value="/inspectItem")
|
||||
public class InspectItemController {
|
||||
|
||||
@Autowired
|
||||
private InspectItemService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<InspectItem> insert(@Validated(Insert.class) @RequestBody InspectItem dto) {
|
||||
dto.setId(IdWorker.getId());
|
||||
dto.setStatus(0);
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<InspectItem> update(@Validated(Update.class) @RequestBody InspectItem dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "启停")
|
||||
@PostMapping("/startStop")
|
||||
public R<String> startStop(@RequestBody InspectItemDto dto) {
|
||||
return R.ok(service.startStop(dto));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<InspectItem>> page(@RequestBody @Validated AttCctvBasePage page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.InspectPoint;
|
||||
import com.gunshi.project.hsz.service.InspectPointService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 巡检点
|
||||
* author: xusan
|
||||
* date: 2024-08-29 09:57:47
|
||||
*/
|
||||
@Tag(name = "巡检点")
|
||||
@RestController
|
||||
@RequestMapping(value="/inspect/point")
|
||||
public class InspectPointController {
|
||||
|
||||
@Autowired
|
||||
private InspectPointService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<InspectPoint> insert(@Validated(Insert.class) @RequestBody InspectPoint dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<InspectPoint> update(@Validated(Update.class) @RequestBody InspectPoint dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@GetMapping("/list")
|
||||
public R<List<InspectPoint>> list() {
|
||||
return R.ok(service.lambdaQuery().orderByAsc(InspectPoint::getOrderIndex).list());
|
||||
}
|
||||
|
||||
@Operation(summary = "列表(带巡检项)")
|
||||
@GetMapping("/listWithItem")
|
||||
public R<List<InspectPoint>> listWithItem() {
|
||||
return R.ok(service.listWithItem());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.InspectTaskPageSo;
|
||||
import com.gunshi.project.hsz.entity.so.InspectTaskSo;
|
||||
import com.gunshi.project.hsz.entity.vo.InspectTaskVo;
|
||||
import com.gunshi.project.hsz.model.InspectTask;
|
||||
import com.gunshi.project.hsz.service.InspectTaskService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 巡检任务
|
||||
* author: xusan
|
||||
* date: 2024-08-29 14:21:15
|
||||
*/
|
||||
@Tag(name = "巡检任务")
|
||||
@RestController
|
||||
@RequestMapping(value="/inspect/task")
|
||||
public class InspectTaskController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private InspectTaskService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<InspectTask> insert(@Validated(Insert.class) @RequestBody InspectTask dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<InspectTask> update(@Validated(Update.class) @RequestBody InspectTask dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<InspectTask>> page(@RequestBody @Validated InspectTaskPageSo page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
@Operation(summary = "开始巡检")
|
||||
@GetMapping("/startInspect/{id}")
|
||||
public R<Boolean> startInspect(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.startInspect(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "APP-保存/结束巡查")
|
||||
@PostMapping("/finish")
|
||||
public R<Boolean> finish(@RequestBody @Validated InspectTaskVo vo) {
|
||||
return R.ok(service.finish(vo));
|
||||
}
|
||||
|
||||
@Operation(summary = "APP-我的巡查任务")
|
||||
@PostMapping("/list")
|
||||
public R<List<InspectTask>> list(@RequestBody @Validated InspectTaskSo so) {
|
||||
return R.ok(service.listQuery(so));
|
||||
}
|
||||
|
||||
@Operation(summary = "本月巡查记录")
|
||||
@PostMapping("/month")
|
||||
public R<List<InspectTask>> month() {
|
||||
return R.ok(service.month());
|
||||
}
|
||||
|
||||
@Operation(summary = "本年巡查")
|
||||
@PostMapping("/year")
|
||||
public R<Integer> year() {
|
||||
return R.ok(service.year());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "inspectTask";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.InspectProblemPageSo;
|
||||
import com.gunshi.project.hsz.entity.vo.InspectProblemVo;
|
||||
import com.gunshi.project.hsz.entity.vo.InspectTaskDetailVo;
|
||||
import com.gunshi.project.hsz.model.InspectTaskDetail;
|
||||
import com.gunshi.project.hsz.service.InspectTaskDetailService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 巡查信息
|
||||
* author: xusan
|
||||
* date: 2024-08-29 14:21:45
|
||||
*/
|
||||
@Tag(name = "巡查信息")
|
||||
@RestController
|
||||
@RequestMapping(value="/inspect/detail")
|
||||
public class InspectTaskDetailController{
|
||||
|
||||
@Autowired
|
||||
private InspectTaskDetailService service;
|
||||
|
||||
@Operation(summary = "编辑详情")
|
||||
@GetMapping("/getByTaskId")
|
||||
public R<List<InspectTaskDetail>> getByTaskId(@Schema(name = "taskId",description = "任务id") @RequestParam(name = "taskId") Long taskId) {
|
||||
return R.ok(service.getByTaskId(taskId));
|
||||
}
|
||||
|
||||
@Operation(summary = "巡查任务详情-巡查信息")
|
||||
@GetMapping("/info")
|
||||
public R<List<InspectTaskDetailVo>> inspectInfo(@Schema(name = "taskId",description = "任务id") @RequestParam(name = "taskId") Long taskId) {
|
||||
return R.ok(service.inspectInfo(taskId));
|
||||
}
|
||||
|
||||
@Operation(summary = "巡检问题处理分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<InspectProblemVo>> page(@RequestBody @Validated InspectProblemPageSo page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
@Operation(summary = "APP-处理")
|
||||
@PostMapping("/handle")
|
||||
public R<String> handle(@RequestBody @Validated InspectProblemVo vo) {
|
||||
return R.ok(service.handle(vo));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "待处理问题清单")
|
||||
@PostMapping("/handle/list")
|
||||
public R<List<InspectProblemVo>> handelList() {
|
||||
return R.ok(service.handelList());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.InspectTaskTrack;
|
||||
import com.gunshi.project.hsz.service.InspectTaskTrackService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 巡查轨迹
|
||||
* author: xusan
|
||||
* date: 2024-09-18 13:59:21
|
||||
*/
|
||||
@Tag(name = "巡查轨迹")
|
||||
@RestController
|
||||
@RequestMapping(value="/inspectTaskTrack")
|
||||
public class InspectTaskTrackController {
|
||||
|
||||
@Autowired
|
||||
private InspectTaskTrackService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<InspectTaskTrack> insert(@Validated(Insert.class) @RequestBody InspectTaskTrack dto) {
|
||||
dto.setCreateTime(new Date());
|
||||
dto.setId(IdWorker.getId());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<InspectTaskTrack>> list(@Schema(name = "taskId",description = "任务id") @RequestParam(name = "taskId") Long taskId) {
|
||||
return R.ok(service.lambdaQuery().eq(InspectTaskTrack::getTaskId,taskId).orderByAsc(InspectTaskTrack::getCreateTime).list());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.MaintainPageSo;
|
||||
import com.gunshi.project.hsz.model.MaintainService;
|
||||
import com.gunshi.project.hsz.service.MaintainServiceService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 维修养护
|
||||
* author: xusan
|
||||
* date: 2024-08-27 15:15:14
|
||||
*/
|
||||
@Tag(name = "维修养护")
|
||||
@RestController
|
||||
@RequestMapping(value="/maintain/service")
|
||||
public class MaintainServiceController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private MaintainServiceService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<MaintainService> insert(@Validated(Insert.class) @RequestBody MaintainService dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<MaintainService> update(@Validated(Update.class) @RequestBody MaintainService dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<MaintainService>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<MaintainService>> page(@RequestBody MaintainPageSo page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "maintainService";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.db.dto.DateTimeRangeSo;
|
||||
import com.gunshi.project.hsz.entity.so.MessageCenterPageSo;
|
||||
import com.gunshi.project.hsz.model.MessageCenter;
|
||||
import com.gunshi.project.hsz.service.MessageCenterService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 消息中心
|
||||
* author: xusan
|
||||
* date: 2024-09-19 10:39:29
|
||||
*/
|
||||
@Tag(name = "消息中心")
|
||||
@RestController
|
||||
@RequestMapping(value="/messageCenter")
|
||||
public class MessageCenterController {
|
||||
|
||||
@Autowired
|
||||
private MessageCenterService service;
|
||||
|
||||
@Operation(summary = "分页查询")
|
||||
@PostMapping("/list/page")
|
||||
public R<Page<MessageCenter>> listPage(@Validated @RequestBody MessageCenterPageSo page) {
|
||||
return R.ok(service.listPage(page));
|
||||
}
|
||||
|
||||
@Operation(summary = "已读")
|
||||
@PostMapping("/update")
|
||||
public R<MessageCenter> update(@Validated @RequestBody MessageCenter dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "全部标注已读")
|
||||
@GetMapping("/all/read")
|
||||
public R<Boolean> allRead() {
|
||||
return R.ok(service.allRead());
|
||||
}
|
||||
|
||||
@Operation(summary = "APP-消息中心")
|
||||
@PostMapping("/list")
|
||||
public R<List<MessageCenter>> listMes(@Validated @RequestBody DateTimeRangeSo dateTimeRangeSo) {
|
||||
return R.ok(service.listMes(dateTimeRangeSo));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.OsmoticDevicePage;
|
||||
import com.gunshi.project.hsz.entity.vo.HomeOsmoticFlowDeviceVo;
|
||||
import com.gunshi.project.hsz.model.OsmoticFlowDevice;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.service.OsmoticFlowDeviceService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 渗流设备表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "渗流设备表")
|
||||
@RestController
|
||||
@RequestMapping(value="/osmoticFlowDevice")
|
||||
public class OsmoticFlowDeviceController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private OsmoticFlowDeviceService service;
|
||||
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<OsmoticFlowDevice> insert(@Validated(Insert.class) @RequestBody OsmoticFlowDevice dto) {
|
||||
if (Objects.nonNull(service.getById(dto.getStationCode()))) {
|
||||
throw new IllegalArgumentException("当前编号已存在");
|
||||
}
|
||||
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getStationCode());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<OsmoticFlowDevice> update(@Validated(Update.class) @RequestBody OsmoticFlowDevice dto) {
|
||||
if (Objects.isNull(service.getById(dto.getStationCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
dto.setCreateTime(null);
|
||||
boolean result = service.updateById(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getStationCode());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<OsmoticFlowDevice>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<OsmoticFlowDevice>> page(@RequestBody @Validated OsmoticDevicePage page) {
|
||||
LambdaQueryWrapper<OsmoticFlowDevice> query = Wrappers.lambdaQuery();
|
||||
if (ObjectUtils.isNotNull(page.getStationCode())) {
|
||||
query.like(OsmoticFlowDevice::getStationCode, page.getStationCode());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getDeviceCode())) {
|
||||
query.like(OsmoticFlowDevice::getDeviceName, page.getDeviceCode());
|
||||
}
|
||||
query.orderByDesc(OsmoticFlowDevice::getCreateTime);
|
||||
|
||||
Page<OsmoticFlowDevice> data = service.page(page.getPageSo().toPage(), query);
|
||||
data.getRecords().forEach(o -> o.setFiles(
|
||||
fileService.getFiles(getGroupId(),o.getStationCode())
|
||||
));
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "详情和监测数据查询")
|
||||
@PostMapping("/getDetailsAndMonitoringDataList")
|
||||
public R<List<HomeOsmoticFlowDeviceVo>> getDetailsAndMonitoringDataList() {
|
||||
return R.ok(service.getDetailsAndMonitoringDataList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "OsmoticFlowDevice";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.OsmoticQueryPageSo;
|
||||
import com.gunshi.project.hsz.model.OsmoticFlowR;
|
||||
import com.gunshi.project.hsz.service.OsmoticFlowRService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 渗流监测记录表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "渗流监测记录表")
|
||||
@RestController
|
||||
@RequestMapping(value="/osmoticFlowR")
|
||||
public class OsmoticFlowRController {
|
||||
|
||||
@Autowired
|
||||
private OsmoticFlowRService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<OsmoticFlowR> insert(@Validated(Insert.class) @RequestBody OsmoticFlowR dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<OsmoticFlowR> update(@Validated(Update.class) @RequestBody OsmoticFlowR dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<OsmoticFlowR>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<OsmoticFlowR>> page(@RequestBody OsmoticQueryPageSo osmoticQueryPageSo) {
|
||||
return R.ok(service.queryPage(osmoticQueryPageSo));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.OsmoticDevicePage;
|
||||
import com.gunshi.project.hsz.entity.vo.HomeOsmoticPressDeviceVo;
|
||||
import com.gunshi.project.hsz.model.OsmoticPressDevice;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.service.OsmoticPressDeviceService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 渗压设备表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "渗压设备表")
|
||||
@RestController
|
||||
@RequestMapping(value="/osmoticPressDevice")
|
||||
public class OsmoticPressDeviceController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private OsmoticPressDeviceService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<OsmoticPressDevice> insert(@Validated(Insert.class) @RequestBody OsmoticPressDevice dto) {
|
||||
if (Objects.nonNull(service.getById(dto.getStationCode()))) {
|
||||
throw new IllegalArgumentException("当前编号已存在");
|
||||
}
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getStationCode());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<OsmoticPressDevice> update(@Validated(Update.class) @RequestBody OsmoticPressDevice dto) {
|
||||
if (Objects.isNull(service.getById(dto.getStationCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
dto.setCreateTime(null);
|
||||
boolean result = service.updateById(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getStationCode());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<OsmoticPressDevice>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<OsmoticPressDevice>> page(@RequestBody @Validated OsmoticDevicePage page) {
|
||||
LambdaQueryWrapper<OsmoticPressDevice> query = Wrappers.lambdaQuery();
|
||||
|
||||
if (ObjectUtils.isNotNull(page.getStationCode())) {
|
||||
query.like(OsmoticPressDevice::getStationCode, page.getStationCode());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getDeviceCode())) {
|
||||
query.like(OsmoticPressDevice::getDeviceName, page.getDeviceCode());
|
||||
}
|
||||
|
||||
query.orderByDesc(OsmoticPressDevice::getCreateTime);
|
||||
|
||||
Page<OsmoticPressDevice> data = service.page(page.getPageSo().toPage(), query);
|
||||
data.getRecords().forEach(o -> o.setFiles(
|
||||
fileService.getFiles(getGroupId(),o.getStationCode())
|
||||
));
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "详情和监测数据查询")
|
||||
@PostMapping("/getDetailsAndMonitoringDataList")
|
||||
public R<List<HomeOsmoticPressDeviceVo>> getDetailsAndMonitoringDataList() {
|
||||
return R.ok(service.getDetailsAndMonitoringDataList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "OsmoticPressDevice";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
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.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.OsmoticDetailQuerySo;
|
||||
import com.gunshi.project.hsz.entity.so.OsmoticQueryPageSo;
|
||||
import com.gunshi.project.hsz.entity.so.OsmoticQuerySo;
|
||||
import com.gunshi.project.hsz.entity.vo.OsmoticChartVo;
|
||||
import com.gunshi.project.hsz.entity.vo.OsmoticPressDetailVo;
|
||||
import com.gunshi.project.hsz.entity.vo.OsmoticPressVo;
|
||||
import com.gunshi.project.hsz.entity.vo.OsmoticStationVo;
|
||||
import com.gunshi.project.hsz.model.OsmoticPressDevice;
|
||||
import com.gunshi.project.hsz.model.OsmoticPressR;
|
||||
import com.gunshi.project.hsz.service.OsmoticPressDeviceService;
|
||||
import com.gunshi.project.hsz.service.OsmoticPressRService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 渗压监测记录表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "渗压监测记录表")
|
||||
@RestController
|
||||
@RequestMapping(value="/osmoticPressR")
|
||||
public class OsmoticPressRController {
|
||||
|
||||
@Autowired
|
||||
private OsmoticPressRService service;
|
||||
|
||||
@Autowired
|
||||
private OsmoticPressDeviceService osmoticPressDeviceService;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<OsmoticPressR> insert(@Validated(Insert.class) @RequestBody OsmoticPressR dto) {
|
||||
// // 通过时间戳去除毫秒
|
||||
// long currentTime = System.currentTimeMillis();
|
||||
// long seconds = currentTime / 1000; // 去掉毫秒部分
|
||||
// Date dateWithoutMillis = new Date(seconds * 1000); // 转回毫秒时间戳
|
||||
// dto.setTm(dateWithoutMillis);
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<OsmoticPressR> update(@Validated(Update.class) @RequestBody OsmoticPressR dto) {
|
||||
LambdaUpdateWrapper<OsmoticPressR> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(OsmoticPressR::getTm, dto.getTm())
|
||||
.eq(OsmoticPressR::getStationCode, dto.getStationCode())
|
||||
.set(OsmoticPressR::getPress, dto.getPress())
|
||||
.set(OsmoticPressR::getVib, dto.getVib())
|
||||
.set(OsmoticPressR::getTemp, dto.getTemp())
|
||||
.set(OsmoticPressR::getValue, dto.getValue())
|
||||
.set(OsmoticPressR::getChan, dto.getChan());
|
||||
boolean update = service.update(null, wrapper);
|
||||
return R.ok(update ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}/{tm}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id,@Schema(name = "tm") @PathVariable("tm") Serializable tm) {
|
||||
if(Objects.isNull(id) || Objects.isNull(tm)){
|
||||
return R.ok(false);
|
||||
}
|
||||
QueryWrapper<OsmoticPressR> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("station_code", id).eq("tm", tm);
|
||||
return R.ok(service.remove(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<OsmoticPressR>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<OsmoticPressR>> page(@RequestBody OsmoticQueryPageSo osmoticQueryPageSo) {
|
||||
Page<OsmoticPressR> osmoticPressRPage = service.queryPage(osmoticQueryPageSo);
|
||||
List<OsmoticPressR> records = osmoticPressRPage.getRecords();
|
||||
if(CollectionUtils.isEmpty(records)){
|
||||
return R.ok(osmoticPressRPage);
|
||||
}
|
||||
List<OsmoticPressR> collect = records.stream().peek(e -> {
|
||||
LambdaQueryWrapper<OsmoticPressDevice> wq = new LambdaQueryWrapper();
|
||||
wq.eq(OsmoticPressDevice::getStationCode, e.getStationCode());
|
||||
List<OsmoticPressDevice> list = osmoticPressDeviceService.list(wq);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
OsmoticPressDevice osmoticPressDevice = list.stream().findFirst().orElse(null);
|
||||
e.setProfileCode(osmoticPressDevice.getProfileCode());
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
osmoticPressRPage.setRecords(collect);
|
||||
return R.ok(osmoticPressRPage);
|
||||
}
|
||||
|
||||
@Operation(summary = "大屏-大坝安全监测统计")
|
||||
@GetMapping("/stat")
|
||||
public R<Map<Integer,Integer>> stat() {
|
||||
return R.ok(service.stat());
|
||||
}
|
||||
|
||||
@Operation(summary = "布置图-渗压/渗流监测")
|
||||
@GetMapping("/list/value")
|
||||
public R<List<OsmoticPressVo>> listValue(@Schema(name = "type",description = "类型(1渗压 2渗流)") @RequestParam("type") Integer type) {
|
||||
return R.ok(service.listValue(type));
|
||||
}
|
||||
|
||||
@Operation(summary = "布置图-按测站查询渗压/渗流监测数据")
|
||||
@PostMapping("/detail/value")
|
||||
public R<List<OsmoticPressDetailVo>> detailValue(@RequestBody @Validated OsmoticDetailQuerySo so) {
|
||||
return R.ok(service.detailValue(so));
|
||||
}
|
||||
|
||||
@Operation(summary = "测值查询(数据表)")
|
||||
@PostMapping("/query/value")
|
||||
public R<List<OsmoticStationVo>> queryValue(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
||||
return R.ok(service.queryValue(osmoticQuerySo,null));
|
||||
}
|
||||
|
||||
@Operation(summary = "测值查询(多图单表)")
|
||||
@PostMapping("/query/chart")
|
||||
public R<List<OsmoticChartVo>> queryChart(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
||||
return R.ok(service.queryChart(osmoticQuerySo,null));
|
||||
}
|
||||
|
||||
@Operation(summary = "浸润线查询")
|
||||
@PostMapping("/infiltra/line")
|
||||
public R<List<OsmoticStationVo>> infiltraLine(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
||||
return R.ok(service.infiltraLine(osmoticQuerySo));
|
||||
}
|
||||
|
||||
@Operation(summary = "浸润线导出")
|
||||
@PostMapping( "/export")
|
||||
public void export(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo, HttpServletResponse response) {
|
||||
service.export(osmoticQuerySo,response);
|
||||
}
|
||||
|
||||
@Operation(summary = "年度渗压/渗流统计(表格)")
|
||||
@PostMapping("/year/stat")
|
||||
public R<List<OsmoticStationVo>> yearStat(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
||||
return R.ok(service.yearStat(osmoticQuerySo));
|
||||
}
|
||||
|
||||
@Operation(summary = "年度渗压/渗流统计(全年度特征值统计)")
|
||||
@PostMapping("/year/stat/value")
|
||||
public R<List<OsmoticChartVo>> yearStatValue(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
||||
return R.ok(service.yearStatValue(osmoticQuerySo));
|
||||
}
|
||||
|
||||
@Operation(summary = "年度渗压/渗流统计导出")
|
||||
@PostMapping( "/year/stat/export")
|
||||
public void yearStatExport(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo, HttpServletResponse response) {
|
||||
service.yearStatExport(osmoticQuerySo,response);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.vo.HomeOsmoticShiftDeviceVo;
|
||||
import com.gunshi.project.hsz.model.OsmoticShiftDevice;
|
||||
import com.gunshi.project.hsz.service.OsmoticShiftDeviceService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 位移监测记录表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "位移设备表")
|
||||
@RestController
|
||||
@RequestMapping(value="/osmoticShiftDevice")
|
||||
public class OsmoticShiftDeviceController {
|
||||
|
||||
@Autowired
|
||||
private OsmoticShiftDeviceService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<OsmoticShiftDevice> insert(@Validated(Insert.class) @RequestBody OsmoticShiftDevice dto) {
|
||||
if (Objects.nonNull(service.getById(dto.getStationCode()))) {
|
||||
throw new IllegalArgumentException("当前编号已存在");
|
||||
}
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<OsmoticShiftDevice> update(@Validated(Update.class) @RequestBody OsmoticShiftDevice dto) {
|
||||
if (Objects.isNull(service.getById(dto.getStationCode()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
dto.setCreateTime(null);
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<OsmoticShiftDevice>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<OsmoticShiftDevice>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "详情和监测数据查询(暂无设备表,无法使用)")
|
||||
@PostMapping("/getDetailsAndMonitoringDataList")
|
||||
public R<List<HomeOsmoticShiftDeviceVo>> getDetailsAndMonitoringDataList() {
|
||||
return R.ok(service.getDetailsAndMonitoringDataList());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
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.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.OsmoticDetailQuerySo;
|
||||
import com.gunshi.project.hsz.entity.so.OsmoticQueryPageSo;
|
||||
import com.gunshi.project.hsz.entity.so.OsmoticQuerySo;
|
||||
import com.gunshi.project.hsz.entity.vo.*;
|
||||
import com.gunshi.project.hsz.model.OsmoticShiftR;
|
||||
import com.gunshi.project.hsz.service.OsmoticShiftRService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 位移监测记录表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "位移监测记录表")
|
||||
@RestController
|
||||
@RequestMapping(value="/osmoticShiftR")
|
||||
public class OsmoticShiftRController {
|
||||
|
||||
@Autowired
|
||||
private OsmoticShiftRService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<OsmoticShiftR> insert(@Validated(Insert.class) @RequestBody OsmoticShiftR dto) {
|
||||
// dto.setTm(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<OsmoticShiftR> update(@Validated(Update.class) @RequestBody OsmoticShiftR dto) {
|
||||
LambdaUpdateWrapper<OsmoticShiftR> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(OsmoticShiftR::getStationCode, dto.getStationCode())
|
||||
.eq(OsmoticShiftR::getTm, dto.getTm())
|
||||
.set(OsmoticShiftR::getX, dto.getX())
|
||||
.set(OsmoticShiftR::getY, dto.getY())
|
||||
.set(OsmoticShiftR::getH, dto.getH());
|
||||
boolean update = service.update(null, wrapper);
|
||||
return R.ok(update ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}/{tm}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id,@Schema(name = "tm") @PathVariable("tm") Serializable tm) {
|
||||
|
||||
if(Objects.isNull(id) || Objects.isNull(tm)){
|
||||
return R.ok(false);
|
||||
}
|
||||
QueryWrapper<OsmoticShiftR> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("station_code", id).eq("tm", tm);
|
||||
return R.ok(service.remove(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<OsmoticShiftR>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<OsmoticShiftR>> page(@RequestBody OsmoticQueryPageSo osmoticQueryPageSo) {
|
||||
return R.ok(service.queryPage(osmoticQueryPageSo));
|
||||
}
|
||||
|
||||
@Operation(summary = "年度位移统计(表格)")
|
||||
@PostMapping("/year/stat")
|
||||
public R<List<OsmoticShiftVo>> yearStat(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
||||
return R.ok(service.yearStat(osmoticQuerySo));
|
||||
}
|
||||
|
||||
@Operation(summary = "年度位移统计(全年度特征值统计)")
|
||||
@PostMapping("/year/stat/value")
|
||||
public R<List<OsmoticChartVo>> yearStatValue(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo) {
|
||||
return R.ok(service.yearStatValue(osmoticQuerySo));
|
||||
}
|
||||
|
||||
@Operation(summary = "年度位移统计导出")
|
||||
@PostMapping( "/year/stat/export")
|
||||
public void yearStatExport(@RequestBody @Validated OsmoticQuerySo osmoticQuerySo, HttpServletResponse response) {
|
||||
service.yearStatExport(osmoticQuerySo,response);
|
||||
}
|
||||
|
||||
@Operation(summary = "布置图-位移监测")
|
||||
@GetMapping("/list/value")
|
||||
public R<List<OsmoticShiftListVo>> listValue() {
|
||||
return R.ok(service.listValue());
|
||||
}
|
||||
|
||||
@Operation(summary = "布置图-按测站查询位移监测数据")
|
||||
@PostMapping("/detail/value")
|
||||
public R<List<OsmoticShiftValueVo>> detailValue(@RequestBody @Validated OsmoticDetailQuerySo so) {
|
||||
return R.ok(service.detailValue(so));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.WarnPageSo;
|
||||
import com.gunshi.project.hsz.entity.so.WarnSo;
|
||||
import com.gunshi.project.hsz.entity.vo.OsmoticWarnVo;
|
||||
import com.gunshi.project.hsz.model.OsmoticWarnR;
|
||||
import com.gunshi.project.hsz.service.OsmoticWarnRService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 描述: 隐患预警记录表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "隐患预警记录表")
|
||||
@RestController
|
||||
@RequestMapping(value="/osmoticWarnR")
|
||||
public class OsmoticWarnRController {
|
||||
|
||||
@Autowired
|
||||
private OsmoticWarnRService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<OsmoticWarnR> insert(@Validated(Insert.class) @RequestBody OsmoticWarnR dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<OsmoticWarnR> update(@Validated(Update.class) @RequestBody OsmoticWarnR dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "统计")
|
||||
@PostMapping("/stat")
|
||||
public R<Map<Integer,Long>> stat(@RequestBody WarnSo warnSo) {
|
||||
return R.ok(service.stat(warnSo));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<OsmoticWarnVo>> page(@RequestBody WarnPageSo warnPageSo) {
|
||||
return R.ok(service.queryPage(warnPageSo));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.WarnRulePageSo;
|
||||
import com.gunshi.project.hsz.model.OsmoticWarnRule;
|
||||
import com.gunshi.project.hsz.service.OsmoticWarnRuleService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 预警规则配置表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "预警规则配置表")
|
||||
@RestController
|
||||
@RequestMapping(value="/osmoticWarnRule")
|
||||
public class OsmoticWarnRuleController {
|
||||
|
||||
@Autowired
|
||||
private OsmoticWarnRuleService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<OsmoticWarnRule> insert(@Validated(Insert.class) @RequestBody OsmoticWarnRule dto) {
|
||||
checkParam(dto);
|
||||
dto.setId(IdWorker.getId());
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
private void checkParam(OsmoticWarnRule dto) {
|
||||
Long id = dto.getId();
|
||||
LambdaQueryWrapper<OsmoticWarnRule> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.eq(OsmoticWarnRule::getStationCode,dto.getStationCode())
|
||||
.eq(OsmoticWarnRule::getLevel,dto.getLevel());
|
||||
if(dto.getType() == 3){
|
||||
queryWrapper.eq(OsmoticWarnRule::getDirection,dto.getDirection());
|
||||
}
|
||||
if(id != null){
|
||||
queryWrapper.ne(OsmoticWarnRule::getId,id);
|
||||
}
|
||||
if(service.count(queryWrapper ) > 0){
|
||||
throw new IllegalArgumentException("该测点已存在该类型的告警");
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<OsmoticWarnRule> update(@Validated(Update.class) @RequestBody OsmoticWarnRule dto) {
|
||||
checkParam(dto);
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<OsmoticWarnRule>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<OsmoticWarnRule>> page(@RequestBody WarnRulePageSo warnRulePageSo) {
|
||||
return R.ok(service.queryPage(warnRulePageSo));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,218 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.vo.OsmoticWaterRVo;
|
||||
import com.gunshi.project.hsz.listener.OsmoticWaterRImportListener;
|
||||
import com.gunshi.project.hsz.model.OsmoticWaterR;
|
||||
import com.gunshi.project.hsz.model.OsmoticWaterRule;
|
||||
import com.gunshi.project.hsz.service.OsmoticWaterRService;
|
||||
import com.gunshi.project.hsz.service.OsmoticWaterRuleService;
|
||||
import com.gunshi.project.hsz.util.ConvertUtil;
|
||||
import com.gunshi.project.hsz.util.DateUtil;
|
||||
import com.gunshi.project.hsz.util.ExcelUtil;
|
||||
import com.gunshi.project.hsz.util.ResultJson;
|
||||
import com.gunshi.project.hsz.util.excel.ExcelResult;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 描述: 水质采样记录表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "水质采样记录表")
|
||||
@RestController
|
||||
@RequestMapping(value="/osmoticWaterR")
|
||||
public class OsmoticWaterRController {
|
||||
|
||||
@Autowired
|
||||
private OsmoticWaterRService service;
|
||||
|
||||
@Autowired
|
||||
private OsmoticWaterRuleService osmoticWaterRuleService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<OsmoticWaterR> insert(@Validated(Insert.class) @RequestBody OsmoticWaterR dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<OsmoticWaterR> update(@Validated(Update.class) @RequestBody OsmoticWaterR dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取最新一条数据")
|
||||
@PostMapping("/getLastData")
|
||||
public R<Map<String, Object>> getLastData() {
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
QueryWrapper qw = new QueryWrapper<>();
|
||||
qw.orderBy(true, false, "tm").last(" limit 1");
|
||||
OsmoticWaterR osmoticWaterR = service.getOne(qw);
|
||||
if(ObjectUtils.isNotEmpty(osmoticWaterR)){
|
||||
resMap = JSON.parseObject(JSON.toJSONString(osmoticWaterR), Map.class);
|
||||
// 获取标准值
|
||||
List<OsmoticWaterRule> list = osmoticWaterRuleService.list();
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
for (OsmoticWaterRule rule : list){
|
||||
String code = rule.getCode();
|
||||
String codeStandard = code + "Standard";
|
||||
if(resMap.containsKey(code)){
|
||||
if("~".equals(rule.getCondition())){
|
||||
resMap.put(codeStandard, "(" + rule.getOne() + rule.getCondition() + rule.getTwo() + ")");
|
||||
} else {
|
||||
String codeLevel = resMap.get(code + "Level").toString();
|
||||
if(codeLevel.contains("Ⅰ")){
|
||||
resMap.put(codeStandard, "(" + rule.getCondition() + rule.getOne() + ")");
|
||||
} else if (codeLevel.contains("Ⅱ")){
|
||||
resMap.put(codeStandard, "(" + rule.getCondition() + rule.getTwo() + ")");
|
||||
} else if (codeLevel.contains("Ⅲ")){
|
||||
resMap.put(codeStandard, "(" + rule.getCondition() + rule.getThree() + ")");
|
||||
} else if (codeLevel.contains("Ⅳ")){
|
||||
resMap.put(codeStandard, "(" + rule.getCondition() + rule.getFour() + ")");
|
||||
} else if (codeLevel.contains("Ⅴ")){
|
||||
resMap.put(codeStandard, "(" + rule.getCondition() + rule.getFive() + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok(resMap);
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<OsmoticWaterR>> list(@RequestBody @Validated OsmoticWaterR osmoticWaterR) {
|
||||
QueryWrapper<OsmoticWaterR> wrapper = new QueryWrapper<OsmoticWaterR>()
|
||||
.ge(ObjectUtils.isNotNull(osmoticWaterR.getStartTime()), "tm", osmoticWaterR.getStartTime())
|
||||
.le(ObjectUtils.isNotNull(osmoticWaterR.getEndTime()), "tm", osmoticWaterR.getEndTime());
|
||||
if(StringUtils.isNotBlank(osmoticWaterR.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(osmoticWaterR.getIsAsc()) ? false : osmoticWaterR.getIsAsc(), osmoticWaterR.getOrderField());
|
||||
}
|
||||
return R.ok(service.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<OsmoticWaterR>> page(@RequestBody @Validated OsmoticWaterR osmoticWaterR) {
|
||||
QueryWrapper<OsmoticWaterR> wrapper = new QueryWrapper<>();
|
||||
wrapper.ge(ObjectUtils.isNotNull(osmoticWaterR.getStartTime()), "tm", osmoticWaterR.getStartTime())
|
||||
.le(ObjectUtils.isNotNull(osmoticWaterR.getEndTime()), "tm", osmoticWaterR.getEndTime());
|
||||
if(StringUtils.isNotBlank(osmoticWaterR.getOrderField())){
|
||||
wrapper.orderBy(true, ObjectUtils.isEmpty(osmoticWaterR.getIsAsc()) ? false : osmoticWaterR.getIsAsc(), osmoticWaterR.getOrderField());
|
||||
}
|
||||
return R.ok(service.page(osmoticWaterR.getPageSo().toPage(), wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导入模板
|
||||
*/
|
||||
@Operation(summary = "获取导入模板")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil.exportExcel(new ArrayList<>(), "水质整编表", OsmoticWaterRVo.class, response, "水质整编表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*
|
||||
* @param file 导入文件
|
||||
*
|
||||
*/
|
||||
@Operation(summary = "导入数据")
|
||||
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public ResultJson<String> importData(@RequestPart("file") MultipartFile file) throws Exception {
|
||||
ExcelResult<OsmoticWaterRVo> result = ExcelUtil.importExcel(file.getInputStream(), OsmoticWaterRVo.class, new OsmoticWaterRImportListener());
|
||||
return ResultJson.ok(result.getAnalysis());
|
||||
}
|
||||
|
||||
@Operation(summary = "导出")
|
||||
@PostMapping("/exportOsmoticWaterRDataExcel")
|
||||
@CrossOrigin
|
||||
public void exportOsmoticWaterRDataExcel(@RequestBody @Validated OsmoticWaterR osmoticWaterR, HttpServletResponse response) {
|
||||
String filename = "水质整编表";
|
||||
if (ObjectUtils.isNotEmpty(osmoticWaterR.getStartTime())) {
|
||||
filename.concat("_").concat(DateUtil.convertDateToString(osmoticWaterR.getStartTime()));
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(osmoticWaterR.getStartTime())) {
|
||||
filename.concat("_").concat(DateUtil.convertDateToString(osmoticWaterR.getEndTime()));
|
||||
}
|
||||
List<OsmoticWaterRVo> vos = ConvertUtil.entityToVoList(this.list(osmoticWaterR).getData(), OsmoticWaterRVo.class);
|
||||
ExcelUtil.exportExcel(vos, filename, OsmoticWaterRVo.class, response, "水质整编表");
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "文件下载")
|
||||
@PostMapping("/downloadFile")
|
||||
@CrossOrigin
|
||||
public void downloadFile(HttpServletResponse response) throws IOException {
|
||||
String filePath = "doc/2002年6月1日_GB3838-2002地表水环境质量标准.pdf";
|
||||
File file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
new FileNotFoundException("文件不存在!");
|
||||
}
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.setContentType("application/octet-stream; charset=UTF-8");
|
||||
response.setHeader("content-disposition", "attachment;filename*=utf-8'zh_cn'" + URLEncoder.encode("GB3838-2002地表水环境质量标准.pdf", "UTF-8"));
|
||||
InputStream inputStream = null;
|
||||
OutputStream outputStream = null;
|
||||
try {
|
||||
inputStream = this.getClass().getClassLoader().getResourceAsStream(filePath);
|
||||
outputStream = response.getOutputStream();
|
||||
byte[] buffer = new byte[1024];
|
||||
int len = 0;
|
||||
while ((len = inputStream.read(buffer)) != -1) {
|
||||
outputStream.write(buffer, 0, len);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
inputStream.close();
|
||||
outputStream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.OsmoticWaterRule;
|
||||
import com.gunshi.project.hsz.service.OsmoticWaterRuleService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 水质质量标准规则表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "水质质量标准规则表")
|
||||
@RestController
|
||||
@RequestMapping(value="/osmoticWaterRule")
|
||||
public class OsmoticWaterRuleController {
|
||||
|
||||
@Autowired
|
||||
private OsmoticWaterRuleService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<OsmoticWaterRule> insert(@Validated(Insert.class) @RequestBody OsmoticWaterRule dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<OsmoticWaterRule> update(@Validated(Update.class) @RequestBody OsmoticWaterRule dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<OsmoticWaterRule>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<OsmoticWaterRule>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,295 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.PersonnelPlanPage;
|
||||
import com.gunshi.project.hsz.model.PersonnelPlan;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.service.PersonnelPlanService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/23.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Tag(name = "培训计划表")
|
||||
@RestController
|
||||
@RequestMapping(value = "/personnelPlan")
|
||||
public class PersonnelPlanController extends AbstractCommonFileController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private PersonnelPlanService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "personnelPlan";
|
||||
}
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<PersonnelPlan> insert(@Validated(Insert.class) @RequestBody PersonnelPlan dto) {
|
||||
|
||||
LambdaQueryChainWrapper<PersonnelPlan> query = service.lambdaQuery()
|
||||
.eq(PersonnelPlan::getType, dto.getType())
|
||||
.eq(PersonnelPlan::getName, dto.getName());
|
||||
if (query.count() > 0) {
|
||||
throw new IllegalArgumentException("当前培训主题培训班名称重复");
|
||||
}
|
||||
|
||||
if (Objects.nonNull(dto.getStm()) && Objects.nonNull(dto.getEtm()) && dto.getStm().compareTo(dto.getEtm()) > 0) {
|
||||
throw new IllegalArgumentException("开始时间不能大于结束时间");
|
||||
}
|
||||
|
||||
dto.setId(IdWorker.getId());
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
if (result) {
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getId().toString());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<PersonnelPlan> update(@Validated(Update.class) @RequestBody PersonnelPlan dto) {
|
||||
|
||||
LambdaQueryChainWrapper<PersonnelPlan> query = service.lambdaQuery()
|
||||
.ne(PersonnelPlan::getId, dto.getId())
|
||||
.eq(PersonnelPlan::getType, dto.getType())
|
||||
.eq(PersonnelPlan::getName, dto.getName());
|
||||
if (query.count() > 0) {
|
||||
throw new IllegalArgumentException("当前培训主题培训班名称重复");
|
||||
}
|
||||
|
||||
if (Objects.nonNull(dto.getStm()) && Objects.nonNull(dto.getEtm()) && dto.getStm().compareTo(dto.getEtm()) > 0) {
|
||||
throw new IllegalArgumentException("开始时间不能大于结束时间");
|
||||
}
|
||||
|
||||
dto.setCreateTime(null);
|
||||
dto.setCreateBy(null);
|
||||
dto.setCreateName(null);
|
||||
dto.setUpdateTime(new Date());
|
||||
boolean result = service.updateById(dto);
|
||||
if (result) {
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), dto.getId().toString());
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
boolean data = service.removeById(id);
|
||||
if (data) {
|
||||
fileService.deleteFile(getGroupId(), id.toString());
|
||||
}
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<PersonnelPlan>> list(@RequestBody @Validated PersonnelPlanPage dto) {
|
||||
LambdaQueryChainWrapper<PersonnelPlan> query = service.lambdaQuery();
|
||||
if (StringUtils.isNotBlank(dto.getName())){
|
||||
query.like(PersonnelPlan::getName, dto.getName());
|
||||
}
|
||||
return R.ok(query
|
||||
.eq(PersonnelPlan::getStatus, 1)
|
||||
.list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<PersonnelPlan>> page(@RequestBody @Validated PersonnelPlanPage page) {
|
||||
LambdaQueryWrapper<PersonnelPlan> query = Wrappers.lambdaQuery();
|
||||
|
||||
Date stm = page.getStm();
|
||||
Date etm = page.getEtm();
|
||||
|
||||
if (Objects.nonNull(etm) && Objects.nonNull(stm)) {
|
||||
query.nested(o -> o.between(PersonnelPlan::getStm, stm, etm).or().between(PersonnelPlan::getEtm, stm, etm));
|
||||
} else {
|
||||
|
||||
if (Objects.nonNull(stm)) {
|
||||
query.ge(PersonnelPlan::getStm, stm);
|
||||
}
|
||||
|
||||
if (Objects.nonNull(etm)) {
|
||||
query.le(PersonnelPlan::getEtm, etm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String name = page.getName();
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
query.like(PersonnelPlan::getName, name);
|
||||
}
|
||||
|
||||
String applicant = page.getApplicant();
|
||||
if (StringUtils.isNotBlank(applicant)) {
|
||||
query.like(PersonnelPlan::getApplicant, applicant);
|
||||
}
|
||||
query.orderByDesc(PersonnelPlan::getStm).orderByDesc(PersonnelPlan::getCreateTime);
|
||||
Page<PersonnelPlan> data = service.page(page.getPageSo().toPage(), query);
|
||||
data.getRecords().forEach(item ->
|
||||
item.setFiles(fileService.getFiles(getGroupId(), item.getId().toString()))
|
||||
);
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
@Operation(summary = "上传")
|
||||
public R<List<PersonnelPlan>> uploading(@RequestPart("file") MultipartFile file) throws IOException {
|
||||
|
||||
//判断文件是否有数据
|
||||
if (ObjectUtils.isEmpty(file) || file.getSize() <= 0) {
|
||||
throw new IllegalArgumentException("上传文件为空");
|
||||
}
|
||||
|
||||
ExcelUtil<PersonnelPlan> util = new ExcelUtil<>(PersonnelPlan.class);
|
||||
|
||||
List<PersonnelPlan> plans = util.importExcel(file.getInputStream());
|
||||
|
||||
if (CollectionUtils.isNotEmpty(plans)) {
|
||||
checkData(plans);
|
||||
Date regDate = new Date();
|
||||
plans.forEach(o -> o.setId(IdWorker.getId())
|
||||
.setRegDate(regDate)
|
||||
.setStatus(1)
|
||||
// .setApplicant(SecurityUtils.getUsername())
|
||||
);
|
||||
boolean b = service.saveBatch(plans);
|
||||
if (!b) {
|
||||
throw new IllegalArgumentException("上传失败");
|
||||
}
|
||||
}
|
||||
|
||||
return R.ok(plans);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验上传的数据
|
||||
* name type,stm ,etm , , addr, unit, content,numPeople,scope 不能为空
|
||||
* stm etm 进行时间格式校验
|
||||
*/
|
||||
private void checkData(List<PersonnelPlan> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
throw new IllegalArgumentException("上传数据为空");
|
||||
}
|
||||
|
||||
int rowNumber = 1;
|
||||
for (PersonnelPlan o : list) {
|
||||
if (StringUtils.isBlank(o.getName())) {
|
||||
throw new IllegalArgumentException("第" + rowNumber + "行的培训班名称不能为空");
|
||||
}
|
||||
if (Objects.isNull(o.getType())) {
|
||||
throw new IllegalArgumentException("第" + rowNumber + "行的培训主题不能为空");
|
||||
}
|
||||
if (Objects.isNull(o.getStm())) {
|
||||
throw new IllegalArgumentException("第" + rowNumber + "行的开始培训时间不能为空");
|
||||
}
|
||||
if (Objects.isNull(o.getEtm())) {
|
||||
throw new IllegalArgumentException("第" + rowNumber + "行的结束培训时间不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(o.getAddr())) {
|
||||
throw new IllegalArgumentException("第" + rowNumber + "行的培训地点不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(o.getUnit())) {
|
||||
throw new IllegalArgumentException("第" + rowNumber + "行的培训单位不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(o.getContent())) {
|
||||
throw new IllegalArgumentException("第" + rowNumber + "行的培训内容不能为空");
|
||||
}
|
||||
if (o.getNumPeople() == null || o.getNumPeople() <= 0) {
|
||||
throw new IllegalArgumentException("第" + rowNumber + "行的参训人数必须大于0");
|
||||
}
|
||||
if (StringUtils.isBlank(o.getScope())) {
|
||||
throw new IllegalArgumentException("第" + rowNumber + "行的培训范围不能为空");
|
||||
}
|
||||
rowNumber++;
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/download")
|
||||
@Operation(summary = "下载")
|
||||
public void download(@RequestBody PersonnelPlanPage page, HttpServletResponse response) {
|
||||
LambdaQueryWrapper<PersonnelPlan> query = Wrappers.lambdaQuery();
|
||||
|
||||
Date stm = page.getStm();
|
||||
Date etm = page.getEtm();
|
||||
|
||||
if (Objects.nonNull(etm) && Objects.nonNull(stm)) {
|
||||
query.nested(o -> o.between(PersonnelPlan::getStm, stm, etm).or().between(PersonnelPlan::getEtm, stm, etm));
|
||||
} else {
|
||||
|
||||
if (Objects.nonNull(stm)) {
|
||||
query.ge(PersonnelPlan::getStm, stm);
|
||||
}
|
||||
|
||||
if (Objects.nonNull(etm)) {
|
||||
query.le(PersonnelPlan::getEtm, etm);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String name = page.getName();
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
query.like(PersonnelPlan::getName, name);
|
||||
}
|
||||
|
||||
String applicant = page.getApplicant();
|
||||
if (StringUtils.isNotBlank(applicant)) {
|
||||
query.like(PersonnelPlan::getApplicant, applicant);
|
||||
}
|
||||
query.orderByDesc(PersonnelPlan::getStm).orderByDesc(PersonnelPlan::getCreateTime);
|
||||
|
||||
List<PersonnelPlan> list = service.list(query);
|
||||
|
||||
ExcelUtil<PersonnelPlan> util = new ExcelUtil<>(PersonnelPlan.class);
|
||||
|
||||
util.exportExcel(response, list, "培训计划");
|
||||
|
||||
}
|
||||
|
||||
@GetMapping("/template")
|
||||
@Operation(summary = "下载模板")
|
||||
public void download(HttpServletResponse response) {
|
||||
ExcelUtil<PersonnelPlan> util = new ExcelUtil<>(PersonnelPlan.class);
|
||||
|
||||
util.importTemplateExcel(response, "培训计划");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,267 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.PersonnelPlanLogPage;
|
||||
import com.gunshi.project.hsz.entity.vo.PersonnelPlanLogStatisticsVo;
|
||||
import com.gunshi.project.hsz.model.PersonnelPlan;
|
||||
import com.gunshi.project.hsz.model.PersonnelPlanLog;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.service.PersonnelPlanLogService;
|
||||
import com.gunshi.project.hsz.service.PersonnelPlanService;
|
||||
import com.gunshi.project.hsz.util.DateUtil;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/23.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Tag(name = "培训记录表")
|
||||
@RestController
|
||||
@RequestMapping(value = "/personnelPlanLog")
|
||||
public class PersonnelPlanLogController extends AbstractCommonFileController{
|
||||
|
||||
|
||||
@Autowired
|
||||
private PersonnelPlanLogService service;
|
||||
|
||||
|
||||
@Autowired
|
||||
private PersonnelPlanService planService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<PersonnelPlanLog> insert(@Validated(Insert.class) @RequestBody PersonnelPlanLog dto) {
|
||||
|
||||
if (Objects.nonNull(dto.getStm()) && Objects.nonNull(dto.getEtm()) && dto.getStm().compareTo(dto.getEtm()) >= 0){
|
||||
throw new IllegalArgumentException("开始时间不能大于结束时间");
|
||||
}
|
||||
|
||||
LambdaQueryChainWrapper<PersonnelPlanLog> query = service.lambdaQuery()
|
||||
.eq(PersonnelPlanLog::getPlanDate, dto. getPlanDate())
|
||||
.eq(PersonnelPlanLog::getName, dto.getName());
|
||||
if (query.count() > 0){
|
||||
throw new IllegalArgumentException("当前培训日期标题名称重复");
|
||||
}
|
||||
|
||||
if (Objects.nonNull(dto.getPlanId()) && planService.lambdaQuery().eq(PersonnelPlan::getId, dto.getPlanId()).count() == 0) {
|
||||
throw new IllegalArgumentException("培训计划不存在");
|
||||
}
|
||||
dto.setId(IdWorker.getId());
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles1(), getGroupId(), String.valueOf( dto.getId()),"1");
|
||||
fileService.saveFile(dto.getFiles2(), getGroupId(), String.valueOf( dto.getId()),"2");
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<PersonnelPlanLog> update(@Validated(Update.class) @RequestBody PersonnelPlanLog dto) {
|
||||
|
||||
if (Objects.nonNull(dto.getStm()) && Objects.nonNull(dto.getEtm()) && dto.getStm().compareTo(dto.getEtm()) >= 0){
|
||||
throw new IllegalArgumentException("开始时间不能大于结束时间");
|
||||
}
|
||||
|
||||
LambdaQueryChainWrapper<PersonnelPlanLog> query = service.lambdaQuery()
|
||||
.ne(PersonnelPlanLog::getId, dto.getId())
|
||||
.eq(PersonnelPlanLog::getPlanDate, dto. getPlanDate())
|
||||
.eq(PersonnelPlanLog::getName, dto.getName());
|
||||
if (query.count() > 0){
|
||||
throw new IllegalArgumentException("当前培训日期标题名称重复");
|
||||
}
|
||||
if (Objects.nonNull(dto.getPlanId()) && planService.lambdaQuery().eq(PersonnelPlan::getId, dto.getPlanId()).count() == 0) {
|
||||
throw new IllegalArgumentException("培训计划不存在");
|
||||
}
|
||||
|
||||
dto.setCreateTime(null);
|
||||
dto.setCreateBy(null);
|
||||
dto.setCreateName(null);
|
||||
dto.setUpdateTime(new Date());
|
||||
boolean result = service.updateById(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles1(), getGroupId(), String.valueOf( dto.getId()),"1");
|
||||
fileService.saveFile(dto.getFiles2(), getGroupId(), String.valueOf( dto.getId()),"2");
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
@Operation(summary = "获取详情(包括文件信息)")
|
||||
@GetMapping("/get/{id}")
|
||||
public R<PersonnelPlanLog> get(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
PersonnelPlanLog o = service.getById(id);
|
||||
if (Objects.isNull(o)) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
|
||||
o.setFiles1(fileService.getFiles(getGroupId(),String.valueOf(o.getId()),"1"));
|
||||
o.setFiles2(fileService.getFiles(getGroupId(),String.valueOf(o.getId()),"2"));
|
||||
return R.ok(o);
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<PersonnelPlanLog>> list() {
|
||||
return R.ok(service.lambdaQuery()
|
||||
.list());
|
||||
}
|
||||
|
||||
@Operation(summary = "统计")
|
||||
@GetMapping("/statistics/{year}")
|
||||
public R<PersonnelPlanLogStatisticsVo> statistics(@PathVariable("year") Integer year) {
|
||||
if (year < 1970 || year > LocalDate.now().getYear()) {
|
||||
throw new IllegalArgumentException("年份不合法");
|
||||
}
|
||||
//plan planLog
|
||||
Date stm = DateUtil.convertStringToDate(year + "-01-01 00:00:00");
|
||||
Date etm = DateUtil.convertStringToDate(year + "-12-31 23:59:59");
|
||||
List<PersonnelPlanLog> planLogs = service.lambdaQuery()
|
||||
.between(PersonnelPlanLog::getPlanDate, stm, etm)
|
||||
.list();
|
||||
List<PersonnelPlan> plans = planService.lambdaQuery()
|
||||
.between(PersonnelPlan::getStm, stm, etm)
|
||||
.list();
|
||||
|
||||
PersonnelPlanLogStatisticsVo vo = new PersonnelPlanLogStatisticsVo();
|
||||
|
||||
// Map<Integer, PersonnelPlanLogStatisticsVo.EchartsData> map1 = Maps.newHashMap();
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// int month = calendar.get(Calendar.MONTH) + 1;
|
||||
if (CollectionUtils.isNotEmpty(planLogs)) {
|
||||
|
||||
vo.setNumberOfPeriods1(planLogs.size());
|
||||
vo.setNumberOfPeriods2(plans.stream().mapToInt(PersonnelPlan::getNum).sum());
|
||||
vo.setPersonNum1(planLogs.stream().mapToInt(PersonnelPlanLog::getNumPeople).sum());
|
||||
vo.setPersonNum2(plans.stream()
|
||||
.map(
|
||||
item -> item.getNumPeople() * item.getNum()
|
||||
).mapToInt(Integer::intValue).sum()
|
||||
);
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
List<PersonnelPlanLogStatisticsVo.EchartsData> logStatPerMonth = new ArrayList<>();
|
||||
for (int i = 0; i < 12; i++) {
|
||||
int month = i; //calendar的月份是从0开始
|
||||
List<PersonnelPlanLog> logsPerMonth = planLogs.stream().filter(log -> {
|
||||
Date planDate = log.getPlanDate();
|
||||
calendar.setTime(planDate);
|
||||
return month == calendar.get(Calendar.MONTH);
|
||||
}).toList();
|
||||
|
||||
//month num1实际人数 num2实际期数
|
||||
PersonnelPlanLogStatisticsVo.EchartsData chartItem = new PersonnelPlanLogStatisticsVo.EchartsData();
|
||||
chartItem.setMonth(i + 1); //calendar的月份是从0开始
|
||||
chartItem.setNum1(logsPerMonth.stream().mapToInt(PersonnelPlanLog::getNumPeople).sum());
|
||||
chartItem.setNum2(logsPerMonth.size());
|
||||
|
||||
logStatPerMonth.add(chartItem);
|
||||
// PersonnelPlanLogStatisticsVo.EchartsData echartsData1 = map1.get(i);
|
||||
// if (Objects.isNull(echartsData1)) {
|
||||
// echartsData1 = new PersonnelPlanLogStatisticsVo.EchartsData();
|
||||
// }
|
||||
// int finalI = i;
|
||||
// List<PersonnelPlanLog> list = planLogs.stream()
|
||||
// .filter(item ->
|
||||
// {
|
||||
// calendar.setTime(item.getPlanDate());
|
||||
// return month == finalI;
|
||||
// })
|
||||
// .toList();
|
||||
//
|
||||
// echartsData1.setMonth(finalI)
|
||||
// .setNum1(list.stream().mapToInt(PersonnelPlanLog::getNumPeople).sum())
|
||||
// .setNum2(list.size());
|
||||
// map1.put(i, echartsData1);
|
||||
}
|
||||
vo.setList1(logStatPerMonth);
|
||||
}
|
||||
|
||||
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<PersonnelPlanLog>> page(@RequestBody @Validated PersonnelPlanLogPage page) {
|
||||
LambdaQueryWrapper<PersonnelPlanLog> query = Wrappers.lambdaQuery();
|
||||
|
||||
Date stm = page.getStm();
|
||||
if (Objects.nonNull(stm)) {
|
||||
query.ge(PersonnelPlanLog::getPlanDate, stm);
|
||||
}
|
||||
|
||||
Date etm = page.getEtm();
|
||||
if (Objects.nonNull(etm)) {
|
||||
query.le(PersonnelPlanLog::getPlanDate, etm);
|
||||
}
|
||||
|
||||
Integer type = page.getType();
|
||||
if (Objects.nonNull(type)) {
|
||||
query.eq(PersonnelPlanLog::getType, type);
|
||||
}
|
||||
|
||||
Long planId = page.getPlanId();
|
||||
if (Objects.nonNull(planId)) {
|
||||
query.eq(PersonnelPlanLog::getPlanId, planId);
|
||||
}
|
||||
|
||||
String trainees = page.getTrainees();
|
||||
if (StringUtils.isNotBlank(trainees)) {
|
||||
query.like(PersonnelPlanLog::getTrainees, trainees);
|
||||
}
|
||||
|
||||
String unit = page.getUnit();
|
||||
if (StringUtils.isNotBlank(unit)) {
|
||||
query.like(PersonnelPlanLog::getUnit, unit);
|
||||
}
|
||||
|
||||
query.orderByDesc(PersonnelPlanLog::getPlanDate);
|
||||
|
||||
Page<PersonnelPlanLog> data = service.page(page.getPageSo().toPage(), query);
|
||||
data.getRecords().forEach(o -> {
|
||||
o.setFiles1(fileService.getFiles(getGroupId(),String.valueOf(o.getId()),"1"));
|
||||
o.setFiles2(fileService.getFiles(getGroupId(),String.valueOf(o.getId()),"2"));
|
||||
});
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "personnelPlanLog";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.CommonDataPageSo;
|
||||
import com.gunshi.project.hsz.entity.vo.ProjectEventsVo;
|
||||
import com.gunshi.project.hsz.model.ProjectEvents;
|
||||
import com.gunshi.project.hsz.service.ProjectEventsService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 工程大事记
|
||||
* author: wanyan
|
||||
* date: 2024-08-20 17:40:37
|
||||
*/
|
||||
@Tag(name = "工程大事记")
|
||||
@RestController
|
||||
@RequestMapping(value="/projectEvents")
|
||||
public class ProjectEventsController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private ProjectEventsService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ProjectEvents> insert(@Validated(Insert.class) @RequestBody ProjectEvents dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ProjectEvents> update(@Validated(Update.class) @RequestBody ProjectEvents dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ProjectEvents>> list(@RequestBody @Validated CommonDataPageSo so) {
|
||||
return R.ok(service.queryList(so));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ProjectEvents>> page(@RequestBody @Validated CommonDataPageSo page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
@Operation(summary = "全周期档案")
|
||||
@PostMapping("/doc/page")
|
||||
public R<Page<ProjectEventsVo>> filePage(@RequestBody @Validated CommonDataPageSo page) {
|
||||
return R.ok(service.filePage(page));
|
||||
}
|
||||
|
||||
@Operation(summary = "导出")
|
||||
@PostMapping("/export")
|
||||
public void export(@RequestBody @Validated CommonDataPageSo page, HttpServletResponse response) {
|
||||
service.export(page,response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "ProjectEvents";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.annotation.Get;
|
||||
import com.gunshi.core.annotation.Post;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.StPptnSo;
|
||||
import com.gunshi.project.hsz.entity.vo.CartogramVo;
|
||||
import com.gunshi.project.hsz.entity.vo.StPptnDetailsVo;
|
||||
import com.gunshi.project.hsz.entity.vo.StPptnVo;
|
||||
import com.gunshi.project.hsz.model.StPptnRReal;
|
||||
import com.gunshi.project.hsz.service.RainBasinDivisionService;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/attResBase")
|
||||
@Tag(name = "雨情站详细信息查询接口")
|
||||
public class RainBasinDivisionController {
|
||||
|
||||
@Autowired
|
||||
private RainBasinDivisionService rainBasinDivisionService;
|
||||
|
||||
|
||||
@Post(path = "/rainBasinDivision/queryStStbprpPerHour/StcdAndStartTimeAndEndTime",summary = "根据测站编码查询时间段内每小时的雨量")
|
||||
public R<List<StPptnVo>> queryStPptnPerHourByStcdAndStartTimeAndEndTime(@RequestBody @Validated StPptnSo stPptnSo){
|
||||
return R.ok(rainBasinDivisionService.queryStPptnPerHourByStcdAndStartTimeAndEndTime(stPptnSo));
|
||||
}
|
||||
|
||||
@Post(path = "/rainBasinDivision/queryStStbprpPerHourChart/StcdAndStartTimeAndEndTime",summary = "根据测站编码查询时间段内每小时的雨量统计")
|
||||
public R<CartogramVo> queryStPptnPerHourChartByStcdAndStartTimeAndEndTime(@RequestBody @Validated StPptnSo stPptnSo){
|
||||
return R.ok(rainBasinDivisionService.queryStPptnPerHourChartByStcdAndStartTimeAndEndTime(stPptnSo));
|
||||
}
|
||||
|
||||
@Post(path = "/rainBasinDivision/queryStStbprpPerDay/StcdAndStartTimeAndEndTime",summary = "根据测站编码查询时间段内每天的雨量")
|
||||
public R<List<StPptnVo>> queryStPptnPerDayByStcdAndStartTimeAndEndTime(@RequestBody @Validated StPptnSo stPptnSo){
|
||||
return R.ok(rainBasinDivisionService.queryStPptnPerDayByStcdAndStartTimeAndEndTime(stPptnSo).reversed());
|
||||
}
|
||||
|
||||
@Post(path = "/rainBasinDivision/queryStStbprpPerDayChart/StcdAndStartTimeAndEndTime",summary = "根据测站编码查询时间段内每天的雨量统计")
|
||||
public R<CartogramVo> queryStPptnPerDayChartChartByStcdAndStartTimeAndEndTime(@RequestBody @Validated StPptnSo stPptnSo){
|
||||
return R.ok(rainBasinDivisionService.queryStPptnPerDayChartChartByStcdAndStartTimeAndEndTime(stPptnSo));
|
||||
}
|
||||
|
||||
@Get(path = "/rainBasinDivision/queryStPptnDetails/stcd",summary = "根据测站编码查询详细雨量情况")
|
||||
public R<StPptnDetailsVo> queryStPptnDetailsByStcd(@RequestParam("stcd") @Parameter(description = "测站编码") String stcd){
|
||||
return R.ok(rainBasinDivisionService.queryStPptnDetailsByStcd(stcd));
|
||||
}
|
||||
|
||||
@Post(path = "/maxRain",summary = "根据测站编码查询时间段内最大小时雨量")
|
||||
public R<StPptnRReal> maxRain(@RequestBody @Validated StPptnSo stPptnSo){
|
||||
return R.ok(rainBasinDivisionService.maxRain(stPptnSo));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.annotation.Post;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.RealRainBaseSo;
|
||||
import com.gunshi.project.hsz.entity.vo.RealRainListVo;
|
||||
import com.gunshi.project.hsz.service.RealRainService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/real/rain")
|
||||
@Tag(name = "降雨信息查询接口")
|
||||
@Data
|
||||
public class RealRainController {
|
||||
|
||||
@Autowired
|
||||
private RealRainService realRainService;
|
||||
|
||||
@Post(path="/list", summary = "实时雨情-降雨信息-查询接口")
|
||||
public R<List<RealRainListVo>> getRealRainList(@RequestBody RealRainBaseSo realRainBaseSo) {
|
||||
List<RealRainListVo> list = realRainService.getRealRainList(realRainBaseSo);
|
||||
//按RealRainListVo.drp倒序排列,null的排在最后面
|
||||
list.sort((o1, o2) -> {
|
||||
if (o1.getDrp() == null) {
|
||||
return 1;
|
||||
}
|
||||
if (o2.getDrp() == null) {
|
||||
return -1;
|
||||
}
|
||||
return o2.getDrp().compareTo(o1.getDrp());
|
||||
});
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.project.hsz.model.ResBriefR;
|
||||
import com.gunshi.project.hsz.service.ResBriefRService;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @since 2025-04-25
|
||||
*/
|
||||
@Tag(name = "汛情简报接口")
|
||||
@RestController
|
||||
@RequestMapping(value="/resBrief")
|
||||
public class ResBriefController {
|
||||
@Autowired
|
||||
private ResBriefRService resBriefRService;
|
||||
|
||||
@GetMapping("/getResBriefList")
|
||||
public R<List<ResBriefR>> getResBriefList(
|
||||
@RequestParam(value = "startDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date startDate,
|
||||
@RequestParam(value = "endDate") @DateTimeFormat(pattern = "yyyy-MM-dd") Date endDate
|
||||
) {
|
||||
if (startDate.after(endDate)) {
|
||||
return R.fail("开始日期不能大于结束日期");
|
||||
}
|
||||
return R.ok(resBriefRService.getResBriefList(startDate, endDate));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.ResFloodRoad;
|
||||
import com.gunshi.project.hsz.service.ResFloodRoadService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 防汛道路
|
||||
* author: xusan
|
||||
* date: 2024-11-14 10:37:15
|
||||
*/
|
||||
@Tag(name = "防汛道路")
|
||||
@RestController
|
||||
@RequestMapping(value="/resFloodRoad")
|
||||
public class ResFloodRoadController {
|
||||
|
||||
@Autowired
|
||||
private ResFloodRoadService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ResFloodRoad> insert(@Validated(Insert.class) @RequestBody ResFloodRoad dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ResFloodRoad> update(@Validated(Update.class) @RequestBody ResFloodRoad dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ResFloodRoad>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.ResCodeSo;
|
||||
import com.gunshi.project.hsz.model.ResMangUnit;
|
||||
import com.gunshi.project.hsz.service.ResMangUnitService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 水库管理单位表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "水库管理单位表")
|
||||
@RestController
|
||||
@RequestMapping(value="/resMangUnit")
|
||||
public class ResMangUnitController {
|
||||
|
||||
@Autowired
|
||||
private ResMangUnitService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ResMangUnit> insert(@Validated(Insert.class) @RequestBody ResMangUnit dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ResMangUnit> update(@Validated(Update.class) @RequestBody ResMangUnit dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ResMangUnit>> list(@Validated @RequestBody ResCodeSo so) {
|
||||
return R.ok(service.lambdaQuery().eq(ResMangUnit::getResCode,so.getResCode()).list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<ResMangUnit>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.ResMonthEcoFlowListSo;
|
||||
import com.gunshi.project.hsz.model.ResMonthEcoFlow;
|
||||
import com.gunshi.project.hsz.service.ResMonthEcoFlowService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 水库月核定生态流量表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "水库月核定生态流量表")
|
||||
@RestController
|
||||
@RequestMapping(value="/resMonthEcoFlow")
|
||||
public class ResMonthEcoFlowController {
|
||||
|
||||
@Autowired
|
||||
private ResMonthEcoFlowService service;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ResMonthEcoFlow> insert(@Validated(Insert.class) @RequestBody ResMonthEcoFlow dto) {
|
||||
dto.setModitime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ResMonthEcoFlow> update(@Validated(Update.class) @RequestBody ResMonthEcoFlow dto) {
|
||||
if (Objects.isNull(service.getById(dto.getId()))){
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
dto.setModitime(null);
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改")
|
||||
@PostMapping("/updates")
|
||||
public R<Boolean> updates(@Validated(Update.class) @RequestBody List<ResMonthEcoFlow> dto) {
|
||||
|
||||
dto = dto.stream().map(x -> x.setModitime(new Date())).collect(Collectors.toList());
|
||||
boolean result = service.updateBatchById(dto);
|
||||
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))){
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ResMonthEcoFlow>> list(@Validated @RequestBody ResMonthEcoFlowListSo vo) {
|
||||
LocalDateTime stm = LocalDateTime.of(vo.getYear(), 1, 1, 0, 0, 0);
|
||||
LocalDateTime etm = LocalDateTime.of(vo.getYear(), 12, 31, 23, 59, 59);
|
||||
return R.ok(service.lambdaQuery().between(ResMonthEcoFlow::getModitime,stm,etm).orderByAsc(ResMonthEcoFlow::getMonth).list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<ResMonthEcoFlow>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.ResPersonPage;
|
||||
import com.gunshi.project.hsz.model.ResPerson;
|
||||
import com.gunshi.project.hsz.service.ResPersonService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/9/23.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Tag(name = "责任人表")
|
||||
@RestController
|
||||
@RequestMapping(value="/resPerson")
|
||||
public class ResPersonController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ResPersonService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ResPerson> insert(@Validated(Insert.class) @RequestBody ResPerson dto) {
|
||||
|
||||
LambdaQueryChainWrapper<ResPerson> query = service.lambdaQuery()
|
||||
.eq(ResPerson::getType, dto.getType())
|
||||
.eq(ResPerson::getName, dto.getName());
|
||||
if (query.count() > 0){
|
||||
throw new IllegalArgumentException("当前责任类型名字重复");
|
||||
}
|
||||
|
||||
dto.setCreateTime(new Date());
|
||||
dto.setId(IdWorker.getId());
|
||||
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ResPerson> update(@Validated(Update.class) @RequestBody ResPerson dto) {
|
||||
|
||||
LambdaQueryChainWrapper<ResPerson> query = service.lambdaQuery()
|
||||
.ne(ResPerson::getId, dto.getId())
|
||||
.eq(ResPerson::getType, dto.getType())
|
||||
.eq(ResPerson::getName, dto.getName());
|
||||
if (query.count() > 0){
|
||||
throw new IllegalArgumentException("当前责任类型名字重复");
|
||||
}
|
||||
dto.setCreateTime(null);
|
||||
dto.setCreateBy(null);
|
||||
dto.setCreateName(null);
|
||||
dto.setUpdateTime(new Date());
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ResPerson>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ResPerson>> page(@RequestBody @Validated ResPersonPage page) {
|
||||
LambdaQueryWrapper<ResPerson> query = Wrappers.lambdaQuery();
|
||||
Integer type = page.getType();
|
||||
if (Objects.nonNull(type)){
|
||||
query.eq(ResPerson::getType, type);
|
||||
}
|
||||
|
||||
String name = page.getName();
|
||||
if (StringUtils.isNotBlank(name)){
|
||||
query.like(ResPerson::getName, name);
|
||||
}
|
||||
|
||||
String contactInfo = page.getContactInfo();
|
||||
if (StringUtils.isNotBlank(contactInfo)){
|
||||
query.like(ResPerson::getContactInfo, contactInfo);
|
||||
}
|
||||
|
||||
return R.ok(service.page(page.getPageSo().toPage(),query));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.ResCodeSo;
|
||||
import com.gunshi.project.hsz.model.ResPlanB;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.service.ResPlanBService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 水库预案表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "水库预案表")
|
||||
@RestController
|
||||
@RequestMapping(value="/resPlanB")
|
||||
public class ResPlanBController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private ResPlanBService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ResPlanB> insert(@Validated(Insert.class) @RequestBody ResPlanB dto) {
|
||||
dto.setId(IdWorker.getId());
|
||||
dto.setModitime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), String.valueOf( dto.getId()));
|
||||
}
|
||||
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ResPlanB> update(@Validated(Update.class) @RequestBody ResPlanB dto) {
|
||||
if (Objects.isNull(service.getById(dto.getId()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
|
||||
if (result) {
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), String.valueOf( dto.getId()));
|
||||
}
|
||||
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
boolean data = service.removeById(id);
|
||||
|
||||
if (data){
|
||||
fileService.deleteFile(getGroupId(),id.toString());
|
||||
}
|
||||
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ResPlanB>> list(@Validated @RequestBody ResCodeSo so) {
|
||||
LambdaQueryChainWrapper<ResPlanB> query = service.lambdaQuery();
|
||||
if (StringUtils.isNotBlank(so.getResCode())){
|
||||
query.eq(ResPlanB::getResCode, so.getResCode());
|
||||
}
|
||||
if (StringUtils.isNotBlank(so.getType())){
|
||||
query.eq(ResPlanB::getType, so.getType());
|
||||
}
|
||||
query.orderByDesc(ResPlanB::getModitime);
|
||||
List<ResPlanB> list = query.list();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
list.forEach(o -> o.setFiles(fileService.getFiles(getGroupId(),String.valueOf( o.getId()))));
|
||||
}
|
||||
|
||||
return R.ok(list);
|
||||
}
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<ResPlanB>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "ResPlanB";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.ResCodeSo;
|
||||
import com.gunshi.project.hsz.model.ResProjectImg;
|
||||
import com.gunshi.project.hsz.service.AttResBaseService;
|
||||
import com.gunshi.project.hsz.service.FileAssociationsService;
|
||||
import com.gunshi.project.hsz.service.ResProjectImgService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 水库工程图片
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "水库工程图片")
|
||||
@RestController
|
||||
@RequestMapping(value="/resProjectImg")
|
||||
public class ResProjectImgController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private ResProjectImgService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
@Autowired
|
||||
private AttResBaseService resService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ResProjectImg> insert(@Validated(Insert.class) @RequestBody ResProjectImg dto) {
|
||||
if (Objects.isNull(resService.getById(dto.getResCode()))){
|
||||
throw new RuntimeException("当前水库不存在");
|
||||
}
|
||||
dto.setId(IdWorker.getId());
|
||||
dto.setModitime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
if (result){
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), String.valueOf( dto.getId()));
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ResProjectImg> update(@Validated(Update.class) @RequestBody ResProjectImg dto) {
|
||||
if (Objects.isNull(resService.getById(dto.getResCode()))){
|
||||
throw new RuntimeException("当前水库不存在");
|
||||
}
|
||||
if (Objects.isNull(service.getById(dto.getId()))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
if (result) {
|
||||
fileService.saveFile(dto.getFiles(), getGroupId(), String.valueOf( dto.getId()));
|
||||
}
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new IllegalArgumentException("当前数据不存在");
|
||||
}
|
||||
boolean data = service.removeById(id);
|
||||
|
||||
if (data){
|
||||
fileService.deleteFile(getGroupId(),id.toString());
|
||||
}
|
||||
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ResProjectImg>> list(@Validated @RequestBody ResCodeSo so) {
|
||||
List<ResProjectImg> list = service.lambdaQuery().eq(ResProjectImg::getResCode, so.getResCode())
|
||||
.orderByAsc(ResProjectImg::getSortOn)
|
||||
.orderByDesc(ResProjectImg::getModitime)
|
||||
.list();
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
list.forEach(o -> o.setFiles(fileService.getFiles(getGroupId(),String.valueOf( o.getId()))));
|
||||
}
|
||||
return R.ok(list);
|
||||
}
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<ResProjectImg>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "ResProjectImg";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.ResCodeSo;
|
||||
import com.gunshi.project.hsz.model.ResSafePersonB;
|
||||
import com.gunshi.project.hsz.service.AttResBaseService;
|
||||
import com.gunshi.project.hsz.service.ResSafePersonBService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 水库责任体系表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "水库责任体系表")
|
||||
@RestController
|
||||
@RequestMapping(value="/resSafePersonB")
|
||||
public class ResSafePersonBController {
|
||||
|
||||
@Autowired
|
||||
private ResSafePersonBService service;
|
||||
|
||||
@Autowired
|
||||
private AttResBaseService resService;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ResSafePersonB> insert(@Validated(Insert.class) @RequestBody ResSafePersonB dto) {
|
||||
if (Objects.isNull(resService.getById(dto.getResCode()))){
|
||||
throw new RuntimeException("当前水库不存在");
|
||||
}
|
||||
dto.setModitime(new Date());
|
||||
dto.setId(IdWorker.getId());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ResSafePersonB> update(@Validated(Update.class) @RequestBody ResSafePersonB dto) {
|
||||
if (Objects.isNull(resService.getById(dto.getResCode()))){
|
||||
throw new RuntimeException("当前水库不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
if (Objects.isNull(service.getById(id))){
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ResSafePersonB>> list(@Validated @RequestBody ResCodeSo so) {
|
||||
return R.ok(service.lambdaQuery().eq(ResSafePersonB::getResCode,so.getResCode()).list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<ResSafePersonB>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.ResTunnel;
|
||||
import com.gunshi.project.hsz.service.ResTunnelService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 水库建筑物 - 放空洞/灌溉发电洞
|
||||
* author: xusan
|
||||
* date: 2024-11-14 10:34:11
|
||||
*/
|
||||
@Tag(name = "水库建筑物 - 放空洞/灌溉发电洞")
|
||||
@RestController
|
||||
@RequestMapping(value="/resTunnel")
|
||||
public class ResTunnelController {
|
||||
|
||||
@Autowired
|
||||
private ResTunnelService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ResTunnel> insert(@Validated(Insert.class) @RequestBody ResTunnel dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ResTunnel> update(@Validated(Update.class) @RequestBody ResTunnel dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@GetMapping("/list")
|
||||
public R<List<ResTunnel>> list(@Schema(name = "type",description = "类型(1放空洞 2灌溉发电洞)") @RequestParam(name = "type") Integer type) {
|
||||
return R.ok(service.lambdaQuery().eq(ResTunnel::getType,type).list());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,108 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.annotation.Get;
|
||||
import com.gunshi.core.annotation.Post;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.file.model.FileDescriptor;
|
||||
import com.gunshi.project.hsz.entity.so.RescueGoodsPageSo;
|
||||
import com.gunshi.project.hsz.model.RescueGoodsB;
|
||||
import com.gunshi.project.hsz.model.RescueGoodsFile;
|
||||
import com.gunshi.project.hsz.model.RescueGoodsFileAutoDao;
|
||||
import com.gunshi.project.hsz.model.RescueGoodsFileAutoMapper;
|
||||
import com.gunshi.project.hsz.service.AbstractModelWithAttachService;
|
||||
import com.gunshi.project.hsz.service.RescueGoodsService;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by wanyan on 2024/3/18
|
||||
*
|
||||
* @author wanyan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Tag(name = "抢险物资")
|
||||
@RestController
|
||||
@RequestMapping("/rescue/goods")
|
||||
public class RescueGoodsBController extends AbstractCommonFileController implements
|
||||
ICommonInsertWithAttach<RescueGoodsB, com.gunshi.project.hsz.model.RescueGoodsBAutoMapper, com.gunshi.project.hsz.model.RescueGoodsBAutoDao, RescueGoodsFile, RescueGoodsFileAutoMapper, RescueGoodsFileAutoDao>,
|
||||
ICommonUpdateByIdWithAttach<RescueGoodsB, com.gunshi.project.hsz.model.RescueGoodsBAutoMapper, com.gunshi.project.hsz.model.RescueGoodsBAutoDao, RescueGoodsFile, RescueGoodsFileAutoMapper, RescueGoodsFileAutoDao>,
|
||||
ICommonDeleteByIdWithAttach<RescueGoodsB, com.gunshi.project.hsz.model.RescueGoodsBAutoMapper, com.gunshi.project.hsz.model.RescueGoodsBAutoDao, RescueGoodsFile, RescueGoodsFileAutoMapper, RescueGoodsFileAutoDao>,
|
||||
ICommonQueryAttach<RescueGoodsFile, Long, RescueGoodsFileAutoMapper, RescueGoodsFileAutoDao>
|
||||
{
|
||||
|
||||
|
||||
@Autowired
|
||||
private RescueGoodsFileAutoDao fileAutoDao;
|
||||
|
||||
@Autowired
|
||||
private RescueGoodsService rescueGoodsService;
|
||||
|
||||
|
||||
@Override
|
||||
public void customSetFieldForUpdate(RescueGoodsB model) {
|
||||
model.setTm(new Date());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RescueGoodsFileAutoDao getAttachAutoDao() {
|
||||
return fileAutoDao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAttachBzIdName() {
|
||||
return "goods_id";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getId(Serializable id) {
|
||||
return Long.valueOf(id.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractModelWithAttachService<RescueGoodsB, com.gunshi.project.hsz.model.RescueGoodsBAutoMapper, com.gunshi.project.hsz.model.RescueGoodsBAutoDao, RescueGoodsFile, RescueGoodsFileAutoMapper, RescueGoodsFileAutoDao> getModelService() {
|
||||
return rescueGoodsService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void customSetFieldForInsert(RescueGoodsB model) {
|
||||
long id = IdWorker.getId();
|
||||
model.setGoodsId(id);
|
||||
model.setTm(new Date());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "rescueGoodsB";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*/
|
||||
@Post(path = "/page/query", summary = "分页查询")
|
||||
public R<Page<RescueGoodsB>> pageQuery(@RequestBody @Validated RescueGoodsPageSo RescueGoodsPageSo) {
|
||||
return R.ok(rescueGoodsService.pageQuery(RescueGoodsPageSo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@Get(path = "/detail", summary = "详情")
|
||||
public R<List<FileDescriptor>> detail(@Schema(name = "goodsId",description = "物资id") @RequestParam(name = "goodsId") Long goodsId) {
|
||||
return R.ok(rescueGoodsService.detail(goodsId));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.annotation.Get;
|
||||
import com.gunshi.core.annotation.Post;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.RescueTeamPageSo;
|
||||
import com.gunshi.project.hsz.entity.vo.RescueTeamVo;
|
||||
import com.gunshi.project.hsz.model.RescueTeamB;
|
||||
import com.gunshi.project.hsz.model.RescueTeamBAutoMapper;
|
||||
import com.gunshi.project.hsz.model.RescueTeamFile;
|
||||
import com.gunshi.project.hsz.model.RescueTeamFileAutoDao;
|
||||
import com.gunshi.project.hsz.service.AbstractModelWithAttachService;
|
||||
import com.gunshi.project.hsz.service.RescueTeamService;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 抢险队伍
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "抢险队伍")
|
||||
@RestController
|
||||
@RequestMapping("/rescue/team")
|
||||
public class RescueTeamBController extends AbstractCommonFileController implements
|
||||
ICommonInsertWithAttach<RescueTeamB, RescueTeamBAutoMapper, com.gunshi.project.hsz.model.RescueTeamBAutoDao, RescueTeamFile, com.gunshi.project.hsz.model.RescueTeamFileAutoMapper, RescueTeamFileAutoDao>,
|
||||
ICommonUpdateByIdWithAttach<RescueTeamB, RescueTeamBAutoMapper, com.gunshi.project.hsz.model.RescueTeamBAutoDao, RescueTeamFile, com.gunshi.project.hsz.model.RescueTeamFileAutoMapper, RescueTeamFileAutoDao>,
|
||||
ICommonDeleteByIdWithAttach<RescueTeamB, RescueTeamBAutoMapper, com.gunshi.project.hsz.model.RescueTeamBAutoDao, RescueTeamFile, com.gunshi.project.hsz.model.RescueTeamFileAutoMapper, RescueTeamFileAutoDao>,
|
||||
ICommonQueryAttach<RescueTeamFile, Long, com.gunshi.project.hsz.model.RescueTeamFileAutoMapper, RescueTeamFileAutoDao>
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private RescueTeamBAutoMapper rescueTeamBAutoMapper;
|
||||
|
||||
@Autowired
|
||||
private RescueTeamFileAutoDao attachAutoDao;
|
||||
|
||||
@Autowired
|
||||
private RescueTeamService rescueTeamService;
|
||||
|
||||
|
||||
@Override
|
||||
public Long getId(Serializable id) {
|
||||
return Long.valueOf(id.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void customSetFieldForUpdate(RescueTeamB model) {
|
||||
model.setTm(new Date());
|
||||
rescueTeamService.updateDetailAndObj(model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractModelWithAttachService<RescueTeamB, RescueTeamBAutoMapper, com.gunshi.project.hsz.model.RescueTeamBAutoDao, RescueTeamFile, com.gunshi.project.hsz.model.RescueTeamFileAutoMapper, RescueTeamFileAutoDao> getModelService() {
|
||||
return rescueTeamService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void customSetFieldForInsert(RescueTeamB model) {
|
||||
long teamId = IdWorker.getId();
|
||||
model.setTeamId(teamId);
|
||||
model.setTm(new Date());
|
||||
rescueTeamService.saveDetailAndObj(model,teamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "rescueTeamB";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 防汛准备-分页查询
|
||||
*/
|
||||
@Post(path = "/page/query", summary = "防汛准备-分页查询")
|
||||
public R<Page<RescueTeamVo>> pageQuery(@RequestBody @Validated RescueTeamPageSo RescueTeamPageSo) {
|
||||
return R.ok(rescueTeamService.pageQuery(RescueTeamPageSo));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*/
|
||||
@Get(path = "/list", summary = "列表查询")
|
||||
public R<List<RescueTeamB>> list(@Schema(name = "teamName",description = "队伍名称") @RequestParam(name = "teamName",required = false) String teamName) {
|
||||
LambdaQueryWrapper<RescueTeamB> queryWrapper = Wrappers.lambdaQuery();
|
||||
if(StringUtils.isNotEmpty(teamName)){
|
||||
queryWrapper.like(RescueTeamB::getTeamName,teamName);
|
||||
}
|
||||
return R.ok(rescueTeamBAutoMapper.selectList(queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
@Get(path = "/detail", summary = "详情")
|
||||
public R<RescueTeamB> detail(@Schema(name = "teamId",description = "队伍ID") @RequestParam(name = "teamId") Long teamId) {
|
||||
return R.ok(rescueTeamService.detail(teamId));
|
||||
}
|
||||
|
||||
@Get(path ="/delete/{id}", summary = "删除")
|
||||
public R<Boolean> delete(@Schema(name = "teamId") @PathVariable("teamId") Long teamId) {
|
||||
return R.ok(rescueTeamService.delete(teamId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RescueTeamFileAutoDao getAttachAutoDao() {
|
||||
return attachAutoDao;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAttachBzIdName() {
|
||||
return "team_id";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.annotation.Get;
|
||||
import com.gunshi.core.annotation.Post;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.DataQueryCommonSo;
|
||||
import com.gunshi.project.hsz.entity.so.PicQuerySo;
|
||||
import com.gunshi.project.hsz.entity.so.ReservoirWaterCommonSo;
|
||||
import com.gunshi.project.hsz.entity.vo.*;
|
||||
import com.gunshi.project.hsz.model.*;
|
||||
import com.gunshi.project.hsz.service.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by wanyan on 2024/2/20
|
||||
*
|
||||
* @author wanyan
|
||||
* @version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/reservoir/water")
|
||||
@Tag(name = "水库水情")
|
||||
public class ReservoirWaterController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private ReservoirWaterService reservoirWaterService;
|
||||
|
||||
@Autowired
|
||||
private RealRainService realRainService;
|
||||
|
||||
@Autowired
|
||||
private StWaterRRealService stWaterRRealService;
|
||||
|
||||
@Autowired
|
||||
private ResMonthEcoFlowService resMonthEcoFlowService;
|
||||
|
||||
@Autowired
|
||||
private StRsvrRService stRsvrRService;
|
||||
|
||||
@Autowired
|
||||
private StPptnRService stPptnRService;
|
||||
|
||||
@Post(path = "/rz", summary = "水库水位")
|
||||
public R<StRsvrVo> rz(@RequestBody ReservoirWaterCommonSo reservoirWaterCommonSo) {
|
||||
return R.ok(reservoirWaterService.rz(reservoirWaterCommonSo));
|
||||
}
|
||||
|
||||
@Post(path = "/list", summary = "水库水情列表")
|
||||
public R<List<AttResBaseVo>> list() {
|
||||
return R.ok(reservoirWaterService.list());
|
||||
}
|
||||
|
||||
|
||||
@Post(path = "/listV2", summary = "水库水情列表")
|
||||
public R<List<AttResBaseVo>> listV2() {
|
||||
return R.ok(reservoirWaterService.listV2());
|
||||
}
|
||||
|
||||
@Get(path = "/image/channel", summary = "图像监测视角下拉")
|
||||
public R<List<StStbprpB>> channel(@Schema(name = "resCode") @RequestParam("resCode") String resCode) {
|
||||
return R.ok(reservoirWaterService.channel(resCode));
|
||||
}
|
||||
|
||||
@Post(path = "/image/info", summary = "图片信息")
|
||||
public R<Page<StImgR>> imageInfo(@RequestBody @Validated PicQuerySo picQuerySo) {
|
||||
return R.ok(reservoirWaterService.imageInfo(picQuerySo));
|
||||
}
|
||||
|
||||
@Post(path = "/real/img", summary = "水库实时图像")
|
||||
public R<List<StImgRReal>> realImg(@RequestBody ReservoirWaterCommonSo reservoirWaterCommonSo) {
|
||||
return R.ok(reservoirWaterService.realImg(reservoirWaterCommonSo));
|
||||
}
|
||||
|
||||
@Post(path = "/monitor/data", summary = "监测数据")
|
||||
public R<List<AttResMonitorVo>> monitorData(@RequestBody @Validated DataQueryCommonSo dataQueryCommonSo) {
|
||||
return R.ok(reservoirWaterService.monitorData(dataQueryCommonSo));
|
||||
}
|
||||
|
||||
@Post(path = "/data", summary = "闸阀总览-库容曲线")
|
||||
public R<List<AttResMonitorVo>> data(@RequestBody @Validated DataQueryCommonSo dataQueryCommonSo) {
|
||||
dataQueryCommonSo.setStcd("61610700");//檀树岗水库
|
||||
return R.ok(reservoirWaterService.data(dataQueryCommonSo));
|
||||
}
|
||||
|
||||
@Post(path = "/waterInfo", summary = "闸阀总览-库容曲线")
|
||||
public R<AttResMonitorVo> waterInfo(@RequestBody DataQueryCommonSo dataQueryCommonSo) {
|
||||
AttResMonitorVo attResMonitorVo = new AttResMonitorVo();
|
||||
|
||||
LambdaQueryWrapper<StRsvrR> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(StRsvrR::getStcd,dataQueryCommonSo.getStcd()).orderByDesc(StRsvrR::getTm).last(" limit 1");
|
||||
List<StRsvrR> list1 = stRsvrRService.list(qw);
|
||||
if(CollectionUtils.isNotEmpty(list1)){
|
||||
attResMonitorVo.setRz(new BigDecimal(list1.get(0).getRz()));
|
||||
attResMonitorVo.setTm(list1.get(0).getTm());
|
||||
}
|
||||
LambdaQueryWrapper<StPptnR> qw2= new LambdaQueryWrapper<>();
|
||||
qw2.eq(StPptnR::getStcd,dataQueryCommonSo.getStcd()).orderByDesc(StPptnR::getTm).last(" limit 1");
|
||||
List<StPptnR> list3 = stPptnRService.list(qw2);
|
||||
if(CollectionUtils.isNotEmpty(list3)){
|
||||
attResMonitorVo.setTodayRainNum(new BigDecimal(list3.get(0).getDrp()));
|
||||
attResMonitorVo.setTodayRainNumTm(list3.get(0).getTm());
|
||||
}
|
||||
|
||||
List<StWaterRReal> list2 = stWaterRRealService.listRelated();
|
||||
if(CollectionUtils.isNotEmpty(list2)){
|
||||
// 获取当月核定流量
|
||||
ResMonthEcoFlow resMonthEcoFlow = resMonthEcoFlowService.getOne(new QueryWrapper<ResMonthEcoFlow>().eq("month", Calendar.getInstance().get(Calendar.MONTH) + 1));
|
||||
if(ObjectUtils.isNotEmpty(resMonthEcoFlow)){
|
||||
for(StWaterRReal real : list2){
|
||||
real.setResMonthEcoFlow(resMonthEcoFlow);
|
||||
}
|
||||
}
|
||||
StWaterRReal stWaterRReal = list2.stream().max((o1, o2) -> o1.getTm().compareTo(o2.getTm())).orElse(new StWaterRReal());
|
||||
attResMonitorVo.setOutPowerNum(stWaterRReal.getQ());
|
||||
attResMonitorVo.setOutPowerNumTm(stWaterRReal.getTm());
|
||||
}
|
||||
return R.ok(attResMonitorVo);
|
||||
}
|
||||
|
||||
@Post(path = "/data/page", summary = "分页库容曲线")
|
||||
public R<Page<AttResMonitorVo>> dataPage(@RequestBody @Validated PicQuerySo picQuerySo) {
|
||||
return R.ok(reservoirWaterService.dataPage(picQuerySo));
|
||||
}
|
||||
|
||||
@Get(path = "/detail", summary = "监测详细数据(下方表格)")
|
||||
public R<AttRvMonitorDetailVo> detail(@Schema(name = "stcd") @RequestParam("stcd") String stcd) {
|
||||
return R.ok(reservoirWaterService.detail(stcd));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.AttCctvBasePage;
|
||||
import com.gunshi.project.hsz.model.RiskControlInfo;
|
||||
import com.gunshi.project.hsz.service.RiskControlInfoService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
/**
|
||||
* 描述: 风险管控清单
|
||||
* author: xusan
|
||||
* date: 2024-08-22 14:17:28
|
||||
*/
|
||||
@Tag(name = "风险管控清单")
|
||||
@RestController
|
||||
@RequestMapping(value="/risk/info")
|
||||
public class RiskControlInfoController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private RiskControlInfoService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<RiskControlInfo> insert(@Validated(Insert.class) @RequestBody RiskControlInfo dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<RiskControlInfo> update(@Validated(Update.class) @RequestBody RiskControlInfo dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<RiskControlInfo>> page(@RequestBody @Validated AttCctvBasePage page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "riskControlInfo";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.RiskControlMenu;
|
||||
import com.gunshi.project.hsz.service.RiskControlMenuService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 风险管控目录
|
||||
* author: xusan
|
||||
* date: 2024-08-22 14:16:35
|
||||
*/
|
||||
@Tag(name = "风险管控目录")
|
||||
@RestController
|
||||
@RequestMapping(value="/risk/menu")
|
||||
public class RiskControlMenuController {
|
||||
|
||||
@Autowired
|
||||
private RiskControlMenuService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<RiskControlMenu> insert(@Validated(Insert.class) @RequestBody RiskControlMenu dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<RiskControlMenu> update(@Validated(Update.class) @RequestBody RiskControlMenu dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "树")
|
||||
@PostMapping("/tree")
|
||||
public R<List<RiskControlMenu>> tree() {
|
||||
return R.ok(service.tree());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.annotation.Get;
|
||||
import com.gunshi.core.annotation.Post;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.DataQueryCommonSo;
|
||||
import com.gunshi.project.hsz.entity.vo.AttRvBaseVo;
|
||||
import com.gunshi.project.hsz.entity.vo.AttRvMonitorDetailVo;
|
||||
import com.gunshi.project.hsz.entity.vo.AttRvMonitorVo;
|
||||
import com.gunshi.project.hsz.model.StZqrlB;
|
||||
import com.gunshi.project.hsz.service.RiverWaterService;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by wanyan on 2024/2/21
|
||||
*
|
||||
* @author wanyan
|
||||
* @version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/river/water")
|
||||
@Tag(name = "河道水情")
|
||||
public class RiverWaterController {
|
||||
|
||||
@Autowired
|
||||
private RiverWaterService riverWaterService;
|
||||
|
||||
@Post(path = "/list", summary = "河道水情列表")
|
||||
public R<List<AttRvBaseVo>> list() {
|
||||
return R.ok(riverWaterService.list());
|
||||
}
|
||||
|
||||
@Get(path = "/zqrl", summary = "水位流量关系")
|
||||
public R<List<StZqrlB>> zqrl(@Schema(name = "stcd") @RequestParam("stcd") String stcd) {
|
||||
return R.ok(riverWaterService.zqrl(stcd));
|
||||
}
|
||||
|
||||
|
||||
@Post(path = "/monitor/data", summary = "监测数据")
|
||||
public R<List<AttRvMonitorVo>> monitorData(@RequestBody @Validated DataQueryCommonSo dataQueryCommonSo) {
|
||||
return R.ok(riverWaterService.monitorData(dataQueryCommonSo));
|
||||
}
|
||||
|
||||
@Get(path = "/detail", summary = "监测详细数据(下方表格)")
|
||||
public R<AttRvMonitorDetailVo> detail(@Schema(name = "stcd") @RequestParam("stcd") String stcd) {
|
||||
return R.ok(riverWaterService.detail(stcd));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.gunshi.core.annotation.Get;
|
||||
import com.gunshi.core.annotation.Post;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.dto.RotaDto;
|
||||
import com.gunshi.project.hsz.entity.vo.RotaVo;
|
||||
import com.gunshi.project.hsz.listener.RotaImportListener;
|
||||
import com.gunshi.project.hsz.model.RotaB;
|
||||
import com.gunshi.project.hsz.service.RotaService;
|
||||
import com.gunshi.project.hsz.util.ExcelUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by wanyan on 2024/3/25
|
||||
*
|
||||
* @author wanyan
|
||||
* @version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rota")
|
||||
@Tag(name = "值班表")
|
||||
public class RotaController {
|
||||
|
||||
@Resource
|
||||
private RotaService rotaService;
|
||||
|
||||
|
||||
@Get(path = "/query", summary = "按年月查询")
|
||||
public R<Map<String,List<RotaB>>> query(@Schema(name = "yearMonth",description = "年月",example = "2024-03") @RequestParam(name = "yearMonth") String yearMonth) {
|
||||
return R.ok(rotaService.query(yearMonth));
|
||||
}
|
||||
|
||||
|
||||
@Post(path = "/edit/info", summary = "编辑值班信息")
|
||||
public R<String> editInfo(@RequestBody @Validated RotaDto rotaDto) {
|
||||
return R.ok(rotaService.editInfo(rotaDto));
|
||||
}
|
||||
|
||||
@Get(path = "/date/list", summary = "按年月日查询")
|
||||
public R<List<RotaB>> dateList(@Schema(name = "rotaDate",description = "年月日",example = "2024-08-19") @RequestParam(name = "rotaDate") String rotaDate) {
|
||||
return R.ok(rotaService.dateList(rotaDate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导入模板
|
||||
*/
|
||||
@Operation(summary = "获取导入模板")
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
ExcelUtil.exportExcel(new ArrayList<>(), "值班表", RotaVo.class, response, "值班表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*
|
||||
* @param file 导入文件
|
||||
*
|
||||
*/
|
||||
@Operation(summary = "导入数据")
|
||||
@PostMapping(value = "/importData", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public R importData(@RequestPart("file") MultipartFile file) throws Exception {
|
||||
//获取正确数据
|
||||
ArrayList<RotaVo> successArrayList = new ArrayList<>();
|
||||
//获取错误数据
|
||||
ArrayList<RotaVo> errorArrayList = new ArrayList<>();
|
||||
EasyExcel.read(file.getInputStream())
|
||||
.head(RotaVo.class)
|
||||
.registerReadListener(new RotaImportListener(
|
||||
// 监听器中doAfterAllAnalysed执行此方法;所有读取完成之后处理逻辑
|
||||
successArrayList::addAll, errorArrayList::addAll))
|
||||
// 设置sheet,默认读取第一个
|
||||
.sheet()
|
||||
// 设置标题(字段列表)所在行数
|
||||
.headRowNumber(2)
|
||||
.doRead();
|
||||
if(CollectionUtils.isNotEmpty(errorArrayList)){
|
||||
List<String> errMsg = errorArrayList.stream().map(RotaVo::getErrorMsg).collect(Collectors.toList());
|
||||
return R.error(400,String.join(";",errMsg));
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(successArrayList)){
|
||||
rotaService.saveImportData(successArrayList);
|
||||
return R.ok();
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.RotaLogPageSo;
|
||||
import com.gunshi.project.hsz.model.RotaLog;
|
||||
import com.gunshi.project.hsz.service.RotaLogService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by wanyan on 2024/3/25
|
||||
*
|
||||
* @author wanyan
|
||||
* @version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/rota/log")
|
||||
@Tag(name = "值班日志")
|
||||
public class RotaLogController {
|
||||
|
||||
@Resource
|
||||
private RotaLogService service;
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<RotaLog> insert(@Validated(Insert.class) @RequestBody RotaLog dto) {
|
||||
checkParam(dto);
|
||||
dto.setId(IdWorker.getId());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<RotaLog> update(@Validated(Update.class) @RequestBody RotaLog dto) {
|
||||
checkParam(dto);
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Long id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
private void checkParam(RotaLog dto) {
|
||||
Long id = dto.getId();
|
||||
LambdaQueryWrapper<RotaLog> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.eq(RotaLog::getRotaDate,dto.getRotaDate());
|
||||
if(id != null){
|
||||
queryWrapper.ne(RotaLog::getId,id);
|
||||
}
|
||||
if(service.count(queryWrapper ) > 0){
|
||||
throw new IllegalArgumentException("该日期已存在值班日志");
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<RotaLog>> page(@RequestBody RotaLogPageSo rotaLogPageSo) {
|
||||
return R.ok(service.queryPage(rotaLogPageSo));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.CommonDataPageSo2;
|
||||
import com.gunshi.project.hsz.model.SafetyAccidentReg;
|
||||
import com.gunshi.project.hsz.service.SafetyAccidentRegService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 描述: 安全事故登记
|
||||
* author: xusan
|
||||
* date: 2024-08-21 14:45:44
|
||||
*/
|
||||
@Tag(name = "安全事故登记")
|
||||
@RestController
|
||||
@RequestMapping(value="/safety/accident/reg")
|
||||
public class SafetyAccidentRegController extends AbstractCommonFileController {
|
||||
|
||||
@Autowired
|
||||
private SafetyAccidentRegService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<SafetyAccidentReg> insert(@Validated(Insert.class) @RequestBody SafetyAccidentReg dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<SafetyAccidentReg> update(@Validated(Update.class) @RequestBody SafetyAccidentReg dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<SafetyAccidentReg>> page(@RequestBody CommonDataPageSo2 page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "safetyAccidentReg";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.CommonDataPageSo;
|
||||
import com.gunshi.project.hsz.model.SafetyCheck;
|
||||
import com.gunshi.project.hsz.service.SafetyCheckService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 描述: 安全检查管理
|
||||
* author: wanyan
|
||||
* date: 2024-08-20 17:40:37
|
||||
*/
|
||||
@Tag(name = "安全检查管理")
|
||||
@RestController
|
||||
@RequestMapping(value="/safety/check")
|
||||
public class SafetyCheckController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private SafetyCheckService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<SafetyCheck> insert(@Validated(Insert.class) @RequestBody SafetyCheck dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<SafetyCheck> update(@Validated(Update.class) @RequestBody SafetyCheck dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<SafetyCheck>> page(@RequestBody @Validated CommonDataPageSo page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "safetyCheck";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.CommonDataPageSo;
|
||||
import com.gunshi.project.hsz.model.SafetyHazardInvest;
|
||||
import com.gunshi.project.hsz.service.SafetyHazardInvestService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 描述: 安全隐患排查
|
||||
* author: wanyan
|
||||
* date: 2024-08-20 17:40:37
|
||||
*/
|
||||
@Tag(name = "安全隐患排查")
|
||||
@RestController
|
||||
@RequestMapping(value="/safety/hazard/invest")
|
||||
public class SafetyHazardInvestController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private SafetyHazardInvestService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<SafetyHazardInvest> insert(@Validated(Insert.class) @RequestBody SafetyHazardInvest dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<SafetyHazardInvest> update(@Validated(Update.class) @RequestBody SafetyHazardInvest dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<SafetyHazardInvest>> page(@RequestBody @Validated CommonDataPageSo page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "safetyHazardInvest";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.db.dto.PageSo;
|
||||
import com.gunshi.project.hsz.model.SafetyIdentify;
|
||||
import com.gunshi.project.hsz.service.SafetyIdentifyService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 描述: 安全鉴定台账
|
||||
* author: xusan
|
||||
* date: 2024-08-21 14:45:44
|
||||
*/
|
||||
@Tag(name = "安全鉴定台账")
|
||||
@RestController
|
||||
@RequestMapping(value="/safety/identify")
|
||||
public class SafetyIdentifyController extends AbstractCommonFileController {
|
||||
|
||||
@Autowired
|
||||
private SafetyIdentifyService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<SafetyIdentify> insert(@Validated(Insert.class) @RequestBody SafetyIdentify dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<SafetyIdentify> update(@Validated(Update.class) @RequestBody SafetyIdentify dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<SafetyIdentify>> page(@RequestBody PageSo page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "safetyIdentify";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.db.dto.PageSo;
|
||||
import com.gunshi.project.hsz.model.SafetyReinforcement;
|
||||
import com.gunshi.project.hsz.service.SafetyReinforcementService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 描述: 除险加固台账
|
||||
* author: xusan
|
||||
* date: 2024-08-22 11:27:44
|
||||
*/
|
||||
@Tag(name = "除险加固台账")
|
||||
@RestController
|
||||
@RequestMapping(value="/safety/reinforcement")
|
||||
public class SafetyReinforcementController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private SafetyReinforcementService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<SafetyReinforcement> insert(@Validated(Insert.class) @RequestBody SafetyReinforcement dto) {
|
||||
return R.ok(service.saveData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<SafetyReinforcement> update(@Validated(Update.class) @RequestBody SafetyReinforcement dto) {
|
||||
return R.ok(service.updateData(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.delData(id));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<SafetyReinforcement>> page(@RequestBody PageSo page) {
|
||||
return R.ok(service.pageQuery(page));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "safetyReinforcement";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.vo.HomeShpPlacementVo;
|
||||
import com.gunshi.project.hsz.model.ShpPlacement;
|
||||
import com.gunshi.project.hsz.service.ShpPlacementService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 安置点
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "安置点")
|
||||
@RestController
|
||||
@RequestMapping(value="/shpPlacement")
|
||||
public class ShpPlacementController {
|
||||
|
||||
@Autowired
|
||||
private ShpPlacementService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ShpPlacement> insert(@Validated(Insert.class) @RequestBody ShpPlacement dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ShpPlacement> update(@Validated(Update.class) @RequestBody ShpPlacement dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ShpPlacement>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<ShpPlacement>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "详情和行政区划数据查询")
|
||||
@PostMapping("/getDetailsAndAddvcdDataList")
|
||||
public R<List<HomeShpPlacementVo>> getDetailsAndMonitoringDataList() {
|
||||
return R.ok(service.getDetailsAndMonitoringDataLis());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.annotation.Get;
|
||||
import com.gunshi.core.annotation.Post;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.SoilMoisturePageSo;
|
||||
import com.gunshi.project.hsz.entity.vo.SoilMoistureVO;
|
||||
import com.gunshi.project.hsz.model.SoilMoistureData;
|
||||
import com.gunshi.project.hsz.model.SoilMoistureStation;
|
||||
import com.gunshi.project.hsz.service.SoilMoistureDataService;
|
||||
import com.gunshi.project.hsz.service.SoilMoistureStationService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 土壤墒情
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/soilMoisture")
|
||||
@Tag(name = "土壤墒情")
|
||||
public class SoilMoistureController {
|
||||
|
||||
@Autowired
|
||||
private SoilMoistureStationService soilMoistureStationService;
|
||||
|
||||
@Autowired
|
||||
private SoilMoistureDataService soilMoistureDataService;
|
||||
|
||||
@Get(path = "/stationList", summary = "站点列表")
|
||||
public R<List<SoilMoistureStation>> listStation() {
|
||||
List<SoilMoistureStation> list = soilMoistureStationService.list();
|
||||
if(CollectionUtil.isEmpty(list)){
|
||||
return R.ok(list);
|
||||
}
|
||||
List<SoilMoistureStation> collect = list.stream().peek(e -> {
|
||||
LambdaQueryWrapper<SoilMoistureData> qw = new LambdaQueryWrapper();
|
||||
qw.eq(SoilMoistureData::getStcd,e.getStcd()).orderByDesc(SoilMoistureData::getCreateTime).last(" limit 1");
|
||||
SoilMoistureData one = soilMoistureDataService.getOne(qw);
|
||||
e.setTm(one.getCreateTime());
|
||||
e.setVal(one.getVal());
|
||||
}).collect(Collectors.toList());
|
||||
return R.ok(collect);
|
||||
}
|
||||
|
||||
@Post(path = "/page", summary = "分页")
|
||||
public R<Page<SoilMoistureData>> page(@RequestBody SoilMoisturePageSo page) {
|
||||
return R.ok(soilMoistureDataService.pageQuery(page));
|
||||
}
|
||||
|
||||
@GetMapping("/count/{stcd}")
|
||||
public R<SoilMoistureVO> count(@Schema(name = "stcd") @PathVariable("stcd") Serializable stcd) {
|
||||
return R.ok(soilMoistureDataService.count(stcd.toString()));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<SoilMoistureData> insert(@Validated(Insert.class) @RequestBody SoilMoistureData dto) {
|
||||
boolean result = soilMoistureDataService.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<SoilMoistureData> update(@Validated(Update.class) @RequestBody SoilMoistureData dto) {
|
||||
boolean result = soilMoistureDataService.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(soilMoistureDataService.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<SoilMoistureData>> list() {
|
||||
return R.ok(soilMoistureDataService.lambdaQuery().list());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.annotation.Get;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.vo.StAddvcdTreeVo;
|
||||
import com.gunshi.project.hsz.model.StAddvcdD;
|
||||
import com.gunshi.project.hsz.service.StAddvcdDService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 行政区划表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "行政区划表")
|
||||
@RestController
|
||||
@RequestMapping(value="/stAddvcdD")
|
||||
public class StAddvcdDController {
|
||||
|
||||
@Autowired
|
||||
private StAddvcdDService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<StAddvcdD> insert(@Validated(Insert.class) @RequestBody StAddvcdD dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<StAddvcdD> update(@Validated(Update.class) @RequestBody StAddvcdD dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<StAddvcdD>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
/**
|
||||
* 行政区划树
|
||||
*/
|
||||
@Get(path = "/tree", summary = "行政区划树")
|
||||
public R<List<StAddvcdTreeVo>> tree(@Schema(description = "以根节点为基础,返回数据的深度,最低到组(自然村)") @RequestParam("level") String level) {
|
||||
return R.ok(service.tree(level));
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<StAddvcdD>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.StImgR;
|
||||
import com.gunshi.project.hsz.service.StImgRService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 图像历史表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "图像历史表")
|
||||
@RestController
|
||||
@RequestMapping(value="/stImgR")
|
||||
public class StImgRController {
|
||||
|
||||
@Autowired
|
||||
private StImgRService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<StImgR> insert(@Validated(Insert.class) @RequestBody StImgR dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<StImgR> update(@Validated(Update.class) @RequestBody StImgR dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<StImgR>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<StImgR>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.model.StImgRReal;
|
||||
import com.gunshi.project.hsz.service.StImgRRealService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: 图像表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "图像表")
|
||||
@RestController
|
||||
@RequestMapping(value="/stImgRReal")
|
||||
public class StImgRRealController {
|
||||
|
||||
@Autowired
|
||||
private StImgRRealService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<StImgRReal> insert(@Validated(Insert.class) @RequestBody StImgRReal dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<StImgRReal> update(@Validated(Update.class) @RequestBody StImgRReal dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<StImgRReal>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public R<List<StImgRReal>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.gunshi.project.hsz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.hsz.entity.so.ImgWarnPageSo;
|
||||
import com.gunshi.project.hsz.model.StImgWarnR;
|
||||
import com.gunshi.project.hsz.service.StImgWarnRService;
|
||||
import com.gunshi.project.hsz.validate.markers.Insert;
|
||||
import com.gunshi.project.hsz.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 描述: AI告警表
|
||||
* author: xusan
|
||||
* date: 2024-07-08 17:40:37
|
||||
*/
|
||||
@Tag(name = "AI告警表")
|
||||
@RestController
|
||||
@RequestMapping(value="/stImgWarnR")
|
||||
public class StImgWarnRController {
|
||||
|
||||
@Autowired
|
||||
private StImgWarnRService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<StImgWarnR> insert(@Validated(Insert.class) @RequestBody StImgWarnR dto) {
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<StImgWarnR> update(@Validated(Update.class) @RequestBody StImgWarnR dto) {
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "删除")
|
||||
@GetMapping("/del/{id}")
|
||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<StImgWarnR>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<StImgWarnR>> page(@RequestBody ImgWarnPageSo imgWarnPageSo) {
|
||||
return R.ok(service.pageQuery(imgWarnPageSo));
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue