Commit 7503fa3f authored by co_dengxiongwen's avatar co_dengxiongwen

首页接口调整

parent 0789393b
......@@ -32,8 +32,13 @@ public class AnalysisServiceImpl implements AnalysisService {
try {
SysSystemParams sysSystemParams = sysSystemParamsService.getById(Constants.STRING_1);
Integer dayTime = Integer.valueOf(sysSystemParams.getSystemRunningTime())/(24*60*60);
Integer hourTime = Integer.valueOf(sysSystemParams.getSystemRunningTime())%(24*60*60)/(60*60);
List<Integer> timeList = new ArrayList<>();
timeList.add(dayTime);
timeList.add(hourTime);
//系统运行时间
map.put("systemRunningTime",sysSystemParams.getSystemRunningTime());
map.put("systemRunningTime",timeList);
//报警总数
map.put("faultAlarm",2);
//供暖模式
......@@ -57,16 +62,16 @@ public class AnalysisServiceImpl implements AnalysisService {
energy.put("sdSystemRunningTimeMonth",sysSystemParams.getSdSystemRunningTimeMonth());
//节能运行时间-月
energy.put("jnSystemRunningTimeMonth",sysSystemParams.getJnSystemRunningTimeMonth());
energy.put("sdEnergyMonth",100);
energy.put("jnEnergyMonth",100);
energy.put("totalEnergyMonth",200);
energy.put("sdEnergyMonth",1000);
energy.put("jnEnergyMonth",1000);
energy.put("totalEnergyMonth",2000);
map.put("energy",energy);
//能耗统计
List<List<String>> list = new ArrayList<List<String>>();
//当天
List<TotalHour> listHour = totalHourService.queryList();
for (int i = 0; i < Integer.valueOf(DateUtil.getNowHour()); i++) {
for (int i = 0; i <= Integer.valueOf(DateUtil.getNowHour()); i++) {
Boolean flag = true;
List<String> listDetail = new ArrayList<String>();
for(TotalHour bean : listHour){
......@@ -82,7 +87,7 @@ public class AnalysisServiceImpl implements AnalysisService {
// 0 代表前面补充0
// 10代表长度为10
// d 代表参数为正数型
listDetail.add(DateUtils.format(new Date()) + String.format("%02d", i) +":00:00");
listDetail.add(DateUtils.format(new Date()) +" "+ String.format("%02d", i) +":00:00");
listDetail.add(Constants.STRING_0);
}
list.add(listDetail);
......@@ -92,7 +97,7 @@ public class AnalysisServiceImpl implements AnalysisService {
List<List<String>> listMonth = new ArrayList<List<String>>();
//当月
List<TotalDay> listDay = totalDayService.queryList();
for (int i = 0; i < Integer.valueOf(DateUtil.getNowDay()); i++) {
for (int i = 1; i <= Integer.valueOf(DateUtil.getNowDay()); i++) {
Boolean flag = true;
List<String> listDetail = new ArrayList<String>();
for(TotalDay bean : listDay){
......@@ -113,7 +118,7 @@ public class AnalysisServiceImpl implements AnalysisService {
}
listMonth.add(listDetail);
}
map.put("energyList",listDay);
map.put("energyList",list);
map.put("energyListMonth",listMonth);
}catch (Exception e){
e.printStackTrace();
......
......@@ -39,7 +39,7 @@
</if>
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.TotalDay">
select * from total_day where TO_DAYS(create_time) = TO_DAYS(NOW())
select * from total_day where DATE_FORMAT(create_time,'%Y%m') = DATE_FORMAT(CURDATE( ),'%Y%m')
order by create_time
</select>
......
......@@ -39,7 +39,7 @@
</if>
</select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.TotalHour">
select * from total_day where DATE_FORMAT(create_time,'%Y%m') = DATE_FORMAT(CURDATE( ),'%Y%m')
select * from total_hour where TO_DAYS(create_time) = TO_DAYS(NOW())
order by create_time
</select>
......
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