feat: 迁移国内标准法规部分1
This commit is contained in:
@@ -2,7 +2,7 @@ package com.adc.da.util;
|
||||
|
||||
/**
|
||||
* @Description:水印
|
||||
* @Author: yangxuenan
|
||||
* @Author: super_liu
|
||||
* date: 2020/1/10 15:42
|
||||
*/
|
||||
public class WaterMarkUtil {
|
||||
|
||||
@@ -3,11 +3,14 @@ package com.adc.da.login.util;
|
||||
import com.adc.da.login.security.JWTRealm;
|
||||
import com.adc.da.login.security.JWTRealm.Principal;
|
||||
import com.adc.da.sys.entity.MenuEO;
|
||||
import com.adc.da.sys.entity.RoleEO;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.service.IMenuEOService;
|
||||
import com.adc.da.sys.service.IRoleEOService;
|
||||
import com.adc.da.sys.service.IUserEOService;
|
||||
import com.adc.da.util.SpringContextHolder;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
@@ -28,15 +31,23 @@ public class UserUtils {
|
||||
}
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(UserUtils.class);
|
||||
|
||||
/**
|
||||
* 当前登陆用户
|
||||
*/
|
||||
* 当前登陆用户
|
||||
*/
|
||||
public static final String CURRENT_USER = "currentUser";
|
||||
|
||||
/**
|
||||
* 菜单信息
|
||||
*/
|
||||
public static final String CACHE_MENU_LIST = "menuList";
|
||||
/**
|
||||
* 角色信息
|
||||
*/
|
||||
public static final String CACHE_ROLE_LIST = "roleList";
|
||||
/**
|
||||
* 菜单信息
|
||||
*/
|
||||
public static final String CACHE_MENU_LIST = "menuList";
|
||||
public static final String CACHE_MENU_TREE = "menuTree";
|
||||
public static final String CACHE_AREA_LIST = "areaList";
|
||||
public static final String CACHE_OFFICE_LIST = "officeList";
|
||||
|
||||
/**
|
||||
* @see IUserEOService
|
||||
@@ -48,6 +59,11 @@ public class UserUtils {
|
||||
*/
|
||||
private static IMenuEOService menuService = SpringContextHolder.getBean(IMenuEOService.class);
|
||||
|
||||
/**
|
||||
* @see IRoleEOService
|
||||
*/
|
||||
private static IRoleEOService roleEOService = SpringContextHolder.getBean(IRoleEOService.class);
|
||||
|
||||
/**
|
||||
* 退出
|
||||
*/
|
||||
@@ -148,6 +164,33 @@ public class UserUtils {
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录用户角色列表
|
||||
*/
|
||||
public static List<RoleEO> getRoleList() throws NumberFormatException, Exception {
|
||||
List<RoleEO> roleList = (List<RoleEO>) CacheUtils.getCache(CACHE_ROLE_LIST);
|
||||
if (roleList == null) {
|
||||
UserEO user = getUser();
|
||||
if(user != null) {
|
||||
roleList = roleEOService.getSysRoleListByUserId(user.getUsid());
|
||||
}
|
||||
CacheUtils.putCache(CACHE_ROLE_LIST, roleList);
|
||||
}
|
||||
return roleList;
|
||||
}
|
||||
|
||||
public static String getRoleIds() throws NumberFormatException, Exception {
|
||||
List<RoleEO> roleList = getRoleList();
|
||||
if (CollectionUtils.isEmpty(roleList)) {
|
||||
return "";
|
||||
}
|
||||
StringBuilder roleIds = new StringBuilder();
|
||||
for (RoleEO sysRoleEO : roleList) {
|
||||
roleIds.append(sysRoleEO.getId()).append(",");
|
||||
}
|
||||
return roleIds.substring(0, roleIds.length() - 1);
|
||||
}
|
||||
|
||||
public static void flush() {
|
||||
CacheUtils.removeCache(CURRENT_USER);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,11 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adc</groupId>
|
||||
<artifactId>adc-da-slrs</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adc</groupId>
|
||||
<artifactId>adc-da-sys</artifactId>
|
||||
@@ -41,6 +46,12 @@
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.adc</groupId>-->
|
||||
<!-- <artifactId>adc-da-search</artifactId>-->
|
||||
<!-- <version>3.0.0</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.adc</groupId>-->
|
||||
<!-- <artifactId>adc-da-gen</artifactId>-->
|
||||
<!-- <version>2.3.2-SNAPSHOT</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
@@ -94,8 +94,21 @@ spring.activiti.process-definition-location-prefix=classpath:/mybatis/mapper/act
|
||||
maxLoginErrorCount=3
|
||||
verifyCodeMode=1
|
||||
|
||||
# =========================================
|
||||
# 上传文件配置
|
||||
# =========================================
|
||||
# =============================================================================
|
||||
# 文件上传管控及配置
|
||||
# =============================================================================
|
||||
# file模块上传文件的服务器地址
|
||||
file.path=D:/uploadfile/bus
|
||||
# 文件下载地址参数
|
||||
file.downloadUrl=http://39.98.140.126:10001/uploadPath
|
||||
#上传文件白名单-以,分隔
|
||||
upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg
|
||||
upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg
|
||||
|
||||
# =============================================================================
|
||||
# elasticsearch 配置
|
||||
# =============================================================================
|
||||
elasticsearch.clustername=laws
|
||||
elasticsearch.ip=localhost
|
||||
elasticsearch.port=9300
|
||||
elasticsearch.poolSize=5
|
||||
elas.flag=true
|
||||
+18
-2
@@ -17,7 +17,23 @@
|
||||
<version>3.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adc</groupId>
|
||||
<artifactId>adc-da-sys</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.json-lib</groupId>
|
||||
<artifactId>json-lib</artifactId>
|
||||
<version>2.2.3</version>
|
||||
<classifier>jdk15</classifier><!-- jdk版本 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adc</groupId>
|
||||
<artifactId>adc-da-jwtLogin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
@@ -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() + ")";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.slrs.otSvpps.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.otSvpps.entity.OtSvpps;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* SVPPS结构数据 SVPPS数据 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|OtSvpps|")
|
||||
@RequestMapping("/otSvpps/ot-svpps")
|
||||
public class OtSvppsController extends BaseController<OtSvpps> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.adc.da.slrs.otSvpps.dao;
|
||||
|
||||
import com.adc.da.slrs.otSvpps.entity.OtSvpps;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* SVPPS结构数据 SVPPS数据 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
public interface OtSvppsDao extends BaseMapper<OtSvpps> {
|
||||
|
||||
List<String> getNamesByIds(@Param("list") String[] list);
|
||||
|
||||
List<String> getNamesTipByIds(@Param("list") String[] list);
|
||||
|
||||
List<String> getIdsByNames(@Param("list") String[] list);
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.adc.da.slrs.otSvpps.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* SVPPS结构数据 SVPPS数据
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="OtSvpps对象", description="SVPPS结构数据 SVPPS数据")
|
||||
public class OtSvpps extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键 主键ID")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "父级ID 父级ID引用本表的主键")
|
||||
@TableField("P_ID")
|
||||
private String pId;
|
||||
|
||||
@ApiModelProperty(value = "一级编码 对应excel中的B列")
|
||||
@TableField("F_NUM")
|
||||
private String fNum;
|
||||
|
||||
@ApiModelProperty(value = "二级编码 对应Excel中的C列")
|
||||
@TableField("S_NUM")
|
||||
private String sNum;
|
||||
|
||||
@ApiModelProperty(value = "三级编码 对应excel中的D列")
|
||||
@TableField("T_NUM")
|
||||
private String tNum;
|
||||
|
||||
@ApiModelProperty(value = "SVPPS编码 对应Excel中的E列")
|
||||
@TableField("SVPPS_CODE")
|
||||
private String svppsCode;
|
||||
|
||||
@ApiModelProperty(value = "SVPPS英文名称 对应excel中的G列")
|
||||
@TableField("SVPPS_EN_NAME")
|
||||
private String svppsEnName;
|
||||
|
||||
@ApiModelProperty(value = "SVPPS中文名称 对应excel中的I列")
|
||||
@TableField("SVPPS_CN_NAME")
|
||||
private String svppsCnName;
|
||||
|
||||
@ApiModelProperty(value = "同步数据ID 对应同步系统中的ID")
|
||||
@TableField("SYNC_ID")
|
||||
private String syncId;
|
||||
|
||||
@ApiModelProperty(value = "是否有效 默认为0")
|
||||
@TableField("VALID_FLAG")
|
||||
private Integer validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间 数据入库时间")
|
||||
@TableField("CREATED_TIME")
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
@ApiModelProperty(value = "更新时间 数据更新时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
@ApiModelProperty(value = "自定义数据标识")
|
||||
@TableField("SELF_FALG")
|
||||
private String selfFalg;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.otSvpps.service;
|
||||
|
||||
import com.adc.da.slrs.otSvpps.entity.OtSvpps;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* SVPPS结构数据 SVPPS数据 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
public interface IOtSvppsService extends IService<OtSvpps> {
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.otSvpps.service.impl;
|
||||
|
||||
import com.adc.da.slrs.otSvpps.entity.OtSvpps;
|
||||
import com.adc.da.slrs.otSvpps.dao.OtSvppsDao;
|
||||
import com.adc.da.slrs.otSvpps.service.IOtSvppsService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* SVPPS结构数据 SVPPS数据 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
@Service
|
||||
public class OtSvppsServiceImpl extends ServiceImpl<OtSvppsDao, OtSvpps> implements IOtSvppsService {
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.slrs.sarGroupMenu.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarGroupMenu.entity.SarGroupMenu;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 树形结构 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|SarGroupMenu|")
|
||||
@RequestMapping("/sarGroupMenu/sar-group-menu")
|
||||
public class SarGroupMenuController extends BaseController<SarGroupMenu> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.adc.da.slrs.sarGroupMenu.dao;
|
||||
|
||||
import com.adc.da.slrs.sarGroupMenu.entity.SarGroupMenu;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 树形结构 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
public interface SarGroupMenuDao extends BaseMapper<SarGroupMenu> {
|
||||
|
||||
String getNamesByIds(@Param("list") String[] list);
|
||||
|
||||
String getIdsByNames(@Param("list") String[] list);
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.adc.da.slrs.sarGroupMenu.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 树形结构
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarGroupMenu对象", description="树形结构")
|
||||
public class SarGroupMenu extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "PID")
|
||||
@TableField("PID")
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty(value = "节点名称")
|
||||
@TableField("MENU_NAME")
|
||||
private String menuName;
|
||||
|
||||
@ApiModelProperty(value = "节点类型")
|
||||
@TableField("MENU_TYPE")
|
||||
private String menuType;
|
||||
|
||||
@ApiModelProperty(value = "节点层级")
|
||||
@TableField("MENU_LEVEL")
|
||||
private BigDecimal menuLevel;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATE_TIME")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@TableField("CREATE_USERID")
|
||||
private String createUserid;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
@TableField("MODIFY_USERID")
|
||||
private String modifyUserid;
|
||||
|
||||
@ApiModelProperty(value = "判断标识")
|
||||
@TableField("VLAG_FLAG")
|
||||
private BigDecimal vlagFlag;
|
||||
|
||||
@ApiModelProperty(value = "标准编号")
|
||||
@TableField("STAND_NO")
|
||||
private String standNo;
|
||||
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarGroupMenu.service;
|
||||
|
||||
import com.adc.da.slrs.sarGroupMenu.entity.SarGroupMenu;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 树形结构 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
public interface ISarGroupMenuService extends IService<SarGroupMenu> {
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarGroupMenu.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarGroupMenu.entity.SarGroupMenu;
|
||||
import com.adc.da.slrs.sarGroupMenu.dao.SarGroupMenuDao;
|
||||
import com.adc.da.slrs.sarGroupMenu.service.ISarGroupMenuService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 树形结构 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-02
|
||||
*/
|
||||
@Service
|
||||
public class SarGroupMenuServiceImpl extends ServiceImpl<SarGroupMenuDao, SarGroupMenu> implements ISarGroupMenuService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.slrs.sarMenu.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarMenu.entity.SarMenu;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|SarMenu|")
|
||||
@RequestMapping("/sarMenu/sar-menu")
|
||||
public class SarMenuController extends BaseController<SarMenu> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.adc.da.slrs.sarMenu.dao;
|
||||
|
||||
import com.adc.da.slrs.sarMenu.entity.SarMenu;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
public interface SarMenuDao extends BaseMapper<SarMenu> {
|
||||
|
||||
List<SarMenu> queryMenuByDis(SarMenu sarMenuEO);
|
||||
|
||||
List<SarMenu> selectMenuByRole(SarMenu sarMenuEO);
|
||||
|
||||
List<SarMenu> queryMenuByPid(SarMenu sarMenuEO);
|
||||
|
||||
List<SarMenu> queryByPidExcpetSelf(SarMenu sarMenuEO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.adc.da.slrs.sarMenu.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarMenu对象", description="")
|
||||
public class SarMenu extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "标准法规划分")
|
||||
@TableField("SOR_DIVIDE")
|
||||
private String sorDivide;
|
||||
|
||||
@ApiModelProperty(value = "目录名称")
|
||||
@TableField("MENU_NAME")
|
||||
private String menuName;
|
||||
|
||||
@ApiModelProperty(value = "父级ID")
|
||||
@TableField("PARENT_ID")
|
||||
private String parentId;
|
||||
|
||||
@ApiModelProperty(value = "父级ID集合")
|
||||
@TableField("PARENT_IDS")
|
||||
private String parentIds;
|
||||
|
||||
@ApiModelProperty(value = "排序序号")
|
||||
@TableField("DISPLAY_SEQ")
|
||||
private Integer displaySeq;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private Integer validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
private Date creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
private Date modifyTime;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
@TableField("REMARKS")
|
||||
private String remarks;
|
||||
|
||||
@TableField(exist=false)
|
||||
private List<String> roleIds;
|
||||
|
||||
@TableField(exist=false)
|
||||
private List<String> childMenuIds;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.slrs.sarMenu.service;
|
||||
|
||||
import com.adc.da.slrs.sarMenu.entity.SarMenu;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
public interface ISarMenuService extends IService<SarMenu> {
|
||||
|
||||
List<String> getParentMenuId(String menuId);
|
||||
|
||||
List<String> queryRoleMenuIdList(String sordDivide, String menuId) throws Exception;
|
||||
|
||||
List<String> getChildMenuList(String menuId);
|
||||
}
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
package com.adc.da.slrs.sarMenu.service.impl;
|
||||
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.slrs.sarMenu.entity.SarMenu;
|
||||
import com.adc.da.slrs.sarMenu.dao.SarMenuDao;
|
||||
import com.adc.da.slrs.sarMenu.service.ISarMenuService;
|
||||
import com.adc.da.utils.treetool.Tree;
|
||||
import com.adc.da.utils.treetool.TreeNode;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@Service
|
||||
public class SarMenuServiceImpl extends ServiceImpl<SarMenuDao, SarMenu> implements ISarMenuService {
|
||||
|
||||
@Autowired
|
||||
private SarMenuDao dao;
|
||||
|
||||
public List<String> getParentMenuId (String menuId) {
|
||||
List<String> parentIds = new ArrayList<>();
|
||||
if (StringUtils.isNotEmpty(menuId)) {
|
||||
List<SarMenu> sarMenuEOList = dao.selectList(new QueryWrapper<>());
|
||||
Tree tree = new Tree(sarMenuEOList);
|
||||
TreeNode treeNode = tree.getTreeNode(menuId);
|
||||
while (treeNode.getParent() != null) {
|
||||
parentIds.add(treeNode.getParent().getNodeId());
|
||||
treeNode = treeNode.getParent();
|
||||
}
|
||||
}
|
||||
return parentIds;
|
||||
}
|
||||
|
||||
public List<String> queryRoleMenuIdList(String sordDivide, String menuId) throws Exception{
|
||||
// 根据当前登录人id查出对应角色
|
||||
SarMenu sarMenu = new SarMenu();
|
||||
sarMenu.setSorDivide(sordDivide);
|
||||
String roleIds = UserUtils.getRoleIds();
|
||||
String[] roleArr = roleIds.split(",");
|
||||
List<String> roleIdList = Arrays.asList(roleArr);
|
||||
sarMenu.setRoleIds(roleIdList);
|
||||
//角色未配置根节点,手动加入根节点权限
|
||||
List<SarMenu> resultList = queryMenuByDis(sarMenu);
|
||||
List<SarMenu> list = selectMenuByRole(sarMenu);
|
||||
if(!"BUSINESS_STAND".equals(sarMenu.getSorDivide())){
|
||||
resultList.addAll(list);
|
||||
} else {
|
||||
// 如果是企标,并且两个根节点都有权限,最先只查已分配下的节点
|
||||
if (resultList != null && resultList.size() == 2) {
|
||||
SarMenu menu1 = resultList.get(0);
|
||||
SarMenu menu2 = resultList.get(1);
|
||||
if (list != null && list.size()>1) {
|
||||
int menu1Index = -1;
|
||||
int menu2Index = -1;
|
||||
for (int i = 0;i < list.size();i++) {
|
||||
if (list.get(i).getId().equals(menu1.getId())) {
|
||||
menu1Index = i;
|
||||
} else if (list.get(i).getId().equals(menu2.getId())) {
|
||||
menu2Index = i;
|
||||
}
|
||||
}
|
||||
if (menu1Index>0 && menu2Index>0 && StringUtils.isEmpty(menuId)) {
|
||||
list.remove(menu2Index);
|
||||
}
|
||||
}
|
||||
}
|
||||
resultList = list;
|
||||
}
|
||||
List<String> getMenuIds = new ArrayList<>();
|
||||
if(resultList != null && !resultList.isEmpty()){
|
||||
for(SarMenu menu : resultList){
|
||||
getMenuIds.add(menu.getId());
|
||||
}
|
||||
}
|
||||
return getMenuIds;
|
||||
}
|
||||
|
||||
public List<SarMenu> queryMenuByDis(SarMenu sarMenu) {
|
||||
return dao.queryMenuByDis(sarMenu);
|
||||
}
|
||||
|
||||
public List<SarMenu> selectMenuByRole(SarMenu sarMenu) {
|
||||
List<SarMenu> list = dao.selectMenuByRole(sarMenu);
|
||||
if (list == null) {
|
||||
list = new ArrayList<>();
|
||||
}
|
||||
SarMenu collectMenu = new SarMenu();
|
||||
collectMenu.setId("wdsc");
|
||||
collectMenu.setSorDivide(sarMenu.getSorDivide());
|
||||
collectMenu.setMenuName("我的收藏");
|
||||
collectMenu.setParentId("1");
|
||||
collectMenu.setDisplaySeq(9999);
|
||||
list.add(collectMenu);
|
||||
SarMenu labeltMenu = new SarMenu();
|
||||
labeltMenu.setId("gxhbq");
|
||||
labeltMenu.setSorDivide(sarMenu.getSorDivide());
|
||||
labeltMenu.setMenuName("个性化标签");
|
||||
labeltMenu.setParentId("1");
|
||||
labeltMenu.setDisplaySeq(10000);
|
||||
if(!"BUSINESS_STAND".equals(sarMenu.getSorDivide())) {
|
||||
list.add(labeltMenu);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<String> queryRoleMenuIdListForLaws(String sordDivide) throws Exception{
|
||||
// 根据当前登录人id查出对应角色
|
||||
SarMenu sarMenu = new SarMenu();
|
||||
sarMenu.setSorDivide(sordDivide);
|
||||
String roleIds = UserUtils.getRoleIds();
|
||||
String[] roleArr = roleIds.split(",");
|
||||
List<String> roleIdList = Arrays.asList(roleArr);
|
||||
sarMenu.setRoleIds(roleIdList);
|
||||
//角色未配置根节点,手动加入根节点权限
|
||||
// List<SarMenu> resultList = queryMenuByDis(SarMenu);
|
||||
List<SarMenu> list = selectMenuByRole(sarMenu);
|
||||
// resultList.addAll(list);
|
||||
List<String> getMenuIds = new ArrayList<>();
|
||||
if(list != null && !list.isEmpty()){
|
||||
for(SarMenu menu : list){
|
||||
getMenuIds.add(menu.getId());
|
||||
}
|
||||
}
|
||||
return getMenuIds;
|
||||
}
|
||||
|
||||
public List<String> getChildMenuList (String menuId) {
|
||||
List<String> menuIds = new ArrayList<>();
|
||||
if (StringUtils.isNotEmpty(menuId)) {
|
||||
List<SarMenu> SarMenuList = dao.selectList(new QueryWrapper<>());
|
||||
Tree tree = new Tree(SarMenuList);
|
||||
TreeNode treeNode = tree.getTreeNode(menuId);
|
||||
if (treeNode != null) {
|
||||
menuIds.add(treeNode.getNodeId());
|
||||
for (TreeNode node : treeNode.getAllChildren()) {
|
||||
menuIds.add(node.getNodeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
return menuIds;
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.slrs.sarStandAttrDetails.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarStandAttrDetails.entity.SarStandAttrDetails;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|SarStandAttrDetails|")
|
||||
@RequestMapping("/sarStandAttrDetails/sar-stand-attr-details")
|
||||
public class SarStandAttrDetailsController extends BaseController<SarStandAttrDetails> {
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.adc.da.slrs.sarStandAttrDetails.dao;
|
||||
|
||||
import com.adc.da.slrs.sarStandAttrDetails.entity.SarStandAttrDetails;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
public interface SarStandAttrDetailsDao extends BaseMapper<SarStandAttrDetails> {
|
||||
|
||||
String selectNameByField(@Param("attrField") String attrField, @Param("sarType") String sarType);
|
||||
|
||||
SarStandAttrDetails selectFieldByName(@Param("attrName") String attrName, @Param("sarType") String sarType);
|
||||
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
package com.adc.da.slrs.sarStandAttrDetails.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarStandAttrDetails对象", description="")
|
||||
public class SarStandAttrDetails extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "属性字段")
|
||||
@TableField("ATTR_FIELD")
|
||||
private String attrField;
|
||||
|
||||
@ApiModelProperty(value = "属性名称")
|
||||
@TableField("ATTR_NAME")
|
||||
private String attrName;
|
||||
|
||||
@ApiModelProperty(value = "类型(INPUT_STR字符串输入框,INPUT_NUM数字输入框,SELECT_OPTION下拉框,DATE_PICKER日期选择,FILE文件,TEXTAREA文本框)")
|
||||
@TableField("ATTR_TYPE")
|
||||
private String attrType;
|
||||
|
||||
@ApiModelProperty(value = "属性字段长度")
|
||||
@TableField("ATTR_LEN")
|
||||
private Long attrLen;
|
||||
|
||||
@ApiModelProperty(value = "展示顺序")
|
||||
@TableField("ORDER_NUM")
|
||||
private Long orderNum;
|
||||
|
||||
@ApiModelProperty(value = "是否可编辑(0是,1否)")
|
||||
@TableField("IS_EDIT")
|
||||
private String isEdit;
|
||||
|
||||
@TableField("CREATION_USER")
|
||||
private String creationUser;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private String validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date modifyTime;
|
||||
|
||||
@ApiModelProperty(value = "是否必填")
|
||||
@TableField("IS_MUST")
|
||||
private String isMust;
|
||||
|
||||
@ApiModelProperty(value = "是否展示")
|
||||
@TableField("IS_SHOW_IMP")
|
||||
private String isShowImp;
|
||||
|
||||
@ApiModelProperty(value = "展示区域")
|
||||
@TableField("SHOW_REGION_ID")
|
||||
private String showRegionId;
|
||||
|
||||
@ApiModelProperty(value = "下拉选项所用的值")
|
||||
@TableField("SEL_VAL")
|
||||
private String selVal;
|
||||
|
||||
@ApiModelProperty(value = "模块类型(STAND标准,LAWS政策)")
|
||||
@TableField("SAR_TYPE")
|
||||
private String sarType;
|
||||
|
||||
@ApiModelProperty(value = "是否作为检索条件")
|
||||
@TableField("IS_SEARCH")
|
||||
private String isSearch;
|
||||
|
||||
@ApiModelProperty(value = "是否预警")
|
||||
@TableField("IS_WARN")
|
||||
private String isWarn;
|
||||
|
||||
@ApiModelProperty(value = "是否检索字段")
|
||||
@TableField("IS_JANSUO")
|
||||
private String isJansuo;
|
||||
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
package com.adc.da.slrs.sarStandAttrDetails.page;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>SAR_STAND_ATTR_DETAILS SarStandAttrDetailsEOPage<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2020-08-17 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
@Data
|
||||
public class SarStandAttrDetailsEOPage extends BasePage {
|
||||
|
||||
private String id;
|
||||
private String idOperator = "=";
|
||||
private String attrField;
|
||||
private String attrFieldOperator = "=";
|
||||
private String attrName;
|
||||
private String attrNameOperator = "=";
|
||||
private String attrType;
|
||||
private String attrTypeOperator = "=";
|
||||
private String orderNum;
|
||||
private String orderNumOperator = "=";
|
||||
private String isEdit;
|
||||
private String isEditOperator = "=";
|
||||
private String creationUser;
|
||||
private String creationUserOperator = "=";
|
||||
private String validFlag;
|
||||
private String validFlagOperator = "=";
|
||||
private String creationTime;
|
||||
private String creationTime1;
|
||||
private String creationTime2;
|
||||
private String creationTimeOperator = "=";
|
||||
private String modifyTime;
|
||||
private String modifyTime1;
|
||||
private String modifyTime2;
|
||||
private String modifyTimeOperator = "=";
|
||||
private String attrLen;
|
||||
private String attrLenOperator = "=";
|
||||
private String[] idList;
|
||||
private String notId;
|
||||
private String sarType;
|
||||
private String isSearch;
|
||||
private String isWarn;
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarStandAttrDetails.service;
|
||||
|
||||
import com.adc.da.slrs.sarStandAttrDetails.entity.SarStandAttrDetails;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
public interface ISarStandAttrDetailsService extends IService<SarStandAttrDetails> {
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarStandAttrDetails.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarStandAttrDetails.entity.SarStandAttrDetails;
|
||||
import com.adc.da.slrs.sarStandAttrDetails.dao.SarStandAttrDetailsDao;
|
||||
import com.adc.da.slrs.sarStandAttrDetails.service.ISarStandAttrDetailsService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@Service
|
||||
public class SarStandAttrDetailsServiceImpl extends ServiceImpl<SarStandAttrDetailsDao, SarStandAttrDetails> implements ISarStandAttrDetailsService {
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.slrs.sarStandAttrInfo.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|SarStandAttrInfo|")
|
||||
@RequestMapping("/SarStandAttrInfo/sar-stand-attr-info")
|
||||
public class SarStandAttrInfoController extends BaseController<SarStandAttrInfo> {
|
||||
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.adc.da.slrs.sarStandAttrInfo.dao;
|
||||
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
import com.adc.da.sys.common.SelectionResult;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
public interface SarStandAttrInfoDao extends BaseMapper<SarStandAttrInfo> {
|
||||
|
||||
void alterStandAttr(@Param("fieldInfo") String fieldInfo);
|
||||
|
||||
void deleteStandAttr(@Param("fieldInfo") String fieldInfo);
|
||||
|
||||
void updateAttrLen(@Param("fieldInfo") String fieldInfo);
|
||||
|
||||
Integer selectStandAttrColumn(@Param("columnName") String columnName);
|
||||
|
||||
Map<String, Object> selectStandFieldAndData(@Param("fieldInfo") String fieldInfo, @Param("standId") String standId);
|
||||
|
||||
int insertStandAttr(@Param("fieldInfo") String fieldInfo, @Param("fieldValue") String fieldValue);
|
||||
|
||||
int deleteStandAttrByStandId(@Param("standId") String standId);
|
||||
|
||||
int updateStandInfo(@Param("standId") String standId, @Param("field") String field, @Param("value") String value);
|
||||
|
||||
String selectFieldValByStandId(@Param("field") String field, @Param("standId") String standId);
|
||||
|
||||
List<SelectionResult> selectFieldValByContainsVal(@Param("field") String field, @Param("value") String value, @Param("standIds") List<String> standIds);
|
||||
}
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
package com.adc.da.slrs.sarStandAttrInfo.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarStandAttrInfo对象", description="")
|
||||
public class SarStandAttrInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableField("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "标准基础表主键")
|
||||
@TableField("STAND_ID")
|
||||
private String standId;
|
||||
|
||||
@TableField("CREATION_USER")
|
||||
private String creationUser;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private String validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
private LocalDateTime creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
@TableField("GKDW")
|
||||
private String gkdw;
|
||||
|
||||
@TableField("FBJG")
|
||||
private String fbjg;
|
||||
|
||||
@TableField("CYSD")
|
||||
private String cysd;
|
||||
|
||||
@TableField("XCXSSRQ")
|
||||
private String xcxssrq;
|
||||
|
||||
@TableField("ZCCSSRQ")
|
||||
private String zccssrq;
|
||||
|
||||
@TableField("EOPSSRQ")
|
||||
private String eopssrq;
|
||||
|
||||
@TableField("CBBH")
|
||||
private String cbbh;
|
||||
|
||||
@TableField("CLLX")
|
||||
private String cllx;
|
||||
|
||||
@TableField("GXHBQ")
|
||||
private String gxhbq;
|
||||
|
||||
@TableField("XGBM")
|
||||
private String xgbm;
|
||||
|
||||
@TableField("ZGRZLX")
|
||||
private String zgrzlx;
|
||||
|
||||
@TableField("GZZXX")
|
||||
private String gzzxx;
|
||||
|
||||
@TableField("FO")
|
||||
private String fo;
|
||||
|
||||
@TableField("XMPGJS")
|
||||
private String xmpgjs;
|
||||
|
||||
@TableField("SVPPS")
|
||||
private String svpps;
|
||||
|
||||
@TableField("CA")
|
||||
private String ca;
|
||||
|
||||
@TableField("ZQYJG")
|
||||
private String zqyjg;
|
||||
|
||||
@TableField("SSG")
|
||||
private String ssg;
|
||||
|
||||
@TableField("BPG")
|
||||
private String bpg;
|
||||
|
||||
@TableField("CGBM")
|
||||
private String cgbm;
|
||||
|
||||
@TableField("FBGBJBD")
|
||||
private String fbgbjbd;
|
||||
|
||||
@TableField("ZBJBD")
|
||||
private String zbjbd;
|
||||
|
||||
@TableField("ZRBM")
|
||||
private String zrbm;
|
||||
|
||||
@TableField("FGWHR")
|
||||
private String fgwhr;
|
||||
|
||||
@TableField("DTBJH")
|
||||
private String dtbjh;
|
||||
|
||||
@TableField("YYBJ")
|
||||
private String yybj;
|
||||
|
||||
@TableField("BYYBJ")
|
||||
private String byybj;
|
||||
|
||||
@TableField("XGLC")
|
||||
private String xglc;
|
||||
|
||||
@TableField("CHJL")
|
||||
private String chjl;
|
||||
|
||||
@TableField("XCXSSRQXM")
|
||||
private String xcxssrqxm;
|
||||
|
||||
@TableField("ZCCSSRQXM")
|
||||
private String zccssrqxm;
|
||||
|
||||
@TableField("EOPSSRQXM")
|
||||
private String eopssrqxm;
|
||||
|
||||
@TableField("CBCD")
|
||||
private String cbcd;
|
||||
|
||||
@TableField("ZRLX")
|
||||
private String zrlx;
|
||||
|
||||
@TableField("YQLX")
|
||||
private String yqlx;
|
||||
|
||||
@TableField("XXZLXX")
|
||||
private String xxzlxx;
|
||||
|
||||
@TableField("NRDBZFGQD")
|
||||
private String nrdbzfgqd;
|
||||
|
||||
@TableField("FGXXSXXX")
|
||||
private String fgxxsxxx;
|
||||
|
||||
@TableField("DXBZ")
|
||||
private String dxbz;
|
||||
|
||||
@TableField("BDTBZBH")
|
||||
private String bdtbzbh;
|
||||
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarStandAttrInfo.service;
|
||||
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
public interface ISarStandAttrInfoService extends IService<SarStandAttrInfo> {
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarStandAttrInfo.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.service.ISarStandAttrInfoService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@Service
|
||||
public class SarStandAttrInfoServiceImpl extends ServiceImpl<SarStandAttrInfoDao, SarStandAttrInfo> implements ISarStandAttrInfoService {
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.adc.da.slrs.sarStandItems.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|SarStandItems|")
|
||||
@RequestMapping("/SarStandItems/sar-stand-items")
|
||||
public class SarStandItemsController extends BaseController<SarStandItems> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.adc.da.slrs.sarStandItems.dao;
|
||||
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import com.adc.da.slrs.sarStandItems.page.SarStandItemsEOPage;
|
||||
import com.adc.da.sys.common.SelectionResult;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
public interface SarStandItemsDao extends BaseMapper<SarStandItems> {
|
||||
|
||||
List<SarStandItems> querySarStandItemsList(SarStandItemsEOPage page);
|
||||
|
||||
int querySarStandItemsListCount(SarStandItemsEOPage page);
|
||||
|
||||
List<SarStandItems> queryItemsByList(SarStandItemsEOPage page);
|
||||
|
||||
List<SarStandItems> selectItemByItemNum(SarStandItemsEOPage page);
|
||||
|
||||
|
||||
@Select("SELECT id,VALID_FLAG FROM SAR_STAND_ITEMS WHERE id = #{id}")
|
||||
SarStandItems getSarStandItemsEOById(String id);
|
||||
|
||||
List<SarStandItems> queryIdsByList(SarStandItemsEOPage page);
|
||||
|
||||
int insertForeach(List<SarStandItems> list);
|
||||
|
||||
int updateForeach(List<SarStandItems> list);
|
||||
|
||||
int deleteByStandIdAndFileType(@Param("standId") String standId, @Param("fileType") String fileType);
|
||||
|
||||
Set<String> selectClaimTypesByStandId(@Param("standId") String standId, @Param("fileType") String fileType, @Param("idList") String[] idList);
|
||||
|
||||
Set<String> selectSvppsByStandId(@Param("standId") String standId, @Param("fileType") String fileType, @Param("idList") String[] idList);
|
||||
|
||||
int deleteByIds(@Param("idList") String[] idList);
|
||||
|
||||
List<SelectionResult> selectAllItemsClaimType(SarStandItems sarStandItemsEO);
|
||||
|
||||
List<SelectionResult> selectAllItemsSvpps(SarStandItems sarStandItemsEO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.adc.da.slrs.sarStandItems.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarStandItems对象", description="")
|
||||
public class SarStandItems extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "标准ID")
|
||||
@TableField("STAND_ID")
|
||||
private String standId;
|
||||
|
||||
@ApiModelProperty(value = "条目编号")
|
||||
@TableField("ITEMS_NUM")
|
||||
private String itemsNum;
|
||||
|
||||
@ApiModelProperty(value = "条目内容")
|
||||
@TableField("ITEMS_NAME")
|
||||
private String itemsName;
|
||||
|
||||
@ApiModelProperty(value = "涉及零部件")
|
||||
@TableField("PARTS")
|
||||
private String parts;
|
||||
|
||||
@ApiModelProperty(value = "特殊生效时间")
|
||||
@TableField("TACK_TIME")
|
||||
private LocalDateTime tackTime;
|
||||
|
||||
@ApiModelProperty(value = "适用车型")
|
||||
@TableField("APPLY_ARCTIC")
|
||||
private String applyArctic;
|
||||
|
||||
@ApiModelProperty(value = "能源类型")
|
||||
@TableField("ENERGY_KIND")
|
||||
private String energyKind;
|
||||
|
||||
@ApiModelProperty(value = "责任部门")
|
||||
@TableField("RESPONSIBLE_UNIT")
|
||||
private String responsibleUnit;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
@TableField("REMARKS")
|
||||
private String remarks;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private Boolean validFlag;
|
||||
|
||||
@TableField("CREATION_USER")
|
||||
private String creationUser;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
private LocalDateTime creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
@ApiModelProperty(value = "条款要求")
|
||||
@TableField("TERMS_CONDITIONS")
|
||||
private String termsConditions;
|
||||
|
||||
@ApiModelProperty(value = "实施要点")
|
||||
@TableField("MAINPOINTS_IMPEMENTATION")
|
||||
private String mainpointsImpementation;
|
||||
|
||||
@ApiModelProperty(value = "FO")
|
||||
@TableField("FO")
|
||||
private String fo;
|
||||
|
||||
@ApiModelProperty(value = "责任工程师")
|
||||
@TableField("DUTY_ENGINEER")
|
||||
private String dutyEngineer;
|
||||
|
||||
@ApiModelProperty(value = "SVPPS")
|
||||
@TableField("SVPPS")
|
||||
private String svpps;
|
||||
|
||||
@ApiModelProperty(value = "要求类型")
|
||||
@TableField("CLAIM_TYPE")
|
||||
private String claimType;
|
||||
|
||||
@ApiModelProperty(value = "企标覆盖关系")
|
||||
@TableField("BUS_STAND_COVER")
|
||||
private String busStandCover;
|
||||
|
||||
@ApiModelProperty(value = "文件类型")
|
||||
@TableField("FILE_TYPE")
|
||||
private String fileType;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.adc.da.slrs.sarStandItems.page;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>SAR_STAND_ITEMS SarStandItemsEOPage<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2018-09-03 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
@Data
|
||||
public class SarStandItemsEOPage extends BasePage {
|
||||
|
||||
private String modifyTime;
|
||||
private String modifyTime1;
|
||||
private String modifyTime2;
|
||||
private String modifyTimeOperator = "=";
|
||||
private String creationTime;
|
||||
private String creationTime1;
|
||||
private String creationTime2;
|
||||
private String creationTimeOperator = "=";
|
||||
private String creationUser;
|
||||
private String creationUserOperator = "=";
|
||||
private String validFlag;
|
||||
private String validFlagOperator = "=";
|
||||
private String remarks;
|
||||
private String remarksOperator = "=";
|
||||
private String responsibleUnit;
|
||||
private String responsibleUnitOperator = "=";
|
||||
private String energyKind;
|
||||
private String energyKindOperator = "=";
|
||||
private String applyArctic;
|
||||
private String applyArcticOperator = "=";
|
||||
private String tackTime;
|
||||
private String tackTime1;
|
||||
private String tackTime2;
|
||||
private String tackTimeOperator = "=";
|
||||
private String parts;
|
||||
private String partsOperator = "=";
|
||||
private String itemsName;
|
||||
private String itemsNameOperator = "=";
|
||||
private String itemsNum;
|
||||
private String itemsNumOperator = "=";
|
||||
private String standId;
|
||||
private String standIdOperator = "=";
|
||||
private String id;
|
||||
private String idOperator = "=";
|
||||
private String nameOrRequest;
|
||||
private String standNum;
|
||||
private String processFlag;
|
||||
private String fileType;
|
||||
private String proType;
|
||||
private String[] idlist;
|
||||
private String noId;
|
||||
private String productId;
|
||||
private String lawsId;
|
||||
private String sarState;
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarStandItems.service;
|
||||
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
public interface ISarStandItemsService extends IService<SarStandItems> {
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarStandItems.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import com.adc.da.slrs.sarStandItems.dao.SarStandItemsDao;
|
||||
import com.adc.da.slrs.sarStandItems.service.ISarStandItemsService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@Service
|
||||
public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarStandItems> implements ISarStandItemsService {
|
||||
|
||||
}
|
||||
+124
-4
@@ -1,11 +1,45 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.common.FileUnZip;
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.*;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.utils.util.*;
|
||||
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.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
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.util.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -16,8 +50,94 @@ import com.adc.da.base.web.BaseController;
|
||||
* @since 2021-05-31
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|SarStandardsInfo|")
|
||||
@Api(tags = "福田标准法规--标准法规库--国内标准法规")
|
||||
@RequestMapping("/sarStandardsInfo/sar-standards-info")
|
||||
public class SarStandardsInfoController extends BaseController<SarStandardsInfo> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarStandardsInfoController.class);
|
||||
|
||||
@Autowired
|
||||
private ISarStandardsInfoService sarStandardsInfoEOService;
|
||||
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;
|
||||
|
||||
@Value("${file.downloadUrl}")
|
||||
private String fileDownloadPath;
|
||||
|
||||
@ApiOperation(value = "|SarStandardsInfoEO|自定义分页查询")
|
||||
@GetMapping("/getSarStandardsInfoPage")
|
||||
//@RequiresPermissions("lawss:sarStandardsInfo:getSarStandardsInfoPage")
|
||||
public ResponseMessage<PageInfo<SarStandardsInfo>> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception {
|
||||
int isNull = -1;
|
||||
if (null != page.getNowOrderBy()) {
|
||||
switch (page.getNowOrderBy()) {
|
||||
case 1:
|
||||
page.setOrderBy1("issueTime");
|
||||
break;
|
||||
case 2:
|
||||
page.setOrderBy1("XCXSSRQPAIXU");
|
||||
break;
|
||||
case 3:
|
||||
page.setOrderBy1("ZCCSSRQPAIXU");
|
||||
break;
|
||||
case 4:
|
||||
page.setOrderBy1("standStateShow");
|
||||
break;
|
||||
case 5:
|
||||
page.setOrderBy1("paixu");
|
||||
break;
|
||||
default:
|
||||
page.setNowOrder(null);
|
||||
break;
|
||||
}
|
||||
if (null != page.getNowOrder()) {
|
||||
switch (page.getNowOrder()) {
|
||||
case 1:
|
||||
page.setOrder1("desc");
|
||||
break;
|
||||
case 2:
|
||||
page.setOrder1("asc");
|
||||
default:
|
||||
page.setOrder1(null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
|
||||
List<SarAdvanceSearchVO> searchList = JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
|
||||
int i = 0;
|
||||
for (SarAdvanceSearchVO sarAdvanceSearchVO:searchList){
|
||||
if ("SVPPS".equals(sarAdvanceSearchVO.getField()) && StringUtils.isBlank(sarAdvanceSearchVO.getValue())){
|
||||
isNull = i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (-1 != isNull) {
|
||||
searchList.remove(isNull);
|
||||
}
|
||||
if (isNull == 0 && searchList.size() > 0){
|
||||
searchList.get(0).setConnect("");
|
||||
}
|
||||
String advanceStr = SarAdvanceSearchUtil.createSql(searchList);
|
||||
if (null != advanceStr) {
|
||||
advanceStr = advanceStr.replace("stand_number", "concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',SAR_STANDARDS_INFO.STAND_YEAR)");
|
||||
}
|
||||
if (-1 != isNull && StringUtils.isBlank(advanceStr)){
|
||||
advanceStr = advanceStr + " SVPPS is null";
|
||||
}else if (-1 != isNull && StringUtils.isNotBlank(advanceStr)){
|
||||
advanceStr = advanceStr + " and SVPPS is null";
|
||||
}
|
||||
if (StringUtils.isNotBlank(advanceStr)) {
|
||||
page.setAdvanceSearchStr(advanceStr);
|
||||
} else {
|
||||
page.setAdvanceSearchStr(null);
|
||||
}
|
||||
}
|
||||
page.setUserId(LoginUserUtil.getUserId());
|
||||
List<SarStandardsInfo> rows = sarStandardsInfoEOService.getSarStandardsInfoPage(page);
|
||||
return Result.success(getPageInfo(page.getPager(), rows));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+50
@@ -1,7 +1,12 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.dao;
|
||||
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.RecommendVO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +18,49 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface SarStandardsInfoDao extends BaseMapper<SarStandardsInfo> {
|
||||
|
||||
List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page);
|
||||
|
||||
int getSarStandardsInfoCount(SarStandardsInfoEOPage page);
|
||||
|
||||
SarStandardsInfo selectByPrimaryKeyAndModifyTime(SarStandardsInfo page);
|
||||
|
||||
List<SarStandardsInfo> selectStandardsByStandnumber(SarStandardsInfo sarStandardsInfoEO);
|
||||
|
||||
Integer selectStandColumn(@Param("columnName") String columnName);
|
||||
|
||||
Integer selectCounterStandardsCount(SarStandardsInfo sarStandardsInfoEO);
|
||||
|
||||
int deleteByPrimaryKeyFlag(String id);
|
||||
|
||||
int updateByStandNum(SarStandardsInfo standardsInfoEO);
|
||||
|
||||
List<SarStandardsInfo> selectStandardsInfoByIdAndRole(SarStandardsInfoEOPage standEO);
|
||||
|
||||
int updateReplacedNumById(SarStandardsInfo sarStandardsInfoEO);
|
||||
|
||||
int updateCitedStandById(SarStandardsInfo sarStandardsInfoEO);
|
||||
|
||||
List<SarStandardsInfo> getSarStandardsExportInfo(SarStandardsInfoEOPage page);
|
||||
|
||||
List<SarStandardsInfo> selectStandardsInfoByKey(String id);
|
||||
|
||||
List<RecommendVO> selectRecommendStand(SarStandardsInfoEOPage pagenew);
|
||||
|
||||
List<String> countReplaceMsg(@Param("standNum") String standNum);
|
||||
|
||||
List<SarStandardsInfo> selectStandToUpState(@Param("stateName") String stateName);
|
||||
|
||||
List<SarStandardsInfo> selectStandToUpRepState();
|
||||
|
||||
List<SarStandardsInfo> selectStandToUpRepAndTime();
|
||||
|
||||
int updateStateById(@Param("state") String state,@Param("list") List<String> list);
|
||||
|
||||
int selectIsExit(@Param("id") String id);
|
||||
|
||||
//添加一个查询标准,但是不判断标准是否删除
|
||||
List<SarStandardsInfo> selectStandardsInfoByIdAndRoleAll(SarStandardsInfoEOPage standEO);
|
||||
|
||||
List<SarStandardsInfo> selectStandardsInfoBynumber(SarStandardsInfoEOPage page);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Created by super_liu
|
||||
* 用于搜索中心的推荐
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class RecommendVO extends BaseEntity {
|
||||
|
||||
private String nameShow;
|
||||
private String numberShow;
|
||||
private String typeShow;
|
||||
private String id;
|
||||
private String module;
|
||||
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
/**
|
||||
* @Description: 标准法规库高级查询
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/12/11 9:22
|
||||
*/
|
||||
public class SarAdvanceSearchVO {
|
||||
|
||||
private String field; //字段 如 标准类别
|
||||
|
||||
private String value; //值
|
||||
|
||||
private String type; //查询类型 如 = != like
|
||||
|
||||
private String connect; //连接符号 如 and or
|
||||
|
||||
private String timeSt;
|
||||
|
||||
private String timeEd;
|
||||
|
||||
public String getField() {
|
||||
return field;
|
||||
}
|
||||
|
||||
public void setField(String field) {
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getConnect() {
|
||||
return connect;
|
||||
}
|
||||
|
||||
public void setConnect(String connect) {
|
||||
this.connect = connect;
|
||||
}
|
||||
|
||||
public String getTimeSt() {
|
||||
return timeSt;
|
||||
}
|
||||
|
||||
public void setTimeSt(String timeSt) {
|
||||
this.timeSt = timeSt;
|
||||
}
|
||||
|
||||
public String getTimeEd() {
|
||||
return timeEd;
|
||||
}
|
||||
|
||||
public void setTimeEd(String timeEd) {
|
||||
this.timeEd = timeEd;
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/***
|
||||
* @Description: 根据导入模板的标题,基础表填写对应数据
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/9/22 10:33
|
||||
* @Param:
|
||||
* @Return:
|
||||
*/
|
||||
public class SarStandImportDto {
|
||||
|
||||
public static void compareFieldAndName (String name, String value,SarStandardsInfo sarStandardsInfoEO) throws Exception{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
switch(name){
|
||||
case "适用区域":
|
||||
sarStandardsInfoEO.setCountry(value);
|
||||
break;
|
||||
case "标准类别":
|
||||
sarStandardsInfoEO.setStandSort(value);
|
||||
break;
|
||||
case "标准编号":
|
||||
sarStandardsInfoEO.setStandNumber(value);
|
||||
break;
|
||||
case "标准年份":
|
||||
sarStandardsInfoEO.setStandYear(value);
|
||||
break;
|
||||
case "中文名称":
|
||||
sarStandardsInfoEO.setStandName(value);
|
||||
break;
|
||||
case "英文名称":
|
||||
sarStandardsInfoEO.setStandEnName(value);
|
||||
break;
|
||||
case "标准状态":
|
||||
sarStandardsInfoEO.setStandState(value);
|
||||
break;
|
||||
case "标准性质":
|
||||
sarStandardsInfoEO.setStandNature(value);
|
||||
break;
|
||||
case "发布日期":
|
||||
// Date iuuseDate = sdf.parse(value);
|
||||
sarStandardsInfoEO.setIssueTime(value);
|
||||
break;
|
||||
case "实施日期":
|
||||
// Date putDate = sdf.parse(value);
|
||||
sarStandardsInfoEO.setPutTime2(value);
|
||||
break;
|
||||
case "文本说明":
|
||||
sarStandardsInfoEO.setSynopsis(value);
|
||||
break;
|
||||
case "代替标准号":
|
||||
sarStandardsInfoEO.setReplaceStandNum(value);
|
||||
break;
|
||||
case "被代替标准号":
|
||||
sarStandardsInfoEO.setReplacedStandNum(value);
|
||||
break;
|
||||
case "重要度":
|
||||
sarStandardsInfoEO.setIsRelateAccess(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
+66
-4
@@ -1,18 +1,24 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import com.adc.da.sys.entity.DicTypeEO;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
@@ -72,7 +78,8 @@ public class SarStandardsInfo extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "实施日期")
|
||||
@TableField("PUT_TIME")
|
||||
private LocalDateTime putTime;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date putTime;
|
||||
|
||||
@ApiModelProperty(value = "内容摘要")
|
||||
@TableField("SYNOPSIS")
|
||||
@@ -95,11 +102,13 @@ public class SarStandardsInfo extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
private LocalDateTime creationTime;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
private LocalDateTime modifyTime;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date modifyTime;
|
||||
|
||||
@ApiModelProperty(value = "是否法规清单相关(0否 1是)")
|
||||
@TableField("IS_RELATE_ACCESS")
|
||||
@@ -114,4 +123,57 @@ public class SarStandardsInfo extends BaseEntity {
|
||||
private String citedStand;
|
||||
|
||||
|
||||
// 以下为非表中字段
|
||||
@Transient
|
||||
private String collectId; // 收藏表ID
|
||||
@Transient
|
||||
private String countryShow; //国家地区显示名称
|
||||
@Transient
|
||||
private String standSortShow; // 标准类别显示名称
|
||||
@Transient
|
||||
private String standStateShow; // 标准状态显示名称
|
||||
@Transient
|
||||
private String standNatureShow; // 标准性质显示名称
|
||||
@Transient
|
||||
private String sychronId; // 同步数据ID
|
||||
@Transient
|
||||
private List<DicTypeEO> dicTypeList = new ArrayList(); // 记录标准涉及到的所有数据字典数据
|
||||
@Transient
|
||||
private Map<String, Object> attrInfoMap = new LinkedHashMap<>(); //属性表字段与值
|
||||
@Transient
|
||||
private String sarStandAttrEOStr; //新增修改时属性表信息
|
||||
@Transient
|
||||
private String menuId; //目录ID
|
||||
@Transient
|
||||
private int upReplaceNumFlag; //记录是否修改了替代文件号
|
||||
@Transient
|
||||
private int upNumFlag; //记录是否修改了文件号
|
||||
@Transient
|
||||
private String fileIds; //全部文件ID
|
||||
@Transient
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date newCarPutTime;
|
||||
@Transient
|
||||
private List<SarStandItems> itemsList = new ArrayList<>();
|
||||
@Transient
|
||||
private String relateStand;//对应其他标准
|
||||
@Transient
|
||||
private String accessCountry;//纳入清单的国家
|
||||
@Transient
|
||||
private String processNum;//流程编号
|
||||
@Transient
|
||||
private String textStatus;//文本状态
|
||||
// 在库里的标准节点类型(工作组)
|
||||
@Transient
|
||||
private String menuType;
|
||||
@Transient
|
||||
private String allPutTime;
|
||||
@Transient
|
||||
private String jspg;
|
||||
@Transient
|
||||
private String CHJL;
|
||||
|
||||
@Transient
|
||||
private String putTime2;
|
||||
|
||||
}
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>SAR_STANDARDS_INFO SarStandardsInfoEOPage<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2020-08-19 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class SarStandardsInfoEOPage extends BasePage {
|
||||
|
||||
private String id;
|
||||
private String idOperator = "=";
|
||||
private String standType;
|
||||
private String standTypeOperator = "=";
|
||||
private String country;
|
||||
private String countryOperator = "=";
|
||||
private String standSort;
|
||||
private String standSortOperator = "=";
|
||||
private String standNumber;
|
||||
private String standNumberOperator = "=";
|
||||
private String standYear;
|
||||
private String standYearOperator = "=";
|
||||
private String standName;
|
||||
private String standNameOperator = "=";
|
||||
private String standEnName;
|
||||
private String standEnNameOperator = "=";
|
||||
private String standState;
|
||||
private String standStateOperator = "=";
|
||||
private String standNature;
|
||||
private String standNatureOperator = "=";
|
||||
private String issueTime;
|
||||
private String issueTime1;
|
||||
private String issueTime2;
|
||||
private String issueTimeOperator = "=";
|
||||
private String putTime;
|
||||
private String putTime1;
|
||||
private String putTime2;
|
||||
private String putTimeOperator = "=";
|
||||
private String synopsis;
|
||||
private String synopsisOperator = "=";
|
||||
private String replaceStandNum;
|
||||
private String replaceStandNumOperator = "=";
|
||||
private String replacedStandNum;
|
||||
private String replacedStandNumOperator = "=";
|
||||
private String creationUser;
|
||||
private String creationUserOperator = "=";
|
||||
private String validFlag;
|
||||
private String validFlagOperator = "=";
|
||||
private String creationTime;
|
||||
private String creationTime1;
|
||||
private String creationTime2;
|
||||
private String creationTimeOperator = "=";
|
||||
private String modifyTime;
|
||||
private String isRelateAccess;
|
||||
private String modifyTime1;
|
||||
private String modifyTime2;
|
||||
private String modifyTimeOperator = "=";
|
||||
private List<String> menuRoleList; //有权限的目录
|
||||
private String[] idlist; //多个id
|
||||
private String menuId; //目录ID
|
||||
private String rootMenuId;
|
||||
private String attrSearchStr;
|
||||
private String advanceSearchStr;
|
||||
private Map<String,String> attrSearchMap; //属性表数据条件查询
|
||||
// 树结构增加搜索条件
|
||||
private String collectMenuId;
|
||||
private String labelMenuId;
|
||||
private String applyArctic;
|
||||
private String ids;
|
||||
private List<String> replaceStandNumList;
|
||||
private List<String> menuAllChildrenIdList;
|
||||
private List<SarAdvanceSearchVO> advanceSearchVOList;
|
||||
private String advanceSearchVOStr;
|
||||
private String proType; // 请求的流程类型
|
||||
private String userId;
|
||||
private String productId;
|
||||
private Integer nowOrder;
|
||||
private Integer nowOrderBy;
|
||||
private String orderBy1 = "SAR_STANDARDS_INFO.issue_time";
|
||||
private String order1 = "desc";
|
||||
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StandardsInfoExcelVO {
|
||||
String exportType;
|
||||
String menuId;
|
||||
String labelMenuId;
|
||||
String exportContent;
|
||||
String exportName;
|
||||
String standType;
|
||||
String standSort;
|
||||
String standNumber;
|
||||
String collectMenuId;
|
||||
|
||||
}
|
||||
+28
@@ -1,8 +1,15 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.service;
|
||||
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.RecommendVO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.StandardsInfoExcelVO;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
@@ -13,4 +20,25 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface ISarStandardsInfoService extends IService<SarStandardsInfo> {
|
||||
|
||||
List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception;
|
||||
|
||||
// void createSarStandardsInfo(SarStandardsInfo sarStandardsInfoEO) throws Exception;
|
||||
//
|
||||
// int updateSarStandardsInfo(SarStandardsInfo sarStandardsInfoEO) throws Exception;
|
||||
//
|
||||
// int deleteSarStandards(String ids);
|
||||
//
|
||||
// List<SarStandardsInfo> getExportDatas (StandardsInfoExcelVO standardsInfoExcelVO) throws Exception;
|
||||
//
|
||||
// ResponseMessage<SarStandardsInfo> importSarStandardsInfoData(List<Map<String,String>> dataList, String standType, String menuId, String filepath);
|
||||
//
|
||||
// List<SarStandardsInfo> selectStandardsByStandnumber(String replaceStandNum, String standType);
|
||||
//
|
||||
// SarStandardsInfo selectStandardsInfoByKey(String id) throws Exception;
|
||||
//
|
||||
// boolean updateStandardsMenu(SarStandardsInfoEOPage standardsInfoEO);
|
||||
//
|
||||
// boolean updateStandInfo(SarStandardsInfoEOPage standardsInfoEO);
|
||||
//
|
||||
// List<RecommendVO> selectRecommendStand(SarStandardsInfoEOPage pagenew);
|
||||
}
|
||||
|
||||
+215
-1
@@ -1,11 +1,30 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.common.*;
|
||||
import com.adc.da.person.service.IPersonCollectEOService;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandItems.dao.SarStandItemsDao;
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.*;
|
||||
import com.adc.da.slrs.sarMenu.service.ISarMenuService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
import com.adc.da.utils.util.*;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.sql.Clob;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
@@ -17,4 +36,199 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao, SarStandardsInfo> implements ISarStandardsInfoService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarStandardsInfoServiceImpl.class);
|
||||
|
||||
@Value("${elas.flag}")
|
||||
private boolean elasflag; //ES是否启用
|
||||
|
||||
@Autowired
|
||||
private SarStandardsInfoDao dao;
|
||||
|
||||
@Autowired
|
||||
private ISarMenuService sarMenuEOService;
|
||||
|
||||
@Autowired
|
||||
private IPersonCollectEOService personCollectEOService;
|
||||
|
||||
@Autowired
|
||||
private SarStandAttrInfoDao sarStandAttrInfoEODao;
|
||||
|
||||
@Autowired
|
||||
private IAttFileEOService attFileEOService;
|
||||
|
||||
@Autowired
|
||||
private DicTypeEODao dicTypeEODao;
|
||||
|
||||
@Autowired
|
||||
private SarStandItemsDao sarStandItemsEODao;
|
||||
|
||||
@Autowired
|
||||
private SysInfoEOService sysInfoEOService;
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* @Description: 分页查询
|
||||
* @Author: super_liu
|
||||
* @Date: 2020/8/19 10:23
|
||||
* @Param: [page]
|
||||
* @Return: java.util.List<com.adc.da.lawss.entity.SarStandardsInfoEO>
|
||||
*/
|
||||
public List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception {
|
||||
//查询当前登录人角色拥有权限的菜单
|
||||
List<String> getMenuIdList = sarMenuEOService.queryRoleMenuIdList(page.getStandType()+"_STAND",null);
|
||||
if(getMenuIdList != null && !getMenuIdList.isEmpty()){
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
} else {
|
||||
page.setMenuRoleList(null);
|
||||
}
|
||||
List<String> ids = sarMenuEOService.getChildMenuList(page.getMenuId());
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
page.setMenuAllChildrenIdList(ids);
|
||||
}
|
||||
Integer rowCount = dao.getSarStandardsInfoCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<SarStandardsInfo> sarlist = dao.getSarStandardsInfoPage(page);
|
||||
attrInfo(sarlist);
|
||||
return sarlist;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 处理属性表数据
|
||||
* @Author: super_liu
|
||||
* @Date: 2021/6/1 9:37
|
||||
* @Param: [sarlist]
|
||||
* @Return: void
|
||||
*/
|
||||
public void attrInfo (List<SarStandardsInfo> sarlist) throws Exception {
|
||||
for(SarStandardsInfo row : sarlist){
|
||||
attrInfoDetails(row);
|
||||
}
|
||||
}
|
||||
|
||||
public void attrInfoDetails (SarStandardsInfo row) throws Exception {
|
||||
String fieldInfo = InitStandAttrUtil.queryField;
|
||||
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
|
||||
row.setCollectId(collectId);
|
||||
// 查询属性表数据
|
||||
if (StringUtils.isNotBlank(fieldInfo)) {
|
||||
Map<String, Object> getAttrMap = sarStandAttrInfoEODao.selectStandFieldAndData(fieldInfo,row.getId());
|
||||
if (InitStandAttrUtil.clobFieldList != null && !InitStandAttrUtil.clobFieldList.isEmpty()) {
|
||||
// 遍历修改所有clob类型的值
|
||||
for (String clobField : InitStandAttrUtil.clobFieldList) {
|
||||
Clob clobValue = (Clob) getAttrMap.get(clobField);
|
||||
String fieldValue = FieldConvertUtil.ClobToString(clobValue);
|
||||
getAttrMap.put(clobField,fieldValue);
|
||||
}
|
||||
}
|
||||
// 组织机构和人员
|
||||
Map<String,Object> newMap = new HashMap<>();
|
||||
if (getAttrMap != null) {
|
||||
for (Map.Entry<String,Object> entry : getAttrMap.entrySet()) {
|
||||
if ("EOPSSRQ".equals(entry.getKey())){
|
||||
if (entry.getValue() != null && entry.getValue().toString().length()>10){
|
||||
String time = DateUtil.formatStrUTCToDateStr(entry.getValue().toString());
|
||||
entry.setValue(time);
|
||||
}
|
||||
}
|
||||
String name = entry.getKey();
|
||||
if ("\"null\"".equals(entry.getValue())) {
|
||||
entry.setValue("");
|
||||
}
|
||||
if ("SVPPS".equals(name)) {
|
||||
Set<String> set = new HashSet();
|
||||
// 查询条款svpps
|
||||
Set<String> itemSvpps = sarStandItemsEODao.selectSvppsByStandId(row.getId(),null,null);
|
||||
if (itemSvpps != null && !itemSvpps.isEmpty()) {
|
||||
set.addAll(itemSvpps);
|
||||
}
|
||||
Object value = entry.getValue();
|
||||
if (value != null && StringUtils.isNotBlank(value.toString())) {
|
||||
set.addAll(Arrays.asList(value.toString().split(",")));
|
||||
}
|
||||
String allVal = ConcatStringUtil.concatSet(set);
|
||||
if (StringUtils.isNotBlank(allVal)) {
|
||||
entry.setValue(allVal);
|
||||
value = sysInfoEOService.getSvppsNamesByIds(allVal);
|
||||
}
|
||||
newMap.put(name + "Name",value);
|
||||
} else if ("YQLX".equals(name)) {
|
||||
//要求类型来源于条款
|
||||
SarStandItems sarStandItemsEO = new SarStandItems();
|
||||
sarStandItemsEO.setStandId(row.getId());
|
||||
Set<String> itemClaimType = sarStandItemsEODao.selectClaimTypesByStandId(row.getId(),null,null);
|
||||
if (itemClaimType != null && itemClaimType.size() > 1) {
|
||||
entry.setValue("RENVECPFGT");
|
||||
} else if (itemClaimType != null && itemClaimType.size() == 1) {
|
||||
entry.setValue(itemClaimType.toArray()[0]);
|
||||
}
|
||||
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
|
||||
String value = entry.getValue().toString();
|
||||
String selVal = InitStandAttrUtil.selectFieldMap.get(name);
|
||||
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal)) {
|
||||
value = sysInfoEOService.getOrgNamesByIds(value);
|
||||
newMap.put(name + "Name",value);
|
||||
} else if (SelectionTypeEnum.USERLIST.getValue().equals(selVal)) {
|
||||
value = sysInfoEOService.getUserNamesByIds(value);
|
||||
newMap.put(name + "Name",value);
|
||||
} else if (SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
|
||||
value = sysInfoEOService.getRoleNamesByIds(value);
|
||||
newMap.put(name + "Name",value);
|
||||
}
|
||||
}
|
||||
}
|
||||
getAttrMap.putAll(newMap);
|
||||
}
|
||||
row.setAttrInfoMap(getAttrMap);
|
||||
}
|
||||
}
|
||||
|
||||
public void attrInfoShow (List<SarStandardsInfo> sarlist) throws Exception {
|
||||
for(SarStandardsInfo row : sarlist){
|
||||
attrInfoDetails(row);
|
||||
Map<String, Object> getAttrMap = row.getAttrInfoMap();
|
||||
Map<String, Object> getNewMap = new LinkedHashMap<>();
|
||||
if (getAttrMap != null && getAttrMap.size() > 0) {
|
||||
String svppsTip = "";
|
||||
for (Map.Entry<String,Object> entry : getAttrMap.entrySet()) {
|
||||
String name = entry.getKey();
|
||||
String value = "";
|
||||
if ("SVPPS".equals(name)) {
|
||||
Object svpps = entry.getValue();
|
||||
if (svpps != null && StringUtils.isNotBlank(svpps.toString())) {
|
||||
svppsTip = svpps.toString();
|
||||
}
|
||||
if (StringUtils.isNotBlank(svppsTip)) {
|
||||
svppsTip = sysInfoEOService.getSvppsNamesTipByIds(svppsTip);
|
||||
}
|
||||
value = String.valueOf(getAttrMap.get("SVPPSName"));
|
||||
entry.setValue(value);
|
||||
} else if (entry.getValue() != null && InitStandAttrUtil.fileFieldList != null && InitStandAttrUtil.fileFieldList.size() > 0 && InitStandAttrUtil.fileFieldList.contains(name)) {
|
||||
value = entry.getValue().toString();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
|
||||
entry.setValue(fileObj);
|
||||
}
|
||||
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
|
||||
value = entry.getValue().toString();
|
||||
if ("GZZXX".equals(name)) {
|
||||
value = sysInfoEOService.getGroupNamesByIds(value);
|
||||
} else {
|
||||
String selVal = InitStandAttrUtil.selectFieldMap.get(name);
|
||||
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal) || SelectionTypeEnum.USERLIST.getValue().equals(selVal) || SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
|
||||
if(getAttrMap.get(name + "Name") != null){
|
||||
value = String.valueOf(getAttrMap.get(name + "Name"));
|
||||
}
|
||||
} else {
|
||||
List<String> valArr = Arrays.asList(value.split(","));
|
||||
value = dicTypeEODao.getDicNamesByCodes(valArr);
|
||||
}
|
||||
}
|
||||
entry.setValue(value);
|
||||
}
|
||||
}
|
||||
getAttrMap.put("SVPPSTips",svppsTip);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,431 @@
|
||||
package com.adc.da.slrs.sysInfo.service;
|
||||
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.common.SarConformStateEnum;
|
||||
import com.adc.da.common.SelectionTypeEnum;
|
||||
import com.adc.da.slrs.otSvpps.dao.OtSvppsDao;
|
||||
import com.adc.da.slrs.sarGroupMenu.dao.SarGroupMenuDao;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
import com.adc.da.sys.dao.OrgEODao;
|
||||
import com.adc.da.sys.dao.RoleEODao;
|
||||
import com.adc.da.sys.dao.UserEODao;
|
||||
import com.adc.da.sys.entity.DicTypeEO;
|
||||
import com.adc.da.sys.page.DicTypeEOPage;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: super_liu
|
||||
* date: 2020/06/02 9:43
|
||||
*/
|
||||
@Service("sysInfoEOService")
|
||||
public class SysInfoEOService {
|
||||
|
||||
@Autowired
|
||||
private DicTypeEODao dicTypeEODao;
|
||||
|
||||
@Autowired
|
||||
private OrgEODao orgEODao;
|
||||
|
||||
@Autowired
|
||||
private UserEODao userEODao;
|
||||
|
||||
@Autowired
|
||||
private RoleEODao roleEODao;
|
||||
|
||||
@Autowired
|
||||
private SarGroupMenuDao sarGroupMenuEODao;
|
||||
|
||||
@Autowired
|
||||
private OtSvppsDao otSvppsEODao;
|
||||
|
||||
@Autowired
|
||||
private IAttFileEOService attFileEOService;
|
||||
|
||||
/**
|
||||
* @Description: 根据用户id返回逗号分隔字符串名称
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/06/02 9:50
|
||||
* @Param: [userIds]
|
||||
* @Return: java.lang.String
|
||||
*/
|
||||
public String getUserNamesByIds(String userIds){
|
||||
String userNames = "";
|
||||
if (StringUtils.isNotBlank(userIds)) {
|
||||
String[] idArr = userIds.split(",");
|
||||
userNames = userEODao.getNamesByIds(idArr);
|
||||
if (StringUtils.isBlank(userNames) || "null".equals(userNames)) {
|
||||
userNames = "";
|
||||
}
|
||||
}
|
||||
return userNames;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 根据机构id返回逗号分隔字符串名称
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/06/02 9:50
|
||||
* @Param: [userIds]
|
||||
* @Return: java.lang.String
|
||||
*/
|
||||
public String getOrgNamesByIds(String orgIds){
|
||||
String names = "";
|
||||
if (StringUtils.isNotBlank(orgIds)) {
|
||||
String[] idArr = orgIds.split(",");
|
||||
names = orgEODao.getNamesByIds(idArr);
|
||||
if (StringUtils.isBlank(names) || "null".equals(names)) {
|
||||
names = "";
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 根据标准法规属性code返回逗号分隔字符串名称
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/06/02 9:51
|
||||
* @Param: [userIds]
|
||||
* @Return: java.lang.String
|
||||
*/
|
||||
public String getDicNamesByCodes(String codes){
|
||||
String names = "";
|
||||
if (StringUtils.isNotBlank(codes)) {
|
||||
String[] idArr = codes.split(",");
|
||||
names = dicTypeEODao.getDicNamesByCodes(Arrays.asList(idArr));
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 根据角色id查询名称
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/12/17 11:28
|
||||
* @Param: [roleIds]
|
||||
* @Return: java.lang.String
|
||||
*/
|
||||
public String getRoleNamesByIds(String roleIds){
|
||||
String names = "";
|
||||
if (StringUtils.isNotBlank(roleIds)) {
|
||||
String[] idArr = roleIds.split(",");
|
||||
names = roleEODao.getNamesByIds(idArr);
|
||||
if (StringUtils.isBlank(names) || "null".equals(names)) {
|
||||
names = "";
|
||||
}
|
||||
// for (String id : idArr) {
|
||||
// RoleEO roleEO = roleEODao.selectByPrimaryKey(id);
|
||||
// if (roleEO != null) {
|
||||
// names += roleEO.getName() + ",";
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// if (StringUtils.isNotBlank(names)) {
|
||||
// names = names.substring(0,names.length()-1);
|
||||
// }
|
||||
return names;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 根据名称查属性id
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/11/24 9:40
|
||||
* @Param: [str]
|
||||
* @Return: com.adc.da.sys.entity.DicTypeEO
|
||||
*/
|
||||
public DicTypeEO getDicType(String str, String dicId){
|
||||
DicTypeEOPage dicTypeEO = new DicTypeEOPage();
|
||||
dicTypeEO.setDicTypeName(str);
|
||||
dicTypeEO.setDicId(dicId);
|
||||
List<DicTypeEO> resultList = dicTypeEODao.queryByList(dicTypeEO);
|
||||
if(resultList!= null && !resultList.isEmpty()){
|
||||
return resultList.get(0);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 仅根据名称查询属性数据
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/12/7 9:40
|
||||
* @Param: [str]
|
||||
* @Return: com.adc.da.sys.entity.DicTypeEO
|
||||
*/
|
||||
public DicTypeEO getDicTypeByName(String str) throws Exception {
|
||||
DicTypeEOPage dicTypeEO = new DicTypeEOPage();
|
||||
dicTypeEO.setDicTypeName(str);
|
||||
List<DicTypeEO> resultList = dicTypeEODao.queryByList(dicTypeEO);
|
||||
if(resultList!= null && !resultList.isEmpty()){
|
||||
return resultList.get(0);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String,Object> changeSelectInfo (Map<String,Object> attrInfoMap,String type,String baseSearchContent) {
|
||||
if (attrInfoMap != null && !attrInfoMap.isEmpty()) {
|
||||
Map<String,Object> nameMap = new HashMap<>();
|
||||
for (Map.Entry<String,Object> entry : attrInfoMap.entrySet()) {
|
||||
baseSearchContent += String.valueOf(entry.getValue()) + ",";
|
||||
String field = entry.getKey();
|
||||
String value = String.valueOf(entry.getValue());
|
||||
List<String> fieldList = new ArrayList<>();
|
||||
List<String> multiTimeList = new ArrayList<>();
|
||||
if ("stand".equals(type)) {
|
||||
fieldList = InitStandAttrUtil.selectionFieldList;
|
||||
multiTimeList = InitStandAttrUtil.multiTimeFieldList;
|
||||
} else if ("laws".equals(type)) {
|
||||
fieldList = InitStandAttrUtil.selectionFieldListLaws;
|
||||
multiTimeList = InitStandAttrUtil.multiTimeFieldListLaws;
|
||||
} else {
|
||||
fieldList = InitStandAttrUtil.selectionFieldListBuss;
|
||||
multiTimeList = InitStandAttrUtil.multiTimeFieldListBuss;
|
||||
}
|
||||
if (multiTimeList != null && multiTimeList.contains(field)) {
|
||||
nameMap.put(field, " " + value);
|
||||
}
|
||||
if (fieldList.contains(field)) {
|
||||
String selVal = "";
|
||||
String valueName = "";
|
||||
if ("stand".equals(type)) {
|
||||
selVal = InitStandAttrUtil.selectFieldMap.get(field);
|
||||
} else if ("laws".equals(type)) {
|
||||
selVal = InitStandAttrUtil.selectFieldMapLaws.get(field);
|
||||
} else {
|
||||
selVal = InitStandAttrUtil.selectFieldMapBuss.get(field);
|
||||
}
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal)) {
|
||||
valueName = getOrgNamesByIds(value);
|
||||
} else if (SelectionTypeEnum.USERLIST.getValue().equals(selVal)) {
|
||||
valueName = getUserNamesByIds(value);
|
||||
} else if (SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
|
||||
valueName = getRoleNamesByIds(value);
|
||||
} else {
|
||||
List<String> valArr = Arrays.asList(value.split(","));
|
||||
valueName = dicTypeEODao.getDicNamesByCodes(valArr);
|
||||
}
|
||||
}
|
||||
nameMap.put(field+"Show", valueName);
|
||||
baseSearchContent += valueName + ",";
|
||||
}
|
||||
}
|
||||
attrInfoMap.putAll(nameMap);
|
||||
}
|
||||
return attrInfoMap;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 根据用户名称查询id
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/12/29 19:01
|
||||
* @Param: [names]
|
||||
* @Return: java.lang.String
|
||||
*/
|
||||
public String getUserIdByName (String names,String orgIds) {
|
||||
String ids = "";
|
||||
if (StringUtils.isNotBlank(names)) {
|
||||
String[] nameArr = names.split(",");
|
||||
if (StringUtils.isNotBlank(orgIds)) {
|
||||
String[] orgIdArr = orgIds.split(",");
|
||||
ids = userEODao.getIdsByNames(nameArr,orgIdArr);
|
||||
} else {
|
||||
ids = userEODao.getIdsByNames(nameArr,null);
|
||||
}
|
||||
// for (String name : nameArr) {
|
||||
// if (StringUtils.isNotBlank(name)) {
|
||||
// UserEOPage page = new UserEOPage();
|
||||
// page.setValidFlag("0");
|
||||
// page.setUname(name);
|
||||
// List<UserEO> userList = userEODao.queryUserEoList(page);
|
||||
// if (userList != null && !userList.isEmpty()) {
|
||||
// ids += userList.get(0).getUsid() + ",";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// if (StringUtils.isNotBlank(ids)) {
|
||||
// ids = ids.substring(0,ids.length()-1);
|
||||
// }
|
||||
return ids;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 根据机构名称查询id
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/12/29 19:04
|
||||
* @Param: [names]
|
||||
* @Return: java.lang.String
|
||||
*/
|
||||
public String getOrgIdByName (String names,String orgType) {
|
||||
String ids = "";
|
||||
if (StringUtils.isNotBlank(names)) {
|
||||
String[] nameArr = names.split(",");
|
||||
ids = orgEODao.getIdsByNames(nameArr,orgType);
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 根据角色名称查id
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/12/29 19:07
|
||||
* @Param: [names]
|
||||
* @Return: java.lang.String
|
||||
*/
|
||||
public String getRoleIdByName (String names) {
|
||||
String ids = "";
|
||||
if (StringUtils.isNotBlank(names)) {
|
||||
String[] nameArr = names.split(",");
|
||||
ids = roleEODao.getIdsByNames(nameArr);
|
||||
// for (String name : nameArr) {
|
||||
// if (StringUtils.isNotBlank(name)) {
|
||||
// List<RoleEO> list = roleEODao.selectByNameAndId(null,name);
|
||||
// if (list != null && !list.isEmpty()) {
|
||||
// ids += list.get(0).getId() + ",";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// if (StringUtils.isNotBlank(ids)) {
|
||||
// ids = ids.substring(0,ids.length()-1);
|
||||
// }
|
||||
return ids;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 根据id查询工作组信息
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/12/30 15:03
|
||||
* @Param: [ids]
|
||||
* @Return: java.lang.String
|
||||
*/
|
||||
public String getGroupNamesByIds(String ids){
|
||||
String names = "";
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
String[] idArr = ids.split(",");
|
||||
names = sarGroupMenuEODao.getNamesByIds(idArr);
|
||||
if (StringUtils.isBlank(names) || "null".equals(names)) {
|
||||
names = "";
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
public String getGroupIdByNames(String names){
|
||||
String ids = "";
|
||||
if (StringUtils.isNotBlank(names)) {
|
||||
String[] nameArr = names.split(",");
|
||||
ids = sarGroupMenuEODao.getIdsByNames(nameArr);
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 根据id查询svpps名称
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/12/31 17:25
|
||||
* @Param: [ids]
|
||||
* @Return: java.lang.String
|
||||
*/
|
||||
public String getSvppsNamesByIds(String ids){
|
||||
String names = "";
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
String[] idArr = ids.split(",");
|
||||
List<String> getList = otSvppsEODao.getNamesByIds(idArr).parallelStream() .filter(Objects::nonNull) .collect(Collectors.toList());
|
||||
if (getList != null && !getList.isEmpty()) {
|
||||
if (getList.size() == 1) {
|
||||
names = getList.get(0);
|
||||
} else {
|
||||
names = getList.get(0) + "," + getList.get(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
public String getSvppsNamesTipByIds(String ids){
|
||||
String names = "";
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
String[] idArr = ids.split(",");
|
||||
List<String> getList = otSvppsEODao.getNamesTipByIds(idArr);
|
||||
if (getList != null && !getList.isEmpty()) {
|
||||
if (getList.size() == 1) {
|
||||
names = getList.get(0);
|
||||
} else {
|
||||
names = getList.get(0) + "," + getList.get(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isBlank(names) || "null".equals(names)) {
|
||||
names = "";
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 根据名称查询id
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2021/1/7 17:12
|
||||
* @Param: [names]
|
||||
* @Return: java.lang.String
|
||||
*/
|
||||
public String getSvppsIdByName (String names) {
|
||||
String ids = "";
|
||||
if (StringUtils.isNotBlank(names)) {
|
||||
String[] nameArr = names.split(",");
|
||||
List<String> getList = otSvppsEODao.getIdsByNames(nameArr);
|
||||
if (getList != null && !getList.isEmpty()) {
|
||||
if (getList.size() == 1) {
|
||||
ids = getList.get(0);
|
||||
} else {
|
||||
ids = getList.get(0) + "," + getList.get(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 根据文件id返回文件名称
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2021/1/15 14:02
|
||||
* @Param: [ids]
|
||||
* @Return: java.lang.String
|
||||
*/
|
||||
public String getFileNamesByIds (String ids) {
|
||||
String names = "";
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
List<AttFileEO> infos = attFileEOService.getMultiFileInfos(ids);
|
||||
if (infos != null && !infos.isEmpty()) {
|
||||
for (AttFileEO attFileEO : infos) {
|
||||
names += attFileEO.getOldFileName() + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(names)) {
|
||||
names = names.substring(0,names.length()-1);
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
public String changeCompStatus (String prcStatus) {
|
||||
if (StringUtils.isBlank(prcStatus)) {
|
||||
return "";
|
||||
}
|
||||
switch (prcStatus) {
|
||||
case "1": return SarConformStateEnum.FIT.getValue().toString();
|
||||
case "2": return SarConformStateEnum.UNFIT.getValue().toString();
|
||||
case "3": return SarConformStateEnum.CHECK.getValue().toString();
|
||||
case "4": return SarConformStateEnum.NOT_INVOLVE.getValue().toString();
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.adc.da.utils.tree;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 操作树的接口类
|
||||
*
|
||||
*/
|
||||
public interface ITree {
|
||||
/**
|
||||
* 获取构建数的list,因为根节点可能不止一个,所有返回List
|
||||
* 获取的结构与getRoot基本一致,但是后边增加了另外的数据,不建议调用
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<TreeNode> getTree();
|
||||
|
||||
/**
|
||||
* 获取根节点树结构,因为根节点可能不止一个,所有返回List
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<TreeNode> getRoot();
|
||||
|
||||
/**
|
||||
* 获取指定节点数据
|
||||
*
|
||||
* @param nodeId
|
||||
* @return
|
||||
*/
|
||||
TreeNode getTreeNode(String nodeId);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.adc.da.utils.tree;
|
||||
|
||||
/**
|
||||
* 需要实现树的实体类需要实现的接口,获取关键数据
|
||||
*
|
||||
*/
|
||||
public interface ITreeNode<T> {
|
||||
/**
|
||||
* TreeNode获取nodeId
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getNodeId();
|
||||
|
||||
/**
|
||||
* TreeNode获取nodeName
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getNodeName();
|
||||
|
||||
/**
|
||||
* TreeNode获取nodeParentId(父id)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getNodeParentId();
|
||||
|
||||
/**
|
||||
* TreeNode获取orderNum(排序字段用于排序)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Integer getOrderNum();
|
||||
|
||||
/**
|
||||
* TreeNode获取nodeLevel(当前属于第几层级)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Integer getNodeLevel();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.adc.da.utils.tree;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 构建树形建构
|
||||
*/
|
||||
public class Tree implements ITree {
|
||||
/**
|
||||
* 用于存放treeNode的Map
|
||||
*/
|
||||
private LinkedHashMap<String, TreeNode> treeNodesMap = new LinkedHashMap<>();
|
||||
/**
|
||||
* 用于存放treeNode的list
|
||||
*/
|
||||
private List<TreeNode> treeNodesList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
public Tree(List<ITreeNode> list) {
|
||||
initTreeNodeMap(list);
|
||||
initTreeNodeList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将List对象数据转为TreeNodeMap
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
private void initTreeNodeMap(List<ITreeNode> list) {
|
||||
TreeNode treeNode;
|
||||
for (ITreeNode item : list) {
|
||||
treeNode = new TreeNode(item);
|
||||
treeNode.setLastNodeNum(1);
|
||||
treeNodesMap.put(treeNode.getNodeId(), treeNode);
|
||||
}
|
||||
Iterator<TreeNode> iterator = treeNodesMap.values().iterator();
|
||||
TreeNode parentTreeNode;
|
||||
while (iterator.hasNext()) {
|
||||
treeNode = iterator.next();
|
||||
if (StringUtils.isEmpty(treeNode.getParentNodeId())) {
|
||||
continue;
|
||||
}
|
||||
parentTreeNode = treeNodesMap.get(treeNode.getParentNodeId());
|
||||
if (parentTreeNode != null) {
|
||||
treeNode.setParent(parentTreeNode);
|
||||
parentTreeNode.addChild(treeNode);
|
||||
// 按照orderNum排序
|
||||
Collections.sort(parentTreeNode.getChildren(), new OrdNamComparator());
|
||||
// 判断这个节点是否是最子节点
|
||||
if (treeNode.getChildren().size() == 0) {
|
||||
treeNode.setLastNode(true);
|
||||
}
|
||||
// 计算每一个节点的最子节点的数量
|
||||
List<TreeNode> children = parentTreeNode.getChildren();
|
||||
if (children.size() > 0) {
|
||||
int sum = 0;
|
||||
for (TreeNode treeNode2 : children) {
|
||||
sum += treeNode2.getLastNodeNum();
|
||||
}
|
||||
parentTreeNode.setLastNodeNum(sum);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据treeNodesMap转为treeNodesList
|
||||
*/
|
||||
private void initTreeNodeList() {
|
||||
if (treeNodesList.size() > 0) {
|
||||
return;
|
||||
}
|
||||
if (treeNodesMap.size() == 0) {
|
||||
return;
|
||||
}
|
||||
Iterator<TreeNode> iterator = treeNodesMap.values().iterator();
|
||||
TreeNode treeNode;
|
||||
while (iterator.hasNext()) {
|
||||
treeNode = iterator.next();
|
||||
if (treeNode.getParent() == null) {
|
||||
this.treeNodesList.add(treeNode);
|
||||
this.treeNodesList.addAll(treeNode.getAllChildren());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreeNode> getTree() {
|
||||
return this.treeNodesList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreeNode> getRoot() {
|
||||
List<TreeNode> rootList = new ArrayList<>();
|
||||
if (this.treeNodesList.size() > 0) {
|
||||
for (TreeNode node : treeNodesList) {
|
||||
if (node.getParent() == null) {
|
||||
rootList.add(node);
|
||||
Collections.sort(rootList, new OrdNamComparator());
|
||||
}
|
||||
}
|
||||
}
|
||||
return rootList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TreeNode getTreeNode(String nodeId) {
|
||||
return this.treeNodesMap.get(nodeId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义排序,按照orderNum排序
|
||||
*/
|
||||
class OrdNamComparator implements Comparator<TreeNode> {
|
||||
@Override
|
||||
public int compare(TreeNode t1, TreeNode t2) {
|
||||
if (t1.getOrderNum() > t2.getOrderNum()) {
|
||||
return 1;
|
||||
}
|
||||
if (t1.getOrderNum() < t2.getOrderNum()) {
|
||||
return -1;
|
||||
}
|
||||
return t1.getNodeName().compareTo(t2.getNodeName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
package com.adc.da.utils.tree;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class TreeNode {
|
||||
|
||||
/**
|
||||
* 树节点ID
|
||||
*/
|
||||
@JSONField(ordinal = 1)
|
||||
private String nodeId;
|
||||
/**
|
||||
* 树节点名称
|
||||
*/
|
||||
@JSONField(ordinal = 2)
|
||||
private String nodeName;
|
||||
/**
|
||||
* 父节点ID
|
||||
*/
|
||||
@JSONField(ordinal = 3)
|
||||
private String parentNodeId;
|
||||
/**
|
||||
* 节点在树中的排序号
|
||||
*/
|
||||
@JSONField(ordinal = 4)
|
||||
private int orderNum;
|
||||
/**
|
||||
* 节点所在的层级
|
||||
*/
|
||||
@JSONField(ordinal = 5)
|
||||
private int level;
|
||||
/**
|
||||
* 最子节点的数量
|
||||
*/
|
||||
@JSONField(ordinal = 6)
|
||||
private int lastNodeNum;
|
||||
|
||||
/**
|
||||
* 是否是最子节点
|
||||
*/
|
||||
@JSONField(ordinal = 7)
|
||||
private boolean lastNode;
|
||||
|
||||
/**
|
||||
* 当前节点的儿子节点
|
||||
*/
|
||||
@JSONField(ordinal = 8)
|
||||
private List<TreeNode> children = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 当前节点的完整路径
|
||||
*/
|
||||
@JSONField(ordinal = 9)
|
||||
private String completeName;
|
||||
|
||||
/**
|
||||
* 当前节点的父级节点
|
||||
* 转json的时候忽略此属性,因为此属性到前端无作用
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private TreeNode parent;
|
||||
|
||||
/**
|
||||
* 当前节点的子孙节点
|
||||
* 转json的时候忽略此属性,因为此属性到前端无作用
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private List<TreeNode> allChildren = new ArrayList<>();
|
||||
|
||||
public TreeNode(ITreeNode obj) {
|
||||
this.nodeId = obj.getNodeId();
|
||||
this.nodeName = obj.getNodeName();
|
||||
this.parentNodeId = obj.getNodeParentId();
|
||||
this.orderNum = obj.getOrderNum();
|
||||
this.level = obj.getNodeLevel();
|
||||
}
|
||||
|
||||
public TreeNode(TreeNode obj) {
|
||||
this.orderNum = obj.getOrderNum();
|
||||
this.level = obj.getLevel();
|
||||
this.lastNodeNum = obj.getLastNodeNum();
|
||||
}
|
||||
|
||||
public TreeNode() {
|
||||
}
|
||||
|
||||
public void addChild(TreeNode treeNode) {
|
||||
this.children.add(treeNode);
|
||||
}
|
||||
|
||||
public void removeChild(TreeNode treeNode) {
|
||||
this.children.remove(treeNode);
|
||||
}
|
||||
|
||||
public String getNodeId() {
|
||||
return nodeId;
|
||||
}
|
||||
|
||||
public void setNodeId(String nodeId) {
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public String getNodeName() {
|
||||
return nodeName;
|
||||
}
|
||||
|
||||
public void setNodeName(String nodeName) {
|
||||
this.nodeName = nodeName;
|
||||
}
|
||||
|
||||
public String getParentNodeId() {
|
||||
return parentNodeId;
|
||||
}
|
||||
|
||||
public void setParentNodeId(String parentNodeId) {
|
||||
this.parentNodeId = parentNodeId;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public TreeNode getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(TreeNode parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public List<TreeNode> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<TreeNode> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public int getOrderNum() {
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(int orderNum) {
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public int getLastNodeNum() {
|
||||
return lastNodeNum;
|
||||
}
|
||||
|
||||
public void setLastNodeNum(int lastNodeNum) {
|
||||
this.lastNodeNum = lastNodeNum;
|
||||
}
|
||||
|
||||
public boolean isLastNode() {
|
||||
return lastNode;
|
||||
}
|
||||
|
||||
public void setLastNode(boolean lastNode) {
|
||||
this.lastNode = lastNode;
|
||||
}
|
||||
|
||||
public List<TreeNode> getAllChildren() {
|
||||
if (this.allChildren.isEmpty()) {
|
||||
for (TreeNode treeNode : this.children) {
|
||||
this.allChildren.add(treeNode);
|
||||
this.allChildren.addAll(treeNode.getAllChildren());
|
||||
}
|
||||
}
|
||||
return this.allChildren;
|
||||
}
|
||||
|
||||
public String getCompleteName() {
|
||||
return completeName;
|
||||
}
|
||||
|
||||
public void setCompleteName(String completeName) {
|
||||
this.completeName = completeName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.adc.da.utils.treetool;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
* List 排序 Comparator
|
||||
* @author david
|
||||
*/
|
||||
public class OrdNamComparator implements Comparator<TreeNode> {
|
||||
|
||||
@Override
|
||||
public int compare(TreeNode t1, TreeNode t2) {
|
||||
if (t1.getOrderNum() > t2.getOrderNum()) {
|
||||
return 1;
|
||||
}
|
||||
if (t1.getOrderNum() < t2.getOrderNum()) {
|
||||
return -1;
|
||||
}
|
||||
return t1.getNodeName().compareTo(t2.getNodeName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.adc.da.utils.treetool;
|
||||
|
||||
import com.adc.da.utils.treetool.annotation.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
|
||||
//import group.ipp.tree.util.annotation.TreeNodeLevel;
|
||||
//import group.ipp.tree.util.annotation.TreeNodeName;
|
||||
//import group.ipp.tree.util.annotation.TreeNodeOrder;
|
||||
//import group.ipp.tree.util.annotation.TreeNodeParentId;
|
||||
|
||||
/**
|
||||
* 构建树形建构
|
||||
*
|
||||
* @author David
|
||||
*/
|
||||
public class Tree<T> {
|
||||
/**
|
||||
* 用于存放treeNode的Map
|
||||
*/
|
||||
private LinkedHashMap<String, TreeNode> treeNodesMap = new LinkedHashMap<>();
|
||||
/**
|
||||
* 用于存放treeNode的list
|
||||
*/
|
||||
private List<TreeNode> treeNodesList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
public Tree(List<T> list) {
|
||||
initTreeNodeMap(list);
|
||||
initTreeNodeList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将List对象数据转为TreeNodeMap
|
||||
*
|
||||
* @param list
|
||||
*/
|
||||
private void initTreeNodeMap(List<T> list) {
|
||||
TreeNode treeNode;
|
||||
for (Object item : list) {
|
||||
treeNode = new TreeNode();
|
||||
treeNode.setNodeId(getFieldValue(item, "TreeNodeId"));
|
||||
treeNode.setNodeName(getFieldValue(item, "TreeNodeName"));
|
||||
treeNode.setParentNodeId(getFieldValue(item, "TreeNodeParentId"));
|
||||
if(StringUtils.isEmpty(getFieldValue(item, "TreeNodeLevel"))) {
|
||||
treeNode.setLevel(0);
|
||||
} else {
|
||||
treeNode.setLevel(Integer.parseInt(getFieldValue(item, "TreeNodeLevel")));
|
||||
}
|
||||
if(StringUtils.isEmpty(getFieldValue(item, "TreeNodeOrder"))) {
|
||||
treeNode.setOrderNum(0);
|
||||
} else {
|
||||
treeNode.setOrderNum(Integer.parseInt(getFieldValue(item, "TreeNodeOrder")));
|
||||
}
|
||||
treeNode.setLastNodeNum(1);
|
||||
treeNode.setData(item);
|
||||
treeNodesMap.put(treeNode.getNodeId(), treeNode);
|
||||
}
|
||||
Iterator<TreeNode> iterator = treeNodesMap.values().iterator();
|
||||
TreeNode parentTreeNode;
|
||||
while (iterator.hasNext()) {
|
||||
treeNode = iterator.next();
|
||||
if (StringUtils.isEmpty(treeNode.getParentNodeId())) {
|
||||
continue;
|
||||
}
|
||||
parentTreeNode = treeNodesMap.get(treeNode.getParentNodeId());
|
||||
if (parentTreeNode != null) {
|
||||
treeNode.setParent(parentTreeNode);
|
||||
parentTreeNode.addChild(treeNode);
|
||||
// 按照orderNum排序
|
||||
Collections.sort(parentTreeNode.getChildren(), new OrdNamComparator());
|
||||
// 判断这个节点是否是最子节点
|
||||
if (treeNode.getChildren().size() == 0) {
|
||||
treeNode.setLastNode(true);
|
||||
}
|
||||
// 计算每一个节点的最子节点的数量
|
||||
List<TreeNode> children = parentTreeNode.getChildren();
|
||||
if (children.size() > 0) {
|
||||
int sum = 0;
|
||||
for (TreeNode treeNode2 : children) {
|
||||
sum += treeNode2.getLastNodeNum();
|
||||
}
|
||||
parentTreeNode.setLastNodeNum(sum);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getFieldValue(Object obj, String type) {
|
||||
Class clz = obj.getClass();
|
||||
Field[] fields = clz.getDeclaredFields();
|
||||
String value = null;
|
||||
try {
|
||||
for(Field field : fields){
|
||||
field.setAccessible(true);
|
||||
switch (type){
|
||||
case "TreeNodeId":
|
||||
if(field.isAnnotationPresent(TreeNodeId.class)) {
|
||||
value = String.valueOf(field.get(obj));
|
||||
}
|
||||
break;
|
||||
case "TreeNodeParentId":
|
||||
if(field.isAnnotationPresent(TreeNodeParentId.class)) {
|
||||
value = String.valueOf(field.get(obj));
|
||||
}
|
||||
break;
|
||||
case "TreeNodeName":
|
||||
if(field.isAnnotationPresent(TreeNodeName.class)) {
|
||||
value = String.valueOf(field.get(obj));
|
||||
}
|
||||
break;
|
||||
case "TreeNodeOrder":
|
||||
if(field.isAnnotationPresent(TreeNodeOrder.class)) {
|
||||
value = String.valueOf(field.get(obj));
|
||||
}
|
||||
break;
|
||||
case "TreeNodeLevel":
|
||||
if(field.isAnnotationPresent(TreeNodeLevel.class)) {
|
||||
value = String.valueOf(field.get(obj));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据treeNodesMap转为treeNodesList
|
||||
*/
|
||||
private void initTreeNodeList() {
|
||||
if (treeNodesList.size() > 0) {
|
||||
return;
|
||||
}
|
||||
if (treeNodesMap.size() == 0) {
|
||||
return;
|
||||
}
|
||||
Iterator<TreeNode> iterator = treeNodesMap.values().iterator();
|
||||
TreeNode treeNode;
|
||||
while (iterator.hasNext()) {
|
||||
treeNode = iterator.next();
|
||||
if (treeNode.getParent() == null) {
|
||||
this.treeNodesList.add(treeNode);
|
||||
this.treeNodesList.addAll(treeNode.getAllChildren());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<TreeNode> getTree() {
|
||||
return this.treeNodesList;
|
||||
}
|
||||
|
||||
public List<TreeNode> getRoot() {
|
||||
List<TreeNode> rootList = new ArrayList<>();
|
||||
if (this.treeNodesList.size() > 0) {
|
||||
for (TreeNode node : treeNodesList) {
|
||||
if (node.getParent() == null) {
|
||||
rootList.add(node);
|
||||
Collections.sort(rootList, new OrdNamComparator());
|
||||
}
|
||||
}
|
||||
}
|
||||
return rootList;
|
||||
}
|
||||
|
||||
public TreeNode getTreeNode(String nodeId) {
|
||||
return this.treeNodesMap.get(nodeId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
package com.adc.da.utils.treetool;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author David
|
||||
*/
|
||||
public class TreeNode {
|
||||
|
||||
/**
|
||||
* 树节点ID
|
||||
*/
|
||||
@JSONField(ordinal = 1)
|
||||
private String nodeId;
|
||||
/**
|
||||
* 树节点名称
|
||||
*/
|
||||
@JSONField(ordinal = 2)
|
||||
private String nodeName;
|
||||
/**
|
||||
* 父节点ID
|
||||
*/
|
||||
@JSONField(ordinal = 3)
|
||||
private String parentNodeId;
|
||||
/**
|
||||
* 节点在树中的排序号
|
||||
*/
|
||||
@JSONField(ordinal = 4)
|
||||
private int orderNum;
|
||||
/**
|
||||
* 节点所在的层级
|
||||
*/
|
||||
@JSONField(ordinal = 5)
|
||||
private int level;
|
||||
/**
|
||||
* 最子节点的数量
|
||||
*/
|
||||
@JSONField(ordinal = 6)
|
||||
private int lastNodeNum;
|
||||
|
||||
/**
|
||||
* 是否是最子节点
|
||||
*/
|
||||
@JSONField(ordinal = 7)
|
||||
private boolean lastNode;
|
||||
|
||||
private Object data;
|
||||
|
||||
/**
|
||||
* 当前节点的儿子节点
|
||||
*/
|
||||
@JSONField(ordinal = 8)
|
||||
private List<TreeNode> children = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 当前节点的完整路径
|
||||
*/
|
||||
@JSONField(ordinal = 9)
|
||||
private String completeName;
|
||||
|
||||
/**
|
||||
* 当前节点的父级节点
|
||||
* 转json的时候忽略此属性,因为此属性到前端无作用
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private TreeNode parent;
|
||||
|
||||
/**
|
||||
* 当前节点的子孙节点
|
||||
* 转json的时候忽略此属性,因为此属性到前端无作用
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private List<TreeNode> allChildren = new ArrayList<>();
|
||||
|
||||
private int standFlag;
|
||||
|
||||
public TreeNode(TreeNode obj) {
|
||||
this.orderNum = obj.getOrderNum();
|
||||
this.level = obj.getLevel();
|
||||
this.lastNodeNum = obj.getLastNodeNum();
|
||||
}
|
||||
|
||||
public TreeNode() {
|
||||
}
|
||||
|
||||
public void addChild(TreeNode treeNode) {
|
||||
this.children.add(treeNode);
|
||||
}
|
||||
|
||||
public void removeChild(TreeNode treeNode) {
|
||||
this.children.remove(treeNode);
|
||||
}
|
||||
|
||||
public String getNodeId() {
|
||||
return nodeId;
|
||||
}
|
||||
|
||||
public void setNodeId(String nodeId) {
|
||||
this.nodeId = nodeId;
|
||||
}
|
||||
|
||||
public String getNodeName() {
|
||||
return nodeName;
|
||||
}
|
||||
|
||||
public void setNodeName(String nodeName) {
|
||||
this.nodeName = nodeName;
|
||||
}
|
||||
|
||||
public String getParentNodeId() {
|
||||
return parentNodeId;
|
||||
}
|
||||
|
||||
public void setParentNodeId(String parentNodeId) {
|
||||
this.parentNodeId = parentNodeId;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public TreeNode getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(TreeNode parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public List<TreeNode> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<TreeNode> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public int getOrderNum() {
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(int orderNum) {
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public int getLastNodeNum() {
|
||||
return lastNodeNum;
|
||||
}
|
||||
|
||||
public void setLastNodeNum(int lastNodeNum) {
|
||||
this.lastNodeNum = lastNodeNum;
|
||||
}
|
||||
|
||||
public boolean isLastNode() {
|
||||
return lastNode;
|
||||
}
|
||||
|
||||
public void setLastNode(boolean lastNode) {
|
||||
this.lastNode = lastNode;
|
||||
}
|
||||
|
||||
public List<TreeNode> getAllChildren() {
|
||||
if (this.allChildren.isEmpty()) {
|
||||
for (TreeNode treeNode : this.children) {
|
||||
this.allChildren.add(treeNode);
|
||||
this.allChildren.addAll(treeNode.getAllChildren());
|
||||
}
|
||||
}
|
||||
return this.allChildren;
|
||||
}
|
||||
|
||||
public String getCompleteName() {
|
||||
return completeName;
|
||||
}
|
||||
|
||||
public void setCompleteName(String completeName) {
|
||||
this.completeName = completeName;
|
||||
}
|
||||
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public int getStandFlag() {
|
||||
return standFlag;
|
||||
}
|
||||
|
||||
public void setStandFlag(int standFlag) {
|
||||
this.standFlag = standFlag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.adc.da.utils.treetool.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author david
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD})
|
||||
@Documented
|
||||
public @interface TreeNodeId {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.adc.da.utils.treetool.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author david
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD})
|
||||
@Documented
|
||||
public @interface TreeNodeLevel {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.adc.da.utils.treetool.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author david
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD})
|
||||
@Documented
|
||||
public @interface TreeNodeName {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.adc.da.utils.treetool.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author david
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD})
|
||||
@Documented
|
||||
public @interface TreeNodeOrder {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.adc.da.utils.treetool.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author david
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.FIELD})
|
||||
@Documented
|
||||
public @interface TreeNodeParentId {
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.adc.da.utils.util;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class AESUtil {
|
||||
private static final String KEY_ALGORITHM = "AES";
|
||||
private static final String DEFAULT_CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding";//默认的加密算法
|
||||
|
||||
/**
|
||||
* AES 加密操作
|
||||
*
|
||||
* @param content 待加密内容
|
||||
* @param password 加密密码
|
||||
* @return 返回Base64转码后的加密数据
|
||||
*/
|
||||
public static String encrypt(String content, String password) {
|
||||
try {
|
||||
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);// 创建密码器
|
||||
|
||||
byte[] byteContent = content.getBytes("utf-8");
|
||||
|
||||
cipher.init(Cipher.ENCRYPT_MODE, getSecretKey(password));// 初始化为加密模式的密码器
|
||||
|
||||
byte[] result = cipher.doFinal(byteContent);// 加密
|
||||
|
||||
return Base64.encodeBase64String(result);//通过Base64转码返回
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(AESUtil.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* AES 解密操作
|
||||
*
|
||||
* @param content
|
||||
* @param password
|
||||
* @return
|
||||
*/
|
||||
public static String decrypt(String content, String password) {
|
||||
|
||||
try {
|
||||
//实例化
|
||||
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
|
||||
|
||||
//使用密钥初始化,设置为解密模式
|
||||
cipher.init(Cipher.DECRYPT_MODE, getSecretKey(password));
|
||||
|
||||
//执行操作
|
||||
byte[] result = cipher.doFinal(Base64.decodeBase64(content));
|
||||
|
||||
return new String(result, "utf-8");
|
||||
} catch (Exception ex) {
|
||||
Logger.getLogger(AESUtil.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成加密秘钥
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private static SecretKeySpec getSecretKey(final String password) {
|
||||
//返回生成指定算法密钥生成器的 KeyGenerator 对象
|
||||
KeyGenerator kg = null;
|
||||
|
||||
try {
|
||||
kg = KeyGenerator.getInstance(KEY_ALGORITHM);
|
||||
|
||||
//AES 要求密钥长度为 128
|
||||
kg.init(128, new SecureRandom(password.getBytes()));
|
||||
|
||||
//生成一个密钥
|
||||
SecretKey secretKey = kg.generateKey();
|
||||
|
||||
return new SecretKeySpec(secretKey.getEncoded(), KEY_ALGORITHM);// 转换为AES专用密钥
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
Logger.getLogger(AESUtil.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String s = "hello,您好";
|
||||
|
||||
System.out.println("s:" + s);
|
||||
|
||||
String s1 = AESUtil.encrypt(s, "1234");
|
||||
System.out.println("s1:" + s1);
|
||||
|
||||
System.out.println("s2:"+AESUtil.decrypt(s1, "1234"));
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.adc.da.utils.util;
|
||||
|
||||
public class CompLDUtils {
|
||||
|
||||
private static int min(int one, int two, int three) {
|
||||
int min = one;
|
||||
if (two < min) {
|
||||
min = two;
|
||||
}
|
||||
if (three < min) {
|
||||
min = three;
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
||||
public static int ld(String str1, String str2) {
|
||||
int d[][]; // 矩阵
|
||||
int n = str1.length();
|
||||
int m = str2.length();
|
||||
int i; // 遍历str1的
|
||||
int j; // 遍历str2的
|
||||
char ch1; // str1的
|
||||
char ch2; // str2的
|
||||
int temp; // 记录相同字符,在某个矩阵位置值的增量,不是0就是1
|
||||
if (n == 0) {
|
||||
return m;
|
||||
}
|
||||
if (m == 0) {
|
||||
return n;
|
||||
}
|
||||
d = new int[n + 1][m + 1];
|
||||
for (i = 0; i <= n; i++) { // 初始化第一列
|
||||
d[i][0] = i;
|
||||
}
|
||||
for (j = 0; j <= m; j++) { // 初始化第一行
|
||||
d[0][j] = j;
|
||||
}
|
||||
for (i = 1; i <= n; i++) { // 遍历str1
|
||||
ch1 = str1.charAt(i - 1);
|
||||
// 去匹配str2
|
||||
for (j = 1; j <= m; j++) {
|
||||
ch2 = str2.charAt(j - 1);
|
||||
if (ch1 == ch2) {
|
||||
temp = 0;
|
||||
} else {
|
||||
temp = 1;
|
||||
}
|
||||
// 左边+1,上边+1, 左上角+temp取最小
|
||||
d[i][j] = min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1]+ temp);
|
||||
}
|
||||
}
|
||||
return d[n][m];
|
||||
}
|
||||
public static double sim(String str1, String str2) {
|
||||
try {
|
||||
double ld = (double)ld(str1, str2);
|
||||
return (1-ld/(double)Math.max(str1.length(), str2.length()));
|
||||
} catch (Exception e) {
|
||||
return 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String str1="6转向系\n" +
|
||||
"6.1汽车(三轮汽车除外)的方向盘应设置于左侧,其他机动车的方向盘不得设置于右侧;专项作业车、教练车按需要可设置左右两个方向盘。有驾驶室的正三轮摩托车如使用方向盘转向,则方向盘中心立柱距车辆纵向中心平面的水平距离应小于等于200 mm;其他摩托车不得使用方向盘转向。\n" +
|
||||
"6.2机动车的方向盘(或方向把)应转动灵活,操纵方便,无卡滞现象。机动车应设置转向限位装置。转向系统在任何操作位置上,不得与其他部件有干涉现象。\n" +
|
||||
"6.3机动车(摩托车、三轮汽车、手扶拖拉机运输机组除外)正常行驶时,转向轮转向后应有一定的回正能力(允许有残余角),以使机动车具有稳定的直线行驶能力。\n" +
|
||||
"6.4机动车方向盘的最大自由转动量应小于或等于:\n" +
|
||||
"a) 最大设计车速大于或等于100 km/h 的机动车:15°\n" +
|
||||
"b) 三轮汽车:35°;\n" +
|
||||
"c) 其他机动车:25° 。\n" +
|
||||
"6.5汽车(三轮汽车除外)应具有适度的不足转向特性。\n" +
|
||||
"6.6三轮汽车、摩托车的转向轮向左或向右转角应小于等于:\n" +
|
||||
"a)\t三轮汽车、三轮摩托车、正三轮轻便摩托车:45°;\n" +
|
||||
"6)\t\t两轮普通摩托车、两轮轻便摩托车:48°。\n" +
|
||||
"6.6机动车在平坦、硬实、干燥和清洁的道路上行驶不应跑偏,其方向盘(或方向把)不应有摆振、路感不灵或其他异常现象。\n" +
|
||||
"6.8机动车在平坦、硬实、干燥和清洁的水泥或沥青道路上行驶,以10 km/h的速度在5 s之内沿螺旋线从直线行驶过渡到外圆直径为25 m的车辆通道圆行驶,施加于方向盘外缘的最大切向力应小于等于245 N。\n" +
|
||||
"6.9专用校车应采用转向助力装置;其他机动车转向轴最大设计轴荷大于4 000 kg时,也应采用转向助力装置。装有转向助力装置的机动车,转向时其转向助力功能不得出现时有时无的现象,且转向助力装置失效时仍应具有用方向盘控制机动车的能力。装有电动转向助力装置的汽车,在产品使用说明书规定的正常使用状态下,应保证转向助力装置的电能供应。\n" +
|
||||
"6.10汽车和汽车列车(不计具有作业功能的专用装置的突出部分)、轮式拖拉机运输机组应能在同一个车辆通道圆内通过,车辆通道圆的外圆直径认为25.00 m,车辆通道圆的内圆直径D2为10.60 m。 汽车和汽车列车、轮式拖拉机运输机组由直线行驶过渡到上述圆周运动时,任何部分超出直线行驶时的 车辆外侧面垂直面的值(外摆值)应小于等于0.80 m(对铰接客车和铰接式无轨电车外摆值应小于等于 1.20 m),其试验方法见GB 1589。\n" +
|
||||
"6.11汽车(三轮汽车除外)的车轮定位应与该车型的技术要求一致。对前轴采用非独立悬架的汽车(前轴采用双转向轴时除外),其转向轮的横向侧滑量,用侧滑台检验时侧滑量值应在±5 m/km之间。\n" +
|
||||
"6.12转向节及臂,转向横、直拉杆及球销不得有裂纹和损伤,并且转向球销不应松旷。对机动车进行改装或修理时横、直拉杆不得拼焊。\n" +
|
||||
"6.13三轮汽车、摩托车的前减振器、上下联板和方向把不应有变形和裂损。\n";
|
||||
String str2="6转向系\n" +
|
||||
"6.1汽车(三轮汽车除外)的方向盘应设置于左侧,其他机动车的方向盘不应设置于右侧;专项作业车、教练车按需要可设置左右两个方向盘。装有两个后轮、有驾驶室的正三轮摩托车如使用方向盘转向,则方向盘中心立柱距车辆纵向中心平面的水平距离应小于或等于200 mm ;其他摩托车不应使用方向盘转向。\n" +
|
||||
"6.2机动车的方向盘(或方向把)应转动灵活,无卡滞现象。机动车应设置转向限位装置。转向系统在任何操作位置上,不应与其他部件有干涉现象。\n" +
|
||||
"6.3机动车(摩托车、三轮汽车、手扶拖拉机运输机组除外〉正常行驶时,转向轮转向后应有一定的回正能力(允许有残余角),以使机动车具有稳定的直线行驶能力0\n" +
|
||||
"6.4机动车方向盘的最大自由转动量应小于或等于:\n" +
|
||||
"a) 最大设计车速大于或等于100 km/h 的机动车:15°\n" +
|
||||
"b) 三轮汽车:35°;\n" +
|
||||
"c) 其他机动车:25° 。\n" +
|
||||
"6.5汽车(三轮汽车除外)应具有适度的不足转向特性。\n" +
|
||||
"6.6三轮汽车、摩托车的转向轮向左或向右转角应小于或等于:\n" +
|
||||
"a) 三轮汽车、三轮摩托车、正三轮轻便摩托车:45°;\n" +
|
||||
"b)两轮普通摩托车、两轮轻便摩托车:48°0\n" +
|
||||
"6.7机动车在平坦、硬实、干燥和清洁的道路上行驶不应跑偏,其方向盘(或方向把)不应有摆振等异常现象。\n" +
|
||||
"6.8机动车在平坦、硬实、干燥和清洁的水泥或沥青道路上行驶,以10 km/h 的速度在5 s 之内沿螺旋线从直线行驶过渡到外圆直径为25m 的车辆通道圆行驶,施加于方向盘外缘的最大切向力应小于或等于245 N。\n" +
|
||||
"6.9汽车(三轮汽车除外)的车轮定位应与该车型的技术要求一致。对前轴采用非独立悬架的汽车(前轴采用双转向轴时除外),其转向轮的横向侧滑量,用侧滑台检验时侧滑量值应小于或等于5 m/km。\n" +
|
||||
"6.10 专用校车应采用转向助力装置;其他机动车转向轴最大设计轴荷大于4 000 kg 时,也应采用转向助力装置。装有转向助力装置的机动车,转向时其转向助力功能不应出现时有时无的现象,且转向助力装置失效时仍应具有用方向盘控制机动车的能力。\n" +
|
||||
"6.11转向节及臂,转向横、直拉杆及球销应连接可靠,且不应有裂纹和损伤,并且转向球销不应松旷。对机动车进行改装或修理时横、直拉杆不应拼焊。\n" +
|
||||
"6.12三轮汽车、摩托车的前减振器、上下联板和方向把不应有变形和裂损。";
|
||||
String str3="\n" +
|
||||
"5车辆识别代号的标示位置\n" +
|
||||
"5.1每辆车辆都应具有唯一的车辆识别代号,并永久保持地标示在车辆上,同一车辆上标示的所有的 车辆识别代号的字码构成与排列顺序应相同。除第9章规定的情况外,不得对已标示的车辆识别代号 进行变更。\n" +
|
||||
"5.2车辆应在产品标牌上标示车辆识别代号(L1、L3类车辆可除外),产品标牌的型式、标示位置、标示要求应符合GB/T 18411的规定。\n" +
|
||||
"5.3车辆应至少有一个车辆识别代号直接打刻在车架(无车架的车辆为车身主要承载且不能拆卸的部件)能防止锈烛、磨损的部位上。其中:\n" +
|
||||
"a)\tM1类车辆的车辆识别代号应打刻在发动机舱内能防止替换的车辆结构件上,或打刻在车门 立柱上,如受结构限制没有打刻空间时也可打刻在右侧除行李舱外的车辆其他结构件上;\n" +
|
||||
"b)\t最大设计总质量大于或等于12000 kg的货车及所有牵引杆挂车,车辆识别代号应打刻在右前轮纵向中心线前端纵梁外侧,如受结构限制也可打刻在右前轮纵向中心线附近纵梁外侧;\n" +
|
||||
"c)\t半挂车和中置轴挂车的车辆识别代号应打刻在右前支腿前端纵梁外侧(无纵梁车辆除外);\n" +
|
||||
"d)\t其他汽车和无纵梁挂车的车辆识别代号应打刻在车辆右侧前部的车辆结构件上,如受结构限 制也可打刻在右侧其他车辆结构件上。\n" +
|
||||
"打刻车辆识别代号的部件不应采用打磨、挖补、垫片、凿改、重新涂漆(设计和制造上为保护打刻的 车辆识别代号而采取涂漆工艺的情形除外)等方式处理,从上(前)方观察时,打刻区域周边足够大面积 的表面不应有任何覆盖物,如有覆盖物,该覆盖物的表面应明确标示“车辆识别代号”或“VIN”字样,且覆盖物在不使用任何专用工具的情况下能直接取下(或揭开)及复原,以方便地观察到足够大的包括打刻区域的表面。\n" +
|
||||
"注1:打刻区域周边足够大面积的表面(足够大的包括打刻区域的表面)是指打刻车辆识别代号的部件的全部表面,但所暴露表面能满足查看打刻车辆识别代号的部件有无挖补、重新焊接、粘贴等痕迹的需要时,也应视为满足要求。\n" +
|
||||
"注2:对摩托车,打刻的车辆识别代号在不举升车辆的情形下可观察、拓印的,视为满足要求。\n" +
|
||||
"打刻的车辆识别代号从上(前)方应易于观察、拓印,对于汽车和挂车还应能拍照。\n" +
|
||||
"5.4具有电子控制单元的汽车,其至少有一个电子控制单元应不可篡改地存储车辆识别代号。\n" +
|
||||
"5.5 M1、N1类车辆应在靠近风窗立柱的位置标示车辆识别代号,该车辆识别代号在白天不需移动任何部件从车外即能清晰识读。\n" +
|
||||
"5.6除按照5.2、5.3、5.4、5.5规定标示车辆识别代号之外,类车辆还应在行李舱的易见部位标示车辆识别代号;且若车辆制造厂选取车辆识别代号作为车辆及部件识别标记的标识信息,还应按照GB 30509的规定,标示车辆识别代号。\n" +
|
||||
"5.7除按照5.2、5.3、5.4规定标示车辆识别代号之外,最大设计总质量大于或等于12000 kg的栏板式、仓栅式、自卸式、罐式货车及最大设计总质量大于或等于10000 kg的栏板式、仓栅式、自卸式、罐式挂车还应在其货箱或常压罐体(或设计和制造上固定在货箱或常压罐体上且用于与车架连接的结构件)上打刻至少两个车辆识别代号。打刻的车辆识别代号应位于货箱(常压罐体)左、右两侧或前端面且易于拍照;且若打刻在货箱(常压罐体)左、右两侧时,打刻的车辆识别代号距货箱(常压罐体)前端面的距离应小于或等于1 000 mm,若打刻在左、右两侧连接结构件时应尽量靠近货箱(常压罐体)前端面。\n" +
|
||||
"5.8车辆制造厂应至少在一种随车文件中标示车辆识别代号。";
|
||||
|
||||
String str4 = "\n" +
|
||||
"5.3车辆的驱动\n" +
|
||||
"5.3.1车辆不应靠自身动力驱动。\n" +
|
||||
"5.3.2在碰撞瞬间,车辆应不冉承受任何附加转向或驱动装置的作用。\n" +
|
||||
"5.3.3车辆到达壁障的路线在横向任一方向偏离理论轨迹均不应超过150 mm。\n" +
|
||||
"5.4 试验速度\n" +
|
||||
"在碰撞瞬间,车辆速度应为504 km/h。如果试验在更高的碰撞速度下进行并且车辆符合要求,也认为试验合格。\n" +
|
||||
"5.5对前排座椅假人的测量\n" +
|
||||
"5.5.1为确定性能指标必需的所有测量,均应采用符合附录D要求的测量系统。\n" +
|
||||
"5.5.2不同的参数应通过具备下列CFC(通道的频率等级)的独立数据通道来记录。\n" +
|
||||
"5.5.2.1对假人头部的测量\n" +
|
||||
"重心处的加速度(a)由加速度的二维分量计算得出。加速度分量测量时,CFC为1000。\n" +
|
||||
"5.5.2.2对假人颈部的测量\n" +
|
||||
"5.5.2.2.1在头颈连接处测量的轴向张力和前后剪切力,CFC为1000。\n" +
|
||||
"5.5.2.2.2在头颈连接处测量的对Y轴的弯矩,CFC为600。\n" +
|
||||
"5.5.2.3对假人胸部的测量\n" +
|
||||
"胸部变形测量时,CFC为180。\n" +
|
||||
"5.5.2.4对假人大腿的测量\n" +
|
||||
"轴向压缩力测量时,CFC为600。";
|
||||
|
||||
System.out.println("ld=" + ld(str1, str2));
|
||||
System.out.println("sim=" + sim(str1, str2));
|
||||
System.out.println("====================================================");
|
||||
System.out.println("ld=" + ld(str1, str3));
|
||||
System.out.println("sim=" + sim(str1, str3));
|
||||
|
||||
System.out.println("====================================================");
|
||||
System.out.println("ld=" + ld(str1, str4));
|
||||
System.out.println("sim=" + sim(str1, str4));
|
||||
|
||||
System.out.println("====================================================");
|
||||
System.out.println("ld=" + ld(str3, str4));
|
||||
System.out.println("sim=" + sim(str3, str4));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.adc.da.utils.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: super_liu
|
||||
* date: 2020/12/9 10:00
|
||||
*/
|
||||
public class CompareListUtil {
|
||||
/**
|
||||
* @param aList 本列表
|
||||
* @param bList 对照列表
|
||||
* @return 返回增加的元素组成的列表
|
||||
* @Description: 计算列表aList相对于bList的增加的情况,兼容任何类型元素的列表数据结构
|
||||
*/
|
||||
public static <E> List<E> getAddaListThanbList(List<E> aList, List<E> bList) {
|
||||
List<E> addList = new ArrayList<E>();
|
||||
for (int i = 0; i < aList.size(); i++) {
|
||||
if (!myListContains(bList, aList.get(i))) {
|
||||
addList.add(aList.get(i));
|
||||
}
|
||||
}
|
||||
return addList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param aList 本列表
|
||||
* @param bList 对照列表
|
||||
* @return 返回减少的元素组成的列表
|
||||
* @Description: 计算列表aList相对于bList的减少的情况,兼容任何类型元素的列表数据结构
|
||||
*/
|
||||
public static <E> List<E> getReduceaListThanbList(List<E> aList, List<E> bList) {
|
||||
List<E> reduceaList = new ArrayList<E>();
|
||||
for (int i = 0; i < bList.size(); i++) {
|
||||
if (!myListContains(aList, bList.get(i))) {
|
||||
reduceaList.add(bList.get(i));
|
||||
}
|
||||
}
|
||||
return reduceaList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param sourceList 源列表
|
||||
* @param element 待判断的包含元素
|
||||
* @return 包含返回 true,不包含返回 false
|
||||
* @Description: 判断元素element是否是sourceList列表中的一个子元素
|
||||
*/
|
||||
private static <E> boolean myListContains(List<E> sourceList, E element) {
|
||||
if (sourceList == null || element == null) {
|
||||
return false;
|
||||
}
|
||||
if (sourceList.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
for (E tip : sourceList) {
|
||||
if (element.equals(tip)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list
|
||||
* @return list
|
||||
* @Description: 去除list重复数据
|
||||
*/
|
||||
public static <E> List<E> cleanDisRepet(List<E> list) {
|
||||
HashSet h = new HashSet(list);
|
||||
list.clear();
|
||||
list.addAll(h);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.adc.da.utils.util;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @Description: 各种类型数据,拼接成逗号分隔字符串
|
||||
* @Author: super_liu
|
||||
* date: 2020/11/23 14:30
|
||||
*/
|
||||
public class ConcatStringUtil {
|
||||
|
||||
public static String concatSet (Set<String> setVal) {
|
||||
String resultStr = "";
|
||||
if (setVal != null && !setVal.isEmpty()) {
|
||||
for (String val : setVal) {
|
||||
if (StringUtils.isNotBlank(val) && !"null".equals(val)) {
|
||||
resultStr += val + ",";
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(resultStr)) {
|
||||
resultStr = resultStr.substring(0,resultStr.length()-1);
|
||||
}
|
||||
}
|
||||
return resultStr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.adc.da.utils.util;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* @Description: 判断是否为日期格式
|
||||
* @Author: super_liu
|
||||
* date: 2020/12/31 11:25
|
||||
*/
|
||||
public class DateUtil {
|
||||
|
||||
/***
|
||||
* @Description: 判断多个日期是否都符合日期格式
|
||||
* @Author: super_liu
|
||||
* @Date: 2020/12/31 11:31
|
||||
* @Param: [str]
|
||||
* @Return: boolean
|
||||
*/
|
||||
public static boolean isValidDate(String str) throws Exception{
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String[] strArr = str.split(",");
|
||||
for (String dateStr : strArr) {
|
||||
try {
|
||||
simpleDateFormat.setLenient(false);
|
||||
simpleDateFormat.parse(dateStr);
|
||||
} catch (Exception e){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* utc 时间格式转换正常格式 2018-08-07T03:41:59Z
|
||||
* @param utcTime 时间
|
||||
* @return
|
||||
*/
|
||||
public static String formatStrUTCToDateStr(String utcTime) {
|
||||
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.SIMPLIFIED_CHINESE);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
TimeZone utcZone = TimeZone.getTimeZone("UTC");
|
||||
sf.setTimeZone(utcZone);
|
||||
Date date = null;
|
||||
String dateTime = "";
|
||||
try {
|
||||
date = sf.parse(utcTime);
|
||||
dateTime = sdf.format(date);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return dateTime;
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String utcTime = "2021-04-15T01:43:54.296Z";
|
||||
String time = formatStrUTCToDateStr("2021-04-15T01:43:54.296Z");
|
||||
System.out.println("utcTime 转换前:" + utcTime);
|
||||
System.out.println("utcTime 转换后 time :" + time);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user