Browse Source

4月30日

zhuwei 1 năm trước cách đây
mục cha
commit
91699542eb

+ 32 - 1
pom.xml

@@ -10,7 +10,7 @@
     <version>4.0.1.RELEASE</version>
 
     <properties>
-        <bladex.project.id>blade-api</bladex.project.id>
+        <bladex.project.id>blade-api-${env}</bladex.project.id>
         <bladex.project.version>4.0.1.RELEASE</bladex.project.version>
 
         <java.version>17</java.version>
@@ -115,6 +115,15 @@
             <artifactId>blade-core-test</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.poi</groupId>
+            <artifactId>poi-ooxml</artifactId>
+        </dependency>
+
         <!-- 报表 -->
         <dependency>
             <groupId>org.springblade</groupId>
@@ -311,6 +320,28 @@
         </plugins>
     </build>
 
+    <!-- 添加环境配置打包配置 -->
+    <profiles>
+        <profile>
+            <id>dev</id>
+            <properties>
+                <env>dev</env>
+            </properties>
+        </profile>
+        <profile>
+            <id>prod</id>
+            <properties>
+                <env>prod</env>
+            </properties>
+        </profile>
+        <profile>
+            <id>test</id>
+            <properties>
+                <env>test</env>
+            </properties>
+        </profile>
+    </profiles>
+
     <repositories>
         <repository>
             <id>aliyun-repos</id>

+ 104 - 11
src/main/java/org/springblade/modules/project/controller/WorkFocusController.java

@@ -39,9 +39,12 @@ import org.springblade.core.secure.annotation.PreAuth;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.core.tool.utils.StringUtil;
 import org.springblade.modules.project.pojo.entity.WorkFocusProgressEntity;
 import org.springblade.modules.project.pojo.excel.WorkFocusExcel;
+import org.springblade.modules.project.pojo.excel.WorkFocusExcel2;
 import org.springblade.modules.project.pojo.excel.WorkFocusImporter;
 import org.springblade.modules.project.pojo.vo.WorkFocusDataInfoVO;
 import org.springblade.modules.project.pojo.vo.WorkFocusListVO;
@@ -189,21 +192,14 @@ public class WorkFocusController extends BladeController {
 				Integer endYear = workFocusEntity.getEndYear();
 				for(int i = startYear ; i <= endYear ; i++){
 					List<WorkFocusProgressEntity> list = new ArrayList<>();
-
-					for(int j=1 ; j <=16 ; j++){
+					for(int j=1 ; j <=14 ; j++){
 						WorkFocusProgressEntity workFocusProgress = new WorkFocusProgressVO();
 						workFocusProgress.setYear(i);
 						workFocusProgress.setWorkFocusId(workFocusEntity.getId());
 						workFocusProgress.setMonth(j);
 						if(j==13){
-							workFocusProgress.setSchedule("problemInfo");
-						}
-						if(j==14){
-							workFocusProgress.setSchedule("workSug");
-						}
-						if(j==15){
 							workFocusProgress.setSchedule("unitInfo");
-						}if(j==16){
+						}if(j==14){
 							workFocusProgress.setSchedule("linkInfo");
 						}
 						list.add(workFocusProgress);
@@ -235,8 +231,105 @@ public class WorkFocusController extends BladeController {
 	@ApiOperationSupport(order = 12)
 	@Operation(summary = "导入工作要点", description  = "导出模板")
 	public R importUser(MultipartFile file, Integer isCovered) {
-		WorkFocusImporter userImporter = new WorkFocusImporter(workfocusService, 1 == 1);
-		ExcelUtil.save(file, userImporter, WorkFocusExcel.class);
+		List<WorkFocusExcel2> read = ExcelUtil.read(file, 0, 0, WorkFocusExcel2.class);
+
+		int moth = 0;
+		int year = 0;
+		Integer maxId = 1;
+		List<WorkFocusEntity> workFocus = new ArrayList<>();
+		List<WorkFocusProgressEntity> workFocusProgressEntities = new ArrayList<>();
+		WorkFocusListVO workFocusListVO = new WorkFocusListVO();
+		for (int i = 0; i < read.size(); i++) {
+			WorkFocusExcel2 readInfo = read.get(i);
+			String dataNo = readInfo.getDataNo();
+			if(dataNo.indexOf("、")>=0){
+				String node= dataNo.substring(0,dataNo.indexOf("、"));
+				if(node.equals("一")){
+					maxId=1;
+				}
+				if(node.equals("二")){
+					maxId=2;
+				}
+				if(node.equals("三")){
+					maxId=3;
+				}
+				if(node.equals("四")){
+					maxId=4;
+				}
+				if(node.equals("五")){
+					maxId=5;
+				}
+				if(node.equals("六")){
+					maxId=6;
+				}
+				if(node.equals("七")){
+					maxId=7;
+				}
+				if(node.equals("八")){
+					maxId=8;
+				}
+
+			}else {
+				if (i < 2) {
+					if (dataNo.indexOf("年") >= 0 && dataNo.indexOf("月") >= 0) {
+						String moth2 = dataNo.substring(dataNo.indexOf("年") + 1, dataNo.indexOf("月"));
+						moth = Func.toInt(moth2);
+					}
+					if (dataNo.indexOf("交通强市建设") >= 0 && dataNo.indexOf("月") >= 0) {
+						String year2 = dataNo.substring(dataNo.indexOf("交通强市建设") + 6, dataNo.indexOf("年"));
+						year = Func.toInt(year2);
+					}
+				} else {
+
+					WorkFocusEntity region = BeanUtil.copyProperties(readInfo, WorkFocusEntity.class);
+					WorkFocusProgressEntity workFocusProgress = BeanUtil.copyProperties(readInfo, WorkFocusProgressEntity.class);
+
+					workFocusProgress.setYear(year);
+					workFocusProgress.setMonth(moth);
+					region.setWorkFocusStage(maxId);
+					if(Func.isNotEmpty(readInfo.getStartYear())){
+						region.setStartYear(Func.toInt(readInfo.getStartYear()));
+					}
+					if(Func.isNotEmpty(readInfo.getEndYear())){
+						region.setEndYear(Func.toInt(readInfo.getEndYear()));
+					}
+					if(Func.isNotEmpty(readInfo.getEndYear()) && Func.isNotEmpty(readInfo.getEndYear())){
+
+						workfocusService.saveOrUpdate(region);
+						// 添加进度信息
+						Integer startYear = region.getStartYear();
+						Integer endYear = region.getEndYear();
+						for(int k = startYear ; k <= endYear ; k++){
+							List<WorkFocusProgressEntity> list = new ArrayList<>();
+
+							for(int j=1 ; j <=14 ; j++){
+								WorkFocusProgressEntity workFocusProgr = new WorkFocusProgressVO();
+								if(year==k && moth==j){
+									workFocusProgr = workFocusProgress;
+								}else{
+									workFocusProgr.setYear(k);
+									workFocusProgr.setMonth(j);
+								}
+								workFocusProgr.setWorkFocusId(region.getId());
+								if(j==13){
+									workFocusProgr.setSchedule("unitInfo");
+									if(k==year){
+										workFocusProgr.setProgress(workFocusProgress.getUnitInfo());
+									}
+								}if(j==14){
+									workFocusProgr.setSchedule("linkInfo");
+									if(k==year) {
+										workFocusProgr.setProgress(workFocusProgress.getLinkInfo());
+									}
+								}
+								list.add(workFocusProgr);
+							}
+							workFocusProgressService.saveOrUpdateBatch(list);
+						}
+					}
+				}
+			}
+		}
 		return R.success("操作成功");
 	}
 

+ 4 - 10
src/main/java/org/springblade/modules/project/controller/WorkFocusProgressController.java

@@ -181,21 +181,15 @@ public class WorkFocusProgressController extends BladeController {
 				for(WorkFocusProgressInfoVO workFocusProgressInfoVO:table){
 					List<WorkFocusProgressEntity> data = workFocusProgressInfoVO.getData();
 					workFocusProgressService.saveOrUpdateBatch(data);
-					String problemInfo = workFocusProgressInfoVO.getProblemInfo();
-					String workSug = workFocusProgressInfoVO.getWorkSug();
+					/*String problemInfo = workFocusProgressInfoVO.getProblemInfo();
+					String workSug = workFocusProgressInfoVO.getWorkSug();*/
 					String unitInfo = workFocusProgressInfoVO.getUnitInfo();
 					String linkInfo = workFocusProgressInfoVO.getLinkInfo();
-					if(Func.isNotEmpty(problemInfo)){
-						jdbcTemplate.update("update d_work_focus_progress set progress='"+workFocusProgressInfoVO.getProblemInfo()+"' where year='"+workFocusProgressInfoVO.getYear()+"' and month=13");
-					}
-					if(Func.isNotEmpty(workSug)) {
-						jdbcTemplate.update("update d_work_focus_progress set progress='"+workFocusProgressInfoVO.getWorkSug()+"' where year='"+workFocusProgressInfoVO.getYear()+"' and month=14");
-					}
 					if(Func.isNotEmpty(unitInfo)) {
-						jdbcTemplate.update("update d_work_focus_progress set progress='"+workFocusProgressInfoVO.getUnitInfo()+"' where year='"+workFocusProgressInfoVO.getYear()+"' and month=15");
+						jdbcTemplate.update("update d_work_focus_progress set progress='"+workFocusProgressInfoVO.getUnitInfo()+"' where year='"+workFocusProgressInfoVO.getYear()+"' and month=13");
 					}
 					if(Func.isNotEmpty(linkInfo)) {
-						jdbcTemplate.update("update d_work_focus_progress set progress='"+workFocusProgressInfoVO.getLinkInfo()+"' where year='"+workFocusProgressInfoVO.getYear()+"' and month=16");
+						jdbcTemplate.update("update d_work_focus_progress set progress='"+workFocusProgressInfoVO.getLinkInfo()+"' where year='"+workFocusProgressInfoVO.getYear()+"' and month=14");
 					}
 				}
 			}

+ 1 - 1
src/main/java/org/springblade/modules/project/mapper/WorkFocusMapper.xml

@@ -67,7 +67,7 @@
     </select>
 
     <select id="queryWorkFocusDataInfo" resultType="org.springblade.modules.project.pojo.vo.WorkFocusProgressDataInfoVO">
-        SELECT id,
+        SELECT DISTINCT id,
                (SELECT dict_value from blade_dict_biz where code='workFocusStage' and is_deleted=0 and dict_key=b.work_focus_stage) as workFocusStageName,
                target_plan,work_plan,duty_unit,
                a.month1,a.month2,a.month3,a.month4,a.month5,a.month6,a.month7,a.month8,a.month9,a.month10,a.month11,a.month12

+ 24 - 0
src/main/java/org/springblade/modules/project/pojo/entity/WorkFocusProgressEntity.java

@@ -76,4 +76,28 @@ public class WorkFocusProgressEntity extends TenantEntity {
 	@Schema(description = "序号")
 	private Integer sort;
 
+	/**
+	 * 累计进度
+	 */
+	@Schema(description = "存在问题")
+	private String problemInfo;
+
+	/**
+	 * 累计进度
+	 */
+	@Schema(description = "工作建议")
+	private String workSug;
+
+	/**
+	 * 累计进度
+	 */
+	@Schema(description = "填报单位")
+	private String unitInfo;
+
+	/**
+	 * 累计进度
+	 */
+	@Schema(description = "联系人及联系方式")
+	private String linkInfo;
+
 }

+ 10 - 6
src/main/java/org/springblade/modules/project/pojo/excel/WorkFocusExcel.java

@@ -51,18 +51,22 @@ public class WorkFocusExcel implements Serializable {
 	@Serial
 	private static final long serialVersionUID = 1L;
 
-	/**
-	 * 工作要点阶段
-	 */
-	@ColumnWidth(20)
-	@ExcelProperty("工作要点阶段")
-	private Integer workFocusStage;
+
 	/**
 	 * 目标任务
 	 */
 	@ColumnWidth(20)
 	@ExcelProperty("目标任务")
 	private String targetPlan;
+
+
+	/**
+	 * 工作要点阶段
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("工作内容")
+	private String workFocusStage;
+
 	/**
 	 * 开始年份
 	 */

+ 134 - 0
src/main/java/org/springblade/modules/project/pojo/excel/WorkFocusExcel2.java

@@ -0,0 +1,134 @@
+/**
+ * BladeX Commercial License Agreement
+ * Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
+ * <p>
+ * Use of this software is governed by the Commercial License Agreement
+ * obtained after purchasing a license from BladeX.
+ * <p>
+ * 1. This software is for development use only under a valid license
+ * from BladeX.
+ * <p>
+ * 2. Redistribution of this software's source code to any third party
+ * without a commercial license is strictly prohibited.
+ * <p>
+ * 3. Licensees may copyright their own code but cannot use segments
+ * from this software for such purposes. Copyright of this software
+ * remains with BladeX.
+ * <p>
+ * Using this software signifies agreement to this License, and the software
+ * must not be used for illegal purposes.
+ * <p>
+ * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
+ * not liable for any claims arising from secondary or illegal development.
+ * <p>
+ * Author: Chill Zhuang (bladejava@qq.com)
+ */
+package org.springblade.modules.project.pojo.excel;
+
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+
+/**
+ * 附件表 Excel实体类
+ *
+ * @author BladeX
+ * @since 2024-04-09
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class WorkFocusExcel2 implements Serializable {
+
+	@Serial
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 目标任务
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("序号")
+	private String dataNo;
+
+	/**
+	 * 目标任务
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("目标任务")
+	private String targetPlan;
+
+	/**
+	 * 工作要点阶段
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("工作内容")
+	private String workPlan;
+
+	/**
+	 * 结束年份
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("开始年份")
+	private String startYear;
+
+
+	/**
+	 * 结束年份
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("结束年份")
+	private String endYear;
+
+
+	/**
+	 * 责任单位
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("责任单位")
+	private String dutyUnit;
+
+	/**
+	 * 责任单位
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("累计进展情况")
+	private String progress;
+
+
+	/**
+	 * 责任单位
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("存在问题")
+	private String problemInfo;
+
+	/**
+	 * 责任单位
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("工作建议")
+	private String workSug;
+
+	/**
+	 * 责任单位
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("填报人")
+	private String unitInfo;
+
+	/**
+	 * 责任单位
+	 */
+	@ColumnWidth(20)
+	@ExcelProperty("联系方式")
+	private String linkInfo;
+
+}

+ 2 - 2
src/main/java/org/springblade/modules/project/pojo/excel/WorkFocusImporter.java

@@ -28,13 +28,13 @@ import java.util.List;
  * @author Chill
  */
 @RequiredArgsConstructor
-public class WorkFocusImporter implements ExcelImporter<WorkFocusExcel> {
+public class WorkFocusImporter implements ExcelImporter<WorkFocusExcel2> {
 
     private final IWorkFocusService service;
     private final Boolean isCovered;
 
     @Override
-    public void save(List<WorkFocusExcel> data) {
+    public void save(List<WorkFocusExcel2> data) {
         service.importWorkFocus(data, isCovered);
     }
 }

+ 2 - 1
src/main/java/org/springblade/modules/project/service/IWorkFocusService.java

@@ -27,6 +27,7 @@ package org.springblade.modules.project.service;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import org.springblade.modules.project.pojo.excel.WorkFocusExcel;
 import org.springblade.modules.project.pojo.entity.WorkFocusEntity;
+import org.springblade.modules.project.pojo.excel.WorkFocusExcel2;
 import org.springblade.modules.project.pojo.vo.WorkFocusDataInfoVO;
 import org.springblade.modules.project.pojo.vo.WorkFocusVO;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -57,7 +58,7 @@ public interface IWorkFocusService extends BaseService<WorkFocusEntity> {
 	 */
 	List<WorkFocusExcel> exportWorkFocus(Wrapper<WorkFocusEntity> queryWrapper);
 
-	void importWorkFocus(List<WorkFocusExcel> data,Boolean isCovered);
+	void importWorkFocus(List<WorkFocusExcel2> data, Boolean isCovered);
 
 	//工作重点查询
 	WorkFocusDataInfoVO queryWorkFocusDataInfo(WorkFocusVO workfocus);

+ 4 - 3
src/main/java/org/springblade/modules/project/service/impl/WorkFocusProgressServiceImpl.java

@@ -86,13 +86,14 @@ public class WorkFocusProgressServiceImpl extends BaseServiceImpl<WorkFocusProgr
 			WorkFocusProgressInfoVO progressInfoVO = new WorkFocusProgressInfoVO();
 			progressInfoVO.setYear(kekys+"");
 			for(WorkFocusProgressEntity workFocusProgres:table){
-				if(StringUtils.isNotEmpty(workFocusProgres.getSchedule()) && workFocusProgres.getSchedule().equals("problemInfo") && workFocusProgres.getMonth()==13){ //
+				/*if(StringUtils.isNotEmpty(workFocusProgres.getSchedule()) && workFocusProgres.getSchedule().equals("problemInfo") && workFocusProgres.getMonth()==13){ //
 					progressInfoVO.setProblemInfo(workFocusProgres.getProgress());
 				}else if(StringUtils.isNotEmpty(workFocusProgres.getSchedule()) && workFocusProgres.getSchedule().equals("workSug") && workFocusProgres.getMonth()==14){ //
 					progressInfoVO.setWorkSug(workFocusProgres.getProgress());
-				}else if(StringUtils.isNotEmpty(workFocusProgres.getSchedule()) && workFocusProgres.getSchedule().equals("unitInfo") && workFocusProgres.getMonth()==15){ //
+				}else */
+				if(StringUtils.isNotEmpty(workFocusProgres.getSchedule()) && workFocusProgres.getSchedule().equals("unitInfo") && workFocusProgres.getMonth()==13){ //
 					progressInfoVO.setUnitInfo(workFocusProgres.getProgress());
-				}else if(StringUtils.isNotEmpty(workFocusProgres.getSchedule()) && workFocusProgres.getSchedule().equals("linkInfo") && workFocusProgres.getMonth()==16){ //
+				}else if(StringUtils.isNotEmpty(workFocusProgres.getSchedule()) && workFocusProgres.getSchedule().equals("linkInfo") && workFocusProgres.getMonth()==14){ //
 					progressInfoVO.setLinkInfo(workFocusProgres.getProgress());
 				}else{
 					table2.add(workFocusProgres);

+ 7 - 4
src/main/java/org/springblade/modules/project/service/impl/WorkFocusServiceImpl.java

@@ -32,6 +32,7 @@ import org.springblade.core.tool.utils.DateUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.modules.project.pojo.excel.WorkFocusExcel;
 import org.springblade.modules.project.pojo.entity.WorkFocusEntity;
+import org.springblade.modules.project.pojo.excel.WorkFocusExcel2;
 import org.springblade.modules.project.pojo.vo.WorkFocusDataInfoVO;
 import org.springblade.modules.project.pojo.vo.WorkFocusProgressDataInfoVO;
 import org.springblade.modules.project.pojo.vo.WorkFocusVO;
@@ -75,18 +76,20 @@ public class WorkFocusServiceImpl extends BaseServiceImpl<WorkFocusMapper, WorkF
 	}
 
 	@Override
-	public void importWorkFocus(List<WorkFocusExcel> data, Boolean isCovered) {
+	public void importWorkFocus(List<WorkFocusExcel2> data, Boolean isCovered) {
 		List<WorkFocusEntity> list = new ArrayList<>();
+
 		data.forEach(regionExcel -> {
-			//WorkFocusEntity region = BeanUtil.copy(regionExcel, WorkFocusEntity.class);
 			WorkFocusEntity region = BeanUtil.copyProperties(regionExcel, WorkFocusEntity.class);
 			list.add(region);
 		});
-		if (isCovered) {
+
+
+		/*if (isCovered) {
 			this.saveOrUpdateBatch(list);
 		} else {
 			this.saveBatch(list);
-		}
+		}*/
 	}
 
 	@Override

+ 103 - 0
src/main/java/org/springblade/modules/project/utils/ExcelUtils2.java

@@ -0,0 +1,103 @@
+package org.springblade.modules.project.utils;
+
+import org.apache.poi.ss.usermodel.*;
+import software.amazon.ion.util.IonStreamUtils;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+public class ExcelUtils2 {
+
+
+    public static void main(String[] args) throws Exception {
+
+        FileInputStream da = new FileInputStream(new File("/Users/hongchuangyanfa/Desktop/excel/交通强市建设2024年工作要点.xlsx"));
+        List<String> titles = new ArrayList<>();
+        titles.add("序号");
+        titles.add("目标任务");
+        titles.add("工作内容");
+        titles.add("责任单位");
+        titles.add("累计进展情况");
+        titles.add("存在问题");
+        titles.add("工作建议");
+        titles.add("填报人");
+        titles.add("联系方式");
+        List<Map<String, String>>  data =  readExcel(da,titles);
+        System.out.println(data.size());
+
+    }
+    /**
+     * 读取 Excel 文件中指定范围内的数据,并封装为 List 返回。
+     *
+     * @return List<Map < String, Object>> 包含读取到的数据的 List
+     * @throws IOException
+     */
+    public static List<Map<String, String>> readExcel(InputStream is, List<String> titles) throws Exception {
+        Workbook workbook = WorkbookFactory.create(is);
+        Sheet sheet = workbook.getSheetAt(0);
+        if (sheet == null) {
+            throw new IllegalArgumentException("Excel 文件中没有 Sheet");
+        }
+
+        int firstRowIndex = sheet.getFirstRowNum();  //获取第一行的行号
+        int lastRowIndex = sheet.getLastRowNum();    //获取最后一行的行号
+
+        Row firstRow = sheet.getRow(firstRowIndex); // 获取第一行
+        int firstColIndex = firstRow.getFirstCellNum();   //获取第一列的列号
+        int lastColIndex = firstRow.getLastCellNum() - 1; //获取最后一列的列号
+
+        for (int j = firstColIndex; j <= lastColIndex; j++) {
+            Cell cell = firstRow.getCell(j);
+            if (cell != null) {
+                cell.setCellType(CellType.STRING);
+                String title = cell.getStringCellValue().trim();
+                titles.add(title);
+            }
+        }
+
+        List<Map<String, String>> list = new ArrayList<>();
+        for (int i = firstRowIndex + 1; i <= lastRowIndex; i++) {
+            Row row = sheet.getRow(i);
+            if (row == null) {
+                continue;
+            }
+
+            Map<String, String> map = new LinkedHashMap<>();
+            for (int j = firstColIndex; j <= lastColIndex; j++) {
+                Cell cell = row.getCell(j);
+                cell.setCellType(CellType.STRING);
+                String value = getCellValue(cell);
+                String key = titles.get(j - firstColIndex);
+                map.put(key, value);
+            }
+            list.add(map);
+        }
+
+        return list;
+    }
+
+
+    /**
+     * 获取单元格的值,并将其转换为字符串类型
+     */
+    private static String getCellValue(Cell cell) {
+        if (cell == null) {
+            return "";
+        }
+        if (cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
+            return String.valueOf(cell.getNumericCellValue());
+        } else if (cell.getCellTypeEnum().equals(CellType.STRING)) {
+            return String.valueOf(cell.getStringCellValue());
+        } else if (cell.getCellTypeEnum().equals(CellType.BOOLEAN)) {
+            return String.valueOf(cell.getBooleanCellValue());
+        } else {
+            return "";
+        }
+    }
+
+}
+
+

+ 5 - 0
src/main/java/org/springblade/modules/project/utils/ObjectUtils.java

@@ -35,4 +35,9 @@ public class ObjectUtils {
         // 所有字段都检查完毕且均为null,返回true
         return true;
     }
+
+    public static void main(String[] args) {
+
+
+    }
 }