| | |
| | | import com.ruoyi.order.service.*; |
| | | import com.ruoyi.order.service.impl.TChargingOrderServiceImpl; |
| | | import com.ruoyi.order.util.PreviousSixMonths; |
| | | import com.ruoyi.order.vo.EndOfChargePageInfo; |
| | | import com.ruoyi.payment.api.feignClient.AliPaymentClient; |
| | | import com.ruoyi.payment.api.feignClient.WxPaymentClient; |
| | | import com.ruoyi.payment.api.vo.AliQueryOrder; |
| | |
| | | private AppUserCarClient appUserCarClient; |
| | | @Resource |
| | | private TChargingOrderAccountingStrategyService chargingOrderAccountingStrategyService; |
| | | |
| | | @Resource |
| | | private TOrderInvoiceService invoiceService; |
| | | |
| | | |
| | | /** |
| | |
| | | @PostMapping(value = "/chargingOrderInfo") |
| | | @ApiOperation(value = "充电桩订单列表查看详情", tags = {"管理后台-订单管理"}) |
| | | public AjaxResult<ChargingOrderInfoVO> chargingOrderInfo(String orderId) { |
| | | TChargingOrder byId = chargingOrderService.getById(orderId); |
| | | ChargingOrderInfoVO chargingOrderInfoVO = new ChargingOrderInfoVO(); |
| | | chargingOrderInfoVO.setCdElectronic(""); |
| | | chargingOrderInfoVO.setCdVoltage(""); |
| | | chargingOrderInfoVO.setSurplus(""); |
| | | chargingOrderInfoVO.setTotalPower(""); |
| | | chargingOrderInfoVO.setLicensePlate(""); |
| | | chargingOrderInfoVO.setVehicleBrand(""); |
| | | chargingOrderInfoVO.setVehicleModel(""); |
| | | chargingOrderInfoVO.setVehicleUse(""); |
| | | List<TChargingOrderAccountingStrategy> tChargingOrderAccountingStrategies = new ArrayList<>(); |
| | | chargingOrderInfoVO.setList(tChargingOrderAccountingStrategies); |
| | | chargingOrderInfoVO.setCdElectronic(byId.getCurrent()+""); |
| | | chargingOrderInfoVO.setCdVoltage(byId.getVoltage()+""); |
| | | chargingOrderInfoVO.setSurplus(byId.getTotalElectricity()+""); |
| | | chargingOrderInfoVO.setTotalPower(byId.getPower()+""); |
| | | if (byId.getAppUserCarId()!=null){ |
| | | List<TAppUserCar> data = appUserCarClient.getCarByIds(Collections.singletonList(byId.getAppUserCarId())).getData(); |
| | | if (!data.isEmpty()){ |
| | | chargingOrderInfoVO.setLicensePlate(data.get(0).getLicensePlate()); |
| | | chargingOrderInfoVO.setVehicleBrand(data.get(0).getVehicleBrand()); |
| | | chargingOrderInfoVO.setVehicleModel(data.get(0).getVehicleModel()); |
| | | chargingOrderInfoVO.setVehicleUse(data.get(0).getVehicleUse()); |
| | | } |
| | | } |
| | | List<TChargingOrderAccountingStrategy> list = chargingOrderAccountingStrategyService.lambdaQuery().eq(TChargingOrderAccountingStrategy::getChargingOrderId, orderId).orderByDesc(TChargingOrderAccountingStrategy::getStartTime).list(); |
| | | chargingOrderInfoVO.setList(list); |
| | | return AjaxResult.success(chargingOrderInfoVO); |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | @PostMapping(value = "/securityDetection") |
| | | public void securityDetection(@RequestBody SecurityDetectionVO securityDetection){ |
| | | log.error("-------------------安全检测数据-------------------:" + securityDetection); |
| | | chargingOrderService.securityDetection(securityDetection); |
| | | } |
| | | |
| | |
| | | public void terminateSuccessfulResponse(@RequestBody PlatformStopChargingReplyVO platformStopChargingReply){ |
| | | log.error("-------------------远程停止充电请求应答-------------------:" + platformStopChargingReply); |
| | | chargingOrderService.terminateSuccessfulResponse(platformStopChargingReply); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 停止充电返回账单后计算费用 |
| | | * @param vo |
| | | */ |
| | | @PostMapping("/endChargeBillingCharge") |
| | | public void endChargeBillingCharge(@RequestBody TransactionRecordMessageVO vo){ |
| | | log.error("-------------------停止充电返回账单后计算费用及修改业务状态-------------------:" + vo); |
| | | chargingOrderService.endChargeBillingCharge(vo); |
| | | } |
| | | |
| | | |
| | |
| | | for (UploadRealTimeMonitoringData uploadRealTimeMonitoringData : data1) { |
| | | ChargingOrderAndUploadRealTimeMonitoringDataDto dataDto = new ChargingOrderAndUploadRealTimeMonitoringDataDto(); |
| | | BeanUtils.copyProperties(uploadRealTimeMonitoringData,dataDto); |
| | | BeanUtils.copyProperties(map.get(uploadRealTimeMonitoringData.getCharging_pile_code()),dataDto); |
| | | TChargingOrder tChargingOrder = map.get(uploadRealTimeMonitoringData.getCharging_pile_code()); |
| | | if (tChargingOrder!=null) { |
| | | BeanUtils.copyProperties(tChargingOrder, dataDto); |
| | | } |
| | | dtos.add(dataDto); |
| | | } |
| | | |
| | |
| | | |
| | | // 获取本月1号的日期 |
| | | YearMonth yearMonth = YearMonth.from(today); |
| | | start = yearMonth.atDay(1); |
| | | |
| | | System.out.println("本月1号是: " + start); |
| | | // start = yearMonth.atDay(1); |
| | | // |
| | | // System.out.println("本月1号是: " + start); |
| | | }else if (statisticsQueryDto.getDayType()==4){ |
| | | LocalDate today = LocalDate.now(); |
| | | // 获取当前年份 |
| | | int currentYear = today.getYear(); |
| | | // 获取今年1月1日的日期 |
| | | start = LocalDate.of(currentYear, 1, 1); |
| | | System.out.println("今年1月1日是: " + start); |
| | | start = statisticsQueryDto.getStartTime(); |
| | | end = statisticsQueryDto.getEndTime(); |
| | | }else if (statisticsQueryDto.getDayType()==5){ |
| | | |
| | | // 获取今年1月1日的日期 |
| | |
| | | |
| | | } |
| | | |
| | | @Resource |
| | | private TOrderInvoiceService invoiceService; |
| | | |
| | | @ResponseBody |
| | | @GetMapping(value = "/work/shopOrder") |
| | | @ApiOperation(value = "购物订单统计", tags = {"管理后台-工作台"}) |
| | |
| | | return R.ok(userMap); |
| | | |
| | | } |
| | | public static void main(String[] args) { |
| | | // 示例数据 |
| | | List<TChargingOrder> list = getSampleData(); |
| | | System.err.println(list); |
| | | List<Map<String, BigDecimal>> result = processData(list); |
| | | |
| | | result.forEach(System.out::println); |
| | | @GetMapping(value = "/getGunIdsByUserId") |
| | | @ApiOperation(value = "查询当前用户正在充电中的枪id集合", tags = {"小程序-首页-用户充电订单信息"}) |
| | | public R<List<Integer>> getGunIdsByUserId() { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | List<TChargingOrder> list = chargingOrderService.list(Wrappers.lambdaQuery(TChargingOrder.class) |
| | | .eq(TChargingOrder::getAppUserId, userId) |
| | | .eq(TChargingOrder::getStatus, 3)); |
| | | List<Integer> gunIds = list.stream().map(TChargingOrder::getChargingGunId).collect(Collectors.toList()); |
| | | return R.ok(gunIds); |
| | | } |
| | | |
| | | |
| | | |
| | | private static List<TChargingOrder> getSampleData() { |
| | |
| | | */ |
| | | @PostMapping("/endCharge") |
| | | public void endCharge(@RequestParam("code") String code){ |
| | | log.error(code + ":-------------------充电桩自动结束充电-------------------"); |
| | | chargingOrderService.endCharge(code, 2); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/excelEndCharge") |
| | | public void excelEndCharge(@RequestParam("code") String code){ |
| | | log.error(code + ":-------------------充电异常,停止充电-------------------"); |
| | | chargingOrderService.excelEndCharge(code); |
| | | } |
| | | |
| | |
| | | chargingOrderService.updateById(chargingOrder); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping(value = "/getEndOfChargePageInfo/{id}") |
| | | @ApiOperation(value = "获取充电结束页面数据", tags = {"小程序-扫一扫"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "订单id", required = true) |
| | | }) |
| | | public AjaxResult<EndOfChargePageInfo> getEndOfChargePageInfo(@PathVariable("id") String id){ |
| | | EndOfChargePageInfo endOfChargePageInfo = chargingOrderService.getEndOfChargePageInfo(id); |
| | | return AjaxResult.success(endOfChargePageInfo); |
| | | } |
| | | } |