|
|
@@ -92,7 +92,7 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
|
|
|
SysOrg sysOrg = RemoteCallHandlerExecutor.executeRemoteCall(() -> orgService.selectTopOrg(SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
|
|
|
List<CoreEduTrainingPlanPageVo> records = page.getRecords();
|
|
|
for (CoreEduTrainingPlanPageVo record : records) {
|
|
|
- dealData(record, records, sysOrg.getId());
|
|
|
+ dealData(record, records, sysOrg.getId(),request);
|
|
|
}
|
|
|
//抓换为TableDataInfo适配前端
|
|
|
TableDataInfo<CoreEduTrainingPlanPageVo> tableDataInfo = new TableDataInfo();
|
|
|
@@ -105,28 +105,31 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void dealData(CoreEduTrainingPlanPageVo record, List<CoreEduTrainingPlanPageVo> records, Long orgId) {
|
|
|
+ private void dealData(CoreEduTrainingPlanPageVo record, List<CoreEduTrainingPlanPageVo> records, Long orgId, CoreEduTrainingPlanPageDto request) {
|
|
|
record.setNo(records.indexOf(record) + 1);
|
|
|
if (ObjectUtil.equal(record.getCreateOrgId(), orgId)) {
|
|
|
record.setCreateByTopOrg(1);
|
|
|
}
|
|
|
String roleNameList = coreEduTrainingPlanToRoleMapper.selectRoleNameByPlanId(record.getId()).stream().map(CoreEduTrainingPlanRoleVo::getRoleName).collect(Collectors.joining(","));
|
|
|
record.setPlanRoleNameList(roleNameList);
|
|
|
- List<CoreEduTrainingPlan> planList = coreEduTrainingPlanMapper.selectList(new LambdaQueryWrapper<CoreEduTrainingPlan>().eq(CoreEduTrainingPlan::getParentId, record.getId()));
|
|
|
- List<CoreEduTrainingPlanPageVo> children = BeanHelper.copyProperties(planList, CoreEduTrainingPlanPageVo.class);
|
|
|
- final List<Long> collect = children.stream().map(CoreEduTrainingPlanPageVo::getUpdateBy).map(Long::valueOf).distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
+ /* List<CoreEduTrainingPlan> planList = coreEduTrainingPlanMapper.selectList(new LambdaQueryWrapper<CoreEduTrainingPlan>().eq(CoreEduTrainingPlan::getParentId, record.getId()));
|
|
|
+ List<CoreEduTrainingPlanPageVo> children = BeanHelper.copyProperties(planList, CoreEduTrainingPlanPageVo.class);*/
|
|
|
+ request.setId(record.getId());
|
|
|
+ List<CoreEduTrainingPlanPageVo> children = coreEduTrainingPlanMapper.selectChildrenPlan(request);
|
|
|
+/* final List<Long> collect = children.stream().map(CoreEduTrainingPlanPageVo::getUpdateBy).map(Long::valueOf).distinct().collect(Collectors.toList());
|
|
|
final List<IdNameVo> idNameVos = RemoteCallHandlerExecutor.executeRemoteCall(() -> remoteRoleService.getNames(new RoleConditionEto(collect)), ErrorMsgConstants.QUERY_ROLE_DATA_ERROR);
|
|
|
|
|
|
//将idNameVos使用steam转为map
|
|
|
- final Map<Long, String> idNameMap = idNameVos.stream().collect(Collectors.toMap(IdNameVo::getId, IdNameVo::getName));
|
|
|
+ final Map<Long, String> idNameMap = idNameVos.stream().collect(Collectors.toMap(IdNameVo::getId, IdNameVo::getName));*/
|
|
|
record.setChildren(children);
|
|
|
record.setHasChildren(ObjectUtil.isNotEmpty(children));
|
|
|
for (CoreEduTrainingPlanPageVo child : children) {
|
|
|
if (ObjectUtil.equal(child.getCreateOrgId(), orgId)) {
|
|
|
child.setCreateByTopOrg(1);
|
|
|
}
|
|
|
- final String name = idNameMap.get(Long.valueOf(child.getUpdateBy()));
|
|
|
- child.setUpdateBy(name);
|
|
|
+ /*final String name = idNameMap.get(Long.valueOf(child.getUpdateBy()));
|
|
|
+ child.setUpdateBy(name);*/
|
|
|
child.setPlanRoleNameList(roleNameList);
|
|
|
}
|
|
|
}
|
|
|
@@ -281,6 +284,7 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
|
|
|
}
|
|
|
|
|
|
public void batchSavePlanToRole(List<Long> roleIdList, Long planId) {
|
|
|
+ roleIdList.removeIf(Objects::isNull);
|
|
|
if (ObjectUtil.isEmpty(roleIdList)) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -297,6 +301,7 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
|
|
|
}
|
|
|
|
|
|
public void batchSavePlanToExecOrg(List<Long> orgIdList, Long planId) {
|
|
|
+ orgIdList.removeIf(Objects::isNull);
|
|
|
if (ObjectUtil.isEmpty(orgIdList)) {
|
|
|
return;
|
|
|
}
|