From 61b1672d8483db06f618469b2a71dffa1c03f210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Thu, 30 Mar 2023 00:23:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=8F=91OTA=E5=A4=87=E6=A1=88?= =?UTF-8?q?=E5=B7=A5=E5=85=B7-=E8=BD=A6=E8=BE=86=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/OtaBaSjSjyxpgServiceImpl.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjyxpgServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjyxpgServiceImpl.java index d60a46d82..be7d94fc9 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjyxpgServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaBaSjSjyxpgServiceImpl.java @@ -14,11 +14,17 @@ import com.jero.modules.ota.utils.ImportFileUtil; import com.jero.modules.system.service.ISysDictService; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.xwpf.usermodel.XWPFDocument; +import org.apache.poi.xwpf.usermodel.XWPFTable; +import org.apache.poi.xwpf.usermodel.XWPFTableCell; +import org.apache.poi.xwpf.usermodel.XWPFTableRow; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; import java.util.List; import java.util.Date; @@ -177,8 +183,24 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl tables = doc.getTables(); + String sjmdStr = tables.get(1).getRow(0).getCell(2).getText(); + if (StringUtils.isNotEmpty(sjmdStr)) { + StringBuilder sb = new StringBuilder(); + String[] strs = sjmdStr.split("、"); + for (int i = 0; i < strs.length; i++) { + if (i >= strs.length - 1) { + sb.append(sysDictService.queryDictItemByValue("uipgrade_purpose", strs[i], cut)); + } else { + sb.append(sysDictService.queryDictItemByValue("uipgrade_purpose", strs[i], cut)).append(","); + } + } + sjyxpg.setSjmd(sb.toString()); + } return sjyxpg; } @@ -186,7 +208,7 @@ public class OtaBaSjSjyxpgServiceImpl extends ServiceImpl upLoadFiles, String otaId, String cut) throws Exception { File upFile = null; for (File f : upLoadFiles) { - if (f.getName().equals("车型基本信息.xlsx")) { + if (f.getName().equals("升级影响评估.docx")) { upFile = f; } }