Просмотр исходного кода

1、拦截放过财务 - 对账 保司数据下载地址。
2、对账功能完善。

ligang134 3 лет назад
Родитель
Сommit
b473be1264

+ 2 - 0
src/main/java/com/ydtech/components/TokenInterceptor.java

@@ -28,6 +28,8 @@ public class TokenInterceptor {
 
         // 文件访问路劲
         notMatchList.add("/upload/**");
+        //财务 - 对账 - 保司数据下载
+        notMatchList.add("/api/inv/insExternalBills/export/**");
 
         //中煤
         notMatchList.add("/zm/Underwriting");   //自动核保回调

+ 2 - 1
src/main/java/com/ydtech/modules/admin/controller/SysUserController.java

@@ -26,6 +26,7 @@ import com.ydtech.modules.esm.service.EsmUserReferrerService;
 import com.ydtech.modules.inv.model.dto.InvInsChinaCoalExcelDto;
 import com.ydtech.security.utils.PasswordUtils;
 import com.ydtech.utils.StringUtils;
+import com.ydtech.utils.excel.ExcelEasypoiUtils;
 import com.ydtech.utils.excel.ExcelUtils2;
 import com.ydtech.utils.idgen.IdGenerate;
 import io.swagger.annotations.*;
@@ -614,7 +615,7 @@ public class SysUserController extends BaseController {
         if(null == sd) return HttpResult.error("机构部门不存在");
 
         try {
-            List<SysUser> userList = ExcelUtils2.importExcel(file, SysUser.class, 0, 1, 1);
+            List<SysUser> userList = ExcelEasypoiUtils.importExcel(file, SysUser.class, 0, 1, 1);
             userList = userList.stream().filter(l -> StringUtils.isNotEmpty(l.getMobile())).collect(Collectors.toList());
 
             userList.stream().forEach(a ->{

+ 35 - 8
src/main/java/com/ydtech/modules/inv/controller/InvExternalBillsController.java

@@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.sun.deploy.net.URLEncoder;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageRequest;
 import com.ydtech.core.page.PageResult;
@@ -15,10 +16,10 @@ import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.service.EsmInsCompanyService;
 import com.ydtech.modules.fnc.vo.FncVoucherVo;
 import com.ydtech.modules.ins.utils.ExcelStyleUtil;
-import com.ydtech.modules.ins.utils.ExcelUtils2;
 import com.ydtech.modules.inv.model.InvExternalBills;
 import com.ydtech.modules.inv.model.InvInsExternalBillsDetails;
 import com.ydtech.modules.inv.model.dto.InvInsImportDto;
+import com.ydtech.modules.inv.model.vo.InvInsCompanyExportVo;
 import com.ydtech.modules.inv.model.vo.req.InvChannelExternalBillsDetailsReqVO;
 import com.ydtech.modules.inv.model.vo.req.InvInsExternalBillsReqVO;
 import com.ydtech.modules.inv.model.vo.res.InvBaseChannelMatchInsResVO;
@@ -26,8 +27,11 @@ import com.ydtech.modules.inv.service.InvChannelsExternalBillsDetailsService;
 import com.ydtech.modules.inv.service.InvExternalBillsService;
 import com.ydtech.modules.inv.service.InvInsExternalBillsDetailsService;
 import com.ydtech.utils.StringUtils;
+import com.ydtech.utils.excel.ExcelEasypoiUtils;
+import com.ydtech.utils.excel.ExcelUtils2;
 import io.swagger.annotations.*;
 import org.apache.commons.lang3.ObjectUtils;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
@@ -35,11 +39,13 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
 /**
- * 外部单据控制层  临时
+ * 外部单据控制层
  *
  * @author: lig
  * @date: 2023-05-31
@@ -75,6 +81,7 @@ public class InvExternalBillsController extends BaseController {
         lqw.between(StringUtils.isNotEmpty(reqVo.getImportStartTime()) && StringUtils.isNotEmpty(reqVo.getImportEndTime()), InvExternalBills::getCreateTime, reqVo.getImportStartTime(), reqVo.getImportEndTime());
         lqw.eq(InvExternalBills::getFlag, reqVo.getFlag());
         lqw.eq(StringUtils.isNotEmpty(reqVo.getInsCompanyId()), InvExternalBills::getInsCompanyId, reqVo.getInsCompanyId());
+        lqw.eq(StringUtils.isNotEmpty(reqVo.getId()),InvExternalBills::getId,reqVo.getId());
 
         Page p = PageRequest.buildPageRequestByVo(reqVo);
         IPage<InvExternalBills> pResult = invExternalBillsService.page(p, lqw);
@@ -181,18 +188,38 @@ public class InvExternalBillsController extends BaseController {
         lqw.eq(InvInsExternalBillsDetails::getBatchNum,batchNum);
         List<InvInsExternalBillsDetails> list = invInsExternalBillsDetailsService.list(lqw);
 
-        String fileName = "result";
-        // 导出
-        ExportParams exportParams = new ExportParams("保司数据导出", "sheet0", ExcelType.HSSF);
-        // 设置
-        exportParams.setStyle(ExcelStyleUtil.class);
+        List<InvInsCompanyExportVo> listVo = new ArrayList<>();
+        list.stream().forEach(a ->{
+            InvInsCompanyExportVo vo = new InvInsCompanyExportVo();
+            vo.setPolicyNum(a.getPolicyNum());
+            vo.setApplicant(a.getApplicant());
+            vo.setPlateNum(a.getPlateNum());
+            vo.setPayDate(a.getPayDate());
+            vo.setMlifta(a.getMlifta());
+            vo.setVavt(a.getVavt());
+            vo.setCip(a.getCip());
+            vo.setOther(a.getOther());
+            vo.setMliftaCost(a.getMliftaCost());
+            vo.setVavtCost(a.getVavtCost());
+            vo.setCipCost(a.getCipCost());
+            vo.setInsCompany(a.getInsCompany());
+
+            listVo.add(vo);
+        });
+
+
+
+        String fileName = batchNum + "-保司数据导出";
         try {
-            ExcelUtils2.exportExcel(list, InvInsExternalBillsDetails.class, fileName, exportParams, request, response);
+            ExcelEasypoiUtils.exportExcel(listVo, InvInsCompanyExportVo.class,fileName,response);
         } catch (IOException e) {
             throw new RuntimeException(e);
         }
 
 
+
+
+
         return HttpResult.ok();
     }
 

+ 17 - 6
src/main/java/com/ydtech/modules/inv/dao/InvChannelsExternalBillsDetailsMapper.java

@@ -12,16 +12,27 @@ import java.util.List;
 public interface InvChannelsExternalBillsDetailsMapper extends BaseMapper<InvChannelsExternalBillsDetails> {
 
     //匹配sql
-    String selectFrom = "select t1.id,t1.batch_num as batchNum,t1.mlifta as mlifta1" +
-            ",t2.mlifta as mlifta2" +
+    String selectFrom = "select t1.id,t1.batch_num as batchNum" +
+            //交强险
+            ",IFNULL(t1.mlifta,0) as mlifta1" +
+            ",IFNULL(t2.mlifta,0) as mlifta2" +
+            ",IFNULL(t1.mlifta_cost,0) as mliftaCost1" +
+            ",IFNULL(t2.mlifta_cost,0) as mliftaCost2" +
             ",if(t2.id is null ,'数据未找到','数据不匹配') AS 'notMatchMsg'" +
             ",if(t1.mlifta &lt;=&gt; t2.mlifta,true,false) as 'mliftaMatch'" +
-            ",t1.vavt as vavt1" +
-            ",t2.vavt as vavt2" +
+            //车船税
+            ",IFNULL(t1.vavt,0) as vavt1" +
+            ",IFNULL(t2.vavt,0) as vavt2" +
+            ",IFNULL(t1.vavt_cost,0) as vavtCost1" +
+            ",IFNULL(t2.vavt_cost,0) as vavtCost2" +
             ",if(t1.vavt &lt;=&gt; t2.vavt,true,false) as 'vavtMatch'" +
-            ",t1.cip as cip1" +
-            ",t2.cip as cip2" +
+            //商业险
+            ",IFNULL(t1.cip,0) as cip1" +
+            ",IFNULL(t2.cip,0) as cip2" +
+            ",IFNULL(t1.cip_cost,0) as cipCost1" +
+            ",IFNULL(t1.cip_cost,0) as cipCost2" +
             ",if(t1.cip &lt;=&gt; t2.cip,true,false) as 'cipMatch'" +
+
             ",t1.plate_num as plateNum1" +
             ",t2.plate_num as plateNum2" +
             ",if(t1.plate_num &lt;=&gt; t2.plate_num,true,false) as 'plateNumMatch'" +

+ 1 - 3
src/main/java/com/ydtech/modules/inv/model/InvBaseExternalBillsDetails.java

@@ -64,7 +64,7 @@ public class InvBaseExternalBillsDetails implements Serializable {
      * 交强保费
      */
     @TableField(value = "mlifta")
-    @ApiModelProperty(value = "交强保费")
+    @ApiModelProperty(value = "交强保费")
     private BigDecimal mlifta;
 
     /**
@@ -94,7 +94,6 @@ public class InvBaseExternalBillsDetails implements Serializable {
      */
     @TableField(value = "mlifta_cost")
     @ApiModelProperty(value = "交强费用")
-    @Excel(name = "交强费用")
     private BigDecimal mliftaCost;
 
     /**
@@ -118,7 +117,6 @@ public class InvBaseExternalBillsDetails implements Serializable {
      */
     @TableField(value = "ins_company")
     @ApiModelProperty(value = "保险公司")
-    @Excel(name = "保险公司")
     private String insCompany;
 
     /**

+ 1 - 0
src/main/java/com/ydtech/modules/inv/model/InvExternalBills.java

@@ -192,6 +192,7 @@ public class InvExternalBills implements Serializable {
         iieb.setMlifta(totalMlifta);
         iieb.setVavt(totalVavt);
         iieb.setCip(totalCip);
+        iieb.setOther(totalOther);
 
 //        iieb.setMliftaCost(totalMliftaCost);
 //        iieb.setVavtCost(totalVavtCost);

+ 0 - 1
src/main/java/com/ydtech/modules/inv/model/InvInsExternalBillsDetails.java

@@ -25,7 +25,6 @@ public class InvInsExternalBillsDetails extends InvBaseExternalBillsDetails {
      */
     @TableField(value = "policy_num")
     @ApiModelProperty(value = "保单号")
-    @Excel(name = "保单号")
     private String policyNum;
 
     /**

+ 1 - 1
src/main/java/com/ydtech/modules/inv/model/dto/InvInsStandardExcelDto.java

@@ -29,7 +29,7 @@ public class InvInsStandardExcelDto {
     /**
      * 付款日期
      */
-    @Excel(name = "付款日期")
+    @Excel(name = "付款日期", exportFormat = "yyyy-MM-dd HH:mm:ss")
     private Date payDate;
 
 

+ 56 - 0
src/main/java/com/ydtech/modules/inv/model/vo/InvInsCompanyExportVo.java

@@ -0,0 +1,56 @@
+package com.ydtech.modules.inv.model.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ *  保险公司导出 VO
+ *
+ * @author: lig
+ * @date: 2023年07月25日 0025
+ */
+@Data
+public class InvInsCompanyExportVo {
+
+    @Excel(name = "保单号",width = 25)
+    private String policyNum;
+
+    @Excel(name = "投保人",width = 15)
+    private String applicant;
+
+    @Excel(name = "车牌号")
+    private String plateNum;
+
+//    @Excel(name = "员工性别", replace = { "男_1", "女_2" }, suffix = "生", isImportField = "true_st",needMerge = true)
+//    @Excel(name = "付款日期")
+    @Excel(name = "付款日期", databaseFormat = "yyyyMMddHHmmss", format = "yyyy-MM-dd", isImportField = "true_st", width = 20,needMerge = true)
+    private Date payDate;
+
+    @Excel(name = "交强险保费")
+    private BigDecimal mlifta;
+
+    @Excel(name = "车船税保费")
+    private BigDecimal vavt;
+
+    @Excel(name = "商业保费")
+    private BigDecimal cip;
+
+    @Excel(name = "其他保费")
+    private BigDecimal other;
+
+    @Excel(name = "交强险费用")
+    private BigDecimal mliftaCost;
+
+    @Excel(name = "车船税费用")
+    private BigDecimal vavtCost;
+
+    @Excel(name = "商业险费用")
+    private BigDecimal cipCost;
+
+    @Excel(name = "保险公司",width = 30)
+    private String insCompany;
+
+}

+ 3 - 0
src/main/java/com/ydtech/modules/inv/model/vo/req/InvInsExternalBillsReqVO.java

@@ -33,6 +33,9 @@ public class InvInsExternalBillsReqVO extends BasePageVO {
     @ApiModelProperty(value = "保险公司ID")
     private String insCompanyId;
 
+    @ApiModelProperty(value = "批次号")
+    private String id;
+
 
 
 }

+ 22 - 4
src/main/java/com/ydtech/modules/inv/model/vo/res/InvBaseChannelMatchInsResVO.java

@@ -27,19 +27,25 @@ public class InvBaseChannelMatchInsResVO  {
     @ApiModelProperty(value = "渠道批次号")
     private String batchNum;
 
-    @ApiModelProperty(value = "交强保费1")
+    @ApiModelProperty(value = "交强保费1(渠道)")
     private String mlifta1;
 
-    @ApiModelProperty(value = "交强保费2")
+    @ApiModelProperty(value = "交强保费2(保司)")
     private String mlifta2;
 
+    @ApiModelProperty(value = "交强费用1(渠道)")
+    private String mliftaCost1;
+
+    @ApiModelProperty(value = "交强费用2(保司)")
+    private String mliftaCost2;
+
     @ApiModelProperty(value = "交强保费匹配(布尔值) 1匹配  0不匹配")
     private String mliftaMatch;
 
-    @ApiModelProperty(value = "车牌号1")
+    @ApiModelProperty(value = "车牌号1(渠道)")
     private String plateNum1;
 
-    @ApiModelProperty(value = "车牌号2")
+    @ApiModelProperty(value = "车牌号2(保司)")
     private String plateNum2;
 
     @ApiModelProperty(value = "车牌号匹配(布尔值) 1匹配  0不匹配")
@@ -51,6 +57,12 @@ public class InvBaseChannelMatchInsResVO  {
     @ApiModelProperty(value = "车船税保费2(保司值)")
     private String vavt2;
 
+    @ApiModelProperty(value = "车船税费用1(渠道)")
+    private String vavtCost1;
+
+    @ApiModelProperty(value = "车船税费用2(保司)")
+    private String vavtCost2;
+
     @ApiModelProperty(value = "车船税保费匹配(布尔值) 1匹配  0不匹配")
     private String vavtMatch;
 
@@ -60,6 +72,12 @@ public class InvBaseChannelMatchInsResVO  {
     @ApiModelProperty(value = "商业保费2(保司值)")
     private String cip2;
 
+    @ApiModelProperty(value = "商业费用1(渠道值)")
+    private String cipCost1;
+
+    @ApiModelProperty(value = "商业费用2(保司值)")
+    private String cipCost2;
+
     @ApiModelProperty(value = "商业保费匹配(布尔值) 1匹配  0不匹配")
     private String cipMatch;
 

+ 2 - 1
src/main/java/com/ydtech/modules/inv/service/impl/InvChannelsExternalBillsDetailsServiceImpl.java

@@ -22,6 +22,7 @@ import com.ydtech.modules.inv.model.vo.res.InvCompanyResVO;
 import com.ydtech.modules.inv.service.InvChannelsExternalBillsDetailsService;
 import com.ydtech.modules.inv.service.InvExternalBillsService;
 import com.ydtech.utils.StringUtils;
+import com.ydtech.utils.excel.ExcelEasypoiUtils;
 import com.ydtech.utils.excel.ExcelUtils2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -85,7 +86,7 @@ public class InvChannelsExternalBillsDetailsServiceImpl extends ServiceImpl<InvC
         String errorMsg = "";
         List<InvChannelsExternalBillsDetails> list = null;
         try {
-            List<InvInsChannelExcelDto> dtoList =  ExcelUtils2.importExcel(file, InvInsChannelExcelDto.class, 0, 1, 1);
+            List<InvInsChannelExcelDto> dtoList =  ExcelEasypoiUtils.importExcel(file, InvInsChannelExcelDto.class, 0, 1, 1);
 
             dtoList = dtoList.stream().filter(l -> l.getPlateNum() != null).collect(Collectors.toList());
             if(null == dtoList || dtoList.size() < 1){

+ 15 - 7
src/main/java/com/ydtech/modules/inv/service/impl/InvInsExternalBillsDetailsServiceImpl.java

@@ -17,6 +17,7 @@ import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
 import com.ydtech.modules.protocol.service.PtlAgreementProductCostsService;
 import com.ydtech.utils.BigDecimalUtils;
 import com.ydtech.utils.StringUtils;
+import com.ydtech.utils.excel.ExcelEasypoiUtils;
 import com.ydtech.utils.excel.ExcelUtils2;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -91,18 +92,24 @@ public class InvInsExternalBillsDetailsServiceImpl extends ServiceImpl<InvInsExt
         Map<String, InvInsExternalBillsDetails> m = new HashMap();
 
 
-        List<InvInsStandardExcelDto> standardList = ExcelUtils2.importExcel(file, InvInsStandardExcelDto.class, 0, 1, 1);
+        List<InvInsStandardExcelDto> standardList = ExcelEasypoiUtils.importExcel(file, InvInsStandardExcelDto.class, 0, 1, 1);
         standardList.stream().forEach(a -> {
 
 
             List<String> filedList = new ArrayList<>();
             filedList.add(a.getInsuranceCompanyUser());
-            //获取费用
-            List<PtlAgreementProductCosts> costList = ptlAgreementProductCostsService.selectByCompanyId(iieb.getInsCompanyId(),filedList);
+            //费用map
             Map<String,String> costMap = new HashMap();
-            costList.stream().forEach(cost ->{
-                costMap.put(cost.getProductName(),cost.getCostsProportion());
-            });
+            try {
+                //获取费用
+                List<PtlAgreementProductCosts> costList = ptlAgreementProductCostsService.selectByCompanyId(iieb.getInsCompanyId(),filedList);
+
+                costList.stream().forEach(cost ->{
+                    costMap.put(cost.getProductName(),cost.getCostsProportion());
+                });
+            }catch (Exception e){
+                log.error("保司导入,获取费用失败!");
+            }
 
             InvInsExternalBillsDetails iiebd = new InvInsExternalBillsDetails();
             if (m.containsKey(a.getPlateNum())) {
@@ -110,6 +117,8 @@ public class InvInsExternalBillsDetailsServiceImpl extends ServiceImpl<InvInsExt
 
             } else {
                 BeanUtil.copyProperties(a, iiebd);
+                iiebd.setInsCompanyId(iieb.getInsCompanyId());
+                iiebd.setInsCompany(iieb.getInsCompanyName());
             }
 
 
@@ -118,7 +127,6 @@ public class InvInsExternalBillsDetailsServiceImpl extends ServiceImpl<InvInsExt
                 if(a.getProductName().equals("单交")){
                     iiebd.setMliftaCost(new BigDecimal(costMap.get(a.getProductName())));
                 }
-
             }
 
             buildStandardDtoParam(a, iiebd);

+ 2 - 1
src/main/java/com/ydtech/modules/inv/service/impl/InvInvoiceInfoServiceImpl.java

@@ -16,6 +16,7 @@ import com.ydtech.modules.inv.model.InvInvoiceInfo;
 import com.ydtech.modules.inv.service.InvCompanyService;
 import com.ydtech.modules.inv.service.InvInvoiceInfoService;
 import com.ydtech.utils.StringUtils;
+import com.ydtech.utils.excel.ExcelEasypoiUtils;
 import com.ydtech.utils.excel.ExcelUtils2;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -56,7 +57,7 @@ public class InvInvoiceInfoServiceImpl extends ServiceImpl<InvInvoiceInfoMapper,
 
         List<InvInvoiceInfo> list = null;
         try {
-            list = ExcelUtils2.importExcel(file, InvInvoiceInfo.class, null, null, null);
+            list = ExcelEasypoiUtils.importExcel(file, InvInvoiceInfo.class, null, null, null);
         } catch (IOException e) {
             return HttpResult.error("导入失败!" + e.getMessage());
         }

+ 97 - 0
src/main/java/com/ydtech/utils/excel/ExcelEasypoiUtils.java

@@ -0,0 +1,97 @@
+package com.ydtech.utils.excel;
+
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
+import cn.afterturn.easypoi.excel.entity.ExportParams;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
+import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
+import com.sun.deploy.net.URLEncoder;
+import com.ydtech.exception.SystemException;
+import com.ydtech.modules.inv.model.InvInsExternalBillsDetails;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.util.List;
+
+/**
+ * @Author: lig
+ * @create: 2023-07-25
+ * description: Excel  easypoi 导入导出工具类
+ */
+public class ExcelEasypoiUtils {
+
+
+
+    /**
+     * excel 导出   重写
+     *
+     * @param list      数据列表
+     * @param pojoClass pojo类型
+     * @param fileName  导出时的excel名称
+     * @param response
+     */
+    public static void exportExcel(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response) throws IOException {
+        ExportParams ep = new ExportParams();
+        Workbook sheets = ExcelExportUtil.exportExcel(ep, pojoClass,list);
+
+        try {
+            //3.返回表格
+            //设置表格文件名字
+//            String fileName = batchNum + "-保司数据导出";
+            fileName = URLEncoder.encode(fileName,"UTF8");
+
+            //设置返回数据类型
+            response.setContentType("application/vnd.ms-excel;charset=utf-8");
+            response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls");
+
+            //将表格输出
+            sheets.write(response.getOutputStream());
+
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
+
+    /**
+     * excel 导入 重写
+     *
+     * @param file      excel文件
+     * @param pojoClass pojo类型
+     * @param titleRows 表格标题行数
+     * @param headRows 表头行数,默认1
+     * @param sheetNum 上传表格需要读取的sheet 数量,默认为1
+     * @return
+     */
+    public static <T> List<T> importExcel(MultipartFile file, Class<T> pojoClass,Integer titleRows,Integer headRows,Integer sheetNum) throws IOException {
+
+
+        ImportParams importParams = new ImportParams();
+        if(null != titleRows) importParams.setTitleRows(0);
+        if(null != headRows) importParams.setHeadRows(1);
+        if(null != sheetNum) importParams.setSheetNum(1);
+
+
+        try {
+            return ExcelImportUtil.importExcel(file.getInputStream(), pojoClass, importParams);
+        } catch (Exception e) {
+            throw new SystemException("导入excel失败:" + e.getMessage());
+//            throw new RuntimeException(e);
+        }
+
+    }
+
+
+
+
+
+
+
+}

+ 0 - 30
src/main/java/com/ydtech/utils/excel/ExcelUtils2.java

@@ -142,36 +142,6 @@ public class ExcelUtils2 {
         }
     }
 
-
-    /**
-     * excel 导入 重写
-     *
-     * @param file      excel文件
-     * @param pojoClass pojo类型
-     * @param titleRows 表格标题行数
-     * @param headRows 表头行数,默认1
-     * @param sheetNum 上传表格需要读取的sheet 数量,默认为1
-     * @return
-     */
-    public static <T> List<T> importExcel(MultipartFile file, Class<T> pojoClass,Integer titleRows,Integer headRows,Integer sheetNum) throws IOException {
-
-
-        ImportParams importParams = new ImportParams();
-        if(null != titleRows) importParams.setTitleRows(0);
-        if(null != headRows) importParams.setHeadRows(1);
-        if(null != sheetNum) importParams.setSheetNum(1);
-
-
-        try {
-            return ExcelImportUtil.importExcel(file.getInputStream(), pojoClass, importParams);
-        } catch (Exception e) {
-            throw new SystemException("导入excel失败:" + e.getMessage());
-//            throw new RuntimeException(e);
-        }
-
-    }
-
-
     /**
      * excel 导入
      *