DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/CbyzxPayUtil.java
@@ -20,7 +20,7 @@ /** * 测试环境域名 */ public static final String TEST_BASE_URL = "https://test-api-pay.cbyzx.com"; public static final String TEST_BASE_URL = "https://api-pay2.cbyzx.com"; /** * 创建支付单接口 @@ -30,8 +30,8 @@ private static final String PAYMENT_ORDER_TYPE = "PAYMENT_ORDER"; private static final String DEFAULT_CURRENCY = "CNY"; private static final String DEFAULT_PAY_CHANNEL_CODE = "ykdride-driver-wxapp"; private static final String DEFAULT_TENANT = "gz.zuny.ykdride.platform"; private static final String DEFAULT_PAY_CHANNEL_CODE = "fxx-ride-wxmini"; private static final String DEFAULT_TENANT = "ha.xinx.fxx.platform"; private CbyzxPayUtil() { } @@ -209,7 +209,7 @@ params.put("currency", DEFAULT_CURRENCY); params.put("buyerId", buyerId); params.put("subOpenid", openId); params.put("storeIds", Arrays.asList("246")); params.put("storeIds", Arrays.asList("1004")); params.put("payChannelCode", DEFAULT_PAY_CHANNEL_CODE); params.put("payEndTime", payEndTime); params.put("callbackUrl", callbackUrl); DriverYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java
@@ -19,6 +19,7 @@ import com.stylefeng.guns.modular.taxi.model.OrderTaxi; import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.http.HttpEntity; @@ -36,6 +37,7 @@ import java.util.*; import java.util.concurrent.TimeUnit; @Slf4j @Service public class OrderTaxiServiceImpl extends ServiceImpl<OrderTaxiMapper, OrderTaxi> implements IOrderTaxiService { @@ -615,7 +617,9 @@ @Override public ResultUtil confirmFees1(Integer orderId, Integer type, Double travelFee, String additionalFee) throws Exception { log.info("出租车费用确认并结束:订单【{}】类型【{}】里程费【{}】附加费【{}】",orderId, type, travelFee, additionalFee); OrderTaxi orderTaxi = this.selectById(orderId); log.info("查询出的订单数据为:{}", JSON.toJSONString(orderTaxi)); orderTaxi.setPayManner(type); if(type == 2){//其他支付,不需要操作,直接完成订单 orderTaxi.setOrderMoney(0D); @@ -649,7 +653,7 @@ } } this.updateById(orderTaxi); log.info("更新后订单数据为:{}", JSON.toJSONString(orderTaxi)); Driver driver = driverService.selectById(orderTaxi.getDriverId()); //回滚司机状态为空闲 @@ -1162,7 +1166,6 @@ return orderTaxi; } public OrderTaxi setMoney1(OrderTaxi orderTaxi, Double travelFee, String additionalFee) throws Exception{ if (travelFee!=null){ String s = travelFee.toString(); @@ -1174,7 +1177,7 @@ orderTaxi.setParkMoney(0D); orderTaxi.setRoadTollMoney(0D); Company company = companyService.selectById(orderTaxi.getCompanyId()); BigDecimal t = new BigDecimal(0); BigDecimal t = new BigDecimal("0"); if(ToolUtil.isNotEmpty(additionalFee)){//附加费 JSONArray jsonArray = JSON.parseArray(additionalFee); for(int i = 0; i < jsonArray.size(); i++){ @@ -1187,14 +1190,17 @@ orderAdditionalFee.setAdditionalFeeId(id); orderAdditionalFee.setAmount(amount); orderAdditionalFeeService.insert(orderAdditionalFee); t = t.add(new BigDecimal(amount)); if(Objects.nonNull(amount)) { t = t.add(new BigDecimal(amount.toString())); } } } orderTaxi.setHolidayFee(null == company.getHolidayFee() ? 0D : company.getHolidayFee()); BigDecimal sum = new BigDecimal(null == travelFee ? 0 : travelFee).add(new BigDecimal(0)) .add(new BigDecimal(0)).add(new BigDecimal(orderTaxi.getHolidayFee())) .add(new BigDecimal(null == orderTaxi.getTipMoney() ? 0 : orderTaxi.getTipMoney())).add(t); BigDecimal sum = new BigDecimal(String.valueOf(null == travelFee ? "0" : travelFee)).add(new BigDecimal("0")) .add(new BigDecimal("0")).add(new BigDecimal(Optional.ofNullable(orderTaxi.getHolidayFee()).map(String::valueOf).orElse("0"))) .add(new BigDecimal(String.valueOf(null == orderTaxi.getTipMoney() ? "0" : orderTaxi.getTipMoney()))).add(t); orderTaxi.setOrderMoney(sum.setScale(2, BigDecimal.ROUND_DOWN).doubleValue()); return orderTaxi; } UserYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/CbyzxPayUtil.java
@@ -20,7 +20,7 @@ /** * 测试环境域名 */ public static final String TEST_BASE_URL = "https://test-api-pay.cbyzx.com"; public static final String TEST_BASE_URL = "https://api-pay2.cbyzx.com"; /** * 创建支付单接口 @@ -209,7 +209,7 @@ params.put("currency", DEFAULT_CURRENCY); params.put("buyerId", buyerId); params.put("subOpenid", openId); params.put("storeIds", Arrays.asList("262")); params.put("storeIds", Arrays.asList("1004")); params.put("payChannelCode", DEFAULT_PAY_CHANNEL_CODE); params.put("payEndTime", payEndTime); params.put("callbackUrl", callbackUrl); UserYKDTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java
@@ -1887,6 +1887,7 @@ String driverId = (String) redisTemplate.opsForValue().get("DEVICE_" + map.get("driverId")); map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1); map.put("orderType", 2); if(Objects.isNull(map.get("orderMoney")) || Double.parseDouble(String.valueOf(map.get("orderMoney"))) <= 0) { if (Objects.equals(orderTaxi.getPaymentMode(), 1)) { System.out.println("预付价格871"); fillTaxiPrepayDisplayMoney(orderTaxi, map); @@ -1894,6 +1895,7 @@ System.out.println("计算价格874"); taxiPreAmountCalculate(orderTaxi, map); } } log.info("获取订单详情为:{}", JSONArray.toJSONString(map)); return map; }