5c93bd9ec30b1a4eca98e396484b22cd47150f17.svn-base 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.BisInspWtuntRgstrSteelReo;
  5. import cn.com.goldenwater.dcproj.param.BisInspWtuntRgstrSteelReoParam;
  6. import cn.com.goldenwater.dcproj.service.BisInspWtuntRgstrSteelReoService;
  7. import cn.com.goldenwater.id.util.UuidUtil;
  8. import com.github.pagehelper.PageInfo;
  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.web.bind.annotation.*;
  17. import java.util.List;
  18. /**
  19. * @author lune
  20. * @date 2020-8-17
  21. */
  22. @Api(value = "BIS 2020年度用水单位节约用水情况检查表-主要产品产量管理",tags="BIS 2020年度用水单位节约用水情况检查表-主要产品产量管理")
  23. @RestController
  24. @RequestMapping("/bis/insp/wtunt/rgstr/steel/reo")
  25. public class BisInspWtuntRgstrSteelReoController extends BaseController {
  26. private Logger logger = LoggerFactory.getLogger(getClass());
  27. @Autowired
  28. private BisInspWtuntRgstrSteelReoService bisInspWtuntRgstrSteelReoService;
  29. @ApiOperation(value = "添加/修改2020年度用水单位节约用水情况检查表-主要产品产量")
  30. @RequestMapping(value = "", method = RequestMethod.POST)
  31. public BaseResponse<BisInspWtuntRgstrSteelReo> insert(@ApiParam(name = "bisInspWtuntRgstrSteelReo", value = "BisInspWtuntRgstrSteelReo", required = true) @RequestBody BisInspWtuntRgstrSteelReo bisInspWtuntRgstrSteelReo) {
  32. if(StringUtils.isBlank(bisInspWtuntRgstrSteelReo.getId())) {
  33. // 生成uuid
  34. String uuid = UuidUtil.uuid();
  35. bisInspWtuntRgstrSteelReo.setId(uuid);
  36. bisInspWtuntRgstrSteelReoService.insert(bisInspWtuntRgstrSteelReo);
  37. }else{
  38. bisInspWtuntRgstrSteelReoService.update(bisInspWtuntRgstrSteelReo);
  39. }
  40. return buildSuccessResponse(bisInspWtuntRgstrSteelReo);
  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 = bisInspWtuntRgstrSteelReoService.delete(id);
  46. return buildSuccessResponse();
  47. }
  48. @ApiOperation(value = "根据ID获取2020年度用水单位节约用水情况检查表-主要产品产量(单表)")
  49. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  50. public BaseResponse<BisInspWtuntRgstrSteelReo> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  51. BisInspWtuntRgstrSteelReo bisInspWtuntRgstrSteelReo = bisInspWtuntRgstrSteelReoService.get(id);
  52. return buildSuccessResponse(bisInspWtuntRgstrSteelReo);
  53. }
  54. @ApiOperation(value = "获取2020年度用水单位节约用水情况检查表-主要产品产量(列表所有)")
  55. @RequestMapping(value = "/list", method = RequestMethod.POST)
  56. public BaseResponse<List<BisInspWtuntRgstrSteelReo>> list(@ApiParam(name = "bisInspWtuntRgstrSteelReoParam", value = "bisInspWtuntRgstrSteelReoParam", required = true) @RequestBody BisInspWtuntRgstrSteelReoParam bisInspWtuntRgstrSteelReoParam) {
  57. List<BisInspWtuntRgstrSteelReo> bisInspWtuntRgstrSteelReoList = bisInspWtuntRgstrSteelReoService.findList(bisInspWtuntRgstrSteelReoParam);
  58. return buildSuccessResponse(bisInspWtuntRgstrSteelReoList);
  59. }
  60. @ApiOperation(value = "获取2020年度用水单位节约用水情况检查表-主要产品产量(列表--分页)")
  61. @RequestMapping(value = "/page", method = RequestMethod.POST)
  62. public BaseResponse<PageInfo<BisInspWtuntRgstrSteelReo>> page(@ApiParam(name = "bisInspWtuntRgstrSteelReoParam", value = "bisInspWtuntRgstrSteelReoParam", required = true) @RequestBody BisInspWtuntRgstrSteelReoParam bisInspWtuntRgstrSteelReoParam) {
  63. PageInfo<BisInspWtuntRgstrSteelReo> bisInspWtuntRgstrSteelReoList = bisInspWtuntRgstrSteelReoService.findPageInfo(bisInspWtuntRgstrSteelReoParam);
  64. return buildSuccessResponse(bisInspWtuntRgstrSteelReoList);
  65. }
  66. @ApiOperation(value = "获取2020年度用水单位节约用水情况检查表-主要产品产量")
  67. @RequestMapping(value = "/getBy/{rgstrId}", method = RequestMethod.POST)
  68. public BaseResponse<BisInspWtuntRgstrSteelReo> getBy(@ApiParam(name = "rgstrId", value = "rgstrId", required = true) @PathVariable String rgstrId) {
  69. BisInspWtuntRgstrSteelReoParam steelReoParam = new BisInspWtuntRgstrSteelReoParam();
  70. steelReoParam.setRgstrId(rgstrId);
  71. return buildSuccessResponse(bisInspWtuntRgstrSteelReoService.getBy(steelReoParam));
  72. }
  73. }