Commit d05c1fef authored by kiritoausna's avatar kiritoausna

2022-5.18

parent a9a15a16
package me.zhengjie.base;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
......@@ -19,9 +20,9 @@ public class BaseDTO implements Serializable {
private String createBy;
private String updateBy;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Timestamp createTime;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Timestamp updateTime;
@Override
......
......@@ -15,6 +15,7 @@
*/
package me.zhengjie.base;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
......
......@@ -19,7 +19,9 @@ import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.poi.excel.BigExcelWriter;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.StyleSet;
import me.zhengjie.exception.BadRequestException;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.util.IOUtils;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.slf4j.Logger;
......@@ -154,7 +156,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
/**
* inputStream 转 File
*/
static File inputStreamToFile(InputStream ins, String name){
static File inputStreamToFile(InputStream ins, String name) {
File file = new File(SYS_TEM_DIR + name);
if (file.exists()) {
return file;
......@@ -182,7 +184,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
*/
public static File upload(MultipartFile file, String filePath) {
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHS");
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
String name = getFileNameNoEx(file.getOriginalFilename());
String suffix = getExtensionName(file.getOriginalFilename());
String nowStr = "-" + format.format(date);
......@@ -213,13 +215,69 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
String tempPath = SYS_TEM_DIR + IdUtil.fastSimpleUUID() + ".xlsx";
File file = new File(tempPath);
BigExcelWriter writer = ExcelUtil.getBigWriter(file);
Map<String, Object> stringObjectMap = list.get(0);
CellStyle headCellStyle = writer.getHeadCellStyle();
Font font = writer.createFont();
font.setColor(Font.COLOR_RED);
headCellStyle.setFont(font);
for (int i = 0; i < stringObjectMap.size(); i++) {
writer.setColumnWidth(i, 20);
}
writer.merge(list.get(0).size() - 1, "导出测试:TEST");
// 一次性写出内容,使用默认样式,强制输出标题
writer.write(list, true);
SXSSFSheet sheet = (SXSSFSheet)writer.getSheet();
SXSSFSheet sheet = (SXSSFSheet) writer.getSheet();
//上面需要强转SXSSFSheet 不然没有trackAllColumnsForAutoSizing方法
sheet.trackAllColumnsForAutoSizing();
//列宽自适应
writer.autoSizeColumnAll();
//writer.autoSizeColumnAll();
//response为HttpServletResponse对象
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
response.setHeader("Content-Disposition", "attachment;filename=file.xlsx");
ServletOutputStream out = response.getOutputStream();
// 终止后删除临时文件
file.deleteOnExit();
writer.flush(out, true);
//此处记得关闭输出Servlet流
IoUtil.close(out);
}
/**
* 导出excel
*/
public static void downloadExcel(List<Map<String, Object>> list, String title, HttpServletResponse response) throws IOException {
String tempPath = SYS_TEM_DIR + IdUtil.fastSimpleUUID() + ".xlsx";
File file = new File(tempPath);
BigExcelWriter writer = ExcelUtil.getBigWriter(file);
Map<String, Object> stringObjectMap = list.get(0);
CellStyle headCellStyle = writer.getHeadCellStyle();
Font font = writer.createFont();
font.setBold(true);
font.setFontHeightInPoints((short) 14);
//font.setColor(Font.COLOR_RED);
headCellStyle.setFont(font);
for (int i = 0; i < stringObjectMap.size(); i++) {
writer.setColumnWidth(i, 20);
}
// 定义数据行的样式
StyleSet style = writer.getStyleSet();
Font font1 = writer.createFont();
font1.setFontName("等线");
style.setBackgroundColor(IndexedColors.YELLOW, false);
style.setAlign(HorizontalAlignment.CENTER, VerticalAlignment.CENTER);
style.setFont(font1, true);
// 设置单元格文本内容自动换行
style.setWrapText();
writer.merge(list.get(0).size() - 1, title);
// 一次性写出内容,使用默认样式,强制输出标题
writer.write(list, true);
SXSSFSheet sheet = (SXSSFSheet) writer.getSheet();
//上面需要强转SXSSFSheet 不然没有trackAllColumnsForAutoSizing方法
sheet.trackAllColumnsForAutoSizing();
//列宽自适应
//writer.autoSizeColumnAll();
//response为HttpServletResponse对象
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
......@@ -264,7 +322,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
public static boolean check(File file1, File file2) {
String img1Md5 = getMd5(file1);
String img2Md5 = getMd5(file2);
if(img1Md5 != null){
if (img1Md5 != null) {
return img1Md5.equals(img2Md5);
}
return false;
......@@ -351,6 +409,37 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
}
}
public static HttpServletResponse download(String path, HttpServletResponse response) {
try {
// path是指欲下载的文件的路径。
File file = new File(path);
// 取得文件名。
String filename = file.getName();
// 取得文件的后缀名。
String ext = filename.substring(filename.lastIndexOf(".") + 1).toUpperCase();
// 以流的形式下载文件。
InputStream fis = new BufferedInputStream(new FileInputStream(path));
byte[] buffer = new byte[fis.available()];
fis.read(buffer);
fis.close();
// 清空response
response.reset();
// 设置response的Header
//response.addHeader("Access-Control-Allow-Origin", "*");
response.addHeader("Content-Disposition", "attachment;filename=" + new String(filename.getBytes()));
response.addHeader("Content-Length", "" + file.length());
OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
response.setContentType("application/octet-stream");
toClient.write(buffer);
toClient.flush();
toClient.close();
} catch (IOException ex) {
ex.printStackTrace();
}
return response;
}
public static String getMd5(File file) {
return getMd5(getByte(file));
}
......
......@@ -90,7 +90,7 @@ public class GeneratorController {
@PostMapping(value = "/{tableName}/{type}")
public ResponseEntity<Object> generatorCode(@PathVariable String tableName, @PathVariable Integer type, HttpServletRequest request, HttpServletResponse response){
if(!generatorEnabled && type == 0){
throw new BadRequestException("此环境不允许生成代码,请选择预览或者下载查看!");
throw new BadRequestException("此环境String tailInfoNo = TailNoForInfoUtil.getTailInfoNo(request);if(tailInfoNo==null){return null;}生成代码,请选择预览或者下载查看!");
}
switch (type){
// 生成代码
......
......@@ -15,6 +15,7 @@
*/
package me.zhengjie.domain;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
......@@ -72,6 +73,7 @@ public class Log implements Serializable {
/** 创建日期 */
@CreationTimestamp
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Timestamp createTime;
public Log(String logType, Long time) {
......
......@@ -151,7 +151,7 @@ public class LogServiceImpl implements LogService {
map.put("创建日期", log.getCreateTime());
list.add(map);
}
FileUtil.downloadExcel(list, response);
FileUtil.downloadExcel(list, "日志信息",response);
}
@Override
......
......@@ -18,7 +18,6 @@ package me.zhengjie;
import io.swagger.annotations.Api;
import me.zhengjie.annotation.rest.AnonymousGetMapping;
import me.zhengjie.utils.SpringContextHolder;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
......
......@@ -43,7 +43,9 @@ import java.util.List;
@EnableWebMvc
public class ConfigurerAdapter implements WebMvcConfigurer {
/** 文件配置 */
/**
* 文件配置
*/
private final FileProperties properties;
public ConfigurerAdapter(FileProperties properties) {
......@@ -65,8 +67,8 @@ public class ConfigurerAdapter implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
FileProperties.ElPath path = properties.getPath();
String avatarUtl = "file:" + path.getAvatar().replace("\\","/");
String pathUtl = "file:" + path.getPath().replace("\\","/");
String avatarUtl = "file:" + path.getAvatar().replace("\\", "/");
String pathUtl = "file:" + path.getPath().replace("\\", "/");
registry.addResourceHandler("/avatar/**").addResourceLocations(avatarUtl).setCachePeriod(0);
registry.addResourceHandler("/file/**").addResourceLocations(pathUtl).setCachePeriod(0);
registry.addResourceHandler("/**").addResourceLocations("classpath:/META-INF/resources/").setCachePeriod(0);
......
......@@ -26,6 +26,7 @@ import java.util.concurrent.ThreadPoolExecutor;
/**
* 异步任务线程池装配类
*
* @author https://juejin.im/entry/5abb8f6951882555677e9da2
* @date 2019年10月31日15:06:18
*/
......@@ -56,8 +57,8 @@ public class AsyncTaskExecutePool implements AsyncConfigurer {
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return (throwable, method, objects) -> {
log.error("===="+throwable.getMessage()+"====", throwable);
log.error("exception method:"+method.getName());
log.error("====" + throwable.getMessage() + "====", throwable);
log.error("exception method:" + method.getName());
};
}
}
......@@ -21,6 +21,7 @@ import org.springframework.stereotype.Component;
/**
* 线程池配置属性类
*
* @author https://juejin.im/entry/5abb8f6951882555677e9da2
* @date 2019年10月31日14:58:18
*/
......
......@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
/**
* 自定义线程名称
*
* @author Zheng Jie
* @date 2019年10月31日17:49:55
*/
......@@ -37,7 +38,7 @@ public class TheadFactoryName implements ThreadFactory {
this("el-pool");
}
private TheadFactoryName(String name){
private TheadFactoryName(String name) {
SecurityManager s = System.getSecurityManager();
group = (s != null) ? s.getThreadGroup() :
Thread.currentThread().getThreadGroup();
......@@ -50,7 +51,7 @@ public class TheadFactoryName implements ThreadFactory {
public Thread newThread(Runnable r) {
//此时线程的名字 就是 namePrefix + -thread- + 这个线程池中第几个执行的线程
Thread t = new Thread(group, r,
namePrefix + "-thread-"+threadNumber.getAndIncrement(),
namePrefix + "-thread-" + threadNumber.getAndIncrement(),
0);
if (t.isDaemon()) {
t.setDaemon(false);
......
......@@ -21,12 +21,13 @@ import java.util.concurrent.TimeUnit;
/**
* 用于获取自定义线程池
*
* @author Zheng Jie
* @date 2019年10月31日18:16:47
*/
public class ThreadPoolExecutorUtil {
public static ThreadPoolExecutor getPoll(){
public static ThreadPoolExecutor getPoll() {
return new ThreadPoolExecutor(
AsyncTaskProperties.corePoolSize,
AsyncTaskProperties.maxPoolSize,
......
......@@ -53,16 +53,16 @@ class JacksonHttpMessageConverter extends MappingJackson2HttpMessageConverter {
}
}
/**
/* *//**
* 处理字符串等类型的null值
*/
*//*
public class NullNumberJsonSerializer extends JsonSerializer<Object> {
@Override
public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
jsonGenerator.writeNumber(0);
}
}
}*/
/**
* 处理字符串等类型的null值
......@@ -88,9 +88,9 @@ class JacksonHttpMessageConverter extends MappingJackson2HttpMessageConverter {
if (isArrayType(writer)) {
//给writer注册一个自己的nullSerializer
writer.assignNullSerializer(new NullArrayJsonSerializer());
} else if (isNumberType(writer)) {
} /*else if (isNumberType(writer)) {
writer.assignNullSerializer(new NullNumberJsonSerializer());
} else if (isBooleanType(writer)) {
} */ else if (isBooleanType(writer)) {
writer.assignNullSerializer(new NullBooleanJsonSerializer());
} else if (isStringType(writer)) {
writer.assignNullSerializer(new NullStringJsonSerializer());
......@@ -156,8 +156,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
SerializerFeature.WriteNullStringAsEmpty,
// Boolean字段如果为null,输出为false,而非null
SerializerFeature.WriteNullBooleanAsFalse,
// 数值字段如果为null,输出为0,而非null
SerializerFeature.WriteNullNumberAsZero,
/* // 数值字段如果为null,输出为0,而非null
SerializerFeature.WriteNullNumberAsZero,*/
// 消除对同一对象循环引用的问题,默认为false
SerializerFeature.DisableCircularReferenceDetect,
// List字段如果为null,输出为[],而非null
......
......@@ -39,16 +39,16 @@ public class ArtificialDataController {
@ApiOperation(value = "人工监测数据表分页列表", response = ArtificialData.class)
@GetMapping()
public ResponseEntity<Object> list(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
HashMap<String, Object> data = artificialDataService.plist(dataQueryCriteria,request);
HashMap<String, Object> data = artificialDataService.plist(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(data), HttpStatus.OK);
}
@Log(value = "新增人工监测数据")
@ApiOperation(value = "人工监测数据表新增")
@PostMapping()
public Object add(@Valid @RequestBody ArtificialData param,HttpServletRequest request) {
public Object add(@Valid @RequestBody ArtificialData param, HttpServletRequest request) {
param.setAddtime(new Date());
boolean result = artificialDataService.add(param,request);
boolean result = artificialDataService.add(param, request);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
......@@ -59,9 +59,9 @@ public class ArtificialDataController {
@Log(value = "修改人工监测数据")
@ApiOperation(value = "人工监测数据表修改")
@PutMapping()
public Object modify(@Valid @RequestBody ArtificialData param,HttpServletRequest request) {
public Object modify(@Valid @RequestBody ArtificialData param, HttpServletRequest request) {
param.setAddtime(new Date());
boolean result = artificialDataService.modify(param,request);
boolean result = artificialDataService.modify(param, request);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
......
......@@ -8,6 +8,7 @@ import me.zhengjie.gemho.entity.artificial.ArtificialPoint;
import me.zhengjie.gemho.service.artificial.ArtificialPointService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.TailNoForInfoUtil;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
......@@ -48,6 +49,10 @@ public class ArtificialPointController {
@ApiOperation(value = "人工监测点位表新增")
@PostMapping()
public Object add(@Valid @RequestBody ArtificialPoint param, HttpServletRequest request) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
if (tailInfoNo == null) {
return new ResponseEntity<>(new PostOrPutResult().noTailFailed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
param.setTime(new Date());
boolean result = artificialPointService.add(param, request);
if (result) {
......
......@@ -52,63 +52,63 @@ public class DataVisController {
ResponseEntity<Object> real = dbDataController.real(child.getRange(), child.getValues(), child.getDeviceid(), child.getSubitem());
RealVo body = (RealVo) real.getBody();
DataVo dataVo = body.getBody();
map.put("t_1"+child.getRange(),dataVo);
map.put("t_1" + child.getRange(), dataVo);
break;
}
case "t_2": {
ResponseEntity<Object> all = wtDataController.getAll(child.getRange(), child.getValues(), child.getDeviceid(), child.getSubitem());
RealVo body = (RealVo) all.getBody();
DataVo dataVo = body.getBody();
map.put("t_2"+child.getRange(),dataVo);
map.put("t_2" + child.getRange(), dataVo);
break;
}
case "t_3": {
ResponseEntity<Object> real = mpDataController.real(child.getRange(), child.getValues(), child.getDeviceid(), child.getSubitem());
RealVo body = (RealVo) real.getBody();
DataVo dataVo = body.getBody();
map.put("t_3"+child.getRange(),dataVo);
map.put("t_3" + child.getRange(), dataVo);
break;
}
case "t_4": {
ResponseEntity<Object> real = dmDataController.real(child.getRange(), child.getValues(), child.getDeviceid(), child.getSubitem());
RealVo body = (RealVo) real.getBody();
DataVo dataVo = body.getBody();
map.put("t_4"+child.getRange(),dataVo);
map.put("t_4" + child.getRange(), dataVo);
break;
}
case "t_5": {
ResponseEntity<Object> all = stDataController.getAll(child.getRange(), child.getValues(), child.getDeviceid(), child.getSubitem());
RealVo body = (RealVo) all.getBody();
DataVo dataVo = body.getBody();
map.put("t_5"+child.getRange(),dataVo);
map.put("t_5" + child.getRange(), dataVo);
break;
}
case "t_6": {
ResponseEntity<Object> daping = rgDataController.daping(child.getRange(), child.getValues(), child.getDeviceid(), child.getSubitem());
RealVo body = (RealVo) daping.getBody();
DataVo dataVo = body.getBody();
map.put("t_6"+child.getRange(),dataVo);
map.put("t_6" + child.getRange(), dataVo);
break;
}
case "t_7": {
ResponseEntity<Object> getall = pslDataController.getall(child.getRange(), child.getValues(), child.getDeviceid(), child.getSubitem());
RealVo body = (RealVo) getall.getBody();
DataVo dataVo = body.getBody();
map.put("t_7"+child.getRange(),dataVo);
map.put("t_7" + child.getRange(), dataVo);
break;
}
case "t_8": {
ResponseEntity<Object> all = szDataController.getAll(child.getRange(), child.getValues(), child.getDeviceid(), child.getSubitem(),request);
ResponseEntity<Object> all = szDataController.getAll(child.getRange(), child.getValues(), child.getDeviceid(), child.getSubitem(), request);
RealVo body = (RealVo) all.getBody();
DataVo dataVo = body.getBody();
map.put("t_8"+child.getRange(),dataVo);
map.put("t_8" + child.getRange(), dataVo);
break;
}
case "t_9": {
ResponseEntity<Object> getall = slDataController.getall(child.getRange(), child.getValues(), child.getDeviceid(), child.getSubitem());
RealVo body = (RealVo) getall.getBody();
DataVo dataVo = body.getBody();
map.put("t_9"+child.getRange(),dataVo);
map.put("t_9" + child.getRange(), dataVo);
break;
}
}
......
......@@ -93,8 +93,8 @@ public class DbDataController {
@ApiOperation(value = "图标历史")
@GetMapping("imghistory")
public ResponseEntity<Object> imgList(DataQueryCriteria dataQueryCriteria,HttpServletRequest request) {
ImgDataVo dbData = dbDataService.imgList(dataQueryCriteria,request);
public ResponseEntity<Object> imgList(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
ImgDataVo dbData = dbDataService.imgList(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(dbData), HttpStatus.OK);
}
......
......@@ -94,15 +94,15 @@ public class DmDataController {
@ApiOperation(value = "图标历史")
@GetMapping("imghistory")
public ResponseEntity<Object> imgList(DataQueryCriteria dataQueryCriteria,HttpServletRequest request) {
ImgDataVo dbData = dmDataService.imgList(dataQueryCriteria,request);
public ResponseEntity<Object> imgList(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
ImgDataVo dbData = dmDataService.imgList(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(dbData), HttpStatus.OK);
}
@ApiOperation(value = "导出excel")
@GetMapping("download")
public void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
dmDataService.download(response, dataQueryCriteria,request);
dmDataService.download(response, dataQueryCriteria, request);
}
}
......
......@@ -170,7 +170,7 @@ public class MpDataController {
@ApiOperation(value = "导出excel")
@GetMapping("download")
public void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
mpDataService.download(response, dataQueryCriteria,request);
mpDataService.download(response, dataQueryCriteria, request);
}
}
......@@ -4,19 +4,22 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.entity.data.PslData;
import me.zhengjie.gemho.service.data.PslDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.gemho.x_datavo.data.ImgDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
/**
......@@ -68,104 +71,17 @@ public class PslDataController {
}
/**
* 新增排水量人工巡检数据
* 排流量分页历史
*
* @param pslData
* @return
*/
@ApiOperation(value = "新增排水量人工巡检数据", response = PostOrPutResult.class)
@PostMapping
public ResponseEntity<Object> add(@RequestBody PslData pslData) {
try {
Date time = pslData.getTime();
String format = sdf.format(time);
int i = Integer.parseInt(format);
pslData.setId(i);
pslData.setCreatetime(new Date());
pslData.setUpdatetime(new Date());
pslData.setDatasource(0);
boolean b = pslDataService.saveOrUpdate(pslData);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
} catch (NumberFormatException e) {
e.printStackTrace();
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
/**
* 修改排水量人工巡检数据
*
* @param pslData
* @return
*/
@ApiOperation(value = "修改排水量人工巡检数据", response = PostOrPutResult.class)
@PutMapping
public ResponseEntity<Object> updata(@RequestBody PslData pslData) {
try {
pslData.setUpdatetime(new Date());
boolean b = pslDataService.saveOrUpdate(pslData);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
/**
* 删除排水量人工巡检数据
*
* @param map
* @return
*/
@ApiOperation(value = "删除排水量人工巡检数据", response = PostOrPutResult.class)
@DeleteMapping
public ResponseEntity<Object> deletedb(@RequestBody HashMap<String, Integer> map) {
try {
Integer id = map.get("id");
boolean b = pslDataService.removeById(id);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
/**
* 获取排水量的历史数据
*
* @param page
* @param size
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param datasource
* @param dataQueryCriteria
* @param request
* @return
*/
@ApiOperation("获取排水量的历史数据")
@GetMapping("history")
public ResponseEntity<Object> gethistory(@ApiParam(value = "分页参数,页数", required = true) String page,
@ApiParam(value = "分页参数,数量", required = true) String size,
@ApiParam(value = "查询条件字段") String searchName,
@ApiParam(value = "查询条件数值") String searchValue,
@ApiParam(value = "查询条件精准或者模糊") String limit,
@ApiParam(value = "查询条件时间区间") String timeSpace,
@ApiParam(value = "查询条件正序或者倒序") String sort,
@ApiParam(value = "数据来源, 1 历史数据 2人工巡检历史数据", required = true) String datasource) {
public ResponseEntity<Object> gethistory(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
try {
long l = Long.parseLong(page);
long l1 = Long.parseLong(size);
HashMap<String, Object> map = pslDataService.pageall(searchName, searchValue, limit, timeSpace, sort, l, l1, datasource);
HashMap<String, Object> map = pslDataService.pageall(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(map), HttpStatus.OK);
} catch (NumberFormatException e) {
e.printStackTrace();
......@@ -173,5 +89,17 @@ public class PslDataController {
return new ResponseEntity<>(new PageResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "图标历史")
@GetMapping("imghistory")
public ResponseEntity<Object> imgList(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
ImgDataVo dbData = pslDataService.imgList(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(dbData), HttpStatus.OK);
}
@ApiOperation(value = "导出excel")
@GetMapping("download")
public void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
pslDataService.download(response, dataQueryCriteria, request);
}
}
......@@ -47,7 +47,10 @@ public class RealDataController {
@Autowired
private SlDataService slDataService;
@Autowired
private WpbDataService wpbDataService;
@Autowired
private RedisUtils redisUtils;
@GetMapping
public ResponseEntity<Object> real(HttpServletRequest request) {
//创建返回对象
......@@ -65,7 +68,7 @@ public class RealDataController {
QueryWrapper<SlData> slDataQueryWrapper = new QueryWrapper<>();*/
//获取当前登录用户 根据当前用户获取尾矿库id
String username = SecurityUtils.getCurrentUsername();
String gettailno = onlineUserService.gettailno(username,request);
String gettailno = onlineUserService.gettailno(username, request);
//获取相应尾矿库下的所有设备
List<String> equipnos = drybeachequipinforService.getequipno(gettailno);
//获取所有检测项
......@@ -78,37 +81,41 @@ public class RealDataController {
for (SysType sysType : list) {
switch (sysType.getCode()) {
case "1":
List<RealDataVo> dbdatas = dbDataService.real(sysType.getTypeno(),request);
List<RealDataVo> dbdatas = dbDataService.real(sysType.getTypeno(), request);
realDataVos.addAll(dbdatas);
break;
case "2":
List<RealDataVo> wtdatas = wtDataService.real(sysType.getTypeno(),request);
List<RealDataVo> wtdatas = wtDataService.real(sysType.getTypeno(), request);
realDataVos.addAll(wtdatas);
break;
case "3":
List<RealDataVo> mpdatas = mpDataService.real(sysType.getTypeno(),request);
List<RealDataVo> mpdatas = mpDataService.real(sysType.getTypeno(), request);
realDataVos.addAll(mpdatas);
break;
case "4":
List<RealDataVo> dmdatas = dmDataService.real(sysType.getTypeno(),request);
List<RealDataVo> dmdatas = dmDataService.real(sysType.getTypeno(), request);
realDataVos.addAll(dmdatas);
break;
case "5":
List<RealDataVo> stdatas = stDataService.real(sysType.getTypeno(),request);
List<RealDataVo> stdatas = stDataService.real(sysType.getTypeno(), request);
realDataVos.addAll(stdatas);
break;
case "6":
List<RealDataVo> rgdatas = rgDataService.real(sysType.getTypeno(),request);
List<RealDataVo> rgdatas = rgDataService.real(sysType.getTypeno(), request);
realDataVos.addAll(rgdatas);
break;
case "7":
List<RealDataVo> psldatas = pslDataService.real(sysType.getTypeno(),request);
List<RealDataVo> psldatas = pslDataService.real(sysType.getTypeno(), request);
realDataVos.addAll(psldatas);
break;
case "9":
List<RealDataVo> sldatas = slDataService.real(sysType.getTypeno(),request);
List<RealDataVo> sldatas = slDataService.real(sysType.getTypeno(), request);
realDataVos.addAll(sldatas);
break;
case "16":
List<RealDataVo> wpbdatas = wpbDataService.real(sysType.getTypeno(), request);
realDataVos.addAll(wpbdatas);
break;
}
}
for (RealDataVo realDataVo : realDataVos) {
......
......@@ -10,11 +10,15 @@ import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.gemho.x_datavo.data.ImgDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
......@@ -112,31 +116,36 @@ public class RgDataController {
public ResponseEntity<Object> updata(@RequestBody RgData rgData) {
rgData.setUpdatetime(new Date());
boolean b = rgDataService.saveOrUpdate(rgData);
if (b){
if (b) {
}
return null;
}
@ApiOperation(value = "降雨量人工巡检历史数据")
@ApiOperation(value = "分页查看")
@GetMapping("history")
public ResponseEntity<Object> gethistory(@ApiParam(value = "分页参数,页数", required = true) String page,
@ApiParam(value = "分页参数,数量", required = true) String size,
@ApiParam(value = "查询条件字段") String searchName,
@ApiParam(value = "查询条件数值") String searchValue,
@ApiParam(value = "查询条件精准或者模糊") String limit,
@ApiParam(value = "查询条件时间区间") String timeSpace,
@ApiParam(value = "查询条件正序或者倒序") String sort,
@ApiParam(value = "数据来源, 1 历史数据 2人工巡检历史数据", required = true) String datasource) {
public ResponseEntity<Object> getall(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
try {
long l = Long.parseLong(page);
long l1 = Long.parseLong(size);
HashMap<String, Object> map = rgDataService.pageall(searchName, searchValue, limit, timeSpace, sort, l, l1, datasource);
HashMap<String, Object> map = rgDataService.pageall(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(map), HttpStatus.OK);
} catch (NumberFormatException e) {
System.out.println(e);
e.printStackTrace();
}
return new ResponseEntity<>(new PageResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "图标历史")
@GetMapping("imghistory")
public ResponseEntity<Object> imgList(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
ImgDataVo dbData = rgDataService.imgList(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(dbData), HttpStatus.OK);
}
@ApiOperation(value = "导出excel")
@GetMapping("download")
public void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
rgDataService.download(response, dataQueryCriteria, request);
}
}
......@@ -4,19 +4,22 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.entity.data.SlData;
import me.zhengjie.gemho.service.data.SlDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.gemho.x_datavo.data.ImgDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
/**
......@@ -67,111 +70,32 @@ public class SlDataController {
return new ResponseEntity<>(new RealVo().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
/**
* 新增渗流量人工巡检数据
*
* @param slData
* @return
*/
@ApiOperation(value = "新增渗流量人工巡检数据", response = PostOrPutResult.class)
@PostMapping
public ResponseEntity<Object> add(@RequestBody SlData slData) {
try {
Date time = slData.getTime();
String format = sdf.format(time);
int i = Integer.parseInt(format);
slData.setId(i);
slData.setCreatetime(new Date());
slData.setUpdatetime(new Date());
slData.setDatasource(0);
boolean b = slDataService.saveOrUpdate(slData);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
} catch (NumberFormatException e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
/**
* 删除渗流量人工巡检数据
*
* @param map
* @return
*/
@ApiOperation(value = "删除渗流量人工巡检数据", response = PostOrPutResult.class)
@DeleteMapping
public ResponseEntity<Object> deletedata(@RequestBody HashMap<String, Integer> map) {
try {
Integer id = map.get("id");
boolean b = slDataService.removeById(id);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
/**
* 修改渗流量人工巡检数据
*
* @param slData
* @return
*/
@ApiOperation(value = "修改渗流量人工巡检数据",response = PostOrPutResult.class)
@PutMapping
public ResponseEntity<Object> updata(@RequestBody SlData slData) {
try {
slData.setUpdatetime(new Date());
boolean b = slDataService.saveOrUpdate(slData);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
/**
* 获取渗流量的历史记录
*
* @param page
* @param size
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param datasource
* @return
*/
@ApiOperation(value = "获取渗流量的历史记录")
@GetMapping(value = "histoty")
public ResponseEntity<Object> gethistory(@ApiParam(value = "分页参数,页数", required = true) String page,
@ApiParam(value = "分页参数,数量", required = true) String size,
@ApiParam(value = "查询条件字段") String searchName,
@ApiParam(value = "查询条件数值") String searchValue,
@ApiParam(value = "查询条件精准或者模糊") String limit,
@ApiParam(value = "查询条件时间区间") String timeSpace,
@ApiParam(value = "查询条件正序或者倒序") String sort,
@ApiParam(value = "数据来源, 1 历史数据 2人工巡检历史数据", required = true) String datasource) {
@GetMapping(value = "history")
public ResponseEntity<Object> gethistory(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
try {
long l = Long.parseLong(page);
long l1 = Long.parseLong(size);
HashMap<String, Object> map = slDataService.pageall(searchName, searchValue, limit, timeSpace, sort, l, l1, datasource);
HashMap<String, Object> map = slDataService.pageall(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(map), HttpStatus.OK);
} catch (NumberFormatException e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PageResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "图标历史")
@GetMapping("imghistory")
public ResponseEntity<Object> imgList(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
ImgDataVo dbData = slDataService.imgList(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(dbData), HttpStatus.OK);
}
@ApiOperation(value = "导出excel")
@GetMapping("download")
public void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
slDataService.download(response, dataQueryCriteria, request);
}
}
......@@ -4,10 +4,8 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.entity.data.StData;
import me.zhengjie.gemho.service.data.StDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
......@@ -15,12 +13,13 @@ import me.zhengjie.gemho.x_datavo.data.ImgDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
/**
......@@ -75,6 +74,7 @@ public class StDataController {
}
return new ResponseEntity<>(new PageResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "图标历史")
@GetMapping("imghistory")
public ResponseEntity<Object> imgList(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
......@@ -85,7 +85,7 @@ public class StDataController {
@ApiOperation(value = "导出excel")
@GetMapping("download")
public void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
stDataService.download(response, dataQueryCriteria,request);
stDataService.download(response, dataQueryCriteria, request);
}
}
......@@ -4,21 +4,20 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.entity.data.SzData;
import me.zhengjie.gemho.service.data.SzDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
/**
......@@ -45,86 +44,13 @@ public class SzDataController {
@ApiParam("检测项") String subitem, HttpServletRequest request) {
ArrayList<HashMap<String, Object>> maps = new ArrayList<>();
try {
maps = szDataService.real(deviceid,request);
maps = szDataService.real(deviceid, request);
return new ResponseEntity<>(new PageResult().nopagesuccess(maps), HttpStatus.OK);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity<>(new RealVo().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "新增水质人工巡检数据")
@PostMapping
public ResponseEntity<Object> add(@RequestBody SzData szData) {
try {
Date time = szData.getTime();
String format = sdf.format(time);
int i = Integer.parseInt(format);
szData.setId(i);
szData.setDatasource(0);
szData.setCreatetime(new Date());
szData.setUpdatetime(new Date());
boolean b = szDataService.saveOrUpdate(szData);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.OK);
} catch (NumberFormatException e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.OK);
}
@ApiOperation(value = "删除水质人工巡检数据")
@DeleteMapping
public ResponseEntity<Object> deletedata(@RequestBody HashMap<String, Integer> map) {
try {
Integer id = map.get("id");
boolean b = szDataService.removeById(id);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "修改水质人工巡检数据")
@PutMapping
public ResponseEntity<Object> updata(@RequestBody SzData szData) {
try {
szData.setUpdatetime(new Date());
boolean b = szDataService.saveOrUpdate(szData);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "分页查看")
@GetMapping("history")
public ResponseEntity<Object> getall(@ApiParam(value = "分页参数,页数", required = true) String page,
@ApiParam(value = "分页参数,数量", required = true) String size,
@ApiParam(value = "查询条件字段") String searchName,
@ApiParam(value = "查询条件数值") String searchValue,
@ApiParam(value = "查询条件精准或者模糊") String limit,
@ApiParam(value = "查询条件时间区间") String timeSpace,
@ApiParam(value = "查询条件正序或者倒序") String sort,
@ApiParam(value = "数据来源, 1 历史数据 2人工巡检历史数据", required = true) String datasource) {
try {
long l = Long.parseLong(page);
long l1 = Long.parseLong(size);
HashMap<String, Object> map = szDataService.pageall(searchName, searchValue, limit, timeSpace, sort, l, l1, datasource);
return new ResponseEntity<>(new PageResult().success(map), HttpStatus.OK);
} catch (NumberFormatException e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PageResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import me.zhengjie.gemho.service.data.WpbDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.gemho.x_datavo.data.ImgDataVo;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
/**
* <p>
* 外坡比数据 前端控制器
* </p>
*
* @author llj
* @since 2022-05-12
*/
@RequiredArgsConstructor
@RestController
@RequestMapping("data/wpb")
public class WpbDataController {
private final WpbDataService wpbDataService;
@ApiOperation(value = "获取指定日期的库水位数据", response = DataVo.class)
@GetMapping
public ResponseEntity<Object> getAll(@ApiParam("日期范围") String range,
@ApiParam("监测值") String values,
@ApiParam("设备id") String deviceid,
@ApiParam("检测项") String subitem) {
DataVo dataVo = new DataVo();
String date = range;
try {
if (date.equals("day")) {
dataVo = wpbDataService.day(date, values, deviceid, subitem);
} else if (date.equals("week")) {
dataVo = wpbDataService.week(date, values, deviceid, subitem);
} else if (date.equals("month")) {
dataVo = wpbDataService.month(date, values, deviceid, subitem);
}
return new ResponseEntity<>(new RealVo().nopagesuccess(dataVo), HttpStatus.OK);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity<>(new RealVo().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "分页查看")
@GetMapping("history")
public ResponseEntity<Object> getall(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
try {
HashMap<String, Object> map = wpbDataService.pageall(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(map), HttpStatus.OK);
} catch (NumberFormatException e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PageResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "图标历史")
@GetMapping("imghistory")
public ResponseEntity<Object> imgList(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
ImgDataVo dbData = wpbDataService.imgList(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(dbData), HttpStatus.OK);
}
@ApiOperation(value = "导出excel")
@GetMapping("download")
public void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
wpbDataService.download(response, dataQueryCriteria, request);
}
}
......@@ -4,10 +4,8 @@ package me.zhengjie.gemho.controller.data;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.gemho.entity.data.WtData;
import me.zhengjie.gemho.service.data.WtDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.RealVo;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
......@@ -15,12 +13,13 @@ import me.zhengjie.gemho.x_datavo.data.ImgDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
/**
......@@ -62,60 +61,6 @@ public class WtDataController {
return new ResponseEntity<>(new RealVo().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "新增水质人工巡检数据")
@PostMapping
public ResponseEntity<Object> add(@RequestBody WtData wtData) {
try {
Date time = wtData.getTime();
String format = sdf.format(time);
int i = Integer.parseInt(format);
wtData.setId(i);
wtData.setDatasource(0);
wtData.setCreatetime(new Date());
wtData.setUpdatetime(new Date());
boolean b = wtDataService.saveOrUpdate(wtData);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.OK);
} catch (NumberFormatException e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.OK);
}
@ApiOperation(value = "删除水质人工巡检数据")
@DeleteMapping
public ResponseEntity<Object> deletedata(@RequestBody HashMap<String, Integer> map) {
try {
Integer id = map.get("id");
boolean b = wtDataService.removeById(id);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "修改水质人工巡检数据")
@PutMapping
public ResponseEntity<Object> updata(@RequestBody WtData wtData) {
try {
wtData.setUpdatetime(new Date());
boolean b = wtDataService.saveOrUpdate(wtData);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
} catch (Exception e) {
e.printStackTrace();
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
@ApiOperation(value = "分页查看")
@GetMapping("history")
public ResponseEntity<Object> getall(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
......@@ -139,7 +84,7 @@ public class WtDataController {
@ApiOperation(value = "导出excel")
@GetMapping("download")
public void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
wtDataService.download(response, dataQueryCriteria,request);
wtDataService.download(response, dataQueryCriteria, request);
}
}
......
package me.zhengjie.gemho.controller.dic;
import lombok.RequiredArgsConstructor;
import me.zhengjie.gemho.entity.dic.AlarmLevel;
import me.zhengjie.gemho.entity.dic.AlarmState;
import me.zhengjie.gemho.service.dic.IAlarmLevelService;
import me.zhengjie.gemho.service.dic.IAlarmStateService;
import me.zhengjie.gemho.util.PageResult;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author llj
* @since 2022-05-05
*/
@RequiredArgsConstructor
@RestController
@RequestMapping("dic/alarm")
public class AlarmLevelController {
private final IAlarmLevelService alarmLevelService;
private final IAlarmStateService alarmStateService;
@GetMapping(value = "level")
public ResponseEntity<Object> level() {
List<AlarmLevel> list = alarmLevelService.list();
return new ResponseEntity<>(new PageResult().nopagesuccess(list), HttpStatus.OK);
}
@GetMapping(value = "status")
public ResponseEntity<Object> status() {
List<AlarmState> list = alarmStateService.list();
return new ResponseEntity<>(new PageResult().nopagesuccess(list), HttpStatus.OK);
}
}
......@@ -7,6 +7,7 @@ import me.zhengjie.gemho.entity.ins.InsData;
import me.zhengjie.gemho.service.ins.InsDataService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.TailNoForInfoUtil;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
......@@ -17,7 +18,6 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.File;
import java.io.FileInputStream;
import java.util.Date;
import java.util.HashMap;
......@@ -41,18 +41,22 @@ public class InsDataController {
@ApiOperation(value = "分页列表", response = InsData.class)
@GetMapping()
public ResponseEntity<Object> list(DataQueryCriteria dataQueryCriteria,HttpServletRequest request) {
HashMap<String, Object> data = insDataService.plist(dataQueryCriteria,request);
public ResponseEntity<Object> list(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
HashMap<String, Object> data = insDataService.plist(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(data), HttpStatus.OK);
}
@ApiOperation(value = "新增")
@PostMapping()
public Object add(@Valid @RequestBody InsData param,HttpServletRequest request) {
public Object add(@Valid @RequestBody InsData param, HttpServletRequest request) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
if (tailInfoNo == null) {
return new ResponseEntity<>(new PostOrPutResult().noTailFailed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
param.setAdd_time(new Date());
param.setUpdate_time(new Date());
boolean result = insDataService.add(param,request);
boolean result = insDataService.add(param, request);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
......@@ -62,9 +66,9 @@ public class InsDataController {
@ApiOperation(value = "修改")
@PutMapping()
public Object modify(@Valid @RequestBody InsData param,HttpServletRequest request) {
public Object modify(@Valid @RequestBody InsData param, HttpServletRequest request) {
param.setUpdate_time(new Date());
boolean result = insDataService.modify(param,request);
boolean result = insDataService.modify(param, request);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
......@@ -93,14 +97,14 @@ public class InsDataController {
@ApiOperation(value = "文件上传")
@PostMapping("inupload")
public ResponseEntity<Object> inupload(FileInputStream fileInputStream,MultipartFile file) {
public ResponseEntity<Object> inupload(FileInputStream fileInputStream, MultipartFile file) {
String upload = insDataService.upload(file);
return new ResponseEntity<>(upload, HttpStatus.OK);
}
@ApiOperation(value = "文件下载")
@GetMapping("download")
public void download(HttpServletResponse response, HttpServletRequest request,Integer id) {
public void download(HttpServletResponse response, HttpServletRequest request, Integer id) {
HttpServletResponse download = insDataService.download(response, request, id);
// return download;
}
......
......@@ -31,7 +31,7 @@ public class SysSelectController {
@Log(value = "修改配置大屏检测项")
@PostMapping
public ResponseEntity<Object> add(@RequestBody HashMap<String, Object> map, HttpServletRequest request) {
boolean updata = sysSelectService.updata(map,request);
boolean updata = sysSelectService.updata(map, request);
if (updata) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
......
......@@ -71,6 +71,9 @@ public class SysSummaryController {
public ResponseEntity<Object> add(@RequestBody SysSummary sysSummary, HttpServletRequest request) {
String currentUsername = SecurityUtils.getCurrentUsername();
String gettailno = onlineUserService.gettailno(currentUsername, request);
if(gettailno==null){
return new ResponseEntity<>(new PostOrPutResult().noTailFailed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
sysSummary.setCreatetime(LocalDateTime.now());
sysSummary.setUpdatetime(LocalDateTime.now());
String title = sysSummary.getTitle();
......
......@@ -70,6 +70,9 @@ public class AbnormalController {
@GetMapping("typelist")
public ResponseEntity<Object> typelist(HttpServletRequest request) {
List<HashMap<String, Object>> statistics1 = tabAbnormalService.statistics1(request);
if (statistics1 == null) {
return new ResponseEntity<>(new PageResult().nullfailed(), HttpStatus.OK);
}
HashMap<String, Integer> map = new HashMap<>();
for (HashMap<String, Object> stringObjectHashMap : statistics1) {
String devicetype = (String) stringObjectHashMap.get("code");
......@@ -100,6 +103,9 @@ public class AbnormalController {
}
}
List<HashMap<String, Object>> typelist = tabAbnormalService.typelist(request);
if (typelist == null) {
return new ResponseEntity<>(new PageResult().nullfailed(), HttpStatus.OK);
}
for (HashMap<String, Object> statistic : typelist) {
String code = (String) statistic.get("code");
Integer integer = map.get(code);
......@@ -121,7 +127,7 @@ public class AbnormalController {
@ApiOperation(value = "获取设备的四级报警")
@GetMapping("level")
public ResponseEntity<Object> alarmlevel(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
HashMap<String, Object> level = drybeachequipinforService.level(dataQueryCriteria,request);
HashMap<String, Object> level = drybeachequipinforService.level(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().nopagesuccess(level), HttpStatus.OK);
}
......
package me.zhengjie.gemho.entity;
package me.zhengjie.gemho.controller.tab;
import me.zhengjie.gemho.util.PostOrPutResult;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -20,8 +21,25 @@ import java.util.Date;
* @since 2021-12-22
*/
@RestController
@RequestMapping("back")
@RequestMapping("tab/back")
public class DataBack {
@Value(value = "${filepath}")
String filepath;
@PostMapping
public ResponseEntity<Object> deal() {
System.out.println("备份数据库开始执行");
try {
String backName = new SimpleDateFormat("yyMMddHHmmss").format(new Date()) + ".sql";
dbBackup("root", "jinghe2021//", "mdm_1_db", "d:/file/", backName);
} catch (Exception ex) {
System.out.println("备份异常");
ex.printStackTrace();
}
System.out.println("备份数据库结束");
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
public static Process linuxEnv(String command) {
Process ps = null;
try {
......@@ -77,8 +95,7 @@ public class DataBack {
}
}
@PostMapping
public ResponseEntity<Object> deal() {
public static void main(String[] args) {
System.out.println("备份数据库开始执行");
try {
String backName = new SimpleDateFormat("yyMMddHHmmss").format(new Date()) + ".sql";
......@@ -88,6 +105,7 @@ public class DataBack {
ex.printStackTrace();
}
System.out.println("备份数据库结束");
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
}
......@@ -15,11 +15,14 @@ import me.zhengjie.gemho.service.tab.DrybeachequipinforService;
import me.zhengjie.gemho.service.tab.TabAbnormalService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.TailNoForInfoUtil;
import me.zhengjie.gemho.x_datavo.DryVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.gemho.x_datavo.tab.DrybeachequipinforVo;
import me.zhengjie.modules.security.service.OnlineUserService;
import me.zhengjie.utils.RedisUtils;
import me.zhengjie.utils.SecurityUtils;
import me.zhengjie.utils.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......@@ -64,8 +67,14 @@ public class DrybeachequipinforController {
@Log("新增设备")
@ApiOperation(value = "新增设备", response = PostOrPutResult.class)
@PostMapping
public ResponseEntity<Object> add(@RequestBody Drybeachequipinfor drybeachequipinfor) {
public ResponseEntity<Object> add(@RequestBody Drybeachequipinfor drybeachequipinfor, HttpServletRequest request) {
try {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo(request);
if (tailInfoNo == null) {
return new ResponseEntity<>(new PostOrPutResult().noTailFailed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
drybeachequipinfor.setTailingid(tailInfoNo);
drybeachequipinfor.setInitialstateno("0");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
String format = simpleDateFormat.format(new Date());
int i = new Random().nextInt(8999) + 1000;
......@@ -75,6 +84,9 @@ public class DrybeachequipinforController {
drybeachequipinfor.setUpdatetime(new Date());
boolean save = drybeachequipinforService.save(drybeachequipinfor);
if (save) {
RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class);
redisUtils.del("NoName" + tailInfoNo);
redisUtils.del("NoDan" + tailInfoNo);
onlineUserService.clearMenu();
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
......@@ -95,7 +107,7 @@ public class DrybeachequipinforController {
@ApiOperation(value = "删除设备", response = PostOrPutResult.class)
@PreAuthorize("@el.check('delect:dry')")
@DeleteMapping
public ResponseEntity<Object> deleteone(@RequestBody HashMap<String, String> map) {
public ResponseEntity<Object> deleteone(@RequestBody HashMap<String, String> map, HttpServletRequest request) {
try {
boolean b = false;
Integer id = Integer.parseInt(map.get("id"));
......@@ -110,6 +122,13 @@ public class DrybeachequipinforController {
b = drybeachequipinforService.deleteall(equipno);
}
if (b) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo(request);
if (tailInfoNo == null) {
return null;
}
RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class);
redisUtils.del("NoName" + tailInfoNo);
redisUtils.del("NoDan" + tailInfoNo);
onlineUserService.clearMenu();
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
......@@ -129,12 +148,20 @@ public class DrybeachequipinforController {
@Log("修改设备")
@ApiOperation(value = "修改设备", response = PostOrPutResult.class)
@PutMapping
public ResponseEntity<Object> updateone(@RequestBody Drybeachequipinfor drybeachequipinfor) {
public ResponseEntity<Object> updateone(@RequestBody Drybeachequipinfor drybeachequipinfor, HttpServletRequest request) {
try {
drybeachequipinfor.setUpdatetime(new Date());
//drybeachequipinfor.setCreatetime(new Date());
boolean save = drybeachequipinforService.saveOrUpdate(drybeachequipinfor);
if (save) {
//清空缓存
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo(request);
if (tailInfoNo == null) {
return null;
}
RedisUtils redisUtils = SpringContextHolder.getBean(RedisUtils.class);
redisUtils.del("NoName" + tailInfoNo);
redisUtils.del("NoDan" + tailInfoNo);
onlineUserService.clearMenu();
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
......@@ -223,6 +250,17 @@ public class DrybeachequipinforController {
return new ResponseEntity<>(new PageResult().success(map), HttpStatus.OK);
}
@ApiOperation(value = "强制在线")
@PutMapping("enforce")
public ResponseEntity<Object> enforceOnline(@RequestBody HashMap<String, String> map) {
boolean b = drybeachequipinforService.enforceOnline(map);
if (b) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
}
package me.zhengjie.gemho.controller.tab;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.gemho.entity.tab.JrxDissect;
import me.zhengjie.gemho.service.tab.JrxDissectService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.TailNoForInfoUtil;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.gemho.x_datavo.data.JrxQueryCriteria;
import me.zhengjie.gemho.x_datavo.tab.visual.JrxDissectVisualVO;
import me.zhengjie.gemho.x_datavo.tab.visual.JrxStepsListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 浸润线坡面 前端控制器
* </p>
*
* @author llj
* @since 2022-05-13
*/
@Api(tags = "浸润线坡面")
@RequiredArgsConstructor
@RestController
@RequestMapping("tab/jrx/dissect")
public class JrxDissectController {
@Autowired
private JrxDissectService tabJrxDissectService;
@ApiOperation(value = "浸润线坡面分页列表", response = JrxDissect.class)
@GetMapping
public ResponseEntity<Object> list(DataQueryCriteria dataQueryCriteria) {
HashMap<String, Object> data = tabJrxDissectService.plist(dataQueryCriteria);
return new ResponseEntity<>(new PageResult().success(data), HttpStatus.OK);
}
@ApiOperation(value = "浸润线坡面新增")
@PostMapping()
public Object add(@Valid @RequestBody JrxDissect param) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
if (tailInfoNo == null) {
return null;
}
param.setPondid(tailInfoNo);
param.setDry_s(JSONObject.toJSONString(param.getDrys()));
boolean result = tabJrxDissectService.add(param);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@ApiOperation(value = "浸润线坡面修改")
@PutMapping()
public Object modify(@Valid @RequestBody JrxDissect param) {
param.setDry_s(JSONObject.toJSONString(param.getDrys()));
boolean result = tabJrxDissectService.modify(param);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@ApiOperation(value = "浸润线坡面删除(单个条目)")
@DeleteMapping()
public Object remove(@RequestBody HashMap<String, Object> map) {
Integer id = Integer.valueOf(map.get("id").toString());
boolean result = tabJrxDissectService.removeById(id);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@ApiOperation(value = "浸润线坡面大屏", response = JrxDissect.class)
@GetMapping("visual")
public ResponseEntity<Object> visual(JrxQueryCriteria jrxQueryCriteria) {
JrxDissectVisualVO visual = tabJrxDissectService.visual(jrxQueryCriteria);
return new ResponseEntity<>(new PageResult().success(visual), HttpStatus.OK);
}
@GetMapping("list")
public ResponseEntity<Object> stepsList() {
List<JrxStepsListVo> jrxStepsListVos = tabJrxDissectService.stepsList();
return new ResponseEntity<>(new PageResult().nopagesuccess(jrxStepsListVos), HttpStatus.OK);
}
}
package me.zhengjie.gemho.controller.tab;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.gemho.entity.tab.JrxSteps;
import me.zhengjie.gemho.service.tab.IJrxStepsService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.gemho.x_datavo.tab.visual.JrxStepsListVo;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author llj
* @since 2022-05-10
*/
@RequiredArgsConstructor
@RestController
@RequestMapping("tab/jrx/steps")
public class JrxStepsController {
private final IJrxStepsService iJrxStepsService;
@ApiOperation(value = "新增浸润线台阶")
@PostMapping
public ResponseEntity<Object> add(HttpServletRequest request, @RequestBody JrxSteps jrxSteps) {
boolean result = iJrxStepsService.add(jrxSteps, request);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@ApiOperation("删除浸润线台阶")
@DeleteMapping
public ResponseEntity<Object> deleteOne(@RequestBody HashMap<String, Object> map, HttpServletRequest request) {
Integer id = Integer.valueOf(map.get("id").toString());
boolean result = iJrxStepsService.removeById(id);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@ApiOperation(value = "修改浸润线台阶")
@PutMapping
public ResponseEntity<Object> updateOne(@RequestBody JrxSteps param, HttpServletRequest request) {
boolean result = iJrxStepsService.modify(param, request);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@ApiOperation(value = "查询浸润线台阶数据")
@GetMapping
public ResponseEntity<Object> pageAll(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
HashMap<String, Object> plist = iJrxStepsService.plist(dataQueryCriteria, request);
return new ResponseEntity<>(new PageResult().success(plist), HttpStatus.OK);
}
@GetMapping("list")
public ResponseEntity<Object> stepsList() {
List<JrxStepsListVo> jrxStepsListVos = iJrxStepsService.stepsList();
return new ResponseEntity<>(new PageResult().nopagesuccess(jrxStepsListVos), HttpStatus.OK);
}
}
package me.zhengjie.gemho.controller.tab;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.gemho.entity.tab.JrxWater;
import me.zhengjie.gemho.service.tab.JrxWaterService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.TailNoForInfoUtil;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.HashMap;
/**
* <p>
* 浸润线坡面水区 前端控制器
* </p>
*
* @author llj
* @since 2022-05-13
*/
@Api(tags = "浸润线坡面水区")
@RequiredArgsConstructor
@RestController
@RequestMapping("tab/jrx/water")
public class JrxWaterController {
@Autowired
private JrxWaterService tabJrxWaterService;
@ApiOperation(value = "浸润线坡面水区分页列表", response = JrxWater.class)
@GetMapping()
public ResponseEntity<Object> list(DataQueryCriteria dataQueryCriteria) {
HashMap<String, Object> data = tabJrxWaterService.plist(dataQueryCriteria);
return new ResponseEntity<>(new PageResult().success(data), HttpStatus.OK);
}
@ApiOperation(value = "浸润线坡面水区新增")
@PostMapping()
public Object add(@Valid @RequestBody JrxWater param) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
if (tailInfoNo == null) {
return null;
}
param.setPondid(tailInfoNo);
boolean result = tabJrxWaterService.add(param);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@ApiOperation(value = "浸润线坡面水区修改")
@PutMapping()
public Object modify(@Valid @RequestBody JrxWater param) {
boolean result = tabJrxWaterService.modify(param);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
@ApiOperation(value = "浸润线坡面水区删除(单个条目)")
@DeleteMapping()
public Object remove(@RequestBody HashMap<String, Object> map) {
Integer id = Integer.valueOf(map.get("id").toString());
boolean result = tabJrxWaterService.removeById(id);
if (result) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
} else {
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
}
}
......@@ -217,7 +217,7 @@ public class TailpondinforController {
@GetMapping("dryinfo")
public ResponseEntity<Object> change(HttpServletRequest request) {
String currentUsername = SecurityUtils.getCurrentUsername();
String gettailno = onlineUserService.gettailno(currentUsername,request);
String gettailno = onlineUserService.gettailno(currentUsername, request);
HashMap<String, Object> getzuobiao = tailpondinforService.getzuobiao(gettailno);
return new ResponseEntity<>(new PageResult().nopagesuccess(getzuobiao), HttpStatus.OK);
}
......
......@@ -4,7 +4,6 @@ package me.zhengjie.gemho.controller.tab;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import me.zhengjie.annotation.Log;
import me.zhengjie.gemho.entity.tab.UserTailpon;
import me.zhengjie.gemho.service.tab.TailpondinforService;
import me.zhengjie.gemho.service.tab.UserTailponService;
......
......@@ -31,7 +31,7 @@ public class WeatherController {
@GetMapping
public ResponseEntity<Object> getWeather(HttpServletRequest request) {
String currentUsername = SecurityUtils.getCurrentUsername();
String gettailno = onlineUserService.gettailno(currentUsername,request);
String gettailno = onlineUserService.gettailno(currentUsername, request);
QueryWrapper<Tailpondinfor> tailpondinforQueryWrapper = new QueryWrapper<>();
tailpondinforQueryWrapper.eq("tailingno", gettailno);
Tailpondinfor one = tailpondinforService.getOne(tailpondinforQueryWrapper);
......
......@@ -8,6 +8,7 @@ import me.zhengjie.gemho.entity.web.WebMonitorChart;
import me.zhengjie.gemho.service.web.IWebMonitorChartService;
import me.zhengjie.gemho.util.PageResult;
import me.zhengjie.gemho.util.PostOrPutResult;
import me.zhengjie.gemho.util.TailNoForInfoUtil;
import me.zhengjie.gemho.x_datavo.web.MonitorChartVo;
import me.zhengjie.modules.security.service.OnlineUserService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -40,6 +41,10 @@ public class WebMonitorChartController {
@ApiOperation(value = "新增/修改监测点模块信息")
@PostMapping
public ResponseEntity<Object> add(@RequestBody WebMonitorChart webMonitorChart, HttpServletRequest request) {
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
if (tailInfoNo == null) {
return new ResponseEntity<>(new PostOrPutResult().noTailFailed(), HttpStatus.INTERNAL_SERVER_ERROR);
}
boolean save = iWebMonitorChartService.deal(webMonitorChart, request);
if (save) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
......
......@@ -56,6 +56,6 @@ public class WebMonitorPointsController {
if (remove) {
return new ResponseEntity<>(new PostOrPutResult().success(), HttpStatus.OK);
}
return new ResponseEntity<>(new PostOrPutResult().failed(), HttpStatus.INTERNAL_SERVER_ERROR);
return new ResponseEntity<>(new PostOrPutResult().deleteFailed(), HttpStatus.CREATED);
}
}
\ No newline at end of file
......@@ -117,6 +117,8 @@ public class DbData implements Serializable {
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@TableField(exist = false)
private Date jctime;
@TableField(exist = false)
public String danwei;
public static void main(String[] args) {
LocalDateTime start = LocalDateTime.now();
......
......@@ -104,7 +104,8 @@ public class DmData implements Serializable {
*/
@ApiModelProperty(value = "数据来源,1在线设备,0人工巡检", hidden = true)
public Integer datasource;
@TableField(exist = false)
public String danwei;
/**
* 报警级别
*/
......
......@@ -174,8 +174,8 @@ public class MpData implements Serializable {
*/
@ApiModelProperty("报警级别")
public String bjjb;
@TableField(exist = false)
public String danwei;
@TableField(exist = false)
private String jcziitemname;
......
package me.zhengjie.gemho.entity.data;
import com.alibaba.fastjson.annotation.JSONField;
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 io.swagger.annotations.ApiModel;
......@@ -40,6 +42,8 @@ public class PslData implements Serializable {
@ApiModelProperty("设备id")
public String sensorid;
public String sensorname;
/**
* 测量时间
*/
......@@ -75,12 +79,21 @@ public class PslData implements Serializable {
*/
@ApiModelProperty(value = "数据创建时间", hidden = true)
public Date createtime;
@TableField(exist = false)
public String danwei;
/**
* 修改时间
*/
@ApiModelProperty(value = "数据修改时间", hidden = true)
public Date updatetime;
@TableField(exist = false)
private String jcziitemname;
@TableField(exist = false)
private String jcvalue;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@TableField(exist = false)
private Date jctime;
}
package me.zhengjie.gemho.entity.data;
import com.alibaba.fastjson.annotation.JSONField;
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 io.swagger.annotations.ApiModel;
......@@ -40,6 +42,9 @@ public class RgData implements Serializable {
@ApiModelProperty("设备id")
private String sensorid;
@ApiModelProperty(value = "设备名称")
public String sensorname;
/**
* 测量时间
*/
......@@ -50,7 +55,7 @@ public class RgData implements Serializable {
* 据上一次统计到现在的降雨量(mm)
*/
@ApiModelProperty("降雨量(mm)")
private Double rainfall;
public Double rainfall;
/**
* 创建时间
......@@ -83,5 +88,17 @@ public class RgData implements Serializable {
@ApiModelProperty(value = "数据来源,1在线设备,0人工巡检", hidden = true)
private Integer datasource;
@TableField(exist = false)
public String jcziitemname;
@TableField(exist = false)
public String jcvalue;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@TableField(exist = false)
public Date jctime;
@TableField(exist = false)
public String danwei;
}
package me.zhengjie.gemho.entity.data;
import com.alibaba.fastjson.annotation.JSONField;
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 io.swagger.annotations.ApiModel;
......@@ -39,6 +41,8 @@ public class SlData implements Serializable {
*/
@ApiModelProperty("设备id")
public String sensorid;
public String sensorname;
/**
* 测量时间
......@@ -46,6 +50,7 @@ public class SlData implements Serializable {
@ApiModelProperty("测量时间")
public Date time;
/**
* 测量值(m),
*/
......@@ -82,5 +87,15 @@ public class SlData implements Serializable {
@ApiModelProperty(value = "数据更新时间", hidden = true)
public Date updatetime;
@TableField(exist = false)
private String jcziitemname;
@TableField(exist = false)
private String jcvalue;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@TableField(exist = false)
private Date jctime;
@TableField(exist = false)
public String danwei;
}
......@@ -102,6 +102,7 @@ public class StData implements Serializable {
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@TableField(exist = false)
public Date jctime;
@TableField(exist = false)
public String danwei;
}
package me.zhengjie.gemho.entity.data;
import com.alibaba.fastjson.annotation.JSONField;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
* <p>
* 外坡比数据
* </p>
*
* @author llj
* @since 2022-05-12
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_wpb_data")
@ApiModel(value = "WpbData对象", description = "外坡比数据")
public class WpbData implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键,自增")
@TableId(value = "id", type = IdType.AUTO)
public Integer id;
@ApiModelProperty(value = "监测点编号(外键),tb_drybeachequipinfor 的id")
public String sensorid;
@ApiModelProperty(value = "设备名称")
public String sensorname;
@ApiModelProperty(value = " 测量时间")
public Date time;
@ApiModelProperty(value = "监测值(m)")
public String value;
@ApiModelProperty(value = "创建时间")
public LocalDateTime createtime;
@ApiModelProperty(value = "修改时间")
public LocalDateTime updatetime;
@ApiModelProperty(value = "是否报警")
public Integer state;
@ApiModelProperty(value = "报警级别")
public String bjjb;
@ApiModelProperty(value = "数据来源,1在线设备,0人工巡检")
public Integer datasource;
@TableField(exist = false)
public String jcziitemname;
@TableField(exist = false)
public String jcvalue;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@TableField(exist = false)
public Date jctime;
@TableField(exist = false)
public String danwei;
}
......@@ -88,13 +88,14 @@ public class WtData implements Serializable {
@TableField(exist = false)
private String jcziitemname;
public String jcziitemname;
@TableField(exist = false)
private String jcvalue;
public String jcvalue;
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@TableField(exist = false)
private Date jctime;
public Date jctime;
@TableField(exist = false)
public String danwei;
}
package me.zhengjie.gemho.entity.dic;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author llj
* @since 2022-05-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tab_dict_alarm_level")
@ApiModel(value = "AlarmLevel对象", description = "")
public class AlarmLevel implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "ID")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "报警等级名称(红色报警)")
@TableField("name")
private String name;
@ApiModelProperty(value = "报警等级值(对应报警表 alarmlevel)")
@TableField("value")
private Integer value;
@ApiModelProperty(value = "报警等级颜色")
@TableField("color")
private String color;
@ApiModelProperty(value = "备注")
@TableField("remark")
private String remark;
}
package me.zhengjie.gemho.entity.dic;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author llj
* @since 2022-05-05
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tab_dict_alarm_state")
@ApiModel(value = "AlarmState对象", description = "")
public class AlarmState implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "报警状态名称")
@TableField("name")
private String name;
@ApiModelProperty(value = "报警状态值(对应报警表 state)")
@TableField("value")
private Integer value;
@ApiModelProperty(value = "备注")
@TableField("remark")
private String remark;
}
......@@ -23,7 +23,7 @@ import java.io.Serializable;
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("c_jcjd")
@ApiModel(value="Jcjd对象", description="检测项_字典")
@ApiModel(value = "Jcjd对象", description = "检测项_字典")
public class Jcjd implements Serializable {
private static final long serialVersionUID = 1L;
......
package me.zhengjie.gemho.entity.ins;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......
package me.zhengjie.gemho.entity.ins;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
......
......@@ -269,6 +269,19 @@ public class Drybeachequipinfor implements Serializable {
*/
@ApiModelProperty(value = "干滩安全超高,只用于干滩监测")
private String gtsafeheight;
/**
* .浸润线设备到开孔位置的距离
*/
private Double jrx_burial;
/**
* 浸润线开孔深度
*/
private Double jrx_trepanning;
/**
* 设备距离坡面左侧距离(单位:m)
*/
private Double jrx_coord_x;
/**
* 排水量流速(单位是m/s),只用于排水量,表示流速
......
package me.zhengjie.gemho.entity.tab;
import com.alibaba.fastjson.annotation.JSONField;
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 lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
* <p>
* 浸润线坡面
* </p>
*
* @author llj
* @since 2022-05-13
*/
@Getter
@Setter
@TableName("tab_jrx_dissect")
public class JrxDissect implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 剖面ID
*/
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 剖面名称
*/
private String name;
/**
* 剖面编号
*/
private String code;
private Double height;
private Double width;
/**
* 水区扇形起始角度
*/
private Double sdeg;
/**
* 总直径
*/
private Double diameter;
/**
* 尾矿库ID
*/
private String pondid;
/**
* 坡面关联的设备编号(多个设备编号用逗号隔开)
*/
@TableField(exist = false)
private String[] drys;
@JSONField(serialize = false)
@TableField(value = "drys")
private String dry_s;
}
package me.zhengjie.gemho.entity.tab;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
*
* </p>
*
* @author llj
* @since 2022-05-10
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tab_jrx_steps")
@ApiModel(value = "JrxSteps对象", description = "")
public class JrxSteps implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "台阶名称")
private String name;
@ApiModelProperty(value = "台阶编号")
private Integer code;
@TableField(updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "高度(米)")
private Double height;
@TableField(updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
@ApiModelProperty(value = "宽度(米)")
private Double width;
@ApiModelProperty(value = "坡度(deg)")
private Double slope;
private Integer dissectid;
@JSONField(serialize = false)
private String pondid;
private LocalDateTime time;
}
package me.zhengjie.gemho.entity.tab;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
* <p>
* 浸润线坡面水区
* </p>
*
* @author llj
* @since 2022-05-13
*/
@Getter
@Setter
@TableName("tab_jrx_water")
public class JrxWater implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
/**
* 剖面id
*/
private Integer dissectid;
/**
* 水区扇形起始角度
*/
private Double sdeg;
/**
* 总直径
*/
private Double diameter;
private String pondid;
}
......@@ -21,7 +21,7 @@ import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="WebMonitorIcon对象", description="")
@ApiModel(value = "WebMonitorIcon对象", description = "")
public class WebMonitorIcon implements Serializable {
private static final long serialVersionUID = 1L;
......
......@@ -22,7 +22,7 @@ import java.io.Serializable;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="WebMonitorLink对象", description="")
@ApiModel(value = "WebMonitorLink对象", description = "")
public class WebMonitorLink implements Serializable {
private static final long serialVersionUID = 1L;
......
package me.zhengjie.gemho.mapper.artificial;
import me.zhengjie.gemho.entity.artificial.ArtificialData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.artificial.ArtificialData;
import org.apache.ibatis.annotations.Mapper;
/**
......
package me.zhengjie.gemho.mapper.artificial;
import me.zhengjie.gemho.entity.artificial.ArtificialPoint;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.artificial.ArtificialPoint;
import org.apache.ibatis.annotations.Mapper;
/**
......
......@@ -19,9 +19,9 @@ import java.util.List;
@Mapper
public interface DbDataMapper extends BaseMapper<DbData> {
@Select("SELECT * FROM (SELECT * FROM `tb_db_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<DbData> dealmonth(String deviceid, String start, String end, int datasource);
@Select("SELECT * FROM (SELECT * FROM `tb_db_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<DbData> dealmonth(String deviceid, String start, String end);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.lenth as `lenth`,a.angle as angle ,a.safeheight as safeheight ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_db_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.lenth as `lenth`,a.angle as angle ,a.safeheight as safeheight ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_db_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
......@@ -19,9 +19,9 @@ import java.util.List;
@Mapper
public interface DmDataMapper extends BaseMapper<DmData> {
@Select("SELECT * FROM (SELECT * FROM `tb_dm_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{sensorid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<DmData> dealmonth(String sensorid, String start, String end, int datasource);
@Select("SELECT * FROM (SELECT * FROM `tb_dm_data` ORDER BY time DESC)a where sensorid=#{sensorid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<DmData> dealmonth(String sensorid, String start, String end);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,a.sensorname,b.equipno equipno,a.dispA as dispA,a.dispB as dispB , DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_dm_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipname as sensorname,b.equipno equipno,a.dispA as dispA,a.dispB as dispB , DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_dm_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
......@@ -22,10 +22,10 @@ public interface MpDataMapper extends BaseMapper<MpData> {
/* @Results({
@Result(column = "acceler_x", property = "accelerx", typeHandler = AESEncryptHandler.class)
})*/
@Select("SELECT a.disp_x as dispx ,a.disp_y as dispy,a.disp_h as disph ,a.time as time FROM (SELECT * FROM `tb_mp_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<MpData> dealmonth(String deviceid, String start, String end, int datasource);
@Select("SELECT a.disp_x as dispx ,a.disp_y as dispy,a.disp_h as disph ,a.time as time FROM (SELECT * FROM `tb_mp_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<MpData> dealmonth(String deviceid, String start, String end);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.disp_x as disp_x , a.disp_y as disp_y ,a.disp_h as disp_h ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_mp_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.disp_x as disp_x , a.disp_y as disp_y ,a.disp_h as disp_h ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_mp_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
......@@ -19,9 +19,9 @@ import java.util.List;
@Mapper
public interface PslDataMapper extends BaseMapper<PslData> {
@Select("SELECT * FROM (SELECT * FROM `tb_psl_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<PslData> dealmonth(String deviceid, String start, String end, int datasource);
@Select("SELECT * FROM (SELECT * FROM `tb_psl_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<PslData> dealmonth(String deviceid, String start, String end);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.pslvalue as `value`, DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m')as time from tb_psl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.pslvalue as `value`, DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m')as time from tb_psl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
......@@ -19,6 +19,6 @@ import java.util.List;
@Mapper
public interface RgDataMapper extends BaseMapper<RgData> {
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.rainfall as `rainfall` ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_rg_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.rainfall as `rainfall` ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_rg_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
......@@ -19,9 +19,9 @@ import java.util.List;
@Mapper
public interface SlDataMapper extends BaseMapper<SlData> {
@Select("SELECT * FROM (SELECT * FROM `tb_sl_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<SlData> dealmonth(String deviceid, String start, String end, int datasource);
@Select("SELECT * FROM (SELECT * FROM `tb_sl_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<SlData> dealmonth(String deviceid, String start, String end);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.sllvalue as `value`, DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_sl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.sllvalue as `value`, DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_sl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
......@@ -2,6 +2,7 @@ package me.zhengjie.gemho.mapper.data;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.data.StData;
import me.zhengjie.gemho.x_datavo.tab.visual.JrxDryVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
......@@ -18,9 +19,11 @@ import java.util.List;
*/
@Mapper
public interface StDataMapper extends BaseMapper<StData> {
@Select("SELECT * FROM (SELECT * FROM `tb_st_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<StData> dealmonth(String deviceid, String start, String end, int datasource);
@Select("SELECT * FROM (SELECT * FROM `tb_st_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<StData> dealmonth(String deviceid, String start, String end);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.stage as stage,a.depth as depth ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_st_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.stage as stage,a.depth as depth ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_st_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
List<JrxDryVo> getStageDepth(List<String> sensorids);
}
......@@ -3,7 +3,6 @@ package me.zhengjie.gemho.mapper.data;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.data.SzData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -19,6 +18,5 @@ import java.util.HashMap;
@Mapper
public interface SzDataMapper extends BaseMapper<SzData> {
@Select(value = "select c.`value` as `value`,c.name as name from (select a.svalue as `value`,b.equipname as `name` ,b.equipno as equipno ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_sz_data a join tb_drybeachequipinfor b on a.sensorid =b.equipno WHERE b.devicetype=8 and b.tailingid=#{tailingid} ORDER BY time DESC) c GROUP BY c.equipno")
ArrayList<HashMap<String, Object>> real(String tailingid);
}
package me.zhengjie.gemho.mapper.data;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.data.WpbData;
import org.apache.ibatis.annotations.Select;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 外坡比数据 Mapper 接口
* </p>
*
* @author llj
* @since 2022-05-12
*/
public interface WpbDataMapper extends BaseMapper<WpbData> {
@Select("SELECT * FROM (SELECT * FROM `tb_wpb_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<WpbData> dealmonth(String deviceid, String start, String end);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.value as `value` ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_wpb_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
......@@ -18,9 +18,9 @@ import java.util.List;
*/
@Mapper
public interface WtDataMapper extends BaseMapper<WtData> {
@Select("SELECT * FROM (SELECT * FROM `tb_wt_data` where datasource =#{datasource} ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<WtData> dealmonth(String deviceid, String start, String end, int datasource);
@Select("SELECT * FROM (SELECT * FROM `tb_wt_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
List<WtData> dealmonth(String deviceid, String start, String end);
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,a.sensorname,a.stage as `stage` ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_wt_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value = "SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.stage as `stage` ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_wt_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
List<HashMap<String, Object>> real(String tailingid);
}
package me.zhengjie.gemho.mapper.dic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.dic.AlarmLevel;
/**
* <p>
* Mapper 接口
* </p>
*
* @author llj
* @since 2022-05-05
*/
public interface AlarmLevelMapper extends BaseMapper<AlarmLevel> {
}
package me.zhengjie.gemho.mapper.dic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.dic.AlarmState;
/**
* <p>
* Mapper 接口
* </p>
*
* @author llj
* @since 2022-05-05
*/
public interface AlarmStateMapper extends BaseMapper<AlarmState> {
}
......@@ -89,4 +89,6 @@ public interface DrybeachequipinforMapper extends BaseMapper<Drybeachequipinfor>
List<HashMap<String, Object>> dryStateCount(String tailingid);
Integer dryUnCount(String tailingid);
int enforceOnline(String equipno);
}
package me.zhengjie.gemho.mapper.tab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.tab.JrxDissect;
import me.zhengjie.gemho.x_datavo.sys.TypeVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.ArrayList;
/**
* <p>
* 浸润线坡面 Mapper 接口
* </p>
*
* @author llj
* @since 2022-05-13
*/
@Mapper
public interface JrxDissectMapper extends BaseMapper<JrxDissect> {
ArrayList<TypeVo> getsubs(String pondid);
}
package me.zhengjie.gemho.mapper.tab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.tab.JrxSteps;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author llj
* @since 2022-05-10
*/
public interface JrxStepsMapper extends BaseMapper<JrxSteps> {
List<JrxSteps> getByCode(Integer code);
}
package me.zhengjie.gemho.mapper;
package me.zhengjie.gemho.mapper.tab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import me.zhengjie.gemho.entity.DataBack;
import me.zhengjie.gemho.entity.tab.JrxWater;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* 浸润线坡面水区 Mapper 接口
* </p>
*
* @author llj
* @since 2021-12-22
* @since 2022-05-13
*/
@Mapper
public interface TestMapper extends BaseMapper<DataBack> {
public interface JrxWaterMapper extends BaseMapper<JrxWater> {
}
......@@ -54,6 +54,7 @@ public interface TailpondinforMapper extends BaseMapper<Tailpondinfor> {
/**
* 获取大屏标题
*
* @return
*/
@Select(value = "SELECT screen_title from tb_tailpondinfor where tailingno=#{tailingno}")
......@@ -61,10 +62,11 @@ public interface TailpondinforMapper extends BaseMapper<Tailpondinfor> {
/**
* 修改大屏标题
*
* @param title
* @param tailingno
* @return
*/
@Update(value = "update tb_tailpondinfor set screen_title= #{title} where tailingno=#{tailingno}")
int updateTitle(String title,String tailingno);
int updateTitle(String title, String tailingno);
}
......@@ -32,7 +32,7 @@ public interface ArtificialDataService extends IService<ArtificialData> {
* @param param 根据需要进行传值
* @return
*/
boolean add(ArtificialData param,HttpServletRequest request);
boolean add(ArtificialData param, HttpServletRequest request);
/**
* 人工监测数据表修改
......@@ -40,6 +40,6 @@ public interface ArtificialDataService extends IService<ArtificialData> {
* @param param 根据需要进行传值
* @return
*/
boolean modify(ArtificialData param,HttpServletRequest request);
boolean modify(ArtificialData param, HttpServletRequest request);
}
......@@ -33,7 +33,7 @@ public interface ArtificialPointService extends IService<ArtificialPoint> {
* @param param 根据需要进行传值
* @return
*/
boolean add(ArtificialPoint param,HttpServletRequest request);
boolean add(ArtificialPoint param, HttpServletRequest request);
/**
* 人工监测点位表修改
......@@ -41,7 +41,7 @@ public interface ArtificialPointService extends IService<ArtificialPoint> {
* @param param 根据需要进行传值
* @return
*/
boolean modify(ArtificialPoint param,HttpServletRequest request);
boolean modify(ArtificialPoint param, HttpServletRequest request);
/**
* 人工监测点位下拉列表
......
......@@ -49,6 +49,9 @@ public class ArtificialDataServiceImpl extends ServiceImpl<ArtificialDataMapper,
public HashMap<String, Object> plist(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
//获取当前尾矿库
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo(request);
if (tailInfoNo == null) {
return null;
}
//查询所有的检测子项
List<Jczx> jczxes = jczxMapper.selectList(null);
long size = dataQueryCriteria.getSize();
......@@ -94,9 +97,12 @@ public class ArtificialDataServiceImpl extends ServiceImpl<ArtificialDataMapper,
* @return
*/
@Override
public boolean add(ArtificialData param,HttpServletRequest request) {
public boolean add(ArtificialData param, HttpServletRequest request) {
//获取当前尾矿库编码
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo(request);
if (tailInfoNo == null) {
return false;
}
param.setTailingid(tailInfoNo);
int result = artificialDataMapper.insert(param);
if (result > 0) {
......@@ -112,9 +118,12 @@ public class ArtificialDataServiceImpl extends ServiceImpl<ArtificialDataMapper,
* @return
*/
@Override
public boolean modify(ArtificialData param,HttpServletRequest request) {
public boolean modify(ArtificialData param, HttpServletRequest request) {
//获取当前尾矿库编码
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo(request);
if (tailInfoNo == null) {
return false;
}
param.setTailingid(tailInfoNo);
QueryWrapper<ArtificialData> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id", param.getId());
......
......@@ -43,6 +43,9 @@ public class ArtificialPointServiceImpl extends ServiceImpl<ArtificialPointMappe
public HashMap<String, Object> plist(DataQueryCriteria dataQueryCriteria, HttpServletRequest request) {
//获取当前尾矿库
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo(request);
if (tailInfoNo == null) {
return null;
}
long size = dataQueryCriteria.getSize();
long page = dataQueryCriteria.getPage();
Page<ArtificialPoint> ArtificialPointPage = new Page<>(page + 1, size);
......@@ -69,6 +72,9 @@ public class ArtificialPointServiceImpl extends ServiceImpl<ArtificialPointMappe
public boolean add(ArtificialPoint param, HttpServletRequest request) {
//获取当前尾矿库
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo(request);
if (tailInfoNo == null) {
return false;
}
param.setTailingid(tailInfoNo);
int result = artificialPointMapper.insert(param);
if (result > 0) {
......@@ -87,6 +93,9 @@ public class ArtificialPointServiceImpl extends ServiceImpl<ArtificialPointMappe
public boolean modify(ArtificialPoint param, HttpServletRequest request) {
//获取当前尾矿库
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo(request);
if (tailInfoNo == null) {
return false;
}
param.setTailingid(tailInfoNo);
QueryWrapper<ArtificialPoint> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id", param.getId());
......@@ -100,6 +109,12 @@ public class ArtificialPointServiceImpl extends ServiceImpl<ArtificialPointMappe
@Override
public List pointList() {
ArrayList<PointListVo> pointListVos = new ArrayList<>();
QueryWrapper<ArtificialPoint> artificialPointQueryWrapper = new QueryWrapper<>();
String tailInfoNo = TailNoForInfoUtil.getTailInfoNo();
if (tailInfoNo == null) {
return null;
}
artificialPointQueryWrapper.eq("tailingid", tailInfoNo);
List<ArtificialPoint> artificialPoints = artificialPointMapper.selectList(null);
for (ArtificialPoint artificialPoint : artificialPoints) {
PointListVo pointListVo = new PointListVo();
......
......@@ -60,7 +60,7 @@ public interface DmDataService extends IService<DmData> {
* @param dataQueryCriteria
* @return
*/
HashMap<String, Object> pageall(DataQueryCriteria dataQueryCriteria,HttpServletRequest request);
HashMap<String, Object> pageall(DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
/**
* 实时数据
......@@ -75,8 +75,8 @@ public interface DmDataService extends IService<DmData> {
* @param dataQueryCriteria
* @return
*/
ImgDataVo imgList(DataQueryCriteria dataQueryCriteria,HttpServletRequest request);
ImgDataVo imgList(DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria,HttpServletRequest request);
void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
}
......@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.data.PslData;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.gemho.x_datavo.data.ImgDataVo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
......@@ -52,22 +55,29 @@ public interface PslDataService extends IService<PslData> {
DataVo month(String date, String values, String deviceid, String subitem);
/**
* 分页历史记录
* 分页历史
*
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param page
* @param size
* @param datasource
* @param dataQueryCriteria
* @param request
* @return
*/
HashMap<String, Object> pageall(String searchName, String searchValue, String limit, String timeSpace, String sort, long page, long size, String datasource);
HashMap<String, Object> pageall(DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
/**
* 图表数据
*
* @param dataQueryCriteria
* @param request
* @return
*/
ImgDataVo imgList(DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
/**
* 实时数据
*
* @return
*/
List<RealDataVo> real(String equipno, HttpServletRequest request);
......
......@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.data.RgData;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.gemho.x_datavo.data.ImgDataVo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
......@@ -48,20 +51,27 @@ public interface RgDataService extends IService<RgData> {
*/
DataVo month(String date, String values, String deviceid);
/**
* 分页历史
*
* @param dataQueryCriteria
* @param request
* @return
*/
HashMap<String, Object> pageall(DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
/**
* 分页查询历史数据
* 图表数据
*
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param page
* @param size
* @param datasource
* @param dataQueryCriteria
* @param request
* @return
*/
HashMap<String, Object> pageall(String searchName, String searchValue, String limit, String timeSpace, String sort, long page, long size, String datasource);
ImgDataVo imgList(DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
/**
* 实时数据
......
......@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.data.SlData;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.gemho.x_datavo.data.ImgDataVo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
......@@ -53,18 +56,20 @@ public interface SlDataService extends IService<SlData> {
/**
* 分页历史记录
*/
HashMap<String, Object> pageall(DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
/**
* 图表数据
*
* @param searchName
* @param searchValue
* @param limit
* @param timeSpace
* @param sort
* @param page
* @param size
* @param datasource
* @param dataQueryCriteria
* @param request
* @return
*/
HashMap<String, Object> pageall(String searchName, String searchValue, String limit, String timeSpace, String sort, long page, long size, String datasource);
ImgDataVo imgList(DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
/**
* 实时数据
......
......@@ -56,6 +56,7 @@ public interface StDataService extends IService<StData> {
/**
* 分页历史记录
*
* @param dataQueryCriteria
* @param request
* @return
......@@ -69,6 +70,7 @@ public interface StDataService extends IService<StData> {
* @return
*/
List<RealDataVo> real(String equipno, HttpServletRequest request);
/**
* 图表数据
*
......
......@@ -52,10 +52,12 @@ public interface SzDataService extends IService<SzData> {
/**
* 实时数据
*
* @param deviceid
* @return
*/
ArrayList<HashMap<String, Object>> real(String deviceid, HttpServletRequest request);
/**
* 分页历史记录
*
......
package me.zhengjie.gemho.service.data;
import com.baomidou.mybatisplus.extension.service.IService;
import me.zhengjie.gemho.entity.data.WpbData;
import me.zhengjie.gemho.x_datavo.DataVo;
import me.zhengjie.gemho.x_datavo.RealDataVo;
import me.zhengjie.gemho.x_datavo.data.DataQueryCriteria;
import me.zhengjie.gemho.x_datavo.data.ImgDataVo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 外坡比数据 服务类
* </p>
*
* @author llj
* @since 2022-05-12
*/
public interface WpbDataService extends IService<WpbData> {
/**
* 日统计
*
* @param date
* @param values
* @param deviceid
* @param subitem
* @return
*/
DataVo day(String date, String values, String deviceid, String subitem);
/**
* 周统计
*
* @param date
* @param values
* @param deviceid
* @param subitem
* @return
*/
DataVo week(String date, String values, String deviceid, String subitem);
/**
* 月统计
*
* @param date
* @param values
* @param deviceid
* @param subitem
* @return
*/
DataVo month(String date, String values, String deviceid, String subitem);
/**
* 分页历史
*
* @param dataQueryCriteria
* @param request
* @return
*/
HashMap<String, Object> pageall(DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
/**
* 图表数据
*
* @param dataQueryCriteria
* @param request
* @return
*/
ImgDataVo imgList(DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
void download(HttpServletResponse response, DataQueryCriteria dataQueryCriteria, HttpServletRequest request);
/**
* 实时数据
*
* @return
*/
List<RealDataVo> real(String equipno, HttpServletRequest request);
}
......@@ -53,6 +53,7 @@ public interface WtDataService extends IService<WtData> {
* @return
*/
DataVo month(String date, String values, String deviceid, String subitem);
/**
* 分页历史
*
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment