Commit 6d3ad8ffb00404a274d97e93261de2c7b8edb1b4
Merge branch 'branch_0808' of http://192.168.1.195:9998/ZTEITS-Developers/zteits…
…-bcp-portal.git into branch_0808
Showing
2 changed files
with
264 additions
and
8 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/CloudsParDurationController.java
| 1 | package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic; | 1 | package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic; |
| 2 | 2 | ||
| 3 | +import java.math.BigDecimal; | ||
| 4 | +import java.text.SimpleDateFormat; | ||
| 5 | +import java.util.ArrayList; | ||
| 3 | import java.util.List; | 6 | import java.util.List; |
| 4 | 7 | ||
| 5 | import javax.servlet.http.HttpServletRequest; | 8 | import javax.servlet.http.HttpServletRequest; |
| 6 | import javax.servlet.http.HttpServletResponse; | 9 | import javax.servlet.http.HttpServletResponse; |
| 7 | 10 | ||
| 11 | +import org.apache.poi.xssf.usermodel.XSSFSheet; | ||
| 8 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 13 | +import org.springframework.util.CollectionUtils; | ||
| 9 | import org.springframework.web.bind.annotation.PostMapping; | 14 | import org.springframework.web.bind.annotation.PostMapping; |
| 10 | import org.springframework.web.bind.annotation.RequestBody; | 15 | import org.springframework.web.bind.annotation.RequestBody; |
| 11 | import org.springframework.web.bind.annotation.RequestMapping; | 16 | import org.springframework.web.bind.annotation.RequestMapping; |
| 17 | +import org.springframework.web.bind.annotation.RequestParam; | ||
| 12 | import org.springframework.web.bind.annotation.RestController; | 18 | import org.springframework.web.bind.annotation.RestController; |
| 13 | 19 | ||
| 20 | +import com.alibaba.dubbo.common.utils.StringUtils; | ||
| 21 | +import com.clouds.common.utils.excle.ExcelUtil; | ||
| 22 | +import com.clouds.common.utils.excle.ExcleFillDateManager; | ||
| 23 | +import com.clouds.common.utils.excle.Layouter; | ||
| 14 | import com.clouds.common.web.BizController; | 24 | import com.clouds.common.web.BizController; |
| 15 | import com.clouds.common.web.vo.BizResultVO; | 25 | import com.clouds.common.web.vo.BizResultVO; |
| 16 | import com.zteits.clouds.api.apibase.bean.BizResult; | 26 | import com.zteits.clouds.api.apibase.bean.BizResult; |
| 17 | import com.zteits.clouds.api.apibase.bean.PageBean; | 27 | import com.zteits.clouds.api.apibase.bean.PageBean; |
| 28 | +import com.zteits.clouds.api.dto.clouds.dto.BillManageDTO; | ||
| 18 | import com.zteits.clouds.api.dto.clouds.dto.ParkDurationDTO; | 29 | import com.zteits.clouds.api.dto.clouds.dto.ParkDurationDTO; |
| 30 | +import com.zteits.clouds.api.dto.clouds.dto.ParkDurationForHourDTO; | ||
| 31 | +import com.zteits.clouds.api.dto.clouds.param.BillQueryRequest; | ||
| 19 | import com.zteits.clouds.api.dto.clouds.param.ParkDurationRequest; | 32 | import com.zteits.clouds.api.dto.clouds.param.ParkDurationRequest; |
| 20 | import com.zteits.clouds.api.service.clouds.CloudsParDurationService; | 33 | import com.zteits.clouds.api.service.clouds.CloudsParDurationService; |
| 21 | 34 | ||
| @@ -51,5 +64,238 @@ public class CloudsParDurationController extends BizController{ | @@ -51,5 +64,238 @@ public class CloudsParDurationController extends BizController{ | ||
| 51 | this.returnJsonDataGrid(response, result); | 64 | this.returnJsonDataGrid(response, result); |
| 52 | } | 65 | } |
| 53 | 66 | ||
| 67 | + /** | ||
| 68 | + * 停车时长-日.<br/> | ||
| 69 | + * | ||
| 70 | + * @param request | ||
| 71 | + * @param response | ||
| 72 | + * @throws Exception | ||
| 73 | + */ | ||
| 74 | + @RequestMapping("/exportToExcleForParkDurationForDay") | ||
| 75 | + public void exportToExcleForParkDurationForDay(@RequestParam String parkOutBeginTime,@RequestParam String parkOutEndTime,@RequestParam List<String> parkIds, | ||
| 76 | + HttpServletRequest request,HttpServletResponse response) throws Exception { | ||
| 77 | + SimpleDateFormat format_yyy = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 78 | + ParkDurationRequest billQueryRequest = new ParkDurationRequest(); | ||
| 79 | + billQueryRequest.setSysCode("1001"); | ||
| 80 | + billQueryRequest.getBaseRequest().setPageSize(0); | ||
| 81 | + billQueryRequest.setParkIds(parkIds); | ||
| 82 | + billQueryRequest.setParkOutBeginTime(format_yyy.parse(parkOutBeginTime)); | ||
| 83 | + billQueryRequest.setParkOutEndTime(format_yyy.parse(parkOutEndTime)); | ||
| 84 | + BizResult<PageBean<ParkDurationDTO>> result = cloudsParDurationService.queryEchartsForParkDurationDayForPage(billQueryRequest); | ||
| 85 | + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 86 | + String[] title = new String[]{"时间","停车场名称","平均时长(小时)"}; | ||
| 87 | + String sheetName="停车时长统计"; | ||
| 88 | + String fileName = "停车时长统计(日)"; | ||
| 89 | + // 1.创建excel信息 | ||
| 90 | + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); | ||
| 91 | + // 2.设置excel表头和表体 | ||
| 92 | + Layouter.buildReport(workSheet,title,0, 0); | ||
| 93 | + //3.填充数据 | ||
| 94 | + List<Object[]> contentList=new ArrayList<Object[]>(); | ||
| 95 | + if(result != null && !CollectionUtils.isEmpty(result.getData().getDataList())){ | ||
| 96 | + List<ParkDurationDTO> list = result.getData().getDataList(); | ||
| 97 | + for (ParkDurationDTO e: list) { | ||
| 98 | + if(e != null){ | ||
| 99 | + Object[] obj=new Object[title.length]; | ||
| 100 | + int index=0; | ||
| 101 | + obj[index++]=(e.getParkOutTime() != null ? format.format(e.getParkOutTime()) : ""); | ||
| 102 | + obj[index++]=e.getParkName(); | ||
| 103 | + obj[index++]=e.getParkingDuration(); | ||
| 104 | + contentList.add(obj); | ||
| 105 | + } | ||
| 106 | + } | ||
| 107 | + } | ||
| 108 | + ExcleFillDateManager fillUserManager=new ExcleFillDateManager(); | ||
| 109 | + fillUserManager.fillSalesOrga(workSheet,title,contentList,2); | ||
| 110 | + // 4.excel输出配置 | ||
| 111 | + ExcelUtil.write(response, workSheet, fileName); | ||
| 112 | + | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + /** | ||
| 116 | + * 停车时长-日-下载详情.<br/> | ||
| 117 | + * | ||
| 118 | + * @param request | ||
| 119 | + * @param response | ||
| 120 | + * @throws Exception | ||
| 121 | + */ | ||
| 122 | + @RequestMapping("/exportExcleForParkDurationDetail") | ||
| 123 | + public void exportExcleForParkDurationDetail(@RequestParam String parkOutBeginTime,@RequestParam String parkOutEndTime,@RequestParam List<String> parkIds, | ||
| 124 | + HttpServletRequest request,HttpServletResponse response) throws Exception { | ||
| 125 | + SimpleDateFormat format_yyy = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 126 | + ParkDurationRequest billQueryRequest = new ParkDurationRequest(); | ||
| 127 | + billQueryRequest.setSysCode("1001"); | ||
| 128 | + billQueryRequest.getBaseRequest().setPageSize(0); | ||
| 129 | + billQueryRequest.setParkIds(parkIds); | ||
| 130 | + billQueryRequest.setParkOutBeginTime(format_yyy.parse(parkOutBeginTime)); | ||
| 131 | + billQueryRequest.setParkOutEndTime(format_yyy.parse(parkOutEndTime)); | ||
| 132 | + BizResult<List<ParkDurationForHourDTO>> result = cloudsParDurationService.queryEchartsForParkDurationDayDetail(billQueryRequest); | ||
| 133 | + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 134 | + String[] title = new String[]{"日期","车辆类型","停车场名称","1小时", | ||
| 135 | + "2小时", | ||
| 136 | + "3小时", | ||
| 137 | + "4小时", | ||
| 138 | + "5小时", | ||
| 139 | + "6小时", | ||
| 140 | + "7小时", | ||
| 141 | + "8小时", | ||
| 142 | + "9小时", | ||
| 143 | + "10小时", | ||
| 144 | + "11小时", | ||
| 145 | + "12小时", | ||
| 146 | + "13小时", | ||
| 147 | + "14小时", | ||
| 148 | + "15小时", | ||
| 149 | + "16小时", | ||
| 150 | + "17小时", | ||
| 151 | + "18小时", | ||
| 152 | + "19小时", | ||
| 153 | + "20小时", | ||
| 154 | + "21小时", | ||
| 155 | + "22小时", | ||
| 156 | + "23小时", | ||
| 157 | + "24小时","平均时长(小时)"}; | ||
| 158 | + String sheetName="停车时长统计详情"; | ||
| 159 | + String fileName = "停车时长统计详情(日)"; | ||
| 160 | + // 1.创建excel信息 | ||
| 161 | + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); | ||
| 162 | + // 2.设置excel表头和表体 | ||
| 163 | + Layouter.buildReport(workSheet,title,0, 0); | ||
| 164 | + //3.填充数据 | ||
| 165 | + List<Object[]> contentList=new ArrayList<Object[]>(); | ||
| 166 | + if(result != null && !CollectionUtils.isEmpty(result.getData())){ | ||
| 167 | + List<ParkDurationForHourDTO> list = result.getData(); | ||
| 168 | + for (ParkDurationForHourDTO e: list) { | ||
| 169 | + if(e != null){ | ||
| 170 | + Object[] obj=new Object[title.length]; | ||
| 171 | + int index=0; | ||
| 172 | + obj[index++]=(e.getParkOutTime() != null ? format.format(e.getParkOutTime()) : ""); | ||
| 173 | + if(1 ==e.getParkType()){ | ||
| 174 | + obj[index++]="临时车"; | ||
| 175 | + }else if(2 ==e.getParkType()){ | ||
| 176 | + obj[index++]="年包车停车"; | ||
| 177 | + }else if(3 ==e.getParkType()){ | ||
| 178 | + obj[index++]="月包车停车"; | ||
| 179 | + }else if(5 ==e.getParkType()){ | ||
| 180 | + obj[index++]="免费停车"; | ||
| 181 | + }else if(99 ==e.getParkType()){ | ||
| 182 | + obj[index++]="合计"; | ||
| 183 | + } | ||
| 184 | + obj[index++]=e.getParkName(); | ||
| 185 | + obj[index++]=e.getH1(); | ||
| 186 | + obj[index++]=e.getH2(); | ||
| 187 | + obj[index++]=e.getH3(); | ||
| 188 | + obj[index++]=e.getH4(); | ||
| 189 | + obj[index++]=e.getH5(); | ||
| 190 | + obj[index++]=e.getH6(); | ||
| 191 | + obj[index++]=e.getH7(); | ||
| 192 | + obj[index++]=e.getH8(); | ||
| 193 | + obj[index++]=e.getH9(); | ||
| 194 | + obj[index++]=e.getH10(); | ||
| 195 | + obj[index++]=e.getH11(); | ||
| 196 | + obj[index++]=e.getH12(); | ||
| 197 | + obj[index++]=e.getH13(); | ||
| 198 | + obj[index++]=e.getH14(); | ||
| 199 | + obj[index++]=e.getH15(); | ||
| 200 | + obj[index++]=e.getH16(); | ||
| 201 | + obj[index++]=e.getH17(); | ||
| 202 | + obj[index++]=e.getH18(); | ||
| 203 | + obj[index++]=e.getH19(); | ||
| 204 | + obj[index++]=e.getH20(); | ||
| 205 | + obj[index++]=e.getH21(); | ||
| 206 | + obj[index++]=e.getH22(); | ||
| 207 | + obj[index++]=e.getH23(); | ||
| 208 | + obj[index++]=e.getH24(); | ||
| 209 | + if(StringUtils.isNotEmpty(e.getDuration())){ | ||
| 210 | + obj[index++]=e.getDuration(); | ||
| 211 | + }else{ | ||
| 212 | + obj[index++]=""; | ||
| 213 | + } | ||
| 214 | + | ||
| 215 | + contentList.add(obj); | ||
| 216 | + } | ||
| 217 | + } | ||
| 218 | + } | ||
| 219 | + ExcleFillDateManager fillUserManager=new ExcleFillDateManager(); | ||
| 220 | + fillUserManager.fillSalesOrga(workSheet,title,contentList,2); | ||
| 221 | + // 4.excel输出配置 | ||
| 222 | + ExcelUtil.write(response, workSheet, fileName); | ||
| 223 | + | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + /****************************************************停车时长按月************************************************************************/ | ||
| 227 | + | ||
| 228 | + /** | ||
| 229 | + * 企业云平台->停车时长折线图->按日.<br/> | ||
| 230 | + * @return | ||
| 231 | + */ | ||
| 232 | + @ApiOperation("企业云平台->停车时长折线图->按月") | ||
| 233 | + @PostMapping("/queryEchartsForParkDurationForMonth") | ||
| 234 | + public BizResultVO<List<ParkDurationDTO>> queryEchartsForParkDurationForMonth(@RequestBody ParkDurationRequest parkDurationRequest){ | ||
| 235 | + BizResult<List<ParkDurationDTO>> result = cloudsParDurationService.queryEchartsForParkDurationForMonth(parkDurationRequest); | ||
| 236 | + return new BizResultVO<List<ParkDurationDTO>>(result); | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + /** | ||
| 240 | + * 企业云平台->停车时长->分页.<br/> | ||
| 241 | + * @return | ||
| 242 | + */ | ||
| 243 | + @ApiOperation("企业云平台->停车时长->分页-按月") | ||
| 244 | + @PostMapping("/queryEchartsForParkDurationMonthForPage") | ||
| 245 | + public void queryEchartsForParkDurationMonthForPage(@RequestBody ParkDurationRequest parkDurationRequest,HttpServletRequest request, | ||
| 246 | + HttpServletResponse response){ | ||
| 247 | + BizResult<PageBean<ParkDurationDTO>> result = cloudsParDurationService.queryEchartsForParkDurationMonthForPage(parkDurationRequest); | ||
| 248 | + this.returnJsonDataGrid(response, result); | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + /** | ||
| 252 | + * 停车时长-日.<br/> | ||
| 253 | + * | ||
| 254 | + * @param request | ||
| 255 | + * @param response | ||
| 256 | + * @throws Exception | ||
| 257 | + */ | ||
| 258 | + @RequestMapping("/exportToExcleForParkDurationForMonth") | ||
| 259 | + public void exportToExcleForParkDurationForMonth(@RequestParam String parkOutBeginTime,@RequestParam String parkOutEndTime,@RequestParam List<String> parkIds, | ||
| 260 | + HttpServletRequest request,HttpServletResponse response) throws Exception { | ||
| 261 | + SimpleDateFormat format_yyy = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 262 | + ParkDurationRequest billQueryRequest = new ParkDurationRequest(); | ||
| 263 | + billQueryRequest.setSysCode("1001"); | ||
| 264 | + billQueryRequest.getBaseRequest().setPageSize(0); | ||
| 265 | + billQueryRequest.setParkIds(parkIds); | ||
| 266 | + billQueryRequest.setParkOutBeginTime(format_yyy.parse(parkOutBeginTime)); | ||
| 267 | + billQueryRequest.setParkOutEndTime(format_yyy.parse(parkOutEndTime)); | ||
| 268 | + BizResult<PageBean<ParkDurationDTO>> result = cloudsParDurationService.queryEchartsForParkDurationMonthForPage(billQueryRequest); | ||
| 269 | + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM"); | ||
| 270 | + String[] title = new String[]{"时间","停车场名称","平均时长(小时)"}; | ||
| 271 | + String sheetName="停车时长统计"; | ||
| 272 | + String fileName = "停车时长统计(月)"; | ||
| 273 | + // 1.创建excel信息 | ||
| 274 | + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); | ||
| 275 | + // 2.设置excel表头和表体 | ||
| 276 | + Layouter.buildReport(workSheet,title,0, 0); | ||
| 277 | + //3.填充数据 | ||
| 278 | + List<Object[]> contentList=new ArrayList<Object[]>(); | ||
| 279 | + if(result != null && !CollectionUtils.isEmpty(result.getData().getDataList())){ | ||
| 280 | + List<ParkDurationDTO> list = result.getData().getDataList(); | ||
| 281 | + for (ParkDurationDTO e: list) { | ||
| 282 | + if(e != null){ | ||
| 283 | + Object[] obj=new Object[title.length]; | ||
| 284 | + int index=0; | ||
| 285 | + obj[index++]=(e.getParkOutTime() != null ? format.format(e.getParkOutTime()) : ""); | ||
| 286 | + obj[index++]=e.getParkName(); | ||
| 287 | + obj[index++]=e.getParkingDuration(); | ||
| 288 | + contentList.add(obj); | ||
| 289 | + } | ||
| 290 | + } | ||
| 291 | + } | ||
| 292 | + ExcleFillDateManager fillUserManager=new ExcleFillDateManager(); | ||
| 293 | + fillUserManager.fillSalesOrga(workSheet,title,contentList,2); | ||
| 294 | + // 4.excel输出配置 | ||
| 295 | + ExcelUtil.write(response, workSheet, fileName); | ||
| 296 | + | ||
| 297 | + } | ||
| 298 | + | ||
| 299 | + | ||
| 54 | 300 | ||
| 55 | } | 301 | } |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/OrderManageController.java
| @@ -85,10 +85,10 @@ public class OrderManageController extends BizController { | @@ -85,10 +85,10 @@ public class OrderManageController extends BizController { | ||
| 85 | @RequestMapping("/exportAllParkOrderByCondition") | 85 | @RequestMapping("/exportAllParkOrderByCondition") |
| 86 | public void exportAllParkOrderByCondition(@RequestParam String plNos, @RequestParam(required = false) String parkStatus, | 86 | public void exportAllParkOrderByCondition(@RequestParam String plNos, @RequestParam(required = false) String parkStatus, |
| 87 | @RequestParam(required = false) String payType, @RequestParam(required = false) String parkType, | 87 | @RequestParam(required = false) String payType, @RequestParam(required = false) String parkType, |
| 88 | - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date beginInTime, | ||
| 89 | - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endInTime, | ||
| 90 | - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date beginOutTime, | ||
| 91 | - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endOutTime, | 88 | + @RequestParam(required = false) Long beginInTime, |
| 89 | + @RequestParam(required = false) Long endInTime, | ||
| 90 | + @RequestParam(required = false) Long beginOutTime, | ||
| 91 | + @RequestParam(required = false) Long endOutTime, | ||
| 92 | @RequestParam(required = false) String carNum, HttpServletRequest request, | 92 | @RequestParam(required = false) String carNum, HttpServletRequest request, |
| 93 | HttpServletResponse response) { | 93 | HttpServletResponse response) { |
| 94 | 94 | ||
| @@ -124,10 +124,20 @@ public class OrderManageController extends BizController { | @@ -124,10 +124,20 @@ public class OrderManageController extends BizController { | ||
| 124 | } | 124 | } |
| 125 | dubboReq.setParkType(nums); | 125 | dubboReq.setParkType(nums); |
| 126 | } | 126 | } |
| 127 | - dubboReq.setBeginInTime(beginInTime); | ||
| 128 | - dubboReq.setEndInTime(endInTime); | ||
| 129 | - dubboReq.setBeginOutTime(beginOutTime); | ||
| 130 | - dubboReq.setEndOutTime(endOutTime); | 127 | + if(null != beginInTime){ |
| 128 | + dubboReq.setBeginInTime(new Date(beginInTime)); | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + if(null != endInTime){ | ||
| 132 | + dubboReq.setEndInTime(new Date(endInTime)); | ||
| 133 | + } | ||
| 134 | + if(null != beginOutTime){ | ||
| 135 | + dubboReq.setBeginOutTime(new Date(beginOutTime)); | ||
| 136 | + } | ||
| 137 | + if(null != endOutTime){ | ||
| 138 | + dubboReq.setEndOutTime(new Date(endOutTime)); | ||
| 139 | + } | ||
| 140 | + | ||
| 131 | dubboReq.setCarNum(carNum); | 141 | dubboReq.setCarNum(carNum); |
| 132 | dubboReq.setSysCode("10001"); | 142 | dubboReq.setSysCode("10001"); |
| 133 | dubboReq.getBaseRequest().setPageNum(1); | 143 | dubboReq.getBaseRequest().setPageNum(1); |