package cn.flightfeather.supervision.lightshare.web
|
|
import cn.flightfeather.supervision.domain.entity.Company
|
import cn.flightfeather.supervision.domain.entity.PersonalInfo
|
import cn.flightfeather.supervision.domain.entity.SelfPatrolTask
|
import cn.flightfeather.supervision.lightshare.service.AuthService
|
import cn.flightfeather.supervision.lightshare.service.SelfPatrolService
|
import cn.flightfeather.supervision.lightshare.vo.AuthSceneVo
|
import io.swagger.annotations.Api
|
import io.swagger.annotations.ApiOperation
|
import io.swagger.annotations.ApiParam
|
import org.springframework.format.annotation.DateTimeFormat
|
import org.springframework.web.bind.annotation.*
|
import org.springframework.web.multipart.MultipartFile
|
import java.util.*
|
|
@Api(tags = ["应急自巡查相关API接口"])
|
@RestController
|
@RequestMapping("/selfPatrol")
|
class SelfPatrolController(val selfPatrolService: SelfPatrolService) {
|
|
@ApiOperation(value = "获取自巡查类型")
|
@GetMapping("/type")
|
fun getPatrolType(
|
@ApiParam("场景类型id") @RequestParam(value = "sceneType") sceneType: Int
|
) = selfPatrolService.getPatrolType(sceneType)
|
|
@ApiOperation(value = "发布应急自巡查任务")
|
@PostMapping("/publish")
|
fun publishTask(
|
@ApiParam("自巡查任务") @RequestBody tasks: List<SelfPatrolTask>,
|
) = selfPatrolService.publishTask(tasks)
|
|
@ApiOperation(value = "获取该用户发布的自寻查任务")
|
@GetMapping("/task/published")
|
fun getPublishedTask(
|
@ApiParam("发布人id") @RequestParam("userId") userId: String,
|
@ApiParam("发布时间") @RequestParam(value = "date", required = false) date: String?,
|
) = selfPatrolService.getPublishedTask(userId, date)
|
|
@ApiOperation(value = "获取发布给该用户的自巡查任务")
|
@GetMapping("/task/uploaded")
|
fun getToTask(
|
@ApiParam("接收人id") @RequestParam("userId") userId: String,
|
@ApiParam("发布时间") @RequestParam(value = "date", required = false) date: String?,
|
) = selfPatrolService.getToTask(userId, date)
|
|
@ApiOperation(value = "获取自巡查任务的上传记录")
|
@GetMapping("/task/record")
|
fun getTaskRecord(
|
@ApiParam("任务id") @RequestParam("taskId") taskId: String,
|
) = selfPatrolService.getTaskRecord(taskId)
|
|
@ApiOperation(value = "上传自巡查信息")
|
@PostMapping("/task/record/upload")
|
fun uploadSelfPatrol(
|
@ApiParam("用户id") @RequestParam userId: String,
|
@ApiParam("应急自巡查任务id") @RequestParam(required = false) taskId: String?,
|
@ApiParam("自巡查信息json") @RequestParam("params") list: String,
|
@ApiParam("自巡查图片") @RequestPart("images") files: Array<MultipartFile>,
|
) = selfPatrolService.uploadSelfPatrol(userId, taskId, list, files)
|
|
@ApiOperation("上传不涉及自巡查")
|
@PostMapping("/task/record/upload/noInvolved")
|
fun uploadNoSelfPatrol(
|
@RequestParam("userId") userId: String,
|
@ApiParam("应急自巡查任务id") @RequestParam(required = false) taskId: String?,
|
@RequestParam("time") time: String,
|
@RequestParam(required = false) remark: String?,
|
@RequestBody idList: List<Int>,
|
) = selfPatrolService.uploadNoSelfPatrol(userId, taskId, time, remark, idList)
|
|
@ApiOperation(value = "获取用户某类自巡查详情")
|
@GetMapping("/record/detail")
|
fun getDetail(
|
@ApiParam("用户id") @RequestParam userId: String,
|
@ApiParam(value = "自巡查子类型id") @RequestParam subTypeId: Int,
|
@ApiParam(value = "自寻查任务id") @RequestParam taskId: String,
|
) = selfPatrolService.getDetail(userId, subTypeId, taskId)
|
|
@ApiOperation(value = "获取某自巡查任务的详情")
|
@GetMapping("/record/details")
|
fun getDetailList(
|
@ApiParam(value = "自寻查任务id") @RequestParam taskId: String,
|
) = selfPatrolService.getDetailList(taskId)
|
}
|