变更报表内容。

This commit is contained in:
Kane Wang 2023-10-26 18:46:32 +08:00
parent 506f18abfe
commit a33981ac55
34 changed files with 709 additions and 325 deletions

View File

@ -28,6 +28,7 @@ CREATE OR REPLACE PACKAGE telsale_archievement_pkg IS
a_attaching_rate OUT VARCHAR2, a_attaching_rate OUT VARCHAR2,
a_renewal_rate OUT VARCHAR2, a_renewal_rate OUT VARCHAR2,
a_total OUT INTEGER, a_total OUT INTEGER,
a_present_month OUT NUMBER,
a_mensual_cur OUT cur_type a_mensual_cur OUT cur_type
); );
@ -90,7 +91,7 @@ CREATE OR REPLACE PACKAGE BODY TELSALE_ARCHIEVEMENT_PKG IS
SELECT round(dept.当月保费渗透率, SELECT round(dept.当月保费渗透率,
2) 2)
INTO A_ATTACHING_RATE INTO A_ATTACHING_RATE
FROM desktop_archievement_admin.bi部门渗透率续保率统计表 dept FROM desktop_archievement_admin.BI机构渗透率跟踪表 dept
WHERE dept.部门 = L_DEPARTMENT_NAME; WHERE dept.部门 = L_DEPARTMENT_NAME;
--续保率 --续保率
/*SELECT DECODE(SUM(到期数), /*SELECT DECODE(SUM(到期数),
@ -141,6 +142,7 @@ CREATE OR REPLACE PACKAGE BODY TELSALE_ARCHIEVEMENT_PKG IS
a_attaching_rate OUT VARCHAR2, a_attaching_rate OUT VARCHAR2,
a_renewal_rate OUT VARCHAR2, a_renewal_rate OUT VARCHAR2,
a_total OUT INTEGER, a_total OUT INTEGER,
a_present_month OUT NUMBER,
a_mensual_cur OUT cur_type a_mensual_cur OUT cur_type
) IS ) IS
l_caller_name VARCHAR2(100); l_caller_name VARCHAR2(100);
@ -182,11 +184,15 @@ CREATE OR REPLACE PACKAGE BODY TELSALE_ARCHIEVEMENT_PKG IS
SELECT rownum, SELECT rownum,
round(nvl(t.当月保费渗透率, round(nvl(t.当月保费渗透率,
0), 0),
2),
round(nvl(t."车险保费(万)" * 10000,
0),
2) 2)
INTO l_rownum, INTO l_rownum,
a_attaching_rate a_attaching_rate,
FROM BI电销坐席车非渗透统计表 t a_present_month
WHERE t.坐席名称 = l_caller_name FROM BI电销坐席车非渗透率跟踪表 t
WHERE t.经办 = l_caller_name
AND rownum = 1; AND rownum = 1;
/*SELECT decode(nvl(SUM(cf.车险个人客户保费), /*SELECT decode(nvl(SUM(cf.车险个人客户保费),
0), 0),
@ -211,12 +217,12 @@ CREATE OR REPLACE PACKAGE BODY TELSALE_ARCHIEVEMENT_PKG IS
FROM 坐席续保统计 xb FROM 坐席续保统计 xb
WHERE xb.坐席工号 = a_caller_code;*/ WHERE xb.坐席工号 = a_caller_code;*/
SELECT rownum, SELECT rownum,
round(nvl(t.个车续保率全月, round(nvl(t."个车续保率全月(%)",
0), 0),
2) 2)
INTO l_rownum, INTO l_rownum,
a_renewal_rate a_renewal_rate
FROM BI坐席续保率统计表 t FROM BI电销坐席续保率跟踪表 t
WHERE t.责任人 = l_caller_name WHERE t.责任人 = l_caller_name
AND rownum = 1; AND rownum = 1;
@ -263,14 +269,14 @@ CREATE OR REPLACE PACKAGE BODY TELSALE_ARCHIEVEMENT_PKG IS
-- 车非融合率排行榜 -- 车非融合率排行榜
OPEN A_ATTACHING_RANKING_LIST FOR OPEN A_ATTACHING_RANKING_LIST FOR
SELECT rownum, SELECT rownum,
paihang.坐席名称 AS caller_name, paihang.经办 AS caller_name,
paihang.attaching_rate paihang.attaching_rate
FROM (SELECT DISTINCT * FROM (SELECT DISTINCT *
FROM (SELECT t.坐席名称, FROM (SELECT t.经办,
round(t.当月保费渗透率, round(t.当月保费渗透率,
2) attaching_rate, 2) attaching_rate,
zuoxi.department_name zuoxi.department_name
FROM BI电销坐席车非渗透统计表 t, FROM BI电销坐席车非渗透率跟踪表 t,
(SELECT DISTINCT t.saler_code, (SELECT DISTINCT t.saler_code,
t.saler_name, t.saler_name,
t.team_code, t.team_code,
@ -282,7 +288,7 @@ CREATE OR REPLACE PACKAGE BODY TELSALE_ARCHIEVEMENT_PKG IS
WHERE t.team_code = team.team_code WHERE t.team_code = team.team_code
AND team.department_code = bm.department_code AND team.department_code = bm.department_code
AND bm.department_name = L_DEPARTMENT_NAME) zuoxi AND bm.department_name = L_DEPARTMENT_NAME) zuoxi
WHERE t.坐席名称 = zuoxi.saler_name) st WHERE t.经办 = zuoxi.saler_name) st
ORDER BY st.department_name, ORDER BY st.department_name,
st.attaching_rate DESC) paihang; st.attaching_rate DESC) paihang;
-- 续保率排行榜 -- 续保率排行榜
@ -292,10 +298,10 @@ CREATE OR REPLACE PACKAGE BODY TELSALE_ARCHIEVEMENT_PKG IS
paihang.xbl AS RENEWAL_RATE paihang.xbl AS RENEWAL_RATE
FROM (SELECT DISTINCT * FROM (SELECT DISTINCT *
FROM (SELECT t.责任人, FROM (SELECT t.责任人,
round(t.个车续保率全月, round(t."个车续保率全月(%)",
2) xbl, 2) xbl,
zuoxi.department_name zuoxi.department_name
FROM BI坐席续保率统计表 t, FROM BI电销坐席续保率跟踪表 t,
(SELECT DISTINCT t.saler_code, (SELECT DISTINCT t.saler_code,
t.saler_name, t.saler_name,
t.team_code, t.team_code,

View File

@ -4,9 +4,9 @@ CREATE OR REPLACE PACKAGE telsale_bi_utils IS
-- Created : 2023/10/12 15:31:13 -- Created : 2023/10/12 15:31:13
-- Purpose : bi数据报表相关的工具 -- Purpose : bi数据报表相关的工具
PROCEDURE 清理BI电销坐席车非渗透统计表; PROCEDURE 清理BI电销坐席车非渗透率跟踪表;
PROCEDURE 清理BI电销坐席续保率统计表; PROCEDURE 清理BI电销坐席续保率跟踪表;
PROCEDURE 清理BI部门渗透率跟踪表; PROCEDURE 清理BI部门渗透率跟踪表;
@ -16,19 +16,19 @@ END telsale_bi_utils;
/ /
CREATE OR REPLACE PACKAGE BODY telsale_bi_utils IS CREATE OR REPLACE PACKAGE BODY telsale_bi_utils IS
PROCEDURE 清理BI电销坐席车非渗透统计表 IS PROCEDURE 清理BI电销坐席车非渗透率跟踪表 IS
BEGIN BEGIN
EXECUTE IMMEDIATE 'truncate table BI电销坐席车非渗透统计表'; EXECUTE IMMEDIATE 'truncate table BI电销坐席车非渗透率跟踪表';
END; END;
PROCEDURE 清理BI电销坐席续保率统计表 IS PROCEDURE 清理BI电销坐席续保率跟踪表 IS
BEGIN BEGIN
EXECUTE IMMEDIATE 'truncate table BI坐席续保率统计表'; EXECUTE IMMEDIATE 'truncate table BI电销坐席续保率跟踪表';
END; END;
PROCEDURE 清理BI部门渗透率跟踪表 IS PROCEDURE 清理BI部门渗透率跟踪表 IS
BEGIN BEGIN
EXECUTE IMMEDIATE 'truncate table BI部门渗透率续保率统计表'; EXECUTE IMMEDIATE 'truncate table BI机构渗透率跟踪表';
END; END;
PROCEDURE 清理BI部门续保率跟踪表 IS PROCEDURE 清理BI部门续保率跟踪表 IS

View File

@ -1,14 +1,15 @@
--drop table BI坐席续保率统计; drop table BI电销坐席续保率跟踪;
create table BI坐席续保率统计 create table BI电销坐席续保率跟踪
( (
summary_date date default sysdate not null, "责任部门" varchar2(100),
varchar2(20) not null, "责任人" varchar2(30),
NUMBER default 0 not null, "机构目标值1(%)" number default 0,
NUMBER default 0 not null, "到期数-全月" integer default 0,
NUMBER default 0 not null, "序时到期数占比(%)" number default 0,
NUMBER default 0 not null, "个车续保率(序时)(%)" number default 0,
NUMBER default 0 not null, "个车续保率(全月)(%)" number default 0,
NUMBER default 0 not null, "环比昨日(%)" number default 0,
NUMBER default 0 not null "环比上月(%)" number default 0,
); "平均提前签单天数" integer default 0,
comment on table BI坐席续保率统计表 is '用于存放BI导出电销坐席全月续保率数据。'; "环比" number
)

View File

@ -0,0 +1,14 @@
--drop table BI坐席续保率统计表;
create table BI坐席续保率统计表
(
summary_date date default sysdate not null,
varchar2(20) not null,
NUMBER default 0 not null,
NUMBER default 0 not null,
NUMBER default 0 not null,
NUMBER default 0 not null,
NUMBER default 0 not null,
NUMBER default 0 not null,
NUMBER default 0 not null
);
comment on table BI坐席续保率统计表 is '用于存放BI导出电销坐席全月续保率数据。';

View File

@ -0,0 +1,14 @@
create table BI电销坐席车非渗透率跟踪表
(
"部门" varchar2(100),
"经办" varchar2(100) not null,
"车险保费(万)" number default 0,
"车险保费占比" number default 0,
"非车保费(万)" number default 0,
"当月保费渗透率" number default 0,
"保费渗透率环比上月" number default 0,
"当月客户渗透率" number default 0,
"客户渗透率环比上月" number default 0,
"当月车非客均保费" number default 0,
"客均保费环比上月" number default 0
);

View File

@ -1,23 +0,0 @@
-- Create table
create table BI电销坐席车非渗透统计表
(
summary_date DATE default sysdate not null,
varchar2(20) not null,
NUMBER default 0 not null,
NUMBER default 0 not null,
NUMBER default 0 not null,
NUMBER default 0 not null,
NUMBER default 0 not null,
NUMBER default 0 not null,
NUMBER default 0 not null,
NUMBER default 0 not null,
NUMBER default 0 not null
)
tablespace DESKTOP_ARCHIEVEMENT
pctfree 10
initrans 1
maxtrans 255;
-- Add comments to the table
comment on table BI电销坐席车非渗透统计表
is '用于存放BI导出每日电销坐席车险非车险保费和车非渗透率数据。';

View File

@ -31,6 +31,7 @@ interface CallerArchievement // 坐席业绩对象
success: boolean; success: boolean;
message: string; message: string;
total_archievement: number; total_archievement: number;
moto_premium_present_month: number;
mensual_archievement_list: number[]; mensual_archievement_list: number[];
insurance_renewal_rate: string; insurance_renewal_rate: string;
attaching_rate: string; attaching_rate: string;
@ -134,6 +135,7 @@ function queryCallerArchievement( callerInfo: TelSaler, render: any ): void
success: false, success: false,
message: "", message: "",
total_archievement: 0, total_archievement: 0,
moto_premium_present_month: 0,
mensual_archievement_list: [], mensual_archievement_list: [],
insurance_renewal_rate: "0.0", insurance_renewal_rate: "0.0",
attaching_rate: "0.0", attaching_rate: "0.0",
@ -150,9 +152,12 @@ function queryCallerArchievement( callerInfo: TelSaler, render: any ): void
{ {
const data = response.data ?? {}; const data = response.data ?? {};
console.log( "个人业绩数据", data );
callArchievement.success = data.success ?? false; callArchievement.success = data.success ?? false;
callArchievement.message = data.message ?? "服务器没有返回调用结果消息,请检查日志!"; callArchievement.message = data.message ?? "服务器没有返回调用结果消息,请检查日志!";
callArchievement.total_archievement = data.total_archievement ?? 0; callArchievement.total_archievement = data.total_archievement ?? 0;
callArchievement.moto_premium_present_month = data.motoPremiumPresentMonth ?? 0;
callArchievement.mensual_archievement_list = []; callArchievement.mensual_archievement_list = [];
callArchievement.insurance_renewal_rate = data.insurance_renewal_rate ?? "0.0"; callArchievement.insurance_renewal_rate = data.insurance_renewal_rate ?? "0.0";
callArchievement.attaching_rate = data.attaching_rate ?? "0.0"; callArchievement.attaching_rate = data.attaching_rate ?? "0.0";

View File

@ -238,10 +238,10 @@ export default {
ui.totalArchievement = data.total_archievement; ui.totalArchievement = data.total_archievement;
ui.callerAttachingRate = data.attaching_rate; ui.callerAttachingRate = data.attaching_rate;
ui.callerRenewalRate = data.insurance_renewal_rate; ui.callerRenewalRate = data.insurance_renewal_rate;
ui.callerPersentMonthPremium = data.mensual_archievement_list[thisMonth]; ui.callerPersentMonthPremium = data.moto_premium_present_month;
// ui.callerPersentMonthPremium = data.mensual_archievement_list[thisMonth];
// console.log( "", ui.chartData ); console.log( "业绩清单", data );
// console.log( "", data.mensual_archievement_list );
ui.showUI = false; ui.showUI = false;
setTimeout(() => setTimeout(() =>

View File

@ -2,7 +2,7 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-10-10 14:50:55 * @Date: 2023-10-10 14:50:55
* @LastEditors: Kane * @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/DepartmentArchievementRecord.java * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/BIDepartmentAttachingRateRecord.java
* @Description: * @Description:
* *
* Copyright (c) ${2023} by Kane, All Rights Reserved. * Copyright (c) ${2023} by Kane, All Rights Reserved.
@ -27,19 +27,25 @@ public class BIDepartmentAttachingRateRecord
private double attachingRate; private double attachingRate;
// 保费渗透率环比上月 // 保费渗透率环比上月
private double attachingRateChange; private double attachingRateChange;
// 车险客户数
private int motoInsuranceCustomerCount;
// 当月客户渗透率 // 当月客户渗透率
private double customerHandleRate; private double customerHandleRate;
// 客户渗透率环比上月 // 客户渗透率环比上月
private double customerHandleRateChange; private double customerHandleRateChange;
// 当月车非客均保费 // 当月车非客均保费
private double premiumPerCustomer; private double premiumPerCustomer;
// 客均保费环比上月 // 客均保费环比上月
private double premiumPerCustomerChange; private double premiumPerCustomerChange;
public BIDepartmentAttachingRateRecord( String departmentName, double departmentObject, public BIDepartmentAttachingRateRecord( String departmentName, double departmentObject,
double objectGap, double motoPremium, double motoPremiumProPortion, double objectGap, double motoPremium, double motoPremiumProPortion,
double nomotoPremium, double attachingRate, double attachingRateChange, double nomotoPremium, double attachingRate, double attachingRateChange,
double customerHandleRate, double customerHandleRateChange, double premiumPerCustomer, int motoInsuranceCustomerCount, double customerHandleRate,
double customerHandleRateChange, double premiumPerCustomer,
double premiumPerCustomerChange ) double premiumPerCustomerChange )
{ {
this.departmentName = departmentName; this.departmentName = departmentName;
@ -50,20 +56,32 @@ public class BIDepartmentAttachingRateRecord
this.nomotoPremium = nomotoPremium; this.nomotoPremium = nomotoPremium;
this.attachingRate = attachingRate; this.attachingRate = attachingRate;
this.attachingRateChange = attachingRateChange; this.attachingRateChange = attachingRateChange;
this.motoInsuranceCustomerCount = motoInsuranceCustomerCount;
this.customerHandleRate = customerHandleRate; this.customerHandleRate = customerHandleRate;
this.customerHandleRateChange = customerHandleRateChange; this.customerHandleRateChange = customerHandleRateChange;
this.premiumPerCustomer = premiumPerCustomer; this.premiumPerCustomer = premiumPerCustomer;
this.premiumPerCustomerChange = premiumPerCustomerChange; this.premiumPerCustomerChange = premiumPerCustomerChange;
} }
public int getMotoInsuranceCustomerCount()
{
return motoInsuranceCustomerCount;
}
public void setMotoInsuranceCustomerCount( int motoInsuranceCustomerCount )
{
this.motoInsuranceCustomerCount = motoInsuranceCustomerCount;
}
@Override @Override
public String toString() public String toString()
{ {
return "DepartmentArchievementRecord [departmentName=" + departmentName return "BIDepartmentAttachingRateRecord [departmentName=" + departmentName
+ ", departmentObject=" + departmentObject + ", objectGap=" + objectGap + ", departmentObject=" + departmentObject + ", objectGap=" + objectGap
+ ", motoPremium=" + motoPremium + ", motoPremiumProPortion=" + ", motoPremium=" + motoPremium + ", motoPremiumProPortion="
+ motoPremiumProPortion + ", nomotoPremium=" + nomotoPremium + ", attachingRate=" + motoPremiumProPortion + ", nomotoPremium=" + nomotoPremium + ", attachingRate="
+ attachingRate + ", attachingRateChange=" + attachingRateChange + attachingRate + ", attachingRateChange=" + attachingRateChange
+ ", motoInsuranceCustomerCount=" + motoInsuranceCustomerCount
+ ", customerHandleRate=" + customerHandleRate + ", customerHandleRateChange=" + ", customerHandleRate=" + customerHandleRate + ", customerHandleRateChange="
+ customerHandleRateChange + ", premiumPerCustomer=" + premiumPerCustomer + customerHandleRateChange + ", premiumPerCustomer=" + premiumPerCustomer
+ ", premiumPerCustomerChange=" + premiumPerCustomerChange + "]"; + ", premiumPerCustomerChange=" + premiumPerCustomerChange + "]";
@ -90,6 +108,7 @@ public class BIDepartmentAttachingRateRecord
result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( attachingRateChange ); temp = Double.doubleToLongBits( attachingRateChange );
result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result + motoInsuranceCustomerCount;
temp = Double.doubleToLongBits( customerHandleRate ); temp = Double.doubleToLongBits( customerHandleRate );
result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( customerHandleRateChange ); temp = Double.doubleToLongBits( customerHandleRateChange );
@ -138,6 +157,8 @@ public class BIDepartmentAttachingRateRecord
if ( Double.doubleToLongBits( attachingRateChange ) != Double if ( Double.doubleToLongBits( attachingRateChange ) != Double
.doubleToLongBits( other.attachingRateChange ) ) .doubleToLongBits( other.attachingRateChange ) )
return false; return false;
if ( motoInsuranceCustomerCount != other.motoInsuranceCustomerCount )
return false;
if ( Double.doubleToLongBits( customerHandleRate ) != Double if ( Double.doubleToLongBits( customerHandleRate ) != Double
.doubleToLongBits( other.customerHandleRate ) ) .doubleToLongBits( other.customerHandleRate ) )
return false; return false;

View File

@ -14,44 +14,61 @@ import com.fasterxml.jackson.annotation.JsonProperty;
public class BITelsalerAttachingRateRecord public class BITelsalerAttachingRateRecord
{ {
// 部门
@JsonProperty( "departmentName" )
private String departmentName;
// 统计日期 // 统计日期
@JsonProperty( "summaryDate" ) @JsonProperty( "summaryDate" )
private LocalDate summaryDate; private LocalDate summaryDate;
// 坐席名称 // 坐席名称
@JsonProperty( "telsalerName" ) @JsonProperty( "telsalerName" )
private String telsalerName; private String telsalerName;
// 车险保费 // 车险保费
@JsonProperty( "motoPremium" ) @JsonProperty( "motoPremium" )
private double motoPremium; private double motoPremium;
// 非车险保费 // 非车险保费
@JsonProperty( "nomotoPremium" ) @JsonProperty( "nomotoPremium" )
private double nomotoPremium; private double nomotoPremium;
// 车险保费占比 // 车险保费占比
@JsonProperty( "motoPremiumProportion" ) @JsonProperty( "motoPremiumProportion" )
private double motoPremiumProportion; private double motoPremiumProportion;
// 渗透率 // 渗透率
@JsonProperty( "attachingRate" ) @JsonProperty( "attachingRate" )
private double attachingRate; private double attachingRate;
// 渗透率环比上月 // 渗透率环比上月
@JsonProperty( "attachingRateChange" ) @JsonProperty( "attachingRateChange" )
private double attachingRateChange; private double attachingRateChange;
// 当月客户渗透率 // 当月客户渗透率
@JsonProperty( "customerHandleRateCell" ) @JsonProperty( "customerHandleRateCell" )
private double customerHandleRate; private double customerHandleRate;
// 客户渗透率环比上月 // 客户渗透率环比上月
@JsonProperty( "customerHandleRateChangeCell" ) @JsonProperty( "customerHandleRateChangeCell" )
private double customerHandleRateChange; private double customerHandleRateChange;
public BITelsalerAttachingRateRecord( LocalDate summaryDate, String telsalerName, double motoPremium, double nomotoPremium, double motoPremiumProportion, double attachingRate, double attachingRateChange, double customerHandleRate, double customerHandleRateChange, double noMotoPremiumPerCustomer, double noMotoPremiumPerCustomerChange ) // 当月车非客均保费
@JsonProperty( "noMotoPremiumPerCustomerCell" )
private double noMotoPremiumPerCustomer;
// 客均保费环比上月
@JsonProperty( "noMotoPremiumPerCustomerChangeCell" )
private double noMotoPremiumPerCustomerChange;
public BITelsalerAttachingRateRecord( String departmentName, LocalDate summaryDate,
String telsalerName, double motoPremium, double nomotoPremium,
double motoPremiumProportion, double attachingRate, double attachingRateChange,
double customerHandleRate, double customerHandleRateChange,
double noMotoPremiumPerCustomer, double noMotoPremiumPerCustomerChange )
{ {
this.departmentName = departmentName;
this.summaryDate = summaryDate; this.summaryDate = summaryDate;
this.telsalerName = telsalerName; this.telsalerName = telsalerName;
this.motoPremium = motoPremium; this.motoPremium = motoPremium;
@ -65,6 +82,9 @@ public class BITelsalerAttachingRateRecord
this.noMotoPremiumPerCustomerChange = noMotoPremiumPerCustomerChange; this.noMotoPremiumPerCustomerChange = noMotoPremiumPerCustomerChange;
} }
public BITelsalerAttachingRateRecord()
{}
public double getCustomerHandleRate() public double getCustomerHandleRate()
{ {
return customerHandleRate; return customerHandleRate;
@ -105,28 +125,17 @@ public class BITelsalerAttachingRateRecord
this.noMotoPremiumPerCustomerChange = noMotoPremiumPerCustomerChange; this.noMotoPremiumPerCustomerChange = noMotoPremiumPerCustomerChange;
} }
// 当月车非客均保费
@JsonProperty( "noMotoPremiumPerCustomerCell" )
private double noMotoPremiumPerCustomer;
// 客均保费环比上月
@JsonProperty( "noMotoPremiumPerCustomerChangeCell" )
private double noMotoPremiumPerCustomerChange;
public BITelsalerAttachingRateRecord()
{}
@Override @Override
public String toString() public String toString()
{ {
return "BITelsalerAttachingRateRecord [summaryDate=" + summaryDate + ", telsalerName=" return "BITelsalerAttachingRateRecord [departmentName=" + departmentName + ", summaryDate="
+ telsalerName + ", motoPremium=" + motoPremium + ", nomotoPremium=" + nomotoPremium + summaryDate + ", telsalerName=" + telsalerName + ", motoPremium=" + motoPremium
+ ", motoPremiumProportion=" + motoPremiumProportion + ", attachingRate=" + ", nomotoPremium=" + nomotoPremium + ", motoPremiumProportion="
+ attachingRate + ", attachingRateChange=" + attachingRateChange + motoPremiumProportion + ", attachingRate=" + attachingRate
+ ", customerHandleRate=" + customerHandleRate + ", customerHandleRateChange=" + ", attachingRateChange=" + attachingRateChange + ", customerHandleRate="
+ customerHandleRateChange + ", noMotoPremiumPerCustomer=" + customerHandleRate + ", customerHandleRateChange=" + customerHandleRateChange
+ noMotoPremiumPerCustomer + ", noMotoPremiumPerCustomerChange=" + ", noMotoPremiumPerCustomer=" + noMotoPremiumPerCustomer
+ noMotoPremiumPerCustomerChange + "]"; + ", noMotoPremiumPerCustomerChange=" + noMotoPremiumPerCustomerChange + "]";
} }
@Override @Override
@ -134,6 +143,7 @@ public class BITelsalerAttachingRateRecord
{ {
final int prime = 31; final int prime = 31;
int result = 1; int result = 1;
result = prime * result + ((departmentName == null) ? 0 : departmentName.hashCode());
result = prime * result + ((summaryDate == null) ? 0 : summaryDate.hashCode()); result = prime * result + ((summaryDate == null) ? 0 : summaryDate.hashCode());
result = prime * result + ((telsalerName == null) ? 0 : telsalerName.hashCode()); result = prime * result + ((telsalerName == null) ? 0 : telsalerName.hashCode());
long temp; long temp;
@ -168,6 +178,13 @@ public class BITelsalerAttachingRateRecord
if ( getClass() != obj.getClass() ) if ( getClass() != obj.getClass() )
return false; return false;
BITelsalerAttachingRateRecord other = (BITelsalerAttachingRateRecord) obj; BITelsalerAttachingRateRecord other = (BITelsalerAttachingRateRecord) obj;
if ( departmentName == null )
{
if ( other.departmentName != null )
return false;
}
else if ( !departmentName.equals( other.departmentName ) )
return false;
if ( summaryDate == null ) if ( summaryDate == null )
{ {
if ( other.summaryDate != null ) if ( other.summaryDate != null )
@ -281,4 +298,14 @@ public class BITelsalerAttachingRateRecord
{ {
this.attachingRateChange = attachingRateChange; this.attachingRateChange = attachingRateChange;
} }
public String getDepartmentName()
{
return departmentName;
}
public void setDepartmentName( String departmentName )
{
this.departmentName = departmentName;
}
} }

View File

@ -2,7 +2,7 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-10-09 21:45:39 * @Date: 2023-10-09 21:45:39
* @LastEditors: Kane * @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/TelsalerRenewalRateRecord.java * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/BITelsalerRenewalRateRecord.java
* @Description: BI导出的续保率Excel文件行记录 * @Description: BI导出的续保率Excel文件行记录
* *
* Copyright (c) ${2023} by Kane, All Rights Reserved. * Copyright (c) ${2023} by Kane, All Rights Reserved.
@ -11,6 +11,7 @@ package com.cpic.xim.mybatis.pojo;
public class BITelsalerRenewalRateRecord public class BITelsalerRenewalRateRecord
{ {
private String 责任部门;
private String 责任人; private String 责任人;
private double 机构目标值; private double 机构目标值;
private double 到期数全月; private double 到期数全月;
@ -19,9 +20,14 @@ public class BITelsalerRenewalRateRecord
private double 个车续保率全月; private double 个车续保率全月;
private double 环比昨日; private double 环比昨日;
private double 环比上月; private double 环比上月;
private double 平均提前签单天数;
public BITelsalerRenewalRateRecord( String 责任人, double 机构目标值, double 到期数全月, double 序时到期数占比, double 个车续保率序时, double 个车续保率全月, double 环比昨日, double 环比上月 ) private double 环比;
public BITelsalerRenewalRateRecord( String 责任部门, String 责任人, double 机构目标值, double 到期数全月,
double 序时到期数占比, double 个车续保率序时, double 个车续保率全月, double 环比昨日, double 环比上月,
double 平均提前签单天数, double 环比 )
{ {
this.责任部门 = 责任部门;
this.责任人 = 责任人; this.责任人 = 责任人;
this.机构目标值 = 机构目标值; this.机构目标值 = 机构目标值;
this.到期数全月 = 到期数全月; this.到期数全月 = 到期数全月;
@ -30,6 +36,40 @@ public class BITelsalerRenewalRateRecord
this.个车续保率全月 = 个车续保率全月; this.个车续保率全月 = 个车续保率全月;
this.环比昨日 = 环比昨日; this.环比昨日 = 环比昨日;
this.环比上月 = 环比上月; this.环比上月 = 环比上月;
this.平均提前签单天数 = 平均提前签单天数;
this.环比 = 环比;
}
public double get平均提前签单天数()
{
return 平均提前签单天数;
}
public void set平均提前签单天数( double 平均提前签单天数 )
{
this.平均提前签单天数 = 平均提前签单天数;
}
public double get环比()
{
return 环比;
}
public void set环比( double 环比 )
{
this.环比 = 环比;
}
public String get责任部门()
{
return 责任部门;
}
public void set责任部门( String 责任部门 )
{
this.责任部门 = 责任部门;
} }
@Override @Override
@ -37,6 +77,7 @@ public class BITelsalerRenewalRateRecord
{ {
final int prime = 31; final int prime = 31;
int result = 1; int result = 1;
result = prime * result + ((责任部门 == null) ? 0 : 责任部门.hashCode());
result = prime * result + ((责任人 == null) ? 0 : 责任人.hashCode()); result = prime * result + ((责任人 == null) ? 0 : 责任人.hashCode());
long temp; long temp;
temp = Double.doubleToLongBits( 机构目标值 ); temp = Double.doubleToLongBits( 机构目标值 );
@ -53,6 +94,10 @@ public class BITelsalerRenewalRateRecord
result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 环比上月 ); temp = Double.doubleToLongBits( 环比上月 );
result = prime * result + (int) (temp ^ (temp >>> 32)); result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 平均提前签单天数 );
result = prime * result + (int) (temp ^ (temp >>> 32));
temp = Double.doubleToLongBits( 环比 );
result = prime * result + (int) (temp ^ (temp >>> 32));
return result; return result;
} }
@ -66,6 +111,13 @@ public class BITelsalerRenewalRateRecord
if ( getClass() != obj.getClass() ) if ( getClass() != obj.getClass() )
return false; return false;
BITelsalerRenewalRateRecord other = (BITelsalerRenewalRateRecord) obj; BITelsalerRenewalRateRecord other = (BITelsalerRenewalRateRecord) obj;
if ( 责任部门 == null )
{
if ( other.责任部门 != null )
return false;
}
else if ( !责任部门.equals( other.责任部门 ) )
return false;
if ( 责任人 == null ) if ( 责任人 == null )
{ {
if ( other.责任人 != null ) if ( other.责任人 != null )
@ -87,15 +139,20 @@ public class BITelsalerRenewalRateRecord
return false; return false;
if ( Double.doubleToLongBits( 环比上月 ) != Double.doubleToLongBits( other.环比上月 ) ) if ( Double.doubleToLongBits( 环比上月 ) != Double.doubleToLongBits( other.环比上月 ) )
return false; return false;
if ( Double.doubleToLongBits( 平均提前签单天数 ) != Double.doubleToLongBits( other.平均提前签单天数 ) )
return false;
if ( Double.doubleToLongBits( 环比 ) != Double.doubleToLongBits( other.环比 ) )
return false;
return true; return true;
} }
@Override @Override
public String toString() public String toString()
{ {
return "TelsalerRenewalRateRecord [责任人=" + 责任人 + ", 机构目标值=" + 机构目标值 + ", 到期数全月=" + 到期数全月 return "BITelsalerRenewalRateRecord [责任部门=" + 责任部门 + ", 责任人=" + 责任人 + ", 机构目标值=" + 机构目标值
+ ", 序时到期数占比=" + 序时到期数占比 + ", 个车续保率序时=" + 个车续保率序时 + ", 个车续保率全月=" + 个车续保率全月 + ", 到期数全月=" + 到期数全月 + ", 序时到期数占比=" + 序时到期数占比 + ", 个车续保率序时=" + 个车续保率序时
+ ", 环比昨日=" + 环比昨日 + ", 环比上月=" + 环比上月 + "]"; + ", 个车续保率全月=" + 个车续保率全月 + ", 环比昨日=" + 环比昨日 + ", 环比上月=" + 环比上月 + ", 平均提前签单天数="
+ 平均提前签单天数 + ", 环比=" + 环比 + "]";
} }
public String get责任人() public String get责任人()

View File

@ -26,25 +26,6 @@ public class CallerArchievement
private static Logger logger = LoggerFactory.getLogger( CallerArchievement.class ); private static Logger logger = LoggerFactory.getLogger( CallerArchievement.class );
private static ArrayList<MensualArchievementItem> monthArray = null; private static ArrayList<MensualArchievementItem> monthArray = null;
/**
* 构造函数
* @param callerCode
* @param totalArchievement
* @param mensualArchievementList
* @param insuranceRenewalRate
* @param attachingRate
*/
public CallerArchievement( String callerCode, long totalArchievement,
ArrayList<MensualArchievementItem> mensualArchievementList, String insuranceRenewalRate,
String attachingRate )
{
this.callerCode = callerCode;
this.totalArchievement = totalArchievement;
this.mensualArchievementList = mensualArchievementList;
this.insuranceRenewalRate = insuranceRenewalRate;
this.attachingRate = attachingRate;
}
// 静态代码块 // 静态代码块
static static
{ {
@ -65,15 +46,6 @@ public class CallerArchievement
monthArray.add( new MensualArchievementItem( 12, "0" ) ); monthArray.add( new MensualArchievementItem( 12, "0" ) );
} }
public CallerArchievement()
{
this.totalArchievement = 0;
this.mensualArchievementList = null;
this.insuranceRenewalRate = "";
this.attachingRate = "";
this.callerCode = "";
}
public static CallerArchievement getCallerArchievement( String callerCode ) throws IOException public static CallerArchievement getCallerArchievement( String callerCode ) throws IOException
{ {
CallerArchievement archievement = null; CallerArchievement archievement = null;
@ -82,6 +54,7 @@ public class CallerArchievement
ArchievementMapper mapper = session.getMapper( ArchievementMapper.class ); ArchievementMapper mapper = session.getMapper( ArchievementMapper.class );
HashMap<String, Object> params = new HashMap<String, Object>(); HashMap<String, Object> params = new HashMap<String, Object>();
Integer totalArchievement = null; Integer totalArchievement = null;
double motoPremiumPresentMonth = 0;
String attachingRate = null; String attachingRate = null;
String renewalRate = null; String renewalRate = null;
ArrayList<MensualArchievementItem> mensual = null; ArrayList<MensualArchievementItem> mensual = null;
@ -100,6 +73,10 @@ public class CallerArchievement
totalArchievement = Integer.valueOf( 0 ); totalArchievement = Integer.valueOf( 0 );
} }
// 当月车险保费
motoPremiumPresentMonth = ((Double) params.get( "a_present_month" )).doubleValue();
// 车非融合 // 车非融合
if ( params.get( "a_attaching_rate" ) instanceof String ) if ( params.get( "a_attaching_rate" ) instanceof String )
{ {
@ -129,8 +106,8 @@ public class CallerArchievement
mensual = (ArrayList<MensualArchievementItem>) params.get( "a_mensual_cur" ); mensual = (ArrayList<MensualArchievementItem>) params.get( "a_mensual_cur" );
} }
archievement = new CallerArchievement( callerCode, totalArchievement, mensual, renewalRate, archievement = new CallerArchievement( callerCode, totalArchievement,
attachingRate ); motoPremiumPresentMonth, mensual, renewalRate, attachingRate );
return archievement; return archievement;
} }
@ -145,6 +122,150 @@ public class CallerArchievement
CallerArchievement.logger = logger; CallerArchievement.logger = logger;
} }
public static ArrayList<MensualArchievementItem> getMonthArray()
{
return monthArray;
}
public static void setMonthArray( ArrayList<MensualArchievementItem> monthArray )
{
CallerArchievement.monthArray = monthArray;
}
@JsonProperty( "caller_code" )
private String callerCode;
@JsonProperty( "total_archievement" )
private long totalArchievement; // 总业绩
@JsonProperty( "motoPremiumPresentMonth" )
private double motoPremiumPresentMonth; // 当月车险保费
// 每月业绩列表
// 要保证数据是按照月份排序
@JsonProperty( "mensual_archievement_list" )
private ArrayList<MensualArchievementItem> mensualArchievementList;
@JsonProperty( "insurance_renewal_rate" )
private String insuranceRenewalRate; // 续保率
@JsonProperty( "attaching_rate" )
private String attachingRate; // 车非渗透率
/**
* 构造函数
* @param callerCode
* @param totalArchievement
* @param mensualArchievementList
* @param insuranceRenewalRate
* @param attachingRate
*/
public CallerArchievement( String callerCode, long totalArchievement,
double motoPremiumPresentMonth,
ArrayList<MensualArchievementItem> mensualArchievementList, String insuranceRenewalRate,
String attachingRate )
{
this.callerCode = callerCode;
this.totalArchievement = totalArchievement;
this.motoPremiumPresentMonth = motoPremiumPresentMonth;
this.mensualArchievementList = mensualArchievementList;
this.insuranceRenewalRate = insuranceRenewalRate;
this.attachingRate = attachingRate;
}
public CallerArchievement()
{
this.totalArchievement = 0;
this.motoPremiumPresentMonth = 0;
this.mensualArchievementList = null;
this.insuranceRenewalRate = "";
this.attachingRate = "";
this.callerCode = "";
}
@Override
public String toString()
{
return "CallerArchievement [callerCode=" + callerCode + ", totalArchievement="
+ totalArchievement + ", motoPremiumPresentMonth=" + motoPremiumPresentMonth
+ ", mensualArchievementList=" + mensualArchievementList + ", insuranceRenewalRate="
+ insuranceRenewalRate + ", attachingRate=" + attachingRate + "]";
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((callerCode == null) ? 0 : callerCode.hashCode());
result = prime * result + (int) (totalArchievement ^ (totalArchievement >>> 32));
long temp;
temp = Double.doubleToLongBits( motoPremiumPresentMonth );
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result
+ ((mensualArchievementList == null) ? 0 : mensualArchievementList.hashCode());
result = prime * result
+ ((insuranceRenewalRate == null) ? 0 : insuranceRenewalRate.hashCode());
result = prime * result + ((attachingRate == null) ? 0 : attachingRate.hashCode());
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
CallerArchievement other = (CallerArchievement) obj;
if ( callerCode == null )
{
if ( other.callerCode != null )
return false;
}
else if ( !callerCode.equals( other.callerCode ) )
return false;
if ( totalArchievement != other.totalArchievement )
return false;
if ( Double.doubleToLongBits( motoPremiumPresentMonth ) != Double
.doubleToLongBits( other.motoPremiumPresentMonth ) )
return false;
if ( mensualArchievementList == null )
{
if ( other.mensualArchievementList != null )
return false;
}
else if ( !mensualArchievementList.equals( other.mensualArchievementList ) )
return false;
if ( insuranceRenewalRate == null )
{
if ( other.insuranceRenewalRate != null )
return false;
}
else if ( !insuranceRenewalRate.equals( other.insuranceRenewalRate ) )
return false;
if ( attachingRate == null )
{
if ( other.attachingRate != null )
return false;
}
else if ( !attachingRate.equals( other.attachingRate ) )
return false;
return true;
}
public double getMotoPremiumPresentMonth()
{
return motoPremiumPresentMonth;
}
public void setMotoPremiumPresentMonth( double motoPremiumPresentMonth )
{
this.motoPremiumPresentMonth = motoPremiumPresentMonth;
}
public String getCallerCode() public String getCallerCode()
{ {
return callerCode; return callerCode;
@ -195,21 +316,4 @@ public class CallerArchievement
{ {
this.attachingRate = attachingRate; this.attachingRate = attachingRate;
} }
@JsonProperty( "caller_code" )
private String callerCode;
@JsonProperty( "total_archievement" )
private long totalArchievement; // 总业绩
// 每月业绩列表
// 要保证数据是按照月份排序
@JsonProperty( "mensual_archievement_list" )
private ArrayList<MensualArchievementItem> mensualArchievementList;
@JsonProperty( "insurance_renewal_rate" )
private String insuranceRenewalRate; // 续保率
@JsonProperty( "attaching_rate" )
private String attachingRate; // 车非渗透率
} }

View File

@ -39,11 +39,11 @@ public final class ImportBIExcelData
"当月车非客均保费", "客均保费环比上月"}; "当月车非客均保费", "客均保费环比上月"};
private static String[] TelSalerRenewalRateExcelTitle = new String[] private static String[] TelSalerRenewalRateExcelTitle = new String[]
{ "责任", "机构目标值1(%)", "到期数-全月", "序时到期数占比(%)", "个车续保率(序时)(%)", "个车续保率(全月)(%)", "环比昨日(%)", { "责任部门", "责任", "机构目标值1(%)", "到期数-全月", "序时到期数占比(%)", "个车续保率(序时)(%)", "个车续保率(全月)(%)", "环比昨日(%)",
"环比上月(%)"}; "环比上月(%)", "平均提前签单天数", "环比"};
private static String[] DepartmentAttachingRateExcelTitle = new String[] private static String[] DepartmentAttachingRateExcelTitle = new String[]
{ "部门", "目标值-机构", "目标差距", "车险保费(万)", "车险保费占比", "非车保费(万)", "当月保费渗透率", "保费渗透率环比上月", "当月客户渗透率", { "部门", "目标值-机构", "目标差距", "车险保费(万)", "车险保费占比", "非车保费(万)", "当月保费渗透率", "保费渗透率环比上月", "车险客户数", "当月客户渗透率",
"客户渗透率环比上月", "当月车非客均保费", "客均保费环比上月"}; "客户渗透率环比上月", "当月车非客均保费", "客均保费环比上月"};
private static String[] DepartmentRenewalRateExcelTitle = new String[] private static String[] DepartmentRenewalRateExcelTitle = new String[]
@ -130,6 +130,9 @@ public final class ImportBIExcelData
Workbook wb = null; Workbook wb = null;
Sheet sheet = null; Sheet sheet = null;
String name = null;
String departmentName = null;
String departmentCurrentRow = null;
try try
{ {
@ -144,7 +147,7 @@ public final class ImportBIExcelData
for ( Row row : sheet ) for ( Row row : sheet )
{ {
String name = "";
int rowIndex = row.getRowNum(); int rowIndex = row.getRowNum();
// 从数据行开始 // 从数据行开始
@ -155,6 +158,24 @@ public final class ImportBIExcelData
try try
{ {
// 部门
try
{
departmentCurrentRow = MyPOIUtils.getStringCellValue( row, 0 );
// 因为是合并列所以要判断一下是不是空的
if ( !departmentCurrentRow.equals( "" )
&& !departmentCurrentRow.equals( "合计" ) )
{
// 不是空的也不是合计说明是新部门的数据更新部门名称
departmentName = departmentCurrentRow;
}
}
catch ( NullPointerException error )
{
// cell是空的说明还是上一行的部门
}
// 坐席名称 // 坐席名称
name = MyPOIUtils.getStringCellValue( row, 1 ); name = MyPOIUtils.getStringCellValue( row, 1 );
@ -165,9 +186,9 @@ public final class ImportBIExcelData
} }
// 车险保费 // 车险保费
double motoPremium = MyPOIUtils.getNumbericCellValue( row, 2 ) * 10000; double motoPremium = MyPOIUtils.getNumbericCellValue( row, 2 );
// 非车险保费 // 非车险保费
double nomotoPremium = MyPOIUtils.getNumbericCellValue( row, 4 ) * 10000; double nomotoPremium = MyPOIUtils.getNumbericCellValue( row, 4 );
// 车险保费占比 // 车险保费占比
double motoPremiumProPortion = MyPOIUtils.getNumbericCellValue( row, 3 ) * 100; double motoPremiumProPortion = MyPOIUtils.getNumbericCellValue( row, 3 ) * 100;
// 当月保费渗透率 // 当月保费渗透率
@ -187,7 +208,7 @@ public final class ImportBIExcelData
MyPOIUtils.getNumbericCellValue( row, 10 ) * 100; MyPOIUtils.getNumbericCellValue( row, 10 ) * 100;
BITelsalerAttachingRateRecord record = new BITelsalerAttachingRateRecord( BITelsalerAttachingRateRecord record = new BITelsalerAttachingRateRecord(
LocalDate.now(), name, motoPremium, nomotoPremium, departmentName, LocalDate.now(), name, motoPremium, nomotoPremium,
motoPremiumProPortion, attachingRate, attachingRateChange, motoPremiumProPortion, attachingRate, attachingRateChange,
customerHandleRateCell, customerHandleRateChangeCell, customerHandleRateCell, customerHandleRateChangeCell,
noMotoPremiumPerCustomerCell, noMotoPremiumPerCustomerChangeCell ); noMotoPremiumPerCustomerCell, noMotoPremiumPerCustomerChangeCell );
@ -235,7 +256,7 @@ public final class ImportBIExcelData
* @return * @return
*/ */
public static ArrayList<BITelsalerRenewalRateRecord> importBITelsalerRenewalRateFromXlsx( public static ArrayList<BITelsalerRenewalRateRecord> importBITelsalerRenewalRateFromXlsx(
String filePath, int sheetIndex, int firstRow, LocalDate summaryDate ) String filePath, int sheetIndex, int firstRow )
throws IOException, InvalidFormatException throws IOException, InvalidFormatException
{ {
ArrayList<BITelsalerRenewalRateRecord> records = new ArrayList<>( 200 ); ArrayList<BITelsalerRenewalRateRecord> records = new ArrayList<>( 200 );
@ -248,6 +269,9 @@ public final class ImportBIExcelData
wb = WorkbookFactory.create( new File( filePath ) ); wb = WorkbookFactory.create( new File( filePath ) );
sheet = wb.getSheetAt( sheetIndex ); sheet = wb.getSheetAt( sheetIndex );
int rowIndex = 0; int rowIndex = 0;
String 责任部门 = null;
String 当前行责任部门 = null;
String 责任人 = null;
if ( !checkExcelFormat( sheet, null, 0, TelSalerRenewalRateExcelTitle, 0 ) ) if ( !checkExcelFormat( sheet, null, 0, TelSalerRenewalRateExcelTitle, 0 ) )
{ {
@ -266,23 +290,41 @@ public final class ImportBIExcelData
try try
{ {
String 责任人 = MyPOIUtils.getStringCellValue( row, 0 ); // 处理责任部门列
// 如果读取到的当前行责任部门不为空且与前一行责任部门不同说明是另一个部门的数据
try
{
当前行责任部门 = MyPOIUtils.getStringCellValue( row, 0 );
if ( !当前行责任部门.isEmpty() && !当前行责任部门.equals( 责任部门 ) )
{
责任部门 = 当前行责任部门;
}
}
catch ( NullPointerException error )
{
}
// 判断责任人如果是空值就跳过此行
责任人 = MyPOIUtils.getStringCellValue( row, 1 );
if ( 责任人.isEmpty() == true ) if ( 责任人.isEmpty() == true )
{ {
continue; continue;
} }
double 机构目标值 = MyPOIUtils.getNumbericCellValue( row, 1 ) * 100; double 机构目标值 = MyPOIUtils.getNumbericCellValue( row, 2 ) * 100;
double 到期数全月 = MyPOIUtils.getNumbericCellValue( row, 2 ) * 100; double 到期数全月 = MyPOIUtils.getNumbericCellValue( row, 3 );
double 序时到期数占比 = MyPOIUtils.getNumbericCellValue( row, 3 ) * 100; double 序时到期数占比 = MyPOIUtils.getNumbericCellValue( row, 4 ) * 100;
double 个车续保率序时 = MyPOIUtils.getNumbericCellValue( row, 4 ) * 100; double 个车续保率序时 = MyPOIUtils.getNumbericCellValue( row, 5 ) * 100;
double 个车续保率全月 = MyPOIUtils.getNumbericCellValue( row, 5 ) * 100; double 个车续保率全月 = MyPOIUtils.getNumbericCellValue( row, 6 ) * 100;
double 环比昨日 = MyPOIUtils.getNumbericCellValue( row, 6 ) * 100; double 环比昨日 = MyPOIUtils.getNumbericCellValue( row, 7 ) * 100;
double 环比上月 = MyPOIUtils.getNumbericCellValue( row, 7 ) * 100; double 环比上月 = MyPOIUtils.getNumbericCellValue( row, 8 ) * 100;
double 平均提前签单天数 = MyPOIUtils.getNumbericCellValue( row, 9 );
double 环比 = MyPOIUtils.getNumbericCellValue( row, 10 );
BITelsalerRenewalRateRecord record = new BITelsalerRenewalRateRecord( 责任人, BITelsalerRenewalRateRecord record = new BITelsalerRenewalRateRecord( 责任部门, 责任,
机构目标值, 到期数全月, 序时到期数占比, 个车续保率序时, 个车续保率全月, 环比昨日, 环比上月 ); 机构目标值, 到期数全月, 序时到期数占比, 个车续保率序时, 个车续保率全月, 环比昨日, 环比上月, 平均提前签单天数, 环比 );
records.add( record ); records.add( record );
} }
@ -362,22 +404,23 @@ public final class ImportBIExcelData
double departmentObject = MyPOIUtils.getNumbericCellValue( row, 1 ) * 100; double departmentObject = MyPOIUtils.getNumbericCellValue( row, 1 ) * 100;
double objectGap = MyPOIUtils.getNumbericCellValue( row, 2 ) * 100; double objectGap = MyPOIUtils.getNumbericCellValue( row, 2 ) * 100;
double motoPremium = MyPOIUtils.getNumbericCellValue( row, 3 ) * 10000; double motoPremium = MyPOIUtils.getNumbericCellValue( row, 3 );
double motoPremiumProPortion = MyPOIUtils.getNumbericCellValue( row, 4 ) * 100; double motoPremiumProPortion = MyPOIUtils.getNumbericCellValue( row, 4 ) * 100;
double nomotoPremium = MyPOIUtils.getNumbericCellValue( row, 5 ) * 10000; double nomotoPremium = MyPOIUtils.getNumbericCellValue( row, 5 );
double attachingRate = MyPOIUtils.getNumbericCellValue( row, 6 ) * 100; double attachingRate = MyPOIUtils.getNumbericCellValue( row, 6 ) * 100;
double attachingRateChange = MyPOIUtils.getNumbericCellValue( row, 7 ) * 100; double attachingRateChange = MyPOIUtils.getNumbericCellValue( row, 7 ) * 100;
double customerHandleRate = MyPOIUtils.getNumbericCellValue( row, 8 ) * 100; int motoInsuranceCustomerCount = (int)MyPOIUtils.getNumbericCellValue( row, 8 );
double customerHandleRate = MyPOIUtils.getNumbericCellValue( row, 9 ) * 100;
double customerHandleRateChange = double customerHandleRateChange =
MyPOIUtils.getNumbericCellValue( row, 9 ) * 100; MyPOIUtils.getNumbericCellValue( row, 10 ) * 100;
double premiumPerCustomer = MyPOIUtils.getNumbericCellValue( row, 10 ) * 100; double premiumPerCustomer = MyPOIUtils.getNumbericCellValue( row, 11 ) * 100;
double premiumPerCustomerChange = double premiumPerCustomerChange =
MyPOIUtils.getNumbericCellValue( row, 11 ) * 100; MyPOIUtils.getNumbericCellValue( row, 12 ) * 100;
BIDepartmentAttachingRateRecord record = new BIDepartmentAttachingRateRecord( BIDepartmentAttachingRateRecord record = new BIDepartmentAttachingRateRecord(
departmentName, departmentObject, objectGap, motoPremium, departmentName, departmentObject, objectGap, motoPremium,
motoPremiumProPortion, nomotoPremium, attachingRate, motoPremiumProPortion, nomotoPremium, attachingRate,
attachingRateChange, customerHandleRate, customerHandleRateChange, attachingRateChange, motoInsuranceCustomerCount, customerHandleRate, customerHandleRateChange,
premiumPerCustomer, premiumPerCustomerChange ); premiumPerCustomer, premiumPerCustomerChange );
records.add( record ); records.add( record );

View File

@ -29,7 +29,7 @@ import com.cpic.xim.utils.ranking.CallerRankingList;
import com.cpic.xim.web.controllers.archievement.RankingList.RankingListRequest; import com.cpic.xim.web.controllers.archievement.RankingList.RankingListRequest;
import com.cpic.xim.web.controllers.archievement.RankingList.RankingListResponse; import com.cpic.xim.web.controllers.archievement.RankingList.RankingListResponse;
import com.cpic.xim.web.controllers.archievement.caller.CallerArchievementQueryRequest; import com.cpic.xim.web.controllers.archievement.caller.CallerArchievementQueryRequest;
import com.cpic.xim.web.controllers.archievement.caller.CallerArchievementQueryResult; import com.cpic.xim.web.controllers.archievement.caller.CallerArchievementQueryResponse;
import com.cpic.xim.web.controllers.archievement.department.DepartmentArchievementQueryRequest; import com.cpic.xim.web.controllers.archievement.department.DepartmentArchievementQueryRequest;
import com.cpic.xim.web.controllers.archievement.department.DepartmentArchievementQueryResult; import com.cpic.xim.web.controllers.archievement.department.DepartmentArchievementQueryResult;
@ -90,24 +90,24 @@ public class ArchievementQueryController
@ResponseBody @ResponseBody
@PostMapping( "/query_caller_archievement.do" ) @PostMapping( "/query_caller_archievement.do" )
public CallerArchievementQueryResult queryCallerArchievement( public CallerArchievementQueryResponse queryCallerArchievement(
@RequestBody CallerArchievementQueryRequest request ) @RequestBody CallerArchievementQueryRequest request )
{ {
CallerArchievementQueryResult result = null; CallerArchievementQueryResponse result = null;
try try
{ {
CallerArchievement archievement = CallerArchievement archievement =
CallerArchievement.getCallerArchievement( request.getCallerCode() ); CallerArchievement.getCallerArchievement( request.getCallerCode() );
result = new CallerArchievementQueryResult( true, "查询成功", archievement.getCallerCode(), result = new CallerArchievementQueryResponse( true, "查询成功", archievement.getCallerCode(),
request.getCallName(), archievement.getTotalArchievement(), request.getCallName(), archievement.getTotalArchievement(), archievement.getMotoPremiumPresentMonth(),
archievement.getMensualArchievementList(), archievement.getMensualArchievementList(),
archievement.getInsuranceRenewalRate(), archievement.getAttachingRate() ); archievement.getInsuranceRenewalRate(), archievement.getAttachingRate() );
} }
catch ( IOException error ) catch ( IOException error )
{ {
result = new CallerArchievementQueryResult(false, error.getMessage(), null, null, 0, null, null, null); result = new CallerArchievementQueryResponse(false, error.getMessage(), null, null, 0, 0, null, null, null);
} }
return result; return result;

View File

@ -0,0 +1,222 @@
/*
* @Author: Kane
* @Date: 2023-06-06 17:35:54
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/caller/CallerArchievementQueryResponse.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers.archievement.caller;
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
import com.cpic.xim.web.controllers.QueryResponse;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
public class CallerArchievementQueryResponse extends QueryResponse
{
@JsonProperty("callerCode")
String callerCode;
@JsonProperty("callerName")
String callerName;
@JsonProperty( "total_archievement" )
private long totalArchievement; // 总业绩
@JsonProperty( "motoPremiumPresentMonth" )
private double motoPremiumPresentMonth; // 当月车险保费
// 每月业绩列表
// 要保证数据是按照月份排序
@JsonProperty( "mensual_archievement_list" )
private ArrayList<MensualArchievementItem> mensualArchievementList;
@JsonProperty( "insurance_renewal_rate" )
private String insuranceRenewalRate; // 续保率
@JsonProperty( "attaching_rate" )
private String attachingRate; // 车非渗透率
public CallerArchievementQueryResponse( boolean success, String message, String callerCode,
String callerName, long totalArchievement, double motoPremiumPresentMonth,
ArrayList<MensualArchievementItem> mensualArchievementList, String insuranceRenewalRate,
String attachingRate )
{
super( success, message );
this.callerCode = callerCode;
this.callerName = callerName;
this.totalArchievement = totalArchievement;
this.motoPremiumPresentMonth = motoPremiumPresentMonth;
this.mensualArchievementList = mensualArchievementList;
this.insuranceRenewalRate = insuranceRenewalRate;
this.attachingRate = attachingRate;
}
public CallerArchievementQueryResponse( String callerCode, String callerName,
long totalArchievement, double motoPremiumPresentMonth,
ArrayList<MensualArchievementItem> mensualArchievementList, String insuranceRenewalRate,
String attachingRate )
{
this.callerCode = callerCode;
this.callerName = callerName;
this.totalArchievement = totalArchievement;
this.motoPremiumPresentMonth = motoPremiumPresentMonth;
this.mensualArchievementList = mensualArchievementList;
this.insuranceRenewalRate = insuranceRenewalRate;
this.attachingRate = attachingRate;
}
@Override
public String toString()
{
return "CallerArchievementQueryResponse [callerCode=" + callerCode + ", callerName="
+ callerName + ", totalArchievement=" + totalArchievement
+ ", motoPremiumPresentMonth=" + motoPremiumPresentMonth
+ ", mensualArchievementList=" + mensualArchievementList + ", insuranceRenewalRate="
+ insuranceRenewalRate + ", attachingRate=" + attachingRate + "]";
}
@Override
public int hashCode()
{
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((callerCode == null) ? 0 : callerCode.hashCode());
result = prime * result + ((callerName == null) ? 0 : callerName.hashCode());
result = prime * result + (int) (totalArchievement ^ (totalArchievement >>> 32));
long temp;
temp = Double.doubleToLongBits( motoPremiumPresentMonth );
result = prime * result + (int) (temp ^ (temp >>> 32));
result = prime * result
+ ((mensualArchievementList == null) ? 0 : mensualArchievementList.hashCode());
result = prime * result
+ ((insuranceRenewalRate == null) ? 0 : insuranceRenewalRate.hashCode());
result = prime * result + ((attachingRate == null) ? 0 : attachingRate.hashCode());
return result;
}
public void setMotoPremiumPresentMonth( double motoPremiumPresentMonth )
{
this.motoPremiumPresentMonth = motoPremiumPresentMonth;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( !super.equals( obj ) )
return false;
if ( getClass() != obj.getClass() )
return false;
CallerArchievementQueryResponse other = (CallerArchievementQueryResponse) obj;
if ( callerCode == null )
{
if ( other.callerCode != null )
return false;
}
else if ( !callerCode.equals( other.callerCode ) )
return false;
if ( callerName == null )
{
if ( other.callerName != null )
return false;
}
else if ( !callerName.equals( other.callerName ) )
return false;
if ( totalArchievement != other.totalArchievement )
return false;
if ( Double.doubleToLongBits( motoPremiumPresentMonth ) != Double
.doubleToLongBits( other.motoPremiumPresentMonth ) )
return false;
if ( mensualArchievementList == null )
{
if ( other.mensualArchievementList != null )
return false;
}
else if ( !mensualArchievementList.equals( other.mensualArchievementList ) )
return false;
if ( insuranceRenewalRate == null )
{
if ( other.insuranceRenewalRate != null )
return false;
}
else if ( !insuranceRenewalRate.equals( other.insuranceRenewalRate ) )
return false;
if ( attachingRate == null )
{
if ( other.attachingRate != null )
return false;
}
else if ( !attachingRate.equals( other.attachingRate ) )
return false;
return true;
}
public String getCallerCode()
{
return callerCode;
}
public void setCallerCode( String callerCode )
{
this.callerCode = callerCode;
}
public String getCallerName()
{
return callerName;
}
public void setCallerName( String callerName )
{
this.callerName = callerName;
}
public long getTotalArchievement()
{
return totalArchievement;
}
public void setTotalArchievement( long totalArchievement )
{
this.totalArchievement = totalArchievement;
}
public ArrayList<MensualArchievementItem> getMensualArchievementList()
{
return mensualArchievementList;
}
public void setMensualArchievementList( ArrayList<MensualArchievementItem> mensualArchievementList )
{
this.mensualArchievementList = mensualArchievementList;
}
public String getInsuranceRenewalRate()
{
return insuranceRenewalRate;
}
public void setInsuranceRenewalRate( String insuranceRenewalRate )
{
this.insuranceRenewalRate = insuranceRenewalRate;
}
public String getAttachingRate()
{
return attachingRate;
}
public void setAttachingRate( String attachingRate )
{
this.attachingRate = attachingRate;
}
public double getMotoPremiumPresentMonth()
{
return motoPremiumPresentMonth;
}
}

View File

@ -1,123 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-06-06 17:35:54
* @LastEditors: Kane
* @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/web/controllers/archievement/caller/CallerArchievementQueryResult.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers.archievement.caller;
import com.cpic.xim.mybatis.pojo.MensualArchievementItem;
import com.cpic.xim.web.controllers.QueryResponse;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
public class CallerArchievementQueryResult extends QueryResponse
{
/**
*
* @param success
* @param message
* @param callerCode
* @param callerName
* @param totalArchievement
* @param mensualArchievementList
* @param insuranceRenewalRate
* @param attachingRate
*/
public CallerArchievementQueryResult( boolean success, String message, String callerCode,
String callerName, long totalArchievement,
ArrayList<MensualArchievementItem> mensualArchievementList, String insuranceRenewalRate,
String attachingRate)
{
super( success, message );
this.callerCode = callerCode;
this.callerName = callerName;
this.totalArchievement = totalArchievement;
this.mensualArchievementList = mensualArchievementList;
this.insuranceRenewalRate = insuranceRenewalRate;
this.attachingRate = attachingRate;
}
@JsonProperty("callerCode")
String callerCode;
public String getCallerCode()
{
return callerCode;
}
public void setCallerCode( String callerCode )
{
this.callerCode = callerCode;
}
public String getCallerName()
{
return callerName;
}
public void setCallerName( String callerName )
{
this.callerName = callerName;
}
public long getTotalArchievement()
{
return totalArchievement;
}
public void setTotalArchievement( long totalArchievement )
{
this.totalArchievement = totalArchievement;
}
public ArrayList<MensualArchievementItem> getMensualArchievementList()
{
return mensualArchievementList;
}
public void setMensualArchievementList( ArrayList<MensualArchievementItem> mensualArchievementList )
{
this.mensualArchievementList = mensualArchievementList;
}
public String getInsuranceRenewalRate()
{
return insuranceRenewalRate;
}
public void setInsuranceRenewalRate( String insuranceRenewalRate )
{
this.insuranceRenewalRate = insuranceRenewalRate;
}
public String getAttachingRate()
{
return attachingRate;
}
public void setAttachingRate( String attachingRate )
{
this.attachingRate = attachingRate;
}
@JsonProperty("callerName")
String callerName;
@JsonProperty( "total_archievement" )
private long totalArchievement; // 总业绩
// 每月业绩列表
// 要保证数据是按照月份排序
@JsonProperty( "mensual_archievement_list" )
private ArrayList<MensualArchievementItem> mensualArchievementList;
@JsonProperty( "insurance_renewal_rate" )
private String insuranceRenewalRate; // 续保率
@JsonProperty( "attaching_rate" )
private String attachingRate; // 车非渗透率
}

View File

@ -149,7 +149,7 @@ public class ImportBIDataController
try try
{ {
records = ImportBIExcelData.importBITelsalerRenewalRateFromXlsx( filePath, sheetIndex, records = ImportBIExcelData.importBITelsalerRenewalRateFromXlsx( filePath, sheetIndex,
firstRow, LocalDate.now() ); firstRow );
session = MybatisUtils.getSqlSessionBatch(); session = MybatisUtils.getSqlSessionBatch();
mapper = session.getMapper( ImportBIArchievementDataMapper.class ); mapper = session.getMapper( ImportBIArchievementDataMapper.class );

View File

@ -15,6 +15,7 @@
#{a_attaching_rate, mode=OUT, jdbcType=VARCHAR}, #{a_attaching_rate, mode=OUT, jdbcType=VARCHAR},
#{a_renewal_rate, mode=OUT, jdbcType=VARCHAR}, #{a_renewal_rate, mode=OUT, jdbcType=VARCHAR},
#{a_total, mode=OUT, jdbcType=INTEGER, javaType=Integer}, #{a_total, mode=OUT, jdbcType=INTEGER, javaType=Integer},
#{a_present_month, mode=OUT, jdbcType=DOUBLE, javaType=Double},
#{a_mensual_cur, mode=OUT, jdbcType=CURSOR, resultMap=MensualArchievementMapper}) #{a_mensual_cur, mode=OUT, jdbcType=CURSOR, resultMap=MensualArchievementMapper})
</select> </select>

View File

@ -2,27 +2,31 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cpic.xim.mybatis.mapper.ImportBIArchievementDataMapper"> <mapper namespace="com.cpic.xim.mybatis.mapper.ImportBIArchievementDataMapper">
<insert id="insertTelsalerAttachingRateDataToDB" parameterType="com.cpic.xim.mybatis.pojo.BITelsalerAttachingRateRecord"> <insert id="insertTelsalerAttachingRateDataToDB" parameterType="com.cpic.xim.mybatis.pojo.BITelsalerAttachingRateRecord">
insert into BI电销坐席车非渗透统计表 ( 坐席名称, 车险保费, 非车保费, 车险保费占比, insert into BI电销坐席车非渗透率跟踪表 ( "部门","经办","车险保费(万)","车险保费占比","非车保费(万)",
当月保费渗透率, 保费渗透率环比上月, 当月客户渗透率, 客户渗透率环比上月, "当月保费渗透率","保费渗透率环比上月","当月客户渗透率","客户渗透率环比上月",
当月车非客均保费, 客均保费环比上月 ) "当月车非客均保费","客均保费环比上月" )
values ( #{telsalerName}, #{motoPremium}, #{nomotoPremium}, #{motoPremiumProportion}, values ( #{departmentName}, #{telsalerName}, #{motoPremium}, #{motoPremiumProportion}, #{nomotoPremium},
#{attachingRate}, #{attachingRateChange}, #{customerHandleRate}, #{attachingRate}, #{attachingRateChange}, #{customerHandleRate},
#{customerHandleRateChange}, #{noMotoPremiumPerCustomer}, #{noMotoPremiumPerCustomerChange} ) #{customerHandleRateChange}, #{noMotoPremiumPerCustomer}, #{noMotoPremiumPerCustomerChange} )
</insert> </insert>
<insert id="insertTelsalerRenewalRateDataToDB" parameterType="com.cpic.xim.mybatis.pojo.BITelsalerRenewalRateRecord"> <insert id="insertTelsalerRenewalRateDataToDB" parameterType="com.cpic.xim.mybatis.pojo.BITelsalerRenewalRateRecord">
insert into BI坐席续保率统计表 (责任人,机构目标值,到期数全月,序时到期数占比,个车续保率序时,个车续保率全月,环比昨日,环比上月) insert into BI电销坐席续保率跟踪表 ("责任部门","责任人","机构目标值1(%)","到期数-全月",
values (#{责任人},#{机构目标值},#{到期数全月},#{序时到期数占比}, "序时到期数占比(%)","个车续保率(序时)(%)","个车续保率(全月)(%)",
#{个车续保率序时},#{个车续保率全月},#{环比昨日},#{环比上月}) "环比昨日(%)","环比上月(%)","平均提前签单天数","环比")
values (#{责任部门},#{责任人},#{机构目标值},#{到期数全月},#{序时到期数占比},
#{个车续保率序时},#{个车续保率全月},#{环比昨日},#{环比上月},
#{平均提前签单天数},#{环比})
</insert> </insert>
<insert id="insertDepartmentAttachingRateDataToDB" parameterType="com.cpic.xim.mybatis.pojo.BIDepartmentAttachingRateRecord"> <insert id="insertDepartmentAttachingRateDataToDB" parameterType="com.cpic.xim.mybatis.pojo.BIDepartmentAttachingRateRecord">
insert into BI部门渗透率续保率统计表 ( 部门,"目标值-机构",目标差距,"车险保费", insert into BI机构渗透率跟踪表 ( 部门,"目标值-机构",目标差距,"车险保费",
车险保费占比,"非车保费",当月保费渗透率,保费渗透率环比上月,当月客户渗透率, 车险保费占比,"非车保费",当月保费渗透率,保费渗透率环比上月,当月客户渗透率,
客户渗透率环比上月,当月车非客均保费,客均保费环比上月) 客户渗透率环比上月,当月车非客均保费,客均保费环比上月,车险客户数)
values (#{departmentName},#{departmentObject},#{objectGap},#{motoPremium}, values (#{departmentName},#{departmentObject},#{objectGap},#{motoPremium},
#{motoPremiumProPortion},#{nomotoPremium},#{attachingRate},#{attachingRateChange}, #{motoPremiumProPortion},#{nomotoPremium},#{attachingRate},#{attachingRateChange},
#{customerHandleRate},#{customerHandleRateChange},#{premiumPerCustomer},#{premiumPerCustomerChange} ) #{customerHandleRate},#{customerHandleRateChange},#{premiumPerCustomer},#{premiumPerCustomerChange},
#{motoInsuranceCustomerCount} )
</insert> </insert>
<insert id="insertDepartmentRenewalRateDataToDB" parameterType="com.cpic.xim.mybatis.pojo.BIDepartmentRenewalRateRecord" > <insert id="insertDepartmentRenewalRateDataToDB" parameterType="com.cpic.xim.mybatis.pojo.BIDepartmentRenewalRateRecord" >
@ -34,10 +38,10 @@
</insert> </insert>
<select id="cleanTelsalerAttachingRateData" statementType="CALLABLE"> <select id="cleanTelsalerAttachingRateData" statementType="CALLABLE">
call telsale_bi_utils.清理BI电销坐席车非渗透统计表() call telsale_bi_utils.清理BI电销坐席车非渗透跟踪表()
</select> </select>
<select id="cleanTelsalerRenewalRateData" statementType="CALLABLE"> <select id="cleanTelsalerRenewalRateData" statementType="CALLABLE">
call telsale_bi_utils.清理BI电销坐席续保率统计表() call telsale_bi_utils.清理BI电销坐席续保率跟踪表()
</select> </select>
<select id="cleanDepartmentAttachingRateData" statementType="CALLABLE"> <select id="cleanDepartmentAttachingRateData" statementType="CALLABLE">
call telsale_bi_utils.清理BI部门渗透率跟踪表() call telsale_bi_utils.清理BI部门渗透率跟踪表()

View File

@ -9,37 +9,42 @@
*/ */
package com.cpic.xim.DesktopArchievement.test; package com.cpic.xim.DesktopArchievement.test;
import java.util.ArrayList;
import org.apache.ibatis.exceptions.PersistenceException; import org.apache.ibatis.exceptions.PersistenceException;
import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSession;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cpic.xim.mybatis.mapper.ImportBIArchievementDataMapper; import com.cpic.xim.mybatis.mapper.ImportBIArchievementDataMapper;
import com.cpic.xim.mybatis.pojo.*; import com.cpic.xim.mybatis.pojo.BIDepartmentAttachingRateRecord;
import com.cpic.xim.mybatis.pojo.BITelsalerRenewalRateRecord;
import com.cpic.xim.mybatis.utils.MybatisUtils; import com.cpic.xim.mybatis.utils.MybatisUtils;
import com.cpic.xim.utils.data.ImportBIExcelData; import com.cpic.xim.utils.data.ImportBIExcelData;
import java.util.ArrayList;
public class BatchInsertTest public class BatchInsertTest
{ {
private static Logger logger = LoggerFactory.getLogger(BatchInsertTest.class);
@Test @Test
public void testBatchInsertIntoBITelsalerAttachingRate() public void testBatchInsertIntoBITelsalerAttachingRate()
{ {
String filePath = "D:/develop/cpicxim/deskop_task_schedule/数据/测试用/坐席车非渗透.xlsx"; String filePath = "D:/develop/cpicxim/deskop_task_schedule/数据/测试用/经办 (2).xlsx";
ArrayList<BITelsalerAttachingRateRecord> records = null; ArrayList<BITelsalerRenewalRateRecord> records = null;
SqlSession session = null; SqlSession session = null;
ImportBIArchievementDataMapper mapper = null; ImportBIArchievementDataMapper mapper = null;
try try
{ {
records = ImportBIExcelData.importBITelsalerAttachingRateRecordFromXlsx( filePath, 0, records = ImportBIExcelData.importBITelsalerRenewalRateFromXlsx( filePath, 0,
1 ); 1 );
session = MybatisUtils.getSqlSessionBatch(); session = MybatisUtils.getSqlSessionBatch();
mapper = session.getMapper( ImportBIArchievementDataMapper.class ); mapper = session.getMapper( ImportBIArchievementDataMapper.class );
mapper.cleanTelsalerAttachingRateData(); mapper.cleanTelsalerRenewalRateData();
for ( BITelsalerAttachingRateRecord record : records ) for ( BITelsalerRenewalRateRecord record : records )
{ {
mapper.insertTelsalerAttachingRateDataToDB( record ); mapper.insertTelsalerRenewalRateDataToDB( record );
} }
session.commit(); session.commit();
@ -50,6 +55,10 @@ public class BatchInsertTest
{ {
System.out.println(error); System.out.println(error);
assert( false ); assert( false );
}
catch(InvalidFormatException error)
{
} }
catch ( Exception error ) catch ( Exception error )
{ {
@ -65,20 +74,18 @@ public class BatchInsertTest
@Test @Test
public void testBatchInsertBITeslsalerRenewalRate() public void testBatchInsertBITeslsalerRenewalRate()
{ {
String filePath = "D:/develop/cpicxim/deskop_task_schedule/数据/测试用/坐席续保率 .xlsx"; String filePath = "D:/develop/cpicxim/deskop_task_schedule/数据/测试用/坐席-续保.xlsx";
String sheetName = "当月个车续保率跟踪报表【机构】";
ArrayList<BITelsalerRenewalRateRecord> records = null; ArrayList<BITelsalerRenewalRateRecord> records = null;
SqlSession session = null; SqlSession session = null;
ImportBIArchievementDataMapper mapper = null; ImportBIArchievementDataMapper mapper = null;
try try
{ {
records = ImportBIExcelData.importBITelsalerRenewalRateFromXlsx( filePath, 0, 1,
null );
session = MybatisUtils.getSqlSessionBatch(); session = MybatisUtils.getSqlSessionBatch();
mapper = session.getMapper( ImportBIArchievementDataMapper.class ); mapper = session.getMapper( ImportBIArchievementDataMapper.class );
records = ImportBIExcelData.importBITelsalerRenewalRateFromXlsx( filePath, 0, 1 );
// 清理数据 // 清理数据
mapper.cleanTelsalerRenewalRateData(); mapper.cleanTelsalerRenewalRateData();
@ -94,6 +101,7 @@ public class BatchInsertTest
} }
catch ( Exception error ) catch ( Exception error )
{ {
logger.error("出现错误", error);
assert (false); assert (false);
if ( session != null ) if ( session != null )
@ -104,10 +112,9 @@ public class BatchInsertTest
} }
@Test @Test
public void testBatchInsertBIDepartmentArchievementToDB() public void testBatchInsertBIDepartmentAttachingRateToDB()
{ {
String filePath = "D:/develop/cpicxim/deskop_task_schedule/数据/测试用/BI部门渗透率续保率.xlsx"; String filePath = "D:/develop/cpicxim/deskop_task_schedule/数据/测试用/机构渗透.xlsx";
String sheetName = "部门";
ArrayList<BIDepartmentAttachingRateRecord> records = null; ArrayList<BIDepartmentAttachingRateRecord> records = null;
SqlSession session = null; SqlSession session = null;
@ -135,6 +142,10 @@ public class BatchInsertTest
{ {
session.rollback(); session.rollback();
} }
logger.error("错误", error);
assert( false );
} }
} }
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.