大屏部分接口修改
parent
74ca877664
commit
392f17b857
|
|
@ -17,10 +17,14 @@ public class OpenApiConfig {
|
|||
@Bean
|
||||
public GroupedOpenApi openApi() {
|
||||
String[] packagesToScan = {
|
||||
"com.gunshi.project.hsz.controller",
|
||||
"com.gunshi.project.ss.controller",
|
||||
};
|
||||
String[] pathsToMatch = {
|
||||
"/osmoticShiftDevice/**"
|
||||
};
|
||||
return GroupedOpenApi.builder()
|
||||
.group("hsz")
|
||||
.group("ss")
|
||||
.pathsToMatch(pathsToMatch)
|
||||
.packagesToScan(packagesToScan)
|
||||
.build();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ package com.gunshi.project.ss.controller;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.ss.entity.so.FundBudgetPageSo;
|
||||
import com.gunshi.project.ss.mapper.FundBudgetMapper;
|
||||
import com.gunshi.project.ss.model.FileAssociations;
|
||||
import com.gunshi.project.ss.model.FundBudget;
|
||||
import com.gunshi.project.ss.service.FileAssociationsService;
|
||||
import com.gunshi.project.ss.service.FundBudgetService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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.web.bind.annotation.*;
|
||||
|
|
@ -49,6 +49,12 @@ public class FundBudgetController extends AbstractCommonFileController {
|
|||
return R.ok(page);
|
||||
}
|
||||
|
||||
@Operation(description = "统计")
|
||||
@GetMapping("stat")
|
||||
public R<FundBudget> stat(@RequestParam(value = "year",required = false) @Parameter(description = "年份") Integer year){
|
||||
FundBudget res = fundBudgetService.stat(year);
|
||||
return R.ok(res);
|
||||
}
|
||||
|
||||
@Operation(description = "新增")
|
||||
@PostMapping("/insert")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,80 @@
|
|||
package com.gunshi.project.ss.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.ss.common.validate.markers.Insert;
|
||||
import com.gunshi.project.ss.common.validate.markers.Update;
|
||||
import com.gunshi.project.ss.entity.so.IaCFlrvvlgPageSo;
|
||||
import com.gunshi.project.ss.model.ImpactZoneInfo;
|
||||
import com.gunshi.project.ss.service.ImpactZoneInfoService;
|
||||
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;
|
||||
|
||||
@Tag(name = "影响区联络信息管理")
|
||||
@RestController
|
||||
@RequestMapping(value="/ImpactZoneInfo")
|
||||
public class ImpactZoneInfoController{
|
||||
|
||||
@Autowired
|
||||
private ImpactZoneInfoService service;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public R<ImpactZoneInfo> insert(@Validated(Insert.class) @RequestBody ImpactZoneInfo dto) {
|
||||
if (StringUtils.isNotBlank(dto.getName())){
|
||||
if (service.lambdaQuery().eq(ImpactZoneInfo::getName,dto.getName()).count() > 0) {
|
||||
throw new IllegalArgumentException("当前名称已存在");
|
||||
}
|
||||
}
|
||||
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
||||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public R<ImpactZoneInfo> update(@Validated(Update.class) @RequestBody ImpactZoneInfo dto) {
|
||||
if (Objects.isNull(service.getById(dto.getId()))) {
|
||||
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("当前数据不存在");
|
||||
}
|
||||
boolean data = service.removeById(id);
|
||||
|
||||
return R.ok(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public R<List<ImpactZoneInfo>> list() {
|
||||
return R.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<ImpactZoneInfo>> page(@RequestBody IaCFlrvvlgPageSo pageSo) {
|
||||
Page<ImpactZoneInfo> page = service.pageInfo(pageSo);
|
||||
return R.ok(page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -97,6 +97,9 @@ public class ResPlanBController extends AbstractCommonFileController{
|
|||
if (StringUtils.isNotBlank(so.getType())){
|
||||
query.eq(ResPlanB::getType, so.getType());
|
||||
}
|
||||
if (so.getIsAvailable() != null){
|
||||
query.eq(ResPlanB::getIsAvailable, so.getIsAvailable());
|
||||
}
|
||||
query.orderByDesc(ResPlanB::getModitime);
|
||||
List<ResPlanB> list = query.list();
|
||||
|
||||
|
|
|
|||
|
|
@ -16,4 +16,7 @@ public class IaCFlrvvlgPageSo {
|
|||
private String name;
|
||||
|
||||
private String phone;
|
||||
|
||||
@Schema(description="状态(0启用 1停用)")
|
||||
private Integer status;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package com.gunshi.project.ss.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.gunshi.project.ss.model.ImpactZoneInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ImpactZoneInfoMapper extends BaseMapper<ImpactZoneInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
package com.gunshi.project.ss.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.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.gunshi.project.ss.common.validate.markers.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description="影响区联络信息管理")
|
||||
@Data
|
||||
@TableName("public.impact_zone_info")
|
||||
public class ImpactZoneInfo implements Serializable {
|
||||
|
||||
public final static String thisTableName = "ImpactZoneInfo";
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键")
|
||||
@NotNull(message = "id不能为空",groups = { Update.class})
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@TableField(value="name")
|
||||
@Schema(description="姓名")
|
||||
@Size(max = 100,message = "姓名最大长度要小于 100")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@TableField(value="org_name")
|
||||
@Schema(description="单位")
|
||||
@Size(max = 100,message = "单位最大长度要小于 100")
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 职务
|
||||
*/
|
||||
@TableField(value="post_name")
|
||||
@Schema(description="职务")
|
||||
@Size(max = 100,message = "职务最大长度要小于 100")
|
||||
private String postName;
|
||||
|
||||
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
@TableField(value="tel")
|
||||
@Schema(description="联系方式")
|
||||
private String tel;
|
||||
|
||||
/**
|
||||
* 关联影响区
|
||||
*/
|
||||
@TableField(value="ass_impact_zone")
|
||||
@Schema(description="关联影响区")
|
||||
@Size(max = 500,message = "关联影响区最大长度要小于 500")
|
||||
private String assImpactZone;
|
||||
|
||||
/**
|
||||
* 主要职责
|
||||
*/
|
||||
@TableField(value="main_duty")
|
||||
@Schema(description="主要职责")
|
||||
@Size(max = 500,message = "主要职责最大长度要小于 500")
|
||||
private String mainDuty;
|
||||
|
||||
|
||||
/**
|
||||
* 状态(0启用 1停用)
|
||||
*/
|
||||
@TableField(value="status")
|
||||
@Schema(description="状态(0启用 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@TableField("create_time")
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
|
|
@ -49,10 +49,10 @@ public class ResPerson extends CommUpdate implements Serializable {
|
|||
private String name;
|
||||
|
||||
/**
|
||||
* 类型,0:行政,1:主管部门,2:管理单位,3:巡查,4:技术
|
||||
* 类型,1:行政,2:主管部门,3:管理单位,4:巡查,5:技术
|
||||
*/
|
||||
@TableField(value="type")
|
||||
@Schema(description="类型,0:行政,1:主管部门,2:管理单位,3:巡查,4:技术")
|
||||
@Schema(description="类型,1:行政,2:主管部门,3:管理单位,4:巡查,5:技术")
|
||||
@NotNull(message = "责任类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ public class ResPlanB implements Serializable {
|
|||
*/
|
||||
@TableField(value="prep_time")
|
||||
@Schema(description="编制时间")
|
||||
// @Size(max = 0,message = "编制时间最大长度要小于 0")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date prepTime;
|
||||
|
||||
|
|
@ -81,7 +80,6 @@ public class ResPlanB implements Serializable {
|
|||
*/
|
||||
@TableField(value="appr_time")
|
||||
@Schema(description="批复时间")
|
||||
// @Size(max = 0,message = "批复时间最大长度要小于 0")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date apprTime;
|
||||
|
||||
|
|
@ -98,7 +96,6 @@ public class ResPlanB implements Serializable {
|
|||
*/
|
||||
@TableField(value="file_id")
|
||||
@Schema(description="文件id")
|
||||
// @Size(max = 0,message = "文件id最大长度要小于 0")
|
||||
private Long fileId;
|
||||
|
||||
/**
|
||||
|
|
@ -106,7 +103,6 @@ public class ResPlanB implements Serializable {
|
|||
*/
|
||||
@TableField(value="type")
|
||||
@Schema(description="类型(1防汛预案 2调度规程)")
|
||||
// @Size(max = 0,message = "类型(1防汛预案 2调度规程)最大长度要小于 0")
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
|
|
@ -114,7 +110,6 @@ public class ResPlanB implements Serializable {
|
|||
*/
|
||||
@TableField(value="moditime")
|
||||
@Schema(description="时间戳")
|
||||
// @Size(max = 0,message = "时间戳最大长度要小于 0")
|
||||
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||
private Date moditime;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.gunshi.project.ss.entity.so.FundBudgetPageSo;
|
||||
import com.gunshi.project.ss.mapper.FundBudgetMapper;
|
||||
import com.gunshi.project.ss.model.FundBudget;
|
||||
import io.jsonwebtoken.lang.Collections;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
|
|
@ -24,6 +26,7 @@ public class FundBudgetService extends ServiceImpl<FundBudgetMapper, FundBudget
|
|||
if(pageSo.getBudgetYear() != null){
|
||||
queryWrapper.eq(FundBudget::getBudgetYear, pageSo.getBudgetYear());
|
||||
}
|
||||
queryWrapper.orderByDesc(FundBudget::getBudgetYear);
|
||||
Page<FundBudget> fundBudgetPage = baseMapper.selectPage(pageSo.getPageSo().toPage(), queryWrapper);
|
||||
return fundBudgetPage;
|
||||
}
|
||||
|
|
@ -67,4 +70,20 @@ public class FundBudgetService extends ServiceImpl<FundBudgetMapper, FundBudget
|
|||
FundBudget one = baseMapper.selectOne(queryWrapper);
|
||||
return one;
|
||||
}
|
||||
|
||||
public FundBudget stat(Integer year) {
|
||||
FundBudget fundBudget = new FundBudget();
|
||||
LambdaQueryWrapper<FundBudget> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if(year != null){
|
||||
queryWrapper.eq(FundBudget::getBudgetYear, year);
|
||||
}
|
||||
List<FundBudget> list = baseMapper.selectList(queryWrapper);
|
||||
if (Collections.isEmpty(list)){
|
||||
return fundBudget;
|
||||
}
|
||||
fundBudget.setAnnualIncomeBudget(list.stream().map(FundBudget::getAnnualIncomeBudget).reduce(BigDecimal.ZERO,BigDecimal::add));
|
||||
fundBudget.setAnnualExpenditureBudget(list.stream().map(FundBudget::getAnnualExpenditureBudget).reduce(BigDecimal.ZERO,BigDecimal::add));
|
||||
fundBudget.setBudgetBalance(list.stream().map(FundBudget::getBudgetBalance).reduce(BigDecimal.ZERO,BigDecimal::add));
|
||||
return fundBudget;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
package com.gunshi.project.ss.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gunshi.project.ss.entity.so.IaCFlrvvlgPageSo;
|
||||
import com.gunshi.project.ss.entity.vo.HomeIaCBsnssinfoVo;
|
||||
import com.gunshi.project.ss.mapper.IaCBsnssinfoMapper;
|
||||
import com.gunshi.project.ss.mapper.ImpactZoneInfoMapper;
|
||||
import com.gunshi.project.ss.model.IaCBsnssinfo;
|
||||
import com.gunshi.project.ss.model.ImpactZoneInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public class ImpactZoneInfoService extends ServiceImpl<ImpactZoneInfoMapper, ImpactZoneInfo>
|
||||
{
|
||||
|
||||
|
||||
public Page<ImpactZoneInfo> pageInfo(IaCFlrvvlgPageSo pageSo) {
|
||||
LambdaQueryWrapper<ImpactZoneInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if(!StringUtils.isEmpty(pageSo.getName())){
|
||||
queryWrapper.like(ImpactZoneInfo::getName, pageSo.getName());
|
||||
}
|
||||
if(pageSo.getStatus() != null){
|
||||
queryWrapper.eq(ImpactZoneInfo::getStatus, pageSo.getStatus());
|
||||
}
|
||||
queryWrapper.orderByDesc(ImpactZoneInfo::getCreateTime);
|
||||
return this.baseMapper.selectPage(pageSo.getPageSo().toPage(), queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
package com.gunshi.project.ss.service;
|
||||
|
||||
|
||||
import com.gunshi.core.result.R;
|
||||
import com.gunshi.project.ss.model.ResPlanB;
|
||||
import com.gunshi.project.ss.model.RotaB;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
|
|||
|
|
@ -57,14 +57,14 @@ public class ScreenResponsibilityService {
|
|||
}
|
||||
|
||||
public List<ResPerson> getPerson() {
|
||||
List<ResPerson> list = resPersonService.lambdaQuery().in(ResPerson::getType, Arrays.asList(0, 1, 2))
|
||||
List<ResPerson> list = resPersonService.lambdaQuery().in(ResPerson::getType, Arrays.asList(1, 2, 3))
|
||||
.orderByDesc(ResPerson::getCreateTime)
|
||||
.list();
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<ResPerson> getFxPerson() {
|
||||
List<ResPerson> list = resPersonService.lambdaQuery().in(ResPerson::getType, Arrays.asList(0, 3, 4))
|
||||
List<ResPerson> list = resPersonService.lambdaQuery().in(ResPerson::getType, Arrays.asList(1, 4, 5))
|
||||
.orderByDesc(ResPerson::getCreateTime)
|
||||
.list();
|
||||
return list;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package com.gunshi.project.ss.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.gunshi.project.ss.entity.vo.ScreenSecurityCheckVo;
|
||||
import com.gunshi.project.ss.entity.vo.WholeCycleVo;
|
||||
import com.gunshi.project.ss.model.*;
|
||||
|
|
|
|||
|
|
@ -1,25 +1,25 @@
|
|||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
active: local
|
||||
datasource:
|
||||
dynamic:
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:postgresql://localhost:5432/ss?stringtype=unspecified
|
||||
username: postgres
|
||||
password: postgres
|
||||
url: jdbc:postgresql://10.0.41.112:5432/ss?stringtype=unspecified
|
||||
username: gunshiiot
|
||||
password: 1234567a
|
||||
driver-class-name: org.postgresql.Driver
|
||||
access-logging:
|
||||
url: jdbc:postgresql://localhost:5432/ss
|
||||
username: postgres
|
||||
password: postgres
|
||||
url: jdbc:postgresql://10.0.41.112:5432/ss
|
||||
username: gunshiiot
|
||||
password: 1234567a
|
||||
driver-class-name: org.postgresql.Driver
|
||||
data:
|
||||
redis:
|
||||
host: localhost
|
||||
host: r-wz9168ab2f2f7ec4pd.redis.rds.aliyuncs.com
|
||||
port: 6379
|
||||
#password: 1234567a
|
||||
database: 0
|
||||
password: CoWR1111
|
||||
database: 9
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
|
|
@ -38,10 +38,32 @@ gunshi:
|
|||
# 洪水预测数据库连接信息
|
||||
algorithem:
|
||||
datasource:
|
||||
url: jdbc:postgresql://localhost:5432/ss?stringtype=unspecified
|
||||
username: postgres
|
||||
password: postgres
|
||||
url: jdbc:postgresql://10.0.41.112:5432/ss?stringtype=unspecified
|
||||
username: gunshiiot
|
||||
password: 1234567a
|
||||
driver-class-name: org.postgresql.Driver
|
||||
|
||||
jcskPath: http://64.97.142.113:8002/shareddata/api/v1/monitdata
|
||||
jcskToken: FB1EE57468E0CB9A51306F9056A534776A505E95AB687866AD05EA91C61B1444D210FF3E3033E268869C0C0D788770D4DE62078895538CF5BA652F6F1C751D24
|
||||
|
||||
knife4j:
|
||||
enable: true
|
||||
setting:
|
||||
language: zh-CN
|
||||
enable-swagger-models: true
|
||||
swagger-model-name: OpenAPI 3.0 Models
|
||||
|
||||
cache:
|
||||
enabled: true # 启用缓存
|
||||
max-size: 1000 # 缓存最大数量
|
||||
expire-after-write: 10m # 写入后过期时间
|
||||
|
||||
basic:
|
||||
enable: false # 不需要basic认证可以关闭
|
||||
username:
|
||||
password:
|
||||
|
||||
response:
|
||||
cache:
|
||||
enabled: true
|
||||
max-age: 3600
|
||||
Loading…
Reference in New Issue