Procházet zdrojové kódy

提现记录、app登录

helixiao před 2 roky
rodič
revize
3a27e33d0d

+ 2 - 0
sql/Online.sql

@@ -42,6 +42,7 @@ CREATE TABLE `sys_agency_fee_approval` (
                                            `user_name` varchar(50) DEFAULT NULL COMMENT '员工姓名',
                                            `dept_id` varchar(30) DEFAULT NULL COMMENT '机构id',
                                            `dept_name` varchar(50) DEFAULT NULL COMMENT '机构名称',
+                                           `number` varchar(255) DEFAULT NULL COMMENT '提现编号',
                                            `sumpremium` decimal(10,2) DEFAULT NULL COMMENT '总保费',
                                            `proportional` varchar(10) DEFAULT NULL COMMENT '抽成比例(总保费抽成)',
                                            `extract_fee` decimal(10,2) DEFAULT NULL COMMENT '总保费抽成费用',
@@ -66,6 +67,7 @@ CREATE TABLE `sys_agency_fee_approval_record` (
                                                   `user_name` varchar(50) DEFAULT NULL COMMENT '员工姓名',
                                                   `dept_id` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '机构id',
                                                   `dept_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '机构名称',
+                                                  `number` varchar(255) DEFAULT NULL COMMENT '提现编号',
                                                   `sumpremium` decimal(10,2) DEFAULT NULL COMMENT '总保费',
                                                   `proportional` varchar(10) DEFAULT NULL COMMENT '抽成比例(总保费抽成)',
                                                   `extract_fee` decimal(10,2) DEFAULT NULL COMMENT '总保费抽成费用',

+ 1 - 0
src/main/java/com/ydtech/components/TokenInterceptor.java

@@ -27,6 +27,7 @@ public class TokenInterceptor {
 
         notMatchList.add("/captchaById"); // 验证码通过ID
         notMatchList.add("/login2");//登录2  配合验证码ID的校验
+        notMatchList.add("/aapLogin");//合伙人和机构负责人登录APP接口
 
         notMatchList.add("/sendMsg");
         notMatchList.add("/loginByPhone");

+ 7 - 0
src/main/java/com/ydtech/modules/admin/controller/SysAgencyFeeApprovalController.java

@@ -4,6 +4,7 @@ package com.ydtech.modules.admin.controller;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.SysAgencyFeeApproval;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalAddDto;
+import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalDto;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalEditDto;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalPageDto;
 import com.ydtech.modules.admin.service.SysAgencyFeeApprovalService;
@@ -14,6 +15,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.util.List;
 
 /**
  * 机构保费抽成审批表(SysAgencyFeeApproval)表控制层
@@ -109,6 +111,11 @@ public class SysAgencyFeeApprovalController extends BaseController {
         return HttpResult.ok(this.sysAgencyFeeApprovalService.confirmAccounts(sysAgencyFeeApprovalEditDto));
     }
 
+    @ApiOperation(value = "当前用户的提现记录")
+    @PostMapping("/queryOperateInfo")
+    public HttpResult<List<SysAgencyFeeApproval>> queryOperateInfo(@RequestBody SysAgencyFeeApprovalDto sysAgencyFeeApprovalDto) {
+        return HttpResult.ok(this.sysAgencyFeeApprovalService.queryOperateInfo(sysAgencyFeeApprovalDto));
+    }
 
 
 }

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

@@ -3,9 +3,9 @@ package com.ydtech.modules.admin.controller;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.dto.SysAgencyLeaderDto;
 import com.ydtech.modules.admin.model.dto.SysAgencyLeaderPageDto;
+import com.ydtech.modules.admin.model.dto.TeamInformationDto;
 import com.ydtech.modules.admin.model.dto.TeamUserInfoDto;
-import com.ydtech.modules.admin.model.vo.AgencyExtractFeeVo;
-import com.ydtech.modules.admin.model.vo.SysAgencyLeaderVo;
+import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.admin.service.SysAgencyLeaderService;
@@ -128,7 +128,7 @@ public class SysAgencyLeaderController extends BaseController {
      */
     @GetMapping("/checkUserId")
     @ApiOperation(value = "登录用户校验是否是机构负责人")
-    public HttpResult checkUserId() {
+    public HttpResult<Boolean> checkUserId() {
 
         return HttpResult.ok(this.sysAgencyLeaderService.checkUserId(getUserId()));
     }
@@ -138,7 +138,7 @@ public class SysAgencyLeaderController extends BaseController {
      */
     @GetMapping("/queryExtractFee")
     @ApiOperation(value = "查询机构负责人和合伙人的抽成费用")
-    public HttpResult queryExtractFee() {
+    public HttpResult<AgencyExtractFee> queryExtractFee() {
 
 
         return HttpResult.ok(this.sysAgencyLeaderService.queryExtractFee(getUserId()));
@@ -163,11 +163,11 @@ public class SysAgencyLeaderController extends BaseController {
     /**
      * 查询机构下所有团队的信息
      */
-    @GetMapping("/queryTeamInfo")
+    @PostMapping("/queryTeamInfo")
     @ApiOperation(value = "查询机构下所有团队的信息")
-    public HttpResult queryTeamInfo(){
+    public HttpResult<List<TeamInformation>> queryTeamInfo(@RequestBody TeamInformationDto teamInformationDto){
 
-        return HttpResult.ok("success", this.sysAgencyLeaderService.queryTeamInfo(getUserId()));
+        return HttpResult.ok("success", this.sysAgencyLeaderService.queryTeamInfo(teamInformationDto));
     }
 
     /**
@@ -176,7 +176,7 @@ public class SysAgencyLeaderController extends BaseController {
 
     @PostMapping("/queryTeamUser")
     @ApiOperation(value = "根据团队id查询团队下人员信息")
-    public HttpResult queryTeamUser(@RequestBody TeamUserInfoDto teamUserInfoDto) {
+    public HttpResult<List<TeamUserInfoVo>> queryTeamUser(@RequestBody TeamUserInfoDto teamUserInfoDto) {
 
         return HttpResult.ok("success", this.sysAgencyLeaderService.queryTeamUser(teamUserInfoDto));
     }

+ 82 - 4
src/main/java/com/ydtech/modules/admin/controller/SysLoginController.java

@@ -20,10 +20,7 @@ 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.service.SysPasswordService;
-import com.ydtech.modules.admin.service.SysUserLinkSysService;
-import com.ydtech.modules.admin.service.SysUserRoleService;
-import com.ydtech.modules.admin.service.SysUserService;
+import com.ydtech.modules.admin.service.*;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.security.utils.PasswordUtils;
 import com.ydtech.utils.IPUtil;
@@ -82,6 +79,11 @@ public class SysLoginController {
     private final SysPasswordService sysPasswordService;
 
     private final SysUserLinkSysService  sysUserLinkSysService;
+
+    private final SysPartnerService sysPartnerService;
+
+    private final SysAgencyLeaderService sysAgencyLeaderService;
+
     @GetMapping("captcha.jpg")
     @ApiOperation(value = "获取验证码", produces = "application/octet-stream")
     public void captcha(HttpServletResponse response, HttpServletRequest request) throws IOException {
@@ -245,6 +247,81 @@ public class SysLoginController {
 
     }
 
+    /**
+     * 合伙人 和机构负责人登录APP接口
+     */
+    @PostMapping(value = "/aapLogin")
+    @ApiOperation(value = "合伙人和机构负责人登录APP接口")
+    public HttpResult aapLogin(@RequestBody LoginBean loginBean, HttpServletRequest request) {
+        String username = loginBean.getAccount();
+        String password = loginBean.getPassword();
+        String captcha = loginBean.getCaptcha();
+
+        // 用户信息
+        SysUser user = sysUserService.getById(username);
+        //校验登录用户是否为合伙人或者是机构负责人
+        boolean a = sysPartnerService.checkPartner(user.getId());
+        boolean b = sysAgencyLeaderService.checkUserId(user.getId());
+        if (!a ) {
+            if (!b) {
+                throw  new SystemException("该用户无权限登录AAP,只能合伙人或者机构负责人才能登录!");
+            }
+        }
+
+
+        String captchaId = loginBean.getCaptchaId();
+        if (StringUtils.isEmpty(captchaId)) return HttpResult.error("验证码不正确");
+
+        // 从redis中获取
+        String kaptcha = redisTemplate.opsForValue().get(captchaId);
+        log.info("登录校验验证码,redis取出的信息为:" + captchaId + ":" + kaptcha);
+        log.info("页面验证码:" + captcha + "===" + "redis验证码:" + kaptcha);
+        if (!captcha.equals(kaptcha)) {
+            return HttpResult.error("验证码不正确");
+        }
+
+        /**
+         *  多个系统登录  添加默认参数解决手机端登陆问题
+         * */
+        if (StringUtils.isBlank(loginBean.getSysId())) {
+            loginBean.setSysId("1");
+        }
+        if (!SysConstants.ADMIN.equalsIgnoreCase(username) && !"1".equals(loginBean.getSysId())) {
+            LambdaQueryWrapper<SysUserLinkSys> sysLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            sysLambdaQueryWrapper.eq(SysUserLinkSys::getUserId, user.getId());
+            sysLambdaQueryWrapper.eq(SysUserLinkSys::getSysId, loginBean.getSysId());
+            List<SysUserLinkSys> list = sysUserLinkSysService.list(sysLambdaQueryWrapper);
+            if (list == null || list.size() == 0) {
+                throw new SystemException("该用户未授权");
+            }
+        }
+
+        //验证用户
+        SysUser.verifyUser(user);
+        SysPassword sysPassword = sysPasswordService.getOne(new LambdaQueryWrapper<SysPassword>().eq(SysPassword::getCode, SysPasswordEnum.GENERAL.getCode()));
+        // 万能密码设置
+        if (!"admin".equals(username) && PasswordUtils.matches(sysPassword.getSalt(), password,
+                sysPassword.getPassword())) {
+            log.info("万能密码登录系统");
+        } else {
+            if (!PasswordUtils.matches(user.getSalt(), password, user.getPassword())) {
+                return HttpResult.error("密码不正确");
+            }
+        }
+        //查询用户角色
+        SysRole sysRole = sysUserRoleService.gainRoleByUserId(user.getId());
+        //设置用户角色
+        user.setRoleId(sysRole.getId().toString());
+        user.setRoleName(sysRole.getName());
+        // 获取这个人的token
+        String token = StpUtil.createLoginSession(user.getId());
+        StpUtil.getSessionByLoginId(user.getId()).set(SaSession.USER, user);
+
+        return HttpResult.ok("登录成功", token);
+
+    }
+
+
     /**
      * 手机验证码登录
      *
@@ -252,6 +329,7 @@ public class SysLoginController {
      * @return token
      */
     @PostMapping("/loginByPhone")
+    @ApiOperation(value = "手机验证码登录")
     public HttpResult<String> loginByPhone(@RequestBody PhoneLoginVo phoneLoginVo) {
         // 用户信息
         String phone = phoneLoginVo.getPhone();

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

@@ -51,6 +51,9 @@ public class SysAgencyFeeApproval implements Serializable {
      */
     @ApiModelProperty(value = "机构name")
     private String deptName;
+
+    @ApiModelProperty(value = "提现编号")
+    private String number;
     /**
      * 总保费
      */

+ 17 - 0
src/main/java/com/ydtech/modules/admin/model/dto/SysAgencyFeeApprovalDto.java

@@ -0,0 +1,17 @@
+package com.ydtech.modules.admin.model.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+@Data
+@ApiModel(value = "提现记录")
+public class SysAgencyFeeApprovalDto {
+    @ApiModelProperty(value = "开始时间")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private String beginTime;
+    @ApiModelProperty(value = "结束时间")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private String endTime;
+}

+ 10 - 6
src/main/java/com/ydtech/modules/admin/model/dto/TeamInformationDto.java

@@ -3,15 +3,19 @@ package com.ydtech.modules.admin.model.dto;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 @Data
-@ApiModel(value = "查询机构负责人的抽成费用")
+@ApiModel(value = "查询机构下团队信息")
 public class TeamInformationDto {
+
     @ApiModelProperty(value = "用户id")
-    private String userId;
+    private String deptName;
 
-    @ApiModelProperty(value = "页数")
-    private int pageNum;
-    @ApiModelProperty(value = "每页条数")
-    private int pageSize;
+    @ApiModelProperty(value = "开始时间")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private String beginTime;
+    @ApiModelProperty(value = "结束时间")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private String endTime;
 }

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

@@ -17,4 +17,13 @@ public class TeamUserInfoDto {
     @ApiModelProperty(value = "保费提层计算开始时间")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     private String startTime;
+
+    @ApiModelProperty(value = "开始时间")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private String beginTime;
+    @ApiModelProperty(value = "结束时间")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private String endTime;
+
+
 }

+ 3 - 0
src/main/java/com/ydtech/modules/admin/service/SysAgencyFeeApprovalService.java

@@ -6,6 +6,7 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.SysAgencyFeeApproval;
 import com.ydtech.modules.admin.model.SysAgencyFeeApprovalRecord;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalAddDto;
+import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalDto;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalEditDto;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalPageDto;
 import com.ydtech.modules.order.entity.BasePageResult;
@@ -30,4 +31,6 @@ public interface SysAgencyFeeApprovalService extends IService<SysAgencyFeeApprov
     List<SysAgencyFeeApprovalRecord> queryOperate(Integer id);
 
     boolean confirmAccounts(SysAgencyFeeApprovalEditDto sysAgencyFeeApprovalEditDto);
+
+    List<SysAgencyFeeApproval> queryOperateInfo(SysAgencyFeeApprovalDto sysAgencyFeeApprovalDto);
 }

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

@@ -6,6 +6,7 @@ import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.dto.SysAgencyLeaderDto;
 import com.ydtech.modules.admin.model.dto.SysAgencyLeaderPageDto;
+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.order.entity.BasePageResult;
@@ -50,7 +51,7 @@ public interface SysAgencyLeaderService extends IService<SysAgencyLeader> {
 
     BasePageResult<AgencyExtractFeeVo> queryExtractFeeAll(SysAgencyLeaderPageDto sysAgencyLeaderPageDto);
 
-    List<TeamInformation> queryTeamInfo(String userId);
+    List<TeamInformation> queryTeamInfo(TeamInformationDto teamInformationDto);
 
     List<TeamUserInfoVo> queryTeamUser(TeamUserInfoDto teamUserInfoDto);
 }

+ 17 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyFeeApprovalServiceImpl.java

@@ -12,12 +12,15 @@ import com.ydtech.modules.admin.dao.SysAgencyFeeApprovalRecordMapper;
 import com.ydtech.modules.admin.model.SysAgencyFeeApproval;
 import com.ydtech.modules.admin.model.SysAgencyFeeApprovalRecord;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalAddDto;
+import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalDto;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalEditDto;
 import com.ydtech.modules.admin.model.dto.SysAgencyFeeApprovalPageDto;
 import com.ydtech.modules.admin.service.SysAgencyFeeApprovalService;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.order.entity.BasePageResult;
+import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.utils.StringUtils;
+import com.ydtech.utils.idgen.IdGenerate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -47,6 +50,7 @@ public class SysAgencyFeeApprovalServiceImpl extends ServiceImpl<SysAgencyFeeApp
     public HttpResult insert(SysAgencyFeeApprovalAddDto sysAgencyFeeApprovalAddDto) {
         SysAgencyFeeApproval sysAgencyFeeApproval = BeanUtil.copyProperties(sysAgencyFeeApprovalAddDto, SysAgencyFeeApproval.class);
         sysAgencyFeeApproval.setCreateTime(new Date());
+        sysAgencyFeeApproval.setNumber(IdGenerate.nextId());
         sysAgencyFeeApproval.setCreateBy(BaseController.getUser().getName());
         //提交审核信息
         save(sysAgencyFeeApproval);
@@ -128,5 +132,18 @@ public class SysAgencyFeeApprovalServiceImpl extends ServiceImpl<SysAgencyFeeApp
         return sysAgencyFeeApprovalRecordMapper.insert(sysAgencyFeeApprovalRecord)>0;
     }
 
+    @Override
+    public List<SysAgencyFeeApproval> queryOperateInfo(SysAgencyFeeApprovalDto sysAgencyFeeApprovalDto) {
+
+        List<SysAgencyFeeApproval> feeApprovalList = sysAgencyFeeApprovalMapper.selectList(new LambdaQueryWrapper<SysAgencyFeeApproval>()
+                .eq(SysAgencyFeeApproval::getUserId, BaseController.getUserId()).eq(SysAgencyFeeApproval::getStatus, 1)
+                .ge(StringUtils.isNotEmpty(sysAgencyFeeApprovalDto.getBeginTime()), SysAgencyFeeApproval::getAuditTime,sysAgencyFeeApprovalDto.getBeginTime())
+                .le(StringUtils.isNotEmpty(sysAgencyFeeApprovalDto.getEndTime()),SysAgencyFeeApproval::getAuditTime,sysAgencyFeeApprovalDto.getEndTime()));
+
+        return feeApprovalList;
+    }
+
+
+
 
 }

+ 23 - 9
src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyLeaderServiceImpl.java

@@ -11,6 +11,7 @@ import com.ydtech.modules.admin.dao.*;
 import com.ydtech.modules.admin.model.*;
 import com.ydtech.modules.admin.model.dto.SysAgencyLeaderDto;
 import com.ydtech.modules.admin.model.dto.SysAgencyLeaderPageDto;
+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;
@@ -549,12 +550,13 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
     }
 
     @Override
-    public List<TeamInformation> queryTeamInfo(String userId) {
+    public List<TeamInformation> queryTeamInfo(TeamInformationDto teamInformationDto) {
+        String userId = BaseController.getUser().getId();
         List<TeamInformation> informationList = new ArrayList<>();
         //合伙人
         boolean c = sysPartnerService.checkPartner(userId);
         if (c) {
-            extracted(userId, informationList);
+            extracted(userId, informationList,teamInformationDto);
             return informationList;
         }
         //校验当前用户是否为机构负责人
@@ -566,7 +568,8 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
             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));
+                    .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");
@@ -583,13 +586,17 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                         //机构下所有订单
                         insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
                                 .likeRight(InsOrders::getDeptid, sysDept.getId())
-                                .ge(InsOrders::getCreatetime, sysAgencyLeaders.getCreateTime()));
+                                .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(InsOrders::getCreatetime, updateTime)
+                                .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()),InsOrders::getCreatetime,teamInformationDto.getBeginTime())
+                                .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()),InsOrders::getCreatetime,teamInformationDto.getEndTime()));
                         teamInformation.setStartTime(updateTime);
                     }
 
@@ -635,7 +642,7 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
         return informationList;
     }
 
-    private void extracted(String userId, List<TeamInformation> informationList) {
+    private void extracted(String userId, List<TeamInformation> informationList,TeamInformationDto teamInformationDto) {
         //查询所有推荐的机构负责人核算总保费
         List<SysRelationPerson> sysRelationPeople = sysRelationPersonMapper.selectList(new LambdaQueryWrapper<SysRelationPerson>()
                 .eq(SysRelationPerson::getSuggestId, userId).eq(SysRelationPerson::getType, 1));
@@ -655,7 +662,8 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                                           .likeRight(SysDept::getId, sysAgencyLeaders.getDeptId())
                                           .isNull(SysDept::getComlevel)
                                           .eq(SysDept::getDelFlag, 0)
-                                          .in(SysDept::getManagementSource, split));
+                                          .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();
@@ -672,12 +680,16 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
                             //机构下所有订单
                             insOrderList = insOrdersMapper.selectList(new LambdaQueryWrapper<InsOrders>()
                                     .likeRight(InsOrders::getDeptid, sysDept.getId())
-                                    .ge(InsOrders::getCreatetime, sysAgencyLeaders.getCreateTime()));
+                                    .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(InsOrders::getCreatetime, updateTime)
+                                    .ge(StringUtils.isNotEmpty(teamInformationDto.getBeginTime()),InsOrders::getCreatetime,teamInformationDto.getBeginTime())
+                                    .le(StringUtils.isNotEmpty(teamInformationDto.getEndTime()),InsOrders::getCreatetime,teamInformationDto.getEndTime()));
                             teamInformation.setStartTime(updateTime);
                         }
 
@@ -733,6 +745,8 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
         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())
                     .eq(InsOrders::getUserid, sysUser.getId()));
             //总保费
             BigDecimal bigDecimal = new BigDecimal("0.00");