master
yangkai 6 years ago
parent 4d3bd00ea4
commit af2ec66f48

@ -775,33 +775,6 @@ public class RetailAppServiceImp implements RetailAppService {
TimeZoneUtils.switchTimeZone(orders, query.getTimezone(), "create_time", "transaction_time", "confirm_time");
ArrayList<String> date_contains = new ArrayList<>();
for (JSONObject order : orders) {
String customer_id = order.getString("customer_id");
if (StringUtils.isEmpty(customer_id)) {
continue;
}
switch (order.getString("channel")) {
case "Alipay":
JSONObject alipayUser = managerCustomerRelationAlipayMapper.findCustomerByUserId(customer_id);
if (alipayUser != null) {
order.put("nickname", alipayUser.getString("nickname"));
order.put("headimg", alipayUser.getString("headimg"));
}
break;
case "Wechat":
JSONObject weUser = new JSONObject();
if (customer_id.startsWith("olH")) {
weUser = customerMapper.findCustomerGlobalpayByOpenId(customer_id);
} else {
weUser = customerMapper.findCustomerByOpenId(customer_id);
}
if (weUser != null && !weUser.isEmpty()) {
order.put("nickname", weUser.getString("nickname"));
order.put("headimg", weUser.getString("headimg"));
}
break;
default:
break;
}
Calendar calendar = (Calendar) order.get("transaction_time");
String trade_date = DateFormatUtils.format(calendar, "yyyy-MM-dd", calendar.getTimeZone());
String trade_time = DateFormatUtils.format(calendar, "HH:mm:ss", calendar.getTimeZone());
@ -831,6 +804,33 @@ public class RetailAppServiceImp implements RetailAppService {
order.put("date_total", analysis);
date_contains.add(trade_date);
}
String customer_id = order.getString("customer_id");
if (StringUtils.isEmpty(customer_id)) {
continue;
}
switch (order.getString("channel")) {
case "Alipay":
JSONObject alipayUser = managerCustomerRelationAlipayMapper.findCustomerByUserId(customer_id);
if (alipayUser != null) {
order.put("nickname", alipayUser.getString("nickname"));
order.put("headimg", alipayUser.getString("headimg"));
}
break;
case "Wechat":
JSONObject weUser = new JSONObject();
if (customer_id.startsWith("olH")) {
weUser = customerMapper.findCustomerGlobalpayByOpenId(customer_id);
} else {
weUser = customerMapper.findCustomerByOpenId(customer_id);
}
if (weUser != null && !weUser.isEmpty()) {
order.put("nickname", weUser.getString("nickname"));
order.put("headimg", weUser.getString("headimg"));
}
break;
default:
break;
}
}
return PageListUtils.buildPageListResult(orders);
}

Loading…
Cancel
Save