Procházet zdrojové kódy

Merge branch 'release' of gitadmin/tuoheng_freeway into master

tags/v1.0.1
wanjing před 1 rokem
rodič
revize
120f265096
9 změnil soubory, kde provedl 125 přidání a 59 odebrání
  1. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionFileController.java
  2. +3
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspectionfile/QueryInspectionFileDistributionListRequest.java
  3. +10
    -7
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/LiveHandle.java
  4. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/IInspectionFileService.java
  5. +56
    -19
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/InspectionFileServiceImpl.java
  6. +28
    -16
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java
  7. +21
    -7
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionDetailsVo.java
  8. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/InspectionFileMapper.xml
  9. +3
    -3
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WorkOrderServiceImpl.java

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/InspectionFileController.java Zobrazit soubor

@@ -120,8 +120,8 @@ public class InspectionFileController {
* 修改巡检任务问题类型
*/
@PutMapping("/edit/question/{id}/{questionCode}")
public JsonResult editQuestionTyppe(@PathVariable("id") String id, @PathVariable("questionCode") String questionCode) {
public JsonResult editQuestionType(@PathVariable("id") String id, @PathVariable("questionCode") String questionCode) {
log.info("进入修改问题类型接口, id={}, questionCode={}", id, questionCode);
return iInspectionFileService.editQuestionTyppe(id, questionCode);
return iInspectionFileService.editQuestionType(id, questionCode);
}
}

+ 3
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/request/inspectionfile/QueryInspectionFileDistributionListRequest.java Zobrazit soubor

@@ -15,12 +15,12 @@ import java.util.List;
public class QueryInspectionFileDistributionListRequest {

/**
* 任务名称
* 关键字,匹配任务编号和任务名称
*/
private String inspectionName;
private String key;

/**
* 问题类型
* 问题编号
*/
private String questionCode;


+ 10
- 7
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/LiveHandle.java Zobrazit soubor

@@ -23,7 +23,9 @@ public class LiveHandle implements GenerateInspectionFieldHander {
*
* 直播:
* 1)、处于任务飞行中状态时显示直播
* 1)、飞手值飞,创建任务时选择不直播的任务,无此按钮
* 2)、机场巡逻,飞行中的任务,显示【直播】按钮
* 3)、飞手值飞,创建任务时选择不直播的任务,无【直播】按钮
*
*
* @param inspectionVo
*/
@@ -36,17 +38,18 @@ public class LiveHandle implements GenerateInspectionFieldHander {
}
return;
}
if (InspectionTypeEnum.MABNNEDFLIGHT.getCode() != inspectionVo.getInspectionType()) {
if (InspectionTypeEnum.AIRPORT.getCode() == inspectionVo.getInspectionType()) {
inspectionVo.setLive(true);
} else if (InspectionTypeEnum.MABNNEDFLIGHT.getCode() == inspectionVo.getInspectionType()) {
if (null != inspectionVo.getIsLive() && 1 == inspectionVo.getIsLive()) {
inspectionVo.setLive(true);
}
} else {
if (null != handler) {
handler.handler(user, dept, inspectionVo);
}
return;
}

if (null != inspectionVo.getIsLive() && 1 == inspectionVo.getIsLive()) {
inspectionVo.setLive(true);
}

if (null != handler) {
handler.handler(user, dept, inspectionVo);
}

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/IInspectionFileService.java Zobrazit soubor

@@ -97,5 +97,5 @@ public interface IInspectionFileService {
*
* @return
*/
JsonResult editQuestionTyppe(String id, String questionCode);
JsonResult editQuestionType(String id, String questionCode);
}

+ 56
- 19
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/InspectionFileServiceImpl.java Zobrazit soubor

@@ -3,6 +3,7 @@ package com.tuoheng.admin.service.inspectionfile;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.entity.Inspection;
import com.tuoheng.admin.entity.InspectionFile;
@@ -104,25 +105,66 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
public JsonResult getQuestionList() {
//获取当前登录人租户id
String tenantId = CurrentUserUtil.getTenantId();
//获取当前登录人信息
User user = CurrentUserUtil.getUserInfo();
//获取用户角色
Integer roleId = user.getRoleId();
if(roleId ==null){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//查询区域范范围问题
List<InspectionFile> inspectionFileLists = new ArrayList<>();
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(Wrappers.<InspectionFile>lambdaQuery()
.eq(InspectionFile::getMark, 1)
.eq(InspectionFile::getTenantId, tenantId));
if (CollectionUtil.isEmpty(inspectionFileList)) {
return JsonResult.success("该覆盖区域范围内没有问题");
//超级管理员
if(RoleEnum.SUPER_ADMIN.getCode()==roleId){
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(Wrappers.<InspectionFile>lambdaQuery()
.eq(InspectionFile::getMark, 1)
.eq(InspectionFile::getTenantId, tenantId));
if (CollectionUtil.isEmpty(inspectionFileList)) {
return JsonResult.success("该覆盖区域范围内没有问题");
}
for (InspectionFile inspectionFile : inspectionFileList) {
//任务状态判断
if(20 == inspectionFile.getStatus()){
//任务状态判断,已生成工单,问题未解决
Inspection inspection = inspectionMapper.selectById(inspectionFile.getInspectionId());
if (ObjectUtil.isNull(inspection)) {
JsonResult.error("问题所属的任务不存在");
}
inspectionFileLists.add(inspectionFile);
}
}
}
for (InspectionFile inspectionFile : inspectionFileList) {
//任务状态判断
if(20 == inspectionFile.getStatus()){
//任务状态判断,已生成工单,问题未解决
Inspection inspection = inspectionMapper.selectById(inspectionFile.getInspectionId());
if (ObjectUtil.isNull(inspection)) {
JsonResult.error("问题所属的任务不存在");
//部门管理员及普通用户 本部门的问题
if(RoleEnum.ADMIN.getCode()== user.getRoleId() || RoleEnum.ORDINARY_USER.getCode()== user.getRoleId()){
//根据用户查询对应的巡检任务id
List<Inspection> inspectionList = inspectionMapper.selectList(new LambdaQueryWrapper<Inspection>()
.eq(Inspection::getTenantId, tenantId)
.eq(Inspection::getMark, 1)
.eq(Inspection::getDeptId, user.getDeptId()));
//查询对应的问题
for (Inspection inspection : inspectionList) {
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(Wrappers.<InspectionFile>lambdaQuery()
.eq(InspectionFile::getMark, 1)
.eq(InspectionFile::getTenantId, tenantId)
.eq(InspectionFile::getInspectionId, inspection.getId()));
if (CollectionUtil.isEmpty(inspectionFileList)) {
return JsonResult.success("该覆盖区域范围内没有问题");
}
for (InspectionFile inspectionFile : inspectionFileList) {
//任务状态判断
if(20 == inspectionFile.getStatus()){
//任务状态判断,已生成工单,问题未解决
Inspection inspections = inspectionMapper.selectById(inspectionFile.getInspectionId());
if (ObjectUtil.isNull(inspections)) {
JsonResult.error("问题所属的任务不存在");
}
inspectionFileLists.add(inspectionFile);
}
}
inspectionFileLists.add(inspectionFile);
}

}

List<InspectionFileVo> list = inspectionFileLists.stream().map(x -> {
InspectionFileVo vo = new InspectionFileVo();
BeanUtils.copyProperties(x, vo);
@@ -234,11 +276,6 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
vo5.setType(QuestionTypeEnum.LONGITUDINAL_CRACK_NAME.getCode());
vo5.setNum(longitudinalCrackNum);
Collections.addAll(list,vo,vo1,vo2,vo3,vo4,vo5);
// list.add(vo);
// list.add(vo1);
// list.add(vo2);
// list.add(vo3);
// list.add(vo4);
}
//若角色为部门管理员或普通用户
if(RoleEnum.ADMIN.getCode()== user.getRoleId() || RoleEnum.ORDINARY_USER.getCode()== user.getRoleId()){
@@ -419,7 +456,7 @@ public class InspectionFileServiceImpl implements IInspectionFileService {
* @return
*/
@Override
public JsonResult editQuestionTyppe(String id, String questionCode) {
public JsonResult editQuestionType(String id, String questionCode) {
return updateInspectionFileQuestionTypeService.update(id, questionCode);
}
}

+ 28
- 16
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java Zobrazit soubor

@@ -7,7 +7,10 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.*;
import com.tuoheng.admin.enums.AiAnalyseTypeEnum;
import com.tuoheng.admin.enums.FileTypeEnum;
import com.tuoheng.admin.enums.InspectionFileStatusEnum;
import com.tuoheng.admin.enums.SourceEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.request.third.DspCallbackRequest;
import com.tuoheng.admin.request.third.QuestionFile;
@@ -163,7 +166,7 @@ public class DspCallbackServiceImpl implements IDspCallbackService {
inspectionFile.setQuestionCode(questionFile.getQuestionCode());
//问题id
//根据questionCode查询问题类型表出对应的id值
if(StringUtils.isNotEmpty(questionFile.getQuestionCode())){
if (StringUtils.isNotEmpty(questionFile.getQuestionCode())) {
QuestionType questionType = questionTypeMapper.selectOne(Wrappers.<QuestionType>lambdaQuery()
.eq(QuestionType::getCode, questionFile.getQuestionCode())
.eq(QuestionType::getMark, 1));
@@ -211,15 +214,20 @@ public class DspCallbackServiceImpl implements IDspCallbackService {
int second = Integer.parseInt(startFrame) / 25;
long shootTime = inspection.getExecutionStartTime().getTime() + second;
FlightData flightData_off = getFlightDataByTime(flightDataList, shootTime);
if (ObjectUtil.isNotNull(flightData_off)) {
inspectionFile.setLongitude(flightData_off.getLng());
inspectionFile.setLatitude(flightData_off.getLat());
}
JSONObject gaodeCoordinateOff = GaodeUtil.getGaodeCoordinate(flightData_off.getLng(), flightData_off.getLat());
inspectionFile.setLongitude(flightData_off.getLng());
inspectionFile.setLatitude(flightData_off.getLat());
inspectionFile.setGaodeLongitude(gaodeCoordinateOff.getString("longitude"));
inspectionFile.setGaodeLatitude(gaodeCoordinateOff.getString("latitude"));
if (ObjectUtil.isNotNull(gaodeCoordinateOff)) {
inspectionFile.setGaodeLongitude(gaodeCoordinateOff.getString("longitude"));
inspectionFile.setGaodeLatitude(gaodeCoordinateOff.getString("latitude"));
}
String gaodeAddressOff = GaodeUtil.getGaodeAddress(gaodeCoordinateOff.getString("longitude"), gaodeCoordinateOff.getString("latitude"));
inspectionFile.setLocation(gaodeAddressOff);
inspectionFile.setGaodeAddress(gaodeAddressOff);

if (ObjectUtil.isNotNull(gaodeAddressOff)) {
inspectionFile.setLocation(gaodeAddressOff);
inspectionFile.setGaodeAddress(gaodeAddressOff);
}
}
if (online_condition) {
// 实时直播处理
@@ -227,13 +235,17 @@ public class DspCallbackServiceImpl implements IDspCallbackService {
// long time = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, questionFile.getAnalyseTime()).getTime();
FlightData flightData_live = getFlightDataByTime(flightDataList, questionFile.getAnalyseTime().getTime());
log.info("实时坐标:{}", JacksonUtil.obj2StringPretty(flightData_live));
inspectionFile.setLatitude(flightData_live.getLat());
inspectionFile.setLongitude(flightData_live.getLng());
inspectionFile.setGaodeLatitude(flightData_live.getLat());
inspectionFile.setGaodeLongitude(flightData_live.getLng());
if (ObjectUtil.isNotNull(flightData_live)) {
inspectionFile.setLatitude(flightData_live.getLat());
inspectionFile.setLongitude(flightData_live.getLng());
inspectionFile.setGaodeLatitude(flightData_live.getLat());
inspectionFile.setGaodeLongitude(flightData_live.getLng());
}
String gaodeAddress_live = GaodeUtil.getGaodeAddress(flightData_live.getLng(), flightData_live.getLat());
inspectionFile.setLocation(gaodeAddress_live);
inspectionFile.setGaodeAddress(gaodeAddress_live);
if (ObjectUtil.isNotNull(gaodeAddress_live)) {
inspectionFile.setLocation(gaodeAddress_live);
inspectionFile.setGaodeAddress(gaodeAddress_live);
}
}
return inspectionFile;
}).collect(Collectors.toList());
@@ -255,7 +267,6 @@ public class DspCallbackServiceImpl implements IDspCallbackService {
if (CollectionUtils.isEmpty(flightDataList)) {
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取无人机飞行坐标失败!");
}

List<FlightData> flightData = flightDataList.stream().filter(data -> {
try {
return Long.valueOf(data.getTimestamp()) <= time;
@@ -270,4 +281,5 @@ public class DspCallbackServiceImpl implements IDspCallbackService {
}
return flightData.get(0);
}

}

+ 21
- 7
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionDetailsVo.java Zobrazit soubor

@@ -70,13 +70,6 @@ public class InspectionDetailsVo {
*/
private Integer status;

/**
* 计划巡检日期
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date inspectionTime;

/**
* 飞行设备名称
*/
@@ -92,6 +85,27 @@ public class InspectionDetailsVo {
*/
private String weather;

/**
* 计划巡检日期
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date inspectionTime;

/**
* 执行开始时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date executionStartTime;

/**
* 执行结束时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date executionEndTime;

/**
* 飞行失败数据
*/

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/resources/mapper/InspectionFileMapper.xml Zobrazit soubor

@@ -234,7 +234,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join th_inspection ti on tif.inspection_id = ti.id
<where>
<if test="1 == 1"> and tif.mark = 1 </if>
<if test="request.inspectionName != null and request.inspectionName != ''"> and ti.name like concat('%', #{request.inspectionName}, '%') </if>
<if test="request.key != null and request.key != ''"> and (ti.code like concat('%', #{request.key}, '%') or ti.name like concat('%', #{request.key}, '%')) </if>
<if test="request.tenantId != null and request.tenantId != ''"> and tif.tenant_id = #{request.tenantId} </if>
<if test="request.questionCode != null and request.questionCode != ''"> and tif.question_code = #{request.questionCode} </if>
<if test="request.status != null">

+ 3
- 3
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WorkOrderServiceImpl.java Zobrazit soubor

@@ -221,7 +221,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
for (String userId : assignUserId) {
User userInfo = userMapper.selectById(userId);
if (ObjectUtil.isNotNull(userInfo)) {
list.add(userInfo.getUsername());
list.add(userInfo.getRealname());
}
}
String usernames = list.stream().map(String::valueOf).collect(Collectors.joining("、"));
@@ -419,7 +419,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
for (String userId : assignUserId) {
User userInfo = userMapper.selectById(userId);
if (ObjectUtil.isNotNull(userInfo)) {
list.add(userInfo.getUsername());
list.add(userInfo.getRealname());
}
}
String usernames = list.stream().map(String::valueOf).collect(Collectors.joining("、"));
@@ -468,7 +468,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO
for (String userId : assignUserId) {
User userInfo = userMapper.selectById(userId);
if (ObjectUtil.isNotNull(userInfo)) {
list.add(userInfo.getUsername());
list.add(userInfo.getRealname());
}
}
String usernames = list.stream().map(String::valueOf).collect(Collectors.joining("、"));

Načítá se…
Zrušit
Uložit