ParkHeatmapServiceImpl.java
3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package com.zteits.park.biz;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xiaoleilu.hutool.util.CollectionUtil;
import com.zteits.clouds.api.apibase.bean.BizResult;
import com.zteits.clouds.api.dto.govclouds.dto.ParkinglotHeatmapDayDTO;
import com.zteits.clouds.api.dto.govclouds.dto.ParkinglotHeatmapHourDTO;
import com.zteits.clouds.api.dto.govclouds.param.QueryHeatmapByDateRequest;
import com.zteits.clouds.api.service.govclouds.ParkHeatmapService;
import com.zteits.park.biz.berths.query.ParkFreeBerthQueryServiceImpl;
import com.zteits.park.dao.ParkinglotHeatmapDayDao;
import com.zteits.park.dao.ParkinglotHeatmapHourDao;
import com.zteits.park.domain.ParkinglotHeatmapDay;
import com.zteits.park.domain.ParkinglotHeatmapHour;
/**
*
* .<br/>
*
* Copyright: Copyright (c) 2017 zteits
*
* @ClassName: ParkHeatmapServiceImpl
* @Description:
* @version: v1.0.0
* @author: xiejianpeng
* @date: 2017年7月11日 上午11:01:26
* Modification History:
* Date Author Version Description
*---------------------------------------------------------*
* 2017年7月11日 xiejianpeng v1.0.0 创建
*/
@Service("com.zteits.park.biz.ParkHeatmapServiceImpl")
public class ParkHeatmapServiceImpl implements ParkHeatmapService{
private static final Logger logger = LoggerFactory.getLogger(ParkFreeBerthQueryServiceImpl.class);
@Autowired
private ParkinglotHeatmapHourDao parkinglotHeatmapHourDao;
@Autowired
private ParkinglotHeatmapDayDao parkinglotHeatmapDayDao;
@Override
public BizResult<List<ParkinglotHeatmapHourDTO>> queryParkHeatmapByHour(QueryHeatmapByDateRequest request) {
List<ParkinglotHeatmapHour> heatmapList = parkinglotHeatmapHourDao.queryParkHeatmapByHour(
request.getProvId(),request.getCityId(),request.getQueryDate());
List<ParkinglotHeatmapHourDTO> heatmapDTOList = new ArrayList<ParkinglotHeatmapHourDTO>();
if(CollectionUtil.isNotEmpty(heatmapList)){
for(ParkinglotHeatmapHour heatmapHour:heatmapList){
ParkinglotHeatmapHourDTO heatmapHourDTO = new ParkinglotHeatmapHourDTO();
BeanUtils.copyProperties(heatmapHour, heatmapHourDTO);
heatmapDTOList.add(heatmapHourDTO);
}
}
return new BizResult<>(heatmapDTOList);
}
@Override
public BizResult<List<ParkinglotHeatmapDayDTO>> queryParkHeatmapByDay(QueryHeatmapByDateRequest request) {
List<ParkinglotHeatmapDay> heatmapList = parkinglotHeatmapDayDao.queryParkHeatmapByDay(
request.getProvId(),request.getCityId(),request.getQueryDate());
List<ParkinglotHeatmapDayDTO> heatmapDTOList = new ArrayList<ParkinglotHeatmapDayDTO>();
if(CollectionUtil.isNotEmpty(heatmapList)){
for(ParkinglotHeatmapDay heatmapday:heatmapList){
ParkinglotHeatmapDayDTO heatmapDayDTO = new ParkinglotHeatmapDayDTO();
BeanUtils.copyProperties(heatmapday, heatmapDayDTO);
heatmapDTOList.add(heatmapDayDTO);
}
}
return new BizResult<>(heatmapDTOList);
}
}