Browse Source

ly 培训bug修复,人员信息修改bug

ly 1 năm trước cách đây
mục cha
commit
2a37f90801

+ 8 - 5
master/src/main/java/com/ruoyi/framework/task/sems/SpecTodoTask.java

@@ -14,6 +14,8 @@ import org.activiti.engine.task.Task;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 @Component
@@ -25,12 +27,13 @@ public class SpecTodoTask extends BaseController {
     public void execute() {
         List<SysUser> sysUsers = sysUserService.selectAllUser();
         IMailService mailService = (IMailService) SpringContextUtils.getBean("mailService");
+        String[] array = {"myProcess", "semsAddDelProcess", "yearProcess", "monthProcess", "yearProcess", "semsWeekcheck"};
+        List<String> processInstanceIds = new ArrayList<>(Arrays.asList(array));
         for (SysUser item : sysUsers) {
             try {
                 ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
                 List<Task> taskList = processEngine.getTaskService()//获取任务service
-                        .createTaskQuery()//创建查询对象
-                        .processDefinitionName("特种设备审批流程")//根据任务流程id查询
+                        .createTaskQuery().processDefinitionKeyIn(processInstanceIds)//创建查询对象
                         .taskCandidateOrAssigned(item.getUserId().toString())
                         //                .taskAssignee(getUserId().toString())
                         .orderByTaskCreateTime().desc().list();//参与者,组任务查询
@@ -44,13 +47,13 @@ public class SpecTodoTask extends BaseController {
                             "<table cellpadding=\"0\" align=\"center\"" +
                             "style=\"width: 600px; margin: 0px auto; text-align: left; position: relative; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; font-size: 14px; font-family:微软雅黑, 黑体; line-height: 1.5; box-shadow: rgb(153, 153, 153) 0px 0px 5px; border-collapse: collapse; background-position: initial initial; background-repeat: initial initial;background:#fff;\">" +
                             "<tbody><tr><th valign=\"middle\" style=\"height: 25px; line-height: 25px; padding: 15px 35px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #42a3d3; background-color: #49bcff; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">" +
-                            "<font face=\"微软雅黑\" size=\"5\" style=\"color: rgb(255, 255, 255); \">待办任务 </font><font face=\"微软雅黑\" size=\"3\" style=\"color: rgb(255, 255, 255); \">To-Do Task</font></th></tr>";
+                            "<font face=\"微软雅黑\" size=\"5\" style=\"color: rgb(255, 255, 255); \">待办任务提醒 </font><font face=\"微软雅黑\" size=\"3\" style=\"color: rgb(255, 255, 255); \">To-Do Task</font></th></tr>";
                     //表html中间内容
                     String center = "<tr><td><div style=\"padding:25px 35px 40px; background-color:#fff;\"><h2 style=\"margin: 5px 0px; \">" +
                             "<font color=\"#333333\" style=\"line-height: 20px; \"><font style=\"line-height: 22px; \" size=\"4\">" +
                             "亲爱的 username(loginName)</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
                             "Dear usernameEN(loginName)</font></font></h2>" +
-                            "<p>您有" + taskList.size() + "条新的待办任务尚未完成:<br>" +
+                            "<p>您有" + taskList.size() + "条待办任务尚未完成:<br>" +
                             "You have " + taskList.size() + " new to-do tasks that have not been completed :<br>" +
                             "请登录<a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">我的待办</a>查看。<br>" +
                             "Please log in the <a href=\"https://cpms.basf-ypc.net.cn/cpms/index.html#/approve/pending\">My To-Do List</a> to handle it.</p>" +
@@ -67,7 +70,7 @@ public class SpecTodoTask extends BaseController {
                     //拼接html
                     String html = start + result + end;
                     logger.info("html:" + html);
-                    mailService.sendHtmlMail(email, "特种设备系统:您有新的待办任务尚未完成 SEMS:You have new to-do tasks that have not been completed", html);
+                    mailService.sendHtmlMail(email, "特种设备系统:您有待办任务尚未完成 SEMS:You have new to-do tasks that have not been completed", html);
                 }
             } catch (Exception ignored) {
             }

+ 1 - 1
master/src/main/java/com/ruoyi/project/listener/semsApprove/GyzjTaskCreateListener.java

@@ -29,7 +29,7 @@ public class GyzjTaskCreateListener implements Serializable, TaskListener {
     @Override
     public void notify(DelegateTask delegateTask) {
         logger.info("Variables:" + JSON.toJSONString(delegateTask.getVariables()));
-        String gyzjusers = (String) delegateTask.getVariables().get("gyjlusers");
+        String gyzjusers = (String) delegateTask.getVariables().get("gyzjusers");
         String id = delegateTask.getExecution().getProcessInstanceBusinessKey();
         ITApproveService tApproveService = (ITApproveService) SpringContextUtils.getBean("tApproveService");
         ISysUserService sysUserService = (ISysUserService) SpringContextUtils.getBean("sysUserService");

+ 1 - 1
master/src/main/java/com/ruoyi/project/listener/semsApprove/ZfhzTaskCreateListener.java

@@ -29,7 +29,7 @@ public class ZfhzTaskCreateListener implements Serializable, TaskListener {
     @Override
     public void notify(DelegateTask delegateTask) {
         logger.info("Variables:" + JSON.toJSONString(delegateTask.getVariables()));
-        String zfusers = (String) delegateTask.getVariables().get("gyjlusers");
+        String zfusers = (String) delegateTask.getVariables().get("zfusers");
         String id = delegateTask.getExecution().getProcessInstanceBusinessKey();
         ITApproveService tApproveService = (ITApproveService) SpringContextUtils.getBean("tApproveService");
         ISysUserService sysUserService = (ISysUserService) SpringContextUtils.getBean("sysUserService");

+ 3 - 0
master/src/main/java/com/ruoyi/project/plant/controller/TStaffmgrController.java

@@ -613,6 +613,9 @@ public class TStaffmgrController extends BaseController {
         if (tStaffmgr.getUnit().equals("10") || tStaffmgr.getUnit().equals("18")) {
             //部门为CBP/C或CBP的人员
             TTrainingrecords tTrainingrecords = tTrainingrecordsService.selectTTrainingrecordsBystaffId(tStaffmgr.getId());
+            if (tTrainingrecords == null) {
+                tTrainingrecords = new TTrainingrecords();
+            }
             tTrainingrecords.setPlantCode(tStaffmgr.getPlantCode());
             tTrainingrecords.setName(tStaffmgr.getName());
             tTrainingrecords.setEmployeeid(tStaffmgr.getStaffid());

+ 19 - 1
master/src/main/java/com/ruoyi/project/sems/controller/TSpecdevCcController.java

@@ -28,7 +28,9 @@ import com.ruoyi.project.sems.his.service.ITApproveSpecModifyService;
 import com.ruoyi.project.sems.service.ITSpecCheckService;
 import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysDictData;
+import com.ruoyi.project.system.domain.SysPlant;
 import com.ruoyi.project.system.domain.TAlarmtype;
+import com.ruoyi.project.system.mapper.SysPlantMapper;
 import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.system.service.ITAlarmtypeService;
@@ -52,6 +54,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
  *
@@ -80,6 +84,8 @@ public class TSpecdevCcController extends BaseController {
     //注入特种设备预警接口
     @Autowired
     private ITAlarmtypeService tAlarmtypeService;
+    @Resource
+    private SysPlantMapper sysPlantMapper;
 
     /**
      * 查询特种设备叉车台账列表
@@ -229,7 +235,7 @@ public class TSpecdevCcController extends BaseController {
         List<TSpecdevCc> list = new ArrayList<TSpecdevCc>();
         //字典查询
         List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
-
+        List<SysPlant> plants =  sysPlantMapper.selectSysPlantList(new SysPlant());
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
         int rowNum = sheet.getPhysicalNumberOfRows();
@@ -251,6 +257,18 @@ public class TSpecdevCcController extends BaseController {
                         //序号
                     } else if (j == 1) {
                         entity.setPlantCode(cellValue);//装置名称
+                        //判断是否存在的plant
+                        boolean found = false;
+                        for (SysPlant p : plants) {
+                            if (p.getName().equals(cellValue)) {
+                                found = true;
+                                break;
+                            }
+                        }
+                        if (!found) {
+                            //未发现plant
+                            throw new Exception("未发现plant");
+                        }
                     } else if (j == 2) {
                         entity.setUnit(cellValue);//使用部门
                     } else if (j == 3) {

+ 19 - 1
master/src/main/java/com/ruoyi/project/sems/controller/TSpecdevDtController.java

@@ -23,7 +23,9 @@ import com.ruoyi.project.sems.his.service.ITApproveSpecModifyService;
 import com.ruoyi.project.sems.service.ITSpecCheckService;
 import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysDictData;
+import com.ruoyi.project.system.domain.SysPlant;
 import com.ruoyi.project.system.domain.TAlarmtype;
+import com.ruoyi.project.system.mapper.SysPlantMapper;
 import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.system.service.ITAlarmtypeService;
@@ -46,6 +48,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
  *
@@ -74,6 +78,8 @@ public class TSpecdevDtController extends BaseController {
     //注入特种设备预警接口
     @Autowired
     private ITAlarmtypeService tAlarmtypeService;
+    @Resource
+    private SysPlantMapper sysPlantMapper;
 
     /**
      * 查询特种设备电梯台账列表
@@ -223,7 +229,7 @@ public class TSpecdevDtController extends BaseController {
         List<TSpecdevDt> list = new ArrayList<TSpecdevDt>();
         //字典查询
         List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
-
+        List<SysPlant> plants =  sysPlantMapper.selectSysPlantList(new SysPlant());
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
         int rowNum = sheet.getPhysicalNumberOfRows();
@@ -245,6 +251,18 @@ public class TSpecdevDtController extends BaseController {
                         //序号
                     } else if (j == 1) {
                         entity.setPlantCode(cellValue);//装置名称
+                        //判断是否存在的plant
+                        boolean found = false;
+                        for (SysPlant p : plants) {
+                            if (p.getName().equals(cellValue)) {
+                                found = true;
+                                break;
+                            }
+                        }
+                        if (!found) {
+                            //未发现plant
+                            throw new Exception("未发现plant");
+                        }
                     } else if (j == 2) {
                         entity.setUnit(cellValue);//单元
                     } else if (j == 3) {

+ 19 - 1
master/src/main/java/com/ruoyi/project/sems/controller/TSpecdevDzsbController.java

@@ -25,7 +25,9 @@ import com.ruoyi.project.sems.his.service.ITApproveSpecModifyService;
 import com.ruoyi.project.sems.service.ITSpecCheckService;
 import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysDictData;
+import com.ruoyi.project.system.domain.SysPlant;
 import com.ruoyi.project.system.domain.TAlarmtype;
+import com.ruoyi.project.system.mapper.SysPlantMapper;
 import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.system.service.ITAlarmtypeService;
@@ -47,6 +49,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
  *
@@ -75,6 +79,8 @@ public class TSpecdevDzsbController extends BaseController {
     //注入特种设备预警接口
     @Autowired
     private ITAlarmtypeService tAlarmtypeService;
+    @Resource
+    private SysPlantMapper sysPlantMapper;
 
     /**
      * 查询特种设备吊装设备台账列表
@@ -224,7 +230,7 @@ public class TSpecdevDzsbController extends BaseController {
         List<TSpecdevDzsb> list = new ArrayList<TSpecdevDzsb>();
         //字典查询
         List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
-
+        List<SysPlant> plants =  sysPlantMapper.selectSysPlantList(new SysPlant());
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
         int rowNum = sheet.getPhysicalNumberOfRows();
@@ -248,6 +254,18 @@ public class TSpecdevDzsbController extends BaseController {
                         //序号
                     } else if (j == 1) {
                         entity.setPlantCode(cellValue);//装置
+                        //判断是否存在的plant
+                        boolean found = false;
+                        for (SysPlant p : plants) {
+                            if (p.getName().equals(cellValue)) {
+                                found = true;
+                                break;
+                            }
+                        }
+                        if (!found) {
+                            //未发现plant
+                            throw new Exception("未发现plant");
+                        }
                     } else if (j == 2) {
                         entity.setUnit(cellValue);//装置维修组
                     } else if (j == 3) {

+ 19 - 1
master/src/main/java/com/ruoyi/project/sems/controller/TSpecdevGlController.java

@@ -24,7 +24,9 @@ import com.ruoyi.project.sems.his.service.ITApproveSpecModifyService;
 import com.ruoyi.project.sems.service.ITSpecCheckService;
 import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysDictData;
+import com.ruoyi.project.system.domain.SysPlant;
 import com.ruoyi.project.system.domain.TAlarmtype;
+import com.ruoyi.project.system.mapper.SysPlantMapper;
 import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.system.service.ITAlarmtypeService;
@@ -46,6 +48,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
  *
@@ -75,6 +79,8 @@ public class TSpecdevGlController extends BaseController
     //注入特种设备预警接口
     @Autowired
     private ITAlarmtypeService tAlarmtypeService;
+    @Resource
+    private SysPlantMapper sysPlantMapper;
     /**
      * 查询特种设备锅炉台账列表
      */
@@ -234,7 +240,7 @@ public class TSpecdevGlController extends BaseController
         List<TSpecdevGl> list = new ArrayList<TSpecdevGl>();
         //字典查询
         List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
-
+        List<SysPlant> plants =  sysPlantMapper.selectSysPlantList(new SysPlant());
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
         int rowNum = sheet.getPhysicalNumberOfRows();
@@ -256,6 +262,18 @@ public class TSpecdevGlController extends BaseController
                         //序号
                     } else if (j == 1) {
                         entity.setPlantCode(cellValue);//装置名称
+                        //判断是否存在的plant
+                        boolean found = false;
+                        for (SysPlant p : plants) {
+                            if (p.getName().equals(cellValue)) {
+                                found = true;
+                                break;
+                            }
+                        }
+                        if (!found) {
+                            //未发现plant
+                            throw new Exception("未发现plant");
+                        }
                     } else if (j == 2) {
                         entity.setUnit(cellValue);//单元
                     } else if (j == 3) {

+ 21 - 0
master/src/main/java/com/ruoyi/project/sems/controller/TSpecdevYlgdController.java

@@ -29,7 +29,9 @@ import com.ruoyi.project.sems.his.service.ITApproveSpecModifyService;
 import com.ruoyi.project.sems.service.ITSpecCheckService;
 import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysDictData;
+import com.ruoyi.project.system.domain.SysPlant;
 import com.ruoyi.project.system.domain.TAlarmtype;
+import com.ruoyi.project.system.mapper.SysPlantMapper;
 import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.system.service.ITAlarmtypeService;
@@ -51,6 +53,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
  *
@@ -78,6 +82,8 @@ public class TSpecdevYlgdController extends BaseController {
     private TSpechiYlgdController tSpechiYlgdController;
     @Autowired
     private TReportYlgdController tReportYlgdController;
+    @Resource
+    private SysPlantMapper sysPlantMapper;
     //注入特种设备预警接口
     @Autowired
     private ITAlarmtypeService tAlarmtypeService;
@@ -235,6 +241,7 @@ public class TSpecdevYlgdController extends BaseController {
         List<TSpecdevYlgd> list = new ArrayList<TSpecdevYlgd>();
         //字典查询
         List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
+        List<SysPlant> plants =  sysPlantMapper.selectSysPlantList(new SysPlant());
 
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
@@ -257,6 +264,18 @@ public class TSpecdevYlgdController extends BaseController {
                         //序号
                     } else if (j == 1) {
                         entity.setPlantCode(cellValue);//装置名称
+                        //判断是否存在的plant
+                        boolean found = false;
+                        for (SysPlant p : plants) {
+                            if (p.getName().equals(cellValue)) {
+                                found = true;
+                                break;
+                            }
+                        }
+                        if (!found) {
+                            //未发现plant
+                            throw new Exception("未发现plant");
+                        }
                     } else if (j == 2) {
                         entity.setUnit(cellValue);//单元
                     } else if (j == 3) {
@@ -370,6 +389,8 @@ public class TSpecdevYlgdController extends BaseController {
         }
         AtomicInteger successNumber = new AtomicInteger();
         AtomicInteger failNum = new AtomicInteger();
+
+
         //线程池
         ExecutorService executorService = Executors.newFixedThreadPool(30);
         final CountDownLatch latch = new CountDownLatch(list.size()); //相同线程数量的计数

+ 17 - 0
master/src/main/java/com/ruoyi/project/sems/controller/TSpecdevYlrqController.java

@@ -33,7 +33,9 @@ import com.ruoyi.project.sems.mapper.TSpecdevYlrqMapper;
 import com.ruoyi.project.sems.service.ITSpecCheckService;
 import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysDictData;
+import com.ruoyi.project.system.domain.SysPlant;
 import com.ruoyi.project.system.domain.TAlarmtype;
+import com.ruoyi.project.system.mapper.SysPlantMapper;
 import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.system.service.ITAlarmtypeService;
@@ -90,6 +92,8 @@ public class TSpecdevYlrqController extends BaseController {
     //注入特种设备预警接口
     @Autowired
     private ITAlarmtypeService tAlarmtypeService;
+    @Resource
+    private SysPlantMapper sysPlantMapper;
 
     /**
      * 查询特种设备压力容器台账列表
@@ -263,6 +267,7 @@ public class TSpecdevYlrqController extends BaseController {
         List<TSpecdevYlrq> list = new ArrayList<TSpecdevYlrq>();
         //字典查询
         List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
+        List<SysPlant> plants =  sysPlantMapper.selectSysPlantList(new SysPlant());
 
         //部门查询
         List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
@@ -289,6 +294,18 @@ public class TSpecdevYlrqController extends BaseController {
                         //序号
                     } else if (j == 1) {
                         entity.setPlantCode(cellValue);//装置名称
+                        //判断是否存在的plant
+                        boolean found = false;
+                        for (SysPlant p : plants) {
+                            if (p.getName().equals(cellValue)) {
+                                found = true;
+                                break;
+                            }
+                        }
+                        if (!found) {
+                            //未发现plant
+                            throw new Exception("未发现plant");
+                        }
                     } else if (j == 2) {
                         entity.setUnit(cellValue);//单元
                     } else if (j == 3) {

+ 1 - 0
master/src/main/java/com/ruoyi/project/training/controller/TTrainingbccController.java

@@ -133,6 +133,7 @@ public class TTrainingbccController extends BaseController
         if (tTrainingbcc.getPosition() != null) {
             TStaffmgr s = new TStaffmgr();
             s.setActualposts(tTrainingbcc.getPosition());
+            s.setDeptId(103l);
             List<TStaffmgr> trainingStaff = tStaffmgrService.selectAllTStaffmgrList(s);
             try {
                 //判断离职

+ 62 - 0
master/src/main/java/com/ruoyi/project/training/elearn/controller/TElQuController.java

@@ -12,6 +12,7 @@ import java.util.regex.Pattern;
 import com.alibaba.fastjson.JSON;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.framework.config.RuoYiConfig;
 import com.ruoyi.project.system.domain.SysUser;
@@ -19,6 +20,10 @@ import com.ruoyi.project.training.elearn.domain.TElQuAnswer;
 import com.ruoyi.project.training.spec.domain.vo.TStPlanImportVO;
 import org.apache.poi.hwpf.HWPFDocument;
 import org.apache.poi.hwpf.extractor.WordExtractor;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
 import org.apache.poi.xwpf.usermodel.XWPFParagraph;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -578,4 +583,61 @@ public class TElQuController extends BaseController {
 
         return AjaxResult.success();
     }
+
+    /**
+     * 导入题目
+     *
+     * @param file          用户上传的文件
+     * @param updateSupport 是否更新支持,如果已存在,则进行更新数据
+     * @param repoIds       题库id
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/importDataExcel")
+    public AjaxResult importDataExcel(MultipartFile file, boolean updateSupport, String repoIds) throws Exception {
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        for (int i = 1; i < rowNum; i++) {
+            logger.info("读取行数:" + i);
+            Row row = sheet.getRow(i);
+            int cellNum = row.getLastCellNum();
+            TElQu qu = new TElQu();
+            for (int j = 0; j < cellNum; j++) {
+                Cell cell = row.getCell(j);
+                String cellValue = ExcelUtils.getCellValue(cell).trim();
+                logger.info("cellValue:" + cellValue);
+                if (j == 0) {
+                    //题型
+                    if ("单选题".equals(cellValue)) {
+                        qu.setQuType(1l);
+                    }else if ("多选题".equals(cellValue)) {
+                        qu.setQuType(2l);
+                    }else if ("判断题".equals(cellValue)) {
+                        qu.setQuType(3l);
+                    }else {
+                        break;
+                    }
+                }else if (j == 1) {
+                        qu.setContent(cellValue);
+                }else if (j == 2) {
+                    if (qu.getQuType() != 3) {
+                        List<String> anwsers = Arrays.asList(cellValue.split(";"));
+                    }
+                }else if (j == 3) {
+                    if (qu.getQuType() == 3) {
+                        List<String> anwsers = Arrays.asList(cellValue.split(";"));
+                    }
+                }
+
+
+
+            }
+
+
+        }
+
+
+        return AjaxResult.success();
+    };
 }

+ 2 - 2
master/src/main/resources/logback.xml

@@ -42,8 +42,8 @@
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <!-- 日志文件名格式 -->
             <fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
-			<!-- 日志最大的历史 60天 -->
-			<maxHistory>60</maxHistory>
+			<!-- 错误日志最大的历史 90天 -->
+			<maxHistory>90</maxHistory>
         </rollingPolicy>
         <encoder>
             <pattern>${log.pattern}</pattern>

+ 2 - 2
master/src/main/resources/mybatis/training/elearn/TElQuMapper.xml

@@ -74,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </selectKey>
         insert into t_el_qu
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="quId != null">qu_id,</if>
+            qu_id,
             <if test="quType != null">qu_type,</if>
             <if test="qlevel != null">qlevel,</if>
             <if test="content != null">content,</if>
@@ -89,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remarks != null">remarks,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="quId != null">#{quId},</if>
+            #{quId},
             <if test="quType != null">#{quType},</if>
             <if test="qlevel != null">#{qlevel},</if>
             <if test="content != null">#{content},</if>

+ 73 - 3
ui/src/views/training/elearn/qu/index.vue

@@ -56,7 +56,15 @@
           icon="el-icon-upload2"
           size="mini"
           @click="handleImport"
-        >导入</el-button>
+        >WORD导入</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImportExcel"
+        >EXCEL导入</el-button>
       </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
@@ -270,6 +278,33 @@
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
     </el-dialog>
+    <el-dialog :title="uploadExcel.title" :visible.sync="uploadExcel.open" width="400px" append-to-body>
+      <el-upload
+        ref="uploadExcel"
+        :limit="1"
+        :headers="uploadExcel.headers"
+        :action="uploadExcel.url + '?repoIds=' + uploadExcel.repoIds"
+        :disabled="uploadExcel.isUploading"
+        :on-progress="handleFileUploadProgressExcel"
+        :on-success="handleFileSuccessExcel"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+        <div class="el-upload__tip" slot="tip">
+          <repo-select v-model="uploadExcel.repoIds" :multi="true" />
+        </div>
+        <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“doc”格式文件!</div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileFormExcel">确 定</el-button>
+        <el-button @click="uploadExcel.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
 
   </div>
 </template>
@@ -344,6 +379,21 @@ export default {
             // 上传的地址
             url: process.env.VUE_APP_BASE_API + "/elearn/qu/importData"
         },
+      // 用户导入参数
+      uploadExcel: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/elearn/qu/importDataExcel"
+      },
       photo: {
         imageUrl: '',
         fileList: [],
@@ -531,6 +581,10 @@ export default {
           this.upload.title = "用户导入";
           this.upload.open = true;
       },
+    handleImportExcel() {
+      this.uploadExcel.title = "用户导入";
+      this.uploadExcel.open = true;
+    },
       /** 下载模板操作 */
       importTemplate() {
           importTemplate().then(response => {
@@ -550,9 +604,25 @@ export default {
           this.getList();
       },
       // 提交上传文件
-      submitFileForm() {
-          this.$refs.upload.submit();
+      submitFileFormExcel() {
+          this.$refs.uploadExcel.submit();
       },
+    // 文件上传中处理
+    handleFileUploadProgressExcel(event, file, fileList) {
+      this.uploadExcel.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccessExcel(response, file, fileList) {
+      this.uploadExcel.open = false;
+      this.uploadExcel.isUploading = false;
+      this.$refs.uploadExcel.clearFiles();
+      this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+      this.getList();
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
     handleTypeChange(v) {
       this.form.answerList = []
       if (v === 3) {