|
|
|
@ -111,6 +111,32 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
|
|
|
|
|
List<CustomSupport> customSupports = customSupportMapper.selectList(new EntityWrapper<CustomSupport>().eq("custom_id", customId));
|
|
|
|
|
jsonObject.put("custom",custom);
|
|
|
|
|
jsonObject.put("customSupports",customSupports);
|
|
|
|
|
|
|
|
|
|
//年度
|
|
|
|
|
Calendar c = Calendar.getInstance();
|
|
|
|
|
c.setTime(new Date());
|
|
|
|
|
c.add(Calendar.YEAR, -1);
|
|
|
|
|
Date y = c.getTime();
|
|
|
|
|
List<Invoice> yearInvoiceList = invoiceMapper.selectList(new EntityWrapper<Invoice>().eq("custom_id", customId).ge("create_date", y));
|
|
|
|
|
//月度
|
|
|
|
|
c.setTime(new Date());
|
|
|
|
|
c.add(Calendar.MONTH, -1);
|
|
|
|
|
Date m = c.getTime();
|
|
|
|
|
List<Invoice> monthInvoiceList = invoiceMapper.selectList(new EntityWrapper<Invoice>().eq("custom_id", customId).ge("create_date", m));
|
|
|
|
|
|
|
|
|
|
BigDecimal yearMoney = new BigDecimal("0");
|
|
|
|
|
BigDecimal monthMoney = new BigDecimal("0");
|
|
|
|
|
for(Invoice invoice:yearInvoiceList){
|
|
|
|
|
BigDecimal money = invoice.getMoney();
|
|
|
|
|
yearMoney = yearMoney.add(money);
|
|
|
|
|
}
|
|
|
|
|
for(Invoice invoice:monthInvoiceList){
|
|
|
|
|
BigDecimal money = invoice.getMoney();
|
|
|
|
|
monthMoney = monthMoney.add(money);
|
|
|
|
|
}
|
|
|
|
|
jsonObject.put("yearMoney",yearMoney);
|
|
|
|
|
jsonObject.put("monthMoney",monthMoney);
|
|
|
|
|
|
|
|
|
|
return jsonObject;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|