广州市综治平台后端
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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());
        }
    }