|
@@ -155,13 +155,13 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
|
|
|
@Override
|
|
|
public Map getProjectStatus(ZdszBigscreenBo zdszBigscreenBo){
|
|
|
- clearTime(zdszBigscreenBo);
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
if(time == null){
|
|
|
zdszBigscreenBo.setTime(getPreviousDay());
|
|
|
}else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
setProjectStatus(time);
|
|
|
}
|
|
|
+ clearTime(zdszBigscreenBo);
|
|
|
List<Map> list = bigscreenMapper.getProjectStatus(zdszBigscreenBo);
|
|
|
int size = list.size();
|
|
|
switch (size){
|
|
@@ -256,13 +256,13 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
}
|
|
|
@Override
|
|
|
public Map getCountEngineering(ZdszBigscreenBo zdszBigscreenBo){
|
|
|
- clearTime(zdszBigscreenBo);
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
if(time == null){
|
|
|
zdszBigscreenBo.setTime(getPreviousDay());
|
|
|
}else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
setCountEngineering(time);
|
|
|
}
|
|
|
+ clearTime(zdszBigscreenBo);
|
|
|
List<Map> list = bigscreenMapper.getCountEngineering(zdszBigscreenBo);
|
|
|
int size = list.size();
|
|
|
switch (size){
|
|
@@ -314,13 +314,13 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
}
|
|
|
@Override
|
|
|
public Map getCountPerson(ZdszBigscreenBo zdszBigscreenBo){
|
|
|
- clearTime(zdszBigscreenBo);
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
if(time == null){
|
|
|
zdszBigscreenBo.setTime(getPreviousDay());
|
|
|
}else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
setCountPerson(time);
|
|
|
}
|
|
|
+ clearTime(zdszBigscreenBo);
|
|
|
List<Map> list = bigscreenMapper.getCountPerson(zdszBigscreenBo);
|
|
|
int size = list.size();
|
|
|
switch (size){
|
|
@@ -369,33 +369,34 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
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> civiOldMaps = bigscreenMapper.civiNumNew(zdszBigscreenBo); // 民用工程 旧改
|
|
|
- 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);
|
|
|
- initMaps = mapMergeMap(initMaps, civiOldMaps);
|
|
|
+// List<Map> civiOldMaps = calculateMapData(bigscreenMapper.civiNumOld(zdszBigscreenBo)); // 民用工程 旧改
|
|
|
+// List<Map> civiMaps = calculateMapData(bigscreenMapper.civiNumNew(zdszBigscreenBo)); // 民用工程 新建
|
|
|
+ List<Map> civiMaps = calculateMapData(bigscreenMapper.civiNumMap(zdszBigscreenBo)); // 民用工程 新建 旧改
|
|
|
+ List<Map> gyMaps = calculateMapData(bigscreenMapper.gyNumNew(zdszBigscreenBo)); // 工业工程
|
|
|
+ List<Map> industryMaps = calculateMapData(bigscreenMapper.industryNumNew(zdszBigscreenBo)); // 市政工程
|
|
|
+ List<Map> touchMaps = calculateMapData(bigscreenMapper.touchNumNew(zdszBigscreenBo)); // 碰口工程
|
|
|
+ List<Map> infrastructureMaps = calculateMapData(bigscreenMapper.infrastructureNumNew(zdszBigscreenBo)); // 基建工程
|
|
|
+ List<Map> pipeMaps = calculateMapData(bigscreenMapper.pipeNumNew(zdszBigscreenBo)); // 顶管工程
|
|
|
+ initMaps = mapMergeMapById(initMaps, civiMaps);
|
|
|
+ initMaps = mapMergeMapById(initMaps, gyMaps);
|
|
|
+ initMaps = mapMergeMapById(initMaps, industryMaps);
|
|
|
+ initMaps = mapMergeMapById(initMaps, touchMaps);
|
|
|
+ initMaps = mapMergeMapById(initMaps, infrastructureMaps);
|
|
|
+ initMaps = mapMergeMapById(initMaps, pipeMaps);
|
|
|
+// initMaps = mapMergeMapById(initMaps, civiOldMaps);
|
|
|
}
|
|
|
map.put("json", mapToJson(initMaps)); // JSON数据
|
|
|
bigscreenMapper.setConstructionMap(map);
|
|
|
}
|
|
|
@Override
|
|
|
public Map getConstructionMap(ZdszBigscreenBo zdszBigscreenBo){
|
|
|
- clearTime(zdszBigscreenBo);
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
if(time == null){
|
|
|
zdszBigscreenBo.setTime(getPreviousDay());
|
|
|
}else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
|
|
|
setConstructionMap(time);
|
|
|
}
|
|
|
+ clearTime(zdszBigscreenBo);
|
|
|
Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
|
|
|
List<SysDictData> dictDataList = sysDictMap.get("district");
|
|
|
List<Map> list = bigscreenMapper.getConstructionMap(zdszBigscreenBo);
|
|
@@ -468,30 +469,41 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
Map map = new HashMap();
|
|
|
map.put("time", time); // 创建时间
|
|
|
List<Map> initMaps = new ArrayList<>();
|
|
|
+ List<Map> initMaps_civi = new ArrayList<>();
|
|
|
+ List<Map> initMaps_gy = new ArrayList<>();
|
|
|
+ List<Map> initMaps_industry = new ArrayList<>();
|
|
|
+ List<Map> initMaps_touch = new ArrayList<>();
|
|
|
+ List<Map> initMaps_infrastructure = new ArrayList<>();
|
|
|
+ List<Map> initMaps_pipe = 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);
|
|
|
- }
|
|
|
+ List<Map> civiMaps = calculateMapData(bigscreenMapper.civiNumNew(zdszBigscreenBo)); // 民用工程
|
|
|
+ List<Map> gyMaps = calculateMapData(bigscreenMapper.gyNumNew(zdszBigscreenBo)); // 工业工程
|
|
|
+ List<Map> industryMaps = calculateMapData(bigscreenMapper.industryNumNew(zdszBigscreenBo)); // 市政工程
|
|
|
+ List<Map> touchMaps = calculateMapData(bigscreenMapper.touchNumNew(zdszBigscreenBo)); // 碰口工程
|
|
|
+ List<Map> infrastructureMaps = calculateMapData(bigscreenMapper.infrastructureNumNew(zdszBigscreenBo)); // 基建工程
|
|
|
+ List<Map> pipeMaps = calculateMapData(bigscreenMapper.pipeNumNew(zdszBigscreenBo)); // 顶管工程
|
|
|
+ initMaps_civi = mapMergeMapById(initMaps_civi, civiMaps);
|
|
|
+ initMaps_gy = mapMergeMapById(initMaps_gy, gyMaps);
|
|
|
+ initMaps_industry = mapMergeMapById(initMaps_industry, industryMaps);
|
|
|
+ initMaps_touch = mapMergeMapById(initMaps_touch, touchMaps);
|
|
|
+ initMaps_infrastructure = mapMergeMapById(initMaps_infrastructure, infrastructureMaps);
|
|
|
+ initMaps_pipe = mapMergeMapById(initMaps_pipe, pipeMaps);
|
|
|
+ }
|
|
|
+ initMaps = mapMergeMap(initMaps, initMaps_civi);
|
|
|
+ initMaps = mapMergeMap(initMaps, initMaps_gy);
|
|
|
+ initMaps = mapMergeMap(initMaps, initMaps_industry);
|
|
|
+ initMaps = mapMergeMap(initMaps, initMaps_touch);
|
|
|
+ initMaps = mapMergeMap(initMaps, initMaps_infrastructure);
|
|
|
+ initMaps = mapMergeMap(initMaps, initMaps_pipe);
|
|
|
map.put("json", mapToJson(initMaps)); // JSON数据
|
|
|
bigscreenMapper.setConstructionNew(map);
|
|
|
}
|
|
|
@Override
|
|
|
public Map getConstructionNew(ZdszBigscreenBo zdszBigscreenBo){
|
|
|
- clearTime(zdszBigscreenBo);
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
if(time == null){
|
|
|
zdszBigscreenBo.setTime(getPreviousDay());
|
|
@@ -500,6 +512,7 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
}
|
|
|
Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
|
|
|
List<SysDictData> dictDataList = sysDictMap.get("district");
|
|
|
+ clearTime(zdszBigscreenBo);
|
|
|
List<Map> list = bigscreenMapper.getConstructionNew(zdszBigscreenBo);
|
|
|
int size = list.size();
|
|
|
switch (size){
|
|
@@ -508,6 +521,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
List values = new ArrayList();
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
// names.add(dictData.getDictLabel());
|
|
|
+ if(dictData.getRemark().equals("门市房")){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
names.add(dictData.getRemark());
|
|
|
values.add(0);
|
|
|
}
|
|
@@ -525,6 +541,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
JsonObject jsonObject = jsonValue.asObject();
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
// names.add(dictData.getDictLabel());
|
|
|
+ if(dictData.getRemark().equals("门市房")){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
names.add(dictData.getRemark());
|
|
|
Object value = jsonObject.get(dictData.getDictValue());
|
|
|
values.add(value == null ? 0 : Long.valueOf(value.toString()));
|
|
@@ -539,6 +558,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
List values = new ArrayList();
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
// names.add(dictData.getDictLabel());
|
|
|
+ if(dictData.getRemark().equals("门市房")){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
names.add(dictData.getRemark());
|
|
|
Long longValue = 0L;
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
@@ -578,16 +600,42 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
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);
|
|
|
+ List<Map> maps = bigscreenMapper.civiNumOld(zdszBigscreenBo); // xz7 1768475728581869569 有重复 需过滤
|
|
|
+ initMaps = mapMergeMapById(initMaps, calculateMapData(maps));
|
|
|
}
|
|
|
map.put("json", mapToJson(initMaps)); // JSON数据
|
|
|
bigscreenMapper.setConstructionOld(map);
|
|
|
}
|
|
|
+ private List<Map> calculateMapData(List<Map> maps){
|
|
|
+ List<Map> mapList = new ArrayList<>();
|
|
|
+ for (Map<String, Object> source: maps) {
|
|
|
+ String sourceKey = source.get("key").toString();
|
|
|
+ String sourceValue = "" + source.get("value");
|
|
|
+ boolean isExist = false;
|
|
|
+ for (Map<String, String> map: mapList) {
|
|
|
+ String key = map.get("key");
|
|
|
+ String id = map.get("id");
|
|
|
+// if(key != null ){
|
|
|
+ if(sourceKey.equals(key) && sourceValue.equals(id)){
|
|
|
+// Long value = Long.valueOf(""+map.get("value")) + 1L;
|
|
|
+// map.put("value", value.toString());
|
|
|
+ isExist = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!isExist){
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("id", sourceValue);
|
|
|
+ map.put("key", sourceKey);
|
|
|
+ map.put("value", "1");
|
|
|
+ mapList.add(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return mapList;
|
|
|
+ }
|
|
|
@Override
|
|
|
public Map getConstructionOld(ZdszBigscreenBo zdszBigscreenBo){
|
|
|
// batchInitData("2024-08-01");
|
|
|
- clearTime(zdszBigscreenBo);
|
|
|
String time = zdszBigscreenBo.getTime();
|
|
|
if(time == null){
|
|
|
zdszBigscreenBo.setTime(getPreviousDay());
|
|
@@ -596,6 +644,7 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
}
|
|
|
Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
|
|
|
List<SysDictData> dictDataList = sysDictMap.get("district");
|
|
|
+ clearTime(zdszBigscreenBo);
|
|
|
List<Map> list = bigscreenMapper.getConstructionOld(zdszBigscreenBo);
|
|
|
int size = list.size();
|
|
|
switch (size){
|
|
@@ -604,6 +653,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
List values = new ArrayList();
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
// names.add(dictData.getDictLabel());
|
|
|
+ if(dictData.getRemark().equals("门市房")){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
names.add(dictData.getRemark());
|
|
|
values.add(0);
|
|
|
}
|
|
@@ -621,6 +673,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
JsonObject jsonObject = jsonValue.asObject();
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
// names.add(dictData.getDictLabel());
|
|
|
+ if(dictData.getRemark().equals("门市房")){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
names.add(dictData.getRemark());
|
|
|
Object value = jsonObject.get(dictData.getDictValue());
|
|
|
values.add(value == null ? 0 : Long.valueOf(value.toString()));
|
|
@@ -635,6 +690,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
List values = new ArrayList();
|
|
|
for (SysDictData dictData: dictDataList) {
|
|
|
// names.add(dictData.getDictLabel());
|
|
|
+ if(dictData.getRemark().equals("门市房")){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
names.add(dictData.getRemark());
|
|
|
Long longValue = 0L;
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
@@ -715,6 +773,34 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
|
|
|
}
|
|
|
return destinations;
|
|
|
}
|
|
|
+ List<Map> mapMergeMapById(List<Map> destinations, List<Map> maps){
|
|
|
+ for (int i = 0; i < maps.size(); i++) {
|
|
|
+ boolean isExist = false;
|
|
|
+ for (int j = 0; j < destinations.size(); j++) {
|
|
|
+ Map destination = destinations.get(j);
|
|
|
+ Map map = maps.get(i);
|
|
|
+ Object keyObj = map.get("key");
|
|
|
+ if(keyObj == null || destination.get("id") == null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(keyObj.equals(destination.get("key"))){
|
|
|
+ if(destination.get("id").equals(map.get("id"))){
|
|
|
+ isExist = true;
|
|
|
+ break;
|
|
|
+ }else {
|
|
|
+ isExist = true;
|
|
|
+ Long value = Long.valueOf(destination.get("value").toString()) + Long.valueOf(map.get("value").toString());
|
|
|
+ destination.put("value", value);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!isExist){
|
|
|
+ destinations.add(maps.get(i));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return destinations;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public void bigscreenAutoQueryYesterdayData(String initTime){
|