修改绑定学生无法删除问题

This commit is contained in:
张博 2024-11-06 16:45:15 +08:00
parent 21903ff992
commit 04999c2708
3 changed files with 8 additions and 3 deletions

View File

@ -1034,7 +1034,7 @@ public class AppApiController {
.eq(TenRelation::getParentId,user.getUserId()) .eq(TenRelation::getParentId,user.getUserId())
.in(TenRelation::getStudentId,list)); .in(TenRelation::getStudentId,list));
relations.forEach(relation -> { relations.forEach(relation -> {
info.put("objectUuid",relation.getId()); info.put("objectUuid",relation.getId().toString());
dataInfo.add(info); dataInfo.add(info);
}); });
opParams.put("dataInfo",dataInfo); opParams.put("dataInfo",dataInfo);

View File

@ -31,6 +31,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping("ten/parent") @RequestMapping("ten/parent")
@ -78,7 +79,11 @@ public class TenParentController {
Map<String,Object> info = new HashMap<>(); Map<String,Object> info = new HashMap<>();
params.forEach(item -> { params.forEach(item -> {
TenParent tenParent = tenParentService.getById(item.get("id")); TenParent tenParent = tenParentService.getById(item.get("id"));
info.put("objectUuid",tenParent.getUserId().toString()); List<TenRelation> relations = relationService.list(new LambdaQueryWrapper<TenRelation>().eq(TenRelation::getParentId,tenParent.getUserId()));
List<Long> ids = relations.stream().map(TenRelation::getId).collect(Collectors.toList());
ids.stream().forEach(id -> {
info.put("objectUuid",id.toString());
});
dataInfo.add(info); dataInfo.add(info);
tenParentService.removeById(item.get("id")); tenParentService.removeById(item.get("id"));
appUserService.removeById(tenParent.getUserId()); appUserService.removeById(tenParent.getUserId());

View File

@ -72,7 +72,7 @@ public class TenRelationController extends AbstractController {
opParams.put("empowerText",KeysEntity.empowerText); opParams.put("empowerText",KeysEntity.empowerText);
List<Map<String,Object>> dataInfo = new ArrayList<>(); List<Map<String,Object>> dataInfo = new ArrayList<>();
Map<String,Object> info = new HashMap<>(); Map<String,Object> info = new HashMap<>();
info.put("objectUuid",tenRelation.getId()); info.put("objectUuid",tenRelation.getId().toString());
info.put("userUuid",tenRelation.getStudentId().toString()); info.put("userUuid",tenRelation.getStudentId().toString());
info.put("salutation",tenRelation.getRelation()); info.put("salutation",tenRelation.getRelation());
info.put("phoneNumber",appUser.getMobile()); info.put("phoneNumber",appUser.getMobile());