Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d4894d4767
|
@ -371,17 +371,19 @@ public class Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("passengerFlow")
|
@RequestMapping("passengerFlow")
|
||||||
//测试
|
//测试获取最新的客流列表,从接口获取
|
||||||
public List<Map> passengerFlow(){
|
public List<Map> passengerFlow(){
|
||||||
List<Map> list = passengerFlowService.passengerFlow();
|
List<Map> list = passengerFlowService.passengerFlow();
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
//从提供方获取最新的实时客流列表
|
//获取最新的实时客流列表,从表获取
|
||||||
@RequestMapping("listPassengerFlow")
|
@RequestMapping("listPassengerFlow")
|
||||||
public List<Map> listPassengerFlow(){
|
public List<PassengerFlow> listPassengerFlow(){
|
||||||
List<Map> list = passengerFlowService.passengerFlow();
|
List<PassengerFlow> list = passengerFlowService.listPassengerFlow();
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取实时客流并保存到表t_passenger_flow
|
//获取实时客流并保存到表t_passenger_flow
|
||||||
@RequestMapping("savePassengerFlow")
|
@RequestMapping("savePassengerFlow")
|
||||||
public Result savePassengerFlow(){
|
public Result savePassengerFlow(){
|
||||||
|
|
|
@ -9,4 +9,5 @@ import java.util.Map;
|
||||||
|
|
||||||
public interface PassengerFlowlMapper extends BaseMapper<PassengerFlow> {
|
public interface PassengerFlowlMapper extends BaseMapper<PassengerFlow> {
|
||||||
void batchSave(List<Map> list);
|
void batchSave(List<Map> list);
|
||||||
|
PassengerFlow getByMaxId();
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,6 +104,16 @@ public class PassengerFlowService {
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
//从表中获取最新的实时客流
|
||||||
|
public List<PassengerFlow> listPassengerFlow(){
|
||||||
|
PassengerFlow passengerFlow = passengerFlowMapper.getByMaxId();
|
||||||
|
String timeId = passengerFlow.getTimeId();
|
||||||
|
|
||||||
|
QueryWrapper<PassengerFlow> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq("time_id",timeId);
|
||||||
|
List<PassengerFlow> lists = passengerFlowMapper.selectList(wrapper);
|
||||||
|
return lists;
|
||||||
|
}
|
||||||
@Scheduled(cron = "0 31 10-22/1 * * ? ")
|
@Scheduled(cron = "0 31 10-22/1 * * ? ")
|
||||||
//提供的接口能查到当前时间2个小时之前的数据,每隔15分钟一次,我们只取整点从早8点到晚8点的整点数据
|
//提供的接口能查到当前时间2个小时之前的数据,每隔15分钟一次,我们只取整点从早8点到晚8点的整点数据
|
||||||
//10:31 到晚上10:31,每小时的31分执行一次
|
//10:31 到晚上10:31,每小时的31分执行一次
|
||||||
|
|
|
@ -14,4 +14,8 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<select id="getByMaxId" resultType="com.hisense.monitormanage.entity.PassengerFlow">
|
||||||
|
select * from t_passenger_flow ORDer by id desc limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
Loading…
Reference in New Issue