heheng
2024-12-03 05600d089901d44e8d5036046025b6a90ceb896a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
package com.gkhy.web.controller.bussiness;
 
 
import com.gkhy.common.annotation.Anonymous;
import com.gkhy.common.annotation.RepeatSubmit;
import com.gkhy.common.core.controller.BaseController;
import com.gkhy.common.core.domain.AjaxResult;
import com.gkhy.common.core.domain.R;
import com.gkhy.common.core.page.TableDataInfo;
import com.gkhy.common.utils.SecurityUtils;
import com.gkhy.system.domain.SysExpertInfo;
import com.gkhy.system.domain.vo.request.ExpertBatchChangeReq;
import com.gkhy.system.domain.vo.request.SysExpertInfoRoundReq;
import com.gkhy.system.domain.vo.request.SysExpertSearchReqDto;
import com.gkhy.system.domain.vo.response.ProjectExpertSectionResp;
import com.gkhy.system.domain.vo.response.SysExpertSearchRep;
import com.gkhy.system.service.SysExpertInfoService;
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.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * @author admin
 */
@Api(tags = "专家库-专家信息前端控制器")
@RestController
@RequestMapping("/system/expert_info")
public class ExpertInfoController extends BaseController {
    @Autowired
    private SysExpertInfoService expertInfoService;
 
    // @RequiresPermissions("system:assess:monitor")
    @ApiOperation(value = "专家列表(分页-都可见)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10,最大50")
    })
    @GetMapping("/list")
    public TableDataInfo exportInfoList(SysExpertInfo expertInfo) {
        startPage();
        List<SysExpertInfo> sysExpertInfos = expertInfoService.exportInfoList(expertInfo);
        return getDataTable(sysExpertInfos);
 
    }
 
 
    @ApiOperation(value = "专家列表(分页-限制处室)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10,最大50")
    })
    @GetMapping("/perList")
    public TableDataInfo exportInfoPerList(SysExpertInfo expertInfo) {
        startPage();
        if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())){
            expertInfo.setDeptId(SecurityUtils.getDeptId());
        }
        List<SysExpertInfo> sysExpertInfos = expertInfoService.exportInfoList(expertInfo);
        return getDataTable(sysExpertInfos);
 
    }
 
    // @RequiresPermissions("system:assess:monitor")
    @RepeatSubmit
    @ApiOperation(value = "新增专家信息")
    @PostMapping("/add")
    @Anonymous
    public AjaxResult addExpertInfo(@RequestBody SysExpertInfo expertInfo) {
        return AjaxResult.success(expertInfoService.addExpertInfo(expertInfo));
    }
 
    //@RequiresPermissions("system:assess:monitor")
    @RepeatSubmit
    @ApiOperation(value = "修改专家信息")
    @PutMapping("/mod")
    public AjaxResult modExpertInfo(@RequestBody SysExpertInfo expertInfo) {
        return AjaxResult.success(expertInfoService.modExpertInfo(expertInfo));
    }
 
    //@RequiresPermissions("system:assess:monitor")
    @RepeatSubmit
    @ApiOperation(value = "删除专家信息")
    @DeleteMapping("/del/{expertId}")
    public AjaxResult delExpertInfo(@PathVariable(value = "expertId") Long expertId) {
        return AjaxResult.success(expertInfoService.delExpertInfo(expertId));
    }
 
    // @RequiresPermissions("system:assess:monitor")
    @RepeatSubmit
    @ApiOperation(value = "批量删除专家信息")
    @DeleteMapping("/del/batch/{expertIds}")
    public AjaxResult delExpertInfo(@PathVariable(value = "expertIds") Long[] expertIds) {
        return AjaxResult.success(expertInfoService.delExpertInfoBatch(expertIds));
    }
 
    // @RequiresPermissions("system:assess:monitor")
    @ApiOperation(value = "根据id获取专家信息")
    @GetMapping("/detail/{expertId}")
    public R<SysExpertInfo> exportInfoDetail(@PathVariable(value = "expertId") Long expertId) {
        return R.ok(expertInfoService.exportInfoDetail(expertId));
    }
 
 
    @RepeatSubmit
    //@RequiresPermissions("system:assess:monitor")
    @ApiOperation(value = "审批状态修改,审批状态(0暂存,1审核中,2审批通过,3审批驳回,4专家库)")
    @PostMapping("/changeApprove")
    public AjaxResult changeApprove(@RequestBody SysExpertInfo expertInfo) {
        return AjaxResult.success(expertInfoService.changeApprove(expertInfo));
    }
 
    @RepeatSubmit
    //@RequiresPermissions("system:assess:monitor")
    @ApiOperation(value = "专家查询审批结果")
    @PostMapping("/queryApprove")
    @Anonymous
    public R<SysExpertSearchRep> queryApprove(@Validated @RequestBody SysExpertSearchReqDto expertInfo) {
        return R.ok(expertInfoService.queryApprove(expertInfo));
    }
 
    @RepeatSubmit
    //@RequiresPermissions("system:assess:monitor")
    @ApiOperation(value = "随机获取专家数据")
    @PostMapping("/getExpertRound")
    public R<List<ProjectExpertSectionResp>> getExpertRound(@Validated @RequestBody SysExpertInfoRoundReq expertInfo) {
        return R.ok(expertInfoService.getExpertRound(expertInfo));
    }
 
 
    @RepeatSubmit
    //@RequiresPermissions("system:assess:monitor")
    @ApiOperation(value = "一键修改证书有效期")
    @PostMapping("/batchChangeEmploymentDate")
    public AjaxResult batchChangeEmploymentDate(@RequestBody ExpertBatchChangeReq expertInfo) {
        expertInfoService.batchChangeEmploymentDate(expertInfo);
        return AjaxResult.success();
    }
 
}