Ver Fonte

数据库解析文件时行列位置存储代码变更

ZhangYanJie há 2 semanas atrás
pai
commit
fbae29ebca

+ 8 - 4
Procedure/backend/project/src/main/java/com/sundata/product/rwa/businessconfig/utils/FilesValueCheckUtils.java

@@ -1,5 +1,6 @@
 package com.sundata.product.rwa.businessconfig.utils;
 
+import cn.hutool.poi.excel.ExcelUtil;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.sundata.admin.excelmanage.model.RptDefineModel;
 import com.sundata.common.exception.BusinessException;
@@ -303,14 +304,17 @@ public class FilesValueCheckUtils {
                     model = new ReportCalculationModel();
                     model.setReportno(defineModel.getReportNo());
                     // sheet页记入
-                    model.setReportUnitSheet((i+1));
+                    //model.setReportUnitSheet((i));
+                    model.setReportUnitSheetName(i+1);
                     // 当前sheet页当前行记入
-                    model.setReportUnitRow((rowNum+1));
+                    //model.setReportUnitRow((rowNum));
+                    model.setReportUnitRowName(rowNum+1);
                     // 当前sheet页当前行的当前列记入
-                    model.setReportUnitCell((cellNum+1));
+                    //model.setReportUnitCell((cellNum));
+                    model.setReportUnitCellName(ExcelUtil.indexToColName(cellNum));
                     // 报表计算单元编号计入(报表编号+sheet页号+行号+列号)
                     model.setReportUnitNo(defineModel.getReportNo()+"_"+
-                            String.valueOf(i+1)+"_"+String.valueOf(rowNum+1)+"_"+String.valueOf(cellNum+1));
+                            String.valueOf(i)+"_"+String.valueOf(rowNum)+"_"+String.valueOf(cellNum));
                     // 序号记录
 //                    reportNo = reportNo + 1;
 //                    model.setId(String.valueOf(reportNo));

+ 37 - 0
Procedure/backend/project/src/main/java/com/sundata/product/rwa/reportformconfigreportcreater/model/ReportCalculationModel.java

@@ -1,5 +1,8 @@
 package com.sundata.product.rwa.reportformconfigreportcreater.model;
 
+import cn.hutool.poi.excel.ExcelUtil;
+import cn.hutool.poi.excel.cell.CellUtil;
+
 import java.util.StringJoiner;
 
 public class ReportCalculationModel {
@@ -22,10 +25,44 @@ public class ReportCalculationModel {
     private String reportUnitNo;
     // sheet页位置
     private Integer reportUnitSheet;
+
+    private Integer reportUnitSheetName;
     // 行位置
     private Integer reportUnitRow;
+
+    private Integer reportUnitRowName;
     // 列位置
     private Integer reportUnitCell;
+
+    private String reportUnitCellName;
+
+    public Integer getReportUnitSheetName() {
+        return reportUnitSheet+1;
+    }
+
+    public void setReportUnitSheetName(Integer reportUnitSheetName) {
+        this.reportUnitSheetName = reportUnitSheetName;
+        setReportUnitSheet(reportUnitSheetName-1);
+    }
+
+    public Integer getReportUnitRowName() {
+        return reportUnitRow+1;
+    }
+
+    public void setReportUnitRowName(Integer reportUnitRowName) {
+        this.reportUnitRowName = reportUnitRowName;
+        setReportUnitRow(reportUnitRowName-1);
+    }
+
+    public String getReportUnitCellName() {
+        return ExcelUtil.indexToColName(reportUnitCell);
+    }
+
+    public void setReportUnitCellName(String reportUnitCellName) {
+        this.reportUnitCellName = reportUnitCellName;
+        setReportUnitCell(ExcelUtil.colNameToIndex(reportUnitCellName));
+    }
+
     // 单元格样式类型
     private String unitStyleType;
     // 计算过程类型

+ 6 - 6
Procedure/frontend/projectb/src/pages/product/report_form_config_reportcreater/reportfillingconfig.tsx

@@ -305,7 +305,7 @@ const analyseFile = async (data: ReportDefinitionModel) => {
     },
     {
       title: '所在sheet页位置',
-      dataIndex: 'reportUnitSheet',
+      dataIndex: 'reportUnitSheetName',
       hideInTable: false,
       width:150,
       ellipsis:true,
@@ -319,7 +319,7 @@ const analyseFile = async (data: ReportDefinitionModel) => {
     },
     {
       title: '所在行位置',
-      dataIndex: 'reportUnitRow',
+      dataIndex: 'reportUnitRowName',
       search: false,
       hideInTable: false,
       width:150,
@@ -334,7 +334,7 @@ const analyseFile = async (data: ReportDefinitionModel) => {
     },
     {
       title: '所在列位置',
-      dataIndex: 'reportUnitCell',
+      dataIndex: 'reportUnitCellName',
       search: false,
       hideInTable: false,
       width:150,
@@ -473,7 +473,7 @@ const analyseFile = async (data: ReportDefinitionModel) => {
     },
     {
       title: '所在sheet页位置',
-      dataIndex: 'reportUnitSheet',
+      dataIndex: 'reportUnitSheetName',
       hideInTable: false,
       formItemProps:{
         rules:[
@@ -483,7 +483,7 @@ const analyseFile = async (data: ReportDefinitionModel) => {
     },
     {
       title: '所在行位置',
-      dataIndex: 'reportUnitRow',
+      dataIndex: 'reportUnitRowName',
       search: false,
       hideInTable: false,
       formItemProps:{
@@ -494,7 +494,7 @@ const analyseFile = async (data: ReportDefinitionModel) => {
     },
     {
       title: '所在列位置',
-      dataIndex: 'reportUnitCell',
+      dataIndex: 'reportUnitCellName',
       search: false,
       hideInTable: false,
       formItemProps:{

+ 3 - 0
Procedure/frontend/projectb/src/services/rwa/product/report_form_config_reportcreater/reportfillingconfig.ts

@@ -71,6 +71,9 @@ export type ReportDefinitionModel = {
     isHasurl?: string;
     // Excel公式
     excelFormula?: string;
+    reportUnitSheetName?:string;
+    reportUnitRowName?:string;
+    reportUnitCellName?:string;
   } & BasePageModel;