|
|
@ -2,12 +2,9 @@ package com.sztzjy.marketing.controller.stu;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
|
import com.sztzjy.marketing.annotation.AnonymousAccess;
|
|
|
|
|
|
|
|
import com.sztzjy.marketing.config.ThreadPoolConfig;
|
|
|
|
|
|
|
|
import com.sztzjy.marketing.entity.StuTableName;
|
|
|
|
import com.sztzjy.marketing.entity.StuTableName;
|
|
|
|
import com.sztzjy.marketing.entity.StuTableNameExample;
|
|
|
|
import com.sztzjy.marketing.entity.StuTableNameExample;
|
|
|
|
import com.sztzjy.marketing.entity.StuUploadExcelUser;
|
|
|
|
import com.sztzjy.marketing.entity.StuUploadExcelUser;
|
|
|
|
import com.sztzjy.marketing.entity.StuUser;
|
|
|
|
|
|
|
|
import com.sztzjy.marketing.entity.dto.StuUserProfileDto;
|
|
|
|
import com.sztzjy.marketing.entity.dto.StuUserProfileDto;
|
|
|
|
import com.sztzjy.marketing.mapper.StuTableNameMapper;
|
|
|
|
import com.sztzjy.marketing.mapper.StuTableNameMapper;
|
|
|
|
import com.sztzjy.marketing.mapper.StuUploadExcelUserMapper;
|
|
|
|
import com.sztzjy.marketing.mapper.StuUploadExcelUserMapper;
|
|
|
@ -16,19 +13,16 @@ import com.sztzjy.marketing.util.ResultEntity;
|
|
|
|
import com.sztzjy.marketing.util.excel.DemoDataListener;
|
|
|
|
import com.sztzjy.marketing.util.excel.DemoDataListener;
|
|
|
|
import com.sztzjy.marketing.util.file.IFileUtil;
|
|
|
|
import com.sztzjy.marketing.util.file.IFileUtil;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.Collections;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
@ -93,7 +87,7 @@ public class StuUserProfileDatabaseController {
|
|
|
|
@PostMapping("/uploadExcel")
|
|
|
|
@PostMapping("/uploadExcel")
|
|
|
|
//@AnonymousAccess
|
|
|
|
//@AnonymousAccess
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
public ResultEntity uploadExcel(@RequestPart @ApiParam("文件") MultipartFile file,String userId) throws IOException {
|
|
|
|
public ResultEntity uploadExcel(@RequestPart @ApiParam("文件") MultipartFile file,@RequestParam(required = false) String userId) throws IOException {
|
|
|
|
//读取文件内容 批量导入excel中 以文件名区分\
|
|
|
|
//读取文件内容 批量导入excel中 以文件名区分\
|
|
|
|
|
|
|
|
|
|
|
|
String fileName = file.getOriginalFilename().substring(0,file.getOriginalFilename().lastIndexOf("."));
|
|
|
|
String fileName = file.getOriginalFilename().substring(0,file.getOriginalFilename().lastIndexOf("."));
|
|
|
|