| | |
| | | @Autowired |
| | | private IOrderCrossCityService orderCrossCityService; |
| | | |
| | | /*@Autowired |
| | | private ICBCPayUtil icbcPayUtil;*/ |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | |
| | | @ApiOperation(value = "获取订单取消支付页面详情", tags = {"用户端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=同城小件物流)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<OrderInfoWarpper> queryCancelPage(Integer orderId, Integer orderType, Integer language){ |
| | |
| | | ResultUtil<BaseWarpper> r = orderCrossCityService.queryCancleAmount(orderId); |
| | | map.put("cancelPayMoney", r.getData().getAmount()); |
| | | break; |
| | | case 4://同城小件物流 |
| | | map = orderLogisticsService.queryOrderInfo(language, orderId); |
| | | ResultUtil<BaseWarpper> r1 = orderLogisticsService.queryCancleAmount(orderId, language); |
| | | map.put("cancelPayMoney", r1.getData().getAmount()); |
| | | break; |
| | | } |
| | | OrderInfoWarpper orderInfoWarpper = OrderInfoWarpper.getOrderInfoWarpper(map); |
| | | // String driverName = orderInfoWarpper.getDriverName(); |
| | | // if(language == 2){ |
| | | // driverName = "Master " + driverName.replace("师傅", ""); |
| | | // } |
| | | // if(language == 3){ |
| | | // driverName = "Maître " + driverName.replace("师傅", ""); |
| | | // } |
| | | // orderInfoWarpper.setDriverName(driverName); |
| | | return ResultUtil.success(orderInfoWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiOperation(value = "获取取消订单需要支付的费用金额", tags = {"用户端-出租车", "用户端-专车"}, notes = "返回金额为0则不需要支付") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城, 4=同城小件物流)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<BaseWarpper> queryCancleAmount(Integer id, Integer orderType, Integer language){ |
| | |
| | | return orderTaxiService.queryCancleAmount(id); |
| | | case 3: |
| | | return orderCrossCityService.queryCancleAmount(id); |
| | | case 4: |
| | | return orderLogisticsService.queryCancleAmount(id, language); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/taxi/addCancle") |
| | | @ApiOperation(value = "添加取消记录", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "") |
| | | @ApiOperation(value = "添加取消记录【2.0】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "取消原因", name = "reason", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "当前经度", name = "lon", required = true, dataType = "Double"), |
| | | @ApiImplicitParam(value = "当前纬度", name = "lat", required = true, dataType = "Double"), |
| | | @ApiImplicitParam(value = "详细地址", name = "address", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "语言类型(1=简体中文,2=英语,3=法语)", name = "language", required = false, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil addCancle(Integer id, Integer orderType, String reason, String remark, Integer language, HttpServletRequest request){ |
| | | public ResultUtil addCancle(Integer id, Integer orderType, String reason, String remark, Double lon, Double lat, String address, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | |
| | | } |
| | | switch (orderType){ |
| | | case 1: |
| | | return orderPrivateCarService.addCancle(id, reason, remark, uid, language); |
| | | return orderPrivateCarService.addCancle(id, reason, remark, uid, lon, lat, address, language); |
| | | // case 2: |
| | | // return orderTaxiService.addCancle(id, reason, remark, uid); |
| | | // case 3: |
| | | // return orderCrossCityService.addCancle(id, reason, remark, uid); |
| | | case 4: |
| | | return orderLogisticsService.addCancle(id, reason, remark, uid, language); |
| | | return orderLogisticsService.addCancle(id, reason, remark, uid, lon, lat, address, language); |
| | | // case 5: |
| | | // return orderLogisticsService.addCancle(id, reason, remark, uid); |
| | | // case 6: |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/taxi/cancleOrderTaxi") |
| | | @ApiOperation(value = "取消操作支付【1.1】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城"}, notes = "") |
| | | @ApiOperation(value = "取消操作支付【1.1】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=同城小件物流)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付方式(1=手机支付,2=银行卡支付,3=余额)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "银行卡id", name = "bankCardId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "取消单id(取消操作返回)", name = "cancleId", required = false, dataType = "int"), |
| | |
| | | // return orderTaxiService.cancleOrderTaxi(id, payType, cancleId, type); |
| | | // case 3: |
| | | // return orderCrossCityService.cancleOrderCrossCity(id, payType, cancleId, type); |
| | | case 4: |
| | | return orderLogisticsService.cancleOrderPrivateCar(id, payType, bankCardId, cancleId, type, language); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | |
| | | // case 3: |
| | | // orderCrossCityService.payCancelOrderCrossCity(id, order_id, 1); |
| | | // break; |
| | | case 4: |
| | | orderLogisticsService.payCancelOrderPrivateCar(id, order_id, language); |
| | | break; |
| | | } |
| | | callbackResponse.setCheckout_request_id(order_id); |
| | | callbackResponse.setMerchant_transaction_id(out_trade_no); |
| | |
| | | payoutCallbackResponse.setResults(results); |
| | | return payoutCallbackResponse; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/taxi/updateEndAddress") |
| | | @ApiOperation(value = "修改目的地【2.0】", tags = {"用户端-专车", "用户端-小件物流"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "终点经度", name = "endLon", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "终点纬度", name = "endLat", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "终点地址", name = "endAddress", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "语言", name = "language", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updateEndAddress(Integer orderId, Integer orderType, String endLon, String endLat, String endAddress){ |
| | | switch (orderType){ |
| | | case 1: |
| | | orderPrivateCarService.updateEndAddress(orderId, endLon, endLat, endAddress); |
| | | break; |
| | | case 4: |
| | | orderLogisticsService.updateEndAddress(orderId, endLon, endLat, endAddress); |
| | | break; |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 小件物流订单 |
| | | */ |
| | | @Data |
| | | @TableName("t_order_logistics") |
| | | public class OrderLogistics { |
| | | /** |
| | |
| | | @TableField("payMoney") |
| | | private Double payMoney; |
| | | /** |
| | | * 状态(1=待接单,2=待出发,3=待到达预约地点,4=待取货,5=送货中,6=已送达,7=待支付,8=需补差价,9=已取货,10=已取消,11=已支付差价) |
| | | * 状态(1=待接单,2=待出发,3=待到达预约地点,4=待取货,5=送货中,6=已送达,7=待支付,8=需补差价,9=已取货,10=已取消,11=改派中,12=已支付差价,13=取消待支付) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | |
| | | */ |
| | | @TableField("driverPay") |
| | | private Integer driverPay; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Integer getDriverId() { |
| | | return driverId; |
| | | } |
| | | |
| | | public void setDriverId(Integer driverId) { |
| | | this.driverId = driverId; |
| | | } |
| | | |
| | | public Integer getCarId() { |
| | | return carId; |
| | | } |
| | | |
| | | public void setCarId(Integer carId) { |
| | | this.carId = carId; |
| | | } |
| | | |
| | | public String getOrderNum() { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(String orderNum) { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public Integer getCargoType() { |
| | | return cargoType; |
| | | } |
| | | |
| | | public void setCargoType(Integer cargoType) { |
| | | this.cargoType = cargoType; |
| | | } |
| | | |
| | | public Integer getUrgent() { |
| | | return urgent; |
| | | } |
| | | |
| | | public void setUrgent(Integer urgent) { |
| | | this.urgent = urgent; |
| | | } |
| | | |
| | | public Integer getCargoNumber() { |
| | | return cargoNumber; |
| | | } |
| | | |
| | | public void setCargoNumber(Integer cargoNumber) { |
| | | this.cargoNumber = cargoNumber; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public Double getPlacementLon() { |
| | | return placementLon; |
| | | } |
| | | |
| | | public void setPlacementLon(Double placementLon) { |
| | | this.placementLon = placementLon; |
| | | } |
| | | |
| | | public Double getPlacementLat() { |
| | | return placementLat; |
| | | } |
| | | |
| | | public void setPlacementLat(Double placementLat) { |
| | | this.placementLat = placementLat; |
| | | } |
| | | |
| | | public String getPlacementAddress() { |
| | | return placementAddress; |
| | | } |
| | | |
| | | public void setPlacementAddress(String placementAddress) { |
| | | this.placementAddress = placementAddress; |
| | | } |
| | | |
| | | public Double getStartLon() { |
| | | return startLon; |
| | | } |
| | | |
| | | public void setStartLon(Double startLon) { |
| | | this.startLon = startLon; |
| | | } |
| | | |
| | | public Double getStartLat() { |
| | | return startLat; |
| | | } |
| | | |
| | | public void setStartLat(Double startLat) { |
| | | this.startLat = startLat; |
| | | } |
| | | |
| | | public String getStartAddress() { |
| | | return startAddress; |
| | | } |
| | | |
| | | public void setStartAddress(String startAddress) { |
| | | this.startAddress = startAddress; |
| | | } |
| | | |
| | | public Double getEndLon() { |
| | | return endLon; |
| | | } |
| | | |
| | | public void setEndLon(Double endLon) { |
| | | this.endLon = endLon; |
| | | } |
| | | |
| | | public Double getEndLat() { |
| | | return endLat; |
| | | } |
| | | |
| | | public void setEndLat(Double endLat) { |
| | | this.endLat = endLat; |
| | | } |
| | | |
| | | public String getEndAddress() { |
| | | return endAddress; |
| | | } |
| | | |
| | | public void setEndAddress(String endAddress) { |
| | | this.endAddress = endAddress; |
| | | } |
| | | |
| | | public String getRecipient() { |
| | | return recipient; |
| | | } |
| | | |
| | | public void setRecipient(String recipient) { |
| | | this.recipient = recipient; |
| | | } |
| | | |
| | | public String getRecipientPhone() { |
| | | return recipientPhone; |
| | | } |
| | | |
| | | public void setRecipientPhone(String recipientPhone) { |
| | | this.recipientPhone = recipientPhone; |
| | | } |
| | | |
| | | public Double getBoardingLon() { |
| | | return boardingLon; |
| | | } |
| | | |
| | | public void setBoardingLon(Double boardingLon) { |
| | | this.boardingLon = boardingLon; |
| | | } |
| | | |
| | | public Double getBoardingLat() { |
| | | return boardingLat; |
| | | } |
| | | |
| | | public void setBoardingLat(Double boardingLat) { |
| | | this.boardingLat = boardingLat; |
| | | } |
| | | |
| | | public String getBoardingAddress() { |
| | | return boardingAddress; |
| | | } |
| | | |
| | | public void setBoardingAddress(String boardingAddress) { |
| | | this.boardingAddress = boardingAddress; |
| | | } |
| | | |
| | | public Date getBoardingTime() { |
| | | return boardingTime; |
| | | } |
| | | |
| | | public void setBoardingTime(Date boardingTime) { |
| | | this.boardingTime = boardingTime; |
| | | } |
| | | |
| | | public Double getGetoffLon() { |
| | | return getoffLon; |
| | | } |
| | | |
| | | public void setGetoffLon(Double getoffLon) { |
| | | this.getoffLon = getoffLon; |
| | | } |
| | | |
| | | public Double getGetoffLat() { |
| | | return getoffLat; |
| | | } |
| | | |
| | | public void setGetoffLat(Double getoffLat) { |
| | | this.getoffLat = getoffLat; |
| | | } |
| | | |
| | | public String getGetoffAddress() { |
| | | return getoffAddress; |
| | | } |
| | | |
| | | public void setGetoffAddress(String getoffAddress) { |
| | | this.getoffAddress = getoffAddress; |
| | | } |
| | | |
| | | public Date getGetoffTime() { |
| | | return getoffTime; |
| | | } |
| | | |
| | | public void setGetoffTime(Date getoffTime) { |
| | | this.getoffTime = getoffTime; |
| | | } |
| | | |
| | | public Double getMileage() { |
| | | return mileage; |
| | | } |
| | | |
| | | public void setMileage(Double mileage) { |
| | | this.mileage = mileage; |
| | | } |
| | | |
| | | public Integer getPayType() { |
| | | return payType; |
| | | } |
| | | |
| | | public void setPayType(Integer payType) { |
| | | this.payType = payType; |
| | | } |
| | | |
| | | public Double getOrderMoney() { |
| | | return orderMoney; |
| | | } |
| | | |
| | | public void setOrderMoney(Double orderMoney) { |
| | | this.orderMoney = orderMoney; |
| | | } |
| | | |
| | | public Double getTravelMoney() { |
| | | return travelMoney; |
| | | } |
| | | |
| | | public void setTravelMoney(Double travelMoney) { |
| | | this.travelMoney = travelMoney; |
| | | } |
| | | |
| | | public Double getTipMoney() { |
| | | return tipMoney; |
| | | } |
| | | |
| | | public void setTipMoney(Double tipMoney) { |
| | | this.tipMoney = tipMoney; |
| | | } |
| | | |
| | | public Double getRedPacketMoney() { |
| | | return redPacketMoney; |
| | | } |
| | | |
| | | public void setRedPacketMoney(Double redPacketMoney) { |
| | | this.redPacketMoney = redPacketMoney; |
| | | } |
| | | |
| | | public Double getCouponMoney() { |
| | | return couponMoney; |
| | | } |
| | | |
| | | public void setCouponMoney(Double couponMoney) { |
| | | this.couponMoney = couponMoney; |
| | | } |
| | | |
| | | public Integer getRedPacketId() { |
| | | return redPacketId; |
| | | } |
| | | |
| | | public void setRedPacketId(Integer redPacketId) { |
| | | this.redPacketId = redPacketId; |
| | | } |
| | | |
| | | public Integer getCouponId() { |
| | | return couponId; |
| | | } |
| | | |
| | | public void setCouponId(Integer couponId) { |
| | | this.couponId = couponId; |
| | | } |
| | | |
| | | public Integer getCompanyId() { |
| | | return companyId; |
| | | } |
| | | |
| | | public void setCompanyId(Integer companyId) { |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Double getPayMoney() { |
| | | return payMoney; |
| | | } |
| | | |
| | | public void setPayMoney(Double payMoney) { |
| | | this.payMoney = payMoney; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public Date getInsertTime() { |
| | | return insertTime; |
| | | } |
| | | |
| | | public void setInsertTime(Date insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | |
| | | public Date getTravelTime() { |
| | | return travelTime; |
| | | } |
| | | |
| | | public void setTravelTime(Date travelTime) { |
| | | this.travelTime = travelTime; |
| | | } |
| | | |
| | | public Date getSnatchOrderTime() { |
| | | return snatchOrderTime; |
| | | } |
| | | |
| | | public void setSnatchOrderTime(Date snatchOrderTime) { |
| | | this.snatchOrderTime = snatchOrderTime; |
| | | } |
| | | |
| | | public Date getSetOutTime() { |
| | | return setOutTime; |
| | | } |
| | | |
| | | public void setSetOutTime(Date setOutTime) { |
| | | this.setOutTime = setOutTime; |
| | | } |
| | | |
| | | public Date getArriveTime() { |
| | | return arriveTime; |
| | | } |
| | | |
| | | public void setArriveTime(Date arriveTime) { |
| | | this.arriveTime = arriveTime; |
| | | } |
| | | |
| | | public Date getStartServiceTime() { |
| | | return startServiceTime; |
| | | } |
| | | |
| | | public void setStartServiceTime(Date startServiceTime) { |
| | | this.startServiceTime = startServiceTime; |
| | | } |
| | | |
| | | public Date getEndServiceTime() { |
| | | return endServiceTime; |
| | | } |
| | | |
| | | public void setEndServiceTime(Date endServiceTime) { |
| | | this.endServiceTime = endServiceTime; |
| | | } |
| | | |
| | | public Integer getOrderSource() { |
| | | return orderSource; |
| | | } |
| | | |
| | | public void setOrderSource(Integer orderSource) { |
| | | this.orderSource = orderSource; |
| | | } |
| | | |
| | | |
| | | public Integer getInvoiceId() { |
| | | return invoiceId; |
| | | } |
| | | |
| | | public void setInvoiceId(Integer invoiceId) { |
| | | this.invoiceId = invoiceId; |
| | | } |
| | | |
| | | public Integer getPayManner() { |
| | | return payManner; |
| | | } |
| | | |
| | | public void setPayManner(Integer payManner) { |
| | | this.payManner = payManner; |
| | | } |
| | | |
| | | public String getTrackId() { |
| | | return trackId; |
| | | } |
| | | |
| | | public void setTrackId(String trackId) { |
| | | this.trackId = trackId; |
| | | } |
| | | |
| | | public Double getDiscount() { |
| | | return discount; |
| | | } |
| | | |
| | | public void setDiscount(Double discount) { |
| | | this.discount = discount; |
| | | } |
| | | |
| | | public Double getDiscountMoney() { |
| | | return discountMoney; |
| | | } |
| | | |
| | | public void setDiscountMoney(Double discountMoney) { |
| | | this.discountMoney = discountMoney; |
| | | } |
| | | |
| | | public Integer getActivityId() { |
| | | return activityId; |
| | | } |
| | | |
| | | public void setActivityId(Integer activityId) { |
| | | this.activityId = activityId; |
| | | } |
| | | |
| | | public Integer getIsDelete() { |
| | | return isDelete; |
| | | } |
| | | |
| | | public void setIsDelete(Integer isDelete) { |
| | | this.isDelete = isDelete; |
| | | } |
| | | |
| | | public String getTelX() { |
| | | return telX; |
| | | } |
| | | |
| | | public void setTelX(String telX) { |
| | | this.telX = telX; |
| | | } |
| | | |
| | | public String getBindId() { |
| | | return bindId; |
| | | } |
| | | |
| | | public void setBindId(String bindId) { |
| | | this.bindId = bindId; |
| | | } |
| | | |
| | | public String getPickUpCode() { |
| | | return pickUpCode; |
| | | } |
| | | |
| | | public void setPickUpCode(String pickUpCode) { |
| | | this.pickUpCode = pickUpCode; |
| | | } |
| | | |
| | | public Integer getIsReassign() { |
| | | return isReassign; |
| | | } |
| | | |
| | | public void setIsReassign(Integer isReassign) { |
| | | this.isReassign = isReassign; |
| | | } |
| | | |
| | | public Integer getReassignNotice() { |
| | | return reassignNotice; |
| | | } |
| | | |
| | | public void setReassignNotice(Integer reassignNotice) { |
| | | this.reassignNotice = reassignNotice; |
| | | } |
| | | |
| | | public Integer getDriverPay() { |
| | | return driverPay; |
| | | } |
| | | |
| | | public void setDriverPay(Integer driverPay) { |
| | | this.driverPay = driverPay; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderLogistics{" + |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", userId=" + userId + |
| | | ", driverId=" + driverId + |
| | | ", carId=" + carId + |
| | | ", orderNum='" + orderNum + '\'' + |
| | | ", cargoType=" + cargoType + |
| | | ", cargoNumber=" + cargoNumber + |
| | | ", remark=" + remark + |
| | | ", placementLon=" + placementLon + |
| | | ", placementLat=" + placementLat + |
| | | ", placementAddress='" + placementAddress + '\'' + |
| | | ", startLon=" + startLon + |
| | | ", startLat=" + startLat + |
| | | ", startAddress='" + startAddress + '\'' + |
| | | ", endLon=" + endLon + |
| | | ", endLat=" + endLat + |
| | | ", endAddress='" + endAddress + '\'' + |
| | | ", recipient='" + recipient + '\'' + |
| | | ", recipientPhone='" + recipientPhone + '\'' + |
| | | ", boardingLon=" + boardingLon + |
| | | ", boardingLat=" + boardingLat + |
| | | ", boardingAddress='" + boardingAddress + '\'' + |
| | | ", boardingTime=" + boardingTime + |
| | | ", getoffLon=" + getoffLon + |
| | | ", getoffLat=" + getoffLat + |
| | | ", getoffAddress='" + getoffAddress + '\'' + |
| | | ", getoffTime=" + getoffTime + |
| | | ", mileage=" + mileage + |
| | | ", payManner=" + payManner + |
| | | ", payType=" + payType + |
| | | ", orderMoney=" + orderMoney + |
| | | ", travelMoney=" + travelMoney + |
| | | ", tipMoney=" + tipMoney + |
| | | ", redPacketMoney=" + redPacketMoney + |
| | | ", couponMoney=" + couponMoney + |
| | | ", redPacketId=" + redPacketId + |
| | | ", couponId=" + couponId + |
| | | ", discount=" + discount + |
| | | ", discountMoney=" + discountMoney + |
| | | ", activityId=" + activityId + |
| | | ", companyId=" + companyId + |
| | | ", payMoney=" + payMoney + |
| | | ", state=" + state + |
| | | ", insertTime=" + insertTime + |
| | | ", travelTime=" + travelTime + |
| | | ", snatchOrderTime=" + snatchOrderTime + |
| | | ", setOutTime=" + setOutTime + |
| | | ", arriveTime=" + arriveTime + |
| | | ", startServiceTime=" + startServiceTime + |
| | | ", endServiceTime=" + endServiceTime + |
| | | ", orderSource=" + orderSource + |
| | | ", invoiceId=" + invoiceId + |
| | | ", trackId='" + trackId + '\'' + |
| | | ", isDelete=" + isDelete + |
| | | ", telX='" + telX + '\'' + |
| | | ", bindId='" + bindId + '\'' + |
| | | '}'; |
| | | } |
| | | /** |
| | | * 改派之前的订单状态 |
| | | * @return |
| | | */ |
| | | @TableField("oldState") |
| | | private Integer oldState; |
| | | /** |
| | | * 修改目的地经度 |
| | | */ |
| | | @TableField("destinationLon") |
| | | private String destinationLon; |
| | | /** |
| | | * 修改目的地纬度 |
| | | */ |
| | | @TableField("destinationLat") |
| | | private String destinationLat; |
| | | /** |
| | | * 修改目的地地址 |
| | | */ |
| | | @TableField("destination") |
| | | private String destination; |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | | import com.stylefeng.guns.modular.system.model.Region; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @param uid |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil addCancle(Integer id, String reason, String remark, Integer uid, Integer language) throws Exception; |
| | | ResultUtil addCancle(Integer id, String reason, String remark, Integer uid, Double lon, Double lat, String address, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | List<Map<String, Object>> queryCoupon(Integer language, Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取取消订单需要支付的金额 |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil<BaseWarpper> queryCancleAmount(Integer id, Integer language) throws Exception; |
| | | |
| | | /** |
| | | * 删除服务中推送定时任务 |
| | | * @param orderId |
| | | */ |
| | | void deleteTask(Integer orderId); |
| | | |
| | | |
| | | /** |
| | | * 取消订单操作 |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil cancleOrderPrivateCar(Integer id, Integer payType, Integer bankCardId, Integer cancleId, Integer type, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 取消订单支付后的处理 |
| | | * @param id 订单=id |
| | | * @param order_id 工行支付单号 |
| | | * @throws Exception |
| | | */ |
| | | void payCancelOrderPrivateCar(Integer id, String order_id, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 修改目的地 |
| | | * @param orderId |
| | | * @param endLon |
| | | * @param endLat |
| | | * @param endAddress |
| | | */ |
| | | void updateEndAddress(Integer orderId, String endLon, String endLat, String endAddress); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.impl.OrderCrossCityServiceImpl; |
| | | import com.stylefeng.guns.modular.smallLogistics.dao.OrderLogisticsMapper; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread; |
| | |
| | | import com.stylefeng.guns.modular.system.util.Tingg.model.Results; |
| | | import com.stylefeng.guns.modular.system.util.itextpdf.HtmlToPdfUtils; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.model.PaymentRecord; |
| | | import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; |
| | | import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; |
| | |
| | | import org.jsoup.select.Elements; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpEntity; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.LinkedMultiValueMap; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | |
| | | |
| | | @Autowired |
| | | private IPhoneService phoneService; |
| | | |
| | | @Autowired |
| | | private ICancleOrderService cancleOrderService; |
| | | |
| | | @Autowired |
| | | private RestTemplate internalRestTemplate; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public ResultUtil addCancle(Integer id, String reason, String remark, Integer uid, Integer language) throws Exception { |
| | | public ResultUtil addCancle(Integer id, String reason, String remark, Integer uid, Double lon, Double lat, String address, Integer language) throws Exception { |
| | | if(ToolUtil.isNotEmpty(remark)){ |
| | | if(ToolUtil.isNotEmpty(remark)){ |
| | | List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null); |
| | |
| | | if(null == orderLogistics){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,订单信息有误" : language == 2 ? "Failed to cancel order, order-information error." : "Échec de l’annulation de la commande, erreur d’information de commande."); |
| | | } |
| | | if(orderLogistics.getState() > 5 && orderLogistics.getState() != 7 && orderLogistics.getState() != 11){ |
| | | if(orderLogistics.getState() > 5 && orderLogistics.getState() != 11){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,不合法的操作" : language == 2 ? "Failed to cancel order, illegal operation." : "Échec de l’annulation de la commande, opération illégale."); |
| | | } |
| | | |
| | | if(orderLogistics.getState() == 7){ |
| | | OrderCancel orderCancel = new OrderCancel(); |
| | | orderCancel.setOrderId(id); |
| | | orderCancel.setOrderType(orderLogistics.getType()); |
| | | orderCancel.setReason(reason); |
| | | orderCancel.setRemark(remark); |
| | | orderCancel.setState(2); |
| | | orderCancel.setInsertTime(new Date()); |
| | | orderCancel.setUserType(1); |
| | | orderCancelService.insert(orderCancel); |
| | | |
| | | if(null == orderLogistics.getDriverId()){//没有接单的情况 |
| | | integer = orderCancelService.saveData(id, 4, language == 1 ? "无司机接单" : language == 2 ? "No driver to take orders" : "Pas de chauffeur pour prendre les commandes", language == 1 ? "无司机接单" : language == 2 ? "No driver to take orders" : "Pas de chauffeur pour prendre les commandes", null, null, 2, 1, uid); |
| | | orderLogistics.setState(10); |
| | | this.updateById(orderLogistics); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | //回退支付金额 |
| | | if(null != orderLogistics.getPayType() && orderLogistics.getPayType() == 1) {//微信 |
| | | OrderCancel orderCancel = new OrderCancel(); |
| | | orderCancel.setOrderId(id); |
| | | orderCancel.setOrderType(orderLogistics.getType()); |
| | | orderCancel.setReason(reason); |
| | | orderCancel.setRemark(remark); |
| | | orderCancel.setState(1); |
| | | orderCancel.setInsertTime(new Date()); |
| | | orderCancel.setUserType(1); |
| | | orderCancelService.insert(orderCancel); |
| | | orderLogistics.setState(10); |
| | | this.updateById(orderLogistics); |
| | | //调用回退接口 |
| | | PaymentRecord query = paymentRecordService.query(1, orderLogistics.getUserId(), 1, orderLogistics.getId(), orderLogistics.getType(), 1, 2); |
| | | if(null == query){ |
| | | return ResultUtil.error("支付数据异常,无法完成退款"); |
| | | }else { |
| | | BaseWarpper data = queryCancleAmount(id, language).getData(); |
| | | Double amount = data.getAmount(); |
| | | if(0 == amount){ |
| | | integer = orderCancelService.saveData(id, 4, reason, remark, null, null, 2, 1, uid); |
| | | if(5 == orderLogistics.getState()){ |
| | | orderLogistics.setState(6); |
| | | orderLogistics.setGetoffLon(lon); |
| | | orderLogistics.setGetoffLat(lat); |
| | | orderLogistics.setGetoffAddress(address); |
| | | orderLogistics.setGetoffTime(new Date()); |
| | | orderLogistics.setEndServiceTime(new Date()); |
| | | }else{ |
| | | orderLogistics.setState(10); |
| | | } |
| | | this.updateById(orderLogistics); |
| | | }else{ |
| | | if(5 == orderLogistics.getState()){ |
| | | orderLogistics.setGetoffLon(lon); |
| | | orderLogistics.setGetoffLat(lat); |
| | | orderLogistics.setGetoffAddress(address); |
| | | orderLogistics.setGetoffTime(new Date()); |
| | | orderLogistics.setEndServiceTime(new Date()); |
| | | } |
| | | orderLogistics.setOldState(orderLogistics.getState()); |
| | | orderLogistics.setState(12); |
| | | this.updateById(orderLogistics); |
| | | integer = orderCancelService.saveData(id, 4, reason, remark, null, amount, 1, 1, uid); |
| | | } |
| | | UserInfo userInfo = userInfoService.selectById(orderLogistics.getUserId()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String payerTransactionID = sdf.format(new Date()) + orderCancel.getId(); |
| | | PayoutResponse payoutResponse = tinggPayoutUtil.sendPayout(userInfo.getPhoneOperator(), "+" + userInfo.getPhone(), payerTransactionID, query.getAmount().doubleValue(), callbackPath + "/base/orderCancelRefundCallback", "取消订单退款"); |
| | | AuthStatus authStatus = payoutResponse.getAuthStatus(); |
| | | Results results = payoutResponse.getResults().get(0); |
| | | String statusCode = results.getStatusCode(); |
| | | if(!"131".equals(authStatus.getAuthStatusCode())){ |
| | | return ResultUtil.error(authStatus.getAuthStatusDescription()); |
| | | } |
| | | if(!"139".equals(statusCode)){ |
| | | return ResultUtil.error(results.getStatusDescription()); |
| | | } |
| | | } |
| | | if(null != orderLogistics.getPayType() && orderLogistics.getPayType() == 2){//支付宝 |
| | | OrderCancel orderCancel = new OrderCancel(); |
| | | orderCancel.setOrderId(id); |
| | | orderCancel.setOrderType(orderLogistics.getType()); |
| | | orderCancel.setReason(reason); |
| | | orderCancel.setRemark(remark); |
| | | orderCancel.setState(1); |
| | | orderCancel.setInsertTime(new Date()); |
| | | orderCancel.setUserType(1); |
| | | orderCancelService.insert(orderCancel); |
| | | orderLogistics.setState(10); |
| | | this.updateById(orderLogistics); |
| | | integer = orderCancel.getId(); |
| | | //调用回退接口 |
| | | PaymentRecord query = paymentRecordService.query(1, orderLogistics.getUserId(), 1, orderLogistics.getId(), orderLogistics.getType(), 2, 2); |
| | | if(null == query){ |
| | | return ResultUtil.error("支付数据异常,无法完成退款"); |
| | | } |
| | | UserInfo userInfo = userInfoService.selectById(orderLogistics.getUserId()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String payerTransactionID = sdf.format(new Date()) + orderCancel.getId(); |
| | | PayoutResponse payoutResponse = tinggPayoutUtil.sendPayout(userInfo.getPhoneOperator(), "+" + userInfo.getPhone(), payerTransactionID, query.getAmount().doubleValue(), callbackPath + "/base/orderCancelRefundCallback", "取消订单退款"); |
| | | AuthStatus authStatus = payoutResponse.getAuthStatus(); |
| | | Results results = payoutResponse.getResults().get(0); |
| | | String statusCode = results.getStatusCode(); |
| | | if(!"131".equals(authStatus.getAuthStatusCode())){ |
| | | return ResultUtil.error(authStatus.getAuthStatusDescription()); |
| | | } |
| | | if(!"139".equals(statusCode)){ |
| | | return ResultUtil.error(results.getStatusDescription()); |
| | | } |
| | | } |
| | | if(null != orderLogistics.getPayType() && orderLogistics.getPayType() == 3){//余额 |
| | | UserInfo userInfo = userInfoService.selectById(orderLogistics.getUserId()); |
| | | userInfo.setBalance(userInfo.getBalance() + orderLogistics.getPayMoney()); |
| | | |
| | | OrderCancel orderCancel = new OrderCancel(); |
| | | orderCancel.setOrderId(id); |
| | | orderCancel.setOrderType(orderLogistics.getType()); |
| | | orderCancel.setReason(reason); |
| | | orderCancel.setRemark(remark); |
| | | orderCancel.setState(2); |
| | | orderCancel.setInsertTime(new Date()); |
| | | orderCancel.setUserType(1); |
| | | orderCancelService.insert(orderCancel); |
| | | userInfoService.updateById(userInfo); |
| | | orderLogistics.setState(10); |
| | | this.updateById(orderLogistics); |
| | | integer = orderCancel.getId(); |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(orderLogistics.getUserId(), "包裹取消退款", orderLogistics.getPayMoney(), 1, 1, 1, 4, orderLogistics.getId()); |
| | | } |
| | | |
| | | |
| | | if(null != orderLogistics.getPayType() && orderLogistics.getPayType() == 4){//现金 |
| | | // UserInfo userInfo = userInfoService.selectById(orderLogistics.getUserId()); |
| | | // userInfo.setBalance(userInfo.getBalance() + orderLogistics.getPayMoney()); |
| | | // userInfoService.updateById(userInfo); |
| | | OrderCancel orderCancel = new OrderCancel(); |
| | | orderCancel.setOrderId(id); |
| | | orderCancel.setOrderType(orderLogistics.getType()); |
| | | orderCancel.setReason(reason); |
| | | orderCancel.setRemark(remark); |
| | | orderCancel.setState(2); |
| | | orderCancel.setInsertTime(new Date()); |
| | | orderCancel.setUserType(1); |
| | | orderCancelService.insert(orderCancel); |
| | | |
| | | orderLogistics.setState(10); |
| | | this.updateById(orderLogistics); |
| | | integer = orderCancel.getId(); |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(orderLogistics.getUserId(), "包裹取消退款", orderLogistics.getPayMoney(), 1, 1, 1, 4, orderLogistics.getId()); |
| | | this.deleteTask(id);//删除定时任务 |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0); |
| | | System.err.println("推送取消操作---------------------"); |
| | | } |
| | | }).start(); |
| | | |
| | | //修改司机为空闲 |
| | | Driver driver = driverService.selectById(orderLogistics.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | } |
| | | |
| | | if(null != orderLogistics.getDriverId()){ |
| | |
| | | list.addAll(list1); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取取消需要支付的金额 |
| | | * @param id |
| | | * @param language |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil<BaseWarpper> queryCancleAmount(Integer id, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(id); |
| | | if(null == orderLogistics){ |
| | | return ResultUtil.error(language == 1 ? "获取数据失败,订单信息有误" : language == 2 ? "Failed to obtain data, order-information error." : "Impossible d’obtenir les données, erreur d’information de commande. "); |
| | | } |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | double amount = 0; |
| | | CancleOrder query = cancleOrderService.query(orderLogistics.getCompanyId()); |
| | | if(null == query || null == orderLogistics.getDriverId()){ |
| | | baseWarpper.setAmount(amount); |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | JSONObject object = JSON.parseObject(query.getContent()); |
| | | long t = object.getInteger("driverTimeout") * 60000L; |
| | | //司机超时未到达起点,免费取消 |
| | | if(orderLogistics.getState() < 3 && orderLogistics.getSnatchOrderTime().getTime() + t < System.currentTimeMillis()){ |
| | | baseWarpper.setAmount(amount); |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | | JSONObject order = object.getJSONObject("order"); |
| | | long m = order.getInteger("orderAcceptanceTime") * 60000L; |
| | | //超过免费时间,计算费用 |
| | | if(orderLogistics.getSnatchOrderTime().getTime() + m < System.currentTimeMillis()){ |
| | | BigDecimal money = order.getBigDecimal("money"); |
| | | if(null != orderLogistics.getSetOutTime()){ |
| | | //里程费 |
| | | BigDecimal mileageFee = order.getBigDecimal("mileageFee").multiply(new BigDecimal(orderLogistics.getMileage() / 1000)); |
| | | //时长费 |
| | | int s = Double.valueOf((System.currentTimeMillis() - orderLogistics.getSetOutTime().getTime()) / 60000).intValue(); |
| | | BigDecimal durationFee = order.getBigDecimal("durationFee").multiply(new BigDecimal(s)); |
| | | money = money.add(durationFee).add(mileageFee); |
| | | } |
| | | amount = money.setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | } |
| | | baseWarpper.setAmount(amount); |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除定时任务 |
| | | * @param orderId |
| | | */ |
| | | @Override |
| | | public void deleteTask(Integer orderId){ |
| | | //发送验证码短信 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("orderId", orderId + ""); |
| | | params.add("orderType", "4"); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://driver-server/base/netty/deleteTask", requestEntity, String.class); |
| | | JSONObject jsonObject = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject.getIntValue("code") != 200){ |
| | | System.err.println("调用driver-server出错了"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 取消订单操作 |
| | | * @param id |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil cancleOrderPrivateCar(Integer id, Integer payType, Integer bankCardId, Integer cancleId, Integer type, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(id); |
| | | Integer uid = orderLogistics.getUserId(); |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | ResultUtil resultUtil = ResultUtil.success(""); |
| | | |
| | | if(null == orderLogistics){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,订单信息有误" : language == 2 ? "Failed to cancel order, order-information error." : "Échec de l’annulation de la commande, erreur d’information de commande.", ""); |
| | | } |
| | | if(orderLogistics.getState() != 13){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,不合法的操作" : language == 2 ? "Failed to cancel order, illegal operation." : "Échec de l’annulation de la commande, opération illégale.", ""); |
| | | } |
| | | OrderCancel orderCancel = null; |
| | | if(null == cancleId || cancleId==0){ |
| | | orderCancel = orderCancelService.query(id, 4, null, null, 1); |
| | | }else{ |
| | | orderCancel = orderCancelService.selectById(cancleId); |
| | | } |
| | | |
| | | Double amount = queryCancleAmount(id, language).getData().getAmount(); |
| | | if(0 < amount){ |
| | | if(payType == 1){//手机支付 |
| | | orderCancel.setPayType(1); |
| | | orderCancelService.updateById(orderCancel); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String merchantTransactionId = sdf.format(new Date()) + "4" + language + id; |
| | | CheckoutRequest checkoutRequest = new CheckoutRequest(); |
| | | checkoutRequest.setMsisdn(Long.valueOf(userInfo.getPhone())); |
| | | checkoutRequest.setCustomerEmail(userInfo.getEmail()); |
| | | checkoutRequest.setAccountNumber(userInfo.getPhone()); |
| | | checkoutRequest.setCustomerFirstName(userInfo.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(userInfo.getLastName()); |
| | | checkoutRequest.setRequestAmount(amount); |
| | | checkoutRequest.setMerchantTransactionId(merchantTransactionId); |
| | | checkoutRequest.setRequestDescription("Cancel a trip"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, id, 4, 1, amount, null, 1);//添加预支付数据 |
| | | } |
| | | |
| | | } |
| | | if(payType == 2){//银行卡支付 |
| | | orderCancel.setPayType(2); |
| | | orderCancelService.updateById(orderCancel); |
| | | BankCard bankCard = bankCardService.selectById(bankCardId); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String merchantTransactionId = sdf.format(new Date()) + "4" + id; |
| | | CheckoutRequest checkoutRequest = new CheckoutRequest(); |
| | | checkoutRequest.setMsisdn(Long.valueOf(bankCard.getCode())); |
| | | checkoutRequest.setCustomerEmail(userInfo.getEmail()); |
| | | checkoutRequest.setAccountNumber(bankCard.getCode()); |
| | | checkoutRequest.setCustomerFirstName(bankCard.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(bankCard.getLastName()); |
| | | checkoutRequest.setRequestAmount(amount); |
| | | checkoutRequest.setMerchantTransactionId(merchantTransactionId); |
| | | checkoutRequest.setRequestDescription("Cancel a trip"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html"); |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, id, 4, 2, amount, null, 1);//添加预支付数据 |
| | | } |
| | | |
| | | } |
| | | if(payType == 3){//余额支付 |
| | | if(userInfo.getBalance() != null && userInfo.getBalance() < amount){ |
| | | return ResultUtil.error((language == 1 ? "账户余额不足" : language == 2 ? "Insufficient balance" : "Solde insuffisant"), ""); |
| | | } |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(amount)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "取消订单", amount, 2, 1, 1, 4, id); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | //解除小号绑定 |
| | | if(orderLogistics.getBindId() != null){ |
| | | ChinaMobileUtil.midAxbUnBindSend(orderLogistics.getBindId(),orderLogistics.getTelX()); |
| | | } |
| | | |
| | | if(5 == orderLogistics.getOldState()){ |
| | | orderLogistics.setState(6); |
| | | }else{ |
| | | orderLogistics.setState(10); |
| | | } |
| | | orderLogistics.setTelX(""); |
| | | orderLogistics.setBindId(""); |
| | | this.updateById(orderLogistics); |
| | | |
| | | orderCancel.setState(2); |
| | | orderCancel.setPayType(3); |
| | | orderCancelService.updateById(orderCancel); |
| | | |
| | | if(null != orderLogistics.getDriverId()){ |
| | | BigDecimal c =new BigDecimal(amount);//司机收入 |
| | | incomeService.saveData(2, orderLogistics.getDriverId(), 3, orderLogistics.getId(), 4, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderLogistics.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | |
| | | this.deleteTask(id);//删除定时任务 |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0); |
| | | } |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0); |
| | | |
| | | |
| | | //添加消息 |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用余额成功支付取消订单费用,谢谢使用!" : language == 2 |
| | | ? "You've paid for cancellation fee with the balance successfully, thank you for using I-GO" |
| | | : "Vous avez utilisé avec succès votre solde pour payer les frais d’annulation, merci d’utiliser I-GO", orderLogistics.getUserId(), 1); |
| | | } |
| | | } |
| | | return resultUtil; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 取消订单支付后的处理 |
| | | * @param id 订单=id |
| | | * @param order_id 工行支付单号 |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public void payCancelOrderPrivateCar(Integer id, String order_id, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(id); |
| | | PaymentRecord query = paymentRecordService.query(1, null, null, Integer.valueOf(id), 4, null, 1); |
| | | if(null != query){ |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(orderLogistics.getUserId(), "取消订单", query.getAmount(), 2, 1, 1, 4, query.getOrderId()); |
| | | |
| | | //解除小号绑定 |
| | | if(orderLogistics.getBindId() != null){ |
| | | ChinaMobileUtil.midAxbUnBindSend(orderLogistics.getBindId(),orderLogistics.getTelX()); |
| | | } |
| | | if(5 == orderLogistics.getOldState()){ |
| | | orderLogistics.setState(6); |
| | | }else{ |
| | | orderLogistics.setState(10); |
| | | } |
| | | orderLogistics.setBindId(""); |
| | | orderLogistics.setTelX(""); |
| | | this.updateById(orderLogistics); |
| | | |
| | | query.setState(2); |
| | | query.setCode(order_id); |
| | | paymentRecordService.updateById(query); |
| | | |
| | | OrderCancel query1 = orderCancelService.query(query.getOrderId(), query.getOrderType(), query.getAmount(), query.getPayType(), 1); |
| | | if (null != query1){ |
| | | query1.setState(2); |
| | | orderCancelService.updateById(query1); |
| | | } |
| | | |
| | | |
| | | if(null != orderLogistics.getDriverId()){ |
| | | BigDecimal c =new BigDecimal(query.getAmount());//司机收入 |
| | | incomeService.saveData(2, orderLogistics.getDriverId(), 3, orderLogistics.getId(), 4, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderLogistics.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | this.deleteTask(orderLogistics.getId());//删除定时任务 |
| | | |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0); |
| | | } |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0); |
| | | |
| | | //添加消息 |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用余额成功支付取消订单费用,谢谢使用!" : language == 2 |
| | | ? "You've paid for cancellation fee with the balance successfully, thank you for using I-GO" |
| | | : "Vous avez utilisé avec succès votre solde pour payer les frais d’annulation, merci d’utiliser I-GO", orderLogistics.getUserId(), 1); |
| | | }else{ |
| | | System.err.println("预支付数据异常(orderId = " + id + ")"); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改目的地 |
| | | * @param orderId |
| | | * @param endLon |
| | | * @param endLat |
| | | * @param endAddress |
| | | */ |
| | | @Override |
| | | public void updateEndAddress(Integer orderId, String endLon, String endLat, String endAddress) { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | if(null != orderLogistics.getDriverId()){ |
| | | orderLogistics.setDestination(endAddress); |
| | | orderLogistics.setDestinationLat(endLat); |
| | | orderLogistics.setDestinationLon(endLon); |
| | | this.updateById(orderLogistics); |
| | | pushUtil.pushModifyAddress(2, orderLogistics.getDriverId(), orderId, 1, 1); |
| | | }else{ |
| | | orderLogistics.setEndAddress(endAddress); |
| | | orderLogistics.setEndLat(Double.valueOf(endLat)); |
| | | orderLogistics.setEndLon(Double.valueOf(endLon)); |
| | | this.updateById(orderLogistics); |
| | | } |
| | | } |
| | | } |
| | |
| | | oldState as oldState, |
| | | telX as telX, |
| | | bindId as bindId |
| | | from t_order_private_car where isDelete = 1 and userId = #{uid} |
| | | from t_order_private_car where isDelete = 1 and isFrozen = 1 and userId = #{uid} |
| | | <if test="null != orderType"> |
| | | and orderType = #{orderType} |
| | | </if> |
| | |
| | | driverId as driverId, |
| | | (1) as orderType, |
| | | state as state, |
| | | oldState as oldState |
| | | oldState as oldState, |
| | | isFrozen |
| | | from t_order_private_car where userId = #{uid} and isDelete = 1 order by insertTime desc limit #{pageNum}, #{size} |
| | | </select> |
| | | |
| | |
| | | h.money as cancelMoney, |
| | | h.reason as cancelReason, |
| | | h.remark as cancelRemark, |
| | | a.isFree,a.moneyType,a.moneyTime |
| | | a.isFree, |
| | | a.moneyType, |
| | | a.moneyTime, |
| | | a.isFrozen |
| | | from t_order_private_car a |
| | | left join t_driver b on (a.driverId = b.id) |
| | | left join t_car c on (a.carId = c.id) |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | |
| | | /** |
| | | * 专车车订单 |
| | | */ |
| | | @Data |
| | | @TableName("t_order_private_car") |
| | | public class OrderPrivateCar { |
| | | /** |
| | |
| | | */ |
| | | @TableField("driverPay") |
| | | private Integer driverPay; |
| | | |
| | | public Integer getIsplatPay() { |
| | | return isplatPay; |
| | | } |
| | | |
| | | public void setIsplatPay(Integer isplatPay) { |
| | | this.isplatPay = isplatPay; |
| | | } |
| | | |
| | | public BigDecimal getFreeMoney() { |
| | | return freeMoney; |
| | | } |
| | | public void setFreeMoney(BigDecimal freeMoney) { |
| | | this.freeMoney = freeMoney; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getCrossCityOrderId() { |
| | | return crossCityOrderId; |
| | | } |
| | | |
| | | public void setCrossCityOrderId(Integer crossCityOrderId) { |
| | | this.crossCityOrderId = crossCityOrderId; |
| | | } |
| | | |
| | | public Integer getPlace() { |
| | | return place; |
| | | } |
| | | |
| | | public void setPlace(Integer place) { |
| | | this.place = place; |
| | | } |
| | | |
| | | public Integer getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Integer getServerCarModelId() { |
| | | return serverCarModelId; |
| | | } |
| | | |
| | | public void setServerCarModelId(Integer serverCarModelId) { |
| | | this.serverCarModelId = serverCarModelId; |
| | | } |
| | | |
| | | public Integer getDriverId() { |
| | | return driverId; |
| | | } |
| | | |
| | | public void setDriverId(Integer driverId) { |
| | | this.driverId = driverId; |
| | | } |
| | | |
| | | public Integer getCarId() { |
| | | return carId; |
| | | } |
| | | |
| | | public void setCarId(Integer carId) { |
| | | this.carId = carId; |
| | | } |
| | | |
| | | public String getOrderNum() { |
| | | return orderNum; |
| | | } |
| | | |
| | | public void setOrderNum(String orderNum) { |
| | | this.orderNum = orderNum; |
| | | } |
| | | |
| | | public Double getPlacementLon() { |
| | | return placementLon; |
| | | } |
| | | |
| | | public void setPlacementLon(Double placementLon) { |
| | | this.placementLon = placementLon; |
| | | } |
| | | |
| | | public Double getPlacementLat() { |
| | | return placementLat; |
| | | } |
| | | |
| | | public void setPlacementLat(Double placementLat) { |
| | | this.placementLat = placementLat; |
| | | } |
| | | |
| | | public String getPlacementAddress() { |
| | | return placementAddress; |
| | | } |
| | | |
| | | public void setPlacementAddress(String placementAddress) { |
| | | this.placementAddress = placementAddress; |
| | | } |
| | | |
| | | public Double getStartLon() { |
| | | return startLon; |
| | | } |
| | | |
| | | public void setStartLon(Double startLon) { |
| | | this.startLon = startLon; |
| | | } |
| | | |
| | | public Double getStartLat() { |
| | | return startLat; |
| | | } |
| | | |
| | | public void setStartLat(Double startLat) { |
| | | this.startLat = startLat; |
| | | } |
| | | |
| | | public String getStartAddress() { |
| | | return startAddress; |
| | | } |
| | | |
| | | public void setStartAddress(String startAddress) { |
| | | this.startAddress = startAddress; |
| | | } |
| | | |
| | | public Double getEndLon() { |
| | | return endLon; |
| | | } |
| | | |
| | | public void setEndLon(Double endLon) { |
| | | this.endLon = endLon; |
| | | } |
| | | |
| | | public Double getEndLat() { |
| | | return endLat; |
| | | } |
| | | |
| | | public void setEndLat(Double endLat) { |
| | | this.endLat = endLat; |
| | | } |
| | | |
| | | public String getEndAddress() { |
| | | return endAddress; |
| | | } |
| | | |
| | | public void setEndAddress(String endAddress) { |
| | | this.endAddress = endAddress; |
| | | } |
| | | |
| | | public Double getBoardingLon() { |
| | | return boardingLon; |
| | | } |
| | | |
| | | public void setBoardingLon(Double boardingLon) { |
| | | this.boardingLon = boardingLon; |
| | | } |
| | | |
| | | public Double getBoardingLat() { |
| | | return boardingLat; |
| | | } |
| | | |
| | | public void setBoardingLat(Double boardingLat) { |
| | | this.boardingLat = boardingLat; |
| | | } |
| | | |
| | | public String getBoardingAddress() { |
| | | return boardingAddress; |
| | | } |
| | | |
| | | public void setBoardingAddress(String boardingAddress) { |
| | | this.boardingAddress = boardingAddress; |
| | | } |
| | | |
| | | public Date getBoardingTime() { |
| | | return boardingTime; |
| | | } |
| | | |
| | | public void setBoardingTime(Date boardingTime) { |
| | | this.boardingTime = boardingTime; |
| | | } |
| | | |
| | | public Double getGetoffLon() { |
| | | return getoffLon; |
| | | } |
| | | |
| | | public void setGetoffLon(Double getoffLon) { |
| | | this.getoffLon = getoffLon; |
| | | } |
| | | |
| | | public Double getGetoffLat() { |
| | | return getoffLat; |
| | | } |
| | | |
| | | public void setGetoffLat(Double getoffLat) { |
| | | this.getoffLat = getoffLat; |
| | | } |
| | | |
| | | public String getGetoffAddress() { |
| | | return getoffAddress; |
| | | } |
| | | |
| | | public void setGetoffAddress(String getoffAddress) { |
| | | this.getoffAddress = getoffAddress; |
| | | } |
| | | |
| | | public Date getGetoffTime() { |
| | | return getoffTime; |
| | | } |
| | | |
| | | public void setGetoffTime(Date getoffTime) { |
| | | this.getoffTime = getoffTime; |
| | | } |
| | | |
| | | public Double getMileage() { |
| | | return mileage; |
| | | } |
| | | |
| | | public void setMileage(Double mileage) { |
| | | this.mileage = mileage; |
| | | } |
| | | |
| | | public Integer getPayManner() { |
| | | return payManner; |
| | | } |
| | | |
| | | public void setPayManner(Integer payManner) { |
| | | this.payManner = payManner; |
| | | } |
| | | |
| | | public Integer getPayType() { |
| | | return payType; |
| | | } |
| | | |
| | | public void setPayType(Integer payType) { |
| | | this.payType = payType; |
| | | } |
| | | |
| | | public Double getOrderMoney() { |
| | | return orderMoney; |
| | | } |
| | | |
| | | public void setOrderMoney(Double orderMoney) { |
| | | this.orderMoney = orderMoney; |
| | | } |
| | | |
| | | public Double getStartMileage() { |
| | | return startMileage; |
| | | } |
| | | |
| | | public void setStartMileage(Double startMileage) { |
| | | this.startMileage = startMileage; |
| | | } |
| | | |
| | | public Double getStartMoney() { |
| | | return startMoney; |
| | | } |
| | | |
| | | public void setStartMoney(Double startMoney) { |
| | | this.startMoney = startMoney; |
| | | } |
| | | |
| | | public Double getMileageKilometers() { |
| | | return mileageKilometers; |
| | | } |
| | | |
| | | public void setMileageKilometers(Double mileageKilometers) { |
| | | this.mileageKilometers = mileageKilometers; |
| | | } |
| | | |
| | | public Double getMileageMoney() { |
| | | return mileageMoney; |
| | | } |
| | | |
| | | public void setMileageMoney(Double mileageMoney) { |
| | | this.mileageMoney = mileageMoney; |
| | | } |
| | | |
| | | public Double getDuration() { |
| | | return duration; |
| | | } |
| | | |
| | | public void setDuration(Double duration) { |
| | | this.duration = duration; |
| | | } |
| | | |
| | | public Double getDurationMoney() { |
| | | return durationMoney; |
| | | } |
| | | |
| | | public void setDurationMoney(Double durationMoney) { |
| | | this.durationMoney = durationMoney; |
| | | } |
| | | |
| | | public Double getWait() { |
| | | return wait; |
| | | } |
| | | |
| | | public void setWait(Double wait) { |
| | | this.wait = wait; |
| | | } |
| | | |
| | | public Double getWaitMoney() { |
| | | return waitMoney; |
| | | } |
| | | |
| | | public void setWaitMoney(Double waitMoney) { |
| | | this.waitMoney = waitMoney; |
| | | } |
| | | |
| | | public Double getLongDistance() { |
| | | return longDistance; |
| | | } |
| | | |
| | | public void setLongDistance(Double longDistance) { |
| | | this.longDistance = longDistance; |
| | | } |
| | | |
| | | public Double getLongDistanceMoney() { |
| | | return longDistanceMoney; |
| | | } |
| | | |
| | | public void setLongDistanceMoney(Double longDistanceMoney) { |
| | | this.longDistanceMoney = longDistanceMoney; |
| | | } |
| | | |
| | | public Double getParkMoney() { |
| | | return parkMoney; |
| | | } |
| | | |
| | | public void setParkMoney(Double parkMoney) { |
| | | this.parkMoney = parkMoney; |
| | | } |
| | | |
| | | public Double getRoadTollMoney() { |
| | | return roadTollMoney; |
| | | } |
| | | |
| | | public void setRoadTollMoney(Double roadTollMoney) { |
| | | this.roadTollMoney = roadTollMoney; |
| | | } |
| | | |
| | | public Double getRedPacketMoney() { |
| | | return redPacketMoney; |
| | | } |
| | | |
| | | public void setRedPacketMoney(Double redPacketMoney) { |
| | | this.redPacketMoney = redPacketMoney; |
| | | } |
| | | |
| | | public Double getCouponMoney() { |
| | | return couponMoney; |
| | | } |
| | | |
| | | public void setCouponMoney(Double couponMoney) { |
| | | this.couponMoney = couponMoney; |
| | | } |
| | | |
| | | public Integer getRedPacketId() { |
| | | return redPacketId; |
| | | } |
| | | |
| | | public void setRedPacketId(Integer redPacketId) { |
| | | this.redPacketId = redPacketId; |
| | | } |
| | | |
| | | public Integer getCouponId() { |
| | | return couponId; |
| | | } |
| | | |
| | | public void setCouponId(Integer couponId) { |
| | | this.couponId = couponId; |
| | | } |
| | | |
| | | public Double getDiscount() { |
| | | return discount; |
| | | } |
| | | |
| | | public void setDiscount(Double discount) { |
| | | this.discount = discount; |
| | | } |
| | | |
| | | public Double getDiscountMoney() { |
| | | return discountMoney; |
| | | } |
| | | |
| | | public void setDiscountMoney(Double discountMoney) { |
| | | this.discountMoney = discountMoney; |
| | | } |
| | | |
| | | public Integer getActivityId() { |
| | | return activityId; |
| | | } |
| | | |
| | | public void setActivityId(Integer activityId) { |
| | | this.activityId = activityId; |
| | | } |
| | | |
| | | public Integer getCompanyId() { |
| | | return companyId; |
| | | } |
| | | |
| | | public void setCompanyId(Integer companyId) { |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Double getPayMoney() { |
| | | return payMoney; |
| | | } |
| | | |
| | | public void setPayMoney(Double payMoney) { |
| | | this.payMoney = payMoney; |
| | | } |
| | | |
| | | public Integer getSubstitute() { |
| | | return substitute; |
| | | } |
| | | |
| | | public void setSubstitute(Integer substitute) { |
| | | this.substitute = substitute; |
| | | } |
| | | |
| | | public String getPassengers() { |
| | | return passengers; |
| | | } |
| | | |
| | | public void setPassengers(String passengers) { |
| | | this.passengers = passengers; |
| | | } |
| | | |
| | | public String getPassengersPhone() { |
| | | return passengersPhone; |
| | | } |
| | | |
| | | public void setPassengersPhone(String passengersPhone) { |
| | | this.passengersPhone = passengersPhone; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public Date getInsertTime() { |
| | | return insertTime; |
| | | } |
| | | |
| | | public void setInsertTime(Date insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | |
| | | public Date getTravelTime() { |
| | | return travelTime; |
| | | } |
| | | |
| | | public void setTravelTime(Date travelTime) { |
| | | this.travelTime = travelTime; |
| | | } |
| | | |
| | | public Date getSnatchOrderTime() { |
| | | return snatchOrderTime; |
| | | } |
| | | |
| | | public void setSnatchOrderTime(Date snatchOrderTime) { |
| | | this.snatchOrderTime = snatchOrderTime; |
| | | } |
| | | |
| | | public Date getSetOutTime() { |
| | | return setOutTime; |
| | | } |
| | | |
| | | public void setSetOutTime(Date setOutTime) { |
| | | this.setOutTime = setOutTime; |
| | | } |
| | | |
| | | public Date getArriveTime() { |
| | | return arriveTime; |
| | | } |
| | | |
| | | public void setArriveTime(Date arriveTime) { |
| | | this.arriveTime = arriveTime; |
| | | } |
| | | |
| | | public Date getStartServiceTime() { |
| | | return startServiceTime; |
| | | } |
| | | |
| | | public void setStartServiceTime(Date startServiceTime) { |
| | | this.startServiceTime = startServiceTime; |
| | | } |
| | | |
| | | public Date getEndServiceTime() { |
| | | return endServiceTime; |
| | | } |
| | | |
| | | public void setEndServiceTime(Date endServiceTime) { |
| | | this.endServiceTime = endServiceTime; |
| | | } |
| | | |
| | | public Integer getOrderType() { |
| | | return orderType; |
| | | } |
| | | |
| | | public void setOrderType(Integer orderType) { |
| | | this.orderType = orderType; |
| | | } |
| | | |
| | | public Integer getOrderSource() { |
| | | return orderSource; |
| | | } |
| | | |
| | | public void setOrderSource(Integer orderSource) { |
| | | this.orderSource = orderSource; |
| | | } |
| | | |
| | | public Integer getInvoiceId() { |
| | | return invoiceId; |
| | | } |
| | | |
| | | public void setInvoiceId(Integer invoiceId) { |
| | | this.invoiceId = invoiceId; |
| | | } |
| | | |
| | | public Integer getIsReassign() { |
| | | return isReassign; |
| | | } |
| | | |
| | | public void setIsReassign(Integer isReassign) { |
| | | this.isReassign = isReassign; |
| | | } |
| | | |
| | | public Integer getReassignNotice() { |
| | | return reassignNotice; |
| | | } |
| | | |
| | | public void setReassignNotice(Integer reassignNotice) { |
| | | this.reassignNotice = reassignNotice; |
| | | } |
| | | |
| | | public String getTrackId() { |
| | | return trackId; |
| | | } |
| | | |
| | | public void setTrackId(String trackId) { |
| | | this.trackId = trackId; |
| | | } |
| | | |
| | | public Integer getIsDelete() { |
| | | return isDelete; |
| | | } |
| | | |
| | | public void setIsDelete(Integer isDelete) { |
| | | this.isDelete = isDelete; |
| | | } |
| | | |
| | | public Integer getOldState() { |
| | | return oldState; |
| | | } |
| | | |
| | | public void setOldState(Integer oldState) { |
| | | this.oldState = oldState; |
| | | } |
| | | |
| | | public String getTelX() { |
| | | return telX; |
| | | } |
| | | |
| | | public void setTelX(String telX) { |
| | | this.telX = telX; |
| | | } |
| | | |
| | | public String getBindId() { |
| | | return bindId; |
| | | } |
| | | |
| | | public void setBindId(String bindId) { |
| | | this.bindId = bindId; |
| | | } |
| | | |
| | | public Integer getDriverPay() { |
| | | return driverPay; |
| | | } |
| | | |
| | | public void setDriverPay(Integer driverPay) { |
| | | this.driverPay = driverPay; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderPrivateCar{" + |
| | | "id=" + id + |
| | | ", type=" + type + |
| | | ", crossCityOrderId=" + crossCityOrderId + |
| | | ", place=" + place + |
| | | ", userId=" + userId + |
| | | ", serverCarModelId=" + serverCarModelId + |
| | | ", driverId=" + driverId + |
| | | ", carId=" + carId + |
| | | ", orderNum='" + orderNum + '\'' + |
| | | ", placementLon=" + placementLon + |
| | | ", placementLat=" + placementLat + |
| | | ", placementAddress='" + placementAddress + '\'' + |
| | | ", startLon=" + startLon + |
| | | ", startLat=" + startLat + |
| | | ", startAddress='" + startAddress + '\'' + |
| | | ", endLon=" + endLon + |
| | | ", endLat=" + endLat + |
| | | ", endAddress='" + endAddress + '\'' + |
| | | ", boardingLon=" + boardingLon + |
| | | ", boardingLat=" + boardingLat + |
| | | ", boardingAddress='" + boardingAddress + '\'' + |
| | | ", boardingTime=" + boardingTime + |
| | | ", getoffLon=" + getoffLon + |
| | | ", getoffLat=" + getoffLat + |
| | | ", getoffAddress='" + getoffAddress + '\'' + |
| | | ", getoffTime=" + getoffTime + |
| | | ", mileage=" + mileage + |
| | | ", payManner=" + payManner + |
| | | ", payType=" + payType + |
| | | ", orderMoney=" + orderMoney + |
| | | ", startMileage=" + startMileage + |
| | | ", startMoney=" + startMoney + |
| | | ", mileageKilometers=" + mileageKilometers + |
| | | ", mileageMoney=" + mileageMoney + |
| | | ", duration=" + duration + |
| | | ", durationMoney=" + durationMoney + |
| | | ", wait=" + wait + |
| | | ", waitMoney=" + waitMoney + |
| | | ", longDistance=" + longDistance + |
| | | ", longDistanceMoney=" + longDistanceMoney + |
| | | ", parkMoney=" + parkMoney + |
| | | ", roadTollMoney=" + roadTollMoney + |
| | | ", redPacketMoney=" + redPacketMoney + |
| | | ", couponMoney=" + couponMoney + |
| | | ", redPacketId=" + redPacketId + |
| | | ", couponId=" + couponId + |
| | | ", discount=" + discount + |
| | | ", discountMoney=" + discountMoney + |
| | | ", activityId=" + activityId + |
| | | ", companyId=" + companyId + |
| | | ", payMoney=" + payMoney + |
| | | ", substitute=" + substitute + |
| | | ", passengers='" + passengers + '\'' + |
| | | ", passengersPhone='" + passengersPhone + '\'' + |
| | | ", state=" + state + |
| | | ", insertTime=" + insertTime + |
| | | ", travelTime=" + travelTime + |
| | | ", snatchOrderTime=" + snatchOrderTime + |
| | | ", setOutTime=" + setOutTime + |
| | | ", arriveTime=" + arriveTime + |
| | | ", startServiceTime=" + startServiceTime + |
| | | ", endServiceTime=" + endServiceTime + |
| | | ", orderType=" + orderType + |
| | | ", orderSource=" + orderSource + |
| | | ", invoiceId=" + invoiceId + |
| | | ", isReassign=" + isReassign + |
| | | ", reassignNotice=" + reassignNotice + |
| | | ", trackId='" + trackId + '\'' + |
| | | ", isDelete=" + isDelete + |
| | | ", oldState=" + oldState + |
| | | ", telX='" + telX + '\'' + |
| | | ", bindId='" + bindId + '\'' + |
| | | '}'; |
| | | } |
| | | /** |
| | | * 修改目的地经度 |
| | | */ |
| | | @TableField("destinationLon") |
| | | private String destinationLon; |
| | | /** |
| | | * 修改目的地纬度 |
| | | */ |
| | | @TableField("destinationLat") |
| | | private String destinationLat; |
| | | /** |
| | | * 修改目的地地址 |
| | | */ |
| | | @TableField("destination") |
| | | private String destination; |
| | | |
| | | } |
| | |
| | | * @param uid |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil addCancle(Integer id, String reason, String remark, Integer uid, Integer language) throws Exception; |
| | | ResultUtil addCancle(Integer id, String reason, String remark, Integer uid, Double lon, Double lat, String address, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | List<Map<String, Object>> queryRedEnvelope(Integer language, Integer uid) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 修改目的地 |
| | | * @param orderId |
| | | * @param endLon |
| | | * @param endLat |
| | | * @param endAddress |
| | | */ |
| | | void updateEndAddress(Integer orderId, String endLon, String endLat, String endAddress); |
| | | } |
| | |
| | | //推单操作 |
| | | if(orderPrivateCar.getState() == 1){ |
| | | this.pushOrder(orderPrivateCar); |
| | | }else{ |
| | | //接单后定时任务判断司机是否去接乘客,没有则推送提醒 |
| | | CancleOrder cancleOrder = cancleOrderService.query(orderPrivateCar.getCompanyId()); |
| | | if(null != cancleOrder){ |
| | | JSONObject object = JSON.parseObject(cancleOrder.getContent()); |
| | | long time = object.getInteger("driverTimeout") * 60000L; |
| | | new Timer().schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | OrderPrivateCar orderPrivateCar1 = OrderPrivateCarServiceImpl.this.selectById(orderPrivateCar.getId()); |
| | | if(orderPrivateCar1.getState() == 2){ |
| | | pushUtil.pushDriverTimeOut(1, orderPrivateCar1.getUserId(), orderPrivateCar1.getId(), 1); |
| | | } |
| | | } |
| | | }, time); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取取消需要支付的金额 |
| | | * @param id |
| | | * @param language |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil<BaseWarpper> queryCancleAmount(Integer id, Integer language) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(id); |
| | | if(null == orderPrivateCar){ |
| | | return ResultUtil.error(language == 1 ? "获取数据失败,订单信息有误" : language == 2 ? "Failed to obtain data, order-information error." : "Impossible d’obtenir les données, erreur d’information de commande. "); |
| | | } |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | double amount = 0; |
| | | CancleOrder query = cancleOrderService.query(orderPrivateCar.getOrderType(), 1, orderPrivateCar.getCompanyId()); |
| | | if(null != orderPrivateCar.getDriverId() && orderPrivateCar.getSnatchOrderTime()!=null && |
| | | (orderPrivateCar.getSnatchOrderTime().getTime() + query.getMinuteNum() * 60 * 1000) < new Date().getTime()){//收费的情况 |
| | | if(null != query){ |
| | | amount += query.getMoney(); |
| | | CancleOrder query = cancleOrderService.query(orderPrivateCar.getCompanyId()); |
| | | if(null == query || null == orderPrivateCar.getDriverId()){ |
| | | baseWarpper.setAmount(amount); |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | JSONObject object = JSON.parseObject(query.getContent()); |
| | | long t = object.getInteger("driverTimeout") * 60000L; |
| | | //司机超时未到达起点,免费取消 |
| | | if(orderPrivateCar.getState() < 3 && orderPrivateCar.getSnatchOrderTime().getTime() + t < System.currentTimeMillis()){ |
| | | baseWarpper.setAmount(amount); |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | //普通单 |
| | | if(1 == orderPrivateCar.getOrderType()){ |
| | | JSONObject order = object.getJSONObject("order"); |
| | | long m = order.getInteger("orderAcceptanceTime") * 60000L; |
| | | //超过免费时间,计算费用 |
| | | if(orderPrivateCar.getSnatchOrderTime().getTime() + m < System.currentTimeMillis()){ |
| | | BigDecimal money = order.getBigDecimal("money"); |
| | | if(null != orderPrivateCar.getSetOutTime()){ |
| | | //里程费 |
| | | BigDecimal mileageFee = order.getBigDecimal("mileageFee").multiply(new BigDecimal(orderPrivateCar.getMileage() / 1000)); |
| | | //时长费 |
| | | int s = Double.valueOf((System.currentTimeMillis() - orderPrivateCar.getSetOutTime().getTime()) / 60000).intValue(); |
| | | BigDecimal durationFee = order.getBigDecimal("durationFee").multiply(new BigDecimal(s)); |
| | | money = money.add(durationFee).add(mileageFee); |
| | | } |
| | | amount = money.setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | } |
| | | } |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | //预约单 |
| | | if(2 == orderPrivateCar.getOrderType()){ |
| | | JSONObject order = object.getJSONObject("reservationOrder"); |
| | | long m = order.getInteger("orderAcceptanceTime") * 60000L; |
| | | //超过免费时间,计算费用 |
| | | if(System.currentTimeMillis() + m > orderPrivateCar.getTravelTime().getTime()){ |
| | | BigDecimal money = order.getBigDecimal("money"); |
| | | if(null != orderPrivateCar.getSetOutTime()){ |
| | | //里程费 |
| | | BigDecimal mileageFee = order.getBigDecimal("mileageFee").multiply(new BigDecimal(orderPrivateCar.getMileage() / 1000)); |
| | | //时长费 |
| | | int s = Double.valueOf((System.currentTimeMillis() - orderPrivateCar.getSetOutTime().getTime()) / 60000).intValue(); |
| | | BigDecimal durationFee = order.getBigDecimal("durationFee").multiply(new BigDecimal(s)); |
| | | //预定费用 |
| | | BigDecimal reservationFee = order.getBigDecimal("reservationFee"); |
| | | money = money.add(durationFee).add(mileageFee).add(reservationFee); |
| | | } |
| | | amount = money.setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | } |
| | | } |
| | | baseWarpper.setAmount(amount); |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加取消操作 |
| | | * @param id |
| | | * @param reason |
| | | * @param remark |
| | | * @param uid |
| | | * @param language |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil addCancle(Integer id, String reason, String remark, Integer uid, Integer language) throws Exception { |
| | | public ResultUtil addCancle(Integer id, String reason, String remark, Integer uid, Double lon, Double lat, String address, Integer language) throws Exception { |
| | | if(ToolUtil.isNotEmpty(remark)){ |
| | | if(ToolUtil.isNotEmpty(remark)){ |
| | | List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null); |
| | |
| | | if(orderPrivateCar.getState() > 5 && orderPrivateCar.getState() != 11){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,不合法的操作" : language == 2 ? "Failed to cancel order, illegal operation." : "Échec de l’annulation de la commande, opération illégale."); |
| | | } |
| | | |
| | | //服务中也可以取消订单,所以取消订单时需要计算订单费用 |
| | | if(null == orderPrivateCar.getDriverId()){//没有接单的情况 |
| | | if(orderPrivateCar.getType() == 2){//摆渡车 |
| | | OrderCrossCityServiceImpl.pushEndMap.remove(orderPrivateCar.getCrossCityOrderId());//删除标识数据 |
| | |
| | | this.updateById(orderPrivateCar); |
| | | } |
| | | }else { |
| | | CancleOrder query = cancleOrderService.query(orderPrivateCar.getOrderType(), 1, orderPrivateCar.getCompanyId()); |
| | | if (null != query) { |
| | | if ((orderPrivateCar.getSnatchOrderTime().getTime() + query.getMinuteNum() * 60 * 1000) < System.currentTimeMillis() && query.getMoney().compareTo(0D) > 0) {//收费的情况 |
| | | orderPrivateCar.setState(12); |
| | | this.updateById(orderPrivateCar); |
| | | integer = orderCancelService.saveData(id, 1, reason, remark, null, query.getMoney(), 1, 1, uid); |
| | | } else { |
| | | integer = orderCancelService.saveData(id, 1, reason, remark, null, null, 2, 1, uid); |
| | | |
| | | BaseWarpper data = queryCancleAmount(id, language).getData(); |
| | | Double amount = data.getAmount(); |
| | | if(0 == amount){ |
| | | integer = orderCancelService.saveData(id, 1, reason, remark, null, null, 2, 1, uid); |
| | | if(5 == orderPrivateCar.getState()){ |
| | | orderPrivateCar.setState(6); |
| | | orderPrivateCar.setGetoffLon(lon); |
| | | orderPrivateCar.setGetoffLat(lat); |
| | | orderPrivateCar.setGetoffAddress(address); |
| | | orderPrivateCar.setGetoffTime(new Date()); |
| | | orderPrivateCar.setEndServiceTime(new Date()); |
| | | }else{ |
| | | orderPrivateCar.setState(10); |
| | | this.updateById(orderPrivateCar); |
| | | } |
| | | this.deleteTask(id);//删除定时任务 |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | System.err.println("推送取消操作---------------------"); |
| | | } |
| | | }).start(); |
| | | |
| | | //修改司机为空闲 |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | this.updateById(orderPrivateCar); |
| | | }else{ |
| | | return ResultUtil.error(language == 1 ? "请完善后台取消规则设置" : language == 2 ? "Please complete the setting of cancellation rules from the background." : "Veuillez compléter le réglage des règles d’annulation à partir de l’arrière-plan."); |
| | | if(5 == orderPrivateCar.getState()){ |
| | | orderPrivateCar.setGetoffLon(lon); |
| | | orderPrivateCar.setGetoffLat(lat); |
| | | orderPrivateCar.setGetoffAddress(address); |
| | | orderPrivateCar.setGetoffTime(new Date()); |
| | | orderPrivateCar.setEndServiceTime(new Date()); |
| | | } |
| | | orderPrivateCar.setOldState(6); |
| | | orderPrivateCar.setState(12); |
| | | this.updateById(orderPrivateCar); |
| | | integer = orderCancelService.saveData(id, 1, reason, remark, null, amount, 1, 1, uid); |
| | | } |
| | | |
| | | this.deleteTask(id);//删除定时任务 |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | System.err.println("推送取消操作---------------------"); |
| | | } |
| | | }).start(); |
| | | |
| | | //修改司机为空闲 |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | } |
| | | |
| | | //添加消息 |
| | |
| | | }else{ |
| | | orderCancel = orderCancelService.selectById(cancleId); |
| | | } |
| | | |
| | | CancleOrder query = cancleOrderService.query(orderPrivateCar.getOrderType(), 1, orderPrivateCar.getCompanyId()); |
| | | if(null != query){ |
| | | |
| | | Double amount = queryCancleAmount(id, language).getData().getAmount(); |
| | | if(0 < amount){ |
| | | if(payType == 1){//手机支付 |
| | | orderCancel.setPayType(1); |
| | | orderCancelService.updateById(orderCancel); |
| | |
| | | checkoutRequest.setAccountNumber(userInfo.getPhone()); |
| | | checkoutRequest.setCustomerFirstName(userInfo.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(userInfo.getLastName()); |
| | | checkoutRequest.setRequestAmount(query.getMoney()); |
| | | checkoutRequest.setRequestAmount(amount); |
| | | checkoutRequest.setMerchantTransactionId(merchantTransactionId); |
| | | checkoutRequest.setRequestDescription("Cancel a trip"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelOrderTaxi"); |
| | |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, id, 1, 1, query.getMoney(), null, 1);//添加预支付数据 |
| | | paymentRecordService.saveData(1, null, null, id, 1, 1, amount, null, 1);//添加预支付数据 |
| | | } |
| | | |
| | | } |
| | |
| | | checkoutRequest.setAccountNumber(bankCard.getCode()); |
| | | checkoutRequest.setCustomerFirstName(bankCard.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(bankCard.getLastName()); |
| | | checkoutRequest.setRequestAmount(query.getMoney()); |
| | | checkoutRequest.setRequestAmount(amount); |
| | | checkoutRequest.setMerchantTransactionId(merchantTransactionId); |
| | | checkoutRequest.setRequestDescription("Cancel a trip"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelOrderTaxi"); |
| | |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, id, 1, 2, query.getMoney(), null, 1);//添加预支付数据 |
| | | paymentRecordService.saveData(1, null, null, id, 1, 2, amount, null, 1);//添加预支付数据 |
| | | } |
| | | |
| | | } |
| | | if(payType == 3){//余额支付 |
| | | if(userInfo.getBalance() != null && userInfo.getBalance() < query.getMoney()){ |
| | | if(userInfo.getBalance() != null && userInfo.getBalance() < amount){ |
| | | return ResultUtil.error((language == 1 ? "账户余额不足" : language == 2 ? "Insufficient balance" : "Solde insuffisant"), ""); |
| | | } |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(query.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(amount)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "取消订单", query.getMoney(), 2, 1, 1, 1, id); |
| | | transactionDetailsService.saveData(uid, "取消订单", amount, 2, 1, 1, 1, id); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | //解除小号绑定 |
| | | if(orderPrivateCar.getBindId() != null){ |
| | | chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX()); |
| | | ChinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX()); |
| | | } |
| | | |
| | | orderPrivateCar.setState(10); |
| | | |
| | | if(5 == orderPrivateCar.getOldState()){ |
| | | orderPrivateCar.setState(6); |
| | | }else{ |
| | | orderPrivateCar.setState(10); |
| | | } |
| | | orderPrivateCar.setTelX(""); |
| | | orderPrivateCar.setBindId(""); |
| | | this.updateById(orderPrivateCar); |
| | |
| | | orderCancel.setPayType(3); |
| | | orderCancelService.updateById(orderCancel); |
| | | |
| | | // //添加已收入明细 |
| | | // incomeService.saveData(1, orderPrivateCar.getCompanyId(), 3, orderPrivateCar.getId(), 1, query.getMoney()); |
| | | // //添加已收入明细 |
| | | // Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | // Double taxi = company.getSpeMoney(); |
| | | BigDecimal c =new BigDecimal(query.getMoney());//司机收入 |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 3, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | |
| | | this.deleteTask(id);//删除定时任务 |
| | | if(null != orderPrivateCar.getDriverId()){ |
| | | BigDecimal c =new BigDecimal(amount);//司机收入 |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 3, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | |
| | | this.deleteTask(id);//删除定时任务 |
| | | pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | } |
| | | pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | |
| | | //添加消息 |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用余额成功支付取消订单费用,谢谢使用!" : language == 2 |
| | |
| | | if(null != query){ |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(orderPrivateCar.getUserId(), "取消订单", query.getAmount(), 2, 1, 1, 1, query.getOrderId()); |
| | | orderPrivateCar.setState(10); |
| | | if(5 == orderPrivateCar.getOldState()){ |
| | | orderPrivateCar.setState(6); |
| | | }else{ |
| | | orderPrivateCar.setState(10); |
| | | } |
| | | //解除小号绑定 |
| | | if(orderPrivateCar.getBindId() != null){ |
| | | chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX()); |
| | | ChinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX()); |
| | | } |
| | | orderPrivateCar.setBindId(""); |
| | | orderPrivateCar.setTelX(""); |
| | |
| | | orderCancelService.updateById(query1); |
| | | } |
| | | |
| | | // //添加已收入明细 |
| | | // incomeService.saveData(1, orderPrivateCar.getCompanyId(), 3, orderPrivateCar.getId(), 1, query.getAmount()); |
| | | // //添加已收入明细 |
| | | // Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | // Double taxi = company.getSpeMoney(); |
| | | BigDecimal c =new BigDecimal(query.getAmount());//司机收入 |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 3, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | this.deleteTask(orderPrivateCar.getId());//删除定时任务 |
| | | |
| | | // TODO: 2020/5/24 这里需要给司机和用户推送订单状态 |
| | | // new Thread(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | | // pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | // } |
| | | // }).start(); |
| | | if(null != orderPrivateCar.getDriverId()){ |
| | | BigDecimal c =new BigDecimal(query.getAmount());//司机收入 |
| | | incomeService.saveData(2, orderPrivateCar.getDriverId(), 3, orderPrivateCar.getId(), 1, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | this.deleteTask(orderPrivateCar.getId());//删除定时任务 |
| | | |
| | | pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | } |
| | | pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0); |
| | | |
| | | //添加消息 |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用余额成功支付取消订单费用,谢谢使用!" : language == 2 |
| | |
| | | } |
| | | return endPushWarpper; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改目的地 |
| | | * @param orderId |
| | | * @param endLon |
| | | * @param endLat |
| | | * @param endAddress |
| | | */ |
| | | @Override |
| | | public void updateEndAddress(Integer orderId, String endLon, String endLat, String endAddress) { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | if(null != orderPrivateCar.getDriverId()){ |
| | | orderPrivateCar.setDestination(endAddress); |
| | | orderPrivateCar.setDestinationLat(endLat); |
| | | orderPrivateCar.setDestinationLon(endLon); |
| | | this.updateById(orderPrivateCar); |
| | | pushUtil.pushModifyAddress(2, orderPrivateCar.getDriverId(), orderId, 1, 1); |
| | | }else{ |
| | | orderPrivateCar.setEndAddress(endAddress); |
| | | orderPrivateCar.setEndLat(Double.valueOf(endLat)); |
| | | orderPrivateCar.setEndLon(Double.valueOf(endLon)); |
| | | this.updateById(orderPrivateCar); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取取消订单配置 |
| | | * @param type |
| | | * @param orderType |
| | | * @return |
| | | */ |
| | | CancleOrder query(@Param("type") Integer type, @Param("orderType") Integer orderType, |
| | | @Param("companyId") Integer companyId); |
| | | CancleOrder query(@Param("companyId") Integer companyId); |
| | | } |
| | |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.CancleOrder"> |
| | | <id column="id" property="id"/> |
| | | <result column="companyId" property="companyId"/> |
| | | <result column="minuteNum" property="minuteNum"/> |
| | | <result column="money" property="money"/> |
| | | <result column="type" property="type"/> |
| | | <result column="orderType" property="orderType"/> |
| | | <result column="content" property="content"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="query" resultType="CancleOrder"> |
| | | <select id="query" resultType="com.stylefeng.guns.modular.system.model.CancleOrder"> |
| | | select |
| | | id as id, |
| | | companyId as companyId, |
| | | minuteNum as minuteNum, |
| | | money as money, |
| | | `type` as `type`, |
| | | orderType as orderType |
| | | from t_sys_cancle_order where `type` = #{type} and orderType = #{orderType} and companyId = #{companyId} |
| | | companyId, |
| | | content |
| | | from t_sys_cancle_order where companyId = #{companyId} |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 取消订单设置 |
| | | */ |
| | | @Data |
| | | @TableName("t_sys_cancle_order") |
| | | public class CancleOrder { |
| | | /** |
| | |
| | | @TableField("companyId") |
| | | private Integer companyId; |
| | | /** |
| | | * 时间(分钟) |
| | | * 取消规则 |
| | | */ |
| | | @TableField("minuteNum") |
| | | private Integer minuteNum; |
| | | /** |
| | | * 金额 |
| | | */ |
| | | @TableField("money") |
| | | private Double money; |
| | | /** |
| | | * 类型(1=取消,2=预约取消) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 订单类型(1=专车,2=出租车) |
| | | */ |
| | | @TableField("orderType") |
| | | private Integer orderType; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getCompanyId() { |
| | | return companyId; |
| | | } |
| | | |
| | | public void setCompanyId(Integer companyId) { |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public Integer getMinuteNum() { |
| | | return minuteNum; |
| | | } |
| | | |
| | | public void setMinuteNum(Integer minuteNum) { |
| | | this.minuteNum = minuteNum; |
| | | } |
| | | |
| | | public Double getMoney() { |
| | | return money; |
| | | } |
| | | |
| | | public void setMoney(Double money) { |
| | | this.money = money; |
| | | } |
| | | |
| | | public Integer getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(Integer type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public Integer getOrderType() { |
| | | return orderType; |
| | | } |
| | | |
| | | public void setOrderType(Integer orderType) { |
| | | this.orderType = orderType; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "CancleOrder{" + |
| | | "id=" + id + |
| | | ", companyId=" + companyId + |
| | | ", minuteNum=" + minuteNum + |
| | | ", money=" + money + |
| | | ", type=" + type + |
| | | ", orderType=" + orderType + |
| | | '}'; |
| | | } |
| | | @TableField("content") |
| | | private String content; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取取消订单设置 |
| | | * @param type |
| | | * @param orderType |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | CancleOrder query(Integer type, Integer orderType, Integer companyId) throws Exception; |
| | | CancleOrder query(Integer companyId) throws Exception; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 获取取消订单配置 |
| | | * @param type |
| | | * @param orderType |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public CancleOrder query(Integer type, Integer orderType, Integer companyId) throws Exception { |
| | | return cancleOrderMapper.query(type, orderType, companyId); |
| | | public CancleOrder query(Integer companyId) throws Exception { |
| | | return cancleOrderMapper.query(companyId); |
| | | } |
| | | } |
| | |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 司机超时提醒 |
| | | * @param type |
| | | * @param uid |
| | | * @param orderId |
| | | * @param orderType |
| | | */ |
| | | public void pushDriverTimeOut(Integer type, Integer uid, Integer orderId, Integer orderType){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", 200); |
| | | jsonObject.put("msg", "SUCCESS"); |
| | | jsonObject.put("method", "DRIVER_TIME_OUT"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderId", orderId); |
| | | map.put("orderType", orderType); |
| | | jsonObject.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", jsonObject.toJSONString()); |
| | | params.add("id", String.valueOf(uid)); |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改目的地推送通知 |
| | | * @param type |
| | | * @param uid |
| | | * @param orderId |
| | | * @param orderType |
| | | * @param status 1=申请,2=同意,3=拒绝 |
| | | */ |
| | | public void pushModifyAddress(Integer type, Integer uid, Integer orderId, Integer orderType, Integer status){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", 200); |
| | | jsonObject.put("msg", "SUCCESS"); |
| | | jsonObject.put("method", "MODIFY_ADDRESS"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderId", orderId); |
| | | map.put("orderType", orderType); |
| | | map.put("status", status); |
| | | jsonObject.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | // 以表单的方式提交 |
| | | headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", jsonObject.toJSONString()); |
| | | params.add("id", String.valueOf(uid)); |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | |
| | | /** |
| | | * Cellulant短信 |
| | | * 短信 : https://www.nalosolutions.com/ |
| | | * @param toPhone |
| | | * @param msg |
| | | * @return |
| | |
| | | */ |
| | | @ApiModelProperty("收据链接") |
| | | private String receipt; |
| | | |
| | | @ApiModelProperty("是否冻结(1=否,2=是)") |
| | | private Integer isFrozen; |
| | | |
| | | public Integer getStartDuration() { |
| | | return startDuration; |
| | |
| | | public void setReceipt(String receipt) { |
| | | this.receipt = receipt; |
| | | } |
| | | |
| | | |
| | | public Integer getIsFrozen() { |
| | | return isFrozen; |
| | | } |
| | | |
| | | public void setIsFrozen(Integer isFrozen) { |
| | | this.isFrozen = isFrozen; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderInfoWarpper{" + |
| | |
| | | orderInfoWarpper.setMoneyTime(null != map.get("moneyTime") ? map.get("moneyTime").toString() :""); |
| | | orderInfoWarpper.setPayType(null != map.get("payType") ? Integer.valueOf(map.get("payType").toString()) : 4); |
| | | orderInfoWarpper.setReceipt(null != map.get("receipt") ? map.get("receipt").toString() : ""); |
| | | orderInfoWarpper.setIsFrozen(null != map.get("isFrozen") ? Integer.valueOf(map.get("isFrozen").toString()) : 1); |
| | | } |
| | | if(orderInfoWarpper.getState()==7){ |
| | | orderInfoWarpper.setOrderMoney(orderInfoWarpper.getOrderMoney()-orderInfoWarpper.getDiscountMoney()); |
| | |
| | | private Long insertTime; |
| | | @ApiModelProperty("收据链接") |
| | | private String receipt; |
| | | @ApiModelProperty("是否冻结(1=否,2=是)") |
| | | private Integer isFrozen; |
| | | |
| | | public Integer getOrderId() { |
| | | return orderId; |
| | |
| | | orderWarpper.setServerCarModel(null != map.get("serverCarModel") ? String.valueOf(map.get("serverCarModel")) : ""); |
| | | orderWarpper.setDifferenceMoney(null != map.get("differenceMoney") ? Double.valueOf(map.get("differenceMoney").toString()) : 0D); |
| | | orderWarpper.setReceipt(null != map.get("receipt") ? String.valueOf(map.get("receipt")) : ""); |
| | | orderWarpper.setIsFrozen(null != map.get("isFrozen") ? Integer.valueOf(String.valueOf(map.get("isFrozen"))) : 1); |
| | | list.add(orderWarpper); |
| | | } |
| | | } |
| | | Collections.sort(list); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | public Integer getIsFrozen() { |
| | | return isFrozen; |
| | | } |
| | | |
| | | public void setIsFrozen(Integer isFrozen) { |
| | | this.isFrozen = isFrozen; |
| | | } |
| | | |
| | | @Override |
| | | public int compareTo(Object o) { |
| | | if (o instanceof OrderWarpper) { |
| | |
| | | spring: |
| | | profiles: |
| | | active: @spring.active@ |
| | | active: "@spring.active@" |