Commit fa587b833a85c8720a751aacc59d09da14f7280c
1 parent
35970915
提交
Showing
2 changed files
with
86 additions
and
60 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthsStatisticController.java
| @@ -235,12 +235,21 @@ public class BerthsStatisticController extends BizController { | @@ -235,12 +235,21 @@ public class BerthsStatisticController extends BizController { | ||
| 235 | // 1个小时为一个时间戳 | 235 | // 1个小时为一个时间戳 |
| 236 | request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); | 236 | request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); |
| 237 | int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); | 237 | int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); |
| 238 | - for (int i = 0; i <= totaltimestampCount; i++) { | ||
| 239 | - String hour = String.format("%02d", i); | ||
| 240 | - xAxisData.add(hour + ":" + "00"); | 238 | + String day = ""; |
| 239 | + 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 | + } | ||
| 241 | } | 250 | } |
| 242 | request.setBaseRequest(new BaseInfo(1, 0)); | 251 | request.setBaseRequest(new BaseInfo(1, 0)); |
| 243 | - dateType="HH:mm"; | 252 | + dateType="MM-dd HH"; |
| 244 | LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); | 253 | LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); |
| 245 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); | 254 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); |
| 246 | } else if (dayDifference <= 3L) { | 255 | } else if (dayDifference <= 3L) { |
| @@ -300,6 +309,7 @@ public class BerthsStatisticController extends BizController { | @@ -300,6 +309,7 @@ public class BerthsStatisticController extends BizController { | ||
| 300 | throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间"); | 309 | throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间"); |
| 301 | } | 310 | } |
| 302 | Calendar beginTime = Calendar.getInstance(); | 311 | Calendar beginTime = Calendar.getInstance(); |
| 312 | + int year=beginTime.get(Calendar.YEAR); | ||
| 303 | beginTime.setTime(request.getBeginTime()); | 313 | beginTime.setTime(request.getBeginTime()); |
| 304 | 314 | ||
| 305 | Calendar endTime = Calendar.getInstance(); | 315 | Calendar endTime = Calendar.getInstance(); |
| @@ -309,18 +319,26 @@ public class BerthsStatisticController extends BizController { | @@ -309,18 +319,26 @@ public class BerthsStatisticController extends BizController { | ||
| 309 | new Timestamp(request.getBeginTime().getTime())); | 319 | new Timestamp(request.getBeginTime().getTime())); |
| 310 | List<String> xAxisData = Lists.newArrayList(); | 320 | List<String> xAxisData = Lists.newArrayList(); |
| 311 | String dateType=""; | 321 | String dateType=""; |
| 322 | + request.setBaseRequest(new BaseInfo(1, 0)); | ||
| 312 | int berthRatio=ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER; | 323 | int berthRatio=ParkConstant.ParkingLotUseStatistic.BerthRatioType.TURNOVER; |
| 313 | if (dayDifference == 0L) { | 324 | if (dayDifference == 0L) { |
| 314 | //1个小时为一个时间戳 | 325 | //1个小时为一个时间戳 |
| 315 | request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); | 326 | request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); |
| 316 | int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); | 327 | int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); |
| 317 | - for (int j = 0; j <= totaltimestampCount; j++) { | ||
| 318 | - String hour = String.format("%02d", (j)); | ||
| 319 | - xAxisData.add(hour + ":" + "00"); | 328 | + String day = ""; |
| 329 | + 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 | + } | ||
| 320 | } | 340 | } |
| 321 | - | ||
| 322 | - request.setBaseRequest(new BaseInfo(1, 0)); | ||
| 323 | - dateType="HH:mm"; | 341 | + dateType="yyyy-MM-dd HH"; |
| 324 | LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); | 342 | LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); |
| 325 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); | 343 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); |
| 326 | } else if (dayDifference <= 3L) { | 344 | } else if (dayDifference <= 3L) { |
| @@ -337,11 +355,10 @@ public class BerthsStatisticController extends BizController { | @@ -337,11 +355,10 @@ public class BerthsStatisticController extends BizController { | ||
| 337 | day = String.format("%02d", (beginDay)); | 355 | day = String.format("%02d", (beginDay)); |
| 338 | for (int j = 0; j < totaltimestampCount; j++) { | 356 | for (int j = 0; j < totaltimestampCount; j++) { |
| 339 | String hour = String.format("%02d", (j)); | 357 | String hour = String.format("%02d", (j)); |
| 340 | - xAxisData.add(month + "-" + day + " " + hour); | 358 | + xAxisData.add(year+"-"+month + "-" + day + " " + hour); |
| 341 | } | 359 | } |
| 342 | } | 360 | } |
| 343 | - request.setBaseRequest(new BaseInfo(1, 0)); | ||
| 344 | - dateType="MM-dd HH"; | 361 | + dateType="yyyy-MM-dd HH"; |
| 345 | LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); | 362 | LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); |
| 346 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); | 363 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); |
| 347 | } else { | 364 | } else { |
| @@ -353,10 +370,9 @@ public class BerthsStatisticController extends BizController { | @@ -353,10 +370,9 @@ public class BerthsStatisticController extends BizController { | ||
| 353 | int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | 370 | int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); |
| 354 | String month = String.format("%02d", (beginMonth)); | 371 | String month = String.format("%02d", (beginMonth)); |
| 355 | String day = String.format("%02d", (beginDay)); | 372 | String day = String.format("%02d", (beginDay)); |
| 356 | - xAxisData.add(month + "-" + day); | 373 | + xAxisData.add(year+"-"+month + "-" + day); |
| 357 | } | 374 | } |
| 358 | - request.setBaseRequest(new BaseInfo(1, 0)); | ||
| 359 | - dateType="MM-dd"; | 375 | + dateType="yyyy-MM-dd"; |
| 360 | LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); | 376 | LineChartVO freeBerthRatios=getFreeBerthRatios(request, xAxisData, dateType,berthRatio); |
| 361 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); | 377 | return new BizResultVO<LineChartVO>().setData(freeBerthRatios); |
| 362 | } | 378 | } |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/VehicleFlowStatisticController.java
| @@ -95,9 +95,9 @@ public class VehicleFlowStatisticController extends BizController { | @@ -95,9 +95,9 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 95 | @ResponseBody | 95 | @ResponseBody |
| 96 | public BizResultVO<EasyUIDataGridVO<ParkingLotUseStatisticDTO>> queryParkingLotUseStatisticForPage( | 96 | public BizResultVO<EasyUIDataGridVO<ParkingLotUseStatisticDTO>> queryParkingLotUseStatisticForPage( |
| 97 | @RequestBody ParkingLotUseStatisticForPageRequest request) throws Exception { | 97 | @RequestBody ParkingLotUseStatisticForPageRequest request) throws Exception { |
| 98 | - if (null == request.getBeginTime() || null==request.getEndTime()) { | ||
| 99 | - throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间"); | ||
| 100 | - } | 98 | + if (null == request.getBeginTime() || null == request.getEndTime()) { |
| 99 | + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间"); | ||
| 100 | + } | ||
| 101 | Calendar beginc = Calendar.getInstance(); | 101 | Calendar beginc = Calendar.getInstance(); |
| 102 | beginc.setTime(request.getBeginTime()); | 102 | beginc.setTime(request.getBeginTime()); |
| 103 | int beginYear = beginc.get(Calendar.YEAR); | 103 | int beginYear = beginc.get(Calendar.YEAR); |
| @@ -220,7 +220,7 @@ public class VehicleFlowStatisticController extends BizController { | @@ -220,7 +220,7 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 220 | * | 220 | * |
| 221 | * @param request | 221 | * @param request |
| 222 | * @return | 222 | * @return |
| 223 | - * @throws Exception | 223 | + * @throws Exception |
| 224 | */ | 224 | */ |
| 225 | @ApiOperation("根据时间获取车流量折线图") | 225 | @ApiOperation("根据时间获取车流量折线图") |
| 226 | @PostMapping("getVehicleFlowForLineChart") | 226 | @PostMapping("getVehicleFlowForLineChart") |
| @@ -228,22 +228,22 @@ public class VehicleFlowStatisticController extends BizController { | @@ -228,22 +228,22 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 228 | public BizResultVO<LineChartVO> getVehicleFlowForLineChart( | 228 | public BizResultVO<LineChartVO> getVehicleFlowForLineChart( |
| 229 | @RequestBody ParkingLotUseStatisticForPageRequest request) throws Exception { | 229 | @RequestBody ParkingLotUseStatisticForPageRequest request) throws Exception { |
| 230 | 230 | ||
| 231 | - if (null == request.getBeginTime() || null==request.getEndTime()) { | ||
| 232 | - throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间"); | ||
| 233 | - } | ||
| 234 | - //2.调用接口查询当前登录人管辖的停车场名称 | 231 | + if (null == request.getBeginTime() || null == request.getEndTime()) { |
| 232 | + throw new BizException(ErrorType.PARAMM_NULL, "开始时间和结束时间"); | ||
| 233 | + } | ||
| 234 | + // 2.调用接口查询当前登录人管辖的停车场名称 | ||
| 235 | UserInfo userInfo = sessionCommUtil.getUserInfo(); | 235 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
| 236 | List<String> plNos = new ArrayList<>(); | 236 | List<String> plNos = new ArrayList<>(); |
| 237 | - if(userInfo!=null){ | 237 | + if (userInfo != null) { |
| 238 | TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | 238 | TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); |
| 239 | tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | 239 | tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); |
| 240 | tdCompanyParkQueryRequest.setSessionId(session.getId()); | 240 | tdCompanyParkQueryRequest.setSessionId(session.getId()); |
| 241 | tdCompanyParkQueryRequest.setSysCode(sysCode); | 241 | tdCompanyParkQueryRequest.setSysCode(sysCode); |
| 242 | BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest); | 242 | BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest); |
| 243 | - //拥有的停车场编号 | 243 | + // 拥有的停车场编号 |
| 244 | plNos = ResultUtils.getBizResultData(bizResult); | 244 | plNos = ResultUtils.getBizResultData(bizResult); |
| 245 | } | 245 | } |
| 246 | - if(CollectionUtils.isEmpty(plNos)){ | 246 | + if (CollectionUtils.isEmpty(plNos)) { |
| 247 | throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); | 247 | throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); |
| 248 | } | 248 | } |
| 249 | request.setPlNos(plNos); | 249 | request.setPlNos(plNos); |
| @@ -251,7 +251,7 @@ public class VehicleFlowStatisticController extends BizController { | @@ -251,7 +251,7 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 251 | logger.info("根据停车场编号获取该停车场今日车流量和车位折线图"); | 251 | logger.info("根据停车场编号获取该停车场今日车流量和车位折线图"); |
| 252 | Calendar beginTime = Calendar.getInstance(); | 252 | Calendar beginTime = Calendar.getInstance(); |
| 253 | beginTime.setTime(request.getBeginTime()); | 253 | beginTime.setTime(request.getBeginTime()); |
| 254 | - | 254 | + int year=beginTime.get(Calendar.YEAR); |
| 255 | Calendar endTime = Calendar.getInstance(); | 255 | Calendar endTime = Calendar.getInstance(); |
| 256 | endTime.setTime(request.getEndTime()); | 256 | endTime.setTime(request.getEndTime()); |
| 257 | 257 | ||
| @@ -259,19 +259,27 @@ public class VehicleFlowStatisticController extends BizController { | @@ -259,19 +259,27 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 259 | new Timestamp(request.getBeginTime().getTime())); | 259 | new Timestamp(request.getBeginTime().getTime())); |
| 260 | List<String> xAxisData = Lists.newArrayList(); | 260 | List<String> xAxisData = Lists.newArrayList(); |
| 261 | request.setBaseRequest(new BaseInfo(1, 0)); | 261 | request.setBaseRequest(new BaseInfo(1, 0)); |
| 262 | - String dateType=""; | ||
| 263 | - | 262 | + String dateType = ""; |
| 263 | + | ||
| 264 | if (dayDifference == 0L) { | 264 | if (dayDifference == 0L) { |
| 265 | - // 20分钟为一个时间戳 | ||
| 266 | - request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER20MINUTE); | ||
| 267 | - int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY) * 3; | ||
| 268 | - for (int i = 0; i < totaltimestampCount; i++) { | ||
| 269 | - String hour = String.format("%02d", (i / 3)); | ||
| 270 | - String minute = String.format("%02d", (i % 3) * 20); | ||
| 271 | - xAxisData.add(hour + ":" + minute); | 265 | + // 1小时为一个时间戳 |
| 266 | + request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); | ||
| 267 | + int totaltimestampCount = endTime.get(Calendar.HOUR_OF_DAY); | ||
| 268 | + String day = ""; | ||
| 269 | + String month = ""; | ||
| 270 | + for (int i = 0; i < dayDifference.intValue(); i++) { | ||
| 271 | + beginTime.add(Calendar.DAY_OF_MONTH, 1); | ||
| 272 | + int beginMonth = beginTime.get(Calendar.MONTH) + 1; | ||
| 273 | + int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | ||
| 274 | + month = String.format("%02d", (beginMonth)); | ||
| 275 | + day = String.format("%02d", (beginDay)); | ||
| 276 | + for (int j = 0; j < totaltimestampCount; j++) { | ||
| 277 | + String hour = String.format("%02d", (j)); | ||
| 278 | + xAxisData.add(year+"-"+month + "-" + day + " " + hour); | ||
| 279 | + } | ||
| 272 | } | 280 | } |
| 273 | - dateType="HH:mm"; | ||
| 274 | - LineChartVO vehicleFlows=getVehicleFlows(request, xAxisData, dateType); | 281 | + dateType = "yyyy-MM-dd HH"; |
| 282 | + LineChartVO vehicleFlows = getVehicleFlows(request, xAxisData, dateType); | ||
| 275 | return new BizResultVO<LineChartVO>().setData(vehicleFlows); | 283 | return new BizResultVO<LineChartVO>().setData(vehicleFlows); |
| 276 | 284 | ||
| 277 | } else if (dayDifference <= 3L) { | 285 | } else if (dayDifference <= 3L) { |
| @@ -288,11 +296,11 @@ public class VehicleFlowStatisticController extends BizController { | @@ -288,11 +296,11 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 288 | day = String.format("%02d", (beginDay)); | 296 | day = String.format("%02d", (beginDay)); |
| 289 | for (int j = 0; j < totaltimestampCount; j++) { | 297 | for (int j = 0; j < totaltimestampCount; j++) { |
| 290 | String hour = String.format("%02d", (j)); | 298 | String hour = String.format("%02d", (j)); |
| 291 | - xAxisData.add(month + "-" + day + " " + hour); | 299 | + xAxisData.add(year+"-"+month + "-" + day + " " + hour); |
| 292 | } | 300 | } |
| 293 | } | 301 | } |
| 294 | - dateType="MM-dd HH"; | ||
| 295 | - LineChartVO vehicleFlows=getVehicleFlows(request, xAxisData, dateType); | 302 | + dateType = "yyyy-MM-dd HH"; |
| 303 | + LineChartVO vehicleFlows = getVehicleFlows(request, xAxisData, dateType); | ||
| 296 | return new BizResultVO<LineChartVO>().setData(vehicleFlows); | 304 | return new BizResultVO<LineChartVO>().setData(vehicleFlows); |
| 297 | 305 | ||
| 298 | } else { | 306 | } else { |
| @@ -304,20 +312,19 @@ public class VehicleFlowStatisticController extends BizController { | @@ -304,20 +312,19 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 304 | int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); | 312 | int beginDay = beginTime.get(Calendar.DAY_OF_MONTH); |
| 305 | String month = String.format("%02d", (beginMonth)); | 313 | String month = String.format("%02d", (beginMonth)); |
| 306 | String day = String.format("%02d", (beginDay)); | 314 | String day = String.format("%02d", (beginDay)); |
| 307 | - xAxisData.add(month + "-" + day); | 315 | + xAxisData.add(year+"-"+month + "-" + day); |
| 308 | 316 | ||
| 309 | } | 317 | } |
| 310 | - dateType="MM-dd"; | ||
| 311 | - LineChartVO vehicleFlows=getVehicleFlows(request, xAxisData, dateType); | 318 | + dateType = "yyyy-MM-dd"; |
| 319 | + LineChartVO vehicleFlows = getVehicleFlows(request, xAxisData, dateType); | ||
| 312 | return new BizResultVO<LineChartVO>().setData(vehicleFlows); | 320 | return new BizResultVO<LineChartVO>().setData(vehicleFlows); |
| 313 | 321 | ||
| 314 | } | 322 | } |
| 315 | 323 | ||
| 316 | } | 324 | } |
| 317 | - | ||
| 318 | - | ||
| 319 | - private LineChartVO getVehicleFlows(ParkingLotUseStatisticForPageRequest request, | ||
| 320 | - List<String> xAxisData,String dateType){ | 325 | + |
| 326 | + private LineChartVO getVehicleFlows(ParkingLotUseStatisticForPageRequest request, List<String> xAxisData, | ||
| 327 | + String dateType) { | ||
| 321 | // 调用后场服务 | 328 | // 调用后场服务 |
| 322 | logger.info("调用DUBBO服务入参:" + JSON.toJSONString(request)); | 329 | logger.info("调用DUBBO服务入参:" + JSON.toJSONString(request)); |
| 323 | BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotStatisticService | 330 | BizResult<PageBean<ParkingLotUseStatisticDTO>> bizResult = parkingLotStatisticService |
| @@ -341,9 +348,13 @@ public class VehicleFlowStatisticController extends BizController { | @@ -341,9 +348,13 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 341 | String key = statisticDTO.getPlNo(); | 348 | String key = statisticDTO.getPlNo(); |
| 342 | parkNameMap.put(key, statisticDTO.getPlName()); | 349 | parkNameMap.put(key, statisticDTO.getPlName()); |
| 343 | String statisBeginTime = DateUtil.getDateString(statisticDTO.getStatisticBeginTime(), dateType); | 350 | String statisBeginTime = DateUtil.getDateString(statisticDTO.getStatisticBeginTime(), dateType); |
| 344 | - //保存固定车流量和临时车流量 | ||
| 345 | - fixVehicleFlowMap.put(statisBeginTime, (fixVehicleFlowMap.get(statisBeginTime)==null?0:fixVehicleFlowMap.get(statisBeginTime))+statisticDTO.getFixVehicleFlow()); | ||
| 346 | - tmpVehicleFlowMap.put(statisBeginTime, (tmpVehicleFlowMap.get(statisBeginTime)==null?0:tmpVehicleFlowMap.get(statisBeginTime))+statisticDTO.getTmpVehicleFlow()); | 351 | + // 保存固定车流量和临时车流量 |
| 352 | + fixVehicleFlowMap.put(statisBeginTime, | ||
| 353 | + (fixVehicleFlowMap.get(statisBeginTime) == null ? 0 : fixVehicleFlowMap.get(statisBeginTime)) | ||
| 354 | + + statisticDTO.getFixVehicleFlow()); | ||
| 355 | + tmpVehicleFlowMap.put(statisBeginTime, | ||
| 356 | + (tmpVehicleFlowMap.get(statisBeginTime) == null ? 0 : tmpVehicleFlowMap.get(statisBeginTime)) | ||
| 357 | + + statisticDTO.getTmpVehicleFlow()); | ||
| 347 | } | 358 | } |
| 348 | } | 359 | } |
| 349 | 360 | ||
| @@ -370,14 +381,14 @@ public class VehicleFlowStatisticController extends BizController { | @@ -370,14 +381,14 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 370 | 381 | ||
| 371 | if (fixVehicleFlowMap.containsKey(timestamp)) { | 382 | if (fixVehicleFlowMap.containsKey(timestamp)) { |
| 372 | lastfixFlow = fixVehicleFlowMap.get(timestamp).intValue(); | 383 | lastfixFlow = fixVehicleFlowMap.get(timestamp).intValue(); |
| 373 | - }else{ | ||
| 374 | - lastfixFlow =0; | 384 | + } else { |
| 385 | + lastfixFlow = 0; | ||
| 375 | } | 386 | } |
| 376 | fixSerieVoData.add(lastfixFlow); | 387 | fixSerieVoData.add(lastfixFlow); |
| 377 | 388 | ||
| 378 | if (tmpVehicleFlowMap.containsKey(timestamp)) { | 389 | if (tmpVehicleFlowMap.containsKey(timestamp)) { |
| 379 | lasttmpFlow = tmpVehicleFlowMap.get(timestamp).intValue(); | 390 | lasttmpFlow = tmpVehicleFlowMap.get(timestamp).intValue(); |
| 380 | - }else{ | 391 | + } else { |
| 381 | lasttmpFlow = 0; | 392 | lasttmpFlow = 0; |
| 382 | } | 393 | } |
| 383 | tmpSerieVoData.add(lasttmpFlow); | 394 | tmpSerieVoData.add(lasttmpFlow); |
| @@ -390,16 +401,15 @@ public class VehicleFlowStatisticController extends BizController { | @@ -390,16 +401,15 @@ public class VehicleFlowStatisticController extends BizController { | ||
| 390 | vehicleFlows.setSeries(vehicleSeries); | 401 | vehicleFlows.setSeries(vehicleSeries); |
| 391 | return vehicleFlows; | 402 | return vehicleFlows; |
| 392 | } | 403 | } |
| 393 | - | 404 | + |
| 394 | public static void main(String[] args) { | 405 | public static void main(String[] args) { |
| 395 | - String json="{\"id\":\"1\",\"platform\":\"android\",\"parameter\":{\"drid\":\"177277364\",\"sex\":\"1\",\"type\":\"2\",\"creatorname\":\"Mrw\",\"username\":\"jack\",\"pwd\":\"123456\",\"remark\":\"平板用户\",\"createtime\":\"2017-07-24 23:59:59\"}}"; | ||
| 396 | - JSONObject object =(JSONObject)JSONObject.parse(json); | 406 | + String json = "{\"id\":\"1\",\"platform\":\"android\",\"parameter\":{\"drid\":\"177277364\",\"sex\":\"1\",\"type\":\"2\",\"creatorname\":\"Mrw\",\"username\":\"jack\",\"pwd\":\"123456\",\"remark\":\"平板用户\",\"createtime\":\"2017-07-24 23:59:59\"}}"; |
| 407 | + JSONObject object = (JSONObject) JSONObject.parse(json); | ||
| 397 | System.out.println(object.get("id")); | 408 | System.out.println(object.get("id")); |
| 398 | System.out.println(object.get("platform")); | 409 | System.out.println(object.get("platform")); |
| 399 | - JSONObject parameter =(JSONObject)object.get("parameter"); | 410 | + JSONObject parameter = (JSONObject) object.get("parameter"); |
| 400 | System.out.println(parameter.get("drid")); | 411 | System.out.println(parameter.get("drid")); |
| 401 | System.out.println(parameter.get("sex")); | 412 | System.out.println(parameter.get("sex")); |
| 402 | } | 413 | } |
| 403 | - | ||
| 404 | 414 | ||
| 405 | } | 415 | } |