优化企业导入流程和新增模板下载接口
This commit is contained in:
@@ -156,6 +156,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
|||||||
addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/importSarBussionessStandFile");
|
addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/importSarBussionessStandFile");
|
||||||
addInterceptor.excludePathPatterns("/api/sarLawsDetailedList/sar-laws-detailed-list/importData");
|
addInterceptor.excludePathPatterns("/api/sarLawsDetailedList/sar-laws-detailed-list/importData");
|
||||||
|
|
||||||
|
//企标标准导入模板下载
|
||||||
|
addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/exportTemplateFile");
|
||||||
|
|
||||||
//doc文檔重新轉換
|
//doc文檔重新轉換
|
||||||
addInterceptor.excludePathPatterns("/api/sarStandardsInfo/sar-standards-info/convertDocAll_GNW");
|
addInterceptor.excludePathPatterns("/api/sarStandardsInfo/sar-standards-info/convertDocAll_GNW");
|
||||||
addInterceptor.excludePathPatterns("/api/sarStandardsInfo/sar-standards-info/convertDocAll_QB");
|
addInterceptor.excludePathPatterns("/api/sarStandardsInfo/sar-standards-info/convertDocAll_QB");
|
||||||
|
|||||||
+68
-3
@@ -1,6 +1,7 @@
|
|||||||
package com.adc.da.slrs.sarBussionessStand.controller;
|
package com.adc.da.slrs.sarBussionessStand.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ZipUtil;
|
||||||
import com.adc.da.Log.BusinessType;
|
import com.adc.da.Log.BusinessType;
|
||||||
import com.adc.da.Log.EpcLog;
|
import com.adc.da.Log.EpcLog;
|
||||||
import com.adc.da.common.FileUnZip;
|
import com.adc.da.common.FileUnZip;
|
||||||
@@ -21,6 +22,7 @@ import com.adc.da.http.PageInfo;
|
|||||||
import com.adc.da.http.ResponseMessage;
|
import com.adc.da.http.ResponseMessage;
|
||||||
import com.adc.da.http.Result;
|
import com.adc.da.http.Result;
|
||||||
import com.adc.da.util.LoginUserUtil;
|
import com.adc.da.util.LoginUserUtil;
|
||||||
|
import com.adc.da.util.UUIDUtils;
|
||||||
import com.adc.da.util.exception.AdcDaBaseException;
|
import com.adc.da.util.exception.AdcDaBaseException;
|
||||||
import com.adc.da.util.utils.IOUtils;
|
import com.adc.da.util.utils.IOUtils;
|
||||||
import com.adc.da.util.utils.StringUtils;
|
import com.adc.da.util.utils.StringUtils;
|
||||||
@@ -31,7 +33,10 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
||||||
|
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||||
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@@ -46,9 +51,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.File;
|
import java.io.*;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -438,5 +441,67 @@ public class SarBussionessStandController extends BaseController<SarBussionessSt
|
|||||||
public ResponseMessage newRpetitionFile (){
|
public ResponseMessage newRpetitionFile (){
|
||||||
return sarBussionessStandEOService.newRpetitionFile();
|
return sarBussionessStandEOService.newRpetitionFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "|SarBussionessStand|导入模板下载")
|
||||||
|
@GetMapping("/exportTemplateFile")
|
||||||
|
public void exportTemplateFile(String fileName,HttpServletResponse response, HttpServletRequest request)throws Exception{
|
||||||
|
|
||||||
|
OutputStream os = null;
|
||||||
|
OutputStream excelOS = null;
|
||||||
|
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||||
|
String fileOriName = "标准导入模板";
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNotEmpty(fileName)) {
|
||||||
|
fileOriName = fileName;
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
//创建临时文件夹
|
||||||
|
String fileNowPath = filePath + "/tempZip/" + UUIDUtils.randomUUID20() + "/" + fileOriName;
|
||||||
|
File nowFile = new File(fileNowPath);
|
||||||
|
if (nowFile.exists()){
|
||||||
|
nowFile.delete();
|
||||||
|
}
|
||||||
|
nowFile.mkdirs();
|
||||||
|
String fileName2 = "导入模板.xls";
|
||||||
|
HSSFSheet sheetItems = workbook.createSheet("模板");
|
||||||
|
sheetItems.setDefaultColumnWidth(16);
|
||||||
|
HSSFCellStyle cellStyle =workbook.createCellStyle();
|
||||||
|
cellStyle.setWrapText(true);
|
||||||
|
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
|
Row rowHeader = sheetItems.createRow(0);//开始创建标题行
|
||||||
|
String exportFieldName = FieldConvertUtil.exportFieldName;
|
||||||
|
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(exportFieldName)) {
|
||||||
|
String[] headerArr = exportFieldName.split(",");
|
||||||
|
for (int i=0;i < headerArr.length; i++) {
|
||||||
|
rowHeader.createCell(i).setCellValue(headerArr[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String repFileName = fileName2.replaceAll("/","_");
|
||||||
|
excelOS = new FileOutputStream(fileNowPath + "/" + repFileName);
|
||||||
|
response.setHeader("Content-Disposition",
|
||||||
|
"attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\"");
|
||||||
|
response.setContentType("application/force-download");
|
||||||
|
response.flushBuffer();
|
||||||
|
os = response.getOutputStream();
|
||||||
|
workbook.write(excelOS);
|
||||||
|
excelOS.flush();
|
||||||
|
excelOS.close();
|
||||||
|
ZipUtil.zip(fileNowPath,fileNowPath+".zip");
|
||||||
|
FileInputStream fis = new FileInputStream(fileNowPath+".zip");
|
||||||
|
int len = 0;
|
||||||
|
while ((len = fis.read()) != -1) {
|
||||||
|
os.write(len);
|
||||||
|
}
|
||||||
|
os.flush();
|
||||||
|
os.close(); // 后开先关
|
||||||
|
fis.close(); // 先开后关
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getMessage(), e);
|
||||||
|
throw new com.adc.da.exception.AdcDaBaseException("下载文件失败,请重试");
|
||||||
|
} finally {
|
||||||
|
org.apache.poi.util.IOUtils.closeQuietly(os);
|
||||||
|
org.apache.poi.util.IOUtils.closeQuietly(excelOS);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+82
-30
@@ -66,6 +66,7 @@ import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
|
|||||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||||
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||||
|
import com.adc.da.slrs.sarVppsTree.dao.SarVppsTreeDao;
|
||||||
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||||
import com.adc.da.sys.constant.ValueStateEnum;
|
import com.adc.da.sys.constant.ValueStateEnum;
|
||||||
import com.adc.da.sys.dao.DicTypeEODao;
|
import com.adc.da.sys.dao.DicTypeEODao;
|
||||||
@@ -106,6 +107,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.test.context.testng.AbstractTestNGSpringContextTests;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.net.ssl.*;
|
import javax.net.ssl.*;
|
||||||
@@ -251,6 +253,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ITsResourceService tsResourceService;
|
private ITsResourceService tsResourceService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SarVppsTreeDao sarVppsTreeDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SarBussionessStand getStandInfoByReviseStatus(String reviseStatus,String standSort,String taskId){
|
public SarBussionessStand getStandInfoByReviseStatus(String reviseStatus,String standSort,String taskId){
|
||||||
SarBussionessStand bussionessStand = new SarBussionessStand();
|
SarBussionessStand bussionessStand = new SarBussionessStand();
|
||||||
@@ -2036,13 +2041,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
public ResponseMessage<String> importSarBussionessStandFile(MultipartFile file,String menuId)throws Exception {
|
public ResponseMessage<String> importSarBussionessStandFile(MultipartFile file,String menuId)throws Exception {
|
||||||
|
|
||||||
List<TsResource> tsResources = tsResourceService.getByMenuId(menuId);
|
List<TsResource> tsResources = tsResourceService.getByMenuId(menuId);
|
||||||
if (ObjectUtils.isEmpty(tsResources)){
|
if (ObjectUtils.isNotEmpty(tsResources)) {
|
||||||
return Result.error("请选择目录进行导入");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//给出头部信息
|
//给出头部信息
|
||||||
String[] headerExcel = {"企标类别,标准年份,企标编号,中文名称,英文名称,文本状态,发布日期,企标实施日期,企标制修订状态,起草部门,废止日期,代替企标编号,复审日期,起草人,被代替企标编号,采用标准,文件上传人员,采标程度,引用标准,适用车型,能源类型,适用产品线,上传时间,体系类别,备案日期,关联模块-乘用车VPPS编码,关联模块--乘用车vpps中文名称,关联模块--卡车VPPS编码,关联模块--卡车vpps中文名称,发布稿附件,编制说明附件,历史版本附件,其他文件附件,修改单附件,关联文件附件,"};
|
String[] headerExcel = {"企标类别,标准年份,企标编号,中文名称,英文名称,文本状态,发布日期,企标实施日期,企标制修订状态,起草部门,代替企标编号,复审日期,起草人,被代替企标编号,采用标准,文件上传人员,采标程度,引用标准,适用车型,能源类型,适用产品线,体系类别,备案日期,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,发布稿附件,编制说明附件,历史版本附件,其他文件附件,修改单附件,关联文件附件,"};
|
||||||
|
|
||||||
//获取文件全称
|
//获取文件全称
|
||||||
String fileNameStr = file.getOriginalFilename();
|
String fileNameStr = file.getOriginalFilename();
|
||||||
@@ -2210,19 +2211,18 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
return Result.error("文本状态不能为空");
|
return Result.error("文本状态不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleDateFormat sdfs = new SimpleDateFormat("yyyy-MM-dd");
|
String issueTimeStr =rowList.get("发布日期");
|
||||||
|
if (issueTimeStr.contains("-")) {
|
||||||
Date issueTime = sdfs.parse( rowList.get("发布日期"));
|
|
||||||
String issueTimeStr = sdfs.format(issueTime);
|
|
||||||
if (StringUtils.isNotBlank(issueTimeStr)){
|
|
||||||
sarBussStandAttrInfo.setIssueTime(issueTimeStr);
|
sarBussStandAttrInfo.setIssueTime(issueTimeStr);
|
||||||
|
}else {
|
||||||
|
return Result.error("发布日期格式必须为年-月-日");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String putTimeStr = rowList.get("企标实施日期");
|
||||||
Date putTime = sdfs.parse(rowList.get("企标实施日期"));
|
if (putTimeStr.contains("-")) {
|
||||||
String putTimeStr = sdfs.format(putTime);
|
|
||||||
if (StringUtils.isNotBlank(putTimeStr)){
|
|
||||||
sarBussStandAttrInfo.setPutTime(putTimeStr);
|
sarBussStandAttrInfo.setPutTime(putTimeStr);
|
||||||
|
}else {
|
||||||
|
return Result.error("企标实施日期格式必须为年-月-日");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2237,18 +2237,15 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
sarBussStandAttrInfo.setQcdw(qcdw);
|
sarBussStandAttrInfo.setQcdw(qcdw);
|
||||||
}
|
}
|
||||||
|
|
||||||
String fzrqbuss = rowList.get("废止日期");
|
|
||||||
if (StringUtils.isNotBlank(fzrqbuss)){
|
|
||||||
sarBussStandAttrInfo.setFzrqbuss(fzrqbuss);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
String dtqbbhbuss = rowList.get("代替企标编号");
|
String dtqbbhbuss = rowList.get("代替企标编号");
|
||||||
sarBussStandAttrInfo.setDtqbbhbuss(dtqbbhbuss);
|
sarBussStandAttrInfo.setDtqbbhbuss(dtqbbhbuss);
|
||||||
|
|
||||||
String fsrqbuss = rowList.get("复审日期");
|
String fsrqbuss = rowList.get("复审日期");
|
||||||
if (StringUtils.isNotBlank(fsrqbuss)){
|
if (fsrqbuss.contains("-")) {
|
||||||
sarBussStandAttrInfo.setFsrqbuss(fsrqbuss);
|
sarBussStandAttrInfo.setFsrqbuss(fsrqbuss);
|
||||||
|
}else {
|
||||||
|
return Result.error("复审日期格式必须为年-月-日");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -2287,10 +2284,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String sycpxclass = rowList.get("适用产品线");
|
String sycpxclass = rowList.get("适用产品线");
|
||||||
sarBussStandAttrInfo.setSycpxclass(sycpxclass);
|
sarBussStandAttrInfo.setSycpxclass(sycpxclass);
|
||||||
|
|
||||||
String xcsjbuss = rowList.get("上传时间");
|
//上传时间
|
||||||
if (StringUtils.isNotBlank(xcsjbuss)){
|
Date date = new Date();
|
||||||
sarBussStandAttrInfo.setXcsjbuss(xcsjbuss);
|
String format = sdf.format(date);
|
||||||
}
|
sarBussStandAttrInfo.setXcsjbuss(format);
|
||||||
|
|
||||||
|
|
||||||
String txlbbuss = rowList.get("体系类别");
|
String txlbbuss = rowList.get("体系类别");
|
||||||
@@ -2298,31 +2295,39 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
|
|
||||||
//// //备案日期 22
|
//// //备案日期 22
|
||||||
String barq = rowList.get("备案日期");
|
String barq = rowList.get("备案日期");
|
||||||
|
if (barq.contains("-")){
|
||||||
sarBussStandAttrInfo.setBarq(barq);
|
sarBussStandAttrInfo.setBarq(barq);
|
||||||
|
}else {
|
||||||
|
return Result.error("备案日期格式必须为年-月-日");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//// //关联模块-乘用车VPPS编码 23
|
//// //关联模块-乘用车VPPS编码 23
|
||||||
String cycvppsbmbuss = rowList.get("关联模块-乘用车VPPS编码");
|
String cycvppsbmbuss = rowList.get("关联模块-乘用车VPPS编码");
|
||||||
sarBussStandAttrInfo.setCycvppsbmbuss(cycvppsbmbuss);
|
sarBussStandAttrInfo.setCycvppsbmbuss(cycvppsbmbuss);
|
||||||
|
|
||||||
//// //关联模块--乘用车vpps中文名称 24
|
// 关联模块-乘用车VPPS名称 24
|
||||||
String cycvppscnbuss = rowList.get("关联模块--乘用车vpps中文名称");
|
String cycvppscnbuss = sarVppsTreeDao.getCycvppscnbuss(sarBussStandAttrInfo.getCycvppsbmbuss());
|
||||||
sarBussStandAttrInfo.setCycvppscnbuss(cycvppscnbuss);
|
sarBussStandAttrInfo.setCycvppscnbuss(cycvppscnbuss);
|
||||||
|
|
||||||
//// //关联模块--卡车VPPS编码 25
|
//// //关联模块--卡车VPPS编码 25
|
||||||
String kcvppsbmbuss = rowList.get("关联模块--卡车VPPS编码");
|
String kcvppsbmbuss = rowList.get("关联模块--卡车VPPS编码");
|
||||||
sarBussStandAttrInfo.setKcvppsbmbuss(kcvppsbmbuss);
|
sarBussStandAttrInfo.setKcvppsbmbuss(kcvppsbmbuss);
|
||||||
|
|
||||||
//// //关联模块--卡车vpps中文名称 26
|
//关联模块--卡车VPPS名称 26
|
||||||
String kcvppscnbuss = rowList.get("关联模块--卡车vpps中文名称");
|
String kcvppscnbuss = sarVppsTreeDao.getKcvppscnbuss(sarBussStandAttrInfo.getKcvppsbmbuss());
|
||||||
sarBussStandAttrInfo.setKcvppscnbuss(kcvppscnbuss);
|
sarBussStandAttrInfo.setKcvppscnbuss(kcvppscnbuss);
|
||||||
|
|
||||||
|
|
||||||
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 = "";
|
||||||
if (split.length != 0) {
|
if (split.length != 0) {
|
||||||
for (int j = 0; j < split.length; j++) {
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
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")) {
|
||||||
String name = fileInfo.getName();
|
String name = fileInfo.getName();
|
||||||
String[] split1 = fileInfo.toString().split(name);
|
String[] split1 = fileInfo.toString().split(name);
|
||||||
File files = new File(split1[0] + split[j]);
|
File files = new File(split1[0] + split[j]);
|
||||||
@@ -2332,6 +2337,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
} else {
|
} else {
|
||||||
s = attFileVo.getAttId();
|
s = attFileVo.getAttId();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
logger.info(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
|
return Result.error(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setFbgbuss(s);
|
sarBussStandAttrInfo.setFbgbuss(s);
|
||||||
}
|
}
|
||||||
@@ -2343,6 +2352,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String s = "";
|
String s = "";
|
||||||
if (split.length != 0) {
|
if (split.length != 0) {
|
||||||
for (int j = 0; j < split.length; j++) {
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
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")) {
|
||||||
String name = fileInfo.getName();
|
String name = fileInfo.getName();
|
||||||
String[] split1 = fileInfo.toString().split(name);
|
String[] split1 = fileInfo.toString().split(name);
|
||||||
File files = new File(split1[0] + split[j]);
|
File files = new File(split1[0] + split[j]);
|
||||||
@@ -2352,6 +2365,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
} else {
|
} else {
|
||||||
s = attFileVo.getAttId();
|
s = attFileVo.getAttId();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
logger.info(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
|
return Result.error(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setBzsmbuss(s);
|
sarBussStandAttrInfo.setBzsmbuss(s);
|
||||||
}
|
}
|
||||||
@@ -2363,6 +2380,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String s = "";
|
String s = "";
|
||||||
if (split.length != 0) {
|
if (split.length != 0) {
|
||||||
for (int j = 0; j < split.length; j++) {
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
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")) {
|
||||||
String name = fileInfo.getName();
|
String name = fileInfo.getName();
|
||||||
String[] split1 = fileInfo.toString().split(name);
|
String[] split1 = fileInfo.toString().split(name);
|
||||||
File files = new File(split1[0] + split[j]);
|
File files = new File(split1[0] + split[j]);
|
||||||
@@ -2372,6 +2393,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
} else {
|
} else {
|
||||||
s = attFileVo.getAttId();
|
s = attFileVo.getAttId();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
logger.info(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
|
return Result.error(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setLsbbbuss(s);
|
sarBussStandAttrInfo.setLsbbbuss(s);
|
||||||
}
|
}
|
||||||
@@ -2383,6 +2408,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String s = "";
|
String s = "";
|
||||||
if (split.length != 0) {
|
if (split.length != 0) {
|
||||||
for (int j = 0; j < split.length; j++) {
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
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")) {
|
||||||
String name = fileInfo.getName();
|
String name = fileInfo.getName();
|
||||||
String[] split1 = fileInfo.toString().split(name);
|
String[] split1 = fileInfo.toString().split(name);
|
||||||
File files = new File(split1[0] + split[j]);
|
File files = new File(split1[0] + split[j]);
|
||||||
@@ -2392,6 +2421,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
} else {
|
} else {
|
||||||
s = attFileVo.getAttId();
|
s = attFileVo.getAttId();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
logger.info(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx/png格式的附件");
|
||||||
|
return Result.error(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx/png格式的附件");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setQtwjbuss(s);
|
sarBussStandAttrInfo.setQtwjbuss(s);
|
||||||
}
|
}
|
||||||
@@ -2403,6 +2436,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String s = "";
|
String s = "";
|
||||||
if (split.length != 0) {
|
if (split.length != 0) {
|
||||||
for (int j = 0; j < split.length; j++) {
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
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")) {
|
||||||
String name = fileInfo.getName();
|
String name = fileInfo.getName();
|
||||||
String[] split1 = fileInfo.toString().split(name);
|
String[] split1 = fileInfo.toString().split(name);
|
||||||
File files = new File(split1[0] + split[j]);
|
File files = new File(split1[0] + split[j]);
|
||||||
@@ -2412,6 +2449,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
} else {
|
} else {
|
||||||
s = attFileVo.getAttId();
|
s = attFileVo.getAttId();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
logger.info(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
|
return Result.error(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setXgd(s);
|
sarBussStandAttrInfo.setXgd(s);
|
||||||
}
|
}
|
||||||
@@ -2423,6 +2464,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
String s = "";
|
String s = "";
|
||||||
if (split.length != 0) {
|
if (split.length != 0) {
|
||||||
for (int j = 0; j < split.length; j++) {
|
for (int j = 0; j < split.length; j++) {
|
||||||
|
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")) {
|
||||||
String name = fileInfo.getName();
|
String name = fileInfo.getName();
|
||||||
String[] split1 = fileInfo.toString().split(name);
|
String[] split1 = fileInfo.toString().split(name);
|
||||||
File files = new File(split1[0] + split[j]);
|
File files = new File(split1[0] + split[j]);
|
||||||
@@ -2432,6 +2477,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
} else {
|
} else {
|
||||||
s = attFileVo.getAttId();
|
s = attFileVo.getAttId();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
logger.info(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
|
return Result.error(fjName + "格式不正确,请上传pdf/ppt/pptx/doc/docx/xls/xlsx格式的附件");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sarBussStandAttrInfo.setGlwjbuss(s);
|
sarBussStandAttrInfo.setGlwjbuss(s);
|
||||||
}
|
}
|
||||||
@@ -2467,6 +2516,9 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
FileUnZip.deleteDir(saveDirectory);
|
FileUnZip.deleteDir(saveDirectory);
|
||||||
return Result.error("导入失败,没有可导入的数据,请检查!");
|
return Result.error("导入失败,没有可导入的数据,请检查!");
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
return Result.error("请选择目录进行导入");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<File> readImpExcelFile(String path) {
|
private static List<File> readImpExcelFile(String path) {
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package com.adc.da.slrs.sarVppsTree.dao;
|
|||||||
|
|
||||||
import com.adc.da.slrs.sarVppsTree.entity.SarVppsTree;
|
import com.adc.da.slrs.sarVppsTree.entity.SarVppsTree;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -13,4 +15,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
*/
|
*/
|
||||||
public interface SarVppsTreeDao extends BaseMapper<SarVppsTree> {
|
public interface SarVppsTreeDao extends BaseMapper<SarVppsTree> {
|
||||||
|
|
||||||
|
@Select("select sar_vpps_tree.CHINESE_NAME from sar_vpps_tree where sar_vpps_tree.VPPS_CODE = #{cycvppsbmbuss} and sar_vpps_tree.TYPE = 'car';")
|
||||||
|
String getCycvppscnbuss(@Param("cycvppsbmbuss") String cycvppsbmbuss);
|
||||||
|
|
||||||
|
@Select("select sar_vpps_tree.CHINESE_NAME from sar_vpps_tree where sar_vpps_tree.VPPS_CODE = #{kcvppsbmbuss} and sar_vpps_tree.TYPE = 'truck';")
|
||||||
|
String getKcvppscnbuss(@Param("kcvppsbmbuss") String kcvppsbmbuss);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ public class FieldConvertUtil {
|
|||||||
"在产车实施日期(项目),EOP实施日期(项目),实施说明,认证交付物,认证对象,监管类型,适用车辆类型,责任部门,相关部门,FO,项目评估角色," +
|
"在产车实施日期(项目),EOP实施日期(项目),实施说明,认证交付物,认证对象,监管类型,适用车辆类型,责任部门,相关部门,FO,项目评估角色," +
|
||||||
"文本说明,标签,要求类型,清单类型,入库模块";
|
"文本说明,标签,要求类型,清单类型,入库模块";
|
||||||
|
|
||||||
|
public static String exportFieldName = "企标类别,标准年份,企标编号,中文名称,英文名称,文本状态,发布日期,企标实施日期,企标制修订状态,起草部门,代替企标编号,复审日期,起草人,被代替企标编号,采用标准,文件上传人员,采标程度,引用标准,适用车型,能源类型,适用产品线,体系类别,备案日期,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,发布稿附件,编制说明附件,历史版本附件,其他文件附件,修改单附件,关联文件附件";
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* @Description: Clob类型 转String
|
* @Description: Clob类型 转String
|
||||||
* @Author: super_liu
|
* @Author: super_liu
|
||||||
|
|||||||
Reference in New Issue
Block a user