Parcourir la source

-导师带徒bugfix

jiangbiao il y a 9 mois
Parent
commit
9c10439132

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

@@ -141,8 +141,9 @@ public class TTsNewServiceImpl implements ITTsNewService {
         }
         tShiftRoster.setWeek(0L);
         List<TShiftRoster> rosters = tShiftRosterMapper.selectTShiftRosterListByTrain(tShiftRoster);
-        int i = 0;
-        double studyCount = 0;
+        int i = 0;//排班日期下标
+        double studyCount = 0;//累计学习时长
+        int c = 1;//课程统计(一天3门课程)
         for (TTsFirstplanTmpl tTsFirstplanTmpl : tTsFirstplanTmplMapper.selectTTsFirstplanTmplList(new TTsFirstplanTmpl())) {
             TTsFirstplan tTsFirstplan = new TTsFirstplan();
             TPlantproglist tpl = new TPlantproglist();
@@ -175,29 +176,31 @@ public class TTsNewServiceImpl implements ITTsNewService {
             tTsFirstplan.setCourseDay(tTsFirstplanTmpl.getCourseDay());
             tTsFirstplan.setCourseHour(tTsFirstplanTmpl.getCourseHour());
             if (tTsFirstplan.getCourseHour() != null) {
-                tTsFirstplan.setTimerNeed(tTsFirstplan.getCourseHour() * 60);
+//                tTsFirstplan.setTimerNeed(tTsFirstplan.getCourseHour() * 60);
                 if (CollectionUtils.isNotEmpty(rosters)) {
+//                    计算培训时长
                     studyCount += tTsFirstplan.getCourseHour();
-                    if (tTsFirstplan.getCourseHour() <= 6) {
-                        if (studyCount <= 6) {
+                    if (tTsFirstplan.getCourseHour() <= 6) {//当前主题培训时长小于6个小时的
+                        if (studyCount <= 6&&c<=3) {//累计时长小于6个小时,放在同一天
                             if (rosters.size() > i) {
                                 tTsFirstplan.setTrainingPlanDate(rosters.get(i).getShiftDate());
                             }
-                        } else {
+                        } else {//超过6个小时放在下一天
                             i++;
                             if (rosters.size() > i) {
                                 tTsFirstplan.setTrainingPlanDate(rosters.get(i).getShiftDate());
                             }
                             studyCount = 0;
+                            c=1;
                         }
                     }else{
+                        // 学习时长累计大于6个小时时往后再延一天
                         i++;
                         tTsFirstplan.setTrainingPlanDate(rosters.get(i).getShiftDate());
+                        i++;
                         studyCount = 0;
                     }
                 }
-            } else {
-                tTsFirstplan.setTimerNeed(tTsFirstplanTmpl.getTimerNeed());
             }
             tTsFirstplan.setCourseType(tTsFirstplanTmpl.getCourseType());
             tTsFirstplan.setCourseDate(tTsFirstplanTmpl.getCourseDate());
@@ -211,6 +214,7 @@ public class TTsNewServiceImpl implements ITTsNewService {
             tTsFirstplan.setExamType(tTsFirstplanTmpl.getExamType());
             tTsFirstplan.setExamId(tTsFirstplanTmpl.getExamId());
             tTsFirstplanMapper.insertTTsFirstplan(tTsFirstplan);
+            c++;
         }
         TStaffmgr tStaffmgr = tStaffmgrMapper.selectTStaffmgrByStaffId(tTsNew.getStaffId());
         Calendar calendar = Calendar.getInstance();

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

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

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

@@ -152,7 +152,7 @@
           <el-input v-model="form.materialVer" placeholder="请输入材料版本"/>
         </el-form-item>
         <el-form-item label="培训时长h" prop="courseHour">
-          <el-input-number min="0" max="6" v-model="form.courseHour" placeholder="请输入培训时长h" @change="changeNeedTimer"/>
+          <el-input-number :min="0" :max="6" v-model="form.courseHour" placeholder="请输入培训时长h"/>
         </el-form-item>
         <el-form-item label="讲师" prop="trainer">
           <el-input v-model="form.trainer" placeholder="请输入讲师"/>
@@ -165,10 +165,10 @@
           </el-select>
         </el-form-item>
         <el-form-item label="应学习时长(分)" prop="timerNeed">
-          <el-input-number min="0" v-model="form.timerNeed" placeholder="请输入应学习时长" disabled/>
+          <el-input-number :min="0" v-model="form.timerNeed" placeholder="请输入应学习时长"/>
         </el-form-item>
         <el-form-item label="培训排序" prop="sortTmpl">
-          <el-input-number min="0" v-model="form.sortTmpl" placeholder="请输入培训排序" />
+          <el-input-number :min="0" v-model="form.sortTmpl" placeholder="请输入培训排序" />
         </el-form-item><el-form-item label="培训考试" prop="examId">
         <el-select v-model="form.examId" filterable  :placeholder="$t('请选择') + $t('培训考试')">
           <el-option