|
@@ -362,4 +362,45 @@ public class PaymentService {
|
|
|
return paymentOrdinaryDao.update(paymentOrdinary);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public Map<String, Object> getCount(long projectId) {
|
|
|
+ Map<String, Object> m = new HashMap<>();
|
|
|
+
|
|
|
+ Map<String, Object> defaultMap = new HashMap<>();
|
|
|
+ defaultMap.put("receivable", 0);
|
|
|
+ defaultMap.put("received", 0);
|
|
|
+ defaultMap.put("overdue", 0);
|
|
|
+
|
|
|
+ Map<String, Object> map1 = new HashMap<>();
|
|
|
+ Map<String, BigDecimal> property1 = paymentDao.getAccumulateProjectId(projectId);
|
|
|
+ Map<String, BigDecimal> hydropower1 = paymentOrdinaryDao.getAccumulateProjectId(projectId, 1);
|
|
|
+ Map<String, BigDecimal> rent1 = paymentOrdinaryDao.getAccumulateProjectId(projectId, 2);
|
|
|
+ map1.put("property", property1 != null ? property1 : defaultMap);
|
|
|
+ map1.put("hydropower", hydropower1 != null ? hydropower1 : defaultMap);
|
|
|
+ map1.put("rent", rent1 != null ? rent1 : defaultMap);
|
|
|
+ m.put("accumulate", map1);
|
|
|
+
|
|
|
+ Map<String, Object> map2 = new HashMap<>();
|
|
|
+ Map<String, BigDecimal> property2 = paymentDao.getYearProjectId(projectId);
|
|
|
+ Map<String, BigDecimal> hydropower2 = paymentOrdinaryDao.getYearProjectId(projectId, 1);
|
|
|
+ Map<String, BigDecimal> rent2 = paymentOrdinaryDao.getYearProjectId(projectId, 2);
|
|
|
+ map2.put("property", property2 != null ? property2 : defaultMap);
|
|
|
+ map2.put("hydropower", hydropower2 != null ? hydropower2 : defaultMap);
|
|
|
+ map2.put("rent", rent2 != null ? rent2 : defaultMap);
|
|
|
+ m.put("year", map2);
|
|
|
+
|
|
|
+ Map<String, Object> map3 = new HashMap<>();
|
|
|
+ Map<String, BigDecimal> property3 = paymentDao.getMonthProjectId(projectId);
|
|
|
+ Map<String, BigDecimal> hydropower3 = paymentOrdinaryDao.getMonthProjectId(projectId, 1);
|
|
|
+ Map<String, BigDecimal> rent3 = paymentOrdinaryDao.getMonthProjectId(projectId, 2);
|
|
|
+ map3.put("property", property3 != null ? property3 : defaultMap);
|
|
|
+ map3.put("hydropower", hydropower3 != null ? hydropower3 : defaultMap);
|
|
|
+ map3.put("rent", rent3 != null ? rent3 : defaultMap);
|
|
|
+ m.put("month", map3);
|
|
|
+
|
|
|
+ return m;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|