8 files modified
20 files added
| | |
| | | secureRegistry.excludePathPatterns("/riverway/**"); |
| | | secureRegistry.excludePathPatterns("/site/**"); |
| | | secureRegistry.excludePathPatterns("/stbprpb/**"); |
| | | secureRegistry.excludePathPatterns("/bigriver/**"); |
| | | secureRegistry.excludePathPatterns("/smariver/**"); |
| | | return secureRegistry; |
| | | } |
| | | |
| New file |
| | |
| | | /** |
| | | * 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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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.*; |
| | |
| | | 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) { |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | lists.add(m); |
| | | return R.data(lists); |
| | | |
| | | } |
| | |
| | | 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) { |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | lists.add(m); |
| | | return R.data(lists); |
| | | } |
| | | |
| | |
| | | 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("成功"); |
| | | } |
| | |
| | | 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); |
| | |
| | | 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) { |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | lists.add(m); |
| | | return R.data(lists); |
| | | |
| | | } |
| | |
| | | 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"); |
| | | } |
| | |
| | | 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) { |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | lists.add(m); |
| | | return R.data(lists); |
| | | } |
| | | |
| | |
| | | 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) { |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | lists.add(m); |
| | | return R.data(lists); |
| | | |
| | | } |
| | |
| | | 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"); |
| | | } |
| | |
| | | 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) { |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | lists.add(m); |
| | | return R.data(lists); |
| | | } |
| | | |
| | |
| | | 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) { |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | lists.add(m); |
| | | return R.data(lists); |
| | | |
| | | } |
| | |
| | | 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"); |
| | | } |
| | |
| | | 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) { |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | lists.add(m); |
| | | return R.data(lists); |
| | | } |
| | | |
| | |
| | | * 土壤色斑图 |
| | | */ |
| | | @GetMapping("/selectS") |
| | | public void selectS(){ |
| | | public R selectS() { |
| | | List<Map<String, Object>> list = mountainrainService.selectS(); |
| | | String fileName = ""; |
| | | // 第一步,创建一个webbook,对应一个Excel文件 |
| | |
| | | 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) { |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return R.data(m); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| New file |
| | |
| | | /** |
| | | * 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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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"); |
| New file |
| | |
| | | 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; |
| | | } |
| New file |
| | |
| | | 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; |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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(); |
| | | } |
| New file |
| | |
| | | <?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> |
| New file |
| | |
| | | /* |
| | | * 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(); |
| | | } |
| New file |
| | |
| | | <?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> |
| New file |
| | |
| | | /* |
| | | * 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(); |
| | | } |
| | |
| | | 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; |
| New file |
| | |
| | | /* |
| | | * 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(); |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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(); |
| | | } |
| | | } |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | |
| | | 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)); |
| | | }); |
| | | } |
| | | |
| | | |
| | | /* |
| | | * 计算最大值 |
| New file |
| | |
| | | /* |
| | | * 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(); |
| | | } |
| | | } |
| New file |
| | |
| | | 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 { |
| | | } |
| New file |
| | |
| | | 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 { |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | 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] + "',"; |
| | | } |
| | |
| | | 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) { |
| | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | lists.add(m); |
| | | return R.data(lists); |
| | | } |
| | | |
| | |
| | | <!--河道自定义预警测试接口--> |
| | | <select id="selecthdcs" resultType="java.util.HashMap"> |
| | | SELECT cs.STCD, |
| | | cs.TM, |
| | | cs1.TM, |
| | | cs1.Z, |
| | | cs1.Q, |
| | | cs2.STNM, |
| | |
| | | cs4.minZ |
| | | FROM ( |
| | | SELECT A.STCD, |
| | | MAX(A.TM) TM, |
| | | s.ADDVCD |
| | | FROM (SELECT STCD, TM, Z, Q |
| | | FROM dbo.ST_RIVER_R |
| | |
| | | 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' |
| | |
| | | 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, |
| | |
| | | cs1.Q, |
| | | rv.WRZ, |
| | | cs3.maxZ, |
| | | cs4.minZ |
| | | cs4.minZ ORDER BY cs1.Z desc |
| | | </select> |
| | | |
| | | <!--河道最新超警信息--> |
| | |
| | | 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(); |