ProjectSalaryHistoryController.java
4.62 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
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
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.labor.LaborProjectsDTO;
import com.subsidy.dto.project.ProjectMembersDTO;
import com.subsidy.dto.project.TalentListDTO;
import com.subsidy.dto.project.TalentSalaryDTO;
import com.subsidy.dto.project.TalentSalaryDetailDTO;
import com.subsidy.dto.salary.CommitSalaryDTO;
import com.subsidy.dto.salary.PushMsgDTO;
import com.subsidy.dto.salary.SaveSalaryDTO;
import com.subsidy.model.ProjectMemberMappingDO;
import com.subsidy.model.ProjectSalaryHistoryDO;
import com.subsidy.service.ProjectSalaryHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
/**
* <p>
* 工资单历史表 前端控制器
* </p>
*
* @author Tuyp
* @since 2024-07-25
*/
@RestController
@Api(tags = "工资单历史表")
@RequestMapping("/projectSalaryHistory")
public class ProjectSalaryHistoryController {
@Autowired
private ProjectSalaryHistoryService projectSalaryHistoryService;
@PostMapping("laborProjects")
@ApiOperation("工资发放-按项目 laborId projectName")
public ResponseVO laborProjects(@RequestBody LaborProjectsDTO laborProjectMappingDO){
return ResponseData.generateCreatedResponse(0,projectSalaryHistoryService.laborProjects(laborProjectMappingDO));
}
@PostMapping("talentSalary")
@ApiOperation("项目-工资明细 projectId userName salaryMonth 2024-07 这种格式 pageSize pageNum")
public ResponseVO talentSalary(@RequestBody TalentSalaryDTO talentSalaryDTO){
return ResponseData.generateCreatedResponse(0,projectSalaryHistoryService.talentSalary(talentSalaryDTO));
}
@PostMapping("talentList")
@ApiOperation("按人才-人才列表 laborId userName pageSize pageNum")
public ResponseVO talentList(@RequestBody TalentListDTO talentListDTO){
return ResponseData.generateCreatedResponse(0,projectSalaryHistoryService.talentList(talentListDTO));
}
@PostMapping("talentSalaryDetail")
@ApiOperation("人才-工资明细 projectId memberId laborId pageSize pageNum")
public ResponseVO talentSalaryDetail(@RequestBody TalentSalaryDetailDTO talentSalaryDetailDTO){
return ResponseData.generateCreatedResponse(0,projectSalaryHistoryService.talentSalaryDetail(talentSalaryDetailDTO));
}
@PostMapping("projectMembers")
@ApiOperation("工资发放-详情:查看某个项目下的所有人才 projectId userName salaryMonth pageSize pageNum")
public ResponseVO projectMembers(@RequestBody ProjectMembersDTO projectMembersDTO){
return ResponseData.generateCreatedResponse(0,projectSalaryHistoryService.projectMembers(projectMembersDTO));
}
@PostMapping("saveSalary")
@ApiOperation("保存工资/编辑 projectId salaryMonth projectSalaryHistoryDOS[projectMappingId memberId salary salaryDate salaryMark]")
public ResponseVO saveSalary(@RequestBody SaveSalaryDTO saveSalaryDTO){
projectSalaryHistoryService.saveSalary(saveSalaryDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("exportTemplate")
@ApiOperation("下载模板 projectId")
public ResponseVO exportTemplate(@RequestBody SaveSalaryDTO saveSalaryDTO){
projectSalaryHistoryService.exportTemplate(saveSalaryDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("importSalary")
@ApiOperation("导入工资单 projectId salaryMonth file")
public ResponseVO importSalary(@RequestParam("file") MultipartFile file,Long projectId,String salaryMonth){
projectSalaryHistoryService.importSalary(file,projectId,salaryMonth);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("commitSalary")
@ApiOperation("提交工资 unCommitIds[] projectMembers接口s返回的unCommitId")
public ResponseVO commitSalary(@RequestBody CommitSalaryDTO commitSalaryDTO){
projectSalaryHistoryService.commitSalary(commitSalaryDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("pushMsg")
@ApiOperation("消息推送 projectId salaryMonth projectSalaryNoticeDOS[noticeType noticeTime]")
public void pushMsg(@RequestBody PushMsgDTO pushMsgDTO){
projectSalaryHistoryService.pushMsg(pushMsgDTO);
}
@GetMapping("testPush")
@ApiOperation("测试推送消息")
public void testPush(){
projectSalaryHistoryService.testPush();
}
}