|
@@ -401,6 +401,34 @@ public class PaymentService {
|
|
|
return m;
|
|
|
}
|
|
|
|
|
|
+ public Map<String, Object> getMonthCount(long projectId) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ // 房租
|
|
|
+ List<Payment> rentList = paymentDao.getMonthCount(projectId);
|
|
|
+ if (rentList.size() > 0) {
|
|
|
+ for (Payment p : rentList) {
|
|
|
+ Map<String, BigDecimal> accumulate = paymentDao.getAccumulate(projectId, p.getContractId());
|
|
|
+ p.setReceived(accumulate.get("received"));
|
|
|
+ }
|
|
|
+ map.put("rent", rentList);
|
|
|
+ }
|
|
|
+ // 物业:1, 水电:2
|
|
|
+ map.put("property", getResult(projectId, 1));
|
|
|
+ map.put("hydropower", getResult(projectId, 2));
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<PaymentOrdinary> getResult(long projectId, int type) {
|
|
|
+ List<PaymentOrdinary> list = paymentOrdinaryDao.getMonthCount(projectId, type);
|
|
|
+ if (list.size() > 0) {
|
|
|
+ for (PaymentOrdinary p : list) {
|
|
|
+ Map<String, BigDecimal> accumulate = paymentOrdinaryDao.getAccumulate(projectId, p.getPayMerchantId(), p.getPayClientId(), type);
|
|
|
+ p.setReceived(accumulate.get("received"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|