开始开发车非渗透率BI表导入功能。
加入一些测试用数据文件。
This commit is contained in:
		@@ -14,6 +14,7 @@
 | 
			
		||||
    <maven.compiler.source>17</maven.compiler.source>
 | 
			
		||||
    <maven.compiler.target>17</maven.compiler.target>
 | 
			
		||||
    <spring.version>5.3.24</spring.version>
 | 
			
		||||
    <log4j2.version>2.20.0</log4j2.version>
 | 
			
		||||
    <!-- <spring.version>6.0.11</spring.version> -->
 | 
			
		||||
  </properties>
 | 
			
		||||
 | 
			
		||||
@@ -116,19 +117,26 @@
 | 
			
		||||
      <artifactId>log4j-slf4j2-impl</artifactId>
 | 
			
		||||
      <version>2.20.0</version>
 | 
			
		||||
    </dependency>
 | 
			
		||||
    <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>org.apache.logging.log4j</groupId>
 | 
			
		||||
      <artifactId>log4j-api</artifactId>
 | 
			
		||||
      <version>2.20.0</version>
 | 
			
		||||
    </dependency>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    <!-- POI -->
 | 
			
		||||
    <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>org.apache.poi</groupId>
 | 
			
		||||
      <artifactId>poi</artifactId>
 | 
			
		||||
      <version>5.2.4</version>
 | 
			
		||||
      <version>5.2.3</version>
 | 
			
		||||
    </dependency>
 | 
			
		||||
    <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
 | 
			
		||||
    <dependency>
 | 
			
		||||
      <groupId>org.apache.poi</groupId>
 | 
			
		||||
      <artifactId>poi-ooxml</artifactId>
 | 
			
		||||
      <version>5.2.4</version>
 | 
			
		||||
      <version>5.2.3</version>
 | 
			
		||||
    </dependency>
 | 
			
		||||
 | 
			
		||||
    <dependency>
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,188 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-10-08 14:45:13
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/pojo/TelsalerAttachingRateRecord.java
 | 
			
		||||
 * @Description: 用于存放BI导出每日电销坐席车险非车险保费和车非渗透率数据.
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright (c) ${2023} by Kane, All Rights Reserved. 
 | 
			
		||||
 */
 | 
			
		||||
package com.cpic.xim.mybatis.pojo;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonProperty;
 | 
			
		||||
 | 
			
		||||
public class TelsalerAttachingRateRecord
 | 
			
		||||
{
 | 
			
		||||
    // 统计日期
 | 
			
		||||
    @JsonProperty("summaryDate")
 | 
			
		||||
    private LocalDate summaryDate;
 | 
			
		||||
    
 | 
			
		||||
    // 坐席名称
 | 
			
		||||
    @JsonProperty("telsalerName")
 | 
			
		||||
    private String telsalerName;
 | 
			
		||||
 | 
			
		||||
    // 车险保费
 | 
			
		||||
    @JsonProperty("motoPremium")
 | 
			
		||||
    private double motoPremium;
 | 
			
		||||
 | 
			
		||||
    // 非车险保费
 | 
			
		||||
    @JsonProperty("nomotoPremium")
 | 
			
		||||
    private double nomotoPremium;
 | 
			
		||||
 | 
			
		||||
    // 车险保费占比
 | 
			
		||||
    @JsonProperty("motoPremiumProportion")
 | 
			
		||||
    private double motoPremiumProportion;
 | 
			
		||||
 | 
			
		||||
    // 渗透率
 | 
			
		||||
    @JsonProperty("attachingRate")
 | 
			
		||||
    private double attachingRate;
 | 
			
		||||
 | 
			
		||||
    // 渗透率环比上月
 | 
			
		||||
    @JsonProperty("attachingRateChange")
 | 
			
		||||
    private double attachingRateChange;
 | 
			
		||||
 | 
			
		||||
    public TelsalerAttachingRateRecord() {}
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String toString()
 | 
			
		||||
    {
 | 
			
		||||
        return "TelsalerAttachingRateRecord [summaryDate=" + summaryDate + ", telsalerName="
 | 
			
		||||
                + telsalerName + ", motoPremium=" + motoPremium + ", nomotoPremium=" + nomotoPremium
 | 
			
		||||
                + ", motoPremiumProportion=" + motoPremiumProportion + ", attachingRate="
 | 
			
		||||
                + attachingRate + ", attachingRateChange=" + attachingRateChange + "]";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public int hashCode()
 | 
			
		||||
    {
 | 
			
		||||
        final int prime = 31;
 | 
			
		||||
        int result = 1;
 | 
			
		||||
        result = prime * result + ((summaryDate == null) ? 0 : summaryDate.hashCode());
 | 
			
		||||
        result = prime * result + ((telsalerName == null) ? 0 : telsalerName.hashCode());
 | 
			
		||||
        long temp;
 | 
			
		||||
        temp = Double.doubleToLongBits( motoPremium );
 | 
			
		||||
        result = prime * result + (int) (temp ^ (temp >>> 32));
 | 
			
		||||
        temp = Double.doubleToLongBits( nomotoPremium );
 | 
			
		||||
        result = prime * result + (int) (temp ^ (temp >>> 32));
 | 
			
		||||
        temp = Double.doubleToLongBits( motoPremiumProportion );
 | 
			
		||||
        result = prime * result + (int) (temp ^ (temp >>> 32));
 | 
			
		||||
        temp = Double.doubleToLongBits( attachingRate );
 | 
			
		||||
        result = prime * result + (int) (temp ^ (temp >>> 32));
 | 
			
		||||
        temp = Double.doubleToLongBits( attachingRateChange );
 | 
			
		||||
        result = prime * result + (int) (temp ^ (temp >>> 32));
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean equals( Object obj )
 | 
			
		||||
    {
 | 
			
		||||
        if ( this == obj )
 | 
			
		||||
            return true;
 | 
			
		||||
        if ( obj == null )
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( getClass() != obj.getClass() )
 | 
			
		||||
            return false;
 | 
			
		||||
        TelsalerAttachingRateRecord other = (TelsalerAttachingRateRecord) obj;
 | 
			
		||||
        if ( summaryDate == null )
 | 
			
		||||
        {
 | 
			
		||||
            if ( other.summaryDate != null )
 | 
			
		||||
                return false;
 | 
			
		||||
        }
 | 
			
		||||
        else if ( !summaryDate.equals( other.summaryDate ) )
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( telsalerName == null )
 | 
			
		||||
        {
 | 
			
		||||
            if ( other.telsalerName != null )
 | 
			
		||||
                return false;
 | 
			
		||||
        }
 | 
			
		||||
        else if ( !telsalerName.equals( other.telsalerName ) )
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( Double.doubleToLongBits( motoPremium ) != Double
 | 
			
		||||
                .doubleToLongBits( other.motoPremium ) )
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( Double.doubleToLongBits( nomotoPremium ) != Double
 | 
			
		||||
                .doubleToLongBits( other.nomotoPremium ) )
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( Double.doubleToLongBits( motoPremiumProportion ) != Double
 | 
			
		||||
                .doubleToLongBits( other.motoPremiumProportion ) )
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( Double.doubleToLongBits( attachingRate ) != Double
 | 
			
		||||
                .doubleToLongBits( other.attachingRate ) )
 | 
			
		||||
            return false;
 | 
			
		||||
        if ( Double.doubleToLongBits( attachingRateChange ) != Double
 | 
			
		||||
                .doubleToLongBits( other.attachingRateChange ) )
 | 
			
		||||
            return false;
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public LocalDate getSummaryDate()
 | 
			
		||||
    {
 | 
			
		||||
        return summaryDate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setSummaryDate( LocalDate summaryDate )
 | 
			
		||||
    {
 | 
			
		||||
        this.summaryDate = summaryDate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getTelsalerName()
 | 
			
		||||
    {
 | 
			
		||||
        return telsalerName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setTelsalerName( String telsalerName )
 | 
			
		||||
    {
 | 
			
		||||
        this.telsalerName = telsalerName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public double getMotoPremium()
 | 
			
		||||
    {
 | 
			
		||||
        return motoPremium;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setMotoPremium( double motoPremium )
 | 
			
		||||
    {
 | 
			
		||||
        this.motoPremium = motoPremium;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public double getNomotoPremium()
 | 
			
		||||
    {
 | 
			
		||||
        return nomotoPremium;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setNomotoPremium( double nomotoPremium )
 | 
			
		||||
    {
 | 
			
		||||
        this.nomotoPremium = nomotoPremium;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public double getMotoPremiumProportion()
 | 
			
		||||
    {
 | 
			
		||||
        return motoPremiumProportion;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setMotoPremiumProportion( double motoPremiumProportion )
 | 
			
		||||
    {
 | 
			
		||||
        this.motoPremiumProportion = motoPremiumProportion;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public double getAttachingRate()
 | 
			
		||||
    {
 | 
			
		||||
        return attachingRate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setAttachingRate( double attachingRate )
 | 
			
		||||
    {
 | 
			
		||||
        this.attachingRate = attachingRate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public double getAttachingRateChange()
 | 
			
		||||
    {
 | 
			
		||||
        return attachingRateChange;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setAttachingRateChange( double attachingRateChange )
 | 
			
		||||
    {
 | 
			
		||||
        this.attachingRateChange = attachingRateChange;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,58 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-10-08 15:02:15
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/utils/data/TelsalerArchievementData.java
 | 
			
		||||
 * @Description: 坐席业绩相关的数据操作方法。
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright (c) ${2023} by Kane, All Rights Reserved. 
 | 
			
		||||
 */
 | 
			
		||||
package com.cpic.xim.utils.data;
 | 
			
		||||
 | 
			
		||||
import java.io.File;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
import java.util.ArrayList;
 | 
			
		||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 | 
			
		||||
import org.apache.poi.openxml4j.opc.OPCPackage;
 | 
			
		||||
import org.apache.poi.ss.usermodel.Sheet;
 | 
			
		||||
import org.apache.poi.ss.usermodel.Workbook;
 | 
			
		||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
 | 
			
		||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 | 
			
		||||
import com.cpic.xim.mybatis.pojo.TelsalerAttachingRateRecord;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 坐席业绩相关的数据操作方法。
 | 
			
		||||
 */
 | 
			
		||||
public class TelsalerArchievementData
 | 
			
		||||
{
 | 
			
		||||
    public static ArrayList<TelsalerAttachingRateRecord> importTelsalerAttachingRateRecordFromXlsx(
 | 
			
		||||
            String filePath ) throws IOException, InvalidFormatException
 | 
			
		||||
    {
 | 
			
		||||
        ArrayList<TelsalerAttachingRateRecord> records = new ArrayList<>( 200 );
 | 
			
		||||
 | 
			
		||||
        Workbook wb = null;
 | 
			
		||||
        Sheet sheet = null;
 | 
			
		||||
 | 
			
		||||
        try
 | 
			
		||||
        {
 | 
			
		||||
            wb = WorkbookFactory.create( new File(filePath));
 | 
			
		||||
            sheet = wb.getSheet("经办");
 | 
			
		||||
        }
 | 
			
		||||
        finally
 | 
			
		||||
        {
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                if ( wb != null )
 | 
			
		||||
                {
 | 
			
		||||
                    wb.close();
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            catch ( IOException error )
 | 
			
		||||
            {
 | 
			
		||||
                error.printStackTrace();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return records;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user