7f19f3cd8cbeae1ff2cd133c76a56218c859384b.svn-base 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package cn.com.goldenwater.dcproj.controller.rsfcoqh;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.BisInspRsfcoqhPres;
  5. import cn.com.goldenwater.dcproj.service.BisInspRsfcoqhPresService;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import io.swagger.annotations.ApiParam;
  9. import org.apache.commons.lang3.StringUtils;
  10. import org.slf4j.Logger;
  11. import org.slf4j.LoggerFactory;
  12. import org.springframework.beans.factory.annotation.Autowired;
  13. import org.springframework.util.Assert;
  14. import org.springframework.web.bind.annotation.*;
  15. /**
  16. * @author lhc
  17. * @date 2021-6-10
  18. */
  19. @Api(value = "水库安全度汛检查表管理", tags = "水库安全度汛检查表管理")
  20. @RestController
  21. @RequestMapping("/bis/insp/rsfcoqh/pres")
  22. public class BisInspRsfcoqhPresController extends BaseController {
  23. private Logger logger = LoggerFactory.getLogger(getClass());
  24. @Autowired
  25. private BisInspRsfcoqhPresService bisInspRsfcoqhPresService;
  26. @ApiOperation(value = "添加水库安全度汛检查表")
  27. @RequestMapping(value = "", method = RequestMethod.POST)
  28. public BaseResponse<BisInspRsfcoqhPres> insert(@ApiParam(name = "bisInspRsfcoqhPres", value = "BisInspRsfcoqhPres", required = true) @RequestBody BisInspRsfcoqhPres bisInspRsfcoqhPres) {
  29. bisInspRsfcoqhPres.setPersId(getCurrentPersId());
  30. if (StringUtils.isBlank(bisInspRsfcoqhPres.getId())) {
  31. bisInspRsfcoqhPresService.insert(bisInspRsfcoqhPres);
  32. } else {
  33. bisInspRsfcoqhPresService.update(bisInspRsfcoqhPres);
  34. }
  35. return buildSuccessResponse(bisInspRsfcoqhPres);
  36. }
  37. @ApiOperation(value = "根据ID删除水库安全度汛检查表")
  38. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  39. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  40. int ret = bisInspRsfcoqhPresService.delete(id);
  41. return buildSuccessResponse();
  42. }
  43. @ApiOperation(value = "更新水库安全度汛检查表信息")
  44. @RequestMapping(value = "/update", method = RequestMethod.POST)
  45. public BaseResponse<BisInspRsfcoqhPres> update(@ApiParam(name = "bisInspRsfcoqhPres", value = "BisInspRsfcoqhPres", required = true) @RequestBody BisInspRsfcoqhPres bisInspRsfcoqhPres) {
  46. Assert.notNull(bisInspRsfcoqhPres.getId(), "主键id为必填参数");
  47. int ret = bisInspRsfcoqhPresService.update(bisInspRsfcoqhPres);
  48. return buildSuccessResponse(bisInspRsfcoqhPres);
  49. }
  50. @ApiOperation(value = "根据ID获取水库安全度汛检查表(单表)")
  51. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  52. public BaseResponse<BisInspRsfcoqhPres> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  53. BisInspRsfcoqhPres bisInspRsfcoqhPres = bisInspRsfcoqhPresService.get(id);
  54. return buildSuccessResponse(bisInspRsfcoqhPres);
  55. }
  56. }