From dfb1f5ab2e8dc03cf2f497ce3327f6ce58700766 Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期四, 23 十月 2025 11:35:55 +0800
Subject: [PATCH] 修改bug
---
UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java | 61 ++++++++++++++++++++++--------
1 files changed, 44 insertions(+), 17 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..04b0101 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
@@ -49,6 +49,8 @@
import java.math.MathContext;
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
@@ -1269,7 +1271,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 +1405,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 +1610,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());
@@ -1629,6 +1631,7 @@
goodsInfoRequest.setProfitSharing("1");
}else{
goodsInfoRequest.setProfitSharing("0");
+ goodsInfoRequest.setSettleDate(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")));
}
goodsInfo.add(goodsInfoRequest);
tradeOrderCreateData.setGoodsInfo(goodsInfo);
@@ -1654,6 +1657,7 @@
goodsInfoRequest.setProfitSharing("1");
}else{
goodsInfoRequest.setProfitSharing("0");
+ goodsInfoRequest.setSettleDate(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")));
}
goodsInfo.add(goodsInfoRequest);
tradePayOff1Data.setGoodsInfo(goodsInfo);
@@ -1716,11 +1720,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());
@@ -1892,10 +1906,8 @@
if (Integer.valueOf(String.valueOf(map.get("state"))) == 11) {
map.put("state", map.get("oldState"));
}
-
- if (map.get("abnormalIntro") != null) {
- map.put("appealStatus", 1);
- }
+ //出租车不需要申诉
+ map.put("appealStatus", 0);
String driverId = (String) redisTemplate.opsForValue().get("DEVICE_" + map.get("driverId"));
map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1);
map.put("orderType", 2);
@@ -2146,8 +2158,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 +2191,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