Browse Source

1、事件增加上报类型自动;2、dsp推送的问题,事件类型增加自动上报字段;

develop
wanjing 9 months ago
parent
commit
57410ae4ce
7 changed files with 54 additions and 10 deletions
  1. +9
    -0
      tuoheng-service/tuoheng-admin/sql/sql_change_v1.3.7.sql
  2. +5
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/Accident.java
  3. +27
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/accident/AccidentReportTypeEnum.java
  4. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/ignore/AccidentIgnoreService.java
  5. +2
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java
  6. +3
    -2
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/AccidentMapper.xml
  7. +7
    -7
      tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/service/DspCallbackServiceTest.java

+ 9
- 0
tuoheng-service/tuoheng-admin/sql/sql_change_v1.3.7.sql View File

@@ -0,0 +1,9 @@
-- 2024-01-19 11:20
-- v1.3.7

use tuoheng_freeway;


-- 事件表
alter table tuoheng_freeway.th_accident add report_type tinyint(1) default 1 not null comment '上报类型:1:自动上报(默认);2:手动上报' after dept_id;


+ 5
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/Accident.java View File

@@ -32,6 +32,11 @@ public class Accident extends BaseEntity {
*/
private String deptId;

/**
* 上报类型:1:自动上报(默认);2:手动上报
*/
private Integer reportType;

/**
* 巡检任务id
*/

+ 27
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/enums/accident/AccidentReportTypeEnum.java View File

@@ -0,0 +1,27 @@
package com.tuoheng.admin.enums.accident;

import lombok.Getter;

/**
* 事件上报类型
*
* @author wanjing
* @team tuoheng
* @date 2024-01-19
*/
public enum AccidentReportTypeEnum {

AUTO(1,"自动上报"),
MANUAL(2,"手动上报"),;

AccidentReportTypeEnum(int code, String description){
this.code = code;
this.description = description;
}

@Getter
private int code;

@Getter
private String description;
}

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/ignore/AccidentIgnoreService.java View File

@@ -32,7 +32,7 @@ public class AccidentIgnoreService {
private AccidentMapper accidentMapper;

public JsonResult ignore(String id) {
// log.info("进入忽略事故业务");
// log.info("进入忽略事故业务, id={}", id);
User user = CurrentUserUtil.getUserInfo();
String userId = user.getId();
String tenantId = user.getTenantId();

+ 2
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallbackServiceImpl.java View File

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.entity.*;
import com.tuoheng.admin.enums.*;
import com.tuoheng.admin.enums.accident.AccidentReportTypeEnum;
import com.tuoheng.admin.mapper.*;
import com.tuoheng.admin.request.third.DspCallbackRequest;
import com.tuoheng.admin.request.third.QuestionFile;
@@ -335,6 +336,7 @@ public class DspCallbackServiceImpl implements IDspCallbackService {
}
Accident accident = new Accident();
//问题类型为应急类型时添加数据
accident.setReportType(AccidentReportTypeEnum.AUTO.getCode());
accident.setTenantId(inspectionFile.getTenantId());
accident.setInspectionId(inspectionFile.getInspectionId());
accident.setInspectionFileId(inspectionFile.getId());

+ 3
- 2
tuoheng-service/tuoheng-admin/src/main/resources/mapper/AccidentMapper.xml View File

@@ -6,6 +6,7 @@
<result property="id" column="id" />
<result property="tenantId" column="tenant_id" />
<result property="deptId" column="dept_id" />
<result property="reportType" column="report_type" />
<result property="inspectionId" column="inspection_id" />
<result property="inspectionFileId" column="inspection_file_id" />
<result property="accidentInspectionId" column="accident_inspection_id" />
@@ -42,13 +43,13 @@


<sql id="Base_Column_List">
id, tenant_id, dept_id, inspection_id, inspection_file_id, accident_inspection_id, road_id, road_code, section_id, section_name, question_id, question_code, question_name,
id, tenant_id, dept_id, report_type, inspection_id, inspection_file_id, accident_inspection_id, road_id, road_code, section_id, section_name, question_id, question_code, question_name,
is_casualties, is_driving_safety, is_fire, record, longitude, latitude, uav_return, status, create_user, create_time, update_user, update_time,
check_user, check_time, check_result, verification_time, report_time, no_accident_time, ignore_time, end_time, flag, mark
</sql>

<sql id="selectThAccidentVo">
select id, tenant_id, dept_id, inspection_id, inspection_file_id, accident_inspection_id, road_id, road_code, section_id, section_name, question_id, question_code, question_name,
select id, tenant_id, dept_id, report_type, inspection_id, inspection_file_id, accident_inspection_id, road_id, road_code, section_id, section_name, question_id, question_code, question_name,
is_casualties, is_driving_safety, is_fire, record, longitude, latitude, uav_return, status, create_user, create_time, update_user, update_time,
check_user, check_time, check_result, verification_time, report_time, no_accident_time, ignore_time, end_time, flag, mark
from th_accident

+ 7
- 7
tuoheng-service/tuoheng-admin/src/test/java/com/tuoheng/admin/service/DspCallbackServiceTest.java View File

@@ -38,18 +38,18 @@ public class DspCallbackServiceTest {

@Test
public void testGetOneById() {
String requestId = "369567d311de473886c40a5c85305493";
String requestId = "c4da0ec5d77b46d6992f9f9462fb1bc3";
DspCallbackRequest dspCallbackRequest = new DspCallbackRequest();
dspCallbackRequest.setAnalyseStatus(2);
dspCallbackRequest.setAnalyseStatus(10);
dspCallbackRequest.setType(1);

List<QuestionFile> questionFiles = new ArrayList<>();
QuestionFile questionFile = new QuestionFile();
questionFile.setFileCode("PVR2024010815484594512");
questionFile.setFileName("2024-01-08-15-48-45_frame-52-332_type_20240108154845591880-1-003-1_AI.jpg");
questionFile.setFileOriginalUrl("https://image.t-aaron.com/369567d311de473886c40a5c85305493/2024-01-08-15-48-45_frame-52-332_type_20240108154845581518-1-0-0_OR.jpg");
questionFile.setFileMarkerUrl("https://image.t-aaron.com/369567d311de473886c40a5c85305493/2024-01-08-15-48-45_frame-52-332_type_20240108154845591880-1-003-1_AI.jpg");
questionFile.setAnalyseTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, "2024-01-08 15:48:45"));
questionFile.setFileCode("PBS2024011110351459454");
questionFile.setFileName("2024-01-11-10-35-14_frame-2926-3206_type_20240111103514148029-1-003-1_AI.jpg");
questionFile.setFileOriginalUrl("https://image.t-aaron.com/c4da0ec5d77b46d6992f9f9462fb1bc3/2024-01-11-10-35-14_frame-2926-3206_type_20240111103514141070-1-0-0_OR.jpg");
questionFile.setFileMarkerUrl("https://image.t-aaron.com/c4da0ec5d77b46d6992f9f9462fb1bc3/2024-01-11-10-35-14_frame-2926-3206_type_20240111103514148029-1-003-1_AI.jpg");
questionFile.setAnalyseTime(DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, "2024-01-11 10:35:14"));
questionFile.setQuestionName("车辆");
questionFile.setQuestionCode("003008");
questionFiles.add(questionFile);

Loading…
Cancel
Save