MemberController.java
3.03 KB
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
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.administer.DownloadFailMembersDTO;
import com.subsidy.dto.member.AddMemberDTO;
import com.subsidy.dto.member.QueryMembersDTO;
import com.subsidy.model.GroupMemberMappingDO;
import com.subsidy.model.MemberDO;
import com.subsidy.service.MemberService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import org.springframework.web.multipart.MultipartFile;
/**
* <p>
* 前端控制器
* </p>
*
* @author Tuyp
* @since 2024-07-18
*/
@RestController
@Api(tags = "人才表")
@RequestMapping("/member")
public class MemberController {
@Autowired
private MemberService memberService;
@PostMapping("addMember")
@ApiOperation("添加人才 groupId userName telephone gender idCard payrollAccount bank ")
public ResponseVO addMember(@RequestBody AddMemberDTO addMemberDTO) {
memberService.addMember(addMemberDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("updateMember")
@ApiOperation("修改 id userName telephone gender idCard payrollAccount bank ")
public ResponseVO updateMember(@RequestBody AddMemberDTO addMemberDTO) {
memberService.updateMember(addMemberDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("deleteMember")
@ApiOperation("删除 id ")
public ResponseVO deleteMember(@RequestBody MemberDO memberDO) {
memberService.deleteMember(memberDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("queryMembers")
@ApiOperation("花名册 groupId 组别id userInfo pageSize pageNum ")
public ResponseVO queryMembers(@RequestBody QueryMembersDTO queryMembersDTO) {
return ResponseData.generateCreatedResponse(0, memberService.queryMembers(queryMembersDTO));
}
@PostMapping("detail")
@ApiOperation("花名册--详情 memberId 人才id")
public ResponseVO detail(@RequestBody GroupMemberMappingDO groupMemberMappingDO){
return ResponseData.generateCreatedResponse(0, memberService.detail(groupMemberMappingDO));
}
@PostMapping("importMember")
@ApiOperation("导入学生 {groupId file}" +
"模板地址:https://ykhl-bigger.oss-cn-beijing.aliyuncs.com/%E4%BA%BA%E6%89%8D%E6%A8%A1%E6%9D%BF.xlsx")
// @LoginRequired
public ResponseVO importMember(Long groupId, @RequestParam("file") MultipartFile file) throws Exception {
return ResponseData.generateCreatedResponse(0, memberService.importMember(groupId, file));
}
@PostMapping("downloadFailMembers")
@ApiOperation("下载失败的学员 importMemberVOS[] 字段是导出失败的字段")
public void downloadFailMembers(@RequestBody DownloadFailMembersDTO downloadFailMembersDTO){
memberService.downloadFailMembers(downloadFailMembersDTO);
}
}