|
|
@@ -0,0 +1,70 @@
|
|
|
+package com.fs.app.controller.statistic;
|
|
|
+
|
|
|
+import com.fs.app.params.MemberReportQuery;
|
|
|
+import com.fs.app.service.IMemberReportService;
|
|
|
+import com.fs.app.vo.MemberReportVO;
|
|
|
+import com.fs.app.vo.SalesMemberReportVO;
|
|
|
+import com.fs.common.core.controller.BaseController;
|
|
|
+import com.fs.common.core.domain.AjaxResult;
|
|
|
+import com.fs.common.core.page.TableDataInfo;
|
|
|
+import com.fs.common.utils.ServletUtils;
|
|
|
+import com.fs.common.utils.poi.ExcelUtil;
|
|
|
+import com.fs.framework.security.LoginUser;
|
|
|
+import com.fs.framework.service.TokenService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * APP会员统计报表Controller
|
|
|
+ *
|
|
|
+ * @author ylrz
|
|
|
+ * @date 2026-04-22
|
|
|
+ */
|
|
|
+@Api(tags = "APP会员统计报表")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/app/statistics")
|
|
|
+public class MemberReportController extends BaseController
|
|
|
+{
|
|
|
+ @Autowired
|
|
|
+ private IMemberReportService memberReportService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TokenService tokenService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询会员统计报表列表(按销售公司)
|
|
|
+ */
|
|
|
+ @ApiOperation("查询会员统计报表列表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('app:statistics:salesMemberReport:list')")
|
|
|
+ @GetMapping("/memberReport")
|
|
|
+ public TableDataInfo memberReport(MemberReportQuery query)
|
|
|
+ {
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ query.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+ List<SalesMemberReportVO> list = memberReportService.selectMemberReportBySalesList(query);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出会员统计报表
|
|
|
+ */
|
|
|
+ @ApiOperation("导出会员统计报表")
|
|
|
+ @PreAuthorize("@ss.hasPermi('app:statistics:memberReport:export')")
|
|
|
+ @GetMapping("/exportMemberReport")
|
|
|
+ public AjaxResult exportMemberReport(MemberReportQuery query)
|
|
|
+ {
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ query.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
+ List<SalesMemberReportVO> list = memberReportService.selectMemberReportBySalesList(query);
|
|
|
+ ExcelUtil<SalesMemberReportVO> util = new ExcelUtil<SalesMemberReportVO>(SalesMemberReportVO.class);
|
|
|
+ return util.exportExcel(list, "会员统计报表");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|