Commit 72351f0c by yangxiujun

fix:修改上传

1 parent 46375f68
......@@ -56,6 +56,7 @@ public class FileController {
*/
@PostMapping("/file/upload")
public Result upload(MultipartFile file, HttpServletRequest request, HttpServletResponse response) throws IOException {
long l = System.currentTimeMillis();
String token = request.getHeader(HttpHeaders.AUTHORIZATION);
if (StringUtils.isBlank(token)) {
throw new BusinessException("用户未登录");
......@@ -83,7 +84,8 @@ public class FileController {
EasyExcel.read(file.getInputStream(), OrderInfoExcelDTO.class
, new ContractsListener(orderCreateService, token, response)).sheet().doRead();
long l1 = System.currentTimeMillis();
System.out.println("全部时间"+(l1-l));
return Result.success();
}
......
......@@ -274,6 +274,10 @@ public class OrderCreateServiceImpl implements OrderCreateService {
public void saveBatch(List<OrderInfoExcelDTO> cachedDataList, String token, ThreadLocal local, HttpServletResponse response) {
FileRateDTO fileRateDTO = new FileRateDTO();
ArrayList<OrderInfoErrorExcelDTO> errorList = (ArrayList<OrderInfoErrorExcelDTO>) local.get();
if(errorList == null){
errorList =new ArrayList<OrderInfoErrorExcelDTO>();
local.set(errorList);
}
Integer successCount = 0;
if (tokenCount.get(token) != null) {
throw new BusinessException("用户正在上传中,请稍后再试");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!