jiangbiao 1 год назад
Родитель
Сommit
3a9d339709
40 измененных файлов с 1693 добавлено и 658 удалено
  1. 49 29
      master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFirstplanController.java
  2. 35 29
      master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFirstplanTmplController.java
  3. 44 29
      master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFlplanController.java
  4. 21 8
      master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFlplanTmplController.java
  5. 43 29
      master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFtplanController.java
  6. 21 8
      master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFtplanTmplController.java
  7. 33 0
      master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsLjplanController.java
  8. 21 8
      master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsLjplanTmplController.java
  9. 44 29
      master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsYsplanController.java
  10. 21 8
      master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsYsplanTmplController.java
  11. 76 0
      master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsFirstplan.java
  12. 30 0
      master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsFirstplanTmpl.java
  13. 40 0
      master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsFlplan.java
  14. 30 0
      master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsFlplanTmpl.java
  15. 40 0
      master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsFtplan.java
  16. 30 0
      master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsFtplanTmpl.java
  17. 40 0
      master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsLjplan.java
  18. 30 0
      master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsLjplanTmpl.java
  19. 40 0
      master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsYsplan.java
  20. 30 0
      master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsYsplanTmpl.java
  21. 20 0
      master/src/main/java/com/ruoyi/project/training/bccnew/service/impl/TTsNewServiceImpl.java
  22. 29 1
      master/src/main/resources/mybatis/training/bccnew/TTsFirstplanMapper.xml
  23. 13 1
      master/src/main/resources/mybatis/training/bccnew/TTsFirstplanTmplMapper.xml
  24. 17 1
      master/src/main/resources/mybatis/training/bccnew/TTsFlplanMapper.xml
  25. 13 1
      master/src/main/resources/mybatis/training/bccnew/TTsFlplanTmplMapper.xml
  26. 17 1
      master/src/main/resources/mybatis/training/bccnew/TTsFtplanMapper.xml
  27. 13 1
      master/src/main/resources/mybatis/training/bccnew/TTsFtplanTmplMapper.xml
  28. 17 1
      master/src/main/resources/mybatis/training/bccnew/TTsLjplanMapper.xml
  29. 13 1
      master/src/main/resources/mybatis/training/bccnew/TTsLjplanTmplMapper.xml
  30. 17 1
      master/src/main/resources/mybatis/training/bccnew/TTsYsplanMapper.xml
  31. 13 1
      master/src/main/resources/mybatis/training/bccnew/TTsYsplanTmplMapper.xml
  32. 10 1
      ui/src/api/training/bccnew/firstplan.js
  33. 10 1
      ui/src/api/training/bccnew/flplandsdt.js
  34. 10 1
      ui/src/api/training/bccnew/ftplandsdt.js
  35. 11 1
      ui/src/api/training/bccnew/ljplandsdt.js
  36. 10 1
      ui/src/api/training/bccnew/ysplandsdt.js
  37. 318 291
      ui/src/views/training/bccnew/firstPlanTmpl/index.vue
  38. 280 152
      ui/src/views/training/bccnew/firstplan/index.vue
  39. 6 16
      ui/src/views/training/bccnew/tsnew/index.vue
  40. 138 7
      ui/src/views/training/bccnew/tsnew/score.vue

+ 49 - 29
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFirstplanController.java

@@ -1,24 +1,23 @@
 package com.ruoyi.project.training.bccnew.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.project.training.bccnew.domain.TTsFirstplan;
-import com.ruoyi.project.training.bccnew.service.ITTsFirstplanService;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysUserService;
+import com.ruoyi.project.training.bccnew.domain.TTsFirstplan;
+import com.ruoyi.project.training.bccnew.domain.TTsLjplan;
+import com.ruoyi.project.training.bccnew.domain.TTsNew;
+import com.ruoyi.project.training.bccnew.service.ITTsFirstplanService;
+import com.ruoyi.project.training.bccnew.service.ITTsNewService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 进组培训Controller
@@ -28,18 +27,20 @@ import com.ruoyi.framework.web.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/bccnew/firstplan")
-public class TTsFirstplanController extends BaseController
-{
+public class TTsFirstplanController extends BaseController {
     @Autowired
     private ITTsFirstplanService tTsFirstplanService;
+    @Autowired
+    private ITTsNewService tTsNewService;
+    @Autowired
+    private ISysUserService sysUserService;
 
     /**
      * 查询进组培训列表
      */
     @PreAuthorize("@ss.hasPermi('bccnew:firstplan:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TTsFirstplan tTsFirstplan)
-    {
+    public TableDataInfo list(TTsFirstplan tTsFirstplan) {
         startPage();
         List<TTsFirstplan> list = tTsFirstplanService.selectTTsFirstplanList(tTsFirstplan);
         return getDataTable(list);
@@ -51,8 +52,7 @@ public class TTsFirstplanController extends BaseController
     @PreAuthorize("@ss.hasPermi('bccnew:firstplan:export')")
     @Log(title = "进组培训", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(TTsFirstplan tTsFirstplan)
-    {
+    public AjaxResult export(TTsFirstplan tTsFirstplan) {
         List<TTsFirstplan> list = tTsFirstplanService.selectTTsFirstplanList(tTsFirstplan);
         ExcelUtil<TTsFirstplan> util = new ExcelUtil<TTsFirstplan>(TTsFirstplan.class);
         return util.exportExcel(list, "firstplan");
@@ -63,8 +63,7 @@ public class TTsFirstplanController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('bccnew:firstplan:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tTsFirstplanService.selectTTsFirstplanById(id));
     }
 
@@ -74,19 +73,41 @@ public class TTsFirstplanController extends BaseController
     @PreAuthorize("@ss.hasPermi('bccnew:firstplan:add')")
     @Log(title = "进组培训", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TTsFirstplan tTsFirstplan)
-    {
+    public AjaxResult add(@RequestBody TTsFirstplan tTsFirstplan) {
         return toAjax(tTsFirstplanService.insertTTsFirstplan(tTsFirstplan));
     }
 
+
+    /**
+     * 修改裂解培训
+     */
+    @Log(title = "进组培训更新学习时长", businessType = BusinessType.UPDATE)
+    @PutMapping("/updateFirstLearnTime")
+    public AjaxResult updateFirstLearnTime(@RequestBody TTsFirstplan tTsFirstplan) {
+        Long userId = getUserId();
+        TTsNew tTsNew = tTsNewService.selectTTsNewById(tTsFirstplan.getNewId());
+        SysUser sysUser = sysUserService.selectUserByStaffId(tTsNew.getStaffId());
+        if (userId.equals(sysUser.getUserId())) {
+            TTsFirstplan plan = new TTsFirstplan();
+            plan.setId(tTsFirstplan.getId());
+            long timer = tTsFirstplan.getTimer() == null ? 0 : tTsFirstplan.getTimer();
+            plan.setTimer(timer+1);
+            TTsFirstplan need = tTsFirstplanService.selectTTsFirstplanById(tTsFirstplan.getId());
+            if (need.getTimerNeed()!=null&&need.getTimerNeed().equals(timer+1)){
+                plan.setPlanStatus(2L);
+            }
+            return toAjax(tTsFirstplanService.updateTTsFirstplan(plan));
+        }
+        return AjaxResult.error("当前登录用户非学习用户!");
+    }
+
     /**
      * 修改进组培训
      */
     @PreAuthorize("@ss.hasPermi('bccnew:firstplan:edit')")
     @Log(title = "进组培训", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TTsFirstplan tTsFirstplan)
-    {
+    public AjaxResult edit(@RequestBody TTsFirstplan tTsFirstplan) {
         return toAjax(tTsFirstplanService.updateTTsFirstplan(tTsFirstplan));
     }
 
@@ -95,9 +116,8 @@ public class TTsFirstplanController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('bccnew:firstplan:remove')")
     @Log(title = "进组培训", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tTsFirstplanService.deleteTTsFirstplanByIds(ids));
     }
 }

+ 35 - 29
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFirstplanTmplController.java

@@ -1,24 +1,23 @@
 package com.ruoyi.project.training.bccnew.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.project.training.bccnew.domain.TTsFirstplanTmpl;
-import com.ruoyi.project.training.bccnew.service.ITTsFirstplanTmplService;
+import com.ruoyi.framework.config.RuoYiConfig;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.project.ehs.domain.TRcfile;
+import com.ruoyi.project.training.bccnew.domain.TTsFirstplanTmpl;
+import com.ruoyi.project.training.bccnew.service.ITTsFirstplanTmplService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.List;
 
 /**
  * 进组培训模版Controller
@@ -28,8 +27,7 @@ import com.ruoyi.framework.web.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/bccnew/firstPlanTmpl")
-public class TTsFirstplanTmplController extends BaseController
-{
+public class TTsFirstplanTmplController extends BaseController {
     @Autowired
     private ITTsFirstplanTmplService tTsFirstplanTmplService;
 
@@ -38,8 +36,7 @@ public class TTsFirstplanTmplController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('bccnew:firstPlanTmpl:list')")
     @GetMapping("/list")
-    public TableDataInfo list(TTsFirstplanTmpl tTsFirstplanTmpl)
-    {
+    public TableDataInfo list(TTsFirstplanTmpl tTsFirstplanTmpl) {
         startPage();
         List<TTsFirstplanTmpl> list = tTsFirstplanTmplService.selectTTsFirstplanTmplList(tTsFirstplanTmpl);
         return getDataTable(list);
@@ -51,8 +48,7 @@ public class TTsFirstplanTmplController extends BaseController
     @PreAuthorize("@ss.hasPermi('bccnew:firstPlanTmpl:export')")
     @Log(title = "进组培训模版", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(TTsFirstplanTmpl tTsFirstplanTmpl)
-    {
+    public AjaxResult export(TTsFirstplanTmpl tTsFirstplanTmpl) {
         List<TTsFirstplanTmpl> list = tTsFirstplanTmplService.selectTTsFirstplanTmplList(tTsFirstplanTmpl);
         ExcelUtil<TTsFirstplanTmpl> util = new ExcelUtil<TTsFirstplanTmpl>(TTsFirstplanTmpl.class);
         return util.exportExcel(list, "firstPlanTmpl");
@@ -63,8 +59,7 @@ public class TTsFirstplanTmplController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('bccnew:firstPlanTmpl:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tTsFirstplanTmplService.selectTTsFirstplanTmplById(id));
     }
 
@@ -74,8 +69,7 @@ public class TTsFirstplanTmplController extends BaseController
     @PreAuthorize("@ss.hasPermi('bccnew:firstPlanTmpl:add')")
     @Log(title = "进组培训模版", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TTsFirstplanTmpl tTsFirstplanTmpl)
-    {
+    public AjaxResult add(@RequestBody TTsFirstplanTmpl tTsFirstplanTmpl) {
         return toAjax(tTsFirstplanTmplService.insertTTsFirstplanTmpl(tTsFirstplanTmpl));
     }
 
@@ -85,8 +79,7 @@ public class TTsFirstplanTmplController extends BaseController
     @PreAuthorize("@ss.hasPermi('bccnew:firstPlanTmpl:edit')")
     @Log(title = "进组培训模版", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TTsFirstplanTmpl tTsFirstplanTmpl)
-    {
+    public AjaxResult edit(@RequestBody TTsFirstplanTmpl tTsFirstplanTmpl) {
         return toAjax(tTsFirstplanTmplService.updateTTsFirstplanTmpl(tTsFirstplanTmpl));
     }
 
@@ -95,9 +88,22 @@ public class TTsFirstplanTmplController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('bccnew:firstPlanTmpl:remove')")
     @Log(title = "进组培训模版", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tTsFirstplanTmplService.deleteTTsFirstplanTmplByIds(ids));
     }
+
+    @Log(title = "附件上传", businessType = BusinessType.UPDATE)
+    @PostMapping("/uploadFile")
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, Long id) throws IOException {
+        if (!file.isEmpty()) {
+            String url = FileUploadUtils.upload(RuoYiConfig.getFilePath("/bccnew"), file);
+            TTsFirstplanTmpl entity = tTsFirstplanTmplService.selectTTsFirstplanTmplById(id);
+            entity.setFileUrl(url);
+            entity.setFileName(file.getOriginalFilename());
+            tTsFirstplanTmplService.updateTTsFirstplanTmpl(entity);
+            return AjaxResult.success();
+        }
+        return AjaxResult.error("上传失败,请联系管理员");
+    }
 }

+ 44 - 29
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFlplanController.java

@@ -1,24 +1,21 @@
 package com.ruoyi.project.training.bccnew.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.project.training.bccnew.domain.TTsFlplan;
-import com.ruoyi.project.training.bccnew.service.ITTsFlplanService;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysUserService;
+import com.ruoyi.project.training.bccnew.domain.TTsFlplan;
+import com.ruoyi.project.training.bccnew.domain.TTsNew;
+import com.ruoyi.project.training.bccnew.service.ITTsFlplanService;
+import com.ruoyi.project.training.bccnew.service.ITTsNewService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 分离培训Controller
@@ -28,17 +25,19 @@ import com.ruoyi.framework.web.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/bccnew/flplandsdt")
-public class TTsFlplanController extends BaseController
-{
+public class TTsFlplanController extends BaseController {
     @Autowired
     private ITTsFlplanService tTsFlplanService;
+    @Autowired
+    private ITTsNewService tTsNewService;
+    @Autowired
+    private ISysUserService sysUserService;
 
     /**
      * 查询分离培训列表
      */
     @GetMapping("/list")
-    public TableDataInfo list(TTsFlplan tTsFlplan)
-    {
+    public TableDataInfo list(TTsFlplan tTsFlplan) {
         startPage();
         List<TTsFlplan> list = tTsFlplanService.selectTTsFlplanList(tTsFlplan);
         return getDataTable(list);
@@ -49,8 +48,7 @@ public class TTsFlplanController extends BaseController
      */
     @Log(title = "分离培训", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(TTsFlplan tTsFlplan)
-    {
+    public AjaxResult export(TTsFlplan tTsFlplan) {
         List<TTsFlplan> list = tTsFlplanService.selectTTsFlplanList(tTsFlplan);
         ExcelUtil<TTsFlplan> util = new ExcelUtil<TTsFlplan>(TTsFlplan.class);
         return util.exportExcel(list, "flplandsdt");
@@ -60,8 +58,7 @@ public class TTsFlplanController extends BaseController
      * 获取分离培训详细信息
      */
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tTsFlplanService.selectTTsFlplanById(id));
     }
 
@@ -70,18 +67,37 @@ public class TTsFlplanController extends BaseController
      */
     @Log(title = "分离培训", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TTsFlplan tTsFlplan)
-    {
+    public AjaxResult add(@RequestBody TTsFlplan tTsFlplan) {
         return toAjax(tTsFlplanService.insertTTsFlplan(tTsFlplan));
     }
 
+
+    @Log(title = "分离培训", businessType = BusinessType.UPDATE)
+    @PutMapping("/updateFlLearnTime")
+    public AjaxResult updateFlLearnTime(@RequestBody TTsFlplan tTsFlplan) {
+        Long userId = getUserId();
+        TTsNew tTsNew = tTsNewService.selectTTsNewById(tTsFlplan.getNewId());
+        SysUser sysUser = sysUserService.selectUserByStaffId(tTsNew.getStaffId());
+        if (userId.equals(sysUser.getUserId())) {
+            TTsFlplan plan = new TTsFlplan();
+            plan.setId(tTsFlplan.getId());
+            long timer = tTsFlplan.getTimer() == null ? 0 : tTsFlplan.getTimer();
+            plan.setTimer(timer + 1);
+            TTsFlplan need = tTsFlplanService.selectTTsFlplanById(tTsFlplan.getId());
+            if (need.getTimerNeed() != null && need.getTimerNeed().equals(timer + 1)) {
+                plan.setPlanStatus(2L);
+            }
+            return toAjax(tTsFlplanService.updateTTsFlplan(plan));
+        }
+        return AjaxResult.error("当前登录用户非学习用户!");
+    }
+
     /**
      * 修改分离培训
      */
     @Log(title = "分离培训", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TTsFlplan tTsFlplan)
-    {
+    public AjaxResult edit(@RequestBody TTsFlplan tTsFlplan) {
         return toAjax(tTsFlplanService.updateTTsFlplan(tTsFlplan));
     }
 
@@ -89,9 +105,8 @@ public class TTsFlplanController extends BaseController
      * 删除分离培训
      */
     @Log(title = "分离培训", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tTsFlplanService.deleteTTsFlplanByIds(ids));
     }
 }

+ 21 - 8
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFlplanTmplController.java

@@ -1,16 +1,14 @@
 package com.ruoyi.project.training.bccnew.controller;
 
+import java.io.IOException;
 import java.util.List;
+
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.framework.config.RuoYiConfig;
+import com.ruoyi.project.training.bccnew.domain.TTsFirstplanTmpl;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.project.training.bccnew.domain.TTsFlplanTmpl;
@@ -19,6 +17,7 @@ import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 分离培训模版Controller
@@ -100,4 +99,18 @@ public class TTsFlplanTmplController extends BaseController
     {
         return toAjax(tTsFlplanTmplService.deleteTTsFlplanTmplByIds(ids));
     }
+
+    @Log(title = "附件上传", businessType = BusinessType.UPDATE)
+    @PostMapping("/uploadFile")
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, Long id) throws IOException {
+        if (!file.isEmpty()) {
+            String url = FileUploadUtils.upload(RuoYiConfig.getFilePath("/bccnew"), file);
+            TTsFlplanTmpl entity = tTsFlplanTmplService.selectTTsFlplanTmplById(id);
+            entity.setFileUrl(url);
+            entity.setFileName(file.getOriginalFilename());
+            tTsFlplanTmplService.updateTTsFlplanTmpl(entity);
+            return AjaxResult.success();
+        }
+        return AjaxResult.error("上传失败,请联系管理员");
+    }
 }

+ 43 - 29
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFtplanController.java

@@ -1,24 +1,21 @@
 package com.ruoyi.project.training.bccnew.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.project.training.bccnew.domain.TTsFtplan;
-import com.ruoyi.project.training.bccnew.service.ITTsFtplanService;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysUserService;
+import com.ruoyi.project.training.bccnew.domain.TTsFtplan;
+import com.ruoyi.project.training.bccnew.domain.TTsNew;
+import com.ruoyi.project.training.bccnew.service.ITTsFtplanService;
+import com.ruoyi.project.training.bccnew.service.ITTsNewService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 芳烃培训Controller
@@ -28,17 +25,19 @@ import com.ruoyi.framework.web.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/bccnew/ftplandsdt")
-public class TTsFtplanController extends BaseController
-{
+public class TTsFtplanController extends BaseController {
     @Autowired
     private ITTsFtplanService tTsFtplanService;
+    @Autowired
+    private ITTsNewService tTsNewService;
+    @Autowired
+    private ISysUserService sysUserService;
 
     /**
      * 查询芳烃培训列表
      */
     @GetMapping("/list")
-    public TableDataInfo list(TTsFtplan tTsFtplan)
-    {
+    public TableDataInfo list(TTsFtplan tTsFtplan) {
         startPage();
         List<TTsFtplan> list = tTsFtplanService.selectTTsFtplanList(tTsFtplan);
         return getDataTable(list);
@@ -49,8 +48,7 @@ public class TTsFtplanController extends BaseController
      */
     @Log(title = "芳烃培训", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(TTsFtplan tTsFtplan)
-    {
+    public AjaxResult export(TTsFtplan tTsFtplan) {
         List<TTsFtplan> list = tTsFtplanService.selectTTsFtplanList(tTsFtplan);
         ExcelUtil<TTsFtplan> util = new ExcelUtil<TTsFtplan>(TTsFtplan.class);
         return util.exportExcel(list, "ftplandsdt");
@@ -60,8 +58,7 @@ public class TTsFtplanController extends BaseController
      * 获取芳烃培训详细信息
      */
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tTsFtplanService.selectTTsFtplanById(id));
     }
 
@@ -70,18 +67,36 @@ public class TTsFtplanController extends BaseController
      */
     @Log(title = "芳烃培训", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TTsFtplan tTsFtplan)
-    {
+    public AjaxResult add(@RequestBody TTsFtplan tTsFtplan) {
         return toAjax(tTsFtplanService.insertTTsFtplan(tTsFtplan));
     }
 
+    @Log(title = "芳烃培训", businessType = BusinessType.UPDATE)
+    @PutMapping("/updateFtLearnTime")
+    public AjaxResult updateFtLearnTime(@RequestBody TTsFtplan tTsFtplan) {
+        Long userId = getUserId();
+        TTsNew tTsNew = tTsNewService.selectTTsNewById(tTsFtplan.getNewId());
+        SysUser sysUser = sysUserService.selectUserByStaffId(tTsNew.getStaffId());
+        if (userId.equals(sysUser.getUserId())) {
+            TTsFtplan plan = new TTsFtplan();
+            plan.setId(tTsFtplan.getId());
+            long timer = tTsFtplan.getTimer() == null ? 0 : tTsFtplan.getTimer();
+            plan.setTimer(timer + 1);
+            TTsFtplan need = tTsFtplanService.selectTTsFtplanById(tTsFtplan.getId());
+            if (need.getTimerNeed() != null && need.getTimerNeed().equals(timer + 1)) {
+                plan.setPlanStatus(2L);
+            }
+            return toAjax(tTsFtplanService.updateTTsFtplan(plan));
+        }
+        return AjaxResult.error("当前登录用户非学习用户!");
+    }
+
     /**
      * 修改芳烃培训
      */
     @Log(title = "芳烃培训", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TTsFtplan tTsFtplan)
-    {
+    public AjaxResult edit(@RequestBody TTsFtplan tTsFtplan) {
         return toAjax(tTsFtplanService.updateTTsFtplan(tTsFtplan));
     }
 
@@ -89,9 +104,8 @@ public class TTsFtplanController extends BaseController
      * 删除芳烃培训
      */
     @Log(title = "芳烃培训", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tTsFtplanService.deleteTTsFtplanByIds(ids));
     }
 }

+ 21 - 8
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsFtplanTmplController.java

@@ -1,16 +1,14 @@
 package com.ruoyi.project.training.bccnew.controller;
 
+import java.io.IOException;
 import java.util.List;
+
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.framework.config.RuoYiConfig;
+import com.ruoyi.project.training.bccnew.domain.TTsFlplanTmpl;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.project.training.bccnew.domain.TTsFtplanTmpl;
@@ -19,6 +17,7 @@ import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 芳烃培训模版Controller
@@ -100,4 +99,18 @@ public class TTsFtplanTmplController extends BaseController
     {
         return toAjax(tTsFtplanTmplService.deleteTTsFtplanTmplByIds(ids));
     }
+
+    @Log(title = "附件上传", businessType = BusinessType.UPDATE)
+    @PostMapping("/uploadFile")
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, Long id) throws IOException {
+        if (!file.isEmpty()) {
+            String url = FileUploadUtils.upload(RuoYiConfig.getFilePath("/bccnew"), file);
+            TTsFtplanTmpl entity = tTsFtplanTmplService.selectTTsFtplanTmplById(id);
+            entity.setFileUrl(url);
+            entity.setFileName(file.getOriginalFilename());
+            tTsFtplanTmplService.updateTTsFtplanTmpl(entity);
+            return AjaxResult.success();
+        }
+        return AjaxResult.error("上传失败,请联系管理员");
+    }
 }

+ 33 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsLjplanController.java

@@ -1,6 +1,11 @@
 package com.ruoyi.project.training.bccnew.controller;
 
 import java.util.List;
+
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysUserService;
+import com.ruoyi.project.training.bccnew.domain.TTsNew;
+import com.ruoyi.project.training.bccnew.service.ITTsNewService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -32,6 +37,10 @@ public class TTsLjplanController extends BaseController
 {
     @Autowired
     private ITTsLjplanService tTsLjplanService;
+    @Autowired
+    private ITTsNewService tTsNewService;
+    @Autowired
+    private ISysUserService sysUserService;
 
     /**
      * 查询裂解培训列表
@@ -75,6 +84,30 @@ public class TTsLjplanController extends BaseController
         return toAjax(tTsLjplanService.insertTTsLjplan(tTsLjplan));
     }
 
+    /**
+     * 修改裂解培训
+     */
+    @Log(title = "裂解培训", businessType = BusinessType.UPDATE)
+    @PutMapping("/updateLjLearnTime")
+    public AjaxResult updateLjLearnTime(@RequestBody TTsLjplan tTsLjplan){
+        Long userId = getUserId();
+        TTsNew tTsNew = tTsNewService.selectTTsNewById(tTsLjplan.getNewId());
+        SysUser sysUser = sysUserService.selectUserByStaffId(tTsNew.getStaffId());
+        if(userId.equals(sysUser.getUserId())){
+            TTsLjplan plan = new TTsLjplan();
+            plan.setId(tTsLjplan.getId());
+            long timer = tTsLjplan.getTimer()==null?0:tTsLjplan.getTimer();
+            plan.setTimer(timer+1);
+            TTsLjplan need = tTsLjplanService.selectTTsLjplanById(tTsLjplan.getId());
+            if (need.getTimerNeed()!=null&&need.getTimerNeed().equals(timer+1)){
+                plan.setPlanStatus(2L);
+            }
+            return toAjax(tTsLjplanService.updateTTsLjplan(plan));
+        }
+        return AjaxResult.error("当前登录用户非学习用户!");
+    }
+
+
     /**
      * 修改裂解培训
      */

+ 21 - 8
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsLjplanTmplController.java

@@ -1,16 +1,14 @@
 package com.ruoyi.project.training.bccnew.controller;
 
+import java.io.IOException;
 import java.util.List;
+
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.framework.config.RuoYiConfig;
+import com.ruoyi.project.training.bccnew.domain.TTsFlplanTmpl;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.project.training.bccnew.domain.TTsLjplanTmpl;
@@ -19,6 +17,7 @@ import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 裂解培训模版Controller
@@ -100,4 +99,18 @@ public class TTsLjplanTmplController extends BaseController
     {
         return toAjax(tTsLjplanTmplService.deleteTTsLjplanTmplByIds(ids));
     }
+
+    @Log(title = "附件上传", businessType = BusinessType.UPDATE)
+    @PostMapping("/uploadFile")
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, Long id) throws IOException {
+        if (!file.isEmpty()) {
+            String url = FileUploadUtils.upload(RuoYiConfig.getFilePath("/bccnew"), file);
+            TTsLjplanTmpl entity = tTsLjplanTmplService.selectTTsLjplanTmplById(id);
+            entity.setFileUrl(url);
+            entity.setFileName(file.getOriginalFilename());
+            tTsLjplanTmplService.updateTTsLjplanTmpl(entity);
+            return AjaxResult.success();
+        }
+        return AjaxResult.error("上传失败,请联系管理员");
+    }
 }

+ 44 - 29
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsYsplanController.java

@@ -1,24 +1,21 @@
 package com.ruoyi.project.training.bccnew.controller;
 
-import java.util.List;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.project.training.bccnew.domain.TTsYsplan;
-import com.ruoyi.project.training.bccnew.service.ITTsYsplanService;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.service.ISysUserService;
+import com.ruoyi.project.training.bccnew.domain.TTsNew;
+import com.ruoyi.project.training.bccnew.domain.TTsYsplan;
+import com.ruoyi.project.training.bccnew.service.ITTsNewService;
+import com.ruoyi.project.training.bccnew.service.ITTsYsplanService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  * 转岗培训Controller
@@ -28,17 +25,19 @@ import com.ruoyi.framework.web.page.TableDataInfo;
  */
 @RestController
 @RequestMapping("/bccnew/ysplandsdt")
-public class TTsYsplanController extends BaseController
-{
+public class TTsYsplanController extends BaseController {
     @Autowired
     private ITTsYsplanService tTsYsplanService;
+    @Autowired
+    private ITTsNewService tTsNewService;
+    @Autowired
+    private ISysUserService sysUserService;
 
     /**
      * 查询转岗培训列表
      */
     @GetMapping("/list")
-    public TableDataInfo list(TTsYsplan tTsYsplan)
-    {
+    public TableDataInfo list(TTsYsplan tTsYsplan) {
         startPage();
         List<TTsYsplan> list = tTsYsplanService.selectTTsYsplanList(tTsYsplan);
         return getDataTable(list);
@@ -49,8 +48,7 @@ public class TTsYsplanController extends BaseController
      */
     @Log(title = "转岗培训", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
-    public AjaxResult export(TTsYsplan tTsYsplan)
-    {
+    public AjaxResult export(TTsYsplan tTsYsplan) {
         List<TTsYsplan> list = tTsYsplanService.selectTTsYsplanList(tTsYsplan);
         ExcelUtil<TTsYsplan> util = new ExcelUtil<TTsYsplan>(TTsYsplan.class);
         return util.exportExcel(list, "ysplandsdt");
@@ -60,8 +58,7 @@ public class TTsYsplanController extends BaseController
      * 获取转岗培训详细信息
      */
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tTsYsplanService.selectTTsYsplanById(id));
     }
 
@@ -70,18 +67,37 @@ public class TTsYsplanController extends BaseController
      */
     @Log(title = "转岗培训", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TTsYsplan tTsYsplan)
-    {
+    public AjaxResult add(@RequestBody TTsYsplan tTsYsplan) {
         return toAjax(tTsYsplanService.insertTTsYsplan(tTsYsplan));
     }
 
+
+    @Log(title = "压缩培训", businessType = BusinessType.UPDATE)
+    @PutMapping("/updateYsLearnTime")
+    public AjaxResult updateYsLearnTime(@RequestBody TTsYsplan tTsYsplan) {
+        Long userId = getUserId();
+        TTsNew tTsNew = tTsNewService.selectTTsNewById(tTsYsplan.getNewId());
+        SysUser sysUser = sysUserService.selectUserByStaffId(tTsNew.getStaffId());
+        if (userId.equals(sysUser.getUserId())) {
+            TTsYsplan plan = new TTsYsplan();
+            plan.setId(tTsYsplan.getId());
+            long timer = tTsYsplan.getTimer() == null ? 0 : tTsYsplan.getTimer();
+            plan.setTimer(timer + 1);
+            TTsYsplan need = tTsYsplanService.selectTTsYsplanById(tTsYsplan.getId());
+            if (need.getTimerNeed() != null && need.getTimerNeed().equals(timer + 1)) {
+                plan.setPlanStatus(2L);
+            }
+            return toAjax(tTsYsplanService.updateTTsYsplan(plan));
+        }
+        return AjaxResult.error("当前登录用户非学习用户!");
+    }
+
     /**
      * 修改转岗培训
      */
     @Log(title = "转岗培训", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody TTsYsplan tTsYsplan)
-    {
+    public AjaxResult edit(@RequestBody TTsYsplan tTsYsplan) {
         return toAjax(tTsYsplanService.updateTTsYsplan(tTsYsplan));
     }
 
@@ -89,9 +105,8 @@ public class TTsYsplanController extends BaseController
      * 删除转岗培训
      */
     @Log(title = "转岗培训", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(tTsYsplanService.deleteTTsYsplanByIds(ids));
     }
 }

+ 21 - 8
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsYsplanTmplController.java

@@ -1,16 +1,14 @@
 package com.ruoyi.project.training.bccnew.controller;
 
+import java.io.IOException;
 import java.util.List;
+
+import com.ruoyi.common.utils.file.FileUploadUtils;
+import com.ruoyi.framework.config.RuoYiConfig;
+import com.ruoyi.project.training.bccnew.domain.TTsFlplanTmpl;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.project.training.bccnew.domain.TTsYsplanTmpl;
@@ -19,6 +17,7 @@ import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 压缩培训模版Controller
@@ -100,4 +99,18 @@ public class TTsYsplanTmplController extends BaseController
     {
         return toAjax(tTsYsplanTmplService.deleteTTsYsplanTmplByIds(ids));
     }
+
+    @Log(title = "附件上传", businessType = BusinessType.UPDATE)
+    @PostMapping("/uploadFile")
+    public AjaxResult uploadFile(@RequestParam("file") MultipartFile file, Long id) throws IOException {
+        if (!file.isEmpty()) {
+            String url = FileUploadUtils.upload(RuoYiConfig.getFilePath("/bccnew"), file);
+            TTsYsplanTmpl entity = tTsYsplanTmplService.selectTTsYsplanTmplById(id);
+            entity.setFileUrl(url);
+            entity.setFileName(file.getOriginalFilename());
+            tTsYsplanTmplService.updateTTsYsplanTmpl(entity);
+            return AjaxResult.success();
+        }
+        return AjaxResult.error("上传失败,请联系管理员");
+    }
 }

+ 76 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsFirstplan.java

@@ -94,10 +94,86 @@ public class TTsFirstplan extends BaseEntity
     @Excel(name = "培训状态")
     private Long planStatus;
 
+    /** 第一次成绩 */
+    @Excel(name = "第一次成绩")
+    private String score1;
+
+    /** 第二次成绩 */
+    @Excel(name = "第二次成绩")
+    private String score2;
+
+    /** 第三次成绩 */
+    @Excel(name = "第三次成绩")
+    private String score3;
+
     private String deptName;
 
     private String staffName;
 
+    private String fileUrl;
+
+    private String fileName;
+
+    private Long timer;
+
+    private Long timerNeed;
+
+    public String getScore1() {
+        return score1;
+    }
+
+    public void setScore1(String score1) {
+        this.score1 = score1;
+    }
+
+    public String getScore2() {
+        return score2;
+    }
+
+    public void setScore2(String score2) {
+        this.score2 = score2;
+    }
+
+    public String getScore3() {
+        return score3;
+    }
+
+    public void setScore3(String score3) {
+        this.score3 = score3;
+    }
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getTimer() {
+        return timer;
+    }
+
+    public void setTimer(Long timer) {
+        this.timer = timer;
+    }
+
+    public Long getTimerNeed() {
+        return timerNeed;
+    }
+
+    public void setTimerNeed(Long timerNeed) {
+        this.timerNeed = timerNeed;
+    }
+
     public String getStaffName() {
         return staffName;
     }

+ 30 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsFirstplanTmpl.java

@@ -94,6 +94,36 @@ public class TTsFirstplanTmpl extends BaseEntity
     @Excel(name = "备注")
     private String remarks;
 
+    private String fileUrl;
+
+    private String fileName;
+
+    private Long timerNeed;
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getTimerNeed() {
+        return timerNeed;
+    }
+
+    public void setTimerNeed(Long timerNeed) {
+        this.timerNeed = timerNeed;
+    }
+
     public void setId(Long id)
     {
         this.id = id;

+ 40 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsFlplan.java

@@ -110,6 +110,46 @@ public class TTsFlplan extends BaseEntity
 
     private String staffName;
 
+    private String fileUrl;
+
+    private String fileName;
+
+    private Long timer;
+
+    private Long timerNeed;
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getTimer() {
+        return timer;
+    }
+
+    public void setTimer(Long timer) {
+        this.timer = timer;
+    }
+
+    public Long getTimerNeed() {
+        return timerNeed;
+    }
+
+    public void setTimerNeed(Long timerNeed) {
+        this.timerNeed = timerNeed;
+    }
+
     public String getStaffName() {
         return staffName;
     }

+ 30 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsFlplanTmpl.java

@@ -94,6 +94,36 @@ public class TTsFlplanTmpl extends BaseEntity
     @Excel(name = "部门名称")
     private String deptName;
 
+    private String fileUrl;
+
+    private String fileName;
+
+    private Long timerNeed;
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getTimerNeed() {
+        return timerNeed;
+    }
+
+    public void setTimerNeed(Long timerNeed) {
+        this.timerNeed = timerNeed;
+    }
+
     public String getDeptName() {
         return deptName;
     }

+ 40 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsFtplan.java

@@ -110,6 +110,46 @@ public class TTsFtplan extends BaseEntity
 
     private String staffName;
 
+    private String fileUrl;
+
+    private String fileName;
+
+    private Long timer;
+
+    private Long timerNeed;
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getTimer() {
+        return timer;
+    }
+
+    public void setTimer(Long timer) {
+        this.timer = timer;
+    }
+
+    public Long getTimerNeed() {
+        return timerNeed;
+    }
+
+    public void setTimerNeed(Long timerNeed) {
+        this.timerNeed = timerNeed;
+    }
+
     public String getStaffName() {
         return staffName;
     }

+ 30 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsFtplanTmpl.java

@@ -94,6 +94,36 @@ public class TTsFtplanTmpl extends BaseEntity
     @Excel(name = "部门名称")
     private String deptName;
 
+    private String fileUrl;
+
+    private String fileName;
+
+    private Long timerNeed;
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getTimerNeed() {
+        return timerNeed;
+    }
+
+    public void setTimerNeed(Long timerNeed) {
+        this.timerNeed = timerNeed;
+    }
+
     public String getDeptName() {
         return deptName;
     }

+ 40 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsLjplan.java

@@ -110,6 +110,46 @@ public class TTsLjplan extends BaseEntity
 
     private String staffName;
 
+    private String fileUrl;
+
+    private String fileName;
+
+    private Long timer;
+
+    private Long timerNeed;
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getTimer() {
+        return timer;
+    }
+
+    public void setTimer(Long timer) {
+        this.timer = timer;
+    }
+
+    public Long getTimerNeed() {
+        return timerNeed;
+    }
+
+    public void setTimerNeed(Long timerNeed) {
+        this.timerNeed = timerNeed;
+    }
+
     public String getStaffName() {
         return staffName;
     }

+ 30 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsLjplanTmpl.java

@@ -94,6 +94,36 @@ public class TTsLjplanTmpl extends BaseEntity
     @Excel(name = "部门名称")
     private String deptName;
 
+    private String fileUrl;
+
+    private String fileName;
+
+    private Long timerNeed;
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getTimerNeed() {
+        return timerNeed;
+    }
+
+    public void setTimerNeed(Long timerNeed) {
+        this.timerNeed = timerNeed;
+    }
+
     public String getDeptName() {
         return deptName;
     }

+ 40 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsYsplan.java

@@ -110,6 +110,46 @@ public class TTsYsplan extends BaseEntity
 
     private String staffName;
 
+    private String fileUrl;
+
+    private String fileName;
+
+    private Long timer;
+
+    private Long timerNeed;
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getTimer() {
+        return timer;
+    }
+
+    public void setTimer(Long timer) {
+        this.timer = timer;
+    }
+
+    public Long getTimerNeed() {
+        return timerNeed;
+    }
+
+    public void setTimerNeed(Long timerNeed) {
+        this.timerNeed = timerNeed;
+    }
+
     public String getStaffName() {
         return staffName;
     }

+ 30 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/domain/TTsYsplanTmpl.java

@@ -94,6 +94,36 @@ public class TTsYsplanTmpl extends BaseEntity
     @Excel(name = "部门名称")
     private String deptName;
 
+    private String fileUrl;
+
+    private String fileName;
+
+    private Long timerNeed;
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getTimerNeed() {
+        return timerNeed;
+    }
+
+    public void setTimerNeed(Long timerNeed) {
+        this.timerNeed = timerNeed;
+    }
+
     public String getDeptName() {
         return deptName;
     }

+ 20 - 0
master/src/main/java/com/ruoyi/project/training/bccnew/service/impl/TTsNewServiceImpl.java

@@ -96,6 +96,10 @@ public class TTsNewServiceImpl implements ITTsNewService {
             tTsFirstplan.setCourseDate(tTsFirstplanTmpl.getCourseDate());
             tTsFirstplan.setAssess(tTsFirstplanTmpl.getAssess());
             tTsFirstplan.setPlanStatus(0L);
+            tTsFirstplan.setFileName(tTsFirstplanTmpl.getFileName());
+            tTsFirstplan.setFileUrl(tTsFirstplanTmpl.getFileUrl());
+            tTsFirstplan.setTimerNeed(tTsFirstplanTmpl.getTimerNeed());
+            tTsFirstplan.setTimer(0L);
             tTsFirstplanMapper.insertTTsFirstplan(tTsFirstplan);
         }
         if (tTsNew.getPlanType() == 1) {
@@ -111,6 +115,10 @@ public class TTsNewServiceImpl implements ITTsNewService {
                 entity.setCourseDate(item.getCourseDate());
                 entity.setAssess(item.getAssess());
                 entity.setNewId(tTsNew.getNewId());
+                entity.setFileName(item.getFileName());
+                entity.setFileUrl(item.getFileUrl());
+                entity.setTimerNeed(item.getTimerNeed());
+                entity.setTimer(0L);
                 tTsLjplanMapper.insertTTsLjplan(entity);
             }
         } else if (tTsNew.getPlanType() == 2) {
@@ -126,6 +134,10 @@ public class TTsNewServiceImpl implements ITTsNewService {
                 entity.setCourseDate(item.getCourseDate());
                 entity.setAssess(item.getAssess());
                 entity.setNewId(tTsNew.getNewId());
+                entity.setFileName(item.getFileName());
+                entity.setFileUrl(item.getFileUrl());
+                entity.setTimerNeed(item.getTimerNeed());
+                entity.setTimer(0L);
                 tTsYsplanMapper.insertTTsYsplan(entity);
             }
         } else if (tTsNew.getPlanType() == 3) {
@@ -141,6 +153,10 @@ public class TTsNewServiceImpl implements ITTsNewService {
                 entity.setCourseDate(item.getCourseDate());
                 entity.setAssess(item.getAssess());
                 entity.setNewId(tTsNew.getNewId());
+                entity.setFileName(item.getFileName());
+                entity.setFileUrl(item.getFileUrl());
+                entity.setTimerNeed(item.getTimerNeed());
+                entity.setTimer(0L);
                 tTsFlplanMapper.insertTTsFlplan(entity);
             }
         } else if (tTsNew.getPlanType() == 4) {
@@ -156,6 +172,10 @@ public class TTsNewServiceImpl implements ITTsNewService {
                 entity.setCourseDate(item.getCourseDate());
                 entity.setAssess(item.getAssess());
                 entity.setNewId(tTsNew.getNewId());
+                entity.setFileName(item.getFileName());
+                entity.setFileUrl(item.getFileUrl());
+                entity.setTimerNeed(item.getTimerNeed());
+                entity.setTimer(0L);
                 tTsFtplanMapper.insertTTsFtplan(entity);
             }
         }

+ 29 - 1
master/src/main/resources/mybatis/training/bccnew/TTsFirstplanMapper.xml

@@ -25,10 +25,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="remarks"    column="remarks"    />
         <result property="planStatus"    column="plan_status"    />
         <result property="deptName" column="dept_name" />
+        <result property="fileUrl" column="file_url" />
+        <result property="fileName" column="file_name" />
+        <result property="timer" column="timer" />
+        <result property="timerNeed" column="timer_need" />
+        <result property="score1"    column="score_1"    />
+        <result property="score2"    column="score_2"    />
+        <result property="score3"    column="score_3"    />
     </resultMap>
 
     <sql id="selectTTsFirstplanVo">
-        select d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.course_type, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.plan_status ,s.dept_name from t_ts_firstplan d
+        select d.file_url,d.file_name,d.timer,d.timer_need,d.score_1, d.score_2, d.score_3 ,d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.course_type, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.plan_status ,s.dept_name from t_ts_firstplan d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -105,6 +112,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">dept_id,</if>
             <if test="remarks != null">remarks,</if>
             <if test="planStatus != null">plan_status,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="timer != null">timer,</if>
+            <if test="timerNeed != null">timer_need,</if>
+            <if test="score1 != null">score_1,</if>
+            <if test="score2 != null">score_2,</if>
+            <if test="score3 != null">score_3,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -126,6 +140,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">#{deptId},</if>
             <if test="remarks != null">#{remarks},</if>
             <if test="planStatus != null">#{planStatus},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="timer != null">#{timer},</if>
+            <if test="timerNeed != null">#{timerNeed},</if>
+            <if test="score1 != null">#{score1},</if>
+            <if test="score2 != null">#{score2},</if>
+            <if test="score3 != null">#{score3},</if>
          </trim>
     </insert>
 
@@ -150,6 +171,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
             <if test="planStatus != null">plan_status = #{planStatus},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="timer != null">timer = #{timer},</if>
+            <if test="timerNeed != null">timer_need = #{timerNeed},</if>
+            <if test="score1 != null">score_1 = #{score1},</if>
+            <if test="score2 != null">score_2 = #{score2},</if>
+            <if test="score3 != null">score_3 = #{score3},</if>
         </trim>
         where id = #{id}
     </update>

+ 13 - 1
master/src/main/resources/mybatis/training/bccnew/TTsFirstplanTmplMapper.xml

@@ -24,10 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptId"    column="dept_id"    />
         <result property="remarks"    column="remarks"    />
         <result property="deptName" column="dept_name" />
+        <result property="fileUrl" column="file_url" />
+        <result property="fileName" column="file_name" />
+        <result property="timerNeed" column="timer_need" />
     </resultMap>
 
     <sql id="selectTTsFirstplanTmplVo">
-        select d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.course_type, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_ts_firstplan_tmpl d
+        select d.file_url,d.file_name,d.timer_need,d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.course_type, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_ts_firstplan_tmpl d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -85,6 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate,</if>
             <if test="deptId != null">dept_id,</if>
             <if test="remarks != null">remarks,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="timerNeed != null">timer_need,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -105,6 +111,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">#{updatedate},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="remarks != null">#{remarks},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="timerNeed != null">#{timerNeed},</if>
          </trim>
     </insert>
 
@@ -128,6 +137,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate = #{updatedate},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="timerNeed != null">timer_need = #{timerNeed},</if>
         </trim>
         where id = #{id}
     </update>

+ 17 - 1
master/src/main/resources/mybatis/training/bccnew/TTsFlplanMapper.xml

@@ -28,10 +28,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="score2"    column="score_2"    />
         <result property="score3"    column="score_3"    />
         <result property="deptName" column="dept_name" />
+        <result property="fileUrl" column="file_url" />
+        <result property="fileName" column="file_name" />
+        <result property="timer" column="timer" />
+        <result property="timerNeed" column="timer_need" />
     </resultMap>
 
     <sql id="selectTTsFlplanVo">
-        select d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.plan_status, d.score_1, d.score_2, d.score_3 ,s.dept_name from t_ts_flplan d
+        select d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.plan_status, d.score_1, d.score_2, d.score_3 ,d.file_url,d.file_name,d.timer,d.timer_need,s.dept_name from t_ts_flplan d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -114,6 +118,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="score1 != null">score_1,</if>
             <if test="score2 != null">score_2,</if>
             <if test="score3 != null">score_3,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="timer != null">timer,</if>
+            <if test="timerNeed != null">timer_need,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -138,6 +146,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="score1 != null">#{score1},</if>
             <if test="score2 != null">#{score2},</if>
             <if test="score3 != null">#{score3},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="timer != null">#{timer},</if>
+            <if test="timerNeed != null">#{timerNeed},</if>
          </trim>
     </insert>
 
@@ -165,6 +177,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="score1 != null">score_1 = #{score1},</if>
             <if test="score2 != null">score_2 = #{score2},</if>
             <if test="score3 != null">score_3 = #{score3},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="timer != null">timer = #{timer},</if>
+            <if test="timerNeed != null">timer_need = #{timerNeed},</if>
         </trim>
         where id = #{id}
     </update>

+ 13 - 1
master/src/main/resources/mybatis/training/bccnew/TTsFlplanTmplMapper.xml

@@ -24,10 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptId"    column="dept_id"    />
         <result property="remarks"    column="remarks"    />
         <result property="deptName" column="dept_name" />
+        <result property="fileUrl" column="file_url" />
+        <result property="fileName" column="file_name" />
+        <result property="timerNeed" column="timer_need" />
     </resultMap>
 
     <sql id="selectTTsFlplanTmplVo">
-        select d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_ts_flplan_tmpl d
+        select d.file_url,d.file_name,d.timer_need,d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_ts_flplan_tmpl d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -85,6 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate,</if>
             <if test="deptId != null">dept_id,</if>
             <if test="remarks != null">remarks,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="timerNeed != null">timer_need,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -105,6 +111,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">#{updatedate},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="remarks != null">#{remarks},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="timerNeed != null">#{timerNeed},</if>
          </trim>
     </insert>
 
@@ -128,6 +137,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate = #{updatedate},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="timerNeed != null">timer_need = #{timerNeed},</if>
         </trim>
         where id = #{id}
     </update>

+ 17 - 1
master/src/main/resources/mybatis/training/bccnew/TTsFtplanMapper.xml

@@ -28,10 +28,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="score2"    column="score_2"    />
         <result property="score3"    column="score_3"    />
         <result property="deptName" column="dept_name" />
+        <result property="fileUrl" column="file_url" />
+        <result property="fileName" column="file_name" />
+        <result property="timer" column="timer" />
+        <result property="timerNeed" column="timer_need" />
     </resultMap>
 
     <sql id="selectTTsFtplanVo">
-        select d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.plan_status, d.score_1, d.score_2, d.score_3 ,s.dept_name from t_ts_ftplan d
+        select d.file_url,d.file_name,d.timer,d.timer_need,d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.plan_status, d.score_1, d.score_2, d.score_3 ,s.dept_name from t_ts_ftplan d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -113,6 +117,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="score1 != null">score_1,</if>
             <if test="score2 != null">score_2,</if>
             <if test="score3 != null">score_3,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="timer != null">timer,</if>
+            <if test="timerNeed != null">timer_need,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -137,6 +145,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="score1 != null">#{score1},</if>
             <if test="score2 != null">#{score2},</if>
             <if test="score3 != null">#{score3},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="timer != null">#{timer},</if>
+            <if test="timerNeed != null">#{timerNeed},</if>
          </trim>
     </insert>
 
@@ -164,6 +176,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="score1 != null">score_1 = #{score1},</if>
             <if test="score2 != null">score_2 = #{score2},</if>
             <if test="score3 != null">score_3 = #{score3},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="timer != null">timer = #{timer},</if>
+            <if test="timerNeed != null">timer_need = #{timerNeed},</if>
         </trim>
         where id = #{id}
     </update>

+ 13 - 1
master/src/main/resources/mybatis/training/bccnew/TTsFtplanTmplMapper.xml

@@ -24,10 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptId"    column="dept_id"    />
         <result property="remarks"    column="remarks"    />
         <result property="deptName" column="dept_name" />
+        <result property="fileUrl" column="file_url" />
+        <result property="fileName" column="file_name" />
+        <result property="timerNeed" column="timer_need" />
     </resultMap>
 
     <sql id="selectTTsFtplanTmplVo">
-        select d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_ts_ftplan_tmpl d
+        select d.file_url,d.file_name,d.timer_need,d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_ts_ftplan_tmpl d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -85,6 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate,</if>
             <if test="deptId != null">dept_id,</if>
             <if test="remarks != null">remarks,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="timerNeed != null">timer_need,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -105,6 +111,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">#{updatedate},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="remarks != null">#{remarks},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="timerNeed != null">#{timerNeed},</if>
          </trim>
     </insert>
 
@@ -128,6 +137,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate = #{updatedate},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="timerNeed != null">timer_need = #{timerNeed},</if>
         </trim>
         where id = #{id}
     </update>

+ 17 - 1
master/src/main/resources/mybatis/training/bccnew/TTsLjplanMapper.xml

@@ -28,10 +28,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="score2"    column="score_2"    />
         <result property="score3"    column="score_3"    />
         <result property="deptName" column="dept_name" />
+        <result property="fileUrl" column="file_url" />
+        <result property="fileName" column="file_name" />
+        <result property="timer" column="timer" />
+        <result property="timerNeed" column="timer_need" />
     </resultMap>
 
     <sql id="selectTTsLjplanVo">
-        select d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.plan_status, d.score_1, d.score_2, d.score_3 ,s.dept_name from t_ts_ljplan d
+        select d.file_url,d.file_name,d.timer,d.timer_need,d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.plan_status, d.score_1, d.score_2, d.score_3 ,s.dept_name from t_ts_ljplan d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -113,6 +117,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="score1 != null">score_1,</if>
             <if test="score2 != null">score_2,</if>
             <if test="score3 != null">score_3,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="timer != null">timer,</if>
+            <if test="timerNeed != null">timer_need,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -137,6 +145,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="score1 != null">#{score1},</if>
             <if test="score2 != null">#{score2},</if>
             <if test="score3 != null">#{score3},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="timer != null">#{timer},</if>
+            <if test="timerNeed != null">#{timerNeed},</if>
          </trim>
     </insert>
 
@@ -164,6 +176,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="score1 != null">score_1 = #{score1},</if>
             <if test="score2 != null">score_2 = #{score2},</if>
             <if test="score3 != null">score_3 = #{score3},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="timer != null">timer = #{timer},</if>
+            <if test="timerNeed != null">timer_need = #{timerNeed},</if>
         </trim>
         where id = #{id}
     </update>

+ 13 - 1
master/src/main/resources/mybatis/training/bccnew/TTsLjplanTmplMapper.xml

@@ -24,10 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptId"    column="dept_id"    />
         <result property="remarks"    column="remarks"    />
         <result property="deptName" column="dept_name" />
+        <result property="fileUrl" column="file_url" />
+        <result property="fileName" column="file_name" />
+        <result property="timerNeed" column="timer_need" />
     </resultMap>
 
     <sql id="selectTTsLjplanTmplVo">
-        select d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_ts_ljplan_tmpl d
+        select d.file_url,d.file_name,d.timer_need,d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_ts_ljplan_tmpl d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -85,6 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate,</if>
             <if test="deptId != null">dept_id,</if>
             <if test="remarks != null">remarks,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="timerNeed != null">timer_need,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -105,6 +111,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">#{updatedate},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="remarks != null">#{remarks},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="timerNeed != null">#{timerNeed},</if>
          </trim>
     </insert>
 
@@ -128,6 +137,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate = #{updatedate},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="timerNeed != null">timer_need = #{timerNeed},</if>
         </trim>
         where id = #{id}
     </update>

+ 17 - 1
master/src/main/resources/mybatis/training/bccnew/TTsYsplanMapper.xml

@@ -28,10 +28,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="score2"    column="score_2"    />
         <result property="score3"    column="score_3"    />
         <result property="deptName" column="dept_name" />
+        <result property="fileUrl" column="file_url" />
+        <result property="fileName" column="file_name" />
+        <result property="timer" column="timer" />
+        <result property="timerNeed" column="timer_need" />
     </resultMap>
 
     <sql id="selectTTsYsplanVo">
-        select d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.plan_status, d.score_1, d.score_2, d.score_3 ,s.dept_name from t_ts_ysplan d
+        select d.file_url,d.file_name,d.timer,d.timer_need,d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.plan_status, d.score_1, d.score_2, d.score_3 ,s.dept_name from t_ts_ysplan d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -113,6 +117,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="score1 != null">score_1,</if>
             <if test="score2 != null">score_2,</if>
             <if test="score3 != null">score_3,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="timer != null">timer,</if>
+            <if test="timerNeed != null">timer_need,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -137,6 +145,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="score1 != null">#{score1},</if>
             <if test="score2 != null">#{score2},</if>
             <if test="score3 != null">#{score3},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="timer != null">#{timer},</if>
+            <if test="timerNeed != null">#{timerNeed},</if>
          </trim>
     </insert>
 
@@ -164,6 +176,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="score1 != null">score_1 = #{score1},</if>
             <if test="score2 != null">score_2 = #{score2},</if>
             <if test="score3 != null">score_3 = #{score3},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="timer != null">timer = #{timer},</if>
+            <if test="timerNeed != null">timer_need = #{timerNeed},</if>
         </trim>
         where id = #{id}
     </update>

+ 13 - 1
master/src/main/resources/mybatis/training/bccnew/TTsYsplanTmplMapper.xml

@@ -24,10 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptId"    column="dept_id"    />
         <result property="remarks"    column="remarks"    />
         <result property="deptName" column="dept_name" />
+        <result property="fileUrl" column="file_url" />
+        <result property="fileName" column="file_name" />
+        <result property="timerNeed" column="timer_need" />
     </resultMap>
 
     <sql id="selectTTsYsplanTmplVo">
-        select d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_ts_ysplan_tmpl d
+        select d.file_url,d.file_name,d.timer_need,d.id, d.new_id, d.course_code, d.topic, d.content, d.course_day, d.course_hour, d.detail_plan, d.trainer, d.course_date, d.assess, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks ,s.dept_name from t_ts_ysplan_tmpl d
       left join sys_dept s on s.dept_id = d.dept_id
     </sql>
 
@@ -85,6 +88,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate,</if>
             <if test="deptId != null">dept_id,</if>
             <if test="remarks != null">remarks,</if>
+            <if test="fileUrl != null">file_url,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="timerNeed != null">timer_need,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -105,6 +111,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">#{updatedate},</if>
             <if test="deptId != null">#{deptId},</if>
             <if test="remarks != null">#{remarks},</if>
+            <if test="fileUrl != null">#{fileUrl},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="timerNeed != null">#{timerNeed},</if>
          </trim>
     </insert>
 
@@ -128,6 +137,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updatedate != null">updatedate = #{updatedate},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="fileUrl != null">file_url = #{fileUrl},</if>
+            <if test="fileName != null">file_name = #{fileName},</if>
+            <if test="timerNeed != null">timer_need = #{timerNeed},</if>
         </trim>
         where id = #{id}
     </update>

+ 10 - 1
ui/src/api/training/bccnew/firstplan.js

@@ -35,6 +35,15 @@ export function updateFirstplan(data) {
   })
 }
 
+// 修改进组培训
+export function updateFirstLearnTime(data) {
+  return request({
+    url: '/bccnew/firstplan/updateFirstLearnTime',
+    method: 'put',
+    data: data
+  })
+}
+
 // 删除进组培训
 export function delFirstplan(id) {
   return request({
@@ -50,4 +59,4 @@ export function exportFirstplan(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 10 - 1
ui/src/api/training/bccnew/flplandsdt.js

@@ -35,6 +35,15 @@ export function updateFlplandsdt(data) {
   })
 }
 
+// 修改分离培训
+export function updateFlLearnTime(data) {
+  return request({
+    url: '/bccnew/flplandsdt/updateFlLearnTime',
+    method: 'put',
+    data: data
+  })
+}
+
 // 删除分离培训
 export function delFlplandsdt(id) {
   return request({
@@ -50,4 +59,4 @@ export function exportFlplandsdt(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 10 - 1
ui/src/api/training/bccnew/ftplandsdt.js

@@ -35,6 +35,15 @@ export function updateFtplandsdt(data) {
   })
 }
 
+// 修改芳烃培训
+export function updateFtLearnTime(data) {
+  return request({
+    url: '/bccnew/ftplandsdt/updateFtLearnTime',
+    method: 'put',
+    data: data
+  })
+}
+
 // 删除芳烃培训
 export function delFtplandsdt(id) {
   return request({
@@ -50,4 +59,4 @@ export function exportFtplandsdt(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 11 - 1
ui/src/api/training/bccnew/ljplandsdt.js

@@ -35,6 +35,16 @@ export function updateLjplandsdt(data) {
   })
 }
 
+
+// 修改裂解培训
+export function updateLjLearnTime(data) {
+  return request({
+    url: '/bccnew/ljplandsdt/updateLjLearnTime',
+    method: 'put',
+    data: data
+  })
+}
+
 // 删除裂解培训
 export function delLjplandsdt(id) {
   return request({
@@ -50,4 +60,4 @@ export function exportLjplandsdt(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 10 - 1
ui/src/api/training/bccnew/ysplandsdt.js

@@ -35,6 +35,15 @@ export function updateYsplandsdt(data) {
   })
 }
 
+// 修改转岗培训
+export function updateYsLearnTime(data) {
+  return request({
+    url: '/bccnew/ysplandsdt/updateYsLearnTime',
+    method: 'put',
+    data: data
+  })
+}
+
 // 删除转岗培训
 export function delYsplandsdt(id) {
   return request({
@@ -50,4 +59,4 @@ export function exportYsplandsdt(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 318 - 291
ui/src/views/training/bccnew/firstPlanTmpl/index.vue

@@ -1,15 +1,6 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="培训员工编号" prop="newId">
-        <el-input
-          v-model="queryParams.newId"
-          placeholder="请输入培训员工编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item label="课程编号" prop="courseCode">
         <el-input
           v-model="queryParams.courseCode"
@@ -28,29 +19,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="培训天" prop="courseDay">
-        <el-input
-          v-model="queryParams.courseDay"
-          placeholder="请输入培训天"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="培训小时" prop="courseHour">
-        <el-input
-          v-model="queryParams.courseHour"
-          placeholder="请输入培训小时"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="培训类型" prop="courseType">
-        <el-select v-model="queryParams.courseType" placeholder="请选择培训类型" clearable size="small">
-          <el-option label="请选择字典生成" value="" />
-        </el-select>
-      </el-form-item>
       <el-form-item label="讲师" prop="trainer">
         <el-input
           v-model="queryParams.trainer"
@@ -60,75 +28,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="培训日期" prop="courseDate">
-        <el-date-picker clearable size="small" style="width: 200px"
-          v-model="queryParams.courseDate"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择培训日期">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="考核情况" prop="assess">
-        <el-input
-          v-model="queryParams.assess"
-          placeholder="请输入考核情况"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建人" prop="createrCode">
-        <el-input
-          v-model="queryParams.createrCode"
-          placeholder="请输入创建人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建时间" prop="createdate">
-        <el-date-picker clearable size="small" style="width: 200px"
-          v-model="queryParams.createdate"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择创建时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改人" prop="updaterCode">
-        <el-input
-          v-model="queryParams.updaterCode"
-          placeholder="请输入修改人"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="修改时间" prop="updatedate">
-        <el-date-picker clearable size="small" style="width: 200px"
-          v-model="queryParams.updatedate"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择修改时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="部门编号" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门编号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="备注" prop="remarks">
-        <el-input
-          v-model="queryParams.remarks"
-          placeholder="请输入备注"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item>
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -143,7 +42,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['bccnew:firstPlanTmpl:add']"
-        >新增</el-button>
+        >新增
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -153,7 +53,8 @@
           :disabled="single"
           @click="handleUpdate"
           v-hasPermi="['bccnew:firstPlanTmpl:edit']"
-        >修改</el-button>
+        >修改
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -163,17 +64,19 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['bccnew:firstPlanTmpl:remove']"
-        >删除</el-button>
+        >删除
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="info"
+          icon="el-icon-upload2"
+          size="mini"
+          @click="handleImport"
+          v-hasPermi="['bccnew:firstPlanTmpl:edit']"
+        >导入
+        </el-button>
       </el-col>
-        <el-col :span="1.5">
-            <el-button
-                    type="info"
-                    icon="el-icon-upload2"
-                    size="mini"
-                    @click="handleImport"
-                    v-hasPermi="['bccnew:firstPlanTmpl:edit']"
-            >导入</el-button>
-        </el-col>
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -181,14 +84,15 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['bccnew:firstPlanTmpl:export']"
-        >导出</el-button>
+        >导出
+        </el-button>
       </el-col>
-	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="firstPlanTmplList" @selection-change="handleSelectionChange" :height="clientHeight" border>
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="唯一标识ID" align="center" prop="id" :show-overflow-tooltip="true"/>
+    <el-table v-loading="loading" :data="firstPlanTmplList" @selection-change="handleSelectionChange"
+              :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="培训员工编号" align="center" prop="newId" :show-overflow-tooltip="true"/>
       <el-table-column label="课程编号" align="center" prop="courseCode" :show-overflow-tooltip="true"/>
       <el-table-column label="培训主题" align="center" prop="topic" :show-overflow-tooltip="true"/>
@@ -203,19 +107,6 @@
         </template>
       </el-table-column>
       <el-table-column label="考核情况" align="center" prop="assess" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建人" align="center" prop="createrCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="创建时间" align="center" prop="createdate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改人" align="center" prop="updaterCode" :show-overflow-tooltip="true"/>
-      <el-table-column label="修改时间" align="center" prop="updatedate" width="100">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updatedate, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="部门编号" align="center" prop="deptId" :show-overflow-tooltip="true"/>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -225,14 +116,23 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['bccnew:firstPlanTmpl:edit']"
-          >修改</el-button>
+          >修改
+          </el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['bccnew:firstPlanTmpl:remove']"
-          >删除</el-button>
+          >删除
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-folder"
+            @click="doc.open=true"
+            v-hasPermi="['newstaff:tnNew:edit']"
+          >学习资料</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -249,129 +149,212 @@
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="培训员工编号" prop="newId">
-          <el-input v-model="form.newId" placeholder="请输入培训员工编号" />
+          <el-input v-model="form.newId" placeholder="请输入培训员工编号"/>
         </el-form-item>
         <el-form-item label="课程编号" prop="courseCode">
-          <el-input v-model="form.courseCode" placeholder="请输入课程编号" />
+          <el-input v-model="form.courseCode" placeholder="请输入课程编号"/>
         </el-form-item>
         <el-form-item label="培训主题" prop="topic">
-          <el-input v-model="form.topic" placeholder="请输入培训主题" />
+          <el-input v-model="form.topic" placeholder="请输入培训主题"/>
         </el-form-item>
         <el-form-item label="培训内容">
           <el-input v-model="form.content" placeholder="请输入培训内容"/>
         </el-form-item>
         <el-form-item label="培训天" prop="courseDay">
-          <el-input v-model="form.courseDay" placeholder="请输入培训天" />
+          <el-input v-model="form.courseDay" placeholder="请输入培训天"/>
         </el-form-item>
         <el-form-item label="培训小时" prop="courseHour">
-          <el-input v-model="form.courseHour" placeholder="请输入培训小时" />
+          <el-input v-model="form.courseHour" placeholder="请输入培训小时"/>
         </el-form-item>
         <el-form-item label="培训类型" prop="courseType">
-          <el-select v-model="form.courseType" placeholder="请选择培训类型">
-            <el-option label="请选择字典生成" value="" />
-          </el-select>
+          <el-input v-model="form.courseType" placeholder="请输入培训类型"/>
         </el-form-item>
         <el-form-item label="讲师" prop="trainer">
-          <el-input v-model="form.trainer" placeholder="请输入讲师" />
+          <el-input v-model="form.trainer" placeholder="请输入讲师"/>
         </el-form-item>
         <el-form-item label="培训日期" prop="courseDate">
           <el-date-picker clearable size="small" style="width: 200px"
-            v-model="form.courseDate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择培训日期">
+                          v-model="form.courseDate"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="选择培训日期">
           </el-date-picker>
         </el-form-item>
         <el-form-item label="考核情况" prop="assess">
-          <el-input v-model="form.assess" placeholder="请输入考核情况" />
-        </el-form-item>
-        <el-form-item label="删除状态" prop="delFlag">
-          <el-input v-model="form.delFlag" placeholder="请输入删除状态" />
-        </el-form-item>
-        <el-form-item label="创建人" prop="createrCode">
-          <el-input v-model="form.createrCode" placeholder="请输入创建人" />
-        </el-form-item>
-        <el-form-item label="创建时间" prop="createdate">
-          <el-date-picker clearable size="small" style="width: 200px"
-            v-model="form.createdate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择创建时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="修改人" prop="updaterCode">
-          <el-input v-model="form.updaterCode" placeholder="请输入修改人" />
-        </el-form-item>
-        <el-form-item label="修改时间" prop="updatedate">
-          <el-date-picker clearable size="small" style="width: 200px"
-            v-model="form.updatedate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择修改时间">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="部门编号" prop="deptId">
-          <el-input v-model="form.deptId" placeholder="请输入部门编号" />
+          <el-input v-model="form.assess" placeholder="请输入考核情况"/>
         </el-form-item>
         <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注" />
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
         </el-form-item>
-          <el-form-item label="归属部门" prop="deptId">
-              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
-          </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
-      <!-- 用户导入对话框 -->
-      <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
-          <el-upload
-                  ref="upload"
-                  :limit="1"
-                  accept=".xlsx, .xls"
-                  :headers="upload.headers"
-                  :action="upload.url + '?updateSupport=' + upload.updateSupport"
-                  :disabled="upload.isUploading"
-                  :on-progress="handleFileUploadProgress"
-                  :on-success="handleFileSuccess"
-                  :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">
-                  <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
-                  <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
-              </div>
-              <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
-          </el-upload>
-          <div slot="footer" class="dialog-footer">
-              <el-button type="primary" @click="submitFileForm">确 定</el-button>
-              <el-button @click="upload.open = false">取 消</el-button>
-          </div>
+    <!-- 用户导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :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">
+          <el-checkbox v-model="upload.updateSupport"/>
+          是否更新已经存在的用户数据
+          <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+        </div>
+        <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
+
+    <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="1000px" append-to-body >
+      <el-upload v-hasPermi="['training:trainingrecords:file']"
+                 ref="doc"
+                 :limit="50"
+                 :headers="doc.headers"
+                 :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
+                 :disabled="doc.isUploading"
+                 :on-progress="handleFileDocProgress"
+                 :on-success="handleFileDocSuccess"
+                 :auto-upload="true"
+                 drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          {{ $t('将文件拖到此处,或') }}
+          <em>{{ $t('点击上传') }}</em>
+        </div>
+      </el-upload>
+      <el-table :data="doc.commonfileList" border>
+        <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <a  class="link-type"  @click="handleDownload(scope.row)">
+              <span>{{ scope.row.fileName }}</span>
+            </a>
+          </template>
+        </el-table-column>
+        <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
+        <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
+        <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              v-if="scope.row.fileName.endsWith('pdf')"
+              size="mini"
+              type="text"
+              icon="el-icon-view"
+              @click="handleSee(scope.row)"
+            >{{ $t('预览') }}</el-button>
+            <el-button v-hasPermi="['training:trainingrecords:file']"  type="text" size="small" v-if="scope.row.isEdit" @click="save(scope.row)">保存</el-button>
+            <el-button type="text" size="small" v-if="scope.row.isEdit" @click="cancelFile(scope.row, scope.$index)">取消</el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-download"
+              @click="handleDownload(scope.row)"
+            >{{ $t('下载') }}</el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDeleteDoc(scope.row)"
+              v-hasPermi="['training:trainingrecords:file']"
+            >{{ $t('删除') }}</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" append-to-body>
+        <div style="margin-top: -60px;float: right;margin-right: 40px;">
+          <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
+        <div style="margin-top: -30px">
+          <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
+        </div>
       </el-dialog>
+
+      <div slot="footer" class="dialog-footer">
+        <!--        <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
+        <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
-import { listFirstPlanTmpl, getFirstPlanTmpl, delFirstPlanTmpl, addFirstPlanTmpl, updateFirstPlanTmpl, exportFirstPlanTmpl, importTemplate} from "@/api/training/bccnew/firstPlanTmpl";
-import { treeselect } from "@/api/system/dept";
-import { getToken } from "@/utils/auth";
+import {
+  addFirstPlanTmpl,
+  delFirstPlanTmpl,
+  exportFirstPlanTmpl,
+  getFirstPlanTmpl,
+  importTemplate,
+  listFirstPlanTmpl,
+  updateFirstPlanTmpl
+} from "@/api/training/bccnew/firstPlanTmpl";
+import {treeselect} from "@/api/system/dept";
+import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import Editor from '@/components/Editor';
+import {delCommonfile} from "@/api/common/commonfile";
 
 export default {
   name: "FirstPlanTmpl",
-  components: { Treeselect },
+  components: {Treeselect},
   // components: { Editor },
   data() {
     return {
+
+      // 报告附件参数
+      doc: {
+        file: "",
+        // 是否显示弹出层(报告附件)
+        open: false,
+        // 弹出层标题(报告附件)
+        title: "附件",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 报告附件上传位置编号
+        ids: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/bccnew/firstPlanTmpl/uploadFile",
+        commonfileList: null,
+        queryParams: {
+          pId: null,
+          pType: 'bccnew'
+        },
+        pType: 'bccnew',
+        pId: null,
+        form: {}
+      },
+      pdf : {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+      },
       // 遮罩层
       loading: true,
       // 选中数组
@@ -390,24 +373,24 @@ export default {
       title: "",
       // 部门树选项
       deptOptions: undefined,
-      clientHeight:300,
+      clientHeight: 300,
       // 是否显示弹出层
       open: false,
-        // 用户导入参数
-        upload: {
-            // 是否显示弹出层(用户导入)
-            open: false,
-            // 弹出层标题(用户导入)
-            title: "",
-            // 是否禁用上传
-            isUploading: false,
-            // 是否更新已经存在的用户数据
-            updateSupport: 0,
-            // 设置上传的请求头部
-            headers: { Authorization: "Bearer " + getToken() },
-            // 上传的地址
-            url: process.env.VUE_APP_BASE_API + "/bccnew/firstPlanTmpl/importData"
-        },
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/bccnew/firstPlanTmpl/importData"
+      },
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -432,25 +415,69 @@ export default {
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-      }
+      rules: {}
     };
   },
   watch: {
-        // 根据名称筛选部门树
-        deptName(val) {
-            this.$refs.tree.filter(val);
-        }
-   },
+    // 根据名称筛选部门树
+    deptName(val) {
+      this.$refs.tree.filter(val);
+    }
+  },
   created() {
-      //设置表格高度对应屏幕高度
-      this.$nextTick(() => {
-          this.clientHeight = document.body.clientHeight -250
-      })
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = document.body.clientHeight - 250
+    })
     this.getList();
     this.getTreeselect();
   },
   methods: {
+    // 文件下载处理
+    handleDownload(row) {
+      var name = row.fileName;
+      var url = row.fileUrl;
+      var suffix = url.substring(url.lastIndexOf("."), url.length);
+      const a = document.createElement('a')
+      a.setAttribute('download', name)
+      a.setAttribute('target', '_blank')
+      a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+      a.click()
+    },
+    openPdf(){
+      window.open(this.pdf.pdfUrl);//path是文件的全路径地址
+    },
+    handleSee (row){
+      // window.open(process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl);//path是文件的全路径地址
+      this.pdf.open =true
+      this.pdf.title = row.fileName
+      this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
+    },
+    /** 删除按钮操作 */
+    handleDeleteDoc(row) {
+      const ids = row.id || this.ids;
+      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function() {
+        return delCommonfile(ids);
+      }).then(() => {
+        this.getFileList()
+        this.msgSuccess(this.$t('删除成功'));
+      })
+    },
+    // 上传中处理
+    handleFileDocProgress(event, file, fileList) {
+      this.doc.file = file;
+      this.doc.isUploading = true;
+    },
+    //附件上传成功处理
+    handleFileDocSuccess(response, file, fileList) {
+      this.doc.isUploading = false;
+      this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+      this.getFileList()
+    },
     /** 查询进组培训模版列表 */
     getList() {
       this.loading = true;
@@ -460,12 +487,12 @@ export default {
         this.loading = false;
       });
     },
-     /** 查询部门下拉树结构 */
-     getTreeselect() {
-          treeselect().then(response => {
-              this.deptOptions = response.data;
-          });
-     },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -508,7 +535,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
@@ -551,56 +578,56 @@ export default {
     handleDelete(row) {
       const ids = row.id || this.ids;
       this.$confirm('是否确认删除?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delFirstPlanTmpl(ids);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        })
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delFirstPlanTmpl(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      })
     },
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有进组培训模版数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportFirstPlanTmpl(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-        })
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return exportFirstPlanTmpl(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      })
     },
-      /** 导入按钮操作 */
-      handleImport() {
-          this.upload.title = "用户导入";
-          this.upload.open = true;
-      },
-      /** 下载模板操作 */
-      importTemplate() {
-          importTemplate().then(response => {
-              this.download(response.msg);
-          });
-      },
-      // 文件上传中处理
-      handleFileUploadProgress(event, file, fileList) {
-          this.upload.isUploading = true;
-      },
-      // 文件上传成功处理
-      handleFileSuccess(response, file, fileList) {
-          this.upload.open = false;
-          this.upload.isUploading = false;
-          this.$refs.upload.clearFiles();
-          this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
-          this.getList();
-      },
-      // 提交上传文件
-      submitFileForm() {
-          this.$refs.upload.submit();
-      }
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "用户导入";
+      this.upload.open = true;
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      importTemplate().then(response => {
+        this.download(response.msg);
+      });
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      this.getList();
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    }
   }
 };
 </script>

+ 280 - 152
ui/src/views/training/bccnew/firstplan/index.vue

@@ -48,7 +48,7 @@
       </el-form-item>
       <el-form-item label="培训类型" prop="courseType">
         <el-select v-model="queryParams.courseType" placeholder="请选择培训类型" clearable size="small">
-          <el-option label="请选择字典生成" value="" />
+          <el-option label="请选择字典生成" value=""/>
         </el-select>
       </el-form-item>
       <el-form-item label="讲师" prop="trainer">
@@ -62,10 +62,10 @@
       </el-form-item>
       <el-form-item label="培训日期" prop="courseDate">
         <el-date-picker clearable size="small" style="width: 200px"
-          v-model="queryParams.courseDate"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择培训日期">
+                        v-model="queryParams.courseDate"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择培训日期">
         </el-date-picker>
       </el-form-item>
       <el-form-item label="考核情况" prop="assess">
@@ -88,10 +88,10 @@
       </el-form-item>
       <el-form-item label="创建时间" prop="createdate">
         <el-date-picker clearable size="small" style="width: 200px"
-          v-model="queryParams.createdate"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择创建时间">
+                        v-model="queryParams.createdate"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择创建时间">
         </el-date-picker>
       </el-form-item>
       <el-form-item label="修改人" prop="updaterCode">
@@ -105,10 +105,10 @@
       </el-form-item>
       <el-form-item label="修改时间" prop="updatedate">
         <el-date-picker clearable size="small" style="width: 200px"
-          v-model="queryParams.updatedate"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择修改时间">
+                        v-model="queryParams.updatedate"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择修改时间">
         </el-date-picker>
       </el-form-item>
       <el-form-item label="部门编号" prop="deptId">
@@ -131,7 +131,7 @@
       </el-form-item>
       <el-form-item label="培训状态" prop="planStatus">
         <el-select v-model="queryParams.planStatus" placeholder="请选择培训状态" clearable size="small">
-          <el-option label="请选择字典生成" value="" />
+          <el-option label="请选择字典生成" value=""/>
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -148,7 +148,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['bccnew:firstplan:add']"
-        >新增</el-button>
+        >新增
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -158,7 +159,8 @@
           :disabled="single"
           @click="handleUpdate"
           v-hasPermi="['bccnew:firstplan:edit']"
-        >修改</el-button>
+        >修改
+        </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -168,13 +170,15 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['bccnew:firstplan:remove']"
-        >删除</el-button>
+        >删除
+        </el-button>
       </el-col>
-	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="firstplanList" @selection-change="handleSelectionChange" :height="clientHeight" border>
-      <el-table-column type="selection" width="55" align="center" />
+    <el-table v-loading="loading" :data="firstplanList" @selection-change="handleSelectionChange" :height="clientHeight"
+              border>
+      <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="课程编号" align="center" prop="courseCode" :show-overflow-tooltip="true" width="180"/>
       <el-table-column label="培训主题" align="center" prop="topic" :show-overflow-tooltip="true" width="180"/>
       <el-table-column label="培训内容" align="center" prop="content" :show-overflow-tooltip="true" width="180"/>
@@ -198,14 +202,23 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['bccnew:firstplan:edit']"
-          >修改</el-button>
+          >修改
+          </el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['bccnew:firstplan:remove']"
-          >删除</el-button>
+          >删除
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-folder"
+            @click="openFileDialog(scope.row)"
+          >学习资料
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -222,37 +235,37 @@
     <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="130px">
         <el-form-item label="课程编号" prop="courseCode">
-          <el-input v-model="form.courseCode" placeholder="请输入课程编号" />
+          <el-input v-model="form.courseCode" placeholder="请输入课程编号"/>
         </el-form-item>
         <el-form-item label="培训主题" prop="topic">
-          <el-input v-model="form.topic" placeholder="请输入培训主题" />
+          <el-input v-model="form.topic" placeholder="请输入培训主题"/>
         </el-form-item>
         <el-form-item label="培训内容">
           <el-input v-model="form.content" placeholder="请输入培训内容"/>
         </el-form-item>
         <el-form-item label="培训天" prop="courseDay">
-          <el-input v-model="form.courseDay" placeholder="请输入培训天" />
+          <el-input v-model="form.courseDay" placeholder="请输入培训天"/>
         </el-form-item>
         <el-form-item label="培训小时" prop="courseHour">
-          <el-input v-model="form.courseHour" placeholder="请输入培训小时" />
+          <el-input v-model="form.courseHour" placeholder="请输入培训小时"/>
         </el-form-item>
         <el-form-item label="培训类型" prop="courseType">
-          <el-input v-model="form.courseType" placeholder="请输入培训类型" />
-            <el-option label="请选择字典生成" value="" />
+          <el-input v-model="form.courseType" placeholder="请输入培训类型"/>
+          <el-option label="请选择字典生成" value=""/>
         </el-form-item>
         <el-form-item label="讲师" prop="trainer">
-          <el-input v-model="form.trainer" placeholder="请输入讲师" />
+          <el-input v-model="form.trainer" placeholder="请输入讲师"/>
         </el-form-item>
         <el-form-item label="培训日期" prop="courseDate">
           <el-date-picker clearable size="small" style="width: 200px"
-            v-model="form.courseDate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择培训日期">
+                          v-model="form.courseDate"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="选择培训日期">
           </el-date-picker>
         </el-form-item>
         <el-form-item label="考核情况" prop="assess">
-          <el-input v-model="form.assess" placeholder="请输入考核情况" />
+          <el-input v-model="form.assess" placeholder="请输入考核情况"/>
         </el-form-item>
         <el-form-item label="培训状态">
           <el-select v-model="form.planStatus" placeholder="请选择培训状态">
@@ -265,70 +278,147 @@
           </el-select>
         </el-form-item>
         <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注" />
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
+        </el-form-item>
+        <el-form-item label="归属部门" prop="deptId">
+          <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
         </el-form-item>
-          <el-form-item label="归属部门" prop="deptId">
-              <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
-          </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
-      <!-- 用户导入对话框 -->
-      <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
-          <el-upload
-                  ref="upload"
-                  :limit="1"
-                  accept=".xlsx, .xls"
-                  :headers="upload.headers"
-                  :action="upload.url + '?updateSupport=' + upload.updateSupport"
-                  :disabled="upload.isUploading"
-                  :on-progress="handleFileUploadProgress"
-                  :on-success="handleFileSuccess"
-                  :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">
-                  <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
-                  <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
-              </div>
-              <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
-          </el-upload>
-          <div slot="footer" class="dialog-footer">
-              <el-button type="primary" @click="submitFileForm">确 定</el-button>
-              <el-button @click="upload.open = false">取 消</el-button>
-          </div>
-      </el-dialog>
+    <!-- 用户导入对话框 -->
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :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">
+          <el-checkbox v-model="upload.updateSupport"/>
+          是否更新已经存在的用户数据
+          <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
+        </div>
+        <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog :visible.sync="file.open" width="30%" append-to-body>
+      <el-descriptions class="margin-top" title="学习资料" :column="1" size="" border>
+        <el-descriptions-item label-style="width:180px">
+          <template slot="label">
+            <i class="el-icon-user"></i>
+            资料名
+          </template>
+          {{ file.data.fileName }}
+        </el-descriptions-item>
+        <el-descriptions-item label-style="width:180px">
+          <template slot="label">
+            <i class="el-icon-mobile-phone"></i>
+            学习进度
+          </template>
+          <el-progress :text-inside="true" :stroke-width="20" :percentage="getCountTime()"
+                       status="success"></el-progress>
+        </el-descriptions-item>
+        <el-descriptions-item label-style="width:180px">
+          <template slot="label">
+            <i class="el-icon-mobile-phone"></i>
+            应学习时长(分)
+          </template>
+          {{ file.data.timerNeed }}
+        </el-descriptions-item>
+        <el-descriptions-item label-style="width:180px">
+          <template slot="label">
+            <i class="el-icon-mobile-phone"></i>
+            已学习时长(分)
+          </template>
+          {{ file.data.timer }}
+        </el-descriptions-item>
+      </el-descriptions>
+      <el-button
+        class="mt10"
+        type="primary"
+        icon="el-icon-video-play"
+        @click="handleStudy(file.data)"
+      >开始学习
+      </el-button>
+    </el-dialog>
+
+    <el-dialog :close-on-click-modal="false" v-loading="pdf.loadingFlash" element-loading-background="rgba(0,0,0,0.2)"
+               v-dialogDrag :title="pdf.title"
+               :visible.sync="pdf.open" width="1300px" height="800px" :center="true" append-to-body
+               @close="handleClose">
+      <div style="margin-top: -30px">
+        <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"
+                v-if="ppt"></iframe>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
 <script>
-import { listFirstplan, getFirstplan, delFirstplan, addFirstplan, updateFirstplan, exportFirstplan, importTemplate} from "@/api/training/bccnew/firstplan";
-import { treeselect } from "@/api/system/dept";
-import { getToken } from "@/utils/auth";
+import {
+  addFirstplan,
+  delFirstplan,
+  exportFirstplan,
+  getFirstplan,
+  importTemplate,
+  listFirstplan,
+  updateFirstLearnTime,
+  updateFirstplan
+} from "@/api/training/bccnew/firstplan";
+import {treeselect} from "@/api/system/dept";
+import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
-import Editor from '@/components/Editor/index.vue';
 
+var timer = null;
 export default {
   name: "FirstplanBccnew",
-  components: { Treeselect },
+  components: {Treeselect},
   props: {
     newId: {
-      default:null
+      default: null
     },
     planType: {}
   },
   // components: { Editor },
   data() {
     return {
+      file: {
+        open: false,
+        data: {}
+      },
+      ppt: false,
+      pdf: {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+        loadingFlash: false,
+      },
       // 遮罩层
       loading: true,
       // 选中数组
@@ -349,24 +439,24 @@ export default {
       title: "",
       // 部门树选项
       deptOptions: undefined,
-      clientHeight:300,
+      clientHeight: 300,
       // 是否显示弹出层
       open: false,
-        // 用户导入参数
-        upload: {
-            // 是否显示弹出层(用户导入)
-            open: false,
-            // 弹出层标题(用户导入)
-            title: "",
-            // 是否禁用上传
-            isUploading: false,
-            // 是否更新已经存在的用户数据
-            updateSupport: 0,
-            // 设置上传的请求头部
-            headers: { Authorization: "Bearer " + getToken() },
-            // 上传的地址
-            url: process.env.VUE_APP_BASE_API + "/bccnew/firstplan/importData"
-        },
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: {Authorization: "Bearer " + getToken()},
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/bccnew/firstplan/importData"
+      },
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -392,21 +482,20 @@ export default {
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-      }
+      rules: {}
     };
   },
   watch: {
-        // 根据名称筛选部门树
-        deptName(val) {
-            this.$refs.tree.filter(val);
-        }
-   },
+    // 根据名称筛选部门树
+    deptName(val) {
+      this.$refs.tree.filter(val);
+    }
+  },
   created() {
-      //设置表格高度对应屏幕高度
-      this.$nextTick(() => {
-          this.clientHeight = document.body.clientHeight -250
-      })
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = document.body.clientHeight - 250
+    })
     this.getList();
     this.getTreeselect();
     this.getDicts("training_newstaff_status").then(response => {
@@ -414,6 +503,45 @@ export default {
     });
   },
   methods: {
+    handleClose() {
+      window.clearInterval(timer);
+      this.getList();
+    },
+    handleStudy(row) {
+      //office预览
+      this.pdf.loadingFlash = true
+      this.pdf.open = true
+      this.pdf.title = row.fileName
+      this.pdf.pdfUrl = ""
+      this.ppt = true
+      //如果是PDF等直接可以打开的就不调接口,否则调用接口
+      if (row.fileName!=null && row.fileName.endsWith('pdf')) {
+        this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
+        this.loadingFlash = false
+      }
+      let _this = this;
+      timer = window.setInterval(function () {
+        updateFirstLearnTime(row).then(res => {
+        })
+      }, 60000);
+    },
+    getCountTime() {
+      if (this.file.data.timerNeed === 0)
+        return 0;
+      return (this.file.data.timer / this.file.data.timerNeed * 100).toFixed(2)
+    },
+    openFileDialog(row) {
+      this.file.open = true;
+      this.file.data = row
+      console.log(row)
+      if (row.timer === '' || row.timer == null) {
+        this.file.data.timer = 0
+      }
+      if (row.timerNeed === '' || row.timerNeed == null) {
+        this.file.data.timerNeed = 0
+      }
+      console.log(this.file.data)
+    },
     /** 查询进组培训列表 */
     getList() {
       this.loading = true;
@@ -423,12 +551,12 @@ export default {
         this.loading = false;
       });
     },
-     /** 查询部门下拉树结构 */
-     getTreeselect() {
-          treeselect().then(response => {
-              this.deptOptions = response.data;
-          });
-     },
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then(response => {
+        this.deptOptions = response.data;
+      });
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -472,7 +600,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
@@ -515,56 +643,56 @@ export default {
     handleDelete(row) {
       const ids = row.id || this.ids;
       this.$confirm('是否确认删除?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delFirstplan(ids);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        })
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return delFirstplan(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      })
     },
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有进组培训数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportFirstplan(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-        })
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return exportFirstplan(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      })
     },
-      /** 导入按钮操作 */
-      handleImport() {
-          this.upload.title = "用户导入";
-          this.upload.open = true;
-      },
-      /** 下载模板操作 */
-      importTemplate() {
-          importTemplate().then(response => {
-              this.download(response.msg);
-          });
-      },
-      // 文件上传中处理
-      handleFileUploadProgress(event, file, fileList) {
-          this.upload.isUploading = true;
-      },
-      // 文件上传成功处理
-      handleFileSuccess(response, file, fileList) {
-          this.upload.open = false;
-          this.upload.isUploading = false;
-          this.$refs.upload.clearFiles();
-          this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
-          this.getList();
-      },
-      // 提交上传文件
-      submitFileForm() {
-          this.$refs.upload.submit();
-      }
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "用户导入";
+      this.upload.open = true;
+    },
+    /** 下载模板操作 */
+    importTemplate() {
+      importTemplate().then(response => {
+        this.download(response.msg);
+      });
+    },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
+      this.getList();
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    }
   }
 };
 </script>

+ 6 - 16
ui/src/views/training/bccnew/tsnew/index.vue

@@ -140,33 +140,33 @@
       </el-table-column>
       <el-table-column label="三级教育记录卡" align="center" prop="three" width="80">
         <template slot-scope="scope">
-          <el-button  icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'tnNew-three')" circle></el-button>
+          <el-button  icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'tsNew-three')" circle></el-button>
         </template>
       </el-table-column>
 
       <el-table-column label="上岗能力评测表" align="center" prop="firstplan-score" width="80">
         <template slot-scope="scope">
-          <el-button  icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'tnNew-firstplan-score')" circle></el-button>
+          <el-button  icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'tsNew-firstplan-score')" circle></el-button>
         </template>
       </el-table-column>
       <el-table-column label="导师提名表" align="center" prop="agreement" width="80">
         <template slot-scope="scope">
-          <el-button  icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'tnNew-teacher-order')" circle></el-button>
+          <el-button  icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'tsNew-teacher-order')" circle></el-button>
         </template>
       </el-table-column>
       <el-table-column label="带徒协议" align="center" prop="agreement" width="80">
         <template slot-scope="scope">
-          <el-button  icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'tnNew-teacher-agreement')" circle></el-button>
+          <el-button  icon="el-icon-folder" style="color:#6e96fa;" @click="" circle></el-button>
         </template>
       </el-table-column>
       <el-table-column label="带徒目标" align="center" prop="target" width="80">
         <template slot-scope="scope">
-          <el-button  icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'tnNew-teacher-target')" circle></el-button>
+          <el-button  icon="el-icon-folder" style="color:#6e96fa;" @click="" circle></el-button>
         </template>
       </el-table-column>
       <el-table-column label="培训考评" align="center" prop="tnNew-score" width="80">
         <template slot-scope="scope">
-          <el-button  icon="el-icon-folder" style="color:#6e96fa;" @click="handleDoc(scope.row , 'tnNew-score')" circle></el-button>
+          <el-button  icon="el-icon-folder" style="color:#6e96fa;" @click="" circle></el-button>
         </template>
       </el-table-column>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="100"/>
@@ -745,16 +745,6 @@ export default {
     },
     /** 报告附件按钮操作 */
     handleDoc(row , fileType) {
-      var workType = "";
-      if (fileType === "byxworklicense-boiler"){
-        workType = this.$t('裂解(裂化)');
-      }else if (fileType === "byxworklicense-compression"){
-        workType = this.$t('压力容器');
-      }else if (fileType === "byxworklicense-separation"){
-        workType = this.$t('压力管道');
-      }else if (fileType === "byxworklicense-pguaeu"){
-        workType = '';
-      }
       this.doc.pType = fileType
       this.doc.queryParams.pType = fileType
       this.doc.id = row.id;

+ 138 - 7
ui/src/views/training/bccnew/tsnew/score.vue

@@ -55,7 +55,7 @@
       <el-table-column label="第二次成绩" align="center" prop="score2" :show-overflow-tooltip="true" width="180"/>
       <el-table-column label="第三次成绩" align="center" prop="score3" :show-overflow-tooltip="true" width="180"/>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="180"/>
-      <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" fixed="right" width="230" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -71,6 +71,13 @@
             @click="handleDelete(scope.row)"
           >删除
           </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-folder"
+            @click="openFileDialog(scope.row)"
+          >学习资料
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -121,9 +128,6 @@
         <el-form-item label="考核情况" prop="assess">
           <el-input v-model="form.assess" placeholder="请输入考核情况"/>
         </el-form-item>
-        <el-form-item label="备注" prop="remarks">
-          <el-input v-model="form.remarks" placeholder="请输入备注"/>
-        </el-form-item>
         <el-form-item label="培训状态">
           <el-select v-model="form.planStatus" placeholder="请选择培训状态">
             <el-option
@@ -143,6 +147,9 @@
         <el-form-item label="第三次成绩" prop="score3">
           <el-input v-model="form.score3" placeholder="请输入第三次成绩"/>
         </el-form-item>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注"/>
+        </el-form-item>
         <el-form-item label="归属部门" prop="deptId">
           <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
         </el-form-item>
@@ -152,6 +159,57 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog :visible.sync="file.open" width="30%" append-to-body>
+      <el-descriptions class="margin-top" title="学习资料" :column="1" size="medium" border>
+        <el-descriptions-item label-style="width:180px">
+          <template slot="label">
+            <i class="el-icon-user"></i>
+            资料名
+          </template>
+          {{ file.data.fileName }}
+        </el-descriptions-item>
+        <el-descriptions-item label-style="width:180px">
+          <template slot="label">
+            <i class="el-icon-mobile-phone"></i>
+            学习进度
+          </template>
+          <el-progress :text-inside="true" :stroke-width="20" :percentage="getCountTime()"
+                       status="success"></el-progress>
+        </el-descriptions-item>
+        <el-descriptions-item label-style="width:180px">
+          <template slot="label">
+            <i class="el-icon-mobile-phone"></i>
+            应学习时长(分)
+          </template>
+          {{ file.data.timerNeed }}
+        </el-descriptions-item>
+        <el-descriptions-item label-style="width:180px">
+          <template slot="label">
+            <i class="el-icon-mobile-phone"></i>
+            已学习时长(分)
+          </template>
+          {{ file.data.timer }}
+        </el-descriptions-item>
+      </el-descriptions>
+      <el-button
+        class="mt10"
+        type="primary"
+        icon="el-icon-video-play"
+        @click="handleStudy(file.data)"
+      >开始学习
+      </el-button>
+    </el-dialog>
+
+    <el-dialog :close-on-click-modal="false" v-loading="pdf.loadingFlash" element-loading-background="rgba(0,0,0,0.2)"
+               v-dialogDrag :title="pdf.title"
+               :visible.sync="pdf.open" width="1300px" height="800px" :center="true" append-to-body
+               @close="handleClose">
+      <div style="margin-top: -30px">
+        <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"
+                v-if="ppt"></iframe>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -161,32 +219,34 @@ import {
   delLjplandsdt,
   getLjplandsdt,
   listLjplandsdt,
+  updateLjLearnTime,
   updateLjplandsdt
 } from "@/api/training/bccnew/ljplandsdt";
 import {
   addYsplandsdt,
   delYsplandsdt,
   getYsplandsdt,
-  listYsplandsdt,
+  listYsplandsdt, updateYsLearnTime,
   updateYsplandsdt
 } from "@/api/training/bccnew/ysplandsdt";
 import {
   addFlplandsdt,
   delFlplandsdt,
   getFlplandsdt,
-  listFlplandsdt,
+  listFlplandsdt, updateFlLearnTime,
   updateFlplandsdt
 } from "@/api/training/bccnew/flplandsdt";
 import {
   addFtplandsdt,
   delFtplandsdt,
   getFtplandsdt,
-  listFtplandsdt,
+  listFtplandsdt, updateFtLearnTime,
   updateFtplandsdt
 } from "@/api/training/bccnew/ftplandsdt";
 import {treeselect} from "@/api/system/dept";
 import Treeselect from "@riophae/vue-treeselect";
 
+var timer = null;
 export default {
   props: {
     newId: {},
@@ -195,6 +255,21 @@ export default {
   components: {Treeselect},
   data() {
     return {
+      file: {
+        open: false,
+        data: {}
+      },
+      ppt: false,
+      pdf: {
+        title: '',
+        pdfUrl: '',
+        numPages: null,
+        open: false,
+        pageNum: 1,
+        pageTotalNum: 1,
+        loadedRatio: 0,
+        loadingFlash: false,
+      },
       // 选中数组
       ids: [],
       // 总条数
@@ -245,6 +320,62 @@ export default {
     });
   },
   methods: {
+    handleClose() {
+      window.clearInterval(timer);
+      this.getList();
+    },
+    handleStudy(row) {
+      //office预览
+      this.pdf.loadingFlash = true
+      this.pdf.open = true
+      this.pdf.title = row.fileName
+      this.pdf.pdfUrl = ""
+      this.ppt = true
+      //如果是PDF等直接可以打开的就不调接口,否则调用接口
+      if (row.fileName.endsWith('pdf')) {
+        this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
+        this.loadingFlash = false
+      }
+      let _this = this;
+      if (this.planType === 1) {
+        timer = window.setInterval(function () {
+          updateLjLearnTime(row).then(res => {
+          })
+        }, 60000);
+      } else if (this.planType === 2) {
+        timer = window.setInterval(function () {
+          updateYsLearnTime(row).then(res => {
+          })
+        }, 60000);
+      } else if (this.planType === 3) {
+        timer = window.setInterval(function () {
+          updateFlLearnTime(row).then(res => {
+          })
+        }, 60000);
+      } else if (this.planType === 4) {
+        timer = window.setInterval(function () {
+          updateFtLearnTime(row).then(res => {
+          })
+        }, 60000);
+      }
+    },
+    getCountTime() {
+      if (this.file.data.timerNeed === 0)
+        return 0;
+      return (this.file.data.timer / this.file.data.timerNeed * 100).toFixed(2)
+    },
+    openFileDialog(row) {
+      this.file.open = true;
+      this.file.data = row
+      console.log(row)
+      if (row.timer === '' || row.timer == null) {
+        this.file.data.timer = 0
+      }
+      if (row.timerNeed === '' || row.timerNeed == null) {
+        this.file.data.timerNeed = 0
+      }
+      console.log(this.file.data)
+    },
     getList() {
       if (this.planType == 1) {
         listLjplandsdt(this.queryParams).then(res => {