法规清单导入(模板数据,列表数据)
模板下载(字段名称)
This commit is contained in:
+8
-7
@@ -66,7 +66,7 @@ public class ProjectLawsInventoryEOEn implements Serializable {
|
||||
private String projectLibraryId;
|
||||
|
||||
/**编号*/
|
||||
@Excel(name = "Number", width = 20)
|
||||
@Excel(name = "*Number", width = 20)
|
||||
@ApiModelProperty(value = "编号")
|
||||
private String serialNumber;
|
||||
|
||||
@@ -116,13 +116,14 @@ public class ProjectLawsInventoryEOEn implements Serializable {
|
||||
private String implementType;
|
||||
|
||||
/**新车型实施日期*/
|
||||
@Excel(name = "New Type Execution Date", width = 30, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "新车型实施日期")
|
||||
private Date xin1Che1Xing2Shi2Shi1Ri4Qi1;
|
||||
|
||||
/**在产车实施日期*/
|
||||
@Excel(name = "New Vehicle Execute Date", width = 30, format = "yyyy-MM-dd")
|
||||
@Excel(name = "New Vehicle Execution Date", width = 30, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "在产车实施日期")
|
||||
@@ -135,7 +136,7 @@ public class ProjectLawsInventoryEOEn implements Serializable {
|
||||
private String attestationType;
|
||||
|
||||
/**认证级别*/
|
||||
@Excel(name = "Certification Level", width = 25,dicCode ="attestation_rank")
|
||||
@Excel(name = "*Certification Level", width = 25,dicCode ="attestation_rank")
|
||||
@ApiModelProperty(value = "认证级别")
|
||||
@Dict(dicCode ="attestation_rank")
|
||||
private String attestationRank;
|
||||
@@ -150,7 +151,7 @@ public class ProjectLawsInventoryEOEn implements Serializable {
|
||||
private String wvtaId;
|
||||
|
||||
/**责任领域*/
|
||||
@Excel(name = "Responsible Field", width = 25,dicCode ="duty_territory")
|
||||
@Excel(name = "*Responsible Field", width = 25,dicCode ="duty_territory")
|
||||
@ApiModelProperty(value = "责任领域")
|
||||
@Dict(dicCode ="duty_territory")
|
||||
private String dutyTerritory;
|
||||
@@ -212,7 +213,7 @@ public class ProjectLawsInventoryEOEn implements Serializable {
|
||||
private String designInitiatorId;
|
||||
|
||||
/**设计符合性确认-发起人名称*/
|
||||
@Excel(name = "Initiator", width = 25,groupName = "Design Compliance Check")
|
||||
@Excel(name = "Reviewer", width = 25,groupName = "Design Compliance Check")
|
||||
@TableField(exist = false)
|
||||
private String designInitiatorName;
|
||||
|
||||
@@ -268,7 +269,7 @@ public class ProjectLawsInventoryEOEn implements Serializable {
|
||||
private String prehomoInitiatorId;
|
||||
|
||||
/**prehomo确认-发起人名称*/
|
||||
@Excel(name = "Initiator", width = 25,groupName = "Pre-homo Check")
|
||||
@Excel(name = "Reviewer", width = 25,groupName = "Pre-homo Check")
|
||||
@TableField(exist = false)
|
||||
private String prehomoInitiatorName;
|
||||
|
||||
@@ -324,7 +325,7 @@ public class ProjectLawsInventoryEOEn implements Serializable {
|
||||
private String verifyInitiatorId;
|
||||
|
||||
/**验证符合性确认-发起人名称*/
|
||||
@Excel(name = "Initiator", width = 25,groupName = "Validation Compliance Check")
|
||||
@Excel(name = "Reviewer", width = 25,groupName = "Validation Compliance Check")
|
||||
@TableField(exist = false)
|
||||
private String verifyInitiatorName;
|
||||
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.jero.modules.project.enums;
|
||||
|
||||
/**
|
||||
* @description
|
||||
* @date 2022/9/14 16:09
|
||||
* @auth zhn
|
||||
*/
|
||||
public enum DataSourceEnum {
|
||||
TEMPLATE_DATA("模板数据","1"),
|
||||
LIST_DATA("列表数据","2");
|
||||
String name;
|
||||
String value;
|
||||
|
||||
DataSourceEnum(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
+9
@@ -57,5 +57,14 @@ public enum InventoryAffirmStatusEnum {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static String getTextByName(String name) {
|
||||
InventoryAffirmStatusEnum[] values = values();
|
||||
for (InventoryAffirmStatusEnum inventoryAffirmStatusEnum : values) {
|
||||
if (inventoryAffirmStatusEnum.name.equals(name)) {
|
||||
return inventoryAffirmStatusEnum.value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+9
@@ -53,5 +53,14 @@ public enum TaskAffirmStatusEnum {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static String getTextByName(String name) {
|
||||
TaskAffirmStatusEnum[] values = values();
|
||||
for (TaskAffirmStatusEnum taskAffirmStatusEnum : values) {
|
||||
if (taskAffirmStatusEnum.name.equals(name)) {
|
||||
return taskAffirmStatusEnum.value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1333
-201
File diff suppressed because it is too large
Load Diff
+64
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.split.common;
|
||||
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.xkcoding.http.util.StringUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.tools.zip.ZipEntry;
|
||||
@@ -169,6 +170,69 @@ public class FileUnZip {
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件名称读取固定目录下文件
|
||||
* 适用范围:filename内容 dir/file
|
||||
* gaoyan
|
||||
* @param filename
|
||||
*/
|
||||
public static List<File> readFileByFilenameDataList(String path,
|
||||
String filename,
|
||||
String cut,
|
||||
String errorMsg,
|
||||
List<String> msgList,
|
||||
String nameCn,
|
||||
String nameEn,
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO) {
|
||||
//法规清单列表数据导入的时候,交付物模板字段为文件属性,填写时需要在本文件同级目录下以标准号为名称建立文件夹,并在文件夹下放置文件,假设在AAA标准号下放置了B.docx,则应填写AAA/B.docx
|
||||
filename = projectLawsInventoryEO.getSerialNumber()+"/"+filename;
|
||||
String filenameOne = "";
|
||||
String filenameTwo = "";
|
||||
if(filename.contains("/")){
|
||||
filenameOne = filename.split("/")[0];
|
||||
filenameTwo = filename.split("/")[1];
|
||||
}
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (StringUtil.isNotEmpty(path)){
|
||||
File file = new File(path);
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
if(fi.isDirectory()){
|
||||
File[] filesTemp = fi.listFiles();
|
||||
for (File fileTemp : filesTemp) {
|
||||
// 对文件进行过滤
|
||||
if (fileTemp.getName().equals(filenameTwo) && fi.getName().equals(filenameOne) && StringUtils.isNotBlank(filenameOne)) {
|
||||
resultlist.add(fileTemp);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// 对文件进行过滤
|
||||
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;
|
||||
}
|
||||
/**
|
||||
* 根据文件名称读取固定目录下文件
|
||||
* 适用范围:filename内容 dir/file
|
||||
|
||||
Reference in New Issue
Block a user