| | |
| | | import com.ruoyi.order.dto.OrderEvaluateVo; |
| | | import com.ruoyi.order.dto.*; |
| | | 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; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.models.auth.In; |
| | | import jdk.nashorn.internal.runtime.ListAdapter; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @RestController |
| | | @RequestMapping("/t-charging-order") |
| | | public class TChargingOrderController { |
| | | |
| | | private Logger log = LoggerFactory.getLogger(TChargingOrderController.class); |
| | | |
| | | @Resource |
| | | private TChargingOrderService chargingOrderService; |
| | |
| | | private AppUserCarClient appUserCarClient; |
| | | @Resource |
| | | private TChargingOrderAccountingStrategyService chargingOrderAccountingStrategyService; |
| | | |
| | | @Resource |
| | | private TOrderInvoiceService invoiceService; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping(value = "/securityDetection") |
| | | public void securityDetection(@RequestBody SecurityDetection securityDetection){ |
| | | public void securityDetection(@RequestBody SecurityDetectionVO securityDetection){ |
| | | log.error("-------------------安全检测数据-------------------:" + securityDetection); |
| | | chargingOrderService.securityDetection(securityDetection); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping(value = "/startChargeSuccessfully") |
| | | public void startChargeSuccessfully(@RequestBody PlatformStartChargingReplyMessage message){ |
| | | public void startChargeSuccessfully(@RequestBody PlatformStartChargingReplyMessageVO message){ |
| | | log.error("-------------------远程启动充电请求应答-------------------:" + message); |
| | | chargingOrderService.startChargeSuccessfully(message); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping(value = "/chargingOrderStartupFailureWxRefund") |
| | | public void chargingOrderStartupFailureWxRefund(@RequestParam("out_trade_no") String out_refund_no, |
| | | @RequestParam("out_trade_no") String refund_id, |
| | | @RequestParam("out_trade_no") String tradeState, |
| | | @RequestParam("out_trade_no") String success_time){ |
| | | public void chargingOrderStartupFailureWxRefund(@RequestParam("out_refund_no") String out_refund_no, |
| | | @RequestParam("refund_id") String refund_id, |
| | | @RequestParam("tradeState") String tradeState, |
| | | @RequestParam("success_time") String success_time){ |
| | | chargingOrderService.chargingOrderStartupFailureWxRefund(out_refund_no, refund_id, tradeState, success_time); |
| | | } |
| | | |
| | |
| | | public AjaxResult stopCharging(@PathVariable String id) { |
| | | return chargingOrderService.stopCharging(id); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 停止充电应答处理逻辑 |
| | | * @param platformStopChargingReply |
| | | */ |
| | | @PostMapping("/terminateSuccessfulResponse") |
| | | 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); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping(value = "/six/charge") |
| | |
| | | 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); |
| | | } |
| | | } |