Browse Source

Merge branch 'develop' of http://192.168.11.14:51037/gitadmin/tuoheng_freeway into feature_v1.0

tags/v1.0.0^2
chengwang 1 year ago
parent
commit
8a14ec8f33
16 changed files with 41 additions and 50 deletions
  1. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/AliyunOssController.java
  2. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/AliyuncsVodController.java
  3. +1
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/FlightDataController.java
  4. +1
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/callback/CloudBoxCallbackoxController.java
  5. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/aliyun/AliyunOssServiceImpl.java
  6. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/aliyun/AliyuncsVodServiceImpl.java
  7. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/aliyun/IAliyunOssService.java
  8. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/aliyun/IAliyuncsVodService.java
  9. +12
    -12
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/flightdata/FlightDataServiceImpl.java
  10. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/flightdata/IFlightDataService.java
  11. +3
    -5
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/flightdata/query/QueryFindFlightDataByInspectionIdService.java
  12. +4
    -10
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/flightdata/query/QueryFindFlightDataService.java
  13. +1
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/flightdata/query/QueryFlightDataTrackService.java
  14. +2
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/AsyncServiceImpl.java
  15. +3
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/InspectionServiceImpl.java
  16. +4
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionPageListService.java

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/AliyunOssController.java View File

@@ -1,8 +1,8 @@
package com.tuoheng.admin.controller;

import com.aliyuncs.sts.model.v20150401.AssumeRoleResponse;
import com.tuoheng.admin.service.IAliyunOssService;
import com.tuoheng.admin.service.impl.AliyunOssServiceImpl;
import com.tuoheng.admin.service.aliyun.IAliyunOssService;
import com.tuoheng.admin.service.aliyun.AliyunOssServiceImpl;
import com.tuoheng.common.core.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/AliyuncsVodController.java View File

@@ -1,6 +1,6 @@
package com.tuoheng.admin.controller;

import com.tuoheng.admin.service.IAliyuncsVodService;
import com.tuoheng.admin.service.aliyun.IAliyuncsVodService;
import com.tuoheng.common.core.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;

+ 1
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/FlightDataController.java View File

@@ -3,8 +3,7 @@ package com.tuoheng.admin.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tuoheng.admin.entity.FlightData;
import com.tuoheng.admin.query.FlightDataQuery;
import com.tuoheng.admin.service.IFlightDataService;
import com.tuoheng.common.core.common.OperationEnum;
import com.tuoheng.admin.service.flightdata.IFlightDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


+ 1
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/callback/CloudBoxCallbackoxController.java View File

@@ -1,10 +1,9 @@
package com.tuoheng.admin.controller.callback;

import com.tuoheng.admin.entity.FlightData;
import com.tuoheng.admin.service.IFlightDataService;
import com.tuoheng.admin.service.flightdata.IFlightDataService;
import com.tuoheng.common.core.common.OperationEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/AliyunOssServiceImpl.java → tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/aliyun/AliyunOssServiceImpl.java View File

@@ -1,4 +1,4 @@
package com.tuoheng.admin.service.impl;
package com.tuoheng.admin.service.aliyun;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
@@ -11,7 +11,7 @@ import com.aliyuncs.profile.IClientProfile;
import com.aliyuncs.sts.model.v20150401.AssumeRoleRequest;
import com.aliyuncs.sts.model.v20150401.AssumeRoleResponse;
import com.tuoheng.admin.config.AliyuncsVodConfig;
import com.tuoheng.admin.service.IAliyunOssService;
import com.tuoheng.admin.service.aliyun.IAliyunOssService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/AliyuncsVodServiceImpl.java → tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/aliyun/AliyuncsVodServiceImpl.java View File

@@ -1,4 +1,4 @@
package com.tuoheng.admin.service.impl;
package com.tuoheng.admin.service.aliyun;

import com.aliyun.oss.ClientException;
import com.aliyun.tea.TeaModel;
@@ -10,7 +10,7 @@ import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.vod.model.v20170321.*;
import com.tuoheng.admin.config.AliyuncsVodConfig;
import com.tuoheng.admin.service.IAliyuncsVodService;
import com.tuoheng.admin.service.aliyun.IAliyuncsVodService;
import com.tuoheng.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/IAliyunOssService.java → tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/aliyun/IAliyunOssService.java View File

@@ -1,4 +1,4 @@
package com.tuoheng.admin.service;
package com.tuoheng.admin.service.aliyun;

import java.net.URL;
import java.util.List;

tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/IAliyuncsVodService.java → tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/aliyun/IAliyuncsVodService.java View File

@@ -1,4 +1,4 @@
package com.tuoheng.admin.service;
package com.tuoheng.admin.service.aliyun;

import com.aliyuncs.vod.model.v20170321.CreateUploadVideoResponse;
import com.aliyuncs.vod.model.v20170321.GetVideoInfoResponse;

tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/FlightDataServiceImpl.java → tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/flightdata/FlightDataServiceImpl.java View File

@@ -1,4 +1,4 @@
package com.tuoheng.admin.service.impl;
package com.tuoheng.admin.service.flightdata;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -8,7 +8,6 @@ import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.mapper.FlightDataMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.query.FlightDataQuery;
import com.tuoheng.admin.service.IFlightDataService;
import com.tuoheng.common.core.common.BaseServiceImpl;
import com.tuoheng.common.core.enums.ServiceExceptionEnum;
import com.tuoheng.common.core.exception.ServiceException;
@@ -40,42 +39,43 @@ public class FlightDataServiceImpl extends BaseServiceImpl<FlightDataMapper, Fli

/**
* 获取巡检任务飞行轨迹坐标列表
*
* @param flightDataQuery
* @return
*/
@Override
public IPage<FlightData> getFlightDataList(FlightDataQuery flightDataQuery) {
if(StringUtils.isEmpty(flightDataQuery.getInspectionId())){
if (StringUtils.isEmpty(flightDataQuery.getInspectionId())) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
QueryWrapper<FlightData> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("inspection_id",flightDataQuery.getInspectionId());
queryWrapper.eq("mark",1);
queryWrapper.eq("inspection_id", flightDataQuery.getInspectionId());
queryWrapper.eq("mark", 1);
//飞机坐标不关联租户id
//queryWrapper.eq("tenant_id", ShiroUtils.getTenantId())
queryWrapper.orderByDesc("id");
//查询分页数据
IPage<FlightData> page = new Page<>(flightDataQuery.getPage(),flightDataQuery.getLimit());
IPage<FlightData> pageData = flightDataMapper.selectPage(page,queryWrapper);
IPage<FlightData> page = new Page<>(flightDataQuery.getPage(), flightDataQuery.getLimit());
IPage<FlightData> pageData = flightDataMapper.selectPage(page, queryWrapper);

return pageData;
}

@Override
public void addCallback(FlightData entity) {
if(entity !=null && StringUtils.isNotEmpty(entity.getBoxSn())){
log.info("addCallback接口入参:"+entity);
if (entity != null && StringUtils.isNotEmpty(entity.getBoxSn())) {
log.info("addCallback接口入参:" + entity);
//查询正在执行的云盒所对应的任务
List<Inspection> inspectionList = inspectionMapper.getListByBox(entity.getBoxSn());
if(StringUtils.isNotEmpty(inspectionList)){
if (StringUtils.isNotEmpty(inspectionList)) {
entity.setTenantId(inspectionList.get(0).getTenantId());
entity.setInspectionId(inspectionList.get(0).getId());
//将最新一条数据存放入缓存,并设置过期时间
redisUtils.set(inspectionList.get(0).getId(),entity,10);
redisUtils.set(inspectionList.get(0).getId(), entity, 10);
}
entity.setCreateTime(DateUtils.now());
flightDataMapper.insert(entity);
log.info("addCallback接口入库成功:"+entity.getId());
log.info("addCallback接口入库成功:" + entity.getId());
}
}
}

tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/IFlightDataService.java → tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/flightdata/IFlightDataService.java View File

@@ -1,4 +1,4 @@
package com.tuoheng.admin.service;
package com.tuoheng.admin.service.flightdata;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tuoheng.admin.entity.FlightData;

tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryFindFlightDataByInspectionIdService.java → tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/flightdata/query/QueryFindFlightDataByInspectionIdService.java View File

@@ -1,7 +1,6 @@
package com.tuoheng.admin.service.inspection.query;
package com.tuoheng.admin.service.flightdata.query;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.entity.FlightData;
import com.tuoheng.admin.mapper.FlightDataMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
@@ -31,7 +30,6 @@ public class QueryFindFlightDataByInspectionIdService {
@Autowired
private RedisUtils redisUtils;


public FlightData getFlightData(String inspectionId) {
//拉取最新一条经纬度信息
// FlightData flightData = flightDataMapper.selectOne(Wrappers.<FlightData>lambdaQuery()
@@ -41,9 +39,9 @@ public class QueryFindFlightDataByInspectionIdService {
//从缓存中拿出遥测数据
Object obj = redisUtils.get(inspectionId);
FlightData flightData = null;
if(ObjectUtil.isNull(obj)){
if (ObjectUtil.isNull(obj)) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}else {
} else {
flightData = (FlightData) obj;
}
return flightData;

tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryFindFlightDataService.java → tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/flightdata/query/QueryFindFlightDataService.java View File

@@ -1,9 +1,8 @@
package com.tuoheng.admin.service.inspection.query;
package com.tuoheng.admin.service.flightdata.query;

import com.tuoheng.admin.entity.FlightData;
import com.tuoheng.admin.enums.code.inspection.QueryInspectionInfoByIdCodeEnum;
import com.tuoheng.admin.mapper.FlightDataMapper;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.common.core.utils.JsonResult;
import com.tuoheng.common.core.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
@@ -22,17 +21,12 @@ import java.util.List;
@Slf4j
public class QueryFindFlightDataService {

@Autowired
private InspectionMapper inspectionMapper;

@Autowired
private FlightDataMapper flightDataMapper;



public JsonResult findFlightData(String id) {
if(StringUtils.isEmpty(id)){
return JsonResult.error(QueryInspectionInfoByIdCodeEnum.INSPECTION_ID_IS_NULL.getCode(),QueryInspectionInfoByIdCodeEnum.INSPECTION_ID_IS_NULL.getMsg());
public JsonResult findFlightData(String id) {
if (StringUtils.isEmpty(id)) {
return JsonResult.error(QueryInspectionInfoByIdCodeEnum.INSPECTION_ID_IS_NULL.getCode(), QueryInspectionInfoByIdCodeEnum.INSPECTION_ID_IS_NULL.getMsg());
}
//根据任务id查询对应的云盒遥测数据
List<FlightData> listData = flightDataMapper.selectListByInspectionId(id);

tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryFlightDataTrackService.java → tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/flightdata/query/QueryFlightDataTrackService.java View File

@@ -1,4 +1,4 @@
package com.tuoheng.admin.service.inspection.query;
package com.tuoheng.admin.service.flightdata.query;

import cn.hutool.core.util.ObjectUtil;
import com.tuoheng.admin.entity.FlightData;
@@ -32,7 +32,6 @@ public class QueryFlightDataTrackService {
@Autowired
private InspectionMapper inspectionMapper;


public OperationEnum track(InspectionRequest inspectionRequest) {
Inspection inspection = inspectionMapper.selectById(inspectionRequest.getRequestId());
if (ObjectUtil.isEmpty(inspection)) {

+ 2
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/AsyncServiceImpl.java View File

@@ -1,7 +1,7 @@
package com.tuoheng.admin.service.impl;

import com.tuoheng.admin.service.AsyncService;
import com.tuoheng.admin.service.IFlightDataService;
import com.tuoheng.admin.service.flightdata.IFlightDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
@@ -9,7 +9,6 @@ import org.springframework.stereotype.Service;

import java.util.List;


/**
* 异步任务接口实现
*/
@@ -21,7 +20,7 @@ public class AsyncServiceImpl implements AsyncService {
private IFlightDataService flightDataService;

@Async("asyncServiceExecutor")
public void flightDataSaveBatch(List list){
public void flightDataSaveBatch(List list) {
log.info("线程-" + Thread.currentThread().getId() + "在执行写入");
flightDataService.saveBatch(list);
}

+ 3
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/InspectionServiceImpl.java View File

@@ -4,6 +4,9 @@ import com.tuoheng.admin.dto.InspectionDto;
import com.tuoheng.admin.entity.FlightData;
import com.tuoheng.admin.mapper.InspectionMapper;
import com.tuoheng.admin.request.inspection.*;
import com.tuoheng.admin.service.flightdata.query.QueryFindFlightDataByInspectionIdService;
import com.tuoheng.admin.service.flightdata.query.QueryFindFlightDataService;
import com.tuoheng.admin.service.flightdata.query.QueryFlightDataTrackService;
import com.tuoheng.admin.service.inspection.add.AddInspectionService;
import com.tuoheng.admin.service.inspection.execute.ExecuteInspectionService;
import com.tuoheng.admin.service.inspection.resubmit.ResubmitInspectionService;

+ 4
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionPageListService.java View File

@@ -121,9 +121,9 @@ public class QueryInspectionPageListService {
if (RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId()) {
pageData = this.getAllList(request);
} else if (RoleEnum.ADMIN.getCode() == user.getRoleId()) {
pageData = this.getListByDept(request);
pageData = this.getListByDept(request, user);
} else if (RoleEnum.ORDINARY_USER.getCode() == user.getRoleId()) {
pageData = this.getListByDept(request);
pageData = this.getListByDept(request, user);
}

if (null == pageData || pageData.getTotal() == 0) {
@@ -191,10 +191,10 @@ public class QueryInspectionPageListService {
* @param request
* @return
*/
private IPage<Inspection> getListByDept(QueryInspectionPageListRequest request) {
private IPage<Inspection> getListByDept(QueryInspectionPageListRequest request, User user) {
// 获取本部门及子孙部门id列表
if (StringUtils.isEmpty(request.getDeptId())) {
List<String> deptIdList = deptMapper.selectAllChildListById(request.getDeptId());
List<String> deptIdList = deptMapper.selectAllChildListById(user.getDeptId());
request.setDeptIdList(deptIdList);
}


Loading…
Cancel
Save