Merge remote-tracking branch 'origin/dev_20230216' into dev_20230216
This commit is contained in:
@@ -115,6 +115,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||||||
//企业标准导出
|
//企业标准导出
|
||||||
addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/exportSarBussionessStand");
|
addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/exportSarBussionessStand");
|
||||||
|
|
||||||
|
addInterceptor.excludePathPatterns("/api/lawss/sarFileSplitItems/importSplitItemsZip");
|
||||||
|
|
||||||
//预警导出
|
//预警导出
|
||||||
addInterceptor.excludePathPatterns("/api/sys/EarlyWarning/exportWarning");
|
addInterceptor.excludePathPatterns("/api/sys/EarlyWarning/exportWarning");
|
||||||
|
|
||||||
|
|||||||
+2
@@ -188,6 +188,8 @@ public class SarBussStandAttrInfoExecl extends BaseEntity {
|
|||||||
|
|
||||||
private String menuId;
|
private String menuId;
|
||||||
|
|
||||||
|
private String standCode;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Map<String, Object> attrInfoMap = new LinkedHashMap<>();
|
private Map<String, Object> attrInfoMap = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
|||||||
+9
-7
@@ -38,6 +38,7 @@ import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|||||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
|
import org.apache.poi.ss.util.CellRangeAddress;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -464,13 +465,10 @@ public class SarBussionessStandController extends BaseController<SarBussionessSt
|
|||||||
String fileName2 = "导入模板.xls";
|
String fileName2 = "导入模板.xls";
|
||||||
HSSFSheet sheetItems = workbook.createSheet("模板");
|
HSSFSheet sheetItems = workbook.createSheet("模板");
|
||||||
sheetItems.setDefaultColumnWidth(16);
|
sheetItems.setDefaultColumnWidth(16);
|
||||||
HSSFCellStyle cellStyle =workbook.createCellStyle();
|
|
||||||
cellStyle.setWrapText(true);
|
|
||||||
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
||||||
Row rowHeader = sheetItems.createRow(1);//开始创建标题行
|
Row rowHeader = sheetItems.createRow(1);//开始创建标题行
|
||||||
|
sheetItems.addMergedRegion(new CellRangeAddress(0, 0, 0, 25));
|
||||||
Row row2 = sheetItems.createRow(0);//开始创建填写说明
|
Row row2 = sheetItems.createRow(0);//开始创建填写说明
|
||||||
String exportFieldName = FieldConvertUtil.exportFieldName;
|
String exportFieldName = FieldConvertUtil.exportFieldName;
|
||||||
|
|
||||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(exportFieldName)) {
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(exportFieldName)) {
|
||||||
String[] headerArr = exportFieldName.split(",");
|
String[] headerArr = exportFieldName.split(",");
|
||||||
for (int i=0;i < headerArr.length; i++) {
|
for (int i=0;i < headerArr.length; i++) {
|
||||||
@@ -479,9 +477,13 @@ public class SarBussionessStandController extends BaseController<SarBussionessSt
|
|||||||
}
|
}
|
||||||
Cell cellA2 = row2.createCell(0);
|
Cell cellA2 = row2.createCell(0);
|
||||||
cellA2.setCellValue(FieldConvertUtil.exportName);
|
cellA2.setCellValue(FieldConvertUtil.exportName);
|
||||||
sheetItems.setColumnWidth(0, 60 * 256);
|
//sheetItems.setColumnWidth(0, 20 * 150);
|
||||||
row2.setHeight((short) (120 * 50));
|
row2.setHeight((short) (100 * 25));
|
||||||
|
HSSFCellStyle cellStyle =workbook.createCellStyle();
|
||||||
|
cellStyle.setAlignment(HorizontalAlignment.LEFT);
|
||||||
|
cellStyle.setVerticalAlignment(VerticalAlignment.TOP);
|
||||||
|
cellStyle.setWrapText(true);
|
||||||
|
cellA2.setCellStyle(cellStyle);
|
||||||
String repFileName = fileName2.replaceAll("/","_");
|
String repFileName = fileName2.replaceAll("/","_");
|
||||||
excelOS = new FileOutputStream(fileNowPath + "/" + repFileName);
|
excelOS = new FileOutputStream(fileNowPath + "/" + repFileName);
|
||||||
response.setHeader("Content-Disposition",
|
response.setHeader("Content-Disposition",
|
||||||
|
|||||||
+3
@@ -126,5 +126,8 @@ public interface SarBussionessStandDao extends BaseMapper<SarBussionessStand> {
|
|||||||
List<OldSystem> getBussionessStandInfo();
|
List<OldSystem> getBussionessStandInfo();
|
||||||
|
|
||||||
void updateByIdInfo(@Param("strFile")String strFile, @Param("attfId")String attfId);
|
void updateByIdInfo(@Param("strFile")String strFile, @Param("attfId")String attfId);
|
||||||
|
|
||||||
|
@Select("select * from sar")
|
||||||
|
String setDtqbbhbuss(String dtqbbhbuss);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+124
-75
@@ -79,6 +79,7 @@ import com.adc.da.sys.util.LoginUserUtil;
|
|||||||
import com.adc.da.util.UUIDUtils;
|
import com.adc.da.util.UUIDUtils;
|
||||||
import com.adc.da.utils.util.*;
|
import com.adc.da.utils.util.*;
|
||||||
import com.adc.da.utils.util.DateUtil;
|
import com.adc.da.utils.util.DateUtil;
|
||||||
|
import com.alibaba.druid.support.json.JSONUtils;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.serializer.SerializerFeature;
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
@@ -121,6 +122,7 @@ import java.security.SecureRandom;
|
|||||||
import java.security.cert.CertificateException;
|
import java.security.cert.CertificateException;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.sql.Clob;
|
import java.sql.Clob;
|
||||||
|
import java.sql.Connection;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@@ -2045,7 +2047,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
return Result.error("请选择需要导入的目录");
|
return Result.error("请选择需要导入的目录");
|
||||||
}
|
}
|
||||||
//给出头部信息
|
//给出头部信息
|
||||||
String[] headerExcel = {"*企标类别,企标编号,*标准年份,*企标名称,企标英文名称,*文本状态,发布日期,企标实施日期,起草部门,起草人,适用车型,能源类型,适用产品线,体系类别,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,代替企标编号,采用标准,采标程度,引用标准,发布稿附件,编制说明附件,历史版本附件,其他文件附件,修改单附件,关联文件附件,"};
|
String[] headerExcel = {"*企标类别,企标编号,*标准年份,*企标名称,企标英文名称,*文本状态,发布日期,企标实施日期,起草部门,起草人,适用车型,能源类型,适用产品线,体系类别,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,发布稿,编制说明,历史版本,其他文件,修改单,代替企标编号,采用标准,采标程度,引用标准,关联文件,"};
|
||||||
|
|
||||||
//获取文件全称
|
//获取文件全称
|
||||||
String fileNameStr = file.getOriginalFilename();
|
String fileNameStr = file.getOriginalFilename();
|
||||||
@@ -2081,8 +2083,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
}
|
}
|
||||||
//File excelfile = fileList.get(0);
|
//File excelfile = fileList.get(0);
|
||||||
int excel = 0;
|
int excel = 0;
|
||||||
|
List<String> jsonList = new ArrayList<>();
|
||||||
|
SarBussStandAttrInfoExecl sarBussStandAttrInfo = new SarBussStandAttrInfoExecl();
|
||||||
for (File fileInfo : fileList) {
|
for (File fileInfo : fileList) {
|
||||||
String infoJson = "";
|
|
||||||
if (fileInfo.getName().contains(".xls") || fileInfo.getName().contains(".xlsx")) {
|
if (fileInfo.getName().contains(".xls") || fileInfo.getName().contains(".xlsx")) {
|
||||||
excel = excel + 1;
|
excel = excel + 1;
|
||||||
if (excel > 1) {
|
if (excel > 1) {
|
||||||
@@ -2125,10 +2128,15 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
// cell.setCellType(CellType.STRING);
|
// cell.setCellType(CellType.STRING);
|
||||||
// sb.append(cell.getStringCellValue() + ",");
|
// sb.append(cell.getStringCellValue() + ",");
|
||||||
} else {
|
} else {
|
||||||
if (CellType.NUMERIC == cell.getCellType() && HSSFDateUtil.isCellDateFormatted(cell)) {
|
if
|
||||||
|
(CellType.NUMERIC == cell.getCellType() && HSSFDateUtil.isCellDateFormatted(cell)) {
|
||||||
Date d = cell.getDateCellValue();
|
Date d = cell.getDateCellValue();
|
||||||
|
if(d.before(sdf.parse("1900-01-01"))||d.after(sdf.parse("2500-01-01")) ){
|
||||||
|
return Result.error("输入的日期异常,请按照实际日期填写");
|
||||||
|
}
|
||||||
rowList.put(headerCell.getStringCellValue(), sdf.format(d));
|
rowList.put(headerCell.getStringCellValue(), sdf.format(d));
|
||||||
} else {
|
} else
|
||||||
|
{
|
||||||
cell.setCellType(CellType.STRING);
|
cell.setCellType(CellType.STRING);
|
||||||
rowList.put(headerCell.getStringCellValue(), cell.getStringCellValue());
|
rowList.put(headerCell.getStringCellValue(), cell.getStringCellValue());
|
||||||
}
|
}
|
||||||
@@ -2147,9 +2155,11 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
FileUnZip.deleteDir(saveDirectory);
|
FileUnZip.deleteDir(saveDirectory);
|
||||||
return Result.error("fail", "读取失败,请严格按照模板文件导入数据");
|
return Result.error("fail", "读取失败,请严格按照模板文件导入数据");
|
||||||
}
|
}
|
||||||
SarBussStandAttrInfoExecl sarBussStandAttrInfo = new SarBussStandAttrInfoExecl();
|
|
||||||
if (i != 0 && i != 1 && !rowList.equals("") && rowList != null ) {
|
if (i != 0 && i != 1 && !rowList.equals("") && rowList != null ) {
|
||||||
|
|
||||||
|
int count = 1;
|
||||||
|
count++;
|
||||||
|
|
||||||
String standSort = rowList.get("*企标类别");
|
String standSort = rowList.get("*企标类别");
|
||||||
if (StringUtils.isNotBlank(standSort)) {
|
if (StringUtils.isNotBlank(standSort)) {
|
||||||
if (standSort.length() > 100) {
|
if (standSort.length() > 100) {
|
||||||
@@ -2271,10 +2281,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
sarBussStandAttrInfo.setStandSort(standSort);
|
sarBussStandAttrInfo.setStandSort(standSort);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return Result.error("请输入正确的企标类别");
|
return Result.error("第"+ count +"行请输入正确的企标类别");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Result.error("企标类别不能为空");
|
return Result.error("第"+ count +"行企标类别不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
String standNumber = rowList.get("企标编号");
|
String standNumber = rowList.get("企标编号");
|
||||||
@@ -2283,21 +2293,21 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String standYear = rowList.get("*标准年份");
|
String standYear = rowList.get("*标准年份");
|
||||||
if (StringUtils.isNotBlank(standYear)) {
|
if (StringUtils.isNotBlank(standYear)) {
|
||||||
if (standYear.length() > 100) {
|
if (standYear.length() > 100) {
|
||||||
return Result.error("标准年份输入过长");
|
return Result.error("第"+ count +"行标准年份输入过长");
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setStandYear(standYear);
|
sarBussStandAttrInfo.setStandYear(standYear);
|
||||||
} else {
|
} else {
|
||||||
return Result.error("标准年份不能为空");
|
return Result.error("第"+ count +"行标准年份不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
String standName = rowList.get("*企标名称");
|
String standName = rowList.get("*企标名称");
|
||||||
if (StringUtils.isNotBlank(standName)) {
|
if (StringUtils.isNotBlank(standName)) {
|
||||||
if (standName.length() > 100) {
|
if (standName.length() > 100) {
|
||||||
return Result.error("输入的企标名称过长");
|
return Result.error("第"+ count +"行输入的企标名称过长");
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setStandName(standName);
|
sarBussStandAttrInfo.setStandName(standName);
|
||||||
} else {
|
} else {
|
||||||
return Result.error("企标名称不能为空");
|
return Result.error("第"+ count +"行企标名称不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
String standEnName = rowList.get("企标英文名称");
|
String standEnName = rowList.get("企标英文名称");
|
||||||
@@ -2306,7 +2316,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String textStatusBuss = rowList.get("*文本状态");
|
String textStatusBuss = rowList.get("*文本状态");
|
||||||
if (StringUtils.isNotBlank(textStatusBuss)) {
|
if (StringUtils.isNotBlank(textStatusBuss)) {
|
||||||
if (textStatusBuss.length() > 200) {
|
if (textStatusBuss.length() > 200) {
|
||||||
return Result.error("输入的文本状态过长");
|
return Result.error("第"+ count +"行输入的文本状态过长");
|
||||||
}
|
}
|
||||||
switch (textStatusBuss) {
|
switch (textStatusBuss) {
|
||||||
case "发布":
|
case "发布":
|
||||||
@@ -2334,19 +2344,19 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
sarBussStandAttrInfo.setTextStatusBuss("1w7cegukbs");
|
sarBussStandAttrInfo.setTextStatusBuss("1w7cegukbs");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return Result.error("请提供正确的文本状态");
|
return Result.error("第"+ count +"行请提供正确的文本状态");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Result.error("文本状态不能为空");
|
return Result.error("第"+ count +"行文本状态不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
String issueTimeStr =rowList.get("发布日期");
|
String issueTimeStr =rowList.get("发布日期");
|
||||||
if (StringUtils.isNotBlank(issueTimeStr)){
|
if (StringUtils.isNotBlank(issueTimeStr)){
|
||||||
if (issueTimeStr.contains("-")) {
|
if (issueTimeStr.contains("-")) {
|
||||||
sarBussStandAttrInfo.setIssueTime(issueTimeStr);
|
sarBussStandAttrInfo.setIssueTime(issueTimeStr);
|
||||||
}else {
|
}else {
|
||||||
return Result.error("发布日期格式必须为年-月-日");
|
return Result.error("第"+ count +"行发布日期格式必须为年-月-日");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2355,7 +2365,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
if (putTimeStr.contains("-")) {
|
if (putTimeStr.contains("-")) {
|
||||||
sarBussStandAttrInfo.setPutTime(putTimeStr);
|
sarBussStandAttrInfo.setPutTime(putTimeStr);
|
||||||
}else {
|
}else {
|
||||||
return Result.error("企标实施日期格式必须为年-月-日");
|
return Result.error("第"+ count +"行企标实施日期格式必须为年-月-日");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2363,7 +2373,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String qcdw = rowList.get("起草部门");
|
String qcdw = rowList.get("起草部门");
|
||||||
if (StringUtils.isNotBlank(qcdw)) {
|
if (StringUtils.isNotBlank(qcdw)) {
|
||||||
if (qcdw.length() > 100) {
|
if (qcdw.length() > 100) {
|
||||||
return Result.error("输入的起草部门过长");
|
return Result.error("第"+ count +"行输入的起草部门过长");
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setQcdw(qcdw);
|
sarBussStandAttrInfo.setQcdw(qcdw);
|
||||||
}
|
}
|
||||||
@@ -2371,7 +2381,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String qcrbuss = rowList.get("起草人");
|
String qcrbuss = rowList.get("起草人");
|
||||||
if (StringUtils.isNotBlank(qcrbuss)) {
|
if (StringUtils.isNotBlank(qcrbuss)) {
|
||||||
if (qcrbuss.length() > 100) {
|
if (qcrbuss.length() > 100) {
|
||||||
return Result.error("输入的起草人过长");
|
return Result.error("第"+ count +"行输入的起草人过长");
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setQcrbuss(qcrbuss);
|
sarBussStandAttrInfo.setQcrbuss(qcrbuss);
|
||||||
}
|
}
|
||||||
@@ -2391,7 +2401,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
sycxs = sycx;
|
sycxs = sycx;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Result.error("请输入正确的适用车型");
|
return Result.error("第"+ count +"行请输入正确的适用车型");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setSycxclass(sycxs);
|
sarBussStandAttrInfo.setSycxclass(sycxs);
|
||||||
@@ -2414,7 +2424,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
nylxs = nylx;
|
nylxs = nylx;
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
return Result.error("请输入正确的能源类型");
|
return Result.error("第"+ count +"行请输入正确的能源类型");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setNylxclass(nylxs);
|
sarBussStandAttrInfo.setNylxclass(nylxs);
|
||||||
@@ -2437,7 +2447,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
sycpxs = sycpx;
|
sycpxs = sycpx;
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
return Result.error("请输入正确的适用产品线");
|
return Result.error("第"+ count +"行请输入正确的适用产品线");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setSycpxclass(sycpxs);
|
sarBussStandAttrInfo.setSycpxclass(sycpxs);
|
||||||
@@ -2469,13 +2479,17 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String dtqbbhbuss = rowList.get("代替企标编号");
|
String dtqbbhbuss = rowList.get("代替企标编号");
|
||||||
sarBussStandAttrInfo.setDtqbbhbuss(dtqbbhbuss);
|
sarBussStandAttrInfo.setDtqbbhbuss(dtqbbhbuss);
|
||||||
|
|
||||||
|
//被代替企标编号
|
||||||
|
// String bdtqbbhbuss = sarBussionessStandEODao.setDtqbbhbuss(dtqbbhbuss);
|
||||||
|
// sarBussionessStandEODao.s
|
||||||
|
|
||||||
//// //采用标准 13
|
//// //采用标准 13
|
||||||
String cybz = rowList.get("采用标准");
|
String cybz = rowList.get("采用标准");
|
||||||
if (StringUtils.isNotBlank(cybz) && !cybz.equals("")){
|
if (StringUtils.isNotBlank(cybz) && !cybz.equals("")){
|
||||||
if (cybz.equals("IDT等同采用") || cybz.equals("NEQ非等效采用") || cybz.equals("MOD修改采用")){
|
if (cybz.equals("IDT等同采用") || cybz.equals("NEQ非等效采用") || cybz.equals("MOD修改采用")){
|
||||||
sarBussStandAttrInfo.setCybz(cybz);
|
sarBussStandAttrInfo.setCybz(cybz);
|
||||||
}else {
|
}else {
|
||||||
return Result.error("请提供正确的采用标准");
|
return Result.error("第"+ count +"行请提供正确的采用标准");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2494,7 +2508,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String format = simpleDateFormat.format(date);
|
String format = simpleDateFormat.format(date);
|
||||||
sarBussStandAttrInfo.setXcsjbuss(format);
|
sarBussStandAttrInfo.setXcsjbuss(format);
|
||||||
|
|
||||||
String fbgbuss = rowList.get("发布稿附件");
|
String fbgbuss = rowList.get("发布稿");
|
||||||
if (fbgbuss != null && !fbgbuss.equals("")) {
|
if (fbgbuss != null && !fbgbuss.equals("")) {
|
||||||
String[] split = fbgbuss.split(",");
|
String[] split = fbgbuss.split(",");
|
||||||
String s = "";
|
String s = "";
|
||||||
@@ -2514,15 +2528,15 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
s = attFileVo.getAttId();
|
s = attFileVo.getAttId();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
logger.info("第"+ count +"行" +fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
return Result.error(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setFbgbuss(s);
|
sarBussStandAttrInfo.setFbgbuss(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String bzsmbuss = rowList.get("编制说明附件");
|
String bzsmbuss = rowList.get("编制说明");
|
||||||
if (bzsmbuss != null && !bzsmbuss.equals("")) {
|
if (bzsmbuss != null && !bzsmbuss.equals("")) {
|
||||||
String[] split = bzsmbuss.split(",");
|
String[] split = bzsmbuss.split(",");
|
||||||
String s = "";
|
String s = "";
|
||||||
@@ -2542,15 +2556,15 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
s = attFileVo.getAttId();
|
s = attFileVo.getAttId();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
logger.info("第"+ count +"行"+ fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
return Result.error(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
return Result.error("第"+ count +"行"+ fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setBzsmbuss(s);
|
sarBussStandAttrInfo.setBzsmbuss(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String lsbbbuss = rowList.get("历史版本附件");
|
String lsbbbuss = rowList.get("历史版本");
|
||||||
if (lsbbbuss != null && !lsbbbuss.equals("")) {
|
if (lsbbbuss != null && !lsbbbuss.equals("")) {
|
||||||
String[] split = lsbbbuss.split(",");
|
String[] split = lsbbbuss.split(",");
|
||||||
String s = "";
|
String s = "";
|
||||||
@@ -2570,15 +2584,15 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
s = attFileVo.getAttId();
|
s = attFileVo.getAttId();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
logger.info("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
return Result.error(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setLsbbbuss(s);
|
sarBussStandAttrInfo.setLsbbbuss(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String qtwjbuss = rowList.get("其他文件附件");
|
String qtwjbuss = rowList.get("其他文件");
|
||||||
if (qtwjbuss != null && !qtwjbuss.equals("")) {
|
if (qtwjbuss != null && !qtwjbuss.equals("")) {
|
||||||
String[] split = qtwjbuss.split(",");
|
String[] split = qtwjbuss.split(",");
|
||||||
String s = "";
|
String s = "";
|
||||||
@@ -2598,15 +2612,15 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
s = attFileVo.getAttId();
|
s = attFileVo.getAttId();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx/png格式的附件");
|
logger.info("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx/png格式的附件");
|
||||||
return Result.error(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx/png格式的附件");
|
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx/png格式的附件");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setQtwjbuss(s);
|
sarBussStandAttrInfo.setQtwjbuss(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String xgd = rowList.get("修改单附件");
|
String xgd = rowList.get("修改单");
|
||||||
if (xgd != null && !xgd.equals("")) {
|
if (xgd != null && !xgd.equals("")) {
|
||||||
String[] split = xgd.split(",");
|
String[] split = xgd.split(",");
|
||||||
String s = "";
|
String s = "";
|
||||||
@@ -2626,15 +2640,15 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
s = attFileVo.getAttId();
|
s = attFileVo.getAttId();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
logger.info("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
return Result.error(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setXgd(s);
|
sarBussStandAttrInfo.setXgd(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String glwjbuss = rowList.get("关联文件附件");
|
String glwjbuss = rowList.get("关联文件");
|
||||||
if (glwjbuss != null && !glwjbuss.equals("")) {
|
if (glwjbuss != null && !glwjbuss.equals("")) {
|
||||||
String[] split = glwjbuss.split(",");
|
String[] split = glwjbuss.split(",");
|
||||||
String s = "";
|
String s = "";
|
||||||
@@ -2654,8 +2668,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
s = attFileVo.getAttId();
|
s = attFileVo.getAttId();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.info(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
logger.info("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
return Result.error(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setGlwjbuss(s);
|
sarBussStandAttrInfo.setGlwjbuss(s);
|
||||||
@@ -2675,19 +2689,12 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
|
|
||||||
sarBussStandAttrInfo.setMenuId(menuId);
|
sarBussStandAttrInfo.setMenuId(menuId);
|
||||||
|
|
||||||
List<SarBussStandAttrInfoExecl> list = new ArrayList<>();
|
String standCode = ifCodeAndName(sarBussStandAttrInfo.getStandName(), sarBussStandAttrInfo.getStandSort(), sarBussStandAttrInfo.getStandYear(), sarBussStandAttrInfo.getStandNumber());
|
||||||
list.add(sarBussStandAttrInfo);
|
sarBussStandAttrInfo.setStandCode(standCode);
|
||||||
|
String json = JSONUtils.toJSONString(sarBussStandAttrInfo);
|
||||||
com.alibaba.fastjson.JSONArray json = com.alibaba.fastjson.JSONArray.parseArray(JSON.toJSONString(list));
|
if(StringUtils.isNotEmpty(json)){
|
||||||
com.alibaba.fastjson.JSONObject jsonObjects = null;
|
jsonList.add(json);
|
||||||
for (int j = 0; j < json.size(); j++) {
|
|
||||||
jsonObjects = json.getJSONObject(j);
|
|
||||||
}
|
}
|
||||||
infoJson = String.valueOf(jsonObjects);
|
|
||||||
|
|
||||||
//入库
|
|
||||||
processCreateBuss(infoJson);
|
|
||||||
countSuccess++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2695,10 +2702,20 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FileUnZip.deleteDir(saveDirectory);
|
FileUnZip.deleteDir(saveDirectory);
|
||||||
return Result.error("导入失败,请查看需要导入的企标标准号和企标名称是否已存在");
|
return Result.error("导入失败,需要导入的数据有问题或导入的企标标号或企标名称重复");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//入库
|
||||||
|
try {
|
||||||
|
for (String infoJson : jsonList) {
|
||||||
|
processCreateBuss(infoJson);
|
||||||
|
countSuccess++;
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
return Result.error("导入失败,请查看导入的数据是否有问题");
|
||||||
|
}
|
||||||
|
|
||||||
String msg = "成功导入" + countSuccess + "条";
|
String msg = "成功导入" + countSuccess + "条";
|
||||||
return Result.success("", msg, null);
|
return Result.success("", msg, null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -2707,6 +2724,38 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param standName
|
||||||
|
* @param standSort
|
||||||
|
* @param standYear
|
||||||
|
* @param standNumber
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String ifCodeAndName(String standName, String standSort, String standYear, String standNumber) {
|
||||||
|
|
||||||
|
SarBussionessStand sarBussionessStand = new SarBussionessStand();
|
||||||
|
//拼接企标编号
|
||||||
|
String standCode = standSort + " " + standNumber + "-" + standYear;
|
||||||
|
sarBussionessStand.setStandCode(standCode);
|
||||||
|
// 根据标准号判断数据是否已存在
|
||||||
|
//2021年4月9日 此处检查当前是否存在standId
|
||||||
|
QueryWrapper<SarBussionessStand>queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq(sarBussionessStand.getStandCode() != null,"STAND_CODE",sarBussionessStand.getStandCode())
|
||||||
|
.eq(standName != null,"STAND_NAME",standName);
|
||||||
|
List<SarBussionessStand> list = iSarBussionessStandService.list(queryWrapper);
|
||||||
|
Integer valIdFlag = 0;
|
||||||
|
for (SarBussionessStand stand :list){
|
||||||
|
if ((list.size() ==1 && !list.get(0).getId().equals(stand.getId())) || list.size() >1){
|
||||||
|
valIdFlag = stand.getValidFlag();
|
||||||
|
if (valIdFlag == 0){
|
||||||
|
throw new AdcDaBaseException("企标标准号"+ sarBussionessStand.getStandCode() +"或企标名称"+ sarBussionessStand.getStandName() +"已存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sarBussionessStand.getStandCode();
|
||||||
|
}
|
||||||
|
|
||||||
private static List<File> readImpExcelFile(String path) {
|
private static List<File> readImpExcelFile(String path) {
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
List<File> resultlist = new ArrayList<>();
|
List<File> resultlist = new ArrayList<>();
|
||||||
@@ -2764,24 +2813,24 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
|
|
||||||
// String textStatusBussShow = sarBussionessStand.getTextStatusBuss();
|
// String textStatusBussShow = sarBussionessStand.getTextStatusBuss();
|
||||||
|
|
||||||
//拼接企标编号
|
// //拼接企标编号
|
||||||
String standCode = sarBussionessStand.getStandSort() + " " + sarBussionessStand.getStandNumber() + "-" + sarBussionessStand.getStandYear();
|
// String standCode = sarBussionessStand.getStandSort() + " " + sarBussionessStand.getStandNumber() + "-" + sarBussionessStand.getStandYear();
|
||||||
sarBussionessStand.setStandCode(standCode);
|
// sarBussionessStand.setStandCode(standCode);
|
||||||
// 根据标准号判断数据是否已存在
|
// // 根据标准号判断数据是否已存在
|
||||||
//2021年4月9日 此处检查当前是否存在standId
|
// //2021年4月9日 此处检查当前是否存在standId
|
||||||
QueryWrapper<SarBussionessStand>queryWrapper = new QueryWrapper<>();
|
// QueryWrapper<SarBussionessStand>queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq(sarBussionessStand.getStandCode() != null,"STAND_CODE",sarBussionessStand.getStandCode())
|
// queryWrapper.eq(sarBussionessStand.getStandCode() != null,"STAND_CODE",sarBussionessStand.getStandCode())
|
||||||
.eq(sarBussionessStand.getStandName() != null,"STAND_NAME",sarBussionessStand.getStandName());
|
// .eq(sarBussionessStand.getStandName() != null,"STAND_NAME",sarBussionessStand.getStandName());
|
||||||
List<SarBussionessStand> list = iSarBussionessStandService.list(queryWrapper);
|
// List<SarBussionessStand> list = iSarBussionessStandService.list(queryWrapper);
|
||||||
Integer valIdFlag = 0;
|
// Integer valIdFlag = 0;
|
||||||
for (SarBussionessStand stand :list){
|
// for (SarBussionessStand stand :list){
|
||||||
if ((list.size() ==1 && !list.get(0).getId().equals(stand.getId())) || list.size() >1){
|
// if ((list.size() ==1 && !list.get(0).getId().equals(stand.getId())) || list.size() >1){
|
||||||
valIdFlag = stand.getValidFlag();
|
// valIdFlag = stand.getValidFlag();
|
||||||
if (valIdFlag == 0){
|
// if (valIdFlag == 0){
|
||||||
throw new AdcDaBaseException("企标标准号"+ sarBussionessStand.getStandCode() +"或企标名称"+ sarBussionessStand.getStandName() +"已存在");
|
// throw new AdcDaBaseException("企标标准号"+ sarBussionessStand.getStandCode() +"或企标名称"+ sarBussionessStand.getStandName() +"已存在");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
//此处判断是否是带入的标准
|
//此处判断是否是带入的标准
|
||||||
if(StringUtils.isNotBlank(sarBussionessStand.getId())) {
|
if(StringUtils.isNotBlank(sarBussionessStand.getId())) {
|
||||||
|
|||||||
@@ -71,12 +71,14 @@ public class FieldConvertUtil {
|
|||||||
public static String exportName = "填写说明\n" +
|
public static String exportName = "填写说明\n" +
|
||||||
"1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" +
|
"1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" +
|
||||||
"2.所有带*号的字段必须填写\n" +
|
"2.所有带*号的字段必须填写\n" +
|
||||||
"3.状态,类别字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
|
"3.企标类别(例如:BZJ、FT、Q-HD、Q-IOUM、Q/ASB、Q/BFC、Q/BQB等),文本状态(包含:发布、被代替、参考、即将实施、有效、直接上传、作废、待修订-指的其他企业标准),采用标准(包含:IDT等同采用、NEQ非等效采用、MOD修改采用)字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
|
||||||
"4.适用车型,能源类型,适用产品线字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文或中文逗号分割\n" +
|
"4.适用车型,能源类型,适用产品线字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文逗号分割\n" +
|
||||||
"5.发布日期,企标实施日期,复审日期字段为日期,必须精确到日\n" +
|
"5.发布日期,企标实施日期字段为年-月-日格式,必须精确到日,例如(2023-04-01)\n" +
|
||||||
"6.编号,企标名称,企标英文名称字段为文本,填写文本内容";
|
"6.企标编号,企标名称,企标英文名称字段为文本,填写文本内容\n" +
|
||||||
|
"7.关联模块-乘用车VPPS编码和关联模块--卡车VPPS编码是填写数据库中已有的编码从而带出乘用车VPPS名称和卡车VPPS名称\n" +
|
||||||
|
"8.发布稿,编制说明,历史版本,其他文件,修改单,关联文件为附件文件,需要放在Excel文档同级目录中";
|
||||||
|
|
||||||
public static String exportFieldName = "*企标类别,企标编号,*标准年份,*企标名称,企标英文名称,*文本状态,发布日期,企标实施日期,起草部门,起草人,适用车型,能源类型,适用产品线,体系类别,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,代替企标编号,采用标准,采标程度,引用标准,发布稿附件,编制说明附件,历史版本附件,其他文件附件,修改单附件,关联文件附件,";
|
public static String exportFieldName = "*企标类别,企标编号,*标准年份,*企标名称,企标英文名称,*文本状态,发布日期,企标实施日期,起草部门,起草人,适用车型,能源类型,适用产品线,体系类别,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,发布稿,编制说明,历史版本,其他文件,修改单,代替企标编号,采用标准,采标程度,引用标准,关联文件,";
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* @Description: Clob类型 转String
|
* @Description: Clob类型 转String
|
||||||
|
|||||||
Reference in New Issue
Block a user