Qchen 1 месяц назад
Родитель
Сommit
f277bc1b80

+ 68 - 0
commons/src/main/java/com/jzg/commons/entity/dto/PersonnelOrganizationReportDto.java

@@ -0,0 +1,68 @@
+package com.jzg.commons.entity.dto;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author quchen
+ * @date 2026/7/30 11:15
+ */
+@HeadRowHeight(20)
+@ContentRowHeight(15)
+@Data
+@Builder
+@Schema(description = "人员数据-业务员组织-列表")
+@AllArgsConstructor
+@NoArgsConstructor
+public class PersonnelOrganizationReportDto {
+
+    @Schema(description = "组织id")
+    private String organizationId;
+
+    @Schema(description = "类型")
+    @ExcelProperty(value = "类型", index = 0)
+    @ColumnWidth(10)
+    private String attribute;
+
+    @Schema(description = "名称")
+    @ExcelProperty(value = "名称", index = 1)
+    @ColumnWidth(20)
+    private String name;
+
+    @Schema(description = "所属机构")
+    @ExcelProperty(value = "所属机构", index = 2)
+    @ColumnWidth(20)
+    private String deptName;
+
+    @Schema(description = "所在区域")
+    @ExcelProperty(value = "所在区域", index = 3)
+    @ColumnWidth(20)
+    private String area;
+
+    @Schema(description = "出单人力")
+    @ExcelProperty(value = "出单人力", index = 4)
+    @ColumnWidth(10)
+    private String salesmanCount;
+
+    @Schema(description = "出单人数")
+    @ExcelProperty(value = "出单人数", index = 5)
+    @ColumnWidth(10)
+    private String salesmanNum;
+
+    @Schema(description = "出单总保费")
+    @ExcelProperty(value = "出单总保费", index = 6)
+    @ColumnWidth(15)
+    private String totalPremium;
+
+    @Schema(description = "承保订单")
+    @ExcelProperty(value = "承保订单", index = 7)
+    @ColumnWidth(10)
+    private String totalOrder;
+}

+ 86 - 0
commons/src/main/java/com/jzg/commons/entity/dto/PersonnelReportDetailDto.java

@@ -0,0 +1,86 @@
+package com.jzg.commons.entity.dto;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author quchen
+ * @date 2026/7/29 15:21
+ */
+@HeadRowHeight(20)
+@ContentRowHeight(15)
+@Data
+@Builder
+@Schema(description = "人员数据-业务员-明细")
+@AllArgsConstructor
+@NoArgsConstructor
+public class PersonnelReportDetailDto {
+    @ExcelProperty(value = "姓名", index = 0)
+    @ColumnWidth(10)
+    @Schema(description = "姓名")
+    private String name;
+
+    @ExcelProperty(value = "手机号", index = 1)
+    @ColumnWidth(15)
+    @Schema(description = "手机号")
+    private String mobile;
+
+    @ExcelProperty(value = "保险公司", index = 2)
+    @ColumnWidth(20)
+    @Schema(description = "保险公司")
+    private String companyName;
+
+    @ExcelProperty(value = "合作保险公司", index = 3)
+    @ColumnWidth(20)
+    @Schema(description = "合作保险公司")
+    private String partnerCompany;
+
+    @ExcelProperty(value = "订单号", index = 4)
+    @ColumnWidth(20)
+    @Schema(description = "订单号")
+    private String orderNo;
+
+    @ExcelProperty(value = "车牌号", index = 5)
+    @ColumnWidth(15)
+    @Schema(description = "车牌号")
+    private String licenseNo;
+
+
+    @ExcelProperty(value = "订单类型", index = 6)
+    @ColumnWidth(10)
+    @Schema(description = "订单类型")
+    private String entryStatus;
+
+    @ExcelProperty(value = "险种", index = 7)
+    @ColumnWidth(10)
+    @Schema(description = "险种")
+    private String productName;
+
+    @ExcelProperty(value = "保费", index = 8)
+    @ColumnWidth(10)
+    @Schema(description = "保费")
+    private String premium;
+
+    @ExcelProperty(value = "出单佣金", index = 9)
+    @ColumnWidth(10)
+    @Schema(description = "出单佣金")
+    private String commission;
+
+    @ExcelProperty(value = "录单时间", index = 10)
+    @ColumnWidth(20)
+    @Schema(description = "录单时间")
+    private String createTime;
+
+    @ExcelProperty(value = "签单时间", index = 11)
+    @ColumnWidth(20)
+    @Schema(description = "签单时间")
+    private String signTime;
+
+}

+ 75 - 0
commons/src/main/java/com/jzg/commons/entity/dto/PersonnelReportDto.java

@@ -0,0 +1,75 @@
+package com.jzg.commons.entity.dto;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+
+/**
+ * @author quchen
+ * @date 2026/7/28 14:33
+ */
+@HeadRowHeight(20)
+@ContentRowHeight(15)
+@Data
+@Builder
+@Schema(description = "人员数据-业务员-列表")
+@AllArgsConstructor
+@NoArgsConstructor
+public class PersonnelReportDto {
+    @ExcelProperty(value = "姓名", index = 0)
+    @ColumnWidth(10)
+    @Schema(description = "姓名")
+    private String name;
+
+    @ExcelProperty(value = "手机号", index = 1)
+    @ColumnWidth(10)
+    @Schema(description = "手机号")
+    private String mobile;
+
+    @ExcelProperty(value = "所属机构", index = 2)
+    @ColumnWidth(20)
+    @Schema(description = "所属机构")
+    private String deptName;
+
+    @ExcelProperty(value = "所属区域", index = 3)
+    @ColumnWidth(20)
+    @Schema(description = "所属区域")
+    private String area;
+
+    @ExcelProperty(value = "总订单数", index = 4)
+    @ColumnWidth(10)
+    @Schema(description = "总订单数")
+    private String totalOrder;
+
+    @ExcelProperty(value = "总保费", index = 5)
+    @ColumnWidth(15)
+    @Schema(description = "总保费")
+    private String totalAmount;
+
+    @ExcelProperty(value = "出单佣金", index = 6)
+    @ColumnWidth(15)
+    @Schema(description = "出单佣金")
+    private String totalBrokerage;
+
+    @ExcelProperty(value = "平均保费", index = 7)
+    @ColumnWidth(15)
+    @Schema(description = "平均保费")
+    private String averagePremium;
+
+    @ExcelProperty(value = "最后登录时间", index = 8)
+    @ColumnWidth(15)
+    @Schema(description = "最后登录时间")
+    private String lastLoginTime;
+
+    @ExcelProperty(value = "最后签单时间", index = 9)
+    @ColumnWidth(15)
+    @Schema(description = "最后签单时间")
+    private String lastSigningTime;
+}

+ 9 - 3
commons/src/main/java/com/jzg/commons/entity/report/vo/ReportSearchCommonVo.java

@@ -22,11 +22,14 @@ import java.util.List;
 @NoArgsConstructor
 public class ReportSearchCommonVo implements Serializable {
 
-    @Serial
-    private static final long serialVersionUID = -8629307976503058201L;
-    @Schema(description = "用户id")
+     @Serial
+     private static final long serialVersionUID = -8629307976503058201L;
+     @Schema(description = "用户id")
      private String userId;
 
+     @Schema(description = "手机号")
+     private String mobile;
+
      @Schema(description = "路由可以")
      private String routerKey;
 
@@ -136,4 +139,7 @@ public class ReportSearchCommonVo implements Serializable {
 
     @Schema(description = "租户编号")
     private String systemCode;
+
+    @Schema(description = "组织id")
+    private String organizationId;
 }

+ 37 - 0
commons/src/main/java/com/jzg/commons/entity/vo/PersonnelReportVo.java

@@ -0,0 +1,37 @@
+package com.jzg.commons.entity.vo;
+
+import com.jzg.commons.core.base.PageRequest;
+import lombok.Data;
+
+/**
+ * @author quchen
+ * @date 2026/7/28 14:48
+ */
+
+@Data
+public class PersonnelReportVo extends PageRequest {
+    /**
+     * 租户编码
+     */
+    private String systemCode;
+
+    /**
+     * 签单时间开始
+     */
+    private String signingTimeStart;
+
+    /**
+     * 签单时间结束
+     */
+    private String signingTimeEnd;
+
+    /**
+     * 排序类型 字段+空格+排序     排序 正序 asc  倒序desc
+     */
+    private String orderType;
+
+    /**
+     * 业务员类型 6-个代 7-渠道 8-电销
+     */
+    private String typeAttr;
+}

+ 13 - 204
consoleStatistics/src/main/java/com/jzg/console/controller/ReportPersonDataManageController.java

@@ -1,8 +1,9 @@
 package com.jzg.console.controller;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
+import com.jzg.commons.entity.dto.PersonnelReportDto;
 import com.jzg.commons.entity.report.vo.ReportSearchCommonVo;
 import com.jzg.console.service.*;
 import io.swagger.v3.oas.annotations.Operation;
@@ -39,6 +40,9 @@ public class ReportPersonDataManageController extends BaseController {
     @Autowired
     private ReportTelemarketingPersonDataService reportTelemarketingPersonDataService;
 
+    @Autowired
+    private ReportPersonnelReportService reportPersonnelReportService;
+
 
     /**
      *  @version
@@ -48,10 +52,10 @@ public class ReportPersonDataManageController extends BaseController {
      */
     @Operation(summary = "人员数据-业务员报表-列表查询", description = "人员数据-业务员报表-列表查询")
     @PostMapping(value = "/salesmanReportPageList")
-    public HttpResult<?> salesmanReportPageList(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
+    public HttpResult<Page<PersonnelReportDto>> salesmanReportPageList(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
         try{
-            IPage<?> pageList = reportSalesmanReportService.getPageListByParams(reportSearchCommonVo);
-            return HttpResult.ok(pageList);
+            Page<PersonnelReportDto> result = reportPersonnelReportService.querySalesmanReport(reportSearchCommonVo);
+            return HttpResult.ok(result);
         }catch (Exception e){
             return HttpResult.error(e.getMessage());
         }
@@ -66,7 +70,7 @@ public class ReportPersonDataManageController extends BaseController {
     @PostMapping(value = "/salesmanReportToTask")
     public HttpResult<?> salesmanReportToTask(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
         try{
-            reportSalesmanReportService.downloadListByParams(reportSearchCommonVo);
+            reportPersonnelReportService.exportPersonnelReport(reportSearchCommonVo);
             return HttpResult.ok("人员数据-业务员报表-列表导出处理中,请在导出中心中查看");
         }catch (Exception e){
             return HttpResult.error(e.getMessage());
@@ -82,7 +86,7 @@ public class ReportPersonDataManageController extends BaseController {
     @PostMapping(value = "/salesmanReportDetailPageList")
     public HttpResult<?> companyDataManageDetailPageList(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
         try{
-            IPage<?> pageList = reportSalesmanReportService.getPageDetailListByParams(reportSearchCommonVo);
+            Page<?> pageList = reportPersonnelReportService.queryPersonnelReportDetail(reportSearchCommonVo);
             return HttpResult.ok(pageList);
         }catch (Exception e){
             return HttpResult.error(e.getMessage());
@@ -98,7 +102,7 @@ public class ReportPersonDataManageController extends BaseController {
     @PostMapping(value = "/salesmanReportDetailToTask")
     public HttpResult<?> companyDataManageDetailToTask(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
         try{
-            reportSalesmanReportService.downloadDetailListByParams(reportSearchCommonVo);
+            reportPersonnelReportService.exportPersonnelReportDetail(reportSearchCommonVo);
             return HttpResult.ok("人员数据-业务员报表-明细导出处理中,请在导出中心中查看");
         }catch (Exception e){
             return HttpResult.error(e.getMessage());
@@ -115,7 +119,7 @@ public class ReportPersonDataManageController extends BaseController {
     @PostMapping(value = "/salesmanDeptPageList")
     public HttpResult<?> salesmanDeptPageList(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
         try{
-            IPage<?> pageList = reportSalesmanDeptService.getPageListByParams(reportSearchCommonVo);
+            Page<?> pageList = reportPersonnelReportService.queryPersonnelOrganizationReport(reportSearchCommonVo);
             return HttpResult.ok(pageList);
         }catch (Exception e){
             return HttpResult.error(e.getMessage());
@@ -131,206 +135,11 @@ public class ReportPersonDataManageController extends BaseController {
     @PostMapping(value = "/salesmanDeptToTask")
     public HttpResult<?> salesmanDeptToTask(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
         try{
-            reportSalesmanDeptService.downloadListByParams(reportSearchCommonVo);
+            reportPersonnelReportService.exportPersonnelOrganizationReport(reportSearchCommonVo);
             return HttpResult.ok("人员数据-业务员组织-列表导出处理中,请在导出中心中查看");
         }catch (Exception e){
             return HttpResult.error(e.getMessage());
         }
     }
-    /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2025/9/22 17:11
-     *  @Description:  业务数据-保险公司-明细查询
-     */
-    @Operation(summary = "人员数据-业务员组织-人员明细查询", description = "人员数据-业务员组织-人员明细查询")
-    @PostMapping(value = "/salesmanDeptDetailPageList")
-    public HttpResult<?> salesmanDeptDetailPageList(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
-        try{
-            IPage<?> pageList = reportSalesmanDeptService.getPageDetailListByParams(reportSearchCommonVo);
-            return HttpResult.ok(pageList);
-        }catch (Exception e){
-            return HttpResult.error(e.getMessage());
-        }
-    }
-    /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2025/9/22 17:11
-     *  @Description:  人员数据-业务员组织-人员明细导出
-     */
-    @Operation(summary = "人员数据-业务员组织-人员明细导出", description = "人员数据-业务员组织-人员明细导出")
-    @PostMapping(value = "/salesmanDeptDetailToTask")
-    public HttpResult<?> salesmanDeptDetailToPage(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
-        try{
-            reportSalesmanDeptService.downloadDetailListByParams(reportSearchCommonVo);
-            return HttpResult.ok("人员数据-业务员组织-人员明细导出处理中,请在导出中心中查看");
-        }catch (Exception e){
-            return HttpResult.error(e.getMessage());
-        }
-    }
-
-    /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2025/9/22 17:11
-     *  @Description:  人员数据-业务员组织-业务明细查询
-     */
-    @Operation(summary = "人员数据-业务员组织-业务明细查询", description = "人员数据-业务员组织-业务明细查询")
-    @PostMapping(value = "/salesmanBusinessDetailPageList")
-    public HttpResult<?> riskDataManageDetailPageList(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
-        try{
-            IPage<?> pageList = reportSalesmanDeptService.getPageBusinessDetailListByParams(reportSearchCommonVo);
-            return HttpResult.ok(pageList);
-        }catch (Exception e){
-            return HttpResult.error(e.getMessage());
-        }
-    }
-    /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2025/9/22 17:11
-     *  @Description:  人员数据-业务员组织-业务明细导出
-     */
-    @Operation(summary = "人员数据-业务员组织-业务明细导出", description = "人员数据-业务员组织-业务明细导出")
-    @PostMapping(value = "/salesmanBusinessDetailToTask")
-    public HttpResult<?> riskDataManageDetailToPage(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
-        try{
-            reportSalesmanDeptService.downloadBusinessDetailListByParams(reportSearchCommonVo);
-            return HttpResult.ok("人员数据-业务员组织-业务明细导出处理中,请在导出中心中查看");
-        }catch (Exception e){
-            return HttpResult.error(e.getMessage());
-        }
-    }
-
-    /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2025/9/22 17:08
-     *  @Description: 人员数据-渠道-列表
-     */
-    @Operation(summary = "人员数据-渠道-列表查询", description = "人员数据-渠道-列表查询")
-    @PostMapping(value = "/channelPersonDataPageList")
-    public HttpResult<?> channelPersonDataPageList(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
-        try{
-            IPage<?> pageList = reportChannelPersonDataService.getPageListByParams(reportSearchCommonVo);
-            return HttpResult.ok(pageList);
-        }catch (Exception e){
-            return HttpResult.error(e.getMessage());
-        }
-    }
-    /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2025/9/22 17:09
-     *  @Description: 人员数据-渠道-列表导出
-     */
-    @Operation(summary = "人员数据-渠道-列表导出", description = "人员数据-渠道-列表导出")
-    @PostMapping(value = "/channelPersonDataToTask")
-    public HttpResult<?> channelPersonDataToTask(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
-        try{
-            reportChannelPersonDataService.downloadListByParams(reportSearchCommonVo);
-            return HttpResult.ok("人员数据-渠道-列表导出处理中,请在导出中心中查看");
-        }catch (Exception e){
-            return HttpResult.error(e.getMessage());
-        }
-    }
-    /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2025/9/22 17:11
-     *  @Description:  人员数据-渠道-明细查询
-     */
-    @Operation(summary = "人员数据-渠道-明细查询", description = "人员数据-渠道-明细查询")
-    @PostMapping(value = "/channelPersonDataDetailPageList")
-    public HttpResult<?> channelPersonDataDetailPageList(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
-        try{
-            IPage<?> pageList = reportChannelPersonDataService.getPageDetailListByParams(reportSearchCommonVo);
-            return HttpResult.ok(pageList);
-        }catch (Exception e){
-            return HttpResult.error(e.getMessage());
-        }
-    }
-    /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2025/9/22 17:11
-     *  @Description:  人员数据-渠道-明细导出
-     */
-    @Operation(summary = "人员数据-渠道-明细导出", description = "业务数据-渠道-明细导出")
-    @PostMapping(value = "/channelPersonDataDetailToTask")
-    public HttpResult<?> channelPersonDataDetailToTask(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
-        try{
-            reportChannelPersonDataService.downloadDetailListByParams(reportSearchCommonVo);
-            return HttpResult.ok("人员数据-渠道-明细导出处理中,请在导出中心中查看");
-        }catch (Exception e){
-            return HttpResult.error(e.getMessage());
-        }
-    }
-
-    /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2025/9/22 17:08
-     *  @Description: 人员数据-电销-列表
-     */
-    @Operation(summary = "人员数据-电销-列表查询", description = "人员数据-电销-列表查询")
-    @PostMapping(value = "/telemarketingPersonDataPageList")
-    public HttpResult<?> telemarketingPersonDataPageList(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
-        try{
-            IPage<?> pageList = reportTelemarketingPersonDataService.getPageListByParams(reportSearchCommonVo);
-            return HttpResult.ok(pageList);
-        }catch (Exception e){
-            return HttpResult.error(e.getMessage());
-        }
-    }
-    /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2025/9/22 17:09
-     *  @Description: 人员数据-电销-列表导出
-     */
-    @Operation(summary = "人员数据-电销-列表导出", description = "人员数据-电销-列表导出")
-    @PostMapping(value = "/telemarketingDataManageToTask")
-    public HttpResult<?> telemarketingDataManageToTask(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
-        try{
-            reportTelemarketingPersonDataService.downloadListByParams(reportSearchCommonVo);
-            return HttpResult.ok("人员数据-电销-列表导出处理中,请在导出中心中查看");
-        }catch (Exception e){
-            return HttpResult.error(e.getMessage());
-        }
-    }
-    /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2025/9/22 17:11
-     *  @Description:  人员数据-电销-明细查询
-     */
-    @Operation(summary = "人员数据-电销-明细查询", description = "人员数据-电销-明细查询")
-    @PostMapping(value = "/telemarketingPersonDataDetailPageList")
-    public HttpResult<?> telemarketingPersonDataDetailPageList(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
-        try{
-            IPage<?> pageList = reportTelemarketingPersonDataService.getPageDetailListByParams(reportSearchCommonVo);
-            return HttpResult.ok(pageList);
-        }catch (Exception e){
-            return HttpResult.error(e.getMessage());
-        }
-    }
-    /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2025/9/22 17:11
-     *  @Description:  人员数据-电销-明细导出
-     */
-    @Operation(summary = "人员数据-电销-明细导出", description = "人员数据-电销-明细导出")
-    @PostMapping(value = "/telemarketingDataManageDetailToTask")
-    public HttpResult<?> telemarketingDataManageDetailToTask(@RequestBody ReportSearchCommonVo reportSearchCommonVo) {
-        try{
-            reportTelemarketingPersonDataService.downloadDetailListByParams(reportSearchCommonVo);
-            return HttpResult.ok("人员数据-电销-明细导出处理中,请在导出中心中查看");
-        }catch (Exception e){
-            return HttpResult.error(e.getMessage());
-        }
-    }
 
 }

+ 26 - 0
consoleStatistics/src/main/java/com/jzg/console/mapper/ReportPersonnelDataMapper.java

@@ -0,0 +1,26 @@
+package com.jzg.console.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jzg.commons.entity.dto.PersonnelOrganizationReportDto;
+import com.jzg.commons.entity.dto.PersonnelReportDetailDto;
+import com.jzg.commons.entity.dto.PersonnelReportDto;
+import com.jzg.commons.entity.report.vo.ReportSearchCommonVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+@Mapper
+public interface ReportPersonnelDataMapper {
+    Page<PersonnelReportDto> queryPersonnelReport(Page page, @Param("reportSearchCommonVo") ReportSearchCommonVo reportSearchCommonVo);
+
+    List<PersonnelReportDto> exportPersonnelReport(@Param("reportSearchCommonVo") ReportSearchCommonVo reportSearchCommonVo);
+
+    Page<PersonnelReportDetailDto> queryPersonnelReportDetail(Page page, @Param("reportSearchCommonVo") ReportSearchCommonVo reportSearchCommonVo);
+
+    List<PersonnelReportDetailDto> exportPersonnelReportDetail(@Param("reportSearchCommonVo") ReportSearchCommonVo reportSearchCommonVo);
+
+    Page<PersonnelOrganizationReportDto> queryPersonnelOrganizationReport(Page page, @Param("reportSearchCommonVo") ReportSearchCommonVo reportSearchCommonVo);
+
+    List<PersonnelOrganizationReportDto> exportPersonnelOrganizationReport(@Param("reportSearchCommonVo") ReportSearchCommonVo reportSearchCommonVo);
+}

+ 29 - 0
consoleStatistics/src/main/java/com/jzg/console/service/ReportPersonnelReportService.java

@@ -0,0 +1,29 @@
+package com.jzg.console.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jzg.commons.entity.dto.PersonnelOrganizationReportDto;
+import com.jzg.commons.entity.dto.PersonnelReportDetailDto;
+import com.jzg.commons.entity.dto.PersonnelReportDto;
+import com.jzg.commons.entity.report.vo.ReportSearchCommonVo;
+
+
+/**
+ *  @version 
+ *  @author: hxl
+ *  @Date: 2025/9/22 16:43
+ *  @Description:  人员数据-业务员报表
+ */ 
+public interface ReportPersonnelReportService extends ReportBaseService{
+    Page<PersonnelReportDto> querySalesmanReport(ReportSearchCommonVo reportSearchCommonVo);
+
+    void exportPersonnelReport(ReportSearchCommonVo reportSearchCommonVo);
+
+    Page<PersonnelReportDetailDto> queryPersonnelReportDetail(ReportSearchCommonVo reportSearchCommonVo);
+
+    void exportPersonnelReportDetail(ReportSearchCommonVo reportSearchCommonVo);
+
+    Page<PersonnelOrganizationReportDto> queryPersonnelOrganizationReport(ReportSearchCommonVo reportSearchCommonVo);
+
+    void exportPersonnelOrganizationReport(ReportSearchCommonVo reportSearchCommonVo);
+
+}

+ 81 - 0
consoleStatistics/src/main/java/com/jzg/console/service/impl/ReportPersonnelReportServiceImpl.java

@@ -0,0 +1,81 @@
+package com.jzg.console.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.jzg.commons.entity.dto.PersonnelOrganizationReportDto;
+import com.jzg.commons.entity.dto.PersonnelReportDetailDto;
+import com.jzg.commons.entity.dto.PersonnelReportDto;
+import com.jzg.commons.entity.report.vo.ReportSearchCommonVo;
+import com.jzg.console.mapper.ReportPersonnelDataMapper;
+import com.jzg.console.service.ReportPersonnelReportService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author quchen
+ * @date 2026/7/29 10:57
+ */
+@Service
+public class ReportPersonnelReportServiceImpl extends ReportBaseServiceImpl implements ReportPersonnelReportService {
+    @Autowired
+    private ReportPersonnelDataMapper reportPersonnelDataMapper;
+
+    @Override
+    public Page<PersonnelReportDto> querySalesmanReport(ReportSearchCommonVo reportSearchCommonVo) {
+        Page<PersonnelReportDto> page = new Page<>(reportSearchCommonVo.getPageNo(), reportSearchCommonVo.getPageSize());
+        return reportPersonnelDataMapper.queryPersonnelReport(page, reportSearchCommonVo);
+    }
+
+    @Override
+    public void exportPersonnelReport(ReportSearchCommonVo reportSearchCommonVo) {
+        List<PersonnelReportDto> list = reportPersonnelDataMapper.exportPersonnelReport(reportSearchCommonVo);
+        upLoadFile(reportSearchCommonVo, PersonnelReportDto.class,list,"人员数据-列表导出-" + reportSearchCommonVo.getUserId());
+    }
+
+    @Override
+    public Page<PersonnelReportDetailDto> queryPersonnelReportDetail(ReportSearchCommonVo reportSearchCommonVo) {
+        Page<PersonnelReportDto> page = new Page<>(reportSearchCommonVo.getPageNo(), reportSearchCommonVo.getPageSize());
+        return reportPersonnelDataMapper.queryPersonnelReportDetail(page, reportSearchCommonVo);
+    }
+
+    @Override
+    public void exportPersonnelReportDetail(ReportSearchCommonVo reportSearchCommonVo) {
+        List<PersonnelReportDetailDto> list = reportPersonnelDataMapper.exportPersonnelReportDetail(reportSearchCommonVo);
+        upLoadFile(reportSearchCommonVo, PersonnelReportDetailDto.class,list,"人员数据-明细导出-" + reportSearchCommonVo.getUserId());
+    }
+
+    @Override
+    public Page<PersonnelOrganizationReportDto> queryPersonnelOrganizationReport(ReportSearchCommonVo reportSearchCommonVo) {
+        Page<PersonnelOrganizationReportDto> page = new Page<>(reportSearchCommonVo.getPageNo(), reportSearchCommonVo.getPageSize());
+        return reportPersonnelDataMapper.queryPersonnelOrganizationReport(page, reportSearchCommonVo);
+    }
+
+    @Override
+    public void exportPersonnelOrganizationReport(ReportSearchCommonVo reportSearchCommonVo) {
+        List<PersonnelOrganizationReportDto> list = reportPersonnelDataMapper.exportPersonnelOrganizationReport(reportSearchCommonVo);
+        upLoadFile(reportSearchCommonVo, PersonnelOrganizationReportDto.class,list,"人员数据-组织结构-" + reportSearchCommonVo.getUserId());
+    }
+
+
+    @Override
+    public IPage<?> getPageListByParams(ReportSearchCommonVo reportSearchCommonVo) {
+        return null;
+    }
+
+    @Override
+    public void downloadListByParams(ReportSearchCommonVo reportSearchCommonVo) {
+
+    }
+
+    @Override
+    public IPage<?> getPageDetailListByParams(ReportSearchCommonVo reportSearchCommonVo) {
+        return null;
+    }
+
+    @Override
+    public void downloadDetailListByParams(ReportSearchCommonVo reportSearchCommonVo) {
+
+    }
+}

+ 246 - 0
consoleStatistics/src/main/resources/mapper/ReportPersonnelDataMapper.xml

@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.jzg.console.mapper.ReportPersonnelDataMapper">
+    <sql id="summaryPersonnelData">
+        SELECT
+            jzg.name as name,
+            io.real_quote_user_id as mobile,
+            dept.dept_path as deptName,
+            CONCAT_WS('/', p.area_cname, c.area_cname, a.area_cname) as area,
+            COUNT(DISTINCT io.id) as totalOrder,
+            ROUND(SUM(ifo.total_premium),2) AS totalAmount,
+            ROUND(SUM(ifo.total_payable_premium),2) AS totalBrokerage,
+            ROUND(IF(COUNT(DISTINCT io.id)=0,0,SUM(ifo.total_premium)/COUNT(DISTINCT io.id)),2) AS averagePremium,
+            MAX(io.signing_time) as lastSigningTime,
+            MAX(jzg.last_login_time) as lastLoginTime,
+            so.id as organizationId
+        FROM
+            ins_orders io
+                LEFT JOIN ins_fee_orders ifo ON io.id = ifo.order_no AND ifo.is_delete = 0
+                LEFT JOIN sys_user su ON io.real_quote_user_id = su.mobile AND su.is_delete = 0
+                LEFT JOIN sys_organization_user_link soul on su.id = soul.user_id
+                LEFT JOIN sys_user_jzg_info jzg ON su.id = jzg.user_id AND jzg.is_delete = 0 AND jzg.system_code = #{reportSearchCommonVo.systemCode}
+                left join sys_organization so on soul.organization_id = so.id
+                LEFT JOIN sys_user_jzg_info_salesman sujis ON jzg.id = sujis.sys_user_jzg_info_id and sujis.is_delete = 0
+                LEFT JOIN
+            (
+                SELECT
+                    d.id,
+                    d.province,
+                    d.city,
+                    d.area,
+                    GROUP_CONCAT(sd.name
+                        ORDER BY FIND_IN_SET(sd.id,REPLACE(d.route,'-',','))
+                     SEPARATOR '-') AS dept_path
+                FROM sys_dept d
+                         LEFT JOIN sys_dept sd
+                                   ON FIND_IN_SET(sd.id,REPLACE(d.route,'-',','))
+                GROUP BY
+                    d.id,
+                    d.province,
+                    d.city,
+                    d.area
+            ) dept
+            ON dept.id = jzg.dept_id
+                LEFT JOIN sys_area p ON dept.province = p.area_code
+                LEFT JOIN sys_area c ON dept.city = c.area_code
+                LEFT JOIN sys_area a ON dept.area = a.area_code
+        WHERE io.system_code = #{reportSearchCommonVo.systemCode}
+          AND io.order_status = 5
+          AND io.is_delete = 0
+          AND io.real_quote_user_id IS NOT NULL
+        <if test="reportSearchCommonVo.signTimeBegin != null and reportSearchCommonVo.signTimeEnd != null">
+            and DATE_FORMAT(io.signing_time, '%Y-%m-%d') between #{reportSearchCommonVo.signTimeBegin} AND #{reportSearchCommonVo.signTimeEnd}
+        </if>
+        <if test="reportSearchCommonVo.organizationId != null and reportSearchCommonVo.organizationId != ''">
+            and so.id = #{reportSearchCommonVo.organizationId}
+        </if>
+
+        <if test="reportSearchCommonVo.salesmanTypes != null and reportSearchCommonVo.salesmanTypes != ''">
+            and sujis.type_attr in
+            <foreach collection="reportSearchCommonVo.salesmanTypes" item="type" index="index" open="(" separator="," close=")">
+            #{type}
+            </foreach>
+        </if>
+        GROUP BY
+        io.real_quote_user_id,
+        jzg.name,
+        dept.dept_path,
+        p.area_cname,
+        c.area_cname,
+        a.area_cname,
+        so.id
+        <if test="reportSearchCommonVo.orderType != null and reportSearchCommonVo.orderType != ''">
+            ORDER BY ${reportSearchCommonVo.orderType}
+        </if>
+        <if test="reportSearchCommonVo.orderType == null or reportSearchCommonVo.orderType == ''">
+            ORDER BY lastSigningTime DESC
+        </if>
+    </sql>
+
+    <select id="queryPersonnelReport" resultType="com.jzg.commons.entity.dto.PersonnelReportDto">
+        <include refid="summaryPersonnelData"/>
+    </select>
+
+    <select id="exportPersonnelReport" resultType="com.jzg.commons.entity.dto.PersonnelReportDto">
+        <include refid="summaryPersonnelData"/>
+    </select>
+
+    <sql id="queryPersonnelDetailData">
+        SELECT
+            jzg.NAME AS name,
+            io.real_quote_user_id AS mobile,
+            io.company_name AS companyName,
+            eic.NAME AS partnerCompany,
+            io.id AS orderNo,
+            ioci.license_no AS licenseNo,
+            CASE io.entry_status
+            WHEN 1 THEN '车险录入'
+            WHEN 2 THEN '待客录单'
+            WHEN 3 THEN '外部订单' end as entryStatus,
+            io.product_name AS productName,
+            ioc.sum_premium AS premium,
+            ifo.total_payable_premium AS commission,
+            io.create_time AS createTime,
+            io.signing_time AS signTime
+        FROM
+            ins_orders io
+                LEFT JOIN ins_fee_orders ifo ON io.id = ifo.order_no
+                AND ifo.is_delete = 0
+                LEFT JOIN ins_orders_car_info ioci ON io.id = ioci.order_no
+                LEFT JOIN ins_orders_costs ioc ON io.id = ioc.order_no
+                LEFT JOIN ptl_agreement pa ON io.agreement_id = pa.id
+                AND pa.is_delete = 0
+                LEFT JOIN esm_ins_company eic ON pa.partner_company_id = eic.id
+                LEFT JOIN sys_user su ON io.real_quote_user_id = su.mobile
+                AND su.is_delete = 0
+                LEFT JOIN sys_user_jzg_info jzg ON su.id = jzg.user_id
+                AND jzg.is_delete = 0
+                AND jzg.system_code = #{reportSearchCommonVo.systemCode}
+                left join sys_user_jzg_info jzg2 on jzg.leader_id = jzg2.id
+                LEFT JOIN sys_organization_user_link soul on su.id = soul.user_id
+                left join sys_organization so on soul.organization_id = so.id
+        WHERE
+            io.system_code =  #{reportSearchCommonVo.systemCode}
+          AND io.order_status = 5
+          AND io.is_delete = 0
+        <if test="reportSearchCommonVo.mobile != null and reportSearchCommonVo.mobile != ''">
+          AND io.real_quote_user_id = #{reportSearchCommonVo.mobile}
+        </if>
+        <if test="reportSearchCommonVo.signTimeBegin != null and reportSearchCommonVo.signTimeEnd != null">
+            and DATE_FORMAT(io.signing_time, '%Y-%m-%d') between #{reportSearchCommonVo.signTimeBegin} AND #{reportSearchCommonVo.signTimeEnd}
+        </if>
+        <if test="reportSearchCommonVo.organizationId != null and reportSearchCommonVo.organizationId != ''">
+            and so.id = #{reportSearchCommonVo.organizationId}
+        </if>
+        <if test="reportSearchCommonVo.orderType != null and reportSearchCommonVo.orderType != ''">
+            ORDER BY ${reportSearchCommonVo.orderType}
+        </if>
+        <if test="reportSearchCommonVo.orderType == null or reportSearchCommonVo.orderType == ''">
+            ORDER BY signTime DESC
+        </if>
+    </sql>
+
+    <select id="queryPersonnelReportDetail" resultType="com.jzg.commons.entity.dto.PersonnelReportDetailDto">
+        <include refid="queryPersonnelDetailData"/>
+    </select>
+
+    <select id="exportPersonnelReportDetail" resultType="com.jzg.commons.entity.dto.PersonnelReportDetailDto">
+        <include refid="queryPersonnelDetailData"/>
+    </select>
+
+    <sql id="queryPersonnelOrganization">
+        SELECT
+            so.id AS organizationId,
+            CASE
+                so.attribute
+                WHEN 1 THEN
+                    '团队'
+                WHEN 2 THEN
+                    '渠道'
+                WHEN 3 THEN
+                    '电销'
+                END AS attribute,
+            so.NAME AS name,
+            dept.dept_path AS deptName,
+            CONCAT_WS( '/', p.area_cname, c.area_cname, a.area_cname ) AS area,
+            COUNT( DISTINCT soul.user_id ) AS salesmanCount,
+            COUNT( DISTINCT CASE WHEN stat.order_count > 0 THEN soul.user_id END ) AS salesmanNum,
+            COALESCE ( SUM( stat.order_count ), 0 ) AS totalOrder,
+            ROUND( COALESCE ( SUM( stat.total_premium ), 0 ), 2 ) AS totalPremium
+        FROM
+            sys_organization so
+                LEFT JOIN sys_organization_user_link soul ON soul.organization_id = so.id
+                LEFT JOIN sys_user su ON su.id = soul.user_id
+                AND su.is_delete = 0
+                LEFT JOIN sys_user_jzg_info jzg ON jzg.user_id = su.id
+                AND jzg.system_code = #{reportSearchCommonVo.systemCode}
+            AND jzg.is_delete = 0
+                LEFT JOIN (
+                SELECT
+                    io.real_quote_user_id,
+                    COUNT( io.id ) AS order_count,
+                    SUM(COALESCE (fee.total_premium, 0)) AS total_premium,
+                    MAX(io.signing_time) AS signing_time
+                FROM
+                    ins_orders io
+                        LEFT JOIN ( SELECT order_no, SUM( total_premium ) AS total_premium
+                                    FROM ins_fee_orders
+                                    WHERE is_delete = 0
+                                    GROUP BY order_no ) fee ON fee.order_no = io.id
+                WHERE
+                    io.system_code = #{reportSearchCommonVo.systemCode}
+                  AND io.is_delete = 0
+                  AND io.order_status = 5
+                  AND io.real_quote_user_id IS NOT NULL
+                <if test="reportSearchCommonVo.signTimeBegin != null and reportSearchCommonVo.signTimeEnd != null">
+                  AND DATE_FORMAT(io.signing_time, '%Y-%m-%d') between #{reportSearchCommonVo.signTimeBegin} AND #{reportSearchCommonVo.signTimeEnd}
+                </if>
+                GROUP BY
+                    io.real_quote_user_id
+            ) stat ON stat.real_quote_user_id = su.mobile
+                LEFT JOIN (
+                SELECT
+                    d.id,
+                    d.province,
+                    d.city,
+                    d.area,
+                    GROUP_CONCAT( sd.NAME ORDER BY FIND_IN_SET( sd.id, REPLACE ( d.route, '-', ',' ) ) SEPARATOR '-' ) AS dept_path
+                FROM
+                    sys_dept d
+                        LEFT JOIN sys_dept sd ON FIND_IN_SET( sd.id, REPLACE ( d.route, '-', ',' ) )
+                GROUP BY
+                    d.id,
+                    d.province,
+                    d.city,
+                    d.area
+            ) dept ON dept.id = so.dept_id
+                LEFT JOIN sys_area p ON p.area_code = dept.province
+                LEFT JOIN sys_area c ON c.area_code = dept.city
+                LEFT JOIN sys_area a ON a.area_code = dept.area
+        WHERE
+            so.system_code = #{reportSearchCommonVo.systemCode}
+          AND so.is_delete = 0
+        GROUP BY
+            so.attribute,
+            so.NAME,
+            dept.dept_path,
+            p.area_cname,
+            c.area_cname,
+            a.area_cname,
+            so.id
+        <if test="reportSearchCommonVo.orderType != null and reportSearchCommonVo.orderType != ''">
+            ORDER BY ${reportSearchCommonVo.orderType}
+        </if>
+        <if test="reportSearchCommonVo.orderType == null or reportSearchCommonVo.orderType == ''">
+            ORDER BY totalPremium DESC
+        </if>
+    </sql>
+
+    <select id="queryPersonnelOrganizationReport" resultType="com.jzg.commons.entity.dto.PersonnelOrganizationReportDto">
+        <include refid="queryPersonnelOrganization"/>
+    </select>
+    <select id="exportPersonnelOrganizationReport" resultType="com.jzg.commons.entity.dto.PersonnelOrganizationReportDto">
+        <include refid="queryPersonnelOrganization"/>
+    </select>
+</mapper>