c9afd98cbbe13531685342f102525644ecc0aed4.svn-base 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package cn.com.goldenwater.dcproj.controller.safeprod;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.ChkSafeStatListIndustry;
  5. import cn.com.goldenwater.dcproj.param.ChkSafeStatListIndustryParam;
  6. import cn.com.goldenwater.dcproj.service.ChkSafeStatListIndustryService;
  7. import cn.com.goldenwater.dcproj.utils.StringUtils;
  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.slf4j.Logger;
  13. import org.slf4j.LoggerFactory;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.web.bind.annotation.PathVariable;
  16. import org.springframework.web.bind.annotation.RequestBody;
  17. import org.springframework.web.bind.annotation.RequestMapping;
  18. import org.springframework.web.bind.annotation.RequestMethod;
  19. import org.springframework.web.bind.annotation.RestController;
  20. import java.util.List;
  21. /**
  22. * 成都市水务行业安全大检查行业(领域)Controller
  23. *
  24. * @author ruoyi
  25. * @date 2023-02-22
  26. */
  27. @Api(value = "成都市水务行业安全大检查行业(领域)",tags="成都市水务行业安全大检查行业(领域)")
  28. @RestController
  29. @RequestMapping("/chk/safe/stat/industry")
  30. public class ChkSafeStatListIndustryController extends BaseController
  31. {
  32. private Logger logger = LoggerFactory.getLogger(getClass());
  33. /**
  34. * 成都市水务行业安全大检查行业(领域) 服务
  35. */
  36. @Autowired
  37. private ChkSafeStatListIndustryService chkSafeStatListIndustryService;
  38. /**
  39. * 新增/编辑成都市水务行业安全大检查行业(领域)单表
  40. */
  41. @ApiOperation(value = "修改")
  42. @RequestMapping(value = "/", method = RequestMethod.POST)
  43. public BaseResponse insert(@ApiParam(name = "chkSafeStatListIndustry", value = "ChkSafeStatListIndustry", required = true)
  44. @RequestBody ChkSafeStatListIndustry chkSafeStatListIndustry) {
  45. int ret = 0;
  46. if (StringUtils.isBlank(chkSafeStatListIndustry.getId())) {
  47. chkSafeStatListIndustry.setOrgId(getCurrentOrgId());
  48. chkSafeStatListIndustry.setPersId(getCurrentPersId());
  49. ret = chkSafeStatListIndustryService.insert(chkSafeStatListIndustry);
  50. } else {
  51. ret = chkSafeStatListIndustryService.update(chkSafeStatListIndustry);
  52. }
  53. return buildSuccessResponse(chkSafeStatListIndustry);
  54. }
  55. /**
  56. * 删除成都市水务行业安全大检查行业(领域) 单表
  57. */
  58. @ApiOperation(value = "根据ID删除")
  59. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  60. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  61. int ret = chkSafeStatListIndustryService.delete(id);
  62. return buildSuccessResponse();
  63. }
  64. /**
  65. * 查询成都市水务行业安全大检查行业(领域)单表
  66. */
  67. @ApiOperation(value = "根据ID获取单表")
  68. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  69. public BaseResponse<ChkSafeStatListIndustry> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  70. ChkSafeStatListIndustry chkSafeStatListIndustry = chkSafeStatListIndustryService.get(id);
  71. return buildSuccessResponse(chkSafeStatListIndustry);
  72. }
  73. /**
  74. * 查询成都市水务行业安全大检查行业(领域)列表
  75. */
  76. @ApiOperation(value = "列表--分页")
  77. @RequestMapping(value = "/page", method = RequestMethod.POST)
  78. public BaseResponse<PageInfo> page(@ApiParam(name = "chkSafeStatListIndustryParam", value = "chkSafeStatListIndustryParam", required = true)
  79. @RequestBody ChkSafeStatListIndustryParam chkSafeStatListIndustryParam) {
  80. chkSafeStatListIndustryParam.setOrgId(getCurrentOrgId());
  81. return buildSuccessResponse(chkSafeStatListIndustryService.findPageInfo(chkSafeStatListIndustryParam));
  82. }
  83. /**
  84. * 查询成都市水务行业安全大检查行业(领域)列表 下拉框列表
  85. */
  86. @ApiOperation(value = "下拉框列表")
  87. @RequestMapping(value = "/selectOptions", method = RequestMethod.POST)
  88. public BaseResponse<List<ChkSafeStatListIndustry>> querySelectOptions() {
  89. return buildSuccessResponse(chkSafeStatListIndustryService.querySelectOptions(null));
  90. }
  91. }