Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0
This commit is contained in:
commit
658fdc1d08
@ -1033,7 +1033,7 @@ public class ResultRecordController extends AbstractController {
|
|||||||
*
|
*
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
// http://localhost:8080/lz_management/user/lzresultrecord/new/resultRecordDetail?resultRecordId=387&loginUserId=380
|
// http://localhost:8080/lz_management/user/lzresultrecord/new/resultRecordDetail?resultRecordId=491&loginUserId=408
|
||||||
@RequestMapping("/new/resultRecordDetail")
|
@RequestMapping("/new/resultRecordDetail")
|
||||||
public R newResultRecordList(RecordDetailDto recordDetailDto) {
|
public R newResultRecordList(RecordDetailDto recordDetailDto) {
|
||||||
if(recordDetailDto.getLoginUserId() ==null && getUser() !=null ){
|
if(recordDetailDto.getLoginUserId() ==null && getUser() !=null ){
|
||||||
|
|||||||
@ -261,7 +261,7 @@ public class TestController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// http://localhost:8080/lz_management/test/resultrecord?resultRecordId=415
|
// http://localhost:8080/lz_management/test/resultrecord?resultRecordId=475
|
||||||
@RequestMapping("/test/resultrecord")
|
@RequestMapping("/test/resultrecord")
|
||||||
public void resultRecorcd(Long resultRecordId) throws Exception{
|
public void resultRecorcd(Long resultRecordId) throws Exception{
|
||||||
R r = resultRecordService.initFlowRecord(resultRecordId);
|
R r = resultRecordService.initFlowRecord(resultRecordId);
|
||||||
|
|||||||
@ -10,5 +10,6 @@ public class FlowDetailResp {
|
|||||||
private String departName;
|
private String departName;
|
||||||
private String avatar;
|
private String avatar;
|
||||||
private int status ;
|
private int status ;
|
||||||
|
private int transfer;
|
||||||
|
private int tiaozhuang;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,7 +69,10 @@ public interface StaffRoleService extends IService<StaffRole> {
|
|||||||
List<StaffRole> selectMastRoles();
|
List<StaffRole> selectMastRoles();
|
||||||
//获取管理全部考评组
|
//获取管理全部考评组
|
||||||
List<StaffRole> selectAllGroupManageRoles();
|
List<StaffRole> selectAllGroupManageRoles();
|
||||||
|
|
||||||
List<StaffRole> selectAllStaffRoleByDepartmentLevel(List<String> asList);
|
List<StaffRole> selectAllStaffRoleByDepartmentLevel(List<String> asList);
|
||||||
|
|
||||||
List<StaffRole> selectByEvaluationGroupId(Long id);
|
List<StaffRole> selectByEvaluationGroupId(Long id);
|
||||||
|
|
||||||
|
StaffRole selectStaffRolesByStaffIdDepartmentLevelList(Long loginUserId, List<String> asList);
|
||||||
}
|
}
|
||||||
@ -33,6 +33,7 @@ import com.lz.modules.sys.entity.SysRoleEntity;
|
|||||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -565,4 +566,11 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
|||||||
public List<StaffRole> selectByEvaluationGroupId(Long groupId){
|
public List<StaffRole> selectByEvaluationGroupId(Long groupId){
|
||||||
return staffRoleMapper.selectByEvaluationGroupId(groupId);
|
return staffRoleMapper.selectByEvaluationGroupId(groupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StaffRole selectStaffRolesByStaffIdDepartmentLevelList(Long staffId, List<String> departmentLevels) {
|
||||||
|
|
||||||
|
return staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevelList(staffId,departmentLevels);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.lz.modules.sys.service.app.impl;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
import com.lz.common.emun.WorkMsgTypeEnum;
|
import com.lz.common.emun.WorkMsgTypeEnum;
|
||||||
import com.lz.common.exception.RRException;
|
import com.lz.common.exception.RRException;
|
||||||
import com.lz.common.utils.*;
|
import com.lz.common.utils.*;
|
||||||
@ -1083,6 +1084,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordId(recordDetailDto.getResultRecordId());
|
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordId(recordDetailDto.getResultRecordId());
|
||||||
List<FlowRecordResp> flowRecordList = new ArrayList<>();
|
List<FlowRecordResp> flowRecordList = new ArrayList<>();
|
||||||
int flowIndex = -1;
|
int flowIndex = -1;
|
||||||
|
ResultRecord resultRecord = resultRecordService.selectResultRecordById(recordDetailDto.getResultRecordId());
|
||||||
for (FlowRecord flowRecord : flowRecords) {
|
for (FlowRecord flowRecord : flowRecords) {
|
||||||
if (flowRecord.getFlowIndex().equals(flowIndex)) { //表示有重复数据
|
if (flowRecord.getFlowIndex().equals(flowIndex)) { //表示有重复数据
|
||||||
FlowRecordResp lastResp = flowRecordList.get(flowRecordList.size() - 1);
|
FlowRecordResp lastResp = flowRecordList.get(flowRecordList.size() - 1);
|
||||||
@ -1094,7 +1096,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
boolean flag2 = false;
|
boolean flag2 = false;
|
||||||
boolean flag4 = false;
|
boolean flag4 = false;
|
||||||
List<FlowDetailResp> flowDetailRespList = lastResp.getFlowDetailRespList();
|
List<FlowDetailResp> flowDetailRespList = lastResp.getFlowDetailRespList();
|
||||||
mySetFlowDetailRespList(flowDetailRespList, flowRecord);
|
mySetFlowDetailRespList(flowDetailRespList, flowRecord,recordDetailDto.getLoginUserId(),resultRecord.getStaffId());
|
||||||
for (FlowRecord mul : mulFlowRecord) {
|
for (FlowRecord mul : mulFlowRecord) {
|
||||||
if (mul.getStatus().equals(FlowRecordStatusEnums.UN_TO_STATUS.getStatus())) {
|
if (mul.getStatus().equals(FlowRecordStatusEnums.UN_TO_STATUS.getStatus())) {
|
||||||
flag0 = true;
|
flag0 = true;
|
||||||
@ -1138,7 +1140,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
resp.setStatus(flowRecord.getStatus() == 2 ? 1 : flowRecord.getStatus());
|
resp.setStatus(flowRecord.getStatus() == 2 ? 1 : flowRecord.getStatus());
|
||||||
|
|
||||||
List<FlowDetailResp> flowDetailRespList = new ArrayList<>();
|
List<FlowDetailResp> flowDetailRespList = new ArrayList<>();
|
||||||
mySetFlowDetailRespList(flowDetailRespList,flowRecord);
|
mySetFlowDetailRespList(flowDetailRespList,flowRecord,recordDetailDto.getLoginUserId(),resultRecord.getStaffId());
|
||||||
resp.setFlowDetailRespList(flowDetailRespList);
|
resp.setFlowDetailRespList(flowDetailRespList);
|
||||||
flowRecordList.add(resp);
|
flowRecordList.add(resp);
|
||||||
flowIndex = flowRecord.getFlowIndex();
|
flowIndex = flowRecord.getFlowIndex();
|
||||||
@ -1186,16 +1188,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
}
|
}
|
||||||
if(currentResultRecord !=null){
|
if(currentResultRecord !=null){
|
||||||
if(StringUtil.isNotBlank(currentResultRecord.getFlowStaffIdRole())){
|
if(StringUtil.isNotBlank(currentResultRecord.getFlowStaffIdRole())){
|
||||||
Map<String,Object> map = JSONObject.parseObject(currentResultRecord.getFlowStaffIdRole(),Map.class);
|
auth = getAuth(currentFlowRecord.getFlowStaffIdRole());
|
||||||
List<Long> roleIds = null;
|
|
||||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
|
||||||
if(entry.getValue() !=null ){
|
|
||||||
roleIds = JSON.parseArray(entry.getValue().toString(),Long.class);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(roleIds !=null && roleIds.size() > 0){
|
|
||||||
auth = recordAuthService.selectAuthByRoleIds(roleIds);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1207,7 +1200,23 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void mySetFlowDetailRespList(List<FlowDetailResp> flowDetailRespList ,FlowRecord flowRecord){
|
public Map<String,Integer> getAuth(String flowStaffIdRole){
|
||||||
|
Map<String,Integer> auth = Maps.newHashMap();
|
||||||
|
Map<String,Object> map = JSONObject.parseObject(flowStaffIdRole,Map.class);
|
||||||
|
List<Long> roleIds = null;
|
||||||
|
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||||
|
if(entry.getValue() !=null ){
|
||||||
|
roleIds = JSON.parseArray(entry.getValue().toString(),Long.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(roleIds !=null && roleIds.size() > 0){
|
||||||
|
auth = recordAuthService.selectAuthByRoleIds(roleIds);
|
||||||
|
}
|
||||||
|
return auth;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void mySetFlowDetailRespList(List<FlowDetailResp> flowDetailRespList ,FlowRecord flowRecord,Long loginUserId,Long recordStaffId){
|
||||||
FlowDetailResp flowDetailResp = new FlowDetailResp();
|
FlowDetailResp flowDetailResp = new FlowDetailResp();
|
||||||
flowDetailResp.setCurrentStaffId(flowRecord.getApprovalStaffId());
|
flowDetailResp.setCurrentStaffId(flowRecord.getApprovalStaffId());
|
||||||
flowDetailResp.setStaffName(flowRecord.getApprovalStaffName());
|
flowDetailResp.setStaffName(flowRecord.getApprovalStaffName());
|
||||||
@ -1223,13 +1232,66 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
StaffEntity staffEntity = staffService.selectStaffById(flowRecord.getApprovalStaffId());
|
StaffEntity staffEntity = staffService.selectStaffById(flowRecord.getApprovalStaffId());
|
||||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(flowRecord.getApprovalStaffId());
|
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(flowRecord.getApprovalStaffId());
|
||||||
flowDetailResp.setAvatar(staffEntity.getAvatar());
|
flowDetailResp.setAvatar(staffEntity.getAvatar());
|
||||||
if(departmentsStaffRelateEntity !=null){
|
DepartmentsEntity departmentsEntity = departmentsDao.selectByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||||
DepartmentsEntity departmentsEntity = departmentsDao.selectByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
flowDetailResp.setDepartName(departmentsEntity.getDepartmentName());
|
||||||
flowDetailResp.setDepartName(departmentsEntity.getDepartmentName());
|
if(new Integer(0).equals(flowRecord.getStatus()) || new Integer(2).equals(flowRecord.getStatus()) ){
|
||||||
}
|
int position = 0 ;
|
||||||
|
StaffRole staffRole = staffRoleService.selectStaffRolesByStaffIdDepartmentLevelList(loginUserId,
|
||||||
|
Arrays.asList(new String[]{RoleEnums.CHILD_PM.getName(),RoleEnums.MASTER_PM.getName()}));
|
||||||
|
if(staffRole !=null ){
|
||||||
|
boolean flag = false;
|
||||||
|
if(staffRole.getDepartmentId() == 0 ){
|
||||||
|
flag = true ;
|
||||||
|
}else {
|
||||||
|
Map<String, String> map = departmentsService.selectUserAllDepartmentIds(departmentsStaffRelateEntity.getDepartmentId());
|
||||||
|
List<StaffRoleDepartment> staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId());
|
||||||
|
for (StaffRoleDepartment staffRoleDepartment : staffRoleDepartments) {
|
||||||
|
String departmentName = map.get(staffRoleDepartment.getDepartmentId());
|
||||||
|
if (StringUtil.isNotBlank(departmentName)) {
|
||||||
|
flag = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(flag){
|
||||||
|
log.info("当前 loginUserId : " + loginUserId + ",是管理员");
|
||||||
|
position = 1;//表示当前是绩效管理员
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(position == 0 && flowRecord.getApprovalStaffId().equals(loginUserId) && !loginUserId.equals(recordStaffId) ){
|
||||||
|
log.info("当前 loginUserId : " + loginUserId + ",是审批节点人员");
|
||||||
|
position = 2 ;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 1:绩效管理员进来
|
||||||
|
* 1.1:转交 都有
|
||||||
|
* 1.2:跳过都有
|
||||||
|
* 2:审批节点人员
|
||||||
|
* 2.1:转交根据初始化数据来确定自己所在节点的权限
|
||||||
|
* 2.2:跳转都没有
|
||||||
|
* 3:普通员工
|
||||||
|
* 3.1:转交没有
|
||||||
|
* 3.2:跳转没有
|
||||||
|
*/
|
||||||
|
if(position == 1){ //如果是绩效管理员
|
||||||
|
initTiaoZhuangZhuangJiao(flowDetailResp,1,1);
|
||||||
|
}else if (position == 2 ){ //如果是审批节点人员
|
||||||
|
Map<String,Integer> auth = getAuth(flowRecord.getFlowStaffIdRole());
|
||||||
|
if(new Integer(1).equals(auth.get("transfer"))){
|
||||||
|
flowDetailResp.setTransfer(1);
|
||||||
|
}
|
||||||
|
}//如果是普通员工,没有跳转和转交的权限
|
||||||
|
}//如果流程节点己经走了,直接返回不可跳转,不可转交
|
||||||
flowDetailRespList.add(flowDetailResp);
|
flowDetailRespList.add(flowDetailResp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void initTiaoZhuangZhuangJiao(FlowDetailResp flowDetailResp,int tiaoZhuang,int transfer){
|
||||||
|
flowDetailResp.setTiaozhuang(tiaoZhuang);
|
||||||
|
flowDetailResp.setTransfer(transfer);
|
||||||
|
}
|
||||||
|
|
||||||
public StaffEntity getDepartmentStaff(Long staffId, int level) {
|
public StaffEntity getDepartmentStaff(Long staffId, int level) {
|
||||||
DepartManagers departManagers = staffService.findLeader( staffId, level);
|
DepartManagers departManagers = staffService.findLeader( staffId, level);
|
||||||
List<StaffEntity> staffEntities = departManagers.getManagers();
|
List<StaffEntity> staffEntities = departManagers.getManagers();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user