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

用户关系修改

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