修改只能绑定一个学生的问题

This commit is contained in:
张博 2024-11-06 13:12:17 +08:00
parent bada89d4c6
commit 21903ff992
2 changed files with 13 additions and 29 deletions

View File

@ -986,27 +986,6 @@ public class AppApiController {
relation.setCreateTime(new Date());
relation.setStatus(2);
relation.setRelation(params.get("salutation").toString());
Map<String,Object> opParams = new HashMap<>();
opParams.put("operation","editUserContactData");
opParams.put("accountNumber",globalValue.accountNumber);
opParams.put("passKey", KeysEntity.passKey);
opParams.put("empowerText",KeysEntity.empowerText);
List<Map<String,Object>> dataInfo = new ArrayList<>();
Map<String,Object> info = new HashMap<>();
info.put("objectUuid",user.getUserId().toString());
info.put("userUuid",user.getUserId().toString());
info.put("salutation",params.get("salutation"));
info.put("phoneNumber",user.getMobile());
info.put("orderNumber",1);
dataInfo.add(info);
opParams.put("dataInfo",dataInfo);
/* JSONObject jsonObject = opFeignClient.submitData(opParams);
if(!jsonObject.getString("shrgStatus").equals("S")) {
return R.error("同步联系人失败");
}
if(!jsonObject.getJSONArray("errInfo").isEmpty()) {
return R.error("同步联系人失败");
}*/
/* 请求参数:
{
"operation": "editUserContactData",
@ -1038,7 +1017,7 @@ public class AppApiController {
@Login
@PostMapping("/remove")
public R removeBing(@LoginUser AppUserEntity user, @RequestBody List<Map<String,Object>> params) {
public R removeBind(@LoginUser AppUserEntity user, @RequestBody List<Map<String,Object>> params) {
//AppUserScopeEntity userScopeEntity = appUserScopeService.getById(user.getCurrentScopeId());
Map<String,Object> opParams = new HashMap<>();
opParams.put("operation","delUserContactData");
@ -1047,8 +1026,17 @@ public class AppApiController {
opParams.put("empowerText",KeysEntity.empowerText);
List<Map<String,Object>> dataInfo = new ArrayList<>();
Map<String,Object> info = new HashMap<>();
info.put("objectUuid",user.getUserId());
dataInfo.add(info);
List<String> list = new ArrayList<>();
params.forEach(item -> {
list.add(item.get("personId").toString());
});
List<TenRelation> relations = relationService.list(new LambdaQueryWrapper<TenRelation>()
.eq(TenRelation::getParentId,user.getUserId())
.in(TenRelation::getStudentId,list));
relations.forEach(relation -> {
info.put("objectUuid",relation.getId());
dataInfo.add(info);
});
opParams.put("dataInfo",dataInfo);
JSONObject jsonObject = opFeignClient.submitData(opParams);
if(!jsonObject.getString("shrgStatus").equals("S")) {
@ -1057,10 +1045,6 @@ public class AppApiController {
if(!jsonObject.getJSONArray("errInfo").isEmpty()) {
return R.error("同步联系人失败");
}
List<String> list = new ArrayList<>();
params.forEach(item -> {
list.add(item.get("personId").toString());
});
relationService.remove(new LambdaQueryWrapper<TenRelation>()
.eq(TenRelation::getParentId,user.getUserId())
.in(TenRelation::getStudentId,list));

View File

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