|
|
|
@@ -8,6 +8,7 @@ import com.simple.enums.EnumCarCmd; |
|
|
|
import com.simple.mapper.*; |
|
|
|
import com.simple.service.DataTowerService; |
|
|
|
import com.simple.utils.DateUtils; |
|
|
|
import org.apache.commons.collections.map.TransformedMap; |
|
|
|
import org.apache.log4j.Logger; |
|
|
|
import org.apache.shiro.crypto.hash.Hash; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@@ -38,6 +39,8 @@ public class DataTowerServiceImpl implements DataTowerService { |
|
|
|
@Autowired |
|
|
|
WxCarCmdLogMapper wxCarCmdLogMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> queryRunning(String tenantId) { |
|
|
|
WxShop wxShop = new WxShop(); |
|
|
|
@@ -175,9 +178,74 @@ public class DataTowerServiceImpl implements DataTowerService { |
|
|
|
datamap.put("lasthb","--"); |
|
|
|
} |
|
|
|
|
|
|
|
params.put("startdate",systemTime+" 05:00:00"); |
|
|
|
params.put("enddate",systemTime+" 22:59:59"); |
|
|
|
|
|
|
|
List<Map<String,Object>> todayCarlist=wxCarCmdLogMapper.queryTodayCar(params); |
|
|
|
Map<Object, Object> todaycollect = todayCarlist.stream().collect(Collectors.toMap(m -> { |
|
|
|
return m.get("create_time"); |
|
|
|
}, m -> { |
|
|
|
return m.get("carcount"); |
|
|
|
})); |
|
|
|
TreeMap todaytreemap = getTimeTreeMap(); |
|
|
|
todaytreemap.putAll(todaycollect); |
|
|
|
|
|
|
|
datamap.put("todaycar",todaytreemap); |
|
|
|
|
|
|
|
String yesterday = DateUtils.getTimeBefore(1, new Date()); |
|
|
|
params.put("startdate",yesterday+" 05:00:00"); |
|
|
|
params.put("enddate",yesterday+" 22:59:59"); |
|
|
|
List<Map<String,Object>> yesterdayCarlist=wxCarCmdLogMapper.queryTodayCar(params); |
|
|
|
Map<Object, Object> yesterdaycollect = yesterdayCarlist.stream().collect(Collectors.toMap(m -> { |
|
|
|
return m.get("create_time"); |
|
|
|
}, m -> { |
|
|
|
return m.get("carcount"); |
|
|
|
})); |
|
|
|
TreeMap yesterdaytreemap = getTimeTreeMap(); |
|
|
|
yesterdaytreemap.putAll(yesterdaycollect); |
|
|
|
|
|
|
|
datamap.put("yesterdaycar",yesterdaytreemap); |
|
|
|
|
|
|
|
|
|
|
|
params.put("startdate",startdate+" 05:00:00"); |
|
|
|
params.put("enddate",startdate+" 22:59:59"); |
|
|
|
List<Map<String,Object>> lastdayCarlist=wxCarCmdLogMapper.queryTodayCar(params); |
|
|
|
Map<Object, Object> lastdaycollect = lastdayCarlist.stream().collect(Collectors.toMap(m -> { |
|
|
|
return m.get("create_time"); |
|
|
|
}, m -> { |
|
|
|
return m.get("carcount"); |
|
|
|
})); |
|
|
|
TreeMap lastdaytreemap = getTimeTreeMap(); |
|
|
|
lastdaytreemap.putAll(lastdaycollect); |
|
|
|
datamap.put("lastdaycar",lastdaytreemap); |
|
|
|
|
|
|
|
|
|
|
|
return datamap; |
|
|
|
} |
|
|
|
|
|
|
|
public TreeMap getTimeTreeMap(){ |
|
|
|
TreeMap<Object,Object> timemap=new TreeMap(); |
|
|
|
timemap.put("06:00",0); |
|
|
|
timemap.put("07:00",0); |
|
|
|
timemap.put("08:00",0); |
|
|
|
timemap.put("09:00",0); |
|
|
|
timemap.put("10:00",0); |
|
|
|
timemap.put("11:00",0); |
|
|
|
timemap.put("12:00",0); |
|
|
|
timemap.put("13:00",0); |
|
|
|
timemap.put("14:00",0); |
|
|
|
timemap.put("15:00",0); |
|
|
|
timemap.put("16:00",0); |
|
|
|
timemap.put("17:00",0); |
|
|
|
timemap.put("18:00",0); |
|
|
|
timemap.put("19:00",0); |
|
|
|
timemap.put("20:00",0); |
|
|
|
timemap.put("21:00",0); |
|
|
|
timemap.put("22:00",0); |
|
|
|
timemap.put("23:00",0); |
|
|
|
return timemap; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |