|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package au.com.royalpay.payment.manage.apps.core.impls;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -54,19 +55,25 @@ public class CustomerImpressionImpl implements CustomerImpression {
|
|
|
|
|
}
|
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
|
params.put("customer_id", customer_id);
|
|
|
|
|
JSONObject paymentInfos = new JSONObject();
|
|
|
|
|
PageList<JSONObject> ordersLast = orderMapper.listOrderByCustomer(params, new PageBounds(1, 1, Order.formString("create_time.desc")));
|
|
|
|
|
if (!CollectionUtils.isEmpty(ordersLast)) {
|
|
|
|
|
JSONObject order = ordersLast.get(0);
|
|
|
|
|
customer.put("last_pay_time", DateFormatUtils.format(order.getDate("create_time"), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
customer.put("last_pay_location", lookupService.getLocation(order.getString("customer_ip")).city);
|
|
|
|
|
JSONObject paymentInfo = new JSONObject();
|
|
|
|
|
paymentInfo.put("last_pay_time", DateFormatUtils.format(order.getDate("create_time"), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
paymentInfo.put("last_pay_location", lookupService.getLocation(order.getString("customer_ip")).city);
|
|
|
|
|
paymentInfos.put("last_payment_info",paymentInfo);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
PageList<JSONObject> ordersFirst = orderMapper.listOrderByCustomer(params, new PageBounds(1, 1, Order.formString("create_time.asc")));
|
|
|
|
|
if (!CollectionUtils.isEmpty(ordersFirst)) {
|
|
|
|
|
JSONObject order = ordersFirst.get(0);
|
|
|
|
|
customer.put("first_pay_time", DateFormatUtils.format(order.getDate("create_time"), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
customer.put("first_pay_location", lookupService.getLocation(order.getString("customer_ip")).city);
|
|
|
|
|
|
|
|
|
|
JSONObject paymentInfo = new JSONObject();
|
|
|
|
|
paymentInfo.put("first_pay_time", DateFormatUtils.format(order.getDate("create_time"), "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
paymentInfo.put("first_pay_location", lookupService.getLocation(order.getString("customer_ip")).city);
|
|
|
|
|
paymentInfos.put("first_payment_info",paymentInfo);
|
|
|
|
|
}
|
|
|
|
|
customer.put("payment_info",paymentInfos);
|
|
|
|
|
return customer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|