admin
2019-01-15 233b0814bbb73b5c791ebe3643f4bd91ba2fa959
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package com.yeshi.fanli.controller.admin;
 
import java.io.PrintWriter;
import java.util.Map;
 
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
 
import net.sf.json.JSONObject;
 
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yeshi.utils.JsonUtil;
 
import com.yeshi.fanli.service.inter.count.TaoBaoOrderCountService;
import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.util.RedisManager;
 
@Controller
@RequestMapping("admin/new/api/v1/taoBaoOrder")
public class TaoBaoOrderAdminController {
 
    @Resource
    private TaoBaoOrderService taoBaoOrderService;
 
    @Resource
    private TaoBaoOrderCountService taoBaoOrderCountService;
 
    @Resource
    private HongBaoService hongBaoService;
 
    @Resource
    private RedisManager redisManager;
    @Resource
    private UserInfoService userInfoService;
 
    
    
    @RequestMapping(value = "countByType")
    public void countByType(String callback, HttpServletRequest request, PrintWriter out) {
 
        try {
            Map<String, Object> countByOdrerType = taoBaoOrderCountService.countByOdrerType();
 
            JSONObject data = new JSONObject();
            data.put("countType", countByOdrerType);
 
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
 
        } catch (Exception e) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("统计失败"));
            e.printStackTrace();
        }
    }
 
    @RequestMapping(value = "countByDays")
    public void countByDays(String callback, HttpServletRequest request, PrintWriter out) {
 
        try {
            // 统计今日 未失效订单数量 相同订单号合并为一单
            int countToday = taoBaoOrderCountService.countToday();
            // 统计昨日 未失效订单数量 相同订单号合并为一单
            int countYesterday = taoBaoOrderCountService.countYesterday();
 
            JSONObject data = new JSONObject();
            data.put("countToday", countToday);
            data.put("countYesterday", countYesterday);
 
            JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
 
        } catch (Exception e) {
            // TODO Auto-generated catch block
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("统计失败"));
            e.printStackTrace();
        }
    }
 
    
}