Blame view

MemberController.java 3.96 KB
涂亚平 committed
1 2 3 4 5
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
6
import com.subsidy.common.interceptor.LoginRequired;
涂亚平 committed
7
import com.subsidy.dto.company.AttendMembersDTO;
8
import com.subsidy.dto.member.*;
涂亚平 committed
9
import com.subsidy.model.CompanyMemberMappingDO;
10 11 12
import com.subsidy.model.MemberDO;
import com.subsidy.service.MemberService;
import io.swagger.annotations.Api;
涂亚平 committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 学生表 前端控制器
 * </p>
 *
 * @author Tuyp
 * @since 2024-01-11
 */
@RestController
@Api(tags = "学生表")
@RequestMapping("/member")
public class MemberController {

    @Autowired
34
    private MemberService memberService;
涂亚平 committed
35 36 37 38

    @PostMapping("departMembers")
    @ApiOperation("某公司的离职记录  pageSize pageNum  companyId  userName 姓名/手机号/身份证号")
    public ResponseVO departMembers(@RequestBody DepartMembersDTO departMembersDTO){
39
        return ResponseData.generateCreatedResponse(0,memberService.departMembers(departMembersDTO));
涂亚平 committed
40 41 42 43 44
    }

    @PostMapping("exportDepartMembers")
    @ApiOperation("导出离职人员记录   companyId  userName 姓名/手机号/身份证号  ")
    public void exportDepartMembers(@RequestBody DepartMembersDTO departMembersDTO){
45
        memberService.exportDepartMembers(departMembersDTO);
涂亚平 committed
46 47 48 49 50
    }

    @PostMapping("attendMembers")
    @ApiOperation("查看某个企业已经参加过该培训的学生   companyId departmentId userName pageSize pageNum")
    public ResponseVO attendMembers(@RequestBody AttendMembersDTO attendMembersDTO){
51
        return ResponseData.generateCreatedResponse(0,memberService.attendMembers(attendMembersDTO));
涂亚平 committed
52 53 54 55 56
    }

    @PostMapping("memberAttendInfo")
    @ApiOperation("某个学员在该企业参加培训的详情  memberId  学员id companyId 公司id")
    public ResponseVO memberAttendInfo(@RequestBody CompanyMemberMappingDO companyMemberMappingDO){
57 58 59 60 61 62 63 64
        return ResponseData.generateCreatedResponse(0,memberService.memberAttendInfo(companyMemberMappingDO));
    }

    @PostMapping("getAll")
    @ApiOperation("查询某部门成员 pageNum pageSize departmentId userName status startDate endDate")
    @LoginRequired
    public ResponseVO getAll(@RequestBody GetAllDTO getAllDTO){
        return ResponseData.generateCreatedResponse(0,memberService.getAll(getAllDTO));
涂亚平 committed
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
    @PostMapping("deleteMember")
    @ApiOperation("删除成员 id ")
    @LoginRequired
    public ResponseVO deleteMember(@RequestBody MemberDO memberDO){
        return ResponseData.generateCreatedResponse(0,memberService.deleteMember(memberDO));
    }

    @PostMapping("addMember")
    @ApiOperation("新增成员 companyId userName accountName accountNameEn telephone gender image idCard departmentIds jobIds workNo inductionDate email")
    @LoginRequired
    public ResponseVO addMember(@RequestBody AddMemberDTO addMemberDTO){
        return ResponseData.generateCreatedResponse(0,memberService.addMember(addMemberDTO));
    }

    @PostMapping("updateMember")
    @ApiOperation("编辑成员 {id companyId userName accountName accountNameEn telephone gender image idCard idCardPhoto status departmentIds jobIds}")
    @LoginRequired
    public ResponseVO updateMember(@RequestBody AddMemberDTO addMemberDTO){
        return ResponseData.generateCreatedResponse(0,memberService.updateMember(addMemberDTO));
    }

    @PostMapping("changeDepartments")
    @ApiOperation("修改部门   desDepId[] 目的部门 memberIds[] 成员id")
    @LoginRequired
    public ResponseVO changeDepartments(@RequestBody ChangeDepartmentsDTO changeDepartmentsDTO){
        return ResponseData.generateCreatedResponse(0,memberService.changeDepartments(changeDepartmentsDTO));
    }
涂亚平 committed
94 95

}