完成mybatis导入函数。
This commit is contained in:
		@@ -1,17 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-10-11 16:47:59
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/ImportArchievementDataMapper.java
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright (c) ${2023} by Kane, All Rights Reserved. 
 | 
			
		||||
 */
 | 
			
		||||
package com.cpic.xim.mybatis.mapper;
 | 
			
		||||
 | 
			
		||||
import com.cpic.xim.mybatis.pojo.TelsalerAttachingRateRecord;
 | 
			
		||||
 | 
			
		||||
public interface ImportArchievementDataMapper
 | 
			
		||||
{
 | 
			
		||||
    public void importTesalerAttachingRateDataToDB( TelsalerAttachingRateRecord record);
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,29 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-10-11 16:47:59
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/ImportArchievementDataMapper.java
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright (c) ${2023} by Kane, All Rights Reserved. 
 | 
			
		||||
 */
 | 
			
		||||
package com.cpic.xim.mybatis.mapper;
 | 
			
		||||
 | 
			
		||||
import com.cpic.xim.mybatis.pojo.BITelsalerAttachingRateRecord;
 | 
			
		||||
import com.cpic.xim.mybatis.pojo.BITelsalerRenewalRateRecord;
 | 
			
		||||
import com.cpic.xim.mybatis.pojo.BIDepartmentArchievementRecord;
 | 
			
		||||
 | 
			
		||||
public interface ImportBIArchievementDataMapper
 | 
			
		||||
{
 | 
			
		||||
    public void insertTelsalerAttachingRateDataToDB( BITelsalerAttachingRateRecord record);
 | 
			
		||||
 | 
			
		||||
    public void insertTelsalerRenewalRateDataToDB( BITelsalerRenewalRateRecord record );
 | 
			
		||||
 | 
			
		||||
    public void insertDepartmentAttachingRenewalRateDataToDB(BIDepartmentArchievementRecord record);
 | 
			
		||||
 | 
			
		||||
    public void cleanTelsalerAttachingRateData();
 | 
			
		||||
 | 
			
		||||
    public void cleanTelsalerRenewalRateData();
 | 
			
		||||
 | 
			
		||||
    public void cleanDepartmentAttachingRenewalRateData();
 | 
			
		||||
}
 | 
			
		||||
@@ -9,7 +9,7 @@
 | 
			
		||||
 */
 | 
			
		||||
package com.cpic.xim.mybatis.pojo;
 | 
			
		||||
 | 
			
		||||
public class DepartmentArchievementRecord
 | 
			
		||||
public class BIDepartmentArchievementRecord
 | 
			
		||||
{
 | 
			
		||||
    // 部门
 | 
			
		||||
    private String departmentName;
 | 
			
		||||
@@ -36,7 +36,7 @@ public class DepartmentArchievementRecord
 | 
			
		||||
    // 客均保费环比上月
 | 
			
		||||
    private double premiumPerCustomerChange;
 | 
			
		||||
 | 
			
		||||
    public DepartmentArchievementRecord( String departmentName, double departmentObject,
 | 
			
		||||
    public BIDepartmentArchievementRecord( String departmentName, double departmentObject,
 | 
			
		||||
            double objectGap, double motoPremium, double motoPremiumProPortion,
 | 
			
		||||
            double nomotoPremium, double attachingRate, double attachingRateChange,
 | 
			
		||||
            double customerHandleRate, double customerHandleRateChange, double premiumPerCustomer,
 | 
			
		||||
@@ -110,7 +110,7 @@ public class DepartmentArchievementRecord
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( getClass() != obj.getClass() )
 | 
			
		||||
            return false;
 | 
			
		||||
        DepartmentArchievementRecord other = (DepartmentArchievementRecord) obj;
 | 
			
		||||
        BIDepartmentArchievementRecord other = (BIDepartmentArchievementRecord) obj;
 | 
			
		||||
        if ( departmentName == null )
 | 
			
		||||
        {
 | 
			
		||||
            if ( other.departmentName != null )
 | 
			
		||||
@@ -12,7 +12,7 @@ package com.cpic.xim.mybatis.pojo;
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonProperty;
 | 
			
		||||
 | 
			
		||||
public class TelsalerAttachingRateRecord
 | 
			
		||||
public class BITelsalerAttachingRateRecord
 | 
			
		||||
{
 | 
			
		||||
    // 统计日期
 | 
			
		||||
    @JsonProperty( "summaryDate" )
 | 
			
		||||
@@ -44,28 +44,17 @@ public class TelsalerAttachingRateRecord
 | 
			
		||||
 | 
			
		||||
    // 当月客户渗透率
 | 
			
		||||
    @JsonProperty( "customerHandleRateCell" )
 | 
			
		||||
    private double customerHandleRateCell;
 | 
			
		||||
    private double customerHandleRate;
 | 
			
		||||
 | 
			
		||||
    // 客户渗透率环比上月
 | 
			
		||||
    @JsonProperty( "customerHandleRateChangeCell" )
 | 
			
		||||
    private double customerHandleRateChangeCell;
 | 
			
		||||
    private double customerHandleRateChange;
 | 
			
		||||
 | 
			
		||||
    // 当月车非客均保费
 | 
			
		||||
    @JsonProperty( "noMotoPremiumPerCustomerCell" )
 | 
			
		||||
    private double noMotoPremiumPerCustomerCell;
 | 
			
		||||
 | 
			
		||||
    // 客均保费环比上月
 | 
			
		||||
    @JsonProperty( "noMotoPremiumPerCustomerChangeCell" )
 | 
			
		||||
    private double noMotoPremiumPerCustomerChangeCell;
 | 
			
		||||
 | 
			
		||||
    public TelsalerAttachingRateRecord()
 | 
			
		||||
    {}
 | 
			
		||||
 | 
			
		||||
    public TelsalerAttachingRateRecord( LocalDate summaryDate, String telsalerName,
 | 
			
		||||
    public BITelsalerAttachingRateRecord( LocalDate summaryDate, String telsalerName,
 | 
			
		||||
            double motoPremium, double nomotoPremium, double motoPremiumProportion,
 | 
			
		||||
            double attachingRate, double attachingRateChange, double customerHandleRateCell,
 | 
			
		||||
            double customerHandleRateChangeCell, double noMotoPremiumPerCustomerCell,
 | 
			
		||||
            double noMotoPremiumPerCustomerChangeCell )
 | 
			
		||||
            double attachingRate, double attachingRateChange, double customerHandleRate,
 | 
			
		||||
            double customerHandleRateChange, double noMotoPremiumPerCustomer,
 | 
			
		||||
            double noMotoPremiumPerCustomerChange )
 | 
			
		||||
    {
 | 
			
		||||
        this.summaryDate = summaryDate;
 | 
			
		||||
        this.telsalerName = telsalerName;
 | 
			
		||||
@@ -74,64 +63,74 @@ public class TelsalerAttachingRateRecord
 | 
			
		||||
        this.motoPremiumProportion = motoPremiumProportion;
 | 
			
		||||
        this.attachingRate = attachingRate;
 | 
			
		||||
        this.attachingRateChange = attachingRateChange;
 | 
			
		||||
        this.customerHandleRateCell = customerHandleRateCell;
 | 
			
		||||
        this.customerHandleRateChangeCell = customerHandleRateChangeCell;
 | 
			
		||||
        this.noMotoPremiumPerCustomerCell = noMotoPremiumPerCustomerCell;
 | 
			
		||||
        this.noMotoPremiumPerCustomerChangeCell = noMotoPremiumPerCustomerChangeCell;
 | 
			
		||||
        this.customerHandleRate = customerHandleRate;
 | 
			
		||||
        this.customerHandleRateChange = customerHandleRateChange;
 | 
			
		||||
        this.noMotoPremiumPerCustomer = noMotoPremiumPerCustomer;
 | 
			
		||||
        this.noMotoPremiumPerCustomerChange = noMotoPremiumPerCustomerChange;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public double getCustomerHandleRateCell()
 | 
			
		||||
    public double getCustomerHandleRate()
 | 
			
		||||
    {
 | 
			
		||||
        return customerHandleRateCell;
 | 
			
		||||
        return customerHandleRate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setCustomerHandleRateCell( double customerHandleRateCell )
 | 
			
		||||
    public void setCustomerHandleRate( double customerHandleRate )
 | 
			
		||||
    {
 | 
			
		||||
        this.customerHandleRateCell = customerHandleRateCell;
 | 
			
		||||
        this.customerHandleRate = customerHandleRate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public double getCustomerHandleRateChangeCell()
 | 
			
		||||
    public double getCustomerHandleRateChange()
 | 
			
		||||
    {
 | 
			
		||||
        return customerHandleRateChangeCell;
 | 
			
		||||
        return customerHandleRateChange;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setCustomerHandleRateChangeCell( double customerHandleRateChangeCell )
 | 
			
		||||
    public void setCustomerHandleRateChange( double customerHandleRateChange )
 | 
			
		||||
    {
 | 
			
		||||
        this.customerHandleRateChangeCell = customerHandleRateChangeCell;
 | 
			
		||||
        this.customerHandleRateChange = customerHandleRateChange;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public double getNoMotoPremiumPerCustomerCell()
 | 
			
		||||
    public double getNoMotoPremiumPerCustomer()
 | 
			
		||||
    {
 | 
			
		||||
        return noMotoPremiumPerCustomerCell;
 | 
			
		||||
        return noMotoPremiumPerCustomer;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setNoMotoPremiumPerCustomerCell( double noMotoPremiumPerCustomerCell )
 | 
			
		||||
    public void setNoMotoPremiumPerCustomer( double noMotoPremiumPerCustomer )
 | 
			
		||||
    {
 | 
			
		||||
        this.noMotoPremiumPerCustomerCell = noMotoPremiumPerCustomerCell;
 | 
			
		||||
        this.noMotoPremiumPerCustomer = noMotoPremiumPerCustomer;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public double getNoMotoPremiumPerCustomerChangeCell()
 | 
			
		||||
    public double getNoMotoPremiumPerCustomerChange()
 | 
			
		||||
    {
 | 
			
		||||
        return noMotoPremiumPerCustomerChangeCell;
 | 
			
		||||
        return noMotoPremiumPerCustomerChange;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setNoMotoPremiumPerCustomerChangeCell( double noMotoPremiumPerCustomerChangeCell )
 | 
			
		||||
    public void setNoMotoPremiumPerCustomerChange( double noMotoPremiumPerCustomerChange )
 | 
			
		||||
    {
 | 
			
		||||
        this.noMotoPremiumPerCustomerChangeCell = noMotoPremiumPerCustomerChangeCell;
 | 
			
		||||
        this.noMotoPremiumPerCustomerChange = noMotoPremiumPerCustomerChange;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // 当月车非客均保费
 | 
			
		||||
    @JsonProperty( "noMotoPremiumPerCustomerCell" )
 | 
			
		||||
    private double noMotoPremiumPerCustomer;
 | 
			
		||||
 | 
			
		||||
    // 客均保费环比上月
 | 
			
		||||
    @JsonProperty( "noMotoPremiumPerCustomerChangeCell" )
 | 
			
		||||
    private double noMotoPremiumPerCustomerChange;
 | 
			
		||||
 | 
			
		||||
    public BITelsalerAttachingRateRecord()
 | 
			
		||||
    {}
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        return "TelsalerAttachingRateRecord [summaryDate=" + summaryDate + ", telsalerName="
 | 
			
		||||
        return "BITelsalerAttachingRateRecord [summaryDate=" + summaryDate + ", telsalerName="
 | 
			
		||||
                + telsalerName + ", motoPremium=" + motoPremium + ", nomotoPremium=" + nomotoPremium
 | 
			
		||||
                + ", motoPremiumProportion=" + motoPremiumProportion + ", attachingRate="
 | 
			
		||||
                + attachingRate + ", attachingRateChange=" + attachingRateChange
 | 
			
		||||
                + ", customerHandleRateCell=" + customerHandleRateCell
 | 
			
		||||
                + ", customerHandleRateChangeCell=" + customerHandleRateChangeCell
 | 
			
		||||
                + ", noMotoPremiumPerCustomerCell=" + noMotoPremiumPerCustomerCell
 | 
			
		||||
                + ", noMotoPremiumPerCustomerChangeCell=" + noMotoPremiumPerCustomerChangeCell
 | 
			
		||||
                + "]";
 | 
			
		||||
                + ", customerHandleRate=" + customerHandleRate + ", customerHandleRateChange="
 | 
			
		||||
                + customerHandleRateChange + ", noMotoPremiumPerCustomer="
 | 
			
		||||
                + noMotoPremiumPerCustomer + ", noMotoPremiumPerCustomerChange="
 | 
			
		||||
                + noMotoPremiumPerCustomerChange + "]";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
@@ -152,13 +151,13 @@ public class TelsalerAttachingRateRecord
 | 
			
		||||
        result = prime * result + (int) (temp ^ (temp >>> 32));
 | 
			
		||||
        temp = Double.doubleToLongBits( attachingRateChange );
 | 
			
		||||
        result = prime * result + (int) (temp ^ (temp >>> 32));
 | 
			
		||||
        temp = Double.doubleToLongBits( customerHandleRateCell );
 | 
			
		||||
        temp = Double.doubleToLongBits( customerHandleRate );
 | 
			
		||||
        result = prime * result + (int) (temp ^ (temp >>> 32));
 | 
			
		||||
        temp = Double.doubleToLongBits( customerHandleRateChangeCell );
 | 
			
		||||
        temp = Double.doubleToLongBits( customerHandleRateChange );
 | 
			
		||||
        result = prime * result + (int) (temp ^ (temp >>> 32));
 | 
			
		||||
        temp = Double.doubleToLongBits( noMotoPremiumPerCustomerCell );
 | 
			
		||||
        temp = Double.doubleToLongBits( noMotoPremiumPerCustomer );
 | 
			
		||||
        result = prime * result + (int) (temp ^ (temp >>> 32));
 | 
			
		||||
        temp = Double.doubleToLongBits( noMotoPremiumPerCustomerChangeCell );
 | 
			
		||||
        temp = Double.doubleToLongBits( noMotoPremiumPerCustomerChange );
 | 
			
		||||
        result = prime * result + (int) (temp ^ (temp >>> 32));
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
@@ -172,7 +171,7 @@ public class TelsalerAttachingRateRecord
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( getClass() != obj.getClass() )
 | 
			
		||||
            return false;
 | 
			
		||||
        TelsalerAttachingRateRecord other = (TelsalerAttachingRateRecord) obj;
 | 
			
		||||
        BITelsalerAttachingRateRecord other = (BITelsalerAttachingRateRecord) obj;
 | 
			
		||||
        if ( summaryDate == null )
 | 
			
		||||
        {
 | 
			
		||||
            if ( other.summaryDate != null )
 | 
			
		||||
@@ -202,17 +201,17 @@ public class TelsalerAttachingRateRecord
 | 
			
		||||
        if ( Double.doubleToLongBits( attachingRateChange ) != Double
 | 
			
		||||
                .doubleToLongBits( other.attachingRateChange ) )
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( Double.doubleToLongBits( customerHandleRateCell ) != Double
 | 
			
		||||
                .doubleToLongBits( other.customerHandleRateCell ) )
 | 
			
		||||
        if ( Double.doubleToLongBits( customerHandleRate ) != Double
 | 
			
		||||
                .doubleToLongBits( other.customerHandleRate ) )
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( Double.doubleToLongBits( customerHandleRateChangeCell ) != Double
 | 
			
		||||
                .doubleToLongBits( other.customerHandleRateChangeCell ) )
 | 
			
		||||
        if ( Double.doubleToLongBits( customerHandleRateChange ) != Double
 | 
			
		||||
                .doubleToLongBits( other.customerHandleRateChange ) )
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( Double.doubleToLongBits( noMotoPremiumPerCustomerCell ) != Double
 | 
			
		||||
                .doubleToLongBits( other.noMotoPremiumPerCustomerCell ) )
 | 
			
		||||
        if ( Double.doubleToLongBits( noMotoPremiumPerCustomer ) != Double
 | 
			
		||||
                .doubleToLongBits( other.noMotoPremiumPerCustomer ) )
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( Double.doubleToLongBits( noMotoPremiumPerCustomerChangeCell ) != Double
 | 
			
		||||
                .doubleToLongBits( other.noMotoPremiumPerCustomerChangeCell ) )
 | 
			
		||||
        if ( Double.doubleToLongBits( noMotoPremiumPerCustomerChange ) != Double
 | 
			
		||||
                .doubleToLongBits( other.noMotoPremiumPerCustomerChange ) )
 | 
			
		||||
            return false;
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
@@ -9,7 +9,7 @@
 | 
			
		||||
 */
 | 
			
		||||
package com.cpic.xim.mybatis.pojo;
 | 
			
		||||
 | 
			
		||||
public class TelsalerRenewalRateRecord
 | 
			
		||||
public class BITelsalerRenewalRateRecord
 | 
			
		||||
{
 | 
			
		||||
    private String 责任人;
 | 
			
		||||
    private double 机构目标值;
 | 
			
		||||
@@ -20,7 +20,7 @@ public class TelsalerRenewalRateRecord
 | 
			
		||||
    private double 环比昨日;
 | 
			
		||||
    private double 环比上月;
 | 
			
		||||
 | 
			
		||||
    public TelsalerRenewalRateRecord( String 责任人, double 机构目标值, double 到期数全月, double 序时到期数占比, double 个车续保率序时, double 个车续保率全月, double 环比昨日, double 环比上月 )
 | 
			
		||||
    public BITelsalerRenewalRateRecord( String 责任人, double 机构目标值, double 到期数全月, double 序时到期数占比, double 个车续保率序时, double 个车续保率全月, double 环比昨日, double 环比上月 )
 | 
			
		||||
    {
 | 
			
		||||
        this.责任人 = 责任人;
 | 
			
		||||
        this.机构目标值 = 机构目标值;
 | 
			
		||||
@@ -65,7 +65,7 @@ public class TelsalerRenewalRateRecord
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( getClass() != obj.getClass() )
 | 
			
		||||
            return false;
 | 
			
		||||
        TelsalerRenewalRateRecord other = (TelsalerRenewalRateRecord) obj;
 | 
			
		||||
        BITelsalerRenewalRateRecord other = (BITelsalerRenewalRateRecord) obj;
 | 
			
		||||
        if ( 责任人 == null )
 | 
			
		||||
        {
 | 
			
		||||
            if ( other.责任人 != null )
 | 
			
		||||
@@ -26,9 +26,9 @@ import com.cpic.xim.utils.poi.MyPOIUtils;
 | 
			
		||||
/**
 | 
			
		||||
 * 坐席业绩相关的数据操作方法。
 | 
			
		||||
 */
 | 
			
		||||
public class TelsalerArchievementData
 | 
			
		||||
public class ImportBIData
 | 
			
		||||
{
 | 
			
		||||
    private static Logger logger = LoggerFactory.getLogger( TelsalerArchievementData.class );
 | 
			
		||||
    private static Logger logger = LoggerFactory.getLogger( ImportBIData.class );
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 从excel文件读取坐席的车非渗透率数据
 | 
			
		||||
@@ -38,11 +38,11 @@ public class TelsalerArchievementData
 | 
			
		||||
     * @throws IOException 打开excel文件错误时抛出。
 | 
			
		||||
     * @throws InvalidFormatException excel单元格格式错误时抛出
 | 
			
		||||
     */
 | 
			
		||||
    public static ArrayList<TelsalerAttachingRateRecord> importTelsalerAttachingRateRecordFromXlsx(
 | 
			
		||||
    public static ArrayList<BITelsalerAttachingRateRecord> importBITelsalerAttachingRateRecordFromXlsx(
 | 
			
		||||
            String filePath, LocalDate summaryDate, boolean hasCaptionRow )
 | 
			
		||||
            throws IOException, InvalidFormatException
 | 
			
		||||
    {
 | 
			
		||||
        ArrayList<TelsalerAttachingRateRecord> records = new ArrayList<>( 200 );
 | 
			
		||||
        ArrayList<BITelsalerAttachingRateRecord> records = new ArrayList<>( 200 );
 | 
			
		||||
 | 
			
		||||
        Workbook wb = null;
 | 
			
		||||
        Sheet sheet = null;
 | 
			
		||||
@@ -94,7 +94,7 @@ public class TelsalerArchievementData
 | 
			
		||||
                    double noMotoPremiumPerCustomerChangeCell =
 | 
			
		||||
                            MyPOIUtils.getNumbericCellValue( row, 10 );
 | 
			
		||||
 | 
			
		||||
                    TelsalerAttachingRateRecord record = new TelsalerAttachingRateRecord(
 | 
			
		||||
                    BITelsalerAttachingRateRecord record = new BITelsalerAttachingRateRecord(
 | 
			
		||||
                            summaryDate, name, motoPremium, nomotoPremium, motoPremiumProPortion,
 | 
			
		||||
                            attachingRate, attachingRateChange, customerHandleRateCell,
 | 
			
		||||
                            customerHandleRateChangeCell, noMotoPremiumPerCustomerCell,
 | 
			
		||||
@@ -142,11 +142,11 @@ public class TelsalerArchievementData
 | 
			
		||||
     * @param summaryDate
 | 
			
		||||
     * @return
 | 
			
		||||
     */
 | 
			
		||||
    public static ArrayList<TelsalerRenewalRateRecord> importTelsalerRenewalRateFromXlsx(
 | 
			
		||||
    public static ArrayList<BITelsalerRenewalRateRecord> importBITelsalerRenewalRateFromXlsx(
 | 
			
		||||
            String filePath, String sheetName, boolean hasCaptionRow, LocalDate summaryDate )
 | 
			
		||||
            throws IOException
 | 
			
		||||
    {
 | 
			
		||||
        ArrayList<TelsalerRenewalRateRecord> records = new ArrayList<>( 200 );
 | 
			
		||||
        ArrayList<BITelsalerRenewalRateRecord> records = new ArrayList<>( 200 );
 | 
			
		||||
 | 
			
		||||
        Workbook wb = null;
 | 
			
		||||
        Sheet sheet = null;
 | 
			
		||||
@@ -183,7 +183,7 @@ public class TelsalerArchievementData
 | 
			
		||||
                    double 环比昨日 = MyPOIUtils.getNumbericCellValue( row, 6 );
 | 
			
		||||
                    double 环比上月 = MyPOIUtils.getNumbericCellValue( row, 7 );
 | 
			
		||||
 | 
			
		||||
                    TelsalerRenewalRateRecord record = new TelsalerRenewalRateRecord( 责任人, 机构目标值,
 | 
			
		||||
                    BITelsalerRenewalRateRecord record = new BITelsalerRenewalRateRecord( 责任人, 机构目标值,
 | 
			
		||||
                            到期数全月, 序时到期数占比, 个车续保率序时, 个车续保率全月, 环比昨日, 环比上月 );
 | 
			
		||||
 | 
			
		||||
                    records.add( record );
 | 
			
		||||
@@ -214,10 +214,10 @@ public class TelsalerArchievementData
 | 
			
		||||
        return records;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static ArrayList<DepartmentArchievementRecord> importDepartmentArchievementRecords(
 | 
			
		||||
    public static ArrayList<BIDepartmentArchievementRecord> importBIDepartmentArchievementRecords(
 | 
			
		||||
            String filePath, String sheetName, boolean hasCaptionRow ) throws IOException
 | 
			
		||||
    {
 | 
			
		||||
        ArrayList<DepartmentArchievementRecord> records = new ArrayList<>( 5 );
 | 
			
		||||
        ArrayList<BIDepartmentArchievementRecord> records = new ArrayList<>( 5 );
 | 
			
		||||
 | 
			
		||||
        Workbook wb = null;
 | 
			
		||||
 | 
			
		||||
@@ -241,7 +241,7 @@ public class TelsalerArchievementData
 | 
			
		||||
                {
 | 
			
		||||
                    String departmentName = MyPOIUtils.getStringCellValue( row, 0 );
 | 
			
		||||
 | 
			
		||||
                    if ( departmentName.isEmpty() )
 | 
			
		||||
                    if ( departmentName.isEmpty() || departmentName.equals("合计") )
 | 
			
		||||
                    {
 | 
			
		||||
                        continue;
 | 
			
		||||
                    }
 | 
			
		||||
@@ -258,7 +258,7 @@ public class TelsalerArchievementData
 | 
			
		||||
                    double premiumPerCustomer = MyPOIUtils.getNumbericCellValue( row, 1 );
 | 
			
		||||
                    double premiumPerCustomerChange = MyPOIUtils.getNumbericCellValue( row, 1 );
 | 
			
		||||
 | 
			
		||||
                    DepartmentArchievementRecord record = new DepartmentArchievementRecord(
 | 
			
		||||
                    BIDepartmentArchievementRecord record = new BIDepartmentArchievementRecord(
 | 
			
		||||
                            departmentName, departmentObject, objectGap, motoPremium,
 | 
			
		||||
                            motoPremiumProPortion, nomotoPremium, attachingRate,
 | 
			
		||||
                            attachingRateChange, customerHandleRate, customerHandleRateChange,
 | 
			
		||||
@@ -16,10 +16,10 @@ import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 | 
			
		||||
import org.springframework.stereotype.Controller;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMethod;
 | 
			
		||||
import com.cpic.xim.mybatis.mapper.ImportArchievementDataMapper;
 | 
			
		||||
import com.cpic.xim.mybatis.pojo.TelsalerAttachingRateRecord;
 | 
			
		||||
import com.cpic.xim.mybatis.mapper.ImportBIArchievementDataMapper;
 | 
			
		||||
import com.cpic.xim.mybatis.pojo.BITelsalerAttachingRateRecord;
 | 
			
		||||
import com.cpic.xim.mybatis.utils.MybatisUtils;
 | 
			
		||||
import com.cpic.xim.utils.data.TelsalerArchievementData;
 | 
			
		||||
import com.cpic.xim.utils.data.ImportBIData;
 | 
			
		||||
 | 
			
		||||
@Controller
 | 
			
		||||
@RequestMapping(method=RequestMethod.POST, path="/import_telsaler_archievement")
 | 
			
		||||
@@ -32,14 +32,14 @@ public class ImportTelsalerArchievementController
 | 
			
		||||
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            ArrayList<TelsalerAttachingRateRecord> records = TelsalerArchievementData.importTelsalerAttachingRateRecordFromXlsx( filePath, null,
 | 
			
		||||
            ArrayList<BITelsalerAttachingRateRecord> records = ImportBIData.importBITelsalerAttachingRateRecordFromXlsx( filePath, null,
 | 
			
		||||
                    true );
 | 
			
		||||
            session = MybatisUtils.getSqlSessionBatch();
 | 
			
		||||
            ImportArchievementDataMapper mapper =  session.getMapper( ImportArchievementDataMapper.class );
 | 
			
		||||
            ImportBIArchievementDataMapper mapper =  session.getMapper( ImportBIArchievementDataMapper.class );
 | 
			
		||||
            
 | 
			
		||||
            for ( TelsalerAttachingRateRecord record : records )
 | 
			
		||||
            for ( BITelsalerAttachingRateRecord record : records )
 | 
			
		||||
            {
 | 
			
		||||
                mapper.importTesalerAttachingRateDataToDB(record);
 | 
			
		||||
                mapper.insertTelsalerAttachingRateDataToDB(record);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            session.commit();
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<!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.ImportArchievementDataMapper">
 | 
			
		||||
    <insert id="importTesalerAttachingRateDataToDB" parameterType="com.cpic.xim.mybatis.pojo.TelsalerAttachingRateRecord">
 | 
			
		||||
        insert into 电销坐席车非渗透统计表 ( telsaler_name, moto_premium, nomoto_premium, moto_premium_proportion, attaching_rate, attaching_rate_change )
 | 
			
		||||
        values ( #{telsalerName}, #{motoPremium}, #{nomotoPremium}, #{motoPremiumProportion}, #{attachingRate},  #{attachingRateChange} )
 | 
			
		||||
    </insert>
 | 
			
		||||
</mapper>
 | 
			
		||||
@@ -0,0 +1,37 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<!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">
 | 
			
		||||
    <insert id="insertTelsalerAttachingRateDataToDB" parameterType="com.cpic.xim.mybatis.pojo.BITelsalerAttachingRateRecord">
 | 
			
		||||
        insert into BI电销坐席车非渗透统计表 ( 坐席名称, 车险保费, 非车保费, 车险保费占比, 
 | 
			
		||||
                                           当月保费渗透率, 保费渗透率环比上月, 当月客户渗透率, 客户渗透率环比上月, 
 | 
			
		||||
                                           当月车非客均保费, 客均保费环比上月 )
 | 
			
		||||
        values ( #{telsalerName}, #{motoPremium}, #{nomotoPremium}, #{motoPremiumProportion}, 
 | 
			
		||||
                 #{attachingRate},  #{attachingRateChange}, #{customerHandleRate},
 | 
			
		||||
                 #{customerHandleRateChange}, #{noMotoPremiumPerCustomer}, #{noMotoPremiumPerCustomerChange} )
 | 
			
		||||
    </insert>
 | 
			
		||||
 | 
			
		||||
    <insert id="insertTelsalerRenewalRateDataToDB" parameterType="com.cpic.xim.mybatis.pojo.BITelsalerRenewalRateRecord">
 | 
			
		||||
        insert into BI坐席续保率统计表 (责任人,机构目标值,到期数全月,序时到期数占比,个车续保率序时,个车续保率全月,环比昨日,环比上月)
 | 
			
		||||
        values (#{责任人},#{机构目标值},#{到期数全月},#{序时到期数占比},
 | 
			
		||||
        #{个车续保率序时},#{个车续保率全月},#{环比昨日},#{环比上月})
 | 
			
		||||
    </insert>
 | 
			
		||||
 | 
			
		||||
    <insert id="insertDepartmentAttachingRenewalRateDataToDB" parameterType="com.cpic.xim.mybatis.pojo.BIDepartmentArchievementRecord">
 | 
			
		||||
        insert into BI部门渗透率续保率统计表 ( 部门,"目标值-机构",目标差距,"车险保费(万)",
 | 
			
		||||
        车险保费占比,"非车保费(万)",当月保费渗透率,保费渗透率环比上月,当月客户渗透率,
 | 
			
		||||
        客户渗透率环比上月,当月车非客均保费,客均保费环比上月)
 | 
			
		||||
        values (#{departmentName},#{departmentObject},#{objectGap},#{motoPremium},
 | 
			
		||||
        #{motoPremiumProPortion},#{nomotoPremium},#{attachingRate},#{attachingRateChange},
 | 
			
		||||
        #{customerHandleRate},#{customerHandleRateChange},#{premiumPerCustomer},#{premiumPerCustomerChange} )
 | 
			
		||||
    </insert>
 | 
			
		||||
 | 
			
		||||
    <select id="cleanTelsalerAttachingRateData" statementType="CALLABLE">
 | 
			
		||||
        call telsale_bi_utils.清理BI电销坐席车非渗透统计表()
 | 
			
		||||
    </select>
 | 
			
		||||
    <select id="cleanTelsalerRenewalRateData" statementType="CALLABLE">
 | 
			
		||||
        call telsale_bi_utils.清理BI电销坐席续保率统计表()
 | 
			
		||||
    </select>
 | 
			
		||||
    <select id="cleanDepartmentAttachingRenewalRateData" statementType="CALLABLE">
 | 
			
		||||
        call telsale_bi_utils.清理BI部门业绩统计表()
 | 
			
		||||
    </select>
 | 
			
		||||
</mapper>
 | 
			
		||||
@@ -26,6 +26,6 @@
 | 
			
		||||
        <mapper resource="mybatis/mapper/ArchievementMapper.xml" />
 | 
			
		||||
        <mapper resource="mybatis/mapper/RankingListMapper.xml" />
 | 
			
		||||
        <mapper resource="mybatis/mapper/RewardsMapper.xml" />
 | 
			
		||||
        <mapper resource="mybatis/mapper/ImportArchievementDataMapper.xml" />  
 | 
			
		||||
        <mapper resource="mybatis/mapper/ImportBIArchievementDataMapper.xml" />  
 | 
			
		||||
    </mappers>
 | 
			
		||||
</configuration>
 | 
			
		||||
		Reference in New Issue
	
	Block a user