fix-维修店账号创建

This commit is contained in:
xl
2024-07-18 16:29:43 +08:00
parent 14b7e73a14
commit b0d747c261

View File

@@ -279,10 +279,10 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantDao, Merchant> impl
* @param createId 创建人/审核人ID
*/
private Boolean commonAdd(MerchantAddRequest request, String createType, Integer createId) {
User oldUser = userService.getByPhone(request.getPhone(), UserAccountConstant.UserType.USER_TYPE_REPAIR_SHOP);
if (oldUser != null) {
throw new ServiceException("维修店店员账号手机已存在");
}
User user = userService.getByPhone(request.getPhone(), UserAccountConstant.UserType.USER_TYPE_REPAIR_SHOP);
// if (oldUser != null) {
// throw new ServiceException("维修店店员账号手机已存在");
// }
Merchant merchant = new Merchant();
BeanUtils.copyProperties(request, merchant);
@@ -315,7 +315,9 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantDao, Merchant> impl
}
//初始化用户端账号
User user = userService.addUserByMerIdOrDealerId(request.getPhone(), merchant.getId(), 0, UserAccountConstant.UserType.USER_TYPE_REPAIR_SHOP);
if (user == null) {
user = userService.addUserByMerIdOrDealerId(request.getPhone(), merchant.getId(), 0, UserAccountConstant.UserType.USER_TYPE_REPAIR_SHOP);
}
merchant.setUserId(user.getId());
dao.updateById(merchant);