|
@@ -1,12 +1,15 @@
|
|
|
package com.huimv.env.produce.controller;
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.RandomUtil;
|
|
|
import com.huimv.common.utils.Result;
|
|
|
+import com.huimv.common.utils.ResultCode;
|
|
|
import com.huimv.env.produce.service.DataSourceService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@@ -23,6 +26,28 @@ public class DataSourceController {
|
|
|
@Autowired
|
|
|
private DataSourceService dataSourceService;
|
|
|
|
|
|
+
|
|
|
+ //查询
|
|
|
+ @PostMapping("/getLastEnviron")
|
|
|
+ public Result getLastEnviron() {
|
|
|
+ Map map = new HashMap();
|
|
|
+ //ph
|
|
|
+ map.put("phPj","7."+getRandom(0,1000));
|
|
|
+ //cod
|
|
|
+ map.put("hxxylPj","210."+getRandom(0,1000));
|
|
|
+ //总磷
|
|
|
+ map.put("lin","4."+getRandom(0,10));
|
|
|
+ //总氮
|
|
|
+ map.put("dan","11."+getRandom(0,10));
|
|
|
+ //污水流量
|
|
|
+ map.put("water","7."+getRandom(0,1000));
|
|
|
+ //氨氮
|
|
|
+ map.put("ad","0.0"+getRandom(0,100));
|
|
|
+ return new Result(ResultCode.SUCCESS,map);
|
|
|
+ }
|
|
|
+ public static Integer getRandom(Integer min,Integer max){
|
|
|
+ return RandomUtil.randomInt(min, max);
|
|
|
+ }
|
|
|
//查询
|
|
|
@PostMapping("/getDataSource")
|
|
|
public Result getDataSource(@RequestBody Map<String, String> paramsMap) throws ParseException {
|