package cn.huge.module.cases.controller.web; import cn.huge.base.common.utils.ReturnFailUtils; import cn.huge.base.common.utils.ReturnSucUtils; import cn.huge.module.cases.domain.dto.CaseAndEventInfoDTO; import cn.huge.module.cases.service.ThGridCitizenEventService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; /** * @title: 市民工单事件表接口api-web端 * @description: 市民工单事件表接口api-web端 * @company: hugeinfo * @time: 2024-09-25 10:00:00 * @version: 1.0.0 */ @Slf4j @RestController @RequestMapping("/api/web/thGridCitizenEvent") @Api(tags = "市民工单事件管理接口") public class ThGridCitizenEventWebController { @Autowired private ThGridCitizenEventService thGridCitizenEventService; @Autowired(required = false) private HttpServletRequest request; /** * 根据案件ID整合案件信息和工单信息 * * @param caseId 案件ID * @return 整合后的案件和工单信息 */ @GetMapping("/getCaseAndEventInfo") @ApiOperation(value = "根据案件ID整合案件信息和工单信息", notes = "根据案件ID整合案件信息和工单信息,包含申请人、编号、二维码、纠纷类型等信息") public Object getCaseAndEventInfo( @ApiParam(name = "caseId", value = "案件ID", required = true) @RequestParam(value = "caseId") String caseId) { if (StringUtils.isBlank(caseId)) { return ReturnFailUtils.getRepInfo("案件ID不能为空"); } try { CaseAndEventInfoDTO dto = thGridCitizenEventService.integrateCaseAndEventInfo(caseId); if (dto == null) { return ReturnFailUtils.getRepInfo("未找到相关案件和工单信息"); } return ReturnSucUtils.getRepInfo(dto); } catch (Exception e) { log.error("查询案件和工单信息异常", e); return ReturnFailUtils.getRepInfo("查询案件和工单信息异常: " + e.getMessage()); } } }