Commit 4bf9a3b08f396c10c8c1933dd77b959fcb4fc9cf
1 parent
f35d61ab
提交
Showing
6 changed files
with
149 additions
and
345 deletions
src/main/java/com/zteits/irain/portal/web/fangle/FangleEqpController.java deleted
1 | -package com.zteits.irain.portal.web.fangle; | ||
2 | - | ||
3 | -import java.text.ParseException; | ||
4 | -import java.text.SimpleDateFormat; | ||
5 | -import java.util.Date; | ||
6 | -import java.util.Map; | ||
7 | - | ||
8 | -import org.slf4j.Logger; | ||
9 | -import org.slf4j.LoggerFactory; | ||
10 | -import org.springframework.beans.BeanUtils; | ||
11 | -import org.springframework.beans.factory.annotation.Autowired; | ||
12 | -import org.springframework.beans.factory.annotation.Value; | ||
13 | -import org.springframework.web.bind.annotation.RequestBody; | ||
14 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
15 | -import org.springframework.web.bind.annotation.RequestMethod; | ||
16 | -import org.springframework.web.bind.annotation.RestController; | ||
17 | - | ||
18 | -import com.alibaba.fastjson.JSON; | ||
19 | -import com.alibaba.fastjson.JSONArray; | ||
20 | -import com.alibaba.fastjson.JSONObject; | ||
21 | -import com.clouds.common.web.BizController; | ||
22 | -import com.zteits.clouds.api.apibase.bean.BaseInfo; | ||
23 | -import com.zteits.clouds.api.apibase.bean.BizResult; | ||
24 | -import com.zteits.clouds.api.dto.park.param.EqpLogRequest; | ||
25 | -import com.zteits.clouds.api.service.park.EqpBerthsService; | ||
26 | -import com.zteits.irain.portal.vo.fangle.BerthStateRequest; | ||
27 | -import com.zteits.irain.portal.vo.fangle.EqpHeartBeatRequest; | ||
28 | - | ||
29 | -import io.swagger.annotations.Api; | ||
30 | -import io.swagger.annotations.ApiOperation; | ||
31 | - | ||
32 | -/** | ||
33 | - * Copyright: Copyright (c) 2017 ZTE-ITS | ||
34 | - * | ||
35 | - * @ClassName: FangleEqpController.java | ||
36 | - * @Description:方格尔设备同步 | ||
37 | - * @version: v1.0.0 | ||
38 | - * @author: wangfei | ||
39 | - * @date: 2017年4月20日 下午17:51:45 | ||
40 | - * Modification History: | ||
41 | - * Date Author Version Description | ||
42 | - *---------------------------------------------------------* | ||
43 | - * 2017年8月21日 wangfei v1.0.0 创建 | ||
44 | - */ | ||
45 | -@Api(value="方格尔设备同步",description="方格尔设备同步") | ||
46 | -@RestController | ||
47 | -@RequestMapping("/fangle") | ||
48 | -public class FangleEqpController extends BizController{ | ||
49 | - | ||
50 | - | ||
51 | - private static final Logger logger = LoggerFactory.getLogger(FangleEqpController.class); | ||
52 | - @Value("${project.syscode}") | ||
53 | - private String sysCode; | ||
54 | - @Autowired | ||
55 | - private EqpBerthsService eqpBerthsService; | ||
56 | - | ||
57 | - @ApiOperation("泊位信息同步") | ||
58 | - @RequestMapping(value = "/synBerthInfo",method = RequestMethod.POST) | ||
59 | - public BizResult<Map<String, String>> synBerthInfo(@RequestBody String param){ | ||
60 | - logger.info("同步入参:" + param); | ||
61 | - | ||
62 | - JSONObject jsonObject = JSONObject.parseObject(param); | ||
63 | - String reqList = jsonObject.getString("pushdata"); | ||
64 | - JSONArray jsonArray = JSON.parseArray(reqList); | ||
65 | - BerthStateRequest request = JSON.parseObject(jsonArray.getString(0),BerthStateRequest.class); | ||
66 | - BaseInfo info = new BaseInfo(); | ||
67 | - request.setBaseRequest(info); | ||
68 | - request.setSysCode(sysCode); | ||
69 | - //数据转换 | ||
70 | - EqpLogRequest eqpLogRequest = new EqpLogRequest(); | ||
71 | - BeanUtils.copyProperties(request, eqpLogRequest); | ||
72 | - eqpLogRequest.setBerthOutNo(request.getBerthcode()); | ||
73 | - eqpLogRequest.setEqpType(1);//地磁 | ||
74 | - if(request.getBerthstatus().equals("1") || request.getBerthstatus().equals("2")){ | ||
75 | - eqpLogRequest.setEqpStatus("1");//设备状态 1-正常 | ||
76 | - } | ||
77 | - if(request.getBerthstatus().equals("3")){ | ||
78 | - eqpLogRequest.setEqpStatus("0");//设备状态 0-故障 | ||
79 | - } | ||
80 | - if(request.getBerthstatus().equals("2")){ | ||
81 | - eqpLogRequest.setBerthState("0");//泊位状态 0-空闲 | ||
82 | - } | ||
83 | - if(request.getBerthstatus().equals("1")){ | ||
84 | - eqpLogRequest.setBerthState("1");//泊位状态 1- 占用 | ||
85 | - } | ||
86 | - eqpLogRequest.setElectricity(request.getElectricity()); | ||
87 | - eqpLogRequest.setVoltag(request.getVoltage()); | ||
88 | - | ||
89 | - BizResult<Map<String, String>> result = eqpBerthsService.synEqpInfo(eqpLogRequest); | ||
90 | - return result; | ||
91 | - } | ||
92 | - | ||
93 | - @ApiOperation("设备心跳信息同步") | ||
94 | - @RequestMapping(value = "/synEqpHeartBeatInfo",method = RequestMethod.POST) | ||
95 | - public BizResult<Map<String, String>> synEqpHeartBeatInfo(@RequestBody String param){ | ||
96 | - logger.info("同步入参:" + param); | ||
97 | - | ||
98 | - JSONObject jsonObject = JSONObject.parseObject(param); | ||
99 | - String reqList = jsonObject.getString("pushdata"); | ||
100 | - JSONArray jsonArray = JSON.parseArray(reqList); | ||
101 | - EqpHeartBeatRequest request = JSON.parseObject(jsonArray.getString(0),EqpHeartBeatRequest.class); | ||
102 | - BaseInfo info = new BaseInfo(); | ||
103 | - request.setBaseRequest(info); | ||
104 | - request.setSysCode(sysCode); | ||
105 | - | ||
106 | - //数据转换 | ||
107 | - EqpLogRequest eqpLogRequest = new EqpLogRequest(); | ||
108 | - BeanUtils.copyProperties(request, eqpLogRequest); | ||
109 | - eqpLogRequest.setEqpNo(request.getEquipmentCode()); | ||
110 | - if(request.getEquipmentType().equals("1")){ | ||
111 | - eqpLogRequest.setEqpType(4);//设备类型 4-车检器 | ||
112 | - } | ||
113 | - if(request.getEquipmentType().equals("2")){ | ||
114 | - eqpLogRequest.setEqpType(5);//设备类型 5-网关 | ||
115 | - } | ||
116 | - if(request.getEquipmentType().equals("3")){ | ||
117 | - eqpLogRequest.setEqpType(6);//设备类型 6-中继器 | ||
118 | - } | ||
119 | - if(request.getEquipmentStatus().equals("1")){ | ||
120 | - eqpLogRequest.setEqpStatus("1");//设备状态 1-正常 | ||
121 | - } | ||
122 | - if(request.getEquipmentStatus().equals("2")){ | ||
123 | - eqpLogRequest.setEqpStatus("0");//设备状态 0-故障 | ||
124 | - } | ||
125 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); | ||
126 | - Date date; | ||
127 | - try { | ||
128 | - date = sdf.parse(request.getPushTime()); | ||
129 | - eqpLogRequest.setHeartbeatTime(date); | ||
130 | - } catch (ParseException e) { | ||
131 | - e.printStackTrace(); | ||
132 | - } | ||
133 | - BizResult<Map<String, String>> result = eqpBerthsService.synEqpInfo(eqpLogRequest); | ||
134 | - return result; | ||
135 | - } | ||
136 | - | ||
137 | -} |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BillManageController.java
@@ -3,7 +3,6 @@ package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic; | @@ -3,7 +3,6 @@ package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic; | ||
3 | import java.math.BigDecimal; | 3 | import java.math.BigDecimal; |
4 | import java.text.SimpleDateFormat; | 4 | import java.text.SimpleDateFormat; |
5 | import java.util.ArrayList; | 5 | import java.util.ArrayList; |
6 | -import java.util.Date; | ||
7 | import java.util.List; | 6 | import java.util.List; |
8 | import java.util.Map; | 7 | import java.util.Map; |
9 | 8 | ||
@@ -15,13 +14,13 @@ import org.slf4j.Logger; | @@ -15,13 +14,13 @@ import org.slf4j.Logger; | ||
15 | import org.slf4j.LoggerFactory; | 14 | import org.slf4j.LoggerFactory; |
16 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
17 | import org.springframework.stereotype.Controller; | 16 | import org.springframework.stereotype.Controller; |
17 | +import org.springframework.util.CollectionUtils; | ||
18 | import org.springframework.web.bind.annotation.PostMapping; | 18 | import org.springframework.web.bind.annotation.PostMapping; |
19 | import org.springframework.web.bind.annotation.RequestBody; | 19 | import org.springframework.web.bind.annotation.RequestBody; |
20 | import org.springframework.web.bind.annotation.RequestMapping; | 20 | import org.springframework.web.bind.annotation.RequestMapping; |
21 | import org.springframework.web.bind.annotation.RequestMethod; | 21 | import org.springframework.web.bind.annotation.RequestMethod; |
22 | +import org.springframework.web.bind.annotation.RequestParam; | ||
22 | import org.springframework.web.bind.annotation.ResponseBody; | 23 | import org.springframework.web.bind.annotation.ResponseBody; |
23 | - | ||
24 | -import com.alibaba.dubbo.common.utils.StringUtils; | ||
25 | import com.alibaba.fastjson.JSONArray; | 24 | import com.alibaba.fastjson.JSONArray; |
26 | import com.alibaba.fastjson.JSONObject; | 25 | import com.alibaba.fastjson.JSONObject; |
27 | import com.clouds.common.constants.SessionEnum; | 26 | import com.clouds.common.constants.SessionEnum; |
@@ -30,7 +29,6 @@ import com.clouds.common.utils.excle.ExcelUtil; | @@ -30,7 +29,6 @@ import com.clouds.common.utils.excle.ExcelUtil; | ||
30 | import com.clouds.common.utils.excle.ExcleFillDateManager; | 29 | import com.clouds.common.utils.excle.ExcleFillDateManager; |
31 | import com.clouds.common.utils.excle.Layouter; | 30 | import com.clouds.common.utils.excle.Layouter; |
32 | import com.clouds.common.web.BizController; | 31 | import com.clouds.common.web.BizController; |
33 | -import com.clouds.common.web.SessionCommUtil; | ||
34 | import com.clouds.common.web.vo.BizResultVO; | 32 | import com.clouds.common.web.vo.BizResultVO; |
35 | import com.zteits.clouds.api.apibase.bean.BizResult; | 33 | import com.zteits.clouds.api.apibase.bean.BizResult; |
36 | import com.zteits.clouds.api.apibase.bean.PageBean; | 34 | import com.zteits.clouds.api.apibase.bean.PageBean; |
@@ -39,7 +37,6 @@ import com.zteits.clouds.api.dto.clouds.param.BillQueryRequest; | @@ -39,7 +37,6 @@ import com.zteits.clouds.api.dto.clouds.param.BillQueryRequest; | ||
39 | import com.zteits.clouds.api.dto.pay.param.TdCompanyParkQueryRequest; | 37 | import com.zteits.clouds.api.dto.pay.param.TdCompanyParkQueryRequest; |
40 | import com.zteits.clouds.api.service.clouds.BillManageForDayService; | 38 | import com.zteits.clouds.api.service.clouds.BillManageForDayService; |
41 | import com.zteits.clouds.api.service.pay.TdCustCompanyService; | 39 | import com.zteits.clouds.api.service.pay.TdCustCompanyService; |
42 | -import com.zteits.irain.portal.vo.parkinglotcloudplatform.datastatistic.CustIncomeTotalVO; | ||
43 | 40 | ||
44 | import io.swagger.annotations.Api; | 41 | import io.swagger.annotations.Api; |
45 | import io.swagger.annotations.ApiOperation; | 42 | import io.swagger.annotations.ApiOperation; |
@@ -71,16 +68,10 @@ public class BillManageController extends BizController { | @@ -71,16 +68,10 @@ public class BillManageController extends BizController { | ||
71 | @Autowired | 68 | @Autowired |
72 | private TdCustCompanyService tdCustCompanyService; | 69 | private TdCustCompanyService tdCustCompanyService; |
73 | 70 | ||
74 | - @Autowired | ||
75 | - private SessionCommUtil sessionCommUtil; | ||
76 | - | ||
77 | - @Autowired | ||
78 | - private Map<String,TdCustCompanyService> map; | ||
79 | - | ||
80 | - private SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
81 | 71 | ||
82 | @ApiOperation("日账统计图汇总") | 72 | @ApiOperation("日账统计图汇总") |
83 | @PostMapping("/queryBillforDayTotal") | 73 | @PostMapping("/queryBillforDayTotal") |
74 | + @ResponseBody | ||
84 | public BizResultVO<BillManageDTO> queryBillforDayTotal(@RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, | 75 | public BizResultVO<BillManageDTO> queryBillforDayTotal(@RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, |
85 | HttpServletResponse response){ | 76 | HttpServletResponse response){ |
86 | BizResult<BillManageDTO> result = billManageForDayService.queryBillforDayTotal(billQueryRequest); | 77 | BizResult<BillManageDTO> result = billManageForDayService.queryBillforDayTotal(billQueryRequest); |
@@ -92,59 +83,13 @@ public class BillManageController extends BizController { | @@ -92,59 +83,13 @@ public class BillManageController extends BizController { | ||
92 | @ResponseBody | 83 | @ResponseBody |
93 | public void queryBillforDayTotalForPage(@RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, | 84 | public void queryBillforDayTotalForPage(@RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, |
94 | HttpServletResponse response) throws Exception { | 85 | HttpServletResponse response) throws Exception { |
95 | - TdCustCompanyService sert = map.get("tdCustCompanyService"); | ||
96 | logger.info("---begin--日账汇总单查询调用后场dubbo服务,入参={}", JSONObject.toJSON(billQueryRequest)); | 86 | logger.info("---begin--日账汇总单查询调用后场dubbo服务,入参={}", JSONObject.toJSON(billQueryRequest)); |
97 | - System.out.println("seesionId="+request.getSession().getId()); | ||
98 | - UserInfo userInfo = sessionCommUtil.getUserInfo(); | ||
99 | - logger.info("从session中获取的用户信息={}" + JSONObject.toJSONString(userInfo)); | ||
100 | - TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
101 | - if (userInfo != null) { | ||
102 | - | ||
103 | - tdCompanyParkQueryRequest.setSysCode(billQueryRequest.getSysCode()); | ||
104 | - tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
105 | - tdCompanyParkQueryRequest.setSessionId(request.getSession().getId()); | ||
106 | - billQueryRequest.setParkIdList(userInfo.getOrgIds()); | ||
107 | - } | ||
108 | - | ||
109 | BizResult<PageBean<BillManageDTO>> result = billManageForDayService.queryBillforDayTotalForPage(billQueryRequest); | 87 | BizResult<PageBean<BillManageDTO>> result = billManageForDayService.queryBillforDayTotalForPage(billQueryRequest); |
110 | - result.setErrMsg(billQueryRequest.getParkIdList().toString()); | ||
111 | logger.info("---end--日账汇总单查询调用后场dubbo服务,结果={}", JSONObject.toJSONString(result)); | 88 | logger.info("---end--日账汇总单查询调用后场dubbo服务,结果={}", JSONObject.toJSONString(result)); |
112 | this.returnJsonDataGrid(response, result); | 89 | this.returnJsonDataGrid(response, result); |
113 | } | 90 | } |
114 | 91 | ||
115 | - | ||
116 | 92 | ||
117 | - /** | ||
118 | - * 查询日账单.<br/> | ||
119 | - * | ||
120 | - * @param request | ||
121 | - * @param response | ||
122 | - * @throws Exception | ||
123 | - */ | ||
124 | - @ApiOperation("日账单查看") | ||
125 | - @RequestMapping(value = "/queryBillForDay", method = RequestMethod.POST) | ||
126 | - @ResponseBody | ||
127 | - public void queryBillForDay(@RequestBody BillQueryRequest billQueryRequest, HttpServletRequest request, | ||
128 | - HttpServletResponse response) throws Exception { | ||
129 | - BizResult<PageBean<BillManageDTO>> result = new BizResult<PageBean<BillManageDTO>>(); | ||
130 | - logger.info("---begin---日账单查看调用后场dubbo服务,入参={}", JSONObject.toJSONString(billQueryRequest)); | ||
131 | - TdCompanyParkQueryRequest tdCompanyParkQueryRequest = new TdCompanyParkQueryRequest(); | ||
132 | - UserInfo userInfo = (UserInfo) request.getSession().getAttribute(SessionEnum.USER_INFO.key()); | ||
133 | - logger.info("从session中获取的用户信息={}" + JSONObject.toJSONString(userInfo)); | ||
134 | - if (userInfo != null) { | ||
135 | - | ||
136 | - tdCompanyParkQueryRequest.setSysCode(billQueryRequest.getSysCode()); | ||
137 | - tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); | ||
138 | - tdCompanyParkQueryRequest.setSessionId(request.getSession().getId()); | ||
139 | - billQueryRequest.setUserName(userInfo.getName()); | ||
140 | - billQueryRequest.setParkIdList(this.queryParkNoByCustIds(tdCompanyParkQueryRequest)); | ||
141 | - | ||
142 | - } | ||
143 | - result = billManageForDayService.queryBillforDayDeatilPage(billQueryRequest); | ||
144 | - logger.info("---end---日账单查看调用后场dubbo服务,结果={}", JSONObject.toJSON(result)); | ||
145 | - | ||
146 | - this.returnJsonDataGrid(response, result); | ||
147 | - } | ||
148 | 93 | ||
149 | /** | 94 | /** |
150 | * 获取登录用户信息.<br/> | 95 | * 获取登录用户信息.<br/> |
@@ -171,94 +116,47 @@ public class BillManageController extends BizController { | @@ -171,94 +116,47 @@ public class BillManageController extends BizController { | ||
171 | * @throws Exception | 116 | * @throws Exception |
172 | */ | 117 | */ |
173 | @RequestMapping("/exportToExcleForBillForDay") | 118 | @RequestMapping("/exportToExcleForBillForDay") |
174 | - public void exportToExcleForBillForDay(String sysCode, String beginTime, String endTime, String aliTotalFee , | ||
175 | - String aliDealCount,String wxTotalFee,String wxDealCount,String cashTotalFee,String cashDealCount, | ||
176 | - String orderTotalFee,String orderDealCount, | ||
177 | - HttpServletRequest request,String parkIds,String userName, | ||
178 | - HttpServletResponse response) throws Exception { | ||
179 | - | ||
180 | - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
181 | - //获取session中的用户信息 | ||
182 | - UserInfo userInfo = sessionCommUtil.getUserInfo(); | ||
183 | - BillQueryRequest billQueryRequest = new BillQueryRequest(); | ||
184 | - | ||
185 | - billQueryRequest.setBeginTime(format.parse(beginTime)); | ||
186 | - billQueryRequest.setEndTime(format.parse(endTime)); | ||
187 | - billQueryRequest.setSysCode(sysCode); | 119 | + public void exportToExcleForBillForDay(@RequestParam String beginTime,@RequestParam String endTime,@RequestParam List<String> parkIdList, |
120 | + HttpServletRequest request,HttpServletResponse response) throws Exception { | ||
121 | + SimpleDateFormat format_yyy = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
122 | + BillQueryRequest billQueryRequest = new BillQueryRequest(); | ||
123 | + billQueryRequest.setSysCode("1001"); | ||
188 | billQueryRequest.getBaseRequest().setPageSize(0); | 124 | billQueryRequest.getBaseRequest().setPageSize(0); |
189 | - List<String> parkList= new ArrayList<String>(); | ||
190 | - if(StringUtils.isNotEmpty(parkIds)){ | ||
191 | - for(String str :parkIds.split(",")){ | ||
192 | - if(StringUtils.isNotEmpty(str)){ | ||
193 | - parkList.add(str.trim()); | ||
194 | - } | ||
195 | - } | ||
196 | - } | ||
197 | - billQueryRequest.setParkIdList(parkList); | ||
198 | - /**查询日账单汇总信息.*/ | ||
199 | - BizResult<PageBean<BillManageDTO>> result = billManageForDayService.queryBillforDayDeatilPage(billQueryRequest); | ||
200 | - String[] titleOne = new String[2]; | ||
201 | - titleOne[0] = "用户: " + (StringUtils.isNotEmpty(userName) ? userName : ""); | ||
202 | - titleOne[1] = "时间: "+beginTime+" "+endTime; | ||
203 | - String[] titleTwo = new String[] {"","现金", "微信", "支付宝", "合计"}; | ||
204 | - String[] titleThree = new String[] { "停车场名称", "现金", "微信", "支付宝", "合计"}; | ||
205 | - String sheetName = "日账单"; | ||
206 | - String fileName = "日账单管理" + format.format(new Date()); | ||
207 | - | ||
208 | - | 125 | + billQueryRequest.setParkIdList(parkIdList); |
126 | + billQueryRequest.setBeginTime(format_yyy.parse(beginTime)); | ||
127 | + billQueryRequest.setEndTime(format_yyy.parse(endTime)); | ||
128 | + BizResult<PageBean<BillManageDTO>> result = billManageForDayService.queryBillforDayTotalForPage(billQueryRequest); | ||
129 | + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | ||
130 | + String[] title = new String[]{"时间","停车场名称","现金(元)","支付宝(元)","微信(元)","总收入(元)"}; | ||
131 | + String sheetName="日账单"; | ||
132 | + String fileName = "日账单"; | ||
209 | // 1.创建excel信息 | 133 | // 1.创建excel信息 |
210 | XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); | 134 | XSSFSheet workSheet = ExcelUtil.createExcel(sheetName); |
211 | // 2.设置excel表头和表体 | 135 | // 2.设置excel表头和表体 |
212 | - Layouter.buildBillForDay(workSheet, titleOne, 0, 0);//创建第一行标题 | ||
213 | - Layouter.buildHeaders(workSheet, titleTwo, 0, 0);//创建第2行标题 | ||
214 | - Layouter.buildHeaders(workSheet, titleThree, 3, 0);//创建第3行标题 | ||
215 | - // 3.填充数据 | ||
216 | - List<Object[]> contentListTwo = new ArrayList<Object[]>(); | ||
217 | - for(int i = 0;i<2;i++){ | ||
218 | - Object[] str = new Object[titleTwo.length]; | ||
219 | - if(i == 0){ | ||
220 | - str[0] = "交易笔数"; | ||
221 | - str[1] = (cashDealCount == null ? "0" : cashDealCount); | ||
222 | - str[2] = (wxDealCount== null ? "0" : wxDealCount); | ||
223 | - str[3] = (aliDealCount== null ? "0" : aliDealCount); | ||
224 | - str[4] = (orderDealCount== null ? "0" : orderDealCount); | ||
225 | - }else{ | ||
226 | - str[0] = "总收入(元)"; | ||
227 | - str[1] = (cashTotalFee == null ? "0" : new BigDecimal(cashTotalFee).divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
228 | - str[2] = (wxTotalFee== null ? "0" : new BigDecimal(wxTotalFee).divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
229 | - str[3] = (aliTotalFee== null ? "0" : new BigDecimal(aliTotalFee).divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
230 | - str[4] = (orderTotalFee== null ? "0" : new BigDecimal(orderTotalFee).divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
231 | - } | ||
232 | - contentListTwo.add(str); | ||
233 | - } | ||
234 | - ExcleFillDateManager fillUserManagerTwo = new ExcleFillDateManager(); | ||
235 | - fillUserManagerTwo.fillSalesOrga(workSheet, titleTwo, contentListTwo, 2); //第2行标题 | ||
236 | - | ||
237 | - // | ||
238 | - List<Object[]> contentList = new ArrayList<Object[]>(); | ||
239 | - if(result != null && result.getData() != null){ | 136 | + Layouter.buildReport(workSheet,title,0, 0); |
137 | + //3.填充数据 | ||
138 | + List<Object[]> contentList=new ArrayList<Object[]>(); | ||
139 | + if(result != null && !CollectionUtils.isEmpty(result.getData().getDataList())){ | ||
240 | List<BillManageDTO> list = result.getData().getDataList(); | 140 | List<BillManageDTO> list = result.getData().getDataList(); |
241 | - if(list != null && list.size()>0){ | ||
242 | - for (int i = 0; i < list.size(); i++) { | ||
243 | - BillManageDTO e = list.get(i); | ||
244 | - Object[] obj = new Object[titleThree.length]; | ||
245 | - int index = 0; | ||
246 | - obj[index++] = e.getParkName(); | ||
247 | - obj[index++] = (e.getCashTotalFee()== null ? "0" : e.getCashTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
248 | - obj[index++] = (e.getWxTotalFee()== null ? "0" : e.getWxTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
249 | - obj[index++] = (e.getAliTotalFee()== null ? "0" : e.getAliTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
250 | - obj[index++] = (e.getAliTotalFee()== null ? "0" : e.getAliTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
251 | - contentList.add(obj); | 141 | + for (BillManageDTO e: list) { |
142 | + if(e != null){ | ||
143 | + Object[] obj=new Object[title.length]; | ||
144 | + int index=0; | ||
145 | + obj[index++]=(e.getBillDayTime() != null ? format.format(e.getBillDayTime()) : ""); | ||
146 | + obj[index++]=e.getParkName(); | ||
147 | + obj[index++]=(e.getCashTotalFee() == null ? "0" : e.getCashTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
148 | + obj[index++]=(e.getAliTotalFee() == null ? "0" : e.getAliTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
149 | + obj[index++]=(e.getWxTotalFee() == null ? "0" : e.getWxTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
150 | + obj[index++]=(e.getOrderTotalFee() == null ? "0" : e.getOrderTotalFee().divide(new BigDecimal("100"),2, BigDecimal.ROUND_HALF_UP)) ; | ||
151 | + contentList.add(obj); | ||
252 | } | 152 | } |
253 | } | 153 | } |
254 | } | 154 | } |
255 | - | ||
256 | - ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | ||
257 | - fillUserManager.fillSalesOrga(workSheet, titleThree, contentList, 5); | 155 | + ExcleFillDateManager fillUserManager=new ExcleFillDateManager(); |
156 | + fillUserManager.fillSalesOrga(workSheet,title,contentList,2); | ||
258 | // 4.excel输出配置 | 157 | // 4.excel输出配置 |
259 | ExcelUtil.write(response, workSheet, fileName); | 158 | ExcelUtil.write(response, workSheet, fileName); |
260 | 159 | ||
261 | - | ||
262 | } | 160 | } |
263 | 161 | ||
264 | /** | 162 | /** |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/CloudsParDurationController.java
0 → 100644
1 | +package com.zteits.irain.portal.web.parkinglotcloudplatform.datastatistic; | ||
2 | + | ||
3 | +import java.util.List; | ||
4 | + | ||
5 | +import javax.servlet.http.HttpServletRequest; | ||
6 | +import javax.servlet.http.HttpServletResponse; | ||
7 | + | ||
8 | +import org.springframework.beans.factory.annotation.Autowired; | ||
9 | +import org.springframework.web.bind.annotation.PostMapping; | ||
10 | +import org.springframework.web.bind.annotation.RequestBody; | ||
11 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
12 | +import org.springframework.web.bind.annotation.RestController; | ||
13 | + | ||
14 | +import com.clouds.common.web.BizController; | ||
15 | +import com.clouds.common.web.vo.BizResultVO; | ||
16 | +import com.zteits.clouds.api.apibase.bean.BizResult; | ||
17 | +import com.zteits.clouds.api.apibase.bean.PageBean; | ||
18 | +import com.zteits.clouds.api.dto.clouds.dto.ParkDurationDTO; | ||
19 | +import com.zteits.clouds.api.dto.clouds.param.ParkDurationRequest; | ||
20 | +import com.zteits.clouds.api.service.clouds.CloudsParDurationService; | ||
21 | + | ||
22 | +import io.swagger.annotations.Api; | ||
23 | +import io.swagger.annotations.ApiOperation; | ||
24 | +@Api(value = "企业云平台-停车时长", description = "企业云平台-停车时长") | ||
25 | +@RestController | ||
26 | +@RequestMapping("/parkDuration") | ||
27 | +public class CloudsParDurationController extends BizController{ | ||
28 | + | ||
29 | + @Autowired | ||
30 | + private CloudsParDurationService cloudsParDurationService; | ||
31 | + /** | ||
32 | + * 企业云平台->停车时长折线图->按日.<br/> | ||
33 | + * @return | ||
34 | + */ | ||
35 | + @ApiOperation("企业云平台->停车时长折线图->按日") | ||
36 | + @PostMapping("/queryEchartsForParkDurationForDay") | ||
37 | + public BizResultVO<List<ParkDurationDTO>> queryEchartsForParkDurationForDay(@RequestBody ParkDurationRequest parkDurationRequest){ | ||
38 | + BizResult<List<ParkDurationDTO>> result = cloudsParDurationService.queryEchartsForParkDurationForDay(parkDurationRequest); | ||
39 | + return new BizResultVO<List<ParkDurationDTO>>(result); | ||
40 | + } | ||
41 | + | ||
42 | + /** | ||
43 | + * 企业云平台->停车时长->分页.<br/> | ||
44 | + * @return | ||
45 | + */ | ||
46 | + @ApiOperation("企业云平台->停车时长->分页") | ||
47 | + @PostMapping("/queryEchartsForParkDurationDayForPage") | ||
48 | + public void queryEchartsForParkDurationDayForPage(@RequestBody ParkDurationRequest parkDurationRequest,HttpServletRequest request, | ||
49 | + HttpServletResponse response){ | ||
50 | + BizResult<PageBean<ParkDurationDTO>> result = cloudsParDurationService.queryEchartsForParkDurationDayForPage(parkDurationRequest); | ||
51 | + this.returnJsonDataGrid(response, result); | ||
52 | + } | ||
53 | + | ||
54 | + | ||
55 | +} |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/MonthBillManagementController.java
@@ -355,7 +355,7 @@ public class MonthBillManagementController extends BizController { | @@ -355,7 +355,7 @@ public class MonthBillManagementController extends BizController { | ||
355 | yearMonthCardStatisticRequest.setSysCode(sysCode); | 355 | yearMonthCardStatisticRequest.setSysCode(sysCode); |
356 | yearMonthCardStatisticRequest.setBeginTime(DateUtil.to_date(beginTime, DateUtil.DATETIME_FORMAT)); | 356 | yearMonthCardStatisticRequest.setBeginTime(DateUtil.to_date(beginTime, DateUtil.DATETIME_FORMAT)); |
357 | yearMonthCardStatisticRequest.setEndTime(DateUtil.to_date(endTime, DateUtil.DATETIME_FORMAT)); | 357 | yearMonthCardStatisticRequest.setEndTime(DateUtil.to_date(endTime, DateUtil.DATETIME_FORMAT)); |
358 | - yearMonthCardStatisticRequest.setParkIdList(parkIdList); | 358 | + yearMonthCardStatisticRequest.setPlNos(parkIdList); |
359 | yearMonthCardStatisticRequest.setBaseRequest(new BaseInfo(1, 0)); | 359 | yearMonthCardStatisticRequest.setBaseRequest(new BaseInfo(1, 0)); |
360 | /** 查询月账单年卡月卡. */ | 360 | /** 查询月账单年卡月卡. */ |
361 | result = yearMonthCardStatisticService.queryYearMonthCardStatistic(yearMonthCardStatisticRequest); | 361 | result = yearMonthCardStatisticService.queryYearMonthCardStatistic(yearMonthCardStatisticRequest); |
@@ -377,43 +377,43 @@ public class MonthBillManagementController extends BizController { | @@ -377,43 +377,43 @@ public class MonthBillManagementController extends BizController { | ||
377 | if (CollectionUtils.isNotEmpty(result.getData().getDataList())) { | 377 | if (CollectionUtils.isNotEmpty(result.getData().getDataList())) { |
378 | list = result.getData().getDataList(); | 378 | list = result.getData().getDataList(); |
379 | } | 379 | } |
380 | - for (YearMonthCardStatisticDTO e : list) { | ||
381 | - Object[] obj = new Object[title.length]; | ||
382 | - int index = 0; | ||
383 | - obj[index++] = StringUtils.isNotEmpty(e.getOrderId()) ? e.getOrderId() : ""; | ||
384 | - obj[index++] = e.getPayFinishTime() != null | ||
385 | - ? DateUtil.getDateString(e.getPayFinishTime(), DateUtil.DATETIME_FORMAT) : ""; | ||
386 | - String yearOrMonthCard = ""; | ||
387 | - if (null != e.getOrderType()) { | ||
388 | - if (2 == e.getOrderType()) { | ||
389 | - yearOrMonthCard = "年卡"; | ||
390 | - obj[index++] = yearOrMonthCard; | ||
391 | - } else if (3 == e.getOrderType()) { | ||
392 | - yearOrMonthCard = "月卡"; | ||
393 | - obj[index++] = yearOrMonthCard; | ||
394 | - } | ||
395 | - } else { | ||
396 | - obj[index++] = ""; | ||
397 | - } | ||
398 | - obj[index++] = StringUtils.isNotEmpty(e.getParkName()) ? e.getParkName() + yearOrMonthCard : ""; | ||
399 | - | ||
400 | - obj[index++] = StringUtils.isNotEmpty(e.getCarNumber()) ? e.getCarNumber() : ""; | ||
401 | - | ||
402 | - obj[index++] = e.getAmount() != null ? AmountUtils.changeF2Y(e.getAmount().longValue()) : "0.00"; | ||
403 | - String effDate = ""; | ||
404 | - String expDate = ""; | ||
405 | - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | ||
406 | - if (null != e.getEffDate()) { | ||
407 | - effDate = format.format(e.getEffDate()); | ||
408 | - } | ||
409 | - if (null != e.getExpDate()) { | ||
410 | - expDate = format.format(e.getExpDate()); | ||
411 | - } | ||
412 | - | ||
413 | - obj[index++] = effDate + " - " + expDate; | ||
414 | - | ||
415 | - contentList.add(obj); | ||
416 | - } | 380 | +// for (YearMonthCardStatisticDTO e : list) { |
381 | +// Object[] obj = new Object[title.length]; | ||
382 | +// int index = 0; | ||
383 | +// obj[index++] = StringUtils.isNotEmpty(e.getOrderId()) ? e.getOrderId() : ""; | ||
384 | +// obj[index++] = e.getPayFinishTime() != null | ||
385 | +// ? DateUtil.getDateString(e.getPayFinishTime(), DateUtil.DATETIME_FORMAT) : ""; | ||
386 | +// String yearOrMonthCard = ""; | ||
387 | +// if (null != e.getOrderType()) { | ||
388 | +// if (2 == e.getOrderType()) { | ||
389 | +// yearOrMonthCard = "年卡"; | ||
390 | +// obj[index++] = yearOrMonthCard; | ||
391 | +// } else if (3 == e.getOrderType()) { | ||
392 | +// yearOrMonthCard = "月卡"; | ||
393 | +// obj[index++] = yearOrMonthCard; | ||
394 | +// } | ||
395 | +// } else { | ||
396 | +// obj[index++] = ""; | ||
397 | +// } | ||
398 | +// obj[index++] = StringUtils.isNotEmpty(e.getParkName()) ? e.getParkName() + yearOrMonthCard : ""; | ||
399 | +// | ||
400 | +// obj[index++] = StringUtils.isNotEmpty(e.getCarNumber()) ? e.getCarNumber() : ""; | ||
401 | +// | ||
402 | +// obj[index++] = e.getAmount() != null ? AmountUtils.changeF2Y(e.getAmount().longValue()) : "0.00"; | ||
403 | +// String effDate = ""; | ||
404 | +// String expDate = ""; | ||
405 | +// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); | ||
406 | +// if (null != e.getEffDate()) { | ||
407 | +// effDate = format.format(e.getEffDate()); | ||
408 | +// } | ||
409 | +// if (null != e.getExpDate()) { | ||
410 | +// expDate = format.format(e.getExpDate()); | ||
411 | +// } | ||
412 | +// | ||
413 | +// obj[index++] = effDate + " - " + expDate; | ||
414 | +// | ||
415 | +// contentList.add(obj); | ||
416 | +// } | ||
417 | 417 | ||
418 | ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); | 418 | ExcleFillDateManager fillUserManager = new ExcleFillDateManager(); |
419 | fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); | 419 | fillUserManager.fillSalesOrga(workSheet, title, contentList, 2); |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/YearMonthCardStatisticController.java
@@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletRequest; | @@ -9,6 +9,7 @@ import javax.servlet.http.HttpServletRequest; | ||
9 | import javax.servlet.http.HttpServletResponse; | 9 | import javax.servlet.http.HttpServletResponse; |
10 | 10 | ||
11 | import com.alibaba.dubbo.common.utils.CollectionUtils; | 11 | import com.alibaba.dubbo.common.utils.CollectionUtils; |
12 | +import com.alibaba.dubbo.common.utils.StringUtils; | ||
12 | import com.alibaba.fastjson.JSON; | 13 | import com.alibaba.fastjson.JSON; |
13 | 14 | ||
14 | import com.clouds.common.utils.excle.ExcelUtil; | 15 | import com.clouds.common.utils.excle.ExcelUtil; |
@@ -100,8 +101,8 @@ public class YearMonthCardStatisticController extends BizController { | @@ -100,8 +101,8 @@ public class YearMonthCardStatisticController extends BizController { | ||
100 | @ApiOperation("导出年卡月卡统计excel") | 101 | @ApiOperation("导出年卡月卡统计excel") |
101 | @GetMapping("exportYearMonthStatisticExcel") | 102 | @GetMapping("exportYearMonthStatisticExcel") |
102 | public void exportYearMonthStatisticExcel(@RequestParam Long beginTime, @RequestParam Long endTime, | 103 | public void exportYearMonthStatisticExcel(@RequestParam Long beginTime, @RequestParam Long endTime, |
103 | - @RequestParam List<String> parkIdList, @RequestParam String parkNames, | ||
104 | - Integer orderType, Integer payType, Integer dataState, | 104 | + @RequestParam List<String> plNos, |
105 | + Integer orderType, Integer dataState, | ||
105 | HttpServletRequest requests, HttpServletResponse response) throws Exception { | 106 | HttpServletRequest requests, HttpServletResponse response) throws Exception { |
106 | 107 | ||
107 | YearMonthCardStatisticRequest request = new YearMonthCardStatisticRequest(); | 108 | YearMonthCardStatisticRequest request = new YearMonthCardStatisticRequest(); |
@@ -109,20 +110,19 @@ public class YearMonthCardStatisticController extends BizController { | @@ -109,20 +110,19 @@ public class YearMonthCardStatisticController extends BizController { | ||
109 | request.setBeginTime(new Date(beginTime)); | 110 | request.setBeginTime(new Date(beginTime)); |
110 | request.setEndTime(new Date(endTime)); | 111 | request.setEndTime(new Date(endTime)); |
111 | 112 | ||
112 | - request.setParkIdList(parkIdList); | 113 | + request.setPlNos(plNos); |
113 | request.setBaseRequest(new BaseInfo(1, 0)); | 114 | request.setBaseRequest(new BaseInfo(1, 0)); |
114 | request.setOrderType(orderType); | 115 | request.setOrderType(orderType); |
115 | - request.setPayType(payType); | ||
116 | request.setDataState(dataState); | 116 | request.setDataState(dataState); |
117 | 117 | ||
118 | BizResult<PageBean<YearMonthCardStatisticDTO>> bizResult = yearMonthCardStatisticService | 118 | BizResult<PageBean<YearMonthCardStatisticDTO>> bizResult = yearMonthCardStatisticService |
119 | .queryYearMonthCardStatistic(request); | 119 | .queryYearMonthCardStatistic(request); |
120 | - BizResult<List<YearMonthCardStatisticSumDTO>> bizResultSum = yearMonthCardStatisticService | ||
121 | - .queryYearMonthCardStatisticSum(request); | 120 | +// BizResult<List<YearMonthCardStatisticSumDTO>> bizResultSum = yearMonthCardStatisticService |
121 | +// .queryYearMonthCardStatisticSum(request); | ||
122 | 122 | ||
123 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 123 | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
124 | SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); | 124 | SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); |
125 | - String[] title = new String[] {"交易时间", "停车场", "类型", "车牌号", "支付方式", "支付金额", "有效期", "状态"}; | 125 | + String[] title = new String[] {"购买日期", "类型", "车牌号", "停车场", "车主","手机号", "金额", "有效期", "状态"}; |
126 | String sheetName = "年卡月卡统计"; | 126 | String sheetName = "年卡月卡统计"; |
127 | String fileName = "年卡月卡统计" + format2.format(new Date()); | 127 | String fileName = "年卡月卡统计" + format2.format(new Date()); |
128 | 128 | ||
@@ -187,39 +187,21 @@ public class YearMonthCardStatisticController extends BizController { | @@ -187,39 +187,21 @@ public class YearMonthCardStatisticController extends BizController { | ||
187 | for (YearMonthCardStatisticDTO e : list) { | 187 | for (YearMonthCardStatisticDTO e : list) { |
188 | Object[] obj = new Object[title.length]; | 188 | Object[] obj = new Object[title.length]; |
189 | int index = 0; | 189 | int index = 0; |
190 | - obj[index++] = e.getPayFinishTime() != null ? format.format(e.getPayFinishTime()) : ""; | ||
191 | - obj[index++] = e.getParkName(); | 190 | + obj[index++] = e.getCreateTime() != null ? format.format(e.getCreateTime()) : ""; |
192 | String cardType=""; | 191 | String cardType=""; |
193 | if (null != e.getOrderType()) { | 192 | if (null != e.getOrderType()) { |
194 | - if (2 == e.getOrderType()) { | ||
195 | - cardType = "年卡"; | ||
196 | - }else{ | ||
197 | - cardType = "月卡"; | ||
198 | - } | 193 | + if (2 == e.getOrderType()) { |
194 | + cardType = "年卡"; | ||
195 | + }else{ | ||
196 | + cardType = "月卡"; | ||
197 | + } | ||
199 | } | 198 | } |
200 | obj[index++]=cardType; | 199 | obj[index++]=cardType; |
201 | obj[index++] = e.getCarNumber(); | 200 | obj[index++] = e.getCarNumber(); |
202 | - if (e.getPayType() != null) { | ||
203 | - switch (e.getPayType()) { | ||
204 | - case 1: | ||
205 | - obj[index++] = "支付宝"; | ||
206 | - break; | ||
207 | - case 2: | ||
208 | - obj[index++] = "微信"; | ||
209 | - break; | ||
210 | - case 3: | ||
211 | - obj[index++] = "银联"; | ||
212 | - break; | ||
213 | - case 4: | ||
214 | - obj[index++] = "微信"; | ||
215 | - break; | ||
216 | - default: | ||
217 | - obj[index++] = "现金"; | ||
218 | - break; | ||
219 | - } | ||
220 | - } else { | ||
221 | - obj[index++] = ""; | ||
222 | - } | 201 | + obj[index++] = e.getParkName(); |
202 | + obj[index++] = StringUtils.isEmpty(e.getCustName())?"":e.getCustName(); | ||
203 | + obj[index++] = StringUtils.isEmpty(e.getUserPhone())?"":e.getUserPhone(); | ||
204 | + | ||
223 | obj[index++] = e.getAmount() != null ? e.getAmount() : "0.00"; | 205 | obj[index++] = e.getAmount() != null ? e.getAmount() : "0.00"; |
224 | obj[index++] = e.getEffDate() != null ? format.format(e.getEffDate()) | 206 | obj[index++] = e.getEffDate() != null ? format.format(e.getEffDate()) |
225 | : "" + "-" + e.getExpDate() != null ? format.format(e.getExpDate()) : ""; | 207 | : "" + "-" + e.getExpDate() != null ? format.format(e.getExpDate()) : ""; |
src/main/resources/dubbo/dubbo-park-consumer.xml
@@ -143,4 +143,10 @@ | @@ -143,4 +143,10 @@ | ||
143 | version="${spring.dubbo.provider.version}" | 143 | version="${spring.dubbo.provider.version}" |
144 | timeout="30000"/> | 144 | timeout="30000"/> |
145 | 145 | ||
146 | + <!--企业云平台-停车时长统计 --> | ||
147 | + <dubbo:reference id="cloudsParDurationService" interface="com.zteits.clouds.api.service.clouds.CloudsParDurationService" | ||
148 | + version="${spring.dubbo.provider.version}" | ||
149 | + timeout="30000"/> | ||
150 | + | ||
151 | + | ||
146 | </beans> | 152 | </beans> |
147 | \ No newline at end of file | 153 | \ No newline at end of file |