|
@@ -92,6 +92,10 @@ public class CmcBorrowController extends BaseController
|
92
|
92
|
JSONObject usageObject = new JSONObject();
|
93
|
93
|
JSONArray usageAmountArray = new JSONArray();
|
94
|
94
|
JSONObject usageAmountObject = new JSONObject();
|
|
95
|
+ JSONArray yearProjectCountArray = new JSONArray();
|
|
96
|
+ JSONObject yearProjectCountObject = new JSONObject();
|
|
97
|
+ JSONArray yearProjectAmountArray = new JSONArray();
|
|
98
|
+ JSONObject yearProjectAmountObject = new JSONObject();
|
95
|
99
|
//每年借款金额
|
96
|
100
|
if (cmcBorrow.getApplyDate() == null) {
|
97
|
101
|
for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
|
|
@@ -116,15 +120,19 @@ public class CmcBorrowController extends BaseController
|
116
|
120
|
}
|
117
|
121
|
amountObject.put(new SimpleDateFormat("yyyy").format(cmcBorrow.getApplyDate()), amount);
|
118
|
122
|
}
|
119
|
|
- getBorrowUsageStatistic(cmcBorrow, usageObject, usageAmountObject);
|
|
123
|
+ getBorrowUsageStatistic(cmcBorrow, usageObject, usageAmountObject, yearProjectCountObject, yearProjectAmountObject);
|
120
|
124
|
yearArray.add(yearObject);
|
121
|
125
|
amountArray.add(amountObject);
|
122
|
126
|
usageArray.add(usageObject);
|
123
|
127
|
usageAmountArray.add(usageAmountObject);
|
|
128
|
+ yearProjectCountArray.add(yearProjectCountObject);
|
|
129
|
+ yearProjectAmountArray.add(yearProjectAmountObject);
|
124
|
130
|
jsonObject.put("year", yearArray);
|
125
|
131
|
jsonObject.put("amount", amountArray);
|
126
|
132
|
jsonObject.put("usage", usageArray);
|
127
|
133
|
jsonObject.put("usageAmount", usageAmountArray);
|
|
134
|
+ jsonObject.put("yearProjectCount", yearProjectCountArray);
|
|
135
|
+ jsonObject.put("yearProjectAmount", yearProjectAmountArray);
|
128
|
136
|
return success(jsonObject);
|
129
|
137
|
}
|
130
|
138
|
|
|
@@ -183,7 +191,7 @@ public class CmcBorrowController extends BaseController
|
183
|
191
|
}
|
184
|
192
|
|
185
|
193
|
//各用途借款次数
|
186
|
|
- public void getBorrowUsageStatistic(CmcBorrow cmcBorrow, JSONObject usageObject, JSONObject usageAmountObject) {
|
|
194
|
+ public void getBorrowUsageStatistic(CmcBorrow cmcBorrow, JSONObject usageObject, JSONObject usageAmountObject, JSONObject yearProjectCountObject, JSONObject yearProjectAmountObject) {
|
187
|
195
|
cmcBorrow.setBorrowUsage("0");
|
188
|
196
|
List<CmcBorrow> usageList = cmcBorrowService.selectCmcBorrowList(cmcBorrow);
|
189
|
197
|
usageObject.put("项目借款", usageList.size());
|
|
@@ -193,6 +201,18 @@ public class CmcBorrowController extends BaseController
|
193
|
201
|
pAmount = pAmount.add(borrow.getManagerAmount());
|
194
|
202
|
}
|
195
|
203
|
usageAmountObject.put("项目借款", pAmount);
|
|
204
|
+ for (int i = 2019; i <= Calendar.getInstance().get(Calendar.YEAR); i++) {
|
|
205
|
+ BigDecimal pyAmount = new BigDecimal(0);
|
|
206
|
+ int count = 0;
|
|
207
|
+ for (CmcBorrow borrow : usageList) {
|
|
208
|
+ if (borrow.getManagerAmount() != null && borrow.getProjectNumber() != null && borrow.getProjectNumber().contains(String.valueOf(i))) {
|
|
209
|
+ pyAmount = pyAmount.add(borrow.getManagerAmount());
|
|
210
|
+ count ++;
|
|
211
|
+ }
|
|
212
|
+ }
|
|
213
|
+ yearProjectCountObject.put(String.valueOf(i), count);
|
|
214
|
+ yearProjectAmountObject.put(String.valueOf(i), pyAmount);
|
|
215
|
+ }
|
196
|
216
|
cmcBorrow.setBorrowUsage("1");
|
197
|
217
|
usageList = cmcBorrowService.selectCmcBorrowList(cmcBorrow);
|
198
|
218
|
usageObject.put("非项目借款", usageList.size());
|