完善指定考核人员信息
This commit is contained in:
parent
8f38d222fa
commit
81aa664cb3
@ -1,11 +1,12 @@
|
|||||||
package com.lz.modules.flow.model;
|
package com.lz.modules.flow.model;
|
||||||
|
|
||||||
|
import com.lz.modules.flow.entity.EvaluationGroup;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
//组,人员ids
|
//组,人员ids
|
||||||
@Data
|
@Data
|
||||||
public class GroupStaffs {
|
public class GroupStaffs {
|
||||||
private Long groupId;
|
private EvaluationGroup evaluationGroup;
|
||||||
private List<Long> staffIds;
|
private List<Long> staffIds;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,5 +7,5 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class StartGroups {
|
public class StartGroups {
|
||||||
private Long startId;
|
private Long startId;
|
||||||
private List<GroupStaffs> staffIds;
|
private List<GroupStaffs> groups;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,10 +10,7 @@ import com.lz.modules.app.entity.StaffSimpleInfo;
|
|||||||
import com.lz.modules.app.service.StaffService;
|
import com.lz.modules.app.service.StaffService;
|
||||||
import com.lz.modules.flow.dao.FlowStartMapper;
|
import com.lz.modules.flow.dao.FlowStartMapper;
|
||||||
import com.lz.modules.flow.entity.*;
|
import com.lz.modules.flow.entity.*;
|
||||||
import com.lz.modules.flow.model.DepartManagers;
|
import com.lz.modules.flow.model.*;
|
||||||
import com.lz.modules.flow.model.ResultModelDto;
|
|
||||||
import com.lz.modules.flow.model.ResultTagetLibDto;
|
|
||||||
import com.lz.modules.flow.model.StartGroups;
|
|
||||||
import com.lz.modules.flow.service.*;
|
import com.lz.modules.flow.service.*;
|
||||||
import com.lz.modules.performance.service.ResultTagetLibService;
|
import com.lz.modules.performance.service.ResultTagetLibService;
|
||||||
import com.lz.modules.sys.entity.app.ResultDetail;
|
import com.lz.modules.sys.entity.app.ResultDetail;
|
||||||
@ -135,6 +132,28 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
if(staffSimpleInfos.size() == 0){
|
if(staffSimpleInfos.size() == 0){
|
||||||
return R.error("无有效考核人员,考核人员已离职");
|
return R.error("无有效考核人员,考核人员已离职");
|
||||||
}*/
|
}*/
|
||||||
|
Map<String, List<StaffEntity>> staffManages = new HashedMap();//部门(id+几级)和部门几级管理对应关系,减少数据库查找
|
||||||
|
for (GroupStaffs groupStaffs:startGroupStaffIds.getGroups()
|
||||||
|
) {
|
||||||
|
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(groupStaffs.getStaffIds());
|
||||||
|
if(staffSimpleInfos.size() == 0){
|
||||||
|
R.error(groupStaffs.getEvaluationGroup().getName() + "——无有效考核人员");
|
||||||
|
}
|
||||||
|
switch (start(groupStaffs.getEvaluationGroup(), flowStart, staffManages, staffSimpleInfos)){
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
return R.error(groupStaffs.getEvaluationGroup().getName() + "——没有设置考核模板");
|
||||||
|
case 2:
|
||||||
|
return R.error(groupStaffs.getEvaluationGroup().getName() + "——没有绩效流程节点");
|
||||||
|
case 3:
|
||||||
|
return R.error(groupStaffs.getEvaluationGroup().getName() + "——没有设置考核流程");
|
||||||
|
case 4:
|
||||||
|
return R.error(groupStaffs.getEvaluationGroup().getName() + "——没有设置绩效管理人员");
|
||||||
|
case 5:
|
||||||
|
return R.error(groupStaffs.getEvaluationGroup().getName() + "——初始化考核流程失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,44 +199,45 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
for (int n = 0; n < evaluationGroups.size(); n++
|
for (int n = 0; n < evaluationGroups.size(); n++
|
||||||
) {
|
) {
|
||||||
EvaluationGroup evaluationGroup = evaluationGroups.get(n);
|
EvaluationGroup evaluationGroup = evaluationGroups.get(n);
|
||||||
switch (start(evaluationGroup, flowStart, staffManages)){
|
|
||||||
case 1:
|
|
||||||
return R.error(evaluationGroup.getName() + "——无有效考核人员");
|
|
||||||
case 2:
|
|
||||||
return R.error(evaluationGroup.getName() + "——没有设置考核模板");
|
|
||||||
case 3:
|
|
||||||
return R.error(evaluationGroup.getName() + "——没有绩效流程节点");
|
|
||||||
case 4:
|
|
||||||
return R.error(evaluationGroup.getName() + "——没有设置考核流程");
|
|
||||||
case 5:
|
|
||||||
return R.error(evaluationGroup.getName() + "——没有设置绩效管理人员");
|
|
||||||
case 6:
|
|
||||||
return R.error(evaluationGroup.getName() + "——初始化考核流程失败");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return R.ok("发起成功").put("data", flowStart);
|
|
||||||
}
|
|
||||||
|
|
||||||
private int start(EvaluationGroup evaluationGroup, FlowStart flowStart, Map<String, List<StaffEntity>> staffManages){
|
|
||||||
|
|
||||||
//下面初始化员工考核流程
|
//下面初始化员工考核流程
|
||||||
List<StaffSimpleInfo> staffIds = evaluationGroupService.selectAllStaffSimpleInfoByGroupId(evaluationGroup);
|
List<StaffSimpleInfo> staffIds = evaluationGroupService.selectAllStaffSimpleInfoByGroupId(evaluationGroup);
|
||||||
|
|
||||||
if(staffIds.size() == 0){
|
if(staffIds.size() == 0){
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||||
|
|
||||||
return 1;
|
return R.error(evaluationGroup.getName() + "——无有效考核人员");
|
||||||
}
|
}
|
||||||
|
switch (start(evaluationGroup, flowStart, staffManages, staffIds)){
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
return R.error(evaluationGroup.getName() + "——没有设置考核模板");
|
||||||
|
case 2:
|
||||||
|
return R.error(evaluationGroup.getName() + "——没有绩效流程节点");
|
||||||
|
case 3:
|
||||||
|
return R.error(evaluationGroup.getName() + "——没有设置考核流程");
|
||||||
|
case 4:
|
||||||
|
return R.error(evaluationGroup.getName() + "——没有设置绩效管理人员");
|
||||||
|
case 5:
|
||||||
|
return R.error(evaluationGroup.getName() + "——初始化考核流程失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return R.ok("发起成功").put("data", flowStart);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int start(EvaluationGroup evaluationGroup, FlowStart flowStart,
|
||||||
|
Map<String, List<StaffEntity>> staffManages, List<StaffSimpleInfo> staffIds){
|
||||||
|
|
||||||
|
|
||||||
List<ResultModelDto> resultModelDtos = resultModelService.selectResultDtoByGroupId(evaluationGroup.getId());
|
List<ResultModelDto> resultModelDtos = resultModelService.selectResultDtoByGroupId(evaluationGroup.getId());
|
||||||
if(resultModelDtos.size() == 0){
|
if(resultModelDtos.size() == 0){
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||||
return 2;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<FlowChart> flowCharts = flowChartService.selectFlowChartsByGroupId(evaluationGroup.getId());
|
List<FlowChart> flowCharts = flowChartService.selectFlowChartsByGroupId(evaluationGroup.getId());
|
||||||
if(flowCharts.size() == 0){
|
if(flowCharts.size() == 0){
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||||
return 3;
|
return 2;
|
||||||
}
|
}
|
||||||
List<FlowChartDetailRecord> flowChartDetailRecords = new ArrayList<>();
|
List<FlowChartDetailRecord> flowChartDetailRecords = new ArrayList<>();
|
||||||
for (FlowChart chart:flowCharts
|
for (FlowChart chart:flowCharts
|
||||||
@ -229,7 +249,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
|
|
||||||
if(flowChartDetailRecords.size() == 0){
|
if(flowChartDetailRecords.size() == 0){
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||||
return 4;
|
return 3;
|
||||||
}
|
}
|
||||||
Map<Long, String> chartNameMaps =
|
Map<Long, String> chartNameMaps =
|
||||||
flowCharts.stream().collect(Collectors.toMap(FlowChart::getId, FlowChart::getName));//流程节点与流程名称对应map,下面多次循环,减少数据库查找
|
flowCharts.stream().collect(Collectors.toMap(FlowChart::getId, FlowChart::getName));//流程节点与流程名称对应map,下面多次循环,减少数据库查找
|
||||||
@ -249,15 +269,18 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
}
|
}
|
||||||
if(staffManagers == null || staffManagers.size() == 0){
|
if(staffManagers == null || staffManagers.size() == 0){
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||||
return 5;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
//下面拷贝一份考评组信息发起后所使用的考评组id为复制后的id
|
//下面拷贝一份考评组信息发起后所使用的考评组id为复制后的id
|
||||||
|
if(evaluationGroup.getCopyId() == null){
|
||||||
evaluationGroup.setCopyId(evaluationGroup.getId());
|
evaluationGroup.setCopyId(evaluationGroup.getId());
|
||||||
evaluationGroup.setId(null);
|
evaluationGroup.setId(null);
|
||||||
evaluationGroup.setGmtCreate(null);
|
evaluationGroup.setGmtCreate(null);
|
||||||
evaluationGroup.setGmtModified(null);
|
evaluationGroup.setGmtModified(null);
|
||||||
evaluationGroupService.insertEvaluationGroup(evaluationGroup);
|
evaluationGroupService.insertEvaluationGroup(evaluationGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//拷贝考评组的指标信息
|
//拷贝考评组的指标信息
|
||||||
List<ResultTagetLib> resultTagetLibs = new ArrayList<>();
|
List<ResultTagetLib> resultTagetLibs = new ArrayList<>();
|
||||||
@ -512,7 +535,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
|||||||
//如果有下面通知所有管理人员
|
//如果有下面通知所有管理人员
|
||||||
}else{
|
}else{
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||||
return 6;
|
return 5;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user