Commit 5e9d9b5d authored by mengbali153's avatar mengbali153

培训计划

parent be2dfeca
......@@ -147,6 +147,7 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
}
@Override
@Transactional
public BaseResponse<PlanTraining> update(PlanTrainingQuery planTrainingQuery) {
PlanTraining update = new PlanTraining();
BeanUtils.copyProperties(planTrainingQuery, update);
......@@ -159,11 +160,12 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
boolean remove = iPlantPeopleService.remove(qw);
if (remove) {
Integer planId = update.getId();
List<PlanPeople> batchAdd = new ArrayList<>();
//todo 培训关联表对象 ==>plant + 基本用户信息
//拆分用户id
String userIds = planTrainingQuery.getUserIds();
String[] split = userIds.split("、");
List<PlanPeople> batchAdd = new ArrayList<>();
if (planTrainingQuery.getUserIds()!=null) {
//为每个用户id创建关联表信息s
for (String userId : split) {
Integer id = Integer.parseInt(userId);
......@@ -178,7 +180,9 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
batchAdd.add(planPeople);
update.setPlanObject(update.getPlanObject() + user.getName() + "、");
}
}
if (planTrainingQuery.getGroupIds()!=null) {
//传的GroupIds
String groupIds = planTrainingQuery.getGroupIds();
String[] split1 = groupIds.split("、");
......@@ -197,6 +201,8 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
planPeople.setGroupId(user.getGroupId());
batchAdd.add(planPeople);
update.setPlanObject(update.getPlanObject() + user.getName() + "、");
}
}
}
iPlantPeopleService.saveBatch(batchAdd);
......@@ -204,7 +210,6 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
update.setPlanObject(substring);
iPlanTrainingService.updateById(update);
}
return BaseResponse.okData(update);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment