修复不能设置账户默认值的bug

This commit is contained in:
季圣华
2018-12-23 00:08:35 +08:00
parent 2ff7c900fc
commit e5dcaef99c
3 changed files with 34 additions and 11 deletions

View File

@@ -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);
}
}