Helius
2021-12-30 c197ea1f3078de4d4c0e753c8a54caca5b9d5bc2
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
82
83
84
85
86
87
88
package com.matrix.system.hive.statistics;
 
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.hive.dao.MoneyCardUseDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
 
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
 
/**
 * @author
 * @description 经营数据
 * @date 2020-02-08 10:18
 */
@Controller
@RequestMapping(value = "/admin/moneyCardUseStatistics")
public class moneyCardUseStatisticsAction {
 
    @Autowired
    private MoneyCardUseDao moneyCardUseDao;
 
    /**
     * 客户充值卡明细
     */
    @RequestMapping(value = "/showList")
    public @ResponseBody
    AjaxResult showList( @RequestParam Map<String , Object> param) {
        SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        if(!DataAuthUtil.hasAllShopAuth()){
            param.put("shopId", sysUsers.getShopId());
        }
        return AjaxResult.buildSuccessInstance(moneyCardUseDao.selectItemDetail(param),
                moneyCardUseDao.selectItemDetailTotal(param));
    }
 
    @RequestMapping(value = "/exportShowList")
    public void exportShowList( @RequestParam Map<String , Object> param, HttpServletResponse response) throws Exception {
        SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        String title = "客户充值卡明细";
        String[] header = {"客户名", "充值卡名称","到期日期","剩余本金","剩余赠送金额","是否使用完成","是否为会籍卡","备注","来源","订单号"};
        String[] column = {"VIP_NAME", "card_name","FAIL_TIME","real_money","gift_money","isOver","is_vip_car","remark","SOURCE","ORDER_NO"};
 
        if(!DataAuthUtil.hasAllShopAuth()){
            param.put("shopId", sysUsers.getShopId());
        }
        List<Map<String, Object>> dataList = moneyCardUseDao.selectItemDetail(param);
        OrderStatisticsAction.exportExcel(title, header,column, dataList, response);
    }
 
    /**
     * 客户充值卡统计
     */
    @RequestMapping(value = "/summaryItemDetail")
    public @ResponseBody
    AjaxResult summaryItemDetail( @RequestParam Map<String , Object> param) {
        SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        if(!DataAuthUtil.hasAllShopAuth()){
            param.put("shopId", sysUsers.getShopId());
        }
        return AjaxResult.buildSuccessInstance(moneyCardUseDao.summaryItemDetail(param),
                moneyCardUseDao.summaryItemDetailTotal(param));
    }
 
    @RequestMapping(value = "/exportSummaryItemDetail")
    public void exportSummaryItemDetail( @RequestParam Map<String , Object> param, HttpServletResponse response) throws Exception {
        SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY);
        String title = "客户充值卡统计";
        String[] header = {"充值卡名称", "剩余总本金",  "剩余总赠送金额"};
        String[] column = {"card_name", "real_money", "gift_money"};
 
        if(!DataAuthUtil.hasAllShopAuth()){
            param.put("shopId", sysUsers.getShopId());
        }
        List<Map<String, Object>> dataList = moneyCardUseDao.summaryItemDetail(param);
        OrderStatisticsAction.exportExcel(title, header,column, dataList, response);
    }
 
 
}