MrShi
8 天以前 7c93550a244fcc74678344628c229b42438c729f
server/admin/src/main/java/com/doumee/api/business/ImportRecordController.java
@@ -9,14 +9,17 @@
import com.doumee.dao.business.model.ImportRecord;
import com.doumee.core.utils.Utils;
import com.doumee.service.business.ImportRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import  com.doumee.api.BaseController;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
/**
 * 分类信息表Controller定义
 * @author doumee
@@ -82,4 +85,16 @@
    public ApiResponse findById(@PathVariable Integer id) {
        return ApiResponse.success(importRecordService.findById(id));
    }
    @ApiOperation(value = "信息导入" ,notes = "保单申请")
    @PostMapping("/importExcel")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class),
            @ApiImplicitParam(name = "导入类型 0人员 1案例", value = "type", required = true, paramType = "query", dataType = "Integer",example = "0",dataTypeClass = Integer.class),
    })
    public ApiResponse<String> importExcel (@ApiParam(value = "file") MultipartFile file, @ApiParam(value = "type") Integer type) {
        ImportRecord importRecord = importRecordService.importBatch(file,type);
        importRecordService.dealImporTask(importRecord);
        return ApiResponse.success("文件上传成功");
    }
}