Commit de78db6b authored by 朱晨阳's avatar 朱晨阳

修改逆变器报表查询数据错误

parent fc27a9b4
......@@ -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.rdbms.service.BaseService;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
......@@ -118,7 +121,8 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
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")){
key1 =treeParam.get("key").toString().replace("_","");
} value.add(obj.get(key1).toString());
}
value.add(obj.get(key1).toString());
}
treeParam.put("data",value);
}
......@@ -132,11 +136,19 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
@UserLimits
public Page<TdHYGFInverterDayGenerate> jpInverterDayReport(int current, int size, String time, List<String> sncodes, List<String> stationIds) {
Page<TdHYGFInverterDayGenerate> tdHYGFInverterDayGeneratePage = new Page<>();
Date date = DateUtil.parse(time, "yyyy-MM-dd");
Date timeStart = DateUtils.dateAddHours(date, -8);
Date tiemEnd = DateUtils.dateAddHours(date, 16);
String startTime = DateUtil.format(timeStart, "yyyy-MM-dd HH:mm:ss");
String endTime = DateUtil.format(tiemEnd, "yyyy-MM-dd HH:mm:ss");
// Date date = DateUtil.parse(time, "yyyy-MM-dd");
// Date timeStart = DateUtils.dateAddHours(date, -8);
// Date tiemEnd = DateUtils.dateAddHours(date, 16);
// String startTime = DateUtil.format(timeStart, "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>()
.ge("created_time", startTime)
.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