@ -2,25 +2,20 @@ package com.kms.yxgh.sz.controller;
import com.baomidou.mybatisplus.core.metadata.IPage ;
import com.kms.yxgh.base.Response ;
import com.kms.yxgh.sz.domain.SzPlan ;
import com.kms.yxgh.sz.dto.SzPlanDetailDto ;
import com.kms.yxgh.sz.dto.SzPlanSimpleDto ;
import com.kms.yxgh.sz.dto.SzPointDto ;
import com.kms.yxgh.sz.domain.SzPlan ;
import com.kms.yxgh.sz.service.SzPlanService ;
import com.shuili.common.annotation.Log ;
import com.shuili.common.core.domain.SearchParam ;
import com.shuili.common.enums.BusinessType ;
import io.swagger.annotations.Api ;
import io.swagger.annotations.ApiOperation ;
import java.util.List ;
import lombok.AllArgsConstructor ;
import org.springframework.web.bind.annotation.DeleteMapping ;
import org.springframework.web.bind.annotation.GetMapping ;
import org.springframework.web.bind.annotation.PathVariable ;
import org.springframework.web.bind.annotation.PostMapping ;
import org.springframework.web.bind.annotation.PutMapping ;
import org.springframework.web.bind.annotation.RequestBody ;
import org.springframework.web.bind.annotation.RequestMapping ;
import org.springframework.web.bind.annotation.RestController ;
import org.springframework.web.bind.annotation.* ;
import java.util.List ;
/ * *
@ -35,70 +30,70 @@ import org.springframework.web.bind.annotation.RestController;
@Api ( tags = "水闸巡视检查计划" )
public class SzPlanController {
private final SzPlanService szPlanService ;
private final SzPlanService szPlanService ;
/ * *
* 查询水闸巡视检查计划列表
* /
@PostMapping ( "/list" )
@ApiOperation ( "水闸巡视检查计划列表" )
public IPage < SzPlan > list ( @RequestBody SearchParam < SzPlan > sp ) {
return szPlanService . selectPage ( sp ) ;
}
/ * *
* 查询水闸巡视检查计划列表
* /
@PostMapping ( "/list" )
@ApiOperation ( "水闸巡视检查计划列表" )
public IPage < SzPlanSimpleDto > list ( @RequestBody SearchParam < SzPlan > sp ) {
return szPlanService . search ( sp ) ;
}
/ * *
* 获取水闸巡视检查计划详细信息
* /
@ApiOperation ( " 水闸巡视检查计划详情" )
@GetMapping ( value = "/{id}" )
public Response < SzPlanDetailDto > getInfo ( @PathVariable ( "id" ) String id ) {
return Response . ok ( szPlanService . getDetailById ( id ) ) ;
}
/ * *
* 获取水闸巡视检查计划详细信息
* /
@ApiOperation ( " 水闸巡视检查计划详情" )
@GetMapping ( value = "/{id}" )
public Response < SzPlanDetailDto > getInfo ( @PathVariable ( "id" ) String id ) {
return Response . ok ( szPlanService . getDetailById ( id ) ) ;
}
/ * *
* 新增水闸巡视检查计划
* /
@Log ( title = "水闸巡视检查计划新增" , businessType = BusinessType . INSERT )
@PostMapping
@ApiOperation ( "水闸巡视检查计划新增" )
public Response < SzPlanDetailDto > add ( @RequestBody SzPlanDetailDto SzPlan ) {
return Response . ok ( szPlanService . add ( SzPlan ) ) ;
}
/ * *
* 新增水闸巡视检查计划
* /
@Log ( title = "水闸巡视检查计划新增" , businessType = BusinessType . INSERT )
@PostMapping
@ApiOperation ( "水闸巡视检查计划新增" )
public Response < SzPlanDetailDto > add ( @RequestBody SzPlanDetailDto SzPlan ) {
return Response . ok ( szPlanService . add ( SzPlan ) ) ;
}
/ * *
* 修改水闸巡视检查计划
* /
@ApiOperation ( "水闸巡视检查计划修改" )
@Log ( title = "水闸巡视检查计划修改" , businessType = BusinessType . UPDATE )
@PutMapping
public Response < SzPlanDetailDto > edit ( @RequestBody SzPlanDetailDto SzPlan ) {
return Response . ok ( szPlanService . update ( SzPlan ) ) ;
}
/ * *
* 修改水闸巡视检查计划
* /
@ApiOperation ( "水闸巡视检查计划修改" )
@Log ( title = "水闸巡视检查计划修改" , businessType = BusinessType . UPDATE )
@PutMapping
public Response < SzPlanDetailDto > edit ( @RequestBody SzPlanDetailDto SzPlan ) {
return Response . ok ( szPlanService . update ( SzPlan ) ) ;
}
/ * *
* 删除水闸巡视检查计划
* /
@ApiOperation ( "水闸巡视检查计划删除" )
@Log ( title = "水闸巡视检查计划删除" , businessType = BusinessType . DELETE )
@DeleteMapping ( "/{id}" )
public Response < Boolean > remove ( @PathVariable String id ) {
return Response . ok ( szPlanService . deleteById ( id ) ) ;
}
/ * *
* 删除水闸巡视检查计划
* /
@ApiOperation ( "水闸巡视检查计划删除" )
@Log ( title = "水闸巡视检查计划删除" , businessType = BusinessType . DELETE )
@DeleteMapping ( "/{id}" )
public Response < Boolean > remove ( @PathVariable String id ) {
return Response . ok ( szPlanService . deleteById ( id ) ) ;
}
@ApiOperation ( "水闸巡视检查计划巡查点设置" )
@Log ( title = "水闸巡视检查计划巡查点设置" , businessType = BusinessType . UPDATE )
@PostMapping ( "/points/{id}" )
public Response < Boolean > addPoints ( @PathVariable ( "id" ) String id ,
@RequestBody List < SzPointDto > points ) {
return Response . ok ( szPlanService . addPoints ( id , points ) ) ;
}
@ApiOperation ( "水闸巡视检查计划巡查点设置" )
@Log ( title = "水闸巡视检查计划巡查点设置" , businessType = BusinessType . UPDATE )
@PostMapping ( "/points/{id}" )
public Response < Boolean > addPoints ( @PathVariable ( "id" ) String id ,
@RequestBody List < SzPointDto > points ) {
return Response . ok ( szPlanService . addPoints ( id , points ) ) ;
}
@ApiOperation ( "水闸巡视检查计划巡查点位数据" )
@Log ( title = "水闸巡视检查计划巡查点位数据" , businessType = BusinessType . SEARCH )
@GetMapping ( "/points/{id}" )
public Response < List < SzPointDto > > addPoints ( @PathVariable ( "id" ) String id ) {
return Response . ok ( szPlanService . getPoints ( id ) ) ;
}
@ApiOperation ( "水闸巡视检查计划巡查点位数据" )
@Log ( title = "水闸巡视检查计划巡查点位数据" , businessType = BusinessType . SEARCH )
@GetMapping ( "/points/{id}" )
public Response < List < SzPointDto > > addPoints ( @PathVariable ( "id" ) String id ) {
return Response . ok ( szPlanService . getPoints ( id ) ) ;
}
}