parent
80024e0b44
commit
cd2ccf7bb6
|
|
@ -22,6 +22,7 @@ import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
@ -95,7 +96,10 @@ public class AttDamProfileController extends AbstractCommonFileController{
|
||||||
@Operation(summary = "列表")
|
@Operation(summary = "列表")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public R<List<AttDamProfile>> list() {
|
public R<List<AttDamProfile>> list() {
|
||||||
return R.ok(service.lambdaQuery().list());
|
LambdaQueryWrapper<AttDamProfile> wq = new LambdaQueryWrapper();
|
||||||
|
wq.orderByAsc(AttDamProfile::getProfileCode);
|
||||||
|
List<AttDamProfile> list = service.list(wq);
|
||||||
|
return R.ok(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "断面渗压树")
|
@Operation(summary = "断面渗压树")
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,99 @@
|
||||||
|
package com.gunshi.project.xyt.controller;
|
||||||
|
|
||||||
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.project.xyt.model.AttResBase;
|
||||||
|
import com.gunshi.project.xyt.model.AttResBuilding;
|
||||||
|
import com.gunshi.project.xyt.model.FileAssociations;
|
||||||
|
import com.gunshi.project.xyt.service.AttResBaseService;
|
||||||
|
import com.gunshi.project.xyt.service.AttResBuildingService;
|
||||||
|
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.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="/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";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
package com.gunshi.project.xyt.controller;
|
package com.gunshi.project.xyt.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.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.gunshi.core.result.R;
|
import com.gunshi.core.result.R;
|
||||||
import com.gunshi.project.xyt.entity.so.OsmoticDetailQuerySo;
|
import com.gunshi.project.xyt.entity.so.OsmoticDetailQuerySo;
|
||||||
|
|
@ -9,21 +12,28 @@ import com.gunshi.project.xyt.entity.vo.OsmoticChartVo;
|
||||||
import com.gunshi.project.xyt.entity.vo.OsmoticPressDetailVo;
|
import com.gunshi.project.xyt.entity.vo.OsmoticPressDetailVo;
|
||||||
import com.gunshi.project.xyt.entity.vo.OsmoticPressVo;
|
import com.gunshi.project.xyt.entity.vo.OsmoticPressVo;
|
||||||
import com.gunshi.project.xyt.entity.vo.OsmoticStationVo;
|
import com.gunshi.project.xyt.entity.vo.OsmoticStationVo;
|
||||||
|
import com.gunshi.project.xyt.model.OsmoticPressDevice;
|
||||||
import com.gunshi.project.xyt.model.OsmoticPressR;
|
import com.gunshi.project.xyt.model.OsmoticPressR;
|
||||||
|
import com.gunshi.project.xyt.service.OsmoticPressDeviceService;
|
||||||
import com.gunshi.project.xyt.service.OsmoticPressRService;
|
import com.gunshi.project.xyt.service.OsmoticPressRService;
|
||||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
import com.gunshi.project.xyt.validate.markers.Update;
|
import com.gunshi.project.xyt.validate.markers.Update;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述: 渗压监测记录表
|
* 描述: 渗压监测记录表
|
||||||
|
|
@ -38,10 +48,18 @@ public class OsmoticPressRController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private OsmoticPressRService service;
|
private OsmoticPressRService service;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OsmoticPressDeviceService osmoticPressDeviceService;
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "新增")
|
@Operation(summary = "新增")
|
||||||
@PostMapping("/insert")
|
@PostMapping("/insert")
|
||||||
public R<OsmoticPressR> insert(@Validated(Insert.class) @RequestBody OsmoticPressR dto) {
|
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);
|
boolean result = service.save(dto);
|
||||||
return R.ok(result ? dto : null);
|
return R.ok(result ? dto : null);
|
||||||
}
|
}
|
||||||
|
|
@ -49,14 +67,27 @@ public class OsmoticPressRController {
|
||||||
@Operation(summary = "修改")
|
@Operation(summary = "修改")
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public R<OsmoticPressR> update(@Validated(Update.class) @RequestBody OsmoticPressR dto) {
|
public R<OsmoticPressR> update(@Validated(Update.class) @RequestBody OsmoticPressR dto) {
|
||||||
boolean result = service.updateById(dto);
|
LambdaUpdateWrapper<OsmoticPressR> wrapper = new LambdaUpdateWrapper<>();
|
||||||
return R.ok(result ? dto : null);
|
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 = "删除")
|
@Operation(summary = "删除")
|
||||||
@GetMapping("/del/{id}")
|
@GetMapping("/del/{id}/{tm}")
|
||||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id,@Schema(name = "tm") @PathVariable("tm") Serializable tm) {
|
||||||
return R.ok(service.removeById(id));
|
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 = "列表")
|
@Operation(summary = "列表")
|
||||||
|
|
@ -68,7 +99,22 @@ public class OsmoticPressRController {
|
||||||
@Operation(summary = "分页")
|
@Operation(summary = "分页")
|
||||||
@PostMapping("/page")
|
@PostMapping("/page")
|
||||||
public R<Page<OsmoticPressR>> page(@RequestBody OsmoticQueryPageSo osmoticQueryPageSo) {
|
public R<Page<OsmoticPressR>> page(@RequestBody OsmoticQueryPageSo osmoticQueryPageSo) {
|
||||||
return R.ok(service.queryPage(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 = "大屏-大坝安全监测统计")
|
@Operation(summary = "大屏-大坝安全监测统计")
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
package com.gunshi.project.xyt.controller;
|
package com.gunshi.project.xyt.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.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.gunshi.core.result.R;
|
import com.gunshi.core.result.R;
|
||||||
import com.gunshi.project.xyt.entity.so.OsmoticDetailQuerySo;
|
import com.gunshi.project.xyt.entity.so.OsmoticDetailQuerySo;
|
||||||
import com.gunshi.project.xyt.entity.so.OsmoticQueryPageSo;
|
import com.gunshi.project.xyt.entity.so.OsmoticQueryPageSo;
|
||||||
import com.gunshi.project.xyt.entity.so.OsmoticQuerySo;
|
import com.gunshi.project.xyt.entity.so.OsmoticQuerySo;
|
||||||
import com.gunshi.project.xyt.entity.vo.*;
|
import com.gunshi.project.xyt.entity.vo.*;
|
||||||
|
import com.gunshi.project.xyt.model.OsmoticPressR;
|
||||||
import com.gunshi.project.xyt.model.OsmoticShiftR;
|
import com.gunshi.project.xyt.model.OsmoticShiftR;
|
||||||
import com.gunshi.project.xyt.service.OsmoticShiftRService;
|
import com.gunshi.project.xyt.service.OsmoticShiftRService;
|
||||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
|
|
@ -19,7 +22,10 @@ import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述: 位移监测记录表
|
* 描述: 位移监测记录表
|
||||||
* author: xusan
|
* author: xusan
|
||||||
|
|
@ -37,6 +43,7 @@ public class OsmoticShiftRController {
|
||||||
@Operation(summary = "新增")
|
@Operation(summary = "新增")
|
||||||
@PostMapping("/insert")
|
@PostMapping("/insert")
|
||||||
public R<OsmoticShiftR> insert(@Validated(Insert.class) @RequestBody OsmoticShiftR dto) {
|
public R<OsmoticShiftR> insert(@Validated(Insert.class) @RequestBody OsmoticShiftR dto) {
|
||||||
|
// dto.setTm(new Date());
|
||||||
boolean result = service.save(dto);
|
boolean result = service.save(dto);
|
||||||
return R.ok(result ? dto : null);
|
return R.ok(result ? dto : null);
|
||||||
}
|
}
|
||||||
|
|
@ -44,14 +51,26 @@ public class OsmoticShiftRController {
|
||||||
@Operation(summary = "修改")
|
@Operation(summary = "修改")
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public R<OsmoticShiftR> update(@Validated(Update.class) @RequestBody OsmoticShiftR dto) {
|
public R<OsmoticShiftR> update(@Validated(Update.class) @RequestBody OsmoticShiftR dto) {
|
||||||
boolean result = service.updateById(dto);
|
LambdaUpdateWrapper<OsmoticShiftR> wrapper = new LambdaUpdateWrapper<>();
|
||||||
return R.ok(result ? dto : null);
|
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 = "删除")
|
@Operation(summary = "删除")
|
||||||
@GetMapping("/del/{id}")
|
@GetMapping("/del/{id}/{tm}")
|
||||||
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id) {
|
public R<Boolean> del(@Schema(name = "id") @PathVariable("id") Serializable id,@Schema(name = "tm") @PathVariable("tm") Serializable tm) {
|
||||||
return R.ok(service.removeById(id));
|
|
||||||
|
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 = "列表")
|
@Operation(summary = "列表")
|
||||||
|
|
|
||||||
|
|
@ -226,20 +226,27 @@ public class SzCaseController extends AbstractCommonFileController{
|
||||||
|
|
||||||
List<SzCase> list = query.list();
|
List<SzCase> list = query.list();
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(list)){
|
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
int currYear = calendar.get(Calendar.YEAR);
|
||||||
int month = calendar.get(Calendar.MONTH) + 1;
|
int month = calendar.get(Calendar.MONTH) + 1;
|
||||||
for (int i = 1; i <= month; i++) {
|
if(year.intValue() != currYear){
|
||||||
|
calendar.set(Calendar.YEAR,year);
|
||||||
|
month = 12;
|
||||||
|
}
|
||||||
|
final int finalMonth = month;
|
||||||
|
for (int i = 1; i <= finalMonth; i++) {
|
||||||
int finalI = i;
|
int finalI = i;
|
||||||
long count = list.stream()
|
long count = 0;
|
||||||
|
if(CollectionUtils.isNotEmpty(list)){
|
||||||
|
count = list.stream()
|
||||||
.filter(item ->
|
.filter(item ->
|
||||||
{
|
{
|
||||||
calendar.setTime(item.getCaseDate());
|
calendar.setTime(item.getCaseDate());
|
||||||
return month == finalI;
|
return finalMonth == finalI;
|
||||||
})
|
})
|
||||||
.count();
|
.count();
|
||||||
vos.add(new SzCaseStatisticsVo(i,null,Integer.valueOf(String.valueOf(count))));
|
|
||||||
}
|
}
|
||||||
|
vos.add(new SzCaseStatisticsVo(i,null,Integer.valueOf(String.valueOf(count))));
|
||||||
}
|
}
|
||||||
|
|
||||||
return R.ok(vos);
|
return R.ok(vos);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.gunshi.core.result.R;
|
import com.gunshi.core.result.R;
|
||||||
import com.gunshi.project.xyt.entity.so.SzRegulatoryFrameworkPage;
|
import com.gunshi.project.xyt.entity.so.SzRegulatoryFrameworkPage;
|
||||||
|
import com.gunshi.project.xyt.model.FileAssociations;
|
||||||
import com.gunshi.project.xyt.model.SzRegulatoryFramework;
|
import com.gunshi.project.xyt.model.SzRegulatoryFramework;
|
||||||
import com.gunshi.project.xyt.service.FileAssociationsService;
|
import com.gunshi.project.xyt.service.FileAssociationsService;
|
||||||
import com.gunshi.project.xyt.service.SzRegulatoryFrameworkService;
|
import com.gunshi.project.xyt.service.SzRegulatoryFrameworkService;
|
||||||
|
|
@ -21,7 +22,9 @@ import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述: 案件登记表
|
* 描述: 案件登记表
|
||||||
|
|
@ -127,8 +130,16 @@ public class SzRegulatoryFrameworkController extends AbstractCommonFileControlle
|
||||||
|
|
||||||
query.orderByDesc(SzRegulatoryFramework::getUploadDate);
|
query.orderByDesc(SzRegulatoryFramework::getUploadDate);
|
||||||
Page<SzRegulatoryFramework> data = service.page(page.getPageSo().toPage(), query);
|
Page<SzRegulatoryFramework> data = service.page(page.getPageSo().toPage(), query);
|
||||||
data.getRecords()
|
data.getRecords().forEach(item -> {
|
||||||
.forEach(item -> item.setFiles(fileService.getFiles(getGroupId(), String.valueOf(item.getId()))));
|
List<FileAssociations> files = fileService.getFiles(getGroupId(), String.valueOf(item.getId()));
|
||||||
|
if(CollectionUtils.isNotEmpty(files)){
|
||||||
|
Date minDate = files.stream()
|
||||||
|
.map(FileAssociations::getTm) // 提取每个对象的 tm 字段
|
||||||
|
.min(Date::compareTo).orElse(null); // 找到最小的 Date
|
||||||
|
item.setMinUpTime(minDate);
|
||||||
|
}
|
||||||
|
item.setFiles(files);
|
||||||
|
});
|
||||||
return R.ok(data);
|
return R.ok(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,31 @@
|
||||||
package com.gunshi.project.xyt.controller;
|
package com.gunshi.project.xyt.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.gunshi.core.result.R;
|
import com.gunshi.core.result.R;
|
||||||
|
import com.gunshi.db.dto.PageSo;
|
||||||
import com.gunshi.project.xyt.entity.so.TermiteSurveyPageSo;
|
import com.gunshi.project.xyt.entity.so.TermiteSurveyPageSo;
|
||||||
import com.gunshi.project.xyt.model.TermiteSurvey;
|
import com.gunshi.project.xyt.model.TermiteSurvey;
|
||||||
|
import com.gunshi.project.xyt.model.TermiteSurveyDetail;
|
||||||
|
import com.gunshi.project.xyt.service.TermiteSurveyDetailService;
|
||||||
import com.gunshi.project.xyt.service.TermiteSurveyService;
|
import com.gunshi.project.xyt.service.TermiteSurveyService;
|
||||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
import com.gunshi.project.xyt.validate.markers.Update;
|
import com.gunshi.project.xyt.validate.markers.Update;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述: 白蚁普查
|
* 描述: 白蚁普查
|
||||||
* author: xusan
|
* author: xusan
|
||||||
|
|
@ -25,6 +38,8 @@ public class TermiteSurveyController extends AbstractCommonFileController{
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TermiteSurveyService service;
|
private TermiteSurveyService service;
|
||||||
|
@Autowired
|
||||||
|
private TermiteSurveyDetailService termiteSurveyDetailService;
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "新增")
|
@Operation(summary = "新增")
|
||||||
|
|
@ -57,6 +72,55 @@ public class TermiteSurveyController extends AbstractCommonFileController{
|
||||||
return R.ok(service.pageQuery(page));
|
return R.ok(service.pageQuery(page));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "分页")
|
||||||
|
@PostMapping("/pageDetail")
|
||||||
|
public R<Page<TermiteSurveyDetail>> pageDetail(@RequestBody @Validated TermiteSurveyPageSo page) {
|
||||||
|
return R.ok(termiteSurveyDetailService.pageQuery(page));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "统计")
|
||||||
|
@PostMapping("/count")
|
||||||
|
public R<Map<String,Long>> count(@RequestBody @Validated TermiteSurveyPageSo page) {
|
||||||
|
page.getPageSo().setPageSize(1000000);
|
||||||
|
Page<TermiteSurveyDetail> termiteSurveyPage = termiteSurveyDetailService.pageQuery(page);
|
||||||
|
List<TermiteSurveyDetail> records = termiteSurveyPage.getRecords();
|
||||||
|
Map<String,Long> countMap = new HashMap<>();
|
||||||
|
countMap.put("totalPoint",0l);
|
||||||
|
countMap.put("hasAnt",0l);
|
||||||
|
countMap.put("notAnt",0l);
|
||||||
|
countMap.put("noData",0l);
|
||||||
|
if(CollectionUtils.isEmpty(records)){
|
||||||
|
return R.ok(countMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
//所有点 去除空的
|
||||||
|
long pileNumberCount = records.stream()
|
||||||
|
.map(TermiteSurveyDetail::getPileNumber).filter(e -> StringUtils.isNotEmpty(e))
|
||||||
|
.collect(Collectors.toSet()).stream().count();
|
||||||
|
countMap.put("totalPoint", pileNumberCount);
|
||||||
|
|
||||||
|
|
||||||
|
//有危害 && 未处置
|
||||||
|
long harmNumCount = records.stream()
|
||||||
|
.filter(e-> Objects.nonNull(e.getIsHarm()) && Objects.nonNull(e.getIsHandle())
|
||||||
|
&& e.getIsHarm().intValue() > 0 && e.getIsHandle().intValue()!=1).count();
|
||||||
|
countMap.put("hasAnt", harmNumCount);
|
||||||
|
|
||||||
|
//无危害 || (有危害&& 以处置)
|
||||||
|
long handleNummCount = records.stream()
|
||||||
|
.filter(e-> Objects.nonNull(e.getIsHarm()) && Objects.nonNull(e.getIsHandle())
|
||||||
|
&& (e.getIsHarm().intValue() == 0 || e.getIsHarm().intValue() > 0 && e.getIsHandle().intValue()==1)).count();
|
||||||
|
|
||||||
|
countMap.put("notAnt", handleNummCount);
|
||||||
|
|
||||||
|
//无数据
|
||||||
|
long count = records.stream().filter(e -> Objects.isNull(e.getIsHandle()) || e.getIsHandle().intValue() == 0).count();
|
||||||
|
countMap.put("noData",count);
|
||||||
|
|
||||||
|
return R.ok(countMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGroupId() {
|
public String getGroupId() {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
* Created by wanyan on 2024/3/19
|
* Created by wanyan on 2024/3/19
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
package com.gunshi.project.xyt.entity.so;
|
package com.gunshi.project.xyt.entity.so;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
import com.gunshi.db.dto.PageSo;
|
import com.gunshi.db.dto.PageSo;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.sql.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
* Created by wanyan on 2024/3/19
|
* Created by wanyan on 2024/3/19
|
||||||
|
|
@ -25,4 +29,11 @@ public class TermiteSurveyPageSo {
|
||||||
|
|
||||||
@Schema(description="危害情况(0无危害 1有危害)")
|
@Schema(description="危害情况(0无危害 1有危害)")
|
||||||
private Integer isHarm;
|
private Integer isHarm;
|
||||||
|
|
||||||
|
@Schema(description = "监测时间")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
|
||||||
|
private Date searchDate;
|
||||||
|
|
||||||
|
@Schema(description = "监测点")
|
||||||
|
private String pileNumber;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.gunshi.project.xyt.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.project.xyt.entity.so.DataQueryCommonSo;
|
||||||
|
import com.gunshi.project.xyt.entity.so.PicQuerySo;
|
||||||
|
import com.gunshi.project.xyt.entity.vo.AttResBaseVo;
|
||||||
|
import com.gunshi.project.xyt.entity.vo.AttResMonitorVo;
|
||||||
|
import com.gunshi.project.xyt.entity.vo.AttRvBaseVo;
|
||||||
|
import com.gunshi.project.xyt.entity.vo.AttRvMonitorVo;
|
||||||
|
import com.gunshi.project.xyt.model.*;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述: 水库基本信息表
|
||||||
|
* author: xusan
|
||||||
|
* date: 2024-07-08 15:44:07
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface AttResBuildingMapper extends BaseMapper<AttResBuilding> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
package com.gunshi.project.xyt.mapper;
|
package com.gunshi.project.xyt.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.gunshi.project.xyt.entity.so.TermiteSurveyPageSo;
|
||||||
|
import com.gunshi.project.xyt.model.TermiteSurvey;
|
||||||
import com.gunshi.project.xyt.model.TermiteSurveyDetail;
|
import com.gunshi.project.xyt.model.TermiteSurveyDetail;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述: 白蚁普查明细
|
* 描述: 白蚁普查明细
|
||||||
|
|
@ -12,4 +17,19 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface TermiteSurveyDetailMapper extends BaseMapper<TermiteSurveyDetail> {
|
public interface TermiteSurveyDetailMapper extends BaseMapper<TermiteSurveyDetail> {
|
||||||
|
|
||||||
|
@Select("""
|
||||||
|
<script>
|
||||||
|
select d.*, s.report_date from termite_survey_detail d left join termite_survey s on d.survey_id = s.id
|
||||||
|
<where>
|
||||||
|
<if test="obj.searchDate != null and obj.searchDate != null">
|
||||||
|
and s.report_date = #{obj.searchDate}
|
||||||
|
</if>
|
||||||
|
<if test="obj.pileNumber != null and obj.pileNumber != '' ">
|
||||||
|
and d.pile_number = #{obj.pileNumber}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by s.report_date desc
|
||||||
|
</script>
|
||||||
|
""")
|
||||||
|
Page<TermiteSurveyDetail> pageQuery(Page<TermiteSurveyDetail> page,@Param("obj") TermiteSurveyPageSo page1);
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
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.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述: 水库基本信息表
|
||||||
|
* author: xusan
|
||||||
|
* date: 2024-07-08 17:34:26
|
||||||
|
*/
|
||||||
|
@Schema(description="水库基本信息表")
|
||||||
|
@Data
|
||||||
|
@TableName("public.att_res_building")
|
||||||
|
public class AttResBuilding implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 水库代码
|
||||||
|
*/
|
||||||
|
@TableId(value="id", type= IdType.INPUT)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
// 主坝字段 (prefix: main_)
|
||||||
|
private String mainType; // 主坝-坝型
|
||||||
|
private BigDecimal mainCrestElevation; // 主坝-坝顶高程(m)
|
||||||
|
private BigDecimal mainCrestLength; // 主坝-坝顶长度(m)
|
||||||
|
private BigDecimal mainCrestWidth; // 主坝-坝顶宽度(m)
|
||||||
|
private BigDecimal mainMaxHeight; // 主坝-最大坝高(m)
|
||||||
|
|
||||||
|
// 副坝字段 (prefix: aux_)
|
||||||
|
private String auxType; // 副坝-坝型
|
||||||
|
private BigDecimal auxCrestElevation; // 副坝-坝顶高程(m)
|
||||||
|
private BigDecimal auxCrestLength; // 副坝-坝顶长度(m)
|
||||||
|
private BigDecimal auxCrestWidth; // 副坝-坝顶宽度(m)
|
||||||
|
private BigDecimal auxMaxHeight; // 副坝-最大坝高(m)
|
||||||
|
|
||||||
|
// 溢洪道字段 (prefix: spillway_)
|
||||||
|
private String spillwayType; // 溢洪道-型式
|
||||||
|
private String spillwayCrestType; // 溢洪道-堰顶型式
|
||||||
|
private String spillwayFoundation; // 溢洪道-地基特性
|
||||||
|
private BigDecimal spillwayCrestElevation; // 溢洪道-溢流堰顶高程(m)
|
||||||
|
private BigDecimal spillwayNetWidth; // 溢洪道-溢流堰净宽(m)
|
||||||
|
private String spillwayEnergyDissipation; // 溢洪道-消能型式
|
||||||
|
private BigDecimal spillwayCheckFloodDischarge; // 溢洪道-校核洪水下泄流量(m³/s)
|
||||||
|
private BigDecimal spillwayDesignFloodDischarge; // 溢洪道-设计洪水下泄流量(m³/s)
|
||||||
|
private BigDecimal spillwayScouringDischarge; // 溢洪道-消能防冲下泄流量(m³/s)
|
||||||
|
|
||||||
|
// 灌溉发电洞字段 (prefix: irrigation_)
|
||||||
|
private String irrigationType; // 灌溉发电洞-型式
|
||||||
|
private String irrigationLiningType; // 灌溉发电洞-衬砌型式
|
||||||
|
private String irrigationFoundation; // 灌溉发电洞-地基特性
|
||||||
|
private BigDecimal irrigationInletElevation; // 灌溉发电洞-进口底板高程(m)
|
||||||
|
private String irrigationCrossSection; // 灌溉发电洞-断面尺寸(m)
|
||||||
|
private BigDecimal irrigationLength; // 灌溉发电洞-洞长(m)
|
||||||
|
private BigDecimal irrigationDesignFlow; // 灌溉发电洞-设计流量(m³/s)
|
||||||
|
private String irrigationGateType; // 灌溉发电洞-进口闸门型式
|
||||||
|
private String irrigationHoistType; // 灌溉发电洞-进口启闭机型式
|
||||||
|
|
||||||
|
// 放空洞字段 (prefix: emptying_)
|
||||||
|
private String emptyingType; // 放空洞-型式
|
||||||
|
private String emptyingLiningType; // 放空洞-衬砌型式
|
||||||
|
private String emptyingFoundation; // 放空洞-地基特性
|
||||||
|
private BigDecimal emptyingInletElevation; // 放空洞-进口底板高程(m)
|
||||||
|
private String emptyingCrossSection; // 放空洞-断面尺寸(m)
|
||||||
|
private BigDecimal emptyingLength; // 放空洞-洞长(m)
|
||||||
|
private BigDecimal emptyingDesignFlow; // 放空洞-设计流量(m³/s)
|
||||||
|
private String emptyingGateType; // 放空洞-进口闸门型式
|
||||||
|
private String emptyingHoistType; // 放空洞-进口启闭机型式
|
||||||
|
|
||||||
|
// 拦洪坝字段 (prefix: flood_control_)
|
||||||
|
private String floodControlType; // 拦洪坝-坝型
|
||||||
|
private BigDecimal floodControlCrestElevation; // 拦洪坝-坝顶高程(m)
|
||||||
|
private BigDecimal floodControlCrestLength; // 拦洪坝-坝顶长度(m)
|
||||||
|
private BigDecimal floodControlCrestWidth; // 拦洪坝-坝顶宽度(m)
|
||||||
|
private BigDecimal floodControlMaxHeight; // 拦洪坝-最大坝高(m)
|
||||||
|
|
||||||
|
// 防汛道路字段 (prefix: road_)
|
||||||
|
private BigDecimal roadLength; // 防汛道路-防汛路长度(m)
|
||||||
|
private BigDecimal roadWidth; // 防汛道路-路面宽度(m)
|
||||||
|
}
|
||||||
|
|
@ -83,4 +83,8 @@ public class OsmoticPressR implements Serializable {
|
||||||
@Schema(description = "断面名称")
|
@Schema(description = "断面名称")
|
||||||
private String profileName;
|
private String profileName;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Schema(description = "断面编号")
|
||||||
|
private String profileCode;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -147,5 +147,8 @@ public class SzRegulatoryFramework extends CommUpdate implements Serializable {
|
||||||
@Schema(description = "文件集合")
|
@Schema(description = "文件集合")
|
||||||
private List<FileAssociations> files;
|
private List<FileAssociations> files;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Schema(description = "第一次上次时间")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD_HH_MM_SS, timezone = "GMT+8")
|
||||||
|
private Date minUpTime;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,17 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
import com.gunshi.core.dateformat.DateFormatString;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -129,4 +132,8 @@ public class TermiteSurveyDetail implements Serializable {
|
||||||
@Schema(description = "现场视频")
|
@Schema(description = "现场视频")
|
||||||
private List<FileAssociations> videos;
|
private List<FileAssociations> videos;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
@Schema(description = "监测时间")
|
||||||
|
@JsonFormat(pattern = DateFormatString.YYYY_MM_DD, timezone = "GMT+8")
|
||||||
|
private Date reportDate;
|
||||||
}
|
}
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
package com.gunshi.project.xyt.service;
|
package com.gunshi.project.xyt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.gunshi.project.xyt.entity.vo.ProfilePressTreeVo;
|
import com.gunshi.project.xyt.entity.vo.ProfilePressTreeVo;
|
||||||
import com.gunshi.project.xyt.mapper.AttDamProfileMapper;
|
import com.gunshi.project.xyt.mapper.AttDamProfileMapper;
|
||||||
import com.gunshi.project.xyt.model.AttDamProfile;
|
import com.gunshi.project.xyt.model.AttDamProfile;
|
||||||
import com.gunshi.project.xyt.model.OsmoticPressDevice;
|
import com.gunshi.project.xyt.model.OsmoticPressDevice;
|
||||||
import com.gunshi.project.xyt.model.OsmoticPressDeviceAutoDao;
|
import com.gunshi.project.xyt.model.OsmoticPressDeviceAutoDao;
|
||||||
|
import com.gunshi.project.xyt.system.model.SysVisitMenuLog;
|
||||||
import com.gunshi.project.xyt.util.MyBeanUtil;
|
import com.gunshi.project.xyt.util.MyBeanUtil;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -30,10 +33,13 @@ public class AttDamProfileService extends ServiceImpl<AttDamProfileMapper, AttDa
|
||||||
private OsmoticPressDeviceAutoDao pressDeviceAutoDao;
|
private OsmoticPressDeviceAutoDao pressDeviceAutoDao;
|
||||||
|
|
||||||
public List<ProfilePressTreeVo> tree() {
|
public List<ProfilePressTreeVo> tree() {
|
||||||
List<AttDamProfile> list = this.list();
|
LambdaQueryWrapper<AttDamProfile> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.orderByAsc(AttDamProfile::getProfileCode);
|
||||||
|
List<AttDamProfile> list = this.list(queryWrapper);
|
||||||
List<ProfilePressTreeVo> res = MyBeanUtil.collectionCopy(list,ProfilePressTreeVo.class);
|
List<ProfilePressTreeVo> res = MyBeanUtil.collectionCopy(list,ProfilePressTreeVo.class);
|
||||||
for(ProfilePressTreeVo vo : res){
|
for(ProfilePressTreeVo vo : res){
|
||||||
List<OsmoticPressDevice> pressList = pressDeviceAutoDao.list(new QueryWrapper<OsmoticPressDevice>().eq("profile_code", vo.getProfileCode()));
|
List<OsmoticPressDevice> pressList = pressDeviceAutoDao.list(new LambdaQueryWrapper<OsmoticPressDevice>()
|
||||||
|
.eq(OsmoticPressDevice::getProfileCode, vo.getProfileCode()).orderByAsc(OsmoticPressDevice::getStationCode));
|
||||||
vo.setChildren(pressList.stream().map(OsmoticPressDevice::getStationCode).sorted().collect(Collectors.toList()));
|
vo.setChildren(pressList.stream().map(OsmoticPressDevice::getStationCode).sorted().collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.gunshi.project.xyt.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gunshi.project.xyt.mapper.AttResBaseMapper;
|
||||||
|
import com.gunshi.project.xyt.mapper.AttResBuildingMapper;
|
||||||
|
import com.gunshi.project.xyt.model.AttResBase;
|
||||||
|
import com.gunshi.project.xyt.model.AttResBuilding;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述: 水库基本信息表
|
||||||
|
* author: xusan
|
||||||
|
* date: 2024-07-08 17:30:37
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public class AttResBuildingService extends ServiceImpl<AttResBuildingMapper, AttResBuilding>
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gunshi.project.xyt.entity.so.TermiteSurveyPageSo;
|
||||||
import com.gunshi.project.xyt.mapper.RiskControlInfoMapper;
|
import com.gunshi.project.xyt.mapper.RiskControlInfoMapper;
|
||||||
import com.gunshi.project.xyt.mapper.TermiteSurveyDetailMapper;
|
import com.gunshi.project.xyt.mapper.TermiteSurveyDetailMapper;
|
||||||
import com.gunshi.project.xyt.model.BzDictRel;
|
import com.gunshi.project.xyt.model.BzDictRel;
|
||||||
|
|
@ -124,6 +126,11 @@ public class TermiteSurveyDetailService extends ServiceImpl<TermiteSurveyDetailM
|
||||||
queryWrapper.eq(TermiteSurveyDetail::getSurveyId,id);
|
queryWrapper.eq(TermiteSurveyDetail::getSurveyId,id);
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Page<TermiteSurveyDetail> pageQuery(TermiteSurveyPageSo page) {
|
||||||
|
return this.baseMapper.pageQuery(page.getPageSo().toPage(),page);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,20 +5,20 @@ spring:
|
||||||
dynamic:
|
dynamic:
|
||||||
datasource:
|
datasource:
|
||||||
master:
|
master:
|
||||||
url: jdbc:postgresql://10.0.41.112:5432/tanshugang?stringtype=unspecified
|
url: jdbc:postgresql://postgres:5432/tanshugang?stringtype=unspecified
|
||||||
username: gunshiiot
|
username: gunshiiot
|
||||||
password: 1234567a
|
password: 1234567a
|
||||||
driver-class-name: org.postgresql.Driver
|
driver-class-name: org.postgresql.Driver
|
||||||
access-logging:
|
access-logging:
|
||||||
url: jdbc:postgresql://10.0.41.112:5432/tanshugang
|
url: jdbc:postgresql://postgres:5432/tanshugang
|
||||||
username: gunshiiot
|
username: gunshiiot
|
||||||
password: 1234567a
|
password: 1234567a
|
||||||
driver-class-name: org.postgresql.Driver
|
driver-class-name: org.postgresql.Driver
|
||||||
data:
|
data:
|
||||||
redis:
|
redis:
|
||||||
host: 10.0.41.112
|
host: redis
|
||||||
port: 6379
|
port: 6379
|
||||||
password: 1234567a
|
#password: 1234567a
|
||||||
database: 4
|
database: 4
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
|
|
@ -27,7 +27,7 @@ mybatis-plus:
|
||||||
# 洪水预测数据库连接信息
|
# 洪水预测数据库连接信息
|
||||||
algorithem:
|
algorithem:
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:postgresql://10.0.41.112:5432/tanshugang?stringtype=unspecified
|
url: jdbc:postgresql://postgres:5432/tanshugang?stringtype=unspecified
|
||||||
username: gunshiiot
|
username: gunshiiot
|
||||||
password: 1234567a
|
password: 1234567a
|
||||||
driver-class-name: org.postgresql.Driver
|
driver-class-name: org.postgresql.Driver
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue