修复不能设置账户默认值的bug
This commit is contained in:
@@ -75,6 +75,10 @@ public class AccountService {
|
||||
|
||||
public int insertAccount(String beanJson, HttpServletRequest request) {
|
||||
Account account = JSONObject.parseObject(beanJson, Account.class);
|
||||
if(account.getInitialamount() == null) {
|
||||
account.setInitialamount(0d);
|
||||
}
|
||||
account.setIsdefault(false);
|
||||
return accountMapper.insertSelective(account);
|
||||
}
|
||||
|
||||
@@ -292,4 +296,12 @@ public class AccountService {
|
||||
return accountMapper.findAccountInOutListCount(accountId);
|
||||
}
|
||||
|
||||
public int updateAmountIsDefault(Boolean isDefault, Long accountId) {
|
||||
Account account = new Account();
|
||||
account.setIsdefault(isDefault);
|
||||
AccountExample example = new AccountExample();
|
||||
example.createCriteria().andIdEqualTo(accountId);
|
||||
return accountMapper.updateByExampleSelective(account, example);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user