|
@@ -191,11 +191,15 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
|
addUser.setPassword(password);
|
|
addUser.setPassword(password);
|
|
Integer distributorId = user.getDistributorId();
|
|
Integer distributorId = user.getDistributorId();
|
|
//根据id查询维修厂
|
|
//根据id查询维修厂
|
|
- Distributor distributor = distributorService.getById(distributorId);
|
|
|
|
- if (BeanUtil.isEmpty(distributor)) {
|
|
|
|
- throw new BadReqException("该维修厂不存在");
|
|
|
|
|
|
+ if(user.getDistributorId() != null){
|
|
|
|
+ Distributor distributor = distributorService.getById(distributorId);
|
|
|
|
+ if (BeanUtil.isEmpty(distributor)) {
|
|
|
|
+ throw new BadReqException("该维修厂不存在");
|
|
|
|
+ }
|
|
|
|
+ addUser.setDistributorName(distributor.getCompany());
|
|
}
|
|
}
|
|
- addUser.setDistributorName(distributor.getCompany());
|
|
|
|
|
|
+
|
|
|
|
+
|
|
this.save(addUser);
|
|
this.save(addUser);
|
|
|
|
|
|
return Result.ok();
|
|
return Result.ok();
|