master
hellolujian 6 years ago
parent 0bb5b651b0
commit 4ee68e191f

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

@ -51,7 +51,7 @@ public class CouponValidateController {
@GetMapping(value = "/payment/holloween")
@ResponseBody
public JSONObject getHalloweenActOrderInfo(@RequestParam("customer_id") String customerId,
@RequestParam("act_date") String actDate) {
@RequestParam("act_date") String actDate) {
return couponVerificationService.getHalloweenOrderInfo(customerId, actDate);
}
}

Loading…
Cancel
Save