b8739f7cd4bea79d1088da912d4c54596e4e4093.svn-base 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package cn.com.goldenwater.dcproj.controller.wiujs;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.BisInspWiujsWtrcr;
  5. import cn.com.goldenwater.dcproj.service.BisInspWiujsWtrcrService;
  6. import cn.com.goldenwater.target.CheckException;
  7. import io.swagger.annotations.Api;
  8. import io.swagger.annotations.ApiOperation;
  9. import io.swagger.annotations.ApiParam;
  10. import org.apache.commons.lang3.StringUtils;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.*;
  13. /**
  14. * @author lql
  15. * @date 2022-2-21
  16. */
  17. @Api(value = "节水型载体现场考核管理", tags = "节水型载体现场考核管理")
  18. @RestController
  19. @RequestMapping("/bis/insp/wiujs/wtrcr")
  20. public class BisInspWiujsWtrcrController extends BaseController {
  21. @Autowired
  22. private BisInspWiujsWtrcrService bisInspWiujsWtrcrService;
  23. @ApiOperation(value = "修改节水型载体现场考核")
  24. @RequestMapping(value = "", method = RequestMethod.POST)
  25. public BaseResponse<BisInspWiujsWtrcr> insert(@ApiParam(name = "bisInspWiujsWtrcr", value = "BisInspWiujsWtrcr", required = true) @RequestBody BisInspWiujsWtrcr bisInspWiujsWtrcr) {
  26. // 必填项判断
  27. if (StringUtils.isBlank(bisInspWiujsWtrcr.getRgstrId())) {
  28. throw new CheckException("缺少登记表编码");
  29. }
  30. int ret = bisInspWiujsWtrcrService.update(bisInspWiujsWtrcr);
  31. return buildSuccessResponse(bisInspWiujsWtrcr);
  32. }
  33. @ApiOperation(value = "根据ID删除节水型载体现场考核")
  34. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  35. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  36. int ret = bisInspWiujsWtrcrService.delete(id);
  37. return buildSuccessResponse();
  38. }
  39. @ApiOperation(value = "根据ID获取节水型载体现场考核(单表)")
  40. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  41. public BaseResponse<BisInspWiujsWtrcr> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  42. BisInspWiujsWtrcr bisInspWiujsWtrcr = bisInspWiujsWtrcrService.get(id);
  43. return buildSuccessResponse(bisInspWiujsWtrcr);
  44. }
  45. }