86a23e73150963d71beb75e8d57d2dacee2b9fc9.svn-base 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package cn.com.goldenwater.dcproj.controller.swhsjs;
  2. import cn.com.goldenwater.dcproj.model.BisInspSwhsjsMgt;
  3. import cn.com.goldenwater.dcproj.param.BisInspSwhsjsMgtParam;
  4. import cn.com.goldenwater.dcproj.service.BisInspSwhsjsMgtService;
  5. import cn.com.goldenwater.core.web.BaseController;
  6. import cn.com.goldenwater.core.web.BaseResponse;
  7. import cn.com.goldenwater.id.util.UuidUtil;
  8. import cn.com.goldenwater.target.CheckException;
  9. import io.swagger.annotations.Api;
  10. import io.swagger.annotations.ApiOperation;
  11. import io.swagger.annotations.ApiParam;
  12. import org.apache.commons.lang3.StringUtils;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.util.Assert;
  15. import org.springframework.web.bind.annotation.PathVariable;
  16. import org.springframework.web.bind.annotation.RequestBody;
  17. import org.springframework.web.bind.annotation.RequestMapping;
  18. import org.springframework.web.bind.annotation.RequestMethod;
  19. import org.springframework.web.bind.annotation.RequestParam;
  20. import org.springframework.web.bind.annotation.RestController;
  21. import java.util.List;
  22. /**
  23. * @author
  24. * @date 2022-2-23
  25. */
  26. @Api(value = "江苏水源地管理现场考核管理", tags = "江苏水源地管理现场考核管理")
  27. @RestController
  28. @RequestMapping("/bis/insp/swhsjs/mgt")
  29. public class BisInspSwhsjsMgtController extends BaseController {
  30. @Autowired
  31. private BisInspSwhsjsMgtService bisInspSwhsjsMgtService;
  32. @ApiOperation(value = "修改江苏水源地管理现场考核")
  33. @RequestMapping(value = "", method = RequestMethod.POST)
  34. public BaseResponse<BisInspSwhsjsMgt> insert(@ApiParam(name = "bisInspSwhsjsMgt", value = "BisInspSwhsjsMgt", required = true) @RequestBody BisInspSwhsjsMgt bisInspSwhsjsMgt) {
  35. // 必填项判断
  36. if (StringUtils.isBlank(bisInspSwhsjsMgt.getRgstrId())) {
  37. throw new CheckException("缺少登记表编码");
  38. }
  39. bisInspSwhsjsMgtService.update(bisInspSwhsjsMgt);
  40. return buildSuccessResponse(bisInspSwhsjsMgt);
  41. }
  42. @ApiOperation(value = "根据ID删除江苏水源地管理现场考核")
  43. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  44. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  45. int ret = bisInspSwhsjsMgtService.delete(id);
  46. return buildSuccessResponse();
  47. }
  48. @ApiOperation(value = "根据ID获取江苏水源地管理现场考核(单表)")
  49. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  50. public BaseResponse<BisInspSwhsjsMgt> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  51. BisInspSwhsjsMgt bisInspSwhsjsMgt = bisInspSwhsjsMgtService.get(id);
  52. return buildSuccessResponse(bisInspSwhsjsMgt);
  53. }
  54. }