Commit ef5fd078b3f5d42d7920bc6150fc80b33c95580d
1 parent
a7df42fc
提交
Showing
2 changed files
with
25 additions
and
51 deletions
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/BillManageController.java
| ... | ... | @@ -92,7 +92,7 @@ public class BillManageController extends BizController { |
| 92 | 92 | tdCompanyParkQueryRequest.setSysCode(billQueryRequest.getSysCode()); |
| 93 | 93 | tdCompanyParkQueryRequest.setCustIdList(userInfo.getOrgIds()); |
| 94 | 94 | tdCompanyParkQueryRequest.setSessionId(request.getSession().getId()); |
| 95 | - billQueryRequest.setParkIdList(this.queryParkNoByCustIds(tdCompanyParkQueryRequest)); | |
| 95 | + billQueryRequest.setParkIdList(userInfo.getOrgIds()); | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | BizResult<PageBean<BillManageDTO>> result = billManageForDayService.queryBillforDayTotalForPage(billQueryRequest); | ... | ... |
src/main/java/com/zteits/irain/portal/web/parkinglotcloudplatform/datastatistic/IndexPageStatisticController.java
| ... | ... | @@ -35,6 +35,7 @@ import com.zteits.clouds.api.apibase.bean.PageBean; |
| 35 | 35 | import com.zteits.clouds.api.dto.clouds.dto.CustIncomeForPayTypeDTO; |
| 36 | 36 | import com.zteits.clouds.api.dto.clouds.dto.CustIncomeTotalDTO; |
| 37 | 37 | import com.zteits.clouds.api.dto.clouds.dto.CustIncomeTotalParkDTO; |
| 38 | +import com.zteits.clouds.api.dto.clouds.dto.ParkingCountDTO; | |
| 38 | 39 | import com.zteits.clouds.api.dto.clouds.param.CustIncomeTotalQueryRequset; |
| 39 | 40 | import com.zteits.clouds.api.dto.park.dto.ParkingLotDTO; |
| 40 | 41 | import com.zteits.clouds.api.dto.park.dto.ParkingLotUseStatisticDTO; |
| ... | ... | @@ -93,7 +94,7 @@ public class IndexPageStatisticController extends BizController { |
| 93 | 94 | public BizResultVO<CustIncomeTotalVO> queryCustIncomeTotal( |
| 94 | 95 | @RequestBody CustIncomeTotalQueryRequset custIncomeTotalQueryRequset) |
| 95 | 96 | throws Exception { |
| 96 | - | |
| 97 | + logger.info("---begin企业云平台首页-实际收入查询,入参={}",JSONObject.toJSON(custIncomeTotalQueryRequset)); | |
| 97 | 98 | BizResultVO<CustIncomeTotalVO> bizResultVO = new BizResultVO<>(); |
| 98 | 99 | |
| 99 | 100 | BizResult<CustIncomeTotalDTO> result = cusIncomeService.queryCustIncomeTotal(custIncomeTotalQueryRequset); |
| ... | ... | @@ -110,13 +111,13 @@ public class IndexPageStatisticController extends BizController { |
| 110 | 111 | vo.setPayedTotalAmount(result.getData().getPayedTotalAmount().setScale(2, BigDecimal.ROUND_HALF_UP).toString()); |
| 111 | 112 | |
| 112 | 113 | bizResultVO.setData(vo); |
| 113 | - | |
| 114 | + logger.info("---end企业云平台首页-实际收入查询"); | |
| 114 | 115 | return bizResultVO; |
| 115 | 116 | } |
| 116 | 117 | |
| 117 | 118 | /** |
| 118 | 119 | * 云平台首页->企业客户负责某个停车收入情况.<br/> |
| 119 | - * | |
| 120 | + * | |
| 120 | 121 | * @return |
| 121 | 122 | * @throws Exception |
| 122 | 123 | */ |
| ... | ... | @@ -172,57 +173,20 @@ public class IndexPageStatisticController extends BizController { |
| 172 | 173 | |
| 173 | 174 | /** |
| 174 | 175 | * 云平台首页->企业客户负责某个停车不同的支付方式收入情况.<br/> |
| 175 | - * | |
| 176 | + * 说明: | |
| 177 | + * 1.2017-08-22将支付方式更改为饼图.<br/> | |
| 176 | 178 | * @return |
| 177 | 179 | * @throws Exception |
| 178 | 180 | */ |
| 179 | 181 | @ApiOperation("企业客户负责某个停车不同的支付方式收入情况") |
| 180 | 182 | @PostMapping("/queryCustIncomeForPayType") |
| 181 | - public BizResultVO<CustIncomeForPayTypeResVO> queryCustIncomeForPayType( | |
| 183 | + public BizResultVO<List<CustIncomeForPayTypeDTO>> queryCustIncomeForPayType( | |
| 182 | 184 | @RequestBody CustIncomeTotalQueryRequset custIncomeTotalQueryRequset) throws Exception { |
| 183 | - logger.info("调用后场dubbo服务,入参为: request={}", JSONObject.toJSONString(custIncomeTotalQueryRequset)); | |
| 185 | + logger.info("...begin企业客户负责某个停车不同的支付方式收入情况,入参为: request={}", JSONObject.toJSONString(custIncomeTotalQueryRequset)); | |
| 184 | 186 | BizResult<List<CustIncomeForPayTypeDTO>> result = cusIncomeService.queryCustIncomeForPayType( |
| 185 | 187 | custIncomeTotalQueryRequset); |
| 186 | - | |
| 187 | - logger.info("调用后场dubbo服务,响应为: result={}", JSONObject.toJSONString(result)); | |
| 188 | - //如果不成功 | |
| 189 | - if (!ResultUtils.isSuccess(result)) { | |
| 190 | - return new BizResultVO<>(result.getErrCode(), result.getErrMsg()); | |
| 191 | - } | |
| 192 | - List<CustIncomeForPayTypeDTO> data = result.getData(); | |
| 193 | - | |
| 194 | - CustIncomeForPayTypeResVO res = new CustIncomeForPayTypeResVO(); | |
| 195 | - res.addLegendData("费用", "占比"); | |
| 196 | - | |
| 197 | - BigDecimal total = BigDecimal.ZERO; | |
| 198 | - List<String> amount = new ArrayList<>(); | |
| 199 | - for (CustIncomeForPayTypeDTO dto : data) { | |
| 200 | - //添加X轴数据 | |
| 201 | - res.addXAxisData(dto.getPayTypeName()); | |
| 202 | - total = total.add(dto.getPayedTotalAmount()); | |
| 203 | - logger.info("返回的类型 和 数据为: payTypeName={},payedTotalAmount={},total={}", dto.getPayTypeName(), | |
| 204 | - dto.getPayedTotalAmount().toString(), total.toString()); | |
| 205 | - amount.add(dto.getPayedTotalAmount().setScale(2, BigDecimal.ROUND_HALF_UP) | |
| 206 | - .doubleValue() + ""); | |
| 207 | - } | |
| 208 | - //计算占比 | |
| 209 | - List<String> zb = new ArrayList<>(); | |
| 210 | - for (CustIncomeForPayTypeDTO dto : data) { | |
| 211 | - logger.info("计算占比 total={}", total.toString()); | |
| 212 | - if (BigDecimal.ZERO.equals(total) || total.doubleValue() == 0.00) { | |
| 213 | - zb.add("0.00"); | |
| 214 | - } else { | |
| 215 | - zb.add(dto.getPayedTotalAmount().divide(total, 4, RoundingMode.HALF_UP) | |
| 216 | - .multiply(new BigDecimal("100.00")).doubleValue() + ""); | |
| 217 | - } | |
| 218 | - | |
| 219 | - } | |
| 220 | - res.addChildData("费用", amount); | |
| 221 | - res.addChildData("占比", zb); | |
| 222 | - BizResultVO<CustIncomeForPayTypeResVO> resResult = new BizResultVO<>(); | |
| 223 | - resResult.setData(res); | |
| 224 | - logger.info("返回到前台的数据为: res={}", JSONObject.toJSONString(res)); | |
| 225 | - return resResult; | |
| 188 | + logger.info("...end企业客户负责某个停车不同的支付方式收入情况,响应为: result={}", JSONObject.toJSONString(result)); | |
| 189 | + return new BizResultVO<List<CustIncomeForPayTypeDTO>>(result); | |
| 226 | 190 | } |
| 227 | 191 | |
| 228 | 192 | /** |
| ... | ... | @@ -475,10 +439,20 @@ public class IndexPageStatisticController extends BizController { |
| 475 | 439 | } |
| 476 | 440 | } |
| 477 | 441 | |
| 478 | - public static void main(String[] args) { | |
| 479 | - BigDecimal m = BigDecimal.ZERO; | |
| 480 | - BigDecimal n = m.add(BigDecimal.TEN); | |
| 481 | - System.out.println(new BigDecimal("00.0").doubleValue() == 0); | |
| 442 | + /** | |
| 443 | + * 企业云平台首页-->停车次数统计(饼图).<br/> | |
| 444 | + * 说明:从订单表中统计(逃逸,免费,月卡年卡,临时)停车次数.<br/> | |
| 445 | + * @param custIncomeTotalQueryRequset | |
| 446 | + * @return | |
| 447 | + * @throws Exception | |
| 448 | + */ | |
| 449 | + @ApiOperation("企业云平台首页-->停车次数统计(饼图)") | |
| 450 | + @PostMapping("/queryParingCount") | |
| 451 | + public BizResultVO<List<ParkingCountDTO>> queryParingCount(@RequestBody CustIncomeTotalQueryRequset custIncomeTotalQueryRequset) throws Exception{ | |
| 452 | + logger.info("...begin停车次数统计->调用后场dubbo服务,入参为: request={}", JSONObject.toJSONString(custIncomeTotalQueryRequset)); | |
| 453 | + BizResult<List<ParkingCountDTO>> result =cusIncomeService.queryParingCount(custIncomeTotalQueryRequset); | |
| 454 | + logger.info("...end停车次数统计->调用后场dubbo服务..."); | |
| 455 | + return new BizResultVO<List<ParkingCountDTO>>(result); | |
| 482 | 456 | } |
| 483 | 457 | |
| 484 | 458 | } | ... | ... |