feat: 迁移国内标准法规部分1
This commit is contained in:
@@ -0,0 +1,178 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
||||
import org.apache.commons.compress.archivers.zip.ZipFile;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.util.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
|
||||
public class FileUnZip {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(FileUnZip.class);
|
||||
|
||||
/**
|
||||
* 解压zip文件
|
||||
*
|
||||
* @param sourceFile,待解压的zip文件; toFolder,解压后的存放路径
|
||||
* @throws Exception
|
||||
* @author gaoyan
|
||||
**/
|
||||
public static String unZipFiles(String sourceFile, String descDir) throws IOException {
|
||||
File zipFile = new File(sourceFile);
|
||||
|
||||
File pathFile = new File(descDir);
|
||||
if (!pathFile.exists()) {
|
||||
pathFile.mkdirs();
|
||||
}
|
||||
ZipFile zip = new ZipFile(zipFile,"gbk");
|
||||
String orgMkdirs = "";
|
||||
for (Enumeration entries = zip.getEntries(); entries.hasMoreElements(); ) {
|
||||
ZipArchiveEntry entry = (ZipArchiveEntry) entries.nextElement();
|
||||
String zipEntryName = entry.getName();
|
||||
String outPath = (descDir + "/" + zipEntryName).replaceAll("\\*", "/");
|
||||
//判断路径是否存在,不存在则创建文件路径
|
||||
File file = new File(outPath.substring(0, outPath.lastIndexOf('/')));
|
||||
if (!file.exists()) {
|
||||
orgMkdirs = outPath.substring(0, outPath.lastIndexOf('/'));
|
||||
file.mkdirs();
|
||||
}else{
|
||||
orgMkdirs = outPath.substring(0, outPath.lastIndexOf('/'));
|
||||
}
|
||||
//判断文件全路径是否为文件夹,如果是上面已经上传,不需要解压
|
||||
if (new File(outPath).isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
//输出文件路径信息
|
||||
// InputStream in = null;
|
||||
// OutputStream out = null;
|
||||
System.gc();
|
||||
try(InputStream in =zip.getInputStream(entry);
|
||||
OutputStream out =new FileOutputStream(outPath)
|
||||
){
|
||||
byte[] buf1 = new byte[1024];
|
||||
int len;
|
||||
while ((len = in.read(buf1)) > 0) {
|
||||
out.write(buf1, 0, len);
|
||||
}
|
||||
}catch(IOException e){
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
System.gc();
|
||||
zip.close();
|
||||
return orgMkdirs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归删除文件及文件夹
|
||||
*
|
||||
* @throws Exception
|
||||
* @author gaoyan
|
||||
* toFolder,解压后的存放路径
|
||||
**/
|
||||
public static boolean deleteDir(File dir) {
|
||||
if (dir.isDirectory()) {
|
||||
String[] children = dir.list();
|
||||
for (int i = 0; i < children.length; i++) {
|
||||
File files = new File(dir, children[i]);
|
||||
boolean success = deleteDir(files);
|
||||
if (!success) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 目录此时为空,可以删除
|
||||
return dir.delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取一个目录下所有的Excel文件
|
||||
* gaoyan
|
||||
*
|
||||
* @param path
|
||||
*/
|
||||
public static List<File> readExcelFile(String path) {
|
||||
File file = new File(path);
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
// 对文件进行过滤,只读取Excel文件
|
||||
if (fi.getName().contains(".xls") || fi.getName().contains(".xlsx")) {
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
public static List<File> readImpExcelFile(String path) {
|
||||
File file = new File(path);
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
// 对文件进行过滤,只读取Excel文件
|
||||
String name = fi.getName();
|
||||
// "导入模板".equals(fi.getName()) || "导入模板.xlsx".equals(fi.getName())
|
||||
if (name != null &&( fi.getName().contains(".xls") || fi.getName().contains(".xlsx") )){
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件名称读取固定目录下文件
|
||||
* gaoyan
|
||||
* @param filename
|
||||
*/
|
||||
public static List<File> readFileByFilename(String path,String filename) {
|
||||
List<File> resultlist = new ArrayList<>();
|
||||
if (StringUtils.isNotEmpty(path)){
|
||||
File file = new File(path);
|
||||
if (file.isDirectory()) {
|
||||
File[] files = file.listFiles();
|
||||
for (File fi : files) {
|
||||
// 对文件进行过滤
|
||||
if (fi.getName().equals(filename)) {
|
||||
resultlist.add(fi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
/**
|
||||
*@Description: 删除某个文件
|
||||
*@Param: [file]
|
||||
*@return: void
|
||||
*@Author: duyunbao
|
||||
*@date: 2019/5/23 20:31
|
||||
*/
|
||||
public static void delete(File file) {
|
||||
if (!file.exists()) return;
|
||||
|
||||
if (file.isFile() || file.list() == null) {
|
||||
file.delete();
|
||||
logger.info("删除了" + file.getName());
|
||||
} else {
|
||||
File[] files = file.listFiles();
|
||||
for (File a : files) {
|
||||
delete(a);
|
||||
}
|
||||
file.delete();
|
||||
logger.info("删除了" + file.getName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
public class HandleFileIOMsg {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(HandleFileIOMsg.class);
|
||||
|
||||
/**
|
||||
* @Description: 根据文件地址转换为base64编码字符串
|
||||
*/
|
||||
public String getFileBase64Str(String filePath) throws Exception {
|
||||
byte[] data = null;
|
||||
try (InputStream inputStream = new FileInputStream(filePath)){
|
||||
File file = new File(filePath);
|
||||
data = new byte[(int) file.length()];
|
||||
inputStream.read(data);
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
logger.info(e.getMessage(),e);
|
||||
}
|
||||
// 加密
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
String codeStr = "";
|
||||
if(data != null){
|
||||
codeStr = encoder.encode(data);
|
||||
codeStr = codeStr.replaceAll("\r|\n", "");
|
||||
}
|
||||
return codeStr;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import cn.afterturn.easypoi.handler.impl.ExcelDataHandlerDefaultImpl;
|
||||
import cn.afterturn.easypoi.util.PoiPublicUtil;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class MapImportHandler extends ExcelDataHandlerDefaultImpl<Map<String, Object>> {
|
||||
|
||||
@Override
|
||||
public void setMapValue(Map<String, Object> map, String originKey, Object value) {
|
||||
if (value instanceof Double) {
|
||||
map.put(originKey, PoiPublicUtil.doubleToString((Double) value));
|
||||
} else {
|
||||
map.put(originKey, value != null ? value.toString() : null);
|
||||
}
|
||||
}
|
||||
|
||||
private String getRealKey(String originKey) {
|
||||
if (originKey.equals("交易账户")) {
|
||||
return "accountNo";
|
||||
}
|
||||
if (originKey.equals("姓名")) {
|
||||
return "name";
|
||||
}
|
||||
if (originKey.equals("客户类型")) {
|
||||
return "type";
|
||||
}
|
||||
return originKey;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: 项目库标准符合性枚举类
|
||||
* @Author: super_liu
|
||||
* date: 2020/11/5 14:14
|
||||
*/
|
||||
public enum ProcessConformStateEnum {
|
||||
|
||||
CHECK("3","待验证"),FIT("1","符合"),
|
||||
UNFIT("2","不符合"),
|
||||
NOT_INVOLVE("4","不涉及");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private ProcessConformStateEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 标准库参数类型枚举设置
|
||||
* @author gaoyan
|
||||
* date 2018/09/03
|
||||
*/
|
||||
public enum PropertyTypeEnum {
|
||||
|
||||
PROVETYPE("PROVETYPE","适用车型"),APPLY_ARCTIC("APPLY_ARCTIC","适用车型"),
|
||||
ENERGY_KIND("ENERGY_KIND","能源种类"),APPLY_AUTH("APPLY_AUTH","适用认证"),
|
||||
CAR_MODEL("CAR_MODEL","公告车型号"),
|
||||
CATEGORY("CATEGORY","所属专业领域"),PRODUCT_TYPE("PRODUCT_TYPE","产品类别");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private PropertyTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
/**
|
||||
* @des : excel信息读取
|
||||
* @author: duyunbao
|
||||
* @email: 1114808306@qq.com
|
||||
* @date 2017/10/27 17:06
|
||||
**/
|
||||
public class ReadExcel {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ReadExcel.class);
|
||||
|
||||
/**
|
||||
* 总行数
|
||||
*/
|
||||
private int totalRows = 0;
|
||||
/**
|
||||
* 总条数
|
||||
*/
|
||||
private int totalCells = 0;
|
||||
/**
|
||||
* 错误信息接收器
|
||||
*/
|
||||
private String errorMsg;
|
||||
|
||||
public ReadExcel() {
|
||||
// 不做操作
|
||||
}
|
||||
|
||||
public int getTotalRows() {
|
||||
return totalRows;
|
||||
}
|
||||
|
||||
public int getTotalCells() {
|
||||
return totalCells;
|
||||
}
|
||||
|
||||
public String getErrorInfo() {//获取错误信息
|
||||
return errorMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* @method_name: validateExcel
|
||||
* @des : 验证excel格式
|
||||
* @author: duyunbao
|
||||
* @param: [filePath]
|
||||
* @return: boolean
|
||||
* @date: 2017/10/27 17:07
|
||||
**/
|
||||
public boolean validateExcel(String filePath) {
|
||||
if (filePath == null || !(WDWUtil.isExcel2003(filePath) || WDWUtil.isExcel2007(filePath))) {
|
||||
errorMsg = "文件名不是excel格式";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @method_name: getExcelInfo
|
||||
* @des : 读EXCEL文件,获取信息集合
|
||||
* @author: duyunbao
|
||||
* @param: [fileName, Mfile]
|
||||
* @return: org.apache.poi.ss.usermodel.Workbook
|
||||
* @date: 2017/10/27 17:08
|
||||
**/
|
||||
public Workbook getExcelInfo(String fileName, MultipartFile Mfile) {
|
||||
Workbook wb = null;
|
||||
//把spring文件上传的MultipartFile转换成CommonsMultipartFile类型
|
||||
CommonsMultipartFile cf = (CommonsMultipartFile) Mfile; //获取本地存储路径
|
||||
//初始化输入流
|
||||
InputStream is = null;
|
||||
try {
|
||||
//根据文件名判断文件是2003版本还是2007版本
|
||||
boolean isExcel2003 = true;
|
||||
if (WDWUtil.isExcel2007(fileName)) {
|
||||
isExcel2003 = false;
|
||||
}
|
||||
is = cf.getInputStream();
|
||||
//根据excel里面的内容读取客户信息
|
||||
wb = getExcelInfo(is, isExcel2003, wb);
|
||||
is.close();
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
} finally {
|
||||
if (is != null) {
|
||||
try {
|
||||
is.close();
|
||||
} catch (IOException e) {
|
||||
is = null;
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return wb;
|
||||
}
|
||||
|
||||
/***
|
||||
* @method_name: getExcelInfo
|
||||
* @des : 判断excel版本
|
||||
* @author: duyunbao
|
||||
* @param: [is, isExcel2003, wb]
|
||||
* @return: org.apache.poi.ss.usermodel.Workbook
|
||||
* @date: 2017/10/27 17:08
|
||||
**/
|
||||
private Workbook getExcelInfo(InputStream is, boolean isExcel2003, Workbook wb) {
|
||||
Workbook workbook =wb;
|
||||
try {
|
||||
/** 根据版本选择创建Workbook的方式 */
|
||||
//当excel是2003时
|
||||
if (isExcel2003) {
|
||||
workbook = new HSSFWorkbook(is);
|
||||
} else {//当excel是2007时
|
||||
workbook = new XSSFWorkbook(is);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
return workbook;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取sheet的名称
|
||||
* @MethodName:getSheetName
|
||||
* @author: 马晓晨
|
||||
* @email: 747052172@qq.com
|
||||
* @date 2017年11月24日 上午9:49:22
|
||||
* @version V1.0
|
||||
* @param filename
|
||||
* @param file
|
||||
* @param sheetIndex
|
||||
* @return
|
||||
*/
|
||||
public String getSheetName(String filename, MultipartFile file, Integer sheetIndex) {
|
||||
Workbook wb = getExcelInfo(filename, file);
|
||||
return wb.getSheetName(sheetIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @Title: encodeFileName
|
||||
* @Description: 导出文件转换文件名称编码
|
||||
* @param @param fileNames
|
||||
* @param @param request
|
||||
* @param @return 设定文件
|
||||
* @return String 返回类型
|
||||
* @throws
|
||||
*/
|
||||
public static String encodeFileName(String fileNames , HttpServletRequest request) {
|
||||
try {
|
||||
String agent = request.getHeader("User-Agent");
|
||||
if (agent.contains("Firefox")) {
|
||||
fileNames = new String(fileNames.getBytes("UTF-8"), "ISO8859-1"); // firefox浏览器
|
||||
} else {
|
||||
fileNames = URLEncoder.encode(fileNames, "utf-8");
|
||||
//谷歌中空格变为+问题
|
||||
fileNames = fileNames.replaceAll("\\+","%20");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
return fileNames ;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,236 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFTable;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFTableCell;
|
||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDecimalNumber;
|
||||
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTcPr;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: super_liu
|
||||
* date: 2020/2/25 16:58
|
||||
*/
|
||||
public class ReadWordTable {
|
||||
|
||||
|
||||
/**
|
||||
* 保存生成HTML时需要被忽略的单元格
|
||||
*/
|
||||
private List<String> omitCellsList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 生成忽略的单元格列表中的格式
|
||||
*
|
||||
* @param row
|
||||
* @param col
|
||||
* @return
|
||||
*/
|
||||
public String generateOmitCellStr(int row, int col) {
|
||||
return row + ":" + col;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前单元格的colspan(列合并)的列数
|
||||
*
|
||||
* @param tcPr 单元格属性
|
||||
* @return
|
||||
*/
|
||||
public int getColspan(CTTcPr tcPr) {
|
||||
// 判断是否存在列合并
|
||||
CTDecimalNumber gridSpan = null;
|
||||
if ((gridSpan = tcPr.getGridSpan()) != null) { // 合并的起始列
|
||||
// 获取合并的列数
|
||||
BigInteger num = gridSpan.getVal();
|
||||
return num.intValue();
|
||||
} else { // 其他被合并的列或正常列
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前单元格的rowspan(行合并)的行数
|
||||
*
|
||||
* @param table 表格
|
||||
* @param row 行值
|
||||
* @param col 列值
|
||||
* @return
|
||||
*/
|
||||
public int getRowspan(XWPFTable table, int row, int col) {
|
||||
|
||||
XWPFTableCell cell = table.getRow(row).getCell(col);
|
||||
// 正常独立单元格
|
||||
if (!isContinueRow(cell) && !isRestartRow(cell)) {
|
||||
return 1;
|
||||
}
|
||||
// 当前单元格的宽度
|
||||
int cellWidth = getCellWidth(table, row, col);
|
||||
// 当前单元格距离左侧边框的距离
|
||||
int leftWidth = getLeftWidth(table, row, col);
|
||||
|
||||
// 用户保存当前单元格行合并的单元格数-1(因为不包含自身)
|
||||
List<Boolean> list = new ArrayList<>();
|
||||
getRowspan(table, row, cellWidth, leftWidth, list);
|
||||
|
||||
return list.size() + 1;
|
||||
}
|
||||
|
||||
private void getRowspan(XWPFTable table, int row, int cellWidth, int leftWidth,
|
||||
List<Boolean> list) {
|
||||
// 已达到最后一行
|
||||
if (row + 1 >= table.getNumberOfRows()) {
|
||||
return;
|
||||
}
|
||||
row = row + 1;
|
||||
int colsNum = table.getRow(row).getTableCells().size();
|
||||
// 因为列合并单元格可能导致行合并的单元格并不在同一列,所以从头遍历列,通过属性、宽度以及距离左边框间距来判断是否是行合并
|
||||
for (int i = 0; i < colsNum; i++) {
|
||||
XWPFTableCell testTable = table.getRow(row).getCell(i);
|
||||
// 是否为合并单元格的中间行(包括结尾行)
|
||||
if (isContinueRow(testTable)) {
|
||||
// 是被上一行单元格合并的单元格
|
||||
if (getCellWidth(table, row, i) == cellWidth
|
||||
&& getLeftWidth(table, row, i) == leftWidth) {
|
||||
list.add(true);
|
||||
// 被合并的单元格在生成html时需要忽略
|
||||
addOmitCell(row, i);
|
||||
// 去下一行继续查找
|
||||
getRowspan(table, row, cellWidth, leftWidth, list);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是合并行的起始行单元格
|
||||
*
|
||||
* @param tableCell
|
||||
* @return
|
||||
*/
|
||||
public boolean isRestartRow(XWPFTableCell tableCell) {
|
||||
CTTcPr tcPr = tableCell.getCTTc().getTcPr();
|
||||
if (tcPr.getVMerge() == null) {
|
||||
return false;
|
||||
}
|
||||
if (tcPr.getVMerge().getVal() == null) {
|
||||
return false;
|
||||
}
|
||||
if (tcPr.getVMerge().getVal().toString().equalsIgnoreCase("restart")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是合并行的中间行单元格(包括结尾的最后一行的单元格)
|
||||
*
|
||||
* @param tableCell
|
||||
* @return
|
||||
*/
|
||||
public boolean isContinueRow(XWPFTableCell tableCell) {
|
||||
CTTcPr tcPr = tableCell.getCTTc().getTcPr();
|
||||
if (tcPr.getVMerge() == null) {
|
||||
return false;
|
||||
}
|
||||
if (tcPr.getVMerge().getVal() == null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getLeftWidth(XWPFTable table, int row, int col) {
|
||||
int leftWidth = 0;
|
||||
for (int i = 0; i < col; i++) {
|
||||
leftWidth += getCellWidth(table, row, i);
|
||||
}
|
||||
return leftWidth;
|
||||
}
|
||||
|
||||
public int getCellWidth(XWPFTable table, int row, int col) {
|
||||
BigInteger width = table.getRow(row).getCell(col).getCTTc().getTcPr().getTcW().getW();
|
||||
return width.intValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加忽略的单元格(被行合并的单元格,生成HTML时需要忽略)
|
||||
*
|
||||
* @param row
|
||||
* @param col
|
||||
*/
|
||||
public void addOmitCell(int row, int col) {
|
||||
String omitCellStr = generateOmitCellStr(row, col);
|
||||
omitCellsList.add(omitCellStr);
|
||||
}
|
||||
|
||||
public boolean isOmitCell(int row, int col) {
|
||||
String cellStr = generateOmitCellStr(row, col);
|
||||
return omitCellsList.contains(cellStr);
|
||||
}
|
||||
|
||||
public String readTable(XWPFTable table) throws IOException {
|
||||
// 表格行数
|
||||
int tableRowsSize = table.getRows().size();
|
||||
StringBuilder tableToHtmlStr = new StringBuilder("<table>");
|
||||
|
||||
for (int i = 0; i < tableRowsSize; i++) {
|
||||
tableToHtmlStr.append("<tr>");
|
||||
int tableCellsSize = table.getRow(i).getTableCells().size();
|
||||
for (int j = 0; j < tableCellsSize; j++) {
|
||||
if (isOmitCell(i, j)) {
|
||||
continue;
|
||||
}
|
||||
XWPFTableCell tableCell = table.getRow(i).getCell(j);
|
||||
// 获取单元格的属性
|
||||
CTTcPr tcPr = tableCell.getCTTc().getTcPr();
|
||||
int colspan = getColspan(tcPr);
|
||||
if (colspan > 1) { // 合并的列
|
||||
tableToHtmlStr.append("<td colspan='" + colspan + "'");
|
||||
} else { // 正常列
|
||||
tableToHtmlStr.append("<td");
|
||||
}
|
||||
|
||||
int rowspan = getRowspan(table, i, j);
|
||||
if (rowspan > 1) { // 合并的行
|
||||
tableToHtmlStr.append(" rowspan='" + rowspan + "'>");
|
||||
} else {
|
||||
tableToHtmlStr.append(">");
|
||||
}
|
||||
String text = tableCell.getText();
|
||||
tableToHtmlStr.append(text + "</td>");
|
||||
|
||||
}
|
||||
tableToHtmlStr.append("</tr>");
|
||||
}
|
||||
tableToHtmlStr.append("</table>");
|
||||
|
||||
clearTableInfo();
|
||||
|
||||
return tableToHtmlStr.toString();
|
||||
}
|
||||
|
||||
public void clearTableInfo() {
|
||||
// System.out.println(omitCellsList);
|
||||
omitCellsList.clear();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
ReadWordTable readWordTable = new ReadWordTable();
|
||||
|
||||
try (FileInputStream fileInputStream = new FileInputStream("E:\\下载\\table1.docx");
|
||||
XWPFDocument document = new XWPFDocument(fileInputStream);) {
|
||||
List<XWPFTable> tables = document.getTables();
|
||||
for (XWPFTable table : tables) {
|
||||
System.out.println(readWordTable.readTable(table));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
public enum SarAskNatureEnum {
|
||||
ZR("ZR","准入"),ZRYY("ZRYY","准入引用"),
|
||||
UNFIT("ZRWG","准入无关");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarAskNatureEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: 自定义属性字段
|
||||
* date: 2020/11/5 14:14
|
||||
*/
|
||||
public enum SarAttrFieldEnum {
|
||||
|
||||
FO("FO","FO"),YQLX("YQLX","要求类型"),
|
||||
ZRBM("ZRBM","责任部门"),XMPGJS("XMPGJS","项目评估角色");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarAttrFieldEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @program: LAWSSystem
|
||||
* @description:
|
||||
* @version: 1.0
|
||||
* @author: LiuJiaQi
|
||||
* @create: 2020-11-03 15:09
|
||||
**/
|
||||
public class SarBussStandStatus {
|
||||
private Map<String,String> planStatusMap = new HashMap<String,String>();
|
||||
private Map<String,String> planTypeMap =new HashMap<String,String>();
|
||||
private Map<String,String> planStatusMapExport =new HashMap<String,String>();
|
||||
private Map<String,String> planTypeMapExport =new HashMap<String,String>();
|
||||
|
||||
public SarBussStandStatus() {
|
||||
planStatusMap.put("制定中", "1");
|
||||
planStatusMap.put("修订中", "2");
|
||||
planStatusMap.put("已发布", "3");
|
||||
planStatusMap.put("计划已确认", "4");
|
||||
planTypeMap.put("制定", "1");
|
||||
planTypeMap.put("修订", "2");
|
||||
//用于导出
|
||||
planStatusMapExport.put("1", "制定中");
|
||||
planStatusMapExport.put("2", "修订中");
|
||||
planStatusMapExport.put("3", "已发布");
|
||||
planStatusMapExport.put("4", "计划已确认");
|
||||
planTypeMapExport.put("1", "制定");
|
||||
planTypeMapExport.put("2", "修订");
|
||||
}
|
||||
|
||||
public Map<String, String> getPlanStatusMap() {
|
||||
return planStatusMap;
|
||||
}
|
||||
|
||||
public void setPlanStatusMap(Map<String, String> planStatusMap) {
|
||||
this.planStatusMap = planStatusMap;
|
||||
}
|
||||
|
||||
public Map<String, String> getPlanTypeMap() {
|
||||
return planTypeMap;
|
||||
}
|
||||
|
||||
public void setPlanTypeMap(Map<String, String> planTypeMap) {
|
||||
this.planTypeMap = planTypeMap;
|
||||
}
|
||||
|
||||
public Map<String, String> getPlanStatusMapExport() {
|
||||
return planStatusMapExport;
|
||||
}
|
||||
|
||||
public void setPlanStatusMapExport(Map<String, String> planStatusMapExport) {
|
||||
this.planStatusMapExport = planStatusMapExport;
|
||||
}
|
||||
|
||||
public Map<String, String> getPlanTypeMapExport() {
|
||||
return planTypeMapExport;
|
||||
}
|
||||
|
||||
public void setPlanTypeMapExport(Map<String, String> planTypeMapExport) {
|
||||
this.planTypeMapExport = planTypeMapExport;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: 项目库标准符合性枚举类
|
||||
* @Author: super_liu
|
||||
* date: 2020/11/5 14:14
|
||||
*/
|
||||
public enum SarConformStateEnum {
|
||||
|
||||
CHECK(1,"待验证"),FIT(2,"符合"),
|
||||
UNFIT(3,"不符合"),PART_FIT(4,"部分符合"),
|
||||
NOT_INVOLVE(5,"不涉及"),ASSESS(6,"评估中"),
|
||||
RESET(7,"整改中"),NOT_EVAL(8,"未评估");
|
||||
|
||||
private Integer value;
|
||||
private String lable;
|
||||
|
||||
private SarConformStateEnum(Integer value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 编号类型分类
|
||||
* @author gaoyan
|
||||
* date 2018/09/19
|
||||
*/
|
||||
public enum SarNumberTypeEnum {
|
||||
|
||||
STAND_NUMBER("STAND_NUMBER","标准编号"),LAWS_NUMBER("LAWS_NUMBER","文件号"),
|
||||
STAND_REPLACE_NUMBER("STAND_REPLACE_NUMBER","代替标准号"),LAWS_REPLACE_NUMBER("LAWS_REPLACE_NUMBER","代替文件号");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarNumberTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: 预警实施日期种类
|
||||
* @Author: super_liu
|
||||
* date: 2020/10/19 15:59
|
||||
*/
|
||||
public enum SarPutTimeEnum {
|
||||
XDXCSSRQ("XDXCSSRQ","新定型车实施日期"),ZCCSSRQ("ZCCSSRQ","在产车实施日期"),
|
||||
XSCCSSRQ("XSCCSSRQ","新生产车实施日期");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarPutTimeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: super_liu
|
||||
* date: 2020/12/18 13:51
|
||||
*/
|
||||
public enum SarStandStateEnum {
|
||||
|
||||
DRAFT("DRAFT","草稿"),ADVICE("ADVICE","征求意见稿"),
|
||||
SUBMIT("SUBMIT","送审稿"),RADYSUBMIT("RADYSUBMIT","报批稿"),
|
||||
FJNVYX9Q7J("FJNVYX9Q7J","发布稿"),ZTXXYX("ZTXXYX","计划修订"),
|
||||
ZTJJSS("ZTJJSS","修订中"),TOVOID("TOVOID","已作废"),
|
||||
N5KLTFLNRC("N5KLTFLNRC","已修订"),QBXDZ("XB2USRPXY5","企标修订中"),
|
||||
QBYZF("AY9L9FMSEW","企标已作废"),QBYXD("7ZT7YWXFPK","企标已修订"),
|
||||
QBJHYQR("4VKQX3V2QU","企标计划已确认"),QBYFB("N75QKJ5MWB","企标已发布");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarStandStateEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
|
||||
public static String getLableByVal(String val){
|
||||
for (SarStandStateEnum stateEnum : SarStandStateEnum.values()) {
|
||||
if (stateEnum.getValue() == val) {
|
||||
return stateEnum.getLable();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: 合规性分级颜色枚举
|
||||
* @Author: super_liu
|
||||
* date: 2021/3/10 15:45
|
||||
*/
|
||||
public enum SarStateColorEnum {
|
||||
|
||||
GREEN("green","绿色"),RED("red","红色"),BLUE("blue","蓝色"),
|
||||
YELLOW("yellow","黄色"),NA("grey","灰色"),NOT("notSure","未反馈");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarStateColorEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
public class SarSychronEO {
|
||||
|
||||
private String sychronId;
|
||||
|
||||
private String sarId;
|
||||
|
||||
private String sarNumber;
|
||||
|
||||
private String conflictType;
|
||||
|
||||
private String standName;
|
||||
|
||||
public String getSychronId() {
|
||||
return sychronId;
|
||||
}
|
||||
|
||||
public void setSychronId(String sychronId) {
|
||||
this.sychronId = sychronId;
|
||||
}
|
||||
|
||||
public String getSarId() {
|
||||
return sarId;
|
||||
}
|
||||
|
||||
public void setSarId(String sarId) {
|
||||
this.sarId = sarId;
|
||||
}
|
||||
|
||||
public String getSarNumber() {
|
||||
return sarNumber;
|
||||
}
|
||||
|
||||
public void setSarNumber(String sarNumber) {
|
||||
this.sarNumber = sarNumber;
|
||||
}
|
||||
|
||||
public String getConflictType() {
|
||||
return conflictType;
|
||||
}
|
||||
|
||||
public void setConflictType(String conflictType) {
|
||||
this.conflictType = conflictType;
|
||||
}
|
||||
|
||||
public String getStandName() {
|
||||
return standName;
|
||||
}
|
||||
|
||||
public void setStandName(String standName) {
|
||||
this.standName = standName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class SarSynInputEO {
|
||||
private String id;
|
||||
private String standSort;
|
||||
private String standNumber;
|
||||
private String standYear;
|
||||
private String standType;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifyTime;
|
||||
private String standName;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getStandSort() {
|
||||
return standSort;
|
||||
}
|
||||
|
||||
public void setStandSort(String standSort) {
|
||||
this.standSort = standSort;
|
||||
}
|
||||
|
||||
public String getStandNumber() {
|
||||
return standNumber;
|
||||
}
|
||||
|
||||
public void setStandNumber(String standNumber) {
|
||||
this.standNumber = standNumber;
|
||||
}
|
||||
|
||||
public String getStandYear() {
|
||||
return standYear;
|
||||
}
|
||||
|
||||
public void setStandYear(String standYear) {
|
||||
this.standYear = standYear;
|
||||
}
|
||||
|
||||
public String getStandType() {
|
||||
return standType;
|
||||
}
|
||||
|
||||
public void setStandType(String standType) {
|
||||
this.standType = standType;
|
||||
}
|
||||
|
||||
public Date getModifyTime() {
|
||||
return modifyTime;
|
||||
}
|
||||
|
||||
public void setModifyTime(Date modifyTime) {
|
||||
this.modifyTime = modifyTime;
|
||||
}
|
||||
|
||||
public String getStandName() {
|
||||
return standName;
|
||||
}
|
||||
|
||||
public void setStandName(String standName) {
|
||||
this.standName = standName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 标准法规分类
|
||||
* @author gaoyan
|
||||
* date 2018/09/19
|
||||
*/
|
||||
public enum SarTypeEnum {
|
||||
|
||||
INLAND_STAND("INLAND_STAND","国内标准法规"),INLAND_LAWS("INLAND_LAWS","国内政策"),
|
||||
FOREIGN_STAND("FOREIGN_STAND","国外标准法规"),FOREIGN_LAWS("FOREIGN_LAWS","国外政策"),
|
||||
STAND("STAND","国内外标准法规"),
|
||||
LAWS("LAWS","国内外政策"),
|
||||
BUSINESS("BUSINESS","企业标准"),
|
||||
BUSS("BUSS","企业标准"),
|
||||
SPLIT("SPLIT","标准拆分"),
|
||||
ACCESS("ACCESS","标准法规清单"),
|
||||
// 增加清单临时分类代码 后续通过同步按钮同步时切换类型
|
||||
INLAND_STAND_ACCESS("INLAND_STAND_ACCESS","国内标准法规清单"),
|
||||
FOREIGN_STAND_ACCESS("FOREIGN_STAND_ACCESS","国外标准法规清单"),
|
||||
FOREIGN_LAWS_ACCESS("FOREIGN_LAWS_ACCESS","国内外政策清单"),
|
||||
BUSS_ACCESS("BUSS","企业标准清单"),
|
||||
PRODUCT("PRODUCT","车型/项目库"),
|
||||
RECORDS("RECORDS","企标备案库");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SarTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: super_liu
|
||||
* date: 2020/12/17 11:23
|
||||
*/
|
||||
public enum SelectionTypeEnum {
|
||||
|
||||
ORGLIST("ORGLIST","组织机构"),USERLIST("USERLIST","用户"),
|
||||
ROLELIST("ROLELIST","角色"),SVPPS("SVPPS","SVPPS"),GZZXX("GZZXX","工作组信息");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SelectionTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 标准法规分类
|
||||
* @author gaoyan
|
||||
* date 2018/09/19
|
||||
*/
|
||||
public enum SorDivideEnum {
|
||||
|
||||
INLAND_STAND("INLAND_STAND","国内标准法规"),INLAND_LAWS("INLAND_LAWS","国内政策"),
|
||||
FOREIGN_STAND("FOREIGN_STAND","国外标准法规"),FOREIGN_LAWS("FOREIGN_LAWS","国外政策"),
|
||||
BUSINESS_STAND("BUSINESS_STAND","企业标准") ;
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SorDivideEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 标准库参数类型枚举设置
|
||||
* @author gaoyan
|
||||
* date 2018/09/03
|
||||
*/
|
||||
public enum SplitFilePragraTypeEnum {
|
||||
|
||||
TEXT("TEXT","文字"),IMG("IMG","图片"),TABLE("TABLE","表格");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private SplitFilePragraTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: super_liu
|
||||
* date: 2020/5/11 10:29
|
||||
*/
|
||||
public class SplitTableInfo {
|
||||
private String tableName;
|
||||
|
||||
private String tableHtml;
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
public String getTableHtml() {
|
||||
return tableHtml;
|
||||
}
|
||||
|
||||
public void setTableHtml(String tableHtml) {
|
||||
this.tableHtml = tableHtml;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description: 属性类型枚举类
|
||||
* @Author: super_liu
|
||||
* date: 2020/8/17 17:02
|
||||
*/
|
||||
public enum StandAttrTypeEnum {
|
||||
|
||||
INPUT_STR("INPUT_STR","输入框(字符串)"),INPUT_NUM("INPUT_NUM","输入框(数字)"),
|
||||
SELECT_OPTION("SEL_OPTION","单选下拉框"),SEL_OPTS("SEL_OPTS","多选下拉框"),DATE_PICKER("DATE_PICKER","日期选择"),
|
||||
DATE_PIC_OPTS("DATE_PIC_OPTS","多日期选择"),FILE("FILE","文件"),
|
||||
TEXTAREA("TEXTAREA","文本框") ;
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private StandAttrTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 资源库文件分类枚举设置
|
||||
* @author gaoyan
|
||||
* date 2018/09/03
|
||||
*/
|
||||
public enum StandFileClassifyEnum {
|
||||
|
||||
STAND_FILE("STAND_FILE","标准文本/法规文件"),STAND_MODIFY_FILE("STAND_MODIFY_FILE","标准修改单"),
|
||||
DRAFT_FILE("DRAFT_FILE","草案文件"),OPINION_FILE("OPINION_FILE","征求意见稿"),
|
||||
SENT_SCREEN_FILE("SENT_SCREEN_FILE","送审稿"),APPROVAL_FILE("APPROVAL_FILE","报批稿"),
|
||||
RELEVANCE_FILE("RELEVANCE_FILE","关联文件"),LAWS_FILE("LAWS_FILE","法规文件") ;
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private StandFileClassifyEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
public class StandPlanSchedule {
|
||||
|
||||
private String value;
|
||||
|
||||
private int countPlanSubmit = 0;
|
||||
|
||||
private int countRealSubmit = 0;
|
||||
|
||||
private int countPlanRelease = 0;
|
||||
|
||||
private int countRealRelease = 0;
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getCountPlanSubmit() {
|
||||
return countPlanSubmit;
|
||||
}
|
||||
|
||||
public void setCountPlanSubmit(int countPlanSubmit) {
|
||||
this.countPlanSubmit = countPlanSubmit;
|
||||
}
|
||||
|
||||
public int getCountRealSubmit() {
|
||||
return countRealSubmit;
|
||||
}
|
||||
|
||||
public void setCountRealSubmit(int countRealSubmit) {
|
||||
this.countRealSubmit = countRealSubmit;
|
||||
}
|
||||
|
||||
public int getCountPlanRelease() {
|
||||
return countPlanRelease;
|
||||
}
|
||||
|
||||
public void setCountPlanRelease(int countPlanRelease) {
|
||||
this.countPlanRelease = countPlanRelease;
|
||||
}
|
||||
|
||||
public int getCountRealRelease() {
|
||||
return countRealRelease;
|
||||
}
|
||||
|
||||
public void setCountRealRelease(int countRealRelease) {
|
||||
this.countRealRelease = countRealRelease;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class TaskCommonQuery {
|
||||
|
||||
@ApiModelProperty(value = "当前页")
|
||||
private int current;
|
||||
@ApiModelProperty(value = "数量")
|
||||
private int size;
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
@ApiModelProperty(value = "开始时间从")
|
||||
private String startTime;
|
||||
@ApiModelProperty(value = "到")
|
||||
private String endTime;
|
||||
@ApiModelProperty(value = "结束时间从")
|
||||
private String finishStartTime;
|
||||
@ApiModelProperty(value = "到")
|
||||
private String finishEndTime;
|
||||
@ApiModelProperty(value = "流程分类")
|
||||
private String category_id;
|
||||
|
||||
@ApiModelProperty(value = "用户Id")
|
||||
private String userId;
|
||||
|
||||
@ApiModelProperty(value = "流程名称")
|
||||
private String prcName;
|
||||
|
||||
@ApiModelProperty(value = "流程编号")
|
||||
private String prcNum;
|
||||
|
||||
@ApiModelProperty(value = "流程类型")
|
||||
private String prcType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: super_liu
|
||||
* date: 2020/2/21 16:34
|
||||
*/
|
||||
public class TemplateOriData {
|
||||
private String preMsg = "<p>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX。</p><p>本标准由广州汽车集团股份有限公司汽车工程研究院XXX提出。</p><p>本标准由广州汽车集团股份有限公司汽车工程研究院质量管理部归口。</p><p>本标准由广州汽车集团股份有限公司汽车工程研究院XXXX起草。</p><p>本标准由广州汽车集团股份有限公司汽车工程研究院XXXX解释。</p><p>本标准主要起草人:XXX、XXX、XXX。</p><p>本标准于20XX年XX月首次发布。</p><p>本标准于20XX年XX月进行第X次修订,标准修订人:XXX。</p><p>本次主要修订内容如下:</p><p>a) 增加内容的表述</p><p>——增加第X.X条XXXX的要求。</p><p>b)修改内容的表述</p><p>——第X.X条XXXX的要求由“XXX”改为“XXX”。</p><p>c)删除内容的表述</p><p>——删除原标准第X.X条XXXX的要求。</p><p>本标准所替代标准的历次版本发布情况为:</p><p>——QJ/GAC XXXX.XXX-XXXX。</p><p><br/></p>";
|
||||
private String titleOne = "<p> 本标准规定了XXXX的术语和定义、技术要求、试验方法、检验规则和标志、包装、运输及贮存。</p><p> 本标准适用于广汽研究院开发的乘用车用的XXXX。</p><p><br/></p>";
|
||||
private String titleTwo = "<p> 下列文件对于本文件的应用是必不可少的。凡是注日期的引用文件,仅所注日期的版本适用于本文件。凡是不注日期的引用文件,其最新版本(包括所有的修改单)适用于本文件。</p><p> [国家标准]</p><p> [行业标准]</p><p> [地方标准]</p><p> [法规、规程、规范和其它有关文件]</p><p> [ISO标准]</p><p> [IEC标准]</p><p> [ISO、IEC有关文件]</p><p> [其它国际标准]</p><p> [其它国际有关文件]</p><p> [本企业已发布的院级标准]</p><p><br/></p>";
|
||||
private String titleThree = "<p> 下列术语和定义适用于本标准。</p><p><br/></p>";
|
||||
|
||||
public String getPreMsg() {
|
||||
return preMsg;
|
||||
}
|
||||
|
||||
public void setPreMsg(String preMsg) {
|
||||
this.preMsg = preMsg;
|
||||
}
|
||||
|
||||
public String getTitleOne() {
|
||||
return titleOne;
|
||||
}
|
||||
|
||||
public void setTitleOne(String titleOne) {
|
||||
this.titleOne = titleOne;
|
||||
}
|
||||
|
||||
public String getTitleTwo() {
|
||||
return titleTwo;
|
||||
}
|
||||
|
||||
public void setTitleTwo(String titleTwo) {
|
||||
this.titleTwo = titleTwo;
|
||||
}
|
||||
|
||||
public String getTitleThree() {
|
||||
return titleThree;
|
||||
}
|
||||
|
||||
public void setTitleThree(String titleThree) {
|
||||
this.titleThree = titleThree;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: super_liu
|
||||
* date: 2019/12/5 13:50
|
||||
*/
|
||||
public class TextCompare {
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
public class UploadFile {
|
||||
|
||||
private String id;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private String oldFileName;
|
||||
|
||||
private String fileSuffix;
|
||||
|
||||
private String filePath;
|
||||
|
||||
private String attId;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
public String getOldFileName() {
|
||||
return oldFileName;
|
||||
}
|
||||
|
||||
public void setOldFileName(String oldFileName) {
|
||||
this.oldFileName = oldFileName;
|
||||
}
|
||||
|
||||
public String getFileSuffix() {
|
||||
return fileSuffix;
|
||||
}
|
||||
|
||||
public void setFileSuffix(String fileSuffix) {
|
||||
this.fileSuffix = fileSuffix;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public String getAttId() {
|
||||
return attId;
|
||||
}
|
||||
|
||||
public void setAttId(String attId) {
|
||||
this.attId = attId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: super_liu
|
||||
* date: 2020/1/9 18:59
|
||||
*/
|
||||
public class UploadFileInfo {
|
||||
private String id;
|
||||
private String filePath;
|
||||
private String name;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 标准库参数类型枚举设置
|
||||
* @author gaoyan
|
||||
* date 2018/09/03
|
||||
*/
|
||||
public enum UseModuleEnum {
|
||||
|
||||
SOURCE_FILE("SOURCE_FILE","源文件"),WEB_FILE("WEB_FILE","PC预览文件"),MOBLE_FILE("MOBLE_FILE","手机预览文件");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private UseModuleEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @des : excel版本判断类
|
||||
* @author: duyunbao
|
||||
* @email: 1114808306@qq.com
|
||||
* @date 2017/10/27 16:59
|
||||
**/
|
||||
public class WDWUtil {
|
||||
|
||||
/**
|
||||
* @method_name: isExcel2003
|
||||
* @des :是否是2003的excel,返回true是2003
|
||||
* @author: duyunbao
|
||||
* @param: [filePath]
|
||||
* @return: boolean
|
||||
* @date: 2017/10/27 16:57
|
||||
**/
|
||||
public static boolean isExcel2003(String filePath) {
|
||||
return filePath.matches("^.+\\.(?i)(xls)$");
|
||||
}
|
||||
|
||||
/**
|
||||
* @method_name: isExcel2007
|
||||
* @des : 是否是2007的excel,返回true是2007
|
||||
* @author: duyunbao
|
||||
* @param: [filePath]
|
||||
* @return: boolean
|
||||
* @date: 2017/10/27 16:57
|
||||
**/
|
||||
public static boolean isExcel2007(String filePath) {
|
||||
return filePath.matches("^.+\\.(?i)(xlsx)$");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断字符串是否是整数
|
||||
* @MethodName:isInteger
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/22 18:00
|
||||
*/
|
||||
public static boolean isNumeric(String str){
|
||||
for (int i = str.length();--i>=0;){
|
||||
if (!Character.isDigit(str.charAt(i))){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**方法二:推荐,速度最快
|
||||
* 判断是否为整数
|
||||
* @param str 传入的字符串
|
||||
* @return 是整数返回true,否则返回false
|
||||
*/
|
||||
public static boolean isInteger(String str) {
|
||||
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
|
||||
return pattern.matcher(str).matches();
|
||||
}
|
||||
|
||||
/**
|
||||
* 字母或数字
|
||||
*
|
||||
* @MethodName:isLetterDigitOrChinese
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 15:26
|
||||
*/
|
||||
public static boolean isLetterOrNumber(String str) {
|
||||
String regex = "^(\\d|[a-zA-Z])+$";
|
||||
return !str.matches(regex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 汉字、字母、()
|
||||
*
|
||||
* @MethodName:isLetterOrChineseOrChar1
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 15:53
|
||||
*/
|
||||
public static boolean isLetterOrChineseOrChar1(String str) {
|
||||
String regex = "[^\\a-\\z\\A-\\Z\\u4E00-\\u9FA5\\()\\()]";
|
||||
return str.matches(regex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 汉字、字母、数字
|
||||
*
|
||||
* @MethodName:isLetterOrChineseOrNumber
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 15:56
|
||||
*/
|
||||
public static boolean isLetterOrChineseOrNumber(String str) {
|
||||
String regex = "^[\\u4E00-\\u9FA5A-Za-z0-9]+$";
|
||||
return !str.matches(regex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 汉字、字母、()、-、下划线
|
||||
*
|
||||
* @MethodName:isChineseOrLetterOrUnderlineOrChar1
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 16:03
|
||||
*/
|
||||
public static boolean isChineseOrLetterOrUnderlineOrChar1(String str) {
|
||||
String regex = "^[\\u4E00-\\u9FA5A-Za-z_\\-\\()\\()]+$";
|
||||
return !str.matches(regex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数字
|
||||
*
|
||||
* @MethodName:isNumbee
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 16:09
|
||||
*/
|
||||
public static boolean isNumber(String str) {
|
||||
String regex = "\\D";
|
||||
return str.matches(regex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数字、大写字母、-
|
||||
*
|
||||
* @MethodName:isNumberOrLowerLetterOrChar1
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 16:41
|
||||
*/
|
||||
public static boolean isNumberOrLowerLetterOrChar1(String str) {
|
||||
String regex = "^[A-Z0-9\\-]+$";
|
||||
return !str.matches(regex);
|
||||
}
|
||||
|
||||
/**
|
||||
* 汉字、数字、字母、()、-、下划线
|
||||
*
|
||||
* @MethodName:isChineseOrNumberOrLetterOrUnderlineOrChar
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/30 16:45
|
||||
*/
|
||||
public static boolean isChineseOrNumberOrLetterOrUnderlineOrChar(String str) {
|
||||
String regex = "^[\\u4E00-\\u9FA5A-Za-z0-9_\\-\\()\\()]+$";
|
||||
return !str.matches(regex);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 去除整数含有小数点
|
||||
* @MethodName:subStr
|
||||
* @author: DuYunbao
|
||||
* @date: 2018/5/31 11:19
|
||||
*/
|
||||
public static String subStr(String text) {
|
||||
if (StringUtils.isNotEmpty(text)) {
|
||||
if(text.contains(".0") && text.substring(text.length()-2,text.length()).equals(".0")) {
|
||||
text = text.substring(0,text.length()-2);
|
||||
}
|
||||
}
|
||||
return text;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 标准法规分类
|
||||
* @author gaoyan
|
||||
* date 2018/09/19
|
||||
*/
|
||||
public enum WarnPutTypeEnum {
|
||||
|
||||
NEWCAR("NEWCAR","新定车型"),NEWPRODUCT("NEWPRODUCT","新生产车型"),
|
||||
PRODUCT("PRODUCT","在产车型");
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
|
||||
private WarnPutTypeEnum(String value, String lable) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
/**
|
||||
* 预警时间间隔
|
||||
* @author syt
|
||||
* date 2018/09/19
|
||||
*/
|
||||
public enum WarnTimeEnum {
|
||||
|
||||
THREEMONTH("THREEMONTH","三个月",3),SIXMONTH("SIXMONTH","六个月",6),
|
||||
ONEYEAR("ONEYEAR","一年",12),TWOYEAR("TWOYEAR","两年",24);
|
||||
|
||||
private String value;
|
||||
private String lable;
|
||||
private int month;
|
||||
|
||||
private WarnTimeEnum(String value, String lable,int month) {
|
||||
this.value = value;
|
||||
this.lable = lable;
|
||||
this.month = month;
|
||||
}
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
|
||||
|
||||
public int getMonth() {
|
||||
return month;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.adc.da.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Wrapper<T> implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final int SUCCESS_CODE = 200;
|
||||
public static final String SUCCESS_MESSAGE = "操作成功";
|
||||
public static final int ERROR_CODE = 500;
|
||||
public static final String ERROR_MESSAGE = "内部异常";
|
||||
public static final int ILLEGAL_ARGUMENT_CODE_ = 100;
|
||||
public static final String ILLEGAL_ARGUMENT_MESSAGE = "参数非法";
|
||||
private boolean success;
|
||||
private int code;
|
||||
private String message;
|
||||
private T result;
|
||||
|
||||
Wrapper() {
|
||||
this(200, "操作成功");
|
||||
}
|
||||
|
||||
Wrapper(int code, String message) {
|
||||
this(code, message, (T) null);
|
||||
}
|
||||
|
||||
Wrapper(int code, String message, T result) {
|
||||
this.success = true;
|
||||
this.code(code).message(message).result(result);
|
||||
}
|
||||
|
||||
private Wrapper<T> code(int code) {
|
||||
this.setCode(code);
|
||||
return this;
|
||||
}
|
||||
|
||||
private Wrapper<T> message(String message) {
|
||||
this.setMessage(message);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Wrapper<T> result(T result) {
|
||||
this.setResult(result);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean success() {
|
||||
return 200 == this.code;
|
||||
}
|
||||
|
||||
public boolean error() {
|
||||
return !this.success();
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return this.success;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return this.code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
public T getResult() {
|
||||
return this.result;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public void setResult(T result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
protected boolean canEqual(Object other) {
|
||||
return other instanceof Wrapper;
|
||||
}
|
||||
|
||||
|
||||
public String toString() {
|
||||
return "Wrapper(success=" + this.isSuccess() + ", code=" + this.getCode() + ", message=" + this.getMessage() + ", result=" + this.getResult() + ")";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user