Преглед на файлове

refactor(ui): 优化巡逻记录路由和培训资料表格

- 更新巡逻记录路由,添加 '/patrol' 前缀
- 在多个培训资料表格中注释掉上传人和上传日期列
- 优化文档生成相关代码,调整图片路径处理方式
jiangbiao преди 2 седмици
родител
ревизия
6f6f11df48

+ 21 - 20
master/src/main/java/com/ruoyi/project/training/bccnew/controller/TTsNewController.java

@@ -31,8 +31,8 @@ import java.nio.file.Paths;
 import java.text.SimpleDateFormat;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
-import java.util.List;
 import java.util.*;
+import java.util.List;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -364,7 +364,7 @@ public class TTsNewController extends BaseController {
         String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss"));
         String fileName = time + tTsNew.getNewId() + ".docx";
         String wordPath = this.createWord(templatePath, fileDir, fileName, params, "appraisalFormWord");
-        wordPath = this.createWord(wordPath, fileDir, fileName, genSign(appraisalFormWordData.get("signs")), "appraisalFormWord",true);
+        wordPath = this.createWord(wordPath, fileDir, fileName, genSign(appraisalFormWordData.get("signs")), "appraisalFormWord", true);
         return wordPath;
     }
 
@@ -483,18 +483,18 @@ public class TTsNewController extends BaseController {
     private Map<String, Object> genSign(Map<String, Object> map) {
         Map<String, Object> params = new HashMap<>();
         for (String s : map.keySet()) {
-            if (s.equals("traineeSignature")){
+            if (s.equals("traineeSignature")) {
                 params.put(s, map.get(s));
             }
             if (Objects.nonNull(map.get(s))) {
                 SysUser sysUser = new SysUser();
-                sysUser.setNickName(map.get(s).toString().replaceAll(" ",""));
+                sysUser.setNickName(map.get(s).toString().replaceAll(" ", ""));
                 sysUser.setDeptId(103L);
                 List<SysUser> sysUsers = sysUserService.selectUserList(sysUser);
                 if (CollectionUtils.isNotEmpty(sysUsers)) {
                     if (sysUsers.get(0).getSignUrl() != null) {
-                        s = s.replace("{{@","");
-                        s = s.replace("}}","");
+                        s = s.replace("{{@", "");
+                        s = s.replace("}}", "");
                         params.put(s, Pictures.ofLocal(fileName(sysUsers.get(0).getSignUrl())).size(100, 40).create());
                     }
                 }
@@ -528,17 +528,17 @@ public class TTsNewController extends BaseController {
                 trainDate = formatter.format(firstplan.getCourseDate());
             }
             String tn = "";
-            String trainerSign="";
-            String traineeSign="";
+            String trainerSign = "";
+            String traineeSign = "";
             if (StringUtils.isNotEmpty(firstplan.getTrainerConfirm())) {
-                if (StringUtils.isNotEmpty(firstplan.getTrainer())){
-                    tn = firstplan.getTrainer().replaceAll(" ","");
+                if (StringUtils.isNotEmpty(firstplan.getTrainer())) {
+                    tn = firstplan.getTrainer().replaceAll(" ", "");
                     trainerSign = "{{@trainSign" + tn + "}}";
                     signMap.put(trainerSign, tn);
                 }
             }
-            if(StringUtils.isNotEmpty(firstplan.getStudentConfirm())){
-                traineeSign="{{@traineeSignature}}";
+            if (StringUtils.isNotEmpty(firstplan.getStudentConfirm())) {
+                traineeSign = "{{@traineeSignature}}";
             }
             plantList[i] = Rows.create(String.valueOf(i), planDate, firstplan.getTopic(), firstplan.getMaterialVer(), String.valueOf(firstplan.getCourseHour())
                     , firstplan.getTrainer(), trainDate, trainerSign, firstplan.getExamType(), firstplan.getAssess(), traineeSign);
@@ -558,7 +558,7 @@ public class TTsNewController extends BaseController {
         List<TTsApprove> tTsApproves = tsApproveService.selectTTsApproveByNewId(tTsNew.getNewId());
         if (CollectionUtils.isNotEmpty(tTsApproves)) {
             for (TTsApprove tTsApprove : tTsApproves) {
-                if(tTsApprove.getApprover()!=null) {
+                if (tTsApprove.getApprover() != null) {
                     SysUser manager = sysUserService.selectUserById(Long.valueOf(tTsApprove.getApprover()));
                     if (StringUtils.isNotEmpty(manager.getSignUrl())) {
                         params.put("mgrSign", Pictures.ofLocal(fileName(manager.getSignUrl())).size(100, 40).create());
@@ -567,12 +567,12 @@ public class TTsNewController extends BaseController {
                         params.put("traineeTime", DateUtils.dateTime(tTsApprove.getCreatedate()));
                     }
                     if (tTsNew.getPlanStatus() == 3) {// 模板路径
-                        String imgPath = "/static/word/training/commentImg/end2.png";
-                        params.put("mentorComments", Pictures.ofLocal(Objects.requireNonNull(getClass().getResource(imgPath)).getPath()).size(500, 80).create());
+                        String imgPath = "static/word/training/commentImg/end2.png";
+                        params.put("mentorComments", Pictures.ofStream(getClass().getClassLoader().getResourceAsStream(imgPath)).size(500, 80).create());
                     }
                     if (tTsNew.getPlanStatus() == 1) {// 模板路径
-                        String imgPath = "/static/word/training/commentImg/end1.png";
-                        params.put("mentorComments", Pictures.ofLocal(Objects.requireNonNull(getClass().getResource(imgPath)).getPath()).size(500, 80).create());
+                        String imgPath = "static/word/training/commentImg/end1.png";
+                        params.put("mentorComments", Pictures.ofStream(getClass().getClassLoader().getResourceAsStream(imgPath)).size(500, 80).create());
                     }
                 }
             }
@@ -792,11 +792,12 @@ public class TTsNewController extends BaseController {
         logger.info("目录{}!", filePath);
         logger.info("模板{}!", templatePath);
         // 读取模板渲染参数
-        InputStream is =  getClass().getClassLoader().getResourceAsStream(templatePath);;
-        if (flag.length>0&&flag[0]) {
+        InputStream is = getClass().getClassLoader().getResourceAsStream(templatePath);
+        ;
+        if (flag.length > 0 && flag[0]) {
             logger.info("待签名文件地址:{}!", filePath);
             is = new FileInputStream(filePath);
-            fileName = fileName.replace(".docx","_sign.docx");
+            fileName = fileName.replace(".docx", "_sign.docx");
             filePath = fileDir + "/" + fileName;
         }
 

+ 26 - 26
ui/src/views/patrol/patrol/issues/index.vue

@@ -135,157 +135,157 @@ export default {
       switch (patrolType) {
         case '1':
           this.$router.push({
-            path: '/record/fire/annihilator',
+            path: '/patrol/record/fire/annihilator',
             query: {id: id}
           });
           break;
         case '2':
           this.$router.push({
-            path: '/record/fire/cannon',
+            path: '/patrol/record/fire/cannon',
             query: {id: id}
           });
           break;
         case '3':
           this.$router.push({
-            path: '/record/fire/postFire',
+            path: '/patrol/record/fire/postFire',
             query: {id: id}
           });
           break;
         case '4':
           this.$router.push({
-            path: '/record/fire/hoseBox',
+            path: '/patrol/record/fire/hoseBox',
             query: {id: id}
           });
           break;
         case '5':
           this.$router.push({
-            path: '/record/fire/standpipe',
+            path: '/patrol/record/fire/standpipe',
             query: {id: id}
           });
           break;
         case '6':
           this.$router.push({
-            path: '/record/fire/sprinkler',
+            path: '/patrol/record/fire/sprinkler',
             query: {id: id}
           });
           break;
         case '7':
           this.$router.push({
-            path: '/record/emergency/cabinet',
+            path: '/patrol/record/emergency/cabinet',
             query: {id: id}
           });
           break;
         case '8':
           this.$router.push({
-            path: '/record/fire/alarm',
+            path: '/patrol/record/fire/alarm',
             query: {id: id}
           });
           break;
         case '9':
           this.$router.push({
-            path: '/record/fire/shield',
+            path: '/patrol/record/fire/shield',
             query: {id: id}
           });
           break;
         case '10':
           this.$router.push({
-            path: '/record/emergency/paga',
+            path: '/patrol/record/emergency/paga',
             query: {id: id}
           });
           break;
         case '11':
           this.$router.push({
-            path: '/record/emergency/cctv',
+            path: '/patrol/record/emergency/cctv',
             query: {id: id}
           });
           break;
         case '12':
           this.$router.push({
-            path: '/record/emergency/eyewash',
+            path: '/patrol/record/emergency/eyewash',
             query: {id: id}
           });
           break;
         case '13':
           this.$router.push({
-            path: '/record/fire/sandbox',
+            path: '/patrol/record/fire/sandbox',
             query: {id: id}
           });
           break;
         case '14':
           this.$router.push({
-            path: '/record/fire/door',
+            path: '/patrol/record/fire/door',
             query: {id: id}
           });
           break;
         case '15':
           this.$router.push({
-            path: '/record/fire/weathervane',
+            path: '/patrol/record/fire/weathervane',
             query: {id: id}
           });
           break;
         case '16':
           this.$router.push({
-            path: '/record/fire/curtain',
+            path: '/patrol/record/fire/curtain',
             query: {id: id}
           });
           break;
         case '17':
           this.$router.push({
-            path: '/record/emergency/cofferdam',
+            path: '/patrol/record/emergency/cofferdam',
             query: {id: id}
           });
           break;
         case '18':
           this.$router.push({
-            path: '/record/commonuse/tester',
+            path: '/patrol/record/commonuse/tester',
             query: {id: id}
           });
           break;
         case '19':
           this.$router.push({
-            path: '/record/commonuse/earplug',
+            path: '/patrol/record/commonuse/earplug',
             query: {id: id}
           });
           break;
         case '20':
           this.$router.push({
-            path: '/record/commonuse/movement',
+            path: '/patrol/record/commonuse/movement',
             query: {id: id}
           });
           break;
         case '21':
           this.$router.push({
-            path: '/record/commonuse/bicycle',
+            path: '/patrol/record/commonuse/bicycle',
             query: {id: id}
           });
           break;
         case '22':
           this.$router.push({
-            path: '/record/commonuse/cover',
+            path: '/patrol/record/commonuse/cover',
             query: {id: id}
           });
           break;
         case '23':
           this.$router.push({
-            path: '/record/commonuse/walkitTalkie',
+            path: '/patrol/record/commonuse/walkitTalkie',
             query: {id: id}
           });
           break;
         case '24':
           this.$router.push({
-            path: '/record/commonuse/safetyBelt',
+            path: '/patrol/record/commonuse/safetyBelt',
             query: {id: id}
           });
           break;
         case '25':
           this.$router.push({
-            path: '/record/commonuse/downspout',
+            path: '/patrol/record/commonuse/downspout',
             query: {id: id}
           });
           break;
         case '26':
           this.$router.push({
-            path: '/record/commonuse/pump',
+            path: '/patrol/record/commonuse/pump',
             query: {id: id}
           });
           break;

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

@@ -386,13 +386,13 @@
         </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" prop="createdate" :show-overflow-tooltip="true"
-                         width="120">
-          <template slot-scope="scope">
-            <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-          </template>
-        </el-table-column>
+<!--        <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>-->
+<!--        <el-table-column :label="$t('上传日期')" align="center" prop="createdate" :show-overflow-tooltip="true"-->
+<!--                         width="120">-->
+<!--          <template slot-scope="scope">-->
+<!--            <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>-->
+<!--          </template>-->
+<!--        </el-table-column>-->
         <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
           <template slot-scope="scope">
             <el-button

+ 7 - 7
ui/src/views/training/bccnew/firstplan/index_student.vue

@@ -288,13 +288,13 @@
         </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" prop="createdate" :show-overflow-tooltip="true"
-                         width="120">
-          <template slot-scope="scope">
-            <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-          </template>
-        </el-table-column>
+<!--        <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>-->
+<!--        <el-table-column :label="$t('上传日期')" align="center" prop="createdate" :show-overflow-tooltip="true"-->
+<!--                         width="120">-->
+<!--          <template slot-scope="scope">-->
+<!--            <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>-->
+<!--          </template>-->
+<!--        </el-table-column>-->
         <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
           <template slot-scope="scope">
             <el-button

+ 7 - 7
ui/src/views/training/bccnew/firstplan/index_t.vue

@@ -255,13 +255,13 @@
         </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" prop="createdate" :show-overflow-tooltip="true"
-                         width="120">
-          <template slot-scope="scope">
-            <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-          </template>
-        </el-table-column>
+<!--        <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>-->
+<!--        <el-table-column :label="$t('上传日期')" align="center" prop="createdate" :show-overflow-tooltip="true"-->
+<!--                         width="120">-->
+<!--          <template slot-scope="scope">-->
+<!--            <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>-->
+<!--          </template>-->
+<!--        </el-table-column>-->
         <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
           <template slot-scope="scope">
             <el-button

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

@@ -350,7 +350,7 @@
         </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" prop="creator" :show-overflow-tooltip="true" width="120"/>-->
         <!--        <el-table-column :label="$t('培训日期')" align="center" prop="pDate"  width="150">-->
         <!--          <template slot-scope="scope">-->
         <!--            <el-date-picker-->

+ 1 - 1
ui/src/views/training/bccnew/tsnew/index_s.vue

@@ -194,7 +194,7 @@
           </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" 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

+ 1 - 1
ui/src/views/training/bccnew/tsnew/index_t.vue

@@ -269,7 +269,7 @@
           </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" prop="creator" :show-overflow-tooltip="true" width="120"/>-->
         <!--        <el-table-column :label="$t('培训日期')" align="center" prop="pDate"  width="150">-->
         <!--          <template slot-scope="scope">-->
         <!--            <el-date-picker-->

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

@@ -309,13 +309,13 @@
         </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" prop="createdate" :show-overflow-tooltip="true"
-                         width="120">
-          <template slot-scope="scope">
-            <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-          </template>
-        </el-table-column>
+<!--        <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>-->
+<!--        <el-table-column :label="$t('上传日期')" align="center" prop="createdate" :show-overflow-tooltip="true"-->
+<!--                         width="120">-->
+<!--          <template slot-scope="scope">-->
+<!--            <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>-->
+<!--          </template>-->
+<!--        </el-table-column>-->
         <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
           <template slot-scope="scope">
             <el-button

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

@@ -139,13 +139,13 @@
         </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" prop="createdate" :show-overflow-tooltip="true"
-                         width="120">
-          <template slot-scope="scope">
-            <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>
-          </template>
-        </el-table-column>
+<!--        <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>-->
+<!--        <el-table-column :label="$t('上传日期')" align="center" prop="createdate" :show-overflow-tooltip="true"-->
+<!--                         width="120">-->
+<!--          <template slot-scope="scope">-->
+<!--            <span>{{ parseTime(scope.row.createdate, '{y}-{m}-{d}') }}</span>-->
+<!--          </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>