|
|
@ -228,13 +228,16 @@ public class CouponValidateServiceImpl implements CouponValidateService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public JSONObject getHalloweenOrderInfo(String customerId, String transactionDate) {
|
|
|
|
public JSONObject getHalloweenOrderInfo(String customerId, String transactionDate) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取万圣节活动当天支付成功的订单
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
param.put("customer_id", customerId);
|
|
|
|
param.put("customer_id", customerId);
|
|
|
|
param.put("transaction_date", transactionDate);
|
|
|
|
param.put("transaction_date", transactionDate);
|
|
|
|
param.put("status", 5);
|
|
|
|
param.put("status", 5);
|
|
|
|
List<JSONObject> orderList = orderMapper.listHalloweenActOrder(param);
|
|
|
|
List<JSONObject> orderList = orderMapper.listHalloweenActOrder(param);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject result = null;
|
|
|
|
if (orderList != null && orderList.size() > 0) {
|
|
|
|
if (orderList != null && orderList.size() > 0) {
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
|
result = new JSONObject();
|
|
|
|
result.put("orderList", orderList);
|
|
|
|
result.put("orderList", orderList);
|
|
|
|
for (JSONObject order : orderList) {
|
|
|
|
for (JSONObject order : orderList) {
|
|
|
|
String redpackOpenId = getRedpackId(order);
|
|
|
|
String redpackOpenId = getRedpackId(order);
|
|
|
@ -244,10 +247,11 @@ public class CouponValidateServiceImpl implements CouponValidateService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取该笔订单的redpackOpenId
|
|
|
|
// 获取该笔订单的redpackOpenId
|
|
|
|
|
|
|
|
// TODO: 2018/10/28 有待商榷
|
|
|
|
private String getRedpackId(JSONObject order) {
|
|
|
|
private String getRedpackId(JSONObject order) {
|
|
|
|
String redpackOpenId = null;
|
|
|
|
String redpackOpenId = null;
|
|
|
|
String channel = order.getString("channel");
|
|
|
|
String channel = order.getString("channel");
|
|
|
@ -255,10 +259,11 @@ public class CouponValidateServiceImpl implements CouponValidateService {
|
|
|
|
JSONObject customerRelation = customerMapper.findCustomerByOpenId(order.getString("customer_id"));
|
|
|
|
JSONObject customerRelation = customerMapper.findCustomerByOpenId(order.getString("customer_id"));
|
|
|
|
if (customerRelation == null) {
|
|
|
|
if (customerRelation == null) {
|
|
|
|
customerRelation = customerMapper.findCustomerGlobalpayByOpenId(order.getString("customer_id"));
|
|
|
|
customerRelation = customerMapper.findCustomerGlobalpayByOpenId(order.getString("customer_id"));
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
redpackOpenId = customerRelation.getString("redpack_openid");
|
|
|
|
redpackOpenId = customerRelation.getString("redpack_openid");
|
|
|
|
if (customerRelation.getString("kanga_openid") == null) {
|
|
|
|
if (customerRelation.getString("kanga_openid") == null) {
|
|
|
|
redpackOpenId = null;
|
|
|
|
redpackOpenId = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return redpackOpenId;
|
|
|
|
return redpackOpenId;
|
|
|
|