给仓库和账户的第一次录入设置为默认

This commit is contained in:
季圣华
2023-02-09 21:26:17 +08:00
parent 215c403ce6
commit 07d1f4ad68
2 changed files with 12 additions and 2 deletions

View File

@@ -138,7 +138,12 @@ public class AccountService {
if(account.getInitialAmount() == null) {
account.setInitialAmount(BigDecimal.ZERO);
}
List<Account> accountList = getAccountByParam(null, null);
if(accountList.size() == 0) {
account.setIsDefault(true);
} else {
account.setIsDefault(false);
}
account.setEnabled(true);
int result=0;
try{

View File

@@ -125,7 +125,12 @@ public class DepotService {
int result=0;
try{
depot.setType(0);
List<Depot> depotList = getDepot();
if(depotList.size() == 0) {
depot.setIsDefault(true);
} else {
depot.setIsDefault(false);
}
depot.setEnabled(true);
result=depotMapper.insertSelective(depot);
//新增仓库时给当前用户自动授权