年度制修订计划导入 修复问题
This commit is contained in:
+10
@@ -33,4 +33,14 @@ public enum ESPProjectType {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getValueByName(String name) {
|
||||||
|
for (ESPProjectType type : ESPProjectType.values()) {
|
||||||
|
if (type.getName().equals(name)) {
|
||||||
|
return type.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ESPProjectType.ENACT.getValue(); // 返回ENACT枚举值对应的value值
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -13,7 +13,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
|||||||
public class EnterpriseStandardPlanImport {
|
public class EnterpriseStandardPlanImport {
|
||||||
|
|
||||||
@Excel(name = "*制修订类型", width = 15, orderNum = "0")
|
@Excel(name = "*制修订类型", width = 15, orderNum = "0")
|
||||||
private String editType;
|
private String applicationCategory;
|
||||||
|
|
||||||
@Excel(name = "*原企标编号", width = 15, orderNum = "1")
|
@Excel(name = "*原企标编号", width = 15, orderNum = "1")
|
||||||
private String originEnStandardNo;
|
private String originEnStandardNo;
|
||||||
@@ -87,7 +87,7 @@ public class EnterpriseStandardPlanImport {
|
|||||||
* 判断是否是无用行
|
* 判断是否是无用行
|
||||||
*/
|
*/
|
||||||
public boolean isBlankRow() {
|
public boolean isBlankRow() {
|
||||||
return StringUtils.isBlank(editType) &&
|
return StringUtils.isBlank(applicationCategory) &&
|
||||||
StringUtils.isBlank(originEnStandardNo) &&
|
StringUtils.isBlank(originEnStandardNo) &&
|
||||||
StringUtils.isBlank(newEnStandardNo) &&
|
StringUtils.isBlank(newEnStandardNo) &&
|
||||||
StringUtils.isBlank(projectStatus) &&
|
StringUtils.isBlank(projectStatus) &&
|
||||||
@@ -99,7 +99,7 @@ public class EnterpriseStandardPlanImport {
|
|||||||
* 判断是否是无用行
|
* 判断是否是无用行
|
||||||
*/
|
*/
|
||||||
public boolean isUselessRow() {
|
public boolean isUselessRow() {
|
||||||
return !"制定".equals(editType) && !"修订".equals(editType);
|
return !"制定".equals(applicationCategory) && !"修订".equals(applicationCategory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -200,6 +200,7 @@ public class EnterpriseStandardPlanServiceImpl extends ServiceImpl<EnterpriseSta
|
|||||||
}
|
}
|
||||||
EnterpriseStandardPlan esp = new EnterpriseStandardPlan();
|
EnterpriseStandardPlan esp = new EnterpriseStandardPlan();
|
||||||
try {
|
try {
|
||||||
|
esp.setApplicationCategory(ESPProjectType.getValueByName(item.getApplicationCategory()));
|
||||||
esp.setOriginEnStandardNo(item.getOriginEnStandardNo());
|
esp.setOriginEnStandardNo(item.getOriginEnStandardNo());
|
||||||
esp.setNewEnStandardNo(item.getNewEnStandardNo());
|
esp.setNewEnStandardNo(item.getNewEnStandardNo());
|
||||||
esp.setProjectStatus(ESPProjectStatus.getValueByName(item.getProjectStatus()));
|
esp.setProjectStatus(ESPProjectStatus.getValueByName(item.getProjectStatus()));
|
||||||
@@ -208,6 +209,7 @@ public class EnterpriseStandardPlanServiceImpl extends ServiceImpl<EnterpriseSta
|
|||||||
esp.setEnStandardCode(item.getEnStandardCode());
|
esp.setEnStandardCode(item.getEnStandardCode());
|
||||||
esp.setEnNameCode(item.getEnNameCode());
|
esp.setEnNameCode(item.getEnNameCode());
|
||||||
esp.setStandardCategoryCode(item.getStandardCategoryCode());
|
esp.setStandardCategoryCode(item.getStandardCategoryCode());
|
||||||
|
esp.setDecadeCode(item.getNewEnStandardNo().substring(item.getNewEnStandardNo().length() - 4));
|
||||||
esp.setEnStandardSystem(importUtil.convertStandardSystem(item.getEnStandardSystem(), "3"));
|
esp.setEnStandardSystem(importUtil.convertStandardSystem(item.getEnStandardSystem(), "3"));
|
||||||
esp.setStandardType(excelUtils.translateDictValue("esp_standard_type", item.getStandardType(), listDict));
|
esp.setStandardType(excelUtils.translateDictValue("esp_standard_type", item.getStandardType(), listDict));
|
||||||
esp.setEnStandardClassification(item.getEnStandardClassification());
|
esp.setEnStandardClassification(item.getEnStandardClassification());
|
||||||
@@ -231,7 +233,7 @@ public class EnterpriseStandardPlanServiceImpl extends ServiceImpl<EnterpriseSta
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 制定的,拿新企标编号在企标表里查,查到的话要报错,不予导入,统计并反馈;查不到的,数据正常录入plan表
|
// 制定的,拿新企标编号在企标表里查,查到的话要报错,不予导入,统计并反馈;查不到的,数据正常录入plan表
|
||||||
if ("制定".equals(item.getEditType())) {
|
if ("制定".equals(item.getApplicationCategory())) {
|
||||||
ManyStandardSelectionBox singleStandard = lawsCommonService.getSingleStandard(esp.getNewEnStandardNo(), null);
|
ManyStandardSelectionBox singleStandard = lawsCommonService.getSingleStandard(esp.getNewEnStandardNo(), null);
|
||||||
if (ObjectUtils.isNotEmpty(singleStandard)) {
|
if (ObjectUtils.isNotEmpty(singleStandard)) {
|
||||||
// 查到的话要报错,不予导入,统计并反馈
|
// 查到的话要报错,不予导入,统计并反馈
|
||||||
@@ -246,7 +248,7 @@ public class EnterpriseStandardPlanServiceImpl extends ServiceImpl<EnterpriseSta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 修订的,拿旧企标编号在企标表里查,查不到的要报错,不予导入,统计并反馈;查得到的,数据正常录入plan表
|
// 修订的,拿旧企标编号在企标表里查,查不到的要报错,不予导入,统计并反馈;查得到的,数据正常录入plan表
|
||||||
if ("修订".equals(item.getEditType())) {
|
if ("修订".equals(item.getApplicationCategory())) {
|
||||||
ManyStandardSelectionBox singleStandard = lawsCommonService.getSingleStandard(esp.getOriginEnStandardNo(), null);
|
ManyStandardSelectionBox singleStandard = lawsCommonService.getSingleStandard(esp.getOriginEnStandardNo(), null);
|
||||||
if (ObjectUtils.isEmpty(singleStandard)) {
|
if (ObjectUtils.isEmpty(singleStandard)) {
|
||||||
//查不到的要报错,不予导入
|
//查不到的要报错,不予导入
|
||||||
|
|||||||
Reference in New Issue
Block a user