From 7bf07f46d7c39fa01b6d8abd860bd80c210d86cb Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期四, 09 十月 2025 15:48:31 +0800
Subject: [PATCH] 修改上传图片配置
---
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java | 100 ++++++++++++++++++++++++++++++++------------------
1 files changed, 64 insertions(+), 36 deletions(-)
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
index ebdead0..3765267 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -4,6 +4,7 @@
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.google.api.client.http.UrlEncodedParser;
+import com.stylefeng.guns.core.util.MD5Util;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.CharteredCar.server.IOrderCharteredCarService;
import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity;
@@ -31,6 +32,8 @@
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.http.client.utils.URLEncodedUtils;
import org.bouncycastle.util.encoders.UrlBase64Encoder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils;
@@ -55,6 +58,8 @@
@RestController
@RequestMapping("")
public class OrderController {
+
+ private Logger log = LoggerFactory.getLogger(OrderController.class);
@Autowired
private IOrderTaxiService orderTaxiService;
@@ -128,7 +133,7 @@
/**
- * 获取正在进行中的订单
+ * 获取正在sudo rm -rf的订单
* @param request
* @return
*/
@@ -182,6 +187,19 @@
orderStatusWarpper.setOrderType(3);
orderStatusWarpper.setState(orderCrossCity.getState());
// orderStatusWarpper.setTripId(orderPrivateCar.getTripId());
+ data.add(orderStatusWarpper);
+ }
+ List<OrderLogistics> orderLogistics = orderLogisticsService.selectList(new EntityWrapper<OrderLogistics>().eq("userId", uid)
+ .in("state", Arrays.asList(1, 2, 3, 4, 5, 6, 7, 11, 12)).eq("isDelete", 1));
+ for(OrderLogistics orderLogistics1 : orderLogistics){
+ if(orderLogistics1.getState() == 11){
+ orderLogistics1.setState(orderLogistics1.getOldState());
+ }
+ OrderStatusWarpper orderStatusWarpper = new OrderStatusWarpper();
+ orderStatusWarpper.setOrderId(orderLogistics1.getId());
+ orderStatusWarpper.setOrderType(4);
+ orderStatusWarpper.setState(orderLogistics1.getState());
+ orderStatusWarpper.setTripId(orderLogistics1.getTripId());
data.add(orderStatusWarpper);
}
return ResultUtil.success(data);
@@ -658,31 +676,7 @@
})
public ResultUtil queryTrack_(Integer orderId, Integer orderType){
try {
- List<Map<String, Object>> list = new ArrayList<>();
- switch (orderType){
- case 1:
- OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
- Map<String, Object> map = new HashMap<>();
- map.put("lon", orderPrivateCar.getStartLon());
- map.put("lat", orderPrivateCar.getStartLat());
- list.add(map);
- map = new HashMap<>();
- map.put("lon", orderPrivateCar.getEndLon());
- map.put("lat", orderPrivateCar.getEndLat());
- list.add(map);
- break;
- case 4:
- OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
- Map<String, Object> map1 = new HashMap<>();
- map1.put("lon", orderLogistics.getStartLon());
- map1.put("lat", orderLogistics.getStartLat());
- list.add(map1);
- map1 = new HashMap<>();
- map1.put("lon", orderLogistics.getEndLon());
- map1.put("lat", orderLogistics.getEndLat());
- list.add(map1);
- break;
- }
+ List<Map<String, Object>> list = orderPositionService.queryTrack(orderId, orderType);
return ResultUtil.success(list);
}catch (Exception e){
e.printStackTrace();
@@ -699,7 +693,7 @@
*/
@ResponseBody
@PostMapping("/base/order/sendOrderState")
- public ResultUtil cancelOrder(Integer id, Integer orderType){
+ public ResultUtil cancelOrder(Integer id, Integer orderType, String from){
try {
Integer driverId = null;
Integer userId = null;
@@ -711,7 +705,7 @@
userId = orderPrivateCar.getUserId();
state = orderPrivateCar.getState();
if(null != driverId){
- pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "");
+ pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "", from);
}
break;
case 2:
@@ -720,7 +714,7 @@
userId = orderTaxi.getUserId();
state = orderTaxi.getState();
if(null != driverId){
- pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "");
+ pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "", from);
}
break;
case 3:
@@ -731,7 +725,7 @@
if(orderCrossCity.getPayMoney() == null && state == 10){//支付的情况才推送取消
break;
}else{
- pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "");
+ pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "", from);
}
break;
case 4:
@@ -742,7 +736,7 @@
if(orderLogistics.getPayMoney() == null && state == 10){//支付的情况才推送取消
break;
}else{
- pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "");
+ pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "", from);
}
break;
case 5:
@@ -753,11 +747,11 @@
if(orderLogistics1.getPayMoney() == null && state == 10){//支付的情况才推送取消
break;
}else{
- pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "");
+ pushUtil.pushOrderState(2, driverId, id, orderType, state, 0, "", from);
}
break;
}
- pushUtil.pushOrderState(1, userId, id, orderType, state, 0, "");
+ pushUtil.pushOrderState(1, userId, id, orderType, state, 0, "", from);
return ResultUtil.success();
}catch (Exception e){
e.printStackTrace();
@@ -1040,6 +1034,13 @@
if(null == uid){
return ResultUtil.tokenErr();
}
+ String format = String.format("uid=%s&id=%s&orderType=%s&payType=%s&type=%s", uid, id, orderType, payType, type);
+ String key = MD5Util.encrypt(format);
+ String value = redisUtil.getValue(key);
+ if(ToolUtil.isNotEmpty(value) && (System.currentTimeMillis() - Long.valueOf(value)) <= 1000){
+ return ResultUtil.error(language == 1 ? "请勿重复操作" : language == 2 ? "Don't repeat the operation" : "Ne répétez pas l’opération");
+ }
+ redisUtil.setStrValue(key, System.currentTimeMillis() + "", 5);
switch (orderType){
case 1:
return orderPrivateCarService.cancleOrderPrivateCar(id, payType, bankCardId, cancleId, type, language);
@@ -1117,10 +1118,12 @@
}
Map<String, Object> map = new HashMap<>();
Double payMoney = 0D;
+ Integer companyId = null;
switch (orderType){
case 1:
map = orderPrivateCarService.queryBalance(orderId, uid);
OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
+ companyId = orderPrivateCar.getCompanyId();
payMoney = orderPrivateCar.getOrderMoney();
UserActivityDiscount1 query = userActivityDiscount1Mapper.query(orderPrivateCar.getCompanyId());
if(null != query){
@@ -1146,6 +1149,7 @@
case 4:
map = orderLogisticsService.queryBalance(orderId, uid);
OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
+ companyId = orderLogistics.getCompanyId();
payMoney = orderLogistics.getOrderMoney();
UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(orderLogistics.getCompanyId());
if(null != query2){
@@ -1165,7 +1169,12 @@
// map = orderLogisticsService.queryBalance(orderId, uid);
// break;
}
- Double aDouble = userRedPacketRecordService.queryRemainingAmount(uid);
+ List<UserRedPacketRecord> userRedPacketRecords = userRedPacketRecordService.selectList(new EntityWrapper<UserRedPacketRecord>()
+ .eq("companyId", companyId).eq("state", 1).eq("userId", uid));
+ Double aDouble = 0D;
+ if(userRedPacketRecords.size() > 0){
+ aDouble = userRedPacketRecords.stream().mapToDouble(UserRedPacketRecord::getRemainingAmount).sum();
+ }
map.put("redTotal", aDouble);
RedEnvelopePaymentSettings redEnvelopePaymentSettings = redEnvelopePaymentSettingsService.getRedEnvelopePaymentSettings();
if(null == redEnvelopePaymentSettings){
@@ -1261,6 +1270,16 @@
if(null == uid){
return ResultUtil.tokenErr();
}
+ System.err.println("支付接口请求参数:payType=" + payType + "&bankCardId=" + bankCardId + "&orderId=" + orderId + "&orderType=" + orderType +
+ "&couponId=" + couponId + "&redDeduction=" + redDeduction + "&type=" + type + "&language=" + language);
+ String format = String.format("uid=%s&payType=%s&orderId=%s&orderType=%s", uid, payType, orderId, orderType);
+ String key = MD5Util.encrypt(format);
+ String value = redisUtil.getValue(key);
+ if(ToolUtil.isNotEmpty(value) && (System.currentTimeMillis() - Long.valueOf(value)) <= 1000){
+ return ResultUtil.error(language == 1 ? "请勿重复操作" : language == 2 ? "Don't repeat the operation" : "Ne répétez pas l’opération");
+ }
+ redisUtil.setStrValue(key, System.currentTimeMillis() + "", 5);
+
switch (orderType){
case 1:
return orderPrivateCarService.payPrivateCarOrder(payType, bankCardId, orderId, couponId, redDeduction, type, language);
@@ -1413,6 +1432,7 @@
@ResponseBody
@PostMapping("/base/wxCancelOrderTaxi")
public CallbackResponse wxCancelOrderTaxi(@RequestBody CallbackRequest callbackRequest){
+ log.info("取消订单支付回调结果:{}", JSON.toJSONString(callbackRequest));
CallbackResponse callbackResponse = new CallbackResponse();
try {
/**
@@ -1464,6 +1484,7 @@
}catch (Exception e){
e.printStackTrace();
}
+ log.info("取消订单支付回调处理结束:{}", JSON.toJSONString(callbackResponse));
return callbackResponse;
}
@@ -1515,6 +1536,7 @@
@ResponseBody
@PostMapping("/base/wxPayOrderTaxi")
public CallbackResponse wxPayOrderTaxi(@RequestBody CallbackRequest callbackRequest){
+ log.info("订单完成支付回调结果:{}", JSON.toJSONString(callbackRequest));
CallbackResponse callbackResponse = new CallbackResponse();
try {
/**
@@ -1569,6 +1591,7 @@
}catch (Exception e){
e.printStackTrace();
}
+ log.info("订单完成支付回调处理结束:{}", JSON.toJSONString(callbackResponse));
return callbackResponse;
}
@@ -1765,9 +1788,11 @@
return ResultUtil.tokenErr();
}
Double payMoney = 0D;
+ Integer companyId = 1;
switch (orderType){
case 1:
OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
+ companyId = orderPrivateCar.getCompanyId();
Double orderMoney = orderPrivateCar.getOrderMoney();
if(null == orderMoney){
orderMoney = 0D;
@@ -1786,6 +1811,7 @@
break;
case 4:
OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
+ companyId = orderLogistics.getCompanyId();
Double orderMoney1 = orderLogistics.getOrderMoney();
if(null == orderMoney1){
orderMoney1 = 0D;
@@ -1803,9 +1829,10 @@
}
break;
}
- Double aDouble = userRedPacketRecordService.queryRemainingAmount(uid);
+ List<UserRedPacketRecord> userRedPacketRecords = userRedPacketRecordService.selectList(new EntityWrapper<UserRedPacketRecord>().eq("userId", uid)
+ .eq("state", 1).eq("companyId", companyId).gt("remainingAmount", 0).orderBy("insertTime", false));
Map<String, Object> map = new HashMap<>();
- map.put("redTotal", aDouble);
+ map.put("redTotal", userRedPacketRecords.stream().mapToDouble(UserRedPacketRecord::getRemainingAmount).sum());
RedEnvelopePaymentSettings redEnvelopePaymentSettings = redEnvelopePaymentSettingsService.getRedEnvelopePaymentSettings();
if(null == redEnvelopePaymentSettings){
map.put("deductionAmount", 0D);
@@ -1835,6 +1862,7 @@
}
String randomCode = UUIDUtil.getRandomCode();
redisUtil.setStrValue("trip" + uid, randomCode);
+ log.warn("生成tripId:{} {}", System.currentTimeMillis(), randomCode);
return ResultUtil.success(randomCode);
}catch (Exception e){
e.printStackTrace();
--
Gitblit v1.7.1