Merge remote-tracking branch 'origin/master'
This commit is contained in:
+1
-1
@@ -4342,7 +4342,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String fileName : value.split(",")) {
|
||||
List<File> nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName);
|
||||
List<File> nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName,cut,errorMsg,null,key,key);
|
||||
if (nowFileList.size() == 0) {
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
errorMsg += key + "压缩包中没有" + fileName + "文件; ";
|
||||
|
||||
+51
-18
@@ -856,6 +856,13 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
|
||||
}
|
||||
//编号
|
||||
String serialNumber = dummyInventoryInfoEO.getSerialNumber();
|
||||
//子标题
|
||||
String subtitle = dummyInventoryInfoEO.getSubtitle();
|
||||
//wvtaId
|
||||
String wvtaId = dummyInventoryInfoEO.getWvtaId();
|
||||
//备注remark
|
||||
String remark = dummyInventoryInfoEO.getRemark();
|
||||
|
||||
//认证级别
|
||||
String attestationRank = dummyInventoryInfoEO.getAttestationRank();
|
||||
//责任领域
|
||||
@@ -890,6 +897,43 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
|
||||
//编号(输入框必填)
|
||||
flag = must(dummyInventoryInfoEO, errorMsg, msgList, serialNumber, "编号", "serial number");
|
||||
|
||||
//子标题
|
||||
if(StringUtils.isNotBlank(subtitle)){
|
||||
if(subtitle.length() > 100){
|
||||
String message = "";
|
||||
if(CutEnum.CN.getValue().equals(dummyInventoryInfoEOTemp.getCut())){
|
||||
message = errorMsg + "子标题不能超过100个字符";
|
||||
}else{
|
||||
message = errorMsg + " Subheadings cannot be checked more than 100 characters";
|
||||
}
|
||||
msgList.add(message);
|
||||
}
|
||||
}
|
||||
//WVTA ID
|
||||
if(StringUtils.isNotBlank(wvtaId)){
|
||||
if(wvtaId.length() > 100){
|
||||
String message = "";
|
||||
if(CutEnum.CN.getValue().equals(dummyInventoryInfoEOTemp.getCut())){
|
||||
message = errorMsg + "WVTA ID不能超过100个字符";
|
||||
}else{
|
||||
message = errorMsg + " The WVTA ID cannot contain more than 100 characters";
|
||||
}
|
||||
msgList.add(message);
|
||||
}
|
||||
}
|
||||
//备注 remark
|
||||
if(StringUtils.isNotBlank(remark)){
|
||||
if(remark.length() > 300){
|
||||
String message = "";
|
||||
if(CutEnum.CN.getValue().equals(dummyInventoryInfoEOTemp.getCut())){
|
||||
message = errorMsg + "备注不能超过300个字符";
|
||||
}else{
|
||||
message = errorMsg + " Note The value cannot exceed 300 characters";
|
||||
}
|
||||
msgList.add(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//实施类别(单选不必填)
|
||||
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, implementType,msgList,"实施类别","implementation category","implement_type");
|
||||
@@ -897,17 +941,6 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
|
||||
dummyInventoryInfoEO.setImplementType(value);
|
||||
}
|
||||
|
||||
//新车实施日期 xin1Che1Xing2Shi2Shi1Ri4Qi1
|
||||
// flag = dateVerify(dummyInventoryInfoEO, errorMsg, xin1Che1Xing2Shi2Shi1Ri4Qi1,msgList,"新车实施日期","new car implementation date");
|
||||
// if(flag){
|
||||
// dummyInventoryInfoEO.setXin1Che1Xing2Shi2Shi1Ri4Qi1(xin1Che1Xing2Shi2Shi1Ri4Qi1);
|
||||
// }
|
||||
|
||||
//在产车实施日期 implementTime
|
||||
// flag = dateVerify(dummyInventoryInfoEO, errorMsg, implementTime,msgList,"在产车实施日期","on the production vehicle implementation date");
|
||||
// if(flag){
|
||||
// dummyInventoryInfoEO.setImplementTime(implementTime);
|
||||
// }
|
||||
//认证类型(单选不必填)
|
||||
value = pullSingle(dictItemList, dummyInventoryInfoEO, errorMsg, attestationType,msgList,"认证类型","certification type","attestation_type");
|
||||
if(StringUtils.isNotBlank(value)){
|
||||
@@ -1087,14 +1120,14 @@ public class DummyInventoryInfoEOServiceImpl extends ServiceImpl<DummyInventoryI
|
||||
if (StringUtils.isNotBlank(designDeliverableTemplate)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String fileName : designDeliverableTemplate.split(",")) {
|
||||
List<File> nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName);
|
||||
List<File> nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName,dummyInventoryInfoEO.getCut(),errorMsg,msgList,nameCn,nameEn);
|
||||
if (nowFileList.size() == 0) {
|
||||
if(CutEnum.CN.getValue().equals(dummyInventoryInfoEO.getCut())){
|
||||
errorMsg += "压缩包中没有" + fileName + "文件; ";
|
||||
}else{
|
||||
errorMsg += " Not in the zip package" + fileName + "file; ";
|
||||
}
|
||||
msgList.add(errorMsg);
|
||||
// if(CutEnum.CN.getValue().equals(dummyInventoryInfoEO.getCut())){
|
||||
// errorMsg += "压缩包中没有" + fileName + "文件; ";
|
||||
// }else{
|
||||
// errorMsg += " Not in the zip package" + fileName + "file; ";
|
||||
// }
|
||||
// msgList.add(errorMsg);
|
||||
} else {
|
||||
try {
|
||||
FileInputStream input = new FileInputStream(nowFileList.get(0));
|
||||
|
||||
+7
-7
@@ -2309,14 +2309,14 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
|
||||
if (StringUtils.isNotBlank(designDeliverableTemplate)) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String fileName : designDeliverableTemplate.split(",")) {
|
||||
List<File> nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName);
|
||||
List<File> nowFileList = FileUnZip.readFileByFilename(zipEntryName, fileName,projectLawsInventoryEO.getCut(),errorMsg,msgList,nameCn,nameEn);
|
||||
if (nowFileList.size() == 0) {
|
||||
if(CutEnum.CN.getValue().equals(projectLawsInventoryEO.getCut())){
|
||||
errorMsg += "压缩包中没有" + fileName + "文件; ";
|
||||
}else{
|
||||
errorMsg += " Not in the zip package" + fileName + "file; ";
|
||||
}
|
||||
msgList.add(errorMsg);
|
||||
// if(CutEnum.CN.getValue().equals(projectLawsInventoryEO.getCut())){
|
||||
// errorMsg += "压缩包中没有" + fileName + "文件; ";
|
||||
// }else{
|
||||
// errorMsg += " Not in the zip package" + fileName + "file; ";
|
||||
// }
|
||||
// msgList.add(errorMsg);
|
||||
} else {
|
||||
try {
|
||||
FileInputStream input = new FileInputStream(nowFileList.get(0));
|
||||
|
||||
+36
-6
@@ -1,12 +1,18 @@
|
||||
package com.jero.modules.split.common;
|
||||
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.xkcoding.http.util.StringUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.tools.zip.ZipEntry;
|
||||
import org.apache.tools.zip.ZipFile;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
@@ -114,9 +120,18 @@ public class FileUnZip {
|
||||
* gaoyan
|
||||
* @param filename
|
||||
*/
|
||||
public static List<File> readFileByFilename(String path,String filename) {
|
||||
public static List<File> readFileByFilename(String path,
|
||||
String filename,
|
||||
String cut,
|
||||
String errorMsg,
|
||||
List<String> msgList,
|
||||
String nameCn,
|
||||
String nameEn) {
|
||||
String filenameOne = "";
|
||||
String filenameTwo = "";
|
||||
if(filename.contains("/")){
|
||||
filename = filename.split("/")[1];
|
||||
filenameOne = filename.split("/")[0];
|
||||
filenameTwo = filename.split("/")[1];
|
||||
}
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (StringUtil.isNotEmpty(path)){
|
||||
@@ -128,20 +143,35 @@ public class FileUnZip {
|
||||
File[] filesTemp = fi.listFiles();
|
||||
for (File fileTemp : filesTemp) {
|
||||
// 对文件进行过滤
|
||||
if (fileTemp.getName().equals(filename)) {
|
||||
if (fileTemp.getName().equals(filenameTwo) && fileTemp.getPath().contains(filenameOne) && StringUtils.isNotBlank(filenameOne)) {
|
||||
resultlist.add(fileTemp);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// 对文件进行过滤
|
||||
if (fi.getName().equals(filename)) {
|
||||
if (fi.getName().equals(filenameTwo) && fi.getPath().contains(filenameOne) && StringUtils.isNotBlank(filenameOne)) {
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if(resultlist.size() == 0){
|
||||
String name = "";
|
||||
if(filename.contains("/")){
|
||||
name = filenameTwo;
|
||||
}else{
|
||||
name = filename;
|
||||
}
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
errorMsg += nameCn + name + "格式不正确或者压缩包中没有" + name + "文件,请参考模板下载中的说明";
|
||||
}else{
|
||||
errorMsg += nameEn + name + " Incorrect format or not present in compressed package " + name + " file please refer to the description in template download;";
|
||||
}
|
||||
if(msgList != null){
|
||||
msgList.add(errorMsg);
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
// public static List<File> readFileByFilename(String path,String filename) {
|
||||
|
||||
+4
-4
@@ -1217,7 +1217,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
}
|
||||
}
|
||||
}
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]);
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i],null,null,null,null,null);
|
||||
if (nowfilelist != null && !nowfilelist.isEmpty()) {
|
||||
String url = nowfilelist.get(0).getPath();
|
||||
MultipartFile multipartFile = createMfileByPath(url);
|
||||
@@ -1262,7 +1262,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
}
|
||||
}
|
||||
}
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]);
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i],null,null,null,null,null);
|
||||
if (nowfilelist != null && !nowfilelist.isEmpty()) {
|
||||
String url = nowfilelist.get(0).getPath();
|
||||
MultipartFile multipartFile = createMfileByPath(url);
|
||||
@@ -1311,7 +1311,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
}
|
||||
}
|
||||
}
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]);
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i],null,null,null,null,null);
|
||||
if (nowfilelist != null && !nowfilelist.isEmpty()) {
|
||||
String url = nowfilelist.get(0).getPath();
|
||||
MultipartFile multipartFile = createMfileByPath(url);
|
||||
@@ -2223,7 +2223,7 @@ public class FileSplitItemsEOServiceImpl extends ServiceImpl<FileSplitItemsEOMap
|
||||
StringBuilder sb = new StringBuilder();
|
||||
value = value.replace(",",",");
|
||||
for (String fileName : value.split(",")) {
|
||||
List<File> nowFileList = FileUnZip.readFileByFilename(filepath, fileName);
|
||||
List<File> nowFileList = FileUnZip.readFileByFilename(filepath, fileName,null,null,null,null,null);
|
||||
if (nowFileList.size() == 0) {
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += fieldName + "压缩包中没有" + fileName + "文件; ";
|
||||
|
||||
+3
-3
@@ -993,7 +993,7 @@ public class SarFileSplitItemsEOServiceImpl extends ServiceImpl<SarFileSplitItem
|
||||
}
|
||||
}
|
||||
}
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]);
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i],null,null,null,null,null);
|
||||
if (nowfilelist != null && !nowfilelist.isEmpty()) {
|
||||
OSSFile ossFile = new OSSFile();
|
||||
ossFile.setFileName(nowfilelist.get(0).getName());
|
||||
@@ -1030,7 +1030,7 @@ public class SarFileSplitItemsEOServiceImpl extends ServiceImpl<SarFileSplitItem
|
||||
}
|
||||
}
|
||||
}
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]);
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i],null,null,null,null,null);
|
||||
if (nowfilelist != null && !nowfilelist.isEmpty()) {
|
||||
OSSFile ossFile = new OSSFile();
|
||||
ossFile.setFileName(nowfilelist.get(0).getName());
|
||||
@@ -1069,7 +1069,7 @@ public class SarFileSplitItemsEOServiceImpl extends ServiceImpl<SarFileSplitItem
|
||||
}
|
||||
}
|
||||
}
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i]);
|
||||
List<File> nowfilelist = FileUnZip.readFileByFilename(filepath, valArr[i],null,null,null,null,null);
|
||||
if (nowfilelist != null && !nowfilelist.isEmpty()) {
|
||||
OSSFile ossFile = new OSSFile();
|
||||
ossFile.setFileName(nowfilelist.get(0).getName());
|
||||
|
||||
Reference in New Issue
Block a user