溢洪道列表查询,大坝列表查询,闸阀列表查询,潜水泵列表查询,量水堰列表查询,监测站点列表查询,视频基本信息列表查询,视频区域树查询接口新增
parent
5834ec5739
commit
53db88a017
|
|
@ -7,6 +7,7 @@ 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 = {
|
||||
|
|
@ -24,6 +25,7 @@ import org.springframework.boot.SpringApplication;
|
|||
@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);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
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.xyt.entity.so.AttCctvBasePage;
|
||||
import com.gunshi.project.xyt.model.AttCctvBase;
|
||||
import com.gunshi.project.xyt.service.AttCctvBaseService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
|
|
@ -56,8 +60,21 @@ public class AttCctvBaseController {
|
|||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<List<AttCctvBase>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
public R<Page<AttCctvBase>> page(@RequestBody @Validated AttCctvBasePage page) {
|
||||
LambdaQueryChainWrapper<AttCctvBase> query = service.lambdaQuery();
|
||||
if (ObjectUtils.isNotNull(page.getCode())) {
|
||||
query.like(AttCctvBase::getIndexCode, page.getCode());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getMenuId())) {
|
||||
query.like(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()));
|
||||
}
|
||||
return R.ok(service.page(page.getPageSo().toPage(), query));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
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.xyt.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.xyt.model.AttDamBase;
|
||||
import com.gunshi.project.xyt.service.AttDamBaseService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
|
|
@ -14,6 +18,8 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 大坝表
|
||||
* author: xusan
|
||||
|
|
@ -38,6 +44,9 @@ public class AttDamBaseController {
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttDamBase> update(@Validated(Update.class) @RequestBody AttDamBase dto) {
|
||||
if (Objects.isNull(service.getById(dto.getDamCode()))) {
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -45,6 +54,9 @@ public class AttDamBaseController {
|
|||
@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));
|
||||
}
|
||||
|
||||
|
|
@ -56,8 +68,15 @@ public class AttDamBaseController {
|
|||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<List<AttDamBase>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
public R<Page<AttDamBase>> page(@RequestBody @Validated GeneralDataPage page) {
|
||||
LambdaQueryChainWrapper<AttDamBase> query = service.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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,9 +1,14 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
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.xyt.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.xyt.entity.vo.ProfilePressTreeVo;
|
||||
import com.gunshi.project.xyt.model.AttDamProfile;
|
||||
import com.gunshi.project.xyt.service.AttDamProfileService;
|
||||
import com.gunshi.project.xyt.service.FileAssociationsService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
|
@ -15,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 监测断面信息表
|
||||
|
|
@ -24,29 +30,46 @@ import java.util.List;
|
|||
@Tag(name = "监测断面信息表")
|
||||
@RestController
|
||||
@RequestMapping(value="/attDamProfile")
|
||||
public class AttDamProfileController {
|
||||
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.lambdaQuery().eq(AttDamProfile::getProfileName,dto.getProfileName()))) {
|
||||
throw new RuntimeException("当前名称已存在");
|
||||
}
|
||||
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 RuntimeException("当前数据不存在");
|
||||
}
|
||||
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 RuntimeException("当前数据不存在");
|
||||
}
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
|
|
@ -64,9 +87,18 @@ public class AttDamProfileController {
|
|||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<List<AttDamProfile>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
public R<Page<AttDamProfile>> page(@RequestBody @Validated GeneralDataPage page) {
|
||||
LambdaQueryChainWrapper<AttDamProfile> query = service.lambdaQuery();
|
||||
if (ObjectUtils.isNotNull(page.getName())) {
|
||||
query.like(AttDamProfile::getProfileName, page.getName());
|
||||
}
|
||||
|
||||
return R.ok(service.page(page.getPageSo().toPage(), query));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "AttDamProfile";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
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.xyt.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.xyt.model.AttGateValve;
|
||||
import com.gunshi.project.xyt.service.AttGateValveService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
|
|
@ -14,6 +18,8 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 闸阀信息表
|
||||
* author: xusan
|
||||
|
|
@ -38,6 +44,9 @@ public class AttGateValveController {
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttGateValve> update(@Validated(Update.class) @RequestBody AttGateValve dto) {
|
||||
if (Objects.isNull(service.getById(dto.getValveCode()))) {
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -45,6 +54,9 @@ public class AttGateValveController {
|
|||
@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));
|
||||
}
|
||||
|
||||
|
|
@ -56,8 +68,15 @@ public class AttGateValveController {
|
|||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<List<AttGateValve>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
public R<Page<AttGateValve>> page(@RequestBody @Validated GeneralDataPage page) {
|
||||
LambdaQueryChainWrapper<AttGateValve> query = service.lambdaQuery();
|
||||
if (ObjectUtils.isNotNull(page.getCode())){
|
||||
query.like(AttGateValve::getValveCode, page.getCode());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getName())){
|
||||
query.like(AttGateValve::getValveName, page.getName());
|
||||
}
|
||||
return R.ok(service.page(page.getPageSo().toPage(),query));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
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.xyt.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.xyt.model.AttMeaWeir;
|
||||
import com.gunshi.project.xyt.service.AttMeaWeirService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
|
|
@ -14,6 +18,8 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 量水堰表
|
||||
* author: xusan
|
||||
|
|
@ -38,6 +44,9 @@ public class AttMeaWeirController {
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttMeaWeir> update(@Validated(Update.class) @RequestBody AttMeaWeir dto) {
|
||||
if (Objects.isNull(service.getById(dto.getWeirCode()))) {
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -45,6 +54,9 @@ public class AttMeaWeirController {
|
|||
@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));
|
||||
}
|
||||
|
||||
|
|
@ -56,8 +68,14 @@ public class AttMeaWeirController {
|
|||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<List<AttMeaWeir>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
public R<Page<AttMeaWeir>> page(@RequestBody @Validated GeneralDataPage page) {
|
||||
LambdaQueryChainWrapper<AttMeaWeir> query = service.lambdaQuery();
|
||||
if (ObjectUtils.isNotNull(page.getCode())) {
|
||||
query.like(AttMeaWeir::getWeirCode, page.getCode());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getName())) {
|
||||
query.like(AttMeaWeir::getWeirName, page.getName());
|
||||
}
|
||||
return R.ok(service.page(page.getPageSo().toPage(), query));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
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.xyt.entity.so.GeneralDataPage;
|
||||
import com.gunshi.project.xyt.model.AttSpillwayBase;
|
||||
import com.gunshi.project.xyt.service.AttSpillwayBaseService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
|
|
@ -14,6 +18,8 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 溢洪道
|
||||
* author: xusan
|
||||
|
|
@ -38,6 +44,9 @@ public class AttSpillwayBaseController {
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<AttSpillwayBase> update(@Validated(Update.class) @RequestBody AttSpillwayBase dto) {
|
||||
if (Objects.isNull(service.getById(dto.getCode()))) {
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -45,6 +54,9 @@ public class AttSpillwayBaseController {
|
|||
@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));
|
||||
}
|
||||
|
||||
|
|
@ -56,8 +68,14 @@ public class AttSpillwayBaseController {
|
|||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<List<AttSpillwayBase>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
public R<Page<AttSpillwayBase>> page(@RequestBody @Validated GeneralDataPage page) {
|
||||
LambdaQueryChainWrapper<AttSpillwayBase> query = service.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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -54,6 +54,12 @@ public class CctvBMenuController {
|
|||
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() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.model.FileAssociations;
|
||||
import com.gunshi.project.xyt.service.FileAssociationsService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -3,18 +3,22 @@ package com.gunshi.project.xyt.controller;
|
|||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.entity.vo.HomeIaCBsnssinfoVo;
|
||||
import com.gunshi.project.xyt.model.IaCBsnssinfo;
|
||||
import com.gunshi.project.xyt.service.FileAssociationsService;
|
||||
import com.gunshi.project.xyt.service.IaCBsnssinfoService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.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.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 防治区企事业单位汇总表
|
||||
* author: xusan
|
||||
|
|
@ -23,30 +27,50 @@ import java.util.List;
|
|||
@Tag(name = "防治区企事业单位汇总表")
|
||||
@RestController
|
||||
@RequestMapping(value="/iaCBsnssinfo")
|
||||
public class IaCBsnssinfoController {
|
||||
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) {
|
||||
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 RuntimeException("当前数据不存在");
|
||||
}
|
||||
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) {
|
||||
return R.ok(service.removeById(id));
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
boolean data = service.removeById(id);
|
||||
|
||||
if (data){
|
||||
fileService.deleteFile(getGroupId(),id.toString());
|
||||
}
|
||||
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
|
|
@ -64,6 +88,15 @@ public class IaCBsnssinfoController {
|
|||
@Operation(summary = "详情和行政区划数据查询")
|
||||
@PostMapping("/getDetailsAndAddvcdDataList")
|
||||
public R<List<HomeIaCBsnssinfoVo>> getDetailsAndMonitoringDataList() {
|
||||
return R.ok(service.getDetailsAndMonitoringDataLis());
|
||||
List<HomeIaCBsnssinfoVo> list = service.getDetailsAndMonitoringDataLis();
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
list.forEach(o -> o.setFiles(fileService.getFiles(getGroupId(),o.getEicd())));
|
||||
}
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "iaCBsnssinfo";
|
||||
}
|
||||
}
|
||||
|
|
@ -3,19 +3,22 @@ package com.gunshi.project.xyt.controller;
|
|||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.entity.so.ResCodeSo;
|
||||
import com.gunshi.project.xyt.model.ResPlanB;
|
||||
import com.gunshi.project.xyt.model.ResSafePersonB;
|
||||
import com.gunshi.project.xyt.service.FileAssociationsService;
|
||||
import com.gunshi.project.xyt.service.ResPlanBService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.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.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 水库预案表
|
||||
* author: xusan
|
||||
|
|
@ -24,36 +27,67 @@ import java.util.List;
|
|||
@Tag(name = "水库预案表")
|
||||
@RestController
|
||||
@RequestMapping(value="/resPlanB")
|
||||
public class ResPlanBController {
|
||||
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) {
|
||||
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 RuntimeException("当前数据不存在");
|
||||
}
|
||||
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) {
|
||||
return R.ok(service.removeById(id));
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
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) {
|
||||
return R.ok(service.lambdaQuery().eq(ResPlanB::getResCode,so.getResCode()).list());
|
||||
List<ResPlanB> list = service.lambdaQuery().eq(ResPlanB::getResCode, so.getResCode()).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")
|
||||
|
|
@ -61,4 +95,8 @@ public class ResPlanBController {
|
|||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "ResPlanB";
|
||||
}
|
||||
}
|
||||
|
|
@ -3,18 +3,22 @@ package com.gunshi.project.xyt.controller;
|
|||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.xyt.entity.so.ResCodeSo;
|
||||
import com.gunshi.project.xyt.model.ResProjectImg;
|
||||
import com.gunshi.project.xyt.service.FileAssociationsService;
|
||||
import com.gunshi.project.xyt.service.ResProjectImgService;
|
||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||
import com.gunshi.project.xyt.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.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 水库工程图片
|
||||
* author: xusan
|
||||
|
|
@ -23,36 +27,61 @@ import java.util.List;
|
|||
@Tag(name = "水库工程图片")
|
||||
@RestController
|
||||
@RequestMapping(value="/resProjectImg")
|
||||
public class ResProjectImgController {
|
||||
public class ResProjectImgController extends AbstractCommonFileController{
|
||||
|
||||
@Autowired
|
||||
private ResProjectImgService service;
|
||||
|
||||
@Autowired
|
||||
private FileAssociationsService fileService;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ResProjectImg> insert(@Validated(Insert.class) @RequestBody ResProjectImg dto) {
|
||||
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(service.getById(dto.getId()))) {
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
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) {
|
||||
return R.ok(service.removeById(id));
|
||||
if (Objects.isNull(service.getById(id))) {
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
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) {
|
||||
return R.ok(service.lambdaQuery().eq(ResProjectImg::getResCode,so.getResCode()).list());
|
||||
List<ResProjectImg> list = service.lambdaQuery().eq(ResProjectImg::getResCode, so.getResCode()).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")
|
||||
|
|
@ -60,4 +89,8 @@ public class ResProjectImgController {
|
|||
return R.ok(service.page(null,null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGroupId() {
|
||||
return "ResProjectImg";
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,11 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
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.xyt.entity.so.HomeStStbprpBSo;
|
||||
import com.gunshi.project.xyt.entity.so.StStbprpBPage;
|
||||
import com.gunshi.project.xyt.entity.so.StStbprpBSo;
|
||||
import com.gunshi.project.xyt.entity.vo.HomeStStbprpBVo;
|
||||
import com.gunshi.project.xyt.entity.vo.StStatusListVo;
|
||||
|
|
@ -70,8 +73,18 @@ public class StStbprpBController {
|
|||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<List<StStbprpB>> page() {
|
||||
return R.ok(service.page(null,null));
|
||||
public R<Page<StStbprpB>> page(@RequestBody @Validated StStbprpBPage page) {
|
||||
LambdaQueryChainWrapper<StStbprpB> query = service.lambdaQuery();
|
||||
if (ObjectUtils.isNotNull(page.getCode())) {
|
||||
query.like(StStbprpB::getStcd, page.getCode());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getName())) {
|
||||
query.like(StStbprpB::getStnm, page.getName());
|
||||
}
|
||||
if (ObjectUtils.isNotNull(page.getAgreement())) {
|
||||
query.like(StStbprpB::getAgreement, page.getAgreement());
|
||||
}
|
||||
return R.ok(service.page(page.getPageSo().toPage(), query));
|
||||
}
|
||||
|
||||
@Operation(summary = "雨量站详情带雨量列表")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.gunshi.project.xyt.entity;
|
||||
|
||||
/**
|
||||
* @author xusan
|
||||
* @date 2023/4/27 9:41
|
||||
*/
|
||||
public class MyConstant {
|
||||
|
||||
public static final String
|
||||
|
||||
// 删除
|
||||
DEL = "0",
|
||||
|
||||
// 未删除
|
||||
REC = "1";
|
||||
|
||||
/**
|
||||
* 数据-数据服务运维员 角色编码
|
||||
*/
|
||||
public static final String ROLE_PUSH = "data_zh_om";
|
||||
public static final String REDIS_KEY = "xyt:";
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.gunshi.project.xyt.entity.so;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/7/17.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class AttCctvBasePage extends GeneralDataPage{
|
||||
|
||||
/**
|
||||
* menu_id
|
||||
*/
|
||||
@Schema(description="menu_id")
|
||||
private Long menuId;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.gunshi.project.xyt.entity.so;
|
||||
|
||||
import com.gunshi.project.xyt.entity.page.GenericPageParams;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* Description: 数据通用查询
|
||||
* Created by XuSan on 2024/7/17.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class GeneralDataPage extends GenericPageParams {
|
||||
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
@Schema(description="代码")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description="名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Schema(description="类型")
|
||||
private String type;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.gunshi.project.xyt.entity.so;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/7/17.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class StStbprpBPage extends GeneralDataPage{
|
||||
/**
|
||||
* 归属协议
|
||||
*/
|
||||
@Schema(description="归属协议")
|
||||
private String agreement;
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.gunshi.project.xyt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.xyt.model.FileAssociations;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 文件关联业务表
|
||||
* author: xusan
|
||||
* date: 2024-07-17 10:09:40
|
||||
*/
|
||||
@Mapper
|
||||
public interface FileAssociationsMapper extends BaseMapper<FileAssociations> {
|
||||
|
||||
@Select("""
|
||||
<script>
|
||||
SELECT
|
||||
fa.*,
|
||||
fd.file_name,
|
||||
fd.file_path
|
||||
FROM
|
||||
file_associations fa
|
||||
LEFT JOIN file_descriptor fd ON fa.file_id = fd.file_id
|
||||
WHERE
|
||||
fa.business_id = #{businessId}
|
||||
AND fa."table_name" = #{tableName}
|
||||
AND fd.group_id = #{tableName}
|
||||
</script>
|
||||
""")
|
||||
List<FileAssociations> getFiles(@Param("tableName") String tableName,@Param("businessId") String businessId);
|
||||
}
|
||||
|
|
@ -11,6 +11,7 @@ import jakarta.validation.constraints.Size;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 监测断面信息表
|
||||
|
|
@ -58,4 +59,8 @@ public class AttDamProfile implements Serializable {
|
|||
@Size(max = 250,message = "备注/描述最大长度要小于 250")
|
||||
private String remark;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "文件集合")
|
||||
private List<FileAssociations> files;
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ import lombok.Data;
|
|||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 水库基本信息表
|
||||
|
|
@ -485,4 +486,8 @@ public class AttResBase implements Serializable {
|
|||
@Size(max = 255,message = "adcd最大长度要小于 255")
|
||||
private String adcd;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "文件id集合")
|
||||
private List<String> fileIds;
|
||||
}
|
||||
|
|
@ -5,15 +5,13 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 视频点目录
|
||||
|
|
@ -59,4 +57,9 @@ public class CctvBMenu implements Serializable {
|
|||
@Schema(description="排序")
|
||||
private Integer orderIndex;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description="子集")
|
||||
private List<CctvBMenu> children;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 文件关联业务表
|
||||
* author: xusan
|
||||
* date: 2024-07-17 10:09:40
|
||||
*/
|
||||
@Schema(description="文件关联业务表")
|
||||
@Data
|
||||
@TableName("public.file_associations")
|
||||
public class FileAssociations implements Serializable {
|
||||
|
||||
public final static String thisTableName = "file_associations";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
@NotBlank(message = "主键不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 业务id
|
||||
*/
|
||||
@TableField(value="business_id")
|
||||
@Schema(description="业务id")
|
||||
@NotBlank(message = "业务id不能为空")
|
||||
private String businessId;
|
||||
/**
|
||||
* 业务id
|
||||
*/
|
||||
@TableField(value="business_str_id")
|
||||
@Schema(description="业务id")
|
||||
@NotBlank(message = "业务id不能为空")
|
||||
private String businessStrId;
|
||||
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
@TableField(value="file_id")
|
||||
@Schema(description="文件id")
|
||||
@NotBlank(message = "文件id不能为空")
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
* 序号
|
||||
*/
|
||||
@TableField(value="sort_on")
|
||||
@Schema(description="序号")
|
||||
private Integer sortOn;
|
||||
|
||||
/**
|
||||
* 时间戳
|
||||
*/
|
||||
@TableField(value="tm")
|
||||
@Schema(description="时间戳")
|
||||
@NotBlank(message = "时间戳不能为空")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date tm;
|
||||
|
||||
/**
|
||||
* 业务表名
|
||||
*/
|
||||
@TableField(value="table_name")
|
||||
@Schema(description="业务表名")
|
||||
@Size(max = 255,message = "业务表名最大长度要小于 255")
|
||||
@NotBlank(message = "业务表名不能为空")
|
||||
private String tableName;
|
||||
/**
|
||||
* 业务表名
|
||||
*/
|
||||
@TableField(value="del")
|
||||
@Size(max = 1,message = "删除标识最大长度要小于 2")
|
||||
@Schema(description="删除标识0: 未删除,1:已删除")
|
||||
@NotBlank(message = "删除标识不能为空")
|
||||
private String del;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "文件路径")
|
||||
private String filePath;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "文件名称")
|
||||
private String fileName;
|
||||
|
||||
}
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
package com.gunshi.project.xyt.model;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gunshi.core.dateformat.DateFormatString;
|
||||
|
|
@ -14,6 +12,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 防治区企事业单位汇总表
|
||||
|
|
@ -191,4 +190,7 @@ public class IaCBsnssinfo implements Serializable {
|
|||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date moditime;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "文件集合")
|
||||
private List<FileAssociations> files;
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 水库预案表
|
||||
|
|
@ -112,4 +113,8 @@ public class ResPlanB implements Serializable {
|
|||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date moditime;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "文件集合")
|
||||
private List<FileAssociations> files;
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 水库工程图片
|
||||
|
|
@ -79,4 +80,7 @@ public class ResProjectImg implements Serializable {
|
|||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date moditime;
|
||||
|
||||
@TableField(exist = false)
|
||||
@Schema(description = "文件集合")
|
||||
private List<FileAssociations> files;
|
||||
}
|
||||
|
|
@ -520,6 +520,13 @@ public class StStbprpB implements Serializable {
|
|||
// @Size(max = 0,message = "测站状态 0无效 1有效最大长度要小于 0")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 归属协议
|
||||
*/
|
||||
@Schema(description="归属协议")
|
||||
@TableField(value="agreement")
|
||||
private String agreement;
|
||||
|
||||
public static final String COL_STCD = "stcd";
|
||||
|
||||
}
|
||||
|
|
@ -4,10 +4,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.gunshi.project.xyt.mapper.CctvBMenuMapper;
|
||||
import com.gunshi.project.xyt.model.CctvBMenu;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 视频点目录
|
||||
|
|
@ -20,6 +25,33 @@ import java.util.Date;
|
|||
public class CctvBMenuService extends ServiceImpl<CctvBMenuMapper, CctvBMenu>
|
||||
{
|
||||
|
||||
public List<CctvBMenu> tree() {
|
||||
List<CctvBMenu> list = list(lambdaQuery().orderByDesc(CctvBMenu::getId));
|
||||
if (CollectionUtils.isEmpty(list)){
|
||||
return list;
|
||||
}
|
||||
Map<Long, List<CctvBMenu>> listMap = list.stream().collect(Collectors.groupingBy(CctvBMenu::getParentId));
|
||||
|
||||
list.forEach(o -> o.setChildren(listMap.get(o.getId())));
|
||||
List<CctvBMenu> parentList = list.stream().filter(o -> Objects.isNull(o.getParentId())).collect(Collectors.toList());
|
||||
return sorted(parentList);
|
||||
}
|
||||
|
||||
|
||||
private List<CctvBMenu> sorted( List<CctvBMenu> tree) {
|
||||
|
||||
List<CctvBMenu> sorteds = null;
|
||||
|
||||
if (CollectionUtils.isNotEmpty(tree)){
|
||||
sorteds = tree.stream().sorted(Comparator.comparing(CctvBMenu::getOrderIndex)
|
||||
).collect(Collectors.toList());
|
||||
sorteds.forEach(o->{
|
||||
o.setChildren(sorted(o.getChildren()));
|
||||
});
|
||||
}
|
||||
|
||||
return sorteds;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,103 @@
|
|||
package com.gunshi.project.xyt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.xyt.mapper.FileAssociationsMapper;
|
||||
import com.gunshi.project.xyt.model.FileAssociations;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.gunshi.project.xyt.entity.MyConstant.*;
|
||||
|
||||
|
||||
/**
|
||||
* 描述: 文件关联业务表
|
||||
* author: xusan
|
||||
* date: 2024-07-17 10:09:40
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Transactional
|
||||
public class FileAssociationsService extends ServiceImpl<FileAssociationsMapper, FileAssociations> {
|
||||
|
||||
private static final String THIS_REDIS_KEY = REDIS_KEY + FileAssociations.thisTableName + ":";
|
||||
|
||||
@CacheEvict(value = THIS_REDIS_KEY, key = "#tableName+':'+#businessId", allEntries = true)
|
||||
public void saveFile(List<FileAssociations> files, String tableName, String businessId) {
|
||||
if (CollectionUtils.isEmpty(files)) {
|
||||
log.info("fileIds is null!");
|
||||
}
|
||||
|
||||
// 查询是否添加
|
||||
List<FileAssociations> dbList = this.lambdaQuery()
|
||||
.eq(FileAssociations::getTableName, tableName)
|
||||
.eq(FileAssociations::getBusinessId, businessId)
|
||||
.eq(FileAssociations::getDel, REC)
|
||||
.list();
|
||||
|
||||
if (CollectionUtils.isNotEmpty(dbList)) {
|
||||
Set<Long> fileIds = dbList.stream().map(FileAssociations::getFileId)
|
||||
.collect(Collectors.toSet());
|
||||
// 删除已添加数据, 删除重复数据 删除不成功即新数据
|
||||
files = files.stream()
|
||||
.filter(fileAssociations -> !fileIds.remove(fileAssociations.getFileId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isNotEmpty(files)) {
|
||||
|
||||
// 删除
|
||||
if (this.lambdaUpdate()
|
||||
.set(FileAssociations::getDel, 1)
|
||||
.eq(FileAssociations::getTableName, tableName)
|
||||
.eq(FileAssociations::getBusinessId, businessId)
|
||||
.in(FileAssociations::getFileId, fileIds)
|
||||
.update()) {
|
||||
log.info("delete file {} success!", fileIds);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 做新增
|
||||
if (CollectionUtils.isNotEmpty(files)) {
|
||||
|
||||
files.forEach(fileId -> {
|
||||
FileAssociations fileAssociations = new FileAssociations();
|
||||
fileAssociations.setTableName(tableName);
|
||||
fileAssociations.setBusinessId(businessId);
|
||||
});
|
||||
|
||||
if (!this.saveBatch(files)) {
|
||||
log.error("save file error!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@CacheEvict(value = THIS_REDIS_KEY, key = "#tableName+':'+#businessId", allEntries = true)
|
||||
public void deleteFile(String tableName, String businessId) {
|
||||
// 删除
|
||||
if (this.lambdaUpdate()
|
||||
.set(FileAssociations::getDel, DEL)
|
||||
.eq(FileAssociations::getTableName, tableName)
|
||||
.eq(FileAssociations::getBusinessId, businessId)
|
||||
.update()) {
|
||||
log.info("delete file {} success!", businessId);
|
||||
}
|
||||
}
|
||||
|
||||
@Cacheable(value = THIS_REDIS_KEY, key = "#tableName+':'+#businessId")
|
||||
public List<FileAssociations> getFiles(String tableName, String businessId) {
|
||||
return this.baseMapper.getFiles(tableName,businessId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gunshi.project.xyt.mapper.FileAssociationsMapper">
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue