From c0480d2c62876fa3dc807817900b4f61c007600c Mon Sep 17 00:00:00 2001 From: "james.zhao" Date: Tue, 30 Oct 2018 22:11:15 +0800 Subject: [PATCH] update --- .../core/impls/CouponValidateServiceImpl.java | 29 ++++++++++++++----- .../manage/mappers/system/CustomerMapper.java | 3 ++ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java index da92be0e2..9cc652ff0 100644 --- a/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/customers/core/impls/CouponValidateServiceImpl.java @@ -227,14 +227,29 @@ public class CouponValidateServiceImpl implements CouponValidateService { @Override public JSONObject getHalloweenOrderInfo(String customerId, String transactionDate) { - + List orderList = new ArrayList<>(); + JSONObject relation = customerMapper.findCustomerBykangaId(customerId); + if (relation.containsKey("wechat_openid")) { + JSONObject param = new JSONObject(); + param.put("customer_id", relation.getString("wechat_openid")); + param.put("transaction_date", transactionDate); + param.put("status", 5); + List orderListWechat = orderMapper.listHalloweenActOrder(param); + if(orderListWechat!=null){ + orderList.addAll(orderListWechat); + } + } + if (relation.containsKey("globalpay_openid")) { + JSONObject param = new JSONObject(); + param.put("customer_id", relation.getString("globalpay_openid")); + param.put("transaction_date", transactionDate); + param.put("status", 5); + List orderListGlobal = orderMapper.listHalloweenActOrder(param); + if(orderListGlobal!=null){ + orderList.addAll(orderListGlobal); + } + } // 获取万圣节活动当天支付成功的订单 - JSONObject param = new JSONObject(); - param.put("customer_id", customerId); - param.put("transaction_date", transactionDate); - param.put("status", 5); - List orderList = orderMapper.listHalloweenActOrder(param); - JSONObject result = null; if (orderList != null && orderList.size() > 0) { result = new JSONObject(); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java index cfcc331b0..de8658aaf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/CustomerMapper.java @@ -28,4 +28,7 @@ public interface CustomerMapper { @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "wechat_openid like 'o32%'") JSONObject findCustomerBykangaOpenid(@Param("kanga_openid") String openId); + + @AutoSql(type = SqlType.SELECT) + JSONObject findCustomerBykangaId(@Param("kanga_openid") String openId); }