ZhcxProjectManageController.java 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. package com.rongwei.bsserver.controller;
  2. import com.rongwei.bscommon.sys.service.LuckysheetService;
  3. import com.rongwei.bscommon.sys.service.ZhcxProjectManageService;
  4. import com.rongwei.bsentity.domain.ZhcxProjectManageDo;
  5. import com.rongwei.bsentity.dto.project.SavePorjectSummaryDto;
  6. import com.rongwei.rwcommon.base.R;
  7. import com.rongwei.rwcommon.base.exception.CustomException;
  8. import io.swagger.annotations.Api;
  9. import io.swagger.annotations.ApiOperation;
  10. import lombok.extern.slf4j.Slf4j;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.PostMapping;
  13. import org.springframework.web.bind.annotation.RequestBody;
  14. import org.springframework.web.bind.annotation.RequestMapping;
  15. import org.springframework.web.bind.annotation.RestController;
  16. import java.util.Map;
  17. /**
  18. * <p>
  19. * 项目管理表 前端控制器
  20. * </p>
  21. *
  22. * @author wm
  23. * @since 2024-06-28
  24. */
  25. @RestController
  26. @RequestMapping("/zhcxProjectManage")
  27. @Api(tags = "项目管理")
  28. @Slf4j
  29. public class ZhcxProjectManageController {
  30. @Autowired
  31. private ZhcxProjectManageService service;
  32. @Autowired
  33. private LuckysheetService luckysheetService;
  34. /**
  35. * 复制新增
  36. * @param projectManageDo
  37. * @return
  38. */
  39. @PostMapping("/genSummaryFiles")
  40. @ApiOperation("生成汇总文件")
  41. public R genSummaryFiles(@RequestBody ZhcxProjectManageDo projectManageDo){
  42. try {
  43. String files = luckysheetService.genProjectSummaryFiles(projectManageDo.getId());
  44. return R.ok(files);
  45. } catch (Exception e) {
  46. log.error("生成异常, {}", e);
  47. return R.error("生成异常!");
  48. }
  49. }
  50. /**
  51. * 保存汇总文件数据
  52. *
  53. * @param dto
  54. * @return
  55. */
  56. @PostMapping("/saveSummaryData")
  57. @ApiOperation("保存汇总文件数据")
  58. public R saveSummaryData(@RequestBody SavePorjectSummaryDto dto) {
  59. try {
  60. service.saveSummaryData(dto);
  61. } catch (CustomException e) {
  62. log.error("保存自定义异常", e);
  63. R.error("保存异常");
  64. } catch (Exception e) {
  65. log.error("保存异常", e);
  66. return R.error("保存异常");
  67. }
  68. return R.ok();
  69. }
  70. @PostMapping("/getRectifyReportData")
  71. @ApiOperation("获取整改报表数据")
  72. public R getRectifyReportData(@RequestBody Map<String,Object> map) {
  73. R r = service.getRectifyReportData(map);
  74. return r;
  75. }
  76. }