ソースを参照

LY 公司培训成绩

ly 2 年 前
コミット
de3976ea72

+ 21 - 13
master/src/main/java/com/ruoyi/common/utils/file/ExcelUtils.java

@@ -1,5 +1,6 @@
 package com.ruoyi.common.utils.file;
 
+import com.ruoyi.framework.web.controller.BaseController;
 import org.apache.commons.lang.time.DateFormatUtils;
 import org.apache.poi.hssf.usermodel.HSSFDataFormat;
 import org.apache.poi.hssf.usermodel.HSSFDateUtil;
@@ -7,6 +8,8 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.File;
@@ -25,6 +28,7 @@ import java.util.List;
  * Created by Administrator on 2018/7/26 0026.
  */
 public class ExcelUtils {
+    protected static final Logger logger = LoggerFactory.getLogger(BaseController.class);
 
     public static Workbook getWorkBook(MultipartFile file) {
         //获得文件名
@@ -38,7 +42,7 @@ public class ExcelUtils {
             if (fileName.endsWith("xls")) {
                 //2003
                 workbook = new HSSFWorkbook(is);
-            } else if (fileName.endsWith("xlsx")||fileName.endsWith("xlsm")) {
+            } else if (fileName.endsWith("xlsx") || fileName.endsWith("xlsm")) {
                 //2007 及2007以上
                 workbook = new XSSFWorkbook(is);
             }
@@ -55,7 +59,7 @@ public class ExcelUtils {
         Workbook workbook = null;
         try {
             //获取excel文件的io流
-            InputStream is =new FileInputStream(file);
+            InputStream is = new FileInputStream(file);
             //根据文件后缀名不同(xls和xlsx)获得不同的Workbook实现类对象
             if (fileName.endsWith("xls")) {
                 //2003
@@ -75,28 +79,32 @@ public class ExcelUtils {
         if (cell == null) {
             return cellValue;
         }
-        System.out.println("Excel格式:"+ cell.getCellType().name());
+        logger.info("Excel格式:" + cell.getCellType().name());
 
         switch (cell.getCellType().name()) {
             case "STRING":
                 cellValue = cell.getRichStringCellValue().getString();
                 break;
             case "NUMERIC":
-                System.out.println("Excel数据样式:"+ cell.getCellStyle().getDataFormatString());
-                if("General".equals(cell.getCellStyle().getDataFormatString())){
+                logger.info("Excel数据样式:" + cell.getCellStyle().getDataFormatString());
+                if ("General".equals(cell.getCellStyle().getDataFormatString())) {
                     cellValue = new BigDecimal(cell.getNumericCellValue()).toPlainString();
-                }else if("m/d/yyyy;@".equals(cell.getCellStyle().getDataFormatString())){
-                    cellValue =  new SimpleDateFormat("yyyy-MM-dd").format(cell.getDateCellValue());
-                }else if("@".equals(cell.getCellStyle().getDataFormatString())){
+                } else if ("m/d/yyyy;@".equals(cell.getCellStyle().getDataFormatString())) {
+                    cellValue = new SimpleDateFormat("yyyy-MM-dd").format(cell.getDateCellValue());
+                } else if ("@".equals(cell.getCellStyle().getDataFormatString())) {
                     cellValue = cell.getNumericCellValue() + "";
-                }else if(cell.getCellStyle().getDataFormatString().indexOf("0_") > -1){
+                } else if (cell.getCellStyle().getDataFormatString().indexOf("0_") > -1) {
                     //数字非日期
-                    System.out.println("Excel值:"+ cell.getNumericCellValue());
+                    logger.info("Excel值:" + cell.getNumericCellValue());
                     cellValue = cell.getNumericCellValue() + "";
-                }else{
+                } else if (cell.getCellStyle().getDataFormatString().indexOf("0.0") > -1) {
+                    //数字非日期
+                    logger.info("Excel值:" + cell.getNumericCellValue());
+                    cellValue = cell.getNumericCellValue() + "";
+                } else {
                     try {
-                        cellValue =  new SimpleDateFormat("yyyy-MM-dd").format(cell.getDateCellValue());
-                    }catch (Exception e){
+                        cellValue = new SimpleDateFormat("yyyy-MM-dd").format(cell.getDateCellValue());
+                    } catch (Exception e) {
                         cellValue = cell.getNumericCellValue() + "";
                     }
                 }

+ 0 - 1
master/src/main/java/com/ruoyi/project/invoice/controller/TInvoiceBookingworkticketController.java

@@ -97,7 +97,6 @@ public class TInvoiceBookingworkticketController extends BaseController {
                }*/
                 }
             });
-
         }
         executorService.shutdown();
         return getDataTable(newtInvoiceWorkcontentList, bookingworkticketList);

+ 216 - 216
master/src/main/java/com/ruoyi/project/officeConvert/OfficeConvertController.java

@@ -1,216 +1,216 @@
-package com.ruoyi.project.officeConvert;
-
-import com.ruoyi.common.constant.Constants;
-import com.ruoyi.common.constant.HttpStatus;
-import com.ruoyi.common.utils.StringUtils;
-import com.ruoyi.framework.config.RuoYiConfig;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-
-import org.jodconverter.DocumentConverter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static com.ruoyi.project.officeConvert.PptPreview.pptToImage;
-import static com.ruoyi.project.officeConvert.PptPreview.pptxToImage;
-
-
-@Component
-@RestController
-@RequestMapping(value="/office",method = RequestMethod.POST)
-public class OfficeConvertController {
-
-    // 第一步:转换器直接注入
-    @Resource
-    DocumentConverter documentConverter;
-
-    protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
-
-    private static  String successMsg="请求成功!请预览文件!";
-
-    private static  String failMsg="暂不支持此格式类型文件预览,请下载后查看!";
-
-    private static  String codeMiss="若csv文件预览结果有乱码,请重新上传编码格式另存为ANSI的csv文件!";
-
-    private static  String fileMiss="您需要预览的文件不存在,可能已在本地删除,请重新上传即可!";
-
-
-    /**
-     office类型的文件
-     先远程服务端获取文件
-     然后转换
-     然后读写缓冲区返回前台
-     */
-    @PostMapping("/toPdfFile")
-    public AjaxResult toPdfFile(HttpServletRequest request, HttpServletResponse response,String filepath) {
-        // 获取HttpServletResponse
-        response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
-        String newFilePath=filepath.replace("/profile","");
-        // 需要转换的文件路径
-        File file = new File(RuoYiConfig.getProfile()+newFilePath);
-        boolean  flag= file.exists();
-        if(flag==false){
-            return new AjaxResult(HttpStatus.SUCCESS,fileMiss,Constants.RESOURCE_PREFIX+ "/" + newFilePath);
-        }
-        String converterPdf ="";  //生成的文件名
-        try {
-            // 转换之后文件生成的本地地址
-            File newFile = new File(RuoYiConfig.getProfile());
-            if (!newFile.exists()) {
-                newFile.mkdirs();
-            }
-            String name =file.getName();
-            int t=name.lastIndexOf(".");
-            String newName=name.substring(0,t);
-            //根据文件类型判断转换方式
-            if(newFilePath.endsWith(".docx")||newFilePath.endsWith(".doc")||newFilePath.endsWith(".xlsx")
-                    ||newFilePath.endsWith(".xls")||newFilePath.endsWith(".csv")||newFilePath.endsWith(".txt")){
-                converterPdf =  newName+".html";
-            }else if(newFilePath.endsWith(".mp4")||newFilePath.endsWith("pdf")||newFilePath.endsWith(".gif")
-                    ||newFilePath.endsWith("jpg")||newFilePath.endsWith("png")
-                    ||newFilePath.endsWith(".jpeg")){
-                //浏览器可以直接打开的直接返回图片和视频的文件路径
-                return   new AjaxResult(HttpStatus.SUCCESS,successMsg,Constants.RESOURCE_PREFIX+ "/" + newFilePath) ;
-            }else {
-                //其他类型都不支持就返回错误消息
-                return new AjaxResult(HttpStatus.SUCCESS,failMsg,Constants.RESOURCE_PREFIX+ "/" + newFilePath);
-            }
-            // 文件转化
-            documentConverter.convert(file).to(new File(RuoYiConfig.getProfile() + File.separator +"temp" + File.separator +converterPdf)).execute();
-            //office文件需要给有表格的加一个边框 以免 排版出现问题
-            if(newFilePath.endsWith(".xlsx")){
-                this.doActionConvertedFile(RuoYiConfig.getProfile() + File.separator +"temp" + File.separator +converterPdf);
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        //最后应该返回转换后的文件名称
-        String pathFileName = Constants.RESOURCE_PREFIX+ File.separator +"temp" + File.separator + converterPdf;
-        return  newFilePath.endsWith(".csv")? new AjaxResult(HttpStatus.SUCCESS,codeMiss,pathFileName): new AjaxResult(HttpStatus.SUCCESS,successMsg,pathFileName) ;
-    }
-
-    @PostMapping("/toBookFile")
-    public AjaxResult toBookFile(HttpServletRequest request, HttpServletResponse response,String filepath) {
-        // 获取HttpServletResponse
-        response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
-        String newFilePath=filepath.replace("/profile","");
-        // 需要转换的文件路径
-        File file = new File(RuoYiConfig.getProfile()+newFilePath);
-        boolean  flag= file.exists();
-        if(flag==false){
-            return new AjaxResult(HttpStatus.SUCCESS,fileMiss,Constants.RESOURCE_PREFIX+ "/" + newFilePath);
-        }
-        String converterPdf ="";  //生成的文件名
-        try {
-            // 转换之后文件生成的本地地址
-            File newFile = new File(RuoYiConfig.getProfile());
-            if (!newFile.exists()) {
-                newFile.mkdirs();
-            }
-            String name =file.getName();
-            int t=name.lastIndexOf(".");
-            String newName=name.substring(0,t);
-            //预约开票的word文档
-                converterPdf =  newName+".pdf";
-            // 文件转化
-            documentConverter.convert(file).to(new File(RuoYiConfig.getProfile() + File.separator +"temp" + File.separator +converterPdf)).execute();
-            //office文件需要给有表格的加一个边框 以免 排版出现问题
-           // this.doActionConvertedFile(RuoYiConfig.getProfile() + File.separator +"temp" + File.separator +converterPdf);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        //最后应该返回转换后的文件名称
-        String pathFileName = Constants.RESOURCE_PREFIX+ File.separator +"temp" + File.separator + converterPdf;
-        return   new AjaxResult(HttpStatus.SUCCESS,successMsg,pathFileName) ;
-    }
-
-
-    /**
-    PPT文件需要根据不同格式类型区分一下
-     */
-    @PostMapping("/PPTransJPEG")
-    public AjaxResult PPTransJPEG(HttpServletRequest request, HttpServletResponse response,String filepath) {
-        Map<String, Object> resultMap = new HashMap<>();
-        String newFilePath=filepath.replace("/profile","");
-        // 需要转换的PPT文件路径
-        File file = new File(RuoYiConfig.getProfile()+newFilePath);
-        //判断ppt,pptx文件是否存在本地
-        boolean  flag= file.exists();
-        if(flag==false){
-            return new AjaxResult(HttpStatus.SUCCESS,fileMiss,Constants.RESOURCE_PREFIX+ "/" + newFilePath);
-        }
-        File imageFile = new File(RuoYiConfig.getProfile() + File.separator + "temp");
-        if (!imageFile.exists()){
-            imageFile.mkdirs();
-        } //判断生成文件路径是否已存在
-        String name =file.getName();
-        int t=name.lastIndexOf(".");
-        String newName=name.substring(0,t); //将名字带到生成方法中以便于区分不同文件名的ppt
-        List list =new ArrayList();
-        if(newFilePath.endsWith("pptx")){
-            list= pptToImage(file, imageFile,newName);
-        }else {
-            list= pptxToImage(file, imageFile,newName);
-        }
-        //将生成的图片传给前端
-        resultMap.put("imagePathList", list);
-        //  resultMap.put("reviewUrlPrefix",  Constants.RESOURCE_PREFIX+ "/" );
-        return  new AjaxResult(HttpStatus.SUCCESS,successMsg,resultMap);
-    }
-
-    private static final String getPathFileName(String uploadDir, String fileName) throws IOException
-    {
-        int dirLastIndex = RuoYiConfig.getProfile().length() + 1;
-        String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
-        String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
-        return pathFileName;
-    }
-
-    /**
-     * 对转换后的文件进行操作(改变编码方式)
-     *
-     * @param outFilePath 文件绝对路径
-     */
-    public void doActionConvertedFile(String outFilePath) {
-        StringBuilder sb = new StringBuilder();
-        try (InputStream inputStream = new FileInputStream(outFilePath);
-             BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, System.getProperty("sun.jnu.encoding")))) {
-            String line;
-            while (null != (line = reader.readLine())) {
-                if (line.contains("charset=gb2312")) {
-                    line = line.replace("charset=gb2312", "charset=utf-8");
-                }
-                sb.append(line);
-            }
-            // 添加sheet控制头
-            sb.append("<script src=\"js/jquery-3.0.0.min.js\" type=\"text/javascript\"></script>");
-            sb.append("<script src=\"js/excel.header.js\" type=\"text/javascript\"></script>");
-            sb.append("<link rel=\"stylesheet\" href=\"bootstrap/css/bootstrap.min.css\">");
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        // 重新写入文件
-        try (FileOutputStream fos = new FileOutputStream(outFilePath);
-             BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(fos, StandardCharsets.UTF_8))) {
-            writer.write(sb.toString());
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-}
+//package com.ruoyi.project.officeConvert;
+//
+//import com.ruoyi.common.constant.Constants;
+//import com.ruoyi.common.constant.HttpStatus;
+//import com.ruoyi.common.utils.StringUtils;
+//import com.ruoyi.framework.config.RuoYiConfig;
+//import com.ruoyi.framework.web.controller.BaseController;
+//import com.ruoyi.framework.web.domain.AjaxResult;
+//
+//import org.jodconverter.DocumentConverter;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.springframework.beans.factory.annotation.Value;
+//import org.springframework.stereotype.Component;
+//import org.springframework.web.bind.annotation.*;
+//import org.springframework.web.context.request.RequestContextHolder;
+//import org.springframework.web.context.request.ServletRequestAttributes;
+//
+//import javax.annotation.Resource;
+//import javax.servlet.http.HttpServletRequest;
+//import javax.servlet.http.HttpServletResponse;
+//import java.io.*;
+//import java.nio.charset.StandardCharsets;
+//import java.util.ArrayList;
+//import java.util.HashMap;
+//import java.util.List;
+//import java.util.Map;
+//
+//import static com.ruoyi.project.officeConvert.PptPreview.pptToImage;
+//import static com.ruoyi.project.officeConvert.PptPreview.pptxToImage;
+//
+//
+//@Component
+//@RestController
+//@RequestMapping(value="/office",method = RequestMethod.POST)
+//public class OfficeConvertController {
+//
+//    // 第一步:转换器直接注入
+//    @Resource
+//    DocumentConverter documentConverter;
+//
+//    protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
+//
+//    private static  String successMsg="请求成功!请预览文件!";
+//
+//    private static  String failMsg="暂不支持此格式类型文件预览,请下载后查看!";
+//
+//    private static  String codeMiss="若csv文件预览结果有乱码,请重新上传编码格式另存为ANSI的csv文件!";
+//
+//    private static  String fileMiss="您需要预览的文件不存在,可能已在本地删除,请重新上传即可!";
+//
+//
+//    /**
+//     office类型的文件
+//     先远程服务端获取文件
+//     然后转换
+//     然后读写缓冲区返回前台
+//     */
+//    @PostMapping("/toPdfFile")
+//    public AjaxResult toPdfFile(HttpServletRequest request, HttpServletResponse response,String filepath) {
+//        // 获取HttpServletResponse
+//        response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
+//        String newFilePath=filepath.replace("/profile","");
+//        // 需要转换的文件路径
+//        File file = new File(RuoYiConfig.getProfile()+newFilePath);
+//        boolean  flag= file.exists();
+//        if(flag==false){
+//            return new AjaxResult(HttpStatus.SUCCESS,fileMiss,Constants.RESOURCE_PREFIX+ "/" + newFilePath);
+//        }
+//        String converterPdf ="";  //生成的文件名
+//        try {
+//            // 转换之后文件生成的本地地址
+//            File newFile = new File(RuoYiConfig.getProfile());
+//            if (!newFile.exists()) {
+//                newFile.mkdirs();
+//            }
+//            String name =file.getName();
+//            int t=name.lastIndexOf(".");
+//            String newName=name.substring(0,t);
+//            //根据文件类型判断转换方式
+//            if(newFilePath.endsWith(".docx")||newFilePath.endsWith(".doc")||newFilePath.endsWith(".xlsx")
+//                    ||newFilePath.endsWith(".xls")||newFilePath.endsWith(".csv")||newFilePath.endsWith(".txt")){
+//                converterPdf =  newName+".html";
+//            }else if(newFilePath.endsWith(".mp4")||newFilePath.endsWith("pdf")||newFilePath.endsWith(".gif")
+//                    ||newFilePath.endsWith("jpg")||newFilePath.endsWith("png")
+//                    ||newFilePath.endsWith(".jpeg")){
+//                //浏览器可以直接打开的直接返回图片和视频的文件路径
+//                return   new AjaxResult(HttpStatus.SUCCESS,successMsg,Constants.RESOURCE_PREFIX+ "/" + newFilePath) ;
+//            }else {
+//                //其他类型都不支持就返回错误消息
+//                return new AjaxResult(HttpStatus.SUCCESS,failMsg,Constants.RESOURCE_PREFIX+ "/" + newFilePath);
+//            }
+//            // 文件转化
+//            documentConverter.convert(file).to(new File(RuoYiConfig.getProfile() + File.separator +"temp" + File.separator +converterPdf)).execute();
+//            //office文件需要给有表格的加一个边框 以免 排版出现问题
+//            if(newFilePath.endsWith(".xlsx")){
+//                this.doActionConvertedFile(RuoYiConfig.getProfile() + File.separator +"temp" + File.separator +converterPdf);
+//            }
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        //最后应该返回转换后的文件名称
+//        String pathFileName = Constants.RESOURCE_PREFIX+ File.separator +"temp" + File.separator + converterPdf;
+//        return  newFilePath.endsWith(".csv")? new AjaxResult(HttpStatus.SUCCESS,codeMiss,pathFileName): new AjaxResult(HttpStatus.SUCCESS,successMsg,pathFileName) ;
+//    }
+//
+//    @PostMapping("/toBookFile")
+//    public AjaxResult toBookFile(HttpServletRequest request, HttpServletResponse response,String filepath) {
+//        // 获取HttpServletResponse
+//        response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
+//        String newFilePath=filepath.replace("/profile","");
+//        // 需要转换的文件路径
+//        File file = new File(RuoYiConfig.getProfile()+newFilePath);
+//        boolean  flag= file.exists();
+//        if(flag==false){
+//            return new AjaxResult(HttpStatus.SUCCESS,fileMiss,Constants.RESOURCE_PREFIX+ "/" + newFilePath);
+//        }
+//        String converterPdf ="";  //生成的文件名
+//        try {
+//            // 转换之后文件生成的本地地址
+//            File newFile = new File(RuoYiConfig.getProfile());
+//            if (!newFile.exists()) {
+//                newFile.mkdirs();
+//            }
+//            String name =file.getName();
+//            int t=name.lastIndexOf(".");
+//            String newName=name.substring(0,t);
+//            //预约开票的word文档
+//                converterPdf =  newName+".pdf";
+//            // 文件转化
+//            documentConverter.convert(file).to(new File(RuoYiConfig.getProfile() + File.separator +"temp" + File.separator +converterPdf)).execute();
+//            //office文件需要给有表格的加一个边框 以免 排版出现问题
+//           // this.doActionConvertedFile(RuoYiConfig.getProfile() + File.separator +"temp" + File.separator +converterPdf);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//        //最后应该返回转换后的文件名称
+//        String pathFileName = Constants.RESOURCE_PREFIX+ File.separator +"temp" + File.separator + converterPdf;
+//        return   new AjaxResult(HttpStatus.SUCCESS,successMsg,pathFileName) ;
+//    }
+//
+//
+//    /**
+//    PPT文件需要根据不同格式类型区分一下
+//     */
+//    @PostMapping("/PPTransJPEG")
+//    public AjaxResult PPTransJPEG(HttpServletRequest request, HttpServletResponse response,String filepath) {
+//        Map<String, Object> resultMap = new HashMap<>();
+//        String newFilePath=filepath.replace("/profile","");
+//        // 需要转换的PPT文件路径
+//        File file = new File(RuoYiConfig.getProfile()+newFilePath);
+//        //判断ppt,pptx文件是否存在本地
+//        boolean  flag= file.exists();
+//        if(flag==false){
+//            return new AjaxResult(HttpStatus.SUCCESS,fileMiss,Constants.RESOURCE_PREFIX+ "/" + newFilePath);
+//        }
+//        File imageFile = new File(RuoYiConfig.getProfile() + File.separator + "temp");
+//        if (!imageFile.exists()){
+//            imageFile.mkdirs();
+//        } //判断生成文件路径是否已存在
+//        String name =file.getName();
+//        int t=name.lastIndexOf(".");
+//        String newName=name.substring(0,t); //将名字带到生成方法中以便于区分不同文件名的ppt
+//        List list =new ArrayList();
+//        if(newFilePath.endsWith("pptx")){
+//            list= pptToImage(file, imageFile,newName);
+//        }else {
+//            list= pptxToImage(file, imageFile,newName);
+//        }
+//        //将生成的图片传给前端
+//        resultMap.put("imagePathList", list);
+//        //  resultMap.put("reviewUrlPrefix",  Constants.RESOURCE_PREFIX+ "/" );
+//        return  new AjaxResult(HttpStatus.SUCCESS,successMsg,resultMap);
+//    }
+//
+//    private static final String getPathFileName(String uploadDir, String fileName) throws IOException
+//    {
+//        int dirLastIndex = RuoYiConfig.getProfile().length() + 1;
+//        String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
+//        String pathFileName = Constants.RESOURCE_PREFIX + "/" + currentDir + "/" + fileName;
+//        return pathFileName;
+//    }
+//
+//    /**
+//     * 对转换后的文件进行操作(改变编码方式)
+//     *
+//     * @param outFilePath 文件绝对路径
+//     */
+//    public void doActionConvertedFile(String outFilePath) {
+//        StringBuilder sb = new StringBuilder();
+//        try (InputStream inputStream = new FileInputStream(outFilePath);
+//             BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, System.getProperty("sun.jnu.encoding")))) {
+//            String line;
+//            while (null != (line = reader.readLine())) {
+//                if (line.contains("charset=gb2312")) {
+//                    line = line.replace("charset=gb2312", "charset=utf-8");
+//                }
+//                sb.append(line);
+//            }
+//            // 添加sheet控制头
+//            sb.append("<script src=\"js/jquery-3.0.0.min.js\" type=\"text/javascript\"></script>");
+//            sb.append("<script src=\"js/excel.header.js\" type=\"text/javascript\"></script>");
+//            sb.append("<link rel=\"stylesheet\" href=\"bootstrap/css/bootstrap.min.css\">");
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        }
+//        // 重新写入文件
+//        try (FileOutputStream fos = new FileOutputStream(outFilePath);
+//             BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(fos, StandardCharsets.UTF_8))) {
+//            writer.write(sb.toString());
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        }
+//    }
+//
+//}

+ 118 - 75
master/src/main/java/com/ruoyi/project/training/controller/TTrainingCompanylevelController.java

@@ -1,17 +1,26 @@
 package com.ruoyi.project.training.controller;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.framework.task.CompanyLevelTask;
 import com.ruoyi.project.training.domain.TTrainingHisparticipants;
 import com.ruoyi.project.training.domain.TTrainingParticipants;
+import com.ruoyi.project.training.mapper.TTrainingCompanylevelMapper;
 import com.ruoyi.project.training.mapper.TTrainingHisparticipantsMapper;
 import com.ruoyi.project.training.mapper.TTrainingParticipantsMapper;
 import com.ruoyi.project.training.service.ITTrainingHisparticipantsService;
 import com.ruoyi.project.training.service.ITTrainingParticipantsService;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellFormulaType;
+import org.springframework.beans.BeanUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -41,11 +50,11 @@ import javax.annotation.Resource;
  */
 @RestController
 @RequestMapping("/training/companylevel")
-public class TTrainingCompanylevelController extends BaseController
-{
+public class TTrainingCompanylevelController extends BaseController {
     @Autowired
     private ITTrainingCompanylevelService tTrainingCompanylevelService;
-
+    @Resource
+    private TTrainingCompanylevelMapper tTrainingCompanylevelMapper;
     @Autowired
     private ITTrainingParticipantsService tTrainingParticipantsService;
     @Autowired
@@ -54,89 +63,129 @@ public class TTrainingCompanylevelController extends BaseController
     private TTrainingParticipantsMapper tTrainingParticipantsMapper;
     @Resource
     private TTrainingHisparticipantsMapper tTrainingHisparticipantsMapper;
+
     /**
      * 查询公司级培训列表
      */
     @PreAuthorize("@ss.hasPermi('training:companylevel:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TTrainingCompanylevel tTrainingCompanylevel)
-    {
+    public TableDataInfo list(TTrainingCompanylevel tTrainingCompanylevel) {
         startPage();
         List<TTrainingCompanylevel> list = tTrainingCompanylevelService.selectTTrainingCompanylevelList(tTrainingCompanylevel);
         return getDataTable(list);
     }
+
     /**
      * 更新培训成绩
      */
     @GetMapping("/updateScore")
-    public AjaxResult updateScore(TTrainingCompanylevel tTrainingCompanylevel)
-    {
+    public AjaxResult updateScore(TTrainingCompanylevel tTrainingCompanylevel) {
         List<TTrainingHisparticipants> hislist = tTrainingHisparticipantsMapper.selectTTrainingHisparticipantsListTask(new TTrainingHisparticipants());
         List<TTrainingCompanylevel> companylevels = tTrainingCompanylevelService.selectTTrainingCompanylevelList(new TTrainingCompanylevel());
+        //线程池
+        ExecutorService executor1 = Executors.newFixedThreadPool(20);
+        final CountDownLatch latch1 = new CountDownLatch(hislist.size()); //相同线程数量的计数
+
         for (TTrainingHisparticipants hisparticipant : hislist) {
-            if (hisparticipant.getCompanyId() == null) {
-                continue;
-            }
-            TTrainingParticipants t = new TTrainingParticipants();
-            t.setCompanyId(hisparticipant.getCompanyId());
-            t.setStaffId(hisparticipant.getStaffId());
-            t.setBudget(hisparticipant.getBudget());
-            t.setEndDate(hisparticipant.getEndDate());
-            t.setStartDate(hisparticipant.getStartDate());
-            t.setOperationScore(hisparticipant.getOperationScore());
-            t.setScore(hisparticipant.getScore());
-            t.setRemarks(hisparticipant.getRemarks());
-            t.setTrainingCost(hisparticipant.getTrainingCost());
-            t.setTrainingDuration(hisparticipant.getTrainingDuration());
-            t.setTrainingPlace(hisparticipant.getTrainingPlace());
-            t.setDelFlag(0l);
-            int i = 0 ;
-            for (TTrainingCompanylevel companylevel : companylevels){
-                if (companylevel.getId().equals(hisparticipant.getCompanyId())) {
-                    if (companylevel.getFrequency() != null) {
-                        Long frequency = Long.parseLong(companylevel.getFrequency()) * 365 * 24 * 3600 * 1000;
-                        Long validPeriod = hisparticipant.getStartDate().getTime() + frequency;
-                        Long nowDate = new Date().getTime();
-                        if (validPeriod <= nowDate) {
-                            TTrainingParticipants delParticipants = new TTrainingParticipants();
-                            delParticipants.setCompanyId(hisparticipant.getCompanyId());
-                            delParticipants.setStaffId(hisparticipant.getStaffId());
-                            delParticipants.setDelFlag(2l);
-                            tTrainingParticipantsMapper.updateTTrainingParticipantsByStaffAndCom(delParticipants);
-                        }else {
-                            i = tTrainingParticipantsMapper.updateTTrainingParticipantsByStaffAndCom(t);
-                            if (i == 0) {
-                                tTrainingParticipantsMapper.insertTTrainingParticipants(t);
+            executor1.execute(() -> {
+                try {
+                    if (hisparticipant.getCompanyId() != null) {
+                        TTrainingParticipants t = new TTrainingParticipants();
+                        t.setCompanyId(hisparticipant.getCompanyId());
+                        t.setStaffId(hisparticipant.getStaffId());
+                        t.setBudget(hisparticipant.getBudget());
+                        t.setEndDate(hisparticipant.getEndDate());
+                        t.setStartDate(hisparticipant.getStartDate());
+                        t.setOperationScore(hisparticipant.getOperationScore());
+                        t.setScore(hisparticipant.getScore());
+                        t.setRemarks(hisparticipant.getRemarks());
+                        t.setTrainingCost(hisparticipant.getTrainingCost());
+                        t.setTrainingDuration(hisparticipant.getTrainingDuration());
+                        t.setTrainingPlace(hisparticipant.getTrainingPlace());
+                        t.setDelFlag(0l);
+                        int i = 0;
+//                        List<TTrainingCompanylevel> companylevelList = new ArrayList<>();
+//                        BeanUtils.copyProperties(companylevels, companylevelList);
+//                        for (TTrainingCompanylevel companylevel : companylevels) {
+                            for (int j = 0; j < companylevels.size(); j++) {
+                                TTrainingCompanylevel companylevel = companylevels.get(j);
+                            if (companylevel.getId().equals(hisparticipant.getCompanyId())) {
+                                if (companylevel.getFrequency() != null) {
+                                    Long frequency = Long.parseLong(companylevel.getFrequency()) * 365 * 24 * 3600 * 1000;
+                                    Long validPeriod = hisparticipant.getStartDate().getTime() + frequency;
+                                    Long nowDate = new Date().getTime();
+                                    if (validPeriod <= nowDate) {
+                                        TTrainingParticipants delParticipants = new TTrainingParticipants();
+                                        delParticipants.setCompanyId(hisparticipant.getCompanyId());
+                                        delParticipants.setStaffId(hisparticipant.getStaffId());
+                                        delParticipants.setDelFlag(2l);
+                                        tTrainingParticipantsMapper.updateTTrainingParticipantsByStaffAndCom(delParticipants);
+                                    } else {
+                                        i = tTrainingParticipantsMapper.updateTTrainingParticipantsByStaffAndCom(t);
+                                        if (i == 0) {
+                                            tTrainingParticipantsMapper.insertTTrainingParticipants(t);
+                                        }
+                                    }
+                                } else {
+                                    i = tTrainingParticipantsMapper.updateTTrainingParticipantsByStaffAndCom(t);
+                                    if (i == 0) {
+                                        tTrainingParticipantsMapper.insertTTrainingParticipants(t);
+                                    }
+                                }
                             }
                         }
-                    }else {
-                        i = tTrainingParticipantsMapper.updateTTrainingParticipantsByStaffAndCom(t);
-                        if (i == 0) {
-                            tTrainingParticipantsMapper.insertTTrainingParticipants(t);
-                        }
                     }
+                } catch (Exception e) {
+                    logger.error(e.toString());
+                } finally {
+                    latch1.countDown(); //线程计数
                 }
-            }
+            });
+        }
+        try {
+            latch1.await(); //线程计数完毕后继续执行
+        } catch (InterruptedException e) {
+            e.printStackTrace();
         }
+        executor1.shutdown();
         List<TTrainingCompanylevel> list1 = tTrainingCompanylevelService.selectTTrainingCompanylevelList(tTrainingCompanylevel);
+        //线程池
+        ExecutorService executor2 = Executors.newFixedThreadPool(20);
+        final CountDownLatch latch2 = new CountDownLatch(list1.size()); //相同线程数量的计数
         for (TTrainingCompanylevel t : list1) {
-            if (t.getStaffId() != null) {
-                String[] newStaffs = t.getStaffId().split(",");
-                for (String s : newStaffs) {
-                    TTrainingHisparticipants th = new TTrainingHisparticipants();
-                    th.setCompanyId(t.getId());
-                    th.setStaffId(s);
-                    List<TTrainingHisparticipants> hislist1 = tTrainingHisparticipantsMapper.selectTTrainingHisparticipantsListTask(th);
-                    if (hislist1 == null) {
-                        TTrainingParticipants tTrainingParticipants = new TTrainingParticipants();
-                        tTrainingParticipants.setStaffId(s);
-                        tTrainingParticipants.setCompanyId(tTrainingCompanylevel.getId());
-                        tTrainingParticipantsService.insertTTrainingParticipants(tTrainingParticipants);
+            executor2.submit(() -> {
+                try {
+                    if (t.getStaffId() != null) {
+                        String[] newStaffs = t.getStaffId().split(",");
+                        for (String s : newStaffs) {
+                            TTrainingHisparticipants th = new TTrainingHisparticipants();
+                            th.setCompanyId(t.getId());
+                            th.setStaffId(s);
+                            List<TTrainingHisparticipants> hislist1 = tTrainingHisparticipantsMapper.selectTTrainingHisparticipantsListTask(th);
+                            if (hislist1 == null) {
+                                TTrainingParticipants tTrainingParticipants = new TTrainingParticipants();
+                                tTrainingParticipants.setStaffId(s);
+                                tTrainingParticipants.setCompanyId(tTrainingCompanylevel.getId());
+                                tTrainingParticipantsService.insertTTrainingParticipants(tTrainingParticipants);
+                            }
+                        }
                     }
+                } catch (Exception e) {
+                    logger.error(e.toString());
+                } finally {
+                    latch2.countDown();
                 }
-            }
+            });
+        }
+        try {
+            latch2.await(); //线程计数完毕后继续执行
+        } catch (InterruptedException e) {
+            e.printStackTrace();
         }
-        return null;
+        executor2.shutdown();
+        // 去重
+        tTrainingParticipantsMapper.duplicateParticipants();
+        return AjaxResult.success("公司级培训已同步");
     }
 
     /**
@@ -145,8 +194,7 @@ public class TTrainingCompanylevelController extends BaseController
     @PreAuthorize("@ss.hasPermi('training:companylevel:export')")
     @Log(title = "公司级培训", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(TTrainingCompanylevel tTrainingCompanylevel)
-    {
+    public AjaxResult export(TTrainingCompanylevel tTrainingCompanylevel) {
         List<TTrainingCompanylevel> list = tTrainingCompanylevelService.selectTTrainingCompanylevelList(tTrainingCompanylevel);
         ExcelUtil<TTrainingCompanylevel> util = new ExcelUtil<TTrainingCompanylevel>(TTrainingCompanylevel.class);
         return util.exportExcel(list, "companylevel");
@@ -157,8 +205,7 @@ public class TTrainingCompanylevelController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('training:companylevel:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tTrainingCompanylevelService.selectTTrainingCompanylevelById(id));
     }
 
@@ -168,8 +215,7 @@ public class TTrainingCompanylevelController extends BaseController
     @PreAuthorize("@ss.hasPermi('training:companylevel:add')")
     @Log(title = "公司级培训", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TTrainingCompanylevel tTrainingCompanylevel)
-    {
+    public AjaxResult add(@RequestBody TTrainingCompanylevel tTrainingCompanylevel) {
         return toAjax(tTrainingCompanylevelService.insertTTrainingCompanylevel(tTrainingCompanylevel));
     }
 
@@ -179,10 +225,9 @@ public class TTrainingCompanylevelController extends BaseController
     @PreAuthorize("@ss.hasPermi('training:companylevel:edit')")
     @Log(title = "公司级培训", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TTrainingCompanylevel tTrainingCompanylevel)
-    {
+    public AjaxResult edit(@RequestBody TTrainingCompanylevel tTrainingCompanylevel) {
         TTrainingCompanylevel trainingCompanylevel = tTrainingCompanylevelService.selectTTrainingCompanylevelById(tTrainingCompanylevel.getId());
-        if ( StringUtils.isNotEmpty(tTrainingCompanylevel.getStaffId())) {
+        if (StringUtils.isNotEmpty(tTrainingCompanylevel.getStaffId())) {
             String[] newStaffs = tTrainingCompanylevel.getStaffId().split(",");
             if (trainingCompanylevel.getStaffId() != null) {
                 //如果曾经旧名单中选择过数据
@@ -200,7 +245,7 @@ public class TTrainingCompanylevelController extends BaseController
                         tTrainingParticipantsService.insertTTrainingParticipants(tTrainingParticipants);
                     }
                 }
-            }else {
+            } else {
                 //该类公司级培训曾经没有填写过参会人员名单
                 for (String s : newStaffs) {
                     TTrainingParticipants tTrainingParticipants = new TTrainingParticipants();
@@ -219,8 +264,7 @@ public class TTrainingCompanylevelController extends BaseController
     @PreAuthorize("@ss.hasPermi('training:companylevel:remove')")
     @Log(title = "公司级培训", businessType = BusinessType.DELETE)
     @DeleteMapping("/resetAll")
-    public AjaxResult resetAll()
-    {
+    public AjaxResult resetAll() {
         return toAjax(tTrainingCompanylevelService.resetTTrainingCompanylevel());
     }
 
@@ -229,9 +273,8 @@ public class TTrainingCompanylevelController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('training:companylevel:remove')")
     @Log(title = "公司级培训", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tTrainingCompanylevelService.deleteTTrainingCompanylevelByIds(ids));
     }
 

+ 116 - 88
master/src/main/java/com/ruoyi/project/training/controller/TTrainingHisparticipantsController.java

@@ -4,16 +4,21 @@ import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.project.system.domain.SysDept;
-import com.ruoyi.project.system.domain.SysDictData;
 import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.training.domain.TTrainingCompanylevel;
-import com.ruoyi.project.training.domain.TTrainingParticipants;
+import com.ruoyi.project.training.mapper.TTrainingCompanylevelMapper;
 import com.ruoyi.project.training.service.ITTrainingCompanylevelService;
 import org.apache.poi.ss.usermodel.*;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -29,6 +34,8 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.annotation.Resource;
+
 /**
  * 人员-公司级培训历史Controller
  *
@@ -37,10 +44,10 @@ import org.springframework.web.multipart.MultipartFile;
  */
 @RestController
 @RequestMapping("/training/hisparticipants")
-public class TTrainingHisparticipantsController extends BaseController
-{
+public class TTrainingHisparticipantsController extends BaseController {
     @Autowired
     private ITTrainingHisparticipantsService tTrainingHisparticipantsService;
+
     @Autowired
     private ISysDeptService iSysDeptService;
     @Autowired
@@ -53,8 +60,7 @@ public class TTrainingHisparticipantsController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('training:hisparticipants:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TTrainingHisparticipants tTrainingHisparticipants)
-    {
+    public TableDataInfo list(TTrainingHisparticipants tTrainingHisparticipants) {
         startPage();
         List<TTrainingHisparticipants> list = tTrainingHisparticipantsService.selectTTrainingHisparticipantsList(tTrainingHisparticipants);
         return getDataTable(list);
@@ -66,8 +72,7 @@ public class TTrainingHisparticipantsController extends BaseController
     @PreAuthorize("@ss.hasPermi('training:hisparticipants:export')")
     @Log(title = "人员-公司级培训历史", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(TTrainingHisparticipants tTrainingHisparticipants)
-    {
+    public AjaxResult export(TTrainingHisparticipants tTrainingHisparticipants) {
         List<TTrainingHisparticipants> list = tTrainingHisparticipantsService.selectTTrainingHisparticipantsList(tTrainingHisparticipants);
         ExcelUtil<TTrainingHisparticipants> util = new ExcelUtil<TTrainingHisparticipants>(TTrainingHisparticipants.class);
         return util.exportExcel(list, "hisparticipants");
@@ -78,8 +83,7 @@ public class TTrainingHisparticipantsController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('training:hisparticipants:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tTrainingHisparticipantsService.selectTTrainingHisparticipantsById(id));
     }
 
@@ -89,8 +93,7 @@ public class TTrainingHisparticipantsController extends BaseController
     @PreAuthorize("@ss.hasPermi('training:hisparticipants:add')")
     @Log(title = "人员-公司级培训历史", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TTrainingHisparticipants tTrainingHisparticipants)
-    {
+    public AjaxResult add(@RequestBody TTrainingHisparticipants tTrainingHisparticipants) {
         return toAjax(tTrainingHisparticipantsService.insertTTrainingHisparticipants(tTrainingHisparticipants));
     }
 
@@ -100,8 +103,7 @@ public class TTrainingHisparticipantsController extends BaseController
     @PreAuthorize("@ss.hasPermi('training:hisparticipants:edit')")
     @Log(title = "人员-公司级培训历史", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TTrainingHisparticipants tTrainingHisparticipants)
-    {
+    public AjaxResult edit(@RequestBody TTrainingHisparticipants tTrainingHisparticipants) {
         return toAjax(tTrainingHisparticipantsService.updateTTrainingHisparticipants(tTrainingHisparticipants));
     }
 
@@ -110,9 +112,8 @@ public class TTrainingHisparticipantsController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('training:hisparticipants:remove')")
     @Log(title = "人员-公司级培训历史", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tTrainingHisparticipantsService.deleteTTrainingHisparticipantsByIds(ids));
     }
 
@@ -121,99 +122,126 @@ public class TTrainingHisparticipantsController extends BaseController
      */
     @Log(title = "培训历史导入", businessType = BusinessType.INSERT)
     @PostMapping("/importData")
-    public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException
-    {
+    public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
         //获取操作人员ID
         Long userId = getUserId();
         //报错行数统计
-        List<Integer> failRow =new ArrayList<Integer>();
+        CopyOnWriteArrayList<Integer> failRow = new CopyOnWriteArrayList<Integer>();
         Workbook workbook = ExcelUtils.getWorkBook(file);
         Sheet sheet = workbook.getSheetAt(0);
-        List<TTrainingHisparticipants> list = new ArrayList<TTrainingHisparticipants>();
+        CopyOnWriteArrayList<TTrainingHisparticipants> list = new CopyOnWriteArrayList<TTrainingHisparticipants>();
         //字典查询
         List<TTrainingCompanylevel> levelList = tTrainingCompanylevelService.selectTTrainingCompanylevelList(new TTrainingCompanylevel());
 
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
         int rowNum = sheet.getPhysicalNumberOfRows();
-        int failNumber = 0;
+        AtomicInteger failNumber = new AtomicInteger();
+        //线程池
+        ExecutorService executorExcel = Executors.newFixedThreadPool(20);
+        final CountDownLatch latchExcel = new CountDownLatch(rowNum-1); //相同线程数量的计数
         for (int i = 1; i < rowNum; i++) {
-            try {
-                logger.info("读取行数:" + i);
-                Row row = sheet.getRow(i);
-                int cellNum = row.getPhysicalNumberOfCells();
-                TTrainingHisparticipants entity = new TTrainingHisparticipants();
-                for (int j = 0; j < cellNum; j++) {
-                    Cell cell = row.getCell(j);
-                    String cellValue = ExcelUtils.getCellValue(cell);
-                    logger.info("cellValue:" + cellValue);
-                    if (j == 0) {
-                        entity.setStaffId(cellValue.trim());
-                    }else if (j == 5){
-                        if (cellValue.length() > 3) {
-                            entity.setStartDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
-                        }
-                    }else if (j == 6){
-                        if (cellValue.length() > 3) {
-                            entity.setEndDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
-                        }
-                    }else if (j == 7){
-                        for (TTrainingCompanylevel t : levelList
-                             ) {
-                            if (t.getCourseCode().equals(cellValue.trim())){
-                                entity.setCompanyId(t.getId());
-                                break;
+            final int finalI = i;
+            executorExcel.execute(() -> {
+                try {
+                    logger.info("读取行数:" + finalI);
+                    Row row = sheet.getRow(finalI);
+                    int cellNum = row.getPhysicalNumberOfCells();
+                    TTrainingHisparticipants entity = new TTrainingHisparticipants();
+                    for (int j = 0; j < cellNum; j++) {
+                        Cell cell = row.getCell(j);
+                        String cellValue = ExcelUtils.getCellValue(cell);
+                        logger.info("cellValue:" + cellValue);
+                        entity.setRemark(String.valueOf(finalI +1));
+                        if (j == 0) {
+                            entity.setStaffId(cellValue.trim());
+                        } else if (j == 5) {
+                            if (cellValue.length() > 3) {
+                                entity.setStartDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
                             }
-                        }
-                    }else if (j == 8){
+                        } else if (j == 6) {
+                            if (cellValue.length() > 3) {
+                                entity.setEndDate(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));
+                            }
+                        } else if (j == 7) {
+                            for (TTrainingCompanylevel t : levelList
+                            ) {
+                                if (t.getCourseCode().equals(cellValue.trim())) {
+                                    entity.setCompanyId(t.getId());
+                                }
+                            }
+                        } else if (j == 8) {
 
-                    }else if (j == 9){
-                        if (cellValue!= ""){
-                            entity.setScore(Double.parseDouble(cellValue.trim()));
-                        }
-                    }else if (j == 10){
-                        if (cellValue!= ""){
-                            entity.setOperationScore(Double.parseDouble(cellValue.trim()));
+                        } else if (j == 9) {
+                            if (cellValue != "") {
+                                entity.setScore(Double.parseDouble(cellValue.trim()));
+                            }
+                        } else if (j == 10) {
+                            if (cellValue != "") {
+                                entity.setOperationScore(Double.parseDouble(cellValue.trim()));
+                            }
+                        } else if (j == 11) {
+                            entity.setTrainingPlace(cellValue);
+                        } else if (j == 12) {
+                            entity.setTrainingDuration(cellValue);
+                        } else if (j == 13) {
+                            entity.setTrainingCost(cellValue);
+                        } else if (j == 14) {
+                            entity.setBudget(cellValue);
+                        } else if (j == 15) {
+                            entity.setRemarks(cellValue);
                         }
-                    }else if (j == 11){
-                        entity.setTrainingPlace(cellValue);
-                    }else if (j == 12){
-                        entity.setTrainingDuration(cellValue);
-                    }else if (j == 13){
-                        entity.setTrainingCost(cellValue);
-                    }else if (j == 14){
-                        entity.setBudget(cellValue);
-                    }else if (j == 15){
-                        entity.setRemarks(cellValue);
                     }
+                    entity.setCreaterCode(userId.toString());
+                    list.add(entity);
+                } catch (Exception e) {
+                    logger.error(JSON.toJSONString(e));
+                    failNumber.getAndIncrement();
+                    failRow.add(finalI + 1);
+                } finally {
+                    latchExcel.countDown(); //线程计数
                 }
-                entity.setCreaterCode(userId.toString());
-                logger.info("entity:" + entity);
-                list.add(entity);
-            }catch (Exception e){
-                logger.error(JSON.toJSONString(e));
-                failNumber++;
-                failRow.add(i+1);
-            }
+            });
+        }
+        try {
+            latchExcel.await(); //线程计数完毕后继续执行
+        } catch (InterruptedException e) {
+            e.printStackTrace();
         }
-        int successNumber = 0;
-        int failNum = 0;
+        executorExcel.shutdown();
+
+        //线程池
+        ExecutorService executorService = Executors.newFixedThreadPool(30);
+        final CountDownLatch latch = new CountDownLatch(list.size()); //相同线程数量的计数
+        AtomicInteger successNumber = new AtomicInteger(0);
+        AtomicInteger failNum =  new AtomicInteger(0);
         for (TTrainingHisparticipants t : list
         ) {
-            failNum++;
-            try {
-                tTrainingHisparticipantsService.insertTTrainingHisparticipants(t);
-                successNumber++;
-            }catch (Exception e){
-                logger.error(JSON.toJSONString(e));
-                failNumber++;
-                failRow.add(failNum+1);
-            }
+            failNum.getAndIncrement();
+                executorService.execute(() -> {
+                //续票列表 -- 业务模块
+                try {
+                    tTrainingHisparticipantsService.insertTTrainingHisparticipants(t);
+                    successNumber.getAndIncrement();
+                } catch (Exception e) {
+                    logger.error(JSON.toJSONString(e));
+                    failNumber.getAndIncrement();
+                    failRow.add(Integer.parseInt(t.getRemark()));
+                }finally {
+                    latch.countDown(); //线程计数
+                }
+            });
+        }
+        try {
+            latch.await(); //线程计数完毕后继续执行
+        } catch (InterruptedException e) {
+            e.printStackTrace();
         }
+        executorService.shutdown();
         logger.info("list:" + list.size());
-        logger.info("successNumber:" +String.valueOf(successNumber));
-        logger.info("failNumber:" +String.valueOf(failNumber));
-        logger.info("failRow:" +String.valueOf(failRow));
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber.get()));
+        logger.info("failRow:" + String.valueOf(failRow));
         return AjaxResult.success(String.valueOf(successNumber), failRow);
     }
 }

+ 5 - 0
master/src/main/java/com/ruoyi/project/training/mapper/TTrainingParticipantsMapper.java

@@ -80,4 +80,9 @@ public interface TTrainingParticipantsMapper
     public int deleteTTrainingParticipantsAll();
 
     void deleteTParticipantsByCompanyId(Long id);
+
+    /**
+     * 去重
+     */
+    void duplicateParticipants();
 }

+ 10 - 10
master/src/main/resources/application.yml

@@ -172,16 +172,16 @@ xss:
   # 匹配链接
   urlPatterns: /system/*,/monitor/*,/tool/*
 # 文件预览
-jodconverter:
-  local:
-    enabled: true
-    # 设置LibreOffice主目录
-    #    office-home: /opt/libreoffice7.2  C:/Program Files/LibreOffice
-    office-home: C:/Program Files/LibreOffice
-    max-tasks-per-process: 100
-    port-numbers: 8100
-    # 开启多个LibreOffice进程,每个端口对应一个进程
-    portNumbers: 9080,9081,9089
+#jodconverter:
+#  local:
+#    enabled: true
+#    # 设置LibreOffice主目录
+#    #    office-home: /opt/libreoffice7.2  C:/Program Files/LibreOffice
+#    office-home: C:/Program Files/LibreOffice
+#    max-tasks-per-process: 100
+#    port-numbers: 8100
+#    # 开启多个LibreOffice进程,每个端口对应一个进程
+#    portNumbers: 9080,9081,9089
 
 # 代码生成
 gen:

+ 80 - 37
master/src/main/resources/mybatis/training/TTrainingParticipantsMapper.xml

@@ -1,55 +1,77 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.project.training.mapper.TTrainingParticipantsMapper">
 
     <resultMap type="TTrainingParticipants" id="TTrainingParticipantsResult">
-        <result property="id"    column="id"    />
-        <result property="staffId"    column="staff_id"    />
-        <result property="companyId"    column="company_id"    />
-        <result property="startDate"    column="start_date"    />
-        <result property="endDate"    column="end_date"    />
-        <result property="score"    column="score"    />
-        <result property="operationScore"    column="operation_score"    />
-        <result property="trainingPlace"    column="training_place"    />
-        <result property="trainingDuration"    column="training_duration"    />
-        <result property="trainingCost"    column="training_cost"    />
-        <result property="budget"    column="budget"    />
-        <result property="remarks"    column="remarks"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="createrCode"    column="creater_code"    />
-        <result property="createdate"    column="createdate"    />
-        <result property="updaterCode"    column="updater_code"    />
-        <result property="updatedate"    column="updatedate"    />
-        <result property="companyItem"    column="item"    />
-        <result property="frequency"    column="frequency"    />
-        <result property="courseCode"    column="course_code"    />
+        <result property="id" column="id"/>
+        <result property="staffId" column="staff_id"/>
+        <result property="companyId" column="company_id"/>
+        <result property="startDate" column="start_date"/>
+        <result property="endDate" column="end_date"/>
+        <result property="score" column="score"/>
+        <result property="operationScore" column="operation_score"/>
+        <result property="trainingPlace" column="training_place"/>
+        <result property="trainingDuration" column="training_duration"/>
+        <result property="trainingCost" column="training_cost"/>
+        <result property="budget" column="budget"/>
+        <result property="remarks" column="remarks"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createrCode" column="creater_code"/>
+        <result property="createdate" column="createdate"/>
+        <result property="updaterCode" column="updater_code"/>
+        <result property="updatedate" column="updatedate"/>
+        <result property="companyItem" column="item"/>
+        <result property="frequency" column="frequency"/>
+        <result property="courseCode" column="course_code"/>
     </resultMap>
 
     <sql id="selectTTrainingParticipantsVo">
-        select d.id, d.staff_id, d.company_id, s.item, s.frequency, s.course_code, d.start_date, d.end_date, d.score, d.operation_score, d.training_place, d.training_duration, d.training_cost, d.budget, d.remarks, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate from t_training_participants d
-        left join t_training_companylevel s on d.company_id = s.id
+        select d.id,
+               d.staff_id,
+               d.company_id,
+               s.item,
+               s.frequency,
+               s.course_code,
+               d.start_date,
+               d.end_date,
+               d.score,
+               d.operation_score,
+               d.training_place,
+               d.training_duration,
+               d.training_cost,
+               d.budget,
+               d.remarks,
+               d.del_flag,
+               d.creater_code,
+               d.createdate,
+               d.updater_code,
+               d.updatedate
+        from t_training_participants d
+                 left join t_training_companylevel s on d.company_id = s.id
     </sql>
 
-    <select id="selectTTrainingParticipantsList" parameterType="TTrainingParticipants" resultMap="TTrainingParticipantsResult">
+    <select id="selectTTrainingParticipantsList" parameterType="TTrainingParticipants"
+            resultMap="TTrainingParticipantsResult">
         <include refid="selectTTrainingParticipantsVo"/>
         <where>
-            <if test="staffId != null "> and d.staff_id = #{staffId}</if>
-            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="staffId != null ">and d.staff_id = #{staffId}</if>
+            <if test="companyId != null ">and company_id = #{companyId}</if>
             and d.del_flag = 0
         </where>
         order by s.course_code
     </select>
 
-    <select id="selectTTrainingParticipantsListTask" parameterType="TTrainingParticipants" resultMap="TTrainingParticipantsResult">
+    <select id="selectTTrainingParticipantsListTask" parameterType="TTrainingParticipants"
+            resultMap="TTrainingParticipantsResult">
         <include refid="selectTTrainingParticipantsVo"/>
         <where>
-            <if test="staffId != null "> and d.staff_id = #{staffId}</if>
-            <if test="companyId != null "> and company_id = #{companyId}</if>
+            <if test="staffId != null ">and d.staff_id = #{staffId}</if>
+            <if test="companyId != null ">and company_id = #{companyId}</if>
             and d.del_flag = 0
         </where>
-       order by end_date
+        order by end_date
     </select>
 
 
@@ -81,7 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null">createdate,</if>
             <if test="updaterCode != null">updater_code,</if>
             <if test="updatedate != null">updatedate,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
             <if test="staffId != null">#{staffId},</if>
@@ -100,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createdate != null">#{createdate},</if>
             <if test="updaterCode != null">#{updaterCode},</if>
             <if test="updatedate != null">#{updatedate},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateTTrainingParticipants" parameterType="TTrainingParticipants">
@@ -150,21 +172,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <update id="deleteTTrainingParticipantsById" parameterType="Long">
-        update t_training_participants set del_flag = 2 where id = #{id}
+        update t_training_participants
+        set del_flag = 2
+        where id = #{id}
     </update>
 
     <update id="deleteTTrainingParticipantsByCompanyId" parameterType="TTrainingParticipants">
-        update t_training_participants set del_flag = 2 where company_id = #{companyId} and staff_id = #{staffId} and del_flag = 0
+        update t_training_participants
+        set del_flag = 2
+        where company_id = #{companyId}
+          and staff_id = #{staffId}
+          and del_flag = 0
     </update>
 
     <update id="deleteTTrainingParticipantsAll">
-        update t_training_participants set del_flag = 2 where del_flag = 0
+        update t_training_participants
+        set del_flag = 2
+        where del_flag = 0
     </update>
 
     <update id="deleteTParticipantsByCompanyId">
-        update t_training_participants set del_flag = 2 where company_id = #{companyId}
+        update t_training_participants
+        set del_flag = 2
+        where company_id = #{companyId}
     </update>
 
+    <delete id="duplicateParticipants">
+        DELETE
+        FROM T_TRAINING_PARTICIPANTS
+        where rowid !=( select max(rowid)
+        from T_TRAINING_PARTICIPANTS b
+        where b.STAFF_ID = T_TRAINING_PARTICIPANTS.STAFF_ID
+				and b.COMPANY_ID = T_TRAINING_PARTICIPANTS.COMPANY_ID
+				and b.START_DATE = T_TRAINING_PARTICIPANTS.START_DATE
+        )
+    </delete>
+
     <update id="deleteTTrainingParticipantsByIds" parameterType="String">
         update t_training_participants set del_flag = 2 where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">

+ 12 - 12
ui/src/views/ehs/jobticket/index.vue

@@ -275,17 +275,17 @@
         </template>
       </el-table-column>
       <el-table-column :label="$t('新票/续票')" align="center" prop="xpxp" width="100" :formatter="xpxpFormat"/>
-      <el-table-column :label="$t('延期许可证号')" align="center" sortable="custom" prop="yqxkzh" width="100"
+      <el-table-column :label="$t('延期许可证号')" align="center" sortable="custom" prop="yqxkzh" width="120"
                        :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('危害工作许可证号')" align="center" sortable="custom" prop="whgzxkzh" width="100"
+      <el-table-column :label="$t('危害工作许可证号')" align="center" sortable="custom" prop="whgzxkzh" width="120"
                        :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('动火作业许可证号')" align="center" sortable="custom" prop="dhzyxkzh" width="100"
+      <el-table-column :label="$t('动火作业许可证号')" align="center" sortable="custom" prop="dhzyxkzh" width="120"
                        :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('火票级别')" align="center" sortable="custom" prop="hpjb" :formatter="hpjbFormat"/>
-      <el-table-column :label="$t('限制空间许可证号')" align="center" sortable="custom" prop="xzkjxkzh"
+      <el-table-column :label="$t('限制空间许可证号')" align="center" sortable="custom" prop="xzkjxkzh" width="120"
                        :show-overflow-tooltip="true"/>
-      <el-table-column label="盲板作业许可证号" align="center" sortable="custom" prop="mbzyxkzh" :show-overflow-tooltip="true"/>
-      <el-table-column label="高处作业许可证号" align="center" sortable="custom" prop="gczyxkzh" :show-overflow-tooltip="true"/>
+      <el-table-column label="盲板作业许可证号" align="center" sortable="custom" prop="mbzyxkzh" width="120" :show-overflow-tooltip="true"/>
+      <el-table-column label="高处作业许可证号" align="center" sortable="custom" prop="gczyxkzh" width="120" :show-overflow-tooltip="true"/>
       <el-table-column label="高处作业级别" align="center" sortable="custom" prop="gczyjb" :formatter="gczyjbFormat"/>
       <el-table-column :label="$t('工作内容')" align="center" prop="content" width="300" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('BYC负责单位/联系人')" align="center" prop="byclxr" width="100"
@@ -382,17 +382,17 @@
         </template>
       </el-table-column>
       <el-table-column :label="$t('新票/续票')" align="center" prop="xpxp" width="100" :formatter="xpxpFormat"/>
-      <el-table-column :label="$t('延期许可证号')" align="center" sortable="custom" prop="yqxkzh" width="100"
+      <el-table-column :label="$t('延期许可证号')" align="center" sortable="custom" prop="yqxkzh" width="120"
                        :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('危害工作许可证号')" align="center" sortable="custom" prop="whgzxkzh" width="100"
+      <el-table-column :label="$t('危害工作许可证号')" align="center" sortable="custom" prop="whgzxkzh" width="120"
                        :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('动火作业许可证号')" align="center" sortable="custom" prop="dhzyxkzh" width="100"
+      <el-table-column :label="$t('动火作业许可证号')" align="center" sortable="custom" prop="dhzyxkzh" width="120"
                        :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('火票级别')" align="center" sortable="custom" prop="hpjb" :formatter="hpjbFormat"/>
-      <el-table-column :label="$t('限制空间许可证号')" align="center" sortable="custom" prop="xzkjxkzh"
+      <el-table-column :label="$t('限制空间许可证号')" align="center" sortable="custom" prop="xzkjxkzh" width="120"
                        :show-overflow-tooltip="true"/>
-      <el-table-column label="盲板作业许可证号" align="center" sortable="custom" prop="mbzyxkzh" :show-overflow-tooltip="true"/>
-      <el-table-column label="高处作业许可证号" align="center" sortable="custom" prop="gczyxkzh" :show-overflow-tooltip="true"/>
+      <el-table-column label="盲板作业许可证号" align="center" sortable="custom" prop="mbzyxkzh" width="120" :show-overflow-tooltip="true"/>
+      <el-table-column label="高处作业许可证号" align="center" sortable="custom" prop="gczyxkzh" width="120" :show-overflow-tooltip="true"/>
       <el-table-column label="高处作业级别" align="center" sortable="custom" prop="gczyjb" :formatter="gczyjbFormat"/>
       <el-table-column :label="$t('工作内容')" align="center" prop="content" width="300" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('BYC负责单位/联系人')" align="center" prop="byclxr" width="100"

+ 1 - 1
ui/src/views/invoice/bookingworkticket/index.vue

@@ -182,7 +182,7 @@
         </template>
       </el-table-column>
       <el-table-column label="预约状态" align="center" prop="bookingworkticket.status" :formatter="statusFormat" />
-      <el-table-column label="票号" align="center" width="30" prop="reservationNumber">
+      <el-table-column label="票号" align="center" width="40" prop="reservationNumber">
         <template slot-scope="scope">
           <span>  {{ scope.row.reservationNumber }}</span>
           <el-button

+ 19 - 4
ui/src/views/training/companylevel/index.vue

@@ -242,7 +242,7 @@
       </div>
     </el-dialog>
     <!-- 用户导入对话框 -->
-    <el-dialog v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+    <el-dialog v-loading="upload.isUploading" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
         <el-upload
                 ref="upload"
                 :limit="1"
@@ -280,7 +280,7 @@
 <script>
 import { listCompanylevel, updateScore, resetCompanylevel, getCompanylevel, delCompanylevel, addCompanylevel, updateCompanylevel, exportCompanylevel, importTemplate} from "@/api/training/companylevel";
 import { deleteAll } from "@/api/training/participants";
-import { listStaffmgr } from "@/api/plant/staffmgr";
+import {listStaffmgr, selectTimeStaffmgr} from "@/api/plant/staffmgr";
 import { treeselect } from "@/api/system/dept";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
@@ -299,6 +299,7 @@ export default {
       checkboxPost: [],
       // 遮罩层
       loading: true,
+      uploadLoading: false,
       // 选中数组
       ids: [],
       // 非单个禁用
@@ -357,6 +358,7 @@ export default {
       //人员表查询参数
       staffmgrQueryParams: {
         units: "10,18,20",
+        leftYear: this.getNowTime(),
         actualpost: null
       },
       //人员表联查
@@ -426,6 +428,14 @@ export default {
               this.deptOptions = response.data;
           });
      },
+    /** 获取当前年份 */
+    getNowTime() {
+      var now = new Date();
+      var year = now.getFullYear(); //得到年份
+      var defaultDate = `${year}`;
+      defaultDate = `${year}`
+      return defaultDate;
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -467,7 +477,7 @@ export default {
     },
     //获取人员表
     getStaffmar() {
-      listStaffmgr(this.staffmgrQueryParams).then(response => {
+      selectTimeStaffmgr(this.staffmgrQueryParams).then(response => {
         const allData = response.rows
         const data = [];
         for (let i = 0; i < allData.length; i++) {
@@ -506,7 +516,7 @@ export default {
       if (this.checkboxPost.length > 0) {
         this.staffmgrQueryParams.actualposts = this.checkboxPost.toString();
         this.$nextTick(() => {
-          listStaffmgr(this.staffmgrQueryParams).then(response => {
+          selectTimeStaffmgr(this.staffmgrQueryParams).then(response => {
             const allData = response.rows
             const data = [];
             for (let i = 0; i < allData.length; i++) {
@@ -573,12 +583,14 @@ export default {
               this.msgSuccess(this.$t('修改成功'));
               this.open = false;
               this.getList();
+              this.handleScore();
             });
           } else {
             addCompanylevel(this.form).then(response => {
               this.msgSuccess(this.$t('新增成功'));
               this.open = false;
               this.getList();
+              this.handleScore();
             });
           }
         }
@@ -593,6 +605,7 @@ export default {
             this.participantsOpen = false;
             this.checkboxPost = [];
             this.getList();
+            this.handleScore();
           });
         }
       });
@@ -620,6 +633,7 @@ export default {
         return delCompanylevel(ids);
       }).then(() => {
         this.getList();
+        this.handleScore();
         this.msgSuccess(this.$t('删除成功'));
       })
     },
@@ -665,6 +679,7 @@ export default {
       }else {
         this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
       }
+      this.handleScore();
       this.getList();
     },
     // 提交上传文件