ソースを参照

Merge remote-tracking branch 'origin/test' into test

wks 2 年 前
コミット
c1023b5723
22 ファイル変更845 行追加210 行削除
  1. 16 0
      sql/Online.sql
  2. 69 0
      src/main/java/com/ydtech/modules/admin/controller/InsuranceHandlingSettlementMonthController.java
  3. 25 6
      src/main/java/com/ydtech/modules/admin/controller/SysAgencyLeaderController.java
  4. 13 11
      src/main/java/com/ydtech/modules/admin/controller/SysLoginController.java
  5. 6 0
      src/main/java/com/ydtech/modules/admin/model/SysAgencyFeeApproval.java
  6. 6 0
      src/main/java/com/ydtech/modules/admin/model/SysAgencyFeeApprovalRecord.java
  7. 6 0
      src/main/java/com/ydtech/modules/admin/model/dto/SysAgencyFeeApprovalAddDto.java
  8. 9 3
      src/main/java/com/ydtech/modules/admin/model/dto/TeamInformationDto.java
  9. 5 0
      src/main/java/com/ydtech/modules/admin/model/dto/TeamUserInfoDto.java
  10. 16 0
      src/main/java/com/ydtech/modules/admin/model/vo/AAPLoginVo.java
  11. 2 1
      src/main/java/com/ydtech/modules/admin/model/vo/AgencyExtractFeeVo.java
  12. 6 2
      src/main/java/com/ydtech/modules/admin/service/SysAgencyLeaderService.java
  13. 10 1
      src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyFeeApprovalServiceImpl.java
  14. 314 186
      src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyLeaderServiceImpl.java
  15. 2 0
      src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java
  16. 25 0
      src/main/java/com/ydtech/modules/fnc/dao/InsuranceHandlingSettlementMonthMapper.java
  17. 46 0
      src/main/java/com/ydtech/modules/fnc/dto/InsuranceHandlingSettlementMonthDto.java
  18. 65 0
      src/main/java/com/ydtech/modules/fnc/entity/InsuranceHandlingSettlementMonthEntity.java
  19. 31 0
      src/main/java/com/ydtech/modules/fnc/service/InsuranceHandlingSettlementMonthService.java
  20. 66 0
      src/main/java/com/ydtech/modules/fnc/service/impl/InsuranceHandlingSettlementMonthServiceImpl.java
  21. 47 0
      src/main/java/com/ydtech/modules/fnc/vo/InsuranceHandlingSettlementMonthVo.java
  22. 60 0
      src/main/resources/mapper/modules/insuranceHandlingSettlementMonth/InsuranceHandlingSettlementMonthMapper.xml

+ 16 - 0
sql/Online.sql

@@ -161,3 +161,19 @@ CREATE TABLE `sys_user_role_kzt`  (
                                       `last_update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
                                       PRIMARY KEY (`id`) USING BTREE
 ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '控制台用户关联角色' ROW_FORMAT = Dynamic;
+
+
+-- 保险手续费结算关联表
+DROP TABLE IF EXISTS `sys_insurance_handling_settlement_month`;
+CREATE TABLE `sys_insurance_handling_settlement_month`  (
+                                                            `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
+                                                            `task_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '任务id',
+                                                            `settlement_documentary_fees_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '结算id',
+                                                            `settlement_amount` decimal(15,5) DEFAULT NULL COMMENT '结算金额',
+                                                            `total_amount` decimal(15,5) DEFAULT NULL COMMENT '开票金额',
+                                                            `remaining_amount` decimal(15,5) DEFAULT NULL COMMENT '剩余结算金额',
+                                                            `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+                                                            `signing_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+                                                            `creater_id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
+                                                            PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '保险手续费结算关联表' ROW_FORMAT = Dynamic;

+ 69 - 0
src/main/java/com/ydtech/modules/admin/controller/InsuranceHandlingSettlementMonthController.java

@@ -0,0 +1,69 @@
+package com.ydtech.modules.admin.controller;
+
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
+import com.ydtech.modules.fnc.entity.InsPlyIncome;
+import com.ydtech.modules.fnc.service.InsuranceHandlingSettlementMonthService;
+import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
+import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * <p>
+ *    保险手续费结算关联表
+ * </p>
+ *
+ * @author whp
+ * @since 2024-08-16
+ */
+@RestController
+@Api(tags = "保险手续费结算")
+@RequestMapping("SettlementHandling")
+public class InsuranceHandlingSettlementMonthController {
+
+    @Autowired
+    private InsuranceHandlingSettlementMonthService  insuranceHandlingSettlementMonthService;
+
+    /**
+     *
+     * @param insuranceHandlingSettlementMonthVo  结算传参
+     * @return  返回结算信息
+     */
+    @PostMapping("/queryList")
+    @ApiModelProperty(value = "查询")
+    public HttpResult<List<InsuranceHandlingSettlementMonthDto>> queryList(@RequestBody @Valid InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
+        List<InsuranceHandlingSettlementMonthDto> result = insuranceHandlingSettlementMonthService.queryList(insuranceHandlingSettlementMonthVo);
+        return HttpResult.ok(result);
+    }
+
+    /**
+     * 结算新增
+     * @param insuranceHandlingSettlementMonthVo
+     * @return
+     */
+    @PostMapping("/insert")
+    @ApiModelProperty(value = "新增")
+    public HttpResult<InsuranceHandlingSettlementMonthDto> insertByEntity(@RequestBody InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
+        return insuranceHandlingSettlementMonthService.insertByEntity(insuranceHandlingSettlementMonthVo);
+    }
+
+
+
+
+
+
+
+
+
+
+}

+ 25 - 6
src/main/java/com/ydtech/modules/admin/controller/SysAgencyLeaderController.java

@@ -163,11 +163,21 @@ public class SysAgencyLeaderController extends BaseController {
     /**
      * 查询机构下所有团队的信息
      */
-    @PostMapping("/queryTeamInfo")
-    @ApiOperation(value = "查询机构下所有团队的信息")
-    public HttpResult<List<TeamInformation>> queryTeamInfo(@RequestBody TeamInformationDto teamInformationDto){
+//    @PostMapping("/queryTeamInfo")
+//    @ApiOperation(value = "查询机构下所有团队的信息")
+//    public HttpResult<List<TeamInformation>> queryTeamInfo(@RequestBody TeamInformationDto teamInformationDto){
+//
+//        return HttpResult.ok("success", this.sysAgencyLeaderService.queryTeamInfo(teamInformationDto));
+//    }
+
+    /**
+     * 分页查询机构下所有团队的信息
+     */
+    @PostMapping("/queryTeamInfoPage")
+    @ApiOperation(value = "分页查询机构下所有团队的信息")
+    public HttpResult<BasePageResult<TeamInformation>> queryTeamInfoPage(@RequestBody TeamInformationDto teamInformationDto){
 
-        return HttpResult.ok("success", this.sysAgencyLeaderService.queryTeamInfo(teamInformationDto));
+        return HttpResult.ok("success", this.sysAgencyLeaderService.queryTeamInfoPage(teamInformationDto));
     }
 
     /**
@@ -175,12 +185,21 @@ public class SysAgencyLeaderController extends BaseController {
      */
 
     @PostMapping("/queryTeamUser")
-    @ApiOperation(value = "根据团队id查询团队下人员信息")
-    public HttpResult<List<TeamUserInfoVo>> queryTeamUser(@RequestBody TeamUserInfoDto teamUserInfoDto) {
+    @ApiOperation(value = "分页查询团队下人员信息")
+    public HttpResult<BasePageResult<TeamUserInfoVo>> queryTeamUser(@RequestBody TeamUserInfoDto teamUserInfoDto) {
 
         return HttpResult.ok("success", this.sysAgencyLeaderService.queryTeamUser(teamUserInfoDto));
     }
 
+    /**
+     * 查询合伙人下的机构负责人
+     */
+    @GetMapping("/queryAgencyLeader")
+    @ApiOperation(value = "查询合伙人下的机构负责人")
+    public HttpResult<List<SysAgencyLeaderVo>> queryAgencyLeader(){
+
+        return HttpResult.ok("success", this.sysAgencyLeaderService.queryAgencyLeader(getUserId()));
+    }
 
 
 }

+ 13 - 11
src/main/java/com/ydtech/modules/admin/controller/SysLoginController.java

@@ -16,10 +16,7 @@ import com.ydtech.modules.admin.model.SysPassword;
 import com.ydtech.modules.admin.model.SysRole;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.po.SysUserLinkSys;
-import com.ydtech.modules.admin.model.vo.LoginBean;
-import com.ydtech.modules.admin.model.vo.LoginTicket;
-import com.ydtech.modules.admin.model.vo.PhoneLoginVo;
-import com.ydtech.modules.admin.model.vo.QrCodeStatusEnum;
+import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.admin.service.*;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.security.utils.PasswordUtils;
@@ -252,7 +249,8 @@ public class SysLoginController {
      */
     @PostMapping(value = "/aapLogin")
     @ApiOperation(value = "合伙人和机构负责人登录APP接口")
-    public HttpResult aapLogin(@RequestBody LoginBean loginBean, HttpServletRequest request) {
+    public HttpResult<AAPLoginVo> aapLogin(@RequestBody LoginBean loginBean, HttpServletRequest request) {
+        AAPLoginVo aapLoginVo = new AAPLoginVo();
         String username = loginBean.getAccount();
         String password = loginBean.getPassword();
         String captcha = loginBean.getCaptcha();
@@ -262,10 +260,14 @@ public class SysLoginController {
         //校验登录用户是否为合伙人或者是机构负责人
         boolean a = sysPartnerService.checkPartner(user.getId());
         boolean b = sysAgencyLeaderService.checkUserId(user.getId());
-        if (!a ) {
-            if (!b) {
-                throw  new SystemException("该用户无权限登录AAP,只能合伙人或者机构负责人才能登录!");
-            }
+        if (a ) {
+            //类型:1.合伙人;2机构负责人
+            aapLoginVo.setType(1);
+        }else if (b) {
+            aapLoginVo.setType(2);
+        }else {
+            throw  new SystemException("该用户无权限登录AAP,只能合伙人或者机构负责人才能登录!");
+
         }
 
 
@@ -316,8 +318,8 @@ public class SysLoginController {
         // 获取这个人的token
         String token = StpUtil.createLoginSession(user.getId());
         StpUtil.getSessionByLoginId(user.getId()).set(SaSession.USER, user);
-
-        return HttpResult.ok("登录成功", token);
+        aapLoginVo.setToken(token);
+        return HttpResult.ok("登录成功", aapLoginVo);
 
     }
 

+ 6 - 0
src/main/java/com/ydtech/modules/admin/model/SysAgencyFeeApproval.java

@@ -47,6 +47,12 @@ public class SysAgencyFeeApproval implements Serializable {
      */
     @ApiModelProperty(value = "机构id")
     private String deptId;
+
+    /**
+     * 银行卡户主
+     */
+    @ApiModelProperty(value = "银行卡户主")
+    private String realUserName;
     /**
      * 机构name
      */

+ 6 - 0
src/main/java/com/ydtech/modules/admin/model/SysAgencyFeeApprovalRecord.java

@@ -45,6 +45,12 @@ public class SysAgencyFeeApprovalRecord {
     @ApiModelProperty(value = "机构name")
     private String deptName;
 
+    /**
+     * 银行卡户主
+     */
+    @ApiModelProperty(value = "银行卡户主")
+    private String realUserName;
+
     /**
      * 银行卡号
      */

+ 6 - 0
src/main/java/com/ydtech/modules/admin/model/dto/SysAgencyFeeApprovalAddDto.java

@@ -13,6 +13,12 @@ import java.util.Date;
 @Data
 @ApiModel(value = "机构保费抽成提交审批入参")
 public class SysAgencyFeeApprovalAddDto {
+    /**
+     * 银行卡户主
+     */
+    @ApiModelProperty(value = "银行卡户主")
+    private String realUserName;
+
     /**
      * 银行卡号
      */

+ 9 - 3
src/main/java/com/ydtech/modules/admin/model/dto/TeamInformationDto.java

@@ -8,10 +8,11 @@ import org.springframework.format.annotation.DateTimeFormat;
 @Data
 @ApiModel(value = "查询机构下团队信息")
 public class TeamInformationDto {
-    @ApiModelProperty(value = "首页为1,详情为2")
-    private Integer type;
 
-    @ApiModelProperty(value = "用户id")
+    @ApiModelProperty(value = "机构负责人id")
+    private String userId;
+
+    @ApiModelProperty(value = "团队name")
     private String deptName;
 
     @ApiModelProperty(value = "开始时间")
@@ -20,4 +21,9 @@ public class TeamInformationDto {
     @ApiModelProperty(value = "结束时间")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     private String endTime;
+
+    @ApiModelProperty(value = "页数")
+    private int pageNum;
+    @ApiModelProperty(value = "每页条数")
+    private int pageSize;
 }

+ 5 - 0
src/main/java/com/ydtech/modules/admin/model/dto/TeamUserInfoDto.java

@@ -25,5 +25,10 @@ public class TeamUserInfoDto {
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     private String endTime;
 
+    @ApiModelProperty(value = "页数")
+    private int pageNum;
+    @ApiModelProperty(value = "每页条数")
+    private int pageSize;
+
 
 }

+ 16 - 0
src/main/java/com/ydtech/modules/admin/model/vo/AAPLoginVo.java

@@ -0,0 +1,16 @@
+package com.ydtech.modules.admin.model.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel(value = "AAP登录返参")
+public class AAPLoginVo {
+
+    @ApiModelProperty(value = "个人的token")
+    private String token;
+
+    @ApiModelProperty(value = "类型:1.合伙人;2机构负责人")
+    private int type;
+}

+ 2 - 1
src/main/java/com/ydtech/modules/admin/model/vo/AgencyExtractFeeVo.java

@@ -11,7 +11,8 @@ import java.util.Date;
 @Data
 @ApiModel(value = "机构抽成返回实体")
 public class AgencyExtractFeeVo {
-        @ApiModelProperty(value = "员工id")
+
+    @ApiModelProperty(value = "员工id")
     private String userId;
     /**
      * 员工姓名

+ 6 - 2
src/main/java/com/ydtech/modules/admin/service/SysAgencyLeaderService.java

@@ -51,7 +51,11 @@ public interface SysAgencyLeaderService extends IService<SysAgencyLeader> {
 
     BasePageResult<AgencyExtractFeeVo> queryExtractFeeAll(SysAgencyLeaderPageDto sysAgencyLeaderPageDto);
 
-    List<TeamInformation> queryTeamInfo(TeamInformationDto teamInformationDto);
+//    List<TeamInformation> queryTeamInfo(TeamInformationDto teamInformationDto);
 
-    List<TeamUserInfoVo> queryTeamUser(TeamUserInfoDto teamUserInfoDto);
+    BasePageResult<TeamUserInfoVo> queryTeamUser(TeamUserInfoDto teamUserInfoDto);
+
+    BasePageResult<TeamInformation> queryTeamInfoPage(TeamInformationDto teamInformationDto);
+
+    List<SysAgencyLeaderVo> queryAgencyLeader(String userId);
 }

+ 10 - 1
src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyFeeApprovalServiceImpl.java

@@ -10,8 +10,10 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.dao.SysAgencyFeeApprovalMapper;
 import com.ydtech.modules.admin.dao.SysAgencyFeeApprovalRecordMapper;
+import com.ydtech.modules.admin.dao.SysDeptMapper;
 import com.ydtech.modules.admin.model.SysAgencyFeeApproval;
 import com.ydtech.modules.admin.model.SysAgencyFeeApprovalRecord;
+import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalAddDto;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalDto;
@@ -20,6 +22,7 @@ import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalPageDto;
 import com.ydtech.modules.admin.model.vo.AgencyExtractFee;
 import com.ydtech.modules.admin.service.SysAgencyFeeApprovalService;
 import com.ydtech.modules.admin.service.SysAgencyLeaderService;
+import com.ydtech.modules.admin.service.SysDeptService;
 import com.ydtech.modules.admin.service.SysUserService;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.order.entity.BasePageResult;
@@ -52,6 +55,9 @@ public class SysAgencyFeeApprovalServiceImpl extends ServiceImpl<SysAgencyFeeApp
     @Resource
     private SysAgencyLeaderService sysAgencyLeaderService;
 
+    @Resource
+    private SysDeptMapper sysDeptMapper;
+
 
 
 
@@ -77,7 +83,10 @@ public class SysAgencyFeeApprovalServiceImpl extends ServiceImpl<SysAgencyFeeApp
         sysAgencyFeeApproval.setUserId(user.getId());
         sysAgencyFeeApproval.setUserName(user.getName());
         sysAgencyFeeApproval.setDeptId(user.getDeptId());
-        sysAgencyFeeApproval.setDeptName(user.getDeptName());
+        SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>().eq(SysDept::getId, user.getDeptId()).eq(SysDept::getDelFlag, 0));
+        if (sysDept != null) {
+            sysAgencyFeeApproval.setDeptName(sysDept.getName());
+        }
         sysAgencyFeeApproval.setNumber(IdGenerate.nextId());
         //总保费
         sysAgencyFeeApproval.setSumpremium(agencyExtractFee.getSumpremium());

+ 314 - 186
src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyLeaderServiceImpl.java

@@ -15,7 +15,9 @@ import com.ydtech.modules.admin.model.dto.TeamInformationDto;
 import com.ydtech.modules.admin.model.dto.TeamUserInfoDto;
 import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.admin.service.SysAgencyLeaderService;
+import com.ydtech.modules.admin.service.SysDeptService;
 import com.ydtech.modules.admin.service.SysPartnerService;
+import com.ydtech.modules.admin.service.SysUserService;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.order.dao.InsAreaCompanyMapper;
 import com.ydtech.modules.order.dao.InsOrdersMapper;
@@ -46,10 +48,14 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
 
     @Resource
     private SysDeptMapper sysDeptMapper;
+    @Resource
+    private SysDeptService sysDeptService;
 
     @Resource
     private SysUserMapper sysUserMapper;
 
+    @Resource
+    private SysUserService sysUserService;
     @Resource
     private InsOrdersMapper insOrdersMapper;
 
@@ -228,7 +234,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
         if (sysAgencyLeaders.size() > 0) {
             for (SysAgencyLeader record : sysAgencyLeaders) {
                 for (SysAgencyLeaderVo sysAgencyLeaderVo : sysAgencyLeaderVos) {
-                    if (record.getId().equals(sysAgencyLeaderVo.getId()) ) {
+                    if (record.getId().equals(sysAgencyLeaderVo.getId())) {
                         String source = record.getSource();
                         if (!StringUtils.isNullOrEmpty(source)) {
                             String[] split = source.split(",");
@@ -257,7 +263,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
         if (records.size() > 0) {
             for (SysAgencyLeader record : records) {
                 for (SysAgencyLeaderVo sysAgencyLeaderVo : sysAgencyLeaderVos) {
-                    if (record.getId().equals(sysAgencyLeaderVo.getId()) ) {
+                    if (record.getId().equals(sysAgencyLeaderVo.getId())) {
                         String source = record.getSource();
                         if (!StringUtils.isNullOrEmpty(source)) {
                             String[] split = source.split(",");
@@ -380,7 +386,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                     agencyExtractFee.setHistoryFee(historyFee);
                     //可提现 = 总抽成-已提现
                     agencyExtractFee.setCashFee(multiply.subtract(historyFee));
-                }else {
+                } else {
                     agencyExtractFee.setHistoryFee(new BigDecimal("0.00"));
                     agencyExtractFee.setCashFee(multiply.subtract(new BigDecimal("0.00")));
                 }
@@ -455,7 +461,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                     agencyExtractFee.setHistoryFee(historyFee);
                     //可提现 = 总抽成-已提现
                     agencyExtractFee.setCashFee(multiply.subtract(historyFee));
-                }else {
+                } else {
                     agencyExtractFee.setHistoryFee(new BigDecimal("0.00"));
                     agencyExtractFee.setCashFee(multiply.subtract(new BigDecimal("0.00")));
                 }
@@ -538,7 +544,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                     agencyExtractFee.setHistoryFee(historyFee);
                     //可提现 = 总抽成-已提现
                     agencyExtractFee.setCashFee(multiply.subtract(historyFee));
-                }else {
+                } else {
                     agencyExtractFee.setHistoryFee(new BigDecimal("0.00"));
                     agencyExtractFee.setCashFee(multiply.subtract(new BigDecimal("0.00")));
                 }
@@ -552,218 +558,339 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                 agencyExtractFeeList);
     }
 
+//    @Override
+//    public List<TeamInformation> queryTeamInfo(TeamInformationDto teamInformationDto) {
+//        String userId = BaseController.getUser().getId();
+//        List<TeamInformation> informationList = new ArrayList<>();
+//        //合伙人
+//        boolean c = sysPartnerService.checkPartner(userId);
+//        if (c) {
+//            return extracted(userId, informationList, teamInformationDto);
+//        }
+//        //校验当前用户是否为机构负责人
+//        boolean b = this.checkUserId(userId);
+//        if (b) {
+//            //机构负责人查询机构下的团队
+//            SysAgencyLeader sysAgencyLeaders = sysAgencyLeaderMapper.selectOne(new LambdaQueryWrapper<SysAgencyLeader>().eq(SysAgencyLeader::getUserId, userId)
+//                    .eq(SysAgencyLeader::getDelFlag, 1));
+//            String[] split = sysAgencyLeaders.getSource().split(",");
+//            //根据当前机构id查询出下面的团队,条件:机构来源相同,机构等级为null的团队
+//            List<SysDept> sysDeptList = sysDeptMapper.selectList(new LambdaQueryWrapper<SysDept>().likeRight(SysDept::getId, sysAgencyLeaders.getDeptId())
+//                    .isNull(SysDept::getComlevel).eq(SysDept::getDelFlag, 0).in(SysDept::getManagementSource, split)
+//                    .like(StringUtils.isNotEmpty(teamInformationDto.getDeptName()), SysDept::getName, teamInformationDto.getDeptName()));
+//            if (sysDeptList.size() > 0) {
+//                //总保费
+//                BigDecimal bigDecimal = new BigDecimal("0.00");
+//                for (SysDept sysDept : sysDeptList) {
+//                    TeamInformation teamInformation = new TeamInformation();
+//                    teamInformation.setDeptId(sysDept.getId());
+//                    teamInformation.setDeptName(sysDept.getName());
+//                    List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().likeRight(SysUser::getId, sysDept.getId()).eq(SysUser::getStatus, 1));
+//                    teamInformation.setDeptManNum(sysUsers.size());
+//                    List<InsOrders> insOrderList;
+//                    //筛选订单,选择时间
+//                    Date updateTime = sysAgencyLeaders.getUpdateTime();
+//                    if (updateTime == null) {
+//                        //机构下所有订单
+//                        insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
+//                                .likeRight(InsOrders::getDeptid, sysDept.getId())
+//                                .ge(InsOrders::getCreatetime, sysAgencyLeaders.getCreateTime())
+//                                .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()), InsOrders::getCreatetime, teamInformationDto.getBeginTime())
+//                                .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()), InsOrders::getCreatetime, teamInformationDto.getEndTime()));
+//                        teamInformation.setStartTime(sysAgencyLeaders.getCreateTime());
+//
+//                    } else {
+//                        insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
+//                                .likeRight(InsOrders::getDeptid, sysDept.getId())
+//                                .ge(InsOrders::getCreatetime, updateTime)
+//                                .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()), InsOrders::getCreatetime, teamInformationDto.getBeginTime())
+//                                .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()), InsOrders::getCreatetime, teamInformationDto.getEndTime()));
+//                        teamInformation.setStartTime(updateTime);
+//                    }
+//
+//                    if (insOrderList.size() > 0) {
+//                        for (InsOrders insOrders : insOrderList) {
+//                            //查询订单下的所有子订单
+//                            List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
+//                                    .eq(InsAreaCompany::getOrderstatus, 3));
+//                            if (insAreaCompanies.size() > 0) {
+//                                for (InsAreaCompany insAreaCompany : insAreaCompanies) {
+//                                    //累加每一个子订单的交强险费用+商业险费用+驾意险费用
+//                                    bigDecimal = bigDecimal.add(insAreaCompany.getJqpremium()).add(insAreaCompany.getSypremium()).add(insAreaCompany.getJypremium());
+//
+//                                }
+//                            }
+//                        }
+//                    }
+//                    teamInformation.setSumpremium(bigDecimal);
+//                    int num = 0;
+//                    // 查团队有几人出单 :订单表中userid相等同时在 子订单表中状态为3已承保才为出单
+//                    List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
+//                    for (String s : userIdList) {
+//                        List<InsOrders> collect = insOrderList.stream().filter(InsOrders -> InsOrders.getUserid().equals(s)).collect(Collectors.toList());
+//                        if (collect.size() > 0) {
+//                            InsOrders insOrders = collect.get(0);
+//                            List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
+//                                    .eq(InsAreaCompany::getOrderstatus, 3));
+//                            if (insAreaCompanies1.size() > 0) {
+//                                num++;
+//                            }
+//
+//                        }
+//                    }
+//                    teamInformation.setOrderManNum(num);
+//                    informationList.add(teamInformation);
+//                    Integer type = teamInformationDto.getType();
+//                    if (type == 1) {
+//                        int size = informationList.size();
+//                        if (size == 2) {
+//                            return informationList;
+//                        }
+//                    }
+//                }
+//
+//            }
+//            return informationList;
+//        }
+//
+//
+//        return informationList;
+//    }
+//
+//    private List<TeamInformation> extracted(String userId, List<TeamInformation> informationList, TeamInformationDto teamInformationDto) {
+//        //查询所有推荐的机构负责人核算总保费
+//        List<SysRelationPerson> sysRelationPeople = sysRelationPersonMapper.selectList(new LambdaQueryWrapper<SysRelationPerson>()
+//                .eq(SysRelationPerson::getSuggestId, userId).eq(SysRelationPerson::getType, 1));
+//        if (sysRelationPeople.size() > 0) {
+//            //总保费
+//            BigDecimal bigDecimal = new BigDecimal("0.00");
+//            //获取所有推荐的机构负责人id
+//            List<String> agencyLeaderIds = sysRelationPeople.stream().map(SysRelationPerson::getAgencyLeaderId).collect(Collectors.toList());
+//            for (String agencyLeaderId : agencyLeaderIds) {
+//                //获取机构负责人信息
+//                SysAgencyLeader sysAgencyLeaders = sysAgencyLeaderMapper.selectOne(new LambdaQueryWrapper<SysAgencyLeader>()
+//                        .eq(SysAgencyLeader::getUserId, agencyLeaderId)
+//                        .eq(SysAgencyLeader::getDelFlag, 1));
+//                String[] split = sysAgencyLeaders.getSource().split(",");
+//                //根据当前机构id查询出下面的团队,条件:机构来源相同,机构等级为null的团队
+//                List<SysDept> sysDeptList = sysDeptMapper.selectList(new LambdaQueryWrapper<SysDept>()
+//                        .likeRight(SysDept::getId, sysAgencyLeaders.getDeptId())
+//                        .isNull(SysDept::getComlevel)
+//                        .eq(SysDept::getDelFlag, 0)
+//                        .in(SysDept::getManagementSource, split)
+//                        .like(StringUtils.isNotEmpty(teamInformationDto.getDeptName()), SysDept::getName, teamInformationDto.getDeptName()));
+//                if (sysDeptList.size() > 0) {
+//                    for (SysDept sysDept : sysDeptList) {
+//                        TeamInformation teamInformation = new TeamInformation();
+//                        teamInformation.setDeptId(sysDept.getId());
+//                        teamInformation.setDeptName(sysDept.getName());
+//                        List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>()
+//                                .likeRight(SysUser::getId, sysDept.getId())
+//                                .eq(SysUser::getStatus, 1));
+//                        teamInformation.setDeptManNum(sysUsers.size());
+//                        List<InsOrders> insOrderList;
+//                        //筛选订单,选择时间
+//                        Date updateTime = sysAgencyLeaders.getUpdateTime();
+//                        if (updateTime == null) {
+//                            //机构下所有订单
+//                            insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
+//                                    .likeRight(InsOrders::getDeptid, sysDept.getId())
+//                                    .ge(InsOrders::getCreatetime, sysAgencyLeaders.getCreateTime())
+//                                    .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()), InsOrders::getCreatetime, teamInformationDto.getBeginTime())
+//                                    .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()), InsOrders::getCreatetime, teamInformationDto.getEndTime()));
+//                            teamInformation.setStartTime(sysAgencyLeaders.getCreateTime());
+//                        } else {
+//                            insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
+//                                    .likeRight(InsOrders::getDeptid, sysDept.getId())
+//                                    .ge(InsOrders::getCreatetime, updateTime)
+//                                    .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()), InsOrders::getCreatetime, teamInformationDto.getBeginTime())
+//                                    .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()), InsOrders::getCreatetime, teamInformationDto.getEndTime()));
+//                            teamInformation.setStartTime(updateTime);
+//                        }
+//
+//                        if (insOrderList.size() > 0) {
+//                            for (InsOrders insOrders : insOrderList) {
+//                                //查询订单下的所有子订单
+//                                List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
+//                                        .eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
+//                                        .eq(InsAreaCompany::getOrderstatus, 3));
+//                                if (insAreaCompanies.size() > 0) {
+//                                    for (InsAreaCompany insAreaCompany : insAreaCompanies) {
+//                                        //累加每一个子订单的交强险费用+商业险费用+驾意险费用
+//                                        bigDecimal = bigDecimal.add(insAreaCompany.getJqpremium()).add(insAreaCompany.getSypremium()).add(insAreaCompany.getJypremium());
+//
+//                                    }
+//                                }
+//                            }
+//                        }
+//                        teamInformation.setSumpremium(bigDecimal);
+//                        int num = 0;
+//                        // 查团队有几人出单 :子订单中userid相等同时在 子订单表中状态为3已承保才为出单
+//                        List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
+//                        for (String s : userIdList) {
+//                            List<InsOrders> collect = insOrderList.stream().filter(InsOrders -> InsOrders.getUserid().equals(s)).collect(Collectors.toList());
+//                            if (collect.size() > 0) {
+//                                InsOrders insOrders = collect.get(0);
+//                                List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
+//                                        .eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
+//                                        .eq(InsAreaCompany::getOrderstatus, 3));
+//                                if (insAreaCompanies1.size() > 0) {
+//                                    num++;
+//                                }
+//
+//                            }
+//                        }
+//                        teamInformation.setOrderManNum(num);
+//                        informationList.add(teamInformation);
+//                        Integer type = teamInformationDto.getType();
+//                        if (type == 1) {
+//                            int size = informationList.size();
+//                            if (size == 2) {
+//                                return informationList;
+//                            }
+//                        }
+//                    }
+//                }
+//            }
+//        }
+//        return informationList;
+//    }
+
+
     @Override
-    public List<TeamInformation> queryTeamInfo(TeamInformationDto teamInformationDto) {
-        String userId = BaseController.getUser().getId();
-        List<TeamInformation> informationList = new ArrayList<>();
-        //合伙人
-        boolean c = sysPartnerService.checkPartner(userId);
-        if (c) {
-            return extracted(userId, informationList,teamInformationDto);
+    public BasePageResult<TeamInformation> queryTeamInfoPage(TeamInformationDto teamInformationDto) {
+        String userId = teamInformationDto.getUserId();
+        if (userId == null) {
+            userId=BaseController.getUserId();
         }
-        //校验当前用户是否为机构负责人
-        boolean b = this.checkUserId(userId);
-        if (b) {
-            //机构负责人查询机构下的团队
-            SysAgencyLeader sysAgencyLeaders = sysAgencyLeaderMapper.selectOne(new LambdaQueryWrapper<SysAgencyLeader>().eq(SysAgencyLeader::getUserId, userId)
-                    .eq(SysAgencyLeader::getDelFlag, 1));
-            String[] split = sysAgencyLeaders.getSource().split(",");
-            //根据当前机构id查询出下面的团队,条件:机构来源相同,机构等级为null的团队
-            List<SysDept> sysDeptList = sysDeptMapper.selectList(new LambdaQueryWrapper<SysDept>().likeRight(SysDept::getId, sysAgencyLeaders.getDeptId())
-                    .isNull(SysDept::getComlevel).eq(SysDept::getDelFlag, 0).in(SysDept::getManagementSource, split)
-                    .like(StringUtils.isNotEmpty(teamInformationDto.getDeptName()),SysDept::getName,teamInformationDto.getDeptName()));
-            if (sysDeptList.size() > 0) {
-                //总保费
-                BigDecimal bigDecimal = new BigDecimal("0.00");
-                for (SysDept sysDept : sysDeptList) {
-                    TeamInformation teamInformation = new TeamInformation();
-                    teamInformation.setDeptId(sysDept.getId());
-                    teamInformation.setDeptName(sysDept.getName());
-                    List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().likeRight(SysUser::getId, sysDept.getId()).eq(SysUser::getStatus, 1));
-                    teamInformation.setDeptManNum(sysUsers.size());
-                    List<InsOrders> insOrderList;
-                    //筛选订单,选择时间
-                    Date updateTime = sysAgencyLeaders.getUpdateTime();
-                    if (updateTime == null) {
-                        //机构下所有订单
-                        insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
-                                .likeRight(InsOrders::getDeptid, sysDept.getId())
-                                .ge(InsOrders::getCreatetime, sysAgencyLeaders.getCreateTime())
-                                .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()),InsOrders::getCreatetime,teamInformationDto.getBeginTime())
-                                .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()),InsOrders::getCreatetime,teamInformationDto.getEndTime()));
-                        teamInformation.setStartTime(sysAgencyLeaders.getCreateTime());
-
-                    } else {
-                        insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
-                                .likeRight(InsOrders::getDeptid, sysDept.getId())
-                                .ge(InsOrders::getCreatetime, updateTime)
-                                .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()),InsOrders::getCreatetime,teamInformationDto.getBeginTime())
-                                .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()),InsOrders::getCreatetime,teamInformationDto.getEndTime()));
-                        teamInformation.setStartTime(updateTime);
-                    }
+        List<TeamInformation> informationList = new ArrayList<>();
+        //机构负责人查询机构下的团队
+        SysAgencyLeader sysAgencyLeaders = sysAgencyLeaderMapper.selectOne(new LambdaQueryWrapper<SysAgencyLeader>().eq(SysAgencyLeader::getUserId, userId)
+                .eq(SysAgencyLeader::getDelFlag, 1));
+        if (sysAgencyLeaders == null) return null;
+        String[] split = sysAgencyLeaders.getSource().split(",");
 
-                    if (insOrderList.size() > 0) {
-                        for (InsOrders insOrders : insOrderList) {
-                            //查询订单下的所有子订单
-                            List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
-                                    .eq(InsAreaCompany::getOrderstatus, 3));
-                            if (insAreaCompanies.size() > 0) {
-                                for (InsAreaCompany insAreaCompany : insAreaCompanies) {
-                                    //累加每一个子订单的交强险费用+商业险费用+驾意险费用
-                                    bigDecimal = bigDecimal.add(insAreaCompany.getJqpremium()).add(insAreaCompany.getSypremium()).add(insAreaCompany.getJypremium());
+        Page<SysDept> page = new Page<>(teamInformationDto.getPageNum(), teamInformationDto.getPageSize());
 
-                                }
-                            }
-                        }
-                    }
-                    teamInformation.setSumpremium(bigDecimal);
-                    int num = 0;
-                    // 查团队有几人出单 :订单表中userid相等同时在 子订单表中状态为3已承保才为出单
-                    List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
-                    for (String s : userIdList) {
-                        List<InsOrders> collect = insOrderList.stream().filter(InsOrders -> InsOrders.getUserid().equals(s)).collect(Collectors.toList());
-                        if (collect.size() > 0) {
-                            InsOrders insOrders = collect.get(0);
-                            List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
-                                    .eq(InsAreaCompany::getOrderstatus, 3));
-                            if (insAreaCompanies1.size() > 0) {
-                                num++;
-                            }
+        LambdaQueryWrapper<SysDept> wrapper = new LambdaQueryWrapper<>();
+        wrapper.likeRight(SysDept::getId, sysAgencyLeaders.getDeptId())
+                .isNull(SysDept::getComlevel).eq(SysDept::getDelFlag, 0).in(SysDept::getManagementSource, split)
+                .like(StringUtils.isNotEmpty(teamInformationDto.getDeptName()), SysDept::getName, teamInformationDto.getDeptName());
+
+        Page<SysDept> insOrdersPage = sysDeptService.page(page, wrapper);
+        List<SysDept> sysDeptList = insOrdersPage.getRecords();
 
+        if (sysDeptList.size() > 0) {
+            //总保费
+            BigDecimal bigDecimal = new BigDecimal("0.00");
+            for (SysDept sysDept : sysDeptList) {
+                TeamInformation teamInformation = new TeamInformation();
+                teamInformation.setDeptId(sysDept.getId());
+                teamInformation.setDeptName(sysDept.getName());
+                List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>().likeRight(SysUser::getId, sysDept.getId()).eq(SysUser::getStatus, 1));
+                teamInformation.setDeptManNum(sysUsers.size());
+                List<InsOrders> insOrderList;
+                //筛选订单,选择时间
+                Date updateTime = sysAgencyLeaders.getUpdateTime();
+                if (updateTime == null) {
+                    //机构下所有订单
+                    insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
+                            .likeRight(InsOrders::getDeptid, sysDept.getId())
+                            .ge(InsOrders::getCreatetime, sysAgencyLeaders.getCreateTime())
+                            .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()), InsOrders::getCreatetime, teamInformationDto.getBeginTime())
+                            .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()), InsOrders::getCreatetime, teamInformationDto.getEndTime()));
+                    teamInformation.setStartTime(sysAgencyLeaders.getCreateTime());
+
+                } else {
+                    insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
+                            .likeRight(InsOrders::getDeptid, sysDept.getId())
+                            .ge(InsOrders::getCreatetime, updateTime)
+                            .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()), InsOrders::getCreatetime, teamInformationDto.getBeginTime())
+                            .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()), InsOrders::getCreatetime, teamInformationDto.getEndTime()));
+                    teamInformation.setStartTime(updateTime);
+                }
+
+                if (insOrderList.size() > 0) {
+                    for (InsOrders insOrders : insOrderList) {
+                        //查询订单下的所有子订单
+                        List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
+                                .eq(InsAreaCompany::getOrderstatus, 3));
+                        if (insAreaCompanies.size() > 0) {
+                            for (InsAreaCompany insAreaCompany : insAreaCompanies) {
+                                //累加每一个子订单的交强险费用+商业险费用+驾意险费用
+                                bigDecimal = bigDecimal.add(insAreaCompany.getJqpremium()).add(insAreaCompany.getSypremium()).add(insAreaCompany.getJypremium());
+
+                            }
                         }
                     }
-                    teamInformation.setOrderManNum(num);
-                    informationList.add(teamInformation);
-                    Integer type = teamInformationDto.getType();
-                    if (type == 1) {
-                        int size = informationList.size();
-                        if (size == 2) {
-                            return informationList;
+                }
+                teamInformation.setSumpremium(bigDecimal);
+                int num = 0;
+                // 查团队有几人出单 :订单表中userid相等同时在 子订单表中状态为3已承保才为出单
+                List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
+                for (String s : userIdList) {
+                    List<InsOrders> collect = insOrderList.stream().filter(InsOrders -> InsOrders.getUserid().equals(s)).collect(Collectors.toList());
+                    if (collect.size() > 0) {
+                        InsOrders insOrders = collect.get(0);
+                        List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
+                                .eq(InsAreaCompany::getOrderstatus, 3));
+                        if (insAreaCompanies1.size() > 0) {
+                            num++;
                         }
+
                     }
                 }
+                teamInformation.setOrderManNum(num);
+                informationList.add(teamInformation);
 
             }
-            return informationList;
-        }
-
 
-        return informationList;
+        }
+        return new BasePageResult<>(teamInformationDto.getPageNum(), page.getSize(), insOrdersPage.getTotal(), page.getPages(),
+                informationList);
     }
 
-    private List<TeamInformation> extracted(String userId, List<TeamInformation> informationList,TeamInformationDto teamInformationDto) {
-        //查询所有推荐的机构负责人核算总保费
+    @Override
+    public List<SysAgencyLeaderVo> queryAgencyLeader(String userId) {
         List<SysRelationPerson> sysRelationPeople = sysRelationPersonMapper.selectList(new LambdaQueryWrapper<SysRelationPerson>()
                 .eq(SysRelationPerson::getSuggestId, userId).eq(SysRelationPerson::getType, 1));
         if (sysRelationPeople.size() > 0) {
-            //总保费
-            BigDecimal bigDecimal = new BigDecimal("0.00");
             //获取所有推荐的机构负责人id
             List<String> agencyLeaderIds = sysRelationPeople.stream().map(SysRelationPerson::getAgencyLeaderId).collect(Collectors.toList());
-            for (String agencyLeaderId : agencyLeaderIds) {
-                //获取机构负责人信息
-                SysAgencyLeader sysAgencyLeaders = sysAgencyLeaderMapper.selectOne(new LambdaQueryWrapper<SysAgencyLeader>()
-                        .eq(SysAgencyLeader::getUserId, agencyLeaderId)
-                        .eq(SysAgencyLeader::getDelFlag, 1));
-                String[] split = sysAgencyLeaders.getSource().split(",");
-                //根据当前机构id查询出下面的团队,条件:机构来源相同,机构等级为null的团队
-                List<SysDept> sysDeptList = sysDeptMapper.selectList(new LambdaQueryWrapper<SysDept>()
-                                          .likeRight(SysDept::getId, sysAgencyLeaders.getDeptId())
-                                          .isNull(SysDept::getComlevel)
-                                          .eq(SysDept::getDelFlag, 0)
-                                          .in(SysDept::getManagementSource, split)
-                                          .like(StringUtils.isNotEmpty(teamInformationDto.getDeptName()),SysDept::getName,teamInformationDto.getDeptName()));
-                if (sysDeptList.size() > 0) {
-                    for (SysDept sysDept : sysDeptList) {
-                        TeamInformation teamInformation = new TeamInformation();
-                        teamInformation.setDeptId(sysDept.getId());
-                        teamInformation.setDeptName(sysDept.getName());
-                        List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>()
-                                .likeRight(SysUser::getId, sysDept.getId())
-                                .eq(SysUser::getStatus, 1));
-                        teamInformation.setDeptManNum(sysUsers.size());
-                        List<InsOrders> insOrderList;
-                        //筛选订单,选择时间
-                        Date updateTime = sysAgencyLeaders.getUpdateTime();
-                        if (updateTime == null) {
-                            //机构下所有订单
-                            insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
-                                    .likeRight(InsOrders::getDeptid, sysDept.getId())
-                                    .ge(InsOrders::getCreatetime, sysAgencyLeaders.getCreateTime())
-                                    .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()),InsOrders::getCreatetime,teamInformationDto.getBeginTime())
-                                    .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()),InsOrders::getCreatetime,teamInformationDto.getEndTime()));
-                            teamInformation.setStartTime(sysAgencyLeaders.getCreateTime());
-                        } else {
-                            insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
-                                    .likeRight(InsOrders::getDeptid, sysDept.getId())
-                                    .ge(InsOrders::getCreatetime, updateTime)
-                                    .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()),InsOrders::getCreatetime,teamInformationDto.getBeginTime())
-                                    .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()),InsOrders::getCreatetime,teamInformationDto.getEndTime()));
-                            teamInformation.setStartTime(updateTime);
-                        }
 
-                        if (insOrderList.size() > 0) {
-                            for (InsOrders insOrders : insOrderList) {
-                                //查询订单下的所有子订单
-                                List<InsAreaCompany> insAreaCompanies = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
-                                        .eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
-                                        .eq(InsAreaCompany::getOrderstatus, 3));
-                                if (insAreaCompanies.size() > 0) {
-                                    for (InsAreaCompany insAreaCompany : insAreaCompanies) {
-                                        //累加每一个子订单的交强险费用+商业险费用+驾意险费用
-                                        bigDecimal = bigDecimal.add(insAreaCompany.getJqpremium()).add(insAreaCompany.getSypremium()).add(insAreaCompany.getJypremium());
-
-                                    }
-                                }
-                            }
-                        }
-                        teamInformation.setSumpremium(bigDecimal);
-                        int num = 0;
-                        // 查团队有几人出单 :子订单中userid相等同时在 子订单表中状态为3已承保才为出单
-                        List<String> userIdList = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
-                        for (String s : userIdList) {
-                            List<InsOrders> collect = insOrderList.stream().filter(InsOrders -> InsOrders.getUserid().equals(s)).collect(Collectors.toList());
-                            if (collect.size() > 0) {
-                                InsOrders insOrders = collect.get(0);
-                                List<InsAreaCompany> insAreaCompanies1 = insAreaCompanyMapper.selectList(new LambdaQueryWrapper<InsAreaCompany>()
-                                        .eq(InsAreaCompany::getOrderno, insOrders.getOrderno())
-                                        .eq(InsAreaCompany::getOrderstatus, 3));
-                                if (insAreaCompanies1.size() > 0) {
-                                    num++;
-                                }
+            //获取机构负责人信息
+            List<SysAgencyLeader> sysAgencyLeaders = sysAgencyLeaderMapper.selectList(new LambdaQueryWrapper<SysAgencyLeader>()
+                    .in(SysAgencyLeader::getUserId, agencyLeaderIds)
+                    .eq(SysAgencyLeader::getDelFlag, 1));
 
-                            }
-                        }
-                        teamInformation.setOrderManNum(num);
-                        informationList.add(teamInformation);
-                        Integer type = teamInformationDto.getType();
-                        if (type == 1) {
-                            int size = informationList.size();
-                            if (size == 2) {
-                                return informationList;
-                            }
-                        }
-                    }
-                }
-            }
+            return BeanUtil.copyToList(sysAgencyLeaders, SysAgencyLeaderVo.class);
         }
-        return informationList;
+
+        return null;
     }
 
 
     @Override
-    public List<TeamUserInfoVo> queryTeamUser(TeamUserInfoDto teamUserInfoDto) {
+    public BasePageResult<TeamUserInfoVo> queryTeamUser(TeamUserInfoDto teamUserInfoDto) {
         List<TeamUserInfoVo> teamUserInfoVoList = new ArrayList<>();
-        //团队下的人员 报价笔数 核保笔数 出单笔数 签单保费
-        List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>()
-                .likeRight(SysUser::getId, teamUserInfoDto.getDeptId())
-                .eq(SysUser::getStatus, 1));
+        Page<SysUser> page = new Page<>(teamUserInfoDto.getPageNum(), teamUserInfoDto.getPageSize());
+        LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
+        wrapper.likeRight(SysUser::getId, teamUserInfoDto.getDeptId()).eq(SysUser::getStatus, 1);
+
+        Page<SysUser> insOrdersPage = sysUserService.page(page, wrapper);
+        List<SysUser> sysUsers = insOrdersPage.getRecords();
+
+
+//        //团队下的人员 报价笔数 核保笔数 出单笔数 签单保费
+//        List<SysUser> sysUsers = sysUserMapper.selectList(new LambdaQueryWrapper<SysUser>()
+//                .likeRight(SysUser::getId, teamUserInfoDto.getDeptId())
+//                .eq(SysUser::getStatus, 1));
         //总保费
         for (SysUser sysUser : sysUsers) {
             List<InsOrders> insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
                     .ge(InsOrders::getCreatetime, teamUserInfoDto.getStartTime())
-                    .ge(StringUtils.isNotEmpty(teamUserInfoDto.getBeginTime()),InsOrders::getCreatetime,teamUserInfoDto.getBeginTime())
-                    .le(StringUtils.isNotEmpty(teamUserInfoDto.getEndTime()),InsOrders::getCreatetime,teamUserInfoDto.getEndTime())
+                    .ge(StringUtils.isNotEmpty(teamUserInfoDto.getBeginTime()), InsOrders::getCreatetime, teamUserInfoDto.getBeginTime())
+                    .le(StringUtils.isNotEmpty(teamUserInfoDto.getEndTime()), InsOrders::getCreatetime, teamUserInfoDto.getEndTime())
                     .eq(InsOrders::getUserid, sysUser.getId()));
             //总保费
             BigDecimal bigDecimal = new BigDecimal("0.00");
@@ -807,7 +934,8 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
             }
         }
 
-        return teamUserInfoVoList;
+        return new BasePageResult<>(teamUserInfoDto.getPageNum(), page.getSize(), insOrdersPage.getTotal(), page.getPages(),
+                teamUserInfoVoList);
     }
 
 

+ 2 - 0
src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java

@@ -56,6 +56,8 @@ public class RuleAttrMappingVo {
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("NatureOfUse", TypeVehicleMapping.getByCode(carInfo.getVehicleUse())));
         //车辆种类
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarType", VehicleType.getByCode(carInfo.getCimodelclass())));
+        //车辆类型
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("CarClass", carInfo.getCartype()));
         //核定载质量
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("AuthorizedLoadWeight", carInfo.getLimitLoad()));
         //整备质量

+ 25 - 0
src/main/java/com/ydtech/modules/fnc/dao/InsuranceHandlingSettlementMonthMapper.java

@@ -0,0 +1,25 @@
+package com.ydtech.modules.fnc.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
+import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
+import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * <p>
+ *    保险手续费结算关联表
+ * </p>
+ *
+ * @author whp
+ * @since 2024-08-16
+ */
+@Mapper
+public interface InsuranceHandlingSettlementMonthMapper extends BaseMapper<InsuranceHandlingSettlementMonthEntity> {
+    List<InsuranceHandlingSettlementMonthDto> queryList( @Param("vo") InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
+
+
+}

+ 46 - 0
src/main/java/com/ydtech/modules/fnc/dto/InsuranceHandlingSettlementMonthDto.java

@@ -0,0 +1,46 @@
+package com.ydtech.modules.fnc.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Data
+@ApiModel("保险手续费结算关联表返回dto")
+public class InsuranceHandlingSettlementMonthDto implements Serializable {
+    @ApiModelProperty("id")
+    private String id;
+
+    @ApiModelProperty("任务id")
+    private String taskId;
+
+    @ApiModelProperty("结算id")
+    private String settlementDocumentaryFeesId;
+
+    @ApiModelProperty("结算金额")
+    private BigDecimal settlementAmount;
+
+    @ApiModelProperty("开票金额")
+    private BigDecimal totalAmount;
+
+    @ApiModelProperty("剩余结算金额")
+    private BigDecimal remainingAmount;
+
+    @ApiModelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("签单时间")
+    private LocalDateTime signingTime;
+
+    @ApiModelProperty("创建人")
+    private String createrId;
+
+    @ApiModelProperty("合作公司id")
+    private String partnerCompaniesId;
+
+    @ApiModelProperty("开票手续费")
+    private String invoiccommissionFeevalue;
+}

+ 65 - 0
src/main/java/com/ydtech/modules/fnc/entity/InsuranceHandlingSettlementMonthEntity.java

@@ -0,0 +1,65 @@
+package com.ydtech.modules.fnc.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ *
+ */
+@Getter
+@Setter
+@TableName("sys_insurance_handling_settlement_month")
+@ApiModel(value = "InsuranceHandlingSettlementMonthEntity对象", description = "保险手续费结算关联表")
+@NoArgsConstructor
+public class InsuranceHandlingSettlementMonthEntity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("id")
+    @TableField("id")
+    private String id;
+
+    @ApiModelProperty("任务id")
+    @TableField("task_id")
+    private String taskId;
+
+    @ApiModelProperty("结算id")
+    @TableField("settlement_documentary_fees_id")
+    private String settlementDocumentaryFeesId;
+
+    @ApiModelProperty("结算金额")
+    @TableField("settlement_amount")
+    private BigDecimal settlementAmount;
+
+    @ApiModelProperty("开票金额")
+    @TableField("total_amount")
+    private BigDecimal totalAmount;
+
+    @ApiModelProperty("剩余结算金额")
+    @TableField("remaining_amount")
+    private BigDecimal remainingAmount;
+
+    @ApiModelProperty("创建时间")
+    @TableField("create_time")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("创建时间")
+    @TableField("signing_time")
+    private LocalDateTime signingTime;
+
+    @ApiModelProperty("创建人")
+    @TableField("creater_id")
+    private String createrId;
+
+    @ApiModelProperty("合作公司id")
+    @TableField("partner_companies_id")
+    private String partnerCompaniesId;
+}

+ 31 - 0
src/main/java/com/ydtech/modules/fnc/service/InsuranceHandlingSettlementMonthService.java

@@ -0,0 +1,31 @@
+package com.ydtech.modules.fnc.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
+import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
+import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
+
+import java.util.List;
+
+/**
+ * <p>
+ *    保险手续费结算关联表
+ * </p>
+ *
+ * @author whp
+ * @since 2024-08-16
+ */
+public interface InsuranceHandlingSettlementMonthService  extends IService<InsuranceHandlingSettlementMonthEntity> {
+
+    List<InsuranceHandlingSettlementMonthDto> queryList(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
+
+    /**
+     * 结算新增
+     * @param insuranceHandlingSettlementMonthVo
+     * @return
+     */
+    HttpResult<InsuranceHandlingSettlementMonthDto> insertByEntity(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
+
+}

+ 66 - 0
src/main/java/com/ydtech/modules/fnc/service/impl/InsuranceHandlingSettlementMonthServiceImpl.java

@@ -0,0 +1,66 @@
+package com.ydtech.modules.fnc.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.fnc.dao.InsuranceHandlingSettlementMonthMapper;
+import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
+import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
+import com.ydtech.modules.fnc.service.InsuranceHandlingSettlementMonthService;
+import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ * 保险手续费结算关联表
+ * </p>
+ *
+ * @author whp
+ * @since 2024-08-16
+ */
+@Slf4j
+@Service
+public class InsuranceHandlingSettlementMonthServiceImpl extends ServiceImpl<InsuranceHandlingSettlementMonthMapper, InsuranceHandlingSettlementMonthEntity> implements InsuranceHandlingSettlementMonthService {
+
+    @Override
+    public List<InsuranceHandlingSettlementMonthDto> queryList(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
+        List<InsuranceHandlingSettlementMonthDto> resultList = baseMapper.queryList(insuranceHandlingSettlementMonthVo);
+
+        List<InsuranceHandlingSettlementMonthDto> latestRecords = resultList.stream()
+                // 根据taskId分组,并收集每个taskId对应的所有记录
+                .collect(Collectors.groupingBy(
+                        InsuranceHandlingSettlementMonthDto::getTaskId,
+                        Collectors.toList()
+                ))
+                // 遍历每个分组,找出每组中createTime最新的记录
+                .entrySet().stream()
+                .map(entry -> entry.getValue().stream()
+                        .max(Comparator.comparing(InsuranceHandlingSettlementMonthDto::getCreateTime))
+                        .orElse(null) // 如果没有记录,则返回null(这里根据需求决定是否处理null)
+                )
+                // 收集结果到新的List中
+                .collect(Collectors.toList());
+
+        return resultList;
+    }
+
+    /**
+     * 结算新增
+     *
+     * @param insuranceHandlingSettlementMonthVo
+     * @return
+     */
+    @Override
+    public HttpResult<InsuranceHandlingSettlementMonthDto> insertByEntity(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo) {
+        InsuranceHandlingSettlementMonthEntity insuranceHandlingSettlementMonthEntity = new InsuranceHandlingSettlementMonthEntity();
+        BeanUtils.copyProperties(insuranceHandlingSettlementMonthVo, insuranceHandlingSettlementMonthEntity);
+        baseMapper.insert(insuranceHandlingSettlementMonthEntity);
+        return HttpResult.ok("结算成功");
+    }
+}

+ 47 - 0
src/main/java/com/ydtech/modules/fnc/vo/InsuranceHandlingSettlementMonthVo.java

@@ -0,0 +1,47 @@
+package com.ydtech.modules.fnc.vo;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Data
+@ApiModel("保险手续费结算关联表查询Vo")
+public class InsuranceHandlingSettlementMonthVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("id")
+    private String id;
+
+    @ApiModelProperty("任务id")
+    private String taskId;
+
+    @ApiModelProperty("结算id")
+    private String settlementDocumentaryFeesId;
+
+    @ApiModelProperty("结算金额")
+    private BigDecimal settlementAmount;
+
+    @ApiModelProperty("开票金额")
+    private BigDecimal totalAmount;
+
+    @ApiModelProperty("剩余结算金额")
+    private BigDecimal remainingAmount;
+
+    @ApiModelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("签单时间")
+    private LocalDateTime signingTime;
+
+    @ApiModelProperty("创建人")
+    private String createrId;
+
+    @ApiModelProperty("合作公司id")
+    private String partnerCompaniesId;
+}

+ 60 - 0
src/main/resources/mapper/modules/insuranceHandlingSettlementMonth/InsuranceHandlingSettlementMonthMapper.xml

@@ -0,0 +1,60 @@
+<?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.ydtech.modules.fnc.dao.InsuranceHandlingSettlementMonthMapper">
+
+    <sql id="insuranceHandling_com">
+                a.id  as  "id",
+                a.task_id  as  "taskId",
+                a.settlement_documentary_fees_id  as  "settlementDocumentaryFeesId",
+                a.partner_companies_id  as  "partnerCompaniesId",
+                a.settlement_amount  as  "settlementAmount",
+                a.total_amount  as  "totalAmount",
+                a.remaining_amount  as  "remainingAmount",
+                a.create_time  as  "createTime",
+                a.signing_time  as  "signingTime",
+                a.creater_id  as  "createrId"
+    </sql>
+
+    <select id="queryList" resultType="com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto">
+        select ipi.task_id as "taskId" ,
+        sum(IFNULL(ipi.commission_feevalue),0) as"invoiccommissionFeevalue"
+        from
+        ins_ply_income ipi
+        left join ptl_agreement pa on pa.id=ipi.agreement_id
+        left join (
+        select
+        <include refid="insuranceHandling_com"/>
+        from
+        sys_insurance_handling_settlement_month a
+        <where>
+            1=1
+            <if test="vo.partnerCompaniesId  !=null  and  vo.partnerCompaniesId!=''">
+                AND  a.partner_companies_id=#{vo.partnerCompaniesId}
+            </if>
+            <if test="vo.taskId  !=null  and  vo.taskId!=''">
+                AND  a.task_id=#{vo.taskId}
+            </if>
+        </where>
+        )  b on b. taskId =ipi.task_id
+        <where>
+            pa.agreement_type ='2'
+            AND ipi.task_id is  not  null
+            <if test="vo.isNotCar  !=null and vo.isNotCar !=''">
+                AND ipi.is_not_car =#{vo.isNotCar}
+            </if>
+            <if test="vo.isnotDocumentary !=null and vo.isnotDocumentary !=''">
+                AND ipi.is_not_documentary =#{vo.isnotDocumentary}
+            </if>
+            <if test="vo.taskId  !=null  and  vo.taskId!=''">
+                AND  a.task_id=#{vo.taskId}
+            </if>
+        </where>
+        group by ipi.task_id
+
+
+    </select>
+
+
+
+
+</mapper>