ZhcxProjectManageController.java 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. package com.rongwei.bsserver.controller;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.rongwei.bscommon.sys.service.LuckysheetService;
  4. import com.rongwei.bscommon.sys.service.ZhcxProjectManageRectifyBatchService;
  5. import com.rongwei.bscommon.sys.service.ZhcxProjectManageService;
  6. import com.rongwei.bsentity.domain.ZhcxProjectManageDo;
  7. import com.rongwei.bsentity.domain.ZhcxProjectManageRectifyBatchDo;
  8. import com.rongwei.bsentity.dto.luckysheet.UpdateFilterSelectRequest;
  9. import com.rongwei.bsentity.dto.project.DelProjectSummaryDto;
  10. import com.rongwei.bsentity.dto.project.ExportProjectSummaryDto;
  11. import com.rongwei.bsentity.dto.project.SavePorjectSummaryDto;
  12. import com.rongwei.bsentity.dto.project.UpdateDataVerificationRequest;
  13. import com.rongwei.rwcommon.base.R;
  14. import com.rongwei.rwcommon.base.exception.CustomException;
  15. import io.swagger.annotations.Api;
  16. import io.swagger.annotations.ApiOperation;
  17. import lombok.extern.slf4j.Slf4j;
  18. import org.springframework.beans.factory.annotation.Autowired;
  19. import org.springframework.web.bind.annotation.PostMapping;
  20. import org.springframework.web.bind.annotation.RequestBody;
  21. import org.springframework.web.bind.annotation.RequestMapping;
  22. import org.springframework.web.bind.annotation.RestController;
  23. import javax.servlet.http.HttpServletResponse;
  24. import java.util.Map;
  25. /**
  26. * <p>
  27. * 项目管理表 前端控制器
  28. * </p>
  29. *
  30. * @author wm
  31. * @since 2024-06-28
  32. */
  33. @RestController
  34. @RequestMapping("/zhcxProjectManage")
  35. @Api(tags = "项目管理")
  36. @Slf4j
  37. public class ZhcxProjectManageController {
  38. @Autowired
  39. private ZhcxProjectManageService service;
  40. @Autowired
  41. private LuckysheetService luckysheetService;
  42. @Autowired
  43. private ZhcxProjectManageRectifyBatchService projectManageRectifyBatchService;
  44. /**
  45. * 生成整改清单
  46. * @param projectManageDo
  47. * @return
  48. */
  49. @PostMapping("/genSummaryFiles")
  50. @ApiOperation("生成汇总文件")
  51. public R genSummaryFiles(@RequestBody ZhcxProjectManageDo projectManageDo){
  52. String files = luckysheetService.genProjectSummaryFiles(projectManageDo.getId());
  53. return R.ok(files);
  54. }
  55. /**
  56. * 生成整改清单
  57. * @param batch
  58. * @return
  59. */
  60. @PostMapping("/genBatchSummaryFiles")
  61. @ApiOperation("生成批次汇总文件")
  62. public R genBatchSummaryFiles(@RequestBody ZhcxProjectManageRectifyBatchDo batch){
  63. String files = projectManageRectifyBatchService.genProjectSummaryFiles(batch.getId());
  64. return R.ok(files);
  65. }
  66. /**
  67. * 保存汇总文件数据
  68. *
  69. * @param dto
  70. * @return
  71. */
  72. @PostMapping("/saveSummaryData")
  73. @ApiOperation("保存汇总文件数据")
  74. public R saveSummaryData(@RequestBody SavePorjectSummaryDto dto) {
  75. service.saveSummaryData(dto);
  76. return R.ok();
  77. }
  78. /**
  79. * 保存汇总文件数据
  80. *
  81. * @param dto
  82. * @return
  83. */
  84. @PostMapping("/saveSummaryDataByBatchId")
  85. @ApiOperation("保存汇总文件数据")
  86. public R saveSummaryDataByBatchId(@RequestBody SavePorjectSummaryDto dto) {
  87. service.saveSummaryData(dto.getBatchId());
  88. return R.ok();
  89. }
  90. /**
  91. * 更新excel下拉框
  92. *
  93. * @param req
  94. * @return
  95. */
  96. @PostMapping("/updateDataVerification")
  97. @ApiOperation("更新excel下拉框")
  98. public R updateDataVerification(@RequestBody UpdateDataVerificationRequest req) {
  99. final JSONObject verifyData = luckysheetService.updateDataVerification(req);
  100. return R.ok(verifyData);
  101. }
  102. /**
  103. * 更新excel筛选
  104. *
  105. * @param req
  106. * @return
  107. */
  108. @PostMapping("/updateFilterSelect")
  109. @ApiOperation("更新excel筛选")
  110. public R updateFilterSelect(@RequestBody UpdateFilterSelectRequest req) {
  111. luckysheetService.updateFilterSelect(req);
  112. return R.ok();
  113. }
  114. @PostMapping("/getRectifyReportData")
  115. @ApiOperation("获取整改报表数据")
  116. public R getRectifyReportData(@RequestBody Map<String,Object> map) {
  117. R r = service.getRectifyReportData(map);
  118. return r;
  119. }
  120. @PostMapping("/getRectifyListData")
  121. @ApiOperation("获取整改清单数据")
  122. public R getRectifyListData(@RequestBody Map<String,Object> map) {
  123. R r = service.getRectifyListData(map);
  124. return r;
  125. }
  126. /**
  127. * 整改清单和整改报表导出
  128. * @param map
  129. * @param response
  130. */
  131. @PostMapping("/exportRectifyReportData")
  132. @ApiOperation("导出整改报表数据")
  133. public void exportRectifyReportData(@RequestBody Map<String,Object> map, HttpServletResponse response) {
  134. int i = service.exportRectifyReportData(map,response);
  135. if(i == 0){
  136. throw new CustomException("导出失败");
  137. }
  138. }
  139. /**
  140. * 整改查看和整改报表导出
  141. * @param map
  142. * @param response
  143. */
  144. @PostMapping("/exportRectifyListData")
  145. @ApiOperation("导出整改报表数据")
  146. public void exportRectifyListData(@RequestBody Map<String,Object> map, HttpServletResponse response) {
  147. int i = service.exportRectifyListData(map,response);
  148. if(i == 0){
  149. throw new CustomException("导出失败");
  150. }
  151. }
  152. /**
  153. * 整改页导出
  154. *
  155. * @param dto
  156. * @param response
  157. */
  158. @PostMapping("/exportRectifyReportDataInSummary")
  159. @ApiOperation("导出整改报表数据")
  160. public void exportRectifyReportDataInSummary(@RequestBody ExportProjectSummaryDto dto, HttpServletResponse response) {
  161. service.exportRectifyReportDataInSummary(dto, response);
  162. }
  163. @PostMapping("/delDataByBatchId")
  164. @ApiOperation("删除整改")
  165. public R delProjectBatch(@RequestBody DelProjectSummaryDto dto) {
  166. projectManageRectifyBatchService.delPrjRectifyBatch(dto.getBatchId());
  167. return R.ok();
  168. }
  169. @PostMapping("/generateRectifyData")
  170. @ApiOperation("生成整改快照")
  171. public R generateRectifyData(@RequestBody Map<String,Object> map) {
  172. service.deleteSnap();
  173. R r = service.generateRectifyData();
  174. return r;
  175. }
  176. @PostMapping("/searchRectifyData")
  177. @ApiOperation("查询整改快照")
  178. public R searchRectifyData(@RequestBody Map<String,Object> map) {
  179. R r = service.searchRectifyData(map);
  180. return r;
  181. }
  182. }