Merge remote-tracking branch 'origin/master'
| | |
| | | @TableField("serialnumber") |
| | | private String serialnumber; |
| | | |
| | | @TableField(exist = false) |
| | | private String parkName; |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R<Integer> getSalesCountByGoodsIdgetCount(Integer goodId, Integer goodeType, Integer buyType) { |
| | | return null; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R<List<String>> getCodeByOrderId(String goodsIds) { |
| | | return R.fail("根据订单ids查询现金购买优惠券订单编号:" + cause.getMessage()); |
| | | } |
| | |
| | | public R managementGiveVip(@RequestBody TGrantVip grantVip); |
| | | @GetMapping("/t-exchange-order/getSalesCountByGoodsIds/{goodsIds}") |
| | | R<List<Integer>> getSalesCountByGoodsId(@PathVariable("goodsIds") String goodsIds); |
| | | @GetMapping("/t-exchange-order/getCount") |
| | | R<Integer> getSalesCountByGoodsIdgetCount(@RequestParam("goodId") Integer goodId,@RequestParam("goodeType")Integer goodeType,@RequestParam("buyType")Integer buyType); |
| | | |
| | | /** |
| | | * 管理后台 根据t_app_coupon订单购买或者兑换优惠券的订单编号 |
| | |
| | | @TableField(exist = false) |
| | | private Integer useCount; |
| | | |
| | | @ApiModelProperty(value = "销量") |
| | | @TableField(exist = false) |
| | | private Integer salesCount; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | siteList.setPageSize(99999); |
| | | PageInfo<GetSiteListDTO> list = siteService.getSiteList(siteList); |
| | | for (GetSiteListDTO record : list.getRecords()) { |
| | | Long count = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); |
| | | List<Integer> c1 = new ArrayList<>(); |
| | | c1.add(3); |
| | | c1.add(4); |
| | | c1.add(5); |
| | | c1.add(6); |
| | | Long count = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, 2).count(); |
| | | record.setC1(count); |
| | | Long count1 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 1).eq(TChargingGun::getStatus, 2).count(); |
| | | Long count1 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 1).count(); |
| | | record.setC2(count1); |
| | | Long count2 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); |
| | | Long count2 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, 2).count(); |
| | | record.setK1(count2); |
| | | Long count3 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 2).eq(TChargingGun::getStatus, 2).count(); |
| | | Long count3 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 2).count(); |
| | | record.setK2(count3); |
| | | Long count4 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, new int[]{3, 4, 5, 6}).count(); |
| | | Long count4 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, 2).count(); |
| | | record.setM1(count4); |
| | | Long count5 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 3).eq(TChargingGun::getStatus, 2).count(); |
| | | Long count5 = chargingGunService.lambdaQuery().eq(TChargingGun::getSiteId, record.getId()).eq(TChargingGun::getChargeMode, 3).count(); |
| | | record.setM2(count5); |
| | | |
| | | //利用率 |
| | |
| | | @ApiOperation(value = "获取该充电站的利用率", tags = {"管理后台-数据分析-电站分析"}) |
| | | public R getPercentByCityCode(@RequestBody ChargingPercentProvinceDto chargingPercentProvinceDto){ |
| | | |
| | | if (chargingPercentProvinceDto.getDate1()==null){ |
| | | LocalDate today = LocalDate.now(); |
| | | LocalDate lastMonth = today.minusMonths(1); |
| | | LocalDate firstDayOfLastMonth = lastMonth.withDayOfMonth(1); |
| | | LocalDate lastDayOfLastMonth =lastMonth.withDayOfMonth(lastMonth.lengthOfMonth()); |
| | | chargingPercentProvinceDto.setDate1(firstDayOfLastMonth); |
| | | chargingPercentProvinceDto.setDate2(lastDayOfLastMonth); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | List<GetSiteListDTO> records = siteService.getSiteList(siteList).getRecords(); |
| | | List<Integer> collect = records.stream().map(GetSiteListDTO::getId).collect(Collectors.toList()); |
| | | // 通过时间段获取和充电桩id获取各个充电站的充电订单 |
| | | if (chargingPercentProvinceDto.getDate1().equals(chargingPercentProvinceDto.getDate2())){ |
| | | chargingPercentProvinceDto.setDate2(chargingPercentProvinceDto.getDate1().plusDays(1)); |
| | | } |
| | | List<ChargingOrderGroup> data = chargingOrderClient.getBySiteIdAndTime(chargingPercentProvinceDto).getData(); |
| | | // 计算利用率展示 |
| | | for (ChargingOrderGroup datum : data) { |
| | |
| | | bigDecimal1 = bigDecimal1.add(chargingPile.getRatedPower()); |
| | | } |
| | | |
| | | long daysBetween = ChronoUnit.DAYS.between(chargingPercentProvinceDto.getDate1(), chargingPercentProvinceDto.getDate2()) + 1; |
| | | long daysBetween = ChronoUnit.DAYS.between(chargingPercentProvinceDto.getDate1(), chargingPercentProvinceDto.getDate2()); |
| | | BigDecimal multiply = bigDecimal1.multiply(new BigDecimal("24")).multiply(BigDecimal.valueOf(daysBetween)); |
| | | //得到利用率 |
| | | BigDecimal divide = datum.getChargingCapacity().divide(multiply, 0, BigDecimal.ROUND_HALF_UP); |
| | |
| | | .page(Page.of(query.getPageCurr(), query.getPageSize())); |
| | | |
| | | for (TParkingRecord record : page.getRecords()) { |
| | | TParkingLot byId = parkingLotService.getById(record.getParkingLotId()); |
| | | record.setUid(record.getId().toString()); |
| | | if (byId!=null) { |
| | | record.setParkName(byId.getName()); |
| | | } |
| | | } |
| | | return R.ok(page); |
| | | } |
| | |
| | | } |
| | | } |
| | | // 时段总服务费 |
| | | BigDecimal bigDecimal = new BigDecimal("0"); |
| | | List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, strategyId).orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); |
| | | |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | for (TChargingOrderAccountingStrategy tChargingOrderAccountingStrategy : list) { |
| | | String format = tChargingOrderAccountingStrategy.getCreateTime().format(formatter); |
| | | tChargingOrderAccountingStrategy.setStartTime(format+" "+tChargingOrderAccountingStrategy.getStartTime()); |
| | | tChargingOrderAccountingStrategy.setEndTime(format+" "+tChargingOrderAccountingStrategy.getEndTime()); |
| | | if (byId.getVipDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){ |
| | | BigDecimal multiply = byId.getVipDiscountAmount().divide(byId.getServiceCharge(), 2) |
| | | .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | | tChargingOrderAccountingStrategy.setVipDiscount(multiply); |
| | | } |
| | | bigDecimal = bigDecimal.add(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | | |
| | | if (byId.getCouponDiscountAmount()!=null && byId.getServiceCharge().compareTo(BigDecimal.ZERO) != 0){ |
| | | BigDecimal multiply = byId.getCouponDiscountAmount().divide(byId.getServiceCharge(), 2) |
| | | .multiply(tChargingOrderAccountingStrategy.getPeriodOriginalServicePrice()); |
| | |
| | | tCharingUserMapVO.setMap(charMap); |
| | | tCharingUserMapVO.setMap1(charMap1); |
| | | }else { |
| | | |
| | | |
| | | List<Map<String,Object>> map = chargingOrderService.usersByQuery(statisticsQueryDto); |
| | | |
| | | |
| | |
| | | } |
| | | return R.ok(res); |
| | | } |
| | | |
| | | @GetMapping("/getCount") |
| | | public R<Integer> getCount(@RequestParam("goodId") Integer goodId,@RequestParam("goodeType")Integer goodeType,@RequestParam("buyType")Integer buyType){ |
| | | if (buyType==1){ |
| | | //现金 |
| | | if (goodeType==1){ |
| | | //商品 |
| | | Integer reduce = tShoppingOrderService.list(new QueryWrapper<TShoppingOrder>() |
| | | .eq("order_type",1) |
| | | .eq("goods_id", goodId) |
| | | .isNull("refund_status")) |
| | | .stream().map(TShoppingOrder::getPurchaseQuantity).reduce(0, Integer::sum); |
| | | return R.ok(reduce); |
| | | }else { |
| | | //优惠券 |
| | | Integer reduce = tShoppingOrderService.list(new QueryWrapper<TShoppingOrder>() |
| | | .eq("order_type",2) |
| | | .eq("coupon_id", goodId) |
| | | .isNull("refund_status")) |
| | | .stream().map(TShoppingOrder::getPurchaseQuantity).reduce(0, Integer::sum); |
| | | return R.ok(reduce); |
| | | } |
| | | |
| | | }else { |
| | | //兑换 |
| | | if (goodeType==1){ |
| | | Integer reduce = exchangeOrderService.list(new QueryWrapper<TExchangeOrder>().eq("order_type",1) |
| | | .ne("status",4).eq("goods_id", goodId)) |
| | | .stream().map(TExchangeOrder::getPurchaseQuantity).reduce(0, Integer::sum); |
| | | return R.ok(reduce); |
| | | }else { |
| | | Integer reduce = exchangeOrderService.list(new QueryWrapper<TExchangeOrder>().eq("order_type",2) |
| | | .ne("status",4).eq("coupon_id", goodId)) |
| | | .stream().map(TExchangeOrder::getPurchaseQuantity).reduce(0, Integer::sum); |
| | | return R.ok(reduce); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | /** |
| | | * 管理后台 根据t_app_coupon订单ids查询优惠券的订单编号 |
| | | * @param goodsIds 订单号-商品类型 |
| | |
| | | // todo 根据支付方式 取消订单 |
| | | byId.setCancellationId(userid); |
| | | byId.setCancellationTime(LocalDateTime.now()); |
| | | byId.setStatus(4); |
| | | byId.setStatus(5); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | TShoppingOrderRefund tShoppingOrderRefund = new TShoppingOrderRefund(); |
| | | tShoppingOrderRefund.setPayTime(byId.getPayTime()); |
| | |
| | | BigDecimal refundAmount = new BigDecimal("0"); |
| | | int orderCount = 0; |
| | | for (ChargingBillListVO chargingBillListVO : list) { |
| | | if (chargingBillListVO.getType()==2){ |
| | | continue; |
| | | } |
| | | String temp = ""; |
| | | String temp1 = ""; |
| | | switch (chargingBillListVO.getType()){ |
| | |
| | | } |
| | | if (data3!=null)tChargingOrder.setUserName(data3.getName()); |
| | | // 累加实收金额 支付结算金额 |
| | | if (tChargingOrder.getOrderAmount()!=null){ |
| | | paymentAmount = paymentAmount.add(tChargingOrder.getOrderAmount()); |
| | | if (tChargingOrder.getChargeAmount()!=null){ |
| | | paymentAmount = paymentAmount.add(tChargingOrder.getChargeAmount()); |
| | | } |
| | | // 入账金额 |
| | | // 总金额 |
| | | if (tChargingOrder.getOrderAmount()!=null){ |
| | | orderAmount = orderAmount.add(tChargingOrder.getOrderAmount()); |
| | | } |
| | |
| | | List<TChargingOrderRefund> list2 = chargingOrderRefundService.lambdaQuery().eq(TChargingOrderRefund::getRefundStatus, 2) |
| | | .eq(TChargingOrderRefund::getChargingOrderId, tChargingOrder.getId()).list(); |
| | | for (TChargingOrderRefund tChargingOrderRefund : list2) { |
| | | if (tChargingOrderRefund.getRefundStatus()==2){ |
| | | refundAmount = refundAmount.add(tChargingOrderRefund.getRefundTotalAmount()); |
| | | } |
| | | } |
| | | // 累加累计服务费 |
| | | if (tChargingOrder.getServiceCharge()!=null){ |
| | |
| | | } |
| | | // 累加平台手续费 |
| | | if (tChargingOrder.getOrderAmount()!=null){ |
| | | commissionAmount = commissionAmount.add(tChargingOrder.getOrderAmount().multiply(BigDecimal.valueOf(0.006))); |
| | | commissionAmount = commissionAmount.add(tChargingOrder.getPaymentAmount().multiply(BigDecimal.valueOf(0.006))); |
| | | } |
| | | // 累加平台分佣 |
| | | if (tChargingOrder.getSharingAmount()!=null){ |
| | |
| | | chargingBillVO.setPaymentAmount(BigDecimal.ZERO); |
| | | } |
| | | |
| | | chargingBillVO.setOrderAmount(chargingBillVO.getPaymentAmount().subtract(chargingBillVO.getRefundAmount()==null?BigDecimal.ZERO:chargingBillVO.getRefundAmount()) |
| | | .subtract(chargingBillVO.getCommissionAmount()==null?BigDecimal.ZERO:chargingBillVO.getCommissionAmount()) |
| | | .subtract(chargingBillVO.getSharingAmount()==null?BigDecimal.ZERO:chargingBillVO.getSharingAmount())); |
| | | chargingBillListVO.setPaymentAmount(paymentAmount == null?BigDecimal.ZERO:paymentAmount); |
| | | chargingBillListVO.setOrderAmount(orderAmount == null?BigDecimal.ZERO:orderAmount.subtract(refundAmount).subtract(commissionAmount).subtract(sharingAmount)); |
| | | chargingBillListVO.setOrderAmount(chargingBillVO.getPaymentAmount().subtract(chargingBillVO.getRefundAmount()==null?BigDecimal.ZERO:chargingBillVO.getRefundAmount())); |
| | | chargingBillListVO.setPaymentAmount(paymentAmount); |
| | | chargingBillListVO.setOrderAmount(orderAmount == null?BigDecimal.ZERO:orderAmount.subtract(sharingAmount).subtract(commissionAmount)); |
| | | chargingBillListVO.setRefundAmount(refundAmount == null?BigDecimal.ZERO:refundAmount); |
| | | chargingBillListVO.setElectrovalence(electrovalence == null?BigDecimal.ZERO:electrovalence); |
| | | chargingBillListVO.setServiceCharge(serviceCharge == null?BigDecimal.ZERO:serviceCharge); |
| | | chargingBillListVO.setCommissionAmount(commissionAmount == null?BigDecimal.ZERO:commissionAmount.setScale(2, RoundingMode.HALF_DOWN)); |
| | | chargingBillListVO.setSharingAmount(sharingAmount == null?BigDecimal.ZERO:sharingAmount); |
| | | chargingBillListVO.setChargingCapacity(chargingCapacity == null?BigDecimal.ZERO:chargingCapacity); |
| | | chargingBillListVO.setBillMoney(chargingBillListVO.getPaymentAmount().subtract(chargingBillListVO.getRefundAmount()==null?BigDecimal.ZERO:chargingBillListVO.getRefundAmount()) |
| | | chargingBillListVO.setBillMoney(chargingBillListVO.getPaymentAmount().subtract(chargingBillListVO.getRefundAmount()==null?BigDecimal.ZERO:chargingBillListVO.getRefundAmount() |
| | | .subtract(commissionAmount).subtract(sharingAmount)) |
| | | .subtract(chargingBillListVO.getCommissionAmount()==null?BigDecimal.ZERO:chargingBillListVO.getCommissionAmount()) |
| | | .subtract(chargingBillListVO.getSharingAmount()==null?BigDecimal.ZERO:chargingBillListVO.getSharingAmount())); |
| | | switch (chargingBillListVO.getType()){ |
| | |
| | | chargingBillVO.setCategory(""); |
| | | chargingBillVO.setExportList(tChargingOrders); |
| | | for (TChargingOrder tChargingOrder : tChargingOrders) { |
| | | if (tChargingOrder.getRefundAmount()!=null && tChargingOrder.getPaymentAmount()!=null){ |
| | | paymentAmountTotal = paymentAmountTotal.add(tChargingOrder.getPaymentAmount()); |
| | | |
| | | }else if (tChargingOrder.getPaymentAmount()!=null){ |
| | | paymentAmountTotal = paymentAmountTotal.add(tChargingOrder.getPaymentAmount()); |
| | | if (tChargingOrder.getOrderAmount()!=null){ |
| | | paymentAmountTotal = paymentAmountTotal.add(tChargingOrder.getChargeAmount()); |
| | | } |
| | | |
| | | // 累加订单金额 |
| | |
| | | List<TChargingOrderRefund> list2 = chargingOrderRefundService.lambdaQuery().eq(TChargingOrderRefund::getChargingOrderId, tChargingOrder.getId()) |
| | | .eq(TChargingOrderRefund::getRefundStatus, 2).list(); |
| | | for (TChargingOrderRefund tChargingOrderRefund : list2) { |
| | | refundAmountTotal =refundAmountTotal.add(tChargingOrder.getRefundAmount()); |
| | | refundAmountTotal =refundAmountTotal.add(tChargingOrderRefund.getRefundAmount()); |
| | | } |
| | | // 累加累计服务费 |
| | | if (tChargingOrder.getServiceCharge()!=null){ |
| | |
| | | } |
| | | chargingBillVO.setChargingCapacity(chargingCapacityTotal); |
| | | chargingBillVO.setPaymentAmount(paymentAmountTotal.setScale(2, RoundingMode.HALF_DOWN)); |
| | | chargingBillVO.setOrderAmount(orderAmountTotal.setScale(2, RoundingMode.HALF_DOWN)); |
| | | chargingBillVO.setOrderAmount(paymentAmountTotal.subtract(refundAmountTotal).subtract(commissionAmountTotal).subtract(sharingAmountTotal)); |
| | | chargingBillVO.setElectrovalence(electrovalenceTotal.setScale(2, RoundingMode.HALF_DOWN)); |
| | | chargingBillVO.setServiceCharge(serviceChargeTotal.setScale(2, RoundingMode.HALF_DOWN)); |
| | | chargingBillVO.setOrderCount(orderCount); |
| | |
| | | BigDecimal electronicMoney = new BigDecimal("0"); |
| | | BigDecimal serviceMoney = new BigDecimal("0"); |
| | | for (ChargingOrderVO chargingOrderVO : list) { |
| | | chargingOrderVO.setCommissionAmount(chargingOrderVO.getServiceCharge().multiply(new BigDecimal("0.006"))); |
| | | chargingOrderVO.setPlatFormMoney(chargingOrderVO.getServiceCharge().multiply(new BigDecimal("0.006"))); |
| | | chargingOrderVO.setCommissionAmount(chargingOrderVO.getOrderAmount().multiply(new BigDecimal("0.006"))); |
| | | chargingOrderVO.setPlatFormMoney(chargingOrderVO.getOrderAmount().multiply(new BigDecimal("0.006"))); |
| | | chargingOrderVO.setUid(chargingOrderVO.getId()+""); |
| | | TChargingGun data3 = chargingGunClient.getChargingGunById(chargingOrderVO.getChargingGunId()).getData(); |
| | | TChargingPile data2 = chargingPileClient.getChargingPileById(chargingOrderVO.getChargingPileId()).getData(); |
| | |
| | | List<ChargingOrderListVO> list = this.baseMapper.chargingList(pageInfo,dto,startTime1,startTime2,endTime1,endTime2); |
| | | for (ChargingOrderListVO chargingOrderListVO : list) { |
| | | chargingOrderListVO.setChargingCapacity(chargingOrderListVO.getElectricity()); |
| | | chargingOrderListVO.setPaymentAmount(chargingOrderListVO.getPaymentAmount()); |
| | | BigDecimal bigDecimal = new BigDecimal("0.006"); |
| | | if (chargingOrderListVO.getOrderAmount()!=null){ |
| | | chargingOrderListVO.setCommissionAmount(chargingOrderListVO.getOrderAmount().multiply(bigDecimal)); |
| | | } |
| | | chargingOrderListVO.setPaymentAmount(chargingOrderListVO.getResidualAmount()==null?chargingOrderListVO.getPaymentAmount():chargingOrderListVO.getPaymentAmount()); |
| | | chargingOrderListVO.setPaymentAmount(chargingOrderListVO.getPaymentAmount()); |
| | | chargingOrderListVO.setUid(chargingOrderListVO.getId()+""); |
| | | List<Integer> integers = new ArrayList<>(); |
| | | integers.add(chargingOrderListVO.getSiteId()); |
| | |
| | | UploadRealTimeMonitoringData data5 = uploadRealTimeMonitoringDataClient.chargingOrderInfo(chargingOrderListVO.getCode()).getData(); |
| | | if (data5!=null){ |
| | | if (data5.getTime_remaining()!=null){ |
| | | chargingOrderListVO.setChargingSecond(data5.getTime_remaining()*60L); |
| | | chargingOrderListVO.setChargingSecond(data5.getCumulative_charging_time()*60L); |
| | | |
| | | } |
| | | } |
| | |
| | | List<UploadRealTimeMonitoringData> data6 = uploadRealTimeMonitoringDataClient.getDataByOrderCode(chargingOrderListVO.getCode()).getData(); |
| | | if (data6!=null && !data6.isEmpty()){ |
| | | // 第一条数据soc为开始 最后一条数据soc为结束soc |
| | | chargingOrderListVO.setStartSoc(data6.get(0).getSoc().toString()); |
| | | chargingOrderListVO.setEndSoc(data6.get(data6.size()-1).getSoc().toString()); |
| | | chargingOrderListVO.setEndSoc(data6.get(0).getSoc().toString()); |
| | | chargingOrderListVO.setStartSoc(data6.get(data6.size()-1).getSoc().toString()); |
| | | } |
| | | } |
| | | |
| | |
| | | @Override |
| | | public ChargingOrderListInfoVO chargingInfo(String uid) { |
| | | TChargingOrder chargingOrder= this.getById(uid); |
| | | |
| | | ChargingOrderListInfoVO chargingOrderListInfoVO = new ChargingOrderListInfoVO(); |
| | | |
| | | chargingOrderListInfoVO.setStatus(chargingOrder.getStatus()); |
| | | BigDecimal bigDecimal = new BigDecimal("0.006"); |
| | | if (chargingOrder.getOrderAmount()!=null){ |
| | |
| | | if (uploadRealTimeMonitoringData.getOutput_current()!=null&& |
| | | uploadRealTimeMonitoringData.getOutput_voltage()!=null){ |
| | | uploadRealTimeMonitoringData.setPower(uploadRealTimeMonitoringData.getOutput_voltage() |
| | | .multiply(uploadRealTimeMonitoringData.getOutput_current())); |
| | | .multiply(uploadRealTimeMonitoringData.getOutput_current()).divide(new BigDecimal(1000),2, BigDecimal.ROUND_HALF_UP)); |
| | | } |
| | | } |
| | | if (!data6.isEmpty()){ |
| | | // 第一条数据soc为开始 最后一条数据soc为结束soc |
| | | chargingOrderListInfoVO.setStartSoc(data6.get(0).getSoc().toString()); |
| | | chargingOrderListInfoVO.setEndSoc(data6.get(data6.size()-1).getSoc().toString()); |
| | | chargingOrderListInfoVO.setStartSoc(data6.get(data6.size()-1).getSoc().toString()); |
| | | chargingOrderListInfoVO.setEndSoc(data6.get(0).getSoc().toString()); |
| | | chargingOrderListInfoVO.setChargingCapacity(data6.get(data6.size()-1).getCharging_degree()); |
| | | chargingOrderListInfoVO.setChargingSecond(data6.get(data6.size()-1).getCumulative_charging_time()*60+""); |
| | | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : data6) { |
| | | uploadRealTimeMonitoringData.setCreateTime(simpleDateFormat.format(uploadRealTimeMonitoringData.getCreate_time())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | chargingOrderListInfoVO.setList(data6); |
| | | } |
| | | // 获取充电时间 |
| | | UploadRealTimeMonitoringData data5 = uploadRealTimeMonitoringDataClient.chargingOrderInfo(chargingOrder.getCode()).getData(); |
| | | if (data5!=null){ |
| | | if (data5.getTime_remaining()!=null){ |
| | | chargingOrderListInfoVO.setChargingSecond(data5.getCumulative_charging_time()*60L+""); |
| | | |
| | | } |
| | | } |
| | | |
| | | if (chargingOrder.getAppUserCarId()!=null){ |
| | | List<TAppUserCar> data3 = appUserCarClient.getCarByIds(Collections.singletonList(chargingOrder.getAppUserCarId())).getData(); |
| | |
| | | and t1.status = #{req.status} |
| | | </if> |
| | | <if test="req.orderSource != null and req.orderSource != 1 "> |
| | | and t1.orderSource = #{req.orderSource} |
| | | and t1.order_source = #{req.orderSource} |
| | | </if> |
| | | <if test="req.siteId != null "> |
| | | and t1.site_id = #{req.siteId} |
| | |
| | | </if> |
| | | <if test="statisticsQueryDto.dayType ==5"> |
| | | <if test="statisticsQueryDto.startTime != null"> |
| | | AND create_time >= #{statisticsQueryDto.startTime} |
| | | AND DATE(create_time) >= #{statisticsQueryDto.startTime} |
| | | </if> |
| | | <if test="statisticsQueryDto.endTime != null"> |
| | | AND create_time <= #{statisticsQueryDto.endTime} |
| | | AND DATE(create_time) <= #{statisticsQueryDto.endTime} |
| | | </if> |
| | | </if> |
| | | GROUP BY |
| | |
| | | |
| | | </select> |
| | | <select id="chargingList" resultType="com.ruoyi.order.api.vo.ChargingOrderListVO"> |
| | | select t1.* ,t1.current as chargingCapacity,t1.recharge_amount as paymentAmount,t1.electricity as chargingCapacity from t_charging_order t1 |
| | | select t1.* ,t1.current as chargingCapacity,t1.payment_amount as paymentAmount,t1.electricity as chargingCapacity from t_charging_order t1 |
| | | where 1=1 |
| | | <if test="null != req.code and req.code!=''"> |
| | | and t1.code LIKE CONCAT('%',#{req.code},'%') |
| | |
| | | </if> |
| | | and (t1.vip_discount_amount > 0 or t1.coupon_discount_amount > 0) |
| | | and t1.recharge_payment_status =2 |
| | | and t1.refund_status !=2 |
| | | AND t1.del_flag = ${@com.ruoyi.common.core.enums.DelFlagEnum@NO.getCode()} |
| | | </if> |
| | | </if> |
| | |
| | | |
| | | @GetMapping("/getInfoByType") |
| | | @ApiOperation(tags = {"小程序-兑换商城"},value = "商品查看详情") |
| | | public R getInfoByType(Integer goodType,Integer id) { |
| | | public R getInfoByType(Integer goodType,Integer id,Integer type) { |
| | | if (goodType==1){ |
| | | TGoods byId = goodsService.getById(id); |
| | | if (byId==null||byId.getStatus()==2){ |
| | |
| | | // for (int i = 0; i < list.size(); i++) { |
| | | // list.get(i).setSalesCount(data.get(i)); |
| | | // } |
| | | |
| | | Integer data = orderClient.getSalesCountByGoodsIdgetCount(byId.getId(), 1, type).getData(); |
| | | byId.setSalesCount(data); |
| | | return R.ok(byId); |
| | | } |
| | | else { |
| | |
| | | if (byId==null||byId.getStatus()==2){ |
| | | return R.fail(2,"该商品已不存在"); |
| | | } |
| | | Integer data = orderClient.getSalesCountByGoodsIdgetCount(byId.getId(),2, type).getData(); |
| | | byId.setSalesCount(data); |
| | | return R.ok(byId); |
| | | } |
| | | } |
| | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | String string = stringBuilder.toString(); |
| | | // 订单号加上商品类型 |
| | | String res = string+"-"+basePage.getType(); |
| | | |
| | | List<Integer> data = orderClient.getSalesCountByGoodsId(res).getData(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | list.get(i).setSalesCount(data.get(i)); |
| | | for (TGoods tGoods : list) { |
| | | Integer data = orderClient.getSalesCountByGoodsIdgetCount(tGoods.getId(), tGoods.getGoodType(), basePage.getType()).getData(); |
| | | tGoods.setSalesCount(data); |
| | | } |
| | | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | |
| | | |
| | | <select id="pageList1" resultType="com.ruoyi.other.api.domain.TGoods"> |
| | | SELECT |
| | | id,name,redeem_points as redeemPoints,inventory,original_price as originalPrice ,preferential_price as preferentialPrice,vip_price as vipPrice,1 as goodType,cover_picture as coverPicture |
| | | id,name,redeem_points as redeemPoints,inventory,original_price as originalPrice ,preferential_price as preferentialPrice,vip_price as vipPrice,1 as goodType,cover_picture as coverPicture,underlying_sales as underlyingSales |
| | | FROM |
| | | t_goods |
| | | WHERE `status` = 1 and del_flag = 0 and type = #{appGoodQuery.type} |
| | | UNION ALL |
| | | SELECT |
| | | id,name,redeem_points as redeemPoints,inventory_quantity as inventory,payment_amount as originalPrice,payment_amount as preferentiaPrice,vip_payment_amount as vipPrice,2 as goodType,cover_picture as coverPicture |
| | | id,name,redeem_points as redeemPoints,inventory_quantity as inventory,payment_amount as originalPrice,payment_amount as preferentiaPrice,vip_payment_amount as vipPrice,2 as goodType,cover_picture as coverPicture,0 as underlyingSales |
| | | FROM |
| | | t_coupon |
| | | WHERE `status`= 1 and del_flag = 0 and ways_to_obtain != #{appGoodQuery.type} |