🎨 代码优化

🎨 代码优化
This commit is contained in:
ronger 2022-01-13 20:57:03 +08:00 committed by GitHub
commit 54d0813490
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View File

@ -2,7 +2,6 @@ package com.rymcu.forest.lucene.util;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.rymcu.forest.lucene.model.ArticleLucene;
import com.rymcu.forest.lucene.model.PortfolioLucene; import com.rymcu.forest.lucene.model.PortfolioLucene;
import org.apache.lucene.document.Document; import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;

View File

@ -26,8 +26,6 @@ import java.util.Objects;
@Service @Service
public class BankAccountServiceImpl extends AbstractService<BankAccount> implements BankAccountService { public class BankAccountServiceImpl extends AbstractService<BankAccount> implements BankAccountService {
private static String DEFAULT_ACCOUNT_TYPE = "0";
@Resource @Resource
BankAccountMapper bankAccountMapper; BankAccountMapper bankAccountMapper;
@Resource @Resource
@ -35,15 +33,15 @@ public class BankAccountServiceImpl extends AbstractService<BankAccount> impleme
@Override @Override
public List<BankAccountDTO> findBankAccounts(BankAccountSearchDTO bankAccountSearchDTO) { public List<BankAccountDTO> findBankAccounts(BankAccountSearchDTO bankAccountSearchDTO) {
List<BankAccountDTO> bankAccounts = bankAccountMapper.selectBankAccounts(bankAccountSearchDTO.getBankName(), bankAccountSearchDTO.getAccountOwnerName(), bankAccountSearchDTO.getBankAccount()); return bankAccountMapper.selectBankAccounts(bankAccountSearchDTO.getBankName(), bankAccountSearchDTO.getAccountOwnerName(), bankAccountSearchDTO.getBankAccount());
return bankAccounts;
} }
@Override @Override
public BankAccountDTO findBankAccountByIdUser(Integer idUser) { public BankAccountDTO findBankAccountByIdUser(Integer idUser) {
BankAccount bankAccount = new BankAccount(); BankAccount bankAccount = new BankAccount();
bankAccount.setAccountOwner(idUser); bankAccount.setAccountOwner(idUser);
bankAccount.setAccountType(DEFAULT_ACCOUNT_TYPE); String defaultAccountType = "0";
bankAccount.setAccountType(defaultAccountType);
List<BankAccount> bankAccounts = bankAccountMapper.select(bankAccount); List<BankAccount> bankAccounts = bankAccountMapper.select(bankAccount);
BankAccountDTO bankAccountDTO; BankAccountDTO bankAccountDTO;
if (Objects.nonNull(bankAccounts) && bankAccounts.size() > 0) { if (Objects.nonNull(bankAccounts) && bankAccounts.size() > 0) {
@ -68,8 +66,7 @@ public class BankAccountServiceImpl extends AbstractService<BankAccount> impleme
startDate = LocalDateTimeUtil.format(now.minus(30, ChronoUnit.DAYS), "yyyy-MM-dd"); startDate = LocalDateTimeUtil.format(now.minus(30, ChronoUnit.DAYS), "yyyy-MM-dd");
} }
// 查询交易记录 // 查询交易记录
List<TransactionRecordDTO> records = transactionRecordService.findTransactionRecords(bankAccount, startDate, endDate); return transactionRecordService.findTransactionRecords(bankAccount, startDate, endDate);
return records;
} }
@Override @Override