diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 371db155a..8ad7cf913 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -775,33 +775,6 @@ public class RetailAppServiceImp implements RetailAppService { TimeZoneUtils.switchTimeZone(orders, query.getTimezone(), "create_time", "transaction_time", "confirm_time"); ArrayList 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); }