From aebac0a614fbe9dd7a2fdb993ec15fded3c65199 Mon Sep 17 00:00:00 2001 From: llw <18235445130@163.com> Date: Mon, 4 Sep 2017 15:49:21 +0800 Subject: [PATCH] tijiao --- src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthsStatisticController.java | 27 +++++++++++++++++++-------- src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/MonthBillManagementController.java | 42 ------------------------------------------ src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/VehicleFlowStatisticController.java | 28 +++++++++++++++++++++------- 3 files changed, 40 insertions(+), 57 deletions(-) diff --git a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthsStatisticController.java b/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthsStatisticController.java index 5beb0de..9182368 100644 --- a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthsStatisticController.java +++ b/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthsStatisticController.java @@ -511,7 +511,7 @@ public class BerthsStatisticController extends BizController { request.setBaseRequest(new BaseInfo(1, 0)); request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); - //SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); List xAxisData = Lists.newArrayList(); @@ -530,14 +530,18 @@ public class BerthsStatisticController extends BizController { int berthFreeRatio = ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE; LineChartVO freeBerthRatios = getFreeBerthRatios(request, xAxisData, dateType, berthFreeRatio); - - + String[] billTitle = new String[4]; + billTitle[0] = "日报表车位使用统计"+format.format(new Date()); + billTitle[1] = "汇总"; + billTitle[2] = "停车场: " + parkName; + billTitle[3] = "统计时间: " + format2.format(request.getBeginTime()); String sheetName = "日报表车位使用统计"; String fileName = "日报表车位使用统计" + format2.format(new Date()); // 1.创建excel信息 XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); // 2.设置excel表头和表体 - Layouter.buildReport(workSheet, title, 0, 0); + //Layouter.buildReport(workSheet, title, 0, 0); + Layouter.buildReportYearMonth(workSheet, title, 0, 0, billTitle); // 3.填充数据 List contentList = new ArrayList(); @@ -567,7 +571,7 @@ public class BerthsStatisticController extends BizController { } ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); - fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); + fillUserManager.fillSalesOrga(workSheet, title, contentList, billTitle.length+2); // 4.excel输出配置 ExcelUtil.write(response, workSheet, fileName); } @@ -649,8 +653,9 @@ public class BerthsStatisticController extends BizController { request.setBaseRequest(new BaseInfo(1, 0)); request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY); - //SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat format3 = new SimpleDateFormat("yyyy-MM"); Long dayDifference = DateUtil.getTimeDifference(new Timestamp(request.getEndTime().getTime()), @@ -678,13 +683,19 @@ public class BerthsStatisticController extends BizController { int berthFreeRatio = ParkConstant.ParkingLotUseStatistic.BerthRatioType.FREE; LineChartVO freeBerthRatios = getFreeBerthRatios(request, xAxisData, dateType, berthFreeRatio); + String[] billTitle = new String[4]; + billTitle[0] = "月报表车位使用统计"+format.format(new Date()); + billTitle[1] = "汇总"; + billTitle[2] = "停车场: " + parkName; + billTitle[3] = "统计时间: " + format3.format(request.getBeginTime()); String sheetName = "月报表车位使用统计"; String fileName = "月报表车位使用统计" + format2.format(new Date()); // 1.创建excel信息 XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); // 2.设置excel表头和表体 - Layouter.buildReport(workSheet, title, 0, 0); + //Layouter.buildReport(workSheet, title, 0, 0); + Layouter.buildReportYearMonth(workSheet, title, 0, 0, billTitle); // 3.填充数据 List contentList = new ArrayList(); @@ -714,7 +725,7 @@ public class BerthsStatisticController extends BizController { } ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); - fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); + fillUserManager.fillSalesOrga(workSheet, title, contentList, billTitle.length+2); // 4.excel输出配置 ExcelUtil.write(response, workSheet, fileName); } diff --git a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/MonthBillManagementController.java b/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/MonthBillManagementController.java index 4ae9441..28ffaa6 100644 --- a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/MonthBillManagementController.java +++ b/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/MonthBillManagementController.java @@ -256,21 +256,6 @@ public class MonthBillManagementController extends BizController { // 2.调用接口查询当前登录人管辖的停车场名称 UserInfo userInfo = sessionCommUtil.getUserInfo(); List plNos = userInfo.getPlNos(); - // UserInfo userInfo = sessionCommUtil.getUserInfo(); - // List plNos = new ArrayList<>(); - // if (userInfo != null) { - // TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); - // tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); - // tdCompanyParkQueryRequest.setSessionId(session.getId()); - // tdCompanyParkQueryRequest.setSysCode(sysCode); - // BizResult> bizResult = tdCustCompanyService.queryParkNoByCustIds - // (tdCompanyParkQueryRequest); - // // 拥有的停车场编号 - // plNos = ResultUtils.getBizResultData(bizResult); - // } - // if (CollectionUtils.isEmpty(plNos)) { - // throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); - // } billQueryRequest.setParkIdList(plNos); logger.info("月账单管理统计列表 req={}", JSONObject.toJSONString(billQueryRequest)); BizResult> respondResult = monthBillManagementService @@ -292,20 +277,6 @@ public class MonthBillManagementController extends BizController { // 2.调用接口查询当前登录人管辖的停车场名称 UserInfo userInfo = sessionCommUtil.getUserInfo(); List plNos = userInfo.getPlNos(); - // List plNos = new ArrayList<>(); - // if (userInfo != null) { - // TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); - // tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); - // tdCompanyParkQueryRequest.setSessionId(session.getId()); - // tdCompanyParkQueryRequest.setSysCode(sysCode); - // BizResult> bizResult = tdCustCompanyService.queryParkNoByCustIds - // (tdCompanyParkQueryRequest); - // // 拥有的停车场编号 - // plNos = ResultUtils.getBizResultData(bizResult); - // } - // if (CollectionUtils.isEmpty(plNos)) { - // throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); - // } billQueryRequest.setParkIdList(plNos); logger.info("月账单管理对账单统计明细 req={}", JSONObject.toJSONString(billQueryRequest)); BizResult> respondResult = monthBillManagementService @@ -442,19 +413,6 @@ public class MonthBillManagementController extends BizController { // 2.调用接口查询当前登录人管辖的停车场名称 UserInfo userInfo = sessionCommUtil.getUserInfo(); List plNos = userInfo.getPlNos(); - // // 2.调用接口查询当前登录人管辖的停车场名称 - // UserInfo userInfo = sessionCommUtil.getUserInfo(); - // List plNos = new ArrayList<>(); - // if (userInfo != null) { - // TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); - // tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); - // tdCompanyParkQueryRequest.setSessionId(session.getId()); - // tdCompanyParkQueryRequest.setSysCode(sysCode); - // BizResult> bizResult = tdCustCompanyService.queryParkNoByCustIds( - // tdCompanyParkQueryRequest); - // // 拥有的停车场编号 - // plNos = ResultUtils.getBizResultData(bizResult); - // } billQueryRequest.setParkIdList(plNos); logger.info("月账单导出所有 req={}", JSONObject.toJSONString(billQueryRequest)); respondResult = monthBillManagementService diff --git a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/VehicleFlowStatisticController.java b/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/VehicleFlowStatisticController.java index 73871ee..cea40d7 100644 --- a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/VehicleFlowStatisticController.java +++ b/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/VehicleFlowStatisticController.java @@ -406,7 +406,7 @@ public class VehicleFlowStatisticController extends BizController { request.setBaseRequest(new BaseInfo(1, 0)); request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1HOUR); - //SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); List xAxisData = Lists.newArrayList(); @@ -418,6 +418,11 @@ public class VehicleFlowStatisticController extends BizController { xAxisData.add(hour + ":00"); } + String[] billTitle = new String[4]; + billTitle[0] = "日报表车流量使用统计"+format.format(new Date()); + billTitle[1] = "汇总"; + billTitle[2] = "停车场: " + parkName; + billTitle[3] = "统计时间: " + format2.format(request.getBeginTime()); String dateType = "HH:mm"; LineChartVO VehicleFlows = getVehicleFlows(request, xAxisData, dateType); @@ -426,7 +431,8 @@ public class VehicleFlowStatisticController extends BizController { // 1.创建excel信息 XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); // 2.设置excel表头和表体 - Layouter.buildReport(workSheet, title, 0, 0); + //Layouter.buildReport(workSheet, title, 0, 0); + Layouter.buildReportYearMonth(workSheet, title, 0, 0, billTitle); // 3.填充数据 List contentList = new ArrayList(); @@ -441,7 +447,7 @@ public class VehicleFlowStatisticController extends BizController { } ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); - fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); + fillUserManager.fillSalesOrga(workSheet, title, contentList, billTitle.length+2); // 4.excel输出配置 ExcelUtil.write(response, workSheet, fileName); } @@ -468,9 +474,9 @@ public class VehicleFlowStatisticController extends BizController { request.setBaseRequest(new BaseInfo(1, 0)); request.setQueryKind(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY); - //SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); - + SimpleDateFormat format3 = new SimpleDateFormat("yyyy-MM"); Long dayDifference = DateUtil.getTimeDifference(new Timestamp(request.getEndTime().getTime()), new Timestamp(request.getBeginTime().getTime())); @@ -494,12 +500,20 @@ public class VehicleFlowStatisticController extends BizController { String dateType = "MM-dd"; LineChartVO VehicleFlows = getVehicleFlows(request, xAxisData, dateType); + String[] billTitle = new String[4]; + billTitle[0] = "月报表车流量使用统计"+format.format(new Date()); + billTitle[1] = "汇总"; + billTitle[2] = "停车场: " + parkName; + billTitle[3] = "统计时间: " + format3.format(request.getBeginTime()); + + String sheetName = "月报表车流量使用统计"; String fileName = "月报表车流量使用统计" + format2.format(new Date()); // 1.创建excel信息 XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); // 2.设置excel表头和表体 - Layouter.buildReport(workSheet, title, 0, 0); + //Layouter.buildReport(workSheet, title, 0, 0); + Layouter.buildReportYearMonth(workSheet, title, 0, 0, billTitle); // 3.填充数据 List contentList = new ArrayList(); @@ -514,7 +528,7 @@ public class VehicleFlowStatisticController extends BizController { } ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); - fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); + fillUserManager.fillSalesOrga(workSheet, title, contentList, billTitle.length+2); // 4.excel输出配置 ExcelUtil.write(response, workSheet, fileName); } -- libgit2 0.21.4