|
|
@ -3,9 +3,9 @@ package com.kms.yxgh.sz.controller; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.kms.yxgh.base.Response; |
|
|
|
import com.kms.yxgh.common.dto.CommonCheckingTreeDto; |
|
|
|
import com.kms.yxgh.sz.dto.SzCheckingDetailDto; |
|
|
|
import com.kms.yxgh.sz.dto.SimpleSzCheckingDto; |
|
|
|
import com.kms.yxgh.sz.domain.SzChecking; |
|
|
|
import com.kms.yxgh.sz.dto.SimpleSzCheckingDto; |
|
|
|
import com.kms.yxgh.sz.dto.SzCheckingDetailDto; |
|
|
|
import com.kms.yxgh.sz.service.SzCheckingService; |
|
|
|
import com.kms.yxgh.util.BeanCopyUtils; |
|
|
|
import com.shuili.common.annotation.Log; |
|
|
@ -13,16 +13,10 @@ 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; |
|
|
|
|
|
|
|
/** |
|
|
|
* @ClassName: CheckingController |
|
|
@ -38,67 +32,74 @@ import org.springframework.web.bind.annotation.RestController; |
|
|
|
public class SzCheckingController { |
|
|
|
|
|
|
|
|
|
|
|
private final SzCheckingService szCheckingService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询水闸巡视检查列表 |
|
|
|
*/ |
|
|
|
@PostMapping("/list") |
|
|
|
@ApiOperation("水闸巡视检查列表") |
|
|
|
public IPage<SzChecking> list(@RequestBody SearchParam<SzChecking> sp) { |
|
|
|
return szCheckingService.selectPage(sp); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/list-simple") |
|
|
|
@ApiOperation("水闸巡视检查列表-简略信息") |
|
|
|
public Response<List<SimpleSzCheckingDto>> listSimple(SearchParam<SzChecking> sp) { |
|
|
|
return Response.ok( |
|
|
|
BeanCopyUtils.copyList(szCheckingService.selectSimple(sp), SimpleSzCheckingDto.class)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 获取水闸巡视检查详细信息 |
|
|
|
*/ |
|
|
|
@ApiOperation(" 水闸巡视检查详情") |
|
|
|
@GetMapping(value = "/{id}") |
|
|
|
public Response<SzCheckingDetailDto> getInfo(@PathVariable("id") String id) { |
|
|
|
return Response.ok(szCheckingService.getDetailById(id)); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("水闸巡视检查新增") |
|
|
|
@Log(title = "水闸巡视检查新增", businessType = BusinessType.INSERT) |
|
|
|
@PostMapping |
|
|
|
public Response<SzCheckingDetailDto> add(@RequestBody SzCheckingDetailDto SzChecking) { |
|
|
|
return Response.ok(szCheckingService.add(SzChecking)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 修改水闸巡视检查 |
|
|
|
*/ |
|
|
|
@ApiOperation("水闸巡视检查修改") |
|
|
|
@Log(title = "水闸巡视检查修改", businessType = BusinessType.UPDATE) |
|
|
|
@PutMapping |
|
|
|
public Response<SzCheckingDetailDto> edit(@RequestBody SzCheckingDetailDto SzChecking) { |
|
|
|
return Response.ok(szCheckingService.update(SzChecking)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除水闸巡视检查 |
|
|
|
*/ |
|
|
|
@ApiOperation("水闸巡视检查删除") |
|
|
|
@Log(title = "水闸巡视检查删除", businessType = BusinessType.DELETE) |
|
|
|
@DeleteMapping("/{id}") |
|
|
|
public Response<Boolean> remove(@PathVariable("id") String id) { |
|
|
|
return Response.ok(szCheckingService.deleteById(id)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("检查项树数组") |
|
|
|
@GetMapping("/tree") |
|
|
|
public Response<List<CommonCheckingTreeDto>> checkingItemTree() { |
|
|
|
return Response.ok(szCheckingService.checkingItems()); |
|
|
|
} |
|
|
|
private final SzCheckingService szCheckingService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询水闸巡视检查列表 |
|
|
|
*/ |
|
|
|
@PostMapping("/list") |
|
|
|
@ApiOperation("水闸巡视检查列表") |
|
|
|
public IPage<SzChecking> list(@RequestBody SearchParam<SzChecking> sp) { |
|
|
|
return szCheckingService.selectPage(sp); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/list-simple") |
|
|
|
@ApiOperation("水闸巡视检查列表-简略信息") |
|
|
|
public Response<List<SimpleSzCheckingDto>> listSimple(SearchParam<SzChecking> sp) { |
|
|
|
return Response.ok( |
|
|
|
BeanCopyUtils.copyList(szCheckingService.selectSimple(sp), SimpleSzCheckingDto.class)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 获取水闸巡视检查详细信息 |
|
|
|
*/ |
|
|
|
@ApiOperation(" 水闸巡视检查详情") |
|
|
|
@GetMapping(value = "/{id}") |
|
|
|
public Response<SzCheckingDetailDto> getInfo(@PathVariable("id") String id) { |
|
|
|
return Response.ok(szCheckingService.getDetailById(id)); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation("水闸巡视检查新增") |
|
|
|
@Log(title = "水闸巡视检查新增", businessType = BusinessType.INSERT) |
|
|
|
@PostMapping |
|
|
|
public Response<SzCheckingDetailDto> add(@RequestBody SzCheckingDetailDto SzChecking) { |
|
|
|
return Response.ok(szCheckingService.add(SzChecking)); |
|
|
|
} |
|
|
|
|
|
|
|
//检验是否被使用
|
|
|
|
@ApiOperation("检查是否被使用") |
|
|
|
@GetMapping("/check-use/{id}") |
|
|
|
public Response<Boolean> checkUse(@PathVariable("id") String id) { |
|
|
|
return Response.ok(szCheckingService.isUsed(id)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 修改水闸巡视检查 |
|
|
|
*/ |
|
|
|
@ApiOperation("水闸巡视检查修改") |
|
|
|
@Log(title = "水闸巡视检查修改", businessType = BusinessType.UPDATE) |
|
|
|
@PutMapping |
|
|
|
public Response<SzCheckingDetailDto> edit(@RequestBody SzCheckingDetailDto SzChecking) { |
|
|
|
return Response.ok(szCheckingService.update(SzChecking)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除水闸巡视检查 |
|
|
|
*/ |
|
|
|
@ApiOperation("水闸巡视检查删除") |
|
|
|
@Log(title = "水闸巡视检查删除", businessType = BusinessType.DELETE) |
|
|
|
@DeleteMapping("/{id}") |
|
|
|
public Response<Boolean> remove(@PathVariable("id") String id) { |
|
|
|
return Response.ok(szCheckingService.deleteById(id)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("检查项树数组") |
|
|
|
@GetMapping("/tree") |
|
|
|
public Response<List<CommonCheckingTreeDto>> checkingItemTree() { |
|
|
|
return Response.ok(szCheckingService.checkingItems()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|