8d4fae01d834b27c88b32769f535a018718baab0.svn-base 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. package cn.com.goldenwater.dcproj.controller.ducha;
  2. import cn.com.goldenwater.dcproj.model.BisInspPlanYear;
  3. import cn.com.goldenwater.dcproj.model.BisInspPlanYearPrg;
  4. import cn.com.goldenwater.dcproj.param.BisInspPlanYearParam;
  5. import cn.com.goldenwater.dcproj.param.BisInspPlanYearPrgParam;
  6. import cn.com.goldenwater.dcproj.service.BisInspPlanYearPrgService;
  7. import cn.com.goldenwater.core.web.BaseController;
  8. import cn.com.goldenwater.core.web.BaseResponse;
  9. import cn.com.goldenwater.dcproj.service.OlBisInspOrgService;
  10. import cn.com.goldenwater.dcproj.utils.AdLevelUtil;
  11. import cn.com.goldenwater.id.util.UuidUtil;
  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.apache.commons.lang3.StringUtils;
  17. import org.slf4j.Logger;
  18. import org.slf4j.LoggerFactory;
  19. import org.springframework.beans.factory.annotation.Autowired;
  20. import org.springframework.util.Assert;
  21. import org.springframework.web.bind.annotation.PathVariable;
  22. import org.springframework.web.bind.annotation.RequestBody;
  23. import org.springframework.web.bind.annotation.RequestMapping;
  24. import org.springframework.web.bind.annotation.RequestMethod;
  25. import org.springframework.web.bind.annotation.RequestParam;
  26. import org.springframework.web.bind.annotation.RestController;
  27. import javax.servlet.http.HttpServletResponse;
  28. import java.util.List;
  29. /**
  30. * @author lhc
  31. * @date 2022-3-3
  32. */
  33. @Api(value = "山东年度计划月进度情况管理", tags = "山东年度计划月进度情况管理")
  34. @RestController
  35. @RequestMapping("/bis/insp/plan/year/prg")
  36. public class BisInspPlanYearPrgController extends BaseController {
  37. private Logger logger = LoggerFactory.getLogger(getClass());
  38. @Autowired
  39. private BisInspPlanYearPrgService bisInspPlanYearPrgService;
  40. @Autowired
  41. private OlBisInspOrgService olBisInspOrgService;
  42. @ApiOperation(value = "添加山东年度计划月进度情况")
  43. @RequestMapping(value = "/", method = RequestMethod.POST)
  44. public BaseResponse<BisInspPlanYearPrg> insert(@ApiParam(name = "bisInspPlanYearPrg", value = "BisInspPlanYearPrg", required = true) @RequestBody BisInspPlanYearPrg bisInspPlanYearPrg) {
  45. if (StringUtils.isBlank(bisInspPlanYearPrg.getId())) {
  46. bisInspPlanYearPrg.setAdCode(olBisInspOrgService.getProvince(getCurrentOrgId()));
  47. bisInspPlanYearPrg.setPersId(getCurrentPersId());
  48. bisInspPlanYearPrgService.insert(bisInspPlanYearPrg);
  49. } else {
  50. bisInspPlanYearPrgService.update(bisInspPlanYearPrg);
  51. }
  52. return buildSuccessResponse(bisInspPlanYearPrg);
  53. }
  54. @ApiOperation(value = "根据ID删除山东年度计划月进度情况")
  55. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  56. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  57. int ret = bisInspPlanYearPrgService.delete(id);
  58. return buildSuccessResponse();
  59. }
  60. @ApiOperation(value = "更新山东年度计划月进度情况信息")
  61. @RequestMapping(value = "/update", method = RequestMethod.POST)
  62. public BaseResponse<BisInspPlanYearPrg> update(@ApiParam(name = "bisInspPlanYearPrg", value = "BisInspPlanYearPrg", required = true) @RequestBody BisInspPlanYearPrg bisInspPlanYearPrg) {
  63. Assert.notNull(bisInspPlanYearPrg.getId(), "主键id为必填参数");
  64. int ret = bisInspPlanYearPrgService.update(bisInspPlanYearPrg);
  65. return buildSuccessResponse(bisInspPlanYearPrg);
  66. }
  67. @ApiOperation(value = "根据ID获取山东年度计划月进度情况(单表)")
  68. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  69. public BaseResponse<BisInspPlanYearPrg> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  70. BisInspPlanYearPrg bisInspPlanYearPrg = bisInspPlanYearPrgService.get(id);
  71. return buildSuccessResponse(bisInspPlanYearPrg);
  72. }
  73. @ApiOperation(value = "根据年ID获取山东年度计划月进度情况(单表)")
  74. @RequestMapping(value = "/getPlanByYearId/{id}", method = RequestMethod.GET)
  75. public BaseResponse<List<BisInspPlanYearPrg>> getPlanByYearId(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  76. List<BisInspPlanYearPrg> bisInspPlanYearPrgs = bisInspPlanYearPrgService.getPlanByYearId(id);
  77. return buildSuccessResponse(bisInspPlanYearPrgs);
  78. }
  79. @ApiOperation(value = "获取列 表(分页)")
  80. @RequestMapping(value = "/findPageList", method = RequestMethod.POST)
  81. public BaseResponse<List<BisInspPlanYearPrg>> findPageList(@ApiParam(name = "BisInspPlanYearPrgParam", value = "BisInspPlanYearPrgParam", required = true) @RequestBody BisInspPlanYearPrgParam bisInspPlanYearPrgParam) {
  82. bisInspPlanYearPrgParam.setAdCode(AdLevelUtil.getAddvcd(olBisInspOrgService.getProvince(getCurrentOrgId())));
  83. List<BisInspPlanYearPrg> bisInspPlanYearPrgList = bisInspPlanYearPrgService.findPageList(bisInspPlanYearPrgParam);
  84. return buildSuccessResponse(bisInspPlanYearPrgList);
  85. }
  86. @ApiOperation(value = "督查计划进度月报导出")
  87. @RequestMapping(value = "/export", method = RequestMethod.POST)
  88. public void export(HttpServletResponse response, @RequestBody BisInspPlanYearPrgParam bisInspPlanYearPrgParam) {
  89. bisInspPlanYearPrgParam.setOrgId(getCurrentOrgId());
  90. bisInspPlanYearPrgService.export(response, bisInspPlanYearPrgParam,null);
  91. }
  92. @ApiOperation(value = "导出下月计划")
  93. @RequestMapping(value = "/export1", method = RequestMethod.POST)
  94. public void export1(HttpServletResponse response, @RequestBody BisInspPlanYearPrgParam bisInspPlanYearPrgParam) {
  95. bisInspPlanYearPrgParam.setOrgId(getCurrentOrgId());
  96. bisInspPlanYearPrgService.export1(response, bisInspPlanYearPrgParam,null);
  97. }
  98. }