bb87f1bd134ca8f92f445443dd800299893efe99.svn-base 5.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. package cn.com.goldenwater.dcproj.controller.wtunt;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.BisInspWtuntRgstrSteel;
  5. import cn.com.goldenwater.dcproj.model.BisInspWtuntRgstrSteelReo;
  6. import cn.com.goldenwater.dcproj.model.BisInspWtuntRgstrVo;
  7. import cn.com.goldenwater.dcproj.param.BisInspWtuntRgstrSteelParam;
  8. import cn.com.goldenwater.dcproj.param.BisInspWtuntRgstrSteelReoParam;
  9. import cn.com.goldenwater.dcproj.service.BisInspWtuntRgstrService;
  10. import cn.com.goldenwater.dcproj.service.BisInspWtuntRgstrSteelReoService;
  11. import cn.com.goldenwater.dcproj.service.BisInspWtuntRgstrSteelService;
  12. import com.github.pagehelper.PageInfo;
  13. import io.swagger.annotations.Api;
  14. import io.swagger.annotations.ApiOperation;
  15. import io.swagger.annotations.ApiParam;
  16. import org.slf4j.Logger;
  17. import org.slf4j.LoggerFactory;
  18. import org.springframework.beans.factory.annotation.Autowired;
  19. import org.springframework.web.bind.annotation.*;
  20. import java.util.List;
  21. /**
  22. * @author lune
  23. * @date 2020-8-17
  24. */
  25. @Api(value = "BIS 2020年度用水单位节约用水情况检查表(钢铁)管理",tags="BIS 2020年度用水单位节约用水情况检查表(钢铁)管理")
  26. @RestController
  27. @RequestMapping("/bis/insp/wtunt/rgstr/steel")
  28. public class BisInspWtuntRgstrSteelController extends BaseController {
  29. private Logger logger = LoggerFactory.getLogger(getClass());
  30. @Autowired
  31. private BisInspWtuntRgstrSteelService bisInspWtuntRgstrSteelService;
  32. @Autowired
  33. private BisInspWtuntRgstrService bisInspWtuntRgstrService;
  34. @Autowired
  35. private BisInspWtuntRgstrSteelReoService bisInspWtuntRgstrSteelReoService;
  36. @ApiOperation(value = "添加/修改2020年度用水单位节约用水情况检查表(钢铁)")
  37. @RequestMapping(value = "", method = RequestMethod.POST)
  38. public BaseResponse<BisInspWtuntRgstrVo> insert(@ApiParam(name = "bisInspWtuntRgstrVo", value = "BisInspWtuntRgstrVo", required = true) @RequestBody BisInspWtuntRgstrVo bisInspWtuntRgstrVo) {
  39. bisInspWtuntRgstrSteelService.insertSteel(bisInspWtuntRgstrVo);
  40. return buildSuccessResponse(bisInspWtuntRgstrVo);
  41. }
  42. @ApiOperation(value = "根据ID删除2020年度用水单位节约用水情况检查表(钢铁)")
  43. @RequestMapping(value = "/del/{id}", method = RequestMethod.GET)
  44. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  45. int ret = bisInspWtuntRgstrSteelService.delete(id);
  46. return buildSuccessResponse();
  47. }
  48. @ApiOperation(value = "根据ID获取2020年度用水单位节约用水情况检查表(钢铁)(单表)")
  49. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  50. public BaseResponse<BisInspWtuntRgstrSteel> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  51. BisInspWtuntRgstrSteel bisInspWtuntRgstrSteel = bisInspWtuntRgstrSteelService.get(id);
  52. return buildSuccessResponse(bisInspWtuntRgstrSteel);
  53. }
  54. @ApiOperation(value = "获取2020年度用水单位节约用水情况检查表(钢铁)(列表所有)")
  55. @RequestMapping(value = "/list", method = RequestMethod.POST)
  56. public BaseResponse<List<BisInspWtuntRgstrSteel>> list(@ApiParam(name = "bisInspWtuntRgstrSteelParam", value = "bisInspWtuntRgstrSteelParam", required = true) @RequestBody BisInspWtuntRgstrSteelParam bisInspWtuntRgstrSteelParam) {
  57. List<BisInspWtuntRgstrSteel> bisInspWtuntRgstrSteelList = bisInspWtuntRgstrSteelService.findList(bisInspWtuntRgstrSteelParam);
  58. return buildSuccessResponse(bisInspWtuntRgstrSteelList);
  59. }
  60. @ApiOperation(value = "获取2020年度用水单位节约用水情况检查表(钢铁)(列表--分页)")
  61. @RequestMapping(value = "/page", method = RequestMethod.POST)
  62. public BaseResponse<PageInfo<BisInspWtuntRgstrSteel>> page(@ApiParam(name = "bisInspWtuntRgstrSteelParam", value = "bisInspWtuntRgstrSteelParam", required = true) @RequestBody BisInspWtuntRgstrSteelParam bisInspWtuntRgstrSteelParam) {
  63. PageInfo<BisInspWtuntRgstrSteel> bisInspWtuntRgstrSteelList = bisInspWtuntRgstrSteelService.findPageInfo(bisInspWtuntRgstrSteelParam);
  64. return buildSuccessResponse(bisInspWtuntRgstrSteelList);
  65. }
  66. @ApiOperation(value = "获取2020年度用水单位节约用水情况检查表(钢铁)")
  67. @RequestMapping(value = "/getBy/{rgstrId}", method = RequestMethod.POST)
  68. public BaseResponse<BisInspWtuntRgstrVo> getBy(@ApiParam(name = "rgstrId", value = "rgstrId", required = true) @PathVariable String rgstrId) {
  69. BisInspWtuntRgstrVo vo = new BisInspWtuntRgstrVo();
  70. BisInspWtuntRgstrSteelParam steelParam = new BisInspWtuntRgstrSteelParam();
  71. steelParam.setRgstrId(rgstrId);
  72. BisInspWtuntRgstrSteel steel = bisInspWtuntRgstrSteelService.getBy(steelParam);
  73. vo.setBisInspWtuntRgstrSteel(steel);
  74. BisInspWtuntRgstrSteelReoParam steelReoParam = new BisInspWtuntRgstrSteelReoParam();
  75. steelReoParam.setRgstrId(rgstrId);
  76. List<BisInspWtuntRgstrSteelReo> reo = bisInspWtuntRgstrSteelReoService.findList(steelReoParam);
  77. vo.setBisInspWtuntRgstrSteelReo(reo);
  78. return buildSuccessResponse(vo);
  79. }
  80. }