Bladeren bron

Merge branch 'develop' of http://192.168.11.14:51037/gitadmin/tuoheng_telecomumale into develop

tags/v1.3.1
wanjing 1 jaar geleden
bovenliggende
commit
88d13348fd
2 gewijzigde bestanden met toevoegingen van 7 en 2 verwijderingen
  1. +6
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/fly/data/FlyDataService.java
  2. +1
    -1
      tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/tzhl/TZHLFlyLogServiceTest.java

+ 6
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/tzhl/service/fly/data/FlyDataService.java Bestand weergeven

private TZHLGetAirportListService getAirportListService; private TZHLGetAirportListService getAirportListService;


public void getFlyData(Inspection inspection) { public void getFlyData(Inspection inspection) {
log.info("执行获取飞行数据操作,inspection:{}",inspection.toString());
String apiPath = TZHLConstant.TIAN_YI_API_FLIGHT_DATA; String apiPath = TZHLConstant.TIAN_YI_API_FLIGHT_DATA;
JSONObject jsonObject = this.jsonObjectRequest(inspection); JSONObject jsonObject = this.jsonObjectRequest(inspection);
String dataJson = callTianYiPlatformService.callPost(apiPath, jsonObject); String dataJson = callTianYiPlatformService.callPost(apiPath, jsonObject);
log.info("获取飞行数据dataJson:{}",dataJson);


List<TZHLAirportFlightDataResponse> flightDataHlList = JSON.parseArray(dataJson, TZHLAirportFlightDataResponse.class); List<TZHLAirportFlightDataResponse> flightDataHlList = JSON.parseArray(dataJson, TZHLAirportFlightDataResponse.class);


* @return * @return
*/ */
private void addFlightDataHl(Inspection inspection, List<TZHLAirportFlightDataResponse> flightDataHlList) { private void addFlightDataHl(Inspection inspection, List<TZHLAirportFlightDataResponse> flightDataHlList) {
log.info("开始飞行数据保存入库");
if(CollectionUtil.isNotEmpty(flightDataHlList) && flightDataHlList.size() != 0){ if(CollectionUtil.isNotEmpty(flightDataHlList) && flightDataHlList.size() != 0){
List<FlightDataHl> flightDataHls = new ArrayList<>(flightDataHlList.size()); List<FlightDataHl> flightDataHls = new ArrayList<>(flightDataHlList.size());
for (TZHLAirportFlightDataResponse responseData : flightDataHlList) { for (TZHLAirportFlightDataResponse responseData : flightDataHlList) {
throw new SecurityException("飞行数据插入失败"); throw new SecurityException("飞行数据插入失败");
} }
flightDataHls.add(flightDataHl); flightDataHls.add(flightDataHl);
log.info("结束飞行数据保存入库, flightDataHls:{}",flightDataHls);


} }
//将最新的一条数据存入缓存,并设置过期时间 //将最新的一条数据存入缓存,并设置过期时间
log.info("开始存入最新一条数据于缓存中");
if(CollectionUtil.isNotEmpty(flightDataHls) && flightDataHls.size()>0){ if(CollectionUtil.isNotEmpty(flightDataHls) && flightDataHls.size()>0){
flightDataHls = flightDataHls.stream().sorted(Comparator.comparing(FlightDataHl::getCreateTime).reversed()).collect(Collectors.toList()); flightDataHls = flightDataHls.stream().sorted(Comparator.comparing(FlightDataHl::getCreateTime).reversed()).collect(Collectors.toList());
//倒序排列的第一个最新数据保存到缓存 //倒序排列的第一个最新数据保存到缓存
* @return * @return
*/ */
private void getCreateTime(Inspection inspection,JSONObject jsonObject) { private void getCreateTime(Inspection inspection,JSONObject jsonObject) {
String tenantId = CurrentUserUtil.getTenantId();
String tenantId = inspection.getTenantId();


List<FlightDataHl> flightDataHl = flightDataHlMapper.selectList(new LambdaQueryWrapper<FlightDataHl>() List<FlightDataHl> flightDataHl = flightDataHlMapper.selectList(new LambdaQueryWrapper<FlightDataHl>()
.eq(FlightDataHl::getMark, MarkEnum.VALID.getCode()) .eq(FlightDataHl::getMark, MarkEnum.VALID.getCode())

+ 1
- 1
tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/tzhl/TZHLFlyLogServiceTest.java Bestand weergeven



@Test @Test
public void testFlyLog() { public void testFlyLog() {
String id = "da5da2c67dc152de5e43c7e7a104bfcf";
String id = "d51d654e4b8aae6533cbdd997af100d9";
Inspection inspection = inspectionMapper.selectById(id); Inspection inspection = inspectionMapper.selectById(id);
flyLogService.getFlyLog(inspection); flyLogService.getFlyLog(inspection);
} }

Laden…
Annuleren
Opslaan