Commit dfb83adc authored by wujipeng's avatar wujipeng
Browse files

updateMerchantToPerson优化

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