## Opt - 直推人数/金额导出.[http://47.94.148.201:8081/index.php?m=bug&f=view&bugID=459]
This commit is contained in:
		
							parent
							
								
									b5eb1e2aab
								
							
						
					
					
						commit
						5ec391e316
					
				| 
						 | 
				
			
			@ -1,15 +1,29 @@
 | 
			
		|||
package com.hzs.member.statis.controller.manager;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.bean.BeanUtil;
 | 
			
		||||
import com.alibaba.fastjson2.JSONObject;
 | 
			
		||||
import com.hzs.common.core.annotation.Log;
 | 
			
		||||
import com.hzs.common.core.constant.CacheConstants;
 | 
			
		||||
import com.hzs.common.core.enums.ETop30Type;
 | 
			
		||||
import com.hzs.common.core.constant.EnumsPrefixConstants;
 | 
			
		||||
import com.hzs.common.core.enums.*;
 | 
			
		||||
import com.hzs.common.core.service.RedisService;
 | 
			
		||||
import com.hzs.common.core.utils.poi.ExcelUtil;
 | 
			
		||||
import com.hzs.common.core.web.domain.AjaxResult;
 | 
			
		||||
import com.hzs.common.domain.member.statis.DirectStatisticsTop30ForAmountVO;
 | 
			
		||||
import com.hzs.common.domain.member.statis.DirectStatisticsTop30ForPeopleVO;
 | 
			
		||||
import com.hzs.common.domain.member.statis.DirectStatisticsTop30VO;
 | 
			
		||||
import com.hzs.common.security.utils.SecurityUtils;
 | 
			
		||||
import com.hzs.member.base.vo.UpPolicyCurrencyVO;
 | 
			
		||||
import com.hzs.member.statis.param.DirectStatisticsTop30QueryParam;
 | 
			
		||||
import com.hzs.member.statis.service.IMemberStatisticsService;
 | 
			
		||||
import lombok.extern.slf4j.Slf4j;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
import javax.servlet.http.HttpServletResponse;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 统计
 | 
			
		||||
| 
						 | 
				
			
			@ -62,5 +76,35 @@ public class BackMemberStatisticsController {
 | 
			
		|||
        return AjaxResult.success(memberStatisticsService.getDirectStatisticsNumberOfAmount(param));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostMapping("/exportTopPeople")
 | 
			
		||||
    public void exportTopPeople(DirectStatisticsTop30QueryParam param, HttpServletResponse response) {
 | 
			
		||||
        List<DirectStatisticsTop30VO> result = memberStatisticsService.getDirectStatisticsNumberOfAmount(param);
 | 
			
		||||
        List<DirectStatisticsTop30ForPeopleVO> list = new ArrayList<>();
 | 
			
		||||
        for (int i = 0; i < result.size(); i++) {
 | 
			
		||||
            DirectStatisticsTop30VO record = result.get(i);
 | 
			
		||||
            record.setSortNum(i+1);
 | 
			
		||||
            DirectStatisticsTop30ForPeopleVO vo = new DirectStatisticsTop30ForPeopleVO();
 | 
			
		||||
            BeanUtil.copyProperties(record, vo, true);
 | 
			
		||||
            list.add(vo);
 | 
			
		||||
        }
 | 
			
		||||
        ExcelUtil<DirectStatisticsTop30ForPeopleVO> util = new ExcelUtil<>(DirectStatisticsTop30ForPeopleVO.class);
 | 
			
		||||
        util.exportExcel(response, list, "导出直推人数排行");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PostMapping("/exportTopAmount")
 | 
			
		||||
    public void exportTopAmount(DirectStatisticsTop30QueryParam param, HttpServletResponse response) {
 | 
			
		||||
        List<DirectStatisticsTop30VO> result = memberStatisticsService.getDirectStatisticsNumberOfAmount(param);
 | 
			
		||||
        List<DirectStatisticsTop30ForAmountVO> list = new ArrayList<>();
 | 
			
		||||
        for (int i = 0; i < result.size(); i++) {
 | 
			
		||||
            DirectStatisticsTop30VO record = result.get(i);
 | 
			
		||||
            record.setSortNum(i+1);
 | 
			
		||||
            DirectStatisticsTop30ForAmountVO vo = new DirectStatisticsTop30ForAmountVO();
 | 
			
		||||
            BeanUtil.copyProperties(record, vo, true);
 | 
			
		||||
            list.add(vo);
 | 
			
		||||
        }
 | 
			
		||||
        ExcelUtil<DirectStatisticsTop30ForAmountVO> util = new ExcelUtil<>(DirectStatisticsTop30ForAmountVO.class);
 | 
			
		||||
        util.exportExcel(response, list, "导出直推金额排行");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,43 @@
 | 
			
		|||
package com.hzs.common.domain.member.statis;
 | 
			
		||||
 | 
			
		||||
import com.hzs.common.core.annotation.BigDecimalFormat;
 | 
			
		||||
import com.hzs.common.core.annotation.Excel;
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Builder;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@Builder
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class DirectStatisticsTop30ForAmountVO implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户id
 | 
			
		||||
     */
 | 
			
		||||
//    @Excel(name = "来源系统")
 | 
			
		||||
//    private Long memberId;
 | 
			
		||||
 | 
			
		||||
    @Excel(name = "排名")
 | 
			
		||||
    private Integer sortNum;
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户编号
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "会员编号")
 | 
			
		||||
    private String memberCode;
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户名称
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "会员姓名")
 | 
			
		||||
    private String memberName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 直推金额
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "直推金额(万元)")
 | 
			
		||||
    @BigDecimalFormat(value = "#0.00")
 | 
			
		||||
    private BigDecimal numberOfAmount;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,42 @@
 | 
			
		|||
package com.hzs.common.domain.member.statis;
 | 
			
		||||
 | 
			
		||||
import com.hzs.common.core.annotation.BigDecimalFormat;
 | 
			
		||||
import com.hzs.common.core.annotation.Excel;
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Builder;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@Builder
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class DirectStatisticsTop30ForPeopleVO implements Serializable {
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户id
 | 
			
		||||
     */
 | 
			
		||||
//    @Excel(name = "来源系统")
 | 
			
		||||
//    private Long memberId;
 | 
			
		||||
 | 
			
		||||
    @Excel(name = "排名")
 | 
			
		||||
    private Integer sortNum;
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户编号
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "会员编号")
 | 
			
		||||
    private String memberCode;
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户名称
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "会员姓名")
 | 
			
		||||
    private String memberName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 直推数量
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "直推人数")
 | 
			
		||||
    private Integer numberOfPeople;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,6 +1,7 @@
 | 
			
		|||
package com.hzs.common.domain.member.statis;
 | 
			
		||||
 | 
			
		||||
import com.hzs.common.core.annotation.BigDecimalFormat;
 | 
			
		||||
import com.hzs.common.core.annotation.Excel;
 | 
			
		||||
import lombok.AllArgsConstructor;
 | 
			
		||||
import lombok.Builder;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
| 
						 | 
				
			
			@ -17,26 +18,32 @@ public class DirectStatisticsTop30VO implements Serializable {
 | 
			
		|||
    /**
 | 
			
		||||
     * 用户id
 | 
			
		||||
     */
 | 
			
		||||
//    @Excel(name = "来源系统")
 | 
			
		||||
    private Long memberId;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户名称
 | 
			
		||||
     */
 | 
			
		||||
    private String memberName;
 | 
			
		||||
 | 
			
		||||
    @Excel(name = "排名")
 | 
			
		||||
    private Integer sortNum;
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户编号
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "会员编号")
 | 
			
		||||
    private String memberCode;
 | 
			
		||||
    /**
 | 
			
		||||
     * 用户名称
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "会员姓名")
 | 
			
		||||
    private String memberName;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 直推数量
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "直推人数")
 | 
			
		||||
    private Integer numberOfPeople;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 直推金额
 | 
			
		||||
     */
 | 
			
		||||
    @Excel(name = "直推金额(万元)")
 | 
			
		||||
    @BigDecimalFormat(value = "#0.00")
 | 
			
		||||
    private BigDecimal numberOfAmount;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue