Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
杜建超 2020-11-12 09:48:54 +08:00
commit dfbd14a568
8 changed files with 81 additions and 8 deletions

View File

@ -387,9 +387,10 @@ public class ResultRecordController extends AbstractController {
staffs.addAll(departManagers.getManagers());
}
}
/*if(staffs.size() == 0){
return R.error("找不到有效的评分人,设置的评分人不存在");
}*/
if(staffs.size() == 0){
log.info("无法找到评分人员,开始找绩效管理人员");
staffs = staffService.findManger(resultRecord.getId(), 4);
}
for (StaffEntity staff:staffs
) {

View File

@ -98,4 +98,6 @@ public interface StaffDao extends BaseMapper<StaffEntity> {
List<StaffEntity> selectNamesByIds(@Param("list") List<Long> sIds);
List<StaffEntity> selectStaffsByGroupId(@Param("copyId") Long copyId);
List<StaffEntity> findManger(@Param("recordId") Long recordId, @Param("flowProcess") int flowProcess);
}

View File

@ -103,5 +103,7 @@ public interface StaffService extends IService<StaffEntity> {
List<StaffEntity> selectNamesByIds(List<Long> sIds);
//获取绩效考核管理员
List<StaffEntity> selectStaffsByGroupId(Long copyId);
List<StaffEntity> findManger(Long recordId, int flowProcess);
}

View File

@ -529,5 +529,10 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
return staffDao.selectStaffsByGroupId(copyId);
}
@Override
public List<StaffEntity> findManger(Long recordId, int flowProcess){
return staffDao.findManger(recordId, flowProcess);
}
}

View File

@ -58,4 +58,5 @@ public interface EvaluationGroupService extends IService<EvaluationGroup> {
String getEvaluationCopyIdsByEvaluationIds(String evaluationIds,Long startId);
EvaluationGroup selectEvaluationGroupByCopyId(Long copyId, Long startId);
}

View File

@ -414,4 +414,8 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
return StringUtils.join(ids,",");
}
@Override
public EvaluationGroup selectEvaluationGroupByCopyId(Long copyId, Long startId){
return evaluationGroupMapper.selectEvaluationGroupByCopyId(copyId, startId);
}
}

View File

@ -149,7 +149,8 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
log.info("无有效考核人员");
R.error(groupStaffs.getEvaluationGroup().getName() + "——无有效考核人员");
}
switch (start(groupStaffs.getEvaluationGroup(), flowStart, staffManages, staffSimpleInfos, mustRole, selfMustRole)){
switch (start(groupStaffs.getEvaluationGroup(), flowStart, staffManages, staffSimpleInfos, mustRole, selfMustRole, true)){
case 1:
return R.error(groupStaffs.getEvaluationGroup().getName() + "——没有设置考核模板");
@ -278,7 +279,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
switch (start(evaluationGroup, flowStart, staffManages, staffIds, mustRole, selfMustRole)){
switch (start(evaluationGroup, flowStart, staffManages, staffIds, mustRole, selfMustRole, false)){
case 1:
return R.error(evaluationGroup.getName() + "——没有设置考核模板");
@ -295,10 +296,10 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
}
return R.ok("发起成功").put("data", flowStart);
}
//isInsert表示是否中途加人
private int start(EvaluationGroup evaluationGroup, FlowStart flowStart,
Map<String, List<StaffEntity>> staffManages, List<StaffSimpleInfo> staffIds,
Map<Long, List<FlowChartRole>> mustRole, Map<Long, List<FlowChartRole>> selfMustRole){
Map<Long, List<FlowChartRole>> mustRole, Map<Long, List<FlowChartRole>> selfMustRole, boolean isInsert){
List<ResultModelDto> resultModelDtos = resultModelService.selectResultDtoByGroupId(evaluationGroup.getId());
@ -340,7 +341,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
}
//下面拷贝一份考评组信息发起后所使用的考评组id为复制后的id
if(evaluationGroup.getCopyId() == null || evaluationGroup.getCopyId().longValue() == 0L){
if(!isInsert){
evaluationGroup.setCopyId(evaluationGroup.getId());
evaluationGroup.setId(null);
evaluationGroup.setGmtCreate(null);
@ -378,6 +379,56 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
//插入备份的考评组指标信息
resultTagetLibService.insertResultTagetLibs(resultTagetLibs);
}
}else{//流程流转中中途加人走的流程
evaluationGroup =
evaluationGroupService.selectEvaluationGroupByCopyId(evaluationGroup.getId(),flowStart.getId());
if(evaluationGroup == null){
log.info("无法assess/manager/detail找到拷贝组信息");
return 5;
}
//以下代码没必要更新因为这个拷贝分用不到正确的对应关系清查看lz_evaluation_start_staff
//evaluationGroup.setStaffIds(evaluationGroup.getStaffIds() + ",");
List<EvaluationStartStaff> evaluationStartStaffs = new ArrayList<>();
//下面初始化参与人员
for (StaffSimpleInfo staffInfo:staffIds
) {
staffInfo.setStartId(flowStart.getId());
EvaluationStartStaff evaluationStartStaff = new EvaluationStartStaff();
evaluationStartStaff.setEvaluationId(evaluationGroup.getId());
evaluationStartStaff.setEvaluationName(evaluationGroup.getName());
evaluationStartStaff.setStaffId(staffInfo.getId());
evaluationStartStaff.setStartId(flowStart.getId());
evaluationStartStaff.setDepartmentId(staffInfo.getDepartmentId());
evaluationStartStaff.setType(CheckStaffType.STAFF.getCode());
evaluationStartStaffs.add(evaluationStartStaff);
//初始化lz_result_records数据
ResultRecord resultRecord = new ResultRecord();
resultRecord.setDepartmentId(staffInfo.getDepartmentId());
resultRecord.setDepartmentName(staffInfo.getDepartmentName());
resultRecord.setStaffId(staffInfo.getId());
resultRecord.setStaffName(staffInfo.getName());
resultRecord.setType(1);//设置为提交目标
resultRecord.setStatus(0);//设置为新建
resultRecord.setStartId(flowStart.getId());
resultRecord.setEvaluationId(evaluationGroup.getId());
resultRecord.setFlowProcess(0);//设置为目标制定
//设置当前审批员工id current_approval_staff_id
resultRecord.setCurrentApprovalStaffId(staffInfo.getId());
//设置当前审批员工姓名 current_approval_staff_name
resultRecord.setCurrentApprovalStaffName(staffInfo.getName());
resultRecordService.insertResultRecord(resultRecord);
staffInfo.setRecordId(resultRecord.getId());
//下面生成实际的考核流程
resultRecordService.initFlowRecord(resultRecord.getId());
}
evaluationStartStaffService.insertEvaluationStartStaffs(evaluationStartStaffs);
return 0;
}

View File

@ -545,4 +545,11 @@
) and is_delete=0) as staff join lz_staff_occupation as occupation on staff.id = occupation.staff_id where occupation.staff_status=0
</select>
<select id="findManger" resultType="com.lz.modules.app.entity.StaffEntity">
select staff.* from lz_staff as staff join lz_flow_record as record
on record.approval_staff_id = staff.id
where record.record_id = #{recordId} and record.flow_process=#{flowProcess}
</select>
</mapper>