src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -60,6 +60,8 @@ secureRegistry.excludePathPatterns("/riverway/**"); secureRegistry.excludePathPatterns("/site/**"); secureRegistry.excludePathPatterns("/stbprpb/**"); secureRegistry.excludePathPatterns("/bigriver/**"); secureRegistry.excludePathPatterns("/smariver/**"); return secureRegistry; } src/main/java/org/springblade/modules/mountainrain/controller/BigriverController.java
New file @@ -0,0 +1,134 @@ /** * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springblade.modules.mountainrain.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.mp.support.Condition; import org.springblade.core.tool.api.R; import org.springblade.modules.mountainrain.entity.Yucbig; import org.springblade.modules.mountainrain.excel.BgrExcel; import org.springblade.modules.mountainrain.excel.BgrImporter; import org.springblade.modules.mountainrain.service.IBigriverService; import org.springblade.modules.mountainrain.wrapper.BigriverWrapper; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; /** * 控制器 * * @author Blade * @since 2019-11-07 */ @RestController @AllArgsConstructor @RequestMapping("/bigriver") @Api(value = "", tags = "接口") public class BigriverController extends BladeController { private IBigriverService iBigriverService; /** * 详情 */ @ApiLog("详情") @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "site") public R<Yucbig> detail(Yucbig yucbig) { Yucbig detail = iBigriverService.getOne(Condition.getQueryWrapper(yucbig)); return R.data(BigriverWrapper.build().entityVO(detail)); } /** * 新增 */ @ApiLog("新增") @PostMapping("/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入site") public R save(@Valid @RequestBody Yucbig yucbig) { return R.status(iBigriverService.save(yucbig)); } /** * 修改 */ @ApiLog("修改") @PostMapping("/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入site") public R update(@Valid @RequestBody Yucbig yucbig) { return R.status(iBigriverService.updateById(yucbig)); } /** * 大江大河预报数据导入 */ @PostMapping("import-bgr") public R importbgr(MultipartFile file) { BgrImporter bgrImporter = new BgrImporter(iBigriverService, false); ExcelUtil.save(file, bgrImporter, BgrExcel.class); return R.success("导入成功"); } /** * 大江大河预警 * * @return */ @GetMapping("/selectbgriver") public R selectbgriver() { List<Map<String, Object>> selctsmriver = iBigriverService.selctbgriver(); //预警数据 List listyj = new ArrayList(); //无预警数据 List listzc = new ArrayList(); for (int i = 0; i < selctsmriver.size(); i++) { //警戒水位 String yjsw = selctsmriver.get(i).get("yjsw").toString(); Double yjz = Double.parseDouble(yjsw); //水位 String zs = selctsmriver.get(i).get("yuz").toString(); Double z = Double.parseDouble(zs); if (z > yjz) { listyj.add(selctsmriver.get(i)); } else { listzc.add(selctsmriver.get(i)); } } Map map = new HashMap(); map.put("yj", listyj); map.put("zc", listzc); List list = new ArrayList(); list.add(map); return R.data(list); } } src/main/java/org/springblade/modules/mountainrain/controller/MountainrainController.java
@@ -23,6 +23,7 @@ import lombok.AllArgsConstructor; import org.apache.poi.hssf.usermodel.*; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; @@ -33,10 +34,16 @@ import org.springblade.modules.mountain.vo.MountainVO; import org.springblade.modules.mountainrain.entity.Mountainrain; import org.springblade.modules.mountainrain.entity.Yucpptn; import org.springblade.modules.mountainrain.excel.BgrExcel; import org.springblade.modules.mountainrain.excel.BgrImporter; import org.springblade.modules.mountainrain.excel.MgrExcel; import org.springblade.modules.mountainrain.excel.MgrImporter; import org.springblade.modules.mountainrain.service.IMountainrainService; import org.springblade.modules.mountainrain.vo.*; import org.springblade.modules.mountainrain.wrapper.MountainrainWrapper; import org.springblade.modules.regionWeight.service.IRegionWeightService; import org.springblade.modules.system.excel.UserExcel; import org.springblade.modules.system.excel.UserImporter; import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -47,6 +54,7 @@ import java.io.*; import java.math.BigDecimal; import java.net.URLEncoder; import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -598,8 +606,13 @@ e.printStackTrace(); } Process proc; Timestamp timestamp = new Timestamp(System.currentTimeMillis()); long url = timestamp.getTime(); Map m = new HashMap(); m.put("url", url + ".png"); String[] args1 = new String[]{"python", "D:\\fz\\mou.py", String.valueOf(url)}; try { proc = Runtime.getRuntime().exec("python D:\\fz\\mou.py"); proc = Runtime.getRuntime().exec(args1); BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = null; while ((line = in.readLine()) != null) { @@ -612,6 +625,7 @@ } catch (InterruptedException e) { e.printStackTrace(); } lists.add(m); return R.data(lists); } @@ -720,8 +734,13 @@ e.printStackTrace(); } Process proc; Timestamp timestamp = new Timestamp(System.currentTimeMillis()); long url = timestamp.getTime(); Map m = new HashMap(); m.put("url", url + ".png"); String[] args1 = new String[]{"python", "D:\\fz\\moup.py", String.valueOf(url)}; try { proc = Runtime.getRuntime().exec("python D:\\fz\\moup.py"); proc = Runtime.getRuntime().exec(args1); BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = null; while ((line = in.readLine()) != null) { @@ -734,6 +753,7 @@ } catch (InterruptedException e) { e.printStackTrace(); } lists.add(m); return R.data(lists); } @@ -757,44 +777,43 @@ String s = regionWeightService.selectCode(); String[] split = s.split(","); String strArrays = ""; System.out.println("长度:"+split.length); for (int i = 0; i < split.length; i++) { strArrays += "'" + split[i] + "',"; } String code = strArrays.substring(0, strArrays.length() - 1); // for (int i = 0; i < split.length; i++) { // Integer num = 30; // double v1 = 0; // String stcd = null; // for (int j = 0; j < passDaysList.size() - 2; j++) { // List<Map<String, Object>> map = mountainrainService.selectMtwo(passDaysList.get(j).toString(), passDaysList.get(j + 1).toString(), code); // if (map.size() == 0 || i > map.size() - 1) { // break; // } // BigDecimal w = (BigDecimal) map.get(i).get("drp"); // double drp = w.doubleValue(); // stcd = map.get(i).get("STCD").toString(); // //计算湿度 // if (j == 0) { // v1 = formatDouble1((num + drp) * 0.85); // if (v1 > 60) { // v1 = 60; // } // } else { // v1 += drp; // v1 = formatDouble1(v1 * 0.85); // if (v1 > 60) { // v1 = 60; // } // } // } // if (v1 > 60) { // mountainrainService.soleInster(stcd, "60"); // } else { // String a = String.valueOf(v1); // mountainrainService.soleInster(stcd, a); // } // } for (int i = 0; i < split.length; i++) { Integer num = 30; double v1 = 0; String stcd = null; for (int j = 0; j < passDaysList.size() - 2; j++) { List<Map<String, Object>> map = mountainrainService.selectMtwo(passDaysList.get(j).toString(), passDaysList.get(j + 1).toString(), code); if (map.size() == 0 || i > map.size() - 1) { break; } BigDecimal w = (BigDecimal) map.get(i).get("drp"); double drp = w.doubleValue(); stcd = map.get(i).get("STCD").toString(); //计算湿度 if (j == 0) { v1 = formatDouble1((num + drp) * 0.85); if (v1 > 60) { v1 = 60; } } else { v1 += drp; v1 = formatDouble1(v1 * 0.85); if (v1 > 60) { v1 = 60; } } } if (v1 > 60) { mountainrainService.soleInster(stcd, "60"); } else { String a = String.valueOf(v1); mountainrainService.soleInster(stcd, a); } } return R.success("成功"); } @@ -1121,6 +1140,7 @@ String[] split = s.split(","); String strArrays = ""; for (int i = 0; i < split.length; i++) { System.out.println(split.length); strArrays += "'" + split[i] + "',"; } String code = strArrays.substring(0, strArrays.length() - 1); @@ -1223,8 +1243,13 @@ e.printStackTrace(); } Process proc; Timestamp timestamp = new Timestamp(System.currentTimeMillis()); long url = timestamp.getTime(); Map m = new HashMap(); m.put("url", url + ".png"); String[] args1 = new String[]{"python", "D:\\fz\\mou.py", String.valueOf(url)}; try { proc = Runtime.getRuntime().exec("python D:\\fz\\mou.py"); proc = Runtime.getRuntime().exec(args1); BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = null; while ((line = in.readLine()) != null) { @@ -1237,6 +1262,7 @@ } catch (InterruptedException e) { e.printStackTrace(); } lists.add(m); return R.data(lists); } @@ -1263,8 +1289,9 @@ double drp1 = w1.doubleValue(); if (drp1 > 30) { double v = drp1 - 30; double v1 = (double) Math.round(v * 100) / 100; map.put("flage1", "true"); map.put("num", v); map.put("num", v1); } else { map.put("flage1", "false"); } @@ -1314,8 +1341,13 @@ e.printStackTrace(); } Process proc; Timestamp timestamp = new Timestamp(System.currentTimeMillis()); long url = timestamp.getTime(); Map m = new HashMap(); m.put("url", url + ".png"); String[] args1 = new String[]{"python", "D:\\fz\\moup.py", String.valueOf(url)}; try { proc = Runtime.getRuntime().exec("python D:\\fz\\moup.py"); proc = Runtime.getRuntime().exec(args1); BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = null; while ((line = in.readLine()) != null) { @@ -1328,6 +1360,7 @@ } catch (InterruptedException e) { e.printStackTrace(); } lists.add(m); return R.data(lists); } @@ -1475,8 +1508,13 @@ e.printStackTrace(); } Process proc; Timestamp timestamp = new Timestamp(System.currentTimeMillis()); long url = timestamp.getTime(); Map m = new HashMap(); m.put("url", url + ".png"); String[] args1 = new String[]{"python", "D:\\fz\\mou.py", String.valueOf(url)}; try { proc = Runtime.getRuntime().exec("python D:\\fz\\mou.py"); proc = Runtime.getRuntime().exec(args1); BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = null; while ((line = in.readLine()) != null) { @@ -1489,6 +1527,7 @@ } catch (InterruptedException e) { e.printStackTrace(); } lists.add(m); return R.data(lists); } @@ -1515,8 +1554,9 @@ double drp1 = w1.doubleValue(); if (drp1 > 50) { double v = drp1 - 50; double v1 = (double) Math.round(v * 100) / 100; map.put("flage2", "true"); map.put("num", v); map.put("num", v1); } else { map.put("flage2", "false"); } @@ -1566,8 +1606,13 @@ e.printStackTrace(); } Process proc; Timestamp timestamp = new Timestamp(System.currentTimeMillis()); long url = timestamp.getTime(); Map m = new HashMap(); m.put("url", url + ".png"); String[] args1 = new String[]{"python", "D:\\fz\\moup.py", String.valueOf(url)}; try { proc = Runtime.getRuntime().exec("python D:\\fz\\moup.py"); proc = Runtime.getRuntime().exec(args1); BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = null; while ((line = in.readLine()) != null) { @@ -1580,6 +1625,7 @@ } catch (InterruptedException e) { e.printStackTrace(); } lists.add(m); return R.data(lists); } @@ -1706,8 +1752,13 @@ e.printStackTrace(); } Process proc; Timestamp timestamp = new Timestamp(System.currentTimeMillis()); long url = timestamp.getTime(); Map m = new HashMap(); m.put("url", url + ".png"); String[] args1 = new String[]{"python", "D:\\fz\\mou.py", String.valueOf(url)}; try { proc = Runtime.getRuntime().exec("python D:\\fz\\mou.py"); proc = Runtime.getRuntime().exec(args1); BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = null; while ((line = in.readLine()) != null) { @@ -1720,6 +1771,7 @@ } catch (InterruptedException e) { e.printStackTrace(); } lists.add(m); return R.data(lists); } @@ -1746,8 +1798,9 @@ double drp1 = w1.doubleValue(); if (drp1 > 80) { double v = drp1 - 80; double v1 = (double) Math.round(v * 100) / 100; map.put("flage3", "true"); map.put("num", v); map.put("num", v1); } else { map.put("flage3", "false"); } @@ -1798,8 +1851,13 @@ e.printStackTrace(); } Process proc; Timestamp timestamp = new Timestamp(System.currentTimeMillis()); long url = timestamp.getTime(); Map m = new HashMap(); m.put("url", url + ".png"); String[] args1 = new String[]{"python", "D:\\fz\\moup.py", String.valueOf(url)}; try { proc = Runtime.getRuntime().exec("python D:\\fz\\moup.py"); proc = Runtime.getRuntime().exec(args1); BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = null; while ((line = in.readLine()) != null) { @@ -1812,6 +1870,7 @@ } catch (InterruptedException e) { e.printStackTrace(); } lists.add(m); return R.data(lists); } @@ -1821,7 +1880,7 @@ * 土壤色斑图 */ @GetMapping("/selectS") public void selectS(){ public R selectS() { List<Map<String, Object>> list = mountainrainService.selectS(); String fileName = ""; // 第一步,创建一个webbook,对应一个Excel文件 @@ -1847,47 +1906,47 @@ row.createCell((short) 0).setCellValue(list.get(i).get("LGTD").toString()); row.createCell((short) 1).setCellValue(list.get(i).get("LTTD").toString()); row.createCell((short) 2).setCellValue(list.get(i).get("soilval").toString()); if (stcd.equals("62455350")){ if (stcd.equals("62455350")) { row.createCell((short) 0).setCellValue("117.344876"); row.createCell((short) 1).setCellValue("27.827067"); row.createCell((short) 2).setCellValue(list.get(i).get("soilval").toString()); } if (stcd.equals("62334845")){ if (stcd.equals("62334845")) { row.createCell((short) 0).setCellValue("115.625720"); row.createCell((short) 1).setCellValue("27.152794"); row.createCell((short) 2).setCellValue(list.get(i).get("soilval").toString()); } if (stcd.equals("62433800")){ if (stcd.equals("62433800")) { row.createCell((short) 0).setCellValue("115.618546"); row.createCell((short) 1).setCellValue("27.683604"); row.createCell((short) 2).setCellValue(list.get(i).get("soilval").toString()); } if (stcd.equals("62436760")){ if (stcd.equals("62436760")) { row.createCell((short) 0).setCellValue("116.060889"); row.createCell((short) 1).setCellValue("28.216806"); row.createCell((short) 2).setCellValue(list.get(i).get("soilval").toString()); } if (stcd.equals("62437250")){ if (stcd.equals("62437250")) { row.createCell((short) 0).setCellValue("116.622783"); row.createCell((short) 1).setCellValue("28.489384"); row.createCell((short) 2).setCellValue(list.get(i).get("soilval").toString()); } if (stcd.equals("62433700")){ if (stcd.equals("62433700")) { row.createCell((short) 0).setCellValue("115.558771"); row.createCell((short) 1).setCellValue("27.518623"); row.createCell((short) 2).setCellValue(list.get(i).get("soilval").toString()); } if (stcd.equals("62425740")){ if (stcd.equals("62425740")) { row.createCell((short) 0).setCellValue("117.208587"); row.createCell((short) 1).setCellValue("27.298647"); row.createCell((short) 2).setCellValue(list.get(i).get("soilval").toString()); } if (stcd.equals("62437235")){ if (stcd.equals("62437235")) { row.createCell((short) 0).setCellValue("116.780591"); row.createCell((short) 1).setCellValue("28.391352"); row.createCell((short) 2).setCellValue(list.get(i).get("soilval").toString()); } if (stcd.equals("62437250")){ if (stcd.equals("62437250")) { row.createCell((short) 0).setCellValue("116.555834"); row.createCell((short) 1).setCellValue("28.518077"); row.createCell((short) 2).setCellValue(list.get(i).get("soilval").toString()); @@ -1904,8 +1963,13 @@ e.printStackTrace(); } Process proc; Timestamp timestamp = new Timestamp(System.currentTimeMillis()); long url = timestamp.getTime(); Map m = new HashMap(); m.put("url", url + ".png"); String[] args1 = new String[]{"python", "D:\\fz\\tur.py", String.valueOf(url)}; try { proc = Runtime.getRuntime().exec("python D:\\fz\\tur.py"); proc = Runtime.getRuntime().exec(args1); BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = null; while ((line = in.readLine()) != null) { @@ -1918,7 +1982,9 @@ } catch (InterruptedException e) { e.printStackTrace(); } return R.data(m); } } } src/main/java/org/springblade/modules/mountainrain/controller/SmariverController.java
New file @@ -0,0 +1,136 @@ /** * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springblade.modules.mountainrain.controller; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.log.annotation.ApiLog; import org.springblade.core.mp.support.Condition; import org.springblade.core.tool.api.R; import org.springblade.modules.mountainrain.entity.Yucbig; import org.springblade.modules.mountainrain.entity.Yucsma; import org.springblade.modules.mountainrain.excel.BgrExcel; import org.springblade.modules.mountainrain.excel.BgrImporter; import org.springblade.modules.mountainrain.excel.MgrExcel; import org.springblade.modules.mountainrain.excel.MgrImporter; import org.springblade.modules.mountainrain.service.ISmariverService; import org.springblade.modules.mountainrain.wrapper.BigriverWrapper; import org.springblade.modules.mountainrain.wrapper.SmariverWrapper; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.validation.Valid; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; /** * 控制器 * * @author Blade * @since 2019-11-07 */ @RestController @AllArgsConstructor @RequestMapping("/smariver") @Api(value = "", tags = "接口") public class SmariverController extends BladeController { private ISmariverService iSmariverService; /** * 详情 */ @ApiLog("详情") @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "site") public R<Yucsma> detail(Yucsma yucsma) { Yucsma detail = iSmariverService.getOne(Condition.getQueryWrapper(yucsma)); return R.data(SmariverWrapper.build().entityVO(detail)); } /** * 新增 */ @ApiLog("新增") @PostMapping("/save") @ApiOperationSupport(order = 4) @ApiOperation(value = "新增", notes = "传入site") public R save(@Valid @RequestBody Yucsma yucsma) { return R.status(iSmariverService.save(yucsma)); } /** * 修改 */ @ApiLog("修改") @PostMapping("/update") @ApiOperationSupport(order = 5) @ApiOperation(value = "修改", notes = "传入site") public R update(@Valid @RequestBody Yucsma yucsma) { return R.status(iSmariverService.updateById(yucsma)); } /** * 中小河流预报数据导入 */ @PostMapping("import-mgr") public R importmgr(MultipartFile file) { MgrImporter mgrImporter = new MgrImporter(iSmariverService, false); ExcelUtil.save(file, mgrImporter, MgrExcel.class); return R.success("操作成功"); } /** * 中小河流预警 * * @return */ @GetMapping("/selectsmriver") public R selectsmriver() { List<Map<String, Object>> selctsmriver = iSmariverService.selctsmriver(); //预警数据 List listyj = new ArrayList(); //无预警数据 List listzc = new ArrayList(); for (int i = 0; i < selctsmriver.size(); i++) { //警戒水位 String yjsw = selctsmriver.get(i).get("yjsw").toString(); Double yjz = Double.parseDouble(yjsw); //水位 String zs = selctsmriver.get(i).get("yuz").toString(); Double z = Double.parseDouble(zs); if (z > yjz) { listyj.add(selctsmriver.get(i)); } else { listzc.add(selctsmriver.get(i)); } } Map map = new HashMap(); map.put("yj", listyj); map.put("zc", listzc); List list = new ArrayList(); list.add(map); return R.data(list); } } src/main/java/org/springblade/modules/mountainrain/controller/ss.java
@@ -45,7 +45,7 @@ for (int j = 0; j < passDaysList.size() - 2; j++) { List<Map<String, Object>> map = mountainrainService.selectMtwo(passDaysList.get(j).toString(), passDaysList.get(j + 1).toString(), code); if (map.size() == 0 || i > map.size() - 1) { stcd=split[i]; //stcd=split[i]; break; } BigDecimal w = (BigDecimal) map.get(i).get("drp"); src/main/java/org/springblade/modules/mountainrain/entity/Yucbig.java
New file @@ -0,0 +1,61 @@ package org.springblade.modules.mountainrain.entity; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @TableName("sys_Yucbig") @ApiModel(value = "Yucbig对象", description = "Yucbig对象") public class Yucbig { /** * 站码 */ @ApiModelProperty(value = "站码") private String stcd; /** * 站名 */ @ApiModelProperty(value = "站名") private String stname; /** * 河名 */ @ApiModelProperty(value = "河名") private String river; /** * 发布时间 */ @ApiModelProperty(value = "发布时间") private String ftime; /** * 预测时间 */ @ApiModelProperty(value = "预测时间") private String ytime; /** * 预报水位 */ @ApiModelProperty(value = "预报水位") private String yuz; /** * 预警水位 */ @ApiModelProperty(value = "预警水位") private String yjsw; /** * 预警流量 */ @ApiModelProperty(value = "预警流量") private String yq; } src/main/java/org/springblade/modules/mountainrain/entity/Yucsma.java
New file @@ -0,0 +1,61 @@ package org.springblade.modules.mountainrain.entity; import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @TableName("sys_Yucsma") @ApiModel(value = "Yucsma对象", description = "Yucsma对象") public class Yucsma { /** * 站码 */ @ApiModelProperty(value = "站码") private String stcd; /** * 站名 */ @ApiModelProperty(value = "站名") private String stname; /** * 河名 */ @ApiModelProperty(value = "河名") private String river; /** * 发布时间 */ @ApiModelProperty(value = "发布时间") private String ftime; /** * 预测时间 */ @ApiModelProperty(value = "预测时间") private String ytime; /** * 预报水位 */ @ApiModelProperty(value = "预报水位") private String yuz; /** * 预警水位 */ @ApiModelProperty(value = "预警水位") private String yjsw; /** * 预警流量 */ @ApiModelProperty(value = "预警流量") private String yq; } src/main/java/org/springblade/modules/mountainrain/excel/BgrExcel.java
New file @@ -0,0 +1,72 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.mountainrain.excel; import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ContentRowHeight; import com.alibaba.excel.annotation.write.style.HeadRowHeight; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * UserExcel * * @author Chill */ @Data @ColumnWidth(25) @HeadRowHeight(20) @ContentRowHeight(18) public class BgrExcel implements Serializable { private static final long serialVersionUID = 1L; @ColumnWidth(15) @ExcelProperty("河名") private String river; @ExcelProperty("站名") private String stname; @ColumnWidth(20) @ExcelProperty("站码") private String stcd; @ColumnWidth(15) @ExcelProperty("发布时间") private String ftime; @ColumnWidth(10) @ExcelProperty("预测时间") private String ytime; @ColumnWidth(10) @ExcelProperty("预测水位") private String yuz; @ColumnWidth(15) @ExcelProperty("预测流量") private String yq; @ExcelProperty("预警水位") private String yjsw; } src/main/java/org/springblade/modules/mountainrain/excel/BgrImporter.java
New file @@ -0,0 +1,43 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.mountainrain.excel; import lombok.RequiredArgsConstructor; import org.springblade.core.excel.support.ExcelImporter; import org.springblade.modules.mountainrain.service.IBigriverService; import org.springblade.modules.mountainrain.service.IMountainrainService; import org.springblade.modules.system.excel.UserExcel; import org.springblade.modules.system.service.IUserService; import java.util.List; /** * 用户数据导入类 * * @author Chill */ @RequiredArgsConstructor public class BgrImporter implements ExcelImporter<BgrExcel> { private final IBigriverService service; private final Boolean isCovered; @Override public void save(List<BgrExcel> data) { service.importBgr(data, isCovered); } } src/main/java/org/springblade/modules/mountainrain/excel/MgrExcel.java
New file @@ -0,0 +1,71 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.mountainrain.excel; import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ContentRowHeight; import com.alibaba.excel.annotation.write.style.HeadRowHeight; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * UserExcel * * @author Chill */ @Data @ColumnWidth(25) @HeadRowHeight(20) @ContentRowHeight(18) public class MgrExcel implements Serializable { private static final long serialVersionUID = 1L; @ColumnWidth(15) @ExcelProperty("河名") private String river; @ExcelProperty("站名") private String stname; @ColumnWidth(20) @ExcelProperty("站码") private String stcd; @ColumnWidth(15) @ExcelProperty("发布时间") private String ftime; @ColumnWidth(10) @ExcelProperty("预测时间") private String ytime; @ColumnWidth(10) @ExcelProperty("预测水位") private String yuz; @ColumnWidth(15) @ExcelProperty("预测流量") private String yq; @ExcelProperty("预警水位") private String yjsw; } src/main/java/org/springblade/modules/mountainrain/excel/MgrImporter.java
New file @@ -0,0 +1,41 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.mountainrain.excel; import lombok.RequiredArgsConstructor; import org.springblade.core.excel.support.ExcelImporter; import org.springblade.modules.mountainrain.service.IMountainrainService; import org.springblade.modules.mountainrain.service.ISmariverService; import java.util.List; /** * 用户数据导入类 * * @author Chill */ @RequiredArgsConstructor public class MgrImporter implements ExcelImporter<MgrExcel> { private final ISmariverService service; private final Boolean isCovered; @Override public void save(List<MgrExcel> data) { service.importMgr(data, isCovered); } } src/main/java/org/springblade/modules/mountainrain/mapper/BigriverMapper.java
New file @@ -0,0 +1,38 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.mountainrain.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.Param; import org.springblade.modules.mountainrain.entity.Mountainrain; import org.springblade.modules.mountainrain.entity.Yucbig; import org.springblade.modules.mountainrain.entity.Yucpptn; import org.springblade.modules.mountainrain.vo.*; import java.util.List; import java.util.Map; /** * Mapper 接口 * * @author BladeX * @since 2020-02-27 */ public interface BigriverMapper extends BaseMapper<Yucbig> { List<Map<String, Object>> selctbgriver(); } src/main/java/org/springblade/modules/mountainrain/mapper/BigriverMapper.xml
New file @@ -0,0 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.springblade.modules.mountainrain.mapper.BigriverMapper"> <!--大江大河--> <select id="selctbgriver" resultType="java.util.Map"> SELECT cs1.stcd, cs1.ftime, cs1.ytime, cs1.yuz, cs1.yjsw, cs1.stname, cs1.river, st.LGTD, st.LTTD FROM ( SELECT A.stcd, MAX(A.ftime) TM FROM (SELECT stcd, ftime FROM sys_Yucbig) AS A GROUP BY A.stcd ) cs INNER JOIN (SELECT stcd, stname, ftime, ytime, yuz, yjsw, river FROM sys_Yucbig) cs1 ON cs.stcd = cs1.stcd INNER JOIN (SELECT LGTD, LTTD, STCD FROM ST_STBPRP_B) st ON st.STCD = cs1.stcd </select> </mapper> src/main/java/org/springblade/modules/mountainrain/mapper/SmariverMapper.java
New file @@ -0,0 +1,34 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.mountainrain.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.springblade.modules.mountainrain.entity.Yucbig; import org.springblade.modules.mountainrain.entity.Yucsma; import java.util.List; import java.util.Map; /** * Mapper 接口 * * @author BladeX * @since 2020-02-27 */ public interface SmariverMapper extends BaseMapper<Yucsma> { List<Map<String, Object>> selctsmriver(); } src/main/java/org/springblade/modules/mountainrain/mapper/SmariverMapper.xml
New file @@ -0,0 +1,26 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.springblade.modules.mountainrain.mapper.BigriverMapper"> <!--中小河流--> <select id="selctsmriver" resultType="java.util.Map"> SELECT cs1.stcd, cs1.ftime, cs1.ytime, cs1.yuz, cs1.yjsw, cs1.stname, cs1.river, st.LGTD, st.LTTD FROM ( SELECT A.stcd, MAX(A.ftime) TM FROM (SELECT stcd, ftime FROM sys_Yucbig) AS A GROUP BY A.stcd ) cs INNER JOIN (SELECT stcd, stname, ftime, ytime, yuz, yjsw, river FROM sys_Yucbig) cs1 ON cs.stcd = cs1.stcd INNER JOIN (SELECT LGTD, LTTD, STCD FROM ST_STBPRP_B) st ON st.STCD = cs1.stcd </select> </mapper> src/main/java/org/springblade/modules/mountainrain/service/IBigriverService.java
New file @@ -0,0 +1,49 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.mountainrain.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import org.springblade.core.mp.support.Query; import org.springblade.modules.mountainrain.entity.Mountainrain; import org.springblade.modules.mountainrain.entity.Yucbig; import org.springblade.modules.mountainrain.entity.Yucpptn; import org.springblade.modules.mountainrain.excel.BgrExcel; import org.springblade.modules.mountainrain.excel.MgrExcel; import org.springblade.modules.mountainrain.vo.*; import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; /** * 服务类 * * @author BladeX * @since 2020-02-27 */ public interface IBigriverService extends IService<Yucbig> { /** * 导入用户数据 * * @param data * @param isCovered * @return */ void importBgr(List<BgrExcel> data, Boolean isCovered); List<Map<String, Object>> selctbgriver(); } src/main/java/org/springblade/modules/mountainrain/service/IMountainrainService.java
@@ -21,7 +21,10 @@ import org.springblade.core.mp.support.Query; import org.springblade.modules.mountainrain.entity.Mountainrain; import org.springblade.modules.mountainrain.entity.Yucpptn; import org.springblade.modules.mountainrain.excel.BgrExcel; import org.springblade.modules.mountainrain.excel.MgrExcel; import org.springblade.modules.mountainrain.vo.*; import org.springblade.modules.system.excel.UserExcel; import org.springframework.web.multipart.MultipartFile; import java.util.List; src/main/java/org/springblade/modules/mountainrain/service/ISmariverService.java
New file @@ -0,0 +1,37 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.mountainrain.service; import com.baomidou.mybatisplus.extension.service.IService; import org.springblade.modules.mountainrain.entity.Yucbig; import org.springblade.modules.mountainrain.entity.Yucsma; import org.springblade.modules.mountainrain.excel.BgrExcel; import org.springblade.modules.mountainrain.excel.MgrExcel; import java.util.List; import java.util.Map; /** * 服务类 * * @author BladeX * @since 2020-02-27 */ public interface ISmariverService extends IService<Yucsma> { void importMgr(List<MgrExcel> data, Boolean isCovered); List<Map<String, Object>> selctsmriver(); } src/main/java/org/springblade/modules/mountainrain/service/impl/BigriverServiceImpl.java
New file @@ -0,0 +1,81 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.mountainrain.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.modules.mountain.entity.Mountain; import org.springblade.modules.mountain.service.IMountainService; import org.springblade.modules.mountainrain.entity.Mountainrain; import org.springblade.modules.mountainrain.entity.Yucbig; import org.springblade.modules.mountainrain.entity.Yucpptn; import org.springblade.modules.mountainrain.excel.BgrExcel; import org.springblade.modules.mountainrain.excel.MgrExcel; import org.springblade.modules.mountainrain.mapper.BigriverMapper; import org.springblade.modules.mountainrain.mapper.MountainrainMapper; import org.springblade.modules.mountainrain.service.IBigriverService; import org.springblade.modules.mountainrain.service.IMountainrainService; import org.springblade.modules.mountainrain.vo.*; import org.springblade.modules.mountainrain.wrapper.MountainrainWrapper; import org.springblade.modules.system.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import java.io.InputStream; import java.text.DecimalFormat; import java.util.List; import java.util.Map; import java.util.Objects; /** * 服务实现类 * * @author BladeX * @since 2020-02-27 */ @Service @DS("slaves") public class BigriverServiceImpl extends ServiceImpl<BigriverMapper, Yucbig> implements IBigriverService { @Autowired private IBigriverService iBigriverService; @Override @Transactional(rollbackFor = Exception.class) public void importBgr(List<BgrExcel> data, Boolean isCovered) { data.forEach(BgrExcel -> { Yucbig yucbig = Objects.requireNonNull(BeanUtil.copy(BgrExcel, Yucbig.class)); iBigriverService.save(yucbig); }); } @Override public List<Map<String, Object>> selctbgriver() { return baseMapper.selctbgriver(); } } src/main/java/org/springblade/modules/mountainrain/service/impl/MountainrainServiceImpl.java
@@ -25,24 +25,41 @@ import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springblade.common.cache.DictCache; import org.springblade.common.cache.ParamCache; import org.springblade.common.cache.SysCache; import org.springblade.common.cache.UserCache; import org.springblade.common.enums.DictEnum; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; import org.springblade.modules.mountain.entity.Mountain; import org.springblade.modules.mountain.service.IMountainService; import org.springblade.modules.mountainrain.entity.Mountainrain; import org.springblade.modules.mountainrain.entity.Yucpptn; import org.springblade.modules.mountainrain.excel.BgrExcel; import org.springblade.modules.mountainrain.excel.MgrExcel; import org.springblade.modules.mountainrain.mapper.MountainrainMapper; import org.springblade.modules.mountainrain.service.IMountainrainService; import org.springblade.modules.mountainrain.vo.*; import org.springblade.modules.mountainrain.wrapper.MountainrainWrapper; import org.springblade.modules.system.entity.User; import org.springblade.modules.system.excel.UserExcel; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; import java.io.InputStream; import java.text.DecimalFormat; import java.util.List; import java.util.Map; import java.util.Objects; import static org.springblade.common.constant.CommonConstant.DEFAULT_PARAM_PASSWORD; /** * 服务实现类 @@ -495,6 +512,14 @@ baseMapper.del(); } @Override @Transactional(rollbackFor = Exception.class) public void importMgr(List<MgrExcel> data, Boolean isCovered) { data.forEach(MgrExcel -> { User user = Objects.requireNonNull(BeanUtil.copy(MgrExcel, User.class)); }); } /* * 计算最大值 src/main/java/org/springblade/modules/mountainrain/service/impl/SmariverServiceImpl.java
New file @@ -0,0 +1,64 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.mountainrain.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.modules.mountainrain.entity.Yucbig; import org.springblade.modules.mountainrain.entity.Yucsma; import org.springblade.modules.mountainrain.excel.BgrExcel; import org.springblade.modules.mountainrain.excel.MgrExcel; import org.springblade.modules.mountainrain.mapper.BigriverMapper; import org.springblade.modules.mountainrain.mapper.SmariverMapper; import org.springblade.modules.mountainrain.service.IBigriverService; import org.springblade.modules.mountainrain.service.ISmariverService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; import java.util.Objects; /** * 服务实现类 * * @author BladeX * @since 2020-02-27 */ @Service @DS("slaves") public class SmariverServiceImpl extends ServiceImpl<SmariverMapper, Yucsma> implements ISmariverService { @Autowired private ISmariverService iSmariverService; @Override public void importMgr(List<MgrExcel> data, Boolean isCovered) { data.forEach(MgrExcel -> { Yucsma yucsma = Objects.requireNonNull(BeanUtil.copy(MgrExcel, Yucsma.class)); iSmariverService.save(yucsma); }); } @Override public List<Map<String, Object>> selctsmriver() { return baseMapper.selctsmriver(); } } src/main/java/org/springblade/modules/mountainrain/vo/BigriverVO.java
New file @@ -0,0 +1,11 @@ package org.springblade.modules.mountainrain.vo; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.modules.mountain.entity.Mountain; import org.springblade.modules.mountainrain.entity.Yucbig; @Data @EqualsAndHashCode(callSuper = true) public class BigriverVO extends Yucbig { } src/main/java/org/springblade/modules/mountainrain/vo/SmariverVO.java
New file @@ -0,0 +1,11 @@ package org.springblade.modules.mountainrain.vo; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.modules.mountainrain.entity.Yucbig; import org.springblade.modules.mountainrain.entity.Yucsma; @Data @EqualsAndHashCode(callSuper = true) public class SmariverVO extends Yucsma { } src/main/java/org/springblade/modules/mountainrain/wrapper/BigriverWrapper.java
New file @@ -0,0 +1,45 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.mountainrain.wrapper; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.modules.mountainrain.entity.Mountainrain; import org.springblade.modules.mountainrain.entity.Yucbig; import org.springblade.modules.mountainrain.vo.BigriverVO; import org.springblade.modules.mountainrain.vo.MountainrainVO; /** * 包装类,返回视图层所需的字段 * * @author BladeX * @since 2020-02-27 */ public class BigriverWrapper extends BaseEntityWrapper<Yucbig, BigriverVO> { public static BigriverWrapper build() { return new BigriverWrapper(); } @Override public BigriverVO entityVO(Yucbig yucbig) { BigriverVO bigriverVO = BeanUtil.copy(yucbig, BigriverVO.class); return bigriverVO; } } src/main/java/org/springblade/modules/mountainrain/wrapper/SmariverWrapper.java
New file @@ -0,0 +1,45 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.mountainrain.wrapper; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.modules.mountainrain.entity.Yucbig; import org.springblade.modules.mountainrain.entity.Yucsma; import org.springblade.modules.mountainrain.vo.BigriverVO; import org.springblade.modules.mountainrain.vo.SmariverVO; /** * 包装类,返回视图层所需的字段 * * @author BladeX * @since 2020-02-27 */ public class SmariverWrapper extends BaseEntityWrapper<Yucsma, SmariverVO> { public static SmariverWrapper build() { return new SmariverWrapper(); } @Override public SmariverVO entityVO(Yucsma yucsma) { SmariverVO smariverVO = BeanUtil.copy(yucsma, SmariverVO.class); return smariverVO; } } src/main/java/org/springblade/modules/regionWeight/controller/RegionWeightController.java
@@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.*; import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Map.Entry; @@ -772,7 +773,6 @@ String s = regionWeightService.selectCode(); String[] split = s.split(","); String strArrays = ""; System.out.println("数量:"+split.length); for (int i = 0; i < split.length; i++) { strArrays += "'" + split[i] + "',"; } @@ -941,8 +941,13 @@ e.printStackTrace(); } Process proc; Timestamp timestamp = new Timestamp(System.currentTimeMillis()); long url=timestamp.getTime(); Map m= new HashMap(); m.put("url",url+".png"); String[] args1=new String[]{"python","D:\\fz\\fz.py", String.valueOf(url)}; try { proc = Runtime.getRuntime().exec("python D:\\fz\\fz.py"); proc = Runtime.getRuntime().exec(args1); BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line = null; while ((line = in.readLine()) != null) { @@ -955,6 +960,7 @@ } catch (InterruptedException e) { e.printStackTrace(); } lists.add(m); return R.data(lists); } src/main/java/org/springblade/modules/river/mapper/RiverRMapper.xml
@@ -91,7 +91,7 @@ <!--河道自定义预警测试接口--> <select id="selecthdcs" resultType="java.util.HashMap"> SELECT cs.STCD, cs.TM, cs1.TM, cs1.Z, cs1.Q, cs2.STNM, @@ -103,7 +103,6 @@ cs4.minZ FROM ( SELECT A.STCD, MAX(A.TM) TM, s.ADDVCD FROM (SELECT STCD, TM, Z, Q FROM dbo.ST_RIVER_R @@ -124,7 +123,6 @@ FROM dbo.ST_RIVER_R WHERE TM > #{beginTime} AND TM <= #{endTime}) cs1 ON cs.STCD = cs1.STCD AND cs.TM = cs1.TM INNER JOIN (SELECT STCD, STNM, LTTD, LGTD, ADDVCD, STTP FROM dbo.ST_STBPRP_B WHERE STTP = 'ZZ' @@ -142,7 +140,7 @@ AND TM <= #{endTime} GROUP BY STCD) cs4 ON cs4.STCD = cs.STCD GROUP BY cs.STCD, cs.TM, cs1.TM, cs1.Z, cs2.STNM, ad.ADDVNM, @@ -151,7 +149,7 @@ cs1.Q, rv.WRZ, cs3.maxZ, cs4.minZ cs4.minZ ORDER BY cs1.Z desc </select> <!--河道最新超警信息--> src/main/java/org/springblade/modules/rsvr/controller/RsvrRController.java
@@ -172,17 +172,17 @@ edmd = e2; } } // String s = rsvrRService.selectCode(beginTime, endTime); // String[] split = s.split(","); // String strArrays = ""; // for (int i = 0; i < split.length; i++) { // strArrays += "'" + split[i] + "',"; // } // String code = strArrays.substring(0, strArrays.length() - 1); String s = rsvrRService.selectCode(beginTime, endTime); String[] split = s.split(","); String strArrays = ""; for (int i = 0; i < split.length; i++) { strArrays += "'" + split[i] + "',"; } String code = strArrays.substring(0, strArrays.length() - 1); //水库水情预警信息 List<Map<String, Object>> map = rsvrRService.selectyjck(egmd, edmd, beginTime, endTime); // List<Map<String, Object>> sel = rsvrRService.sel(egmd, edmd, code); // map.addAll(sel); List<Map<String, Object>> sel = rsvrRService.sel(egmd, edmd, code); map.addAll(sel); //用来判断是否重复统计超警信息 Map mnum = new HashMap(); Map mnums = new HashMap();