ServiceMemberMappingController.java 2.48 KB
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.member.DownloadFailClassMembers;
import com.subsidy.dto.member.RemoveMembersDTO;
import com.subsidy.dto.member.SelectImportDTO;
import com.subsidy.dto.member.SelectMembersDTO;
import com.subsidy.service.ServiceMemberMappingService;
import io.swagger.annotations.ApiOperation;
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-04-08
 */
@RestController
@Api(tags = "服务映射表")
@RequestMapping("/serviceMemberMapping")
public class ServiceMemberMappingController {

    @Autowired
    private ServiceMemberMappingService serviceMemberMappingService;

    @PostMapping("selectImport")
    @ApiOperation("选择导入   memberIds[]  companyId  ")
    public ResponseVO selectImport(@RequestBody SelectImportDTO selectImportDTO){
        return ResponseData.generateCreatedResponse(0,serviceMemberMappingService.selectImport(selectImportDTO));
    }

    @PostMapping("selectMembers")
    @ApiOperation("该公司服务下已有的学员  companyId pageNum pageSize")
    public ResponseVO selectMembers(@RequestBody SelectMembersDTO selectMembersDTO){
        return ResponseData.generateCreatedResponse(0,serviceMemberMappingService.selectMembers(selectMembersDTO));
    }

    @PostMapping("removeMembers")
    @ApiOperation("移除学员   memberMappingIds")
    public ResponseVO removeMembers(@RequestBody RemoveMembersDTO removeMembersDTO){
        return ResponseData.generateCreatedResponse(0,serviceMemberMappingService.removeMembers(removeMembersDTO));
    }

    @PostMapping("importClassMembers")
    @ApiOperation("班级导入学员 file companyId")
    public ResponseVO importClassMembers(@RequestParam("file") MultipartFile file, Long companyId){
        return ResponseData.generateCreatedResponse(0,serviceMemberMappingService.importClassMembers(file,companyId));
    }

    @PostMapping("downloadFailClassMembers")
    @ApiOperation("下载导入失败的班级学员 downloadFailClassMembersDTOS[]  失败返回的那些字段")
    public void downloadFailClassMembers(@RequestBody DownloadFailClassMembers downloadFailClassMembers){
        serviceMemberMappingService.downloadFailClassMembers(downloadFailClassMembers);
    }

}