|
@@ -1,6 +1,8 @@
|
|
|
package com.ruoyi.project.training.controller;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Calendar;
|
|
|
+import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
|
|
|
import com.ruoyi.project.plant.domain.TStaffmgr;
|
|
@@ -11,6 +13,7 @@ import com.ruoyi.project.training.domain.TTraining;
|
|
|
import com.ruoyi.project.training.domain.TTrainingDevice;
|
|
|
import com.ruoyi.project.training.service.ITTrainingDeviceService;
|
|
|
import com.ruoyi.project.training.service.ITTrainingService;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -170,7 +173,24 @@ public class TTrainingRegularController extends BaseController
|
|
|
logger.info("参培岗位人员");
|
|
|
TStaffmgr staffmgr = new TStaffmgr();
|
|
|
staffmgr.setActualposts(tTrainingRegular.getActualpostId());
|
|
|
- List<TStaffmgr> staffmgrs = tStaffmgrService.selectTStaffmgrList(staffmgr);
|
|
|
+ List<TStaffmgr> staffmgrs = tStaffmgrService.selectAllTStaffmgrList(staffmgr);
|
|
|
+ try {
|
|
|
+ //判断离职
|
|
|
+ if (!StringUtils.isEmpty(tTrainingRegular.getYear())) {
|
|
|
+ Iterator<TStaffmgr> iterator = staffmgrs.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ TStaffmgr t = iterator.next();
|
|
|
+ if (t.getLeftDate() != null && t.getDelFlag() == 9){
|
|
|
+ if (t.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() > 0l ) {
|
|
|
+ logger.debug(t.getName() + "离职时间小于培训时间");
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e) {
|
|
|
+ logger.error(e.toString());
|
|
|
+ }
|
|
|
for (TStaffmgr s : staffmgrs) {
|
|
|
TTrainingDevice tTrainingDevice = new TTrainingDevice();
|
|
|
tTrainingDevice.setStaffId(s.getStaffid());
|
|
@@ -198,7 +218,24 @@ public class TTrainingRegularController extends BaseController
|
|
|
logger.info("涉及MOC人员");
|
|
|
TStaffmgr staffmgrMoc = new TStaffmgr();
|
|
|
staffmgrMoc.setActualposts(tTrainingRegular.getDesignatedOther());
|
|
|
- List<TStaffmgr> staffmgrsMoc = tStaffmgrService.selectTStaffmgrList(staffmgrMoc);
|
|
|
+ List<TStaffmgr> staffmgrsMoc = tStaffmgrService.selectAllTStaffmgrList(staffmgrMoc);
|
|
|
+ try {
|
|
|
+ //判断离职
|
|
|
+ if (!StringUtils.isEmpty(tTrainingRegular.getYear())) {
|
|
|
+ Iterator<TStaffmgr> iterator = staffmgrsMoc.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ TStaffmgr t = iterator.next();
|
|
|
+ if (t.getLeftDate() != null && t.getDelFlag() == 9){
|
|
|
+ if (t.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() > 0l ) {
|
|
|
+ logger.debug(t.getName() + "离职时间小于培训时间");
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e) {
|
|
|
+ logger.error(e.toString());
|
|
|
+ }
|
|
|
for (TStaffmgr s : staffmgrsMoc) {
|
|
|
TTrainingDevice tTrainingDevice = new TTrainingDevice();
|
|
|
tTrainingDevice.setStaffId(s.getStaffid());
|
|
@@ -262,6 +299,23 @@ public class TTrainingRegularController extends BaseController
|
|
|
TStaffmgr staffmgrMoc = new TStaffmgr();
|
|
|
staffmgrMoc.setActualposts(tTrainingRegular.getDesignatedOther());
|
|
|
List<TStaffmgr> staffmgrsMoc = tStaffmgrService.selectTStaffmgrList(staffmgrMoc);
|
|
|
+ try {
|
|
|
+ //判断离职
|
|
|
+ if (!StringUtils.isEmpty(tTrainingRegular.getYear())) {
|
|
|
+ Iterator<TStaffmgr> iterator = staffmgrsMoc.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ TStaffmgr staffmgr2 = iterator.next();
|
|
|
+ if (staffmgr2.getLeftDate() != null && t.getDelFlag() == 9){
|
|
|
+ if (staffmgr2.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() > 0l ) {
|
|
|
+ logger.debug(staffmgr2.getName() + "离职时间小于培训时间");
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e) {
|
|
|
+ logger.error(e.toString());
|
|
|
+ }
|
|
|
//如果存在条目
|
|
|
if (oldRegular.getActualpostId() != null || oldRegular.getDesignatedStaff() != null || oldRegular.getInvolvedMoc().equals("true")) {
|
|
|
TTrainingDevice tTrainingDevice = new TTrainingDevice();
|
|
@@ -273,7 +327,24 @@ public class TTrainingRegularController extends BaseController
|
|
|
logger.info("参培岗位人员");
|
|
|
TStaffmgr staffmgr = new TStaffmgr();
|
|
|
staffmgr.setActualposts(tTrainingRegular.getActualpostId());
|
|
|
- List<TStaffmgr> staffmgrs = tStaffmgrService.selectTStaffmgrList(staffmgr);
|
|
|
+ List<TStaffmgr> staffmgrs = tStaffmgrService.selectAllTStaffmgrList(staffmgr);
|
|
|
+ try {
|
|
|
+ //判断离职
|
|
|
+ if (!StringUtils.isEmpty(tTrainingRegular.getYear())) {
|
|
|
+ Iterator<TStaffmgr> iterator = staffmgrs.iterator();
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ TStaffmgr staffmgr1 = iterator.next();
|
|
|
+ if (staffmgr1.getLeftDate() != null && t.getDelFlag() == 9){
|
|
|
+ if (staffmgr1.getLeftDate().getTime() - tTrainingRegular.getPlanTrainingdate().getTime() > 0l ) {
|
|
|
+ logger.debug(staffmgr1.getName() + "离职时间小于培训时间");
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch (Exception e) {
|
|
|
+ logger.error(e.toString());
|
|
|
+ }
|
|
|
for (TStaffmgr s : staffmgrs) {
|
|
|
TTrainingDevice tTrainingDevice = new TTrainingDevice();
|
|
|
tTrainingDevice.setStaffId(s.getStaffid());
|