|
|
|
@ -316,33 +316,58 @@ public class ClassifyServiceImpl extends BaseServiceImpl<ClassifyMapper, Classif
|
|
|
|
|
IndicatorsEntity indicatorsEntity = Func.copy(instanceofDTO, IndicatorsEntity.class); |
|
|
|
|
assert indicatorsEntity != null; |
|
|
|
|
indicatorsEntity.setIndicatorsStatus(1); |
|
|
|
|
// indicatorsEntity.setAssessUserId(user.getUserId());
|
|
|
|
|
// indicatorsEntity.setAssessDeptName(user.getNickName());
|
|
|
|
|
// 增加当前选择部门的负责人
|
|
|
|
|
|
|
|
|
|
R<List<User>> listR = userClient.userInfoByDept(user.getTenantId(), instanceofDTO.getAssessDept()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.info(">>>>>>>>>>>>> listR {}",listR); |
|
|
|
|
Long userId=null; |
|
|
|
|
String userName=null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(listR.isSuccess()){ |
|
|
|
|
|
|
|
|
|
Dept dept = deptClient.findEntityById(instanceofDTO.getAssessDept()); |
|
|
|
|
List<User> data = listR.getData(); |
|
|
|
|
// 获取仓库经理ID
|
|
|
|
|
R<String> roleIs = sysClient.getRoleIds(user.getTenantId(), "仓库经理"); |
|
|
|
|
R<String> roleIs; |
|
|
|
|
if(dept.getDeptCategory()==4){ |
|
|
|
|
|
|
|
|
|
// 获取仓库经理ID
|
|
|
|
|
roleIs = sysClient.getRoleIds(user.getTenantId(), "仓库经理"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else if(dept.getDeptCategory()==5){ |
|
|
|
|
roleIs = sysClient.getRoleIds(user.getTenantId(), "总部职能"); |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
|
|
roleIs= new R<>(); |
|
|
|
|
roleIs.setSuccess(false); |
|
|
|
|
log.error(">>>>>>>>>>>>> 考核部门获取失败"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
log.info(">>>>>>>>>>>>> roleIs {}",roleIs); |
|
|
|
|
|
|
|
|
|
if(roleIs.isSuccess()){ |
|
|
|
|
String roleId = roleIs.getData(); |
|
|
|
|
for (User datum : data) { |
|
|
|
|
log.info(">>>>>> women datum {}",datum); |
|
|
|
|
log.info(">>>>>> 寻找考核节点负责人 {}",datum); |
|
|
|
|
if(datum.getRoleId().contains(roleId)){ |
|
|
|
|
userId=datum.getId(); |
|
|
|
|
userName=datum.getRealName(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if(ObjectUtil.isEmpty(userId)){ |
|
|
|
|
return R.fail(403,"选择节点不存在仓库负责人"); |
|
|
|
|
return R.fail(403,"选择节点不存在负责人"); |
|
|
|
|
} |
|
|
|
|
indicatorsEntity.setAssessUserId(userId); |
|
|
|
|
indicatorsEntity.setAssessUserName(userName); |
|
|
|
|