From e9d0eb5d4f43c3cd5a37283151d69683b3ddd6bf Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期二, 02 九月 2025 15:05:10 +0800 Subject: [PATCH] 修改bug --- UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java | 51 ++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 38 insertions(+), 13 deletions(-) diff --git a/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java b/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java index 735aba3..e9c094c 100644 --- a/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java +++ b/UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java @@ -1269,7 +1269,7 @@ return ResultUtil.error("订单不在待支付状态,不允许支付", ""); } Integer uid = orderTaxi.getUserId(); - Double orderMoney = orderTaxi.getOrderMoney(); + Double orderMoney = (2 == orderTaxi.getAbnormal() && 2 == orderTaxi.getAbnormalStatus() ? orderTaxi.getResponsibilityMoney().doubleValue() : orderTaxi.getOrderMoney()); UserInfo userInfo = userInfoService.selectById(uid); ResultUtil resultUtil = ResultUtil.success(new Object()); orderTaxi.setCouponMoney(0D);//初始化历史数据 @@ -1403,7 +1403,7 @@ return ResultUtil.error("订单不在待支付状态,不允许支付", ""); } Integer uid = orderTaxi.getUserId(); - Double orderMoney = (1 == orderTaxi.getAbnormal() ? orderTaxi.getOrderMoney() : orderTaxi.getResponsibilityMoney().doubleValue()); + Double orderMoney = (2 == orderTaxi.getAbnormal() && 2 == orderTaxi.getAbnormalStatus() ? orderTaxi.getResponsibilityMoney().doubleValue() : orderTaxi.getOrderMoney()); UserInfo userInfo = userInfoService.selectById(uid); ResultUtil resultUtil = ResultUtil.success(new Object()); orderTaxi.setCouponMoney(0D);//初始化历史数据 @@ -1608,9 +1608,9 @@ tradeOrderCreateData.setTreatShopId(driver.getEmpId().toString()); //追缴单不要分账 if(0 == orderTaxi.getRecoveryOrder()){ - tradeOrderCreateData.setField1("{\"profitSharing\":\"1\",\"isPromote\":\"" + (orderTaxi.getPromotion() == 2 ? 1 : 0) + "\"}"); + tradeOrderCreateData.setField1("{\"profitSharing\":\"1\",\"isCompensate\":\"0\",\"isPromote\":\"" + (orderTaxi.getPromotion() == 2 ? 1 : 0) + "\"}"); }else{ - tradeOrderCreateData.setField1("{\"profitSharing\":\"0\",\"isPromote\":\"0\"}"); + tradeOrderCreateData.setField1("{\"profitSharing\":\"0\",\"isCompensate\":\"1\",\"isPromote\":\"0\"}"); } tradeOrderCreateData.setCharge(new BigDecimal(orderMoney)); tradeOrderCreateData.setOrderId(orderTaxi.getTravelId()); @@ -1716,11 +1716,21 @@ query.setEndTime(new Date()); userRedPacketRecordService.updateById(query); } - - //添加收入 - Map<String, Object> map = incomeService.saveIncome(orderTaxi.getId(), 2, orderTaxi.getOrderMoney()); - orderTaxi.setSplitAllocation(JSON.toJSONString(map)); + //非追缴单才添加收入记录 + if(0 == orderTaxi.getRecoveryOrder()){ + //添加收入 + Double orderMoney1 = (2 == orderTaxi.getAbnormal() && 2 == orderTaxi.getAbnormalStatus() ? orderTaxi.getResponsibilityMoney().doubleValue() : orderTaxi.getOrderMoney()); + Map<String, Object> map = incomeService.saveIncome(orderTaxi.getId(), 2, orderTaxi.getOrderMoney()); + orderTaxi.setSplitAllocation(JSON.toJSONString(map)); + } + //待审核的异常单修改状态为已关闭 + if(2 == orderTaxi.getAbnormal() && 1 == orderTaxi.getAbnormalStatus()){ + orderTaxi.setAbnormalStatus(3); + orderTaxi.setResponsibilityMoney(new BigDecimal(orderTaxi.getOrderMoney())); + orderTaxi.setResponsibilityType(3); + orderTaxi.setAbnormalRemark("乘客已支付订单,申诉已自动关闭"); + } this.updateAllColumnById(orderTaxi); promotion(orderTaxi.getId()); @@ -2146,8 +2156,10 @@ UserInfo userInfo = userInfoService.selectById(orderTaxi.getUserId()); OpenCity openCity = openCityService.openCity1(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); SysIntegral query1 = sysIntegralMapper.query(openCity.getId()); - userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 - userInfoService.updateById(userInfo); + if(null != query1){ + userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 + userInfoService.updateById(userInfo); + } //处理优惠券和红包 if (null != orderTaxi.getCouponId()) { @@ -2177,9 +2189,22 @@ query.setCode(order_id); paymentRecordService.updateById(query); - //添加收入 - Map<String, Object> map = incomeService.saveIncome(orderTaxi.getId(), 2, orderTaxi.getOrderMoney()); - orderTaxi.setSplitAllocation(JSON.toJSONString(map)); + //非追缴单才添加收入记录 + if(0 == orderTaxi.getRecoveryOrder()){ + //添加收入 + Double orderMoney1 = (2 == orderTaxi.getAbnormal() && 2 == orderTaxi.getAbnormalStatus() ? orderTaxi.getResponsibilityMoney().doubleValue() : orderTaxi.getOrderMoney()); + Map<String, Object> map = incomeService.saveIncome(orderTaxi.getId(), 2, orderMoney1); + orderTaxi.setSplitAllocation(JSON.toJSONString(map)); + } + + //待审核的异常单修改状态为已关闭 + if(2 == orderTaxi.getAbnormal() && 1 == orderTaxi.getAbnormalStatus()){ + orderTaxi.setAbnormalStatus(3); + orderTaxi.setResponsibilityMoney(new BigDecimal(orderTaxi.getOrderMoney())); + orderTaxi.setResponsibilityType(3); + orderTaxi.setAbnormalRemark("乘客已支付订单,申诉已自动关闭"); + } + this.updateById(orderTaxi); // TODO: 2020/5/24 这里需要给司机和用户推送订单状态 -- Gitblit v1.7.1