Commit dfd87d2e62b42608815b3e6de88509594ea87d8b

Authored by 王飞
1 parent 98926e1d

设备日志表常量获取

src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/AnalysisController.java
... ... @@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestParam;
25 25 import org.springframework.web.bind.annotation.ResponseBody;
26 26  
27 27 import com.alibaba.dubbo.common.utils.CollectionUtils;
  28 +import com.clouds.common.constants.TableNameEnum;
28 29 import com.clouds.common.utils.DateUtil;
29 30 import com.clouds.common.utils.excle.ExcelUtil;
30 31 import com.clouds.common.utils.excle.ExcleFillDateManager;
... ... @@ -40,8 +41,6 @@ import com.zteits.clouds.api.apibase.constants.ErrorType;
40 41 import com.zteits.clouds.api.apibase.exception.BizException;
41 42 import com.zteits.clouds.api.dto.clouds.param.BerthTurnOverQueryRequest;
42 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 44 import com.zteits.clouds.api.service.park.EqpBerthsService;
46 45 import com.zteits.irain.portal.constant.ParkConstant;
47 46 import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.LineChartVO;
... ... @@ -102,9 +101,9 @@ public class AnalysisController extends BizController {
102 101 int endMonth = endc.get(Calendar.MONTH) + 1;
103 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 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 108 requestObject.setTableName(tableName);
110 109 if (beginYear == endYear && beginMonth == endMonth && beginDay == endDay) {
... ... @@ -202,11 +201,11 @@ public class AnalysisController extends BizController {
202 201 endc.setTime(requestObject.getEndTime());
203 202 int endYear = endc.get(Calendar.YEAR);
204 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 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 210 requestObject.setTableName(tableName);
212 211 // 按每天统计
... ... @@ -239,19 +238,19 @@ public class AnalysisController extends BizController {
239 238 endc.setTime(request.getEndTime());
240 239 int endYear = endc.get(Calendar.YEAR);
241 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 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 246 request.setTableName(tableName);
248 247  
249 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 251 String[] title = new String[] { "时间","停车场名称", "周转率" };
253 252 String sheetName = "泊位周转率";
254   - String fileName = "泊位周转率" + format2.format(new Date());
  253 + String fileName = "泊位周转率" + sdf.format(new Date());
255 254 // 1.创建excel信息
256 255 XSSFSheet workSheet = ExcelUtil.createExcel(sheetName);
257 256 // 2.设置excel表头和表体
... ...