a7d1d982eb5e4605471409ea270fc9b5184daf93.svn-base 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package cn.com.goldenwater.dcproj.controller.stnd;
  2. import cn.com.goldenwater.dcproj.model.BisInspStndMgamt;
  3. import cn.com.goldenwater.dcproj.service.BisInspStndMgamtService;
  4. import cn.com.goldenwater.core.web.BaseController;
  5. import cn.com.goldenwater.core.web.BaseResponse;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import io.swagger.annotations.ApiParam;
  9. import org.slf4j.Logger;
  10. import org.slf4j.LoggerFactory;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.util.Assert;
  13. import org.springframework.web.bind.annotation.PathVariable;
  14. import org.springframework.web.bind.annotation.RequestBody;
  15. import org.springframework.web.bind.annotation.RequestMapping;
  16. import org.springframework.web.bind.annotation.RequestMethod;
  17. import org.springframework.web.bind.annotation.RestController;
  18. /**
  19. * @author lhc
  20. * @date 2020-3-25
  21. */
  22. @Api(value = "小水库标准化管理和物资情况管理",tags="小水库标准化管理和物资情况管理")
  23. @RestController
  24. @RequestMapping("/bis/insp/stnd/mgamt")
  25. public class BisInspStndMgamtController extends BaseController {
  26. private Logger logger = LoggerFactory.getLogger(getClass());
  27. @Autowired
  28. private BisInspStndMgamtService bisInspStndMgamtService;
  29. @ApiOperation(value = "添加小水库标准化管理和物资情况")
  30. @RequestMapping(value = "/add", method = RequestMethod.POST)
  31. public BaseResponse<BisInspStndMgamt> insert(@ApiParam(name = "bisInspStndMgamt", value = "BisInspStndMgamt", required = true) @RequestBody BisInspStndMgamt bisInspStndMgamt) {
  32. int ret = bisInspStndMgamtService.insert(bisInspStndMgamt);
  33. return buildSuccessResponse(bisInspStndMgamt);
  34. }
  35. @ApiOperation(value = "根据ID删除小水库标准化管理和物资情况")
  36. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  37. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  38. int ret = bisInspStndMgamtService.delete(id);
  39. return buildSuccessResponse();
  40. }
  41. @ApiOperation(value = "更新小水库标准化管理和物资情况信息")
  42. @RequestMapping(value = "/update", method = RequestMethod.POST)
  43. public BaseResponse<BisInspStndMgamt> update(@ApiParam(name = "bisInspStndMgamt", value = "BisInspStndMgamt", required = true) @RequestBody BisInspStndMgamt bisInspStndMgamt) {
  44. Assert.notNull(bisInspStndMgamt.getId(), "主键id为必填参数");
  45. int ret = bisInspStndMgamtService.update(bisInspStndMgamt);
  46. return buildSuccessResponse(bisInspStndMgamt);
  47. }
  48. @ApiOperation(value = "根据ID获取小水库标准化管理和物资情况(单表)")
  49. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  50. public BaseResponse<BisInspStndMgamt> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  51. BisInspStndMgamt bisInspStndMgamt = bisInspStndMgamtService.get(id);
  52. return buildSuccessResponse(bisInspStndMgamt);
  53. }
  54. @ApiOperation(value = "根据登记表ID获取小水库标准化责任人和养护情况(单表)")
  55. @RequestMapping(value = "/getByRegId/{regId}", method = RequestMethod.GET)
  56. public BaseResponse<BisInspStndMgamt> getByRegId(@ApiParam(name = "regId", value = "regId", required = true) @PathVariable String regId) {
  57. BisInspStndMgamt bisInspStndMgamt = bisInspStndMgamtService.getByRegId(regId);
  58. return buildSuccessResponse(bisInspStndMgamt);
  59. }
  60. }