feiyu02
9 天以前 85ef942e7195abeb71466b7159c3ee30161e1e54
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
62
63
64
65
66
67
68
69
70
71
72
73
74
package cn.flightfeather.supervision.lightshare.web
 
import cn.flightfeather.supervision.lightshare.service.DataProductService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.ExcelConfigVo
import cn.flightfeather.supervision.lightshare.vo.dataprod.QueryOpt
import cn.flightfeather.supervision.model.dataproduct.DataProdOption
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
import springfox.documentation.annotations.ApiIgnore
import javax.servlet.http.HttpServletResponse
 
/**
 * 数据产品相关API接口
 * @date 2024/10/18
 * @author feiyu02
 */
@Api(tags = ["数据产品相关API接口"], description = "数据产品相关API接口")
@RestController
@RequestMapping("/dataProduct")
class DataProductController(private val dataProductService: DataProductService) {
 
    @ApiOperation(value = "下载数据产品报告")
    @PostMapping("/download")
    fun downloadProduct(
        @ApiParam("区域条件信息") @RequestBody areaVo: AreaVo,
        @ApiParam("报告类型", allowableValues = "1:问题与整改汇总分析与动态跟踪清单;2:规范性评估与分析清单;3:问题与整改分布分析清单;")
        @RequestParam type: Int,
        @ApiParam("是否强制生成新的报告") @RequestParam forceUpdate: Boolean,
        @ApiIgnore response: HttpServletResponse,
    ) = dataProductService.downloadProduct(areaVo, type, forceUpdate, response)
 
    @ApiOperation(value = "获取问题整改清单")
    @PostMapping("/problemChange")
    fun problemChangeList(
        @ApiParam("查询条件") @RequestBody option: DataProdOption,
    ) = dataProductService.problemChangeList(option)
 
    @ApiOperation(value = "获取问题复发情况")
    @PostMapping("/problemRecurrence")
    fun problemRecurrence(
        @ApiParam("查询条件") @RequestBody option: DataProdOption,
    ) = dataProductService.problemRecurrence(option)
 
 
 
 
 
 
    @ApiOperation(value = "查询数据产品项及对应的统计状态")
    @GetMapping("/type/query")
    fun findProductType(
        @ApiParam("产品类型", allowableValues = "base, middle, final", format = "base") @RequestParam types: String,
    ) {
 
    }
 
    @ApiOperation(value = "查询数据产品记录")
    @PostMapping("/record/query")
    fun findProduct(
        @ApiParam("查询条件") @RequestBody queryOpt: QueryOpt,
        @ApiParam("页码") @RequestParam(value = "page", required = false, defaultValue = "1") page: Int?,
        @ApiParam("单页数据量") @RequestParam(value = "perPage", required = false, defaultValue = "30") perPage: Int?,
    ) {
        // 根据产品类型编号、区域、时段、场景类型、配置id查询
        return dataProductService.findProduct(queryOpt, page ?: 1, perPage ?: 30)
    }
 
//    @ApiOperation(value = "生成数据产品")
//    @PostMapping("/generate")
//    fun generateProduct() = dataProductService.generateProduct()
}