master
wangning 7 years ago
parent 20fcdb89cb
commit 653b66f8f5

@ -3,15 +3,22 @@ package au.com.royalpay.payment.manage.analysis.web;
import au.com.royalpay.payment.manage.analysis.beans.AnalysisBean;
import au.com.royalpay.payment.manage.analysis.core.CustomersAnalysisService;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import javax.annotation.Resource;
/**
* Created by yishuqian on 10/11/2016.
*/
@ -82,6 +89,7 @@ public class CustomersAnalysisController {
public JSONObject getCustomerOrders(@PathVariable String customer_id, TradeLogQuery tradeLogQuery, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
JSONObject params = tradeLogQuery.toParams(null);
params.put("customer_id",customer_id);
params.put("status",5);
if (manager.getInteger("org_id") != null) {
params.put("org_id", manager.getIntValue("org_id"));
}

@ -55,6 +55,7 @@ public class CustomerImpressionImpl implements CustomerImpression {
}
JSONObject params = new JSONObject();
params.put("customer_id", customer_id);
params.put("include_success_status",4);
List<JSONObject> paymentInfos = new ArrayList<>();
PageList<JSONObject> ordersLast = orderMapper.listOrderByCustomer(params, new PageBounds(1, 1, Order.formString("create_time.desc")));
if (!CollectionUtils.isEmpty(ordersLast)) {
@ -89,6 +90,7 @@ public class CustomerImpressionImpl implements CustomerImpression {
public void generate(int client_id) {
JSONObject params = new JSONObject();
params.put("client_id", client_id);
params.put("include_success_status",4);
PageList<JSONObject> lastRecord = clientCustomersMapper.listCustomerInfo(params, new PageBounds(1, 1, Order.formString("update_time.desc")));
if (!CollectionUtils.isEmpty(lastRecord)) {
params.put("confirm_time", lastRecord.get(0).getDate("update_time"));

@ -455,7 +455,13 @@
SELECT o.*,c.short_name,c.client_moniker FROM pmt_orders o
LEFT JOIN sys_clients c on c.client_id = o.client_id
<where>
o.customer_id=#{customer_id} and o.status=5
o.customer_id=#{customer_id}
<if test="status != null">
and o.status=5
</if>
<if test="include_success_status != null">
and o.status>#{include_success_status}
</if>
<if test="from!=null">and ocreate_time &gt;= #{from}</if>
<if test="to!=null">and o.create_time &lt; #{to}</if>
<if test="org_id!=null">and c.org_id=#{org_id}</if>
@ -551,6 +557,9 @@
<if test="confirm_time">
and o.confirm_time > #{confirm_time}
</if>
<if test="include_success_status!=null">
and o.status >#{include_success_status}
</if>
group by o.customer_id
</select>
<select id="listPaid" resultType="com.alibaba.fastjson.JSONObject">

Loading…
Cancel
Save