企业标准导入优化及调整
This commit is contained in:
+8
@@ -33,6 +33,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
@@ -94,6 +95,9 @@ public class SarBussionessStandController extends BaseController<SarBussionessSt
|
||||
@Autowired
|
||||
ISarLawsInfoService sarLawsInfoEOService;
|
||||
|
||||
@Autowired
|
||||
private ITsResourceService tsResourceService;
|
||||
|
||||
/**
|
||||
* 根据计划库制定状态查询企标编号
|
||||
*
|
||||
@@ -422,6 +426,10 @@ public class SarBussionessStandController extends BaseController<SarBussionessSt
|
||||
@PostMapping("/importSarBussionessStandFile")
|
||||
public ResponseMessage<String> importSarBussionessStandFile(@RequestParam(value = "file",required = false)MultipartFile file,String menuId,String userId) throws Exception{
|
||||
|
||||
List<TsResource> tsResources = tsResourceService.getByMenuId(menuId);
|
||||
if (ObjectUtils.isEmpty(tsResources)) {
|
||||
return Result.error("请选择需要导入的目录");
|
||||
}
|
||||
return sarBussionessStandEOService.importSarBussionessStandFile(file,menuId,userId);
|
||||
}
|
||||
@ApiOperation(value = "|SarBussionessStand|判断原文译文")
|
||||
|
||||
+29
-28
@@ -259,8 +259,6 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
@Autowired
|
||||
private SarStandardsInfoDao sarStandardsInfoDao;
|
||||
|
||||
@Autowired
|
||||
private ITsResourceService tsResourceService;
|
||||
|
||||
@Autowired
|
||||
private SarVppsTreeDao sarVppsTreeDao;
|
||||
@@ -2048,13 +2046,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
*/
|
||||
@Override
|
||||
public ResponseMessage<String> importSarBussionessStandFile(MultipartFile file,String menuId,String userId)throws Exception {
|
||||
|
||||
List<TsResource> tsResources = tsResourceService.getByMenuId(menuId);
|
||||
if (ObjectUtils.isEmpty(tsResources)) {
|
||||
return Result.error("请选择需要导入的目录");
|
||||
}
|
||||
//给出头部信息
|
||||
String[] headerExcel = {"*企标类别,企标编号,*标准年份,*企标名称,企标英文名称,*文本状态,发布日期,企标实施日期,起草部门,起草人,适用车型,能源类型,适用产品线,体系类别,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,发布稿,编制说明,历史版本,其他文件,修改单,代替企标编号,采用标准,采标程度,引用标准,关联文件,"};
|
||||
String[] headerExcel = {"*企标类别,*企标编号,*标准年份,*企标名称,企标英文名称,*文本状态,发布日期,企标实施日期,起草部门,起草人,适用车型,能源类型,适用产品线,体系类别,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,发布稿,编制说明,历史版本,其他文件,修改单,代替企标编号,采用标准,采标程度,引用标准,关联文件,"};
|
||||
|
||||
//获取文件全称
|
||||
String fileNameStr = file.getOriginalFilename();
|
||||
@@ -2294,8 +2287,16 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
return Result.error("第"+ count +"行企标类别不能为空");
|
||||
}
|
||||
|
||||
String standNumber = rowList.get("企标编号");
|
||||
sarBussStandAttrInfo.setStandNumber(standNumber);
|
||||
String standNumber = rowList.get("*企标编号");
|
||||
if (StringUtils.isNotBlank(standNumber)){
|
||||
if (standNumber.length() > 100){
|
||||
return Result.error("第"+ count +"行企标编号输入过长");
|
||||
}
|
||||
sarBussStandAttrInfo.setStandNumber(standNumber);
|
||||
}else {
|
||||
return Result.error("第"+ count +"行企标编号不能为空");
|
||||
}
|
||||
|
||||
|
||||
String standYear = rowList.get("*标准年份");
|
||||
if (StringUtils.isNotBlank(standYear)) {
|
||||
@@ -2524,7 +2525,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
String fjName = split[j];
|
||||
int one = fjName.lastIndexOf(".");
|
||||
String split2 = fjName.substring(one + 1).toLowerCase();
|
||||
if (split2.equals("pdf") || split2.equals("ppt") || split2.equals("pptx") || split2.equals("doc") || split2.equals("docx") || split2.equals("xls") || split2.equals("xlsx")) {
|
||||
if (split2.equals("pdf") || split2.equals("ppt") || split2.equals("pptx") || split2.equals("doc") || split2.equals("docx")) {
|
||||
String name = fileInfo.getName();
|
||||
String[] split1 = fileInfo.toString().split(name);
|
||||
File files = new File(split1[0] + split[j]);
|
||||
@@ -2535,8 +2536,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
s = attFileVo.getAttId();
|
||||
}
|
||||
} else {
|
||||
logger.info("第"+ count +"行" +fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||
logger.info("第"+ count +"行" +fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
|
||||
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
|
||||
}
|
||||
}
|
||||
sarBussStandAttrInfo.setFbgbuss(s);
|
||||
@@ -2552,7 +2553,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
String fjName = split[j];
|
||||
int one = fjName.lastIndexOf(".");
|
||||
String split2 = fjName.substring(one + 1).toLowerCase();
|
||||
if (split2.equals("pdf") || split2.equals("ppt") || split2.equals("pptx") || split2.equals("doc") || split2.equals("docx") || split2.equals("xls") || split2.equals("xlsx")) {
|
||||
if (split2.equals("pdf") || split2.equals("ppt") || split2.equals("pptx") || split2.equals("doc") || split2.equals("docx")) {
|
||||
String name = fileInfo.getName();
|
||||
String[] split1 = fileInfo.toString().split(name);
|
||||
File files = new File(split1[0] + split[j]);
|
||||
@@ -2563,8 +2564,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
s = attFileVo.getAttId();
|
||||
}
|
||||
} else {
|
||||
logger.info("第"+ count +"行"+ fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||
return Result.error("第"+ count +"行"+ fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||
logger.info("第"+ count +"行"+ fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
|
||||
return Result.error("第"+ count +"行"+ fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
|
||||
}
|
||||
}
|
||||
sarBussStandAttrInfo.setBzsmbuss(s);
|
||||
@@ -2580,7 +2581,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
String fjName = split[j];
|
||||
int one = fjName.lastIndexOf(".");
|
||||
String split2 = fjName.substring(one + 1).toLowerCase();
|
||||
if (split2.equals("pdf") || split2.equals("ppt") || split2.equals("pptx") || split2.equals("doc") || split2.equals("docx") || split2.equals("xls") || split2.equals("xlsx")) {
|
||||
if (split2.equals("pdf") || split2.equals("ppt") || split2.equals("pptx") || split2.equals("doc") || split2.equals("docx")) {
|
||||
String name = fileInfo.getName();
|
||||
String[] split1 = fileInfo.toString().split(name);
|
||||
File files = new File(split1[0] + split[j]);
|
||||
@@ -2591,8 +2592,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
s = attFileVo.getAttId();
|
||||
}
|
||||
} else {
|
||||
logger.info("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||
logger.info("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
|
||||
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
|
||||
}
|
||||
}
|
||||
sarBussStandAttrInfo.setLsbbbuss(s);
|
||||
@@ -2608,7 +2609,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
String fjName = split[j];
|
||||
int one = fjName.lastIndexOf(".");
|
||||
String split2 = fjName.substring(one + 1).toLowerCase();
|
||||
if (split2.equals("pdf") || split2.equals("ppt") || split2.equals("pptx") || split2.equals("doc") || split2.equals("docx") || split2.equals("xls") || split2.equals("xlsx") || split2.equals("png")) {
|
||||
if (split2.equals("pdf") || split2.equals("ppt") || split2.equals("pptx") || split2.equals("doc") || split2.equals("docx") || split2.equals("png")) {
|
||||
String name = fileInfo.getName();
|
||||
String[] split1 = fileInfo.toString().split(name);
|
||||
File files = new File(split1[0] + split[j]);
|
||||
@@ -2619,8 +2620,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
s = attFileVo.getAttId();
|
||||
}
|
||||
} else {
|
||||
logger.info("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx/png格式的附件");
|
||||
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx/png格式的附件");
|
||||
logger.info("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/png格式的附件");
|
||||
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/png格式的附件");
|
||||
}
|
||||
}
|
||||
sarBussStandAttrInfo.setQtwjbuss(s);
|
||||
@@ -2636,7 +2637,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
String fjName = split[j];
|
||||
int one = fjName.lastIndexOf(".");
|
||||
String split2 = fjName.substring(one + 1).toLowerCase();
|
||||
if (split2.equals("pdf") || split2.equals("ppt") || split2.equals("pptx") || split2.equals("doc") || split2.equals("docx") || split2.equals("xls") || split2.equals("xlsx")) {
|
||||
if (split2.equals("pdf") || split2.equals("ppt") || split2.equals("pptx") || split2.equals("doc") || split2.equals("docx")) {
|
||||
String name = fileInfo.getName();
|
||||
String[] split1 = fileInfo.toString().split(name);
|
||||
File files = new File(split1[0] + split[j]);
|
||||
@@ -2647,8 +2648,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
s = attFileVo.getAttId();
|
||||
}
|
||||
} else {
|
||||
logger.info("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||
logger.info("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
|
||||
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
|
||||
}
|
||||
}
|
||||
sarBussStandAttrInfo.setXgd(s);
|
||||
@@ -2664,7 +2665,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
String fjName = split[j];
|
||||
int one = fjName.lastIndexOf(".");
|
||||
String split2 = fjName.substring(one + 1).toLowerCase();
|
||||
if (split2.equals("pdf") || split2.equals("ppt") || split2.equals("pptx") || split2.equals("doc") || split2.equals("docx") || split2.equals("xls") || split2.equals("xlsx")) {
|
||||
if (split2.equals("pdf") || split2.equals("ppt") || split2.equals("pptx") || split2.equals("doc") || split2.equals("docx")) {
|
||||
String name = fileInfo.getName();
|
||||
String[] split1 = fileInfo.toString().split(name);
|
||||
File files = new File(split1[0] + split[j]);
|
||||
@@ -2675,8 +2676,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
s = attFileVo.getAttId();
|
||||
}
|
||||
} else {
|
||||
logger.info("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||
logger.info("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
|
||||
return Result.error("第"+ count +"行"+fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx格式的附件");
|
||||
}
|
||||
}
|
||||
sarBussStandAttrInfo.setGlwjbuss(s);
|
||||
|
||||
@@ -71,14 +71,14 @@ public class FieldConvertUtil {
|
||||
public static String exportName = "填写说明\n" +
|
||||
"1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" +
|
||||
"2.所有带*号的字段必须填写\n" +
|
||||
"3.企标类别(例如:BZJ、FT、Q-HD、Q-IOUM、Q/ASB、Q/BFC、Q/BQB等),文本状态(包含:发布、被代替、参考、即将实施、有效、直接上传、作废、待修订-指的其他企业标准),采用标准(包含:IDT等同采用、NEQ非等效采用、MOD修改采用)字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
|
||||
"3.企标类别(例如:Q/FT),文本状态(包含:发布、被代替、参考、即将实施、有效、直接上传、作废、待修订-指的其他企业标准),采用标准(包含:IDT等同采用、NEQ非等效采用、MOD修改采用)字段是单选属性,必须和系统中的对应字段选项相匹配\n" +
|
||||
"4.适用车型,能源类型,适用产品线字段是多选属性,必须和系统中的对应字段选项相匹配,填写多个时采用英文逗号分割\n" +
|
||||
"5.发布日期,企标实施日期字段为年-月-日格式,必须精确到日,例如(2023-04-01)\n" +
|
||||
"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
|
||||
|
||||
Reference in New Issue
Block a user