|
|
@ -21,6 +21,7 @@ import org.apache.rocketmq.spring.core.RocketMQTemplate; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.integration.support.MessageBuilder; |
|
|
|
import org.springframework.integration.support.MessageBuilder; |
|
|
|
import org.springframework.messaging.Message; |
|
|
|
import org.springframework.messaging.Message; |
|
|
|
|
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Isolation; |
|
|
|
import org.springframework.transaction.annotation.Isolation; |
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
@ -137,9 +138,8 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { |
|
|
|
|
|
|
|
|
|
|
|
// 处理订单产品业务
|
|
|
|
// 处理订单产品业务
|
|
|
|
orderBusHandle(order); |
|
|
|
orderBusHandle(order); |
|
|
|
|
|
|
|
pushUserMsg(order.getId() , "支付成功"); |
|
|
|
|
|
|
|
|
|
|
|
// Todo 需要改成异步推送。推送支付成功消息
|
|
|
|
|
|
|
|
bsMsgService.pushUserMsg(order.getId() , "支付成功"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return order; |
|
|
|
return order; |
|
|
|
|
|
|
|
|
|
|
@ -153,6 +153,11 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Async |
|
|
|
|
|
|
|
public void pushUserMsg(Long order, String title) throws Exception { |
|
|
|
|
|
|
|
bsMsgService.pushUserMsg(order , title); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 订单业务处理 |
|
|
|
* 订单业务处理 |
|
|
|
* @param order |
|
|
|
* @param order |
|
|
@ -344,16 +349,15 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { |
|
|
|
private void kfcHandle(HighOrder order) throws Exception { |
|
|
|
private void kfcHandle(HighOrder order) throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
// 支付给千猪
|
|
|
|
// 支付给千猪
|
|
|
|
JSONObject object = QianZhuConfig.payKfcOrder(order.getOrderNo()); |
|
|
|
QianZhuConfig.payKfcOrder(order.getOrderNo()); |
|
|
|
|
|
|
|
|
|
|
|
// 推送订单记录
|
|
|
|
// 推送订单记录
|
|
|
|
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); |
|
|
|
// HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
|
|
|
|
highGasOrderPush.setType(OrderPushType.type3.getType()); |
|
|
|
// highGasOrderPush.setType(OrderPushType.type3.getType());
|
|
|
|
highGasOrderPush.setOrderNo(order.getOrderNo()); |
|
|
|
// highGasOrderPush.setOrderNo(order.getOrderNo());
|
|
|
|
highGasOrderPush.setCreateTime(new Date()); |
|
|
|
// highGasOrderPush.setCreateTime(new Date());
|
|
|
|
highGasOrderPush.setRequestContent(order.getOrderNo()); |
|
|
|
// highGasOrderPush.setRequestContent(order.getOrderNo());
|
|
|
|
highGasOrderPush.setReturnContent(object.toJSONString()); |
|
|
|
// highGasOrderPush.setReturnContent(object.toJSONString());
|
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
// highGasOrderPushMapper.insert(highGasOrderPush);
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -406,36 +410,36 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { |
|
|
|
|
|
|
|
|
|
|
|
// 汇联通卡充值
|
|
|
|
// 汇联通卡充值
|
|
|
|
JSONObject deposit = HuiLianTongUnionCardConfig.deposit(order.getOrderNo(), order.getMemCardNo(), order.getPayPrice(), businessType, order.getPaySerialNo(), tranDesc); |
|
|
|
JSONObject deposit = HuiLianTongUnionCardConfig.deposit(order.getOrderNo(), order.getMemCardNo(), order.getPayPrice(), businessType, order.getPaySerialNo(), tranDesc); |
|
|
|
System.out.println("工会卡支付响应参数" + deposit.toJSONString()); |
|
|
|
|
|
|
|
|
|
|
|
// 汇联通充值回调解析
|
|
|
|
JSONObject dataObject = HuiLianTongUnionCardConfig.resolveResponse(deposit.getString("data")); |
|
|
|
HuiLianTongUnionCardConfig.resolveResponse(deposit.getString("data")); |
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> dataMap = new HashMap<>(); |
|
|
|
// Map<String,Object> dataMap = new HashMap<>();
|
|
|
|
dataMap.put("orderNo", order.getOrderNo()); |
|
|
|
// dataMap.put("orderNo", order.getOrderNo());
|
|
|
|
dataMap.put("cardType", "ghk"); |
|
|
|
// dataMap.put("cardType", "ghk");
|
|
|
|
dataMap.put("cardNo", order.getMemCardNo()); |
|
|
|
// dataMap.put("cardNo", order.getMemCardNo());
|
|
|
|
dataMap.put("checkPassword", "N"); |
|
|
|
// dataMap.put("checkPassword", "N");
|
|
|
|
dataMap.put("tranAmount", order.getPayPrice()); |
|
|
|
// dataMap.put("tranAmount", order.getPayPrice());
|
|
|
|
dataMap.put("tranChannel", "HiSen"); |
|
|
|
// dataMap.put("tranChannel", "HiSen");
|
|
|
|
dataMap.put("businessType", businessType); |
|
|
|
// dataMap.put("businessType", businessType);
|
|
|
|
dataMap.put("goodsDesc", goodsDesc); |
|
|
|
// dataMap.put("goodsDesc", goodsDesc);
|
|
|
|
dataMap.put("tranDesc", tranDesc); |
|
|
|
// dataMap.put("tranDesc", tranDesc);
|
|
|
|
HighGasOrderPush payPush = new HighGasOrderPush(); |
|
|
|
// HighGasOrderPush payPush = new HighGasOrderPush();
|
|
|
|
payPush.setType(OrderPushType.type7.getType()); |
|
|
|
// payPush.setType(OrderPushType.type7.getType());
|
|
|
|
payPush.setOrderNo(order.getOrderNo()); |
|
|
|
// payPush.setOrderNo(order.getOrderNo());
|
|
|
|
payPush.setCreateTime(new Date()); |
|
|
|
// payPush.setCreateTime(new Date());
|
|
|
|
payPush.setCode(deposit.getString("respCode")); |
|
|
|
// payPush.setCode(deposit.getString("respCode"));
|
|
|
|
payPush.setRequestContent(JSON.toJSONString(dataMap)); |
|
|
|
// payPush.setRequestContent(JSON.toJSONString(dataMap));
|
|
|
|
payPush.setReturnContent(deposit.toJSONString()); |
|
|
|
// payPush.setReturnContent(deposit.toJSONString());
|
|
|
|
highGasOrderPushMapper.insert(payPush); |
|
|
|
// highGasOrderPushMapper.insert(payPush);
|
|
|
|
|
|
|
|
//
|
|
|
|
if (!Objects.equals(deposit.getString("respCode"), "0000")) { |
|
|
|
// if (!Objects.equals(deposit.getString("respCode"), "0000")) {
|
|
|
|
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , deposit.getString("respMessage")); |
|
|
|
// throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , deposit.getString("respMessage"));
|
|
|
|
} |
|
|
|
// }
|
|
|
|
// 记录回调信息
|
|
|
|
// // 记录回调信息
|
|
|
|
if (!dataObject.getBoolean("success")) { |
|
|
|
// if (!dataObject.getBoolean("success")) {
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, dataObject.getString("message")); |
|
|
|
// throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, dataObject.getString("message"));
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -451,13 +455,13 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { |
|
|
|
JSONObject requestContent = QianZhuConfig.starbucksOrdersPay(order.getOrderNo()); |
|
|
|
JSONObject requestContent = QianZhuConfig.starbucksOrdersPay(order.getOrderNo()); |
|
|
|
|
|
|
|
|
|
|
|
// 推送订单记录
|
|
|
|
// 推送订单记录
|
|
|
|
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); |
|
|
|
// HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
|
|
|
|
highGasOrderPush.setType(OrderPushType.type8.getType()); |
|
|
|
// highGasOrderPush.setType(OrderPushType.type8.getType());
|
|
|
|
highGasOrderPush.setOrderNo(order.getOrderNo()); |
|
|
|
// highGasOrderPush.setOrderNo(order.getOrderNo());
|
|
|
|
highGasOrderPush.setCreateTime(new Date()); |
|
|
|
// highGasOrderPush.setCreateTime(new Date());
|
|
|
|
highGasOrderPush.setRequestContent(order.getOrderNo()); |
|
|
|
// highGasOrderPush.setRequestContent(order.getOrderNo());
|
|
|
|
highGasOrderPush.setReturnContent(requestContent.toJSONString()); |
|
|
|
// highGasOrderPush.setReturnContent(requestContent.toJSONString());
|
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
// highGasOrderPushMapper.insert(highGasOrderPush);
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -475,14 +479,14 @@ public class OrderPaySuccessServiceImpl implements OrderPaySuccessService { |
|
|
|
|
|
|
|
|
|
|
|
JSONObject object = QianZhuConfig.insertV2(memberProduct.getProductId() , order.getOrderNo() , order.getRemarks()); |
|
|
|
JSONObject object = QianZhuConfig.insertV2(memberProduct.getProductId() , order.getOrderNo() , order.getRemarks()); |
|
|
|
|
|
|
|
|
|
|
|
// 推送订单记录
|
|
|
|
// // 推送订单记录
|
|
|
|
HighGasOrderPush highGasOrderPush = new HighGasOrderPush(); |
|
|
|
// HighGasOrderPush highGasOrderPush = new HighGasOrderPush();
|
|
|
|
highGasOrderPush.setType(OrderPushType.type8.getType()); |
|
|
|
// highGasOrderPush.setType(OrderPushType.type8.getType());
|
|
|
|
highGasOrderPush.setOrderNo(order.getOrderNo()); |
|
|
|
// highGasOrderPush.setOrderNo(order.getOrderNo());
|
|
|
|
highGasOrderPush.setCreateTime(new Date()); |
|
|
|
// highGasOrderPush.setCreateTime(new Date());
|
|
|
|
highGasOrderPush.setRequestContent(order.getOrderNo()); |
|
|
|
// highGasOrderPush.setRequestContent(order.getOrderNo());
|
|
|
|
highGasOrderPush.setReturnContent(object.toJSONString()); |
|
|
|
// highGasOrderPush.setReturnContent(object.toJSONString());
|
|
|
|
highGasOrderPushMapper.insert(highGasOrderPush); |
|
|
|
// highGasOrderPushMapper.insert(highGasOrderPush);
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|