| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.commons.lang3.StringUtils;
|
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | | @Override
|
| | | @Transactional
|
| | | public Integer saveOrUpdateAccount(Account account) {
|
| | | // 重置密码
|
| | | if(!StringUtils.isBlank(account.getPassword())){
|
| | | account.setPassword(encoder.encode(account.getPassword()));
|
| | | }
|
| | | if (ObjectUtils.isEmpty(account.getId())) {
|
| | | account.setIsDelete(Constants.IS_DELETE_FALSE);
|
| | | account.setCreateTime(new Date());
|