diff --git a/code/web/task_schedule/src/utils/BIReport.ts b/code/web/task_schedule/src/utils/BIReport.ts index 36502e2..98a6701 100644 --- a/code/web/task_schedule/src/utils/BIReport.ts +++ b/code/web/task_schedule/src/utils/BIReport.ts @@ -31,10 +31,22 @@ interface ImportBIReportResponse importedCount: number, } +// BI坐席渗透率报表记录 +interface BITelsalerAttachingRateReportRecord +{ + departmentName: string; + telsalerName: string; + motoPremium: number; + nomotoPremium: number; + attachingRatePresentMonth: number; + attachingRateChange: number; +} + interface QueryBITelsalerAttachingRateReportResponse { success: boolean, message: string, + records: BITelsalerAttachingRateReportRecord[]; } type ImportBIReportResponseHandler = ( response: ImportBIReportResponse, error?: any ) => void; @@ -81,5 +93,7 @@ export { type ImportBIReportRequest, type ImportBIReportResponse, type ImportBIReportResponseHandler, + type BITelsalerAttachingRateReportRecord, + type QueryBITelsalerAttachingRateReportResponse, importBIReport }; diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/QueryBIArchievementDataMapper.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/QueryBIArchievementDataMapper.java new file mode 100644 index 0000000..f0b494a --- /dev/null +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/QueryBIArchievementDataMapper.java @@ -0,0 +1,21 @@ +/* + * @Author: Kane + * @Date: 2023-11-01 15:50:40 + * @LastEditors: Kane + * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/QueryBIArchievementDataMapper.java + * @Description: + * + * Copyright (c) ${2023} by Kane, All Rights Reserved. + */ +package com.cpic.xim.mybatis.mapper; + +import java.util.ArrayList; +import com.cpic.xim.mybatis.pojo.BITelsalerAttachingRateRecord; +import com.cpic.xim.mybatis.pojo.BITelsalerRenewalRateRecord; + +public interface QueryBIArchievementDataMapper +{ + public ArrayList queryBITelsalerAttachingRate(); + + public ArrayList queryBITesalerRenewalRate(); +} diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/BITelsalerAttachingRateRecord.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/BITelsalerAttachingRateRecord.java index 2002dd9..73695c0 100644 --- a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/BITelsalerAttachingRateRecord.java +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/BITelsalerAttachingRateRecord.java @@ -47,19 +47,19 @@ public class BITelsalerAttachingRateRecord private double attachingRateChange; // 当月客户渗透率 - @JsonProperty( "customerHandleRateCell" ) + @JsonProperty( "customerHandleRate" ) private double customerHandleRate; // 客户渗透率环比上月 - @JsonProperty( "customerHandleRateChangeCell" ) + @JsonProperty( "customerHandleRateChange" ) private double customerHandleRateChange; // 当月车非客均保费 - @JsonProperty( "noMotoPremiumPerCustomerCell" ) + @JsonProperty( "noMotoPremiumPerCustomer" ) private double noMotoPremiumPerCustomer; // 客均保费环比上月 - @JsonProperty( "noMotoPremiumPerCustomerChangeCell" ) + @JsonProperty( "noMotoPremiumPerCustomerChange" ) private double noMotoPremiumPerCustomerChange; public BITelsalerAttachingRateRecord( String departmentName, LocalDate summaryDate, diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/bi/BIReportController.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/bi/BIReportController.java new file mode 100644 index 0000000..179d512 --- /dev/null +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/bi/BIReportController.java @@ -0,0 +1,74 @@ +/* + * @Author: Kane + * @Date: 2023-11-01 16:48:56 + * @LastEditors: Kane + * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/bi/BIReportController.java + * @Description: BI报表相关的controller + * + * Copyright (c) ${2023} by Kane, All Rights Reserved. + */ +package com.cpic.xim.web.controllers.archievement.bi; + +import java.io.IOException; +import java.util.ArrayList; +import org.apache.ibatis.exceptions.PersistenceException; +import org.apache.ibatis.session.SqlSession; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import com.cpic.xim.mybatis.mapper.QueryBIArchievementDataMapper; +import com.cpic.xim.mybatis.pojo.BIDepartmentAttachingRateRecord; +import com.cpic.xim.mybatis.pojo.BITelsalerAttachingRateRecord; +import com.cpic.xim.mybatis.utils.MybatisUtils; + +@Controller +@RequestMapping( method = RequestMethod.POST, path = "/archievement" ) +public class BIReportController +{ + private static Logger logger = LoggerFactory.getLogger( BIReportController.class ); + + @PostMapping( path = "/bi_telsaler_attachingrate.do" ) + @ResponseBody + QueryTelsalerAttachingRateReportResponse queryTelsalerAttachingRateRepor() + { + QueryTelsalerAttachingRateReportResponse response = + new QueryTelsalerAttachingRateReportResponse(); + SqlSession session = null; + QueryBIArchievementDataMapper mapper = null; + + try + { + session = MybatisUtils.getSqlSession(); + mapper = session.getMapper( QueryBIArchievementDataMapper.class ); + + ArrayList records = + mapper.queryBITelsalerAttachingRate(); + + response.setSuccess( true ); + response.setMessage( "查询成功" ); + response.setRecords( records ); + } + catch ( IOException error ) + { + logger.error("查询BI坐席渗透率报表出现IOException异常,异常内容:", error); + + response.setSuccess( false ); + response.setMessage( "查询失败,原因" + error.getMessage() ); + response.setRecords( null ); + } + catch ( PersistenceException error ) + { + logger.error("查询BI坐席渗透率报表出现PersistenceException异常,异常内容:", error); + + response.setSuccess( false ); + response.setMessage( "查询失败,原因" + error.getMessage() ); + response.setRecords( null ); + } + + return response; + } +} diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/bi/QueryTelsalerAttachingRateReportResponse.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/bi/QueryTelsalerAttachingRateReportResponse.java new file mode 100644 index 0000000..3a00193 --- /dev/null +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/bi/QueryTelsalerAttachingRateReportResponse.java @@ -0,0 +1,82 @@ +/* + * @Author: Kane + * @Date: 2023-11-01 16:51:53 + * @LastEditors: Kane + * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/bi/QueryTelsalerAttachingRateReportResponse.java + * @Description: + * + * Copyright (c) ${2023} by Kane, All Rights Reserved. + */ +package com.cpic.xim.web.controllers.archievement.bi; + +import java.util.ArrayList; +import com.cpic.xim.mybatis.pojo.BITelsalerAttachingRateRecord; +import com.cpic.xim.web.controllers.QueryResponse; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class QueryTelsalerAttachingRateReportResponse extends QueryResponse +{ + @JsonProperty("records") + ArrayList records; + + public QueryTelsalerAttachingRateReportResponse( boolean success, String message, + ArrayList records ) + { + super( success, message ); + this.records = records; + } + + public QueryTelsalerAttachingRateReportResponse() + { + super( false, "" ); + + this.records = null; + } + + public ArrayList getRecords() + { + return records; + } + + public void setRecords( ArrayList records ) + { + this.records = records; + } + + @Override + public String toString() + { + return "QueryTelsalerAttachingRateReportResponse [records=" + records + "]"; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((records == null) ? 0 : records.hashCode()); + return result; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + return true; + if ( !super.equals( obj ) ) + return false; + if ( getClass() != obj.getClass() ) + return false; + QueryTelsalerAttachingRateReportResponse other = + (QueryTelsalerAttachingRateReportResponse) obj; + if ( records == null ) + { + if ( other.records != null ) + return false; + } + else if ( !records.equals( other.records ) ) + return false; + return true; + } + +} diff --git a/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mapper/QueryBIArchievementDataMapper.xml b/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mapper/QueryBIArchievementDataMapper.xml new file mode 100644 index 0000000..d05b05e --- /dev/null +++ b/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mapper/QueryBIArchievementDataMapper.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mybatis-config.xml b/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mybatis-config.xml index bf44152..186aa45 100644 --- a/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mybatis-config.xml +++ b/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mybatis-config.xml @@ -26,6 +26,7 @@ - + + \ No newline at end of file