922a98ca6d128c113819bdd13bf0d3746236ca6f.svn-base 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package cn.com.goldenwater.dcproj.controller.ducha;
  2. import cn.com.goldenwater.dcproj.model.BisInspHystpOthr;
  3. import cn.com.goldenwater.dcproj.param.BisInspHystpOthrParam;
  4. import cn.com.goldenwater.dcproj.service.BisInspHystpOthrService;
  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.slf4j.Logger;
  14. import org.slf4j.LoggerFactory;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.util.Assert;
  17. import org.springframework.web.bind.annotation.PathVariable;
  18. import org.springframework.web.bind.annotation.RequestBody;
  19. import org.springframework.web.bind.annotation.RequestMapping;
  20. import org.springframework.web.bind.annotation.RequestMethod;
  21. import org.springframework.web.bind.annotation.RequestParam;
  22. import org.springframework.web.bind.annotation.RestController;
  23. import java.util.List;
  24. /**
  25. * @author lhc
  26. * @date 2022-3-23
  27. */
  28. @Api(value = "xxx管理",tags="xxx管理")
  29. @RestController
  30. @RequestMapping("/bis/insp/hystp/othr")
  31. public class BisInspHystpOthrController extends BaseController {
  32. private Logger logger = LoggerFactory.getLogger(getClass());
  33. @Autowired
  34. private BisInspHystpOthrService bisInspHystpOthrService;
  35. @ApiOperation(value = "添加xxx")
  36. @RequestMapping(value = "/", method = RequestMethod.POST)
  37. public BaseResponse<BisInspHystpOthr> insert(@ApiParam(name = "bisInspHystpOthr", value = "BisInspHystpOthr", required = true) @RequestBody BisInspHystpOthr bisInspHystpOthr) {
  38. if (StringUtils.isBlank(bisInspHystpOthr.getRgstrId())) {
  39. throw new CheckException("缺少登记表编码");
  40. }
  41. bisInspHystpOthrService.update(bisInspHystpOthr);
  42. return buildSuccessResponse(bisInspHystpOthr);
  43. }
  44. @ApiOperation(value = "根据ID删除xxx")
  45. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  46. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  47. int ret = bisInspHystpOthrService.delete(id);
  48. return buildSuccessResponse();
  49. }
  50. @ApiOperation(value = "更新xxx信息")
  51. @RequestMapping(value = "/update", method = RequestMethod.POST)
  52. public BaseResponse<BisInspHystpOthr> update(@ApiParam(name = "bisInspHystpOthr", value = "BisInspHystpOthr", required = true) @RequestBody BisInspHystpOthr bisInspHystpOthr) {
  53. Assert.notNull(bisInspHystpOthr.getId(), "主键id为必填参数");
  54. int ret = bisInspHystpOthrService.update(bisInspHystpOthr);
  55. return buildSuccessResponse(bisInspHystpOthr);
  56. }
  57. @ApiOperation(value = "根据ID获取xxx(单表)")
  58. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  59. public BaseResponse<BisInspHystpOthr> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  60. BisInspHystpOthr bisInspHystpOthr = bisInspHystpOthrService.get(id);
  61. return buildSuccessResponse(bisInspHystpOthr);
  62. }
  63. }