aa109a251a0ef9a6b706115894b9a1bb27a3f1ed.svn-base 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package cn.com.goldenwater.dcproj.controller.ducha;
  2. import cn.com.goldenwater.dcproj.model.BisInspHystpDvc;
  3. import cn.com.goldenwater.dcproj.param.BisInspHystpDvcParam;
  4. import cn.com.goldenwater.dcproj.service.BisInspHystpDvcService;
  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/dvc")
  31. public class BisInspHystpDvcController extends BaseController {
  32. private Logger logger = LoggerFactory.getLogger(getClass());
  33. @Autowired
  34. private BisInspHystpDvcService bisInspHystpDvcService;
  35. @ApiOperation(value = "添加xxx")
  36. @RequestMapping(value = "/", method = RequestMethod.POST)
  37. public BaseResponse<BisInspHystpDvc> insert(@ApiParam(name = "bisInspHystpDvc", value = "BisInspHystpDvc", required = true) @RequestBody BisInspHystpDvc bisInspHystpDvc) {
  38. if (StringUtils.isBlank(bisInspHystpDvc.getRgstrId())) {
  39. throw new CheckException("缺少登记表编码");
  40. }
  41. bisInspHystpDvcService.update(bisInspHystpDvc);
  42. return buildSuccessResponse(bisInspHystpDvc);
  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 = bisInspHystpDvcService.delete(id);
  48. return buildSuccessResponse();
  49. }
  50. @ApiOperation(value = "更新xxx信息")
  51. @RequestMapping(value = "/update", method = RequestMethod.POST)
  52. public BaseResponse<BisInspHystpDvc> update(@ApiParam(name = "bisInspHystpDvc", value = "BisInspHystpDvc", required = true) @RequestBody BisInspHystpDvc bisInspHystpDvc) {
  53. Assert.notNull(bisInspHystpDvc.getId(), "主键id为必填参数");
  54. int ret = bisInspHystpDvcService.update(bisInspHystpDvc);
  55. return buildSuccessResponse(bisInspHystpDvc);
  56. }
  57. @ApiOperation(value = "根据ID获取xxx(单表)")
  58. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  59. public BaseResponse<BisInspHystpDvc> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  60. BisInspHystpDvc bisInspHystpDvc = bisInspHystpDvcService.get(id);
  61. return buildSuccessResponse(bisInspHystpDvc);
  62. }
  63. }