فهرست منبع

Merge branch 'test' into 2.0

# Conflicts:
#	src/main/java/com/ydtech/modules/order/entity/vo/InsOrdersEditingVo.java
#	src/main/resources/application-pre.yml
785834757 2 سال پیش
والد
کامیت
46e14d8ae3
65فایلهای تغییر یافته به همراه1707 افزوده شده و 549 حذف شده
  1. 7 0
      sql/Online.sql
  2. 9 1
      src/main/java/com/ydtech/modules/admin/constants/SwitchConfig.java
  3. 1 5
      src/main/java/com/ydtech/modules/admin/controller/SysPcAddressController.java
  4. 127 119
      src/main/java/com/ydtech/modules/admin/controller/SysUserAccountController.java
  5. 1 1
      src/main/java/com/ydtech/modules/admin/controller/deptBalance/DeptBalanceController.java
  6. 49 3
      src/main/java/com/ydtech/modules/admin/controller/khgl/KhglDataController.java
  7. 15 0
      src/main/java/com/ydtech/modules/admin/controller/taskStatistics/TaskStatisticsController.java
  8. 1 5
      src/main/java/com/ydtech/modules/admin/controller/websocket/SysGeographyPositionController.java
  9. 1 0
      src/main/java/com/ydtech/modules/admin/controller/websocket/WebSocketServer.java
  10. 6 0
      src/main/java/com/ydtech/modules/admin/dao/TaskStatisticsMapper.java
  11. 13 0
      src/main/java/com/ydtech/modules/admin/model/dto/AgreeReportQueryDto.java
  12. 5 1
      src/main/java/com/ydtech/modules/admin/model/dto/DxReportDataDto.java
  13. 0 3
      src/main/java/com/ydtech/modules/admin/model/dto/ExportExpenditureTypeDetalsSZDto.java
  14. 24 0
      src/main/java/com/ydtech/modules/admin/model/dto/FeeLookSwitchesDTO.java
  15. 23 5
      src/main/java/com/ydtech/modules/admin/model/dto/MyCollectInAdvanceAllDto.java
  16. 0 4
      src/main/java/com/ydtech/modules/admin/model/dto/MyCollectInAdvanceDto.java
  17. 4 0
      src/main/java/com/ydtech/modules/admin/model/dto/PcAddressInfoDto.java
  18. 9 0
      src/main/java/com/ydtech/modules/admin/model/dto/TaskStatisticsDto.java
  19. 25 0
      src/main/java/com/ydtech/modules/admin/model/vo/MyIncomeAndExpensesNewPageVo.java
  20. 3 0
      src/main/java/com/ydtech/modules/admin/model/vo/QxFrontlineAgentVo.java
  21. 4 0
      src/main/java/com/ydtech/modules/admin/model/vo/TaskStatisticsVo.java
  22. 1 1
      src/main/java/com/ydtech/modules/admin/service/GeoService.java
  23. 29 2
      src/main/java/com/ydtech/modules/admin/service/SysSwitchConfigService.java
  24. 3 2
      src/main/java/com/ydtech/modules/admin/service/SysUserAccountService.java
  25. 7 0
      src/main/java/com/ydtech/modules/admin/service/TaskStatisticsService.java
  26. 34 22
      src/main/java/com/ydtech/modules/admin/service/impl/DxDataServiceImpl.java
  27. 3 1
      src/main/java/com/ydtech/modules/admin/service/impl/ProfitAnalysisServiceImpl.java
  28. 9 2
      src/main/java/com/ydtech/modules/admin/service/impl/SysGeographyPositionServiceImpl.java
  29. 9 2
      src/main/java/com/ydtech/modules/admin/service/impl/SysPcAddressServiceImpl.java
  30. 34 0
      src/main/java/com/ydtech/modules/admin/service/impl/SysSwitchConfigServiceImpl.java
  31. 308 292
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java
  32. 64 5
      src/main/java/com/ydtech/modules/admin/service/impl/TaskStatisticsServiceImpl.java
  33. 19 0
      src/main/java/com/ydtech/modules/constants/GroupType.java
  34. 18 0
      src/main/java/com/ydtech/modules/constants/MessageType.java
  35. 34 0
      src/main/java/com/ydtech/modules/customer/components/CustomerComponents.java
  36. 38 0
      src/main/java/com/ydtech/modules/customer/controller/CustomerController.java
  37. 18 0
      src/main/java/com/ydtech/modules/customer/dao/CusChatMessagesMapper.java
  38. 155 0
      src/main/java/com/ydtech/modules/customer/entity/po/CusChatMessages.java
  39. 15 0
      src/main/java/com/ydtech/modules/customer/service/CusChatMessagesService.java
  40. 22 0
      src/main/java/com/ydtech/modules/customer/service/CustomerService.java
  41. 24 0
      src/main/java/com/ydtech/modules/customer/service/impl/CusChatMessagesServiceImpl.java
  42. 50 0
      src/main/java/com/ydtech/modules/customer/service/impl/CustomerServiceImpl.java
  43. 0 1
      src/main/java/com/ydtech/modules/fee/controller/ConfigController.java
  44. 68 0
      src/main/java/com/ydtech/modules/fee/dto/vo/RuleAttrMappingVo.java
  45. 58 0
      src/main/java/com/ydtech/modules/fee/service/FeeDisplayService.java
  46. 112 0
      src/main/java/com/ydtech/modules/fee/service/impl/FeeDisplayServiceImpl.java
  47. 21 0
      src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java
  48. 6 5
      src/main/java/com/ydtech/modules/order/aop/aspect/QuoteVerificationAspect.java
  49. 24 0
      src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerCustomerRequest.java
  50. 24 2
      src/main/java/com/ydtech/modules/order/entity/vo/FeeOrderNewVo.java
  51. 29 8
      src/main/java/com/ydtech/modules/order/entity/vo/InsOrdersEditingVo.java
  52. 8 2
      src/main/java/com/ydtech/modules/order/entity/vo/OrderVo.java
  53. 15 3
      src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java
  54. 9 3
      src/main/resources/application-pre.yml
  55. 9 3
      src/main/resources/application-prod.yml
  56. 9 3
      src/main/resources/application-test.yml
  57. 7 3
      src/main/resources/mapper/modules/admin/SysTelemarketingWechatDataMapper.xml
  58. 1 1
      src/main/resources/mapper/modules/admin/SysUserLinkZgdUserIdMapper.xml
  59. 1 1
      src/main/resources/mapper/modules/admin/SysUserLinkZzbUserIdMapper.xml
  60. 4 0
      src/main/resources/mapper/modules/admin/SysUserMapper.xml
  61. 5 0
      src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml
  62. 23 0
      src/main/resources/mapper/modules/customer/CusChatMessagesMapper.xml
  63. 3 0
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml
  64. 2 3
      src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml
  65. 48 35
      src/main/resources/mapper/modules/protocol/PtlAgreementMapper.xml

+ 7 - 0
sql/Online.sql

@@ -273,3 +273,10 @@ ALTER TABLE `sys_pc_address_history` ADD COLUMN `district` varchar(30) COLLATE u
 
 -- add by  hxl  2024-09-04
 ALTER TABLE `sys_dept_internal_agent` ADD COLUMN `bind_dept_id` varchar(30) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '绑定机构id';
+-- add by  helixiao  2024-09-11
+ALTER TABLE `sys_geography_position` ADD COLUMN  `leader_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '领导人姓名';
+ALTER TABLE `sys_geography_position_record` ADD COLUMN  `source` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '机构来源(1-渠道、2-个代)';
+
+ALTER TABLE `sys_pc_address` ADD COLUMN  `leader_name` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '领导人姓名';
+ALTER TABLE `sys_pc_address_history` ADD COLUMN  `source` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '机构来源(1-渠道、2-个代)';
+ALTER TABLE sys_pc_address_history RENAME COLUMN 'prov' TO 'province';

+ 9 - 1
src/main/java/com/ydtech/modules/admin/constants/SwitchConfig.java

@@ -13,7 +13,15 @@ import lombok.Getter;
 public enum SwitchConfig {
 
     SC_01("proxyCustomerAgent", "代客录单(代理人启动)"),
-    SC_02("proxyCustomerChannel", "代客录单(渠道启动)");
+    SC_02("proxyCustomerChannel", "代客录单(渠道启动)"),
+
+    // 费用查看是否 / 10
+    FEE_01("feeViewAgent", "掌柜币显示(代理人启动)"),
+    FEE_02("feeViewChannel", "掌柜币显示(渠道启动)"),
+
+    // 是否显示费用
+    FDA_01("feeDisplayAgent", "费用显示(代理人启动)"),
+    FDA_02("feeDisplayChannel", "费用显示(渠道启动)");
 
     private final String code;
 

+ 1 - 5
src/main/java/com/ydtech/modules/admin/controller/SysPcAddressController.java

@@ -105,11 +105,7 @@ public class SysPcAddressController extends BaseController{
     @GetMapping("/getPcAddress")
     @ApiOperation(value = "历史在线人数")
     public HttpResult<PcAddressHistoryInfoVo> getPcAddress(@RequestParam(value = "dates",required = false) String dates) {
-        if (StringUtils.isNullOrEmpty(dates)) {
-            Date date = new Date();
-            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            dates = simpleDateFormat.format(date);
-        }
+
         return HttpResult.ok("success", this.sysPcAddressService.getPcAddress(dates));
     }
 

+ 127 - 119
src/main/java/com/ydtech/modules/admin/controller/SysUserAccountController.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.dto.*;
 import com.ydtech.modules.admin.model.po.SysUserAccount;
+import com.ydtech.modules.admin.model.vo.MyIncomeAndExpensesNewPageVo;
 import com.ydtech.modules.admin.model.vo.SubOrder;
 import com.ydtech.modules.admin.model.vo.SysUserAccountVo;
 import com.ydtech.modules.admin.service.SysUserAccountService;
@@ -38,15 +39,15 @@ public class SysUserAccountController extends BaseController {
 
     @PostMapping("/queryPage")
     @ApiOperation(value = "用户账户表分页")
-    public HttpResult<BasePageResult<SysUserAccount>> queryPageOrder(@RequestBody @Valid SysUserAccountVo sysUserAccountVo ) {
+    public HttpResult<BasePageResult<SysUserAccount>> queryPageOrder(@RequestBody @Valid SysUserAccountVo sysUserAccountVo) {
         BasePageResult<SysUserAccount> result = sysUserAccountService.queryByVo(sysUserAccountVo);
         return HttpResult.ok("success", result);
     }
 
     @PostMapping("/queryPageList")
     @ApiOperation(value = "用户账户表分页2")
-    public HttpResult<IPage<SysUserAccount>> queryPageList(@RequestBody SysUserAccountVo sysUserAccountVo ) {
-            IPage<SysUserAccount> result = sysUserAccountService.queryByVo1(sysUserAccountVo);
+    public HttpResult<IPage<SysUserAccount>> queryPageList(@RequestBody SysUserAccountVo sysUserAccountVo) {
+        IPage<SysUserAccount> result = sysUserAccountService.queryByVo1(sysUserAccountVo);
         return HttpResult.ok("success", result);
     }
 
@@ -56,11 +57,12 @@ public class SysUserAccountController extends BaseController {
     public HttpResult<Object> submit(@RequestBody SysUserAccountVo sysUserAccountVo) {
         return sysUserAccountService.inert(sysUserAccountVo);
     }
+
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/19 8:52
-     *  @Description:  提现
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/19 8:52
+     * @Description: 提现
      */
     @PostMapping("/withdraw")
     @ApiOperation("提现")
@@ -76,230 +78,236 @@ public class SysUserAccountController extends BaseController {
 
     @GetMapping(value = "/getSysAllAmount")
     @ApiOperation("用户余额new")
-    public HttpResult<SysUserAccountVo>  getSysAllAmount (){
-        String   userId = BaseController.getUser().getId();
+    public HttpResult<SysUserAccountVo> getSysAllAmount() {
+        String userId = BaseController.getUser().getId();
         SysUserAccountVo result = sysUserAccountService.getSysAllAmount(userId);
-        return  HttpResult.ok("success", result);
+        return HttpResult.ok("success", result);
     }
+
     @PostMapping("getInsOrders")
     @ApiOperation("获取预收实收列表数据")
-    public HttpResult<SysUserAccountVo>  getInsOrders(@RequestBody SysUserAccountVo sysUserAccountVo){
+    public HttpResult<SysUserAccountVo> getInsOrders(@RequestBody SysUserAccountVo sysUserAccountVo) {
 
-        if(StringUtils.isBlank(sysUserAccountVo.getAmountType())){
+        if (StringUtils.isBlank(sysUserAccountVo.getAmountType())) {
             return HttpResult.error("金额类型(手续费金额1跟单金额2推广金额3)amountType不能为空");
         }
         //预收实收类型
-        if(StringUtils.isBlank(sysUserAccountVo.getSearchType())){
+        if (StringUtils.isBlank(sysUserAccountVo.getSearchType())) {
             return HttpResult.error("预收实收类型(预收1实收2)searchType不能为空");
         }
         //查询时间
-        if(StringUtils.isBlank(sysUserAccountVo.getTimeFiltering())){
+        if (StringUtils.isBlank(sysUserAccountVo.getTimeFiltering())) {
             return HttpResult.error("查询时间timeFiltering不能为空");
         }
-        try{
-            SysUserAccountVo result =sysUserAccountService.getInsOrders(sysUserAccountVo);
-            return  HttpResult.ok("success", result);
-        }catch (Exception e){
-            return HttpResult.error("查询失败"+e.getMessage());
+        try {
+            SysUserAccountVo result = sysUserAccountService.getInsOrders(sysUserAccountVo);
+            return HttpResult.ok("success", result);
+        } catch (Exception e) {
+            return HttpResult.error("查询失败" + e.getMessage());
         }
     }
+
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/3 15:03
-     *  @Description: 通过子订单编号查询订单的详情页面
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/3 15:03
+     * @Description: 通过子订单编号查询订单的详情页面
      */
     @GetMapping("getSubOrderDetails")
     @ApiOperation("获取推广费订单详情")
-    public HttpResult<SubOrder>  getSubOrderDetails(String subOrderId){
-        if(StringUtils.isBlank(subOrderId)){
+    public HttpResult<SubOrder> getSubOrderDetails(String subOrderId) {
+        if (StringUtils.isBlank(subOrderId)) {
             return HttpResult.error("订单号subOrderId不能为空");
         }
-        try{
-            SubOrder subOrder =sysUserAccountService.getSubOrderDetails(subOrderId,BaseController.getUser().getId());
-            return  HttpResult.ok("success", subOrder);
-        }catch (Exception e){
-            return HttpResult.error("操作失败"+e.getMessage());
+        try {
+            SubOrder subOrder = sysUserAccountService.getSubOrderDetails(subOrderId, BaseController.getUser().getId());
+            return HttpResult.ok("success", subOrder);
+        } catch (Exception e) {
+            return HttpResult.error("操作失败" + e.getMessage());
         }
     }
 
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/19 9:00
-     *  @Description: 查询我的账户金额
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/19 9:00
+     * @Description: 查询我的账户金额
      */
     @GetMapping("getUserSumAmountByUserId")
     @ApiOperation("查询我的账户总金额")
-    public HttpResult<BigDecimal>  getUserSumAmountByUserId(String userId){
-        try{
-            BigDecimal sumAmount  =sysUserAccountService.getUserSumAmountByUserId(userId);
-            return  HttpResult.ok("success", sumAmount);
-        }catch (Exception e){
-            return HttpResult.error("操作失败"+e.getMessage());
+    public HttpResult<BigDecimal> getUserSumAmountByUserId(String userId) {
+        try {
+            BigDecimal sumAmount = sysUserAccountService.getUserSumAmountByUserId(userId);
+            return HttpResult.ok("success", sumAmount);
+        } catch (Exception e) {
+            return HttpResult.error("操作失败" + e.getMessage());
         }
     }
+
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/19 9:14
-     *  @Description: 查询我的预收明细
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/19 9:14
+     * @Description: 查询我的预收明细
      */
     @PostMapping("findMyCollectInAdvanceByUserId")
     @ApiOperation("查询我的预收明细")
-    public HttpResult<MyCollectInAdvanceAllDto>  findMyCollectInAdvanceByUserId(@RequestBody MyCollectInAdvanceQueryDto myCollectInAdvanceQueryDto){
-       return  HttpResult.ok(sysUserAccountService.findMyCollectInAdvanceByUserId(myCollectInAdvanceQueryDto));
+    public HttpResult<MyCollectInAdvanceAllDto> findMyCollectInAdvanceByUserId(@RequestBody MyCollectInAdvanceQueryDto myCollectInAdvanceQueryDto) {
+        return HttpResult.ok(sysUserAccountService.findMyCollectInAdvanceByUserId(myCollectInAdvanceQueryDto));
     }
 
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/19 9:14
-     *  @Description: 查询我的预收的数据
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/19 9:14
+     * @Description: 查询我的预收的数据
      */
     @PostMapping("findMyIncomeAndExpensesByUserId")
     @ApiOperation("查询我的收支明细")
-    public HttpResult<MyCollectInAdvanceAllDto>  findIncomeAndExpensesByUserId(@RequestBody MyIncomeAndExpensesQueryDto myIncomeAndExpensesQueryDto){
-      return  HttpResult.ok(sysUserAccountService.findIncomeAndExpensesByUserId(myIncomeAndExpensesQueryDto));
+    public HttpResult<MyCollectInAdvanceAllDto> findIncomeAndExpensesByUserId(@RequestBody MyIncomeAndExpensesQueryDto myIncomeAndExpensesQueryDto) {
+        return HttpResult.ok(sysUserAccountService.findIncomeAndExpensesByUserId(myIncomeAndExpensesQueryDto));
     }
 
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/19 9:14
-     *  @Description: 提现中、已提现的详情
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/19 9:14
+     * @Description: 提现中、已提现的详情
      */
     @GetMapping("findDetailById")
     @ApiOperation("提现的详情")
-    public HttpResult<WithdrawalDetalsDto>  findDetailById(String  id){
-        return  HttpResult.ok(sysUserAccountService.findDetailById(id));
+    public HttpResult<WithdrawalDetalsDto> findDetailById(String id) {
+        return HttpResult.ok(sysUserAccountService.findDetailById(id));
     }
+
     /**
-    @PostMapping("findOrderDetailById")
-    @ApiOperation("订单详情")
-    public HttpResult<OrderDetalsDto>  findOrderDetailById(String subOrderId){
-        return  HttpResult.ok(sysUserAccountService.findOrderDetailById(subOrderId));
-    }
-    **/
+     * @PostMapping("findOrderDetailById")
+     * @ApiOperation("订单详情") public HttpResult<OrderDetalsDto>  findOrderDetailById(String subOrderId){
+     * return  HttpResult.ok(sysUserAccountService.findOrderDetailById(subOrderId));
+     * }
+     **/
 
     @GetMapping("findRefundDetailById")
     @ApiOperation("退款详情")
-    public HttpResult<RefundDetalsDto>  findRefundDetailById(String  id){
-        return  HttpResult.ok(sysUserAccountService.findRefundDetailById(id));
+    public HttpResult<RefundDetalsDto> findRefundDetailById(String id) {
+        return HttpResult.ok(sysUserAccountService.findRefundDetailById(id));
     }
 
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/30 19:14
-     *  @Description: 查询我的车险明细
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/30 19:14
+     * @Description: 查询我的车险明细
      */
     @PostMapping("findMyInsuranceByUserId")
     @ApiOperation("查询我的车险明细")
-    public HttpResult<BasePageResult<ExportExpenditureTypeDetalsDto>>  findMyInsuranceByUserId(@RequestBody MyInsuranceQueryDto myInsuranceQueryDto){
-        return  HttpResult.ok(sysUserAccountService.findMyInsuranceByUserId(myInsuranceQueryDto));
+    public HttpResult<MyIncomeAndExpensesNewPageVo<ExportExpenditureTypeDetalsDto>> findMyInsuranceByUserId(@RequestBody MyInsuranceQueryDto myInsuranceQueryDto) {
+        return HttpResult.ok(sysUserAccountService.findMyInsuranceByUserId(myInsuranceQueryDto));
     }
 
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/30 19:14
-     *  @Description: 查询我的推广费明细
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/30 19:14
+     * @Description: 查询我的推广费明细
      */
     @PostMapping("findMyInsuranceTGByUserId")
     @ApiOperation("查询我的推广费明细")
-    public HttpResult<BasePageResult<ExportExpenditureTypeDetalsTGDto>>  findMyInsuranceTGByUserId(@RequestBody MyInsuranceTgQueryDto myInsuranceTgQueryDto){
-        return  HttpResult.ok(sysUserAccountService.findMyInsuranceTGByUserId(myInsuranceTgQueryDto));
+    public HttpResult<BasePageResult<ExportExpenditureTypeDetalsTGDto>> findMyInsuranceTGByUserId(@RequestBody MyInsuranceTgQueryDto myInsuranceTgQueryDto) {
+        return HttpResult.ok(sysUserAccountService.findMyInsuranceTGByUserId(myInsuranceTgQueryDto));
     }
 
 
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/30 19:14
-     *  @Description:  查询导出车险明细
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/30 19:14
+     * @Description: 查询导出车险明细
      */
     @PostMapping("exportMyInsuranceByUserId")
     @ApiOperation("查询导出车险明细")
-    public HttpResult<List<ExportExpenditureTypeDetalsDto>>  exportMyInsuranceByUserId(@RequestBody MyInsuranceQueryDto myInsuranceQueryDto){
+    public HttpResult<List<ExportExpenditureTypeDetalsDto>> exportMyInsuranceByUserId(@RequestBody MyInsuranceQueryDto myInsuranceQueryDto) {
         List<ExportExpenditureTypeDetalsDto> exportIncomeTypeDetalsList = sysUserAccountService.exportMyInsuranceByUserId(myInsuranceQueryDto);
         ExcelUtils<ExportExpenditureTypeDetalsDto> excelUtils = new ExcelUtils<>(ExportExpenditureTypeDetalsDto.class);
         String fileName = "车险明细" + System.currentTimeMillis() + ".xlsx";
-        String saveFilePath = uploadPath+"//" + EXCEL_PATH + fileName;
+        String saveFilePath = uploadPath + "//" + EXCEL_PATH + fileName;
         String resultPath = UPLOAD_PATH + fileName;
         String sheetName = "车险明细表";
-        try{
-            excelUtils.writeExcelNew(saveFilePath,sheetName, exportIncomeTypeDetalsList);
+        try {
+            excelUtils.writeExcelNew(saveFilePath, sheetName, exportIncomeTypeDetalsList);
             return HttpResult.ok(resultPath);
-        }catch(Exception e){
-            return HttpResult.error("导出车险明细表失败:"+e.getMessage());
+        } catch (Exception e) {
+            return HttpResult.error("导出车险明细表失败:" + e.getMessage());
         }
     }
 
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/30 19:14
-     *  @Description:  查询导出推广费明细
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/30 19:14
+     * @Description: 查询导出推广费明细
      */
     @PostMapping("expeortMyInsuranceTGByUserId")
     @ApiOperation("查询导出推广费明细")
-    public HttpResult<List<ExportExpenditureTypeDetalsTGDto>>  expeortMyInsuranceTGByUserId(@RequestBody MyInsuranceTgQueryDto myInsuranceTgQueryDto){
+    public HttpResult<List<ExportExpenditureTypeDetalsTGDto>> expeortMyInsuranceTGByUserId(@RequestBody MyInsuranceTgQueryDto myInsuranceTgQueryDto) {
         List<ExportExpenditureTypeDetalsTGDto> exportIncomeTypeDetalsList = sysUserAccountService.exportMyInsuranceTGByUserId(myInsuranceTgQueryDto);
         ExcelUtils<ExportExpenditureTypeDetalsTGDto> excelUtils = new ExcelUtils<>(ExportExpenditureTypeDetalsTGDto.class);
         String fileName = "推广费明细" + System.currentTimeMillis() + ".xlsx";
-        String saveFilePath = uploadPath+"//" + EXCEL_PATH + fileName;
+        String saveFilePath = uploadPath + "//" + EXCEL_PATH + fileName;
         String resultPath = UPLOAD_PATH + fileName;
         String sheetName = "推广费明细表";
-        try{
-            excelUtils.writeExcelNew(saveFilePath,sheetName, exportIncomeTypeDetalsList);
+        try {
+            excelUtils.writeExcelNew(saveFilePath, sheetName, exportIncomeTypeDetalsList);
             return HttpResult.ok(resultPath);
-        }catch(Exception e){
-            return HttpResult.error("导出推广费明细表失败:"+e.getMessage());
+        } catch (Exception e) {
+            return HttpResult.error("导出推广费明细表失败:" + e.getMessage());
         }
     }
+
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/30 19:14
-     *  @Description:  收支明细
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/30 19:14
+     * @Description: 收支明细
      */
     @PostMapping("findMyIncomeAndExpensesNewByUserId")
     @ApiOperation("查询收支明细新")
-    public HttpResult<BasePageResult<ExportExpenditureTypeDetalsSZDto>>  findMyIncomeAndExpensesNewByUserId(@RequestBody MyCollectInAdvanceQueryNewDto myCollectInAdvanceQueryNewDto){
-        return  HttpResult.ok(sysUserAccountService.findMyIncomeAndExpensesNewByUserId(myCollectInAdvanceQueryNewDto));
+    public HttpResult<MyIncomeAndExpensesNewPageVo<ExportExpenditureTypeDetalsSZDto>> findMyIncomeAndExpensesNewByUserId(@RequestBody MyCollectInAdvanceQueryNewDto myCollectInAdvanceQueryNewDto) {
+        return HttpResult.ok(sysUserAccountService.findMyIncomeAndExpensesNewByUserId(myCollectInAdvanceQueryNewDto));
     }
+
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/7/1 8:57
-     *  @Description: 导出收支明细新
+     * @version
+     * @author: hxl
+     * @Date: 2024/7/1 8:57
+     * @Description: 导出收支明细新
      */
     @PostMapping("exportMyIncomeAndExpensesNewByUserId")
     @ApiOperation("导出收支明细新")
-    public HttpResult<MyCollectInAdvanceAllDto>  exportMyIncomeAndExpensesNewByUserId(@RequestBody MyCollectInAdvanceQueryNewDto myCollectInAdvanceQueryNewDto){
+    public HttpResult<MyCollectInAdvanceAllDto> exportMyIncomeAndExpensesNewByUserId(@RequestBody MyCollectInAdvanceQueryNewDto myCollectInAdvanceQueryNewDto) {
         List<ExportExpenditureTypeDetalsSZDto> exportIncomeTypeDetalsList = sysUserAccountService.exportMyIncomeAndExpensesNewByUserId(myCollectInAdvanceQueryNewDto);
         ExcelUtils<ExportExpenditureTypeDetalsSZDto> excelUtils = new ExcelUtils<>(ExportExpenditureTypeDetalsSZDto.class);
         String fileName = "收支明细" + System.currentTimeMillis() + ".xlsx";
-        String saveFilePath = uploadPath+"//" + EXCEL_PATH + fileName;
+        String saveFilePath = uploadPath + "//" + EXCEL_PATH + fileName;
         String resultPath = UPLOAD_PATH + fileName;
         String sheetName = "收支明细表";
-        try{
-            excelUtils.writeExcelNew(saveFilePath,sheetName, exportIncomeTypeDetalsList);
+        try {
+            excelUtils.writeExcelNew(saveFilePath, sheetName, exportIncomeTypeDetalsList);
             return HttpResult.ok(resultPath);
-        }catch(Exception e){
-            return HttpResult.error("导出收支明细表失败:"+e.getMessage());
+        } catch (Exception e) {
+            return HttpResult.error("导出收支明细表失败:" + e.getMessage());
         }
     }
+
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/30 18:43
-     *  @Description: 我的账户页面的数据
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/30 18:43
+     * @Description: 我的账户页面的数据
      */
     @PostMapping("findMyAmount")
     @ApiOperation("我的账户页面的数据")
-    public HttpResult<MySumAmountDto>  findMyAmount(@RequestBody MySumAmountQueryDto mySumAmountQueryDto){
+    public HttpResult<MySumAmountDto> findMyAmount(@RequestBody MySumAmountQueryDto mySumAmountQueryDto) {
         MySumAmountDto amountDto = sysUserAccountService.findMyAmount(mySumAmountQueryDto);
         return HttpResult.ok(amountDto);
     }

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

@@ -108,7 +108,7 @@ public class DeptBalanceController {
         }else{
             if("1".equals(type)){
                 // 近1天
-                startDateStr= SliceUpDateUtil.getBeforeDay(new Date(),5)+" 00:00:00";
+                startDateStr= SliceUpDateUtil.getBeforeDay(new Date(),0)+" 00:00:00";
                 endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
             }else if("2".equals(type)){
                 // 近7天

+ 49 - 3
src/main/java/com/ydtech/modules/admin/controller/khgl/KhglDataController.java

@@ -14,6 +14,7 @@ import com.ydtech.modules.admin.model.vo.KztDataPermissionVo;
 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.SliceUpDateUtil;
 import com.ydtech.modules.order.entity.BasePageResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -22,6 +23,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 
 @Api(tags = "电销统计数据")
@@ -124,6 +127,9 @@ public class KhglDataController {
     @PostMapping("/queryDxDataPage")
     @ApiOperation(value = "查询用户所有的数据分页")
     public HttpResult<BasePageResult<DxReportDataDto>> queryDxDataPage(@RequestBody DxQueryVo dxQueryVo){
+        HashMap<String, String> map = getDateMapByType(dxQueryVo.getType(), dxQueryVo.getBeginDate(), dxQueryVo.getEndDate(),"2");
+        dxQueryVo.setBeginDate(map.get("startDate"));
+        dxQueryVo.setEndDate(map.get("endDate"));
         return HttpResult.ok(dxDataService.queryPage(dxQueryVo));
     }
 
@@ -139,9 +145,12 @@ public class KhglDataController {
         if(StringUtils.isBlank(dxQueryVo.getUserId())){
             return HttpResult.error("用户id不能为空!!!");
         }
-        if(StringUtils.isBlank(dxQueryVo.getBeginDate())  || StringUtils.isBlank(dxQueryVo.getEndDate())){
-            return HttpResult.error("开始时间和结束时间不能为空!!!");
-        }
+        //if(StringUtils.isBlank(dxQueryVo.getBeginDate())  || StringUtils.isBlank(dxQueryVo.getEndDate())){
+        //    return HttpResult.error("开始时间和结束时间不能为空!!!");
+        //}
+        HashMap<String, String> map = getDateMapByType(dxQueryVo.getType(), dxQueryVo.getBeginDate(), dxQueryVo.getEndDate(),"1");
+        dxQueryVo.setBeginDate(map.get("startDate"));
+        dxQueryVo.setEndDate(map.get("endDate"));
         return HttpResult.ok(dxDataService.queryDxDataDayPage(dxQueryVo));
     }
 
@@ -159,4 +168,41 @@ public class KhglDataController {
         }
         return HttpResult.ok(dxDataService.queryGroupListByDeptId(deptId,"3"));
     }
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/6/19 11:57
+     *  @Description:  通过时间类型判断
+     */
+    private static HashMap<String,String> getDateMapByType(String type, String startDate, String endDate,String flag) {
+        HashMap<String,String> map =new HashMap<>();
+        String  startDateStr="";
+        String  endDateStr="";
+        if(org.apache.commons.lang3.StringUtils.isNotBlank(startDate) && org.apache.commons.lang3.StringUtils.isNotBlank(endDate)){
+            startDateStr= org.apache.commons.lang3.StringUtils.isNotBlank(startDate)?startDate+" 00:00:00":null;
+            endDateStr= org.apache.commons.lang3.StringUtils.isNotBlank(endDate)?endDate+" 23:59:59":null;
+        }else{
+            if(StringUtils.isBlank(type) && "1".equals(flag)){
+                startDateStr= SliceUpDateUtil.getBeforeDay(new Date(),0)+" 00:00:00";
+                endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
+            }
+            if("1".equals(type)){
+                // 近1天
+                startDateStr= SliceUpDateUtil.getBeforeDay(new Date(),0)+" 00:00:00";
+                endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
+            }else if("2".equals(type)){
+                // 近7天
+                startDateStr=SliceUpDateUtil.getBeforeDay(new Date(),1)+" 00:00:00";
+                endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
+            }else if("3".equals(type)){
+                // 近30天
+                startDateStr=SliceUpDateUtil.getBeforeDay(new Date(),6)+" 00:00:00";
+                endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
+            }
+        }
+        map.put("startDate",startDateStr);
+        map.put("endDate",endDateStr);
+        return map;
+    }
 }

+ 15 - 0
src/main/java/com/ydtech/modules/admin/controller/taskStatistics/TaskStatisticsController.java

@@ -222,5 +222,20 @@ public class TaskStatisticsController {
         }
     }
 
+    /**
+     *
+     * @param taskStatisticsVo
+     * @return  控制台任务统计 渠道代理人详情
+     */
+    @PostMapping("channelAgentDetails")
+    @ApiOperation(value = "控制台任务统计 渠道代理人详情")
+    public HttpResult<IPage<TaskStatisticsDto>> channelAgentDetails(@RequestBody TaskStatisticsVo taskStatisticsVo) {
+        try{
+            IPage<TaskStatisticsDto> result = taskStatisticsService.channelAgentDetails(taskStatisticsVo);
+            return HttpResult.ok("查询数据成功", result);
+        }catch (Exception e){
+            return HttpResult.error("查询错误"+e.getMessage());
+        }
+    }
 
 }

+ 1 - 5
src/main/java/com/ydtech/modules/admin/controller/websocket/SysGeographyPositionController.java

@@ -81,11 +81,7 @@ public class SysGeographyPositionController {
     @GetMapping("/getGeographyPosition")
     @ApiOperation(value = "历史在线人数")
     public HttpResult<PcAddressHistoryInfoVo> getGeographyPosition(@RequestParam(value = "dates",required = false) String dates) {
-        if (StringUtils.isNullOrEmpty(dates)) {
-            Date date = new Date();
-            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            dates = simpleDateFormat.format(date);
-        }
+
         return HttpResult.ok("success", this.sysGeographyPositionService.getGeographyPosition(dates));
     }
 

+ 1 - 0
src/main/java/com/ydtech/modules/admin/controller/websocket/WebSocketServer.java

@@ -170,6 +170,7 @@ public class WebSocketServer {
             sysGeographyPosition1.setAddress(province + city + district + street+streetNum+poiName+cityCode);
             sysGeographyPosition1.setCreateTime(new Date());
             sysGeographyPosition1.setSource(sysDept.getManagementSource());
+            sysGeographyPosition1.setLeaderName(sysUser.getLeaderName());
             sysGeographyPositionService.updateById(sysGeographyPosition1);
 
             SysGeographyPositionRecord sysGeographyPositionRecord = BeanUtil.copyProperties(sysGeographyPosition1, SysGeographyPositionRecord.class);

+ 6 - 0
src/main/java/com/ydtech/modules/admin/dao/TaskStatisticsMapper.java

@@ -32,6 +32,12 @@ public interface TaskStatisticsMapper extends BaseMapper<TaskStatisticsDto> {
     IPage<BusinessAgentData> getBusinessAgentDataDetails(@Param("page") Page page,@Param("vo") TaskStatisticsVo taskStatisticsVo);
 
     Long getBusinessAgentDataDetailsAdd(@Param("vo") TaskStatisticsVo taskStatisticsVo);
+    /**
+     *
+     * @param taskStatisticsVo
+     * @return  控制台任务统计 渠道代理人详情
+     */
 
+    IPage<TaskStatisticsDto> channelAgentDetails(Page page, TaskStatisticsVo taskStatisticsVo);
 
 }

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

@@ -53,4 +53,17 @@ public class AgreeReportQueryDto {
     private int pageNum;
 
 
+    @ApiModelProperty(value = "省机构id")
+    private String provinceId;
+
+    @ApiModelProperty(value = "市机构id")
+    private String cityId;
+
+    @ApiModelProperty(value = "县机构id")
+    private String countyId;
+
+    @ApiModelProperty(value = "门店机构id")
+    private String houseId;
+
+
 }

+ 5 - 1
src/main/java/com/ydtech/modules/admin/model/dto/DxReportDataDto.java

@@ -82,5 +82,9 @@ public class DxReportDataDto  implements Serializable {
     @ApiModelProperty(value = "")
     private  String zzdUserId;
 
-
+    /***
+     *  电销用户id
+     */
+    @ApiModelProperty(value = "")
+    private  String  dxUserId;
 }

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

@@ -56,7 +56,6 @@ public class ExportExpenditureTypeDetalsSZDto {
     @ApiModelProperty(value = "交易类型")
     private String  transactionType;
 
-
     /***
      * 金额
      */
@@ -64,8 +63,6 @@ public class ExportExpenditureTypeDetalsSZDto {
     @ApiModelProperty(value = "交易金额")
     private BigDecimal amount;
 
-
-
     @ExcelProperty(value="提现状态",index=6)
     @ApiModelProperty(value = "提现状态  1 提现申请  2.处理中 3.提现失败  4.提现成功")
     private String auditingStatus;

+ 24 - 0
src/main/java/com/ydtech/modules/admin/model/dto/FeeLookSwitchesDTO.java

@@ -0,0 +1,24 @@
+package com.ydtech.modules.admin.model.dto;
+
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class FeeLookSwitchesDTO implements Serializable {
+
+    private static final long serialVersionUID = -8717266422994737007L;
+
+    @ApiModelProperty("费用查看 /10")
+    private Boolean feeView;
+
+    @ApiModelProperty("费用显示 ")
+    private Boolean feeDisplay;
+
+}

+ 23 - 5
src/main/java/com/ydtech/modules/admin/model/dto/MyCollectInAdvanceAllDto.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.admin.model.dto;
 
 import com.ydtech.modules.order.entity.BasePageResult;
+import com.ydtech.utils.BigDecimalUtils;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -22,6 +23,7 @@ public class MyCollectInAdvanceAllDto {
      */
     @ApiModelProperty(value = "收入金额")
     private BigDecimal sumAmountSR;
+
     /***
      * 支出金额
      */
@@ -34,20 +36,36 @@ public class MyCollectInAdvanceAllDto {
     @ApiModelProperty(value = "预收金额")
     private BigDecimal sumAmountYS;
 
+    @ApiModelProperty("掌柜币显示 /10")
+    private Boolean feeView;
+
     @ApiModelProperty(value = "分页数据")
     BasePageResult<MyCollectInAdvanceDto> data =new BasePageResult<>();
 
     public MyCollectInAdvanceAllDto() {
     }
 
-    public MyCollectInAdvanceAllDto(BigDecimal sumAmountSR,BigDecimal sumAmountZC, BasePageResult<MyCollectInAdvanceDto> data) {
-        this.sumAmountSR = sumAmountSR;
-        this.sumAmountZC = sumAmountZC;
+    public MyCollectInAdvanceAllDto(BigDecimal sumAmountSR,BigDecimal sumAmountZC, BasePageResult<MyCollectInAdvanceDto> data, boolean b) {
+        if (b) {
+            this.sumAmountSR = BigDecimalUtils.nullToZero(sumAmountSR).divide(new BigDecimal(10));
+            this.sumAmountZC = BigDecimalUtils.nullToZero(sumAmountZC).divide(new BigDecimal(10));
+        }else {
+            this.sumAmountSR = sumAmountSR;
+            this.sumAmountZC = sumAmountZC;
+        }
         this.data = data;
+        this.feeView = b;
     }
 
-    public MyCollectInAdvanceAllDto(BigDecimal sumAmountYS, BasePageResult<MyCollectInAdvanceDto> data) {
-        this.sumAmountYS = sumAmountYS;
+    public MyCollectInAdvanceAllDto(BigDecimal sumAmountYS, BasePageResult<MyCollectInAdvanceDto> data, boolean b) {
+        if (b) {
+            this.sumAmountYS = BigDecimalUtils.nullToZero(sumAmountYS).divide(new BigDecimal(10));
+        }else {
+            this.sumAmountYS = sumAmountYS;
+        }
+
         this.data = data;
+        this.feeView = b;
     }
+
 }

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

@@ -28,7 +28,6 @@ public class MyCollectInAdvanceDto {
     @ApiModelProperty(value = "承保时间")
     private String  signingTime;
 
-
     /***
      * 车牌
      */
@@ -41,7 +40,6 @@ public class MyCollectInAdvanceDto {
     @ApiModelProperty(value = "金额")
     private BigDecimal amount;
 
-
     /***
      * 交易号
      */
@@ -54,8 +52,6 @@ public class MyCollectInAdvanceDto {
     @ApiModelProperty(value = "支出时间")
     private String   createTime;
 
-
-
     @ApiModelProperty(value = "业务板块")
     private String businessSegmentsType;
 

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

@@ -20,6 +20,10 @@ public class PcAddressInfoDto {
     @ApiModelProperty("维度")
     private String lat;
 
+    @ApiModelProperty(value = "机构来源 全部:null 渠道:1 代理:2")
+    private String source;
+
+
     @ApiModelProperty(value = "页数")
     private int pageNum;
 

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

@@ -124,4 +124,13 @@ public class TaskStatisticsDto {
     @ApiModelProperty(value = "协议类型")
     private String agreementType;
 
+    @ApiModelProperty(value = "是否app,pc报价")
+    private String orderSource;
+
+    @ApiModelProperty(value = "pc报价")
+    private String pcOrderSource;
+
+    @ApiModelProperty(value = "app报价")
+    private String appOrderSource;
+
 }

+ 25 - 0
src/main/java/com/ydtech/modules/admin/model/vo/MyIncomeAndExpensesNewPageVo.java

@@ -0,0 +1,25 @@
+package com.ydtech.modules.admin.model.vo;
+
+import com.ydtech.modules.order.entity.BasePageResult;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class MyIncomeAndExpensesNewPageVo<T> extends BasePageResult<T> {
+
+    @ApiModelProperty("掌柜币显示 /10")
+    private Boolean feeView;
+
+    public MyIncomeAndExpensesNewPageVo(long pageNum, long pageSize, long totalSize, long totalPages, List<T> content, boolean feeView) {
+        super(pageNum, pageSize, totalSize, totalPages, content);
+        this.feeView = feeView;
+    }
+}

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

@@ -68,6 +68,9 @@ public class QxFrontlineAgentVo implements Serializable {
     @ApiModelProperty(value = "结束时间")
     private String createtimeStart;
 
+    @ApiModelProperty(value = "领导人id")
+    private String leaderId;
+
     @ApiModelProperty(value = "类型  1 近1天 2近7天 3.近30天")
     private String days;
 

+ 4 - 0
src/main/java/com/ydtech/modules/admin/model/vo/TaskStatisticsVo.java

@@ -94,6 +94,10 @@ public class TaskStatisticsVo implements Serializable {
     @ApiModelProperty(value = "用户ids")
     private List<String> userIds;
 
+    @ApiModelProperty(value = "是否app,pc报价")
+    private String orderSource;
+
+
 
 
 

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

@@ -50,7 +50,7 @@ public class GeoService {
 
     // 查找某位置附近的ID集合
     public List<String> findNearbyIds(String geoKey, double longitude, double latitude, double radius) {
-        Circle within = new Circle(new Point(longitude, latitude), new Distance(radius, Metrics.KILOMETERS));
+        Circle within = new Circle(new Point(longitude, latitude), new Distance(radius, Metrics.NEUTRAL));
         RedisGeoCommands.GeoRadiusCommandArgs args = RedisGeoCommands.GeoRadiusCommandArgs.newGeoRadiusArgs().includeCoordinates().includeDistance();
         List<GeoResult<RedisGeoCommands.GeoLocation<String>>> content = redisTemplate.opsForGeo().radius(geoKey, within, args).getContent();
         if (content .size()==0) return new ArrayList<String>();

+ 29 - 2
src/main/java/com/ydtech/modules/admin/service/SysSwitchConfigService.java

@@ -1,12 +1,12 @@
 package com.ydtech.modules.admin.service;
 
-import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.extension.BaseIService;
+import com.ydtech.modules.admin.model.dto.FeeLookSwitchesDTO;
 import com.ydtech.modules.admin.model.po.SysSwitchConfig;
 import com.ydtech.modules.admin.model.vo.SysSwitchConfigQueryVo;
 import com.ydtech.modules.admin.model.vo.SysSwitchConfigVo;
 import com.ydtech.modules.order.entity.BasePageResult;
-import com.ydtech.modules.protocol.utils.AssertionUtils;
+import com.ydtech.modules.order.entity.vo.OrderVo;
 
 import java.math.BigDecimal;
 
@@ -48,4 +48,31 @@ public interface SysSwitchConfigService extends BaseIService<SysSwitchConfig> {
      * @return
      */
     BasePageResult<SysSwitchConfig> queryPage(SysSwitchConfigQueryVo sysSwitchConfigQueryVo);
+
+    /**
+     * 是否开启
+     *
+     * @param keyWord 键值
+     * @return true 开启  false 关闭
+     */
+    default boolean isEnabled(String keyWord) {
+        SysSwitchConfig one = lambdaQuery().eq(SysSwitchConfig::getKeyword, keyWord).one();
+        if (one == null) return false;
+        return 1 == one.getEnabled();
+    }
+
+    /**
+     * 费用查看开关
+     *
+     * @return 是否开启
+     */
+    FeeLookSwitchesDTO feeLookSwitches();
+
+    /**
+     * 机构 掌柜币查看
+     *
+     * @return
+     */
+    boolean feeDisplaySwitches();
+
 }

+ 3 - 2
src/main/java/com/ydtech/modules/admin/service/SysUserAccountService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.admin.model.dto.*;
 import com.ydtech.modules.admin.model.po.SysUserAccount;
+import com.ydtech.modules.admin.model.vo.MyIncomeAndExpensesNewPageVo;
 import com.ydtech.modules.admin.model.vo.SubOrder;
 import com.ydtech.modules.admin.model.vo.SysUserAccountVo;
 import com.ydtech.modules.order.entity.BasePageResult;
@@ -89,7 +90,7 @@ public interface SysUserAccountService extends IService<SysUserAccount> {
      *  @Date: 2024/6/30 15:27
      *  @Description: 预收车险明细
      */
-    BasePageResult<ExportExpenditureTypeDetalsDto> findMyInsuranceByUserId(MyInsuranceQueryDto myInsuranceQueryDto);
+    MyIncomeAndExpensesNewPageVo<ExportExpenditureTypeDetalsDto> findMyInsuranceByUserId(MyInsuranceQueryDto myInsuranceQueryDto);
     /**
      *  @version
      *  @author: hxl
@@ -117,7 +118,7 @@ public interface SysUserAccountService extends IService<SysUserAccount> {
      *  @Date: 2024/6/30 18:24
      *  @Description:  收支明细查询
      */
-    BasePageResult<ExportExpenditureTypeDetalsSZDto> findMyIncomeAndExpensesNewByUserId(MyCollectInAdvanceQueryNewDto myCollectInAdvanceQueryNewDto);
+    MyIncomeAndExpensesNewPageVo<ExportExpenditureTypeDetalsSZDto> findMyIncomeAndExpensesNewByUserId(MyCollectInAdvanceQueryNewDto myCollectInAdvanceQueryNewDto);
     /**
      *  @version
      *  @author: hxl

+ 7 - 0
src/main/java/com/ydtech/modules/admin/service/TaskStatisticsService.java

@@ -91,4 +91,11 @@ public interface TaskStatisticsService {
      **/
     IPage<BusinessAgentData> getBusinessAgentDataDetails(TaskStatisticsVo taskStatisticsVo);
 
+    /**
+     *
+     * @param taskStatisticsVo
+     * @return  控制台任务统计 渠道代理人详情
+     */
+
+    IPage<TaskStatisticsDto> channelAgentDetails(TaskStatisticsVo taskStatisticsVo);
 }

+ 34 - 22
src/main/java/com/ydtech/modules/admin/service/impl/DxDataServiceImpl.java

@@ -74,18 +74,25 @@ public class DxDataServiceImpl implements DxDataService {
         if (records != null && records.size() > 0) {
             for (DxReportDataDto dxReportDataDto : records) {
                 //通过用户id查询电销数据
-                DxDataVo dxDataVo = new DxDataVo(dxQueryVo.getBeginDate(), dxQueryVo.getEndDate(), dxReportDataDto.getUserId());
-                DxDataDto dxData = getDataByPost(dxDataVo, dxApiConfigurationProperties.getFindDataUserIdUrl());
-                if (dxData != null) {
-                    dxReportDataDto.setExhaleDuration(dxData.getExhaleDuration());
-                    dxReportDataDto.setOutgoingCallsNumber(dxData.getOutgoingCallsNumber());
-                    dxReportDataDto.setConnectionsNumber(dxData.getConnectionsNumber());
-                    dxReportDataDto.setCallSuccessRate(dxData.getCallSuccessRate());
-                } else {
+                if(dxReportDataDto.getDxUserId()==null){
                     dxReportDataDto.setExhaleDuration("0");
                     dxReportDataDto.setOutgoingCallsNumber("0");
                     dxReportDataDto.setConnectionsNumber("0");
                     dxReportDataDto.setCallSuccessRate("-");
+                }else{
+                    DxDataVo dxDataVo = new DxDataVo(dxQueryVo.getBeginDate(), dxQueryVo.getEndDate(), dxReportDataDto.getDxUserId());
+                    DxDataDto dxData = getDataByPost(dxDataVo, dxApiConfigurationProperties.getFindDataUserIdUrl());
+                    if (dxData != null) {
+                        dxReportDataDto.setExhaleDuration(dxData.getExhaleDuration());
+                        dxReportDataDto.setOutgoingCallsNumber(dxData.getOutgoingCallsNumber());
+                        dxReportDataDto.setConnectionsNumber(dxData.getConnectionsNumber());
+                        dxReportDataDto.setCallSuccessRate(dxData.getCallSuccessRate());
+                    } else {
+                        dxReportDataDto.setExhaleDuration("0");
+                        dxReportDataDto.setOutgoingCallsNumber("0");
+                        dxReportDataDto.setConnectionsNumber("0");
+                        dxReportDataDto.setCallSuccessRate("-");
+                    }
                 }
                 int qywx_zgd = 0;
                 int qywx_zzb = 0;
@@ -102,11 +109,9 @@ public class DxDataServiceImpl implements DxDataService {
                     KhglDataDto zgdDto = khglZgdDataService.findByUserId(new KhglDataVo(zzdUserId, dxQueryVo.getBeginDate(), dxQueryVo.getEndDate()));
                     if (zgdDto != null && zgdDto.getWxCount() != null) {
                         qywx_zgd += zgdDto.getWxCount();
-
-                        dxReportDataDto.setQywxCount(qywx_zgd + qywx_zzb);
-
                     }
                 }
+                dxReportDataDto.setQywxCount(qywx_zgd + qywx_zzb);
                 //查询微信添加数量
                 Integer count = sysTelemarketingWechatDataMapper.queryCountByUserId(new DxDataVo(dxQueryVo.getBeginDate(), dxQueryVo.getEndDate(), dxReportDataDto.getUserId()));
                 dxReportDataDto.setWxCount(count == null ? 0 : count);
@@ -141,19 +146,25 @@ public class DxDataServiceImpl implements DxDataService {
                 dxReportDataDto.setGroupName(user.getGroupName());
                 dxReportDataDto.setUserId(user.getUserId());
                 dxReportDataDto.setUserName(user.getUserName());
-
-                //通过用户id查询电销数据
-                DxDataDto dxData = getDataByPost(new DxDataVo(dxReportDataDto.getUserId(),dxReportDataDto.getDateTime()), dxApiConfigurationProperties.getFindDataUserIdAndDayUrl());
-                if (dxData != null) {
-                    dxReportDataDto.setExhaleDuration(dxData.getExhaleDuration());
-                    dxReportDataDto.setOutgoingCallsNumber(dxData.getOutgoingCallsNumber());
-                    dxReportDataDto.setConnectionsNumber(dxData.getConnectionsNumber());
-                    dxReportDataDto.setCallSuccessRate(dxData.getCallSuccessRate());
-                } else {
+                if(dxReportDataDto.getDxUserId()==null){
                     dxReportDataDto.setExhaleDuration("0");
                     dxReportDataDto.setOutgoingCallsNumber("0");
                     dxReportDataDto.setConnectionsNumber("0");
                     dxReportDataDto.setCallSuccessRate("-");
+                }else{
+                    //通过用户id查询电销数据
+                    DxDataDto dxData = getDataByPost(new DxDataVo(dxReportDataDto.getDxUserId(),dxReportDataDto.getDateTime()), dxApiConfigurationProperties.getFindDataUserIdAndDayUrl());
+                    if (dxData != null) {
+                        dxReportDataDto.setExhaleDuration(dxData.getExhaleDuration());
+                        dxReportDataDto.setOutgoingCallsNumber(dxData.getOutgoingCallsNumber());
+                        dxReportDataDto.setConnectionsNumber(dxData.getConnectionsNumber());
+                        dxReportDataDto.setCallSuccessRate(dxData.getCallSuccessRate());
+                    } else {
+                        dxReportDataDto.setExhaleDuration("0");
+                        dxReportDataDto.setOutgoingCallsNumber("0");
+                        dxReportDataDto.setConnectionsNumber("0");
+                        dxReportDataDto.setCallSuccessRate("-");
+                    }
                 }
                 int qywx_zgd = 0;
                 int qywx_zzb = 0;
@@ -170,9 +181,10 @@ public class DxDataServiceImpl implements DxDataService {
                     KhglDataDto zgdDto = khglZgdDataService.findByUserId(new KhglDataVo(zzdUserId, dxReportDataDto.getDateTime()));
                     if (zgdDto != null && zgdDto.getWxCount() != null) {
                         qywx_zgd += zgdDto.getWxCount();
-                        dxReportDataDto.setQywxCount(qywx_zgd + qywx_zzb);
+
                     }
                 }
+                dxReportDataDto.setQywxCount(qywx_zgd + qywx_zzb);
                 //查询微信添加数量
                 newRecords.add(dxReportDataDto);
             }
@@ -199,7 +211,7 @@ public class DxDataServiceImpl implements DxDataService {
 
         }
         if(response!=null) {
-           HttpResult<DxDataDto> body =  response.getBody();
+            HttpResult<DxDataDto> body =  response.getBody();
             if (body.getCode() == 200) {
                 DxDataDto data = body.getData();
                 return new DxDataDto(dxDataVo.getDateTime(),data.getExhaleDuration(), data.getOutgoingCallsNumber(), data.getConnectionsNumber(), data.getCallSuccessRate());

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

@@ -49,7 +49,9 @@ public class ProfitAnalysisServiceImpl implements ProfitAnalysisService {
      */
     @Override
     public List<ProfitAnalysisDto> getProfitAnalysisQueryList(ProfitAnalysisQueryDto profitAnalysisQueryDto) {
-
+        HashMap<String, String> dateMapByType = getDateMapByType(profitAnalysisQueryDto.getDateType(), profitAnalysisQueryDto.getYear());
+        profitAnalysisQueryDto.setBeginDate(dateMapByType.get("startDate"));
+        profitAnalysisQueryDto.setEndDate(dateMapByType.get("endDate"));
         return insPlyIncomeMapper.getProfitAnalysisQueryList(profitAnalysisQueryDto);
     }
 

+ 9 - 2
src/main/java/com/ydtech/modules/admin/service/impl/SysGeographyPositionServiceImpl.java

@@ -24,6 +24,7 @@ import com.ydtech.utils.StringUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -199,6 +200,7 @@ public class SysGeographyPositionServiceImpl extends ServiceImpl<SysGeographyPos
         wrapper.eq(StringUtils.isNotEmpty(addressInfoDto.getLng()), SysGeographyPosition::getLongitude, addressInfoDto.getLng());
         wrapper.eq(StringUtils.isNotEmpty(addressInfoDto.getLat()), SysGeographyPosition::getLatitude, addressInfoDto.getLat());
         wrapper.in(SysGeographyPosition::getSource, Arrays.asList("1", "2"));
+        wrapper.eq(StringUtils.isNotEmpty(addressInfoDto.getSource()), SysGeographyPosition::getSource, addressInfoDto.getSource());
         wrapper.orderByDesc(SysGeographyPosition::getCreateTime);
 
         Page<SysGeographyPosition> insOrdersPage = page(page, wrapper);
@@ -223,8 +225,6 @@ public class SysGeographyPositionServiceImpl extends ServiceImpl<SysGeographyPos
     @Override
     public PcAddressHistoryInfoVo getGeographyPosition(String dates) {
         PcAddressHistoryInfoVo pcAddressHistoryInfoVo = new PcAddressHistoryInfoVo();
-        List<PcAddressHistoryTimeVo> geographyPosition = sysGeographyPositionRecordMapper.getGeographyPosition(dates);
-        pcAddressHistoryInfoVo.setList(geographyPosition);
         QueryWrapper<SysGeographyPositionRecord> queryWrapper = new QueryWrapper<>();
         // 指定 COUNT(DISTINCT user_id) 查询
         queryWrapper.select("COUNT(DISTINCT user_id) AS total").likeRight(StringUtils.isNotEmpty(dates), "create_time", dates)
@@ -232,6 +232,13 @@ public class SysGeographyPositionServiceImpl extends ServiceImpl<SysGeographyPos
         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);
+        }
+        List<PcAddressHistoryTimeVo> geographyPosition = sysGeographyPositionRecordMapper.getGeographyPosition(dates);
+        pcAddressHistoryInfoVo.setList(geographyPosition);
         return pcAddressHistoryInfoVo;
     }
 

+ 9 - 2
src/main/java/com/ydtech/modules/admin/service/impl/SysPcAddressServiceImpl.java

@@ -28,6 +28,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -190,6 +191,7 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
         wrapper.eq(StringUtils.isNotEmpty(addressInfoDto.getLng()), SysPcAddress::getLongitude, addressInfoDto.getLng());
         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.orderByDesc(SysPcAddress::getOperationTime);
 
         Page<SysPcAddress> insOrdersPage = page(page, wrapper);
@@ -201,8 +203,6 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
     @Override
     public PcAddressHistoryInfoVo getPcAddress(String dates) {
         PcAddressHistoryInfoVo pcAddressHistoryInfoVo = new PcAddressHistoryInfoVo();
-        List<PcAddressHistoryTimeVo> pcAddress = sysPcAddressHistoryMapper.getPcAddress(dates);
-        pcAddressHistoryInfoVo.setList(pcAddress);
         QueryWrapper<SysPcAddressHistory> queryWrapper = new QueryWrapper<>();
         // 指定 COUNT(DISTINCT user_id) 查询
         queryWrapper.select("COUNT(DISTINCT user_id) AS total").likeRight(StringUtils.isNotEmpty(dates), "operation_time", dates)
@@ -210,6 +210,13 @@ public class SysPcAddressServiceImpl extends ServiceImpl<SysPcAddressMapper, Sys
         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);
+        }
+        List<PcAddressHistoryTimeVo> pcAddress = sysPcAddressHistoryMapper.getPcAddress(dates);
+        pcAddressHistoryInfoVo.setList(pcAddress);
 
         return pcAddressHistoryInfoVo;
     }

+ 34 - 0
src/main/java/com/ydtech/modules/admin/service/impl/SysSwitchConfigServiceImpl.java

@@ -7,6 +7,7 @@ import com.ydtech.modules.admin.constants.ManagementSource;
 import com.ydtech.modules.admin.constants.SwitchConfig;
 import com.ydtech.modules.admin.dao.SysSwitchConfigMapper;
 import com.ydtech.modules.admin.model.SysDept;
+import com.ydtech.modules.admin.model.dto.FeeLookSwitchesDTO;
 import com.ydtech.modules.admin.model.po.SysSwitchConfig;
 import com.ydtech.modules.admin.model.vo.SysSwitchConfigQueryVo;
 import com.ydtech.modules.admin.model.vo.SysSwitchConfigVo;
@@ -17,6 +18,7 @@ import com.ydtech.modules.fee.constants.CostAllocation;
 import com.ydtech.modules.fee.dto.po.InsFeeOrderConfig;
 import com.ydtech.modules.fee.service.InsFeeOrderConfigService;
 import com.ydtech.modules.order.entity.BasePageResult;
+import com.ydtech.modules.order.entity.vo.OrderVo;
 import com.ydtech.modules.protocol.utils.AssertionUtils;
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.lang3.ObjectUtils;
@@ -110,6 +112,38 @@ public class SysSwitchConfigServiceImpl extends ServiceImpl<SysSwitchConfigMappe
                 sysSwitchConfigPage.getTotal(), sysSwitchConfigPage.getPages(), sysSwitchConfigPage.getRecords());
     }
 
+    @Override
+    public FeeLookSwitchesDTO feeLookSwitches() {
+        String deptId = BaseController.getDeptId();
+        FeeLookSwitchesDTO feeLookSwitchesDTO = new FeeLookSwitchesDTO();
+        SysDept dept = sysDeptService.getById(deptId);
+        // 渠道
+        if (ManagementSource.MS_01.getCode().equals(dept.getManagementSource())) {
+            feeLookSwitchesDTO.setFeeView(isEnabled(SwitchConfig.FEE_02.getCode()));
+            feeLookSwitchesDTO.setFeeDisplay(isEnabled(SwitchConfig.FDA_02.getCode()));
+            // 代理人
+        } else if (ManagementSource.MS_02.getCode().equals(dept.getManagementSource())) {
+            feeLookSwitchesDTO.setFeeView(isEnabled(SwitchConfig.FEE_01.getCode()));
+            feeLookSwitchesDTO.setFeeDisplay(isEnabled(SwitchConfig.FDA_01.getCode()));
+        }else {
+            feeLookSwitchesDTO.setFeeView(false);
+            feeLookSwitchesDTO.setFeeDisplay(true);
+        }
+        return feeLookSwitchesDTO;
+    }
+
+    @Override
+    public boolean feeDisplaySwitches() {
+        String deptId = BaseController.getDeptId();
+        SysDept dept = sysDeptService.getById(deptId);
+        if (ManagementSource.MS_01.getCode().equals(dept.getManagementSource())) {
+            return isEnabled(SwitchConfig.FEE_02.getCode());
+            // 代理人
+        } else if (ManagementSource.MS_02.getCode().equals(dept.getManagementSource())) {
+            return isEnabled(SwitchConfig.FEE_01.getCode());
+        }
+        return false;
+    }
 }
 
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 308 - 292
src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java


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

@@ -128,6 +128,20 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
      **/
     @Override
     public IPage<TaskStatisticsDto> insuranceCompanyQueryPage(TaskStatisticsVo taskStatisticsVo) {
+        if(com.ydtech.utils.StringUtils.isNotEmpty(taskStatisticsVo.getProvinceId())){
+            String provinceId =   this.removeTrailingZeros(taskStatisticsVo.getProvinceId());
+            taskStatisticsVo.setProvinceId(provinceId);
+
+        }
+        if(com.ydtech.utils.StringUtils.isNotEmpty(taskStatisticsVo.getCityId())){
+            String cityId =   this.removeTrailingZeros(taskStatisticsVo.getCityId());
+            taskStatisticsVo.setCityId(cityId);
+        }
+        if(com.ydtech.utils.StringUtils.isNotEmpty(taskStatisticsVo.getCountyId())){
+            String countyId =   this.removeTrailingZeros(taskStatisticsVo.getCountyId());
+            taskStatisticsVo.setCountyId(countyId);
+        }
+
         PageVo<TaskStatisticsVo> pageVo = new PageVo<>();
         Page page = new Page(taskStatisticsVo.getPageNum(), taskStatisticsVo.getPageSize());
         page.setSearchCount(false).setOptimizeCountSql(false);//关闭count查询
@@ -138,6 +152,26 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
         list.setTotal(total);
         return list;
     }
+
+
+    private String removeTrailingZeros(String value) {
+        int len = value.length();
+        int i = len - 1;
+
+        // 查找第一个非零字符的位置
+        while (i >= 0 && value.charAt(i) == '0') {
+            i--;
+        }
+
+        // 如果所有字符都是0,则返回"0"
+        if (i < 0) {
+            return "0";
+        }
+
+        // 使用substring方法获取去除末尾零的子串
+        return value.substring(0, i + 1);
+    }
+
     /**
      * @description:   代理人统计查询
      * @author: whp
@@ -230,11 +264,20 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
      **/
     @Override
     public IPage<TaskStatisticsDto> getBusinessData(TaskStatisticsVo taskStatisticsVo) {
+        if(StringUtils.isNotEmpty(taskStatisticsVo.getDays())){
+            if("7".equals(taskStatisticsVo.getDays())){
+                taskStatisticsVo.setDateType("2");
+            } else if ("30".equals(taskStatisticsVo.getDays())) {
+                taskStatisticsVo.setDateType("3");
+            }
+        }
+        HashMap<String, String> dateMapByType = getDateMapByTypeNew(taskStatisticsVo.getDateType(), taskStatisticsVo.getCreatetimeStart(), taskStatisticsVo.getCreatetimeEnd());
+        taskStatisticsVo.setCreatetimeStart(dateMapByType.get("startDate"));
+        taskStatisticsVo.setCreatetimeEnd(dateMapByType.get("endDate"));
         PageVo<TaskStatisticsVo> pageVo = new PageVo<>();
         Page page = new Page(taskStatisticsVo.getPageNum(), taskStatisticsVo.getPageSize());
         pageVo.setPageNum(taskStatisticsVo.getPageNum());
         pageVo.setPageSize(taskStatisticsVo.getPageSize());
-
         IPage<TaskStatisticsDto> list = this.insAreaCompanyMapper.getBusinessData(page,taskStatisticsVo);
         return list;
     }
@@ -478,13 +521,9 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
             if(!userIds.isEmpty()){
                 taskStatisticsVo.setUserIds(userIds);
             }
-
         }
-
         BusinessAgentData result = this.taskStatisticsMapper.getBusinessAgentDataTotalAdd(taskStatisticsVo);
-
         BusinessAgentData allsumPremium = this.taskStatisticsMapper.getAllsumPremium(taskStatisticsVo);
-
         if (ObjectUtils.isNotEmpty(allsumPremium) && ObjectUtils.isNotEmpty(result)) {
             BigDecimal sumPremium = allsumPremium.getSumPremium().compareTo(BigDecimal.ZERO) > 0 ? allsumPremium.getSumPremium() : BigDecimal.ZERO;
             BigDecimal resultSumPremium = result.getSumPremium().compareTo(BigDecimal.ZERO) > 0 ? result.getSumPremium() : BigDecimal.ZERO;
@@ -547,4 +586,24 @@ public class TaskStatisticsServiceImpl  implements TaskStatisticsService {
         list.setTotal(total);
         return list;
     }
+    /**
+     *
+     * @param taskStatisticsVo
+     * @return  控制台任务统计 渠道代理人详情
+     */
+    @Override
+    public IPage<TaskStatisticsDto> channelAgentDetails(TaskStatisticsVo taskStatisticsVo) {
+
+        PageVo<TaskStatisticsVo> pageVo = new PageVo<>();
+        Page page = new Page(taskStatisticsVo.getPageNum(), taskStatisticsVo.getPageSize());
+        pageVo.setPageNum(taskStatisticsVo.getPageNum());
+        pageVo.setPageSize(taskStatisticsVo.getPageSize());
+
+
+        HashMap<String, String> dateMapByType = getDateMapByType(taskStatisticsVo.getDateType(), taskStatisticsVo.getCreatetimeStart(), taskStatisticsVo.getCreatetimeEnd());
+        taskStatisticsVo.setCreatetimeStart(dateMapByType.get("startDate"));
+        taskStatisticsVo.setCreatetimeEnd(dateMapByType.get("endDate"));
+        IPage<TaskStatisticsDto> list = this.taskStatisticsMapper.channelAgentDetails(page,taskStatisticsVo);
+        return list;
+    }
 }

+ 19 - 0
src/main/java/com/ydtech/modules/constants/GroupType.java

@@ -0,0 +1,19 @@
+package com.ydtech.modules.constants;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
+@Getter
+public enum GroupType {
+
+    GT_1(1, "AI机器人");
+
+    private final Integer code;
+
+    private final String desc;
+
+    public final static String AI_NAME = "AI";
+
+}

+ 18 - 0
src/main/java/com/ydtech/modules/constants/MessageType.java

@@ -0,0 +1,18 @@
+package com.ydtech.modules.constants;
+
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
+@Getter
+public enum MessageType {
+
+    MT_1(1, "文本");
+
+    private final Integer code;
+
+    private final String desc;
+
+
+}

+ 34 - 0
src/main/java/com/ydtech/modules/customer/components/CustomerComponents.java

@@ -0,0 +1,34 @@
+package com.ydtech.modules.customer.components;
+
+
+import com.ydtech.modules.order.components.InsCrawlerOrderComponents;
+import com.ydtech.modules.order.entity.crawler.request.CrawlerCustomerRequest;
+import com.ydtech.modules.order.entity.crawler.response.CrawlerBaseResponse;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpHeaders;
+import org.springframework.stereotype.Component;
+
+@Component
+@RequiredArgsConstructor
+public class CustomerComponents {
+
+    @Value("${customer.api.url}")
+    private String baseUrl;
+
+    private final InsCrawlerOrderComponents insCrawlerOrderComponents;
+
+    /**
+     * 发送消息
+     *
+     * @param message 消息
+     * @return 返回消息
+     */
+    public String sendMessage(String message) {
+        CrawlerCustomerRequest crawlerCustomerRequest = new CrawlerCustomerRequest(message);
+        CrawlerBaseResponse post = insCrawlerOrderComponents.post(baseUrl, "AI", "AI", crawlerCustomerRequest, CrawlerBaseResponse.class, new HttpHeaders());
+        return post.getMessage();
+    }
+
+
+}

+ 38 - 0
src/main/java/com/ydtech/modules/customer/controller/CustomerController.java

@@ -0,0 +1,38 @@
+package com.ydtech.modules.customer.controller;
+
+
+import com.ydtech.aop.request.RequestSingleParam;
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.customer.entity.po.CusChatMessages;
+import com.ydtech.modules.customer.service.CustomerService;
+import io.swagger.annotations.Api;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Api(tags = "客服功能", value = "客服功能")
+@RequestMapping("/customer")
+@RestController
+@RequiredArgsConstructor
+public class CustomerController {
+
+    private final CustomerService customerService;
+
+    @PostMapping("/ai/sendMessage")
+    public HttpResult<String> sendMessage(@RequestSingleParam(value = "message") String message) {
+        String resultMessage = customerService.sendMessage(message);
+        return HttpResult.ok(resultMessage);
+    }
+
+
+    @PostMapping("/ai/queryMessage")
+    public HttpResult<List<CusChatMessages>> queryMessage() {
+        List<CusChatMessages> list = customerService.queryMessage();
+        return HttpResult.ok(list);
+    }
+
+
+}

+ 18 - 0
src/main/java/com/ydtech/modules/customer/dao/CusChatMessagesMapper.java

@@ -0,0 +1,18 @@
+package com.ydtech.modules.customer.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ydtech.modules.customer.entity.po.CusChatMessages;
+
+/**
+* @author Administrator
+* @description 针对表【cus_chat_messages(客服消息)】的数据库操作Mapper
+* @createDate 2024-09-11 17:59:16
+* @Entity generator.domain.CusChatMessages
+*/
+public interface CusChatMessagesMapper extends BaseMapper<CusChatMessages> {
+
+}
+
+
+
+

+ 155 - 0
src/main/java/com/ydtech/modules/customer/entity/po/CusChatMessages.java

@@ -0,0 +1,155 @@
+package com.ydtech.modules.customer.entity.po;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ydtech.modules.constants.GroupType;
+import com.ydtech.modules.constants.MessageType;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 客服消息
+ *
+ * @TableName cus_chat_messages
+ */
+@TableName(value = "cus_chat_messages")
+@Data
+public class CusChatMessages implements Serializable {
+    /**
+     * 组件
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 发送用户的id
+     */
+    @TableField(value = "from_user_id")
+    private String fromUserId;
+
+    /**
+     * 接受用户的工号
+     */
+    @TableField(value = "to_user_id")
+    private String toUserId;
+
+    /**
+     * @see com.ydtech.modules.constants.MessageType
+     * 消息类型
+     */
+    @TableField(value = "message_type")
+    private Integer messageType;
+
+    /**
+     * 消息体
+     */
+    @TableField(value = "message")
+    private String message;
+
+    /**
+     * @see com.ydtech.modules.constants.GroupType
+     * 消息分组
+     */
+    @TableField(value = "group_type")
+    private Integer groupType;
+
+    /**
+     * 发送消息的时间
+     */
+    @TableField(value = "created_at")
+    private Date createdAt;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 发送给AI 信息
+     *
+     * @param fromUserId 发送人
+     * @param message    消息
+     * @return 消息对象
+     */
+    public static CusChatMessages toAiMessage(String fromUserId, String message) {
+        CusChatMessages cusChatMessages = new CusChatMessages();
+        cusChatMessages.setFromUserId(fromUserId);
+        cusChatMessages.setToUserId(GroupType.AI_NAME);
+        cusChatMessages.setGroupType(GroupType.GT_1.getCode());
+        cusChatMessages.setMessageType(MessageType.MT_1.getCode());
+        cusChatMessages.setMessage(message);
+        return cusChatMessages;
+    }
+
+    /**
+     * 接收给AI 信息
+     *
+     * @param toUserId 接收人
+     * @param message  消息
+     * @return 消息对象
+     */
+    public static CusChatMessages receptionAiMessage(String toUserId, String message) {
+        CusChatMessages cusChatMessages = new CusChatMessages();
+        cusChatMessages.setFromUserId(GroupType.AI_NAME);
+        cusChatMessages.setToUserId(toUserId);
+        cusChatMessages.setGroupType(GroupType.GT_1.getCode());
+        cusChatMessages.setMessageType(MessageType.MT_1.getCode());
+        cusChatMessages.setMessage(message);
+        return cusChatMessages;
+    }
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        CusChatMessages other = (CusChatMessages) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+                && (this.getFromUserId() == null ? other.getFromUserId() == null : this.getFromUserId().equals(other.getFromUserId()))
+                && (this.getToUserId() == null ? other.getToUserId() == null : this.getToUserId().equals(other.getToUserId()))
+                && (this.getMessageType() == null ? other.getMessageType() == null : this.getMessageType().equals(other.getMessageType()))
+                && (this.getMessage() == null ? other.getMessage() == null : this.getMessage().equals(other.getMessage()))
+                && (this.getGroupType() == null ? other.getGroupType() == null : this.getGroupType().equals(other.getGroupType()))
+                && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getFromUserId() == null) ? 0 : getFromUserId().hashCode());
+        result = prime * result + ((getToUserId() == null) ? 0 : getToUserId().hashCode());
+        result = prime * result + ((getMessageType() == null) ? 0 : getMessageType().hashCode());
+        result = prime * result + ((getMessage() == null) ? 0 : getMessage().hashCode());
+        result = prime * result + ((getGroupType() == null) ? 0 : getGroupType().hashCode());
+        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", fromUserId=").append(fromUserId);
+        sb.append(", toUserId=").append(toUserId);
+        sb.append(", messageType=").append(messageType);
+        sb.append(", message=").append(message);
+        sb.append(", groupType=").append(groupType);
+        sb.append(", createdAt=").append(createdAt);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 15 - 0
src/main/java/com/ydtech/modules/customer/service/CusChatMessagesService.java

@@ -0,0 +1,15 @@
+package com.ydtech.modules.customer.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ydtech.modules.customer.entity.po.CusChatMessages;
+
+/**
+* @author Administrator
+* @description 针对表【cus_chat_messages(客服消息)】的数据库操作Service
+* @createDate 2024-09-11 17:59:16
+*/
+public interface CusChatMessagesService extends IService<CusChatMessages> {
+
+
+
+}

+ 22 - 0
src/main/java/com/ydtech/modules/customer/service/CustomerService.java

@@ -0,0 +1,22 @@
+package com.ydtech.modules.customer.service;
+
+import com.ydtech.modules.customer.entity.po.CusChatMessages;
+
+import java.util.List;
+
+public interface CustomerService {
+
+    /**
+     * 发送消息
+     *
+     * @param message 消息
+     * @return
+     */
+    String sendMessage(String message);
+
+    /**
+     * 获取哦
+     * @return
+     */
+    List<CusChatMessages> queryMessage();
+}

+ 24 - 0
src/main/java/com/ydtech/modules/customer/service/impl/CusChatMessagesServiceImpl.java

@@ -0,0 +1,24 @@
+package com.ydtech.modules.customer.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ydtech.modules.customer.dao.CusChatMessagesMapper;
+import com.ydtech.modules.customer.entity.po.CusChatMessages;
+import com.ydtech.modules.customer.service.CusChatMessagesService;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 针对表【cus_chat_messages(客服消息)】的数据库操作Service实现
+* @createDate 2024-09-11 17:59:16
+*/
+@Service
+public class CusChatMessagesServiceImpl extends ServiceImpl<CusChatMessagesMapper, CusChatMessages>
+    implements CusChatMessagesService {
+
+
+
+}
+
+
+
+

+ 50 - 0
src/main/java/com/ydtech/modules/customer/service/impl/CustomerServiceImpl.java

@@ -0,0 +1,50 @@
+package com.ydtech.modules.customer.service.impl;
+
+import cn.hutool.core.util.ArrayUtil;
+import com.ydtech.modules.base.controller.BaseController;
+import com.ydtech.modules.constants.GroupType;
+import com.ydtech.modules.customer.components.CustomerComponents;
+import com.ydtech.modules.customer.entity.po.CusChatMessages;
+import com.ydtech.modules.customer.service.CusChatMessagesService;
+import com.ydtech.modules.customer.service.CustomerService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+@Service
+@RequiredArgsConstructor
+public class CustomerServiceImpl implements CustomerService {
+
+    private final CustomerComponents customerComponents;
+
+    private final CusChatMessagesService cusChatMessagesService;
+
+    @Override
+    @Transactional
+    public String sendMessage(String message) {
+        String userId = BaseController.getUserId();
+        List<CusChatMessages> list = new ArrayList<>();
+        CusChatMessages toMessage = CusChatMessages.toAiMessage(userId, message);
+        String s = customerComponents.sendMessage(message);
+        CusChatMessages receptionMessages = CusChatMessages.receptionAiMessage(userId, message);
+        Collections.addAll(list, toMessage, receptionMessages);
+        cusChatMessagesService.saveBatch(list);
+        return s;
+    }
+
+
+    @Override
+    public List<CusChatMessages> queryMessage() {
+        String userId = BaseController.getUserId();
+        cusChatMessagesService
+                .lambdaQuery()
+                .eq(CusChatMessages::getGroupType, GroupType.GT_1.getCode())
+                .and(x -> x.eq(CusChatMessages::getToUserId, userId).or().eq(CusChatMessages::getFromUserId, userId))
+                .orderByDesc(CusChatMessages::getCreatedAt);
+        return Collections.emptyList();
+    }
+}

+ 0 - 1
src/main/java/com/ydtech/modules/fee/controller/ConfigController.java

@@ -4,7 +4,6 @@ import com.ydtech.core.page.HttpResult;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.fee.dto.po.InsFeeOrderConfig;
 import com.ydtech.modules.fee.service.InsFeeOrderConfigService;
-import com.ydtech.modules.inv.model.vo.InvAccountQueryVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;

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

@@ -7,6 +7,7 @@ import com.ydtech.modules.ins.model.vo.CustomerInfoVo;
 import com.ydtech.modules.ins.model.vo.KindInfoVo;
 import com.ydtech.modules.order.entity.InsAreaCompany;
 import com.ydtech.modules.order.entity.InsOrders;
+import com.ydtech.modules.order.entity.api.bohai.constants.VehicleUsage;
 import com.ydtech.modules.order.entity.api.dajia.constants.TypeVehicleMapping;
 import com.ydtech.modules.protocol.entity.po.PtlNewCarJudgeRules;
 import com.ydtech.modules.protocols.entity.po.PtlAgreementUndwrtRulesAttr;
@@ -275,6 +276,73 @@ public class RuleAttrMappingVo {
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("JqNumberOfClaims", insAreaCompany.getJqClaims() == null ? "0" : insAreaCompany.getJqClaims()));
         // 商业出险次数
         ruleAttrMappingVoList.add(new RuleAttrMappingVo("SyNumberOfClaims", insAreaCompany.getSyClaims() == null ? "0" : insAreaCompany.getSyClaims()));
+        // 车牌地区
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("LicenseArea", insAreaCompany.getLicenseno().substring(0,1)));
+        // 系数
+        ruleAttrMappingVoList.add(new RuleAttrMappingVo("Coefficient", getCoefficient(carInfo,insAreaCompany).toString()));
         return ruleAttrMappingVoList;
     }
+
+    private static Float getCoefficient(CarInfoVo carInfo,InsAreaCompany insAreaCompany){
+        Integer seatCount = Integer.parseInt(carInfo.getSeatCount());
+        Float coefficient = 1.00f;
+
+        //        ruleAttrMappingVoList.add(new RuleAttrMappingVo())
+        //家庭自用车
+        if(carInfo.getCimodelclass().equals(VehicleType.VT_A0.getCode()) &&
+                carInfo.getVehicleUse().equals(TypeVehicleMapping.TM_05.getCode())){
+            //2-5座
+            if(seatCount >= 2 && seatCount <=5) {
+                coefficient = Float.parseFloat(insAreaCompany.getJqpremium().toString()) / 950;
+            }
+            //6-9座
+            if(seatCount >= 6 && seatCount <=9){
+                coefficient = Float.parseFloat(insAreaCompany.getJqpremium().toString()) / 1100;
+            }
+        }else
+            //非营业机关、企业
+            if(carInfo.getCimodelclass().equals(VehicleType.VT_A0.getCode()) &&
+                    (carInfo.getVehicleUse().equals(TypeVehicleMapping.TM_06.getCode()) ||
+                            carInfo.getVehicleUse().equals(TypeVehicleMapping.TM_07.getCode()))){
+                //2-5座
+                if(seatCount >= 2 && seatCount <=5) {
+                    coefficient = Float.parseFloat(insAreaCompany.getJqpremium().toString()) / 1000;
+                }
+                //6-9座
+                if(seatCount >= 6 && seatCount <=9){
+                    coefficient = Float.parseFloat(insAreaCompany.getJqpremium().toString()) / 1130;
+                }
+            }
+            else
+                //货车
+                if(carInfo.getCimodelclass().equals(VehicleType.VT_A1.getCode()))
+                {
+                    //营业货运 2吨
+                    if(carInfo.getVehicleUse().equals(TypeVehicleMapping.TM_04.getCode()) &&
+                            Integer.parseInt(carInfo.getLimitLoad()) < 2000){
+                        coefficient = Float.parseFloat(insAreaCompany.getJqpremium().toString()) / 1850;
+                    }
+
+                    //非营业货运 2吨
+                    if(carInfo.getVehicleUse().equals(TypeVehicleMapping.TM_08.getCode()) &&
+                            Integer.parseInt(carInfo.getLimitLoad()) < 2000){
+                        coefficient = Float.parseFloat(insAreaCompany.getJqpremium().toString()) / 1200;
+                    }
+
+                    //大吨位
+                    if(Integer.parseInt(carInfo.getLimitLoad()) > 2000){
+                        coefficient = Float.parseFloat(insAreaCompany.getJqpremium().toString()) / 4480;
+                    }
+                }
+                else
+                    //出租车 网约车
+                    if(carInfo.getCimodelclass().equals(VehicleType.VT_A0.getCode()) &&
+                            carInfo.getVehicleUse().equals(TypeVehicleMapping.TM_01.getCode())){
+                        coefficient = Float.parseFloat(insAreaCompany.getJqpremium().toString()) / 1800;
+                    }
+
+                    return coefficient;
+    }
+
 }
+

+ 58 - 0
src/main/java/com/ydtech/modules/fee/service/FeeDisplayService.java

@@ -0,0 +1,58 @@
+package com.ydtech.modules.fee.service;
+
+
+import com.ydtech.modules.admin.model.dto.ExportExpenditureTypeDetalsDto;
+import com.ydtech.modules.admin.model.dto.ExportExpenditureTypeDetalsSZDto;
+import com.ydtech.modules.admin.model.dto.MyCollectInAdvanceDto;
+import com.ydtech.modules.ins.model.vo.QuoteRespVo;
+import com.ydtech.modules.order.entity.vo.InsOrdersEditingVo;
+import com.ydtech.modules.order.entity.vo.OrderVo;
+
+import java.util.List;
+
+public interface FeeDisplayService {
+
+    /**
+     * 设置是否可以查看费用 和 费用比例 / 10
+     *
+     * @param orderVo
+     */
+    void setUpFeePresentationFormat(OrderVo orderVo);
+
+
+    /**
+     * 设置费用显示
+     *
+     * @param insAreaCompanyEditingDtos 订单列表
+     */
+    void setUpRevise(List<InsOrdersEditingVo.InsAreaCompanyEditingDto> insAreaCompanyEditingDtos);
+
+    /**
+     * 设置报价
+     *
+     * @param quoteRespVo 报价
+     */
+    void setQuote(QuoteRespVo quoteRespVo);
+
+
+    /**
+     * 设置收支明细
+     *
+     * @param recordsNew 收支数据
+     */
+    boolean setWithdrawals(List<MyCollectInAdvanceDto> recordsNew);
+
+    /**
+     * 设置收支明细
+     *
+     * @param recordsNew 收支数据
+     */
+    boolean setWithdrawalsPc(List<ExportExpenditureTypeDetalsSZDto> recordsNew);
+
+
+    /**
+     * 查询数据
+     * @param recordsNew 收支数据
+     */
+    boolean setCarInsurance(List<ExportExpenditureTypeDetalsDto> recordsNew);
+}

+ 112 - 0
src/main/java/com/ydtech/modules/fee/service/impl/FeeDisplayServiceImpl.java

@@ -0,0 +1,112 @@
+package com.ydtech.modules.fee.service.impl;
+
+
+import com.ydtech.modules.admin.model.dto.ExportExpenditureTypeDetalsDto;
+import com.ydtech.modules.admin.model.dto.ExportExpenditureTypeDetalsSZDto;
+import com.ydtech.modules.admin.model.dto.FeeLookSwitchesDTO;
+import com.ydtech.modules.admin.model.dto.MyCollectInAdvanceDto;
+import com.ydtech.modules.admin.service.SysSwitchConfigService;
+import com.ydtech.modules.fee.service.FeeDisplayService;
+import com.ydtech.modules.ins.model.vo.QuoteRespVo;
+import com.ydtech.modules.order.entity.vo.FeeOrderNewVo;
+import com.ydtech.modules.order.entity.vo.InsOrdersEditingVo;
+import com.ydtech.modules.order.entity.vo.OrderVo;
+import com.ydtech.utils.BigDecimalUtils;
+import com.ydtech.utils.StringUtils;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+@Service
+@RequiredArgsConstructor
+public class FeeDisplayServiceImpl implements FeeDisplayService {
+
+    private final SysSwitchConfigService sysSwitchConfigService;
+
+    @Override
+    public void setUpFeePresentationFormat(OrderVo orderVo) {
+        FeeLookSwitchesDTO feeLookSwitchesDTO = sysSwitchConfigService.feeLookSwitches();
+        FeeOrderNewVo feeOrderNewVo = orderVo.getFeeOrderNewVo();
+        List<FeeOrderNewVo.ExportFee> exportFees = Optional.ofNullable(feeOrderNewVo)
+                .map(FeeOrderNewVo::getExportFee)
+                .orElse(new ArrayList<>());
+
+        if (!feeLookSwitchesDTO.getFeeDisplay()) {
+            exportFees.forEach(FeeOrderNewVo.ExportFee::feeVacant);
+        } else if (feeLookSwitchesDTO.getFeeView()) {
+            exportFees.forEach(FeeOrderNewVo.ExportFee::feeDivideBy10);
+            if(StringUtils.isNotEmpty(orderVo.getSumFee())){
+                orderVo.setSumFee(new BigDecimal(orderVo.getSumFee()).divide(new BigDecimal(10)).toString());
+            }
+        }
+        orderVo.setFeeDisplay(feeLookSwitchesDTO.getFeeDisplay());
+        orderVo.setFeeView(feeLookSwitchesDTO.getFeeView());
+
+    }
+
+    @Override
+    public void setUpRevise(List<InsOrdersEditingVo.InsAreaCompanyEditingDto> insAreaCompanyEditingDtos) {
+        FeeLookSwitchesDTO feeLookSwitchesDTO = sysSwitchConfigService.feeLookSwitches();
+        if (!feeLookSwitchesDTO.getFeeDisplay()) {
+            insAreaCompanyEditingDtos.forEach(InsOrdersEditingVo.InsAreaCompanyEditingDto::feeVacant);
+        } else if (feeLookSwitchesDTO.getFeeView()) {
+            insAreaCompanyEditingDtos.forEach(InsOrdersEditingVo.InsAreaCompanyEditingDto::feeDivideBy10);
+        }
+        insAreaCompanyEditingDtos.forEach(x -> {
+            x.setFeeDisplay(feeLookSwitchesDTO.getFeeDisplay());
+            x.setFeeView(feeLookSwitchesDTO.getFeeView());
+        });
+    }
+
+    @Override
+    public void setQuote(QuoteRespVo quoteRespVo) {
+        FeeLookSwitchesDTO feeLookSwitchesDTO = sysSwitchConfigService.feeLookSwitches();
+        if (!feeLookSwitchesDTO.getFeeDisplay()) {
+            quoteRespVo.feeVacant();
+        } else if (feeLookSwitchesDTO.getFeeView()) {
+            quoteRespVo.feeDivideBy10();
+        }
+
+        quoteRespVo.setFeeDisplay(feeLookSwitchesDTO.getFeeDisplay());
+        quoteRespVo.setFeeView(feeLookSwitchesDTO.getFeeView());
+
+    }
+
+    @Override
+    public boolean setWithdrawals(List<MyCollectInAdvanceDto> recordsNew) {
+        boolean b = sysSwitchConfigService.feeDisplaySwitches();
+        if (b) {
+            recordsNew.forEach(x -> {
+                x.setAmount(BigDecimalUtils.nullToZero(x.getAmount()).divide(new BigDecimal(10)));
+            });
+        }
+        return b;
+    }
+
+
+    @Override
+    public boolean setWithdrawalsPc(List<ExportExpenditureTypeDetalsSZDto> recordsNew) {
+        boolean b = sysSwitchConfigService.feeDisplaySwitches();
+        if (b) {
+            recordsNew.forEach(x -> {
+                x.setAmount(BigDecimalUtils.nullToZero(x.getAmount()).divide(new BigDecimal(10)));
+            });
+        }
+        return b;
+    }
+
+    @Override
+    public boolean setCarInsurance(List<ExportExpenditureTypeDetalsDto> recordsNew) {
+        boolean b = sysSwitchConfigService.feeDisplaySwitches();
+        if (b) {
+            recordsNew.forEach(x -> {
+                x.setAmount(BigDecimalUtils.nullToZero(x.getAmount()).divide(new BigDecimal(10)));
+            });
+        }
+        return b;
+    }
+}

+ 21 - 0
src/main/java/com/ydtech/modules/ins/model/vo/QuoteRespVo.java

@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
 import com.ydtech.modules.order.entity.TaxArrears;
 import com.ydtech.modules.order.entity.crawler.response.CrawlerQuoteResponse;
 import com.ydtech.modules.order.entity.vo.CoreModelsVo;
+import com.ydtech.utils.BigDecimalUtils;
 import com.ydtech.utils.StringUtils;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -178,6 +179,12 @@ public class QuoteRespVo {
     @ApiModelProperty("自主定价系数")
     private String pricingCoefficient;
 
+    @ApiModelProperty("费用查看")
+    private Boolean feeView;
+
+    @ApiModelProperty("费用显示")
+    private Boolean feeDisplay;
+
     public void setJqClaims(String jqClaims) {
         this.jqClaims = StringUtils.isEmpty(jqClaims) ? null : jqClaims;
     }
@@ -210,8 +217,22 @@ public class QuoteRespVo {
             this.opinion = predictInfoDTO.getOpinion();
         }
 
+    }
+
+    public void feeVacant(){
+        this.jqExportFee = null;
+        this.syExportFee = null;
+        this.noExportFee = null;
+        this.sumExportFee = null;
+    }
 
+    public void feeDivideBy10(){
+        this.jqExportFee = BigDecimalUtils.nullToZero(this.jqExportFee).divide(new BigDecimal(10));
+        this.syExportFee = BigDecimalUtils.nullToZero(this.syExportFee).divide(new BigDecimal(10));
+        this.noExportFee = BigDecimalUtils.nullToZero(this.noExportFee).divide(new BigDecimal(10));
+        this.sumExportFee = BigDecimalUtils.nullToZero(this.sumExportFee).divide(new BigDecimal(10));
     }
 
 
+
 }

+ 6 - 5
src/main/java/com/ydtech/modules/order/aop/aspect/QuoteVerificationAspect.java

@@ -3,7 +3,6 @@ package com.ydtech.modules.order.aop.aspect;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ydtech.constants.enums.InsuranceRisk;
-import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.constants.enums.dict.agreement.ProductsType;
 import com.ydtech.constants.sys.SystemConstant;
 import com.ydtech.core.page.HttpResult;
@@ -15,6 +14,7 @@ import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.fee.service.CostsCalcService;
+import com.ydtech.modules.fee.service.FeeDisplayService;
 import com.ydtech.modules.fee.service.FeeRuleSchemeNewService;
 import com.ydtech.modules.ins.model.vo.KindInfoVo;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
@@ -35,7 +35,6 @@ import com.ydtech.modules.protocol.constants.TaxSourceStatusConstants;
 import com.ydtech.modules.protocol.dao.PtlTaxSourceNewMapper;
 import com.ydtech.modules.protocol.entity.dto.TaxSourceExcludeDto;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
-import com.ydtech.modules.protocol.entity.po.PtlAgreementDept;
 import com.ydtech.modules.protocol.entity.po.PtlTaxSourceNew;
 import com.ydtech.modules.protocol.service.ITaxSourceExcludeService;
 import com.ydtech.modules.protocol.service.PtlAgreementDeptService;
@@ -87,21 +86,20 @@ public class QuoteVerificationAspect {
 
     private final InsFeeOrderNewService insFeeOrderNewService;
 
-
     private final SysUserService sysUserService;
 
     private final PtlTaxSourceNewService ptlTaxSourceNewService;
 
-
     private final ITaxSourceExcludeService taxSourceExcludeService;
 
-
     private final PtlTaxSourceNewMapper ptlTaxSourceNewMapper;
 
     private final PtlAgreementService ptlAgreementService;
 
     private final InsAreaCompanyErrorService insAreaCompanyErrorService;
 
+    private final FeeDisplayService feeDisplayService;
+
     @AfterReturning(pointcut = "@annotation(com.ydtech.modules.order.aop.QuoteVerification)", returning = "result")
     public void doAfter(HttpResult<QuoteRespVo> result) {
         //计算费用因子
@@ -130,7 +128,10 @@ public class QuoteVerificationAspect {
                         result.getData().setSumExportFee(subOrderExportFeeVo.getJqExportCosts()
                                 .add(subOrderExportFeeVo.getSyExportCosts())
                                 .add(subOrderExportFeeVo.getNoExportCosts()));
+                    }else {
+                        feeDisplayService.setQuote(result.getData());
                     }
+
                 }else{
                     //输出费用匹配失败日志
                     result.getData().setFeeNoDescription(logs.toString());

+ 24 - 0
src/main/java/com/ydtech/modules/order/entity/crawler/request/CrawlerCustomerRequest.java

@@ -0,0 +1,24 @@
+package com.ydtech.modules.order.entity.crawler.request;
+
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class CrawlerCustomerRequest implements Serializable {
+
+    private static final long serialVersionUID = -3877747852543263512L;
+
+    /**
+     * 消息
+     */
+    @JsonProperty(value = "question")
+    private String question;
+
+}

+ 24 - 2
src/main/java/com/ydtech/modules/order/entity/vo/FeeOrderNewVo.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.order.entity.vo;
 
 
+import com.ydtech.utils.BigDecimalUtils;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -89,6 +90,27 @@ public class FeeOrderNewVo implements Serializable {
         @ApiModelProperty("外部金额")
         private BigDecimal externalPremiums;
 
+        public void feeVacant() {
+            this.totalProportion = null;
+            this.totalAmount = null;
+            this.superviseCosts = null;
+            this.superviseCostsPremiums = null;
+            this.otherCostsProportion = null;
+            this.otherCostsPremiums = null;
+            this.externalProportion = null;
+            this.externalPremiums = null;
+        }
+
+        public void feeDivideBy10() {
+            this.totalProportion = BigDecimalUtils.nullToZero(this.totalProportion).divide(new BigDecimal(10));
+            this.totalAmount = BigDecimalUtils.nullToZero(this.totalAmount).divide(new BigDecimal(10));
+            this.superviseCosts = BigDecimalUtils.nullToZero(this.superviseCosts).divide(new BigDecimal(10));
+            this.superviseCostsPremiums = BigDecimalUtils.nullToZero(this.superviseCostsPremiums).divide(new BigDecimal(10));
+            this.otherCostsProportion = BigDecimalUtils.nullToZero(this.otherCostsProportion).divide(new BigDecimal(10));
+            this.otherCostsPremiums = BigDecimalUtils.nullToZero(this.otherCostsPremiums).divide(new BigDecimal(10));
+            this.externalProportion = BigDecimalUtils.nullToZero(this.externalProportion).divide(new BigDecimal(10));
+            this.externalPremiums = BigDecimalUtils.nullToZero(this.externalPremiums).divide(new BigDecimal(10));
+        }
 
     }
 
@@ -130,7 +152,7 @@ public class FeeOrderNewVo implements Serializable {
 
     @ApiModel(description = "分销费用")
     @Data
-    public static class RetailFee{
+    public static class RetailFee {
         @ApiModelProperty("险种")
         private String insuranceType;
 
@@ -158,7 +180,7 @@ public class FeeOrderNewVo implements Serializable {
         @ApiModelProperty("总分销金额")
         private BigDecimal totalRetailPremiums;
 
-        public RetailFee(){
+        public RetailFee() {
             jqRetailProportion = new BigDecimal(0);
             jqRetailPremiums = new BigDecimal(0);
             syRetailProportion = new BigDecimal(0);

+ 29 - 8
src/main/java/com/ydtech/modules/order/entity/vo/InsOrdersEditingVo.java

@@ -11,11 +11,15 @@ import com.ydtech.modules.order.entity.InsBusinessInsurance;
 import com.ydtech.modules.order.entity.InsOrders;
 import com.ydtech.modules.order.entity.TaxArrears;
 import com.ydtech.modules.order.entity.dto.InsAreaCompanyQueryDto;
+import com.ydtech.utils.BigDecimalUtils;
 import com.ydtech.modules.protocol.entity.dto.PtlAgreementInsCompanyDto;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.ObjectUtils;
 
+import javax.persistence.NamedQueries;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
@@ -84,13 +88,17 @@ public class InsOrdersEditingVo extends InsOrders implements Serializable {
     private List<PtlAgreementInsCompanyDto> companyDtos;
 
     @Data
+    @AllArgsConstructor
+    @NoArgsConstructor
     public static class InsAreaCompanyEditingDto implements Serializable {
 
-        public InsAreaCompanyEditingDto(){
+        private static final long serialVersionUID = 5819731807013343817L;
 
-        }
+        @ApiModelProperty("费用查看")
+        private Boolean feeView;
 
-        private static final long serialVersionUID = 5819731807013343817L;
+        @ApiModelProperty("费用显示")
+        private Boolean feeDisplay;
 
         @ApiModelProperty("编辑状态")
         private boolean editStatus = true;
@@ -222,6 +230,19 @@ public class InsOrdersEditingVo extends InsOrders implements Serializable {
         private List<InsBusinessInsurance> drivingList = new ArrayList<>();
 
 
+        public void feeVacant() {
+            this.jqExportFee = null;
+            this.syExportFee = null;
+            this.noExportFee = null;
+            this.sumExportFee = null;
+        }
+
+        public void feeDivideBy10() {
+            this.jqExportFee = BigDecimalUtils.nullToZero(this.jqExportFee).divide(new BigDecimal(10));
+            this.syExportFee = BigDecimalUtils.nullToZero(this.syExportFee).divide(new BigDecimal(10));
+            this.noExportFee = BigDecimalUtils.nullToZero(this.noExportFee).divide(new BigDecimal(10));
+            this.sumExportFee = BigDecimalUtils.nullToZero(this.sumExportFee).divide(new BigDecimal(10));
+        }
 
         public InsAreaCompanyEditingDto(InsAreaCompanyQueryDto insAreaCompany) {
             this.orderno = insAreaCompany.getOrderno();
@@ -230,11 +251,11 @@ public class InsOrdersEditingVo extends InsOrders implements Serializable {
             this.inscompany = insAreaCompany.getInscompany();
             this.kindList = ObjectUtils.isEmpty(insAreaCompany.getKindinfo()) ? new ArrayList<>() :
                     insAreaCompany.getKindinfo().toJavaList(QuoteKindRespVo.class);
-            this.jqPremium = ObjectUtils.isEmpty(insAreaCompany.getJqpremium()) ? 0.0 :insAreaCompany.getJqpremium().doubleValue();
-            this.syPremium = ObjectUtils.isEmpty(insAreaCompany.getSypremium()) ? 0.0 :insAreaCompany.getSypremium().doubleValue();
-            this.jyPremium = ObjectUtils.isEmpty(insAreaCompany.getJypremium()) ? 0.0 :insAreaCompany.getJypremium().doubleValue();
-            this.taxAmount = ObjectUtils.isEmpty(insAreaCompany.getTaxamount()) ? 0.0 :insAreaCompany.getTaxamount().doubleValue();
-            this.sumPermium = ObjectUtils.isEmpty(insAreaCompany.getSumpremium()) ? 0.0 :insAreaCompany.getSumpremium().doubleValue();
+            this.jqPremium = ObjectUtils.isEmpty(insAreaCompany.getJqpremium()) ? 0.0 : insAreaCompany.getJqpremium().doubleValue();
+            this.syPremium = ObjectUtils.isEmpty(insAreaCompany.getSypremium()) ? 0.0 : insAreaCompany.getSypremium().doubleValue();
+            this.jyPremium = ObjectUtils.isEmpty(insAreaCompany.getJypremium()) ? 0.0 : insAreaCompany.getJypremium().doubleValue();
+            this.taxAmount = ObjectUtils.isEmpty(insAreaCompany.getTaxamount()) ? 0.0 : insAreaCompany.getTaxamount().doubleValue();
+            this.sumPermium = ObjectUtils.isEmpty(insAreaCompany.getSumpremium()) ? 0.0 : insAreaCompany.getSumpremium().doubleValue();
             this.startDateJq = insAreaCompany.getJqStartDate();
             this.endDateJq = insAreaCompany.getJqEndDate();
             this.startDateSy = insAreaCompany.getSyStartDate();

+ 8 - 2
src/main/java/com/ydtech/modules/order/entity/vo/OrderVo.java

@@ -383,7 +383,7 @@ public class OrderVo implements Serializable {
     /**
      * 分销明细
      */
-    private List<DistributionLevelVo>  distributionLevelVoList;
+    private List<DistributionLevelVo> distributionLevelVoList;
 
     /**
      * 紫金能源车(鼎然-车辆风险评分  add by hxl 2024-04-09
@@ -492,7 +492,7 @@ public class OrderVo implements Serializable {
     /**
      * 交强险种信息
      */
-    @TableField(exist = false,typeHandler = FastjsonTypeHandler.class)
+    @TableField(exist = false, typeHandler = FastjsonTypeHandler.class)
     private JSONArray jqInsuranceType;
 
     @ApiModelProperty(value = "api类型")
@@ -510,4 +510,10 @@ public class OrderVo implements Serializable {
     @ApiModelProperty(value = "核保原因")
     private String underwritingReason;
 
+    @ApiModelProperty("费用查看")
+    private Boolean feeView;
+
+    @ApiModelProperty("费用显示")
+    private Boolean feeDisplay;
+
 }

+ 15 - 3
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -33,6 +33,8 @@ import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.esm.model.EsmUserReferrer;
 import com.ydtech.modules.esm.service.EsmUserReferrerService;
 import com.ydtech.modules.fee.service.CostsCalcService;
+import com.ydtech.modules.fee.service.FeeDisplayService;
+import com.ydtech.modules.fee.service.impl.FeeDisplayServiceImpl;
 import com.ydtech.modules.fee.service.impl.FeeRuleSchemeServiceImpl;
 import com.ydtech.modules.fnc.entity.InsFeeAudit;
 import com.ydtech.modules.fnc.service.InsFeeAuditService;
@@ -134,6 +136,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
     private final InsOrdersUnderwritingReasonService insOrdersUnderwritingReasonService;
 
+    private final FeeDisplayService feeDisplayService;
+
     @Autowired
     private SysUserInfoService sysUserInfoService;
 
@@ -187,7 +191,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
                                 PtlAgreementService ptlAgreementService,
                                 @Lazy FeeRuleSchemeServiceImpl feeRuleSchemeService,
                                 @Lazy InsFeeAuditService insFeeAuditService, InsOrdersTrackService insOrdersTrackService,
-                                InsOrdersUnderwritingReasonService insOrdersUnderwritingReasonService) {
+                                InsOrdersUnderwritingReasonService insOrdersUnderwritingReasonService, FeeDisplayService feeDisplayService) {
 
         this.orderComponents = orderComponents;
         this.sysUserService = sysUserService;
@@ -201,6 +205,7 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         this.insFeeAuditService = insFeeAuditService;
         this.insOrdersTrackService = insOrdersTrackService;
         this.insOrdersUnderwritingReasonService = insOrdersUnderwritingReasonService;
+        this.feeDisplayService = feeDisplayService;
     }
 
 
@@ -767,6 +772,8 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
 
         String insOrdersUnderwritingReason = insOrdersUnderwritingReasonService.getInsOrdersUnderwritingReason(orderAndAreaCompany.getCompanyId(), orderAndAreaCompany.getOrderstatus());
         orderAndAreaCompany.setUnderwritingReason(insOrdersUnderwritingReason);
+        // 置空数据 数据除以10
+        feeDisplayService.setUpFeePresentationFormat(orderAndAreaCompany);
         return HttpResult.ok("success", orderAndAreaCompany);
     }
 
@@ -1058,10 +1065,10 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             });
 
         });
-        if (insAreaCompanyEditingDtos != null && insAreaCompanyEditingDtos.size() > 0) {
+        if (!insAreaCompanyEditingDtos.isEmpty()) {
             //根据出单员判断  编辑查看
             //add  by  hxl   添加出单员不能查看优惠的限制    2024-07-16
-            String userId = new BaseController().getUserId();
+            String userId = BaseController.getUserId();
             SysUserRole sysUserRole = sysUserRoleService.selectByUserId(userId);
             if (sysUserRole != null && sysUserRole.getRoleId() == 19) {
                 insAreaCompanyEditingDtos.forEach(item -> {
@@ -1071,8 +1078,13 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
                             item.setSumExportFee(null);
                         }
                 );
+            }else {
+                feeDisplayService.setUpRevise(insAreaCompanyEditingDtos);
             }
+
         }
+
+
         insOrdersEditingVo.setInsAreaCompanyEditingDtos(insAreaCompanyEditingDtos);
         return insOrdersEditingVo;
     }

+ 9 - 3
src/main/resources/application-pre.yml

@@ -110,8 +110,8 @@ resp_json: '{"status":"Z00001","msg":"success","data":{"invoiceType":[],"payWayL
 # 电销接口配置
 dx:
   api:
-    findDataUserIdUrl: http://172.24.144.218:8088/dxData/listByUserId
-    findDataUserIdAndDayUrl: http://172.24.144.218:8088/dxData/listByUserIdByDay
+    findDataUserIdUrl: http://172.24.144.220:8008/dxData/listByUserId
+    findDataUserIdAndDayUrl: http://172.24.144.220:8008/dxData/listByUserIdByDay
 
 spring:
   datasource:
@@ -379,6 +379,7 @@ xxl:
       #logpath: /data/logs/mls/job
       # 执行器日志文件保存天数 [选填] : 过期日志自动清理, 限制值大于等于3时生效; 否则, 如-1, 关闭自动清理功能;
       logretentiondays: 7
+
 #接口反爬虫配置
 anti:
   reptile:
@@ -400,4 +401,9 @@ anti:
       file: classpath:redisson-pre.yml
 
 python:
-  check: zs
+  check: zs
+
+### AI
+customer:
+  api:
+    url: http://47.92.254.66:8088/ai

+ 9 - 3
src/main/resources/application-prod.yml

@@ -110,8 +110,8 @@ resp_json: '{"status":"Z00001","msg":"success","data":{"invoiceType":[],"payWayL
 # 电销接口配置
 dx:
   api:
-    findDataUserIdUrl: http://172.24.144.218:8088/dxData/listByUserId
-    findDataUserIdAndDayUrl: http://172.24.144.218:8088/dxData/listByUserIdByDay
+    findDataUserIdUrl: http://172.24.144.220:8008/dxData/listByUserId
+    findDataUserIdAndDayUrl: http://172.24.144.220:8008/dxData/listByUserIdByDay
 
 spring:
   datasource:
@@ -394,4 +394,10 @@ anti:
       file: classpath:redisson-prod.yml
 
 python:
-  check: zs
+  check: zs
+
+
+### AI
+customer:
+  api:
+    url: http://47.92.254.66:8088/ai

+ 9 - 3
src/main/resources/application-test.yml

@@ -124,8 +124,8 @@ resp_json: '{"code":200,"msg":null,"data":{"busUniqueId":"P_YBX_TESTT0NukiEN02OG
 # 电销接口配置
 dx:
   api:
-    findDataUserIdUrl: http://172.24.144.218:8088/dxData/listByUserId
-    findDataUserIdAndDayUrl: http://172.24.144.218:8088/dxData/listByUserIdByDay
+    findDataUserIdUrl: http://172.24.144.218:8008/dxData/listByUserId
+    findDataUserIdAndDayUrl: http://172.24.144.218:8008/dxData/listByUserIdByDay
 
 spring:
   datasource:
@@ -475,4 +475,10 @@ anti:
       file: classpath:redisson-test.yml
 
 python:
-  check: ceshi
+  check: ceshi
+
+
+### AI
+customer:
+  api:
+    url: http://47.92.254.66:8088/ai

+ 7 - 3
src/main/resources/mapper/modules/admin/SysTelemarketingWechatDataMapper.xml

@@ -27,10 +27,12 @@
             t3.NAME AS groupName,
             t3.id AS groupId,
             zgd.zgd_user_id AS zgdUserId,
-            zzb.zzb_user_id AS zzdUserId
+            zzb.zzb_user_id AS zzdUserId,
+            dx.dial_username AS  dxUserId
         FROM
         sys_user t1
         LEFT JOIN sys_dept t2 ON t1.dept_id = t2.id
+        LEFT JOIN sys_user_is_dial  dx  ON t1.id =dx.user_id
         LEFT JOIN sys_user_link_dept_internal_agent t4 ON t4.user_id = t1.id
         LEFT JOIN sys_dept_internal_agent t3 ON t2.id = t3.bind_dept_id
         LEFT JOIN sys_user_link_zgd_user_id zgd ON t2.id = zgd.user_id
@@ -84,7 +86,7 @@
         <where>
             user_id =#{vo.userId}
             <if test="vo.beginDate != null and vo.beginDate != ''  and vo.endDate != null and vo.endDate != '' ">
-                AND  calldate  BETWEEN  #{vo.beginDate}  AND  #{vo.endDate}
+                AND  create_time  BETWEEN  #{vo.beginDate}  AND  #{vo.endDate}
             </if>
         </where>
     </select>
@@ -99,10 +101,12 @@
         t3.NAME AS groupName,
         t3.id AS groupId,
         zgd.zgd_user_id AS zgdUserId,
-        zzb.zzb_user_id AS zzdUserId
+        zzb.zzb_user_id AS zzdUserId,
+        dx.dial_username AS  dxUserId
         FROM
         sys_user t1
         LEFT JOIN sys_dept t2 ON t1.dept_id = t2.id
+        LEFT JOIN sys_user_is_dial  dx  ON t1.id =dx.user_id
         LEFT JOIN sys_user_link_dept_internal_agent t4 ON t4.user_id = t1.id
         LEFT JOIN sys_dept_internal_agent t3 ON t2.id = t3.bind_dept_id
         LEFT JOIN sys_user_link_zgd_user_id zgd ON t2.id = zgd.user_id

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

@@ -40,7 +40,7 @@
                 AND su.id = #{vo.userId}
             </if>
             <if test="vo.deptId != null and vo.deptId != ''">
-                AND su.dept_id like CONCAT('%', #{deptId}, '%')
+                AND su.dept_id like CONCAT('%', #{vo.deptId}, '%')
             </if>
         </where>
           order by su.id

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

@@ -40,7 +40,7 @@
                 AND su.id = #{vo.userId}
             </if>
             <if test="vo.deptId != null and vo.deptId != ''">
-                AND su.dept_id like CONCAT('%', #{deptId}, '%')
+                AND su.dept_id like CONCAT('%', #{vo.deptId}, '%')
             </if>
         </where>
         order by su.id

+ 4 - 0
src/main/resources/mapper/modules/admin/SysUserMapper.xml

@@ -1382,6 +1382,10 @@
             <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>
         </where>
     </select>
 

+ 5 - 0
src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml

@@ -261,6 +261,11 @@
               group by pa.insurance_company, pa.partner_companies_id) a
     </select>
 
+    <select id="channelAgentDetails" resultType="com.ydtech.modules.admin.model.dto.TaskStatisticsDto">
+
+
+    </select>
+
 
 
 </mapper>

+ 23 - 0
src/main/resources/mapper/modules/customer/CusChatMessagesMapper.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ydtech.modules.customer.dao.CusChatMessagesMapper">
+
+    <resultMap id="BaseResultMap" type="com.ydtech.modules.customer.entity.po.CusChatMessages">
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="fromUserId" column="from_user_id" jdbcType="VARCHAR"/>
+            <result property="toUserId" column="to_user_id" jdbcType="VARCHAR"/>
+            <result property="messageType" column="message_type" jdbcType="TINYINT"/>
+            <result property="message" column="message" jdbcType="VARCHAR"/>
+            <result property="groupType" column="group_type" jdbcType="TINYINT"/>
+            <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,from_user_id,to_user_id,
+        message_type,message,group_type,
+        created_at
+    </sql>
+
+</mapper>

+ 3 - 0
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -2876,6 +2876,9 @@
                     <if test="vo.year !=null  and  vo.year !=''">
                        and DATE_FORMAT( iac.signing_time, '%Y') =#{vo.year}
                     </if>
+                    <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                        AND  iac.signing_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+                    </if>
                     <if test="vo.days !=null  and vo.days !='' ">
                         and iac.signing_time >= DATE_SUB(NOW(), INTERVAL #{vo.days} DAY)
                     </if>

+ 2 - 3
src/main/resources/mapper/modules/order/InsAreaCompanyMapper.xml

@@ -997,6 +997,8 @@
         COUNT( CASE WHEN iac.orderstatus = 3 THEN 1 END ) /  COUNT( iac.orderstatus ) AS "closeRate",
         (COUNT( CASE WHEN iac.orderstatus = 3 THEN 1 END )  +  COUNT( CASE WHEN iac.orderstatus = 2 THEN 1 END ))/ COUNT( iac.orderstatus ) AS "contributionRate",
         COUNT( CASE WHEN iac.orderstatus = 0 THEN 1 END ) / COUNT( iac.orderstatus ) AS "quotationRate",
+        COUNT(CASE WHEN io.order_source = 0  and iac.orderstatus = 0 THEN 1 END) as "pcOrderSource",
+        COUNT(CASE WHEN io.order_source = 1  and iac.orderstatus = 0 THEN 1 END) as "appOrderSource",
         COUNT( CASE WHEN iac.orderstatus = 1 THEN 1 END ) AS "auditOrder"
         FROM
         ins_area_company iac
@@ -1610,9 +1612,6 @@
         <if test="vo.createtimeStart  != null  and  vo.createtimeStart!=''  and vo.createtimeEnd  != null  and  vo.createtimeEnd!=''">
             AND   DATE_FORMAT( iac.createtime, '%Y-%m-%d')   BETWEEN DATE_FORMAT( #{vo.createtimeStart}, '%Y-%m-%d')  AND DATE_FORMAT( #{vo.createtimeEnd}, '%Y-%m-%d')
         </if>
-        <if test="vo.days !=null  and vo.days !=''  and vo.days != 0 ">
-            and iac.createtime >= DATE_SUB(NOW(), INTERVAL #{vo.days} DAY)
-        </if>
         <if test="vo.provinceId != null and vo.provinceId != '' and  vo.cityId == null and vo.countyId == null  and vo.houseId == null ">
             and io.deptid like "${vo.provinceId}%"
         </if>

+ 48 - 35
src/main/resources/mapper/modules/protocol/PtlAgreementMapper.xml

@@ -188,42 +188,55 @@
         esm_ins_company AS eic
         LEFT JOIN ptl_agreement AS pa ON pa.insurance_company_id = eic.id
         LEFT JOIN esm_ins_company eic_hz ON pa.partner_companies_id = eic_hz.id
-        left join sys_area area on  RPAD(SUBSTRING( pa.partner_companies_id, 6, 4 ),6,0)= area.area_code
+        left join sys_area area on RPAD(SUBSTRING( pa.partner_companies_id, 6, 4 ),6,0)= area.area_code
         <where>
-           1=1
-           and  pa.id  is  not  null
-        <if test="vo.deptId  !=null  and   vo.deptId  !=''" >
-            AND pa.id IN ( SELECT DISTINCT agreement_id FROM ptl_agreement_dept WHERE dept_id LIKE concat(#{vo.deptId},'%') )
-        </if>
-        <if test="vo.warningDay  !=null  and   vo.warningDay  !=''" >
-            <choose>
-                <when test="warningDay==1">
-                    DATEDIFF(pa.end_date,NOW()) &lt;= 30
-                </when>
-                <when test="warningDay==2">
-                    DATEDIFF(pa.end_date,NOW()) &lt;= 60
-                </when>
-            </choose>
-        </if>
-        <if test="vo.warningStatus  !=null  and   vo.warningStatus  !=''" >
-            <choose>
-                <when test="warningStatus==1">
-                    DATEDIFF(pa.end_date,NOW()) &lt;=  30
-                </when>
-                <when test="warningStatus==2">
-                    DATEDIFF(pa.end_date,NOW()) &gt;  30
-                </when>
-            </choose>
-        </if>
-        <if test="vo.areaId  !=null  and   vo.areaId  !=''" >
-             AND ( pa.companies_type = 1 AND  RPAD(SUBSTRING( pa.partner_companies_id, 6, 4 ),6,0) = #{vo.areaId})
-        </if>
-        <if test="vo.partnerCompaniesId  !=null  and   vo.partnerCompaniesId  !=''" >
-            and   pa.partner_companies_id =#{vo.partnerCompaniesId}
-        </if>
-        <if test="vo.insuranceCompanyId  !=null  and   vo.insuranceCompanyId  !=''" >
-            and   pa.insurance_company_id =#{vo.insuranceCompanyId}
-        </if>
+            1=1
+            and pa.id is not null
+            <if test="vo.deptId  !=null  and   vo.deptId  !=''">
+                AND pa.id IN ( SELECT DISTINCT agreement_id FROM ptl_agreement_dept WHERE dept_id LIKE
+                concat(#{vo.deptId},'%') )
+            </if>
+            <if test="vo.warningDay  !=null  and   vo.warningDay  !=''">
+                <choose>
+                    <when test="warningDay==1">
+                        DATEDIFF(pa.end_date,NOW()) &lt;= 30
+                    </when>
+                    <when test="warningDay==2">
+                        DATEDIFF(pa.end_date,NOW()) &lt;= 60
+                    </when>
+                </choose>
+            </if>
+            <if test="vo.warningStatus  !=null  and   vo.warningStatus  !=''">
+                <choose>
+                    <when test="warningStatus==1">
+                        DATEDIFF(pa.end_date,NOW()) &lt;= 30
+                    </when>
+                    <when test="warningStatus==2">
+                        DATEDIFF(pa.end_date,NOW()) &gt; 30
+                    </when>
+                </choose>
+            </if>
+            <if test="vo.areaId  !=null  and   vo.areaId  !=''">
+                AND ( pa.companies_type = 1 AND RPAD(SUBSTRING( pa.partner_companies_id, 6, 4 ),6,0) = #{vo.areaId})
+            </if>
+            <if test="vo.partnerCompaniesId  !=null  and   vo.partnerCompaniesId  !=''">
+                and pa.partner_companies_id =#{vo.partnerCompaniesId}
+            </if>
+            <if test="vo.insuranceCompanyId  !=null  and   vo.insuranceCompanyId  !=''">
+                and pa.insurance_company_id =#{vo.insuranceCompanyId}
+            </if>
+            <if test="vo.provinceId != null and vo.provinceId != ''">
+                and pa.dept_id like concat('%',#{vo.provinceId},'%')
+            </if>
+            <if test="vo.cityId != null and vo.cityId != ''">
+                and pa.dept_id like concat('%',#{vo.cityId},'%')
+            </if>
+            <if test="vo.countyId != null and vo.countyId != ''">
+                and pa.dept_id like concat('%',#{vo.countyId},'%')
+            </if>
+            <if test="vo.houseId != null and vo.houseId != ''">
+                and pa.dept_id like concat('%',#{vo.houseId},'%')
+            </if>
         </where>
         ORDER BY
         pa.serial_number

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است