| | |
| | | import static org.apache.commons.lang3.StringUtils.isNumeric;
|
| | | import static org.springframework.util.ObjectUtils.isEmpty;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Set;
|
| | | import java.util.*;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.util.ObjectUtils;
|
| | |
| | |
|
| | | @Service
|
| | | public class AccountServiceImpl implements AccountService {
|
| | |
|
| | | @Resource
|
| | | private BCryptPasswordEncoder encoder;
|
| | | @Resource
|
| | | private AccountMapper accountMapper;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private OrganizationMapper organizationMapper;
|
| | | |
| | |
|
| | | @Override
|
| | | public Map<String, Object> screenLogin(Map<String, Object> parameters) {
|
| | | Map<String, Object> result = new HashMap<String, Object>();
|
| | |
| | | if (ObjectUtils.isEmpty(account.getId())) {
|
| | | account.setIsDelete(Constants.IS_DELETE_FALSE);
|
| | | account.setCreateTime(new Date());
|
| | | account.setPassword(Crypto.md5(ResourceUtil.getValue("password")));
|
| | | account.setPassword(encoder.encode(ResourceUtil.getValue("password")));
|
| | | return accountMapper.insertSelective(account);
|
| | | } else {
|
| | | return accountMapper.updateByPrimaryKeySelective(account);
|
| | |
| | | return accountMapper.selectCount(account);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Optional<Account> queryAccountByName(String accountName) {
|
| | | Account account = new Account();
|
| | | account.setAccountName(accountName);
|
| | | return Optional.ofNullable(accountMapper.selectOne(account));
|
| | | }
|
| | | }
|