diff --git a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/AnalysisController.java b/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/AnalysisController.java index d54b456..3140e92 100644 --- a/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/AnalysisController.java +++ b/src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/AnalysisController.java @@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.alibaba.dubbo.common.utils.CollectionUtils; +import com.clouds.common.constants.TableNameEnum; import com.clouds.common.utils.DateUtil; import com.clouds.common.utils.excle.ExcelUtil; import com.clouds.common.utils.excle.ExcleFillDateManager; @@ -40,8 +41,6 @@ import com.zteits.clouds.api.apibase.constants.ErrorType; import com.zteits.clouds.api.apibase.exception.BizException; import com.zteits.clouds.api.dto.clouds.param.BerthTurnOverQueryRequest; import com.zteits.clouds.api.dto.park.dto.BerthTurnOverCountDTO; -import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO; -import com.zteits.clouds.api.dto.park.param.ParkingLotUseStatisticForPageRequest; import com.zteits.clouds.api.service.park.EqpBerthsService; import com.zteits.irain.portal.constant.ParkConstant; import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO; @@ -102,9 +101,9 @@ public class AnalysisController extends BizController { int endMonth = endc.get(Calendar.MONTH) + 1; int endDay = endc.get(Calendar.DAY_OF_MONTH); - String tableName = "tp_p_eqp_log"+endYear+""+endMonth; + String tableName = TableNameEnum.TP_P_EQP_LOG.getValue()+endYear+""+endMonth; if(endMonth < 10){ - tableName = "tp_p_eqp_log"+endYear+"0"+endMonth; + tableName = TableNameEnum.TP_P_EQP_LOG.getValue()+endYear+"0"+endMonth; } requestObject.setTableName(tableName); if (beginYear == endYear && beginMonth == endMonth && beginDay == endDay) { @@ -202,11 +201,11 @@ public class AnalysisController extends BizController { endc.setTime(requestObject.getEndTime()); int endYear = endc.get(Calendar.YEAR); int endMonth = endc.get(Calendar.MONTH) + 1; - int endDay = endc.get(Calendar.DAY_OF_MONTH); + //int endDay = endc.get(Calendar.DAY_OF_MONTH); - String tableName = "tp_p_eqp_log"+endYear+""+endMonth; + String tableName = TableNameEnum.TP_P_EQP_LOG.getValue()+endYear+""+endMonth; if(endMonth < 10){ - tableName = "tp_p_eqp_log"+endYear+"0"+endMonth; + tableName = TableNameEnum.TP_P_EQP_LOG.getValue()+endYear+"0"+endMonth; } requestObject.setTableName(tableName); // 按每天统计 @@ -239,19 +238,19 @@ public class AnalysisController extends BizController { endc.setTime(request.getEndTime()); int endYear = endc.get(Calendar.YEAR); int endMonth = endc.get(Calendar.MONTH) + 1; - int endDay = endc.get(Calendar.DAY_OF_MONTH); - String tableName = "tp_p_eqp_log"+endYear+""+endMonth; + //int endDay = endc.get(Calendar.DAY_OF_MONTH); + String tableName = TableNameEnum.TP_P_EQP_LOG.getValue()+endYear+""+endMonth; if(endMonth < 10){ - tableName = "tp_p_eqp_log"+endYear+"0"+endMonth; + tableName = TableNameEnum.TP_P_EQP_LOG.getValue()+endYear+"0"+endMonth; } request.setTableName(tableName); BizResult> bizResult = eqpBerthsService.queryBerthTurnOverDetailForHour(request); - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); + //SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String[] title = new String[] { "时间","停车场名称", "周转率" }; String sheetName = "泊位周转率"; - String fileName = "泊位周转率" + format2.format(new Date()); + String fileName = "泊位周转率" + sdf.format(new Date()); // 1.创建excel信息 XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); // 2.设置excel表头和表体