梳理单位累计应收和应付的逻辑

This commit is contained in:
季圣华
2017-07-07 00:18:47 +08:00
parent 4334e49f03
commit a520b0ddd1
4 changed files with 14 additions and 10 deletions

View File

@@ -56,13 +56,16 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
accountItem.setHeaderId(new AccountHead(headerId));
if(tempInsertedJson.get("AccountId")!=null&&!tempInsertedJson.get("AccountId").equals("")){accountItem.setAccountId(new Account(tempInsertedJson.getLong("AccountId")));}
if(tempInsertedJson.get("InOutItemId")!=null&&!tempInsertedJson.get("InOutItemId").equals("")){accountItem.setInOutItemId(new InOutItem(tempInsertedJson.getLong("InOutItemId")));}
if(tempInsertedJson.get("EachAmount")!=null){
if(tempInsertedJson.get("EachAmount")!=null&&!tempInsertedJson.get("EachAmount").equals("")){
Double eachAmount = tempInsertedJson.getDouble("EachAmount");
if(listType.equals("付款")) {
eachAmount = 0 - eachAmount;
}
accountItem.setEachAmount(eachAmount);
}
else {
accountItem.setEachAmount(0.0);
}
accountItem.setRemark(tempInsertedJson.getString("Remark"));
accountItemService.create(accountItem);
}
@@ -84,13 +87,16 @@ public class AccountItemAction extends BaseAction<AccountItemModel>
accountItem.setHeaderId(new AccountHead(headerId));
if(tempUpdatedJson.get("AccountId")!=null&&!tempUpdatedJson.get("AccountId").equals("")){accountItem.setAccountId(new Account(tempUpdatedJson.getLong("AccountId")));}
if(tempUpdatedJson.get("InOutItemId")!=null&&!tempUpdatedJson.get("InOutItemId").equals("")){accountItem.setInOutItemId(new InOutItem(tempUpdatedJson.getLong("InOutItemId")));}
if(tempUpdatedJson.get("EachAmount")!=null){
if(tempUpdatedJson.get("EachAmount")!=null&&!tempUpdatedJson.get("EachAmount").equals("")){
Double eachAmount = tempUpdatedJson.getDouble("EachAmount");
if(listType.equals("付款")) {
eachAmount = 0 - eachAmount;
}
accountItem.setEachAmount(eachAmount);
}
else {
accountItem.setEachAmount(0.0);
}
accountItem.setRemark(tempUpdatedJson.getString("Remark"));
accountItemService.create(accountItem);
}