|
@@ -313,4 +313,77 @@ public class HandleDataController extends BaseController
|
|
|
}
|
|
|
return "ok";
|
|
|
}
|
|
|
+
|
|
|
+ //下面是新的 将一个小时的数据 更新到一个小时之内的所有的数据中
|
|
|
+ @GetMapping("/dateUpdateCLMinute")
|
|
|
+ public String dateUpdateCLMinute() {
|
|
|
+ String fileName = "除磷加药瞬时流量";
|
|
|
+ //输入目录
|
|
|
+ ExcelReader reader = ExcelUtil.getReader("C:\\Users\\10109\\Desktop\\新程序\\" + fileName + ".xls");
|
|
|
+ //解析数据
|
|
|
+ List<List<Object>> readAll = reader.read();
|
|
|
+ int i = 0;
|
|
|
+ if(!CollectionUtils.isEmpty(readAll)){
|
|
|
+ for (List<Object> objects : readAll) {
|
|
|
+ if(!Objects.isNull(objects.get(0)) && !Objects.isNull(objects.get(1))){
|
|
|
+ String beginTime = "20" + objects.get(0) + " " + objects.get(1).toString().substring(0, 5);
|
|
|
+ System.out.println("beginTime = " + beginTime);
|
|
|
+ String endTime = "20" + objects.get(0) + " " + objects.get(1).toString().substring(0, 3) + "59";
|
|
|
+ System.out.println("endTime = " + endTime);
|
|
|
+ //更新数据
|
|
|
+ System.out.println(objects.get(2));
|
|
|
+ //有特殊情况
|
|
|
+ if(Objects.isNull(objects.get(2)) || objects.get(2).toString().contains("-")){
|
|
|
+ System.out.println("存在特殊的情况,值包含-,不做更新");
|
|
|
+ i++;
|
|
|
+ }else{
|
|
|
+ this.xinyiIndustryMapper.updateTXinyiIndustryCLByBetweenTime(beginTime, endTime, new BigDecimal(String.valueOf(objects.get(2))));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("i = " + i);
|
|
|
+ return "ok";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/dateUpdateSJTYMinute")
|
|
|
+ public String dateUpdateSJTYMinute() {
|
|
|
+ String fileName = "信义污水厂实际碳源加药量";
|
|
|
+ //输入目录
|
|
|
+ ExcelReader reader = ExcelUtil.getReader("C:\\Users\\10109\\Desktop\\新程序\\" + fileName + ".xls");
|
|
|
+ //解析数据
|
|
|
+ List<List<Object>> readAll = reader.read();
|
|
|
+ if(!CollectionUtils.isEmpty(readAll)){
|
|
|
+ int i = 0;
|
|
|
+ for (List<Object> objects : readAll) {
|
|
|
+ String beginTime = "";
|
|
|
+ if(objects.get(0) instanceof String){
|
|
|
+ System.out.println("----------是字符串类型的");
|
|
|
+ String time = ((String) objects.get(0));
|
|
|
+// System.out.println("time = " + time);
|
|
|
+ beginTime = time.replaceAll("-", "/").substring(0, 16);
|
|
|
+ }else if (objects.get(0) instanceof cn.hutool.core.date.DateTime){
|
|
|
+ System.out.println("++++++++++是日期类型的");
|
|
|
+ cn.hutool.core.date.DateTime time = (DateTime) objects.get(0);
|
|
|
+// System.out.println("time = " + time);
|
|
|
+ beginTime = DateUtil.format(time, DateUtils.YYYYMMDDHHMM_TS);
|
|
|
+ System.out.println("beginTime = " + beginTime);
|
|
|
+ }else {
|
|
|
+ System.out.println(JSON.toJSONString(objects));
|
|
|
+ beginTime = "";
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ //endTime
|
|
|
+ String endTime = beginTime.substring(0, 14) + "59";
|
|
|
+ System.out.println("endTime = " + endTime);
|
|
|
+ //更新数据
|
|
|
+ BigDecimal sjtyjly = Objects.isNull(objects.get(1)) ? null : new BigDecimal(String.valueOf(objects.get(1)));
|
|
|
+ this.xinyiIndustryMapper.updateTXinyiIndustrySJByBetweenTime(beginTime, endTime, sjtyjly);
|
|
|
+ }
|
|
|
+ System.out.println("i =" + i);
|
|
|
+ }
|
|
|
+ return "ok";
|
|
|
+ }
|
|
|
+
|
|
|
}
|