Commit 97964bc6 by 林冲

feat(checkreport): 新增车辆检测报告管理模块

- 创建车辆检测报告实体类及日志实体类,映射数据库表结构
- 新增请求、响应DTO类支持报告创建、详情、分页、导出等功能
- 实现车辆检测报告分页查询、详情查询、新增任务及导出接口
- 添加枚举类定义报告类型和状态,方便业务逻辑使用
- 实现异步服务支持Token获取、状态查询和事故报告解析
- 实现定时任务服务处理生成中报告轮询和未解析报告解析
- 集成Feign远程调用接口,支持跨模块调用车辆检测报告服务
- 完善Mapper接口及XML,支持复杂查询条件和分页处理
- 新增日志服务,记录柠檬查报告调用信息,支持追踪调用过程
- Controller层提供RESTful API接口,支持前端调用及开放文档
- 配置接口请求参数校验和Swagger文档注解
- 优化查询逻辑,支持条件筛选和模糊搜索
- 引入配置参数支持查询超时天数设置,增强系统灵活性
1 parent e6056e68
package com.gsc4cloud.gsc.facade.vpcweb.controller.checkreport;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.facade.vpcweb.anotation.RopSession;
import com.gsc4cloud.gsc.facade.vpcweb.service.checkreport.CheckReportWebService;
import com.gsc4cloud.gsc.vpc.api.dto.web.resdto.checkreport.CheckReportDetailResDTO;
import com.gsc4cloud.gsc.vpc.api.dto.web.resdto.checkreport.CheckReportPageResDTO;
import com.gsc4cloud.gsc.vpc.api.req.PageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.checkreport.CheckReportCreateRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.checkreport.CheckReportDetailRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.checkreport.CheckReportExportRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.checkreport.CheckReportPageRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
/**
* 车辆检测报告管理(Web端)
*
* @author auto-generated
*/
@RestController
@RequestMapping("/checkReport")
@Tag(name = "车辆检测报告管理")
@Slf4j
public class CheckReportWebController {
@Resource
private CheckReportWebService checkReportWebService;
/**
* 分页查询
*/
@Operation(summary = "分页查询")
@PostMapping("/pageList")
public R<Page<CheckReportPageResDTO>> pageList(@RequestBody PageRequest<CheckReportPageRequest> request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return checkReportWebService.pageList(request);
} catch (Exception e) {
log.error("分页查询失败", e);
return R.failed(e.getMessage());
}
}
/**
* 详情
*/
@Operation(summary = "详情")
@PostMapping("/detail")
public R<CheckReportDetailResDTO> detail(@RequestBody CheckReportDetailRequest request) {
log.info("查询详情,id={}", request.getId());
try {
return checkReportWebService.detail(request);
} catch (Exception e) {
log.error("查询详情失败", e);
return R.failed(e.getMessage());
}
}
/**
* 新增查询任务
*/
@Operation(summary = "新增查询任务")
@RopSession
@PostMapping("/create")
public R<Long> create(@RequestBody CheckReportCreateRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return checkReportWebService.create(request);
} catch (Exception e) {
log.error("新增查询任务失败", e);
return R.failed(e.getMessage());
}
}
/**
* 导出报告管理
*/
@Operation(summary = "导出报告管理")
@RopSession
@PostMapping("/export")
public R<String> export(@RequestBody CheckReportExportRequest request) {
log.info("请求参数{}", JSONObject.toJSONString(request));
try {
return checkReportWebService.exportCheckReports(request);
} catch (Exception e) {
log.error("导出报告管理失败", e);
return R.failed(e.getMessage());
}
}
}
package com.gsc4cloud.gsc.facade.vpcweb.service.checkreport;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gsc4cloud.gsc.common.core.util.R;
import com.gsc4cloud.gsc.vpc.api.dto.web.resdto.checkreport.CheckReportDetailResDTO;
import com.gsc4cloud.gsc.vpc.api.dto.web.resdto.checkreport.CheckReportPageResDTO;
import com.gsc4cloud.gsc.vpc.api.feign.checkreport.CheckReportRemote;
import com.gsc4cloud.gsc.vpc.api.req.PageRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.checkreport.CheckReportCreateRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.checkreport.CheckReportDetailRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.checkreport.CheckReportExportRequest;
import com.gsc4cloud.gsc.vpc.api.req.web.checkreport.CheckReportPageRequest;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* 车辆检测报告Web服务
*
* @author auto-generated
*/
@Slf4j
@Service
public class CheckReportWebService {
@Resource
private CheckReportRemote checkReportRemote;
/**
* 分页查询
*/
public R<Page<CheckReportPageResDTO>> pageList(PageRequest<CheckReportPageRequest> request) {
return checkReportRemote.pageList(request);
}
/**
* 详情
*/
public R<CheckReportDetailResDTO> detail(CheckReportDetailRequest request) {
return checkReportRemote.detail(request);
}
/**
* 新增查询任务
*/
public R<Long> create(CheckReportCreateRequest request) {
return checkReportRemote.create(request);
}
/**
* 导出报告管理
*/
public R<String> exportCheckReports(CheckReportExportRequest request) {
return checkReportRemote.exportByIds(request);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!