feat: 国标外标模板下载多余字段去除
This commit is contained in:
+17
@@ -1334,6 +1334,22 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 去除国标导入逻辑不需要显示的字段
|
||||
if (TableNameEnum.DOMESTIC_REGULATIONS.getTableName().equals(tableName)) {
|
||||
fieldList = fieldList.stream()
|
||||
.filter(lawsTag -> !lawsTag.getDbFieldName().equals(FieldCommon.STANDARD_CLASS))
|
||||
.filter(lawsTag -> !lawsTag.getDbFieldName().equals(FieldCommon.YEAR_NUMBER))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 去除外标导入逻辑不需要显示的字段
|
||||
if (TableNameEnum.FOREIGN_REGULATIONS.getTableName().equals(tableName)) {
|
||||
fieldList = fieldList.stream()
|
||||
.filter(lawsTag -> !lawsTag.getDbFieldName().equals(FieldCommon.STANDARD_CLASS))
|
||||
.filter(lawsTag -> !lawsTag.getDbFieldName().equals(FieldCommon.YEAR_NUMBER))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// 创建一个Excel工作簿
|
||||
Workbook workbook = this.createWorkBookWithLawsTags(fieldList);
|
||||
|
||||
@@ -1474,6 +1490,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
|
||||
LawsTag tag = headerMap.get(cell.toString().replace("*", ""));
|
||||
if (tag == null && !cell.toString().equals("稽查内容")) {
|
||||
FileUnZip.deleteDir(saveDirectory);
|
||||
log.error("找不到" + cell + "对应的字段");
|
||||
throw new JeroBootException(MessageUtils.getMessage(ResultCommon.IMPORT_TEMPLATE_ERROR));
|
||||
} else {
|
||||
headerList.add(tag);
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ public class LawsDomesticController {
|
||||
@ApiOperation(value="国内法规标准-导入", notes="国内法规标准-导入")
|
||||
@PostMapping("/importExcelWithData")
|
||||
public Result<?> importExcelWithData(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = lawsCommonService.importExcelWithData(file, TableNameEnum.ENTERPRISE_STANDARDS.getValue());
|
||||
List<String> errorMessages = lawsCommonService.importExcelWithData(file, TableNameEnum.DOMESTIC_REGULATIONS.getValue());
|
||||
if (errorMessages.size() > 0) {
|
||||
return Result.error(MessageUtils.getMessage(ResultCommon.IMPORT_ERROR), errorMessages);
|
||||
}
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@ public class LawsOverseasController {
|
||||
@ApiOperation(value="海外法规标准-导入", notes="海外法规标准-导入")
|
||||
@PostMapping("/importExcelWithData")
|
||||
public Result<?> importExcelWithData(@RequestParam("file") MultipartFile file) {
|
||||
List<String> errorMessages = lawsCommonService.importExcelWithData(file, TableNameEnum.ENTERPRISE_STANDARDS.getValue());
|
||||
List<String> errorMessages = lawsCommonService.importExcelWithData(file, TableNameEnum.FOREIGN_REGULATIONS.getValue());
|
||||
if (errorMessages.size() > 0) {
|
||||
return Result.error(ResultCommon.IMPORT_ERROR, errorMessages);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ spring:
|
||||
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000;druid.stat.logSlowSql\=true
|
||||
datasource:
|
||||
master:
|
||||
# url: jdbc:p6spy:mysql://10.10.10.44:3306/laws-sinotruk?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
# url: jdbc:p6spy:mysql://10.10.10.44:3306/laws-sinotruk-test?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
# username: root
|
||||
# password: hzwlsoft.com
|
||||
# driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||
@@ -160,14 +160,14 @@ spring:
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 多数据源配置
|
||||
#multi-datasource1:
|
||||
#url: jdbc:mysql://localhost:3306/jero-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
#username: root
|
||||
#password: root
|
||||
#driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/jero-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
|
||||
# username: root
|
||||
# password: root
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
#redis 配置
|
||||
redis:
|
||||
database: 11
|
||||
host: 121.36.69.172
|
||||
host: 127.0.0.1
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8 #最大连接数据库连接数,设 0 为没有限制
|
||||
@@ -175,8 +175,7 @@ spring:
|
||||
max-wait: -1ms #最大建立连接等待时间。如果超过此时间将接到异常。设为-1表示无限制。
|
||||
min-idle: 0 #最小等待连接中的数量,设 0 为没有限制
|
||||
shutdown-timeout: 100ms
|
||||
password: hzwlsoft.com
|
||||
port: 4780
|
||||
|
||||
#rabbitmq 配置
|
||||
rabbitmq:
|
||||
host: 121.36.69.172
|
||||
@@ -303,13 +302,12 @@ jero:
|
||||
# 文件限制后缀黑名单
|
||||
fileSuffixLimits : 0x00,%00,\\00,.jsp,.exe,.php,.asp,.aspx,.jspx,.xml,.html,.js,.sh,.bin,$DATA
|
||||
# 跨站白名单
|
||||
whiteUrls: localhost:3334,localhost:8184
|
||||
# xss白名单
|
||||
whiteUrls: localhost:62345,localhost:8184,localhost:3334,localhost:3435,localhost:3408
|
||||
xssExcludedPages: /login,/updatePassword
|
||||
# cors白名单
|
||||
notFilter:
|
||||
# origin地址
|
||||
originIp: http://localhost:3334,http://localhost:8184
|
||||
originIp: http://localhost:62345,http://localhost:8184,http://localhost:3334,http://localhost:3435,http://localhost:3408
|
||||
# 加密默认值
|
||||
password:
|
||||
pbe:
|
||||
|
||||
Reference in New Issue
Block a user