| | |
| | | dto.setList(pageInfo); |
| | | XpOperationsUser xpOperationsUser = xpOperationUserClient.queryById(query.getAppUserId()).getData(); |
| | | List<Long> longList = fleetOperationsClient.getFleetIdsByUserId(xpOperationsUser.getId()).getData(); |
| | | List<XpSchedulingDetail> list = xpSchedulingDetailService.list(new QueryWrapper<XpSchedulingDetail>().eq("fleetId", longList.get(0)).between(StringUtils.isNotEmpty(startTime), "plan_time", startTime, endTime)); |
| | | List<XpSchedulingDetail> list = xpSchedulingDetailService.list(new QueryWrapper<XpSchedulingDetail>().eq("fleet_id", longList.get(0)).between(StringUtils.isNotEmpty(startTime), "plan_time", startTime, endTime)); |
| | | QueryWrapper<XpClockIn> last1 = new QueryWrapper<XpClockIn>().eq("app_user_id", query.getAppUserId()).last(" and (clock_in_result = 1 or clock_out_result = 1)" |
| | | + (StringUtils.isNotEmpty(startTime) ? " and (DATE_FORMAT(clock_in_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "' or DATE_FORMAT(clock_out_time, '%Y-%m-%d') between '" + startTime + "' and '" + endTime + "'))" : "")); |
| | | QueryWrapper<XpClockIn> last2 = new QueryWrapper<XpClockIn>().eq("app_user_id", query.getAppUserId()).last(" and (clock_in_result = 2 or clock_out_result = 2)" |
| | |
| | | String ORDER_REASSIGN_NEW_VEHICLE_NOT_START_ACCEPT = "order.reassign.new.vehicle.not.start.accept"; |
| | | String ORDER_REASSIGN_NEW_VEHICLE_NOT_FREE = "order.reassign.new.vehicle.not.free"; |
| | | String ORDER_STATUS_ERROR = "order.status.error"; |
| | | String ORDER_CHANGE_AMOUNT_ID_REQUIRED = "order.change.amount.id.required"; |
| | | String ORDER_CHANGE_AMOUNT_AMOUNT_REQUIRED = "order.change.amount.amount.required"; |
| | | String ORDER_CHANGE_AMOUNT_AMOUNT_INVALID = "order.change.amount.amount.invalid"; |
| | | String ORDER_CHANGE_AMOUNT_STATUS_INVALID = "order.change.amount.status.invalid"; |
| | | String ORDER_CHANGE_AMOUNT_FAILED = "order.change.amount.failed"; |
| | | String VEHICLE_NOT_EXISTS = "vehicle.not.exists"; |
| | | } |
| | | |
| | |
| | | import com.xiaopeng.order.service.IXpOrderService; |
| | | import com.xiaopeng.order.vo.OrderDetailVo; |
| | | import com.xiaopeng.unifiedverification.interceptor.XpClientCheck; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import io.swagger.annotations.*; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | |
| | | ); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单改价", tags = {"管理后台-交易管理-订单管理"}) |
| | | @PostMapping("/api/v1/order/changeAmount") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "订单ID", required = true, dataType = "Long"), |
| | | @ApiImplicitParam(name = "amount", value = "新的订单金额", required = true, dataType = "BigDecimal") |
| | | }) |
| | | public R<?> changeAmount(@RequestParam("id") Long id ,@RequestParam("amount") BigDecimal amount) { |
| | | xpOrderService.changeAmount(id, amount); |
| | | return R.ok(); |
| | | } |
| | | /** |
| | | * 获取用户快捷胶囊 历史 时段 终点高点 |
| | | */ |
| | |
| | | import com.xiaopeng.order.model.vo.XpOrderPageVO; |
| | | import com.xiaopeng.order.vo.OrderDetailVo; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | OrderDetailVo orderDetail(Long orderId, String uid); |
| | | |
| | | R<String> feeDescription(Long orderId, String uid); |
| | | |
| | | /** |
| | | * 订单改价 |
| | | * @param id |
| | | * @param amount |
| | | */ |
| | | void changeAmount(Long id, BigDecimal amount); |
| | | } |
| | |
| | | |
| | | return xpOrderDetailVO; |
| | | } |
| | | |
| | | @Override |
| | | public void changeAmount(Long id, BigDecimal amount) { |
| | | if (Objects.isNull(id)) { |
| | | throw new ServiceException("订单ID不能为空", I18nKeyConstant.ORDER_CHANGE_AMOUNT_ID_REQUIRED); |
| | | } |
| | | if (Objects.isNull(amount)) { |
| | | throw new ServiceException("订单金额不能为空", I18nKeyConstant.ORDER_CHANGE_AMOUNT_AMOUNT_REQUIRED); |
| | | } |
| | | if (amount.compareTo(BigDecimal.ZERO) < 0) { |
| | | throw new ServiceException("订单金额不能小于0", I18nKeyConstant.ORDER_CHANGE_AMOUNT_AMOUNT_INVALID); |
| | | } |
| | | |
| | | XpOrder order = this.getById(id); |
| | | if (Objects.isNull(order)) { |
| | | throw new ServiceException("订单不存在", I18nKeyConstant.ORDER_NOT_EXISTS); |
| | | } |
| | | |
| | | final Integer pendingPaymentStatus = 8; |
| | | if (!Objects.equals(order.getStatus(), pendingPaymentStatus)) { |
| | | throw new ServiceException("当前订单状态不允许改价,只有待付款状态的订单可以改价", I18nKeyConstant.ORDER_CHANGE_AMOUNT_STATUS_INVALID); |
| | | } |
| | | |
| | | if (Objects.nonNull(order.getOrderMoney()) && order.getOrderMoney().compareTo(amount) == 0) { |
| | | return; |
| | | } |
| | | |
| | | boolean updated = this.lambdaUpdate() |
| | | .set(XpOrder::getOrderMoney, amount) |
| | | .eq(XpOrder::getId, id) |
| | | .eq(XpOrder::getStatus, pendingPaymentStatus) |
| | | .update(); |
| | | if (!updated) { |
| | | throw new ServiceException("订单改价失败,请稍后重试", I18nKeyConstant.ORDER_CHANGE_AMOUNT_FAILED); |
| | | } |
| | | } |
| | | } |
| | |
| | | order.reassign.new.vehicle.not.free=新车辆已接单,请重新选择 |
| | | order.pricing.not.exists=当前城市未配置定价规则 |
| | | order.order.status.error=订单状态错误 |
| | | vehicle.not.exists=车辆不存在 |
| | | vehicle.not.exists=车辆不存在 |
| | | order.change.amount.id.required=订单ID不能为空 |
| | | order.change.amount.amount.required=订单金额不能为空 |
| | | order.change.amount.amount.invalid=订单金额不能小于0 |
| | | order.change.amount.status.invalid=当前订单状态不允许改价,只有待付款状态的订单可以改价 |
| | | order.change.amount.failed=订单改价失败,请稍后重试 |
| | |
| | | welcome.message=Welcome to our application! |
| | | order.pricing.not.exists=The current city has not been configured with pricing rules |
| | | order.order.status.error=Order status error |
| | | vehicle.not.exists=The vehicle does not exist. |
| | | vehicle.not.exists=The vehicle does not exist. |
| | | order.change.amount.id.required=Order ID is required. |
| | | order.change.amount.amount.required=Order amount is required. |
| | | order.change.amount.amount.invalid=Order amount must be greater than or equal to 0. |
| | | order.change.amount.status.invalid=The current order status does not allow price changes. Only pending payment orders can be changed. |
| | | order.change.amount.failed=Failed to change order amount. Please try again later. |
| | |
| | | welcome.message=欢迎来到我们的应用程序! |
| | | order.pricing.not.exists=当前城市未配置定价规则 |
| | | order.order.status.error=订单状态错误 |
| | | vehicle.not.exists=车辆不存在 |
| | | vehicle.not.exists=车辆不存在 |
| | | order.change.amount.id.required=订单ID不能为空 |
| | | order.change.amount.amount.required=订单金额不能为空 |
| | | order.change.amount.amount.invalid=订单金额不能小于0 |
| | | order.change.amount.status.invalid=当前订单状态不允许改价,只有待付款状态的订单可以改价 |
| | | order.change.amount.failed=订单改价失败,请稍后重试 |