| | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.DesensitizedUtil; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.xiaopeng.api.dto.QueryOrderRouteDTO; |
| | | import com.xiaopeng.api.dto.operation.LonLatDto; |
| | | import com.xiaopeng.api.dto.order.GetOrderNumDto; |
| | |
| | | import com.xiaopeng.api.dto.statistics.OrderStatisticsDTO; |
| | | import com.xiaopeng.api.dto.statistics.StatisticsQueryDTO; |
| | | import com.xiaopeng.api.dto.vehicleConvoy.BaseVehicleUserDto; |
| | | import com.xiaopeng.api.dto.vehicleConvoy.BleInfoResponseDto; |
| | | import com.xiaopeng.api.feignClient.account.SysGroupMenuClient; |
| | | import com.xiaopeng.api.feignClient.frdXfipEvent.XpFrdXfipEventClient; |
| | | import com.xiaopeng.api.feignClient.operation.XpSystemSettingClient; |
| | | import com.xiaopeng.api.feignClient.operation.XpWhiteListClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.BluetoothUnlockClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.VehicleMacClient; |
| | | import com.xiaopeng.api.feignClient.vehicleConvoy.XpVehicleClient; |
| | | import com.xiaopeng.api.model.operation.XpOfficialPartner; |
| | | import com.xiaopeng.api.model.operation.XpSystemSetting; |
| | | import com.xiaopeng.api.model.operation.XpWhitelist; |
| | | import com.xiaopeng.api.model.order.OrderTrajectory; |
| | | import com.xiaopeng.api.model.order.XpOrder; |
| | | import com.xiaopeng.api.model.vehicleConvoy.XpVehicle; |
| | | import com.xiaopeng.api.vo.account.LoginUser; |
| | | import com.xiaopeng.api.vo.automaticPilot.VehiclePosition; |
| | | import com.xiaopeng.api.vo.operation.NavigationVo; |
| | | import com.xiaopeng.api.vo.operation.NearestNextVo; |
| | | import com.xiaopeng.api.vo.operation.RouteVo; |
| | | import com.xiaopeng.api.vo.order.*; |
| | | import com.xiaopeng.api.vo.vehicleConvoy.GetBleInfoVo; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.core.enums.OrderStatusEnum; |
| | | import com.xiaopeng.common.core.exception.ServiceException; |
| | | import com.xiaopeng.common.core.utils.SensitiveDataCryptoUtil; |
| | | import com.xiaopeng.common.core.utils.StringUtils; |
| | | import com.xiaopeng.common.core.utils.WebUtils; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.order.config.BluetoothDebugConfig; |
| | | import com.xiaopeng.order.dto.OrderNavigationDto; |
| | | import com.xiaopeng.order.model.dto.*; |
| | | import com.xiaopeng.api.model.order.OrderTrajectory; |
| | | import com.xiaopeng.order.model.dto.CreditPayCallDto; |
| | | import com.xiaopeng.order.model.dto.CreditPaySuccessCallDto; |
| | | import com.xiaopeng.order.mangodb.service.OrderTrajectoryService; |
| | | import com.xiaopeng.order.model.dto.XpOrderCommentDto; |
| | | import com.xiaopeng.order.model.dto.XpOrderOperateDTO; |
| | | import com.xiaopeng.order.model.dto.XpOrderPayDto; |
| | |
| | | import com.xiaopeng.order.model.vo.XpOrderHistoryVO; |
| | | import com.xiaopeng.order.model.vo.XpOrderPageVO; |
| | | import com.xiaopeng.order.service.IXpOrderService; |
| | | import com.xiaopeng.order.service.impl.BootCommonService; |
| | | import com.xiaopeng.order.vo.BluetoothTokenVo; |
| | | import com.xiaopeng.order.vo.OrderDetailVo; |
| | | import com.xiaopeng.order.vo.UpdateOrderStatusVo; |
| | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static org.bouncycastle.asn1.x500.style.RFC4519Style.o; |
| | | import static org.bouncycastle.asn1.x500.style.RFC4519Style.uid; |
| | | |
| | | /** |
| | | * <p> |
| | | * 订单 前端控制器 |
| | |
| | | |
| | | @Resource |
| | | private VehicleMacClient vehicleMacClient; |
| | | @Resource |
| | | private SysGroupMenuClient groupMenuClient; |
| | | |
| | | @Resource |
| | | private XpWhiteListClient xpWhiteListClient; |
| | |
| | | |
| | | @Autowired |
| | | private BluetoothDebugConfig bluetoothDebugConfig; |
| | | |
| | | @Resource |
| | | private XpSystemSettingClient xpSystemSettingClient; |
| | | |
| | | @Resource |
| | | @Lazy |
| | | private BootCommonService bootCommonService; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | @ApiOperation(value = "删除订单", tags = {"管理后台-交易管理-订单管理"}) |
| | | @DeleteMapping("/api/v1/order/deleteById") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ORDER_MANAGEMENT, |
| | | operationType = AdminOperationType.DELETE, |
| | | contentExpression = "'删除订单,id=' + #p0", |
| | | appendRequestData = false |
| | | ) |
| | | public R<?> deleteById(@ApiParam(value = "订单id", required = true) @RequestParam Long id) { |
| | | xpOrderService.deleteOrder(id); |
| | | return R.ok(); |
| | |
| | | */ |
| | | @ApiOperation(value = "订单导出", tags = {"管理后台-交易管理-订单管理"}) |
| | | @PostMapping("/api/v1/order/exportExcel") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ORDER_MANAGEMENT, |
| | | operationType = AdminOperationType.EXPORT, |
| | | content = "订单导出", |
| | | appendRequestData = true |
| | | ) |
| | | public void exportExcel(@RequestBody XpOrderExcelQuery query) { |
| | | // 1. 查询导出数据 |
| | | List<XpOrderPageVO> dataList = xpOrderService.exportList(query); |
| | |
| | | */ |
| | | @ApiOperation(value = "取消/关闭订单", tags = {"管理后台-交易管理-订单管理"}) |
| | | @PostMapping("/api/v1/order/cancelAndCloseById") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ORDER_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "取消/关闭订单", |
| | | appendRequestData = true |
| | | ) |
| | | public R<?> cancelAndCloseById(@Validated @RequestBody XpOrderOperateDTO dto) { |
| | | xpOrderService.cancelOrCloseOrder(dto.getOrderId(), dto.getType(),dto.getIsFree()); |
| | | return R.ok(); |
| | |
| | | */ |
| | | @ApiOperation(value = "改派订单", tags = {"管理后台-交易管理-订单管理"}, notes = "车辆列表在 vehicleConvoy.availableList 服务") |
| | | @PostMapping("/api/v1/order/reassignById") |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ORDER_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | content = "改派订单", |
| | | appendRequestData = true |
| | | ) |
| | | public R<?> reassignById(@Validated @RequestBody XpOrderReassignDTO dto) { |
| | | xpOrderService.reassignOrder( |
| | | dto.getOrderId(), |
| | |
| | | @ApiImplicitParam(name = "id", value = "订单ID", required = true, dataType = "Long"), |
| | | @ApiImplicitParam(name = "amount", value = "新的订单金额", required = true, dataType = "BigDecimal") |
| | | }) |
| | | @AdminOperationLog( |
| | | businessType = AdminBusinessType.ORDER_MANAGEMENT, |
| | | operationType = AdminOperationType.EDIT, |
| | | contentExpression = "'订单改价,id=' + #p0 + ',amount=' + #p1", |
| | | appendRequestData = false |
| | | ) |
| | | public R<?> changeAmount(@RequestParam("id") Long id, @RequestParam("amount") BigDecimal amount) { |
| | | xpOrderService.changeAmount(id, amount); |
| | | return R.ok(); |
| | |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public R<NearestNextVo> quickCapsule(@RequestParam Long startPointId,HttpServletRequest request) { |
| | | String uid = request.getHeader("XP-Uid"); |
| | | return R.ok(xpOrderService.quickCapsule(uid,startPointId)); |
| | | NearestNextVo nearestNextVo = xpOrderService.quickCapsule(uid, startPointId); |
| | | return R.ok(nearestNextVo); |
| | | |
| | | } |
| | | |
| | |
| | | String uid = request.getHeader("XP-Uid"); |
| | | try { |
| | | Boolean b = xpOrderService.endTrip(orderId, uid); |
| | | //判断是否测试免费 |
| | | XpSystemSetting xpSystemSetting = xpSystemSettingClient.getSystemSettingOne().getData(); |
| | | if (xpSystemSetting != null && xpSystemSetting.getOperateFree() == 1) { |
| | | //将支付金额修改成0 并将状态修改成 订单状态9 |
| | | XpOrder xpOrder1 = new XpOrder(); |
| | | xpOrder1.setId(orderId); |
| | | xpOrder1.setIsFree(true);//豁免 |
| | | xpOrder1.setPayMoney(BigDecimal.ZERO); |
| | | xpOrder1.setStatus(OrderStatusEnum.PENDING_PAYMENT.getCode()); |
| | | xpOrder1.setUpdateTime(LocalDateTime.now()); |
| | | xpOrderService.updateById(xpOrder1); |
| | | xpOrder1.setAppUserId(Long.parseLong(uid)); |
| | | bootCommonService.setCache_orderStatus(xpOrder1.getId(), xpOrder1, null); |
| | | } |
| | | return R.ok(b); |
| | | |
| | | } catch (Exception e) { |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @PutMapping("/base/v1/order/testEndTrip/{orderId}") |
| | | @ApiOperation(value = "结束行程", tags = {"小程序-结束行程"}) |
| | | public R<?> testEndTrip(@PathVariable("orderId") Long orderId, HttpServletRequest request) { |
| | | XpOrder xpOrder = xpOrderService.getById(orderId); |
| | | try { |
| | | Boolean b = xpOrderService.endTrip(orderId, xpOrder.getAppUserId().toString()); |
| | | //判断是否测试免费 |
| | | XpSystemSetting xpSystemSetting = xpSystemSettingClient.getSystemSettingOne().getData(); |
| | | if (xpSystemSetting != null && xpSystemSetting.getOperateFree() == 1) { |
| | | //将支付金额修改成0 并将状态修改成 订单状态9 |
| | | XpOrder xpOrder1 = new XpOrder(); |
| | | xpOrder1.setId(orderId); |
| | | xpOrder1.setIsFree(true);//豁免 |
| | | xpOrder1.setPayMoney(BigDecimal.ZERO); |
| | | xpOrder1.setStatus(OrderStatusEnum.PENDING_PAYMENT.getCode()); |
| | | xpOrder1.setUpdateTime(LocalDateTime.now()); |
| | | xpOrderService.updateById(xpOrder1); |
| | | xpOrder1.setAppUserId(xpOrder.getAppUserId()); |
| | | bootCommonService.setCache_orderStatus(xpOrder1.getId(), xpOrder1, null); |
| | | } |
| | | return R.ok(b); |
| | | |
| | | } catch (Exception e) { |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "订单状态推送修改") |
| | | @PostMapping("/logan/inner/v1/order/updateOrderStatus") |
| | | public R<String> updateOrderStatus(@RequestParam Long orderId, |
| | | @RequestParam Integer status, |
| | | @RequestParam Boolean orderException) { |
| | | return xpOrderService.updateOrderStatus(orderId, status, orderException); |
| | | @RequestParam Integer status) { |
| | | return xpOrderService.updateOrderStatus(orderId, status); |
| | | } |
| | | |
| | | /** |
| | |
| | | String uid = request.getHeader("XP-Uid"); |
| | | // 查询订单信息 |
| | | XpOrder xpOrder = xpOrderService.getById(dto.getOrderId()); |
| | | // 获取路线规划 |
| | | // RouteVo routeVo = redisService.getCacheObject(CacheConstants.ORDER_ROUTE_CAPTURE + "_" + dto.getOrderId() + "_" +dto.getRouteType()); |
| | | |
| | | String key = ""; |
| | | //接驾情况,获取车辆位置到起点的导航 |
| | | if (xpOrder.getStatus() < 5) { |
| | |
| | | Object cacheObject = redisService.getCacheObject(key); |
| | | RouteVo routeVo = JSON.parseObject(cacheObject.toString(), RouteVo.class); |
| | | XpVehicle xpVehicle = xpVehicleClient.queryById(xpOrder.getVehicleId()).getData(); |
| | | // VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(xpVehicle.getVehicleVin())), VehiclePosition.class); |
| | | // routeVo.setDirection(null != vehiclePosition ? vehiclePosition.getCourse() : 90); |
| | | |
| | | Long vehicleId = xpOrder.getVehicleId(); |
| | | XpOrder one = xpOrderService.getOne(new QueryWrapper<XpOrder>().eq("vehicle_id", vehicleId).in("status", Arrays.asList(6, 7)).eq("is_deleted", 0)); |
| | | if(null != one){ |
| | | routeVo.setEndLongitude(one.getEndLon()); |
| | | routeVo.setEndLatitude(one.getEndLat()); |
| | | } |
| | | |
| | | String vin = SensitiveDataCryptoUtil.decryptIfPossible(xpVehicle.getVehicleVin()); |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(vin)), VehiclePosition.class); |
| | | routeVo.setDirection(null != vehiclePosition ? vehiclePosition.getCourse() : 90); |
| | | routeVo.setEndLongitude(xpOrder.getEndLon()); |
| | | routeVo.setEndLatitude(xpOrder.getEndLat()); |
| | | return R.ok(routeVo); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | routeVo.setPolyline(polyline); |
| | | XpOrder xpOrder = xpOrderService.getById(orderId); |
| | | XpVehicle xpVehicle = xpVehicleClient.queryById(xpOrder.getVehicleId()).getData(); |
| | | String vin = SensitiveDataCryptoUtil.decryptIfPossible(xpVehicle.getVehicleVin()); |
| | | VehiclePosition vehiclePosition = mongoTemplate.findOne(new Query(Criteria.where("vin").is(vin)), VehiclePosition.class); |
| | | routeVo.setDirection(null != vehiclePosition ? vehiclePosition.getCourse() : 0); |
| | | return R.ok(routeVo); |
| | | } |
| | | |
| | |
| | | * @param |
| | | * @return 订单数量 |
| | | */ |
| | | @PostMapping("/inner/order/todayCancellationCount") |
| | | public R<Integer> todayCancellationCount(@RequestParam Long userId) { |
| | | @PostMapping("/logan/inner/order/todayCancellationCount") |
| | | public R<Integer> todayCancellationCount(@RequestParam Long userId){ |
| | | long count = xpOrderService.count(new QueryWrapper<XpOrder>().eq("app_user_id", userId).eq("status", 0) |
| | | .eq("is_deleted", 0).last(" and DATE_FORMAT(create_time, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')")); |
| | | return R.ok((int) count); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 创建巡游单和推送车端报文 |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @PostMapping("/logan/inner/order/addNewCruiseMission") |
| | | public R<?> addNewCruiseMission(@RequestParam("orderId") String orderId){ |
| | | XpOrder xpOrder = xpOrderService.getById(orderId); |
| | | xpOrderService.addCruiseMission(xpOrder.getVehicleId(), xpOrder); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "通过订单id获取蓝牙开锁秘钥", tags = {"小程序-业务流程"}) |
| | | @GetMapping("/api/v1/mini-program/bluetooth/getUnlocktToken/{orderId}") |
| | |
| | | return R.ok(); |
| | | } |
| | | XpVehicle xpVehicle = xpVehicleClient.queryById(xpOrder.getVehicleId()).getData(); |
| | | String vin = SensitiveDataCryptoUtil.decryptIfPossible(xpVehicle.getVehicleVin()); |
| | | GetBleInfoVo getBleInfoVo = new GetBleInfoVo(); |
| | | getBleInfoVo.setVin(xpVehicle.getVehicleVin()); |
| | | BaseVehicleUserDto baseVehicleUserDto = vehicleMacClient.getBleInfo(uid, getBleInfoVo); |
| | | if(null == baseVehicleUserDto || 200 != baseVehicleUserDto.getCode()){ |
| | | getBleInfoVo.setVin(vin); |
| | | BleInfoResponseDto bleInfoResponseDto = vehicleMacClient.getBleInfo(uid, getBleInfoVo); |
| | | if (null == bleInfoResponseDto || 200 != bleInfoResponseDto.getCode()) { |
| | | throw new ServiceException("获取蓝牙信息失败"); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(baseVehicleUserDto.getData().toString()); |
| | | BluetoothTokenVo vo = new BluetoothTokenVo(); |
| | | vo.setToken(token); |
| | | vo.setMacAddress(jsonObject.getString("macAddress")); |
| | | vo.setSlaveMacList(jsonObject.getList("slaveMacList", String.class)); |
| | | vo.setMacAddress(bleInfoResponseDto.getData().getMacAddress()); |
| | | vo.setSlaveMacList(bleInfoResponseDto.getData().getSlaveMacList().stream() |
| | | .map(s -> s.getMac()).collect(java.util.stream.Collectors.toList())); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/test/bluetooth/getBleInfo") |
| | | @ApiOperation(value = "[测试] 直接调用蓝牙信息接口验证DTO解析", notes = "仅用于本地联调验证,生产环境请勿使用") |
| | | public R<BleInfoResponseDto> testGetBleInfo(@RequestParam String uid, @RequestParam String vin) { |
| | | GetBleInfoVo vo = new GetBleInfoVo(); |
| | | vo.setVin(vin); |
| | | BleInfoResponseDto result = vehicleMacClient.getBleInfo(uid, vo); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private BluetoothUnlockClient bluetoothUnlockClient; |
| | | |
| | | @PostMapping("/test/bluetooth/deliver") |
| | | @ApiOperation(value = "[测试] 直接调用蓝牙token下发接口验证响应", notes = "仅用于本地联调验证,生产环境请勿使用") |
| | | public R<BaseVehicleUserDto> testDeliver(@RequestBody com.xiaopeng.api.vo.vehicleConvoy.BluetoothDeliverVo vo) { |
| | | BaseVehicleUserDto result = bluetoothUnlockClient.deliver(vo); |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @PostMapping("/drainage/v1/order/getOrderInfo") |
| | | @ApiOperation(value = "获取订单详情", notes = "流量接入-订单信息") |
| | | @ApiImplicitParams({ |
| | |
| | | @GetMapping("/api/v1/mini-program/order/queryOrderStatusFromOrderId") |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public R<OrderStatusFromOrderIdVo> queryOrderStatusFromOrderId(Long orderId) { |
| | | return R.ok(xpOrderService.queryOrderStatusFromOrderId(orderId)); |
| | | } |
| | | |
| | | XpOrder order = xpOrderService.getById(orderId); |
| | | |
| | | OrderStatusFromOrderIdVo orderStatusFromOrderIdVo = new OrderStatusFromOrderIdVo(); |
| | | orderStatusFromOrderIdVo.setOrderId(order.getId()); |
| | | orderStatusFromOrderIdVo.setStatus(order.getStatus()); |
| | | return R.ok( xpOrderService.queryOrderStatusFromOrderId(orderId)); |
| | | |
| | | /** |
| | | * 将订单推单状态还原重新推单 |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | @PostMapping("/logan/inner/order/againPushOrder") |
| | | public R<?> againPushOrder(@RequestParam("orderId") String orderId){ |
| | | XpOrder xpOrder = xpOrderService.getById(orderId); |
| | | String firstElement = redisService.getFirstElement(xpOrder.getQueueName()); |
| | | String[] split = firstElement.split("_"); |
| | | if (split[2].equals("1")) { |
| | | String value = split[0] + "_" + split[1] + "_0" + "_" + split[3] + "_" + split[4] + "_" + split[5] + "_" + split[6] + "_" + split[7]; |
| | | // 状态改为处理中 |
| | | redisService.updateFirst(xpOrder.getQueueName(), value); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @PostMapping("/base/v1/mini-program/order/creditPayCall") |
| | | @ApiOperation(value = "信用支付下单回调", tags = {"小程序-发起支付"}, response = CreditPayCallVo.class) |
| | | public CreditPayCallVo creditPayCall(@RequestBody CreditPayCallDto dto) { |
| | | public R<CreditPayCallVo> creditPayCall(@RequestBody CreditPayCallDto dto) { |
| | | CreditPayCallVo vo = new CreditPayCallVo(); |
| | | vo.setRetCode("0"); |
| | | vo.setRetMsg("成功"); |
| | | |
| | | if (dto == null || (StringUtils.isBlank(dto.getAuthOrderId()) || StringUtils.isBlank(dto.getBusinessOrderId()))) { |
| | | return vo; |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | LambdaQueryWrapper<XpOrder> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(XpOrder::getAuthOrderId, dto.getAuthOrderId()); |
| | | XpOrder order = xpOrderService.getOne(wrapper.last("LIMIT 1")); |
| | | if (order == null) { |
| | | return vo; |
| | | return R.ok(vo); |
| | | } |
| | | if ("SUCCESS".equals(dto.getCreditOrderStatus())) { |
| | | // 发起扣款 |
| | | xpOrderService.creditPayCall(order); |
| | | } |
| | | return vo; |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/base/v1/mini-program/order/creditPaySuccessCall") |
| | | @ApiOperation(value = "信用扣款回调", tags = {"小程序-发起支付"}, response = CreditPayCallVo.class) |
| | | public CreditPayCallVo creditPaySuccessCall(@RequestBody CreditPaySuccessCallDto dto) { |
| | | |
| | | LambdaQueryWrapper<XpOrder> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(XpOrder::getAuthOrderId, dto.getAuthOrderId()); |
| | | XpOrder order = xpOrderService.getOne(wrapper.last("LIMIT 1")); |
| | | if(dto.getPayStatus()==1){ |
| | | order.setStatus(9); |
| | | order.setAppUserId(null); |
| | | xpOrderService.updateById(order); |
| | | CreditPayCallVo vo = new CreditPayCallVo(); |
| | | vo.setRetCode("0"); |
| | | vo.setRetMsg("成功"); |
| | | return vo; |
| | | } |
| | | return null; |
| | | |
| | | public R<CreditPayCallVo> creditPaySuccessCall(@RequestBody CreditPaySuccessCallDto dto) { |
| | | CreditPayCallVo vo = xpOrderService.creditPaySuccessCall(dto); |
| | | return R.ok(vo); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据车辆id查询正在服务的订单 |
| | | * @param vehicleId |
| | | * @return |
| | | */ |
| | | @PostMapping("/logan/inner/order/getOrderByVehicleId") |
| | | public R<XpOrder> getOrderByVehicleId(@RequestParam("vehicleId") String vehicleId){ |
| | | XpOrder one = xpOrderService.getOne(new LambdaUpdateWrapper<XpOrder>().eq(XpOrder::getVehicleId, vehicleId) |
| | | .in(XpOrder::getStatus, Arrays.asList(2, 3, 4, 5, 6, 7))); |
| | | return R.ok(one); |
| | | } |
| | | } |