Explorar o código

添加报价次数查询接口

hxl13994548489 %!s(int64=2) %!d(string=hai) anos
pai
achega
83a67cd377

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

@@ -1,14 +1,16 @@
 package com.ydtech.modules.admin.controller.personnelStatistics;
 
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.modules.admin.model.report.user.HouLinePersonnelReportDto;
 import com.ydtech.modules.admin.model.vo.HouLinePersonnelReportVo;
 import com.ydtech.modules.admin.service.SysDeptService;
 import com.ydtech.modules.admin.service.UserReportService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.HashMap;
 

+ 49 - 0
src/main/java/com/ydtech/modules/admin/controller/quoteCount/QuoteCountController.java

@@ -0,0 +1,49 @@
+package com.ydtech.modules.admin.controller.quoteCount;
+
+import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataDto;
+import com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataQueryDto;
+import com.ydtech.modules.admin.service.CompanyDataReportService;
+import com.ydtech.modules.order.entity.BasePageResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ *  @version
+ *  @author: hxl
+ *  @Date: 2024/7/30 14:38
+ *  @Description:  报价次数查询
+ */
+@Api(tags = "报价次数")
+@RequestMapping("/userStatistics")
+@RestController
+public class QuoteCountController {
+
+
+    @Autowired
+    private CompanyDataReportService companyDataReportService;
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/7/3 15:35
+     *  @Description:   查询报价次数数据
+     */
+    @PostMapping("queryCompanyQutationCountDataPage")
+    @ApiOperation(value = "查询报价次数数据")
+    public HttpResult<BasePageResult<CompanyQutationCountDataDto>> queryCompanyQutationCountDataPage(@RequestBody CompanyQutationCountDataQueryDto companyQutationCountDataQueryDto) {
+        try{
+            BasePageResult<CompanyQutationCountDataDto> result = companyDataReportService.queryCompanyQutationCountDataPage(companyQutationCountDataQueryDto);
+            return HttpResult.ok("查询数据成功", result);
+        }catch (Exception e){
+            return HttpResult.error("查询错误"+e.getMessage());
+        }
+    }
+
+
+
+}

+ 15 - 0
src/main/java/com/ydtech/modules/admin/model/report/company/CompanyQutationCountDataDto.java

@@ -28,6 +28,21 @@ public class CompanyQutationCountDataDto {
     @ApiModelProperty("保司机构id")
     private String parterCompanyId;
 
+    /***
+     *  小订单报价数
+     */
+    @ApiModelProperty("大订单报价数")
+    private String bigQutationCount;
+    /***
+     *  小订单核保数
+     */
+    @ApiModelProperty("大订单承保数")
+    private String bigUnderwritingCount;
+    /***
+     *  小订单承保数
+     */
+    @ApiModelProperty("大订单成交率")
+    private String bigCloseRate;
 
     /***
      *  小订单报价数

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

@@ -26,4 +26,20 @@ public class CompanyQutationCountDataQueryDto {
     @ApiModelProperty("页数")
     private int pageSize;
 
+    /***
+     *  开始时间
+     */
+    @ApiModelProperty("开始时间")
+    private String  beginDate;
+    /***
+     *  结束时间
+     */
+    @ApiModelProperty("结束时间")
+    private String endDate;
+    /***
+     *  时间类型  1.近1月 2.近3月  3.近半年
+     */
+    @ApiModelProperty("时间类型  1.近1月 2.近3月  3.近半年")
+    private String  dateType;
+
 }

+ 42 - 0
src/main/java/com/ydtech/modules/admin/service/impl/CompanyDataReportServiceImpl.java

@@ -7,11 +7,16 @@ import com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataDto
 import com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataQueryDto;
 import com.ydtech.modules.admin.model.report.opetationData.QuotationCountDataDto;
 import com.ydtech.modules.admin.service.CompanyDataReportService;
+import com.ydtech.modules.admin.utils.SliceUpDateUtil;
 import com.ydtech.modules.order.dao.InsAreaCompanyMapper;
 import com.ydtech.modules.order.entity.BasePageResult;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
+import java.util.HashMap;
+
 /**
  *  @version
  *  @author: hxl
@@ -49,10 +54,47 @@ public class CompanyDataReportServiceImpl implements CompanyDataReportService {
     @Override
     public BasePageResult<CompanyQutationCountDataDto> queryCompanyQutationCountDataPage(CompanyQutationCountDataQueryDto companyQutationCountDataQueryDto) {
         Page<QuotationCountDataDto> page = new Page<>(companyQutationCountDataQueryDto.getPageNum(), companyQutationCountDataQueryDto.getPageSize());
+        //判断开始时间和结束时间是否为空,如果为空的走时间类型逻辑
+        HashMap<String, String> dateMapByType = getDateMapByType(companyQutationCountDataQueryDto.getDateType(), companyQutationCountDataQueryDto.getBeginDate(), companyQutationCountDataQueryDto.getEndDate());
+        companyQutationCountDataQueryDto.setBeginDate(dateMapByType.get("startDate"));
+        companyQutationCountDataQueryDto.setEndDate(dateMapByType.get("endDate"));
         Page<CompanyQutationCountDataDto> resultSubOrder = insAreaCompanyMapper.queryCompanyQutationCountDataPage(companyQutationCountDataQueryDto, page);
         return new BasePageResult<>(companyQutationCountDataQueryDto.getPageNum(), page.getSize(), resultSubOrder.getTotal(), page.getPages(),
                 resultSubOrder.getRecords());
     }
+
+    /**
+     *  @version
+     *  @author: hxl
+     *  @Date: 2024/6/19 11:57
+     *  @Description:  通过时间类型判断
+     */
+    private static HashMap<String,String> getDateMapByType(String type, String startDate, String endDate) {
+        HashMap<String,String> map =new HashMap<>();
+        String  startDateStr="";
+        String  endDateStr="";
+        if(StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){
+            startDateStr= StringUtils.isNotBlank(startDate)?startDate+" 00:00:00":null;
+            endDateStr= StringUtils.isNotBlank(endDate)?endDate+" 23:59:59":null;
+        }else{
+             if("1".equals(type)){
+                 // 一月内
+                 startDateStr=SliceUpDateUtil.getBeforeDay(new Date(),2)+" 00:00:00";
+                 endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
+            }else if("2".equals(type)){
+                 // 三月内
+                 startDateStr=SliceUpDateUtil.getBeforeDay(new Date(),3)+" 00:00:00";
+                 endDateStr=SliceUpDateUtil.getBeforeDay(new Date(),0)+" 23:59:59";
+            }else if("3".equals(type)){
+                 // 近半年
+                 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;
+    }
 }
 
 

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

@@ -846,7 +846,10 @@
             agree.insurance_company AS companyName,
             agree.partner_companies_id AS parterCompanyId,
             ins.NAME AS parterCompanyName,
-            COUNT( CASE WHEN iac.orderstatus = 0 THEN 1 END ) AS qutationCount,
+            count(iac.orderstatus) AS qutationCount,
+            '-' as  bigQutationCount,
+            '-' as  bigUnderwritingCount,
+            '-' as  bigCloseRate,
             COUNT( CASE WHEN iac.orderstatus = 2 THEN 1 END ) AS underwritingCount,
             COUNT( CASE WHEN iac.orderstatus = 3 THEN 1 END ) AS qutationInsureCount,
             COUNT( CASE WHEN iac.orderstatus = 0 THEN 1 END )/ count(iac.orderstatus) AS passRate,
@@ -864,6 +867,9 @@
             <if test="vo.parterCompanyId  != null  and  vo.parterCompanyId!='' ">
                 agree.insurance_company_id = #{vo.parterCompanyId}
             </if>
+            <if test="vo.beginDate  != null  and  vo.beginDate!=''  and vo.endDate  != null  and  vo.endDate!=''">
+                AND   iac.create_time  BETWEEN #{vo.beginDate} AND #{vo.endDate}
+            </if>
         GROUP BY
             agree.insurance_company_id,
             agree.insurance_company,