Commit dfb83adc authored by wujipeng's avatar wujipeng
Browse files

updateMerchantToPerson优化

parent d2d240da
......@@ -33,7 +33,7 @@ public interface UserService extends IService<UserEntity> {
Boolean delete(String userName);
UserEntity getByUserName(String newName);
UserEntity getByUserName(String newName, int caseId);
List<String> queryListByCaseId(Integer id);
......
......@@ -435,7 +435,7 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
excelDataService.updateBatchById(excelDataEntityList);
}
//格局新名查看用户数据
UserEntity userEntity = userService.getByUserName(userDTO.getNewName());
UserEntity userEntity = userService.getByUserName(userDTO.getOldName(), userDTO.getCaseId());
if (userEntity == null) {
//新增用户
userEntity = new UserEntity();
......@@ -445,7 +445,11 @@ public class CaseServiceImpl extends ServiceImpl<CaseMapper, CasesEntity> implem
userEntity.setBasicInfo(userDTO.getBasicInfo());
userEntity.setAge(userDTO.getAge());
userEntity.setCaseId(userDTO.getCaseId());
userEntity.setType("1");
userService.save(userEntity);
}else {
userEntity.setType("1");
userService.updateById(userEntity);
}
return false;
}
......
......@@ -270,9 +270,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
}
@Override
public UserEntity getByUserName(String newName) {
public UserEntity getByUserName(String newName, int caseId) {
return baseMapper.selectOne(new LambdaQueryWrapper<UserEntity>()
.eq(UserEntity::getUserName, newName));
.eq(UserEntity::getUserName, newName)
.eq(UserEntity::getCaseId, caseId)
);
}
@Override
......
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