package com.ruoyi.projectManagement.controller; import com.ruoyi.framework.aspectj.lang.annotation.Log; import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.projectManagement.dto.InfoStageDto; import com.ruoyi.projectManagement.dto.UpdateStateInfo; import com.ruoyi.projectManagement.service.InfoService; import com.ruoyi.projectManagement.service.impl.handle.InfoStageHandleService; import com.ruoyi.projectManagement.vo.SaveInfoStageVo; import com.ruoyi.projectManagement.vo.SaveInfoVo; import com.ruoyi.projectManagement.vo.SearchInfoVo; import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; import jakarta.validation.Valid; /** * @author buhuazhen * @date 2026/3/9 * @email 3038525872@qq.com */ @RestController @RequestMapping("/projectManagement/info") @Tag(name = "项目管理信息表(项目管理类型)") @RequiredArgsConstructor public class InfoController { private final InfoService infoService; private final InfoStageHandleService infoStageHandleService; @PostMapping("/save") @Operation(summary = "保存") @Log(title = "项目信息-保存", businessType = BusinessType.INSERT) public AjaxResult save(@RequestBody @Valid SaveInfoVo saveInfoVo) { infoService.save(saveInfoVo); return AjaxResult.success(); } @PostMapping("/updateStatus") @Operation(summary = "修改状态") @Log(title = "项目信息-修改状态", businessType = BusinessType.UPDATE) public AjaxResult updateStatus(@RequestBody @Valid UpdateStateInfo updateStateInfo){ infoService.updateStatus(updateStateInfo); return AjaxResult.success(); } @PostMapping("/delete/{id}") @Operation(summary = "删除") @Log(title = "项目信息-删除", businessType = BusinessType.DELETE) public AjaxResult delete(@PathVariable Long id) { infoService.deleteInfo(id); return AjaxResult.success(); } @PostMapping("/listPage") @Operation(summary = "分页列表") public AjaxResult listPage(@RequestBody @Valid SearchInfoVo vo) { return AjaxResult.success(infoService.searchListInfo(vo)); } @PostMapping("/{id}") @Operation(summary = "详情") public AjaxResult getInfoById(@PathVariable Long id) { return AjaxResult.success(infoService.getInfoById(id)); } @PostMapping("/saveStage") @Operation(summary = "保存阶段") @Log(title = "项目信息-保存阶段", businessType = BusinessType.INSERT) public AjaxResult saveStage(@RequestBody @Valid SaveInfoStageVo dto) { infoStageHandleService.save(dto); return AjaxResult.success(); } @PostMapping("/listStage/{id}") @Operation(summary = "列表阶段") public AjaxResult listStage(@PathVariable Long id) { return AjaxResult.success(infoStageHandleService.getListVoByInfoId(id)); } @PostMapping("/deleteStage/{id}") @Operation(summary = "删除阶段") @Log(title = "项目信息-删除阶段", businessType = BusinessType.DELETE) public AjaxResult deleteStage(@PathVariable Long id) { infoStageHandleService.deleteById(id); return AjaxResult.success(); } }