Blame view

ServiceMemberMappingController.java 2.48 KB
涂亚平 committed
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
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);
    }

}