heheng
2024-11-20 2d27b24029adafdbfc5703b38a519d65beda6a68
expert-admin/src/main/java/com/gkhy/web/controller/bussiness/ProjectManagementController.java
@@ -1,25 +1,26 @@
package com.gkhy.system.controller;
package com.gkhy.web.controller.bussiness;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gkhy.common.annotation.Log;
import com.gkhy.common.annotation.RepeatSubmit;
import com.gkhy.common.core.controller.BaseController;
import com.gkhy.common.core.domain.AjaxResult;
import com.gkhy.common.enums.BusinessType;
import com.gkhy.system.domain.ProjectManagement;
import com.gkhy.system.service.IProjectManagementService;
import com.gkhy.common.utils.poi.ExcelUtil;
import com.gkhy.common.core.domain.R;
import com.gkhy.common.core.page.TableDataInfo;
import com.gkhy.system.domain.ProjectExpertDetail;
import com.gkhy.system.domain.ProjectFile;
import com.gkhy.system.domain.ProjectManagement;
import com.gkhy.system.domain.vo.request.*;
import com.gkhy.system.domain.vo.response.*;
import com.gkhy.system.service.IProjectManagementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * 项目管理Controller
@@ -29,6 +30,7 @@
 */
@RestController
@RequestMapping("/system/management")
@Api(tags = "项目管理专家考评-项目管理专家考评前端控制器")
public class ProjectManagementController extends BaseController
{
    @Autowired
@@ -37,8 +39,13 @@
    /**
     * 查询项目管理列表
     */
    @ApiOperation(value = "查询项目管理列表(分页)")
    @PreAuthorize("@ss.hasPermi('system:management:list')")
    @GetMapping("/list")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10,最大50")
    })
    public TableDataInfo list(ProjectManagement projectManagement)
    {
        startPage();
@@ -46,59 +53,171 @@
        return getDataTable(list);
    }
    /**
     * 导出项目管理列表
     */
    @PreAuthorize("@ss.hasPermi('system:management:export')")
    @Log(title = "项目管理", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ProjectManagement projectManagement)
    {
        List<ProjectManagement> list = projectManagementService.selectProjectManagementList(projectManagement);
        ExcelUtil<ProjectManagement> util = new ExcelUtil<ProjectManagement>(ProjectManagement.class);
        util.exportExcel(response, list, "项目管理数据");
    }
    /**
     * 获取项目管理详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:management:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    @ApiOperation(value = "获取项目管理详细信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", dataType = "int", required = true, value = "当前页,默认1")
    })
    public R<ProjectManagement> getInfo(@PathVariable("id") Long id)
    {
        return success(projectManagementService.selectProjectManagementById(id));
        return R.ok(projectManagementService.selectProjectManagementById(id));
    }
    /**
     * 新增项目管理
     */
    @PreAuthorize("@ss.hasPermi('system:management:add')")
    @Log(title = "项目管理", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ProjectManagement projectManagement)
    @ApiOperation(value = "新增编辑项目管理")
    @PostMapping("/saveProject")
    @RepeatSubmit
    public R addProject(@Validated @RequestBody ProjectManageSaveReq projectManagement)
    {
        return toAjax(projectManagementService.insertProjectManagement(projectManagement));
        return R.ok(projectManagementService.insertProjectManagement(projectManagement));
    }
    /**
     * 修改项目管理
     */
    @PreAuthorize("@ss.hasPermi('system:management:edit')")
    @Log(title = "项目管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ProjectManagement projectManagement)
    @ApiOperation(value = "项目专家选取保存-修改")
    @PostMapping("/projectExpert")
    @RepeatSubmit
    public R projectExpert(@Validated @RequestBody ProjectExpertSaveBatchReqDto projectManagement)
    {
        return toAjax(projectManagementService.updateProjectManagement(projectManagement));
        projectManagementService.updateProjectManagement(projectManagement);
        return R.ok();
    }
    @PreAuthorize("@ss.hasPermi('system:management:info')")
    @ApiOperation(value = "获取项目专家审批用(获取项目信息和专家数据)")
    @GetMapping("/projectExpertCheckInfo")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "id", dataType = "long", required = true, value = "当前页,默认1")
    })
    public R<ProjectExpertManagementInfoRes> projectExpertCheckInfo(@RequestParam("id") Long id)
    {
        return R.ok(projectManagementService.projectExpertCheckInfo(id));
    }
    @PreAuthorize("@ss.hasPermi('system:management:edit')")
    @ApiOperation(value = "项目专家审批")
    @PostMapping("/projectCheck")
    @RepeatSubmit
    public R projectCheck(@Validated @RequestBody ProjectCheckReq req)
    {
        projectManagementService.projectCheck(req);
        return R.ok();
    }
    @PreAuthorize("@ss.hasPermi('system:management:edit')")
    @ApiOperation(value = "项目归档")
    @PostMapping("/projectArchive")
    @RepeatSubmit
    public R projectArchive(@Validated @RequestBody ProjectArchiveReq req)
    {
        projectManagementService.projectArchive(req);
        return R.ok();
    }
    /**
     * 删除项目管理
     */
    @PreAuthorize("@ss.hasPermi('system:management:remove')")
    @Log(title = "项目管理", businessType = BusinessType.DELETE)
   @DeleteMapping("/{ids}")
    @ApiOperation(value = "删除项目管理")
    @RepeatSubmit
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(projectManagementService.deleteProjectManagementByIds(ids));
    }
    /**
     * 事后考评列表
     */
    @ApiOperation(value = "事后考评——事后考评(分页)")
    @PreAuthorize("@ss.hasPermi('system:management:list')")
    @GetMapping("/projectExpertList")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10,最大50")
    })
    public TableDataInfo projectExpertList(ProjectExpertStateReq  req)
    {
        startPage();
        List<ProjectExpertStateResp> list = projectManagementService.getProjectExpertSate(req);
        return getDataTable(list);
    }
    @ApiOperation(value = "事后考评——项目专家考评列表(分页)")
    @PreAuthorize("@ss.hasPermi('system:management:list')")
    @GetMapping("/projectExpertEvaluationList")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10,最大50"),
            @ApiImplicitParam(paramType = "query", name = "id", dataType = "int", required = true, value = "项目id")
    })
    public TableDataInfo projectExpertEvaluationList(@RequestParam("id") Long id)
    {
        startPage();
        List<ProjectExpertEvaluationResp> projectExpertEvaluationResps = projectManagementService.projectExpertEvaluationList(id);
        return getDataTable(projectExpertEvaluationResps);
    }
    @PreAuthorize("@ss.hasPermi('system:management:edit')")
    @ApiOperation(value = "事后考评——项目专家考评")
    @PostMapping("/ProjectExpertDetailSave")
    @RepeatSubmit
    public R projectExpertDetailSave(@Validated @RequestBody ProjectExpertScoreSaveReq req)
    {
        projectManagementService.projectExpertDetailSave(req);
        return R.ok();
    }
    @ApiOperation(value = "专家考评记录——专家考评记录列表(分页)")
    @PreAuthorize("@ss.hasPermi('system:management:list')")
    @GetMapping("/projectExpertEvaList")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10,最大50"),
    })
    public TableDataInfo projectExpertEvaList(SysProjectExpertReq req)
    {
        startPage();
        List<ProjectExpertResp> projectExpertResps = projectManagementService.projectExpertEvaList(req);
        return getDataTable(projectExpertResps);
    }
    @ApiOperation(value = "专家考评记录——专家考评记明细")
    @PreAuthorize("@ss.hasPermi('system:management:list')")
    @GetMapping("/selectProjectExpertDetailList")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectExpertId", dataType = "long", required = true, value = "项目专家id")
    })
    public R<List<ProjectExpertDetail>> selectProjectExpertDetailList(@RequestParam("projectExpertId") Long projectExpertId)
    {
        return R.ok(projectManagementService.selectProjectExpertDetailList(projectExpertId));
    }
    @GetMapping("/selectProjectFileList")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", dataType = "long", required = true, value = "项目id"),
            @ApiImplicitParam(paramType = "query", name = "module", dataType = "String", required = true, value = "附件类型1审批附件2项目附件")
    })
    @ApiOperation(value = "项目附件相关")
    public R<List<ProjectFile>> selectProjectFileList(@RequestParam("projectId") Long projectId, @RequestParam("module") String module ){
        return R.ok(projectManagementService.selectProjectFileList(projectId,module));
    }
    @GetMapping("/getProjectNum")
    @ApiOperation(value = "项目统计数量")
    public R<ProjectNumResp> getProjectNum(){
        return R.ok(projectManagementService.getProjectNum());
    }
}