Pārlūkot izejas kodu

自动生成报告显示在当前租户对应的所有用户报告列表中

tags/v1.0.0^2
chengwang pirms 1 gada
vecāks
revīzija
571aa54cab
5 mainītis faili ar 22 papildinājumiem un 5 dzēšanām
  1. +5
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/Report.java
  2. +1
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/generate/GenerateReportByAutoService.java
  3. +13
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryReportPageListService.java
  4. +1
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/application-local.yml
  5. +2
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/ReportMapper.xml

+ 5
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/entity/Report.java Parādīt failu

@@ -275,4 +275,9 @@ public class Report extends BaseEntity {
*/
private String patrolLocation;

/**
* 工单生成:1未自动生成 2自动生成
*/
private Integer autoGenerate;

}

+ 1
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/generate/GenerateReportByAutoService.java Parādīt failu

@@ -67,6 +67,7 @@ public class GenerateReportByAutoService {
report.setInspectionId(inspection.getId());
report.setInspectionCode(inspection.getCode());
report.setInspectionName(inspection.getName());
report.setAutoGenerate(2);
report.setCreateUser("");
report.setCreateTime(DateUtils.now());
return report;

+ 13
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryReportPageListService.java Parādīt failu

@@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@@ -70,13 +71,22 @@ public class QueryReportPageListService {

// 设置分页参数
IPage<Report> page = new Page<>(request.getPage(), request.getLimit());
// 用户只能查看自己生成的报告
request.setCreateUser(userId);
// 用户只能查看自己生成的报告 或者是当前租户下自动生成的报告
//request.setCreateUser(userId);
// 查询结果
IPage<Report> pageData = reportMapper.selectPageList(page, request);

List<Report> reportList = pageData.getRecords();

List<Report> reportsData = new ArrayList<>();
for (Report report : reportList) {
if(report.getCreateUser().equals(userId) || report.getAutoGenerate() == 2){
reportsData.add(report);
}
}

// 构造返回结果对象
List<ReportPageListVo> reportPageListVoList = this.buildReportPageListVoList(pageData.getRecords());
List<ReportPageListVo> reportPageListVoList = this.buildReportPageListVoList(reportsData);

// 重写返回结果对象
IPage<ReportPageListVo> reportVoPageData = new Page<>();

+ 1
- 1
tuoheng-service/tuoheng-admin/src/main/resources/application-local.yml Parādīt failu

@@ -32,7 +32,7 @@ spring:
url: jdbc:mysql://192.168.11.13:3306/tuoheng_telecomumale?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8&useSSL=true&tinyInt1isBit=false
username: root
password: idontcare
# url: jdbc:mysql://rm-uf6z740323e8053pj4o.mysql.rds.aliyuncs.com:3306/tuoheng_airmonitor?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8&useSSL=true&tinyInt1isBit=false
# url: jdbc:mysql://rm-uf6z740323e8053pj4o.mysql.rds.aliyuncs.com:3306/tuoheng_telecomumale?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8&useSSL=true&tinyInt1isBit=false
# username: root
# password: TH22#2022
filter:

+ 2
- 1
tuoheng-service/tuoheng-admin/src/main/resources/mapper/ReportMapper.xml Parādīt failu

@@ -50,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="srtName" column="srt_name" />
<result property="heartbeatTime" column="heartbeat_time" />
<result property="executionStatus" column="execution_status" />
<result property="autoGenerate" column="auto_generate" />
<result property="startLongitude" column="start_longitude" />
<result property="startLatitude" column="start_latitude" />
<result property="endLongitude" column="end_longitude" />
@@ -64,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>

<sql id="selectReportVo">
select id, tenant_id, dept_id, report_code, inspection_id, inspection_code, inspection_name, type, channel_id, channel_name, leg_id, leg_name, inspection_type, airport_id, airport_name, inspection_line, inspection_line_name, equipment_id, equipment_name, equipment_mount_id, equipment_mount_name, cloud_box_id, cloud_box_name, box_sn, flight_hand, flight_hand_name, inspection_time, execution_start_time, execution_end_time, is_live, is_taken, is_tilt, video_url, ai_video_url, report_url, srt_url, status, analyse_status, progressbar, note, weather, fly_height, srt_name, heartbeat_time, execution_status, start_longitude, start_latitude, end_longitude, end_latitude, mobile, patrol_location, create_user, create_time, update_user, update_time, mark from th_report
select id, tenant_id, dept_id, report_code, inspection_id, inspection_code, inspection_name, type, channel_id, channel_name, leg_id, leg_name, inspection_type, airport_id, airport_name, inspection_line, inspection_line_name, equipment_id, equipment_name, equipment_mount_id, equipment_mount_name, cloud_box_id, cloud_box_name, box_sn, flight_hand, flight_hand_name, inspection_time, execution_start_time, execution_end_time, is_live, is_taken, is_tilt, video_url, ai_video_url, report_url, srt_url, status, analyse_status, progressbar, note, weather, fly_height, srt_name, heartbeat_time, execution_status, auto_generate, start_longitude, start_latitude, end_longitude, end_latitude, mobile, patrol_location, create_user, create_time, update_user, update_time, mark from th_report
</sql>

<select id="selectPageList" parameterType="com.tuoheng.admin.request.report.QueryReportPageListRequest" resultMap="ReportResult">

Notiek ielāde…
Atcelt
Saglabāt