Commit dfd87d2e62b42608815b3e6de88509594ea87d8b
1 parent
98926e1d
设备日志表常量获取
Showing
1 changed file
with
12 additions
and
13 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/AnalysisController.java
| @@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestParam; | @@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestParam; | ||
| 25 | import org.springframework.web.bind.annotation.ResponseBody; | 25 | import org.springframework.web.bind.annotation.ResponseBody; |
| 26 | 26 | ||
| 27 | import com.alibaba.dubbo.common.utils.CollectionUtils; | 27 | import com.alibaba.dubbo.common.utils.CollectionUtils; |
| 28 | +import com.clouds.common.constants.TableNameEnum; | ||
| 28 | import com.clouds.common.utils.DateUtil; | 29 | import com.clouds.common.utils.DateUtil; |
| 29 | import com.clouds.common.utils.excle.ExcelUtil; | 30 | import com.clouds.common.utils.excle.ExcelUtil; |
| 30 | import com.clouds.common.utils.excle.ExcleFillDateManager; | 31 | import com.clouds.common.utils.excle.ExcleFillDateManager; |
| @@ -40,8 +41,6 @@ import com.zteits.clouds.api.apibase.constants.ErrorType; | @@ -40,8 +41,6 @@ import com.zteits.clouds.api.apibase.constants.ErrorType; | ||
| 40 | import com.zteits.clouds.api.apibase.exception.BizException; | 41 | import com.zteits.clouds.api.apibase.exception.BizException; |
| 41 | import com.zteits.clouds.api.dto.clouds.param.BerthTurnOverQueryRequest; | 42 | import com.zteits.clouds.api.dto.clouds.param.BerthTurnOverQueryRequest; |
| 42 | import com.zteits.clouds.api.dto.park.dto.BerthTurnOverCountDTO; | 43 | import com.zteits.clouds.api.dto.park.dto.BerthTurnOverCountDTO; |
| 43 | -import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO; | ||
| 44 | -import com.zteits.clouds.api.dto.park.param.ParkingLotUseStatisticForPageRequest; | ||
| 45 | import com.zteits.clouds.api.service.park.EqpBerthsService; | 44 | import com.zteits.clouds.api.service.park.EqpBerthsService; |
| 46 | import com.zteits.irain.portal.constant.ParkConstant; | 45 | import com.zteits.irain.portal.constant.ParkConstant; |
| 47 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO; | 46 | import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO; |
| @@ -102,9 +101,9 @@ public class AnalysisController extends BizController { | @@ -102,9 +101,9 @@ public class AnalysisController extends BizController { | ||
| 102 | int endMonth = endc.get(Calendar.MONTH) + 1; | 101 | int endMonth = endc.get(Calendar.MONTH) + 1; |
| 103 | int endDay = endc.get(Calendar.DAY_OF_MONTH); | 102 | int endDay = endc.get(Calendar.DAY_OF_MONTH); |
| 104 | 103 | ||
| 105 | - String tableName = "tp_p_eqp_log"+endYear+""+endMonth; | 104 | + String tableName = TableNameEnum.TP_P_EQP_LOG.getValue()+endYear+""+endMonth; |
| 106 | if(endMonth < 10){ | 105 | if(endMonth < 10){ |
| 107 | - tableName = "tp_p_eqp_log"+endYear+"0"+endMonth; | 106 | + tableName = TableNameEnum.TP_P_EQP_LOG.getValue()+endYear+"0"+endMonth; |
| 108 | } | 107 | } |
| 109 | requestObject.setTableName(tableName); | 108 | requestObject.setTableName(tableName); |
| 110 | if (beginYear == endYear && beginMonth == endMonth && beginDay == endDay) { | 109 | if (beginYear == endYear && beginMonth == endMonth && beginDay == endDay) { |
| @@ -202,11 +201,11 @@ public class AnalysisController extends BizController { | @@ -202,11 +201,11 @@ public class AnalysisController extends BizController { | ||
| 202 | endc.setTime(requestObject.getEndTime()); | 201 | endc.setTime(requestObject.getEndTime()); |
| 203 | int endYear = endc.get(Calendar.YEAR); | 202 | int endYear = endc.get(Calendar.YEAR); |
| 204 | int endMonth = endc.get(Calendar.MONTH) + 1; | 203 | int endMonth = endc.get(Calendar.MONTH) + 1; |
| 205 | - int endDay = endc.get(Calendar.DAY_OF_MONTH); | 204 | + //int endDay = endc.get(Calendar.DAY_OF_MONTH); |
| 206 | 205 | ||
| 207 | - String tableName = "tp_p_eqp_log"+endYear+""+endMonth; | 206 | + String tableName = TableNameEnum.TP_P_EQP_LOG.getValue()+endYear+""+endMonth; |
| 208 | if(endMonth < 10){ | 207 | if(endMonth < 10){ |
| 209 | - tableName = "tp_p_eqp_log"+endYear+"0"+endMonth; | 208 | + tableName = TableNameEnum.TP_P_EQP_LOG.getValue()+endYear+"0"+endMonth; |
| 210 | } | 209 | } |
| 211 | requestObject.setTableName(tableName); | 210 | requestObject.setTableName(tableName); |
| 212 | // 按每天统计 | 211 | // 按每天统计 |
| @@ -239,19 +238,19 @@ public class AnalysisController extends BizController { | @@ -239,19 +238,19 @@ public class AnalysisController extends BizController { | ||
| 239 | endc.setTime(request.getEndTime()); | 238 | endc.setTime(request.getEndTime()); |
| 240 | int endYear = endc.get(Calendar.YEAR); | 239 | int endYear = endc.get(Calendar.YEAR); |
| 241 | int endMonth = endc.get(Calendar.MONTH) + 1; | 240 | int endMonth = endc.get(Calendar.MONTH) + 1; |
| 242 | - int endDay = endc.get(Calendar.DAY_OF_MONTH); | ||
| 243 | - String tableName = "tp_p_eqp_log"+endYear+""+endMonth; | 241 | + //int endDay = endc.get(Calendar.DAY_OF_MONTH); |
| 242 | + String tableName = TableNameEnum.TP_P_EQP_LOG.getValue()+endYear+""+endMonth; | ||
| 244 | if(endMonth < 10){ | 243 | if(endMonth < 10){ |
| 245 | - tableName = "tp_p_eqp_log"+endYear+"0"+endMonth; | 244 | + tableName = TableNameEnum.TP_P_EQP_LOG.getValue()+endYear+"0"+endMonth; |
| 246 | } | 245 | } |
| 247 | request.setTableName(tableName); | 246 | request.setTableName(tableName); |
| 248 | 247 | ||
| 249 | BizResult<PageBean<BerthTurnOverCountDTO>> bizResult = eqpBerthsService.queryBerthTurnOverDetailForHour(request); | 248 | BizResult<PageBean<BerthTurnOverCountDTO>> bizResult = eqpBerthsService.queryBerthTurnOverDetailForHour(request); |
| 250 | - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 251 | - SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); | 249 | + //SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 250 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 252 | String[] title = new String[] { "时间","停车场名称", "周转率" }; | 251 | String[] title = new String[] { "时间","停车场名称", "周转率" }; |
| 253 | String sheetName = "泊位周转率"; | 252 | String sheetName = "泊位周转率"; |
| 254 | - String fileName = "泊位周转率" + format2.format(new Date()); | 253 | + String fileName = "泊位周转率" + sdf.format(new Date()); |
| 255 | // 1.创建excel信息 | 254 | // 1.创建excel信息 |
| 256 | XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); | 255 | XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); |
| 257 | // 2.设置excel表头和表体 | 256 | // 2.设置excel表头和表体 |