Commit 3539f7d2dee6f0b1931c6094d9a5e134c552a731
1 parent
3b03d717
commit
Showing
2 changed files
with
68 additions
and
3 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/AnalysisController.java
... | ... | @@ -231,7 +231,7 @@ public class AnalysisController extends BizController { |
231 | 231 | request.setBeginTime(DateUtil.to_date(beginTime, DateUtil.DATETIME_FORMAT)); |
232 | 232 | request.setEndTime(DateUtil.to_date(endTime, DateUtil.DATETIME_FORMAT)); |
233 | 233 | request.setPlNos(plNos); |
234 | - request.setBaseRequest(new BaseInfo(1, 100)); | |
234 | + request.setBaseRequest(new BaseInfo(1, 1000)); | |
235 | 235 | request.setTimeType(ParkConstant.ParkingLotUseStatistic.StatisticType.PER1DAY); |
236 | 236 | |
237 | 237 | Calendar endc = Calendar.getInstance(); | ... | ... |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BerthManageController.java
1 | 1 | package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic; |
2 | 2 | |
3 | +import java.text.DecimalFormat; | |
4 | +import java.text.SimpleDateFormat; | |
5 | +import java.util.ArrayList; | |
6 | +import java.util.Calendar; | |
7 | +import java.util.Date; | |
8 | +import java.util.List; | |
9 | + | |
10 | +import javax.servlet.http.HttpServletRequest; | |
11 | +import javax.servlet.http.HttpServletResponse; | |
12 | + | |
13 | +import org.apache.poi.xssf.usermodel.XSSFSheet; | |
3 | 14 | import org.slf4j.Logger; |
4 | 15 | import org.slf4j.LoggerFactory; |
5 | 16 | import org.springframework.beans.factory.annotation.Autowired; |
6 | 17 | import org.springframework.beans.factory.annotation.Value; |
7 | 18 | import org.springframework.stereotype.Controller; |
19 | +import org.springframework.web.bind.annotation.GetMapping; | |
8 | 20 | import org.springframework.web.bind.annotation.PostMapping; |
9 | 21 | import org.springframework.web.bind.annotation.RequestBody; |
10 | 22 | import org.springframework.web.bind.annotation.RequestMapping; |
23 | +import org.springframework.web.bind.annotation.RequestParam; | |
11 | 24 | import org.springframework.web.bind.annotation.ResponseBody; |
12 | 25 | |
26 | +import com.alibaba.dubbo.common.utils.CollectionUtils; | |
27 | +import com.clouds.common.constants.TableNameEnum; | |
28 | +import com.clouds.common.utils.DateUtil; | |
29 | +import com.clouds.common.utils.excle.ExcelUtil; | |
30 | +import com.clouds.common.utils.excle.ExcleFillDateManager; | |
31 | +import com.clouds.common.utils.excle.Layouter; | |
13 | 32 | import com.clouds.common.web.BizController; |
14 | 33 | import com.clouds.common.web.vo.BizResultVO; |
15 | 34 | import com.clouds.common.web.vo.EasyUIDataGridVO; |
35 | +import com.zteits.clouds.api.apibase.bean.BaseInfo; | |
16 | 36 | import com.zteits.clouds.api.apibase.bean.BizResult; |
17 | 37 | import com.zteits.clouds.api.apibase.bean.PageBean; |
38 | +import com.zteits.clouds.api.dto.clouds.param.BerthTurnOverQueryRequest; | |
39 | +import com.zteits.clouds.api.dto.park.dto.BerthTurnOverCountDTO; | |
18 | 40 | import com.zteits.clouds.api.dto.park.dto.BerthsDTO; |
19 | 41 | import com.zteits.clouds.api.dto.park.param.BerthManageRequest; |
20 | 42 | import com.zteits.clouds.api.service.park.BerthManageService; |
43 | +import com.zteits.irain.portal.constant.ParkConstant; | |
21 | 44 | |
22 | 45 | import io.swagger.annotations.Api; |
23 | 46 | import io.swagger.annotations.ApiOperation; |
... | ... | @@ -55,9 +78,9 @@ public class BerthManageController extends BizController { |
55 | 78 | * @throws InstantiationException |
56 | 79 | */ |
57 | 80 | @ApiOperation("泊位信息分页查询") |
58 | - @PostMapping("berthList") | |
81 | + @PostMapping("berthInfoList") | |
59 | 82 | @ResponseBody |
60 | - public BizResultVO<EasyUIDataGridVO<BerthsDTO>> berthList(@RequestBody BerthManageRequest requestObject) | |
83 | + public BizResultVO<EasyUIDataGridVO<BerthsDTO>> berthInfoList(@RequestBody BerthManageRequest requestObject) | |
61 | 84 | throws InstantiationException, IllegalAccessException { |
62 | 85 | |
63 | 86 | requestObject.setSysCode(sysCode); |
... | ... | @@ -105,4 +128,46 @@ public class BerthManageController extends BizController { |
105 | 128 | return new BizResultVO<Boolean>(respondObject); |
106 | 129 | } |
107 | 130 | |
131 | + @ApiOperation("导出泊位信息excel") | |
132 | + @GetMapping("exportBerthInfoExcel") | |
133 | + public void exportBerthInfoExcel(@RequestParam List<String> plNos,@RequestParam List<String> parkTypes, | |
134 | + @RequestParam List<String> parkAreaCodes, HttpServletRequest requests, HttpServletResponse response) { | |
135 | + BerthManageRequest request = new BerthManageRequest(); | |
136 | + request.setSysCode(sysCode); | |
137 | + request.setPlNos(plNos); | |
138 | + request.setBaseRequest(new BaseInfo(1, 1000)); | |
139 | + | |
140 | + | |
141 | + BizResult<PageBean<BerthsDTO>> bizResult = berthManageService.queryBerthByCondition(request); | |
142 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | |
143 | + String[] title = new String[] { "序号","泊位编号", "所属停车场", "所属泊位区间", "停车方式" }; | |
144 | + String sheetName = "泊位信息"; | |
145 | + String fileName = "泊位信息" + sdf.format(new Date()); | |
146 | + // 1.创建excel信息 | |
147 | + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); | |
148 | + // 2.设置excel表头和表体 | |
149 | + Layouter.buildReport(workSheet, title, 0, 0); | |
150 | + // 3.填充数据 | |
151 | + List<Object[]> contentList = new ArrayList<Object[]>(); | |
152 | + List<BerthsDTO> list = new ArrayList<>(); | |
153 | + if (CollectionUtils.isNotEmpty(bizResult.getData().getDataList())) { | |
154 | + list = bizResult.getData().getDataList(); | |
155 | + } | |
156 | + int number = 1; | |
157 | + for (BerthsDTO b : list) { | |
158 | + Object[] obj = new Object[title.length]; | |
159 | + int index = 0; | |
160 | + obj[index++] = number++; | |
161 | + obj[index++] = b.getBerthNo(); | |
162 | + obj[index++] = b.getPlName(); | |
163 | + obj[index++] = b.getParkAreaName(); | |
164 | + obj[index++] = b.getParkType(); | |
165 | + contentList.add(obj); | |
166 | + } | |
167 | + ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | |
168 | + fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); | |
169 | + // 4.excel输出配置 | |
170 | + ExcelUtil.write(response, workSheet, fileName); | |
171 | + } | |
172 | + | |
108 | 173 | } | ... | ... |