浏览代码

LY 离职逻辑修改

ly 2 年之前
父节点
当前提交
f91fed6241

+ 2 - 2
master/src/main/java/com/ruoyi/project/training/controller/TTrainingController.java

@@ -162,7 +162,7 @@ public class TTrainingController extends BaseController
                     while (iterator.hasNext()) {
                         TStaffmgr t = iterator.next();
                         if (t.getLeftDate() != null && t.getDelFlag() == 9){
-                            if (t.getLeftDate().getTime() - tTraining.getStartDate().getTime() > 0l ) {
+                            if (t.getLeftDate().getTime() - tTraining.getStartDate().getTime() < 0l ) {
                                 logger.debug(t.getName() + "离职时间小于培训时间");
                                 iterator.remove();
                             }
@@ -264,7 +264,7 @@ public class TTrainingController extends BaseController
                         while (iterator.hasNext()) {
                             TStaffmgr t = iterator.next();
                             if (t.getLeftDate() != null && t.getDelFlag() == 9){
-                                if (t.getLeftDate().getTime() - tTraining.getStartDate().getTime() > 0l ) {
+                                if (t.getLeftDate().getTime() - tTraining.getStartDate().getTime() < 0l ) {
                                     logger.debug(t.getName() + "离职时间小于培训时间");
                                     iterator.remove();
                                 }

+ 3 - 3
master/src/main/java/com/ruoyi/project/training/controller/TTrainingRegularController.java

@@ -181,7 +181,7 @@ public class TTrainingRegularController extends BaseController
                         while (iterator.hasNext()) {
                             TStaffmgr t = iterator.next();
                             if (t.getLeftDate() != null && t.getDelFlag() == 9){
-                                if (t.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() > 0l ) {
+                                if (t.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() < 0l ) {
                                     logger.debug(t.getName() + "离职时间小于培训时间");
                                     iterator.remove();
                                 }
@@ -306,7 +306,7 @@ public class TTrainingRegularController extends BaseController
                         while (iterator.hasNext()) {
                             TStaffmgr staffmgr2 = iterator.next();
                             if (staffmgr2.getLeftDate() != null && t.getDelFlag() == 9){
-                                if (staffmgr2.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() > 0l ) {
+                                if (staffmgr2.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() < 0l ) {
                                     logger.debug(staffmgr2.getName() + "离职时间小于培训时间");
                                     iterator.remove();
                                 }
@@ -335,7 +335,7 @@ public class TTrainingRegularController extends BaseController
                             while (iterator.hasNext()) {
                                 TStaffmgr staffmgr1 = iterator.next();
                                 if (staffmgr1.getLeftDate() != null && t.getDelFlag() == 9){
-                                    if (staffmgr1.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() > 0l ) {
+                                    if (staffmgr1.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() < 0l ) {
                                         logger.debug(staffmgr1.getName() + "离职时间小于培训时间");
                                         iterator.remove();
                                     }

+ 18 - 2
master/src/main/java/com/ruoyi/project/training/service/impl/TTrainingServiceImpl.java

@@ -1,6 +1,7 @@
 package com.ruoyi.project.training.service.impl;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
 import com.alibaba.fastjson.JSON;
@@ -149,7 +150,22 @@ public class TTrainingServiceImpl implements ITTrainingService
         TTraining tTraining = tTrainingMapper.selectTTrainingById(trainingId);
         TStaffmgr tStaffmgr = new TStaffmgr();
         tStaffmgr.setActualposts(tTraining.getPosition());
-        List<TStaffmgr> staffmgrList =  tStaffmgrMapper.selectTStaffmgrList(tStaffmgr);
+        List<TStaffmgr> staffmgrList =  tStaffmgrMapper.selectAllTStaffmgrList(tStaffmgr);
+        try {
+            //判断离职
+            if (!org.apache.commons.lang.StringUtils.isEmpty(tTraining.getYear())) {
+                Iterator<TStaffmgr> iterator = staffmgrList.iterator();
+                while (iterator.hasNext()) {
+                    TStaffmgr t = iterator.next();
+                    if (t.getLeftDate() != null && t.getDelFlag() == 9){
+                        if (t.getLeftDate().getTime() - tTraining.getStartDate().getTime() < 0l ) {
+                            iterator.remove();
+                        }
+                    }
+                }
+            }
+        }catch (Exception e) {
+        }
         List<TStaffmgr> staffmgrs = new ArrayList<TStaffmgr>();
         if (tTraining.getDesignatedStaff() != null) {
             String[] staffIds = tTraining.getDesignatedStaff().split(",");
@@ -172,7 +188,7 @@ public class TTrainingServiceImpl implements ITTrainingService
                 }
             }
         }
-        
+
         if (CollectionUtils.isNotEmpty(list)) {
             for (int i = 0; i < list.size(); i++) {
                 // 表格第二行

+ 2 - 2
ui/src/views/login.vue

@@ -158,8 +158,8 @@ export default {
   justify-content: center;
   align-items: center;
   height: 100%;
-  background-image: url("../assets/image/CPMS20210107.jpg");
-  //background-image: url("../assets/image/CPMS20211128.jpg");
+  //background-image: url("../assets/image/CPMS20210107.jpg");
+  background-image: url("../assets/image/CPMS20211128.jpg");
   background-size: cover;
 }
 .title {