提交修改
This commit is contained in:
parent
b37f63d2b5
commit
1279d9ebdd
@ -17,6 +17,4 @@ public class FlowRecordResp {
|
||||
|
||||
private List<FlowDetailResp> flowDetailRespList;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1094,6 +1094,7 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByResultRecordId(recordDetailDto.getResultRecordId());
|
||||
List<FlowRecordResp> flowRecordList = new ArrayList<>();
|
||||
int flowIndex = -1;
|
||||
Long flowRecordId= 0l;
|
||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(recordDetailDto.getResultRecordId());
|
||||
for (FlowRecord flowRecord : flowRecords) {
|
||||
if (flowRecord.getFlowIndex().equals(flowIndex)) { //表示有重复数据
|
||||
@ -1187,7 +1188,6 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
if( flowProcess <= 4 ){
|
||||
auth.put("showScore",0);
|
||||
}
|
||||
|
||||
FlowRecord currentResultRecord = null;
|
||||
for(FlowRecord flowRecord:currentResultRecords){
|
||||
if(flowRecord.getApprovalStaffId().equals(recordDetailDto.getLoginUserId())){
|
||||
@ -1199,26 +1199,19 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
if(currentResultRecord !=null){
|
||||
if(StringUtil.isNotBlank(currentResultRecord.getFlowStaffIdRole())){
|
||||
auth = getAuth(currentFlowRecord.getFlowStaffIdRole());
|
||||
flowRecordId = currentFlowRecord.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(FlowRecordResp flowRecordResp : flowRecordList){
|
||||
List<FlowDetailResp> flowDetailResps = flowRecordResp.getFlowDetailRespList();
|
||||
if(flowDetailResps !=null && flowDetailResps.size() ==1 && flowRecordResp.getRealStatus() == 2){
|
||||
auth.put("transfer",flowDetailResps.get(0).getTransfer());
|
||||
auth.put("tiaozhuang",0);
|
||||
}
|
||||
}
|
||||
|
||||
auth.put("tiaozhuang",0);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("flowRecordList", flowRecordList);
|
||||
map.put("resultCommentList", resultCommentList);
|
||||
map.put("auth",auth);
|
||||
map.put("flowRecordId",flowRecordId);
|
||||
return R.ok().put("data", map);
|
||||
}
|
||||
|
||||
|
||||
public Map<String,Integer> getAuth(String flowStaffIdRole){
|
||||
Map<String,Integer> auth = Maps.newHashMap();
|
||||
Map<String,Object> map = JSONObject.parseObject(flowStaffIdRole,Map.class);
|
||||
@ -1253,60 +1246,49 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
||||
DepartmentsEntity departmentsEntity = departmentsDao.selectByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||
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 ;
|
||||
}
|
||||
int position = getRole(loginUserId,departmentsStaffRelateEntity) ;
|
||||
/**
|
||||
* 1:绩效管理员进来
|
||||
* 1.1:转交 都有
|
||||
* 1.2:跳过都有
|
||||
* 2:审批节点人员
|
||||
* 2.1:转交根据初始化数据来确定自己所在节点的权限
|
||||
* 2.2:跳转都没有
|
||||
* 3:普通员工
|
||||
* 3.1:转交没有
|
||||
* 3.2:跳转没有
|
||||
1:绩效管理员的权限只在里面
|
||||
2:流程节点的授权只展示在外面(里面不展示)
|
||||
3:既是绩效管理员和审批节点人员,里面展示,外面根据节点授权情况来确定是否展示
|
||||
*/
|
||||
if(position == 1){ //如果是绩效管理员
|
||||
initTiaoZhuangZhuangJiao(flowDetailResp,1,1);
|
||||
if(flowRecord.getFlowProcess() == 0 ){//目标制定有转交,但是没有跳过
|
||||
initTiaoZhuangZhuangJiao(flowDetailResp,0,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);
|
||||
}
|
||||
|
||||
|
||||
public int getRole(Long loginUserId ,DepartmentsStaffRelateEntity departmentsStaffRelateEntity){
|
||||
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;//表示当前是绩效管理员
|
||||
}
|
||||
}
|
||||
return position;
|
||||
}
|
||||
|
||||
public void initTiaoZhuangZhuangJiao(FlowDetailResp flowDetailResp,int tiaoZhuang,int transfer){
|
||||
flowDetailResp.setTiaozhuang(tiaoZhuang);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user