本月应付

/**
* 取portal页面右上角应付金额
*
* @param map
* @return
*/
@SuppressWarnings("unchecked")
public String getThisTermAmount(Map map) {
map.put("billDate", "thisMonth");
List amountList = null;
amountList = defaultDao.getObjList(SqlMapPostFix.BILL_NAME_SPACE, map,
SqlMapPostFix.BILL_SUM_DATE_AMOUNT);
//如果无本月数据则取上月
if (amountList == null || amountList.size() == 0) {
map.put("billDate", "lastMonth");
amountList = defaultDao.getObjList(SqlMapPostFix.BILL_NAME_SPACE, map,
SqlMapPostFix.BILL_SUM_DATE_AMOUNT);
}

DecimalFormat format = new DecimalFormat();
format.applyPattern("##,###,##0.00");
List<AccountItemSumm> itemSummList = new ArrayList<AccountItemSumm>();
//1:按币种排序
for (Object obj : amountList) {
NaqBillSumm sum = (NaqBillSumm) obj;
AccountItemSumm itemSumm = new AccountItemSumm();

if (BizConstant.CURRENCY_TYPE_CNY.equals(sum.getCurrencyType())) {
itemSumm.setSortId(1);
} else if (BizConstant.CURRENCY_TYPE_USD.equals(sum.getCurrencyType())) {
itemSumm.setSortId(2);
} else if (BizConstant.CURRENCY_TYPE_HKD.equals(sum.getCurrencyType())) {
itemSumm.setSortId(3);
} else if (BizConstant.CURRENCY_TYPE_NTD.equals(sum.getCurrencyType())) {
itemSumm.setSortId(4);
}
itemSumm.setItemCurrency(sum.getCurrencyType());

if (sum.getTotalAmount() == null) {
itemSumm.setAmount("0.00");
} else {
itemSumm.setAmount(format.format((sum.getLastTotalAmount().subtract(sum
.getLastTotalReceiptAmount())).add(sum.getTotalAmount())));
}
itemSummList.add(itemSumm);
}
Collections.sort(itemSummList, new AccountItemSumm());
//2:页面展示应付金额String串按币种排序中间用";"隔开最后一个去掉";"号
String strAmount = "";
int count = 0;
if (itemSummList != null && itemSummList.size() > 0) {
for (AccountItemSumm s : itemSummList) {
count++;
if (itemSummList.size() == count) {
strAmount = strAmount + s.getItemCurrency() + s.getAmount();
} else {
strAmount = strAmount + s.getItemCurrency() + s.getAmount() + ";";
}
}
}
return strAmount;
}
杭州市滨江区网商路699号阿里巴巴园区 邮编310052
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值