Commit 18d1bfadb2cf3d71560b27a61aed4a94b3f3e4c3
1 parent
2e648a0b
提交月账单 月卡年卡统计详情下载
Showing
2 changed files
with
225 additions
and
123 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/MonthBillManagementController.java
@@ -6,12 +6,12 @@ package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic; | @@ -6,12 +6,12 @@ package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic; | ||
6 | import java.math.BigDecimal; | 6 | import java.math.BigDecimal; |
7 | import java.text.SimpleDateFormat; | 7 | import java.text.SimpleDateFormat; |
8 | import java.util.ArrayList; | 8 | import java.util.ArrayList; |
9 | +import java.util.Arrays; | ||
9 | import java.util.Date; | 10 | import java.util.Date; |
10 | import java.util.List; | 11 | import java.util.List; |
11 | 12 | ||
12 | import javax.servlet.http.HttpServletRequest; | 13 | import javax.servlet.http.HttpServletRequest; |
13 | import javax.servlet.http.HttpServletResponse; | 14 | import javax.servlet.http.HttpServletResponse; |
14 | -import javax.servlet.http.HttpSession; | ||
15 | 15 | ||
16 | import com.alibaba.dubbo.common.utils.CollectionUtils; | 16 | import com.alibaba.dubbo.common.utils.CollectionUtils; |
17 | import com.alibaba.dubbo.common.utils.StringUtils; | 17 | import com.alibaba.dubbo.common.utils.StringUtils; |
@@ -39,13 +39,12 @@ import com.zteits.clouds.api.dto.clouds.dto.BillManageForMonthDetailDTO; | @@ -39,13 +39,12 @@ import com.zteits.clouds.api.dto.clouds.dto.BillManageForMonthDetailDTO; | ||
39 | import com.zteits.clouds.api.dto.clouds.dto.MonthBillMngtStatisticByParkinglotDTO; | 39 | import com.zteits.clouds.api.dto.clouds.dto.MonthBillMngtStatisticByParkinglotDTO; |
40 | import com.zteits.clouds.api.dto.clouds.dto.MonthBillMngtStatisticDTO; | 40 | import com.zteits.clouds.api.dto.clouds.dto.MonthBillMngtStatisticDTO; |
41 | import com.zteits.clouds.api.dto.clouds.dto.MonthBillSummaryStatisticDTO; | 41 | import com.zteits.clouds.api.dto.clouds.dto.MonthBillSummaryStatisticDTO; |
42 | -import com.zteits.clouds.api.dto.clouds.dto.YearMonthCardStatisticDTO; | 42 | +import com.zteits.clouds.api.dto.clouds.dto.YearMonthCardIncomeStatisticDTO; |
43 | import com.zteits.clouds.api.dto.clouds.param.BillQueryRequest; | 43 | import com.zteits.clouds.api.dto.clouds.param.BillQueryRequest; |
44 | import com.zteits.clouds.api.dto.clouds.param.MonthBillRequest; | 44 | import com.zteits.clouds.api.dto.clouds.param.MonthBillRequest; |
45 | -import com.zteits.clouds.api.dto.pay.param.YearMonthCardStatisticRequest; | 45 | +import com.zteits.clouds.api.dto.pay.param.YearMonthCardIncomeStatisticRequest; |
46 | import com.zteits.clouds.api.service.clouds.MonthBillManagementService; | 46 | import com.zteits.clouds.api.service.clouds.MonthBillManagementService; |
47 | import com.zteits.clouds.api.service.clouds.YearMonthCardStatisticService; | 47 | import com.zteits.clouds.api.service.clouds.YearMonthCardStatisticService; |
48 | -import com.zteits.clouds.api.service.pay.TdCustCompanyService; | ||
49 | import io.swagger.annotations.Api; | 48 | import io.swagger.annotations.Api; |
50 | import io.swagger.annotations.ApiOperation; | 49 | import io.swagger.annotations.ApiOperation; |
51 | import org.apache.poi.xssf.usermodel.XSSFSheet; | 50 | import org.apache.poi.xssf.usermodel.XSSFSheet; |
@@ -54,6 +53,7 @@ import org.slf4j.Logger; | @@ -54,6 +53,7 @@ import org.slf4j.Logger; | ||
54 | import org.slf4j.LoggerFactory; | 53 | import org.slf4j.LoggerFactory; |
55 | import org.springframework.beans.factory.annotation.Autowired; | 54 | import org.springframework.beans.factory.annotation.Autowired; |
56 | import org.springframework.beans.factory.annotation.Value; | 55 | import org.springframework.beans.factory.annotation.Value; |
56 | +import org.springframework.format.annotation.DateTimeFormat; | ||
57 | import org.springframework.stereotype.Controller; | 57 | import org.springframework.stereotype.Controller; |
58 | import org.springframework.web.bind.annotation.GetMapping; | 58 | import org.springframework.web.bind.annotation.GetMapping; |
59 | import org.springframework.web.bind.annotation.PostMapping; | 59 | import org.springframework.web.bind.annotation.PostMapping; |
@@ -79,79 +79,85 @@ public class MonthBillManagementController extends BizController { | @@ -79,79 +79,85 @@ public class MonthBillManagementController extends BizController { | ||
79 | private SessionCommUtil sessionCommUtil; | 79 | private SessionCommUtil sessionCommUtil; |
80 | @Value("${project.syscode}") | 80 | @Value("${project.syscode}") |
81 | private String sysCode; | 81 | private String sysCode; |
82 | - | ||
83 | - | 82 | + |
84 | @ApiOperation("月账汇总单查询(统计图)") | 83 | @ApiOperation("月账汇总单查询(统计图)") |
85 | - @RequestMapping("/queryBillforMonthTotal") | ||
86 | - @ResponseBody | ||
87 | - public BizResultVO<BillManageDTO> queryBillforMonthTotal(@RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, | ||
88 | - HttpServletResponse response) throws Exception { | ||
89 | - BizResult<BillManageDTO> result = monthBillManagementService.queryBillforMonthTotal(billQueryRequest); | ||
90 | - return new BizResultVO<BillManageDTO>(result); | ||
91 | - } | ||
92 | - | 84 | + @RequestMapping("/queryBillforMonthTotal") |
85 | + @ResponseBody | ||
86 | + public BizResultVO<BillManageDTO> queryBillforMonthTotal(@RequestBody BillQueryRequest billQueryRequest, | ||
87 | + HttpServletRequest request, | ||
88 | + HttpServletResponse response) throws Exception { | ||
89 | + BizResult<BillManageDTO> result = monthBillManagementService.queryBillforMonthTotal(billQueryRequest); | ||
90 | + return new BizResultVO<BillManageDTO>(result); | ||
91 | + } | ||
92 | + | ||
93 | @ApiOperation("月账汇总单查询") | 93 | @ApiOperation("月账汇总单查询") |
94 | - @RequestMapping("/queryBillforMonthForPage") | ||
95 | - @ResponseBody | ||
96 | - public void queryBillforMonthForPage(@RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, | ||
97 | - HttpServletResponse response) throws Exception { | ||
98 | - logger.info("---begin--月账汇总单查询调用后场dubbo服务,入参={}", JSONObject.toJSON(billQueryRequest)); | ||
99 | - BizResult<PageBean<BillManageDTO>> result = monthBillManagementService.queryBillforMonthTotalForPage(billQueryRequest); | ||
100 | - logger.info("---end--月账汇总单查询调用后场dubbo服务,结果={}", JSONObject.toJSONString(result)); | ||
101 | - this.returnJsonDataGrid(response, result); | ||
102 | - } | ||
103 | - | 94 | + @RequestMapping("/queryBillforMonthForPage") |
95 | + @ResponseBody | ||
96 | + public void queryBillforMonthForPage(@RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, | ||
97 | + HttpServletResponse response) throws Exception { | ||
98 | + logger.info("---begin--月账汇总单查询调用后场dubbo服务,入参={}", JSONObject.toJSON(billQueryRequest)); | ||
99 | + BizResult<PageBean<BillManageDTO>> result = monthBillManagementService.queryBillforMonthTotalForPage( | ||
100 | + billQueryRequest); | ||
101 | + logger.info("---end--月账汇总单查询调用后场dubbo服务,结果={}", JSONObject.toJSONString(result)); | ||
102 | + this.returnJsonDataGrid(response, result); | ||
103 | + } | ||
104 | + | ||
104 | /** | 105 | /** |
105 | - * 日账单导出.<br/> | ||
106 | - * | ||
107 | - * @param request | ||
108 | - * @param response | ||
109 | - * @throws Exception | ||
110 | - */ | ||
111 | - @RequestMapping("/exportToExcleForBillForMonth") | ||
112 | - public void exportToExcleForBillForMonth(@RequestParam String beginTime,@RequestParam String endTime,@RequestParam List<String> parkIdList, | ||
113 | - HttpServletRequest request,HttpServletResponse response) throws Exception { | ||
114 | - SimpleDateFormat format_yyy = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
115 | - BillQueryRequest billQueryRequest = new BillQueryRequest(); | ||
116 | - billQueryRequest.setSysCode("1001"); | ||
117 | - billQueryRequest.getBaseRequest().setPageSize(0); | ||
118 | - billQueryRequest.setParkIdList(parkIdList); | ||
119 | - billQueryRequest.setBeginTime(format_yyy.parse(beginTime)); | ||
120 | - billQueryRequest.setEndTime(format_yyy.parse(endTime)); | ||
121 | - BizResult<PageBean<BillManageDTO>> result = monthBillManagementService.queryBillforMonthTotalForPage(billQueryRequest); | ||
122 | - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM"); | ||
123 | - String[] title = new String[]{"时间","停车场名称","现金(元)","支付宝(元)","微信(元)","总收入(元)"}; | ||
124 | - String sheetName="月账单"; | ||
125 | - String fileName = "月账单"; | ||
126 | - // 1.创建excel信息 | ||
127 | - XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); | ||
128 | - // 2.设置excel表头和表体 | ||
129 | - Layouter.buildReport(workSheet,title,0, 0); | ||
130 | - //3.填充数据 | ||
131 | - List<Object[]> contentList=new ArrayList<Object[]>(); | ||
132 | - if(result != null && !CollectionUtils.isEmpty(result.getData().getDataList())){ | ||
133 | - List<BillManageDTO> list = result.getData().getDataList(); | ||
134 | - for (BillManageDTO e: list) { | ||
135 | - if(e != null){ | ||
136 | - Object[] obj=new Object[title.length]; | ||
137 | - int index=0; | ||
138 | - obj[index++]=(e.getBillDayTime() != null ? format.format(e.getBillDayTime()) : ""); | ||
139 | - obj[index++]=e.getParkName(); | ||
140 | - obj[index++]=(e.getCashTotalFee() == null ? "0" : e.getCashTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
141 | - obj[index++]=(e.getAliTotalFee() == null ? "0" : e.getAliTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
142 | - obj[index++]=(e.getWxTotalFee() == null ? "0" : e.getWxTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
143 | - obj[index++]=(e.getOrderTotalFee() == null ? "0" : e.getOrderTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
144 | - contentList.add(obj); | ||
145 | - } | ||
146 | - } | ||
147 | - } | ||
148 | - ExcleFillDateManager fillUserManager=new ExcleFillDateManager(); | ||
149 | - fillUserManager.fillSalesOrga(workSheet,title,contentList,2); | ||
150 | - // 4.excel输出配置 | ||
151 | - ExcelUtil.write(response, workSheet, fileName); | ||
152 | - | ||
153 | - } | ||
154 | - | 106 | + * 日账单导出.<br/> |
107 | + * | ||
108 | + * @param request | ||
109 | + * @param response | ||
110 | + * @throws Exception | ||
111 | + */ | ||
112 | + @RequestMapping("/exportToExcleForBillForMonth") | ||
113 | + public void exportToExcleForBillForMonth(@RequestParam String beginTime, @RequestParam String endTime, | ||
114 | + @RequestParam List<String> parkIdList, | ||
115 | + HttpServletRequest request, HttpServletResponse response) throws Exception { | ||
116 | + SimpleDateFormat format_yyy = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
117 | + BillQueryRequest billQueryRequest = new BillQueryRequest(); | ||
118 | + billQueryRequest.setSysCode("1001"); | ||
119 | + billQueryRequest.getBaseRequest().setPageSize(0); | ||
120 | + billQueryRequest.setParkIdList(parkIdList); | ||
121 | + billQueryRequest.setBeginTime(format_yyy.parse(beginTime)); | ||
122 | + billQueryRequest.setEndTime(format_yyy.parse(endTime)); | ||
123 | + BizResult<PageBean<BillManageDTO>> result = monthBillManagementService.queryBillforMonthTotalForPage( | ||
124 | + billQueryRequest); | ||
125 | + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM"); | ||
126 | + String[] title = new String[] {"时间", "停车场名称", "现金(元)", "支付宝(元)", "微信(元)", "总收入(元)"}; | ||
127 | + String sheetName = "月账单"; | ||
128 | + String fileName = "月账单"; | ||
129 | + // 1.创建excel信息 | ||
130 | + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); | ||
131 | + // 2.设置excel表头和表体 | ||
132 | + Layouter.buildReport(workSheet, title, 0, 0); | ||
133 | + //3.填充数据 | ||
134 | + List<Object[]> contentList = new ArrayList<Object[]>(); | ||
135 | + if (result != null && !CollectionUtils.isEmpty(result.getData().getDataList())) { | ||
136 | + List<BillManageDTO> list = result.getData().getDataList(); | ||
137 | + for (BillManageDTO e : list) { | ||
138 | + if (e != null) { | ||
139 | + Object[] obj = new Object[title.length]; | ||
140 | + int index = 0; | ||
141 | + obj[index++] = (e.getBillDayTime() != null ? format.format(e.getBillDayTime()) : ""); | ||
142 | + obj[index++] = e.getParkName(); | ||
143 | + obj[index++] = (e.getCashTotalFee() == null ? "0" : e.getCashTotalFee().divide( | ||
144 | + new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP)); | ||
145 | + obj[index++] = (e.getAliTotalFee() == null ? "0" : e.getAliTotalFee().divide(new BigDecimal("100"), | ||
146 | + 2, BigDecimal.ROUND_HALF_UP)); | ||
147 | + obj[index++] = (e.getWxTotalFee() == null ? "0" : e.getWxTotalFee().divide(new BigDecimal("100"), 2, | ||
148 | + BigDecimal.ROUND_HALF_UP)); | ||
149 | + obj[index++] = (e.getOrderTotalFee() == null ? "0" : e.getOrderTotalFee().divide( | ||
150 | + new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP)); | ||
151 | + contentList.add(obj); | ||
152 | + } | ||
153 | + } | ||
154 | + } | ||
155 | + ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | ||
156 | + fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); | ||
157 | + // 4.excel输出配置 | ||
158 | + ExcelUtil.write(response, workSheet, fileName); | ||
159 | + | ||
160 | + } | ||
155 | 161 | ||
156 | @ApiOperation("月账单查询汇总统计") | 162 | @ApiOperation("月账单查询汇总统计") |
157 | @PostMapping("/summaryStatistic") | 163 | @PostMapping("/summaryStatistic") |
@@ -247,20 +253,21 @@ public class MonthBillManagementController extends BizController { | @@ -247,20 +253,21 @@ public class MonthBillManagementController extends BizController { | ||
247 | public BizResultVO<EasyUIDataGridVO<BillManageForMonthDTO>> queryBillforMonthList( | 253 | public BizResultVO<EasyUIDataGridVO<BillManageForMonthDTO>> queryBillforMonthList( |
248 | @RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, HttpServletResponse response) | 254 | @RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, HttpServletResponse response) |
249 | throws Exception { | 255 | throws Exception { |
250 | - // 2.调用接口查询当前登录人管辖的停车场名称 | 256 | + // 2.调用接口查询当前登录人管辖的停车场名称 |
251 | UserInfo userInfo = sessionCommUtil.getUserInfo(); | 257 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
252 | List<String> plNos = userInfo.getOrgIds(); | 258 | List<String> plNos = userInfo.getOrgIds(); |
253 | -// UserInfo userInfo = sessionCommUtil.getUserInfo(); | ||
254 | -// List<String> plNos = new ArrayList<>(); | ||
255 | -// if (userInfo != null) { | ||
256 | -// TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
257 | -// tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
258 | -// tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
259 | -// tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
260 | -// BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest); | ||
261 | -// // 拥有的停车场编号 | ||
262 | -// plNos = ResultUtils.getBizResultData(bizResult); | ||
263 | -// } | 259 | + // UserInfo userInfo = sessionCommUtil.getUserInfo(); |
260 | + // List<String> plNos = new ArrayList<>(); | ||
261 | + // if (userInfo != null) { | ||
262 | + // TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
263 | + // tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
264 | + // tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
265 | + // tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
266 | + // BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds | ||
267 | + // (tdCompanyParkQueryRequest); | ||
268 | + // // 拥有的停车场编号 | ||
269 | + // plNos = ResultUtils.getBizResultData(bizResult); | ||
270 | + // } | ||
264 | // if (CollectionUtils.isEmpty(plNos)) { | 271 | // if (CollectionUtils.isEmpty(plNos)) { |
265 | // throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); | 272 | // throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); |
266 | // } | 273 | // } |
@@ -285,16 +292,17 @@ public class MonthBillManagementController extends BizController { | @@ -285,16 +292,17 @@ public class MonthBillManagementController extends BizController { | ||
285 | // 2.调用接口查询当前登录人管辖的停车场名称 | 292 | // 2.调用接口查询当前登录人管辖的停车场名称 |
286 | UserInfo userInfo = sessionCommUtil.getUserInfo(); | 293 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
287 | List<String> plNos = userInfo.getOrgIds(); | 294 | List<String> plNos = userInfo.getOrgIds(); |
288 | -// List<String> plNos = new ArrayList<>(); | ||
289 | -// if (userInfo != null) { | ||
290 | -// TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
291 | -// tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
292 | -// tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
293 | -// tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
294 | -// BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest); | ||
295 | -// // 拥有的停车场编号 | ||
296 | -// plNos = ResultUtils.getBizResultData(bizResult); | ||
297 | -// } | 295 | + // List<String> plNos = new ArrayList<>(); |
296 | + // if (userInfo != null) { | ||
297 | + // TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
298 | + // tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
299 | + // tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
300 | + // tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
301 | + // BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds | ||
302 | + // (tdCompanyParkQueryRequest); | ||
303 | + // // 拥有的停车场编号 | ||
304 | + // plNos = ResultUtils.getBizResultData(bizResult); | ||
305 | + // } | ||
298 | // if (CollectionUtils.isEmpty(plNos)) { | 306 | // if (CollectionUtils.isEmpty(plNos)) { |
299 | // throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); | 307 | // throw new BizException(ErrorType.PARK_LOT_NOT_EXISTS, "停车场plnos不存在"); |
300 | // } | 308 | // } |
@@ -408,8 +416,6 @@ public class MonthBillManagementController extends BizController { | @@ -408,8 +416,6 @@ public class MonthBillManagementController extends BizController { | ||
408 | 416 | ||
409 | } | 417 | } |
410 | 418 | ||
411 | - | ||
412 | - | ||
413 | /** | 419 | /** |
414 | * 月账单所有导出.<br/> | 420 | * 月账单所有导出.<br/> |
415 | * | 421 | * |
@@ -436,19 +442,19 @@ public class MonthBillManagementController extends BizController { | @@ -436,19 +442,19 @@ public class MonthBillManagementController extends BizController { | ||
436 | // 2.调用接口查询当前登录人管辖的停车场名称 | 442 | // 2.调用接口查询当前登录人管辖的停车场名称 |
437 | UserInfo userInfo = sessionCommUtil.getUserInfo(); | 443 | UserInfo userInfo = sessionCommUtil.getUserInfo(); |
438 | List<String> plNos = userInfo.getOrgIds(); | 444 | List<String> plNos = userInfo.getOrgIds(); |
439 | -// // 2.调用接口查询当前登录人管辖的停车场名称 | ||
440 | -// UserInfo userInfo = sessionCommUtil.getUserInfo(); | ||
441 | -// List<String> plNos = new ArrayList<>(); | ||
442 | -// if (userInfo != null) { | ||
443 | -// TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
444 | -// tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
445 | -// tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
446 | -// tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
447 | -// BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds( | ||
448 | -// tdCompanyParkQueryRequest); | ||
449 | -// // 拥有的停车场编号 | ||
450 | -// plNos = ResultUtils.getBizResultData(bizResult); | ||
451 | -// } | 445 | + // // 2.调用接口查询当前登录人管辖的停车场名称 |
446 | + // UserInfo userInfo = sessionCommUtil.getUserInfo(); | ||
447 | + // List<String> plNos = new ArrayList<>(); | ||
448 | + // if (userInfo != null) { | ||
449 | + // TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
450 | + // tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
451 | + // tdCompanyParkQueryRequest.setSessionId(session.getId()); | ||
452 | + // tdCompanyParkQueryRequest.setSysCode(sysCode); | ||
453 | + // BizResult<List<String>> bizResult = tdCustCompanyService.queryParkNoByCustIds( | ||
454 | + // tdCompanyParkQueryRequest); | ||
455 | + // // 拥有的停车场编号 | ||
456 | + // plNos = ResultUtils.getBizResultData(bizResult); | ||
457 | + // } | ||
452 | billQueryRequest.setParkIdList(plNos); | 458 | billQueryRequest.setParkIdList(plNos); |
453 | logger.info("月账单导出所有 req={}", JSONObject.toJSONString(billQueryRequest)); | 459 | logger.info("月账单导出所有 req={}", JSONObject.toJSONString(billQueryRequest)); |
454 | respondResult = monthBillManagementService | 460 | respondResult = monthBillManagementService |
@@ -523,6 +529,97 @@ public class MonthBillManagementController extends BizController { | @@ -523,6 +529,97 @@ public class MonthBillManagementController extends BizController { | ||
523 | 529 | ||
524 | } | 530 | } |
525 | 531 | ||
532 | + @ApiOperation("月账单年卡月卡统计-详情导出") | ||
533 | + @RequestMapping("/exportYearMonthCardIncomeStatistic") | ||
534 | + public void exportYearMonthCardIncomeStatistic(@RequestParam String plNos, | ||
535 | + @RequestParam(required = false) Long beginTime, | ||
536 | + @RequestParam(required = false) Long endTime, @RequestParam(required = false) String orderType, | ||
537 | + HttpServletRequest request, HttpServletResponse response) { | ||
538 | + YearMonthCardIncomeStatisticRequest dubboReq = new YearMonthCardIncomeStatisticRequest(); | ||
539 | + | ||
540 | + if (org.apache.commons.lang3.StringUtils.isNotEmpty(plNos)) { | ||
541 | + dubboReq.setPlNos(Arrays.asList(plNos.split(","))); | ||
542 | + } | ||
543 | + if (org.apache.commons.lang3.StringUtils.isNotEmpty(orderType)) { | ||
544 | + String[] tempStr = orderType.split(","); | ||
545 | + List<Integer> nums = new ArrayList<>(); | ||
546 | + for (String str : tempStr) { | ||
547 | + nums.add(Integer.valueOf(str)); | ||
548 | + } | ||
549 | + dubboReq.setOrderType(nums); | ||
550 | + } | ||
551 | + dubboReq.setBeginTime(new Date(beginTime)); | ||
552 | + dubboReq.setEndTime(new Date(endTime)); | ||
553 | + dubboReq.setSysCode("10001"); | ||
554 | + BizResult<List<YearMonthCardIncomeStatisticDTO>> bizResult = yearMonthCardStatisticService | ||
555 | + .queryYearMonthCardIncomeStatistic(dubboReq); | ||
556 | + String[] title = new String[] {"类型", "现金(元)", "微信(元)", "支付宝(元)", "其他(元)","总金额(元)"}; | ||
557 | + String sheetName = "月卡年卡详情"; | ||
558 | + String fileName = "月卡年卡详情"; | ||
559 | + List<YearMonthCardIncomeStatisticDTO> dtos = new ArrayList<>(); | ||
560 | + if (null != bizResult && CollectionUtils.isNotEmpty(bizResult.getData())) { | ||
561 | + dtos = bizResult.getData(); | ||
562 | + } | ||
563 | + | ||
564 | + // 1.创建excel信息 | ||
565 | + XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); | ||
566 | + // 2.设置excel表头和表体 | ||
567 | + Layouter.buildReport(workSheet, title, 0, 0); | ||
568 | + // 3.填充数据 | ||
569 | + List<Object[]> contentList = new ArrayList<Object[]>(); | ||
570 | + | ||
571 | + for (YearMonthCardIncomeStatisticDTO e : dtos) { | ||
572 | + Object[] obj = new Object[title.length]; | ||
573 | + int index = 0; | ||
574 | + obj[index++] = getOrderTypeStr(e.getOrderType()); | ||
575 | + //现金 | ||
576 | + obj[index++] = e.getCashTotalFee() != null ? e.getCashTotalFee().divide(new BigDecimal("100"), | ||
577 | + 2, BigDecimal.ROUND_HALF_UP) : ""; | ||
578 | + //微信 | ||
579 | + obj[index++] = e.getWxTotalFee() != null ? e.getWxTotalFee().divide(new BigDecimal("100"), | ||
580 | + 2, BigDecimal.ROUND_HALF_UP) : ""; | ||
581 | + //支付宝 | ||
582 | + obj[index++] = e.getAliTotalFee() != null ? e.getAliTotalFee().divide(new BigDecimal("100"), | ||
583 | + 2, BigDecimal.ROUND_HALF_UP) : ""; | ||
584 | + //其他 | ||
585 | + obj[index++] = e.getOthersTotalFee() != null ? e.getOthersTotalFee().divide(new BigDecimal("100"), | ||
586 | + 2, BigDecimal.ROUND_HALF_UP) : ""; | ||
587 | + //总金额 | ||
588 | + obj[index++] = e.getOrderTotalFee() != null ? e.getOrderTotalFee().divide(new BigDecimal("100"), | ||
589 | + 2, BigDecimal.ROUND_HALF_UP) : ""; | ||
590 | + contentList.add(obj); | ||
591 | + } | ||
592 | + | ||
593 | + ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | ||
594 | + fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); | ||
595 | + // 4.excel输出配置 | ||
596 | + ExcelUtil.write(response, workSheet, fileName); | ||
597 | + } | ||
598 | + | ||
599 | + private String getOrderTypeStr(Integer orderType) { | ||
600 | + String orderTypeStr; | ||
601 | + if (orderType == null) { | ||
602 | + return ""; | ||
603 | + } | ||
604 | + switch (orderType) { | ||
605 | + case -1: | ||
606 | + orderTypeStr = "合计"; | ||
607 | + break; | ||
608 | + case 1: | ||
609 | + orderTypeStr = "停车订单"; | ||
610 | + break; | ||
611 | + case 2: | ||
612 | + orderTypeStr = "年卡"; | ||
613 | + break; | ||
614 | + case 3: | ||
615 | + orderTypeStr = "月卡"; | ||
616 | + break; | ||
617 | + default: | ||
618 | + orderTypeStr = "未知"; | ||
619 | + } | ||
620 | + return orderTypeStr; | ||
621 | + } | ||
622 | + | ||
526 | /** | 623 | /** |
527 | * 通过session信息获取停车场编码.<br/> | 624 | * 通过session信息获取停车场编码.<br/> |
528 | * | 625 | * |
@@ -531,17 +628,19 @@ public class MonthBillManagementController extends BizController { | @@ -531,17 +628,19 @@ public class MonthBillManagementController extends BizController { | ||
531 | * @return | 628 | * @return |
532 | * @throws Exception | 629 | * @throws Exception |
533 | */ | 630 | */ |
534 | -// private List<String> queryParkNoByCustIds(TdCompanyParkQueryRequest tdCompanyParkQueryRequest) throws Exception { | ||
535 | -// /** 查询停车场编码. */ | ||
536 | -// BizResult<List<String>> parkNoResult = tdCustCompanyService.queryParkNoByCustIds(tdCompanyParkQueryRequest); | ||
537 | -// if (parkNoResult.isSuccess() && parkNoResult != null && parkNoResult.getData() != null) { | ||
538 | -// logger.info("根据登录获取到对应的停车场编码=" + JSONArray.toJSONString(parkNoResult.getData())); | ||
539 | -// return parkNoResult.getData(); | ||
540 | -// } else { | ||
541 | -// logger.info("根据登录用户没有获取到对应的停车场编码"); | ||
542 | -// return null; | ||
543 | -// } | ||
544 | -// | ||
545 | -// } | 631 | + // private List<String> queryParkNoByCustIds(TdCompanyParkQueryRequest tdCompanyParkQueryRequest) throws |
632 | + // Exception { | ||
633 | + // /** 查询停车场编码. */ | ||
634 | + // BizResult<List<String>> parkNoResult = tdCustCompanyService.queryParkNoByCustIds | ||
635 | + // (tdCompanyParkQueryRequest); | ||
636 | + // if (parkNoResult.isSuccess() && parkNoResult != null && parkNoResult.getData() != null) { | ||
637 | + // logger.info("根据登录获取到对应的停车场编码=" + JSONArray.toJSONString(parkNoResult.getData())); | ||
638 | + // return parkNoResult.getData(); | ||
639 | + // } else { | ||
640 | + // logger.info("根据登录用户没有获取到对应的停车场编码"); | ||
641 | + // return null; | ||
642 | + // } | ||
643 | + // | ||
644 | + // } | ||
546 | 645 | ||
547 | } | 646 | } |
548 | \ No newline at end of file | 647 | \ No newline at end of file |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/OrderManageController.java