Commit 3ab2f7e5b2aaad81eef2638dd3b7bc1f47c51b6b
1 parent
27be2244
tijiao
Showing
5 changed files
with
251 additions
and
220 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthsStatisticController.java
| @@ -113,10 +113,10 @@ public class BerthsStatisticController extends BizController { | @@ -113,10 +113,10 @@ public class BerthsStatisticController extends BizController { | ||
| 113 | public BizResultVO<EasyUIDataGridVO<ParkingLotUseStatisticDTO>> GetParkingPlaceStatistic( | 113 | public BizResultVO<EasyUIDataGridVO<ParkingLotUseStatisticDTO>> GetParkingPlaceStatistic( |
| 114 | @RequestBody ParkingLotUseStatisticForPageRequest requestObject) | 114 | @RequestBody ParkingLotUseStatisticForPageRequest requestObject) |
| 115 | throws InstantiationException, IllegalAccessException { | 115 | throws InstantiationException, IllegalAccessException { |
| 116 | - if (null == requestObject.getBeginTime() || null==requestObject.getEndTime()) { | ||
| 117 | - throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间"); | ||
| 118 | - } | ||
| 119 | - | 116 | + if (null == requestObject.getBeginTime() || null == requestObject.getEndTime()) { |
| 117 | + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间"); | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | Calendar beginc = Calendar.getInstance(); | 120 | Calendar beginc = Calendar.getInstance(); |
| 121 | beginc.setTime(requestObject.getBeginTime()); | 121 | beginc.setTime(requestObject.getBeginTime()); |
| 122 | int beginYear = beginc.get(Calendar.YEAR); | 122 | int beginYear = beginc.get(Calendar.YEAR); |
| @@ -153,7 +153,7 @@ public class BerthsStatisticController extends BizController { | @@ -153,7 +153,7 @@ public class BerthsStatisticController extends BizController { | ||
| 153 | plNoslist.add(plNos); | 153 | plNoslist.add(plNos); |
| 154 | request.setPlNos(plNoslist); | 154 | request.setPlNos(plNoslist); |
| 155 | request.setBaseRequest(new BaseInfo(1, 0)); | 155 | request.setBaseRequest(new BaseInfo(1, 0)); |
| 156 | - | 156 | + |
| 157 | Calendar beginc = Calendar.getInstance(); | 157 | Calendar beginc = Calendar.getInstance(); |
| 158 | beginc.setTime(request.getBeginTime()); | 158 | beginc.setTime(request.getBeginTime()); |
| 159 | int beginYear = beginc.get(Calendar.YEAR); | 159 | int beginYear = beginc.get(Calendar.YEAR); |
| @@ -194,7 +194,7 @@ public class BerthsStatisticController extends BizController { | @@ -194,7 +194,7 @@ public class BerthsStatisticController extends BizController { | ||
| 194 | Object[] obj = new Object[title.length]; | 194 | Object[] obj = new Object[title.length]; |
| 195 | int index = 0; | 195 | int index = 0; |
| 196 | obj[index++] = format.format(e.getStatisticBeginTime()); | 196 | obj[index++] = format.format(e.getStatisticBeginTime()); |
| 197 | - obj[index++] = e.getFreeRatio() *100 +"%"; | 197 | + obj[index++] = e.getFreeRatio() * 100 + "%"; |
| 198 | obj[index++] = e.getTurnoverRatio(); | 198 | obj[index++] = e.getTurnoverRatio(); |
| 199 | contentList.add(obj); | 199 | contentList.add(obj); |
| 200 | } | 200 | } |
| @@ -215,13 +215,14 @@ public class BerthsStatisticController extends BizController { | @@ -215,13 +215,14 @@ public class BerthsStatisticController extends BizController { | ||
| 215 | @ResponseBody | 215 | @ResponseBody |
| 216 | public BizResultVO<LineChartVO> getFreeRatioBerthForLineChart( | 216 | public BizResultVO<LineChartVO> getFreeRatioBerthForLineChart( |
| 217 | @RequestBody ParkingLotUseStatisticForPageRequest request) { | 217 | @RequestBody ParkingLotUseStatisticForPageRequest request) { |
| 218 | - //根据权限获取停车场列表 | ||
| 219 | - if (null == request.getBeginTime() || null==request.getEndTime()) { | ||
| 220 | - throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间"); | ||
| 221 | - } | 218 | + // 根据权限获取停车场列表 |
| 219 | + if (null == request.getBeginTime() || null == request.getEndTime()) { | ||
| 220 | + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间"); | ||
| 221 | + } | ||
| 222 | logger.info("根据停车场编号获取该停车场车位空置率折线图"); | 222 | logger.info("根据停车场编号获取该停车场车位空置率折线图"); |
| 223 | Calendar beginTime = Calendar.getInstance(); | 223 | Calendar beginTime = Calendar.getInstance(); |
| 224 | beginTime.setTime(request.getBeginTime()); | 224 | beginTime.setTime(request.getBeginTime()); |
| 225 | + int year = beginTime.get(Calendar.YEAR); | ||
| 225 | 226 | ||
| 226 | Calendar endTime = Calendar.getInstance(); | 227 | Calendar endTime = Calendar.getInstance(); |
| 227 | endTime.setTime(request.getEndTime()); | 228 | endTime.setTime(request.getEndTime()); |
| @@ -229,28 +230,27 @@ public class BerthsStatisticController extends BizController { | @@ -229,28 +230,27 @@ public class BerthsStatisticController extends BizController { | ||
| 229 | Long dayDifference = DateUtil.getTimeDifference(new Timestamp(request.getEndTime().getTime()), | 230 | Long dayDifference = DateUtil.getTimeDifference(new Timestamp(request.getEndTime().getTime()), |
| 230 | new Timestamp(request.getBeginTime().getTime())); | 231 | new Timestamp(request.getBeginTime().getTime())); |
| 231 | List<String> xAxisData = Lists.newArrayList(); | 232 | List<String> xAxisData = Lists.newArrayList(); |
| 232 | - String dateType=""; | ||
| 233 | - int berthRatio=ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE; | 233 | + String dateType = ""; |
| 234 | + int berthRatio = ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE; | ||
| 235 | + request.setBaseRequest(new BaseInfo(1, 0)); | ||
| 234 | if (dayDifference == 0L) { | 236 | if (dayDifference == 0L) { |
| 235 | // 1个小时为一个时间戳 | 237 | // 1个小时为一个时间戳 |
| 236 | request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); | 238 | request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); |
| 237 | int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); | 239 | int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); |
| 238 | String day = ""; | 240 | String day = ""; |
| 239 | String month = ""; | 241 | String month = ""; |
| 240 | - for (int i = 0; i < dayDifference.intValue(); i++) { | ||
| 241 | - beginTime.add(Calendar.DAY_OF_MONTH, 1); | ||
| 242 | - int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 243 | - int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | ||
| 244 | - month = String.format("%02d", (beginMonth)); | ||
| 245 | - day = String.format("%02d", (beginDay)); | ||
| 246 | - for (int j = 0; j < totaltimestampCount; j++) { | ||
| 247 | - String hour = String.format("%02d", (j)); | ||
| 248 | - xAxisData.add(month + "-" + day + " " + hour); | ||
| 249 | - } | 242 | + |
| 243 | + int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 244 | + int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | ||
| 245 | + month = String.format("%02d", (beginMonth)); | ||
| 246 | + day = String.format("%02d", (beginDay)); | ||
| 247 | + for (int j = 0; j <= totaltimestampCount; j++) { | ||
| 248 | + String hour = String.format("%02d", (j)); | ||
| 249 | + xAxisData.add(year + "-" + month + "-" + day + " " + hour); | ||
| 250 | } | 250 | } |
| 251 | - request.setBaseRequest(new BaseInfo(1, 0)); | ||
| 252 | - dateType="MM-dd HH"; | ||
| 253 | - LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); | 251 | + |
| 252 | + dateType = "yyyy-MM-dd HH"; | ||
| 253 | + LineChartVO freeBerthRatios = getFreeBerthRatios(request, xAxisData, dateType, berthRatio); | ||
| 254 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); | 254 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); |
| 255 | } else if (dayDifference <= 3L) { | 255 | } else if (dayDifference <= 3L) { |
| 256 | // 1小时为一个时间戳 | 256 | // 1小时为一个时间戳 |
| @@ -258,38 +258,41 @@ public class BerthsStatisticController extends BizController { | @@ -258,38 +258,41 @@ public class BerthsStatisticController extends BizController { | ||
| 258 | int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); | 258 | int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); |
| 259 | String day = ""; | 259 | String day = ""; |
| 260 | String month = ""; | 260 | String month = ""; |
| 261 | - for (int i = 0; i < dayDifference.intValue(); i++) { | ||
| 262 | - beginTime.add(Calendar.DAY_OF_MONTH, 1); | ||
| 263 | - int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 264 | - int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | 261 | + for (int i = 0; i <= dayDifference.intValue(); i++) { |
| 262 | + Calendar tempDate = Calendar.getInstance(); | ||
| 263 | + tempDate.setTime(request.getBeginTime()); | ||
| 264 | + tempDate.add(Calendar.DAY_OF_MONTH, i); | ||
| 265 | + int beginMonth = tempDate.get(Calendar.MONTH) + 1; | ||
| 266 | + int beginDay = tempDate.get(Calendar.DAY_OF_MONTH); | ||
| 265 | month = String.format("%02d", (beginMonth)); | 267 | month = String.format("%02d", (beginMonth)); |
| 266 | day = String.format("%02d", (beginDay)); | 268 | day = String.format("%02d", (beginDay)); |
| 267 | - for (int j = 0; j < totaltimestampCount; j++) { | 269 | + for (int j = 0; j <= totaltimestampCount; j++) { |
| 268 | String hour = String.format("%02d", (j)); | 270 | String hour = String.format("%02d", (j)); |
| 269 | - xAxisData.add(month + "-" + day + " " + hour); | 271 | + xAxisData.add(year + "-" + month + "-" + day + " " + hour); |
| 270 | } | 272 | } |
| 271 | } | 273 | } |
| 272 | - request.setBaseRequest(new BaseInfo(1, 0)); | ||
| 273 | - dateType="MM-dd HH"; | ||
| 274 | - LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); | 274 | + dateType = "yyyy-MM-dd HH"; |
| 275 | + LineChartVO freeBerthRatios = getFreeBerthRatios(request, xAxisData, dateType, berthRatio); | ||
| 275 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); | 276 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); |
| 276 | } else { | 277 | } else { |
| 277 | // 1天为一个时间戳 | 278 | // 1天为一个时间戳 |
| 278 | request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY); | 279 | request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY); |
| 279 | - for (int i = 0; i < dayDifference.intValue(); i++) { | ||
| 280 | - beginTime.add(Calendar.DAY_OF_MONTH, 1); | ||
| 281 | - int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 282 | - int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | 280 | + for (int i = 0; i <= dayDifference.intValue(); i++) { |
| 281 | + Calendar tempDate = Calendar.getInstance(); | ||
| 282 | + tempDate.setTime(request.getBeginTime()); | ||
| 283 | + tempDate.add(Calendar.DAY_OF_MONTH, i); | ||
| 284 | + int beginMonth = tempDate.get(Calendar.MONTH) + 1; | ||
| 285 | + int beginDay = tempDate.get(Calendar.DAY_OF_MONTH); | ||
| 283 | String month = String.format("%02d", (beginMonth)); | 286 | String month = String.format("%02d", (beginMonth)); |
| 284 | String day = String.format("%02d", (beginDay)); | 287 | String day = String.format("%02d", (beginDay)); |
| 285 | - xAxisData.add(month + "-" + day); | 288 | + xAxisData.add(year + "-" + month + "-" + day); |
| 289 | + | ||
| 286 | } | 290 | } |
| 287 | - } | ||
| 288 | - request.setBaseRequest(new BaseInfo(1, 0)); | ||
| 289 | - dateType="MM-dd"; | ||
| 290 | - LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); | ||
| 291 | - return new BizResultVO<LineChartVO>().setData(freeBerthRatios); | 291 | + dateType = "yyyy-MM-dd"; |
| 292 | + LineChartVO freeBerthRatios = getFreeBerthRatios(request, xAxisData, dateType, berthRatio); | ||
| 293 | + return new BizResultVO<LineChartVO>().setData(freeBerthRatios); | ||
| 292 | 294 | ||
| 295 | + } | ||
| 293 | } | 296 | } |
| 294 | 297 | ||
| 295 | /** | 298 | /** |
| @@ -305,11 +308,11 @@ public class BerthsStatisticController extends BizController { | @@ -305,11 +308,11 @@ public class BerthsStatisticController extends BizController { | ||
| 305 | @RequestBody ParkingLotUseStatisticForPageRequest request) { | 308 | @RequestBody ParkingLotUseStatisticForPageRequest request) { |
| 306 | 309 | ||
| 307 | logger.info("根据停车场编号获取该停车场车位周转率折线图"); | 310 | logger.info("根据停车场编号获取该停车场车位周转率折线图"); |
| 308 | - if (null == request.getBeginTime() || null==request.getEndTime()) { | ||
| 309 | - throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间"); | ||
| 310 | - } | 311 | + if (null == request.getBeginTime() || null == request.getEndTime()) { |
| 312 | + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间"); | ||
| 313 | + } | ||
| 311 | Calendar beginTime = Calendar.getInstance(); | 314 | Calendar beginTime = Calendar.getInstance(); |
| 312 | - int year=beginTime.get(Calendar.YEAR); | 315 | + int year = beginTime.get(Calendar.YEAR); |
| 313 | beginTime.setTime(request.getBeginTime()); | 316 | beginTime.setTime(request.getBeginTime()); |
| 314 | 317 | ||
| 315 | Calendar endTime = Calendar.getInstance(); | 318 | Calendar endTime = Calendar.getInstance(); |
| @@ -318,28 +321,27 @@ public class BerthsStatisticController extends BizController { | @@ -318,28 +321,27 @@ public class BerthsStatisticController extends BizController { | ||
| 318 | Long dayDifference = DateUtil.getTimeDifference(new Timestamp(request.getEndTime().getTime()), | 321 | Long dayDifference = DateUtil.getTimeDifference(new Timestamp(request.getEndTime().getTime()), |
| 319 | new Timestamp(request.getBeginTime().getTime())); | 322 | new Timestamp(request.getBeginTime().getTime())); |
| 320 | List<String> xAxisData = Lists.newArrayList(); | 323 | List<String> xAxisData = Lists.newArrayList(); |
| 321 | - String dateType=""; | 324 | + String dateType = ""; |
| 322 | request.setBaseRequest(new BaseInfo(1, 0)); | 325 | request.setBaseRequest(new BaseInfo(1, 0)); |
| 323 | - int berthRatio=ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER; | 326 | + int berthRatio = ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER; |
| 324 | if (dayDifference == 0L) { | 327 | if (dayDifference == 0L) { |
| 325 | - //1个小时为一个时间戳 | 328 | + // 1个小时为一个时间戳 |
| 326 | request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); | 329 | request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); |
| 327 | int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); | 330 | int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); |
| 328 | String day = ""; | 331 | String day = ""; |
| 329 | String month = ""; | 332 | String month = ""; |
| 330 | - for (int i = 0; i < dayDifference.intValue(); i++) { | ||
| 331 | - beginTime.add(Calendar.DAY_OF_MONTH, 1); | ||
| 332 | - int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 333 | - int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | ||
| 334 | - month = String.format("%02d", (beginMonth)); | ||
| 335 | - day = String.format("%02d", (beginDay)); | ||
| 336 | - for (int j = 0; j < totaltimestampCount; j++) { | ||
| 337 | - String hour = String.format("%02d", (j)); | ||
| 338 | - xAxisData.add(year+"-"+month + "-" + day + " " + hour); | ||
| 339 | - } | 333 | + |
| 334 | + int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 335 | + int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | ||
| 336 | + month = String.format("%02d", (beginMonth)); | ||
| 337 | + day = String.format("%02d", (beginDay)); | ||
| 338 | + for (int j = 0; j <= totaltimestampCount; j++) { | ||
| 339 | + String hour = String.format("%02d", (j)); | ||
| 340 | + xAxisData.add(year + "-" + month + "-" + day + " " + hour); | ||
| 340 | } | 341 | } |
| 341 | - dateType="yyyy-MM-dd HH"; | ||
| 342 | - LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); | 342 | + |
| 343 | + dateType = "yyyy-MM-dd HH"; | ||
| 344 | + LineChartVO freeBerthRatios = getFreeBerthRatios(request, xAxisData, dateType, berthRatio); | ||
| 343 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); | 345 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); |
| 344 | } else if (dayDifference <= 3L) { | 346 | } else if (dayDifference <= 3L) { |
| 345 | // 1小时为一个时间戳 | 347 | // 1小时为一个时间戳 |
| @@ -347,41 +349,45 @@ public class BerthsStatisticController extends BizController { | @@ -347,41 +349,45 @@ public class BerthsStatisticController extends BizController { | ||
| 347 | int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); | 349 | int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); |
| 348 | String day = ""; | 350 | String day = ""; |
| 349 | String month = ""; | 351 | String month = ""; |
| 350 | - for (int i = 0; i < dayDifference.intValue(); i++) { | ||
| 351 | - beginTime.add(Calendar.DAY_OF_MONTH, 1); | ||
| 352 | - int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 353 | - int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | 352 | + for (int i = 0; i <= dayDifference.intValue(); i++) { |
| 353 | + Calendar tempDate = Calendar.getInstance(); | ||
| 354 | + tempDate.setTime(request.getBeginTime()); | ||
| 355 | + tempDate.add(Calendar.DAY_OF_MONTH, i); | ||
| 356 | + int beginMonth = tempDate.get(Calendar.MONTH) + 1; | ||
| 357 | + int beginDay = tempDate.get(Calendar.DAY_OF_MONTH); | ||
| 354 | month = String.format("%02d", (beginMonth)); | 358 | month = String.format("%02d", (beginMonth)); |
| 355 | day = String.format("%02d", (beginDay)); | 359 | day = String.format("%02d", (beginDay)); |
| 356 | - for (int j = 0; j < totaltimestampCount; j++) { | 360 | + for (int j = 0; j <= totaltimestampCount; j++) { |
| 357 | String hour = String.format("%02d", (j)); | 361 | String hour = String.format("%02d", (j)); |
| 358 | - xAxisData.add(year+"-"+month + "-" + day + " " + hour); | 362 | + xAxisData.add(year + "-" + month + "-" + day + " " + hour); |
| 359 | } | 363 | } |
| 360 | } | 364 | } |
| 361 | - dateType="yyyy-MM-dd HH"; | ||
| 362 | - LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); | 365 | + dateType = "yyyy-MM-dd HH"; |
| 366 | + LineChartVO freeBerthRatios = getFreeBerthRatios(request, xAxisData, dateType, berthRatio); | ||
| 363 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); | 367 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); |
| 364 | } else { | 368 | } else { |
| 365 | // 1天为一个时间戳 | 369 | // 1天为一个时间戳 |
| 366 | request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY); | 370 | request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY); |
| 367 | - for (int i = 0; i < dayDifference.intValue(); i++) { | ||
| 368 | - beginTime.add(Calendar.DAY_OF_MONTH, 1); | ||
| 369 | - int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 370 | - int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | 371 | + for (int i = 0; i <= dayDifference.intValue(); i++) { |
| 372 | + Calendar tempDate = Calendar.getInstance(); | ||
| 373 | + tempDate.setTime(request.getBeginTime()); | ||
| 374 | + tempDate.add(Calendar.DAY_OF_MONTH, i); | ||
| 375 | + int beginMonth = tempDate.get(Calendar.MONTH) + 1; | ||
| 376 | + int beginDay = tempDate.get(Calendar.DAY_OF_MONTH); | ||
| 371 | String month = String.format("%02d", (beginMonth)); | 377 | String month = String.format("%02d", (beginMonth)); |
| 372 | String day = String.format("%02d", (beginDay)); | 378 | String day = String.format("%02d", (beginDay)); |
| 373 | - xAxisData.add(year+"-"+month + "-" + day); | 379 | + xAxisData.add(year + "-" + month + "-" + day); |
| 380 | + | ||
| 374 | } | 381 | } |
| 375 | - dateType="yyyy-MM-dd"; | ||
| 376 | - LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); | 382 | + dateType = "yyyy-MM-dd"; |
| 383 | + LineChartVO freeBerthRatios = getFreeBerthRatios(request, xAxisData, dateType, berthRatio); | ||
| 377 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); | 384 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); |
| 378 | } | 385 | } |
| 379 | 386 | ||
| 380 | } | 387 | } |
| 381 | - | ||
| 382 | - | ||
| 383 | - private LineChartVO getFreeBerthRatios(ParkingLotUseStatisticForPageRequest request, | ||
| 384 | - List<String> xAxisData,String dateType ,int berthRatio){ | 388 | + |
| 389 | + private LineChartVO getFreeBerthRatios(ParkingLotUseStatisticForPageRequest request, List<String> xAxisData, | ||
| 390 | + String dateType, int berthRatio) { | ||
| 385 | logger.info("调用DUBBO服务入参:" + JSON.toJSONString(request)); | 391 | logger.info("调用DUBBO服务入参:" + JSON.toJSONString(request)); |
| 386 | BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotStatisticService | 392 | BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotStatisticService |
| 387 | .queryParkingLotUseStatisticForPage(request); | 393 | .queryParkingLotUseStatisticForPage(request); |
| @@ -403,33 +409,33 @@ public class BerthsStatisticController extends BizController { | @@ -403,33 +409,33 @@ public class BerthsStatisticController extends BizController { | ||
| 403 | // 保存空置率 | 409 | // 保存空置率 |
| 404 | if (!parkLotMap.containsKey(key)) { | 410 | if (!parkLotMap.containsKey(key)) { |
| 405 | Map<String, Double> timeAndVal = Maps.newHashMap(); | 411 | Map<String, Double> timeAndVal = Maps.newHashMap(); |
| 406 | - if(ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE == berthRatio){ | 412 | + if (ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE == berthRatio) { |
| 407 | timeAndVal.put(statisBeginTime, statisticDTO.getFreeRatio() * 100); | 413 | timeAndVal.put(statisBeginTime, statisticDTO.getFreeRatio() * 100); |
| 408 | parkLotMap.put(key, timeAndVal); | 414 | parkLotMap.put(key, timeAndVal); |
| 409 | - }else if(ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER == berthRatio){ | 415 | + } else if (ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER == berthRatio) { |
| 410 | timeAndVal.put(statisBeginTime, statisticDTO.getTurnoverRatio() * 100); | 416 | timeAndVal.put(statisBeginTime, statisticDTO.getTurnoverRatio() * 100); |
| 411 | parkLotMap.put(key, timeAndVal); | 417 | parkLotMap.put(key, timeAndVal); |
| 412 | } | 418 | } |
| 413 | } else { | 419 | } else { |
| 414 | - if(ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE == berthRatio){ | 420 | + if (ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE == berthRatio) { |
| 415 | parkLotMap.get(key).put(statisBeginTime, statisticDTO.getFreeRatio() * 100); | 421 | parkLotMap.get(key).put(statisBeginTime, statisticDTO.getFreeRatio() * 100); |
| 416 | - }else if(ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER == berthRatio){ | 422 | + } else if (ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER == berthRatio) { |
| 417 | parkLotMap.get(key).put(statisBeginTime, statisticDTO.getTurnoverRatio() * 100); | 423 | parkLotMap.get(key).put(statisBeginTime, statisticDTO.getTurnoverRatio() * 100); |
| 418 | } | 424 | } |
| 419 | } | 425 | } |
| 420 | 426 | ||
| 421 | } | 427 | } |
| 422 | } | 428 | } |
| 423 | - //判断是否包含所有待查询的停车场信息 | ||
| 424 | - if(request.getPlNos().size()>parkLotMap.size()){ | ||
| 425 | - for (String plNo:request.getPlNos()) { | ||
| 426 | - if(!parkLotMap.containsKey(plNo)){ | ||
| 427 | - ParkingLotDTO parkingLotDTO=ParkingLotCacheUtil.getParkLotByPlNo(plNo); | ||
| 428 | - parkNameMap.put(plNo, parkingLotDTO.getPlName()); | ||
| 429 | - parkLotMap.put(plNo, Maps.newHashMap()); | ||
| 430 | - } | ||
| 431 | - } | ||
| 432 | - } | 429 | + // 判断是否包含所有待查询的停车场信息 |
| 430 | + if (request.getPlNos().size() > parkLotMap.size()) { | ||
| 431 | + for (String plNo : request.getPlNos()) { | ||
| 432 | + if (!parkLotMap.containsKey(plNo)) { | ||
| 433 | + ParkingLotDTO parkingLotDTO = ParkingLotCacheUtil.getParkLotByPlNo(plNo); | ||
| 434 | + parkNameMap.put(plNo, parkingLotDTO.getPlName()); | ||
| 435 | + parkLotMap.put(plNo, Maps.newHashMap()); | ||
| 436 | + } | ||
| 437 | + } | ||
| 438 | + } | ||
| 433 | 439 | ||
| 434 | // 封装车位统计信息 | 440 | // 封装车位统计信息 |
| 435 | LineChartVO freeBerthRatios = new LineChartVO(); | 441 | LineChartVO freeBerthRatios = new LineChartVO(); |
| @@ -453,7 +459,7 @@ public class BerthsStatisticController extends BizController { | @@ -453,7 +459,7 @@ public class BerthsStatisticController extends BizController { | ||
| 453 | for (String timestamp : xAxisData) { | 459 | for (String timestamp : xAxisData) { |
| 454 | if (freeRatioMaps.containsKey(timestamp)) { | 460 | if (freeRatioMaps.containsKey(timestamp)) { |
| 455 | lastFreeRatio = freeRatioMaps.get(timestamp).intValue(); | 461 | lastFreeRatio = freeRatioMaps.get(timestamp).intValue(); |
| 456 | - }else{ | 462 | + } else { |
| 457 | lastFreeRatio = 0; | 463 | lastFreeRatio = 0; |
| 458 | } | 464 | } |
| 459 | freeRations.add(lastFreeRatio); | 465 | freeRations.add(lastFreeRatio); |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/InOutParkStatisticController.java
| @@ -10,14 +10,12 @@ import java.util.Map; | @@ -10,14 +10,12 @@ import java.util.Map; | ||
| 10 | 10 | ||
| 11 | import javax.servlet.http.HttpServletRequest; | 11 | import javax.servlet.http.HttpServletRequest; |
| 12 | import javax.servlet.http.HttpServletResponse; | 12 | import javax.servlet.http.HttpServletResponse; |
| 13 | -import javax.servlet.http.HttpSession; | ||
| 14 | 13 | ||
| 15 | import org.apache.poi.xssf.usermodel.XSSFSheet; | 14 | import org.apache.poi.xssf.usermodel.XSSFSheet; |
| 16 | import org.slf4j.Logger; | 15 | import org.slf4j.Logger; |
| 17 | import org.slf4j.LoggerFactory; | 16 | import org.slf4j.LoggerFactory; |
| 18 | import org.springframework.beans.factory.annotation.Autowired; | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | import org.springframework.beans.factory.annotation.Value; | 18 | import org.springframework.beans.factory.annotation.Value; |
| 20 | -import org.springframework.security.config.authentication.UserServiceBeanDefinitionParser; | ||
| 21 | import org.springframework.stereotype.Controller; | 19 | import org.springframework.stereotype.Controller; |
| 22 | import org.springframework.web.bind.annotation.GetMapping; | 20 | import org.springframework.web.bind.annotation.GetMapping; |
| 23 | import org.springframework.web.bind.annotation.PostMapping; | 21 | import org.springframework.web.bind.annotation.PostMapping; |
| @@ -25,20 +23,15 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -25,20 +23,15 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 25 | import org.springframework.web.bind.annotation.RequestMapping; | 23 | import org.springframework.web.bind.annotation.RequestMapping; |
| 26 | import org.springframework.web.bind.annotation.RequestParam; | 24 | import org.springframework.web.bind.annotation.RequestParam; |
| 27 | import org.springframework.web.bind.annotation.ResponseBody; | 25 | import org.springframework.web.bind.annotation.ResponseBody; |
| 28 | -import org.springframework.web.bind.annotation.RestController; | ||
| 29 | 26 | ||
| 30 | import com.alibaba.dubbo.common.utils.CollectionUtils; | 27 | import com.alibaba.dubbo.common.utils.CollectionUtils; |
| 31 | -import com.alibaba.dubbo.common.utils.StringUtils; | ||
| 32 | import com.alibaba.fastjson.JSON; | 28 | import com.alibaba.fastjson.JSON; |
| 33 | -import com.clouds.common.entity.UserInfo; | ||
| 34 | -import com.clouds.common.utils.AmountUtils; | ||
| 35 | import com.clouds.common.utils.DateUtil; | 29 | import com.clouds.common.utils.DateUtil; |
| 36 | import com.clouds.common.utils.ResultUtils; | 30 | import com.clouds.common.utils.ResultUtils; |
| 37 | import com.clouds.common.utils.excle.ExcelUtil; | 31 | import com.clouds.common.utils.excle.ExcelUtil; |
| 38 | import com.clouds.common.utils.excle.ExcleFillDateManager; | 32 | import com.clouds.common.utils.excle.ExcleFillDateManager; |
| 39 | import com.clouds.common.utils.excle.Layouter; | 33 | import com.clouds.common.utils.excle.Layouter; |
| 40 | import com.clouds.common.web.BizController; | 34 | import com.clouds.common.web.BizController; |
| 41 | -import com.clouds.common.web.SessionCommUtil; | ||
| 42 | import com.clouds.common.web.vo.BizResultVO; | 35 | import com.clouds.common.web.vo.BizResultVO; |
| 43 | import com.clouds.common.web.vo.EasyUIDataGridVO; | 36 | import com.clouds.common.web.vo.EasyUIDataGridVO; |
| 44 | import com.google.common.collect.Lists; | 37 | import com.google.common.collect.Lists; |
| @@ -48,16 +41,13 @@ import com.zteits.clouds.api.apibase.bean.BizResult; | @@ -48,16 +41,13 @@ import com.zteits.clouds.api.apibase.bean.BizResult; | ||
| 48 | import com.zteits.clouds.api.apibase.bean.PageBean; | 41 | import com.zteits.clouds.api.apibase.bean.PageBean; |
| 49 | import com.zteits.clouds.api.apibase.constants.ErrorType; | 42 | import com.zteits.clouds.api.apibase.constants.ErrorType; |
| 50 | import com.zteits.clouds.api.apibase.exception.BizException; | 43 | import com.zteits.clouds.api.apibase.exception.BizException; |
| 51 | -import com.zteits.clouds.api.dto.clouds.dto.BillManageDTO; | ||
| 52 | import com.zteits.clouds.api.dto.park.dto.InOutParkDTO; | 44 | import com.zteits.clouds.api.dto.park.dto.InOutParkDTO; |
| 53 | import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO; | 45 | import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO; |
| 54 | import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticSumDTO; | 46 | import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticSumDTO; |
| 55 | import com.zteits.clouds.api.dto.park.param.InOutParkRequest; | 47 | import com.zteits.clouds.api.dto.park.param.InOutParkRequest; |
| 56 | import com.zteits.clouds.api.dto.park.param.ParkingLotUseStatisticForPageRequest; | 48 | import com.zteits.clouds.api.dto.park.param.ParkingLotUseStatisticForPageRequest; |
| 57 | -import com.zteits.clouds.api.dto.pay.param.TdCompanyParkQueryRequest; | ||
| 58 | import com.zteits.clouds.api.service.clouds.InOutParkStatisticService; | 49 | import com.zteits.clouds.api.service.clouds.InOutParkStatisticService; |
| 59 | import com.zteits.clouds.api.service.park.ParkingLotUseStatisticService; | 50 | import com.zteits.clouds.api.service.park.ParkingLotUseStatisticService; |
| 60 | -import com.zteits.clouds.api.service.pay.TdCustCompanyService; | ||
| 61 | import com.zteits.irain.portal.constant.ParkConstant; | 51 | import com.zteits.irain.portal.constant.ParkConstant; |
| 62 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO; | 52 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO; |
| 63 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO.SerieVO; | 53 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO.SerieVO; |
| @@ -125,6 +115,7 @@ public class InOutParkStatisticController extends BizController { | @@ -125,6 +115,7 @@ public class InOutParkStatisticController extends BizController { | ||
| 125 | 115 | ||
| 126 | Calendar beginTime = Calendar.getInstance(); | 116 | Calendar beginTime = Calendar.getInstance(); |
| 127 | beginTime.setTime(request.getBeginTime()); | 117 | beginTime.setTime(request.getBeginTime()); |
| 118 | + int year = beginTime.get(Calendar.YEAR); | ||
| 128 | 119 | ||
| 129 | Calendar endTime = Calendar.getInstance(); | 120 | Calendar endTime = Calendar.getInstance(); |
| 130 | endTime.setTime(request.getEndTime()); | 121 | endTime.setTime(request.getEndTime()); |
| @@ -137,56 +128,95 @@ public class InOutParkStatisticController extends BizController { | @@ -137,56 +128,95 @@ public class InOutParkStatisticController extends BizController { | ||
| 137 | if (dayDifference == 0L) { | 128 | if (dayDifference == 0L) { |
| 138 | //同一天 | 129 | //同一天 |
| 139 | // 20分钟为一个时间戳 | 130 | // 20分钟为一个时间戳 |
| 140 | - UseStatisticRequest.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER20MINUTE); | ||
| 141 | - int totaltimestampCount = (endTime.get(Calendar.HOUR_OF_DAY)-beginTime.get(Calendar.HOUR_OF_DAY))*3; | ||
| 142 | - for (int i = 0; i < totaltimestampCount; i++) { | ||
| 143 | - int hour1 = beginTime.get(Calendar.HOUR_OF_DAY)+i/3; | ||
| 144 | - String hour = String.format("%02d", hour1); | ||
| 145 | - String minute = String.format("%02d", (i % 3) * 20); | ||
| 146 | - xAxisData.add(hour + ":" + minute); | ||
| 147 | - } | ||
| 148 | - dateType="HH:mm"; | 131 | + UseStatisticRequest.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); |
| 132 | + int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); | ||
| 133 | + String day = ""; | ||
| 134 | + String month = ""; | ||
| 135 | + | ||
| 136 | + int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 137 | + int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | ||
| 138 | + month = String.format("%02d", (beginMonth)); | ||
| 139 | + day = String.format("%02d", (beginDay)); | ||
| 140 | + for (int j = 0; j <= totaltimestampCount; j++) { | ||
| 141 | + String hour = String.format("%02d", (j)); | ||
| 142 | + xAxisData.add(year + "-" + month + "-" + day + " " + hour); | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + dateType = "yyyy-MM-dd HH"; | ||
| 149 | LineChartVO vehicleFlows=getVehicleFlows(UseStatisticRequest, xAxisData, dateType); | 146 | LineChartVO vehicleFlows=getVehicleFlows(UseStatisticRequest, xAxisData, dateType); |
| 150 | return new BizResultVO<LineChartVO>().setData(vehicleFlows); | 147 | return new BizResultVO<LineChartVO>().setData(vehicleFlows); |
| 151 | 148 | ||
| 152 | } else if (dayDifference <= 3L) { | 149 | } else if (dayDifference <= 3L) { |
| 153 | // 1小时为一个时间戳 | 150 | // 1小时为一个时间戳 |
| 154 | UseStatisticRequest.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); | 151 | UseStatisticRequest.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); |
| 155 | - int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); | ||
| 156 | - String day = ""; | ||
| 157 | - String month = ""; | ||
| 158 | - for (int i = 0; i < dayDifference.intValue(); i++) { | ||
| 159 | - int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 160 | - int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | ||
| 161 | - month = String.format("%02d", (beginMonth)); | ||
| 162 | - day = String.format("%02d", (beginDay)); | ||
| 163 | - int endDay = endTime.get(Calendar.DAY_OF_MONTH); | ||
| 164 | - if(beginDay != endDay){ | ||
| 165 | - totaltimestampCount = 24; | ||
| 166 | - } | ||
| 167 | - for (int j = 0; j < totaltimestampCount; j++) { | ||
| 168 | - String hour = String.format("%02d", (j)); | ||
| 169 | - xAxisData.add(month + "-" + day + " " + hour); | ||
| 170 | - } | ||
| 171 | - beginTime.add(Calendar.DAY_OF_MONTH, 1); | ||
| 172 | - } | ||
| 173 | - dateType="MM-dd HH"; | 152 | + int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); |
| 153 | + String day = ""; | ||
| 154 | + String month = ""; | ||
| 155 | + for (int i = 0; i <=dayDifference.intValue(); i++) { | ||
| 156 | + Calendar tempDate = Calendar.getInstance(); | ||
| 157 | + tempDate .setTime(request.getBeginTime()); | ||
| 158 | + tempDate.add(Calendar.DAY_OF_MONTH, i); | ||
| 159 | + int beginMonth = tempDate.get(Calendar.MONTH) + 1; | ||
| 160 | + int beginDay = tempDate.get(Calendar.DAY_OF_MONTH); | ||
| 161 | + month = String.format("%02d", (beginMonth)); | ||
| 162 | + day = String.format("%02d", (beginDay)); | ||
| 163 | + for (int j = 0; j < 24; j++) { | ||
| 164 | + String hour = String.format("%02d", (j)); | ||
| 165 | + xAxisData.add(year + "-" + month + "-" + day + " " + hour); | ||
| 166 | + } | ||
| 167 | + } | ||
| 168 | + dateType = "yyyy-MM-dd HH"; | ||
| 169 | + | ||
| 170 | + | ||
| 171 | +// | ||
| 172 | +// int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); | ||
| 173 | +// String day = ""; | ||
| 174 | +// String month = ""; | ||
| 175 | +// for (int i = 0; i < dayDifference.intValue(); i++) { | ||
| 176 | +// int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 177 | +// int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | ||
| 178 | +// month = String.format("%02d", (beginMonth)); | ||
| 179 | +// day = String.format("%02d", (beginDay)); | ||
| 180 | +// int endDay = endTime.get(Calendar.DAY_OF_MONTH); | ||
| 181 | +// if(beginDay != endDay){ | ||
| 182 | +// totaltimestampCount = 24; | ||
| 183 | +// } | ||
| 184 | +// for (int j = 0; j < totaltimestampCount; j++) { | ||
| 185 | +// String hour = String.format("%02d", (j)); | ||
| 186 | +// xAxisData.add(month + "-" + day + " " + hour); | ||
| 187 | +// } | ||
| 188 | +// beginTime.add(Calendar.DAY_OF_MONTH, 1); | ||
| 189 | +// } | ||
| 190 | +// dateType="MM-dd HH"; | ||
| 174 | LineChartVO vehicleFlows=getVehicleFlows(UseStatisticRequest, xAxisData, dateType); | 191 | LineChartVO vehicleFlows=getVehicleFlows(UseStatisticRequest, xAxisData, dateType); |
| 175 | return new BizResultVO<LineChartVO>().setData(vehicleFlows); | 192 | return new BizResultVO<LineChartVO>().setData(vehicleFlows); |
| 176 | 193 | ||
| 177 | } else { | 194 | } else { |
| 178 | // 1天为一个时间戳 | 195 | // 1天为一个时间戳 |
| 179 | UseStatisticRequest.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY); | 196 | UseStatisticRequest.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY); |
| 180 | - for (int i = 0; i < dayDifference.intValue()+1; i++) { | ||
| 181 | - int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 182 | - int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | ||
| 183 | - String month = String.format("%02d", (beginMonth)); | ||
| 184 | - String day = String.format("%02d", (beginDay)); | ||
| 185 | - xAxisData.add(month + "-" + day); | ||
| 186 | - beginTime.add(Calendar.DAY_OF_MONTH, 1); | 197 | + for (int i = 0; i <=dayDifference.intValue(); i++) { |
| 198 | + Calendar tempDate = Calendar.getInstance(); | ||
| 199 | + tempDate .setTime(request.getBeginTime()); | ||
| 200 | + tempDate.add(Calendar.DAY_OF_MONTH, i); | ||
| 201 | + int beginMonth = tempDate.get(Calendar.MONTH) + 1; | ||
| 202 | + int beginDay = tempDate.get(Calendar.DAY_OF_MONTH); | ||
| 203 | + String month = String.format("%02d", (beginMonth)); | ||
| 204 | + String day = String.format("%02d", (beginDay)); | ||
| 205 | + xAxisData.add(year + "-" + month + "-" + day); | ||
| 187 | 206 | ||
| 188 | - } | ||
| 189 | - dateType="MM-dd"; | 207 | + } |
| 208 | + dateType = "yyyy-MM-dd"; | ||
| 209 | + | ||
| 210 | +// for (int i = 0; i < dayDifference.intValue()+1; i++) { | ||
| 211 | +// int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 212 | +// int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | ||
| 213 | +// String month = String.format("%02d", (beginMonth)); | ||
| 214 | +// String day = String.format("%02d", (beginDay)); | ||
| 215 | +// xAxisData.add(month + "-" + day); | ||
| 216 | +// beginTime.add(Calendar.DAY_OF_MONTH, 1); | ||
| 217 | +// | ||
| 218 | +// } | ||
| 219 | +// dateType="MM-dd"; | ||
| 190 | LineChartVO vehicleFlows=getVehicleFlows(UseStatisticRequest, xAxisData, dateType); | 220 | LineChartVO vehicleFlows=getVehicleFlows(UseStatisticRequest, xAxisData, dateType); |
| 191 | return new BizResultVO<LineChartVO>().setData(vehicleFlows); | 221 | return new BizResultVO<LineChartVO>().setData(vehicleFlows); |
| 192 | 222 |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/MonthBillManagementController.java
| @@ -14,13 +14,11 @@ import javax.servlet.http.HttpSession; | @@ -14,13 +14,11 @@ import javax.servlet.http.HttpSession; | ||
| 14 | 14 | ||
| 15 | import com.alibaba.dubbo.common.utils.CollectionUtils; | 15 | import com.alibaba.dubbo.common.utils.CollectionUtils; |
| 16 | import com.alibaba.dubbo.common.utils.StringUtils; | 16 | import com.alibaba.dubbo.common.utils.StringUtils; |
| 17 | -import com.alibaba.fastjson.JSONArray; | ||
| 18 | import com.alibaba.fastjson.JSONObject; | 17 | import com.alibaba.fastjson.JSONObject; |
| 19 | 18 | ||
| 20 | import com.clouds.common.entity.UserInfo; | 19 | import com.clouds.common.entity.UserInfo; |
| 21 | import com.clouds.common.utils.AmountUtils; | 20 | import com.clouds.common.utils.AmountUtils; |
| 22 | import com.clouds.common.utils.DateUtil; | 21 | import com.clouds.common.utils.DateUtil; |
| 23 | -import com.clouds.common.utils.ResultUtils; | ||
| 24 | import com.clouds.common.utils.excle.ExcelUtil; | 22 | import com.clouds.common.utils.excle.ExcelUtil; |
| 25 | import com.clouds.common.utils.excle.ExcleFillDateManager; | 23 | import com.clouds.common.utils.excle.ExcleFillDateManager; |
| 26 | import com.clouds.common.utils.excle.Layouter; | 24 | import com.clouds.common.utils.excle.Layouter; |
| @@ -42,7 +40,6 @@ import com.zteits.clouds.api.dto.clouds.dto.MonthBillSummaryStatisticDTO; | @@ -42,7 +40,6 @@ import com.zteits.clouds.api.dto.clouds.dto.MonthBillSummaryStatisticDTO; | ||
| 42 | import com.zteits.clouds.api.dto.clouds.dto.YearMonthCardStatisticDTO; | 40 | import com.zteits.clouds.api.dto.clouds.dto.YearMonthCardStatisticDTO; |
| 43 | import com.zteits.clouds.api.dto.clouds.param.BillQueryRequest; | 41 | import com.zteits.clouds.api.dto.clouds.param.BillQueryRequest; |
| 44 | import com.zteits.clouds.api.dto.clouds.param.MonthBillRequest; | 42 | import com.zteits.clouds.api.dto.clouds.param.MonthBillRequest; |
| 45 | -import com.zteits.clouds.api.dto.pay.param.TdCompanyParkQueryRequest; | ||
| 46 | import com.zteits.clouds.api.dto.pay.param.YearMonthCardStatisticRequest; | 43 | import com.zteits.clouds.api.dto.pay.param.YearMonthCardStatisticRequest; |
| 47 | import com.zteits.clouds.api.service.clouds.MonthBillManagementService; | 44 | import com.zteits.clouds.api.service.clouds.MonthBillManagementService; |
| 48 | import com.zteits.clouds.api.service.clouds.YearMonthCardStatisticService; | 45 | import com.zteits.clouds.api.service.clouds.YearMonthCardStatisticService; |
| @@ -76,11 +73,6 @@ public class MonthBillManagementController extends BizController { | @@ -76,11 +73,6 @@ public class MonthBillManagementController extends BizController { | ||
| 76 | private MonthBillManagementService monthBillManagementService; | 73 | private MonthBillManagementService monthBillManagementService; |
| 77 | @Autowired | 74 | @Autowired |
| 78 | private YearMonthCardStatisticService yearMonthCardStatisticService; | 75 | private YearMonthCardStatisticService yearMonthCardStatisticService; |
| 79 | - | ||
| 80 | - @Autowired | ||
| 81 | - private TdCustCompanyService tdCustCompanyService; | ||
| 82 | - @Autowired | ||
| 83 | - private HttpSession session; | ||
| 84 | @Autowired | 76 | @Autowired |
| 85 | private SessionCommUtil sessionCommUtil; | 77 | private SessionCommUtil sessionCommUtil; |
| 86 | @Value("${project.syscode}") | 78 | @Value("${project.syscode}") |
| @@ -180,18 +172,20 @@ public class MonthBillManagementController extends BizController { | @@ -180,18 +172,20 @@ public class MonthBillManagementController extends BizController { | ||
| 180 | public BizResultVO<EasyUIDataGridVO<BillManageForMonthDTO>> queryBillforMonthList( | 172 | public BizResultVO<EasyUIDataGridVO<BillManageForMonthDTO>> queryBillforMonthList( |
| 181 | @RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, HttpServletResponse response) | 173 | @RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, HttpServletResponse response) |
| 182 | throws Exception { | 174 | throws Exception { |
| 183 | - // 2.调用接口查询当前登录人管辖的停车场名称 | 175 | + // 2.调用接口查询当前登录人管辖的停车场名称 |
| 184 | UserInfo userInfo = sessionCommUtil.getUserInfo(); | 176 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
| 185 | - List<String> plNos = new ArrayList<>(); | ||
| 186 | - if (userInfo != null) { | ||
| 187 | - TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
| 188 | - tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
| 189 | - tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
| 190 | - tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
| 191 | - BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest); | ||
| 192 | - // 拥有的停车场编号 | ||
| 193 | - plNos = ResultUtils.getBizResultData(bizResult); | ||
| 194 | - } | 177 | + List<String> plNos = userInfo.getOrgIds(); |
| 178 | +// UserInfo userInfo = sessionCommUtil.getUserInfo(); | ||
| 179 | +// List<String> plNos = new ArrayList<>(); | ||
| 180 | +// if (userInfo != null) { | ||
| 181 | +// TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
| 182 | +// tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
| 183 | +// tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
| 184 | +// tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
| 185 | +// BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest); | ||
| 186 | +// // 拥有的停车场编号 | ||
| 187 | +// plNos = ResultUtils.getBizResultData(bizResult); | ||
| 188 | +// } | ||
| 195 | // if (CollectionUtils.isEmpty(plNos)) { | 189 | // if (CollectionUtils.isEmpty(plNos)) { |
| 196 | // throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); | 190 | // throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); |
| 197 | // } | 191 | // } |
| @@ -215,16 +209,17 @@ public class MonthBillManagementController extends BizController { | @@ -215,16 +209,17 @@ public class MonthBillManagementController extends BizController { | ||
| 215 | throws Exception { | 209 | throws Exception { |
| 216 | // 2.调用接口查询当前登录人管辖的停车场名称 | 210 | // 2.调用接口查询当前登录人管辖的停车场名称 |
| 217 | UserInfo userInfo = sessionCommUtil.getUserInfo(); | 211 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
| 218 | - List<String> plNos = new ArrayList<>(); | ||
| 219 | - if (userInfo != null) { | ||
| 220 | - TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
| 221 | - tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
| 222 | - tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
| 223 | - tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
| 224 | - BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest); | ||
| 225 | - // 拥有的停车场编号 | ||
| 226 | - plNos = ResultUtils.getBizResultData(bizResult); | ||
| 227 | - } | 212 | + List<String> plNos = userInfo.getOrgIds(); |
| 213 | +// List<String> plNos = new ArrayList<>(); | ||
| 214 | +// if (userInfo != null) { | ||
| 215 | +// TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
| 216 | +// tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
| 217 | +// tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
| 218 | +// tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
| 219 | +// BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest); | ||
| 220 | +// // 拥有的停车场编号 | ||
| 221 | +// plNos = ResultUtils.getBizResultData(bizResult); | ||
| 222 | +// } | ||
| 228 | // if (CollectionUtils.isEmpty(plNos)) { | 223 | // if (CollectionUtils.isEmpty(plNos)) { |
| 229 | // throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); | 224 | // throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); |
| 230 | // } | 225 | // } |
| @@ -456,17 +451,20 @@ public class MonthBillManagementController extends BizController { | @@ -456,17 +451,20 @@ public class MonthBillManagementController extends BizController { | ||
| 456 | billQueryRequest.setBaseRequest(new BaseInfo(1, 0)); | 451 | billQueryRequest.setBaseRequest(new BaseInfo(1, 0)); |
| 457 | // 2.调用接口查询当前登录人管辖的停车场名称 | 452 | // 2.调用接口查询当前登录人管辖的停车场名称 |
| 458 | UserInfo userInfo = sessionCommUtil.getUserInfo(); | 453 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
| 459 | - List<String> plNos = new ArrayList<>(); | ||
| 460 | - if (userInfo != null) { | ||
| 461 | - TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
| 462 | - tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
| 463 | - tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
| 464 | - tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
| 465 | - BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds( | ||
| 466 | - tdCompanyParkQueryRequest); | ||
| 467 | - // 拥有的停车场编号 | ||
| 468 | - plNos = ResultUtils.getBizResultData(bizResult); | ||
| 469 | - } | 454 | + List<String> plNos = userInfo.getOrgIds(); |
| 455 | +// // 2.调用接口查询当前登录人管辖的停车场名称 | ||
| 456 | +// UserInfo userInfo = sessionCommUtil.getUserInfo(); | ||
| 457 | +// List<String> plNos = new ArrayList<>(); | ||
| 458 | +// if (userInfo != null) { | ||
| 459 | +// TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
| 460 | +// tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
| 461 | +// tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
| 462 | +// tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
| 463 | +// BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds( | ||
| 464 | +// tdCompanyParkQueryRequest); | ||
| 465 | +// // 拥有的停车场编号 | ||
| 466 | +// plNos = ResultUtils.getBizResultData(bizResult); | ||
| 467 | +// } | ||
| 470 | billQueryRequest.setParkIdList(plNos); | 468 | billQueryRequest.setParkIdList(plNos); |
| 471 | logger.info("月账单导出所有 req={}", JSONObject.toJSONString(billQueryRequest)); | 469 | logger.info("月账单导出所有 req={}", JSONObject.toJSONString(billQueryRequest)); |
| 472 | respondResult = monthBillManagementService | 470 | respondResult = monthBillManagementService |
| @@ -549,17 +547,17 @@ public class MonthBillManagementController extends BizController { | @@ -549,17 +547,17 @@ public class MonthBillManagementController extends BizController { | ||
| 549 | * @return | 547 | * @return |
| 550 | * @throws Exception | 548 | * @throws Exception |
| 551 | */ | 549 | */ |
| 552 | - private List<String> queryParkNoByCustIds(TdCompanyParkQueryRequest tdCompanyParkQueryRequest) throws Exception { | ||
| 553 | - /** 查询停车场编码. */ | ||
| 554 | - BizResult<List<String>> parkNoResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest); | ||
| 555 | - if (parkNoResult.isSuccess() && parkNoResult != null && parkNoResult.getData() != null) { | ||
| 556 | - logger.info("根据登录获取到对应的停车场编码=" + JSONArray.toJSONString(parkNoResult.getData())); | ||
| 557 | - return parkNoResult.getData(); | ||
| 558 | - } else { | ||
| 559 | - logger.info("根据登录用户没有获取到对应的停车场编码"); | ||
| 560 | - return null; | ||
| 561 | - } | ||
| 562 | - | ||
| 563 | - } | 550 | +// private List<String> queryParkNoByCustIds(TdCompanyParkQueryRequest tdCompanyParkQueryRequest) throws Exception { |
| 551 | +// /** 查询停车场编码. */ | ||
| 552 | +// BizResult<List<String>> parkNoResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest); | ||
| 553 | +// if (parkNoResult.isSuccess() && parkNoResult != null && parkNoResult.getData() != null) { | ||
| 554 | +// logger.info("根据登录获取到对应的停车场编码=" + JSONArray.toJSONString(parkNoResult.getData())); | ||
| 555 | +// return parkNoResult.getData(); | ||
| 556 | +// } else { | ||
| 557 | +// logger.info("根据登录用户没有获取到对应的停车场编码"); | ||
| 558 | +// return null; | ||
| 559 | +// } | ||
| 560 | +// | ||
| 561 | +// } | ||
| 564 | 562 | ||
| 565 | } | 563 | } |
| 566 | \ No newline at end of file | 564 | \ No newline at end of file |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/ParkLotStatisticController.java
| @@ -112,21 +112,24 @@ public class ParkLotStatisticController { | @@ -112,21 +112,24 @@ public class ParkLotStatisticController { | ||
| 112 | 112 | ||
| 113 | private List<String> GetParkLotNosByCurrUser(String sysCode) throws Exception { | 113 | private List<String> GetParkLotNosByCurrUser(String sysCode) throws Exception { |
| 114 | logger.info("根据登录人权限获取停车场列表"); | 114 | logger.info("根据登录人权限获取停车场列表"); |
| 115 | - List<String> plNos = Lists.newArrayList(); | ||
| 116 | - //2.调用接口查询当前登录人管辖的停车场名称 | ||
| 117 | /*plNos.add("A320211000"); | 115 | /*plNos.add("A320211000"); |
| 118 | plNos.add("B1504020C7");*/ | 116 | plNos.add("B1504020C7");*/ |
| 119 | - UserInfo userInfo = sessionCommUtil.getUserInfo(); | ||
| 120 | - if(userInfo!=null){ | ||
| 121 | - TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
| 122 | - tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
| 123 | - tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
| 124 | - tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
| 125 | - BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest ); | ||
| 126 | - plNos = ResultUtils.getBizResultData(bizResult); | ||
| 127 | - }else{ | ||
| 128 | - throw new BizException(ErrorType.AUTH_TOKEN_NOT_EXISTS); | ||
| 129 | - } | 117 | + // 2.调用接口查询当前登录人管辖的停车场名称 |
| 118 | + UserInfo userInfo = sessionCommUtil.getUserInfo(); | ||
| 119 | + List<String> plNos = userInfo.getOrgIds(); | ||
| 120 | +// if(userInfo!=null){ | ||
| 121 | +// TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
| 122 | +// tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
| 123 | +// tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
| 124 | +// tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
| 125 | +// BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest ); | ||
| 126 | +// plNos = ResultUtils.getBizResultData(bizResult); | ||
| 127 | +// }else{ | ||
| 128 | +// throw new BizException(ErrorType.AUTH_TOKEN_NOT_EXISTS); | ||
| 129 | +// } | ||
| 130 | + if(CollectionUtils.isEmpty(plNos)){ | ||
| 131 | + throw new BizException(ErrorType.AUTH_TOKEN_NOT_EXISTS); | ||
| 132 | + } | ||
| 130 | return plNos; | 133 | return plNos; |
| 131 | } | 134 | } |
| 132 | } | 135 | } |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/VehicleFlowStatisticController.java
| @@ -10,7 +10,6 @@ import java.util.Map; | @@ -10,7 +10,6 @@ import java.util.Map; | ||
| 10 | 10 | ||
| 11 | import javax.servlet.http.HttpServletRequest; | 11 | import javax.servlet.http.HttpServletRequest; |
| 12 | import javax.servlet.http.HttpServletResponse; | 12 | import javax.servlet.http.HttpServletResponse; |
| 13 | -import javax.servlet.http.HttpSession; | ||
| 14 | 13 | ||
| 15 | import com.alibaba.dubbo.common.utils.CollectionUtils; | 14 | import com.alibaba.dubbo.common.utils.CollectionUtils; |
| 16 | import com.alibaba.fastjson.JSON; | 15 | import com.alibaba.fastjson.JSON; |
| @@ -37,7 +36,6 @@ import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO; | @@ -37,7 +36,6 @@ import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO; | ||
| 37 | import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticMaxAndMinDTO; | 36 | import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticMaxAndMinDTO; |
| 38 | import com.zteits.clouds.api.dto.park.param.ParkingLotUseStatisticForPageRequest; | 37 | import com.zteits.clouds.api.dto.park.param.ParkingLotUseStatisticForPageRequest; |
| 39 | import com.zteits.clouds.api.service.park.ParkingLotUseStatisticService; | 38 | import com.zteits.clouds.api.service.park.ParkingLotUseStatisticService; |
| 40 | -import com.zteits.clouds.api.service.pay.TdCustCompanyService; | ||
| 41 | import com.zteits.irain.portal.constant.ParkConstant; | 39 | import com.zteits.irain.portal.constant.ParkConstant; |
| 42 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO; | 40 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO; |
| 43 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO.SerieVO; | 41 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO.SerieVO; |
| @@ -79,11 +77,7 @@ public class VehicleFlowStatisticController extends BizController { | @@ -79,11 +77,7 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 79 | @Autowired | 77 | @Autowired |
| 80 | private ParkingLotUseStatisticService parkingLotStatisticService; | 78 | private ParkingLotUseStatisticService parkingLotStatisticService; |
| 81 | @Autowired | 79 | @Autowired |
| 82 | - private HttpSession session; | ||
| 83 | - @Autowired | ||
| 84 | private SessionCommUtil sessionCommUtil; | 80 | private SessionCommUtil sessionCommUtil; |
| 85 | - @Autowired | ||
| 86 | - private TdCustCompanyService tdCustCompanyService; | ||
| 87 | 81 | ||
| 88 | @ApiOperation("分页查询车流量数据统计车位总流量") | 82 | @ApiOperation("分页查询车流量数据统计车位总流量") |
| 89 | @PostMapping("getVehicleFlowStatisticForPage") | 83 | @PostMapping("getVehicleFlowStatisticForPage") |
| @@ -229,9 +223,9 @@ public class VehicleFlowStatisticController extends BizController { | @@ -229,9 +223,9 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 229 | // 2.调用接口查询当前登录人管辖的停车场名称 | 223 | // 2.调用接口查询当前登录人管辖的停车场名称 |
| 230 | UserInfo userInfo = sessionCommUtil.getUserInfo(); | 224 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
| 231 | List<String> plNos = userInfo.getOrgIds(); | 225 | List<String> plNos = userInfo.getOrgIds(); |
| 232 | - if (CollectionUtils.isEmpty(plNos)) { | ||
| 233 | - throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); | ||
| 234 | - } | 226 | +// if (CollectionUtils.isEmpty(plNos)) { |
| 227 | +// throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); | ||
| 228 | +// } | ||
| 235 | request.setPlNos(plNos); | 229 | request.setPlNos(plNos); |
| 236 | 230 | ||
| 237 | logger.info("根据停车场编号获取该停车场今日车流量和车位折线图"); | 231 | logger.info("根据停车场编号获取该停车场今日车流量和车位折线图"); |
| @@ -258,7 +252,7 @@ public class VehicleFlowStatisticController extends BizController { | @@ -258,7 +252,7 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 258 | int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | 252 | int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); |
| 259 | month = String.format("%02d", (beginMonth)); | 253 | month = String.format("%02d", (beginMonth)); |
| 260 | day = String.format("%02d", (beginDay)); | 254 | day = String.format("%02d", (beginDay)); |
| 261 | - for (int j = 0; j < totaltimestampCount; j++) { | 255 | + for (int j = 0; j <= totaltimestampCount; j++) { |
| 262 | String hour = String.format("%02d", (j)); | 256 | String hour = String.format("%02d", (j)); |
| 263 | xAxisData.add(year + "-" + month + "-" + day + " " + hour); | 257 | xAxisData.add(year + "-" + month + "-" + day + " " + hour); |
| 264 | } | 258 | } |
| @@ -281,7 +275,7 @@ public class VehicleFlowStatisticController extends BizController { | @@ -281,7 +275,7 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 281 | int beginDay = tempDate.get(Calendar.DAY_OF_MONTH); | 275 | int beginDay = tempDate.get(Calendar.DAY_OF_MONTH); |
| 282 | month = String.format("%02d", (beginMonth)); | 276 | month = String.format("%02d", (beginMonth)); |
| 283 | day = String.format("%02d", (beginDay)); | 277 | day = String.format("%02d", (beginDay)); |
| 284 | - for (int j = 0; j < totaltimestampCount; j++) { | 278 | + for (int j = 0; j <= totaltimestampCount; j++) { |
| 285 | String hour = String.format("%02d", (j)); | 279 | String hour = String.format("%02d", (j)); |
| 286 | xAxisData.add(year + "-" + month + "-" + day + " " + hour); | 280 | xAxisData.add(year + "-" + month + "-" + day + " " + hour); |
| 287 | } | 281 | } |