"...platform/git@gitlab.ruzhoukj.com:wujipeng/relation.git" did not exist on "7bfe80fd54fd0e8e77f2ad77b3b3ed7ea58864d7"
Commit 6aa65f69 authored by wujipeng's avatar wujipeng
Browse files

用户关系修改

parent 26c2bacf
...@@ -24,9 +24,9 @@ public class UserDTO extends UserEntity { ...@@ -24,9 +24,9 @@ public class UserDTO extends UserEntity {
private Integer pageSize; private Integer pageSize;
@ApiModelProperty(value = "用户id") @ApiModelProperty(value = "用户id")
private String userId; private String userName;
@ApiModelProperty(value = "对方id") @ApiModelProperty(value = "对方id")
private String otherId; private String otherName;
} }
...@@ -20,18 +20,19 @@ public class UserRelationEntity { ...@@ -20,18 +20,19 @@ public class UserRelationEntity {
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
private Integer id; private Integer id;
@ApiModelProperty(value = "用户id")
@TableField("user_id")
private Integer userId;
@ApiModelProperty(value = "对方id")
@TableField("other_id")
private Integer otherId;
@ApiModelProperty(value = "用户名") @ApiModelProperty(value = "用户名")
@TableField("user_name") @TableField("user_name")
private String userName; private String userName;
@ApiModelProperty(value = "对方名")
@TableField("other_name")
private String otherName;
@ApiModelProperty(value = "案件id")
@TableField("case_id")
private String caseId;
@ApiModelProperty(value = "关系") @ApiModelProperty(value = "关系")
@TableField("relation_ship") @TableField("relation_ship")
private String relationShip; private String relationShip;
......
...@@ -54,7 +54,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -54,7 +54,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
List<UserAccountEntity> userAccountEntityList = userAccountService.queryListByUserName(userName); List<UserAccountEntity> userAccountEntityList = userAccountService.queryListByUserName(userName);
userVO.setUserAccountList(userAccountEntityList); userVO.setUserAccountList(userAccountEntityList);
} }
List<UserRelationEntity> relationShipList = userRelationService.list(new LambdaQueryWrapper<UserRelationEntity>().eq(UserRelationEntity::getUserId, userEntity.getId())); List<UserRelationEntity> relationShipList = userRelationService.list(new LambdaQueryWrapper<UserRelationEntity>()
.eq(UserRelationEntity::getUserName, userEntity.getUserName()).eq(UserRelationEntity::getCaseId, caseId));
if(!ObjectUtils.isEmpty(relationShipList)){ if(!ObjectUtils.isEmpty(relationShipList)){
userVO.setRelationShipList(relationShipList); userVO.setRelationShipList(relationShipList);
} }
...@@ -141,12 +142,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -141,12 +142,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
List<UserRelationEntity> relationShipList = userDTO.getRelationShipList(); List<UserRelationEntity> relationShipList = userDTO.getRelationShipList();
for (UserRelationEntity userRelationEntity : relationShipList) { for (UserRelationEntity userRelationEntity : relationShipList) {
userRelationEntity.setOtherId(userDTO.getId()); userRelationEntity.setOtherName(userDTO.getUserName());
userRelationEntity.setCaseId(userDTO.getCaseId());
} }
userRelationService.saveBatch(relationShipList); userRelationService.saveBatch(relationShipList);
for (UserRelationEntity userRelationEntity : relationShipList) { for (UserRelationEntity userRelationEntity : relationShipList) {
userRelationEntity.setOtherId(userRelationEntity.getUserId()); userRelationEntity.setOtherName(userRelationEntity.getUserName());
userRelationEntity.setUserId(userDTO.getId()); userRelationEntity.setUserName(userDTO.getUserName());
userRelationEntity.setCaseId(userDTO.getCaseId());
userRelationEntity.setId(null); userRelationEntity.setId(null);
} }
userRelationService.saveBatch(relationShipList); userRelationService.saveBatch(relationShipList);
...@@ -171,8 +174,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -171,8 +174,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
@Override @Override
public EveryoneVO relationPage(UserDTO userDTO) { public EveryoneVO relationPage(UserDTO userDTO) {
EveryoneVO everyoneVO = new EveryoneVO(); EveryoneVO everyoneVO = new EveryoneVO();
UserEntity oneself = getById(userDTO.getUserId()); UserEntity oneself = getOne(new LambdaQueryWrapper<UserEntity>()
UserEntity other = getById(userDTO.getOtherId()); .eq(UserEntity::getUserName, userDTO.getUserName()).eq(UserEntity::getCaseId, userDTO.getCaseId()),false);
UserEntity other = getOne(new LambdaQueryWrapper<UserEntity>()
.eq(UserEntity::getUserName, userDTO.getOtherName()).eq(UserEntity::getCaseId, userDTO.getCaseId()),false);
if(ObjectUtils.isEmpty(oneself) || ObjectUtils.isEmpty(other)){ if(ObjectUtils.isEmpty(oneself) || ObjectUtils.isEmpty(other)){
throw new BusinessException("用户不存在"); throw new BusinessException("用户不存在");
} }
...@@ -180,8 +185,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -180,8 +185,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
everyoneVO.setTitle(oneself.getUserName() + "," + other.getUserName()); everyoneVO.setTitle(oneself.getUserName() + "," + other.getUserName());
//查询关系 //查询关系
List<UserRelationEntity> userRelation = userRelationService.list(new LambdaQueryWrapper<UserRelationEntity>() List<UserRelationEntity> userRelation = userRelationService.list(new LambdaQueryWrapper<UserRelationEntity>()
.eq(UserRelationEntity::getUserId, userDTO.getUserId()) .eq(UserRelationEntity::getUserName, userDTO.getUserName())
.eq(UserRelationEntity::getOtherId, userDTO.getOtherId())); .eq(UserRelationEntity::getOtherName, userDTO.getOtherName()));
//指认关系 //指认关系
if(ObjectUtils.isEmpty(userRelation)){ if(ObjectUtils.isEmpty(userRelation)){
everyoneVO.setRelation(userRelation); everyoneVO.setRelation(userRelation);
......
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