Commit f0468699 authored by wujiang's avatar wujiang

Merge branch 'developer' of http://36.40.66.175:5000/moa/jxdj_zx/amos-boot-zx-biz into developer

parents 9bfb81c7 4d2f0a25
...@@ -26,6 +26,9 @@ import org.typroject.tyboot.core.foundation.utils.Bean; ...@@ -26,6 +26,9 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -94,7 +97,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -94,7 +97,7 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
return this.getBaseMapper().selectPageDataTotal(jpInverterDto); return this.getBaseMapper().selectPageDataTotal(jpInverterDto);
} }
public Map<String,Object> selectDayTrend(List<JSONObject>treeParams, String time, String time2, String snCode, String thirdStationId) { public Map<String,Object> selectDayTrend(List<JSONObject>treeParams, String time, String time2, String snCode, String thirdStationId) {
List<String> key = new ArrayList<>(); List<String> key = new ArrayList<>();
treeParams.forEach(a->{ treeParams.forEach(a->{
if (a.get("key").toString().startsWith("acc")||a.get("key").toString().startsWith("acv")||a.get("key").toString().startsWith("pv")){ if (a.get("key").toString().startsWith("acc")||a.get("key").toString().startsWith("acv")||a.get("key").toString().startsWith("pv")){
...@@ -103,40 +106,49 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -103,40 +106,49 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
key.add(a.get("key").toString()); key.add(a.get("key").toString());
} }
}); });
List<Map<String,Object>> tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerateMapper.selectDayTrend(key, time,time2, snCode, thirdStationId); List<Map<String,Object>> tdHYGFInverterDayGenerates = tdHYGFInverterDayGenerateMapper.selectDayTrend(key, time,time2, snCode, thirdStationId);
List<String> zData = new ArrayList<>(); List<String> zData = new ArrayList<>();
tdHYGFInverterDayGenerates.forEach(e-> { tdHYGFInverterDayGenerates.forEach(e-> {
if(e.get("workstatus") != null) { if(e.get("workstatus") != null) {
zData.add(e.get("workstatus").toString()); zData.add(e.get("workstatus").toString());
} }
} ); } );
Set<String> xData = new TreeSet<>(); Set<String> xData = new TreeSet<>();
for (JSONObject treeParam : treeParams) { for (JSONObject treeParam : treeParams) {
List<String> value = new ArrayList<>(); List<String> value = new ArrayList<>();
for (Map<String, Object> obj : tdHYGFInverterDayGenerates) { for (Map<String, Object> obj : tdHYGFInverterDayGenerates) {
xData.add(obj.get("time").toString().substring(0,obj.get("time").toString().length()-4)); xData.add(obj.get("time").toString().substring(0,obj.get("time").toString().length()-4));
String key1 = treeParam.get("key").toString(); String key1 = treeParam.get("key").toString();
if (treeParam.get("key").toString().startsWith("acc")||treeParam.get("key").toString().startsWith("acv")||treeParam.get("key").toString().startsWith("pv")){ if (treeParam.get("key").toString().startsWith("acc")||treeParam.get("key").toString().startsWith("acv")||treeParam.get("key").toString().startsWith("pv")){
key1 =treeParam.get("key").toString().replace("_",""); key1 =treeParam.get("key").toString().replace("_","");
} value.add(obj.get(key1).toString()); }
} value.add(obj.get(key1).toString());
treeParam.put("data",value); }
} treeParam.put("data",value);
Map<String,Object> map = new HashMap<>(); }
map.put("xData",xData); Map<String,Object> map = new HashMap<>();
map.put("yData",treeParams); map.put("xData",xData);
map.put("zData",zData); map.put("yData",treeParams);
return map; map.put("zData",zData);
} return map;
}
@UserLimits
public Page<TdHYGFInverterDayGenerate> jpInverterDayReport(int current, int size, String time, List<String> sncodes, List<String> stationIds) { @UserLimits
public Page<TdHYGFInverterDayGenerate> jpInverterDayReport(int current, int size, String time, List<String> sncodes, List<String> stationIds) {
Page<TdHYGFInverterDayGenerate> tdHYGFInverterDayGeneratePage = new Page<>(); Page<TdHYGFInverterDayGenerate> tdHYGFInverterDayGeneratePage = new Page<>();
Date date = DateUtil.parse(time, "yyyy-MM-dd"); // Date date = DateUtil.parse(time, "yyyy-MM-dd");
Date timeStart = DateUtils.dateAddHours(date, -8); // Date timeStart = DateUtils.dateAddHours(date, -8);
Date tiemEnd = DateUtils.dateAddHours(date, 16); // Date tiemEnd = DateUtils.dateAddHours(date, 16);
String startTime = DateUtil.format(timeStart, "yyyy-MM-dd HH:mm:ss"); // String startTime = DateUtil.format(timeStart, "yyyy-MM-dd HH:mm:ss");
String endTime = DateUtil.format(tiemEnd, "yyyy-MM-dd HH:mm:ss"); // String endTime = DateUtil.format(tiemEnd, "yyyy-MM-dd HH:mm:ss");
CharSequence time1 = time + " 00:00:00";
CharSequence time2 = time + " 23:59:59";
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String startTime = DateUtil.format(LocalDateTime.parse(time1,df), "yyyy-MM-dd HH:mm:ss");
String endTime = DateUtil.format(LocalDateTime.parse(time2,df), "yyyy-MM-dd HH:mm:ss");
QueryWrapper queryWrapper = new QueryWrapper<TdHYGFInverterDayGenerate>() QueryWrapper queryWrapper = new QueryWrapper<TdHYGFInverterDayGenerate>()
.ge("created_time", startTime) .ge("created_time", startTime)
.le("created_time", endTime); .le("created_time", endTime);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment