Commit 7503fa3f authored by co_dengxiongwen's avatar co_dengxiongwen

首页接口调整

parent 0789393b
...@@ -32,8 +32,13 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -32,8 +32,13 @@ public class AnalysisServiceImpl implements AnalysisService {
try { try {
SysSystemParams sysSystemParams = sysSystemParamsService.getById(Constants.STRING_1); 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); map.put("faultAlarm",2);
//供暖模式 //供暖模式
...@@ -57,16 +62,16 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -57,16 +62,16 @@ public class AnalysisServiceImpl implements AnalysisService {
energy.put("sdSystemRunningTimeMonth",sysSystemParams.getSdSystemRunningTimeMonth()); energy.put("sdSystemRunningTimeMonth",sysSystemParams.getSdSystemRunningTimeMonth());
//节能运行时间-月 //节能运行时间-月
energy.put("jnSystemRunningTimeMonth",sysSystemParams.getJnSystemRunningTimeMonth()); energy.put("jnSystemRunningTimeMonth",sysSystemParams.getJnSystemRunningTimeMonth());
energy.put("sdEnergyMonth",100); energy.put("sdEnergyMonth",1000);
energy.put("jnEnergyMonth",100); energy.put("jnEnergyMonth",1000);
energy.put("totalEnergyMonth",200); energy.put("totalEnergyMonth",2000);
map.put("energy",energy); map.put("energy",energy);
//能耗统计 //能耗统计
List<List<String>> list = new ArrayList<List<String>>(); List<List<String>> list = new ArrayList<List<String>>();
//当天 //当天
List<TotalHour> listHour = totalHourService.queryList(); 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; Boolean flag = true;
List<String> listDetail = new ArrayList<String>(); List<String> listDetail = new ArrayList<String>();
for(TotalHour bean : listHour){ for(TotalHour bean : listHour){
...@@ -82,7 +87,7 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -82,7 +87,7 @@ public class AnalysisServiceImpl implements AnalysisService {
// 0 代表前面补充0 // 0 代表前面补充0
// 10代表长度为10 // 10代表长度为10
// d 代表参数为正数型 // 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); listDetail.add(Constants.STRING_0);
} }
list.add(listDetail); list.add(listDetail);
...@@ -92,7 +97,7 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -92,7 +97,7 @@ public class AnalysisServiceImpl implements AnalysisService {
List<List<String>> listMonth = new ArrayList<List<String>>(); List<List<String>> listMonth = new ArrayList<List<String>>();
//当月 //当月
List<TotalDay> listDay = totalDayService.queryList(); 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; Boolean flag = true;
List<String> listDetail = new ArrayList<String>(); List<String> listDetail = new ArrayList<String>();
for(TotalDay bean : listDay){ for(TotalDay bean : listDay){
...@@ -113,7 +118,7 @@ public class AnalysisServiceImpl implements AnalysisService { ...@@ -113,7 +118,7 @@ public class AnalysisServiceImpl implements AnalysisService {
} }
listMonth.add(listDetail); listMonth.add(listDetail);
} }
map.put("energyList",listDay); map.put("energyList",list);
map.put("energyListMonth",listMonth); map.put("energyListMonth",listMonth);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</if> </if>
</select> </select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.TotalDay"> <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 order by create_time
</select> </select>
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</if> </if>
</select> </select>
<select id="queryList" resultType="com.devplatform.admin.modules.eq.bean.TotalHour"> <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 order by create_time
</select> </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