|
@@ -1194,8 +1194,8 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
if ((ObjectUtil.isNotEmpty(appOrder.getOrderOrFree()) && appOrder.getOrderOrFree() == 1) || appOrder.getPrice().compareTo(BigDecimal.ZERO)== 0) {
|
|
|
payForm.setOrPayOrder(0);
|
|
|
} else {
|
|
|
-// Map<String, String> result = payment(appOrder.getId());
|
|
|
-// payForm.setParams(result);
|
|
|
+ Map<String, String> result = payment(appOrder.getId());
|
|
|
+ payForm.setParams(result);
|
|
|
|
|
|
//发布任务到redission延迟队列(16分钟)
|
|
|
String task = CommonConstant.ORDER_TIME_OUT_TASK_PREFIX + appOrder.getId();
|
|
@@ -1245,8 +1245,8 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
//订单金额信息
|
|
|
JSONObject amount_json = new JSONObject();
|
|
|
//支付金额 单位:分
|
|
|
-// amount_json.put("total", Integer.parseInt(amount_fee(appOrder.getPrice())));
|
|
|
- amount_json.put("total", Integer.parseInt(amount_fee(new BigDecimal("0.01"))));//测试0.01元
|
|
|
+ amount_json.put("total", Integer.parseInt(amount_fee(appOrder.getPrice())));
|
|
|
+// amount_json.put("total", Integer.parseInt(amount_fee(new BigDecimal("0.01"))));//测试0.01元
|
|
|
amount_json.put("currency", "CNY");//固定传:CNY,代表人民币
|
|
|
params.put("amount", amount_json);
|
|
|
|
|
@@ -1698,14 +1698,15 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
AppOrder appOrder = appOrderMapper.selectOne(Wrappers.<AppOrder>lambdaQuery().eq(AppOrder::getOrderCode, orderCode).last("limit 1"));
|
|
|
|
|
|
//null代表查询失败 SUCCESS-成功 USERPAYING和ACCEPT为中间态 其他为支付失败
|
|
|
-// JSONObject res = weChatPayService.orderQueryByOutTradeNo(orderCode);
|
|
|
-// String s = res == null ? null : res.getString("trade_state");
|
|
|
- String s = "SUCCESS";
|
|
|
+ JSONObject res = weChatPayService.orderQueryByOutTradeNo(orderCode);
|
|
|
+ String s = res == null ? null : res.getString("trade_state");
|
|
|
if ("SUCCESS".equals(s) || appOrder.getOriginalPrice().compareTo(BigDecimal.ZERO)==0) {
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(appOrder) && Objects.equals(appOrder.getOrderStatus(), CommonConstant.ORDER_STATUS_0)) {
|
|
|
appOrder.setOrderStatus(1);
|
|
|
-// appOrder.setTransactionId(res.getString("transaction_id"));
|
|
|
+ appOrder.setPayTime(new Date());
|
|
|
+ appOrder.setPayStatus(1);
|
|
|
+ appOrder.setTransactionId(res.getString("transaction_id"));
|
|
|
appOrderMapper.updateById(appOrder);
|
|
|
List<AppOrderProInfo> proInfoList = appOrderProInfoMapper.selectList(Wrappers.<AppOrderProInfo>lambdaQuery().eq(AppOrderProInfo::getOrderId, appOrder.getId()));
|
|
|
if (CollUtil.isNotEmpty(proInfoList)) {
|