소스 검색

Merge remote-tracking branch 'origin/master'

jiangbiao 1 년 전
부모
커밋
9d86cd7e56

+ 10 - 5
master/src/main/java/com/ruoyi/project/training/controller/TTrainingbccRegularController.java

@@ -1,10 +1,7 @@
 package com.ruoyi.project.training.controller;
 
 import java.time.LocalDate;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;
 
 import com.ruoyi.project.plant.domain.TStaffmgr;
 import com.ruoyi.project.plant.service.ITStaffmgrService;
@@ -279,7 +276,15 @@ public class TTrainingbccRegularController extends BaseController
                     addFlag = 1;
                 }
             }
-
+            if ("每月一次".equals(matrix.getFrequency()) ) {
+                tr.setYear(String.valueOf(currentYear));
+                tr.setItem(matrix.getItem());
+                tr.setPlanTrainingdate(new Date());
+                List<TTrainingbccRegular> regulars = tTrainingbccRegularService.selectTTrainingbccRegularList(tr);
+                if (regulars.size() == 0) {
+                    addFlag = 1;
+                }
+            }
             if (addFlag == 1) {
                 TTrainingbccRegular tTrainingRegular = new TTrainingbccRegular();
                 tTrainingRegular.setDeptId(matrix.getDeptId());

+ 2 - 1
master/src/main/resources/mybatis/training/TTrainingbccRegularMapper.xml

@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
             <if test="updatedate != null "> and updatedate = #{updatedate}</if>
             <if test="deptId != null "> and dept_id = #{deptId}</if>
-            <if test="planTrainingdate != null "> and plan_trainingdate = #{planTrainingdate}</if>
+            <if test="planTrainingdate != null "> and to_char(plan_trainingdate, 'yyyy-mm') = to_char(#{planTrainingdate}, 'yyyy-mm') </if>
             <if test="actualCompletedate != null "> and actual_completedate = #{actualCompletedate}</if>
             <if test="lecturer != null  and lecturer != ''"> and lecturer = #{lecturer}</if>
             <if test="hour != null  and hour != ''"> and hour = #{hour}</if>
@@ -61,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
+        order by year desc,plan_trainingdate
     </select>
 
     <select id="selectTTrainingbccRegularById" parameterType="Long" resultMap="TTrainingbccRegularResult">

+ 1 - 0
ui/src/views/training/bccregular/index.vue

@@ -585,6 +585,7 @@ export default {
     },
     handleAddBatch(){
       batchAddTraining(null).then(response => {
+        this.getList()
         this.msgSuccess('操作成功');
       })
     },