|
@@ -1,12 +1,10 @@
|
|
|
package com.ruoyi.zdsz.service.impl;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.github.therapi.runtimejavadoc.repack.com.eclipsesource.json.Json;
|
|
|
import com.github.therapi.runtimejavadoc.repack.com.eclipsesource.json.JsonObject;
|
|
|
import com.github.therapi.runtimejavadoc.repack.com.eclipsesource.json.JsonValue;
|
|
|
import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
|
import com.ruoyi.common.utils.redis.RedisUtils;
|
|
|
-import com.ruoyi.zdsz.domain.ZEngineeringIndustry;
|
|
|
import com.ruoyi.zdsz.domain.bo.ZdszBigscreenBo;
|
|
|
import com.ruoyi.zdsz.mapper.*;
|
|
|
import com.ruoyi.zdsz.service.IZdszBigscreenService;
|
|
@@ -18,6 +16,7 @@ import java.math.BigDecimal;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 大屏首页Service业务层处理
|
|
@@ -56,27 +55,45 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
if(initTime != null){
|
|
|
time = initTime;
|
|
|
}
|
|
|
-// time = "2024-05-21";
|
|
|
zdszBigscreenBo.setTime(time);
|
|
|
- String[] times = time.split("-");
|
|
|
- zdszBigscreenBo.setMaterial("z_engineering_material_" + times[0] + "_" + times[1]); // z_engineering_material_2024_08
|
|
|
- List<Double> numbers = bigscreenMapper.pipeNum(zdszBigscreenBo);
|
|
|
+ Double iron = 0.0;
|
|
|
+ Double pe = 0.0;
|
|
|
+ Double stainless_steel_bellow = 0.0;
|
|
|
+ Double spiral_welded_pipe = 0.0;
|
|
|
+ Double seamless_steel_tube = 0.0;
|
|
|
+ Double galvanized_steel_pipe = 0.0;
|
|
|
+ Double polyethylene_pipe = 0.0;
|
|
|
+ List<String> monthList = batchInitMonthList(null);
|
|
|
+ for (String month: monthList) {
|
|
|
+ String[] times = month.split("-");
|
|
|
+ zdszBigscreenBo.setMaterial("z_engineering_material_" + times[0] + "_" + times[1]); // z_engineering_material_2024_08
|
|
|
+ List<Double> numbers= bigscreenMapper.pipeNum(zdszBigscreenBo);
|
|
|
+ iron += numbers.get(0);
|
|
|
+ pe += numbers.get(1);
|
|
|
+ stainless_steel_bellow += numbers.get(2);
|
|
|
+ spiral_welded_pipe += numbers.get(3);
|
|
|
+ seamless_steel_tube += numbers.get(4);
|
|
|
+ galvanized_steel_pipe += numbers.get(5);
|
|
|
+ iron += numbers.get(6);
|
|
|
+ }
|
|
|
Map map = new HashMap();
|
|
|
map.put("time", time); // 创建时间
|
|
|
- map.put("iron", numbers.get(0)); // 钢管总数
|
|
|
- map.put("pe", numbers.get(1)); // PE总数
|
|
|
- map.put("stainless_steel_bellow", numbers.get(2)); // 不锈钢波纹管
|
|
|
- map.put("spiral_welded_pipe", numbers.get(3)); // 螺旋焊管
|
|
|
- map.put("seamless_steel_tube", numbers.get(4)); // 无缝钢管
|
|
|
- map.put("galvanized_steel_pipe", numbers.get(5)); // 镀锌钢管
|
|
|
- map.put("polyethylene_pipe", numbers.get(6)); // 燃气用埋地聚乙烯管
|
|
|
+ map.put("iron", iron); // 钢管总数
|
|
|
+ map.put("pe", pe); // PE总数
|
|
|
+ map.put("stainless_steel_bellow", stainless_steel_bellow); // 不锈钢波纹管
|
|
|
+ map.put("spiral_welded_pipe", spiral_welded_pipe); // 螺旋焊管
|
|
|
+ map.put("seamless_steel_tube", seamless_steel_tube); // 无缝钢管
|
|
|
+ map.put("galvanized_steel_pipe", galvanized_steel_pipe); // 镀锌钢管
|
|
|
+ map.put("polyethylene_pipe", polyethylene_pipe); // 燃气用埋地聚乙烯管
|
|
|
bigscreenMapper.setConstructionProgress(map);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public Map getConstructionProgress(ZdszBigscreenBo zdszBigscreenBo){
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
- if(time != null && time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
+ if(time == null){
|
|
|
+ zdszBigscreenBo.setTime(getPreviousDay());
|
|
|
+ }else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
setConstructionProgress(time);
|
|
|
}
|
|
|
clearTime(zdszBigscreenBo);
|
|
@@ -85,6 +102,7 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
switch (size){
|
|
|
case 0:{
|
|
|
Map map = new LinkedHashMap();
|
|
|
+ map.put("time", time); // 当日时间
|
|
|
map.put("iron", 0); // 钢管总数
|
|
|
map.put("pe", 0); // PE总数
|
|
|
map.put("stainless_steel_bellow", 0); // 不锈钢波纹管
|
|
@@ -99,6 +117,7 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
}
|
|
|
default:{
|
|
|
Map map = new LinkedHashMap();
|
|
|
+ map.put("time", time); // 当日时间
|
|
|
map.put("iron", list.stream().map(x -> new BigDecimal(String.valueOf(x.get("iron")))).reduce(BigDecimal.ZERO, BigDecimal::add)); // 钢管总数
|
|
|
map.put("pe", list.stream().map(x -> new BigDecimal(String.valueOf(x.get("pe")))).reduce(BigDecimal.ZERO, BigDecimal::add)); // PE总数
|
|
|
map.put("stainless_steel_bellow", list.stream().map(x -> new BigDecimal(String.valueOf(x.get("stainless_steel_bellow")))).reduce(BigDecimal.ZERO, BigDecimal::add)); // 不锈钢波纹管
|
|
@@ -138,7 +157,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
public Map getProjectStatus(ZdszBigscreenBo zdszBigscreenBo){
|
|
|
clearTime(zdszBigscreenBo);
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
- if(time != null && time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
+ if(time == null){
|
|
|
+ zdszBigscreenBo.setTime(getPreviousDay());
|
|
|
+ }else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
setProjectStatus(time);
|
|
|
}
|
|
|
List<Map> list = bigscreenMapper.getProjectStatus(zdszBigscreenBo);
|
|
@@ -173,25 +194,53 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
if(initTime != null){
|
|
|
time = initTime;
|
|
|
}
|
|
|
- String[] times = time.split("-");
|
|
|
zdszBigscreenBo.setTime(time);
|
|
|
- zdszBigscreenBo.setInfo("z_engineering_info_" + times[0] + "_" + times[1]); // z_engineering_info_2024_03
|
|
|
- zdszBigscreenBo.setNode("z_engineering_node_" + times[0] + "_" + times[1]); // z_engineering_node_2024_03
|
|
|
Map map = new HashMap();
|
|
|
map.put("time", time); // 创建时间
|
|
|
- map.put("civi", bigscreenMapper.civiNumEng(zdszBigscreenBo)); // 民用工程
|
|
|
- map.put("gy", bigscreenMapper.gyNumEng(zdszBigscreenBo)); // 工业工程
|
|
|
- map.put("industry", bigscreenMapper.industryNumEng(zdszBigscreenBo)); // 市政工程
|
|
|
- map.put("touch", bigscreenMapper.touchNumEng(zdszBigscreenBo)); // 碰口工程
|
|
|
- map.put("infrastructure", bigscreenMapper.infrastructureNumEng(zdszBigscreenBo)); // 基建工程
|
|
|
- map.put("pipe", bigscreenMapper.pipeNumEng(zdszBigscreenBo)); // 顶管工程
|
|
|
+// Long civi = 0L;
|
|
|
+// Long gy = 0L;
|
|
|
+// Long industry = 0L;
|
|
|
+// Long touch = 0L;
|
|
|
+// Long infrastructure = 0L;
|
|
|
+// Long pipe = 0L;
|
|
|
+ Set civi = new HashSet();
|
|
|
+ Set gy = new HashSet();
|
|
|
+ Set industry = new HashSet();
|
|
|
+ Set touch = new HashSet();
|
|
|
+ Set infrastructure = new HashSet();
|
|
|
+ Set pipe = new HashSet();
|
|
|
+ List<String> monthList = batchInitMonthList(null);
|
|
|
+ for (String month: monthList) {
|
|
|
+ String[] times = month.split("-");
|
|
|
+ zdszBigscreenBo.setInfo("z_engineering_info_" + times[0] + "_" + times[1]); // z_engineering_info_2024_03
|
|
|
+ zdszBigscreenBo.setNode("z_engineering_node_" + times[0] + "_" + times[1]); // z_engineering_node_2024_03
|
|
|
+ civi.add(bigscreenMapper.civiNumEng(zdszBigscreenBo).stream().collect(Collectors.toSet()));
|
|
|
+ gy.add(bigscreenMapper.gyNumEng(zdszBigscreenBo).stream().collect(Collectors.toSet()));
|
|
|
+ industry.add(bigscreenMapper.industryNumEng(zdszBigscreenBo).stream().collect(Collectors.toSet()));
|
|
|
+ touch.add(bigscreenMapper.touchNumEng(zdszBigscreenBo).stream().collect(Collectors.toSet()));
|
|
|
+ infrastructure.add(bigscreenMapper.infrastructureNumEng(zdszBigscreenBo).stream().collect(Collectors.toSet()));
|
|
|
+ civi.add(bigscreenMapper.pipeNumEng(zdszBigscreenBo).stream().collect(Collectors.toSet()));
|
|
|
+// pipe += bigscreenMapper.gyNumEng(zdszBigscreenBo);
|
|
|
+// industry += bigscreenMapper.industryNumEng(zdszBigscreenBo);
|
|
|
+// touch += bigscreenMapper.touchNumEng(zdszBigscreenBo);
|
|
|
+// infrastructure += bigscreenMapper.infrastructureNumEng(zdszBigscreenBo);
|
|
|
+// pipe += bigscreenMapper.pipeNumEng(zdszBigscreenBo);
|
|
|
+ }
|
|
|
+ map.put("civi", civi.size()); // 民用工程
|
|
|
+ map.put("gy", gy.size()); // 工业工程
|
|
|
+ map.put("industry", industry.size()); // 市政工程
|
|
|
+ map.put("touch", touch.size()); // 碰口工程
|
|
|
+ map.put("infrastructure", infrastructure.size()); // 基建工程
|
|
|
+ map.put("pipe", pipe.size()); // 顶管工程
|
|
|
bigscreenMapper.setCountEngineering(map);
|
|
|
}
|
|
|
@Override
|
|
|
public Map getCountEngineering(ZdszBigscreenBo zdszBigscreenBo){
|
|
|
clearTime(zdszBigscreenBo);
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
- if(time != null && time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
+ if(time == null){
|
|
|
+ zdszBigscreenBo.setTime(getPreviousDay());
|
|
|
+ }else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
setCountEngineering(time);
|
|
|
}
|
|
|
List<Map> list = bigscreenMapper.getCountEngineering(zdszBigscreenBo);
|
|
@@ -247,7 +296,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
public Map getCountPerson(ZdszBigscreenBo zdszBigscreenBo){
|
|
|
clearTime(zdszBigscreenBo);
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
- if(time != null && time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
+ if(time == null){
|
|
|
+ zdszBigscreenBo.setTime(getPreviousDay());
|
|
|
+ }else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
setCountPerson(time);
|
|
|
}
|
|
|
List<Map> list = bigscreenMapper.getCountPerson(zdszBigscreenBo);
|
|
@@ -315,7 +366,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
public Map getConstructionMap(ZdszBigscreenBo zdszBigscreenBo){
|
|
|
clearTime(zdszBigscreenBo);
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
- if(time != null && time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
+ if(time == null){
|
|
|
+ zdszBigscreenBo.setTime(getPreviousDay());
|
|
|
+ }else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
setConstructionMap(time);
|
|
|
}
|
|
|
Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
|
|
@@ -345,7 +398,7 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
names.add(dictData.getDictLabel());
|
|
|
Object value = jsonObject.get(dictData.getDictValue());
|
|
|
- values.add(value == null ? 0 : value);
|
|
|
+ values.add(value == null ? 0 : Long.valueOf(value.toString()));
|
|
|
}
|
|
|
Map linkedHashMap = new LinkedHashMap();
|
|
|
linkedHashMap.put("name", names); // 名称
|
|
@@ -386,32 +439,38 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
if(initTime != null){
|
|
|
time = initTime;
|
|
|
}
|
|
|
-// time = "2024-03-10";
|
|
|
zdszBigscreenBo.setTime(time);
|
|
|
- String[] times = time.split("-");
|
|
|
- zdszBigscreenBo.setInfo("z_engineering_info_" + times[0] + "_" + times[1]); // z_engineering_info_2024_03
|
|
|
- zdszBigscreenBo.setNode("z_engineering_node_" + times[0] + "_" + times[1]); // z_engineering_node_2024_03
|
|
|
Map map = new HashMap();
|
|
|
map.put("time", time); // 创建时间
|
|
|
- List<Map> civiMaps = bigscreenMapper.civiNumNew(zdszBigscreenBo); // 民用工程
|
|
|
- List<Map> gyMaps = bigscreenMapper.gyNumNew(zdszBigscreenBo); // 工业工程
|
|
|
- List<Map> industryMaps = bigscreenMapper.industryNumNew(zdszBigscreenBo); // 市政工程
|
|
|
- List<Map> touchMaps = bigscreenMapper.touchNumNew(zdszBigscreenBo); // 碰口工程
|
|
|
- List<Map> infrastructureMaps = bigscreenMapper.infrastructureNumNew(zdszBigscreenBo); // 基建工程
|
|
|
- List<Map> pipeMaps = bigscreenMapper.pipeNumNew(zdszBigscreenBo); // 顶管工程
|
|
|
- civiMaps = mapMergeMap(civiMaps, gyMaps);
|
|
|
- civiMaps = mapMergeMap(civiMaps, industryMaps);
|
|
|
- civiMaps = mapMergeMap(civiMaps, touchMaps);
|
|
|
- civiMaps = mapMergeMap(civiMaps, infrastructureMaps);
|
|
|
- civiMaps = mapMergeMap(civiMaps, pipeMaps);
|
|
|
- map.put("json", mapToJson(civiMaps)); // JSON数据
|
|
|
+ List<Map> initMaps = new ArrayList<>();
|
|
|
+ List<String> monthList = batchInitMonthList(null);
|
|
|
+ for (String month: monthList) {
|
|
|
+ String[] times = month.split("-");
|
|
|
+ zdszBigscreenBo.setInfo("z_engineering_info_" + times[0] + "_" + times[1]); // z_engineering_info_2024_03
|
|
|
+ zdszBigscreenBo.setNode("z_engineering_node_" + times[0] + "_" + times[1]); // z_engineering_node_2024_03
|
|
|
+ List<Map> civiMaps = bigscreenMapper.civiNumNew(zdszBigscreenBo); // 民用工程
|
|
|
+ List<Map> gyMaps = bigscreenMapper.gyNumNew(zdszBigscreenBo); // 工业工程
|
|
|
+ List<Map> industryMaps = bigscreenMapper.industryNumNew(zdszBigscreenBo); // 市政工程
|
|
|
+ List<Map> touchMaps = bigscreenMapper.touchNumNew(zdszBigscreenBo); // 碰口工程
|
|
|
+ List<Map> infrastructureMaps = bigscreenMapper.infrastructureNumNew(zdszBigscreenBo); // 基建工程
|
|
|
+ List<Map> pipeMaps = bigscreenMapper.pipeNumNew(zdszBigscreenBo); // 顶管工程
|
|
|
+ initMaps = mapMergeMap(initMaps, civiMaps);
|
|
|
+ initMaps = mapMergeMap(initMaps, gyMaps);
|
|
|
+ initMaps = mapMergeMap(initMaps, industryMaps);
|
|
|
+ initMaps = mapMergeMap(initMaps, touchMaps);
|
|
|
+ initMaps = mapMergeMap(initMaps, infrastructureMaps);
|
|
|
+ initMaps = mapMergeMap(initMaps, pipeMaps);
|
|
|
+ }
|
|
|
+ map.put("json", mapToJson(initMaps)); // JSON数据
|
|
|
bigscreenMapper.setConstructionNew(map);
|
|
|
}
|
|
|
@Override
|
|
|
public Map getConstructionNew(ZdszBigscreenBo zdszBigscreenBo){
|
|
|
clearTime(zdszBigscreenBo);
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
- if(time != null && time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
+ if(time == null){
|
|
|
+ zdszBigscreenBo.setTime(getPreviousDay());
|
|
|
+ }else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
setConstructionNew(time);
|
|
|
}
|
|
|
Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
|
|
@@ -423,7 +482,8 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
List names = new ArrayList();
|
|
|
List values = new ArrayList();
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
- names.add(dictData.getDictLabel());
|
|
|
+// names.add(dictData.getDictLabel());
|
|
|
+ names.add(dictData.getRemark());
|
|
|
values.add(0);
|
|
|
}
|
|
|
Map map = new LinkedHashMap();
|
|
@@ -439,9 +499,10 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
JsonValue jsonValue = Json.parse(jsonStr);
|
|
|
JsonObject jsonObject = jsonValue.asObject();
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
- names.add(dictData.getDictLabel());
|
|
|
+// names.add(dictData.getDictLabel());
|
|
|
+ names.add(dictData.getRemark());
|
|
|
Object value = jsonObject.get(dictData.getDictValue());
|
|
|
- values.add(value == null ? 0 : value);
|
|
|
+ values.add(value == null ? 0 : Long.valueOf(value.toString()));
|
|
|
}
|
|
|
Map linkedHashMap = new LinkedHashMap();
|
|
|
linkedHashMap.put("name", names); // 名称
|
|
@@ -452,7 +513,8 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
List names = new ArrayList();
|
|
|
List values = new ArrayList();
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
- names.add(dictData.getDictLabel());
|
|
|
+// names.add(dictData.getDictLabel());
|
|
|
+ names.add(dictData.getRemark());
|
|
|
Long longValue = 0L;
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
Map map = list.get(i);
|
|
@@ -482,22 +544,19 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
if(initTime != null){
|
|
|
time = initTime;
|
|
|
}
|
|
|
- String[] times = time.split("-");
|
|
|
zdszBigscreenBo.setTime(time);
|
|
|
-// zdszBigscreenBo.setTime("2024-08-05");
|
|
|
- zdszBigscreenBo.setInfo("z_engineering_info_" + times[0] + "_" + times[1]); // z_engineering_info_2024_03
|
|
|
- zdszBigscreenBo.setNode("z_engineering_node_" + times[0] + "_" + times[1]); // z_engineering_node_2024_03
|
|
|
Map map = new HashMap();
|
|
|
map.put("time", time); // 创建时间
|
|
|
-// Json json = Json.
|
|
|
- List<Map> maps = bigscreenMapper.civiNumOld(zdszBigscreenBo);
|
|
|
-// map.put("json", aaa); // 民用工程
|
|
|
-// map.put("gy", bigscreenMapper.gyNumEng(zdszBigscreenBo)); // 工业工程
|
|
|
-// map.put("industry", bigscreenMapper.industryNumEng(zdszBigscreenBo)); // 市政工程
|
|
|
-// map.put("touch", bigscreenMapper.touchNumEng(zdszBigscreenBo)); // 碰口工程
|
|
|
-// map.put("infrastructure", bigscreenMapper.infrastructureNumEng(zdszBigscreenBo)); // 基建工程
|
|
|
-// map.put("pipe", bigscreenMapper.pipeNumEng(zdszBigscreenBo)); // 顶管工程
|
|
|
- map.put("json", mapToJson(maps)); // JSON数据
|
|
|
+ List<Map> initMaps = new ArrayList<>();
|
|
|
+ List<String> monthList = batchInitMonthList(null);
|
|
|
+ for (String month: monthList) {
|
|
|
+ String[] times = month.split("-");
|
|
|
+ zdszBigscreenBo.setInfo("z_engineering_info_" + times[0] + "_" + times[1]); // z_engineering_info_2024_03
|
|
|
+ zdszBigscreenBo.setNode("z_engineering_node_" + times[0] + "_" + times[1]); // z_engineering_node_2024_03
|
|
|
+ List<Map> maps = bigscreenMapper.civiNumOld(zdszBigscreenBo);
|
|
|
+ initMaps = mapMergeMap(initMaps, maps);
|
|
|
+ }
|
|
|
+ map.put("json", mapToJson(initMaps)); // JSON数据
|
|
|
bigscreenMapper.setConstructionOld(map);
|
|
|
}
|
|
|
@Override
|
|
@@ -505,7 +564,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
// batchInitData("2024-08-01");
|
|
|
clearTime(zdszBigscreenBo);
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
- if(time != null && time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
+ if(time == null){
|
|
|
+ zdszBigscreenBo.setTime(getPreviousDay());
|
|
|
+ }else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
setConstructionOld(time);
|
|
|
}
|
|
|
Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
|
|
@@ -517,7 +578,8 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
List names = new ArrayList();
|
|
|
List values = new ArrayList();
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
- names.add(dictData.getDictLabel());
|
|
|
+// names.add(dictData.getDictLabel());
|
|
|
+ names.add(dictData.getRemark());
|
|
|
values.add(0);
|
|
|
}
|
|
|
Map map = new LinkedHashMap();
|
|
@@ -533,9 +595,10 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
JsonValue jsonValue = Json.parse(jsonStr);
|
|
|
JsonObject jsonObject = jsonValue.asObject();
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
- names.add(dictData.getDictLabel());
|
|
|
+// names.add(dictData.getDictLabel());
|
|
|
+ names.add(dictData.getRemark());
|
|
|
Object value = jsonObject.get(dictData.getDictValue());
|
|
|
- values.add(value == null ? 0 : value);
|
|
|
+ values.add(value == null ? 0 : Long.valueOf(value.toString()));
|
|
|
}
|
|
|
Map linkedHashMap = new LinkedHashMap();
|
|
|
linkedHashMap.put("name", names); // 名称
|
|
@@ -546,7 +609,8 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
List names = new ArrayList();
|
|
|
List values = new ArrayList();
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
- names.add(dictData.getDictLabel());
|
|
|
+// names.add(dictData.getDictLabel());
|
|
|
+ names.add(dictData.getRemark());
|
|
|
Long longValue = 0L;
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
Map map = list.get(i);
|
|
@@ -603,7 +667,7 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
for (int i = 0; i < maps.size(); i++) {
|
|
|
boolean isExist = false;
|
|
|
for (int j = 0; j < destinations.size(); j++) {
|
|
|
- Map destination = destinations.get(i);
|
|
|
+ Map destination = destinations.get(j);
|
|
|
Map map = maps.get(i);
|
|
|
if(map.get("key").equals(destination.get("key"))){
|
|
|
isExist = true;
|
|
@@ -630,7 +694,8 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
setConstructionNew(initTime); // 各个区今日施工数
|
|
|
}
|
|
|
|
|
|
- private void batchInitData(String startTime){
|
|
|
+ @Override
|
|
|
+ public void batchInitData(String startTime){
|
|
|
List<String> times = batchInitDateList(startTime);
|
|
|
for (String time: times) {
|
|
|
System.out.println("time=" + time);
|
|
@@ -638,6 +703,32 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public List batchInitMonthList(String startTime){
|
|
|
+ if(startTime == null){
|
|
|
+ startTime = "2024-03";
|
|
|
+ }
|
|
|
+ Date today = new Date();
|
|
|
+ List list = new ArrayList();
|
|
|
+ list.add(startTime);
|
|
|
+ while (!startTime.equals(new SimpleDateFormat("yyyy-MM").format(today))){
|
|
|
+ list.add(getNextMonth(startTime));
|
|
|
+ startTime = getNextMonth(startTime);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ public String getNextMonth(String date){
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ try {
|
|
|
+ calendar.setTime(new SimpleDateFormat("yyyy-MM").parse(date));
|
|
|
+ } catch (ParseException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ // 将日期加一个月
|
|
|
+ calendar.add(Calendar.MONTH, 1);
|
|
|
+ // 获取下一月的日期
|
|
|
+ Date nextMonth = calendar.getTime();
|
|
|
+ return new SimpleDateFormat("yyyy-MM").format(nextMonth);
|
|
|
+ }
|
|
|
public List batchInitDateList(String startTime){
|
|
|
Date today = new Date();
|
|
|
List list = new ArrayList();
|