Переглянути джерело

Merge branch 'test' into 2.0

785834757 1 рік тому
батько
коміт
dca814153c
86 змінених файлів з 2139 додано та 244 видалено
  1. 15 2
      src/main/java/com/ydtech/modules/admin/controller/AgreeReportConroller.java
  2. 25 2
      src/main/java/com/ydtech/modules/admin/controller/CompanyDataReportConroller.java
  3. 22 0
      src/main/java/com/ydtech/modules/admin/controller/SysDeptController.java
  4. 52 2
      src/main/java/com/ydtech/modules/admin/controller/SysPcAddressController.java
  5. 12 0
      src/main/java/com/ydtech/modules/admin/controller/SysUserController.java
  6. 2 2
      src/main/java/com/ydtech/modules/admin/controller/SysUserLinkPtlAgreementController.java
  7. 34 3
      src/main/java/com/ydtech/modules/admin/controller/deptBalance/DeptBalanceController.java
  8. 14 1
      src/main/java/com/ydtech/modules/admin/controller/financialReceivables/FinancialReceivablesController.java
  9. 14 5
      src/main/java/com/ydtech/modules/admin/controller/khgl/KhglDataController.java
  10. 34 4
      src/main/java/com/ydtech/modules/admin/controller/personnelStatistics/PersonnelStatisticsController.java
  11. 15 4
      src/main/java/com/ydtech/modules/admin/controller/quoteCount/QuoteCountController.java
  12. 84 8
      src/main/java/com/ydtech/modules/admin/controller/taskStatistics/TaskStatisticsController.java
  13. 51 6
      src/main/java/com/ydtech/modules/admin/controller/websocket/SysGeographyPositionController.java
  14. 14 1
      src/main/java/com/ydtech/modules/admin/dao/SysGeographyPositionRecordMapper.java
  15. 12 2
      src/main/java/com/ydtech/modules/admin/dao/SysPcAddressHistoryMapper.java
  16. 18 0
      src/main/java/com/ydtech/modules/admin/model/SysGeographyPositionRecord.java
  17. 7 0
      src/main/java/com/ydtech/modules/admin/model/dto/AgreeReportQueryDto.java
  18. 6 0
      src/main/java/com/ydtech/modules/admin/model/dto/PcAddressInfoDto.java
  19. 4 0
      src/main/java/com/ydtech/modules/admin/model/dto/QxFrontlineAgentDto.java
  20. 3 0
      src/main/java/com/ydtech/modules/admin/model/po/SysPcAddress.java
  21. 3 0
      src/main/java/com/ydtech/modules/admin/model/po/SysPcAddressHistory.java
  22. 8 0
      src/main/java/com/ydtech/modules/admin/model/report/company/CompanyQutationCountDataQueryDto.java
  23. 9 0
      src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesQueryVo.java
  24. 21 0
      src/main/java/com/ydtech/modules/admin/model/vo/AppGeographyHistoryInfoVo.java
  25. 6 0
      src/main/java/com/ydtech/modules/admin/model/vo/DeptBalanceVo.java
  26. 7 0
      src/main/java/com/ydtech/modules/admin/model/vo/DxQueryVo.java
  27. 15 0
      src/main/java/com/ydtech/modules/admin/model/vo/KztGetDeptUtilsDto.java
  28. 7 0
      src/main/java/com/ydtech/modules/admin/model/vo/OrdersDataVo.java
  29. 5 1
      src/main/java/com/ydtech/modules/admin/model/vo/PcAddressHistoryInfoVo.java
  30. 6 0
      src/main/java/com/ydtech/modules/admin/model/vo/QxFrontlineAgentVo.java
  31. 6 0
      src/main/java/com/ydtech/modules/admin/model/vo/SysGeographyPositionInfoVo.java
  32. 2 1
      src/main/java/com/ydtech/modules/admin/model/vo/TaskStatisticsVo.java
  33. 5 1
      src/main/java/com/ydtech/modules/admin/service/SysDeptService.java
  34. 3 5
      src/main/java/com/ydtech/modules/admin/service/SysGeographyPositionService.java
  35. 4 2
      src/main/java/com/ydtech/modules/admin/service/SysPcAddressService.java
  36. 1 1
      src/main/java/com/ydtech/modules/admin/service/SysUserLinkPtlAgreementService.java
  37. 5 0
      src/main/java/com/ydtech/modules/admin/service/SysUserService.java
  38. 2 0
      src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyLeaderServiceImpl.java
  39. 90 0
      src/main/java/com/ydtech/modules/admin/service/impl/SysDeptServiceImpl.java
  40. 89 16
      src/main/java/com/ydtech/modules/admin/service/impl/SysGeographyPositionServiceImpl.java
  41. 2 0
      src/main/java/com/ydtech/modules/admin/service/impl/SysPartnerServiceImpl.java
  42. 75 23
      src/main/java/com/ydtech/modules/admin/service/impl/SysPcAddressServiceImpl.java
  43. 2 1
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserLinkPtlAgreementServiceImpl.java
  44. 21 0
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java
  45. 1 1
      src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java
  46. 44 23
      src/main/java/com/ydtech/modules/admin/utils/KztGetDeptUtils.java
  47. 12 2
      src/main/java/com/ydtech/modules/esm/controller/EsmInsCompanyController.java
  48. 8 1
      src/main/java/com/ydtech/modules/esm/dao/EsmInsCompanyMapper.java
  49. 8 0
      src/main/java/com/ydtech/modules/esm/service/EsmInsCompanyService.java
  50. 11 0
      src/main/java/com/ydtech/modules/esm/service/impl/EsmInsCompanyServiceImpl.java
  51. 31 0
      src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java
  52. 24 3
      src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java
  53. 10 0
      src/main/java/com/ydtech/modules/fnc/dao/InsuranceHandlingSettlementMonthMapper.java
  54. 36 0
      src/main/java/com/ydtech/modules/fnc/dto/InsPlyIncomePTCompanyDto.java
  55. 32 0
      src/main/java/com/ydtech/modules/fnc/dto/InsPlyIncomePTDto.java
  56. 8 0
      src/main/java/com/ydtech/modules/fnc/entity/InsPlyIncome.java
  57. 2 0
      src/main/java/com/ydtech/modules/fnc/entity/InsuranceHandlingSettlementMonthEntity.java
  58. 17 4
      src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java
  59. 10 0
      src/main/java/com/ydtech/modules/fnc/service/InsuranceHandlingSettlementMonthService.java
  60. 31 55
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java
  61. 12 0
      src/main/java/com/ydtech/modules/fnc/service/impl/InsuranceHandlingSettlementMonthServiceImpl.java
  62. 1 1
      src/main/java/com/ydtech/modules/fnc/service/impl/SettlementDocumentaryFeesServiceImpl.java
  63. 35 0
      src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomePTVo.java
  64. 31 0
      src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeQueryPTVo.java
  65. 5 1
      src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java
  66. 3 0
      src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java
  67. 1 1
      src/main/java/com/ydtech/modules/protocol/dao/PtlAgreementMapper.java
  68. 3 0
      src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreement.java
  69. 17 4
      src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java
  70. 24 0
      src/main/resources/mapper/modules/admin/CompanyDataReport.xml
  71. 13 0
      src/main/resources/mapper/modules/admin/DeptBalanceMapper.xml
  72. 13 0
      src/main/resources/mapper/modules/admin/SysAgencyLeaderMapper.xml
  73. 3 1
      src/main/resources/mapper/modules/admin/SysDeptMapper.xml
  74. 116 14
      src/main/resources/mapper/modules/admin/SysGeographyPositionRecordMapper.xml
  75. 13 0
      src/main/resources/mapper/modules/admin/SysPartnerMapper.xml
  76. 115 11
      src/main/resources/mapper/modules/admin/SysPcAddressHistoryMapper.xml
  77. 13 0
      src/main/resources/mapper/modules/admin/SysTelemarketingWechatDataMapper.xml
  78. 38 1
      src/main/resources/mapper/modules/admin/SysUserMapper.xml
  79. 61 7
      src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml
  80. 12 2
      src/main/resources/mapper/modules/esm/EsmInsCompanyMapper.xml
  81. 261 17
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml
  82. 9 0
      src/main/resources/mapper/modules/fnc/SettlementDocumentaryFeesMapper.xml
  83. 33 0
      src/main/resources/mapper/modules/insuranceHandlingSettlementMonth/InsuranceHandlingSettlementMonthMapper.xml
  84. 169 1
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml
  85. 9 1
      src/main/resources/mapper/modules/order/InsOrdersMapper.xml
  86. 12 0
      src/main/resources/mapper/modules/protocol/PtlAgreementMapper.xml

+ 15 - 2
src/main/java/com/ydtech/modules/admin/controller/AgreeReportConroller.java

@@ -1,18 +1,23 @@
 package com.ydtech.modules.admin.controller;
 
+import cn.hutool.http.server.HttpServerRequest;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.dto.AgreeReportQueryDto;
 import com.ydtech.modules.admin.model.report.user.agree.AgreeReportDto;
+import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
 import com.ydtech.modules.admin.service.AgreeReportService;
+import com.ydtech.modules.admin.utils.KztGetDeptUtils;
 import com.ydtech.modules.order.entity.BasePageResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.ObjectUtils;
 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.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /**
@@ -37,9 +42,17 @@ public class AgreeReportConroller {
      */
     @PostMapping("queryPage")
     @ApiOperation(value = "控制台战略合作单位统计")
-    public HttpResult<BasePageResult<AgreeReportDto>> queryPage(@RequestBody AgreeReportQueryDto agreeReportQueryDto) {
-
+    public HttpResult<BasePageResult<AgreeReportDto>> queryPage(@RequestBody AgreeReportQueryDto agreeReportQueryDto, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    agreeReportQueryDto.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    agreeReportQueryDto.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             BasePageResult<AgreeReportDto> result = agreeReportService.queryPage(agreeReportQueryDto);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){

+ 25 - 2
src/main/java/com/ydtech/modules/admin/controller/CompanyDataReportConroller.java

@@ -2,18 +2,23 @@ package com.ydtech.modules.admin.controller;
 
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.report.company.*;
+import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
 import com.ydtech.modules.admin.model.vo.OrdersDataVo;
 import com.ydtech.modules.admin.model.vo.TaskStatisticsVo;
 import com.ydtech.modules.admin.service.CompanyDataReportService;
+import com.ydtech.modules.admin.utils.KztGetDeptUtils;
 import com.ydtech.modules.order.entity.BasePageResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.ObjectUtils;
 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.servlet.http.HttpServletRequest;
+
 /**
  *  @version
  *  @author: hxl
@@ -69,8 +74,17 @@ public class CompanyDataReportConroller {
      */
     @PostMapping("querOrdersDataPage")
     @ApiOperation(value = "查询控制台大订单")
-    public HttpResult<BasePageResult<OrdersDataDto>> querOrdersDataPage(@RequestBody OrdersDataVo ordersDataVo) {
+    public HttpResult<BasePageResult<OrdersDataDto>> querOrdersDataPage(@RequestBody OrdersDataVo ordersDataVo, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    ordersDataVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    ordersDataVo.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             BasePageResult<OrdersDataDto> result = companyDataReportService.querOrdersDataPage(ordersDataVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){
@@ -85,8 +99,17 @@ public class CompanyDataReportConroller {
      */
     @PostMapping("querOrdersamountTo")
     @ApiOperation(value = "查询控制台大订单合计")
-    public HttpResult<OrdersDataDto> querOrdersamountTo(@RequestBody OrdersDataVo ordersDataVo) {
+    public HttpResult<OrdersDataDto> querOrdersamountTo(@RequestBody OrdersDataVo ordersDataVo, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    ordersDataVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    ordersDataVo.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             OrdersDataDto result = companyDataReportService.querOrdersamountTo(ordersDataVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){

+ 22 - 0
src/main/java/com/ydtech/modules/admin/controller/SysDeptController.java

@@ -8,21 +8,26 @@ import com.ydtech.core.page.PageRequest;
 import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.admin.model.SysPassword;
 import com.ydtech.modules.admin.model.SysUser;
+import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
 import com.ydtech.modules.admin.model.vo.SysDeptRemoveVo;
 import com.ydtech.modules.admin.model.vo.SysDeptTreeVo;
 import com.ydtech.modules.admin.model.vo.SysDeptVo;
 import com.ydtech.modules.admin.service.SysDeptService;
 import com.ydtech.modules.admin.service.SysPasswordService;
+import com.ydtech.modules.admin.utils.KztGetDeptUtils;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.security.utils.PasswordUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
 import java.util.List;
 
 
@@ -204,5 +209,22 @@ public class SysDeptController extends BaseController {
     }
 
 
+    /**
+     * 数据权限机构数
+     * @return
+     */
+    @ApiOperation(value = "数据权限机构数")
+    @GetMapping(value = "/getDataDeptTree")
+    public HttpResult<List<SysDept>> getDataDeptTree(HttpServletRequest httpServerRequest) {
+        List<String> deptIds = new ArrayList<>();
+        KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+            if("1".equals(kztGetDeptUtilsDto.getType())){
+                deptIds = kztGetDeptUtilsDto.getIds();
+            }
+        }
+        return HttpResult.ok(sysDeptService.getDataDeptTree(deptIds));
+    }
 
 }

+ 52 - 2
src/main/java/com/ydtech/modules/admin/controller/SysPcAddressController.java

@@ -14,11 +14,13 @@ import com.ydtech.modules.admin.service.SysPcAddressService;
 import com.ydtech.modules.admin.service.SysUserService;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.order.entity.BasePageResult;
+import com.ydtech.utils.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.*;
 
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
@@ -101,11 +103,59 @@ public class SysPcAddressController extends BaseController{
         return HttpResult.ok("success", this.sysPcAddressService.queryPcAddressInfo(addressInfoDto));
     }
 
+    @PostMapping("/queryPcAddressHistoryInfo")
+    @ApiOperation(value = "历史人员:同一经纬度人员信息")
+    public HttpResult<BasePageResult<SysPcAddressHistory>> queryPcAddressHistoryInfo(@RequestBody PcAddressInfoDto addressInfoDto) {
+        if (addressInfoDto.getPageNum() == 0) {
+            addressInfoDto.setPageNum(1);
+        }
+        if (addressInfoDto.getPageSize() == 0) {
+            addressInfoDto.setPageSize(10);
+        }
+        String startTime = addressInfoDto.getStartTime();
+        String endTime = addressInfoDto.getEndTime();
+        Date date = new Date();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        if (StringUtils.isEmpty(startTime)) {
+            addressInfoDto.setStartTime(simpleDateFormat.format(date));
+        }else {
+            startTime = addressInfoDto.getStartTime() + " 00:00:01";
+
+
+            Date parse = null;
+            try {
+                parse = simpleDateFormat.parse(startTime);
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+            addressInfoDto.setStartTime(simpleDateFormat.format(parse));
+        }
+        if (StringUtils.isEmpty(endTime)) {
+            addressInfoDto.setEndTime(simpleDateFormat.format(date));
+        }else {
+            endTime = endTime + " 23:59:59";
+            Date parse = null;
+            try {
+                parse = simpleDateFormat.parse(endTime);
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+            addressInfoDto.setEndTime(simpleDateFormat.format(parse));
+        }
+
+        return HttpResult.ok("success", this.sysPcAddressService.queryPcAddressHistoryInfo(addressInfoDto));
+    }
+
+
+
+
     @GetMapping("/getPcAddress")
     @ApiOperation(value = "历史在线人数")
-    public HttpResult<PcAddressHistoryInfoVo> getPcAddress(@RequestParam(value = "dates",required = false) String dates) {
+    public HttpResult<PcAddressHistoryInfoVo> getPcAddress(@RequestParam(value = "startTime",required = false) String startTime,
+                                                           @RequestParam(value = "endTime",required = false) String endTime,
+                                                           @RequestParam(value = "source",required = false) String source) {
 
-        return HttpResult.ok("success", this.sysPcAddressService.getPcAddress(dates));
+        return HttpResult.ok("success", this.sysPcAddressService.getPcAddress(startTime,endTime,source));
     }
 
     @GetMapping("/getOnlinePeople")

+ 12 - 0
src/main/java/com/ydtech/modules/admin/controller/SysUserController.java

@@ -841,6 +841,18 @@ public class SysUserController extends BaseController {
         return HttpResult.ok(list);
     }
 
+    /**
+     * 获取当前用户的下级所有人员
+     * @return
+     */
+    @ApiOperation(value = "获取当前用户的下级所有人员")
+    @GetMapping(value = "/findNextTree")
+    public HttpResult<List<SysUser>> findNextTree() {
+        List<SysUser> list = sysUserService.findNextTree();
+        return HttpResult.ok(list);
+    }
+
+
     @ApiOperation(value = "渠道区域业绩管理")
     @PostMapping(value = "/quUserNum")
     public HttpResult quUserNum(@RequestBody QuUserNumDto quUserNumDto) {

+ 2 - 2
src/main/java/com/ydtech/modules/admin/controller/SysUserLinkPtlAgreementController.java

@@ -111,9 +111,9 @@ public class SysUserLinkPtlAgreementController extends BaseController {
      */
     @GetMapping("findPtlAgreementListNew")
     @ApiOperation("查询所有审核协议列表")
-    public HttpResult<Object> findPtlAgreementListNew() {
+    public HttpResult<Object> findPtlAgreementListNew(String type) {
         try{
-            List<PtlAgreement> list= sysUserLinkPtlAgreementService.findPtlAgreementListNew();
+            List<PtlAgreement> list= sysUserLinkPtlAgreementService.findPtlAgreementListNew(type);
             return HttpResult.ok(list);
         }catch (Exception e){
             return HttpResult.error("操作失败"+e.getMessage());

+ 34 - 3
src/main/java/com/ydtech/modules/admin/controller/deptBalance/DeptBalanceController.java

@@ -6,14 +6,18 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.dto.DeptBalanceDto;
 import com.ydtech.modules.admin.model.dto.SysPartnerConsoleDto;
 import com.ydtech.modules.admin.model.vo.DeptBalanceVo;
+import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
 import com.ydtech.modules.admin.model.vo.PartnerBalanceVo;
 import com.ydtech.modules.admin.service.DeptBalanceService;
+import com.ydtech.modules.admin.utils.KztGetDeptUtils;
 import com.ydtech.modules.admin.utils.SliceUpDateUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -35,10 +39,19 @@ public class DeptBalanceController {
      */
     @PostMapping("deptLeaderStatistics")
     @ApiOperation(value = "机构负责人统计")
-    public HttpResult<IPage<DeptBalanceDto>> queryDeptLeaderStatistics(@RequestBody DeptBalanceVo deptBalanceVo) {
+    public HttpResult<IPage<DeptBalanceDto>> queryDeptLeaderStatistics(@RequestBody DeptBalanceVo deptBalanceVo, HttpServletRequest httpServerRequest) {
         HashMap<String, String> map = getDateMapByType(deptBalanceVo.getDays(), deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate());
         deptBalanceVo.setBeginDate(map.get("startDate"));
         deptBalanceVo.setEndDate(map.get("endDate"));
+        KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+            if("1".equals(kztGetDeptUtilsDto.getType())){
+                deptBalanceVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+            } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                deptBalanceVo.setUserIds(kztGetDeptUtilsDto.getIds());
+            }
+        }
         HttpResult<IPage<DeptBalanceDto>> result = deptBalanceService.queryDeptLeaderStatistics(deptBalanceVo);
         return result;
     }
@@ -51,10 +64,19 @@ public class DeptBalanceController {
      */
     @PostMapping("queryPartnerStatistics")
     @ApiOperation(value = "合伙人统计")
-    public HttpResult<IPage<SysPartnerConsoleDto>> queryPartnerStatistics(@RequestBody DeptBalanceVo deptBalanceVo) {
+    public HttpResult<IPage<SysPartnerConsoleDto>> queryPartnerStatistics(@RequestBody DeptBalanceVo deptBalanceVo, HttpServletRequest httpServerRequest) {
         HashMap<String, String> map = getDateMapByType(deptBalanceVo.getDays(), deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate());
         deptBalanceVo.setBeginDate(map.get("startDate"));
         deptBalanceVo.setEndDate(map.get("endDate"));
+        KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+            if("1".equals(kztGetDeptUtilsDto.getType())){
+                deptBalanceVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+            } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                deptBalanceVo.setUserIds(kztGetDeptUtilsDto.getIds());
+            }
+        }
         HttpResult<IPage<SysPartnerConsoleDto>> result = deptBalanceService.queryPartnerStatistics(deptBalanceVo);
         return result;
     }
@@ -83,10 +105,19 @@ public class DeptBalanceController {
      */
     @PostMapping("walletAgent")
     @ApiOperation(value = "钱包代理人")
-    public HttpResult<IPage<SysPartnerConsoleDto>> getWalletAgent(@RequestBody DeptBalanceVo deptBalanceVo) {
+    public HttpResult<IPage<SysPartnerConsoleDto>> getWalletAgent(@RequestBody DeptBalanceVo deptBalanceVo, HttpServletRequest httpServerRequest) {
         HashMap<String, String> map = getDateMapByType(deptBalanceVo.getDays(), deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate());
         deptBalanceVo.setBeginDate(map.get("startDate"));
         deptBalanceVo.setEndDate(map.get("endDate"));
+        KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+            if("1".equals(kztGetDeptUtilsDto.getType())){
+                deptBalanceVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+            } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                deptBalanceVo.setUserIds(kztGetDeptUtilsDto.getIds());
+            }
+        }
         IPage<SysPartnerConsoleDto> result = deptBalanceService.getWalletAgent(deptBalanceVo);
         return HttpResult.ok(result);
     }

+ 14 - 1
src/main/java/com/ydtech/modules/admin/controller/financialReceivables/FinancialReceivablesController.java

@@ -5,16 +5,20 @@ import com.ydtech.modules.admin.model.report.financialReceivables.FinancialRecei
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryMonthVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
+import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
+import com.ydtech.modules.admin.utils.KztGetDeptUtils;
 import com.ydtech.modules.fnc.service.InsPlyIncomeService;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.ObjectUtils;
 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.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -43,7 +47,16 @@ public class FinancialReceivablesController {
     */
     @PostMapping("/queryDateByType")
     @ApiModelProperty(value = "获取平台私有数据列表")
-    public HttpResult<FinancialReceivablesAllVo> queryDateByType(@RequestBody FinancialReceivablesQueryVo financialReceivablesQueryVo) {
+    public HttpResult<FinancialReceivablesAllVo> queryDateByType(@RequestBody FinancialReceivablesQueryVo financialReceivablesQueryVo, HttpServletRequest httpServerRequest) {
+        KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+            if("1".equals(kztGetDeptUtilsDto.getType())){
+                financialReceivablesQueryVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+            } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                financialReceivablesQueryVo.setUserIds(kztGetDeptUtilsDto.getIds());
+            }
+        }
         return HttpResult.ok(insPlyIncomeService.queryDateByType(financialReceivablesQueryVo));
     }
 

+ 14 - 5
src/main/java/com/ydtech/modules/admin/controller/khgl/KhglDataController.java

@@ -7,21 +7,21 @@ import com.ydtech.modules.admin.model.dto.DxReportDataDto;
 import com.ydtech.modules.admin.model.dto.GroupDto;
 import com.ydtech.modules.admin.model.dto.KhglDataDto;
 import com.ydtech.modules.admin.model.po.KztDataPermission;
-import com.ydtech.modules.admin.model.vo.DxDataVo;
-import com.ydtech.modules.admin.model.vo.DxQueryVo;
-import com.ydtech.modules.admin.model.vo.KhglDataVo;
-import com.ydtech.modules.admin.model.vo.KztDataPermissionVo;
+import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.admin.service.DxDataService;
 import com.ydtech.modules.admin.service.KhglZgdDataService;
 import com.ydtech.modules.admin.service.KhglZzbDataService;
+import com.ydtech.modules.admin.utils.KztGetDeptUtils;
 import com.ydtech.modules.admin.utils.SliceUpDateUtil;
 import com.ydtech.modules.order.entity.BasePageResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
@@ -126,7 +126,16 @@ public class KhglDataController {
      */
     @PostMapping("/queryDxDataPage")
     @ApiOperation(value = "查询用户所有的数据分页")
-    public HttpResult<BasePageResult<DxReportDataDto>> queryDxDataPage(@RequestBody DxQueryVo dxQueryVo){
+    public HttpResult<BasePageResult<DxReportDataDto>> queryDxDataPage(@RequestBody DxQueryVo dxQueryVo, HttpServletRequest httpServerRequest){
+        KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+            if("1".equals(kztGetDeptUtilsDto.getType())){
+                dxQueryVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+            } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                dxQueryVo.setUserIds(kztGetDeptUtilsDto.getIds());
+            }
+        }
         HashMap<String, String> map = getDateMapByType(dxQueryVo.getType(), dxQueryVo.getBeginDate(), dxQueryVo.getEndDate(),"2");
         dxQueryVo.setBeginDate(map.get("startDate"));
         dxQueryVo.setEndDate(map.get("endDate"));

+ 34 - 4
src/main/java/com/ydtech/modules/admin/controller/personnelStatistics/PersonnelStatisticsController.java

@@ -6,15 +6,19 @@ import com.ydtech.modules.admin.model.dto.EsmUserReferrerDTO;
 import com.ydtech.modules.admin.model.dto.QxFrontlineAgentDto;
 import com.ydtech.modules.admin.model.dto.TeamManagementDto;
 import com.ydtech.modules.admin.model.vo.HouLinePersonnelReportVo;
+import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
 import com.ydtech.modules.admin.model.vo.QxFrontlineAgentVo;
 import com.ydtech.modules.admin.service.SysDeptService;
 import com.ydtech.modules.admin.service.UserReportService;
+import com.ydtech.modules.admin.utils.KztGetDeptUtils;
 import com.ydtech.modules.esm.model.vo.EsmUserCountVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.HashMap;
 import java.util.List;
 
@@ -59,8 +63,16 @@ public class PersonnelStatisticsController {
      */
     @PostMapping("queryQxFrontlineAgent")
     @ApiOperation(value = "人员统计-前线人员-代理人统计")
-    public HttpResult<IPage<QxFrontlineAgentDto>> queryQxFrontlineAgent(@RequestBody QxFrontlineAgentVo qxFrontlineAgentVo) {
-
+    public HttpResult<IPage<QxFrontlineAgentDto>> queryQxFrontlineAgent(@RequestBody QxFrontlineAgentVo qxFrontlineAgentVo, HttpServletRequest httpServerRequest) {
+        KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+            if("1".equals(kztGetDeptUtilsDto.getType())){
+                qxFrontlineAgentVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+            } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                qxFrontlineAgentVo.setUserIds(kztGetDeptUtilsDto.getIds());
+            }
+        }
         HttpResult<IPage<QxFrontlineAgentDto>> result = userReportService.queryQxFrontlineAgent(qxFrontlineAgentVo);
         return result;
     }
@@ -73,8 +85,17 @@ public class PersonnelStatisticsController {
      */
     @PostMapping("queryQxFrontlineAgentRanking")
     @ApiOperation(value = "人员统计-前线人员-代理人统计-团队排名")
-    public HttpResult<List<QxFrontlineAgentDto>> queryQxFrontlineAgentRanking(@RequestBody QxFrontlineAgentVo qxFrontlineAgentVo) {
+    public HttpResult<List<QxFrontlineAgentDto>> queryQxFrontlineAgentRanking(@RequestBody QxFrontlineAgentVo qxFrontlineAgentVo, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    qxFrontlineAgentVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    qxFrontlineAgentVo.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             List<QxFrontlineAgentDto> result = userReportService.queryQxFrontlineAgentRanking(qxFrontlineAgentVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){
@@ -103,7 +124,16 @@ public class PersonnelStatisticsController {
      */
     @PostMapping("queryChannelDetails")
     @ApiOperation(value = "人员统计-前线人员-渠道明细")
-    public HttpResult<List<QxFrontlineAgentDto>> queryChannelDetails(@RequestBody QxFrontlineAgentVo qxFrontlineAgentVo) {
+    public HttpResult<List<QxFrontlineAgentDto>> queryChannelDetails(@RequestBody QxFrontlineAgentVo qxFrontlineAgentVo,HttpServletRequest httpServerRequest) {
+        KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+        KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+        if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+            if("1".equals(kztGetDeptUtilsDto.getType())){
+                qxFrontlineAgentVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+            } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                qxFrontlineAgentVo.setUserIds(kztGetDeptUtilsDto.getIds());
+            }
+        }
         HttpResult<List<QxFrontlineAgentDto>> result = userReportService.queryChannelDetails(qxFrontlineAgentVo);
         return result;
     }

+ 15 - 4
src/main/java/com/ydtech/modules/admin/controller/quoteCount/QuoteCountController.java

@@ -3,16 +3,21 @@ package com.ydtech.modules.admin.controller.quoteCount;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataDto;
 import com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataQueryDto;
+import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
 import com.ydtech.modules.admin.service.CompanyDataReportService;
+import com.ydtech.modules.admin.utils.KztGetDeptUtils;
 import com.ydtech.modules.order.entity.BasePageResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.ObjectUtils;
 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.servlet.http.HttpServletRequest;
+
 /**
  *  @version
  *  @author: hxl
@@ -35,15 +40,21 @@ public class QuoteCountController {
      */
     @PostMapping("queryCompanyQutationCountDataPage")
     @ApiOperation(value = "查询报价次数数据")
-    public HttpResult<BasePageResult<CompanyQutationCountDataDto>> queryCompanyQutationCountDataPage(@RequestBody CompanyQutationCountDataQueryDto companyQutationCountDataQueryDto) {
+    public HttpResult<BasePageResult<CompanyQutationCountDataDto>> queryCompanyQutationCountDataPage(@RequestBody CompanyQutationCountDataQueryDto companyQutationCountDataQueryDto, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    companyQutationCountDataQueryDto.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    companyQutationCountDataQueryDto.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             BasePageResult<CompanyQutationCountDataDto> result = companyDataReportService.queryCompanyQutationCountDataPage(companyQutationCountDataQueryDto);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){
             return HttpResult.error("查询错误"+e.getMessage());
         }
     }
-
-
-
 }

+ 84 - 8
src/main/java/com/ydtech/modules/admin/controller/taskStatistics/TaskStatisticsController.java

@@ -5,15 +5,19 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.dto.TaskStatisticsDto;
 import com.ydtech.modules.admin.model.vo.BusinessAgentData;
+import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
 import com.ydtech.modules.admin.model.vo.TaskStatisticsVo;
 import com.ydtech.modules.admin.service.TaskStatisticsService;
+import com.ydtech.modules.admin.utils.KztGetDeptUtils;
 import io.swagger.annotations.*;
+import org.apache.commons.lang3.ObjectUtils;
 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.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /**
@@ -35,8 +39,17 @@ public class TaskStatisticsController {
      **/
     @PostMapping("queryPage")
     @ApiOperation(value = "控制台-渠道任务统计查询")
-    public HttpResult<IPage<TaskStatisticsDto>> queryPage(@RequestBody TaskStatisticsVo taskStatisticsVo) {
+    public HttpResult<IPage<TaskStatisticsDto>> queryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             IPage<TaskStatisticsDto> result = taskStatisticsService.queryPage(taskStatisticsVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){
@@ -51,8 +64,17 @@ public class TaskStatisticsController {
      **/
     @PostMapping("insuranceCompanyQueryPage")
     @ApiOperation(value = "控制台-保险公司统计查询")
-    public HttpResult<IPage<TaskStatisticsDto>> insuranceCompanyQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo) {
+    public HttpResult<IPage<TaskStatisticsDto>> insuranceCompanyQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             IPage<TaskStatisticsDto> result = taskStatisticsService.insuranceCompanyQueryPage(taskStatisticsVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){
@@ -67,8 +89,17 @@ public class TaskStatisticsController {
      **/
     @PostMapping("agentStatisticsQueryPage")
     @ApiOperation(value = "控制台-代理人统计查询")
-    public HttpResult<IPage<TaskStatisticsDto>> agentStatisticsQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo) {
+    public HttpResult<IPage<TaskStatisticsDto>> agentStatisticsQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             IPage<TaskStatisticsDto> result = taskStatisticsService.agentStatisticsQueryPage(taskStatisticsVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){
@@ -95,8 +126,17 @@ public class TaskStatisticsController {
      **/
     @PostMapping("costCenter")
     @ApiOperation(value = "控制台-财务中心-费用校验")
-    public HttpResult<IPage<TaskStatisticsDto>> costCenter(@RequestBody TaskStatisticsVo taskStatisticsVo) {
+    public HttpResult<IPage<TaskStatisticsDto>> costCenter(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             IPage<TaskStatisticsDto> result = taskStatisticsService.costCenter(taskStatisticsVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){
@@ -139,8 +179,17 @@ public class TaskStatisticsController {
      **/
     @PostMapping("getBusinessData")
     @ApiOperation(value = "控制台-业务数据")
-    public HttpResult<IPage<TaskStatisticsDto>> getBusinessData(@RequestBody TaskStatisticsVo taskStatisticsVo) {
+    public HttpResult<IPage<TaskStatisticsDto>> getBusinessData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             IPage<TaskStatisticsDto> result = taskStatisticsService.getBusinessData(taskStatisticsVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){
@@ -155,8 +204,17 @@ public class TaskStatisticsController {
      **/
     @PostMapping("getDistribution")
     @ApiOperation(value = "控制台-业务数据-保险分布")
-    public HttpResult<List<TaskStatisticsDto>> getDistribution(@RequestBody TaskStatisticsVo taskStatisticsVo) {
+    public HttpResult<List<TaskStatisticsDto>> getDistribution(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             List<TaskStatisticsDto> result = taskStatisticsService.getDistribution(taskStatisticsVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){
@@ -181,8 +239,17 @@ public class TaskStatisticsController {
      **/
     @PostMapping("getBusinessAgentData")
     @ApiOperation(value = "控制台-业务数据-代理人")
-    public HttpResult<IPage<BusinessAgentData>> getBusinessAgentData(@RequestBody TaskStatisticsVo taskStatisticsVo) {
+    public HttpResult<IPage<BusinessAgentData>> getBusinessAgentData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             IPage<BusinessAgentData> result = taskStatisticsService.getBusinessAgentData(taskStatisticsVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){
@@ -197,8 +264,17 @@ public class TaskStatisticsController {
      **/
     @PostMapping("getBusinessAgentDataTotal")
     @ApiOperation(value = "控制台-业务数据-代理人-合计")
-    public HttpResult<BusinessAgentData> getBusinessAgentDataTotal(@RequestBody TaskStatisticsVo taskStatisticsVo) {
+    public HttpResult<BusinessAgentData> getBusinessAgentDataTotal(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
         try{
+            KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
+            KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
+            if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
+                if("1".equals(kztGetDeptUtilsDto.getType())){
+                    taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
+                } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
+                    taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
+                }
+            }
             BusinessAgentData result = taskStatisticsService.getBusinessAgentDataTotal(taskStatisticsVo);
             return HttpResult.ok("查询数据成功", result);
         }catch (Exception e){

+ 51 - 6
src/main/java/com/ydtech/modules/admin/controller/websocket/SysGeographyPositionController.java

@@ -5,17 +5,17 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.SysGeographyPosition;
 import com.ydtech.modules.admin.model.SysGeographyPositionRecord;
 import com.ydtech.modules.admin.model.dto.*;
-import com.ydtech.modules.admin.model.vo.PcAddressHistoryInfoVo;
-import com.ydtech.modules.admin.model.vo.RegionInfoVo;
-import com.ydtech.modules.admin.model.vo.SysGeographyPositionInfoVo;
-import com.ydtech.modules.admin.model.vo.SysGeographyPositionVo;
+import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.admin.service.SysGeographyPositionService;
 import com.ydtech.modules.order.entity.BasePageResult;
+import com.ydtech.utils.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 
@@ -77,11 +77,56 @@ public class SysGeographyPositionController {
         return HttpResult.ok("success", this.sysGeographyPositionService.queryPcAddressInfo(addressInfoDto));
     }
 
+    @PostMapping("/queryGeographyRecord")
+    @ApiOperation(value = "历史人员:查询同一经纬度人员信息")
+    public HttpResult<BasePageResult<SysGeographyPositionInfoVo>> queryGeographyRecord(@RequestBody PcAddressInfoDto addressInfoDto) {
+        if (addressInfoDto.getPageNum() == 0) {
+            addressInfoDto.setPageNum(1);
+        }
+        if (addressInfoDto.getPageSize() == 0) {
+            addressInfoDto.setPageSize(10);
+        }
+        String startTime = addressInfoDto.getStartTime();
+        String endTime = addressInfoDto.getEndTime();
+        Date date = new Date();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        if (StringUtils.isEmpty(startTime)) {
+            addressInfoDto.setStartTime(simpleDateFormat.format(date));
+        }else {
+            startTime = addressInfoDto.getStartTime() + " 00:00:01";
+
+
+            Date parse = null;
+            try {
+                parse = simpleDateFormat.parse(startTime);
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+            addressInfoDto.setStartTime(simpleDateFormat.format(parse));
+        }
+        if (StringUtils.isEmpty(endTime)) {
+            addressInfoDto.setEndTime(simpleDateFormat.format(date));
+        }else {
+            endTime = endTime + " 23:59:59";
+            Date parse = null;
+            try {
+                parse = simpleDateFormat.parse(endTime);
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+            addressInfoDto.setEndTime(simpleDateFormat.format(parse));
+        }
+
+        return HttpResult.ok("success", this.sysGeographyPositionService.queryGeographyRecord(addressInfoDto));
+    }
+
     @GetMapping("/getGeographyPosition")
     @ApiOperation(value = "历史在线人数")
-    public HttpResult<PcAddressHistoryInfoVo> getGeographyPosition(@RequestParam(value = "dates",required = false) String dates) {
+    public HttpResult<AppGeographyHistoryInfoVo> getGeographyPosition(@RequestParam(value = "startTime",required = false) String startTime,
+                                                                      @RequestParam(value = "endTime",required = false) String endTime,
+                                                                      @RequestParam(value = "source",required = false) String source) {
 
-        return HttpResult.ok("success", this.sysGeographyPositionService.getGeographyPosition(dates));
+        return HttpResult.ok("success", this.sysGeographyPositionService.getGeographyPosition(startTime,endTime,source));
     }
 
     @GetMapping("/getOnlinePeople")

+ 14 - 1
src/main/java/com/ydtech/modules/admin/dao/SysGeographyPositionRecordMapper.java

@@ -2,9 +2,14 @@ package com.ydtech.modules.admin.dao;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.admin.model.SysGeographyPositionRecord;
+import com.ydtech.modules.admin.model.dto.PcAddressInfoDto;
 import com.ydtech.modules.admin.model.vo.PcAddressHistoryTimeVo;
+import com.ydtech.modules.admin.model.vo.SysGeographyPositionInfoVo;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -18,6 +23,14 @@ import java.util.List;
 public interface SysGeographyPositionRecordMapper extends BaseMapper<SysGeographyPositionRecord> {
 
 
-    List<PcAddressHistoryTimeVo> getGeographyPosition(String dates);
+    List<PcAddressHistoryTimeVo> getGeographyPosition(@Param("dates") String dates, @Param("source")String source);
+
+    List<SysGeographyPositionRecord> getGeographyPositionRecord(@Param("dates") String dates, @Param("source")String source);
+
+    List<PcAddressHistoryTimeVo> getGeographyPositionSection(@Param("startTime")String startTime, @Param("endTime") String endTime,@Param("source") String source);
+
+    List<SysGeographyPositionRecord> getGeographyPositionHistory(@Param("startTime")String startTime, @Param("endTime") String endTime,@Param("source") String source);
+
+    IPage<SysGeographyPositionInfoVo> queryGeographyHistory(Page page, @Param("dto")  PcAddressInfoDto addressInfoDto);
 }
 

+ 12 - 2
src/main/java/com/ydtech/modules/admin/dao/SysPcAddressHistoryMapper.java

@@ -1,11 +1,13 @@
 package com.ydtech.modules.admin.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ydtech.modules.admin.model.dto.PcAddressInfoDto;
 import com.ydtech.modules.admin.model.po.SysPcAddressHistory;
 import com.ydtech.modules.admin.model.vo.PcAddressHistoryTimeVo;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -16,7 +18,15 @@ import java.util.List;
 */
 public interface SysPcAddressHistoryMapper extends BaseMapper<SysPcAddressHistory> {
 
-    List<PcAddressHistoryTimeVo> getPcAddress(@Param("dates") String dates);
+    List<PcAddressHistoryTimeVo> getPcAddress(@Param("dates") String dates, @Param("source")String source);
+
+    List<SysPcAddressHistory> getPcAddressInfo(@Param("dates") String dates, @Param("source") String source);
+
+    List<PcAddressHistoryTimeVo> getPcAddressSection(@Param("startTime")String startTime, @Param("endTime") String endTime,@Param("source") String source);
+
+    List<SysPcAddressHistory> getPcAddressHistory(@Param("startTime")String startTime, @Param("endTime") String endTime,@Param("source") String source);
+
+    IPage<SysPcAddressHistory> queryAddressHistory(Page page, @Param("dto") PcAddressInfoDto addressInfoDto);
 }
 
 

+ 18 - 0
src/main/java/com/ydtech/modules/admin/model/SysGeographyPositionRecord.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.admin.model;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
@@ -62,6 +63,23 @@ public class SysGeographyPositionRecord implements Serializable {
 
     @ApiModelProperty(value = "机构来源")
     private String source;
+    //预留字段,判断调接口使用
+    @TableField(exist = false)
+    private Integer type=2;
+
+    @ApiModelProperty(value = "所属机构")
+    @TableField(exist = false)
+    private String deptName;
+
+    @ApiModelProperty(value = "领导人姓名")
+    @TableField(exist = false)
+    private String leaderName;
+
+
+
+
+
+
 
 }
 

+ 7 - 0
src/main/java/com/ydtech/modules/admin/model/dto/AgreeReportQueryDto.java

@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  *  @version
  *  @author: hxl
@@ -65,5 +67,10 @@ public class AgreeReportQueryDto {
     @ApiModelProperty(value = "门店机构id")
     private String houseId;
 
+    @ApiModelProperty(value = "用户ids")
+    private List<String> userIds;
+
+    @ApiModelProperty(value = "部门ids")
+    private List<String> deptIds;
 
 }

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

@@ -3,6 +3,7 @@ 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 = "经纬度筛选")
@@ -33,5 +34,10 @@ public class PcAddressInfoDto {
     @ApiModelProperty(value = "每页条数")
     private int pageSize;
 
+    //历史人员信息筛选
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    private String startTime;
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    private String endTime;
 
 }

+ 4 - 0
src/main/java/com/ydtech/modules/admin/model/dto/QxFrontlineAgentDto.java

@@ -120,7 +120,11 @@ public class QxFrontlineAgentDto implements Serializable {
     @ApiModelProperty(value = "省部门名称")
     private String provinceName;
 
+    @ApiModelProperty(value = "部门ids")
+    private List<String> deptIds;
 
+    @ApiModelProperty(value = "用户ids")
+    private List<String> userIds;
 
     private Integer totalManpowerNum;
 

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

@@ -88,5 +88,8 @@ public class SysPcAddress implements Serializable {
     @ApiModelProperty(value = "在线状态(0:离线; 1:在线)")
     private Integer status;
 
+    @TableField(exist = false)
+    private Integer type=1;
+
 
 }

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

@@ -80,4 +80,7 @@ public class SysPcAddressHistory implements Serializable {
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
 
+    @TableField(exist = false)
+    private Integer type=2;
+
 }

+ 8 - 0
src/main/java/com/ydtech/modules/admin/model/report/company/CompanyQutationCountDataQueryDto.java

@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  *  @version
  *  @author: hxl
@@ -55,5 +57,11 @@ public class CompanyQutationCountDataQueryDto {
     @ApiModelProperty("部门id")
     private String  deptId;
 
+    @ApiModelProperty(value = "部门ids")
+    private List<String> deptIds;
+
+    @ApiModelProperty(value = "用户ids")
+    private List<String> userIds;
+
 
 }

+ 9 - 0
src/main/java/com/ydtech/modules/admin/model/report/financialReceivables/FinancialReceivablesQueryVo.java

@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  *  @version 
  *  @author: hxl
@@ -30,4 +32,11 @@ public class FinancialReceivablesQueryVo {
     @ApiModelProperty("是否是非车  0  不是 1 是")
     private String  isNotCar;
 
+    @ApiModelProperty(value = "部门ids")
+    private List<String> deptIds;
+
+    @ApiModelProperty(value = "用户ids")
+    private List<String> userIds;
+
+
 }

+ 21 - 0
src/main/java/com/ydtech/modules/admin/model/vo/AppGeographyHistoryInfoVo.java

@@ -0,0 +1,21 @@
+package com.ydtech.modules.admin.model.vo;
+
+import com.ydtech.modules.admin.model.SysGeographyPositionRecord;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+@Data
+@ApiModel(value ="APP历史在线人数")
+public class AppGeographyHistoryInfoVo {
+
+    @ApiModelProperty(value = "历史在线总人数")
+    private Long onlineNum;
+
+    @ApiModelProperty(value = "历史时间点在线人数")
+    List<PcAddressHistoryTimeVo> list;
+
+    @ApiModelProperty(value = "在线人")
+    List<SysGeographyPositionRecord> positionRecordList;
+}

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

@@ -60,6 +60,12 @@ public class DeptBalanceVo implements Serializable {
     @ApiModelProperty(value = "天数")
     private String  days;
 
+    @ApiModelProperty(value = "部门ids")
+    private List<String> deptIds;
+
+    @ApiModelProperty(value = "用户ids")
+    private List<String> userIds;
+
 
 
 }

+ 7 - 0
src/main/java/com/ydtech/modules/admin/model/vo/DxQueryVo.java

@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import javax.validation.constraints.Min;
+import java.util.List;
 
 /**
  *  @version
@@ -44,4 +45,10 @@ public class DxQueryVo {
     @ApiModelProperty(value = "页数")
     @Min(value = 1, message = "页数最小为1")
     private int pageNum;
+
+    @ApiModelProperty(value = "部门ids")
+    private List<String> deptIds;
+
+    @ApiModelProperty(value = "用户ids")
+    private List<String> userIds;
 }

+ 15 - 0
src/main/java/com/ydtech/modules/admin/model/vo/KztGetDeptUtilsDto.java

@@ -0,0 +1,15 @@
+package com.ydtech.modules.admin.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class KztGetDeptUtilsDto  implements Serializable {
+    @ApiModelProperty(value = "返回类型")
+    private String type;
+    @ApiModelProperty
+    private List<String> ids;
+}

+ 7 - 0
src/main/java/com/ydtech/modules/admin/model/vo/OrdersDataVo.java

@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 /**
  *  @version
  *  @author: whp
@@ -67,4 +69,9 @@ public class OrdersDataVo {
 
     @ApiModelProperty("年份")
     private String year;
+
+    @ApiModelProperty(value = "部门ids")
+    private List<String> deptIds;
+    @ApiModelProperty(value = "用户ids")
+    private List<String> userIds;
 }

+ 5 - 1
src/main/java/com/ydtech/modules/admin/model/vo/PcAddressHistoryInfoVo.java

@@ -1,5 +1,6 @@
 package com.ydtech.modules.admin.model.vo;
 
+import com.ydtech.modules.admin.model.po.SysPcAddressHistory;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -7,7 +8,7 @@ import lombok.Data;
 import java.util.List;
 
 @Data
-@ApiModel(value ="历史在线人数")
+@ApiModel(value ="PC历史在线人数")
 public class PcAddressHistoryInfoVo {
 
     @ApiModelProperty(value = "历史在线总人数")
@@ -16,5 +17,8 @@ public class PcAddressHistoryInfoVo {
     @ApiModelProperty(value = "历史时间点在线人数")
     List<PcAddressHistoryTimeVo> list;
 
+    @ApiModelProperty(value = "在线人")
+    List<SysPcAddressHistory> pcAddressList;
+
 
 }

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

@@ -81,5 +81,11 @@ public class QxFrontlineAgentVo implements Serializable {
     @ApiModelProperty(value = "层级类型  0 汇总  1.本人  2. 一级团队 3. 二级团队  4 三级团队  5 临时团队")
     private String type;
 
+    @ApiModelProperty(value = "用户ids")
+    private List<String> userIds;
+
+    @ApiModelProperty(value = "部门ids")
+    private List<String> deptIds;
+
 
 }

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

@@ -1,5 +1,6 @@
 package com.ydtech.modules.admin.model.vo;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.ydtech.modules.admin.model.SysGeographyPosition;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -9,5 +10,10 @@ public class SysGeographyPositionInfoVo extends SysGeographyPosition {
 
     @ApiModelProperty(value = "所属机构")
     private String deptName;
+    @ApiModelProperty(value = "用户id")
+    private String userId;
+
+    @TableField(exist = false)
+    private Integer type=1;
 
 }

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

@@ -96,7 +96,8 @@ public class TaskStatisticsVo implements Serializable {
 
     @ApiModelProperty(value = "是否app,pc报价")
     private String orderSource;
-
+    @ApiModelProperty(value = "部门ids")
+    private List<String> deptIds;
 
 
 

+ 5 - 1
src/main/java/com/ydtech/modules/admin/service/SysDeptService.java

@@ -125,7 +125,11 @@ public interface SysDeptService extends IService<SysDept> {
      * @return ture 一致 false 不一致
      */
     boolean contrastiveManagementSource(String orderNo, String managementSource);
-
+    /**
+     * 数据权限机构数
+     * @return
+     */
+    List<SysDept> getDataDeptTree(List<String> deptIds);
 }
 
 

+ 3 - 5
src/main/java/com/ydtech/modules/admin/service/SysGeographyPositionService.java

@@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.modules.admin.model.SysGeographyPosition;
 import com.ydtech.modules.admin.model.SysGeographyPositionRecord;
 import com.ydtech.modules.admin.model.dto.*;
-import com.ydtech.modules.admin.model.vo.PcAddressHistoryInfoVo;
-import com.ydtech.modules.admin.model.vo.RegionInfoVo;
-import com.ydtech.modules.admin.model.vo.SysGeographyPositionInfoVo;
-import com.ydtech.modules.admin.model.vo.SysGeographyPositionVo;
+import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.order.entity.BasePageResult;
 
 import java.util.List;
@@ -25,8 +22,9 @@ public interface SysGeographyPositionService extends IService<SysGeographyPositi
     List<SysGeographyPositionInfoVo> findLocationsWithinRadius(AdressRangeDto adressRangeDto);
 
     BasePageResult<SysGeographyPositionInfoVo> queryPcAddressInfo(PcAddressInfoDto addressInfoDto);
+    BasePageResult<SysGeographyPositionInfoVo> queryGeographyRecord(PcAddressInfoDto addressInfoDto);
 
-    PcAddressHistoryInfoVo getGeographyPosition(String dates);
+    AppGeographyHistoryInfoVo getGeographyPosition(String startTime, String endTime, String source);
 
     List<SysGeographyPosition> getOnlinePeople();
 

+ 4 - 2
src/main/java/com/ydtech/modules/admin/service/SysPcAddressService.java

@@ -4,11 +4,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.dto.*;
 import com.ydtech.modules.admin.model.po.SysPcAddress;
+import com.ydtech.modules.admin.model.po.SysPcAddressHistory;
 import com.ydtech.modules.admin.model.vo.PcAddressHistoryInfoVo;
 import com.ydtech.modules.admin.model.vo.RegionInfoVo;
 import com.ydtech.modules.order.entity.BasePageResult;
 
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -41,7 +41,9 @@ public interface SysPcAddressService extends IService<SysPcAddress> {
 
     BasePageResult<SysPcAddress> queryPcAddressInfo(PcAddressInfoDto addressInfoDto);
 
-    PcAddressHistoryInfoVo getPcAddress(String dates);
+    PcAddressHistoryInfoVo getPcAddress(String startTime, String endTime, String source);
 
     List<SysPcAddress> getOnlinePeople();
+
+    BasePageResult<SysPcAddressHistory> queryPcAddressHistoryInfo(PcAddressInfoDto addressInfoDto);
 }

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

@@ -85,6 +85,6 @@ public interface SysUserLinkPtlAgreementService extends IService<SysUserLinkPtlA
      *  @Date: 2024/07/23
      *  @Description: 查询审核的所有协议  协议名称拼接
      */
-    List<PtlAgreement> findPtlAgreementListNew();
+    List<PtlAgreement> findPtlAgreementListNew(String type);
 
 }

+ 5 - 0
src/main/java/com/ydtech/modules/admin/service/SysUserService.java

@@ -242,6 +242,11 @@ public interface SysUserService extends BaseIService<SysUser> {
      * @return
      */
     List<String> getTelemarketingPersonnelData();
+    /**
+     * 获取当前用户的下级所有人员
+     * @return
+     */
+    List<SysUser> findNextTree();
 
 
 }

+ 2 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysAgencyLeaderServiceImpl.java

@@ -329,6 +329,8 @@ public class SysAgencyLeaderServiceImpl extends ServiceImpl<SysAgencyLeaderMappe
         Page<SysAgencyLeader> page = new Page<>(sysAgencyLeaderPageDto.getPageNum(), sysAgencyLeaderPageDto.getPageSize());
         LambdaQueryWrapper<SysAgencyLeader> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(SysAgencyLeader::getDelFlag, 1);
+        wrapper.like(StringUtils.isNotEmpty(sysAgencyLeaderPageDto.getUserId()),SysAgencyLeader::getUserId,sysAgencyLeaderPageDto.getUserId());
+        wrapper.like(StringUtils.isNotEmpty(sysAgencyLeaderPageDto.getUserName()),SysAgencyLeader::getUserName,sysAgencyLeaderPageDto.getUserName());
         wrapper.likeRight(!StringUtils.isNullOrEmpty(sysAgencyLeaderPageDto.getDeptId()), SysAgencyLeader::getDeptId, sysAgencyLeaderPageDto.getDeptId());
         wrapper.orderByDesc(SysAgencyLeader::getId);
 

+ 90 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysDeptServiceImpl.java

@@ -14,6 +14,7 @@ import com.ydtech.modules.admin.dao.SysAreaMapper;
 import com.ydtech.modules.admin.dao.SysDeptMapper;
 import com.ydtech.modules.admin.model.SysArea;
 import com.ydtech.modules.admin.model.SysDept;
+import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesMonthVo;
 import com.ydtech.modules.admin.model.vo.SysDeptRemoveVo;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.po.SysUserTreeShowLevel;
@@ -33,6 +34,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.ObjectUtils;
 
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 
@@ -649,7 +651,95 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept>
         String managementSourceDept = sysDeptMapper.getByOrderNoQueryManagementSource(orderNo);
         return managementSource.equals(managementSourceDept);
     }
+    /**
+     * 数据权限机构数
+     * @return
+     */
+    @Override
+    public List<SysDept> getDataDeptTree(List<String> deptIds) {
+        String name = BaseController.getUser().getName();
+        List<SysDept> result = new ArrayList<>();
+        if(!deptIds.isEmpty()){
+            List<SysDept> deptList = sysDeptMapper.getListByIds(deptIds);
+            // 使用一个Map来快速查找部门节点
+            Map<String, SysDept> deptMap = new HashMap<>();
+            for (SysDept dept : deptList) {
+                deptMap.put(dept.getId(), dept);
+            }
+            // 找出顶级部门(即没有父部门的部门)
+            for (SysDept dept : deptList) {
+                if (dept.getParentId() == null || deptMap.get(dept.getParentId()) == null) {
+                    // 添加到结果列表并构建其子树
+                    buildDeptTree(dept, deptMap);
+                    result.add(dept);
+                }
+            }
 
+        } else if ("admin".equals(name)) {
+           String  deptId ="9";
+            if(deptId==null || "".equals(deptId)){
+                deptId="9";
+            }else{
+                //如果是平台下判断包含D的查询上级id
+                if(deptId.contains("D")){
+                    SysDept dept = baseMapper.selectById(deptId);
+                    deptId =dept==null?"":dept.getParentId();
+                }
+            }
+            LambdaQueryWrapper<SysDept> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper.eq(SysDept::getDelFlag, 0);
+            // 获取当前操作用户
+            SysUser user = BaseController.getUser();
+            String userId = user.getId();
+
+            // 根据用户ID查询用户的部门树展示级别
+            LambdaQueryWrapper<SysUserTreeShowLevel> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+            lambdaQueryWrapper.eq(SysUserTreeShowLevel::getUserId, userId);
+            SysUserTreeShowLevel treeShowLevel = sysUserTreeShowLevelService.getOne(lambdaQueryWrapper);
+
+            List<SysDept> treeByShowLevel = new ArrayList<>();
+            //如果当前用户未配置树展示等级,则默认为查询全部
+            if (Objects.isNull(treeShowLevel)) {
+                treeShowLevel = new SysUserTreeShowLevel();
+                treeShowLevel.setShowLevel("subordinate");
+            }
+            // 如果指定的部门ID为空或特定值,则使用当前用户所在部门ID
+            if (null == deptId || "".equals(deptId) || "undefined".equals(deptId)) {
+                if (!treeShowLevel.getShowLevel().equals("all")) {
+                    deptId = user.getDeptId();
+                } else {
+                    deptId = "9";
+                }
+            }
+            // 根据用户的部门树展示级别查询相应的部门树
+            switch (treeShowLevel.getShowLevel()) {
+                case "all":
+                    treeByShowLevel = findTreeByShowLevel(deptId, null, "all");
+                    break;
+                case "same":
+                    treeByShowLevel = findTreeByShowLevel(deptId, null, "same");
+                    break;
+                case "subordinate":
+                    treeByShowLevel = findTreeByShowLevel(deptId, null, "subordinate");
+                    break;
+            }
+            return treeByShowLevel;
+        }
+        return result;
+    }
+
+    private void buildDeptTree(SysDept dept, Map<String, SysDept> deptMap) {
+        List<SysDept> children = new ArrayList<>();
+        dept.setChildren(children);
+
+        // 查找并添加子部门
+        for (SysDept potentialChild : deptMap.values()) {
+            if (potentialChild.getParentId() != null && potentialChild.getParentId().equals(dept.getId())) {
+                children.add(potentialChild);
+                buildDeptTree(potentialChild, deptMap); // 递归构建子部门的子树
+            }
+        }
+    }
 }
 
 

+ 89 - 16
src/main/java/com/ydtech/modules/admin/service/impl/SysGeographyPositionServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.modules.admin.dao.SysDeptMapper;
@@ -24,6 +25,7 @@ import com.ydtech.utils.StringUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -230,23 +232,94 @@ public class SysGeographyPositionServiceImpl extends ServiceImpl<SysGeographyPos
     }
 
     @Override
-    public PcAddressHistoryInfoVo getGeographyPosition(String dates) {
-        PcAddressHistoryInfoVo pcAddressHistoryInfoVo = new PcAddressHistoryInfoVo();
-        QueryWrapper<SysGeographyPositionRecord> queryWrapper = new QueryWrapper<>();
-        // 指定 COUNT(DISTINCT user_id) 查询
-        queryWrapper.select("COUNT(DISTINCT user_id) AS total").likeRight(StringUtils.isNotEmpty(dates), "create_time", dates)
-                .in("source", Arrays.asList(1, 2));
-        Map<String, Object> result = sysGeographyPositionRecordService.getMap(queryWrapper);
-        Long total = (Long) result.get("total");
-        pcAddressHistoryInfoVo.setOnlineNum(total);
-        if (StringUtils.isNullOrEmpty(dates)) {
-            Date date = new Date();
-            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            dates = simpleDateFormat.format(date);
+    public BasePageResult<SysGeographyPositionInfoVo> queryGeographyRecord(PcAddressInfoDto addressInfoDto) {
+        Page page = new Page(addressInfoDto.getPageNum(), addressInfoDto.getPageSize());
+        IPage<SysGeographyPositionInfoVo> sysGeographyPositionList = sysGeographyPositionRecordMapper.queryGeographyHistory(page,addressInfoDto);
+        List<SysGeographyPositionInfoVo> records = sysGeographyPositionList.getRecords();
+        //填充机构名
+        for (SysGeographyPositionInfoVo sysGeographyPositionInfoVo : records) {
+            SysUser sysUser = sysUserService.getById(sysGeographyPositionInfoVo.getUserId());
+            if (sysUser == null) continue;
+            SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
+                    .eq(SysDept::getId, sysUser.getDeptId()).eq(SysDept::getDelFlag, 0));
+            if (sysDept == null) continue;
+            sysGeographyPositionInfoVo.setDeptName(sysDept.getName());
+        }
+
+        return new BasePageResult<>(addressInfoDto.getPageNum(), addressInfoDto.getPageSize(), sysGeographyPositionList.getTotal(), sysGeographyPositionList.getPages(),
+                records);
+    }
+
+    @Override
+    public AppGeographyHistoryInfoVo getGeographyPosition(String startTime, String endTime, String source) {
+        AppGeographyHistoryInfoVo appGeographyHistoryInfoVo = new AppGeographyHistoryInfoVo();
+        if (StringUtils.isEmpty(startTime) || startTime.equals(endTime)) {
+
+            if (StringUtils.isNullOrEmpty(startTime)) {
+                Date date = new Date();
+                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                startTime = simpleDateFormat.format(date);
+            }
+            QueryWrapper<SysGeographyPositionRecord> queryWrapper = new QueryWrapper<>();
+            // 指定 COUNT(DISTINCT user_id) 查询
+            queryWrapper.select("COUNT(DISTINCT user_id) AS total")
+                    .likeRight(StringUtils.isNotEmpty(startTime), "create_time", startTime)
+                    .in("source", Arrays.asList(1, 2))
+                    .eq(StringUtils.isNotEmpty(source),"source",source);;
+            Map<String, Object> result = sysGeographyPositionRecordService.getMap(queryWrapper);
+            Long total = (Long) result.get("total");
+            appGeographyHistoryInfoVo.setOnlineNum(total);
+            List<PcAddressHistoryTimeVo> geographyPosition = sysGeographyPositionRecordMapper.getGeographyPosition(startTime,source);
+            appGeographyHistoryInfoVo.setList(geographyPosition);
+
+            List<SysGeographyPositionRecord> sysGeographyPositionRecords =sysGeographyPositionRecordMapper.getGeographyPositionRecord(startTime,source);
+            System.out.println("********************" + sysGeographyPositionRecords.size());
+            appGeographyHistoryInfoVo.setPositionRecordList(sysGeographyPositionRecords);
+        }else {
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            startTime = startTime + " 00:00:01";
+            endTime = endTime + " 23:59:59";
+            try {
+                Date parse = simpleDateFormat.parse(startTime);
+                Date parse1 = simpleDateFormat.parse(endTime);
+                startTime = simpleDateFormat.format(parse);
+                endTime = simpleDateFormat.format(parse1);
+
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+            QueryWrapper<SysGeographyPositionRecord> queryWrapper = new QueryWrapper<>();
+            queryWrapper.select("COUNT(DISTINCT user_id) AS total")
+                    .between("create_time", startTime, endTime)
+                    .in("source", Arrays.asList(1, 2))
+                    .eq(StringUtils.isNotEmpty(source),"source",source);;
+            Map<String, Object> result = sysGeographyPositionRecordService.getMap(queryWrapper);
+            Long total = (Long) result.get("total");
+            appGeographyHistoryInfoVo.setOnlineNum(total);
+
+            List<PcAddressHistoryTimeVo> geographyPosition = sysGeographyPositionRecordMapper.getGeographyPositionSection(startTime,endTime,source);
+            appGeographyHistoryInfoVo.setList(geographyPosition);
+
+            List<SysGeographyPositionRecord> sysGeographyPositionRecords =sysGeographyPositionRecordMapper.getGeographyPositionHistory(startTime,endTime,source);
+            for (SysGeographyPositionRecord sysGeographyPositionRecord : sysGeographyPositionRecords) {
+
+                SysUser sysUser = sysUserService.getById(sysGeographyPositionRecord.getUserId());
+                if (sysUser == null) continue;
+                SysDept sysDept = sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>()
+                        .eq(SysDept::getId, sysUser.getDeptId()).eq(SysDept::getDelFlag, 0));
+                if (sysDept == null) continue;
+                sysGeographyPositionRecord.setDeptName(sysDept.getName());
+
+                SysGeographyPosition sysGeographyPosition = sysGeographyPositionMapper.selectOne(new LambdaQueryWrapper<SysGeographyPosition>()
+                        .eq(SysGeographyPosition::getId,sysGeographyPositionRecord.getUserId()));
+                sysGeographyPositionRecord.setLeaderName(sysGeographyPosition.getLeaderName());
+            }
+            System.out.println("********************" + sysGeographyPositionRecords.size());
+            appGeographyHistoryInfoVo.setPositionRecordList(sysGeographyPositionRecords);
+
         }
-        List<PcAddressHistoryTimeVo> geographyPosition = sysGeographyPositionRecordMapper.getGeographyPosition(dates);
-        pcAddressHistoryInfoVo.setList(geographyPosition);
-        return pcAddressHistoryInfoVo;
+
+        return appGeographyHistoryInfoVo;
     }
 
     @Override

+ 2 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysPartnerServiceImpl.java

@@ -112,6 +112,8 @@ public class SysPartnerServiceImpl extends ServiceImpl<SysPartnerMapper, SysPart
         }
         LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(SysUser::getStatus, 1);
+        wrapper.like(StringUtils.isNotEmpty(sysPartnerPageDto.getUserId()),SysUser::getId, sysPartnerPageDto.getUserId());
+        wrapper.like(StringUtils.isNotEmpty(sysPartnerPageDto.getUserName()),SysUser::getName, sysPartnerPageDto.getUserName());
         wrapper.likeRight(StringUtils.isNotEmpty(sysPartnerPageDto.getDeptId()), SysUser::getId, sysPartnerPageDto.getDeptId());
         wrapper.notLike(SysUser::getId, "M");
         wrapper.notIn(CollectionUtil.isNotEmpty(stringList), SysUser::getId, stringList);

+ 75 - 23
src/main/java/com/ydtech/modules/admin/service/impl/SysPcAddressServiceImpl.java

@@ -3,6 +3,7 @@ package com.ydtech.modules.admin.service.impl;
 import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.modules.admin.dao.SysDeptMapper;
@@ -28,6 +29,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -95,7 +97,7 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getDistrict()), SysPcAddress::getDistrict, sysPcAddressDto.getDistrict())
                 .in(SysPcAddress::getSource, Arrays.asList("1", "2"))
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getSource()), SysPcAddress::getSource, sysPcAddressDto.getSource())
-                .eq(sysPcAddressDto.getStatus()!=null, SysPcAddress::getStatus, sysPcAddressDto.getStatus())
+                .eq(sysPcAddressDto.getStatus() != null, SysPcAddress::getStatus, sysPcAddressDto.getStatus())
                 .orderByDesc(SysPcAddress::getOperationTime));
 
         return sysPcAddresses;
@@ -121,27 +123,27 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getCity()), SysPcAddress::getCity, sysPcAddressDto.getCity())
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getDistrict()), SysPcAddress::getDistrict, sysPcAddressDto.getDistrict())
                 .in(SysPcAddress::getSource, Arrays.asList("1", "2"))
-                .eq(sysPcAddressDto.getStatus()!=null, SysPcAddress::getStatus, sysPcAddressDto.getStatus()));
+                .eq(sysPcAddressDto.getStatus() != null, SysPcAddress::getStatus, sysPcAddressDto.getStatus()));
         Long channelNum = sysPcAddressMapper.selectCount(new LambdaQueryWrapper<SysPcAddress>()
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getProvince()), SysPcAddress::getProvince, sysPcAddressDto.getProvince())
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getCity()), SysPcAddress::getCity, sysPcAddressDto.getCity())
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getDistrict()), SysPcAddress::getDistrict, sysPcAddressDto.getDistrict())
                 .eq(SysPcAddress::getSource, 1)
-                .eq(sysPcAddressDto.getStatus()!=null, SysPcAddress::getStatus, sysPcAddressDto.getStatus()));
+                .eq(sysPcAddressDto.getStatus() != null, SysPcAddress::getStatus, sysPcAddressDto.getStatus()));
         Long proxyNum = sysPcAddressMapper.selectCount(new LambdaQueryWrapper<SysPcAddress>()
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getProvince()), SysPcAddress::getProvince, sysPcAddressDto.getProvince())
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getCity()), SysPcAddress::getCity, sysPcAddressDto.getCity())
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getDistrict()), SysPcAddress::getDistrict, sysPcAddressDto.getDistrict())
                 .eq(SysPcAddress::getSource, 2)
-                .eq(sysPcAddressDto.getStatus()!=null, SysPcAddress::getStatus, sysPcAddressDto.getStatus()));
+                .eq(sysPcAddressDto.getStatus() != null, SysPcAddress::getStatus, sysPcAddressDto.getStatus()));
 
         Long onlineNum = sysPcAddressMapper.selectCount(new LambdaQueryWrapper<SysPcAddress>()
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getProvince()), SysPcAddress::getProvince, sysPcAddressDto.getProvince())
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getCity()), SysPcAddress::getCity, sysPcAddressDto.getCity())
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getDistrict()), SysPcAddress::getDistrict, sysPcAddressDto.getDistrict())
                 .in(SysPcAddress::getSource, Arrays.asList("1", "2"))
-                .eq(sysPcAddressDto.getStatus()==null,SysPcAddress::getStatus, 1)
-                .eq(sysPcAddressDto.getStatus()!=null, SysPcAddress::getStatus, sysPcAddressDto.getStatus()));
+                .eq(sysPcAddressDto.getStatus() == null, SysPcAddress::getStatus, 1)
+                .eq(sysPcAddressDto.getStatus() != null, SysPcAddress::getStatus, sysPcAddressDto.getStatus()));
 
 
         sysPcAddressNumVo.setAllNum(all);
@@ -162,7 +164,7 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getDistrict()), SysPcAddress::getDistrict, sysPcAddressDto.getDistrict())
                 .in(SysPcAddress::getSource, Arrays.asList("1", "2"))
                 .eq(StringUtils.isNotEmpty(sysPcAddressDto.getSource()), SysPcAddress::getSource, sysPcAddressDto.getSource())
-                .eq(sysPcAddressDto.getStatus()!=null, SysPcAddress::getStatus, sysPcAddressDto.getStatus()));
+                .eq(sysPcAddressDto.getStatus() != null, SysPcAddress::getStatus, sysPcAddressDto.getStatus()));
 
         if (CollectionUtil.isEmpty(sysPcAddresses)) return regionInfoVos;
 
@@ -199,7 +201,7 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
         wrapper.eq(StringUtils.isNotEmpty(addressInfoDto.getLat()), SysPcAddress::getLatitude, addressInfoDto.getLat());
         wrapper.in(SysPcAddress::getSource, Arrays.asList("1", "2"));
         wrapper.eq(StringUtils.isNotEmpty(addressInfoDto.getSource()), SysPcAddress::getSource, addressInfoDto.getSource());
-        wrapper.eq(addressInfoDto.getStatus()!=null, SysPcAddress::getStatus, addressInfoDto.getStatus());
+        wrapper.eq(addressInfoDto.getStatus() != null, SysPcAddress::getStatus, addressInfoDto.getStatus());
         wrapper.orderByDesc(SysPcAddress::getOperationTime);
 
         Page<SysPcAddress> insOrdersPage = page(page, wrapper);
@@ -209,32 +211,82 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
     }
 
     @Override
-    public PcAddressHistoryInfoVo getPcAddress(String dates) {
+    public PcAddressHistoryInfoVo getPcAddress(String startTime, String endTime, String source) {
         PcAddressHistoryInfoVo pcAddressHistoryInfoVo = new PcAddressHistoryInfoVo();
-        QueryWrapper<SysPcAddressHistory> queryWrapper = new QueryWrapper<>();
-        // 指定 COUNT(DISTINCT user_id) 查询
-        queryWrapper.select("COUNT(DISTINCT user_id) AS total").likeRight(StringUtils.isNotEmpty(dates), "operation_time", dates)
-                .in("source", Arrays.asList(1, 2));
-        Map<String, Object> result = sysPcAddressHistoryService.getMap(queryWrapper);
-        Long total = (Long) result.get("total");
-        pcAddressHistoryInfoVo.setOnlineNum(total);
-        if (StringUtils.isNullOrEmpty(dates)) {
-            Date date = new Date();
-            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            dates = simpleDateFormat.format(date);
+        if (StringUtils.isEmpty(startTime) || startTime.equals(endTime)) {
+            if (StringUtils.isNullOrEmpty(startTime)) {
+                Date date = new Date();
+                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
+                startTime = simpleDateFormat.format(date);
+            }
+            QueryWrapper<SysPcAddressHistory> queryWrapper = new QueryWrapper<>();
+            // 指定 COUNT(DISTINCT user_id) 查询
+            queryWrapper.select("COUNT(DISTINCT user_id) AS total")
+                    .likeRight(StringUtils.isNotEmpty(startTime), "operation_time", startTime)
+                    .in("source", Arrays.asList(1, 2))
+                    .eq(StringUtils.isNotEmpty(source),"source",source);
+            Map<String, Object> result = sysPcAddressHistoryService.getMap(queryWrapper);
+            Long total = (Long) result.get("total");
+            pcAddressHistoryInfoVo.setOnlineNum(total);
+
+            List<PcAddressHistoryTimeVo> pcAddress = sysPcAddressHistoryMapper.getPcAddress(startTime,source);
+            pcAddressHistoryInfoVo.setList(pcAddress);
+
+            List<SysPcAddressHistory> sysPcAddressHistories = sysPcAddressHistoryMapper.getPcAddressInfo(startTime,source);
+            System.out.println("********************" + sysPcAddressHistories.size());
+            pcAddressHistoryInfoVo.setPcAddressList(sysPcAddressHistories);
+
+
+        } else {
+            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            startTime = startTime + " 00:00:01";
+            endTime = endTime + " 23:59:59";
+            try {
+                Date parse = simpleDateFormat.parse(startTime);
+                Date parse1 = simpleDateFormat.parse(endTime);
+                startTime = simpleDateFormat.format(parse);
+                endTime = simpleDateFormat.format(parse1);
+
+            } catch (ParseException e) {
+                throw new RuntimeException(e);
+            }
+            QueryWrapper<SysPcAddressHistory> queryWrapper = new QueryWrapper<>();
+            // 指定 COUNT(DISTINCT user_id) 查询
+            queryWrapper.select("COUNT(DISTINCT user_id) AS total").between("operation_time", startTime, endTime)
+                    .in("source", Arrays.asList(1, 2)).eq(StringUtils.isNotEmpty(source),"source",source);
+            Map<String, Object> result = sysPcAddressHistoryService.getMap(queryWrapper);
+            Long total = (Long) result.get("total");
+            pcAddressHistoryInfoVo.setOnlineNum(total);
+
+            List<PcAddressHistoryTimeVo> pcAddress = sysPcAddressHistoryMapper.getPcAddressSection(startTime, endTime,source);
+
+            pcAddressHistoryInfoVo.setList(pcAddress);
+
+            List<SysPcAddressHistory> sysPcAddressHistories = sysPcAddressHistoryMapper.getPcAddressHistory(startTime, endTime,source);
+            System.out.println("********************" + sysPcAddressHistories.size());
+            pcAddressHistoryInfoVo.setPcAddressList(sysPcAddressHistories);
         }
-        List<PcAddressHistoryTimeVo> pcAddress = sysPcAddressHistoryMapper.getPcAddress(dates);
-        pcAddressHistoryInfoVo.setList(pcAddress);
 
         return pcAddressHistoryInfoVo;
     }
 
     @Override
     public List<SysPcAddress> getOnlinePeople() {
-        return sysPcAddressMapper.selectList(new LambdaQueryWrapper<SysPcAddress>().eq(SysPcAddress::getStatus,1));
+        return sysPcAddressMapper.selectList(new LambdaQueryWrapper<SysPcAddress>().eq(SysPcAddress::getStatus, 1));
+    }
+
+    @Override
+    public BasePageResult<SysPcAddressHistory> queryPcAddressHistoryInfo(PcAddressInfoDto addressInfoDto) {
+        Page page = new Page(addressInfoDto.getPageNum(), addressInfoDto.getPageSize());
+
+        IPage<SysPcAddressHistory> sysPcAddressHistoryIPage=sysPcAddressHistoryMapper.queryAddressHistory(page,addressInfoDto);
+
+        return new BasePageResult<>(addressInfoDto.getPageNum(), addressInfoDto.getPageSize(), sysPcAddressHistoryIPage.getTotal(), sysPcAddressHistoryIPage.getPages(),
+                sysPcAddressHistoryIPage.getRecords());
     }
 
 
+
 }
 
 

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

@@ -131,9 +131,10 @@ public class SysUserLinkPtlAgreementServiceImpl extends ServiceImpl<SysUserLinkP
      *  @Description: 查询审核的所有协议  协议名称拼接
      */
     @Override
-    public List<PtlAgreement> findPtlAgreementListNew() {
+    public List<PtlAgreement> findPtlAgreementListNew(String type) {
         //预留查询条件后期添加
         PtlAgreement param =new PtlAgreement();
+        param.setAgreementType(type);
         return ptlAgreementService.findCheckAgreementListNew(param);
     }
     /**

+ 21 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysUserServiceImpl.java

@@ -1611,4 +1611,25 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         return baseMapper.getTelemarketingPersonnelUserId();
     }
 
+    @Override
+    public List<SysUser> findNextTree() {
+//        findTree
+        // 获取当前登录用户
+        SysUser user = BaseController.getUser();
+        if ("admin".equals(user.getName())) {
+            return this.findTree();
+        } else {
+            //获取领导字段不为空的人的ID
+            List<SysUser> users = lambdaQuery().isNotNull(SysUser::getLeaderId).list();
+            if (users == null || users.size() == 0) {
+                return new ArrayList<>();
+            }
+            List<SysUser> topUsers = new ArrayList<>(); //存放1级用户,即没有直接上级的用户
+            // 根据组织结构展示级别,筛选顶层节点并构建组织结构树
+            topUsers.add(user);
+            // 递归构建用户树结构
+            buildUserTree(topUsers, users);
+            return topUsers;
+        }
+    }
 }

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

@@ -270,7 +270,7 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
                 taskStatisticsVo.setDateType("2");
             } else if ("30".equals(taskStatisticsVo.getDays())) {
                 taskStatisticsVo.setDateType("3");
-            } else {
+            } else if ("1".equals(taskStatisticsVo.getDays())){
                 taskStatisticsVo.setDateType("1");
             }
         }

+ 44 - 23
src/main/java/com/ydtech/modules/admin/utils/KztGetDeptUtils.java

@@ -5,7 +5,11 @@ import com.ydtech.modules.admin.dao.KztDataPermissionMapper;
 import com.ydtech.modules.admin.dao.SysUserDeptRelationshipMapper;
 import com.ydtech.modules.admin.model.po.KztDataPermission;
 import com.ydtech.modules.admin.model.po.SysUserDeptRelationship;
+import com.ydtech.modules.admin.model.po.SysUserTreeShowLevel;
+import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
+import com.ydtech.modules.admin.service.SysUserService;
 import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.esm.service.EsmUserReferrerService;
 import com.ydtech.utils.StringUtils;
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.BeanUtils;
@@ -28,42 +32,59 @@ public class KztGetDeptUtils {
     private SysUserDeptRelationshipMapper sysUserDeptRelationshipMapper;
     @Autowired
     private KztDataPermissionMapper kztDataPermissionMapper;
+    @Autowired
+    private SysUserService sysUserService;
+    @Autowired
+    private EsmUserReferrerService  esmUserReferrerService;
 
 
 
-    public List<String> KztGetDeptIds(String requestURL) {
+    public KztGetDeptUtilsDto KztGetDeptIds(String requestURL) {
         try {
             ApplicationContext applicationContext = SpringContextUtil.getApplicationContext();
-            SysUserDeptRelationshipMapper bean = applicationContext.getBean(SysUserDeptRelationshipMapper.class);
-            ApplicationContext applicationContext2 = SpringContextUtil.getApplicationContext();
-            KztDataPermissionMapper bean1 = applicationContext2.getBean(KztDataPermissionMapper.class);
-
+            SysUserDeptRelationshipMapper userDeptMapper = applicationContext.getBean(SysUserDeptRelationshipMapper.class);
+            KztDataPermissionMapper dataPermissionMapper = applicationContext.getBean(KztDataPermissionMapper.class);
 
             URI uri = new URI(requestURL);
             String path = uri.getPath();
-            QueryWrapper<KztDataPermission> queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("url", path);
+            KztDataPermission kztDataPermissions = dataPermissionMapper.selectOne(new QueryWrapper<KztDataPermission>().eq("url", path));
 
-            KztDataPermission kztDataPermissions = bean1.selectOne(queryWrapper);
-            String userId = BaseController.getUserId();
-            if (ObjectUtils.isNotEmpty(kztDataPermissions)) {
-                QueryWrapper<SysUserDeptRelationship> relationshipQueryWrapper = new QueryWrapper<>();//用户权限关系表
-                relationshipQueryWrapper.eq("user_id", userId);
-                List<SysUserDeptRelationship> sysUserDeptRelationships = bean.selectList(relationshipQueryWrapper);
-                if (sysUserDeptRelationships.isEmpty()) {
-                    return new ArrayList<>();
-                }
-                String dataPermissionId = kztDataPermissions.getDataPermissionId();
-                if (StringUtils.isNotEmpty(dataPermissionId)) {
-                    if ("1".equals(dataPermissionId)) {
-                        List<String> collect = sysUserDeptRelationships.stream().map(SysUserDeptRelationship::getDeptId).collect(Collectors.toList());
-                        return collect;
-                    }
+            if (kztDataPermissions != null) {
+                String userId = BaseController.getUserId();
+                String userName = BaseController.getUserName();
+                if(!"admin".equals(userName)){
+                    String dataPermissionId = kztDataPermissions.getDataPermissionId();
+                    KztGetDeptUtilsDto resultDto = handleDataPermission(userId, dataPermissionId, userDeptMapper);
+                    return resultDto;
                 }
             }
         } catch (URISyntaxException e) {
+            // 可以选择抛出自定义异常或记录更详细的日志
             e.printStackTrace();
         }
-        return new ArrayList<>();
+        return new KztGetDeptUtilsDto(); // 返回一个空的DTO或设置默认值的DTO
+    }
+
+    private KztGetDeptUtilsDto handleDataPermission(String userId, String dataPermissionId, SysUserDeptRelationshipMapper userDeptMapper) {
+        KztGetDeptUtilsDto resultDto = new KztGetDeptUtilsDto();
+        if ("1".equals(dataPermissionId)) {
+            List<SysUserDeptRelationship> relationships = userDeptMapper.selectList(new QueryWrapper<SysUserDeptRelationship>().eq("user_id", userId));
+            if (!relationships.isEmpty()) {
+                List<String> deptIds = relationships.stream().map(SysUserDeptRelationship::getDeptId).collect(Collectors.toList());
+                resultDto.setIds(deptIds);
+                resultDto.setType("1");
+            }
+        } else if ("3".equals(dataPermissionId)) {
+            ApplicationContext applicationContext = SpringContextUtil.getApplicationContext();
+            EsmUserReferrerService dataPermissionMapper = applicationContext.getBean(EsmUserReferrerService.class);
+
+            List<String> ids = new ArrayList<>();
+            List<String> userList = dataPermissionMapper.getUpUser(userId,ids); // 假设此方法直接返回用户列表
+            if (!userList.isEmpty()) {
+                resultDto.setIds(userList);
+                resultDto.setType("2");
+            }
+        }
+        return resultDto;
     }
 }

+ 12 - 2
src/main/java/com/ydtech/modules/esm/controller/EsmInsCompanyController.java

@@ -247,6 +247,16 @@ public class EsmInsCompanyController extends BaseController {
         List<EsmInsCompany> esmInsCompanyList = esmInsCompanyService.queryListByParentId(parentId);
         return HttpResult.ok(esmInsCompanyList);
     }
-
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 16:22
+     *  @Description: 查询子订单中的保险公司列表
+     */
+    @ApiOperation(value = "查询子订单中的保险公司列表")
+    @GetMapping(value = "/findOrderCompanyList")
+    public HttpResult<List<EsmInsCompanyResVo>> findOrderCompanyList() {
+        List<EsmInsCompanyResVo> esmInsCompanyList = esmInsCompanyService.findOrderCompanyList();
+        return HttpResult.ok(esmInsCompanyList);
+    }
 }

+ 8 - 1
src/main/java/com/ydtech/modules/esm/dao/EsmInsCompanyMapper.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.esm.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ydtech.modules.esm.model.EsmInsCompany;
+import com.ydtech.modules.esm.model.vo.res.EsmInsCompanyResVo;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
@@ -28,5 +29,11 @@ public interface EsmInsCompanyMapper extends BaseMapper<EsmInsCompany> {
 
 
     List<EsmInsCompany> queryListByParentId( @Param("parentId") String parentId);
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 16:24
+     *  @Description: 查询订单下的保险公司列表
+     */
+    List<EsmInsCompanyResVo> findOrderCompanyList();
 }

+ 8 - 0
src/main/java/com/ydtech/modules/esm/service/EsmInsCompanyService.java

@@ -4,6 +4,7 @@ package com.ydtech.modules.esm.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.model.vo.req.EsmInsCompanyReq;
+import com.ydtech.modules.esm.model.vo.res.EsmInsCompanyResVo;
 
 import java.util.List;
 
@@ -68,6 +69,13 @@ public interface EsmInsCompanyService extends IService<EsmInsCompany> {
     List<String> getInsCompanyNextLevel(String companyId);
 
     List<EsmInsCompany> queryListByParentId(String parentId);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 16:23
+     *  @Description:  查询子订单中的保险公司列表
+     */
+    List<EsmInsCompanyResVo> findOrderCompanyList();
 }
 
 

+ 11 - 0
src/main/java/com/ydtech/modules/esm/service/impl/EsmInsCompanyServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.modules.esm.dao.EsmInsCompanyMapper;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.model.vo.req.EsmInsCompanyReq;
+import com.ydtech.modules.esm.model.vo.res.EsmInsCompanyResVo;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import com.ydtech.utils.StringUtils;
@@ -171,6 +172,16 @@ public class EsmInsCompanyServiceImpl extends ServiceImpl<EsmInsCompanyMapper, E
         List<EsmInsCompany>  resultList=baseMapper.queryListByParentId(parentId);
         return resultList;
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 16:23
+     *  @Description: 查询子订单中的保险公司列表
+     */
+    @Override
+    public List<EsmInsCompanyResVo> findOrderCompanyList() {
+        return baseMapper.findOrderCompanyList();
+    }
 }
 
 

+ 31 - 0
src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java

@@ -2,18 +2,23 @@ package com.ydtech.modules.fnc.controller;
 
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTCompanyDto;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.SettlementDocumentaryFeesEntity;
 import com.ydtech.modules.fnc.service.ImportAsyncService;
 import com.ydtech.modules.fnc.service.InsPlyIncomeService;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeIdsVo;
+import com.ydtech.modules.fnc.vo.InsPlyIncomePTVo;
+import com.ydtech.modules.fnc.vo.InsPlyIncomeQueryPTVo;
 import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
 import com.ydtech.modules.inv.model.dto.InsBxNoPlyIncomeExcelDto;
 import com.ydtech.modules.inv.model.dto.InsBxOtherExcelDto;
 import com.ydtech.modules.inv.model.dto.InsBxPlyIncomeExcelDto;
 import com.ydtech.modules.inv.model.dto.InsNoBxOtherExcelDto;
 import com.ydtech.modules.order.entity.BasePageResult;
+import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.utils.SnowFlakeUtil;
 import com.ydtech.utils.StringUtils;
 import com.ydtech.utils.excel.ExcelEasypoiUtils;
@@ -510,6 +515,32 @@ public class InsPlyIncomeController extends BaseController {
     public HttpResult<List<InsPlyIncome>> createData(@RequestBody InsPlyIncomeIdsVo insPlyIncomeIdsVo) {
         return insPlyIncomeService.createData(insPlyIncomeIdsVo);
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 9:51
+     *  @Description:  平台结算情况接口
+     */
+    @PostMapping("/totalPTAmount")
+    @ApiOperation(value = "平台结算情况接口")
+    public HttpResult<List<InsPlyIncomePTDto>> totalPTAmount(@RequestBody InsPlyIncomePTVo insPlyIncomeVo) {
+        List<InsPlyIncomePTDto> result = insPlyIncomeService.totalPTAmount(insPlyIncomeVo);
+        return HttpResult.ok(result);
+    }
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 10:53
+     *  @Description: 通过结算人查询数据
+     */
+    @PostMapping("/findListByDockingPerson")
+    @ApiOperation(value = "平台结算情况接口详情")
+    public HttpResult<List<InsPlyIncomePTCompanyDto>> findListByDockingPerson(@RequestBody InsPlyIncomeQueryPTVo insPlyIncomeVo) {
+        List<InsPlyIncomePTCompanyDto> result = insPlyIncomeService.findListByDockingPerson(insPlyIncomeVo);
+        return HttpResult.ok(result);
+    }
+
 }
 
 

+ 24 - 3
src/main/java/com/ydtech/modules/fnc/dao/InsPlyIncomeMapper.java

@@ -1,15 +1,16 @@
 package com.ydtech.modules.fnc.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.admin.model.report.financialReceivables.*;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisDto;
 import com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisQueryDto;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTCompanyDto;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTDto;
 import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
-import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
-import com.ydtech.modules.fnc.vo.InsPlySettleVo;
-import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
+import com.ydtech.modules.fnc.vo.*;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -203,5 +204,25 @@ public interface InsPlyIncomeMapper extends BaseMapper<InsPlyIncome> {
     Collection<? extends FinancialReceivablesVo> queryDateByTypePt( @Param("vo") FinancialReceivablesQueryVo financialReceivablesQueryVo);
 
     List<FinancialReceivablesMonthVo> getPatherId( @Param("vo")  FinancialReceivablesQueryMonthVo financialReceivablesQueryVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 9:59
+     *  @Description:  平台结算情况
+     */
+    List<InsPlyIncomePTDto> totalPTAmount(@Param("vo")  InsPlyIncomePTVo insPlyIncomeVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 11:04
+     *  @Description: 通过对接人查询数据
+     */
+    List<InsPlyIncomePTCompanyDto>  findListByDockingPerson(@Param("vo") InsPlyIncomeQueryPTVo insPlyIncomeVo);
 
+    /**
+     *
+     * @param params
+     * @return  合计金额
+     */
+    List<InsPlyIncome> totalBxAmountNew(HashMap<String, Object> params);
 }

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

@@ -7,6 +7,8 @@ import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.math.BigDecimal;
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -23,4 +25,12 @@ public interface InsuranceHandlingSettlementMonthMapper extends BaseMapper<Insur
     List<InsuranceHandlingSettlementMonthDto> queryListNew( @Param("vo") InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
 
 
+    /**
+     *
+     * @param insuranceHandlingSettlementMonthDto
+     * @return    返回结算金额  未结算 开票金额
+     */
+
+    HashMap<String, BigDecimal> getSumAmount(InsuranceHandlingSettlementMonthDto insuranceHandlingSettlementMonthDto);
+
 }

+ 36 - 0
src/main/java/com/ydtech/modules/fnc/dto/InsPlyIncomePTCompanyDto.java

@@ -0,0 +1,36 @@
+package com.ydtech.modules.fnc.dto;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/9/20 9:53
+ *  @Description: 平台结算情况列表数据
+ */
+@Data
+@ApiModel("平台结算情况列表数据")
+public class InsPlyIncomePTCompanyDto implements Serializable {
+
+
+
+    @ApiModelProperty("保险公司名称")
+    private String companyName;
+
+    @ApiModelProperty("合作公司名称")
+    private String partnerCompaniesName;
+
+    @ApiModelProperty(value = "应收金额")
+    private String sumAmount;
+
+    @ApiModelProperty(value = "已收金额")
+    private String ysAmount;
+
+    @ApiModelProperty(value = "未收金额")
+    private String wsAmount;
+}

+ 32 - 0
src/main/java/com/ydtech/modules/fnc/dto/InsPlyIncomePTDto.java

@@ -0,0 +1,32 @@
+package com.ydtech.modules.fnc.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.Min;
+import java.io.Serializable;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/9/20 9:53
+ *  @Description: 平台结算情况列表数据
+ */
+@Data
+@ApiModel("平台结算情况列表数据")
+public class InsPlyIncomePTDto implements Serializable {
+
+
+    @ApiModelProperty("对接人")
+    private String dockingPerson;
+
+    @ApiModelProperty(value = "应收金额")
+    private String sumAmount;
+
+    @ApiModelProperty(value = "已收金额")
+    private String ysAmount;
+
+    @ApiModelProperty(value = "未收金额")
+    private String wsAmount;
+}

+ 8 - 0
src/main/java/com/ydtech/modules/fnc/entity/InsPlyIncome.java

@@ -336,6 +336,10 @@ public class InsPlyIncome implements Serializable {
     @TableField("task_id")
     private String taskId;
 
+    @ApiModelProperty("开票方式 0 保司开票 1掌柜开票")
+    @TableField("invoicing_method")
+    private String invoicingMethod;
+
 
     @ApiModelProperty("总单数")
     @TableField(exist = false)
@@ -467,6 +471,10 @@ public class InsPlyIncome implements Serializable {
     @TableField(exist = false)
     private String isExternal;
 
+    @ApiModelProperty("是否外部订单")
+    @TableField("add_type")
+    private String addType;
+
 
     public InsPlyIncome(String orderno, String policyno, String syPolicyno, String noPolicyno, String settleno, String deptId, String deptName, String riskcode, LocalDateTime payDate, LocalDateTime signDate, String companyId, String companyName, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal noTaxPremium, BigDecimal commissionFeerate, BigDecimal otherFeerate, BigDecimal commissionFeevalue, BigDecimal otherFeevalue, BigDecimal allFeeValue, BigDecimal finalFeeValue, BigDecimal doingFeeValue, LocalDateTime createTime, String voucherNumber, String contractId, String contractFileId, String handlingFeesStatus, String documentaryFeesStatus, String isNotCar, String isNotDocumentary) {
         this.orderno = orderno;

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
@@ -20,6 +21,7 @@ import java.time.LocalDateTime;
 @TableName("sys_insurance_handling_settlement_month")
 @ApiModel(value = "InsuranceHandlingSettlementMonthEntity对象", description = "保险手续费结算关联表")
 @NoArgsConstructor
+@Data
 public class InsuranceHandlingSettlementMonthEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 

+ 17 - 4
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -6,14 +6,14 @@ import com.ydtech.modules.admin.model.report.financialReceivables.FinancialRecei
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesAllVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryMonthVo;
 import com.ydtech.modules.admin.model.report.financialReceivables.FinancialReceivablesQueryVo;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTCompanyDto;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTDto;
 import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.InsAreaCompany;
 import com.ydtech.modules.fnc.entity.InsPlyIncome;
 import com.ydtech.modules.fnc.entity.SettlementDocumentaryFeesEntity;
-import com.ydtech.modules.fnc.vo.InsPlyIncomeIdsVo;
-import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
-import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
+import com.ydtech.modules.fnc.vo.*;
 import com.ydtech.modules.order.entity.BasePageResult;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
@@ -215,5 +215,18 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     HttpResult<List<InsPlyIncome>> createData(InsPlyIncomeIdsVo insPlyIncomeIdsVo);
 
     List<InsuranceHandlingSettlementMonthDto> getInvociAmount(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
-
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 9:57
+     *  @Description:  平台结算情况统计
+     */
+    List<InsPlyIncomePTDto> totalPTAmount(InsPlyIncomePTVo insPlyIncomeVo);
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 11:00
+     *  @Description: 通过对接人查询结算数据
+     */
+    List<InsPlyIncomePTCompanyDto> findListByDockingPerson(InsPlyIncomeQueryPTVo insPlyIncomeVo);
 }

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

@@ -7,6 +7,8 @@ import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
 import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
 
+import java.math.BigDecimal;
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -30,5 +32,13 @@ public interface InsuranceHandlingSettlementMonthService  extends IService<Insur
 
     List<InsuranceHandlingSettlementMonthDto> getQueryLists(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
 
+    /**
+     *
+     * @param insuranceHandlingSettlementMonthDto
+     * @return    返回结算金额  未结算 开票金额
+     */
+
+    HashMap<String, BigDecimal> getSumAmount(InsuranceHandlingSettlementMonthDto insuranceHandlingSettlementMonthDto);
+
 
 }

+ 31 - 55
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alipay.api.domain.VehicleIovData;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.PageHelper;
@@ -14,21 +15,22 @@ import com.ydtech.constants.InsuranceEnum;
 import com.ydtech.constants.enums.dict.agreement.ProductsType;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
+import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.admin.model.report.financialReceivables.*;
 import com.ydtech.modules.admin.utils.SliceUpDateUtil;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.esm.model.EsmInsCompany;
+import com.ydtech.modules.esm.model.EsmInsPackage;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.fnc.dao.FncInsAreaCompanyMapper;
 import com.ydtech.modules.fnc.dao.InsPlyIncomeMapper;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTCompanyDto;
+import com.ydtech.modules.fnc.dto.InsPlyIncomePTDto;
 import com.ydtech.modules.fnc.dto.InsuranceHandlingSettlementMonthDto;
 import com.ydtech.modules.fnc.dto.PlatformSettlementRecordDto;
 import com.ydtech.modules.fnc.entity.*;
 import com.ydtech.modules.fnc.service.*;
-import com.ydtech.modules.fnc.vo.InsPlyIncomeIdsVo;
-import com.ydtech.modules.fnc.vo.InsPlyIncomeVo;
-import com.ydtech.modules.fnc.vo.InsuranceHandlingSettlementMonthVo;
-import com.ydtech.modules.fnc.vo.SettlementDocumentaryFeesVo;
+import com.ydtech.modules.fnc.vo.*;
 import com.ydtech.modules.ins.model.vo.res.*;
 import com.ydtech.modules.inv.model.dto.*;
 import com.ydtech.modules.inv.utils.EasyExcelUtils;
@@ -1298,6 +1300,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setUpdateUserId(BaseController.getUser().getId());
         insPlyIncome.setNoSuperviseCostsProportion(insPlyIncomeVo.getNoSuperviseCostsProportion());
         insPlyIncome.setAgreementId(insPlyIncomeVo.getAgreementId());
+        insPlyIncome.setAddType(insPlyIncomeVo.getAddType());
         baseMapper.updateById(insPlyIncome);
 
         InsPlyIncomeLog insPlyIncomeLog = new InsPlyIncomeLog();
@@ -1883,54 +1886,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         HashMap<String, Object> params = new HashMap<>();
         params = this.saveParams(insPlyIncomeVo, params);
         params.remove("handlingFeesStatus");
-        List<InsPlyIncome> resultList = baseMapper.totalBxAmount(params);
-        for (InsPlyIncome item : resultList) {
-            BigDecimal commissionFeevalue = BigDecimal.ZERO;  //总金额
-            BigDecimal invoicCommissionFeevalue = BigDecimal.ZERO; //开票未结算
-            BigDecimal readyCommissionFeevalue = BigDecimal.ZERO; // 已开票已结算
-            BigDecimal noInvoicCommissionFeevalue = BigDecimal.ZERO; //未开票金额
-            BigDecimal unSettledAmount; //未结算金额
-            params.put("partnerCompaniesId", item.getPartnerCompaniesId());
-            params.remove("handlingFeesStatus");
-            List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);  //金额总数
-            for (InsPlyIncome all : insPlyIncomes) {
-                commissionFeevalue = commissionFeevalue.add(all.getCommissionFeevalue());
-            }
-            //已开票金额  =  开票未结算+  开票已结算
-            params.put("handlingFeesStatus", "0"); // 开票
-            params.put("settlementStatus", "1"); // 开票
-            List<SettlementDocumentaryFeesEntity> invoicInsPlyIncomes = settlementDocumentaryFeesService.queryNew(params);  //金额总数
-            for (SettlementDocumentaryFeesEntity invoicInsPlyIncome : invoicInsPlyIncomes) {
-                BigDecimal invoicIcommissionFeevalue = invoicInsPlyIncome.getSettlementAmount();// 已经开票金额
-                invoicCommissionFeevalue = invoicCommissionFeevalue.add(invoicIcommissionFeevalue);  //开票金额
-
-            }
-            params.put("settlementStatus", "2"); // 结算
-            List<SettlementDocumentaryFeesEntity> settleInsPlyIncomes = settlementDocumentaryFeesService.queryNew(params);  //金额总数
-            for (SettlementDocumentaryFeesEntity settleInsPlyIncome : settleInsPlyIncomes) {
-                BigDecimal settleIcommissionFeevalue = settleInsPlyIncome.getSettlementAmount();// 已结算金额
-                readyCommissionFeevalue = readyCommissionFeevalue.add(settleIcommissionFeevalue);  //已结算总
-            }
-            params.put("settlementStatus", 0);  //未开票金额
-            List<SettlementDocumentaryFeesEntity> noInvoicInsPlyIncomes = settlementDocumentaryFeesService.queryNew(params);  //金额总数
-            for (SettlementDocumentaryFeesEntity noInvoicInsPlyIncome : noInvoicInsPlyIncomes) {
-                BigDecimal noInvoicIcommissionFeevalue = noInvoicInsPlyIncome.getSettlementAmount();// 未开票金额
-                noInvoicCommissionFeevalue = noInvoicCommissionFeevalue.add(noInvoicIcommissionFeevalue);  //未开票总金额
-            }
-
-            noInvoicCommissionFeevalue = commissionFeevalue.subtract(invoicCommissionFeevalue);// 未开票
-            unSettledAmount = commissionFeevalue.subtract(readyCommissionFeevalue);   //未结算
-            //已开票金额
-
-            item.setCommissionFeevalue(commissionFeevalue);  //总手续费
-            item.setAllInvoicCommissionFeevalue(invoicCommissionFeevalue);  //总开票金额
-            //  开票未结算   = 开票金额 -  已开票已结算
-            invoicCommissionFeevalue = invoicCommissionFeevalue.subtract(readyCommissionFeevalue);
-            item.setInvoicCommissionFeevalue(invoicCommissionFeevalue); //开票未结算
-            item.setReadyCommissionFeevalue(readyCommissionFeevalue);  //已开票已结算
-            item.setNoInvoicCommissionFeevalue(noInvoicCommissionFeevalue);   //未开票金额
-            item.setUnSettledAmount(unSettledAmount);   // 未结算金额
-        }
+        List<InsPlyIncome> resultList = baseMapper.totalBxAmountNew(params);
         return resultList;
     }
 
@@ -3120,9 +3076,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
      */
     @Override
     public List<PlatformSettlementRecordDto> platformSettlementRecord(InsPlyIncomeVo insPlyIncomeVo) {
-        if(insPlyIncomeVo.getPartnerCompaniesId()==null || "".equals(insPlyIncomeVo.getPartnerCompaniesId())){
-            throw new SystemException("合作公司编码(partnerCompaniesId)不能为空");
-        }
+      //  if(insPlyIncomeVo.getPartnerCompaniesId()==null || "".equals(insPlyIncomeVo.getPartnerCompaniesId())){
+       //     throw new SystemException("合作公司编码(partnerCompaniesId)不能为空");
+      //  }
         if(insPlyIncomeVo.getHandlingFeesStatus()==null || "".equals(insPlyIncomeVo.getHandlingFeesStatus())){
             throw new SystemException("结算状态 0 未结算 1已结算(handlingFeesStatus)不能为空");
         }
@@ -3625,4 +3581,24 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
         return baseMapper.getInvociAmount(insuranceHandlingSettlementMonthVo);
     }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 9:58
+     *  @Description:  平台结算情况统计
+     */
+    @Override
+    public List<InsPlyIncomePTDto> totalPTAmount(InsPlyIncomePTVo insPlyIncomeVo) {
+        return baseMapper.totalPTAmount(insPlyIncomeVo);
+    }
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/9/20 11:01
+     *  @Description:  通过结算人查询保险公司结算数据
+     */
+    @Override
+    public List<InsPlyIncomePTCompanyDto> findListByDockingPerson(InsPlyIncomeQueryPTVo insPlyIncomeVo) {
+        return  baseMapper.findListByDockingPerson(insPlyIncomeVo);
+    }
 }

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

@@ -112,4 +112,16 @@ public class InsuranceHandlingSettlementMonthServiceImpl extends ServiceImpl<Ins
         List<InsuranceHandlingSettlementMonthDto> resultList = baseMapper.queryList(insuranceHandlingSettlementMonthVo);
         return resultList;
     }
+
+    /**
+     *
+     * @param insuranceHandlingSettlementMonthDto
+     * @return    返回结算金额  未结算 开票金额
+     */
+
+    @Override
+    public HashMap<String, BigDecimal> getSumAmount(InsuranceHandlingSettlementMonthDto insuranceHandlingSettlementMonthDto) {
+        return   baseMapper.getSumAmount(insuranceHandlingSettlementMonthDto);
+
+    }
 }

+ 1 - 1
src/main/java/com/ydtech/modules/fnc/service/impl/SettlementDocumentaryFeesServiceImpl.java

@@ -215,7 +215,7 @@ public class SettlementDocumentaryFeesServiceImpl extends ServiceImpl<Settlement
             wrapper.set(InsPlyIncome::getSettlementTime, null);
             insPlyIncomeMapper.update(item, wrapper);
 
-            incomeTaskRelationshipService.deleteByIncomeId(item.getId());  //作废后删除关系任务表
+//          incomeTaskRelationshipService.deleteByIncomeId(item.getId());  //作废后删除关系任务表
         }
 
 

+ 35 - 0
src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomePTVo.java

@@ -0,0 +1,35 @@
+package com.ydtech.modules.fnc.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ydtech.modules.fnc.entity.InsPlyIncome;
+import com.ydtech.modules.fnc.entity.InsuranceHandlingSettlementMonthEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.Min;
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.List;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/9/20 9:53
+ *  @Description: 平台结算情况查询vo
+ */
+@Data
+@ApiModel("平台结算情况查询vo")
+public class InsPlyIncomePTVo implements Serializable {
+
+
+    @ApiModelProperty("对接人")
+    private String dockingPerson;
+
+    @ApiModelProperty(value = "开始时间")
+    private String beginDate;
+
+    @ApiModelProperty(value = "结束时间")
+    private String endDate;
+}

+ 31 - 0
src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeQueryPTVo.java

@@ -0,0 +1,31 @@
+package com.ydtech.modules.fnc.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.Min;
+import java.io.Serializable;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/9/20 9:53
+ *  @Description: 平台结算情况查询vo
+ */
+@Data
+@ApiModel("平台结算情况详情查询vo")
+public class InsPlyIncomeQueryPTVo implements Serializable {
+
+
+    @ApiModelProperty("对接人")
+    private String dockingPerson;
+
+
+    @ApiModelProperty(value = "每页页数")
+    private int pageSize;
+
+    @ApiModelProperty(value = "页数")
+    @Min(value = 1, message = "页数最小为1")
+    private int pageNum=1;
+}

+ 5 - 1
src/main/java/com/ydtech/modules/fnc/vo/InsPlyIncomeVo.java

@@ -61,7 +61,7 @@ public class InsPlyIncomeVo implements Serializable {
     private LocalDate createTime;
 
     @ApiModelProperty(value = "结算日期")
-    @DateTimeFormat(value = "yyyy-MM-dd'T'HH:mm:ss")
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDate settlementTime;
 
 
@@ -422,4 +422,8 @@ public class InsPlyIncomeVo implements Serializable {
     private List<InsuranceHandlingSettlementMonthEntity> insuranceHandlingList;
 
 
+    @ApiModelProperty("添加类型")
+    private String addType;
+
+
 }

+ 3 - 0
src/main/java/com/ydtech/modules/order/entity/vo/OrderQueryVo.java

@@ -162,6 +162,9 @@ public class OrderQueryVo {
     @ApiModelProperty("领导人名称")
     private String leaderName;
 
+    @ApiModelProperty("录入来源")
+    private String entryStatus;
+
     public LocalDate getEndDatePlusOneDay() {
         if(ObjectUtils.isEmpty(endDate)){
             return endDate;

+ 1 - 1
src/main/java/com/ydtech/modules/protocol/dao/PtlAgreementMapper.java

@@ -48,7 +48,7 @@ public interface PtlAgreementMapper extends BaseMapper<PtlAgreement> {
 
     List<AgreeReportDto> getInsuranceCompany();
 
-    List<PtlAgreement> findCheckAgreementListNew();
+    List<PtlAgreement> findCheckAgreementListNew(@Param("vo") PtlAgreement ptlAgreement);
 
 
 }

+ 3 - 0
src/main/java/com/ydtech/modules/protocol/entity/po/PtlAgreement.java

@@ -257,6 +257,9 @@ public class PtlAgreement implements Serializable {
     @TableField(exist = false)
     private String partnerCompaniesName;
 
+    @TableField(exist = false)
+    private String isValid;
+
     /**
      * 逻辑删除
      */

+ 17 - 4
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java

@@ -212,7 +212,8 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         List<PtlAgreement> updateList = new ArrayList<>();
         List<PtlAgreement> list = ptlAgreementMapper.selectList(new QueryWrapper<PtlAgreement>()
                 .ge("serial_number", ptlAgreement.getSerialNumber())
-                .ne("id", ptlAgreement.getId()));
+                .ne("id", ptlAgreement.getId())
+                .eq("is_external", ptlAgreement.getIsExternal()));
         if (list != null && !list.isEmpty()) {
             int newSerialNumber = ptlAgreement.getSerialNumber();
             for (PtlAgreement ptlAgreement1 : list) {
@@ -505,6 +506,16 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
             wrapper.apply("SUBSTRING(partner_companies_id, 6, " + sign + ") =" + prefix);
         }
         Page<PtlAgreement> agreementPage = page(page, wrapper);
+        agreementPage.getRecords().forEach(agreement -> {
+            LocalDate startDate = agreement.getStartDate();
+            LocalDate endDate = agreement.getEndDate();
+            LocalDate now = LocalDate.now();
+            if (now.isAfter(startDate) && now.isBefore(endDate)) {
+                agreement.setIsValid("1");
+            } else {
+                agreement.setIsValid("0");
+            }
+        });
         return agreementPage;
     }
 
@@ -602,7 +613,8 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         List<PtlAgreement> updateList = new ArrayList<>();
         List<PtlAgreement> list = ptlAgreementMapper.selectList(new QueryWrapper<PtlAgreement>()
                 .ge("serial_number", ptlAgreement.getSerialNumber())
-                .ne("id", agreementId));
+                .ne("id", agreementId)
+                .eq("is_external", ptlAgreement.getIsExternal()));
         if (list != null && !list.isEmpty()) {
             int newSerialNumber = ptlAgreement.getSerialNumber(); // 被删除协议的序列号
             for (PtlAgreement ptlAgreement1 : list) {
@@ -671,7 +683,8 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         List<PtlAgreement> updateList = new ArrayList<>();
         List<PtlAgreement> list = ptlAgreementMapper.selectList(new QueryWrapper<PtlAgreement>()
                         .ge("serial_number", ptlAgreement.getSerialNumber())
-                        .ne("id", agreementId));
+                        .ne("id", agreementId)
+                        .eq("is_external", ptlAgreement.getIsExternal()));
         if (list != null && list.size() > 0) {
             int newSerialNumber = ptlAgreement.getSerialNumber();
             for (PtlAgreement ptlAgreement1 : list) {
@@ -876,7 +889,7 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
      *  @Description: 查询审核的所有协议  协议名称拼接
      */
     public List<PtlAgreement> findCheckAgreementListNew(PtlAgreement ptlAgreement) {
-        List<PtlAgreement> list =baseMapper.findCheckAgreementListNew();
+        List<PtlAgreement> list =baseMapper.findCheckAgreementListNew(ptlAgreement);
         return list;
     }
 

+ 24 - 0
src/main/resources/mapper/modules/admin/CompanyDataReport.xml

@@ -102,6 +102,18 @@
             <if test="vo.deptId  != null  and  vo.deptId!=''  ">
                 and io.deptid like concat('%', #{vo.deptId}, '%')
             </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND io.deptid  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
         ) b
         GROUP BY
@@ -147,6 +159,18 @@
                 <if test="vo.year  != null  and  vo.year!='' ">
                     AND DATE_FORMAT( io.createtime, '%Y') =#{vo.year}
                 </if>
+                <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                    AND io.deptid  in
+                    <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
+                <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                    AND io.userid  in
+                    <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                        #{item}
+                    </foreach>
+                </if>
             </where>
 
     </select>

+ 13 - 0
src/main/resources/mapper/modules/admin/DeptBalanceMapper.xml

@@ -142,6 +142,19 @@
             <if test="vo.userCode !=null  and  vo.userCode !=''">
                 and su.id= #{vo.userCode}
             </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND sd.id  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND su.id  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
     </select>
 

+ 13 - 0
src/main/resources/mapper/modules/admin/SysAgencyLeaderMapper.xml

@@ -66,6 +66,19 @@
             <if test="vo.userCode !=null  and  vo.userCode !=''">
                 and su.id= #{vo.userCode}
             </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND sd.id  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND su.id  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
     </select>
 

+ 3 - 1
src/main/resources/mapper/modules/admin/SysDeptMapper.xml

@@ -121,7 +121,9 @@
     </select>
     <select id="getListByIds" resultType="com.ydtech.modules.admin.model.SysDept">
         SELECT sd.id        AS id,
-               sd.NAME      AS NAME
+               sd.NAME      AS NAME,
+               sd.parent_id  AS parentId,
+               sd.comlevel  AS comlevel
         FROM sys_dept sd
         WHERE sd.id  in
         <foreach collection="ids" item="item" open="(" close=")" separator=",">

+ 116 - 14
src/main/resources/mapper/modules/admin/SysGeographyPositionRecordMapper.xml

@@ -15,25 +15,127 @@
     </resultMap>
 
     <select id="getGeographyPosition" resultType="com.ydtech.modules.admin.model.vo.PcAddressHistoryTimeVo">
-        select spa.time ,COUNT(spa.countNum) as countNum
+        select spa.time ,COUNT(spa.user_id) as countNum
         from(
         SELECT
-        DATE_FORMAT(s.create_time, '%Y-%m-%d %H' ) as time,
-        COUNT( DISTINCT s.user_id) as countNum
+        DISTINCT s.user_id,DATE_FORMAT(s.create_time, '%Y-%m-%d %H' ) as time
         FROM
         sys_geography_position_record s
-        where
-        s.source in (1,2)
-        <if test="dates != null and dates != ''">
-            and DATE_FORMAT(s.create_time, '%Y-%m-%d' ) = DATE_FORMAT( #{dates}, '%Y-%m-%d' )
-        </if>
-        GROUP BY
-        s.create_time
+        <where>
+            <if test="source != null">
+                s.source = #{source}
+            </if>
+            <if test="source == null">
+                s.source in (1,2)
+            </if>
+            <if test="dates != null and dates != ''">
+                and DATE_FORMAT(s.create_time, '%Y-%m-%d' ) = DATE_FORMAT( #{dates}, '%Y-%m-%d' )
+            </if>
+        </where>
         ) as spa
-        GROUP BY
-        spa.time
-        ORDER BY
-        spa.time
+        GROUP BY spa.time
+        ORDER BY spa.time ASC
+
+    </select>
+    <select id="getGeographyPositionRecord" resultType="com.ydtech.modules.admin.model.SysGeographyPositionRecord">
+        SELECT t1.*
+        FROM sys_geography_position_record t1
+        INNER JOIN (
+        SELECT s.user_id, MAX(s.id) AS max_id
+        FROM sys_geography_position_record s
+        <where>
+            <if test="source == null">
+                s.source in (1,2)
+            </if>
+            <if test="source != null">
+                s.source = #{source}
+            </if>
+            <if test="dates != null and dates != ''">
+                and DATE_FORMAT(s.create_time, '%Y-%m-%d' ) = DATE_FORMAT( #{dates}, '%Y-%m-%d' )
+            </if>
+        </where>
+        GROUP BY s.user_id
+        ) t2 ON t1.id = t2.max_id
+        ORDER BY t1.id DESC
+
+    </select>
+    <select id="getGeographyPositionSection" resultType="com.ydtech.modules.admin.model.vo.PcAddressHistoryTimeVo">
+        select spa.time ,COUNT(spa.user_id) as countNum
+        from(
+        SELECT
+        DISTINCT s.user_id,DATE_FORMAT(s.create_time, '%Y-%m-%d' ) as time
+        FROM
+        sys_geography_position_record s
+        <where>
+            <if test="source != null">
+                s.source = #{source}
+            </if>
+            <if test="source == null">
+                s.source in (1,2)
+            </if>
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and (DATE_FORMAT(s.create_time, '%Y-%m-%d') between DATE_FORMAT( #{startTime}, '%Y-%m-%d') and
+                DATE_FORMAT( #{endTime}, '%Y-%m-%d'))
+            </if>
+        </where>
+        ) as spa
+        GROUP BY spa.time
+        ORDER BY spa.time ASC
+
+    </select>
+
+    <select id="getGeographyPositionHistory" resultType="com.ydtech.modules.admin.model.SysGeographyPositionRecord">
+        SELECT t1.*
+        FROM sys_geography_position_record t1
+        INNER JOIN (
+        SELECT s.user_id, MAX(s.id) AS max_id
+        FROM sys_geography_position_record s
+        <where>
+            <if test="source == null">
+                s.source in (1,2)
+            </if>
+            <if test="source != null">
+                s.source = #{source}
+            </if>
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and (DATE_FORMAT(s.create_time, '%Y-%m-%d') between DATE_FORMAT( #{startTime}, '%Y-%m-%d') and
+                DATE_FORMAT( #{endTime}, '%Y-%m-%d'))
+            </if>
+        </where>
+        GROUP BY s.user_id
+        ) t2 ON t1.id = t2.max_id
+        ORDER BY t1.id DESC
+
+    </select>
+    <select id="queryGeographyHistory" resultType="com.ydtech.modules.admin.model.vo.SysGeographyPositionInfoVo">
+        SELECT t1.*
+        FROM sys_geography_position_record t1
+        INNER JOIN (
+        SELECT user_id, MAX(id) AS max_id
+        FROM sys_geography_position_record
+        <where>
+            <if test="dto.lng != null and dto.lng != ''">
+                and longitude=#{dto.lng}
+            </if>
+            <if test="dto.lat != null and dto.lat != ''">
+                and latitude=#{dto.lat}
+            </if>
+            <if test="dto.source != null">
+                and source=#{dto.source}
+            </if>
+            <if test="dto.source == null">
+                and source in (1,2)
+            </if>
+            <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''and dto.startTime != dto.endTime">
+                and (DATE_FORMAT(create_time, '%Y-%m-%d' ) between DATE_FORMAT( #{dto.startTime}, '%Y-%m-%d' ) and
+                DATE_FORMAT( #{dto.endTime}, '%Y-%m-%d' ))
+            </if>
+            <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''and dto.startTime == dto.endTime">
+                and DATE_FORMAT(create_time, '%Y-%m-%d' ) like CONCAT( DATE_FORMAT( #{dto.startTime}, '%Y-%m-%d' ), '%')
+            </if>
+        </where>
+        GROUP BY user_id) t2 ON t1.id = t2.max_id
+        ORDER BY t1.id DESC
 
     </select>
 

+ 13 - 0
src/main/resources/mapper/modules/admin/SysPartnerMapper.xml

@@ -45,6 +45,19 @@
             <if test="vo.userCode !=null  and  vo.userCode !=''">
                 and su.id= #{vo.userCode}
             </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND sd.id  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND su.id  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
     </select>
 

+ 115 - 11
src/main/resources/mapper/modules/admin/SysPcAddressHistoryMapper.xml

@@ -21,26 +21,130 @@
 
 
     <select id="getPcAddress" resultType="com.ydtech.modules.admin.model.vo.PcAddressHistoryTimeVo">
-        select spa.time ,COUNT(spa.countNum) as countNum
+        select spa.time, COUNT(spa.user_id) as countNum
         from(
         SELECT
-             DATE_FORMAT(s.operation_time, '%Y-%m-%d %H' ) as time,
-             COUNT( DISTINCT s.user_id) as countNum
+            DISTINCT s.user_id,DATE_FORMAT(s.operation_time, '%Y-%m-%d %H' ) as time
              FROM
                  sys_pc_address_history  s
 
-             where
-                s.source in (1,2)
-                <if test="dates != null and dates != ''">
-                 and DATE_FORMAT(s.operation_time, '%Y-%m-%d' ) = DATE_FORMAT( #{dates}, '%Y-%m-%d' )
-                </if>
-             GROUP BY
-                s.operation_time
+             <where>
+                 <if test="source != null">
+                     s.source = #{source}
+                 </if>
+                 <if test="source == null">
+                     s.source in (1,2)
+                 </if>
+                 <if test="dates != null and dates != ''">
+                     and DATE_FORMAT(s.operation_time, '%Y-%m-%d' ) = DATE_FORMAT( #{dates}, '%Y-%m-%d' )
+                 </if>
+             </where>
              ) as spa
         GROUP BY
             spa.time
         ORDER BY
-            spa.time
+            spa.time ASC
+
+    </select>
+    <select id="getPcAddressSection" resultType="com.ydtech.modules.admin.model.vo.PcAddressHistoryTimeVo">
+        select spa.time, COUNT(spa.user_id) as countNum
+        from(
+        SELECT
+            DISTINCT s.user_id,DATE_FORMAT(s.operation_time, '%Y-%m-%d' ) as time
+        FROM
+            sys_pc_address_history  s
+
+        <where>
+            <if test="source != null ">
+                s.source = #{source}
+            </if>
+            <if test="source == null ">
+                s.source in (1,2)
+            </if>
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and (DATE_FORMAT(s.operation_time, '%Y-%m-%d') between DATE_FORMAT( #{startTime}, '%Y-%m-%d') and DATE_FORMAT( #{endTime}, '%Y-%m-%d'))
+            </if>
+        </where>
+        ) as spa
+        GROUP BY
+        spa.time
+        ORDER BY
+        spa.time ASC
+    </select>
+
+    <select id="getPcAddressHistory" resultType="com.ydtech.modules.admin.model.po.SysPcAddressHistory">
+        SELECT t1.*
+        FROM sys_pc_address_history t1
+        INNER JOIN (
+        SELECT s.user_id, MAX(s.id) AS max_id
+        FROM sys_pc_address_history s
+        <where>
+            <if test="source != null ">
+                s.source = #{source}
+            </if>
+            <if test="source == null">
+                s.source in (1,2)
+            </if>
+            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
+                and (DATE_FORMAT(s.operation_time, '%Y-%m-%d' ) between DATE_FORMAT( #{startTime}, '%Y-%m-%d' ) and DATE_FORMAT( #{endTime}, '%Y-%m-%d' ))
+            </if>
+        </where>
+        GROUP BY s.user_id
+        ) t2 ON t1.id = t2.max_id
+        ORDER BY t1.id DESC
+    </select>
+
+    <select id="getPcAddressInfo" resultType="com.ydtech.modules.admin.model.po.SysPcAddressHistory">
+        SELECT t1.*
+        FROM sys_pc_address_history t1
+                 INNER JOIN (
+            SELECT s.user_id, MAX(s.id) AS max_id
+            FROM sys_pc_address_history s
+            <where>
+                <if test="source == null">
+                    s.source in (1,2)
+                </if>
+                <if test="source != null">
+                    s.source = #{source}
+                </if>
+                <if test="dates != null and dates != ''">
+                    and DATE_FORMAT(s.operation_time, '%Y-%m-%d' ) = DATE_FORMAT( #{dates}, '%Y-%m-%d' )
+                </if>
+            </where>
+            GROUP BY s.user_id
+        ) t2 ON t1.id = t2.max_id
+        ORDER BY t1.id DESC
+    </select>
 
+    <select id="queryAddressHistory" resultType="com.ydtech.modules.admin.model.po.SysPcAddressHistory">
+        SELECT t1.*
+        FROM sys_pc_address_history t1
+        INNER JOIN (
+        SELECT user_id, MAX(id) AS max_id
+        FROM sys_pc_address_history
+        <where>
+            <if test="dto.lng != null and dto.lng != ''">
+                and longitude=#{dto.lng}
+            </if>
+            <if test="dto.lat != null and dto.lat != ''">
+                and latitude=#{dto.lat}
+            </if>
+            <if test="dto.source != null">
+                and source=#{dto.source}
+            </if>
+            <if test="dto.source == null">
+                and source in (1,2)
+            </if>
+            <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''and dto.startTime != dto.endTime">
+                and (DATE_FORMAT(operation_time, '%Y-%m-%d' ) between DATE_FORMAT( #{dto.startTime}, '%Y-%m-%d' ) and DATE_FORMAT( #{dto.endTime}, '%Y-%m-%d' ))
+            </if>
+            <if test="dto.startTime != null and dto.startTime != '' and dto.endTime != null and dto.endTime != ''and dto.startTime == dto.endTime">
+                and (DATE_FORMAT(operation_time, '%Y-%m-%d' ) like CONCAT( DATE_FORMAT( #{dto.startTime}, '%Y-%m-%d' ), '%' ))
+            </if>
+        </where>
+        GROUP BY user_id) t2 ON t1.id = t2.max_id
+        ORDER BY t1.id DESC
     </select>
+
+
 </mapper>

+ 13 - 0
src/main/resources/mapper/modules/admin/SysTelemarketingWechatDataMapper.xml

@@ -59,6 +59,19 @@
             <if test='vo.groupId !=null and vo.groupId!=""  '>
                 and t5.id like CONCAT('', #{vo.groupId}, '%')
             </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND t2.id  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND t1.id  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </if>
         order by t1.id
     </select>

+ 38 - 1
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -1361,6 +1361,16 @@
             <if test="vo.managementSource != null  and  vo.managementSource!='' ">
                 AND sd.management_source =#{vo.managementSource}
             </if>
+            <choose>
+                <when  test='vo.managementSource == "2"'>
+                   and (sur.role_id = 20  or  sur.role_id = 21)
+                </when>
+                <when  test='vo.managementSource == "1"'>
+                    and (sur.role_id = 19  or  sur.role_id = 21)
+                </when>
+                <otherwise>
+                </otherwise>
+            </choose>
             <if test="vo.provinceId != null and vo.provinceId != ''">
                 and sd.id like  concat('%',#{vo.provinceId},'%')
             </if>
@@ -1382,10 +1392,23 @@
             <if test="vo.phoneNumber != null and vo.phoneNumber != ''">
                 and su.mobile   =#{vo.phoneNumber}
             </if>
-
             <if test="vo.leaderId != null and vo.leaderId != ''">
                 and su.leader_id   =#{vo.leaderId}
             </if>
+
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND sd.id  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND su.id  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
     </select>
 
@@ -1441,10 +1464,12 @@
         FROM
         sys_user su
         LEFT JOIN sys_dept sd ON sd.id = su.dept_id
+        LEFT JOIN sys_user_role sur ON sur.user_id = su.id
         <where>
             su.id  LIKE '%M%'
             and su.status = '1'
             AND sd.management_source =2
+            and (sur.role_id = 20  or  sur.role_id = 21)
             <if test="vo.provinceId != null and vo.provinceId != ''">
                 and sd.id like  concat('%',#{vo.provinceId},'%')
             </if>
@@ -1454,6 +1479,18 @@
             <if test="vo.countyId != null and vo.countyId != ''">
                 and sd.id like concat('%',#{vo.countyId},'%')
             </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND sd.id  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND su.id  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
     </select>
 

+ 61 - 7
src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml

@@ -8,7 +8,7 @@
         select
         io.userid as "userId",
         su.name as "userName",
-        IFNULL (sum(sumpremium),0) as "sumpremium",
+        sum(IFNULL(jqpremium, 0) + IFNULL(sypremium, 0)+ IFNULL(jypremium, 0)) as "sumpremium",
         IFNULL(sum(jqpremium),0) as "jqpremium",
         IFNULL(sum(sypremium),0) as "sypremium",
         IFNULL(sum(taxamount),0) as "taxamount",
@@ -42,6 +42,19 @@
                     #{item}
                 </foreach>
             </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND io.deptid  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
 
             <if test="vo.userName !=null  and vo.userName!=''">
                 and su.name=#{vo.userName}
@@ -90,6 +103,19 @@
             <if test="vo.managementSource !=null  and vo.managementSource!=''">
                 and sd.management_source=#{vo.managementSource}
             </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND io.deptid  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
         group by io.userid
               ) a
@@ -97,7 +123,7 @@
 
     <select id="getBusinessAgentDataTotalAdd" resultType="com.ydtech.modules.admin.model.vo.BusinessAgentData">
         select
-            IFNULL (sum(sumpremium),0) as "sumpremium",
+            sum(IFNULL(jqpremium, 0) + IFNULL(sypremium, 0)+ IFNULL(jypremium, 0)) as "sumpremium",
             IFNULL(sum(jqpremium),0) as "jqpremium",
             IFNULL(sum(sypremium),0) as "sypremium",
             IFNULL(sum(taxamount),0) as "taxamount",
@@ -137,13 +163,27 @@
             <if test="vo.managementSource !=null  and vo.managementSource!=''">
                 and sd.management_source=#{vo.managementSource}
             </if>
+
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND io.deptid  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
     </select>
 
 
     <select id="getAllsumPremium" resultType="com.ydtech.modules.admin.model.vo.BusinessAgentData">
         select
-            IFNULL (sum(sumpremium),0) as "sumpremium"
+          sum(IFNULL(iac.jqpremium, 0) + IFNULL(iac.sypremium, 0)+ IFNULL(iac.jypremium, 0)) as "sumpremium"
         from ins_area_company iac
                  left join ins_orders io on io.orderno =iac.orderno
                  left join sys_user su on io.userid =su.id
@@ -173,13 +213,26 @@
             <if test="vo.managementSource !=null  and vo.managementSource!=''">
                 and sd.management_source=#{vo.managementSource}
             </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND io.deptid  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
     </select>
 
     <select id="getBusinessAgentDataDetails" resultType="com.ydtech.modules.admin.model.vo.BusinessAgentData">
-        select a.insurance_company as "insuranceCompany",
+        select
         a.insurance_company as "insuranceCompany",
-        a.sumpremium as "sumpremium",
+        (IFNULL(a.jqpremium, 0) + IFNULL(a.sypremium, 0)+ IFNULL(a.jypremium, 0)) as "sumpremium",
         a.jqpremium as "jqpremium",
         a.sypremium as "sypremium",
         a.taxamount as "taxamount",
@@ -202,6 +255,7 @@
         left join ptl_agreement pa on pa.id = iac.agreement_id
         left join sys_user su on io.userid =su.id
         left join sys_dept sd on sd.id =su.dept_id
+        LEFT JOIN esm_ins_company eic on eic.id = pa.partner_companies_id
         <where>
             iac.orderstatus = '3'
             and io.orderstatus = '3'
@@ -219,7 +273,7 @@
                 and sd.management_source=#{vo.managementSource}
             </if>
 
-            <if test="vo.userIds  !=null  and vo.userIds!=''  and vo.userIds.size().0">
+            <if test="vo.userIds  !=null  and vo.userIds!=''  and vo.userIds.size()>0">
                 and su.id in
                 <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
                     #{item}
@@ -228,7 +282,7 @@
 
         </where>
         group by pa.insurance_company, pa.partner_companies_id ,su.id,su.name) a
-        LEFT JOIN esm_ins_company eic on eic.id = a.partner_companies_id
+        LEFT JOIN esm_ins_company eic ON eic.id = a.partner_companies_id
     </select>
 
 

+ 12 - 2
src/main/resources/mapper/modules/esm/EsmInsCompanyMapper.xml

@@ -67,6 +67,16 @@
 
 
     </select>
-
-
+    <select id="findOrderCompanyList" resultType="com.ydtech.modules.esm.model.vo.res.EsmInsCompanyResVo">
+        SELECT
+            company_id as id,
+            inscompany as name
+        FROM
+            ins_area_company
+        WHERE
+            IFNULL( company_id, '' )!= ''
+        GROUP BY
+            company_id,
+            inscompany
+    </select>
 </mapper>

+ 261 - 17
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -151,7 +151,8 @@
                 a.invoicing_method  as  "invoicingMethod",
                 a.settlement_image_id as "settlementImageId",
                 a.task_id as "taskId",
-                a.create_time  as  "createTime"
+                a.create_time  as  "createTime",
+                a.add_type  as  "addType"
     </sql>
 
     <select id="queryNew"  resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
@@ -2831,22 +2832,6 @@
             order by    a.subSigndate
     </select>
 
-    <select id="queryDateByTypeMonthSumAmount" resultType="java.math.BigDecimal">
-        SELECT
-        SUM(IFNULL(a.commission_feevalue ,0 ) + IFNULL(a.other_feevalue ,0 ))
-        FROM
-        ins_ply_income a
-        LEFT JOIN
-        ptl_agreement pa ON pa.id = a.agreement_id
-        <where>
-            <if test="vo.type !=null  and  vo.type  !=''">
-                and pa.agreement_type =#{vo.type}
-            </if>
-            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
-                AND  a.create_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
-            </if>
-        </where>
-    </select>
     <select id="getProfitAnalysisQueryList" resultType="com.ydtech.modules.admin.model.report.profitAnalysis.ProfitAnalysisDto">
         SELECT
             a.signingTime as "yearAndMonth",
@@ -3152,4 +3137,263 @@
         eic.namesimple,
         sa.area_cname
     </select>
+    <select id="totalBxAmountNew" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
+        select
+        a.companyId as "companyId",
+        a.companyName as "companyName",
+        a.partnerCompaniesName as "partnerCompaniesName",
+        a.partner_companies_id as "partnerCompaniesId",
+        IFNULL(a.allInvoicCommissionFeevalue,0) AS "allInvoicCommissionFeevalue",
+        IFNULL(a.commissionFeevalue,0) as "commissionFeevalue",
+        IFNULL(b.settlementAmount,0)   as "readyCommissionFeevalue",
+        IFNULL(a.allInvoicCommissionFeevalue,0) -IFNULL(b.settlementAmount,0) as "invoicCommissionFeevalue",
+        IFNULL(a.commissionFeevalue,0) - IFNULL(a.allInvoicCommissionFeevalue,0) as "noInvoicCommissionFeevalue",
+        (IFNULL(a.allInvoicCommissionFeevalue,0) -IFNULL(b.settlementAmount,0)) +(IFNULL(a.commissionFeevalue,0) - IFNULL(a.allInvoicCommissionFeevalue,0)) as "unSettledAmount"
+        from (
+        select a.partner_companies_id,
+        sum(a.commission_feevalue) as "commissionFeevalue",
+        SUM(CASE WHEN a.handling_fees_status != '0' and a.task_id  is  not  null  THEN IFNULL(a.commission_feevalue, 0) ELSE 0 END)   AS "allInvoicCommissionFeevalue",
+        MAX( a.company_name ) AS "companyName",
+        MAX( a.company_id ) AS "companyId",
+        MAX( a.partner_companies_name ) AS "partnerCompaniesName"
+        from ins_ply_income a
+        LEFT JOIN ptl_agreement pa ON a.agreement_id = pa.id
+        LEFT JOIN esm_ins_company eic on eic.id = a.partner_companies_id
+        <where>
+            1=1
+            <if test="startDate !=null  and  startDate!='' and  endDate !=null and endDate !=''">
+                and DATE_FORMAT( a.signdate, '%Y-%m-%d')  between DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(#{endDate}, '%Y-%m-%d')
+            </if>
+            <if test="agreementType !=null  and  agreementType  !=''">
+                and pa.agreement_type =#{agreementType}
+            </if>
+
+            <if test="signDateEnd !=null  and  signDateEnd!='' and  signDateStart !=null and signDateStart !=''">
+                and a.signdate   between #{signDateStart} and #{signDateEnd}
+            </if>
+
+            <if test="handlingFeesStatus !=null  and  handlingFeesStatus  !=''">
+                and a.handling_fees_status =#{handlingFeesStatus}
+            </if>
+
+            <if test="allPartnerCompaniesId !=null  and  allPartnerCompaniesId  !=''">
+                AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
+            </if>
+
+            <if test="provincePartnerCompaniesId !=null  and  provincePartnerCompaniesId  !=''">
+                and eic.parent_id LIKE CONCAT(#{provincePartnerCompaniesId}, '%')
+            </if>
+
+            <if test="createTimeStart  !=null  and  createTimeStart  != ''  and  createTimeEnd   != null  and  createTimeEnd   !=''">
+                AND DATE(a.create_time) BETWEEN #{createTimeStart} AND #{createTimeEnd}
+            </if>
+            <if test="dockingPerson !=null  and  dockingPerson  !=''">
+                and  pa.docking_person  =#{dockingPerson}
+            </if>
+
+            <if test="provinceId != null and provinceId != ''">
+                and pa.dept_id  LIKE CONCAT(#{provinceId}, '%')
+            </if>
+
+            <if test="cityId != null and cityId != ''">
+                and pa.dept_id  LIKE CONCAT(#{cityId}, '%')
+            </if>
+
+            <if test="countyId != null and countyId != ''">
+                and pa.dept_id   LIKE CONCAT(#{countyId}, '%')
+            </if>
+            <if test="taskId != null and taskId != ''">
+                and a.task_id = #{taskId}
+            </if>
+            <if test="orderno !=null  and  orderno  !=''">
+                and a.orderno =#{orderno}
+            </if>
+            <if test="companyName !=null  and  companyName  !=''">
+                and a.company_id =#{companyName}
+            </if>
+
+            <if test="isExternal  !=null  and  isExternal  != ''">
+                AND pa.is_external =#{isExternal}
+            </if>
+
+            <if test="policyno !=null  and  policyno  !=''">
+                and a.policyno =#{policyno}
+            </if>
+            <if test="documentaryFeesStatus !=null  and  documentaryFeesStatus  !=''">
+                and a.documentary_fees_status =#{documentaryFeesStatus}
+            </if>
+
+            <if test="createTimeQuery != null and createTimeQuery != ''">
+                and DATE_FORMAT( a.create_time, '%Y-%m-%d')   =#{createTimeQuery}
+            </if>
+
+            <if test="isNotCar !=null  and  isNotCar  !=''">
+                and a.is_not_car =#{isNotCar}
+            </if>
+
+            <if test="deptId !=null  and  deptId  !=''">
+                and pa.dept_id =#{deptId}
+            </if>
+
+
+            <if test="ids != null and ids != '' and ids.length > 0">
+                and a.id in
+                <foreach collection="ids" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="incomeIds != null and incomeIds != '' and incomeIds.size() > 0">
+                and a.id in
+                <foreach collection="incomeIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="selectIds != null and selectIds != '' and selectIds.size() > 0">
+                and a.id in
+                <foreach collection="selectIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="partnerCompaniesIdList != null and partnerCompaniesIdList != '' and partnerCompaniesIdList.size() > 0">
+                and a.partner_companies_id in
+                <foreach collection="partnerCompaniesIdList" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="isOther !=null  and  isOther  !=''">
+                and a.is_not_documentary   =#{isOther}
+            </if>
+            <if test="licenseno != null and licenseno != ''">
+                and a.licenseno  =#{licenseno}
+            </if>
+            <if test="syPolicyno != null and syPolicyno != ''">
+                and a.sy_policyno  =#{syPolicyno}
+            </if>
+
+            <if test="noPolicyno != null and noPolicyno != ''">
+                and a.no_policyno =#{noPolicyno}
+            </if>
+            <if test="signdate !=null  and  signdate  !=''">
+                AND  a.signdate =#{signdate}
+            </if>
+            <if test="partnerCompaniesId !=null  and  partnerCompaniesId  !=''">
+                AND a.partner_companies_id =#{partnerCompaniesId}
+            </if>
+
+            <if test="partnerCompaniesName !=null  and  partnerCompaniesName  !=''">
+                AND   a.partner_companies_name =#{partnerCompaniesName}
+            </if>
+
+            <if test="createTime !=null  and  createTime  !=''">
+                AND  a.create_time =#{createTime}
+            </if>
+            <if test="settlementTime !=null  and  settlementTime  !=''">
+                AND a.settlement_time =#{settlementTime}
+            </if>
+
+            <if test="userId !=null  and  userId  !=''">
+                and a.userId   =#{userId}
+            </if>
+            <if test="companyId !=null  and  companyId  !=''">
+                and a.company_id   =#{companyId}
+            </if>
+            <if test="riskcode !=null  and  riskcode  !=''">
+                and a.riskcode   =#{riskcode}
+            </if>
+            <if test="year !=null  and  year  !=''">
+                AND YEAR(a.signdate) =#{year}
+            </if>
+            <if test="month !=null  and  month !=''">
+                AND month(a.signdate) =#{month}
+            </if>
+            <if test="day !=null  and  day !=''">
+                AND day(a.signdate) =#{day}
+            </if>
+            <if test="insuredName !=null  and  insuredName !=''">
+                AND  a.insured_name =#{insuredName}
+            </if>
+            <if test="jqStartDate  !=null  and  jqStartDate  != ''  and  jqEndDate   != null  and  jqEndDate   !=''">
+                AND DATE(a.jq_start_date) BETWEEN #{jqStartDate} AND #{jqEndDate}
+
+            </if>
+            <if test="syStartDate  !=null  and  syStartDate  != ''  and  syEndDate   != null  and  syEndDate   !=''">
+                AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
+
+            </if>
+            <if test="yearStrat  !=null  and  yearStrat  != ''  and  yearEnd   != null  and  yearEnd   !=''">
+                AND DATE(a.signdate) BETWEEN #{yearStrat} AND #{yearEnd}
+            </if>
+        </where>
+        group by a.partner_companies_id) a
+        left join (select sum(settlement_amount) as "settlementAmount",
+        a.partner_companies_id
+        from sys_insurance_handling_settlement_month a
+        <where>
+            1=1
+            <if test="year !=null  and  year  !=''">
+                AND YEAR(a.signing_time) =#{year}
+            </if>
+            <if test="month !=null  and  month !=''">
+                AND month(a.signing_time) =#{month}
+            </if>
+            <if test="day !=null  and  day !=''">
+                AND day(a.signing_time) =#{day}
+            </if>
+            <if test="isNotCar !=null  and  isNotCar  !=''">
+                and a.is_not_car =#{isNotCar}
+            </if>
+        </where>
+        group by a.partner_companies_id) b on b.partner_companies_id = a.partner_companies_id
+    </select>
+
+    <select id="totalPTAmount" resultType="com.ydtech.modules.fnc.dto.InsPlyIncomePTDto">
+        SELECT
+            pa.docking_person AS "dockingPerson",
+            sum( a.all_fee_value ) AS "sumAmount",
+            sum(case when a.handling_fees_status =1 then a.all_fee_value else 0 end) ysAmount,
+            sum( a.all_fee_value ) - sum(case when a.handling_fees_status =1 then a.all_fee_value else 0 end) wsAmount
+        FROM
+            ins_ply_income a
+            LEFT JOIN esm_ins_company ec ON ec.id = a.company_id
+            LEFT JOIN ptl_agreement pa ON pa.id = a.agreement_id
+        <where>
+            pa.agreement_type = 1
+            <if test="vo.dockingPerson !=null  and  vo.dockingPerson  !=''">
+                and pa.docking_person =#{vo.dockingPerson}
+            </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND  date(a.signdate)  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
+        </where>
+        GROUP BY
+        pa.docking_person,
+        a.handling_fees_status
+        order by  sum( a.all_fee_value ) - sum(case when a.handling_fees_status =1 then a.all_fee_value else 0 end) desc
+    </select>
+
+    <select id="findListByDockingPerson" resultType="com.ydtech.modules.fnc.dto.InsPlyIncomePTCompanyDto">
+        select
+            a.company_name AS "companyName",
+            a.partner_companies_name AS "partnerCompaniesName",
+            sum( a.all_fee_value ) AS "sumAmount",
+            sum( CASE WHEN a.handling_fees_status = 1 THEN a.all_fee_value ELSE 0 END ) ysAmount,
+            sum( a.all_fee_value ) - sum( CASE WHEN a.handling_fees_status = 1 THEN a.all_fee_value ELSE 0 END ) wsAmount
+        from ins_ply_income a
+        LEFT JOIN ptl_agreement pa on pa.id= a.agreement_id
+        <where>
+            pa.agreement_type = 1
+            <if test="vo.dockingPerson !=null  and  vo.dockingPerson  !=''">
+                and pa.docking_person =#{vo.dockingPerson}
+            </if>
+        </where>
+        GROUP BY
+        a.company_name,
+        a.partner_companies_name,
+        pa.docking_person,
+        a.handling_fees_status
+        order by  sum( a.all_fee_value ) - sum(case when a.handling_fees_status =1 then a.all_fee_value else 0 end) desc
+    </select>
 </mapper>

+ 9 - 0
src/main/resources/mapper/modules/fnc/SettlementDocumentaryFeesMapper.xml

@@ -295,6 +295,15 @@
             <if test="completionStatus !=null  and  completionStatus  !=''">
                 and a.completion_status =#{completionStatus}
             </if>
+            <if test="year !=null  and  year  !=''">
+                AND YEAR(a.signing_time) =#{year}
+            </if>
+            <if test="month !=null  and  month !=''">
+                AND month(a.signing_time) =#{month}
+            </if>
+            <if test="day !=null  and  day !=''">
+                AND day(a.signing_time) =#{day}
+            </if>
         </where>
         ORDER  BY  a.create_time desc
 

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

@@ -62,6 +62,39 @@
     </select>
 
 
+    <select id="getSumAmount" resultType="java.util.HashMap">
+        select
+            sum(settlement_amount)  as "settlementAmount",
+            sum(total_amount) as "invoicAmount",
+            sum(remaining_amount) as "notSettleAmount"
+        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>
 
+            <if test="vo.settlementDocumentaryFeesId  !=null  and  vo.settlementDocumentaryFeesId!=''">
+                AND  a.settlement_documentary_fees_id=#{vo.settlementDocumentaryFeesId}
+            </if>
+
+            <if test="vo.isNotCar  !=null  and  vo.isNotCar!=''">
+                AND  a.is_not_car=#{vo.isNotCar}
+            </if>
+            <if test="vo.year !=null  and  vo.year  !=''">
+                AND YEAR(a.signing_time) =#{vo.year}
+            </if>
+            <if test="vo.month !=null  and  vo.month !=''">
+                AND month(a.signing_time) =#{vo.month}
+            </if>
+            <if test="vo.day !=null  and  vo.day !=''">
+                AND day(a.signing_time) =#{vo.day}
+            </if>
+
+        </where>
+    </select>
 
 </mapper>

+ 169 - 1
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -894,11 +894,24 @@
         <if test="vo.deptId  != null  and vo.deptId !=''">
             AND  io.deptId  like concat('%',#{vo.leaderName},'%')
         </if>
+        <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+            AND sd.id  in
+            <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+            AND io.userid  in
+            <foreach collection="taskStatisticsVo.userIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         GROUP BY
         agree.insurance_company,
         iac.company_id,
         agree.partner_companies_id
         ) a
+        order  by a.parterCompanyId
     </select>
 
     <select id="getInsAreaCompanyError"
@@ -919,6 +932,21 @@
             <if test="vo.userId != null  and  vo.userId!=''">
                 AND iace.user_id  =#{vo.userId}
             </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND iace.create_time BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND iace.dept_id  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND iace.user_id  in
+                <foreach collection="taskStatisticsVo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
 
     </select>
@@ -956,6 +984,18 @@
         <if test="vo.deptId  != null  and vo.deptId !=''">
             AND  io.deptId  like concat('%',#{vo.leaderName},'%')
         </if>
+        <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+            AND sd.id  in
+            <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+            AND io.userid  in
+            <foreach collection="taskStatisticsVo.userIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         GROUP BY
         agree.partner_companies_id
         ) a
@@ -1046,6 +1086,19 @@
                 and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
             </if>
 
+            <if test="taskStatisticsVo.deptIds != null and taskStatisticsVo.deptIds != '' and taskStatisticsVo.deptIds.size() > 0">
+                AND sd.id  in
+                <foreach collection="taskStatisticsVo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="taskStatisticsVo.userIds != null and taskStatisticsVo.userIds != '' and taskStatisticsVo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="taskStatisticsVo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
             <if test="taskStatisticsVo.days !=null  and taskStatisticsVo.days !='' ">
                 <choose>
                     <when test="taskStatisticsVo.days =='1'">
@@ -1109,6 +1162,19 @@
                 and io.userid =#{taskStatisticsVo.userId}
             </if>
 
+            <if test="taskStatisticsVo.deptIds != null and taskStatisticsVo.deptIds != '' and taskStatisticsVo.deptIds.size() > 0">
+                AND sd.id  in
+                <foreach collection="taskStatisticsVo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="taskStatisticsVo.userIds != null and taskStatisticsVo.userIds != '' and taskStatisticsVo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="taskStatisticsVo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
             <if test="taskStatisticsVo.days !=null  and taskStatisticsVo.days !='' ">
                 <choose>
                     <when test="taskStatisticsVo.days =='1'">
@@ -1187,6 +1253,18 @@
             <if test="taskStatisticsVo.days !=null  and taskStatisticsVo.days !='' ">
                 and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
             </if>
+            <if test="taskStatisticsVo.deptIds != null and taskStatisticsVo.deptIds != '' and taskStatisticsVo.deptIds.size() > 0">
+                AND io.deptid  in
+                <foreach collection="taskStatisticsVo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="taskStatisticsVo.userIds != null and taskStatisticsVo.userIds != '' and taskStatisticsVo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="taskStatisticsVo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
         GROUP BY
         pa.insurance_company_id,
@@ -1235,6 +1313,18 @@
             <if test="taskStatisticsVo.days !=null  and taskStatisticsVo.days !='' ">
                 and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
             </if>
+            <if test="taskStatisticsVo.deptIds != null and taskStatisticsVo.deptIds != '' and taskStatisticsVo.deptIds.size() > 0">
+                AND io.deptid  in
+                <foreach collection="taskStatisticsVo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="taskStatisticsVo.userIds != null and taskStatisticsVo.userIds != '' and taskStatisticsVo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="taskStatisticsVo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
         GROUP BY
         pa.insurance_company_id,
@@ -1292,6 +1382,19 @@
                 and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{taskStatisticsVo.days} DAY)
             </if>
 
+            <if test="taskStatisticsVo.deptIds != null and taskStatisticsVo.deptIds != '' and taskStatisticsVo.deptIds.size() > 0">
+                AND sd.id  in
+                <foreach collection="taskStatisticsVo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="taskStatisticsVo.userIds != null and taskStatisticsVo.userIds != '' and taskStatisticsVo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="taskStatisticsVo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
             <if test="taskStatisticsVo.days !=null  and taskStatisticsVo.days !='' ">
                 <choose>
                     <when test="taskStatisticsVo.days =='1'">
@@ -1398,6 +1501,19 @@
             <if test="taskStatisticsVo.beginDate !=null and taskStatisticsVo.beginDate != '' and taskStatisticsVo.endDate !=null and taskStatisticsVo.endDate != ''">
                 AND   DATE_FORMAT( ifa.audittime, '%Y-%m-%d')   BETWEEN  DATE_FORMAT( #{taskStatisticsVo.beginDate}, '%Y-%m-%d')   AND  DATE_FORMAT( #{taskStatisticsVo.endDate}, '%Y-%m-%d')
             </if>
+            <if test="taskStatisticsVo.deptIds != null and taskStatisticsVo.deptIds != '' and taskStatisticsVo.deptIds.size() > 0">
+                AND io.deptid  in
+                <foreach collection="taskStatisticsVo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="taskStatisticsVo.userIds != null and taskStatisticsVo.userIds != '' and taskStatisticsVo.userIds.size() > 0">
+                AND su.id  in
+                <foreach collection="taskStatisticsVo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
             <choose>
                 <when test="taskStatisticsVo.riskCode != null and taskStatisticsVo.riskCode != '' and  taskStatisticsVo.riskCode != 'all' ">
                     and iac.product = #{taskStatisticsVo.riskCode}
@@ -1512,9 +1628,22 @@
             <if test="vo.createtimeStart  != null  and  vo.createtimeStart!=''  and vo.createtimeEnd  != null  and  vo.createtimeEnd!=''">
                 AND iac.createtime BETWEEN #{vo.createtimeStart} AND #{vo.createtimeEnd}
             </if>
-        <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
                 AND iac.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
             </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND io.deptid  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
         GROUP BY
         io.userid,
@@ -1653,6 +1782,19 @@
         <if test="vo.houseId != null and vo.houseId != ''">
             and io.deptid like "${vo.houseId}%"
         </if>
+        <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+            AND io.deptid  in
+            <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+
+        <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+            AND io.userid  in
+            <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         GROUP BY
         agree.insurance_company_id,
         agree.insurance_company,
@@ -1723,6 +1865,19 @@
         <if test="vo.quotationStatus != null and vo.quotationStatus != ''">
             and iac.orderstatus  =#{vo.quotationStatus}
         </if>
+        <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+            AND io.deptid  in
+            <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+
+        <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+            AND io.userid  in
+            <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
         GROUP BY
         agree.insurance_company_id,
         agree.insurance_company,
@@ -1798,6 +1953,19 @@
             <if test="vo.year  != null  and  vo.year!='' ">
                 AND DATE_FORMAT( io.createtime, '%Y') =#{vo.year}
             </if>
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND io.deptid  in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.userIds != null and vo.userIds != '' and vo.userIds.size() > 0">
+                AND io.userid  in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
         ) b
         GROUP  BY

+ 9 - 1
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -53,6 +53,7 @@
         <result property="leaderName" column="leader_name" jdbcType="VARCHAR"/>
         <result property="leaderId" column="leader_id" jdbcType="VARCHAR"/>
         <result property="underwritingStatus" column="underwritingStatus" jdbcType="INTEGER"/>
+        <result property="entryStatus" column="entryStatus" jdbcType="VARCHAR"/>
     </resultMap>
     <resultMap id="OrderResultMap" type="com.ydtech.modules.order.entity.vo.OrderVo">
         <id property="orderno" column="orderno" jdbcType="VARCHAR"/>
@@ -908,7 +909,8 @@
         WHEN '2' THEN '个代'
         WHEN '3' THEN '电销'
         ELSE '' END
-        AS managementSource
+        AS managementSource,
+        io.entry_status  as entryStatus
         from
             ins_area_company iac
         left JOIN
@@ -1043,6 +1045,9 @@
             <if test="orderQueryVo.signStartDateStr != null and orderQueryVo.signEndDateStr != null">
                 and  DATE_FORMAT(iac.signing_time, '%Y-%m-%d') between #{orderQueryVo.signStartDateStr} AND #{orderQueryVo.signEndDateStr}
             </if>
+            <if test="orderQueryVo.entryStatus != null and orderQueryVo.entryStatus != ''">
+                and io.entry_status = #{orderQueryVo.entryStatus }
+            </if>
         </where>
         order by io.createtime desc
     </select>
@@ -1181,6 +1186,9 @@
             <if test="orderQueryVo.signStartDateStr != null and orderQueryVo.signEndDateStr != null">
                 and  DATE_FORMAT(iac.signing_time, '%Y-%m-%d') between #{orderQueryVo.signStartDateStr} AND #{orderQueryVo.signEndDateStr}
             </if>
+            <if test="orderQueryVo.entryStatus != null and orderQueryVo.entryStatus != ''">
+                and io.entry_status = #{orderQueryVo.entryStatus }
+            </if>
         </where>
         ) as s
     </select>

+ 12 - 0
src/main/resources/mapper/modules/protocol/PtlAgreementMapper.xml

@@ -196,6 +196,13 @@
                 AND pa.id IN ( SELECT DISTINCT agreement_id FROM ptl_agreement_dept WHERE dept_id LIKE
                 concat(#{vo.deptId},'%') )
             </if>
+
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND pa.id IN ( SELECT DISTINCT agreement_id FROM ptl_agreement_dept WHERE dept_id  in
+                 <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                #{item}
+                </foreach>)
+            </if>
             <if test="vo.warningDay  !=null  and   vo.warningDay  !=''">
                 <choose>
                     <when test="warningDay==1">
@@ -259,6 +266,11 @@
         select a.*,
         CONCAT_WS( '-', a.agreement_abbreviation, NULLIF(a.business_description, '' ), NULLIF(a.job_description, '' ) ) AS agreementName
         from ptl_agreement a
+        <where>
+            <if test="vo.agreementType  !=null  and   vo.agreementType  !=''">
+                AND a.agreement_type =#{vo.agreementType}
+            </if>
+        </where>
         order by  a.agreement_code
     </select>
 </mapper>