去除公司名称空格

master
bynt 2 years ago
parent dcc37862a2
commit ba36851a4d

@ -67,6 +67,7 @@ public class CompanyServiceImpl implements CompanyService {
companyDto.setStatus(DefaultNumberConstants.ZERO_NUMBER);
BeanUtil.copyProperties(companyDto, byUserId);
byUserId.setApplicationTime(DateUtil.date());
byUserId.setCompanyCode(byUserId.getCompanyName().trim());
userRepository.updateStatusById(Boolean.FALSE, SecurityUtils.getCurrentUserId());
return companyMapper.toDto(companyRepository.save(byUserId));
}

@ -102,7 +102,7 @@ public class FormUserServiceImpl implements FormUserService {
FormUser formUser = formUserRepository.findByPhone(phone);
// 已存在用户
if (ObjectUtil.isNotNull(formUser)) {
if (!formUser.getStatus()){
if (Boolean.FALSE.equals(formUser.getStatus())){
return CommonResponse.createByErrorMessage(ResponseCode.ACCOUNT_DISABLED.getDesc());
}
formUser.setLastLoginTime(DateUtil.date());
@ -203,4 +203,4 @@ public class FormUserServiceImpl implements FormUserService {
}
}
}

@ -98,7 +98,7 @@ public class UserServiceImpl implements UserService {
BeanUtil.copyProperties(user, copyUser);
new HashSet<>();
copyUser.setRoles(roles);
String username = byId.getCompanyName().
String username = byId.getCompanyName().trim().
concat(StrPool.COLON).concat(user.getUsername());
if (userRepository.findByUsername(username) != null) {
throw new EntityExistException(User.class, "username", username);
@ -188,8 +188,8 @@ public class UserServiceImpl implements UserService {
BeanUtil.copyProperties(userDTO, user);
user.setCompanyId(companyId);
user.setUsername(flag ||
userId == DefaultNumberConstants.ONE_NUMBER ? user.getUsername() :
companyService.findById(companyId).getCompanyName().concat(StrPool.COLON).concat(user.getUsername()));
userId == DefaultNumberConstants.ONE_NUMBER ? user.getUsername().trim() :
companyService.findById(companyId).getCompanyName().trim().concat(StrPool.COLON).concat(user.getUsername()));
user.setWhichUserId(userId);
User userCreateResult = create(user);
MultipartFile file = userDTO.getFile();
@ -345,7 +345,7 @@ public class UserServiceImpl implements UserService {
if (!user.getUsername().equals(resources.getUsername()) && user.getCompanyId() != null){
String username =
companyService.findById(user.getCompanyId())
.getCompanyName().concat(StrPool.COLON).concat(resources.getUsername());
.getCompanyName().trim().concat(StrPool.COLON).concat(resources.getUsername());
user.setUsername(username);
}
user.setEmail(resources.getEmail());

@ -67,7 +67,7 @@ public class TelephoneCallController {
if (organize.getCallMode() != null) {
switch (organize.getCallMode()) {
case DefaultNumberConstants.ZERO_NUMBER:
telephoneCallReqDTO.setCompanyName(byId.getCompanyName());
telephoneCallReqDTO.setCompanyName(byId.getCompanyName().trim());
return telephoneCallService.doubleCallReq(telephoneCallReqDTO, companyId);
case DefaultNumberConstants.TWO_NUMBER:
if (StringUtils.isBlank(byId.getXGroup()) || StringUtils.isBlank(byId.getTelX())) {

Loading…
Cancel
Save