package com.rongwei.bsserver.controller; import com.rongwei.bscommon.sys.service.LuckysheetService; import com.rongwei.bscommon.sys.service.ZhcxProjectManageService; import com.rongwei.bsentity.domain.ZhcxProjectManageDo; import com.rongwei.bsentity.dto.project.SavePorjectSummaryDto; import com.rongwei.rwcommon.base.R; import com.rongwei.rwcommon.base.exception.CustomException; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Map; /** *
* 项目管理表 前端控制器 *
* * @author wm * @since 2024-06-28 */ @RestController @RequestMapping("/zhcxProjectManage") @Api(tags = "项目管理") @Slf4j public class ZhcxProjectManageController { @Autowired private ZhcxProjectManageService service; @Autowired private LuckysheetService luckysheetService; /** * 复制新增 * @param projectManageDo * @return */ @PostMapping("/genSummaryFiles") @ApiOperation("生成汇总文件") public R genSummaryFiles(@RequestBody ZhcxProjectManageDo projectManageDo){ try { String files = luckysheetService.genProjectSummaryFiles(projectManageDo.getId()); return R.ok(files); } catch (Exception e) { log.error("生成异常, {}", e); return R.error("生成异常!"); } } /** * 保存汇总文件数据 * * @param dto * @return */ @PostMapping("/saveSummaryData") @ApiOperation("保存汇总文件数据") public R saveSummaryData(@RequestBody SavePorjectSummaryDto dto) { try { service.saveSummaryData(dto); } catch (CustomException e) { log.error("保存自定义异常", e); R.error("保存异常"); } catch (Exception e) { log.error("保存异常", e); return R.error("保存异常"); } return R.ok(); } @PostMapping("/getRectifyReportData") @ApiOperation("获取整改报表数据") public R getRectifyReportData(@RequestBody Map