Bläddra i källkod

-导师带徒bugfix

jiangbiao 1 år sedan
förälder
incheckning
469dfb8c2e

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

@@ -133,7 +133,9 @@ public class TTsNewServiceImpl implements ITTsNewService {
         tTsNewMapper.insertTTsNew(tTsNew);
         TShiftRoster tShiftRoster = new TShiftRoster();
         tShiftRoster.setShiftDate(tTsNew.getStartdate());
-        tShiftRoster.setVacation(tTsNew.getVacation());
+        if(tTsNew.getVacation()!=null&&tTsNew.getVacation()==1) {
+            tShiftRoster.setVacation(tTsNew.getVacation());
+        }
         tShiftRoster.setWeek(0L);
         List<TShiftRoster> rosters = tShiftRosterMapper.selectTShiftRosterListByTrain(tShiftRoster);
         int i = 0;
@@ -158,6 +160,8 @@ public class TTsNewServiceImpl implements ITTsNewService {
                     tTsFirstplan.setTrainer(user.getNickName());
                     tTsFirstplan.setTrainerId(user.getUserId());
                 }
+            }else{
+                tTsFirstplan.setTrainer(tTsFirstplanTmpl.getTrainer());
             }
             tTsFirstplan.setNewId(tTsNew.getNewId());
             tTsFirstplan.setCourseCode(tTsFirstplanTmpl.getCourseCode());
@@ -208,6 +212,7 @@ public class TTsNewServiceImpl implements ITTsNewService {
         tShiftRoster.setDclass(tStaffmgr.getTeam());
         tShiftRoster.setNclass(tStaffmgr.getTeam());
         tShiftRoster.setVacation(null);
+        tShiftRoster.setWeek(null);
         rosters = tShiftRosterMapper.selectTShiftRosterListByTrain(tShiftRoster);
         i=0;
         if (tTsNew.getPlanType() == 1) {

+ 1 - 1
master/src/main/resources/mybatis/shiftmgr/TShiftRosterMapper.xml

@@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="shiftDate != null "> and shift_date >= #{shiftDate}</if>
             <if test="dclass != null  and dclass != '' and nclass != null  and nclass != ''"> and (dclass = #{dclass} or nclass = #{nclass})</if>
             <if test="vacation != null "> and vacation != #{vacation}</if>
-            <if test="week != null "> and week != 0 and week != 6</if>
+            <if test="week != null "> and week != 1 and week != 7</if>
             and d.del_flag = 0
         </where>
     </select>

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

@@ -300,6 +300,18 @@
             </el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="是否避开节假日" prop="vacation">
+          <el-radio-group v-model="form.vacation">
+            <el-radio
+              key="1"
+              :label="1"
+            >是</el-radio>
+            <el-radio
+              key="0"
+              :label="0"
+            >否</el-radio>
+          </el-radio-group>
+        </el-form-item>
         <el-form-item label="备注" prop="remarks">
           <el-input v-model="form.remarks" placeholder="请输入备注" />
         </el-form-item>