保时捷政府资源墙
parent
138947dc15
commit
be949e910e
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -33,4 +33,8 @@ public class MybatisUtil {
|
||||||
}
|
}
|
||||||
return sqlSessionManager;
|
return sqlSessionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <T> T getMapper(Class<T> tClass){
|
||||||
|
return sqlSessionManager.getMapper(tClass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package aiyh.utils;
|
package aiyh.utils;
|
||||||
|
|
||||||
|
import aiyh.utils.annotation.BooleanConverter;
|
||||||
|
import aiyh.utils.annotation.BooleanConverterEnum;
|
||||||
import aiyh.utils.annotation.DateFormatAn;
|
import aiyh.utils.annotation.DateFormatAn;
|
||||||
import aiyh.utils.entity.*;
|
import aiyh.utils.entity.*;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
import aiyh.utils.fileUtil.ProperUtil;
|
import aiyh.utils.fileUtil.ProperUtil;
|
||||||
import aiyh.utils.logger.LoggerUtil;
|
|
||||||
import aiyh.utils.mapUtil.UtilHashMap;
|
import aiyh.utils.mapUtil.UtilHashMap;
|
||||||
import aiyh.utils.mapUtil.UtilLinkedHashMap;
|
import aiyh.utils.mapUtil.UtilLinkedHashMap;
|
||||||
import aiyh.utils.mapper.UtilMapper;
|
import aiyh.utils.mapper.UtilMapper;
|
||||||
|
@ -15,16 +17,29 @@ import aiyh.utils.sqlUtil.whereUtil.impl.PrepWhereImpl;
|
||||||
import aiyh.utils.sqlUtil.whereUtil.impl.WhereImpl;
|
import aiyh.utils.sqlUtil.whereUtil.impl.WhereImpl;
|
||||||
import aiyh.utils.zwl.common.ToolUtil;
|
import aiyh.utils.zwl.common.ToolUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.google.common.base.Strings;
|
||||||
import com.ibm.icu.text.SimpleDateFormat;
|
import com.ibm.icu.text.SimpleDateFormat;
|
||||||
|
import com.weaver.general.TimeUtil;
|
||||||
import org.apache.dubbo.common.utils.CollectionUtils;
|
import org.apache.dubbo.common.utils.CollectionUtils;
|
||||||
import org.apache.log4j.*;
|
import org.apache.log4j.*;
|
||||||
import org.h2.util.StringUtils;
|
import org.h2.util.StringUtils;
|
||||||
import weaver.common.util.string.StringUtil;
|
import weaver.common.util.string.StringUtil;
|
||||||
import weaver.conn.RecordSet;
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.docs.docs.DocImageManager;
|
||||||
|
import weaver.docs.webservices.DocInfo;
|
||||||
|
import weaver.docs.webservices.DocServiceImpl;
|
||||||
|
import weaver.file.ImageFileManager;
|
||||||
|
import weaver.formmode.data.ModeDataIdUpdate;
|
||||||
|
import weaver.formmode.setup.ModeRightInfo;
|
||||||
import weaver.general.GCONST;
|
import weaver.general.GCONST;
|
||||||
|
import weaver.general.IOUtils;
|
||||||
import weaver.hrm.HrmUserVarify;
|
import weaver.hrm.HrmUserVarify;
|
||||||
import weaver.hrm.User;
|
import weaver.hrm.User;
|
||||||
|
import weaver.interfaces.workflow.action.Action;
|
||||||
|
import weaver.soa.workflow.request.RequestInfo;
|
||||||
|
import weaver.soa.workflow.request.RequestService;
|
||||||
import weaver.systeminfo.SystemEnv;
|
import weaver.systeminfo.SystemEnv;
|
||||||
|
import weaver.workflow.request.RequestManager;
|
||||||
import weaver.workflow.workflow.WorkflowVersion;
|
import weaver.workflow.workflow.WorkflowVersion;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
@ -61,13 +76,38 @@ import java.util.zip.ZipEntry;
|
||||||
public class Util extends weaver.general.Util {
|
public class Util extends weaver.general.Util {
|
||||||
|
|
||||||
private static final UtilService utilService = new UtilService();
|
private static final UtilService utilService = new UtilService();
|
||||||
private static final RecordSet rs = new RecordSet();
|
private static RecordSet rs;
|
||||||
private static final String LOGGER_NAME = "cusAYH";
|
|
||||||
private static final RecordsetUtil recordsetUtil = new RecordsetUtil();
|
private static final RecordsetUtil recordsetUtil = new RecordsetUtil();
|
||||||
private static final UtilMapper mapper = getMapper(UtilMapper.class);
|
private static final UtilMapper mapper = recordsetUtil.getMapper(UtilMapper.class);
|
||||||
private static final LoggerUtil loggerUtil = new LoggerUtil();
|
|
||||||
static ToolUtil toolUtil = new ToolUtil();
|
static ToolUtil toolUtil = new ToolUtil();
|
||||||
private static volatile Logger log = null;
|
private static volatile Logger log = null;
|
||||||
|
public static final ModeRightInfo MODE_RIGHT_INFO = new ModeRightInfo();
|
||||||
|
public static final ModeDataIdUpdate mdu = ModeDataIdUpdate.getInstance();
|
||||||
|
|
||||||
|
public static final char SBC_SPACE = 12288; // 全角空格 12288
|
||||||
|
|
||||||
|
public static final char DBC_SPACE = 32; //半角空格 32
|
||||||
|
|
||||||
|
// ASCII character 33-126 <-> unicode 65281-65374
|
||||||
|
public static final char ASCII_START = 33;
|
||||||
|
|
||||||
|
public static final char ASCII_END = 126;
|
||||||
|
|
||||||
|
public static final char UNICODE_START = 65281;
|
||||||
|
|
||||||
|
public static final char UNICODE_END = 65374;
|
||||||
|
|
||||||
|
public static final char DBC_SBC_STEP = 65248; // 全角半角转换间隔
|
||||||
|
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
rs = new RecordSet();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
new ToolUtil().writeErrorLog("\n初始化RecordSet失败!请检查系统是否正常启动!\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取指定格式的当前时间
|
* 获取指定格式的当前时间
|
||||||
|
@ -207,8 +247,6 @@ public class Util extends weaver.general.Util {
|
||||||
String[] columnType = rs.getColumnTypeName();
|
String[] columnType = rs.getColumnTypeName();
|
||||||
int colCounts = 0;
|
int colCounts = 0;
|
||||||
colCounts = rs.getColCounts() == 0 ? columnType.length : rs.getColCounts();
|
colCounts = rs.getColCounts() == 0 ? columnType.length : rs.getColCounts();
|
||||||
toolUtil.writeErrorLog(Arrays.toString(columnType));
|
|
||||||
toolUtil.writeErrorLog("字段数:" + colCounts);
|
|
||||||
for (int i = 1; i <= colCounts; i++) {
|
for (int i = 1; i <= colCounts; i++) {
|
||||||
String key = null;
|
String key = null;
|
||||||
String type = "varchar";
|
String type = "varchar";
|
||||||
|
@ -334,7 +372,40 @@ public class Util extends weaver.general.Util {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (field.getType().equals(boolean.class) || field.getType().equals(Boolean.class)) {
|
if (field.getType().equals(boolean.class) || field.getType().equals(Boolean.class)) {
|
||||||
field.set(t, rs.getBoolean(fieldName));
|
try {
|
||||||
|
BooleanConverter annotation = field.getAnnotation(BooleanConverter.class);
|
||||||
|
BooleanConverterEnum value = annotation.value();
|
||||||
|
String trueStr = annotation.trueStr();
|
||||||
|
String falseStr = annotation.falseStr();
|
||||||
|
String trueInteger = annotation.trueInteger();
|
||||||
|
String falseInteger = annotation.falseInteger();
|
||||||
|
boolean defaultValue = annotation.defaultValue();
|
||||||
|
String booleanVal = null;
|
||||||
|
try {
|
||||||
|
booleanVal = rs.getString(fieldName);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
boolean hasValueTrue = annotation.hasValueTrue();
|
||||||
|
if (value == BooleanConverterEnum.STRING) {
|
||||||
|
if (booleanVal == null || booleanVal.equals(falseStr)) {
|
||||||
|
field.set(t, false);
|
||||||
|
} else if ((hasValueTrue && !Strings.isNullOrEmpty(booleanVal)) || booleanVal.equals(trueStr)) {
|
||||||
|
field.set(t, true);
|
||||||
|
} else {
|
||||||
|
field.set(t, defaultValue);
|
||||||
|
}
|
||||||
|
} else if (value == BooleanConverterEnum.INTEGER) {
|
||||||
|
if (booleanVal == null || booleanVal.equals(falseInteger)) {
|
||||||
|
field.set(t, false);
|
||||||
|
} else if ((hasValueTrue && !Strings.isNullOrEmpty(booleanVal)) || booleanVal.equals(trueInteger)) {
|
||||||
|
field.set(t, true);
|
||||||
|
} else {
|
||||||
|
field.set(t, defaultValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new CustomerException("不支持的类型转换!");
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (field.getType().equals(Float.class) || field.getType().equals(float.class)) {
|
if (field.getType().equals(Float.class) || field.getType().equals(float.class)) {
|
||||||
|
@ -401,7 +472,40 @@ public class Util extends weaver.general.Util {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (field.getType().equals(boolean.class) || field.getType().equals(Boolean.class)) {
|
if (field.getType().equals(boolean.class) || field.getType().equals(Boolean.class)) {
|
||||||
field.set(t, rs.getBoolean(fieldName));
|
try {
|
||||||
|
BooleanConverter annotation = field.getAnnotation(BooleanConverter.class);
|
||||||
|
BooleanConverterEnum value = annotation.value();
|
||||||
|
String trueStr = annotation.trueStr();
|
||||||
|
String falseStr = annotation.falseStr();
|
||||||
|
String trueInteger = annotation.trueInteger();
|
||||||
|
String falseInteger = annotation.falseInteger();
|
||||||
|
boolean defaultValue = annotation.defaultValue();
|
||||||
|
String booleanVal = null;
|
||||||
|
try {
|
||||||
|
booleanVal = rs.getString(fieldName);
|
||||||
|
} catch (Exception ignored) {
|
||||||
|
}
|
||||||
|
boolean hasValueTrue = annotation.hasValueTrue();
|
||||||
|
if (value == BooleanConverterEnum.STRING) {
|
||||||
|
if (booleanVal == null || booleanVal.equals(falseStr)) {
|
||||||
|
field.set(t, false);
|
||||||
|
} else if ((hasValueTrue && !Strings.isNullOrEmpty(booleanVal)) || booleanVal.equals(trueStr)) {
|
||||||
|
field.set(t, true);
|
||||||
|
} else {
|
||||||
|
field.set(t, defaultValue);
|
||||||
|
}
|
||||||
|
} else if (value == BooleanConverterEnum.INTEGER) {
|
||||||
|
if (booleanVal == null || booleanVal.equals(falseInteger)) {
|
||||||
|
field.set(t, false);
|
||||||
|
} else if ((hasValueTrue && !Strings.isNullOrEmpty(booleanVal)) || booleanVal.equals(trueInteger)) {
|
||||||
|
field.set(t, true);
|
||||||
|
} else {
|
||||||
|
field.set(t, defaultValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new CustomerException("不支持的类型转换!");
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (field.getType().equals(Float.class) || field.getType().equals(float.class)) {
|
if (field.getType().equals(Float.class) || field.getType().equals(float.class)) {
|
||||||
|
@ -513,7 +617,11 @@ public class Util extends weaver.general.Util {
|
||||||
return null;
|
return null;
|
||||||
} else if (clazz.equals(Boolean.class)) {
|
} else if (clazz.equals(Boolean.class)) {
|
||||||
if (rs.next()) {
|
if (rs.next()) {
|
||||||
|
try {
|
||||||
return (T) Boolean.valueOf(rs.getBoolean(1));
|
return (T) Boolean.valueOf(rs.getBoolean(1));
|
||||||
|
} catch (Exception e) {
|
||||||
|
return (T) Boolean.valueOf("false");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1611,11 +1719,12 @@ public class Util extends weaver.general.Util {
|
||||||
* @param docField
|
* @param docField
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public static String getDocCategorys(String workflowId, String docField) {
|
public static String getDocCategorys(String workflowId, String docField) {
|
||||||
RecordSet rs = new RecordSet();
|
RecordSet rs = new RecordSet();
|
||||||
rs.executeQuery("select formid from workflow_base where id = ?", workflowId);
|
rs.executeQuery("select formid from workflow_base where id = ?", workflowId);
|
||||||
String formId = Util.recordeSet2Entity(rs, String.class);
|
String formId = Util.recordeSet2Entity(rs, String.class);
|
||||||
String query = "select doccategory from workflow_fileupload where fieldid = (select id from workflow_billfield where fieldname = ? and billid = ?)";
|
String query = "select doccategory from workflow_fileupload where fieldid in (select id from workflow_billfield where fieldname = ? and billid = ?)";
|
||||||
rs.executeQuery(query, docField, formId);
|
rs.executeQuery(query, docField, formId);
|
||||||
String docCategorys = Util.null2String(Util.recordeSet2Entity(rs, String.class));
|
String docCategorys = Util.null2String(Util.recordeSet2Entity(rs, String.class));
|
||||||
if (StringUtils.isNullOrEmpty(docCategorys)) {
|
if (StringUtils.isNullOrEmpty(docCategorys)) {
|
||||||
|
@ -1630,6 +1739,7 @@ public class Util extends weaver.general.Util {
|
||||||
return docCategorys;
|
return docCategorys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public static String getDocCategorys(int workflowId, String docField) {
|
public static String getDocCategorys(int workflowId, String docField) {
|
||||||
return getDocCategorys(String.valueOf(workflowId), docField);
|
return getDocCategorys(String.valueOf(workflowId), docField);
|
||||||
}
|
}
|
||||||
|
@ -1641,6 +1751,7 @@ public class Util extends weaver.general.Util {
|
||||||
* @param docFieldId
|
* @param docFieldId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public static String getDocCategorysById(String workflowId, String docFieldId) {
|
public static String getDocCategorysById(String workflowId, String docFieldId) {
|
||||||
RecordSet rs = new RecordSet();
|
RecordSet rs = new RecordSet();
|
||||||
// rs.executeQuery("select formid from workflow_base where id = ?",workflowId);
|
// rs.executeQuery("select formid from workflow_base where id = ?",workflowId);
|
||||||
|
@ -1660,6 +1771,40 @@ public class Util extends weaver.general.Util {
|
||||||
return docCategorys;
|
return docCategorys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据流程和流程字段查询文档目录
|
||||||
|
*
|
||||||
|
* @param workflowId 流程ID
|
||||||
|
* @param docField 文档字段ID
|
||||||
|
* @param tableName 明细表名
|
||||||
|
* @return 文档目录
|
||||||
|
*/
|
||||||
|
public static String getDocCategorysByTable(String workflowId, String docField, String tableName) {
|
||||||
|
RecordSet rs = new RecordSet();
|
||||||
|
rs.executeQuery("select formid from workflow_base where id = ?", workflowId);
|
||||||
|
String formId = Util.recordeSet2Entity(rs, String.class);
|
||||||
|
String query = "select doccategory from workflow_fileupload where fieldid in (select id from workflow_billfield where fieldname = ? and billid = ? and (detailtable = ? or detailtable is null))";
|
||||||
|
if (!Strings.isNullOrEmpty(tableName) && tableName.contains("_dt")) {
|
||||||
|
query = "select doccategory from workflow_fileupload where fieldid in (select id from workflow_billfield where fieldname = ? and billid = ? and detailtable = ?)";
|
||||||
|
}
|
||||||
|
if (Strings.isNullOrEmpty(tableName)) {
|
||||||
|
tableName = "";
|
||||||
|
}
|
||||||
|
rs.executeQuery(query, docField, formId, tableName);
|
||||||
|
String docCategorys = Util.null2String(Util.recordeSet2Entity(rs, String.class));
|
||||||
|
if (StringUtils.isNullOrEmpty(docCategorys)) {
|
||||||
|
query = "select doccategory from workflow_base where id = ?";
|
||||||
|
rs.executeQuery(query, workflowId);
|
||||||
|
rs.next();
|
||||||
|
docCategorys = Util.null2String(rs.getString(1));
|
||||||
|
}
|
||||||
|
if (StringUtils.isNullOrEmpty(docCategorys)) {
|
||||||
|
docCategorys = ",,1";
|
||||||
|
}
|
||||||
|
return docCategorys;
|
||||||
|
}
|
||||||
|
|
||||||
public static String null2DefaultStr(Object obj, String defaultStr) {
|
public static String null2DefaultStr(Object obj, String defaultStr) {
|
||||||
String objStr = Util.null2String(obj);
|
String objStr = Util.null2String(obj);
|
||||||
if (StringUtils.isNullOrEmpty(objStr) && StringUtils.isNullOrEmpty(defaultStr)) {
|
if (StringUtils.isNullOrEmpty(objStr) && StringUtils.isNullOrEmpty(defaultStr)) {
|
||||||
|
@ -1842,7 +1987,7 @@ public class Util extends weaver.general.Util {
|
||||||
boolean isFirst = true;
|
boolean isFirst = true;
|
||||||
|
|
||||||
String s;
|
String s;
|
||||||
for (Iterator item = coll.iterator(); item.hasNext(); sb.append(s)) {
|
for (Iterator<String> item = coll.iterator(); item.hasNext(); sb.append(s)) {
|
||||||
s = (String) item.next();
|
s = (String) item.next();
|
||||||
if (isFirst) {
|
if (isFirst) {
|
||||||
isFirst = false;
|
isFirst = false;
|
||||||
|
@ -1850,11 +1995,36 @@ public class Util extends weaver.general.Util {
|
||||||
sb.append(split);
|
sb.append(split);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* join方法
|
||||||
|
*
|
||||||
|
* @param coll
|
||||||
|
* @param split
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> String joinEach(Collection<T> coll, String split) {
|
||||||
|
if (CollectionUtils.isEmpty(coll)) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
boolean isFirst = true;
|
||||||
|
|
||||||
|
String s;
|
||||||
|
for (Iterator<T> item = coll.iterator(); item.hasNext(); sb.append(s)) {
|
||||||
|
s = (String) item.next();
|
||||||
|
if (isFirst) {
|
||||||
|
isFirst = false;
|
||||||
|
} else {
|
||||||
|
sb.append(split);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String intJoin(Collection<Integer> coll, String split) {
|
public static String intJoin(Collection<Integer> coll, String split) {
|
||||||
if (CollectionUtils.isEmpty(coll)) {
|
if (CollectionUtils.isEmpty(coll)) {
|
||||||
|
@ -1864,7 +2034,7 @@ public class Util extends weaver.general.Util {
|
||||||
boolean isFirst = true;
|
boolean isFirst = true;
|
||||||
|
|
||||||
String s;
|
String s;
|
||||||
for (Iterator item = coll.iterator(); item.hasNext(); sb.append(s)) {
|
for (Iterator<Integer> item = coll.iterator(); item.hasNext(); sb.append(s)) {
|
||||||
Object next = item.next();
|
Object next = item.next();
|
||||||
s = next == null ? "" : String.valueOf(next);
|
s = next == null ? "" : String.valueOf(next);
|
||||||
if (isFirst) {
|
if (isFirst) {
|
||||||
|
@ -1878,10 +2048,6 @@ public class Util extends weaver.general.Util {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void errorException(Object message, Throwable exception) {
|
|
||||||
loggerUtil.error(message, exception);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取日志对象
|
* 获取日志对象
|
||||||
*
|
*
|
||||||
|
@ -1891,10 +2057,9 @@ public class Util extends weaver.general.Util {
|
||||||
if (log == null) {
|
if (log == null) {
|
||||||
synchronized (Util.class) {
|
synchronized (Util.class) {
|
||||||
if (log == null) {
|
if (log == null) {
|
||||||
// log = org.apache.log4j.Logger.getLogger(LOGGER_NAME);
|
|
||||||
DailyRollingFileAppender appender = new DailyRollingFileAppender();
|
DailyRollingFileAppender appender = new DailyRollingFileAppender();
|
||||||
log = Logger.getLogger("aiyh_cus");
|
log = Logger.getLogger("ayh_cus");
|
||||||
appender.setName("aiyh_cus");
|
appender.setName("ayh_cus");
|
||||||
appender.setEncoding("UTF-8");
|
appender.setEncoding("UTF-8");
|
||||||
appender.setDatePattern("'_'yyyyMMdd'.log'");
|
appender.setDatePattern("'_'yyyyMMdd'.log'");
|
||||||
appender.setFile(weaver.general.GCONST.getLogPath() + "cus" + File.separator + "util_cus" + File.separator + "cus.log");
|
appender.setFile(weaver.general.GCONST.getLogPath() + "cus" + File.separator + "util_cus" + File.separator + "cus.log");
|
||||||
|
@ -1913,6 +2078,28 @@ public class Util extends weaver.general.Util {
|
||||||
return log;
|
return log;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Logger getLogger(String name) {
|
||||||
|
DailyRollingFileAppender appender = new DailyRollingFileAppender();
|
||||||
|
Logger cusLog = Logger.getLogger(name);
|
||||||
|
appender.setName(name);
|
||||||
|
appender.setEncoding("UTF-8");
|
||||||
|
appender.setDatePattern("'_'yyyyMMdd'.log'");
|
||||||
|
appender.setFile(weaver.general.GCONST.getLogPath() + "cus" + File.separator + name + File.separator + "cus.log");
|
||||||
|
appender.setThreshold(Priority.DEBUG);
|
||||||
|
appender.setLayout(new PatternLayout("[%-5p] [%d{yyyy-MM-dd HH:mm:ss,SSS}] [%r] [Thread:%t][%F.%M:%L] ==> : %m %x %n"));
|
||||||
|
appender.setAppend(true);
|
||||||
|
appender.activateOptions();
|
||||||
|
cusLog.addAppender(appender);
|
||||||
|
if (mapper != null) {
|
||||||
|
Boolean enableDebug = mapper.selectLogLevel();
|
||||||
|
if (!enableDebug) {
|
||||||
|
cusLog.setLevel(Level.INFO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cusLog;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询自定义配置参数值
|
* 查询自定义配置参数值
|
||||||
*
|
*
|
||||||
|
@ -1923,6 +2110,30 @@ public class Util extends weaver.general.Util {
|
||||||
return mapper.selectCusConfigParam(onlyMark);
|
return mapper.selectCusConfigParam(onlyMark);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取自定义配置参数值
|
||||||
|
*
|
||||||
|
* @param onlyMark 唯一标识
|
||||||
|
* @param defaultStr 默认值
|
||||||
|
* @return 参数值
|
||||||
|
*/
|
||||||
|
public static String getCusConfigValue(String onlyMark, String defaultStr) {
|
||||||
|
String cusConfigValue = getCusConfigValue(onlyMark);
|
||||||
|
return cusConfigValue == null ? defaultStr : cusConfigValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取自定义配置参数值
|
||||||
|
*
|
||||||
|
* @param onlyMark 唯一标识
|
||||||
|
* @param defaultStr 默认值
|
||||||
|
* @return 参数值
|
||||||
|
*/
|
||||||
|
public static String getCusConfigValueNullOrEmpty(String onlyMark, String defaultStr) {
|
||||||
|
String cusConfigValue = getCusConfigValue(onlyMark);
|
||||||
|
return StringUtils.isNullOrEmpty(cusConfigValue) ? defaultStr : cusConfigValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 将list转化为树形list
|
* 将list转化为树形list
|
||||||
|
@ -1992,6 +2203,9 @@ public class Util extends weaver.general.Util {
|
||||||
index++;
|
index++;
|
||||||
K id = getIdFn.apply(item);
|
K id = getIdFn.apply(item);
|
||||||
K parentId = getParentId.apply(item);
|
K parentId = getParentId.apply(item);
|
||||||
|
if (dataMap.containsKey(id)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
dataMap.put(id, item);
|
dataMap.put(id, item);
|
||||||
// 判断是否属于根节点,如果是根节点,则将数据添加到树中
|
// 判断是否属于根节点,如果是根节点,则将数据添加到树中
|
||||||
if (predicate.test(parentId)) {
|
if (predicate.test(parentId)) {
|
||||||
|
@ -2061,6 +2275,9 @@ public class Util extends weaver.general.Util {
|
||||||
index++;
|
index++;
|
||||||
K id = getIdFn.apply(item);
|
K id = getIdFn.apply(item);
|
||||||
K parentId = getParentId.apply(item);
|
K parentId = getParentId.apply(item);
|
||||||
|
if (dataMap.containsKey(id)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
dataMap.put(id, item);
|
dataMap.put(id, item);
|
||||||
// 判断是否属于根节点,如果是根节点,则将数据添加到树中
|
// 判断是否属于根节点,如果是根节点,则将数据添加到树中
|
||||||
if (predicate.test(parentId)) {
|
if (predicate.test(parentId)) {
|
||||||
|
@ -2159,19 +2376,44 @@ public class Util extends weaver.general.Util {
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机数字字符串
|
||||||
|
*
|
||||||
|
* @param length 长度
|
||||||
|
* @return 随机字符串
|
||||||
|
*/
|
||||||
public static String randomNumber(int length) {
|
public static String randomNumber(int length) {
|
||||||
return creatRandom("0123456789", length);
|
return creatRandom("0123456789", length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 随机家字符串
|
||||||
|
*
|
||||||
|
* @param length 长度
|
||||||
|
* @return 随机字符串
|
||||||
|
*/
|
||||||
public static String randomString(int length) {
|
public static String randomString(int length) {
|
||||||
return creatRandom("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", length);
|
return creatRandom("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成随机英文字符
|
||||||
|
*
|
||||||
|
* @param length 长度
|
||||||
|
* @return 随机字符串
|
||||||
|
*/
|
||||||
public static String randomLetter(int length) {
|
public static String randomLetter(int length) {
|
||||||
return creatRandom("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", length);
|
return creatRandom("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建随机字符串
|
||||||
|
*
|
||||||
|
* @param randomStr 随机字符串范围
|
||||||
|
* @param length 长度
|
||||||
|
* @return 随机字符串
|
||||||
|
*/
|
||||||
public static String creatRandom(String randomStr, int length) {
|
public static String creatRandom(String randomStr, int length) {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
|
@ -2182,5 +2424,295 @@ public class Util extends weaver.general.Util {
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取建模模块ID通过表名
|
||||||
|
*
|
||||||
|
* @param tableName 表名
|
||||||
|
* @return 模块ID
|
||||||
|
*/
|
||||||
|
public static String getModeIdByTableName(String tableName) {
|
||||||
|
String modeId = "";
|
||||||
|
String querySql = "select id from modeinfo where formid = (select id from workflow_bill where tablename = ?)";
|
||||||
|
RecordSet recordSet = new RecordSet();
|
||||||
|
recordSet.executeQuery(querySql, tableName);
|
||||||
|
if (recordSet.next()) {
|
||||||
|
modeId = Util.null2String(recordSet.getString("id"));
|
||||||
|
}
|
||||||
|
return modeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取建模表数据ID
|
||||||
|
*
|
||||||
|
* @param tableName 表名
|
||||||
|
* @param formModeId 模块ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 数据ID
|
||||||
|
*/
|
||||||
|
public static int getModeDataId(String tableName, int formModeId, int userId) {
|
||||||
|
return mdu.getModeDataNewId(tableName, formModeId, userId, 0, TimeUtil.getCurrentDateString(), TimeUtil.getOnlyCurrentTimeString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 建模表数据权限重构
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @param formId 表单ID
|
||||||
|
* @param id 数据ID
|
||||||
|
*/
|
||||||
|
public static void rebuildModeDataShare(Integer userId, Integer formId, Integer id) {
|
||||||
|
MODE_RIGHT_INFO.rebuildModeDataShareByEdit(userId, formId, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成文件并创建文档信息,权限继承文档目录
|
||||||
|
*
|
||||||
|
* @param fileName 文件名称
|
||||||
|
* @param seccategory 目录ID
|
||||||
|
* @param inputStream 文件流
|
||||||
|
* @return 创建的文档信息
|
||||||
|
* @throws Exception 异常细信息
|
||||||
|
*/
|
||||||
|
public static int createDoc(String fileName, int seccategory, InputStream inputStream, Integer userId) throws Exception {
|
||||||
|
ImageFileManager imageFileManager = new ImageFileManager();
|
||||||
|
int imageFileId = imageFileManager.saveImageFileByInputStream(inputStream, fileName);
|
||||||
|
return createDocByImageFileId(fileName, seccategory, imageFileId, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static int createDocByImageFileId(int seccategory, int imageFileId, Integer userId) throws Exception {
|
||||||
|
String fileName = mapper.selectFileNameByImageFileId(imageFileId);
|
||||||
|
return createDocByImageFileId(fileName, seccategory, imageFileId, userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建文件信息,文件权限继承文档目录权限
|
||||||
|
*
|
||||||
|
* @param fileName 文件名称
|
||||||
|
* @param seccategory 文件目录
|
||||||
|
* @param imageFileId 物理文件ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 文档ID
|
||||||
|
* @throws Exception 可能会出现的异常
|
||||||
|
*/
|
||||||
|
public static int createDocByImageFileId(String fileName, int seccategory, int imageFileId, Integer userId) throws Exception {
|
||||||
|
DocInfo docInfo = new DocInfo();
|
||||||
|
docInfo.setImagefileId(imageFileId);
|
||||||
|
docInfo.setSeccategory(seccategory);
|
||||||
|
docInfo.setDocSubject(fileName);
|
||||||
|
docInfo.setDoccontent("");
|
||||||
|
DocServiceImpl docService = new DocServiceImpl();
|
||||||
|
int docId = docService.createDocByUser(docInfo, new User(userId));
|
||||||
|
DocImageManager imgManger = new DocImageManager();
|
||||||
|
imgManger.resetParameter();
|
||||||
|
imgManger.setDocid(docId);
|
||||||
|
imgManger.setImagefileid(imageFileId);
|
||||||
|
imgManger.setImagefilename(fileName);
|
||||||
|
imgManger.setIsextfile("1");
|
||||||
|
String ext = fileName.substring(fileName.lastIndexOf(".") + 1);
|
||||||
|
if ("doc".equalsIgnoreCase(ext)) {
|
||||||
|
imgManger.setDocfiletype("3");
|
||||||
|
} else if ("xls".equalsIgnoreCase(ext)) {
|
||||||
|
imgManger.setDocfiletype("4");
|
||||||
|
} else if ("ppt".equalsIgnoreCase(ext)) {
|
||||||
|
imgManger.setDocfiletype("5");
|
||||||
|
} else if ("wps".equalsIgnoreCase(ext)) {
|
||||||
|
imgManger.setDocfiletype("6");
|
||||||
|
} else if ("docx".equalsIgnoreCase(ext)) {
|
||||||
|
imgManger.setDocfiletype("7");
|
||||||
|
} else if ("xlsx".equalsIgnoreCase(ext)) {
|
||||||
|
imgManger.setDocfiletype("8");
|
||||||
|
} else if ("pptx".equalsIgnoreCase(ext)) {
|
||||||
|
imgManger.setDocfiletype("9");
|
||||||
|
} else {
|
||||||
|
imgManger.setDocfiletype("2");
|
||||||
|
}
|
||||||
|
imgManger.AddDocImageInfo();
|
||||||
|
return docId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String builderUpdateSql(String modelTableName, Map<String, Object> mapping) {
|
||||||
|
StringBuilder sb = new StringBuilder("update ");
|
||||||
|
sb.append(modelTableName)
|
||||||
|
.append(" set ");
|
||||||
|
int n = 0;
|
||||||
|
for (Map.Entry<String, Object> entry : mapping.entrySet()) {
|
||||||
|
n++;
|
||||||
|
sb.append(entry.getKey()).append("=#{").append(entry.getKey()).append("}");
|
||||||
|
if (n < mapping.size()) {
|
||||||
|
sb.append(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static boolean submitWorkflow(Integer requestId, Integer userId, String remark) {
|
||||||
|
RequestService requestService = new RequestService();
|
||||||
|
RequestInfo req = requestService.getRequest(requestId);
|
||||||
|
if (remark == null) {
|
||||||
|
remark = "流程自动提交";
|
||||||
|
}
|
||||||
|
return requestService.nextNodeBySubmit(req, requestId, userId, remark);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void submitWorkflowThread(Integer requestId, Integer userId, String remark) {
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000 * 60);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Util.getLogger().error("线程休眠失败", e);
|
||||||
|
}
|
||||||
|
int n = 0;
|
||||||
|
while (!Util.submitWorkflow(requestId, userId, remark)) {
|
||||||
|
n++;
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000 * 10);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
if (n > 5) {
|
||||||
|
Util.getLogger().error("异步流程自动提交失败!");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean submitWorkflowByRequestInfo(RequestInfo requestInfo, Integer userId, String remark) {
|
||||||
|
RequestService requestService = new RequestService();
|
||||||
|
if (remark == null) {
|
||||||
|
remark = "流程自动提交";
|
||||||
|
}
|
||||||
|
return requestService.nextNodeBySubmit(requestInfo, Integer.parseInt(requestInfo.getRequestid()), userId, remark);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全角转半角
|
||||||
|
*
|
||||||
|
* @param src 全角字符
|
||||||
|
* @return 半角字符
|
||||||
|
*/
|
||||||
|
public static char sbc2dbc(char src) {
|
||||||
|
if (src == SBC_SPACE) {
|
||||||
|
return DBC_SPACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (src >= UNICODE_START && src <= UNICODE_END) {
|
||||||
|
return (char) (src - DBC_SBC_STEP);
|
||||||
|
}
|
||||||
|
|
||||||
|
return src;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全角转半角
|
||||||
|
*
|
||||||
|
* @param src 全角字符串
|
||||||
|
* @return DBC case
|
||||||
|
*/
|
||||||
|
public static String sbc2dbcCase(String src) {
|
||||||
|
if (src == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
char[] c = src.toCharArray();
|
||||||
|
for (int i = 0; i < c.length; i++) {
|
||||||
|
c[i] = sbc2dbc(c[i]);
|
||||||
|
}
|
||||||
|
return new String(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 半角转全角
|
||||||
|
*
|
||||||
|
* @param src 半角字符
|
||||||
|
* @return SBC case
|
||||||
|
*/
|
||||||
|
public static char dbc2sbc(char src) {
|
||||||
|
if (src == DBC_SPACE) {
|
||||||
|
return SBC_SPACE;
|
||||||
|
}
|
||||||
|
if (src <= ASCII_END) {
|
||||||
|
return (char) (src + DBC_SBC_STEP);
|
||||||
|
}
|
||||||
|
return src;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 半角转全角
|
||||||
|
*
|
||||||
|
* @param src 半角字符
|
||||||
|
* @return SBC case string
|
||||||
|
*/
|
||||||
|
public static String dbc2sbcCase(String src) {
|
||||||
|
if (src == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
char[] c = src.toCharArray();
|
||||||
|
for (int i = 0; i < c.length; i++) {
|
||||||
|
c[i] = dbc2sbc(c[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new String(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getWorkflowMainTable(String workflowId) {
|
||||||
|
return mapper.selectWorkfowMainTable(workflowId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建物理文件
|
||||||
|
*
|
||||||
|
* @param content 文件流
|
||||||
|
* @param fileName 文件名
|
||||||
|
* @return 文件id
|
||||||
|
*/
|
||||||
|
public static int createFileByInputSteam(InputStream content, String fileName) {
|
||||||
|
ImageFileManager imageFileManager = new ImageFileManager();
|
||||||
|
int imgFileId = -1;
|
||||||
|
try {
|
||||||
|
Method saveImageFileByInputStream = ImageFileManager.class.getMethod("saveImageFileByInputStream", InputStream.class, String.class);
|
||||||
|
if (saveImageFileByInputStream != null) {
|
||||||
|
imgFileId = imageFileManager.saveImageFileByInputStream(content, fileName);
|
||||||
|
} else {
|
||||||
|
throw new NoSuchMethodException("saveImageFileByInputStream 没有找到!");
|
||||||
|
}
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
imageFileManager.setImagFileName(fileName);
|
||||||
|
try {
|
||||||
|
imageFileManager.setData(IOUtils.toBytes(content));
|
||||||
|
} catch (Exception ex) {
|
||||||
|
throw new CustomerException("创建文件失败,文件流转换失败", e);
|
||||||
|
}
|
||||||
|
imgFileId = imageFileManager.saveImageFile();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new CustomerException("创建文件失败");
|
||||||
|
}
|
||||||
|
return imgFileId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程失败返回
|
||||||
|
*
|
||||||
|
* @param requestManager 流程请求管理
|
||||||
|
* @param msg 失败信息
|
||||||
|
* @return 失败
|
||||||
|
*/
|
||||||
|
public static String actionFail(RequestManager requestManager, String msg) {
|
||||||
|
requestManager.setMessageid(System.currentTimeMillis() + "");
|
||||||
|
requestManager.setMessagecontent(msg);
|
||||||
|
return Action.FAILURE_AND_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DocImageInfo selectImageInfoByDocId(String docId) {
|
||||||
|
return mapper.selectDocImageInfo(docId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WorkflowNodeConfig selectNodeConfig(String allVersion) {
|
||||||
|
return mapper.selectNodeConfig(allVersion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
package aiyh.utils.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p></p>
|
||||||
|
* <p>create 2022/4/18 4:32 PM</p>
|
||||||
|
*
|
||||||
|
* @author ayh
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.FIELD)
|
||||||
|
@Documented
|
||||||
|
public @interface BooleanConverter {
|
||||||
|
/**
|
||||||
|
* 数据库字段累心
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BooleanConverterEnum value();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如果是字符串,那么当字符串等于什么的时候为true
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String trueStr() default "true";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如果是字符串,那么当字符串等与什么的时候为false
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String falseStr() default "false";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数字,如果等于多少的时候是true
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String trueInteger() default "1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数字,,但如果等于多少的时候是false
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String falseInteger() default "0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当字段有值时就为给定的默认值
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean hasValueTrue() default false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 如果没有这个字段或者数据库数据为null时给定的值
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean defaultValue() default false;
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package aiyh.utils.annotation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p></p>
|
||||||
|
* <p>create 2022/4/18 4:34 PM</p>
|
||||||
|
*
|
||||||
|
* @author ayh
|
||||||
|
*/
|
||||||
|
|
||||||
|
public enum BooleanConverterEnum {
|
||||||
|
/**
|
||||||
|
* 数据库字段类型为varchar 其实这个是通用的,无所谓
|
||||||
|
*/
|
||||||
|
STRING,
|
||||||
|
/**
|
||||||
|
* 数据库字段是int类型的
|
||||||
|
*/
|
||||||
|
INTEGER
|
||||||
|
}
|
|
@ -21,6 +21,9 @@ public class AbstractFactoryImpl implements AbstractFactory {
|
||||||
if (DataSourceHandlerFactory.class.equals(type)) {
|
if (DataSourceHandlerFactory.class.equals(type)) {
|
||||||
return (T) new DataSourceHandlerFactory();
|
return (T) new DataSourceHandlerFactory();
|
||||||
}
|
}
|
||||||
|
if(ApiAsyncFactory.class.equals(type)){
|
||||||
|
return (T) new ApiAsyncFactory();
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import aiyh.utils.apirequest.core.typehandler.IDataSourceHandler;
|
||||||
import aiyh.utils.apirequest.core.typehandler.datasource.ModelDataHandler;
|
import aiyh.utils.apirequest.core.typehandler.datasource.ModelDataHandler;
|
||||||
import aiyh.utils.apirequest.core.typehandler.datasource.WorkflowDataHandler;
|
import aiyh.utils.apirequest.core.typehandler.datasource.WorkflowDataHandler;
|
||||||
import aiyh.utils.apirequest.enumtype.DataSourceRuleEnum;
|
import aiyh.utils.apirequest.enumtype.DataSourceRuleEnum;
|
||||||
import aiyh.utils.apirequest.enumtype.ParamValueRuleEnum;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>解析参数处理器工厂</p>
|
* <p>解析参数处理器工厂</p>
|
||||||
|
@ -14,7 +13,7 @@ import aiyh.utils.apirequest.enumtype.ParamValueRuleEnum;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
public class DataSourceHandlerFactory implements ParamHandlerFactory<IDataSourceHandler, DataSourceRuleEnum> {
|
public class DataSourceHandlerFactory implements TypeHandlerFactory<IDataSourceHandler, DataSourceRuleEnum> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IDataSourceHandler createParamHandler(DataSourceRuleEnum factoryEnum) {
|
public IDataSourceHandler createParamHandler(DataSourceRuleEnum factoryEnum) {
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
package aiyh.utils.apirequest.core.factory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>参数处理工厂接口</p>
|
|
||||||
* <p>create 2022/1/24 0024 10:59</p>
|
|
||||||
*
|
|
||||||
* @author EBU7-dev1-ayh
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
public interface ParamHandlerFactory<R,V> {
|
|
||||||
/**
|
|
||||||
* 创建参数处理对象工厂方法
|
|
||||||
* @param factoryEnum 工厂类型枚举
|
|
||||||
* @return 产生的对象
|
|
||||||
*/
|
|
||||||
|
|
||||||
public R createParamHandler(V factoryEnum);
|
|
||||||
}
|
|
|
@ -11,7 +11,7 @@ import aiyh.utils.apirequest.enumtype.ParamTypeEnum;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
public class ParamTypeHandlerFactory implements ParamHandlerFactory<IParamTypeHandler, ParamTypeEnum> {
|
public class ParamTypeHandlerFactory implements TypeHandlerFactory<IParamTypeHandler, ParamTypeEnum> {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -11,7 +11,7 @@ import aiyh.utils.apirequest.enumtype.ParamValueRuleEnum;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
public class ParamValueRuleHandlerFactory implements ParamHandlerFactory<IParamValueRuleHandler, ParamValueRuleEnum> {
|
public class ParamValueRuleHandlerFactory implements TypeHandlerFactory<IParamValueRuleHandler, ParamValueRuleEnum> {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -12,25 +12,7 @@ import aiyh.utils.apirequest.pojo.ApiRequestMain;
|
||||||
* @author EBU7-dev1-ayh
|
* @author EBU7-dev1-ayh
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* 彩蛋 2 书接上回
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* 客户想再上级面前表扬我,让给我加点工资 ----> 主要是怕我没做完项目就离职
|
|
||||||
*
|
|
||||||
* 后来客户问老板,我会不会项目没做完离职,老板自信的说不会:
|
|
||||||
* 评了优秀员工,奖励iPhone12一个
|
|
||||||
* 年会抽奖抽中 无人机\ps4任选
|
|
||||||
* 所以坚定我不会离职 (可是,算错了,调薪没成功就已经打算离职了)
|
|
||||||
*
|
|
||||||
* 客户之前似乎争取过让我涨薪,但是具体情况不知道
|
|
||||||
*
|
|
||||||
* 客户说 那个是抽奖嘛,那你给人家加工资了没
|
|
||||||
*
|
|
||||||
* 老板说 加了,加了百分之29%
|
|
||||||
*
|
|
||||||
* 后续自行寻找
|
|
||||||
*/
|
|
||||||
public class ModelDataHandler implements IDataSourceHandler {
|
public class ModelDataHandler implements IDataSourceHandler {
|
||||||
@Override
|
@Override
|
||||||
public ParamConfigInfo parseDataSource(ApiRequestData apiRequestData) {
|
public ParamConfigInfo parseDataSource(ApiRequestData apiRequestData) {
|
||||||
|
|
|
@ -27,22 +27,6 @@ import java.util.Map;
|
||||||
* @author EBU7-dev1-ayh
|
* @author EBU7-dev1-ayh
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* 彩蛋3 书接上回
|
|
||||||
*
|
|
||||||
* 好吧,刚好我知道了这件事
|
|
||||||
* 我震惊了,加薪了我竟然不知道,离大谱
|
|
||||||
* 不过客户争取加工资的还要一个同事,他加了,我没加(本来无所谓,大不了问问调薪机制,但是老板们说的破大防了)
|
|
||||||
*
|
|
||||||
* 这一刻,公司的印象全没了,路走死了啊!
|
|
||||||
*
|
|
||||||
* 好了,这回离职的想法更加坚定了
|
|
||||||
*
|
|
||||||
* 当这个注释被看到的时候就是离职的时候(或许没看到就离职了,后来的同学有幸看到注释的话,
|
|
||||||
* 好好想想什么样的场景,自己拿捏,在项目中加班是常事,但是依然没有加班工资,且有时候你会被好几个项目经理一起催,
|
|
||||||
* 结局就是加班到凌晨,免费劳动力。)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class WorkflowDataHandler implements IDataSourceHandler {
|
public class WorkflowDataHandler implements IDataSourceHandler {
|
||||||
|
|
||||||
private final DataSourceMapper mapper = Util.getMapper(DataSourceMapper.class);
|
private final DataSourceMapper mapper = Util.getMapper(DataSourceMapper.class);
|
||||||
|
|
|
@ -27,6 +27,7 @@ public class CustomerSqlRuleHandler implements IParamValueRuleHandler {
|
||||||
@Override
|
@Override
|
||||||
public Object getValue(ApiRequestParamData paramInfo, Map<String, Object> dataMap) {
|
public Object getValue(ApiRequestParamData paramInfo, Map<String, Object> dataMap) {
|
||||||
String customerSql = paramInfo.getCustomerValue();
|
String customerSql = paramInfo.getCustomerValue();
|
||||||
|
customerSql = Util.sbc2dbcCase(customerSql);
|
||||||
String pattern = "^(\\$:)(?<name>\\w*)\\{(?<sql>[\\S\\s]+)}";
|
String pattern = "^(\\$:)(?<name>\\w*)\\{(?<sql>[\\S\\s]+)}";
|
||||||
Pattern compile = Pattern.compile(pattern);
|
Pattern compile = Pattern.compile(pattern);
|
||||||
Matcher matcher = compile.matcher(customerSql.trim());
|
Matcher matcher = compile.matcher(customerSql.trim());
|
||||||
|
|
|
@ -29,19 +29,6 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||||
* @author EBU7-dev1-ayh
|
* @author EBU7-dev1-ayh
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
* 彩蛋1
|
|
||||||
|
|
||||||
* 2022/02/14 开完会后和上级谈工资的事情
|
|
||||||
* 结果说每年固定时间调薪,12月份时我没满半年,调薪失败,并画下一个大饼,今年六月有我
|
|
||||||
* 调薪额度200-2000
|
|
||||||
*
|
|
||||||
* 2022/02/13 客户在之前的工作中对我十分认可
|
|
||||||
* 问我将我包下来在项目上能不能有更多的工资,我说结算方式不一样,不管包与不包,都是 一样的
|
|
||||||
*
|
|
||||||
* 后续更加精彩,记得找找,就在这个文件的方法调用里面(说不定在实现类里面哦)
|
|
||||||
* */
|
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
@Data
|
@Data
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package aiyh.utils.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p></p>
|
||||||
|
* <p>create 2022/5/6 4:00 PM</p>
|
||||||
|
*
|
||||||
|
* @author ayh
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DocImageInfo {
|
||||||
|
|
||||||
|
private Integer docId;
|
||||||
|
private Integer imageFileId;
|
||||||
|
private String imageFileName;
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package aiyh.utils.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p></p>
|
||||||
|
* <p>create 2022/5/16 11:45</p>
|
||||||
|
*
|
||||||
|
* @author ayh
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class WorkflowNodeConfig {
|
||||||
|
private String id;
|
||||||
|
private String workflowType;
|
||||||
|
private String markOnly;
|
||||||
|
private String workflowNodes;
|
||||||
|
private String enableNodes;
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package aiyh.utils.excention;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>自定义异常类</p>
|
||||||
|
* <p>create 2022/3/9 2:20 PM</p>
|
||||||
|
*
|
||||||
|
* @author ayh
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CustomerException extends RuntimeException{
|
||||||
|
private Logger logger = Util.getLogger();
|
||||||
|
private String msg;
|
||||||
|
private Throwable throwable;
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
public CustomerException(String msg){
|
||||||
|
super(msg);
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomerException(String msg,Integer code){
|
||||||
|
super(msg);
|
||||||
|
this.code = code;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
public CustomerException(String msg, Integer code, Throwable throwable){
|
||||||
|
super(msg);
|
||||||
|
this.code= code;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
public CustomerException(String msg, Throwable throwable){
|
||||||
|
super(msg,throwable);
|
||||||
|
this.msg = msg;
|
||||||
|
this.throwable = throwable;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void printStackTrace() {
|
||||||
|
logger.error("二开自定义异常:" + this.msg);
|
||||||
|
if(this.throwable != null){
|
||||||
|
logger.error("异常信息: " + Util.getErrString(this.throwable));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCode (){
|
||||||
|
return this.code;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMessage() {
|
||||||
|
return this.msg;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,369 @@
|
||||||
|
package aiyh.utils.excention.monad;
|
||||||
|
|
||||||
|
import java.util.NoSuchElementException;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Predicate;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* url: https://github.com/jasongoodwin/better-java-monads/blob/master/src/main/java/com/jasongoodwin/monads/Try.java
|
||||||
|
* Monadic Try type.
|
||||||
|
* Represents a result type that could have succeeded with type T or failed with a Throwable.
|
||||||
|
* Originally was Exception but due to seeing issues with eg play with checked Throwable,
|
||||||
|
* And also seeing that Scala deals with throwable,
|
||||||
|
* I made the decision to change it to use Throwable.
|
||||||
|
*
|
||||||
|
* @param <T>
|
||||||
|
*/
|
||||||
|
|
||||||
|
public abstract class Try<T> {
|
||||||
|
|
||||||
|
protected Try() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <U> Try<U> ofFailable(TrySupplier<U> f) {
|
||||||
|
Objects.requireNonNull(f);
|
||||||
|
|
||||||
|
try {
|
||||||
|
return Try.successful(f.get());
|
||||||
|
} catch (Throwable t) {
|
||||||
|
return Try.failure(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform success or pass on failure.
|
||||||
|
* Takes an optional type parameter of the new type.
|
||||||
|
* You need to be specific about the new type if changing type
|
||||||
|
*
|
||||||
|
* Try.ofFailable(() -> "1").<Integer>map((x) -> Integer.valueOf(x))
|
||||||
|
*
|
||||||
|
* @param f function to apply to successful value.
|
||||||
|
* @param <U> new type (optional)
|
||||||
|
* @return Success<U> or Failure<U>
|
||||||
|
*/
|
||||||
|
|
||||||
|
public abstract <U> Try<U> map(TryMapFunction<? super T, ? extends U> f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform success or pass on failure, taking a Try<U> as the result.
|
||||||
|
* Takes an optional type parameter of the new type.
|
||||||
|
* You need to be specific about the new type if changing type.
|
||||||
|
*
|
||||||
|
* Try.ofFailable(() -> "1").<Integer>flatMap((x) -> Try.ofFailable(() -> Integer.valueOf(x)))
|
||||||
|
* returns Integer(1)
|
||||||
|
*
|
||||||
|
* @param f function to apply to successful value.
|
||||||
|
* @param <U> new type (optional)
|
||||||
|
* @return new composed Try
|
||||||
|
*/
|
||||||
|
public abstract <U> Try<U> flatMap(TryMapFunction<? super T, Try<U>> f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies a result to use in case of failure.
|
||||||
|
* Gives access to the exception which can be pattern matched on.
|
||||||
|
*
|
||||||
|
* Try.ofFailable(() -> "not a number")
|
||||||
|
* .<Integer>flatMap((x) -> Try.ofFailable(() ->Integer.valueOf(x)))
|
||||||
|
* .recover((t) -> 1)
|
||||||
|
* returns Integer(1)
|
||||||
|
*
|
||||||
|
* @param f function to execute on successful result.
|
||||||
|
* @return new composed Try
|
||||||
|
*/
|
||||||
|
|
||||||
|
public abstract T recover(Function<? super Throwable, T> f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Try applying f(t) on the case of failure.
|
||||||
|
* @param f function that takes throwable and returns result
|
||||||
|
* @return a new Try in the case of failure, or the current Success.
|
||||||
|
*/
|
||||||
|
public abstract Try<T> recoverWith(TryMapFunction<? super Throwable, Try<T>> f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a value in the case of a failure.
|
||||||
|
* This is similar to recover but does not expose the exception type.
|
||||||
|
*
|
||||||
|
* @param value return the try's value or else the value specified.
|
||||||
|
* @return new composed Try
|
||||||
|
*/
|
||||||
|
public abstract T orElse(T value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return another try in the case of failure.
|
||||||
|
* Like recoverWith but without exposing the exception.
|
||||||
|
*
|
||||||
|
* @param f return the value or the value from the new try.
|
||||||
|
* @return new composed Try
|
||||||
|
*/
|
||||||
|
public abstract Try<T> orElseTry(TrySupplier<T> f);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value T on Success or throws the cause of the failure.
|
||||||
|
*
|
||||||
|
* @return T
|
||||||
|
* @throws Throwable produced by the supplier function argument
|
||||||
|
*/
|
||||||
|
|
||||||
|
public abstract <X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value T on Success or throws the cause of the failure.
|
||||||
|
*
|
||||||
|
* @return T
|
||||||
|
* @throws Throwable
|
||||||
|
*/
|
||||||
|
public abstract T get() throws Throwable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value T on Success or throws the cause of the failure wrapped into a RuntimeException
|
||||||
|
* @return T
|
||||||
|
* @throws RuntimeException
|
||||||
|
*/
|
||||||
|
public abstract T getUnchecked();
|
||||||
|
|
||||||
|
public abstract boolean isSuccess();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs the provided action, when successful
|
||||||
|
* @param action action to run
|
||||||
|
* @return new composed Try
|
||||||
|
* @throws E if the action throws an exception
|
||||||
|
*/
|
||||||
|
public abstract <E extends Throwable> Try<T> onSuccess(TryConsumer<T, E> action) throws E;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs the provided action, when failed
|
||||||
|
* @param action action to run
|
||||||
|
* @return new composed Try
|
||||||
|
* @throws E if the action throws an exception
|
||||||
|
*/
|
||||||
|
public abstract <E extends Throwable> Try<T> onFailure(TryConsumer<Throwable, E> action) throws E;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If a Try is a Success and the predicate holds true, the Success is passed further.
|
||||||
|
* Otherwise (Failure or predicate doesn't hold), pass Failure.
|
||||||
|
* @param pred predicate applied to the value held by Try
|
||||||
|
* @return For Success, the same success if predicate holds true, otherwise Failure
|
||||||
|
*/
|
||||||
|
public abstract Try<T> filter(Predicate<T> pred);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Try contents wrapped in Optional.
|
||||||
|
* @return Optional of T, if Success, Empty if Failure or null value
|
||||||
|
*/
|
||||||
|
public abstract Optional<T> toOptional();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Factory method for failure.
|
||||||
|
*
|
||||||
|
* @param e throwable to create the failed Try with
|
||||||
|
* @param <U> Type
|
||||||
|
* @return a new Failure
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static <U> Try<U> failure(Throwable e) {
|
||||||
|
return new Failure<>(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Factory method for success.
|
||||||
|
*
|
||||||
|
* @param x value to create the successful Try with
|
||||||
|
* @param <U> Type
|
||||||
|
* @return a new Success
|
||||||
|
*/
|
||||||
|
public static <U> Try<U> successful(U x) {
|
||||||
|
return new Success<>(x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Success<T> extends Try<T> {
|
||||||
|
private final T value;
|
||||||
|
|
||||||
|
public Success(T value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <U> Try<U> flatMap(TryMapFunction<? super T, Try<U>> f) {
|
||||||
|
Objects.requireNonNull(f);
|
||||||
|
try {
|
||||||
|
return f.apply(value);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
return Try.failure(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T recover(Function<? super Throwable, T> f) {
|
||||||
|
Objects.requireNonNull(f);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Try<T> recoverWith(TryMapFunction<? super Throwable, Try<T>> f) {
|
||||||
|
Objects.requireNonNull(f);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T orElse(T value) {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Try<T> orElseTry(TrySupplier<T> f) {
|
||||||
|
Objects.requireNonNull(f);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T get() throws Throwable {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T getUnchecked() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <U> Try<U> map(TryMapFunction<? super T, ? extends U> f) {
|
||||||
|
Objects.requireNonNull(f);
|
||||||
|
try {
|
||||||
|
return new Success<>(f.apply(value));
|
||||||
|
} catch (Throwable t) {
|
||||||
|
return Try.failure(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <E extends Throwable> Try<T> onSuccess(TryConsumer<T, E> action) throws E {
|
||||||
|
action.accept(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Try<T> filter(Predicate<T> p) {
|
||||||
|
Objects.requireNonNull(p);
|
||||||
|
|
||||||
|
if (p.test(value)) {
|
||||||
|
return this;
|
||||||
|
} else {
|
||||||
|
return Try.failure(new NoSuchElementException("Predicate does not match for " + value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<T> toOptional() {
|
||||||
|
return Optional.ofNullable(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <E extends Throwable> Try<T> onFailure(TryConsumer<Throwable, E> action) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Failure<T> extends Try<T> {
|
||||||
|
private final Throwable e;
|
||||||
|
|
||||||
|
Failure(Throwable e) {
|
||||||
|
this.e = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <U> Try<U> map(TryMapFunction<? super T, ? extends U> f) {
|
||||||
|
Objects.requireNonNull(f);
|
||||||
|
return Try.failure(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <U> Try<U> flatMap(TryMapFunction<? super T, Try<U>> f) {
|
||||||
|
Objects.requireNonNull(f);
|
||||||
|
return Try.failure(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T recover(Function<? super Throwable, T> f) {
|
||||||
|
Objects.requireNonNull(f);
|
||||||
|
return f.apply(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Try<T> recoverWith(TryMapFunction<? super Throwable, Try<T>> f) {
|
||||||
|
Objects.requireNonNull(f);
|
||||||
|
try{
|
||||||
|
return f.apply(e);
|
||||||
|
}catch(Throwable t){
|
||||||
|
return Try.failure(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T orElse(T value) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Try<T> orElseTry(TrySupplier<T> f) {
|
||||||
|
Objects.requireNonNull(f);
|
||||||
|
return Try.ofFailable(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <X extends Throwable> T orElseThrow(Supplier<? extends X> exceptionSupplier) throws X {
|
||||||
|
throw exceptionSupplier.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T get() throws Throwable {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T getUnchecked() {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSuccess() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <E extends Throwable> Try<T> onSuccess(TryConsumer<T, E> action) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Try<T> filter(Predicate<T> pred) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<T> toOptional() {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <E extends Throwable> Try<T> onFailure(TryConsumer<Throwable, E> action) throws E {
|
||||||
|
action.accept(e);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package aiyh.utils.excention.monad;
|
||||||
|
|
||||||
|
|
||||||
|
public interface TryConsumer<T, E extends Throwable> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs this operation on the given argument.
|
||||||
|
*
|
||||||
|
* @param t the input argument
|
||||||
|
*/
|
||||||
|
void accept(T t) throws E;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
package aiyh.utils.excention.monad;
|
||||||
|
|
||||||
|
public interface TryMapFunction<T, R> {
|
||||||
|
R apply(T t) throws Throwable;
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
package aiyh.utils.excention.monad;
|
||||||
|
|
||||||
|
|
||||||
|
public interface TrySupplier<T>{
|
||||||
|
T get() throws Throwable;
|
||||||
|
}
|
|
@ -0,0 +1,145 @@
|
||||||
|
package aiyh.utils.fileUtil.pdf;
|
||||||
|
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
|
import com.itextpdf.awt.geom.Rectangle2D;
|
||||||
|
import com.itextpdf.text.pdf.parser.ImageRenderInfo;
|
||||||
|
import com.itextpdf.text.pdf.parser.RenderListener;
|
||||||
|
import com.itextpdf.text.pdf.parser.TextRenderInfo;
|
||||||
|
import org.h2.util.StringUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>自定义pdf读取监听器</p>
|
||||||
|
* <p>create 2022/4/27 3:45 PM</p>
|
||||||
|
*
|
||||||
|
* @author ayh
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CustomerPdfRenderListener implements RenderListener {
|
||||||
|
|
||||||
|
private final List<PdfPointItem> points = new ArrayList<>(16);
|
||||||
|
private final List<PdfPointItem> pdfAllTextPoints = new ArrayList<>(16 * 8);
|
||||||
|
private int page;
|
||||||
|
private int startPage;
|
||||||
|
private String keyWord;
|
||||||
|
private int totalPage;
|
||||||
|
private float startX;
|
||||||
|
private float startY;
|
||||||
|
private int n = 0;
|
||||||
|
private char[] keywordChars;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始读取回调函数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void beginTextBlock() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读取到某个字符时回调函数
|
||||||
|
*
|
||||||
|
* @param textRenderInfo 文本信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void renderText(TextRenderInfo textRenderInfo) {
|
||||||
|
String text = textRenderInfo.getText();
|
||||||
|
if(text == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Rectangle2D.Float boundingRectange = textRenderInfo.getBaseline().getBoundingRectange();
|
||||||
|
if(text.equals(keyWord)){
|
||||||
|
createKeywordPotion(boundingRectange);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (char c : text.toCharArray()) {
|
||||||
|
char keywordChar = keywordChars[n];
|
||||||
|
if(keywordChar == c){
|
||||||
|
if(n == 0){
|
||||||
|
this.startX = boundingRectange.x;
|
||||||
|
this.startY = boundingRectange.y;
|
||||||
|
this.startPage = page;
|
||||||
|
}
|
||||||
|
if(n == keywordChars.length - 1){
|
||||||
|
createKeywordPotion(boundingRectange);
|
||||||
|
n = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
n ++;
|
||||||
|
}else {
|
||||||
|
n = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createKeywordPotion(Rectangle2D.Float boundingRectange) {
|
||||||
|
float endX = boundingRectange.x;
|
||||||
|
float endY = boundingRectange.y;
|
||||||
|
int endPage = page;
|
||||||
|
PdfPointItem pdfPointItem = new PdfPointItem();
|
||||||
|
pdfPointItem.setStartPointX(startX);
|
||||||
|
pdfPointItem.setEndPointX(endX);
|
||||||
|
pdfPointItem.setStartPointY(startY);
|
||||||
|
pdfPointItem.setEndPointY(endY);
|
||||||
|
pdfPointItem.setStartPage(startPage);
|
||||||
|
pdfPointItem.setEndPage(endPage);
|
||||||
|
pdfPointItem.setKewWords(keyWord);
|
||||||
|
pdfPointItem.setTotalPage(totalPage);
|
||||||
|
points.add(pdfPointItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束读取回调
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void endTextBlock() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 读取到图片回调
|
||||||
|
*
|
||||||
|
* @param imageRenderInfo 图片信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void renderImage(ImageRenderInfo imageRenderInfo) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPage() {
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPage(int page) {
|
||||||
|
this.page = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PdfPointItem> getPoints() {
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKeyWord() {
|
||||||
|
return keyWord;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKeyWord(String keyWord) {
|
||||||
|
this.keyWord = keyWord;
|
||||||
|
if(StringUtils.isNullOrEmpty(keyWord)){
|
||||||
|
throw new CustomerException("keyWord is null");
|
||||||
|
}
|
||||||
|
this.keywordChars = keyWord.toCharArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PdfPointItem> getPdfAllTextPoints() {
|
||||||
|
return pdfAllTextPoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalPage() {
|
||||||
|
return totalPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalPage(int totalPage) {
|
||||||
|
this.totalPage = totalPage;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,121 @@
|
||||||
|
package aiyh.utils.fileUtil.pdf;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>pdf关键字坐标信息</p>
|
||||||
|
* <p>create 2022/4/27 3:41 PM</p>
|
||||||
|
*
|
||||||
|
* @author ayh
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class PdfPointItem {
|
||||||
|
/**
|
||||||
|
* 当前查询的关键字
|
||||||
|
*/
|
||||||
|
private String kewWords;
|
||||||
|
/**
|
||||||
|
* 当前关键字所在开始位置的页码
|
||||||
|
*/
|
||||||
|
private int startPage;
|
||||||
|
/**
|
||||||
|
* 当前关键字结束位置所在的耶main
|
||||||
|
*/
|
||||||
|
private int endPage;
|
||||||
|
/**
|
||||||
|
* 关键字开始坐标x
|
||||||
|
*/
|
||||||
|
private float startPointX;
|
||||||
|
/**
|
||||||
|
* 关键字开始坐标y
|
||||||
|
*/
|
||||||
|
private float startPointY;
|
||||||
|
/**
|
||||||
|
* 关键字结束坐标x
|
||||||
|
*/
|
||||||
|
private float endPointX;
|
||||||
|
/**
|
||||||
|
* 关键字结束坐标y
|
||||||
|
*/
|
||||||
|
private float endPointY;
|
||||||
|
/**
|
||||||
|
* 总页面
|
||||||
|
*/
|
||||||
|
private int totalPage;
|
||||||
|
|
||||||
|
public String getKewWords() {
|
||||||
|
return kewWords;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKewWords(String kewWords) {
|
||||||
|
this.kewWords = kewWords;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStartPage() {
|
||||||
|
return startPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getEndPage() {
|
||||||
|
return endPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndPage(int endPage) {
|
||||||
|
this.endPage = endPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartPage(int startPage) {
|
||||||
|
this.startPage = startPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getStartPointX() {
|
||||||
|
return startPointX;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartPointX(float startPointX) {
|
||||||
|
this.startPointX = startPointX;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getStartPointY() {
|
||||||
|
return startPointY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartPointY(float startPointY) {
|
||||||
|
this.startPointY = startPointY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getEndPointX() {
|
||||||
|
return endPointX;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndPointX(float endPointX) {
|
||||||
|
this.endPointX = endPointX;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getEndPointY() {
|
||||||
|
return endPointY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndPointY(float endPointY) {
|
||||||
|
this.endPointY = endPointY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTotalPage() {
|
||||||
|
return totalPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalPage(int totalPage) {
|
||||||
|
this.totalPage = totalPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PdfPointItem{" +
|
||||||
|
", kewWords='" + kewWords + '\'' +
|
||||||
|
", startPage=" + startPage +
|
||||||
|
", endPage=" + endPage +
|
||||||
|
", startPointX=" + startPointX +
|
||||||
|
", startPointY=" + startPointY +
|
||||||
|
", endPointX=" + endPointX +
|
||||||
|
", endPointY=" + endPointY +
|
||||||
|
", totalPage=" + totalPage +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,245 @@
|
||||||
|
package aiyh.utils.fileUtil.pdf;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
|
import com.itextpdf.text.DocumentException;
|
||||||
|
import com.itextpdf.text.Image;
|
||||||
|
import com.itextpdf.text.pdf.PdfContentByte;
|
||||||
|
import com.itextpdf.text.pdf.PdfGState;
|
||||||
|
import com.itextpdf.text.pdf.PdfReader;
|
||||||
|
import com.itextpdf.text.pdf.PdfStamper;
|
||||||
|
import com.itextpdf.text.pdf.parser.PdfReaderContentParser;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import weaver.file.FileUpload;
|
||||||
|
import weaver.file.ImageFileManager;
|
||||||
|
import weaver.system.SystemComInfo;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>pdf工具类</p>
|
||||||
|
* <p>create 2022/4/27 4:16 PM</p>
|
||||||
|
*
|
||||||
|
* @author ayh
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class PdfUtil {
|
||||||
|
|
||||||
|
private static final Logger log = Util.getLogger("util_water_log");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取关键字位置信息
|
||||||
|
*
|
||||||
|
* @param inputStream pdf文件流
|
||||||
|
* @param keyword 关键字
|
||||||
|
* @return 关键字位置信息
|
||||||
|
*/
|
||||||
|
public static List<PdfPointItem> findKeywordPoints(InputStream inputStream, String keyword) {
|
||||||
|
PdfReader pdfReader = null;
|
||||||
|
try {
|
||||||
|
pdfReader = new PdfReader(inputStream);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new CustomerException("读取pdf失败!", e);
|
||||||
|
}
|
||||||
|
return getKeywordPoints(pdfReader, keyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取关键字位置信息
|
||||||
|
*
|
||||||
|
* @param pdfReader pdf读取器
|
||||||
|
* @param keyword 关键字
|
||||||
|
* @return 关键字位置信息
|
||||||
|
*/
|
||||||
|
private static List<PdfPointItem> getKeywordPoints(PdfReader pdfReader, String keyword) {
|
||||||
|
int totalPage = pdfReader.getNumberOfPages();
|
||||||
|
PdfReaderContentParser pdfReaderContentParser = new PdfReaderContentParser(pdfReader);
|
||||||
|
CustomerPdfRenderListener customerPdfRenderListener = new CustomerPdfRenderListener();
|
||||||
|
customerPdfRenderListener.setKeyWord(keyword);
|
||||||
|
customerPdfRenderListener.setTotalPage(totalPage);
|
||||||
|
for (int page = 1; page <= totalPage; page++) {
|
||||||
|
customerPdfRenderListener.setPage(page);
|
||||||
|
try {
|
||||||
|
pdfReaderContentParser.processContent(page, customerPdfRenderListener);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new CustomerException("解析pdf失败!", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pdfReader.close();
|
||||||
|
return customerPdfRenderListener.getPoints();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加图片水印到关键字位置
|
||||||
|
*
|
||||||
|
* @param pdfImageFileId 添加图片水印的pdfid
|
||||||
|
* @param pictureInputStream 图片流
|
||||||
|
* @param keyword 关键字
|
||||||
|
* @param allKeyword 是否全部关键字
|
||||||
|
* @param opacity 透明度
|
||||||
|
* @param imageFitWidth 图片宽度
|
||||||
|
* @param imageFitHeight 图片高度
|
||||||
|
* @param offsetX 图片水印x偏移量
|
||||||
|
* @param offsetY 图片水印y偏移量
|
||||||
|
* @return 添加水印后的pdf文件
|
||||||
|
*/
|
||||||
|
public static int addPictureWater2pdfByKeyword(int pdfImageFileId,
|
||||||
|
InputStream pictureInputStream,
|
||||||
|
String keyword,
|
||||||
|
boolean allKeyword,
|
||||||
|
float opacity,
|
||||||
|
int imageFitWidth,
|
||||||
|
int imageFitHeight,
|
||||||
|
int offsetX,
|
||||||
|
int offsetY) {
|
||||||
|
ImageFileManager imageFileManager = new ImageFileManager();
|
||||||
|
imageFileManager.getImageFileInfoById(pdfImageFileId);
|
||||||
|
String imageFileName = imageFileManager.getImageFileName();
|
||||||
|
String suffix = imageFileName.substring(imageFileName.lastIndexOf(".") + 1);
|
||||||
|
if (!"pdf".equalsIgnoreCase(suffix)) {
|
||||||
|
throw new CustomerException("不支持的文件类型 : " + suffix);
|
||||||
|
}
|
||||||
|
InputStream inputStream = ImageFileManager.getInputStreamById(pdfImageFileId);
|
||||||
|
List<PdfPointItem> keywordPoints = findKeywordPoints(inputStream, keyword);
|
||||||
|
PdfReader pdfReader = null;
|
||||||
|
Image image = null;
|
||||||
|
try {
|
||||||
|
byte[] imgb = org.apache.commons.io.IOUtils.toByteArray(pictureInputStream);
|
||||||
|
image = Image.getInstance(imgb);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new CustomerException("获取水印图片失败!", e);
|
||||||
|
}
|
||||||
|
PdfGState gs = new PdfGState();
|
||||||
|
gs.setFillOpacity(opacity);
|
||||||
|
image.scaleToFit(imageFitWidth, imageFitHeight);
|
||||||
|
String createDir = FileUpload.getCreateDir(new SystemComInfo().getFilesystem()) + "tempfile" + File.separator;
|
||||||
|
// 防止高并发下文件名重复导致文件覆盖的问题
|
||||||
|
String tempPath = createDir + imageFileName + System.currentTimeMillis() + UUID.randomUUID() + ".pdf";
|
||||||
|
File file = new File(tempPath);
|
||||||
|
if (!file.getParentFile().exists()) {
|
||||||
|
file.getParentFile().mkdirs();
|
||||||
|
}
|
||||||
|
if (!file.exists()) {
|
||||||
|
try {
|
||||||
|
file.createNewFile();
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new CustomerException("创建临时文件失败!", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 输出到临时目录
|
||||||
|
FileOutputStream outputStreamTem;
|
||||||
|
try {
|
||||||
|
outputStreamTem = new FileOutputStream(URLDecoder.decode(tempPath, "utf-8"));
|
||||||
|
} catch (FileNotFoundException | UnsupportedEncodingException e) {
|
||||||
|
throw new CustomerException("创建临时文件流和路径转换失败!", e);
|
||||||
|
}
|
||||||
|
PdfStamper pdfStamper = null;
|
||||||
|
try {
|
||||||
|
inputStream = ImageFileManager.getInputStreamById(pdfImageFileId);
|
||||||
|
pdfReader = new PdfReader(inputStream);
|
||||||
|
pdfStamper = new PdfStamper(pdfReader, outputStreamTem);
|
||||||
|
} catch (IOException | DocumentException e) {
|
||||||
|
throw new CustomerException("读取pdf失败!", e);
|
||||||
|
}
|
||||||
|
if (allKeyword) {
|
||||||
|
addPictureWater2pdfByKeywordAllKeyword(pdfStamper, keywordPoints, image, gs, offsetX, offsetY);
|
||||||
|
} else {
|
||||||
|
PdfPointItem keywordPoint = keywordPoints.get(0);
|
||||||
|
PdfContentByte overContent = pdfStamper.getOverContent(keywordPoint.getStartPage());
|
||||||
|
overContent.setGState(gs);
|
||||||
|
float absoluteX = keywordPoint.getStartPointX() + offsetX;
|
||||||
|
float absoluteY = keywordPoint.getStartPointY() + offsetY;
|
||||||
|
image.setAbsolutePosition(absoluteX, absoluteY);
|
||||||
|
try {
|
||||||
|
overContent.addImage(image);
|
||||||
|
} catch (DocumentException e) {
|
||||||
|
throw new CustomerException("添加水印图片失败!", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
pdfStamper.close();
|
||||||
|
outputStreamTem.close();
|
||||||
|
} catch (IOException | DocumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
log.error("关闭流失败!", e);
|
||||||
|
}
|
||||||
|
int imageFileId = -1;
|
||||||
|
InputStream waterPdf = null;
|
||||||
|
try {
|
||||||
|
waterPdf = new FileInputStream(tempPath);
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
throw new CustomerException("文件水印添加失败!", e);
|
||||||
|
}
|
||||||
|
imageFileId = Util.createFileByInputSteam(waterPdf, imageFileName);
|
||||||
|
try {
|
||||||
|
waterPdf.close();
|
||||||
|
Files.deleteIfExists(Paths.get(tempPath));
|
||||||
|
} catch (IOException e ){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return imageFileId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加图片水印到关键字位置
|
||||||
|
*
|
||||||
|
* @param pdfImageFileId 添加图片水印的pdfid
|
||||||
|
* @param pictureImageFileId 图片id
|
||||||
|
* @param keyword 关键字
|
||||||
|
* @param allKeyword 是否全部关键字
|
||||||
|
* @param opacity 透明度
|
||||||
|
* @param imageFitWidth 图片宽度
|
||||||
|
* @param imageFitHeight 图片高度
|
||||||
|
* @param offsetX x偏移
|
||||||
|
* @param offsetY y偏移
|
||||||
|
* @return 添加水印后的pdf文件
|
||||||
|
*/
|
||||||
|
public static int addPictureWater2pdfByKeyword(int pdfImageFileId,
|
||||||
|
int pictureImageFileId,
|
||||||
|
String keyword,
|
||||||
|
boolean allKeyword,
|
||||||
|
float opacity,
|
||||||
|
int imageFitWidth,
|
||||||
|
int imageFitHeight,
|
||||||
|
int offsetX,
|
||||||
|
int offsetY) {
|
||||||
|
InputStream pictureInputStream = ImageFileManager.getInputStreamById(pictureImageFileId);
|
||||||
|
return addPictureWater2pdfByKeyword(pdfImageFileId, pictureInputStream, keyword, allKeyword, opacity, imageFitWidth, imageFitHeight, offsetX, offsetY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加图片水印全关键字的地方
|
||||||
|
*
|
||||||
|
* @param pdfStamper pdfStamper
|
||||||
|
* @param keywordPoints 关键字位置
|
||||||
|
* @param image 图片
|
||||||
|
* @param gs 图片透明度
|
||||||
|
* @param offsetX 图片偏移量X
|
||||||
|
* @param offsetY 图片偏移量Y
|
||||||
|
*/
|
||||||
|
private static void addPictureWater2pdfByKeywordAllKeyword(PdfStamper pdfStamper,
|
||||||
|
List<PdfPointItem> keywordPoints,
|
||||||
|
Image image, PdfGState gs,
|
||||||
|
int offsetX, int offsetY) {
|
||||||
|
PdfContentByte overContent = null;
|
||||||
|
for (PdfPointItem keywordPoint : keywordPoints) {
|
||||||
|
overContent = pdfStamper.getOverContent(keywordPoint.getStartPage());
|
||||||
|
overContent.setGState(gs);
|
||||||
|
float absoluteX = keywordPoint.getStartPointX() + offsetX;
|
||||||
|
float absoluteY = keywordPoint.getStartPointY() + offsetY;
|
||||||
|
image.setAbsolutePosition(absoluteX, absoluteY);
|
||||||
|
try {
|
||||||
|
overContent.addImage(image);
|
||||||
|
} catch (DocumentException e) {
|
||||||
|
throw new CustomerException("添加水印图片失败!", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,9 +26,9 @@ public class HttpManager {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
private static final int CONNECT_TIMEOUT = 1000 * 60 * 3;
|
private static final int CONNECT_TIMEOUT = 1000 * 60 * 5;
|
||||||
private static final int CONNECTION_REQUEST_TIMEOUT = 1000 * 60 * 3;
|
private static final int CONNECTION_REQUEST_TIMEOUT = 1000 * 60 * 5;
|
||||||
private static final int SOCKET_TIMEOUT = 10000 * 60 * 3;
|
private static final int SOCKET_TIMEOUT = 10000 * 60 * 5;
|
||||||
private static final int MAX_TOTAL = 500;
|
private static final int MAX_TOTAL = 500;
|
||||||
private static final int MAX_PRE_ROUTE = 500;
|
private static final int MAX_PRE_ROUTE = 500;
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,11 @@ package aiyh.utils.httpUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import org.apache.http.Header;
|
import org.apache.http.Header;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.io.InputStream;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -22,22 +23,35 @@ public class ResponeVo {
|
||||||
/**
|
/**
|
||||||
* 相应状态码
|
* 相应状态码
|
||||||
*/
|
*/
|
||||||
int code;
|
private int code;
|
||||||
/**
|
/**
|
||||||
* 相应内容
|
* 相应内容
|
||||||
*/
|
*/
|
||||||
String entityString;
|
private String entityString;
|
||||||
/**
|
/**
|
||||||
* 相应头信息
|
* 相应头信息
|
||||||
*/
|
*/
|
||||||
@JSONField(serialize = false)
|
@JSONField(serialize = false)
|
||||||
Header[] allHeaders;
|
private Header[] allHeaders;
|
||||||
Locale locale;
|
private Locale locale;
|
||||||
|
|
||||||
|
private InputStream content;
|
||||||
|
|
||||||
|
private byte[] contentByteArr;
|
||||||
|
|
||||||
|
private Map<String,Object> requestData;
|
||||||
public int getCode() {
|
public int getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getRequestData() {
|
||||||
|
return requestData;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequestData(Map<String, Object> requestData) {
|
||||||
|
this.requestData = requestData;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据相应结果转化为map集合
|
* 根据相应结果转化为map集合
|
||||||
* @return 资源皇后的map集合
|
* @return 资源皇后的map集合
|
||||||
|
@ -60,6 +74,18 @@ public class ResponeVo {
|
||||||
return mapper.readValue(this.getEntityString(), clazz);
|
return mapper.readValue(this.getEntityString(), clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据相应结果,转化为实体类
|
||||||
|
* @param <T> 需要转换实体类的泛型处理器
|
||||||
|
* @return 转换后的实体类
|
||||||
|
* @throws JsonProcessingException JSON转换异常
|
||||||
|
*/
|
||||||
|
public <T> T getEntity(TypeReference<T> typeReference) throws JsonProcessingException {
|
||||||
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
return mapper.readValue(this.getEntityString(), typeReference);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据相应结果转化为实体集合
|
* 根据相应结果转化为实体集合
|
||||||
* @param clazz 需要映射的实体类
|
* @param clazz 需要映射的实体类
|
||||||
|
@ -98,12 +124,28 @@ public class ResponeVo {
|
||||||
this.entityString = entityString;
|
this.entityString = entityString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InputStream getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getContentByteArr() {
|
||||||
|
return contentByteArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContentByteArr(byte[] contentByteArr) {
|
||||||
|
this.contentByteArr = contentByteArr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(InputStream content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ResponeVo{" +
|
return "ResponeVo{" +
|
||||||
"code=" + code +
|
"code=" + code +
|
||||||
", entityString='" + entityString + '\'' +
|
", entityString='" + entityString + '\'' +
|
||||||
", locale=" + locale +
|
", otherParam=" + requestData +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
package aiyh.utils.httpUtil.util;
|
package aiyh.utils.httpUtil.util;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.httpUtil.ExtendedIOUtils;
|
||||||
|
import aiyh.utils.httpUtil.HttpArgsType;
|
||||||
|
import aiyh.utils.httpUtil.HttpManager;
|
||||||
|
import aiyh.utils.httpUtil.ResponeVo;
|
||||||
|
import aiyh.utils.httpUtil.httpAsync.HttpAsyncThread;
|
||||||
|
import aiyh.utils.httpUtil.httpAsync.HttpAsyncThreadCallBack;
|
||||||
|
import aiyh.utils.zwl.common.ToolUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
|
@ -16,23 +24,16 @@ import org.apache.http.entity.mime.MultipartEntityBuilder;
|
||||||
import org.apache.http.entity.mime.content.StringBody;
|
import org.apache.http.entity.mime.content.StringBody;
|
||||||
import org.apache.http.impl.client.CloseableHttpClient;
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
import org.apache.http.message.BasicNameValuePair;
|
import org.apache.http.message.BasicNameValuePair;
|
||||||
import org.apache.http.protocol.HTTP;
|
|
||||||
import org.apache.http.util.EntityUtils;
|
import org.apache.http.util.EntityUtils;
|
||||||
import aiyh.utils.httpUtil.ExtendedIOUtils;
|
|
||||||
import aiyh.utils.httpUtil.HttpArgsType;
|
|
||||||
import aiyh.utils.httpUtil.HttpManager;
|
|
||||||
import aiyh.utils.httpUtil.ResponeVo;
|
|
||||||
import aiyh.utils.httpUtil.httpAsync.HttpAsyncThread;
|
|
||||||
import aiyh.utils.httpUtil.httpAsync.HttpAsyncThreadCallBack;
|
|
||||||
import aiyh.utils.zwl.common.ToolUtil;
|
|
||||||
import weaver.file.ImageFileManager;
|
import weaver.file.ImageFileManager;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.Charset;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
|
import java.util.function.BiFunction;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author EBU7-dev1-ayh
|
* @author EBU7-dev1-ayh
|
||||||
|
@ -50,10 +51,12 @@ public class HttpUtils {
|
||||||
private final GlobalCache globalCache = new GlobalCache();
|
private final GlobalCache globalCache = new GlobalCache();
|
||||||
// 线程池
|
// 线程池
|
||||||
private final ThreadPoolExecutor executorService;
|
private final ThreadPoolExecutor executorService;
|
||||||
|
public static final String JSON_PARAM_KEY = "JSON_PARAM_KEY";
|
||||||
|
|
||||||
{
|
{
|
||||||
// private final ExecutorService executorService = Executors.newFixedThreadPool(3);
|
// private final ExecutorService executorService = Executors.newFixedThreadPool(3);
|
||||||
ThreadFactoryBuilder threadFactoryBuilder = new ThreadFactoryBuilder();
|
ThreadFactoryBuilder threadFactoryBuilder = new ThreadFactoryBuilder();
|
||||||
ThreadFactory threadFactory = threadFactoryBuilder.setNameFormat("xxx-pool-%d").build();
|
ThreadFactory threadFactory = threadFactoryBuilder.setNameFormat("util-http-pool").build();
|
||||||
executorService = new ThreadPoolExecutor(5, 200, 0L,
|
executorService = new ThreadPoolExecutor(5, 200, 0L,
|
||||||
TimeUnit.MILLISECONDS,
|
TimeUnit.MILLISECONDS,
|
||||||
new LinkedBlockingQueue<>(1024),
|
new LinkedBlockingQueue<>(1024),
|
||||||
|
@ -273,11 +276,24 @@ public class HttpUtils {
|
||||||
|
|
||||||
public ResponeVo apiUploadFile(String url, InputStream inputStream, String fileKey, String fileName,
|
public ResponeVo apiUploadFile(String url, InputStream inputStream, String fileKey, String fileName,
|
||||||
Map<String, Object> params, Map<String, String> headers) throws IOException {
|
Map<String, Object> params, Map<String, String> headers) throws IOException {
|
||||||
|
Util.getLogger().info("进入请求方法,上传文件!");
|
||||||
|
CloseableHttpClient httpConnection = HttpManager.getHttpConnection(url);
|
||||||
|
Util.getLogger().info("获取连接成功!");
|
||||||
|
Map<String, Object> paramsMap = paramsHandle(params);
|
||||||
|
Map<String, String> headerMap = headersHandle(headers);
|
||||||
|
Util.getLogger().info("参数处理成功!");
|
||||||
|
HttpPost httpPost = uploadFileByInputStream(url, inputStream, fileKey, fileName, paramsMap, headerMap);
|
||||||
|
Util.getLogger().info("处理文件成功!创建HttpPost请求!");
|
||||||
|
return baseRequest(httpConnection, httpPost);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Future<ResponeVo> apiUploadFileAsync(String url, InputStream inputStream, String fileKey, String fileName,
|
||||||
|
Map<String, Object> params, Map<String, String> headers) throws IOException {
|
||||||
CloseableHttpClient httpConnection = HttpManager.getHttpConnection(url);
|
CloseableHttpClient httpConnection = HttpManager.getHttpConnection(url);
|
||||||
Map<String, Object> paramsMap = paramsHandle(params);
|
Map<String, Object> paramsMap = paramsHandle(params);
|
||||||
Map<String, String> headerMap = headersHandle(headers);
|
Map<String, String> headerMap = headersHandle(headers);
|
||||||
HttpPost httpPost = uploadFileByInputStream(url, inputStream, fileKey, fileName, paramsMap, headerMap);
|
HttpPost httpPost = uploadFileByInputStream(url, inputStream, fileKey, fileName, paramsMap, headerMap);
|
||||||
return baseRequest(httpConnection, httpPost);
|
return executorService.submit(new HttpAsyncThread(httpConnection, httpPost, DEFAULT_ENCODING));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResponeVo apiUploadFile(String url, File file, String fileKey, String fileName,
|
public ResponeVo apiUploadFile(String url, File file, String fileKey, String fileName,
|
||||||
|
@ -315,6 +331,22 @@ public class HttpUtils {
|
||||||
callBackRequest(httpConnection, httpPost, consumer);
|
callBackRequest(httpConnection, httpPost, consumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResponeVo apiPost(String url, Map<String, Object> params, Map<String, String> headers, Function<CloseableHttpResponse, ResponeVo> consumer) throws IOException {
|
||||||
|
CloseableHttpClient httpConnection = HttpManager.getHttpConnection(url);
|
||||||
|
Map<String, Object> paramsMap = paramsHandle(params);
|
||||||
|
Map<String, String> headerMap = headersHandle(headers);
|
||||||
|
HttpPost httpPost = handleHttpPost(url, headerMap, paramsMap);
|
||||||
|
return callBackRequest(httpConnection, httpPost, consumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ResponeVo apiPost(String url, Map<String, Object> params, Map<String, String> headers, BiFunction<Map<String, Object>, CloseableHttpResponse, ResponeVo> consumer) throws IOException {
|
||||||
|
CloseableHttpClient httpConnection = HttpManager.getHttpConnection(url);
|
||||||
|
Map<String, Object> paramsMap = paramsHandle(params);
|
||||||
|
Map<String, String> headerMap = headersHandle(headers);
|
||||||
|
HttpPost httpPost = handleHttpPost(url, headerMap, paramsMap);
|
||||||
|
return callBackRequest(paramsMap, httpConnection, httpPost, consumer);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param url 请求地址
|
* @param url 请求地址
|
||||||
* @param params 请求参数
|
* @param params 请求参数
|
||||||
|
@ -331,7 +363,6 @@ public class HttpUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void callBackRequest(CloseableHttpClient httpClient, HttpUriRequest request, Consumer<CloseableHttpResponse> consumer) throws IOException {
|
private void callBackRequest(CloseableHttpClient httpClient, HttpUriRequest request, Consumer<CloseableHttpResponse> consumer) throws IOException {
|
||||||
CloseableHttpResponse response = null;
|
CloseableHttpResponse response = null;
|
||||||
try {
|
try {
|
||||||
|
@ -347,6 +378,39 @@ public class HttpUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private ResponeVo callBackRequest(CloseableHttpClient httpClient, HttpUriRequest request, Function<CloseableHttpResponse, ResponeVo> consumer) throws IOException {
|
||||||
|
CloseableHttpResponse response = null;
|
||||||
|
ResponeVo apply = null;
|
||||||
|
try {
|
||||||
|
response = httpClient.execute(request);
|
||||||
|
apply = consumer.apply(response);
|
||||||
|
} catch (Exception e) {
|
||||||
|
toolUtil.writeErrorLog(" http调用失败:" + e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
// new CloseThread(httpClient,response).run();
|
||||||
|
ExtendedIOUtils.closeQuietly(httpClient);
|
||||||
|
ExtendedIOUtils.closeQuietly(response);
|
||||||
|
return apply;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ResponeVo callBackRequest(Map<String, Object> requestParam, CloseableHttpClient httpClient, HttpUriRequest request, BiFunction<Map<String, Object>, CloseableHttpResponse, ResponeVo> consumer) throws IOException {
|
||||||
|
CloseableHttpResponse response = null;
|
||||||
|
ResponeVo apply = null;
|
||||||
|
try {
|
||||||
|
response = httpClient.execute(request);
|
||||||
|
apply = consumer.apply(requestParam, response);
|
||||||
|
} catch (Exception e) {
|
||||||
|
toolUtil.writeErrorLog(" http调用失败:" + e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
// new CloseThread(httpClient,response).run();
|
||||||
|
ExtendedIOUtils.closeQuietly(httpClient);
|
||||||
|
ExtendedIOUtils.closeQuietly(response);
|
||||||
|
return apply;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public ResponeVo baseRequest(CloseableHttpClient httpClient, HttpUriRequest request) throws IOException {
|
public ResponeVo baseRequest(CloseableHttpClient httpClient, HttpUriRequest request) throws IOException {
|
||||||
ResponeVo responeVo = new ResponeVo();
|
ResponeVo responeVo = new ResponeVo();
|
||||||
CloseableHttpResponse response = null;
|
CloseableHttpResponse response = null;
|
||||||
|
@ -360,7 +424,7 @@ public class HttpUtils {
|
||||||
responeVo.setEntityString(EntityUtils.toString(entity, DEFAULT_ENCODING));
|
responeVo.setEntityString(EntityUtils.toString(entity, DEFAULT_ENCODING));
|
||||||
responeVo.setCode(response.getStatusLine().getStatusCode());
|
responeVo.setCode(response.getStatusLine().getStatusCode());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
toolUtil.writeErrorLog(" http调用失败:" + e);
|
toolUtil.writeErrorLog(" http调用失败:" + Util.getErrString(e));
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
// new CloseThread(httpClient,response).run();
|
// new CloseThread(httpClient,response).run();
|
||||||
|
@ -487,7 +551,6 @@ public class HttpUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param url 请求地址
|
* @param url 请求地址
|
||||||
* @param params 请求参数
|
* @param params 请求参数
|
||||||
* @param headers 请求头信息
|
* @param headers 请求头信息
|
||||||
|
@ -596,7 +659,12 @@ public class HttpUtils {
|
||||||
httpPost.setEntity(new UrlEncodedFormEntity(nvps));
|
httpPost.setEntity(new UrlEncodedFormEntity(nvps));
|
||||||
// } else if (contentType.toUpperCase().startsWith(HttpArgsType.APPLICATION_JSON.toUpperCase())) {
|
// } else if (contentType.toUpperCase().startsWith(HttpArgsType.APPLICATION_JSON.toUpperCase())) {
|
||||||
} else {
|
} else {
|
||||||
StringEntity stringEntity = new StringEntity(JSON.toJSONString(paramsMap),DEFAULT_ENCODING);
|
StringEntity stringEntity;
|
||||||
|
if(paramsMap.containsKey(JSON_PARAM_KEY)){
|
||||||
|
stringEntity = new StringEntity(String.valueOf(paramsMap.get(JSON_PARAM_KEY)));
|
||||||
|
}else {
|
||||||
|
stringEntity = new StringEntity(JSON.toJSONString(paramsMap), DEFAULT_ENCODING);
|
||||||
|
}
|
||||||
httpPost.setEntity(stringEntity);
|
httpPost.setEntity(stringEntity);
|
||||||
}
|
}
|
||||||
return httpPost;
|
return httpPost;
|
||||||
|
@ -609,11 +677,13 @@ public class HttpUtils {
|
||||||
builder.setCharset(StandardCharsets.UTF_8);
|
builder.setCharset(StandardCharsets.UTF_8);
|
||||||
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
|
||||||
builder.addBinaryBody(fileKey, inputStream, ContentType.MULTIPART_FORM_DATA, fileName);
|
builder.addBinaryBody(fileKey, inputStream, ContentType.MULTIPART_FORM_DATA, fileName);
|
||||||
|
Util.getLogger().info("设置请求文件!");
|
||||||
ContentType contentType = ContentType.create("text/plain", StandardCharsets.UTF_8);
|
ContentType contentType = ContentType.create("text/plain", StandardCharsets.UTF_8);
|
||||||
for (Map.Entry<String, Object> param : params.entrySet()) {
|
for (Map.Entry<String, Object> param : params.entrySet()) {
|
||||||
StringBody stringBody = new StringBody(String.valueOf(param.getValue()), contentType);
|
StringBody stringBody = new StringBody(String.valueOf(param.getValue()), contentType);
|
||||||
builder.addPart(param.getKey(), stringBody);
|
builder.addPart(param.getKey(), stringBody);
|
||||||
}
|
}
|
||||||
|
Util.getLogger().info("设置其他参数成功!");
|
||||||
HttpPost httpPost = new HttpPost(url.trim());
|
HttpPost httpPost = new HttpPost(url.trim());
|
||||||
|
|
||||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||||
|
@ -622,6 +692,7 @@ public class HttpUtils {
|
||||||
}
|
}
|
||||||
httpPost.setHeader(entry.getKey(), entry.getValue());
|
httpPost.setHeader(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
|
Util.getLogger().info("设置请求头content-type成功!");
|
||||||
HttpEntity entity = builder.build();
|
HttpEntity entity = builder.build();
|
||||||
httpPost.setEntity(entity);
|
httpPost.setEntity(entity);
|
||||||
return httpPost;
|
return httpPost;
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
package aiyh.utils.logger;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* create 2022/1/17 0017 9:58
|
|
||||||
* 日志接口
|
|
||||||
*
|
|
||||||
* @author EBU7-dev1-ayh
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface Logger {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打印debug日志
|
|
||||||
* @param message 消息
|
|
||||||
*/
|
|
||||||
public void debug(Object message);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打印debug日志
|
|
||||||
* @param message 消息
|
|
||||||
* @param exception 异常
|
|
||||||
*/
|
|
||||||
public void debug(Object message, Throwable exception);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打印info日志
|
|
||||||
* @param message 消息
|
|
||||||
*/
|
|
||||||
public void info(Object message);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打印info日志
|
|
||||||
* @param message 消息
|
|
||||||
* @param exception 异常
|
|
||||||
*/
|
|
||||||
public void info(Object message, Throwable exception);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打印warn日志
|
|
||||||
* @param message 消息
|
|
||||||
*/
|
|
||||||
public void warn(Object message);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打印warn日志
|
|
||||||
* @param message 消息
|
|
||||||
* @param exception 异常
|
|
||||||
*/
|
|
||||||
public void warn(Object message, Throwable exception);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打印error日志
|
|
||||||
* @param message 错误消息
|
|
||||||
*/
|
|
||||||
public void error(Object message);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打印error日志
|
|
||||||
* @param message 消息
|
|
||||||
* @param exception 异常
|
|
||||||
*/
|
|
||||||
public void error(Object message, Throwable exception);
|
|
||||||
}
|
|
|
@ -1,69 +0,0 @@
|
||||||
package aiyh.utils.logger;
|
|
||||||
|
|
||||||
import aiyh.utils.Util;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* create 2022/1/17 0017 9:57
|
|
||||||
* 日志工具
|
|
||||||
*
|
|
||||||
* @author EBU7-dev1-ayh
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
public class LoggerUtil implements Logger{
|
|
||||||
private final String LOGGER_NAME = "cusAYH";
|
|
||||||
private final org.apache.log4j.Logger log;
|
|
||||||
|
|
||||||
public LoggerUtil() {
|
|
||||||
log = org.apache.log4j.Logger.getLogger(LOGGER_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
public LoggerUtil(String loggerName) {
|
|
||||||
this.log = org.apache.log4j.Logger.getLogger(loggerName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void debug(Object message) {
|
|
||||||
this.log.debug(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void debug(Object message, Throwable exception) {
|
|
||||||
this.log.debug(message,exception);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void info(Object message) {
|
|
||||||
this.log.info(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void info(Object message, Throwable exception) {
|
|
||||||
this.log.info(message,exception);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void warn(Object message) {
|
|
||||||
this.log.warn(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void warn(Object message, Throwable exception) {
|
|
||||||
this.log.warn(message,exception);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void error(Object message) {
|
|
||||||
this.log.error(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void error(Object message, Throwable exception) {
|
|
||||||
this.log.error(message,exception);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void errorException(Object message, Throwable exception) {
|
|
||||||
this.log.error(message + " ==> :\n " + Util.getErrString(exception));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,6 +3,8 @@ package aiyh.utils.mapper;
|
||||||
import aiyh.utils.annotation.recordset.ParamMapper;
|
import aiyh.utils.annotation.recordset.ParamMapper;
|
||||||
import aiyh.utils.annotation.recordset.Select;
|
import aiyh.utils.annotation.recordset.Select;
|
||||||
import aiyh.utils.annotation.recordset.SqlMapper;
|
import aiyh.utils.annotation.recordset.SqlMapper;
|
||||||
|
import aiyh.utils.entity.DocImageInfo;
|
||||||
|
import aiyh.utils.entity.WorkflowNodeConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>工具类查询SQL</p>
|
* <p>工具类查询SQL</p>
|
||||||
|
@ -29,4 +31,29 @@ public interface UtilMapper {
|
||||||
*/
|
*/
|
||||||
@Select("select param_value from uf_cus_dev_config where only_mark = #{onlyMark} and enable_param = 1")
|
@Select("select param_value from uf_cus_dev_config where only_mark = #{onlyMark} and enable_param = 1")
|
||||||
public String selectCusConfigParam(@ParamMapper("onlyMark") String onlyMark);
|
public String selectCusConfigParam(@ParamMapper("onlyMark") String onlyMark);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询文件名
|
||||||
|
* @param imageFileId 查询文件名
|
||||||
|
* @return 文件名
|
||||||
|
*/
|
||||||
|
@Select("select imagefilename from imagefile where imagefileid = #{imageFileId}")
|
||||||
|
String selectFileNameByImageFileId(@ParamMapper("imageFileId") int imageFileId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询流程主表
|
||||||
|
* @param workflowId 流程id
|
||||||
|
* @return 流程表名
|
||||||
|
*/
|
||||||
|
@Select("select bill.tablename from workflow_bill bill join workflow_base base on base.formid = bill.id where base.id = #{workflowId}")
|
||||||
|
String selectWorkfowMainTable(@ParamMapper("workflowId") String workflowId);
|
||||||
|
|
||||||
|
|
||||||
|
@Select("select id,docid doc_id,imagefileid image_file_id,imagefilename image_file_name from docimagefile where docid = #{docId}")
|
||||||
|
DocImageInfo selectDocImageInfo(@ParamMapper("docId") String docId);
|
||||||
|
|
||||||
|
|
||||||
|
@Select("select id,workflow_type,mark_only,workflow_nodes,enable_nodes from uf_node_config where enable_nodes = 1 and workflow_type in (${allVersion})")
|
||||||
|
WorkflowNodeConfig selectNodeConfig(@ParamMapper("allVersion")String allVersion);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package aiyh.utils.recordset;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>float处理</p>
|
||||||
|
* <p>create 2022/4/29 2:34 PM</p>
|
||||||
|
*
|
||||||
|
* @author ayh
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class FloatTypeHandler implements TypeHandler {
|
||||||
|
@Override
|
||||||
|
public Object getValue(RecordSet rs, String fieldName, Field declaredField) {
|
||||||
|
String string = Util.null2DefaultStr(rs.getString(fieldName),"0.0");
|
||||||
|
return Float.parseFloat(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getValue(RecordSet rs, int index, Field declaredField) {
|
||||||
|
String string = Util.null2DefaultStr(rs.getString(index),"0.0");
|
||||||
|
return Float.parseFloat(string);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package aiyh.utils.recordset;
|
package aiyh.utils.recordset;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
import weaver.conn.RecordSet;
|
import weaver.conn.RecordSet;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
@ -13,11 +14,19 @@ import java.lang.reflect.Field;
|
||||||
public class IntegerTypeHandler implements TypeHandler{
|
public class IntegerTypeHandler implements TypeHandler{
|
||||||
@Override
|
@Override
|
||||||
public Object getValue(RecordSet rs, String fieldName, Field declaredField) {
|
public Object getValue(RecordSet rs, String fieldName, Field declaredField) {
|
||||||
return rs.getInt(fieldName);
|
String string = Util.null2DefaultStr(rs.getString(fieldName),"-1");
|
||||||
|
if(string.contains(".")){
|
||||||
|
string = string.substring(0,string.indexOf("."));
|
||||||
|
}
|
||||||
|
return Integer.parseInt(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getValue(RecordSet rs, int index,Field declaredField) {
|
public Object getValue(RecordSet rs, int index,Field declaredField) {
|
||||||
return rs.getInt(index);
|
String string = Util.null2DefaultStr(rs.getString(index),"-1");
|
||||||
|
if(string.contains(".")){
|
||||||
|
string = string.substring(0,string.indexOf("."));
|
||||||
|
}
|
||||||
|
return Integer.parseInt(string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package aiyh.utils.recordset;
|
package aiyh.utils.recordset;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
import aiyh.utils.annotation.recordset.*;
|
import aiyh.utils.annotation.recordset.*;
|
||||||
import aiyh.utils.excention.BindingException;
|
import aiyh.utils.excention.BindingException;
|
||||||
|
import aiyh.utils.excention.CustomerException;
|
||||||
import aiyh.utils.sqlUtil.sqlResult.impl.PrepSqlResultImpl;
|
import aiyh.utils.sqlUtil.sqlResult.impl.PrepSqlResultImpl;
|
||||||
import aiyh.utils.zwl.common.ToolUtil;
|
import org.apache.log4j.Logger;
|
||||||
import weaver.conn.RecordSet;
|
import weaver.conn.RecordSet;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationHandler;
|
import java.lang.reflect.InvocationHandler;
|
||||||
|
@ -18,7 +20,8 @@ import java.lang.reflect.Proxy;
|
||||||
|
|
||||||
public class RecordsetUtil implements InvocationHandler {
|
public class RecordsetUtil implements InvocationHandler {
|
||||||
|
|
||||||
private final ToolUtil toolUtil = new ToolUtil();
|
private final Logger logger = Util.getLogger("sql_util_log");
|
||||||
|
private final RecordSet recordSet = new RecordSet();
|
||||||
|
|
||||||
public <T> T getMapper(Class<T> tClass) {
|
public <T> T getMapper(Class<T> tClass) {
|
||||||
if (tClass == null) {
|
if (tClass == null) {
|
||||||
|
@ -35,7 +38,6 @@ public class RecordsetUtil implements InvocationHandler {
|
||||||
public Object invoke(Object proxy, Method method, Object[] args) {
|
public Object invoke(Object proxy, Method method, Object[] args) {
|
||||||
|
|
||||||
SqlHandler sqlHandler = new SqlHandler();
|
SqlHandler sqlHandler = new SqlHandler();
|
||||||
toolUtil.writeDebuggerLog(String.format("%s===>Preparing to parse SQL", proxy.getClass().getName()));
|
|
||||||
ResultMapper resultMapper = new ResultMapper();
|
ResultMapper resultMapper = new ResultMapper();
|
||||||
Select select = method.getAnnotation(Select.class);
|
Select select = method.getAnnotation(Select.class);
|
||||||
if (select != null) {
|
if (select != null) {
|
||||||
|
@ -44,7 +46,7 @@ public class RecordsetUtil implements InvocationHandler {
|
||||||
String sql = select.value();
|
String sql = select.value();
|
||||||
boolean custom = select.custom();
|
boolean custom = select.custom();
|
||||||
PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
|
PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
|
||||||
toolUtil.writeDebuggerLog(handler.toString());
|
logger.info("解析sql===>" + handler.toString());
|
||||||
if (handler.getArgs().isEmpty()) {
|
if (handler.getArgs().isEmpty()) {
|
||||||
rs.executeQuery(handler.getSqlStr());
|
rs.executeQuery(handler.getSqlStr());
|
||||||
} else {
|
} else {
|
||||||
|
@ -56,17 +58,16 @@ public class RecordsetUtil implements InvocationHandler {
|
||||||
|
|
||||||
if (update != null) {
|
if (update != null) {
|
||||||
// 查询
|
// 查询
|
||||||
RecordSet rs = new RecordSet();
|
|
||||||
String sql = update.value();
|
String sql = update.value();
|
||||||
boolean custom = update.custom();
|
boolean custom = update.custom();
|
||||||
PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
|
PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
|
||||||
toolUtil.writeDebuggerLog(handler.toString());
|
logger.info(handler.toString());
|
||||||
Class<?> returnType = method.getReturnType();
|
Class<?> returnType = method.getReturnType();
|
||||||
boolean b;
|
boolean b;
|
||||||
if (handler.getArgs().isEmpty()) {
|
if (handler.getArgs().isEmpty()) {
|
||||||
b = rs.executeUpdate(handler.getSqlStr());
|
b = recordSet.executeUpdate(handler.getSqlStr());
|
||||||
} else {
|
} else {
|
||||||
b = rs.executeUpdate(handler.getSqlStr(), handler.getArgs());
|
b = recordSet.executeUpdate(handler.getSqlStr(), handler.getArgs());
|
||||||
}
|
}
|
||||||
if (returnType.equals(void.class)) {
|
if (returnType.equals(void.class)) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -85,17 +86,16 @@ public class RecordsetUtil implements InvocationHandler {
|
||||||
Insert insert = method.getAnnotation(Insert.class);
|
Insert insert = method.getAnnotation(Insert.class);
|
||||||
if (insert != null) {
|
if (insert != null) {
|
||||||
// 查询
|
// 查询
|
||||||
RecordSet rs = new RecordSet();
|
|
||||||
String sql = insert.value();
|
String sql = insert.value();
|
||||||
boolean custom = insert.custom();
|
boolean custom = insert.custom();
|
||||||
PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
|
PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
|
||||||
toolUtil.writeDebuggerLog(handler.toString());
|
logger.info(handler.toString());
|
||||||
Class<?> returnType = method.getReturnType();
|
Class<?> returnType = method.getReturnType();
|
||||||
boolean b;
|
boolean b;
|
||||||
if (handler.getArgs().isEmpty()) {
|
if (handler.getArgs().isEmpty()) {
|
||||||
b = rs.executeUpdate(handler.getSqlStr());
|
b = recordSet.executeUpdate(handler.getSqlStr());
|
||||||
} else {
|
} else {
|
||||||
b = rs.executeUpdate(handler.getSqlStr(), handler.getArgs());
|
b = recordSet.executeUpdate(handler.getSqlStr(), handler.getArgs());
|
||||||
}
|
}
|
||||||
if (returnType.equals(void.class)) {
|
if (returnType.equals(void.class)) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -107,17 +107,16 @@ public class RecordsetUtil implements InvocationHandler {
|
||||||
Delete delete = method.getAnnotation(Delete.class);
|
Delete delete = method.getAnnotation(Delete.class);
|
||||||
if (delete != null) {
|
if (delete != null) {
|
||||||
// 查询
|
// 查询
|
||||||
RecordSet rs = new RecordSet();
|
|
||||||
String sql = delete.value();
|
String sql = delete.value();
|
||||||
boolean custom = delete.custom();
|
boolean custom = delete.custom();
|
||||||
PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
|
PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
|
||||||
toolUtil.writeDebuggerLog(handler.toString());
|
logger.info(handler.toString());
|
||||||
Class<?> returnType = method.getReturnType();
|
Class<?> returnType = method.getReturnType();
|
||||||
boolean b;
|
boolean b;
|
||||||
if (handler.getArgs().isEmpty()) {
|
if (handler.getArgs().isEmpty()) {
|
||||||
b = rs.executeUpdate(handler.getSqlStr());
|
b = recordSet.executeUpdate(handler.getSqlStr());
|
||||||
} else {
|
} else {
|
||||||
b = rs.executeUpdate(handler.getSqlStr(), handler.getArgs());
|
b = recordSet.executeUpdate(handler.getSqlStr(), handler.getArgs());
|
||||||
}
|
}
|
||||||
if (returnType.equals(void.class)) {
|
if (returnType.equals(void.class)) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -126,7 +125,7 @@ public class RecordsetUtil implements InvocationHandler {
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
throw new CustomerException("该方法没有添加注解!请检查是否正确添加注解!@Select、@Update、@Insert、@Delete");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,9 @@ package aiyh.utils.recordset;
|
||||||
import aiyh.utils.Util;
|
import aiyh.utils.Util;
|
||||||
import aiyh.utils.annotation.recordset.CaseConversion;
|
import aiyh.utils.annotation.recordset.CaseConversion;
|
||||||
import aiyh.utils.excention.TypeNonsupportException;
|
import aiyh.utils.excention.TypeNonsupportException;
|
||||||
|
import com.google.common.base.Strings;
|
||||||
import weaver.conn.RecordSet;
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.conn.RecordSetTrans;
|
||||||
|
|
||||||
import java.beans.BeanInfo;
|
import java.beans.BeanInfo;
|
||||||
import java.beans.Introspector;
|
import java.beans.Introspector;
|
||||||
|
@ -33,12 +35,17 @@ public class ResultMapper {
|
||||||
typeHandler.put(Boolean.class, new BooleanTypeHandler());
|
typeHandler.put(Boolean.class, new BooleanTypeHandler());
|
||||||
typeHandler.put(boolean.class, new BooleanTypeHandler());
|
typeHandler.put(boolean.class, new BooleanTypeHandler());
|
||||||
typeHandler.put(Date.class, new DataTypeHandler());
|
typeHandler.put(Date.class, new DataTypeHandler());
|
||||||
|
typeHandler.put(Float.class, new FloatTypeHandler());
|
||||||
|
typeHandler.put(float.class, new FloatTypeHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> T mapperResult(RecordSet rs, Method method, Class<T> tClass) {
|
public <T> T mapperResult(RecordSet rs, Method method, Class<T> tClass) {
|
||||||
if (tClass.equals(void.class)) {
|
if (tClass.equals(void.class)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (tClass.equals(RecordSet.class) || tClass.equals(RecordSetTrans.class)) {
|
||||||
|
return (T) rs;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (tClass.equals(List.class)) {
|
if (tClass.equals(List.class)) {
|
||||||
tClass = (Class<T>) ArrayList.class;
|
tClass = (Class<T>) ArrayList.class;
|
||||||
|
@ -127,17 +134,10 @@ public class ResultMapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (o instanceof Map) {
|
||||||
for (int i = 0; i < columnName.length; i++) {
|
for (int i = 0; i < columnName.length; i++) {
|
||||||
String columnType = columnTypeName[i];
|
String columnType = columnTypeName[i];
|
||||||
if (o instanceof Map) {
|
if ("int".equalsIgnoreCase(columnType) || "long".equalsIgnoreCase(columnType) || "number".equalsIgnoreCase(columnType) || "MEDIUMINT".equalsIgnoreCase(columnType) || "TINYINT".equalsIgnoreCase(columnType) || "SMALLINT".equalsIgnoreCase(columnType) || "BIGINT".equalsIgnoreCase(columnType) || "INTEGER".equalsIgnoreCase(columnType)) {
|
||||||
if ("int".equalsIgnoreCase(columnType) ||
|
|
||||||
"long".equalsIgnoreCase(columnType) ||
|
|
||||||
"number".equalsIgnoreCase(columnType) ||
|
|
||||||
"MEDIUMINT".equalsIgnoreCase(columnType) ||
|
|
||||||
"TINYINT".equalsIgnoreCase(columnType) ||
|
|
||||||
"SMALLINT".equalsIgnoreCase(columnType) ||
|
|
||||||
"BIGINT".equalsIgnoreCase(columnType) ||
|
|
||||||
"INTEGER".equalsIgnoreCase(columnType)) {
|
|
||||||
if (enable) {
|
if (enable) {
|
||||||
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getInt(i + 1));
|
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getInt(i + 1));
|
||||||
continue;
|
continue;
|
||||||
|
@ -145,9 +145,7 @@ public class ResultMapper {
|
||||||
((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getInt(i + 1));
|
((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getInt(i + 1));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ("FLOAT".equalsIgnoreCase(columnType) ||
|
if ("FLOAT".equalsIgnoreCase(columnType) || "DOUBLE".equalsIgnoreCase(columnType) || "DECIMAL".equalsIgnoreCase(columnType)) {
|
||||||
"DOUBLE".equalsIgnoreCase(columnType) ||
|
|
||||||
"DECIMAL".equalsIgnoreCase(columnType)) {
|
|
||||||
if (enable) {
|
if (enable) {
|
||||||
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getFloat(i + 1));
|
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getFloat(i + 1));
|
||||||
continue;
|
continue;
|
||||||
|
@ -162,39 +160,50 @@ public class ResultMapper {
|
||||||
((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getString(i + 1));
|
((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getString(i + 1));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
return o;
|
||||||
|
}
|
||||||
if (o instanceof Collection) {
|
if (o instanceof Collection) {
|
||||||
throw new TypeNonsupportException("An unsupported return type!");
|
throw new TypeNonsupportException("An unsupported return type!");
|
||||||
}
|
}
|
||||||
if (o instanceof Number) {
|
if (o instanceof Number) {
|
||||||
if ("int".equalsIgnoreCase(columnType) ||
|
for (int i = 0; i < columnName.length; i++) {
|
||||||
"long".equalsIgnoreCase(columnType) ||
|
String columnType = columnTypeName[i];
|
||||||
"number".equalsIgnoreCase(columnType) ||
|
if ("int".equalsIgnoreCase(columnType) || "long".equalsIgnoreCase(columnType) || "number".equalsIgnoreCase(columnType) || "MEDIUMINT".equalsIgnoreCase(columnType) || "TINYINT".equalsIgnoreCase(columnType) || "SMALLINT".equalsIgnoreCase(columnType) || "BIGINT".equalsIgnoreCase(columnType) || "INTEGER".equalsIgnoreCase(columnType)) {
|
||||||
"MEDIUMINT".equalsIgnoreCase(columnType) ||
|
|
||||||
"TINYINT".equalsIgnoreCase(columnType) ||
|
|
||||||
"SMALLINT".equalsIgnoreCase(columnType) ||
|
|
||||||
"BIGINT".equalsIgnoreCase(columnType) ||
|
|
||||||
"INTEGER".equalsIgnoreCase(columnType)) {
|
|
||||||
return rs.getInt(i + 1);
|
return rs.getInt(i + 1);
|
||||||
}
|
}
|
||||||
if ("FLOAT".equalsIgnoreCase(columnType) ||
|
if ("FLOAT".equalsIgnoreCase(columnType) || "DOUBLE".equalsIgnoreCase(columnType) || "DECIMAL".equalsIgnoreCase(columnType)) {
|
||||||
"DOUBLE".equalsIgnoreCase(columnType) ||
|
|
||||||
"DECIMAL".equalsIgnoreCase(columnType)) {
|
|
||||||
return rs.getFloat(i + 1);
|
return rs.getFloat(i + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return o;
|
||||||
|
}
|
||||||
if (o instanceof String) {
|
if (o instanceof String) {
|
||||||
|
for (int i = 0; i < columnName.length; i++) {
|
||||||
return rs.getString(i + 1);
|
return rs.getString(i + 1);
|
||||||
}
|
}
|
||||||
|
return o;
|
||||||
|
}
|
||||||
if (o instanceof Boolean) {
|
if (o instanceof Boolean) {
|
||||||
|
for (int i = 0; i < columnName.length; i++) {
|
||||||
return rs.getBoolean(i + 1);
|
return rs.getBoolean(i + 1);
|
||||||
}
|
}
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Util.getLogger().info("获取对象:" + o.toString());
|
||||||
BeanInfo beanInfo = Introspector.getBeanInfo(o.getClass(), Object.class);
|
BeanInfo beanInfo = Introspector.getBeanInfo(o.getClass(), Object.class);
|
||||||
PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
|
PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
|
||||||
for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
|
for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
|
||||||
Class<?> propertyType = propertyDescriptor.getPropertyType();
|
Class<?> propertyType = propertyDescriptor.getPropertyType();
|
||||||
Object value = null;
|
Object value = null;
|
||||||
String fieldName = propertyDescriptor.getName();
|
String fieldName = propertyDescriptor.getName();
|
||||||
|
|
||||||
|
if(Strings.isNullOrEmpty(fieldName)){
|
||||||
|
fieldName = propertyDescriptor.getDisplayName();
|
||||||
|
}
|
||||||
|
// Util.getLogger().info("获取类字段:" + fieldName);
|
||||||
|
// Util.getLogger().info("获取类字段1:" + propertyDescriptor.getDisplayName());
|
||||||
|
// Util.getLogger().info("获取的数据库数据:" + rs.getString(fieldName));
|
||||||
Field declaredField = o.getClass().getDeclaredField(fieldName);
|
Field declaredField = o.getClass().getDeclaredField(fieldName);
|
||||||
if (enable) {
|
if (enable) {
|
||||||
value = ResultMapper.typeHandler.get(propertyType) == null ? null : ResultMapper.typeHandler.get(propertyType).getValue(rs, Util.toUnderlineCase(fieldName), declaredField);
|
value = ResultMapper.typeHandler.get(propertyType) == null ? null : ResultMapper.typeHandler.get(propertyType).getValue(rs, Util.toUnderlineCase(fieldName), declaredField);
|
||||||
|
@ -204,10 +213,9 @@ public class ResultMapper {
|
||||||
propertyDescriptor.getWriteMethod().invoke(o, value);
|
propertyDescriptor.getWriteMethod().invoke(o, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
Util.getLogger().error("报错了,写入数据到实体类报错!\n" + Util.getErrString(e));
|
||||||
}
|
}
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ public class SqlHandler {
|
||||||
} else {
|
} else {
|
||||||
parse = parse(findSql, methodArgNameMap);
|
parse = parse(findSql, methodArgNameMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PrepSqlResultImpl(parse, sqlArgs);
|
return new PrepSqlResultImpl(parse, sqlArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,19 +115,9 @@ public class SqlHandler {
|
||||||
|
|
||||||
private String parse(String sql, Object arg) {
|
private String parse(String sql, Object arg) {
|
||||||
String parseSql = sql;
|
String parseSql = sql;
|
||||||
String pattern = "\\$\\{\\s*(?<regx>(?<field>\\w+)(\\.?(?<other>\\S+))*)\\s*}";
|
String pattern = "\\$t\\{\\s*(?<regx>(?<field>\\w+)(\\.?(?<other>\\S+))*)\\s*}";
|
||||||
Pattern compile = Pattern.compile(pattern);
|
Pattern compile = Pattern.compile(pattern);
|
||||||
Matcher matcher = compile.matcher(parseSql);
|
Matcher matcher = compile.matcher(parseSql);
|
||||||
while (matcher.find()) {
|
|
||||||
String regx = matcher.group("regx");
|
|
||||||
String field = matcher.group("field");
|
|
||||||
String other = matcher.group("other");
|
|
||||||
Object value = getValueByRegx(regx, field, other, arg, false);
|
|
||||||
parseSql = parseSql.replaceFirst(pattern, value.toString());
|
|
||||||
}
|
|
||||||
pattern = "\\$t\\{\\s*(?<regx>(?<field>\\w+)(\\.?(?<other>\\S+))*)\\s*}";
|
|
||||||
compile = Pattern.compile(pattern);
|
|
||||||
matcher = compile.matcher(parseSql);
|
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
String regx = matcher.group("regx");
|
String regx = matcher.group("regx");
|
||||||
String field = matcher.group("field");
|
String field = matcher.group("field");
|
||||||
|
@ -134,7 +125,19 @@ public class SqlHandler {
|
||||||
Object value = getValueByRegx(regx, field, other, arg, true);
|
Object value = getValueByRegx(regx, field, other, arg, true);
|
||||||
parseSql = parseSql.replaceFirst(pattern, value.toString());
|
parseSql = parseSql.replaceFirst(pattern, value.toString());
|
||||||
}
|
}
|
||||||
pattern = "#\\{\\s*(?<regx>(?<field>\\w+)(\\.?(?<other>\\S+))*)\\s*}";
|
pattern = "\\$\\{\\s*(?<regx>(?<field>\\w+)(\\.?(?<other>\\S+))*)\\s*}";
|
||||||
|
compile = Pattern.compile(pattern);
|
||||||
|
matcher = compile.matcher(parseSql);
|
||||||
|
while (matcher.find()) {
|
||||||
|
String regx = matcher.group("regx");
|
||||||
|
String field = matcher.group("field");
|
||||||
|
String other = matcher.group("other");
|
||||||
|
Object value = getValueByRegx(regx, field, other, arg, false);
|
||||||
|
parseSql = parseSql.replaceFirst(pattern, value.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// pattern = "#\\{\\s*(?<regx>(?<field>\\w+)(\\.?(?<other>\\S+))*)\\s*}";
|
||||||
|
pattern = "#\\{\\s*(?<regx>(?<field>\\w+)\\.*(?<other>\\w+)*)\\s*}";
|
||||||
compile = Pattern.compile(pattern);
|
compile = Pattern.compile(pattern);
|
||||||
matcher = compile.matcher(parseSql);
|
matcher = compile.matcher(parseSql);
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
|
@ -167,6 +170,10 @@ public class SqlHandler {
|
||||||
|
|
||||||
|
|
||||||
private Object valueHandler(Object arg, String key, boolean isEscape) {
|
private Object valueHandler(Object arg, String key, boolean isEscape) {
|
||||||
|
if(arg == null){
|
||||||
|
return null;
|
||||||
|
// throw new CustomerException(String.format("sql参数{%s} 为null,请检查!",key));
|
||||||
|
}
|
||||||
if (arg instanceof Number) {
|
if (arg instanceof Number) {
|
||||||
// 处理数字类型
|
// 处理数字类型
|
||||||
return arg;
|
return arg;
|
||||||
|
@ -207,7 +214,7 @@ public class SqlHandler {
|
||||||
return "'" + o + "'";
|
return "'" + o + "'";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return o;
|
return valueHandler(o,key,isEscape);
|
||||||
}
|
}
|
||||||
String methodName = "get" + key.substring(0, 1).toUpperCase() + key.substring(1);
|
String methodName = "get" + key.substring(0, 1).toUpperCase() + key.substring(1);
|
||||||
// 当做javaBean处理
|
// 当做javaBean处理
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -19,9 +19,7 @@ import javax.ws.rs.core.Context;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.StreamingOutput;
|
import javax.ws.rs.core.StreamingOutput;
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -80,22 +78,13 @@ public class UploadByBase64 {
|
||||||
@Path("/download/img/{fileId}")
|
@Path("/download/img/{fileId}")
|
||||||
@GET
|
@GET
|
||||||
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
@Produces(MediaType.APPLICATION_OCTET_STREAM)
|
||||||
public Response downloadFile(@PathParam("fileId") int fileId) throws IOException {
|
public Response downloadFile(@PathParam("fileId") int fileId){
|
||||||
try {
|
try {
|
||||||
InputStream inputStreamById = ImageFileManager.getInputStreamById(fileId);
|
InputStream inputStreamById = ImageFileManager.getInputStreamById(fileId);
|
||||||
byte[] bytes = IOUtils.toByteArray(inputStreamById);
|
byte[] bytes = IOUtils.toByteArray(inputStreamById);
|
||||||
StreamingOutput output = new StreamingOutput() {
|
StreamingOutput output = outputStream -> {
|
||||||
@Override
|
|
||||||
public void write(OutputStream outputStream) throws IOException, WebApplicationException {
|
|
||||||
outputStream.write(bytes);
|
outputStream.write(bytes);
|
||||||
// byte[] buffer = new byte[1024*10];
|
|
||||||
// int len = 0;
|
|
||||||
// while ((len = inputStreamById.read(buffer)) != -1) {
|
|
||||||
// outputStream.write(buffer, 0, len);
|
|
||||||
// }
|
|
||||||
outputStream.flush();
|
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
}
|
|
||||||
};
|
};
|
||||||
Response.ResponseBuilder header = Response.ok(output, MediaType.APPLICATION_OCTET_STREAM)
|
Response.ResponseBuilder header = Response.ok(output, MediaType.APPLICATION_OCTET_STREAM)
|
||||||
.header("Content-Disposition",
|
.header("Content-Disposition",
|
||||||
|
@ -104,6 +93,5 @@ public class UploadByBase64 {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return Response.ok(ApiResult.error("异常" + e), MediaType.APPLICATION_JSON).build();
|
return Response.ok(ApiResult.error("异常" + e), MediaType.APPLICATION_JSON).build();
|
||||||
}
|
}
|
||||||
// return ApiResult.success("成功");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,8 @@ public class ConfigEmpty {
|
||||||
*/
|
*/
|
||||||
private String attachmentFieldId;
|
private String attachmentFieldId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ConfigEmpty(Builder builder) {
|
public ConfigEmpty(Builder builder) {
|
||||||
this.id = builder.id;
|
this.id = builder.id;
|
||||||
this.workflowType = builder.workflowType;
|
this.workflowType = builder.workflowType;
|
||||||
|
|
|
@ -75,14 +75,21 @@ public class FaDDContractMapping {
|
||||||
* 获取节点信息
|
* 获取节点信息
|
||||||
*
|
*
|
||||||
* @param versionStringByWfid 全版本的流程
|
* @param versionStringByWfid 全版本的流程
|
||||||
* @param markOnly 获取配置的节点信息
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getNodes(String versionStringByWfid) {
|
public String getNodes(String versionStringByWfid) {
|
||||||
String query = "select workflow_nodes from uf_node_config where workflow_type in (" + versionStringByWfid + ") and enable_nodes = ?";
|
String query = "select workflow_nodes from uf_node_config where workflow_type in (" + versionStringByWfid + ") and enable_nodes = ?";
|
||||||
rs.executeQuery(query, 1);
|
rs.executeQuery(query, 1);
|
||||||
rs.next();
|
String nodes = "";
|
||||||
return rs.getString(1);
|
while (rs.next()){
|
||||||
|
if("".equals(nodes)){
|
||||||
|
nodes += rs.getString(1);
|
||||||
|
}else{
|
||||||
|
String node = Util.null2String(rs.getString(1));
|
||||||
|
nodes += "".equals(node) ? "" : "," + node;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -688,13 +688,13 @@ public class FaDDContractService {
|
||||||
RecordSet rs = new RecordSet();
|
RecordSet rs = new RecordSet();
|
||||||
rs.executeQuery(query, requestId);
|
rs.executeQuery(query, requestId);
|
||||||
Map<String, Object> result = Util.recordSet2Map(rs);
|
Map<String, Object> result = Util.recordSet2Map(rs);
|
||||||
this.toolUtil.writeDebuggerLog(result.toString());
|
|
||||||
boolean isAllSinged = false;
|
boolean isAllSinged = false;
|
||||||
boolean isSingedOneself = false;
|
boolean isSingedOneself = false;
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
toolUtil.writeDebuggerLog("查询到状态为null;sql:" + query + " ---> " + requestId);
|
toolUtil.writeDebuggerLog("查询到状态为null;sql:" + query + " ---> " + requestId);
|
||||||
return ParaMap.create().put("isAllSinged", false).put("isSingedOneself", false);
|
return ParaMap.create().put("isAllSinged", false).put("isSingedOneself", false);
|
||||||
}
|
}
|
||||||
|
// this.toolUtil.writeDebuggerLog(result.toString());
|
||||||
// 等待对方签署
|
// 等待对方签署
|
||||||
/* if("2".equals(result.get("contract_status"))){
|
/* if("2".equals(result.get("contract_status"))){
|
||||||
isAllSinged = false;
|
isAllSinged = false;
|
||||||
|
|
|
@ -1,5 +1,25 @@
|
||||||
package com.api.aiyh_pcn.fadada.service.impl;
|
package com.api.aiyh_pcn.fadada.service.impl;
|
||||||
|
|
||||||
|
import aiyh.utils.Util;
|
||||||
|
import aiyh.utils.entity.ApiConfigDetailDTO;
|
||||||
|
import aiyh.utils.entity.ApiConfigMainDTO;
|
||||||
|
import aiyh.utils.httpUtil.ResponeVo;
|
||||||
|
import aiyh.utils.zwl.common.ToolUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.api.aiyh_pcn.fadada.dao.FaDDServiceMapping;
|
||||||
|
import com.api.aiyh_pcn.fadada.entity.FaDaDaConfigDTO;
|
||||||
|
import com.api.aiyh_pcn.fadada.service.IFaDDService;
|
||||||
|
import com.api.aiyh_pcn.fadada.util.FaDDRequestUtils;
|
||||||
|
import com.api.aiyh_pcn.fadada.vo.TableFieldMappingVO;
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import org.apache.http.Header;
|
||||||
|
import org.apache.http.HeaderElement;
|
||||||
|
import org.apache.http.HttpEntity;
|
||||||
|
import org.apache.http.NameValuePair;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.workflow.workflow.WorkflowVersion;
|
||||||
|
|
||||||
|
import javax.ws.rs.core.StreamingOutput;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -9,29 +29,6 @@ import java.util.Map;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipOutputStream;
|
import java.util.zip.ZipOutputStream;
|
||||||
|
|
||||||
import javax.ws.rs.core.StreamingOutput;
|
|
||||||
|
|
||||||
import org.apache.http.Header;
|
|
||||||
import org.apache.http.HeaderElement;
|
|
||||||
import org.apache.http.HttpEntity;
|
|
||||||
import org.apache.http.NameValuePair;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.api.aiyh_pcn.fadada.dao.FaDDServiceMapping;
|
|
||||||
import com.api.aiyh_pcn.fadada.entity.FaDaDaConfigDTO;
|
|
||||||
import com.api.aiyh_pcn.fadada.service.IFaDDService;
|
|
||||||
import com.api.aiyh_pcn.fadada.util.FaDDRequestUtils;
|
|
||||||
import com.api.aiyh_pcn.fadada.vo.TableFieldMappingVO;
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
|
|
||||||
import aiyh.utils.Util;
|
|
||||||
import aiyh.utils.entity.ApiConfigDetailDTO;
|
|
||||||
import aiyh.utils.entity.ApiConfigMainDTO;
|
|
||||||
import aiyh.utils.httpUtil.ResponeVo;
|
|
||||||
import aiyh.utils.zwl.common.ToolUtil;
|
|
||||||
import weaver.conn.RecordSet;
|
|
||||||
import weaver.workflow.workflow.WorkflowVersion;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author EBU7-dev1-ayh
|
* @author EBU7-dev1-ayh
|
||||||
* @create 2021/9/30 0030 11:12 core
|
* @create 2021/9/30 0030 11:12 core
|
||||||
|
|
|
@ -5,6 +5,7 @@ import aiyh.utils.httpUtil.HttpArgsType;
|
||||||
import aiyh.utils.httpUtil.ResponeVo;
|
import aiyh.utils.httpUtil.ResponeVo;
|
||||||
import aiyh.utils.httpUtil.util.HttpUtils;
|
import aiyh.utils.httpUtil.util.HttpUtils;
|
||||||
import aiyh.utils.zwl.common.ToolUtil;
|
import aiyh.utils.zwl.common.ToolUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.core.util.URLUtil;
|
import cn.hutool.core.util.URLUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
@ -22,6 +23,7 @@ import java.security.NoSuchAlgorithmException;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.TreeMap;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,7 +65,6 @@ public class FaDDRequestUtils {
|
||||||
data, null);
|
data, null);
|
||||||
TOOL_UTIL.writeDebuggerLog("查询企业认真状态:" + JSONObject.toJSONString(data));
|
TOOL_UTIL.writeDebuggerLog("查询企业认真状态:" + JSONObject.toJSONString(data));
|
||||||
TOOL_UTIL.writeDebuggerLog(responeVo.getEntityString() + "\n");
|
TOOL_UTIL.writeDebuggerLog(responeVo.getEntityString() + "\n");
|
||||||
// System.out.println(responeVo.getEntityString());
|
|
||||||
if (responeVo.getCode() != 200) {
|
if (responeVo.getCode() != 200) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -76,6 +77,13 @@ public class FaDDRequestUtils {
|
||||||
|
|
||||||
|
|
||||||
// 创建合同
|
// 创建合同
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建合同接口
|
||||||
|
* @param fileInfo 创建合同文件对象
|
||||||
|
* @param url 创建合同地址
|
||||||
|
* @return 返回值
|
||||||
|
*/
|
||||||
public static ResponeVo createContract(FileInfo fileInfo, String url) {
|
public static ResponeVo createContract(FileInfo fileInfo, String url) {
|
||||||
Map<String, Object> data = new HashMap<>();
|
Map<String, Object> data = new HashMap<>();
|
||||||
data.put("contractExtension", fileInfo.getContractExtension());
|
data.put("contractExtension", fileInfo.getContractExtension());
|
||||||
|
@ -84,7 +92,6 @@ public class FaDDRequestUtils {
|
||||||
data.put("customerNo", fileInfo.getCustomerNo());
|
data.put("customerNo", fileInfo.getCustomerNo());
|
||||||
header.put("sign", builderSign(data));
|
header.put("sign", builderSign(data));
|
||||||
header.put("Content-Type", "multipart/form-data");
|
header.put("Content-Type", "multipart/form-data");
|
||||||
// System.out.println(JSONObject.toJSONString(data));
|
|
||||||
ResponeVo responeVo = null;
|
ResponeVo responeVo = null;
|
||||||
try {
|
try {
|
||||||
responeVo = httpUtils.apiUploadFile(url,
|
responeVo = httpUtils.apiUploadFile(url,
|
||||||
|
@ -95,30 +102,36 @@ public class FaDDRequestUtils {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
TOOL_UTIL.writeErrorLog(e.toString());
|
TOOL_UTIL.writeErrorLog(e.toString());
|
||||||
}
|
}
|
||||||
// System.out.println(JSONObject.toJSONString(responeVo));
|
|
||||||
return responeVo;
|
return responeVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
// 签署合同
|
* 签署合同
|
||||||
|
* @param data 签署合同参数
|
||||||
|
* @param url 签署合同地址
|
||||||
|
* @return 返回
|
||||||
|
*/
|
||||||
public static ResponeVo signedContract(Map<String, Object> data, String url) {
|
public static ResponeVo signedContract(Map<String, Object> data, String url) {
|
||||||
header.put("sign", builderSign(data));
|
header.put("sign", builderSign(data));
|
||||||
header.put("Content-Type", "application/json");
|
header.put("Content-Type", "application/json");
|
||||||
// System.out.println(JSONObject.toJSONString(data));
|
|
||||||
ResponeVo responeVo = null;
|
ResponeVo responeVo = null;
|
||||||
try {
|
try {
|
||||||
// http://apigwaws-lite.porsche-cloudservice.com/env-101/econtract/econtract/contract/api/v1/contract/sign
|
|
||||||
responeVo = httpUtils.apiPost(url,
|
responeVo = httpUtils.apiPost(url,
|
||||||
data, null);
|
data, null);
|
||||||
TOOL_UTIL.writeDebuggerLog("签署合同:" + JSONObject.toJSONString(data));
|
TOOL_UTIL.writeDebuggerLog("签署合同:" + JSONObject.toJSONString(data));
|
||||||
TOOL_UTIL.writeDebuggerLog(responeVo.getEntityString() + "\n");
|
TOOL_UTIL.writeDebuggerLog(responeVo.getEntityString() + "\n");
|
||||||
// System.out.println(JSONObject.toJSONString(responeVo));
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return responeVo;
|
return responeVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载合同
|
||||||
|
* @param data 下载合同参数
|
||||||
|
* @param consumer 下载合同回调
|
||||||
|
* @param url 下载合同地址
|
||||||
|
*/
|
||||||
public static void downContract(Map<String, Object> data, Consumer<CloseableHttpResponse> consumer, String url) {
|
public static void downContract(Map<String, Object> data, Consumer<CloseableHttpResponse> consumer, String url) {
|
||||||
header.put("sign", builderSign(data));
|
header.put("sign", builderSign(data));
|
||||||
header.put("Content-Type", "application/json");
|
header.put("Content-Type", "application/json");
|
||||||
|
@ -132,6 +145,12 @@ public class FaDDRequestUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询合同状态
|
||||||
|
* @param data 请求参数
|
||||||
|
* @return 请求结果封装
|
||||||
|
* @throws JsonProcessingException json转换异常
|
||||||
|
*/
|
||||||
public static Map<String, Object> queryContractStatus(Map<String, Object> data) throws JsonProcessingException {
|
public static Map<String, Object> queryContractStatus(Map<String, Object> data) throws JsonProcessingException {
|
||||||
header.put("sign", builderSign(data));
|
header.put("sign", builderSign(data));
|
||||||
ResponeVo responeVo = null;
|
ResponeVo responeVo = null;
|
||||||
|
@ -143,10 +162,15 @@ public class FaDDRequestUtils {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
// System.out.println(JSONObject.toJSONString(responeVo));
|
|
||||||
return responeVo.getEntityMap();
|
return responeVo.getEntityMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询合同详细信息
|
||||||
|
* @param data 请求参数
|
||||||
|
* @return 返回结果
|
||||||
|
* @throws JsonProcessingException
|
||||||
|
*/
|
||||||
public static Map<String, Object> queryDetailContractStatus(Map<String, Object> data) throws JsonProcessingException {
|
public static Map<String, Object> queryDetailContractStatus(Map<String, Object> data) throws JsonProcessingException {
|
||||||
header.put("sign", builderSign(data));
|
header.put("sign", builderSign(data));
|
||||||
ResponeVo responeVo = null;
|
ResponeVo responeVo = null;
|
||||||
|
@ -158,7 +182,6 @@ public class FaDDRequestUtils {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
// System.out.println(JSONObject.toJSONString(responeVo));
|
|
||||||
return responeVo.getEntityMap();
|
return responeVo.getEntityMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,7 +193,6 @@ public class FaDDRequestUtils {
|
||||||
"&bizContent=" + header.get("bizContent") +
|
"&bizContent=" + header.get("bizContent") +
|
||||||
"&signType=" + header.get("signType") +
|
"&signType=" + header.get("signType") +
|
||||||
"×tamp=" + header.get("timestamp");
|
"×tamp=" + header.get("timestamp");
|
||||||
// System.out.println(signStr);
|
|
||||||
String appKey = TOOL_UTIL.getSystemParamValue("FDD_appKey");
|
String appKey = TOOL_UTIL.getSystemParamValue("FDD_appKey");
|
||||||
if (StringUtils.isNullOrEmpty(appKey)) {
|
if (StringUtils.isNullOrEmpty(appKey)) {
|
||||||
TOOL_UTIL.writeErrorLog("查询到的FDD_appKey为空!");
|
TOOL_UTIL.writeErrorLog("查询到的FDD_appKey为空!");
|
||||||
|
@ -179,20 +201,23 @@ public class FaDDRequestUtils {
|
||||||
TOOL_UTIL.writeDebuggerLog("app签名:" + appKey);
|
TOOL_UTIL.writeDebuggerLog("app签名:" + appKey);
|
||||||
TOOL_UTIL.writeDebuggerLog("signStr:" + signStr);
|
TOOL_UTIL.writeDebuggerLog("signStr:" + signStr);
|
||||||
TOOL_UTIL.writeDebuggerLog("请求头信息:" + JSONObject.toJSONString(header));
|
TOOL_UTIL.writeDebuggerLog("请求头信息:" + JSONObject.toJSONString(header));
|
||||||
// String appKey = "L7P59oqA2An0XgJ1LeMN0fRu1";
|
|
||||||
String sha256 = string2SHA256(signStr) + appKey;
|
String sha256 = string2SHA256(signStr) + appKey;
|
||||||
// System.out.println(sign);
|
|
||||||
return Base64.getEncoder().encodeToString(string2SHA256(sha256).getBytes(StandardCharsets.UTF_8));
|
return Base64.getEncoder().encodeToString(string2SHA256(sha256).getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 压缩请求信息
|
||||||
|
* @param data 请求数据
|
||||||
|
* @return 压缩结果
|
||||||
|
*/
|
||||||
public static String builderBizContent(Map<String, Object> data) {
|
public static String builderBizContent(Map<String, Object> data) {
|
||||||
String jsonString = JSONUtil.toJsonStr(data);
|
String jsonString = JSONUtil.toJsonStr(data);
|
||||||
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码:" + jsonString);
|
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码:" + jsonString);
|
||||||
|
TreeMap<String,Object> treeMap = JSONUtil.parseObj(jsonString).toBean(TreeMap.class);
|
||||||
|
jsonString = JSONUtil.toJsonStr(treeMap);
|
||||||
String encode;
|
String encode;
|
||||||
// encode = URLEncoder.encode(jsonString, "UTF-8");
|
|
||||||
encode = URLUtil.encodeAll(jsonString, StandardCharsets.UTF_8);
|
encode = URLUtil.encodeAll(jsonString, StandardCharsets.UTF_8);
|
||||||
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码后URLEncoder编码:" + encode);
|
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码后URLEncoder编码:" + encode);
|
||||||
String s = Base64.getEncoder().encodeToString(encode.getBytes(StandardCharsets.UTF_8));
|
String s = cn.hutool.core.codec.Base64.encode(StrUtil.bytes(encode, StandardCharsets.UTF_8));
|
||||||
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码后URLEncoder编码后进行base64编码:" + s);
|
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码后URLEncoder编码后进行base64编码:" + s);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ import javax.ws.rs.core.Context;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.StreamingOutput;
|
import javax.ws.rs.core.StreamingOutput;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -82,6 +83,7 @@ public class FaDDContractController {
|
||||||
faDDService.signedCallBack(contractNo);
|
faDDService.signedCallBack(contractNo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
toolUtil.writeErrorLog(e.toString());
|
toolUtil.writeErrorLog(e.toString());
|
||||||
|
return JSON.toJSONString(result);
|
||||||
}
|
}
|
||||||
return JSON.toJSONString(result);
|
return JSON.toJSONString(result);
|
||||||
}
|
}
|
||||||
|
@ -172,11 +174,13 @@ public class FaDDContractController {
|
||||||
if (Util.null2String(ufContractInfoDTO.getContractNo()).split(",").length >= 2) {
|
if (Util.null2String(ufContractInfoDTO.getContractNo()).split(",").length >= 2) {
|
||||||
// 多文件
|
// 多文件
|
||||||
return Response.ok(contractZipStream, MediaType.APPLICATION_OCTET_STREAM).type("application/zip")
|
return Response.ok(contractZipStream, MediaType.APPLICATION_OCTET_STREAM).type("application/zip")
|
||||||
.header("Content-Disposition", "attachment;filename=" + requestTitle + ".zip").build();
|
.header("Content-Disposition", "attachment;filename=\"" +
|
||||||
|
new String(requestTitle.getBytes("GBK"), StandardCharsets.ISO_8859_1) + ".zip" + "\"").build();
|
||||||
} else {
|
} else {
|
||||||
// 单文件
|
// 单文件
|
||||||
return Response.ok(contractZipStream, MediaType.APPLICATION_OCTET_STREAM).type("application/pdf")
|
return Response.ok(contractZipStream, MediaType.APPLICATION_OCTET_STREAM).type("application/pdf")
|
||||||
.header("Content-Disposition", "attachment;filename=" + requestTitle).build();
|
.header("Content-Disposition", "attachment;filename=\"" +
|
||||||
|
new String(requestTitle.getBytes("GBK"), StandardCharsets.ISO_8859_1) + "\"").build();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
toolUtil.writeErrorLog("文件流转换失败," + e);
|
toolUtil.writeErrorLog("文件流转换失败," + e);
|
||||||
|
|
|
@ -1,11 +1,19 @@
|
||||||
package com.api.aiyh_pcn.fadada.web;
|
package com.api.aiyh_pcn.fadada.web;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import aiyh.utils.ApiResult;
|
||||||
import java.net.URLDecoder;
|
import aiyh.utils.Util;
|
||||||
import java.nio.charset.StandardCharsets;
|
import aiyh.utils.mapUtil.ParaMap;
|
||||||
import java.util.Base64;
|
import aiyh.utils.sqlUtil.sqlResult.impl.PrepSqlResultImpl;
|
||||||
import java.util.HashMap;
|
import aiyh.utils.zwl.common.ToolUtil;
|
||||||
import java.util.Map;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.api.aiyh_pcn.fadada.dao.FaDDServiceMapping;
|
||||||
|
import com.api.aiyh_pcn.fadada.service.impl.FaDDServiceImpl;
|
||||||
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
|
import org.h2.util.StringUtils;
|
||||||
|
import weaver.conn.RecordSet;
|
||||||
|
import weaver.hrm.HrmUserVarify;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
@ -14,23 +22,12 @@ import javax.ws.rs.core.Context;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.StreamingOutput;
|
import javax.ws.rs.core.StreamingOutput;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import org.h2.util.StringUtils;
|
import java.net.URLDecoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import com.alibaba.fastjson.JSON;
|
import java.util.Base64;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import java.util.HashMap;
|
||||||
import com.api.aiyh_pcn.fadada.dao.FaDDServiceMapping;
|
import java.util.Map;
|
||||||
import com.api.aiyh_pcn.fadada.service.impl.FaDDServiceImpl;
|
|
||||||
|
|
||||||
import aiyh.utils.ApiResult;
|
|
||||||
import aiyh.utils.Util;
|
|
||||||
import aiyh.utils.mapUtil.ParaMap;
|
|
||||||
import aiyh.utils.sqlUtil.sqlResult.impl.PrepSqlResultImpl;
|
|
||||||
import aiyh.utils.zwl.common.ToolUtil;
|
|
||||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
|
||||||
import weaver.conn.RecordSet;
|
|
||||||
import weaver.hrm.HrmUserVarify;
|
|
||||||
import weaver.hrm.User;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author EBU7-dev1-ayh
|
* @author EBU7-dev1-ayh
|
||||||
|
|
|
@ -17,7 +17,6 @@ import javax.ws.rs.*;
|
||||||
import javax.ws.rs.core.Context;
|
import javax.ws.rs.core.Context;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author EBU7-dev1-ayh
|
* @author EBU7-dev1-ayh
|
||||||
|
|
|
@ -2,7 +2,6 @@ package com.api.aiyh_pcn.patentWall.service;
|
||||||
|
|
||||||
import aiyh.utils.Util;
|
import aiyh.utils.Util;
|
||||||
import aiyh.utils.zwl.common.ToolUtil;
|
import aiyh.utils.zwl.common.ToolUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.api.aiyh_pcn.patentWall.dao.PatentWallMapping;
|
import com.api.aiyh_pcn.patentWall.dao.PatentWallMapping;
|
||||||
import com.api.aiyh_pcn.patentWall.dto.FilterWhere;
|
import com.api.aiyh_pcn.patentWall.dto.FilterWhere;
|
||||||
import com.api.aiyh_pcn.patentWall.vo.LinkUrlVO;
|
import com.api.aiyh_pcn.patentWall.vo.LinkUrlVO;
|
||||||
|
@ -244,7 +243,6 @@ public class PatentWallService {
|
||||||
rs.executeQuery(sqlStr, args);
|
rs.executeQuery(sqlStr, args);
|
||||||
rs.next();
|
rs.next();
|
||||||
parsing = parsing.replaceFirst(pattern, Util.null2String(rs.getString(1)));
|
parsing = parsing.replaceFirst(pattern, Util.null2String(rs.getString(1)));
|
||||||
;
|
|
||||||
}
|
}
|
||||||
return parsing;
|
return parsing;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,5 @@ public class PatentVO {
|
||||||
private String title;
|
private String title;
|
||||||
private String docId;
|
private String docId;
|
||||||
private String imageFileId;
|
private String imageFileId;
|
||||||
|
private String titleEn;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,6 @@ public class NewMeetingServiceProxy extends AbstractServiceProxy implements Meet
|
||||||
private final SimpleDateFormat simpleFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
|
private final SimpleDateFormat simpleFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm");
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@ServiceMethodDynamicProxy(desc = "创建会议,向全时会议中添加预约会议")
|
@ServiceMethodDynamicProxy(desc = "创建会议,向全时会议中添加预约会议")
|
||||||
public Map<String, Object> newMeeting(Map<String, Object> map) {
|
public Map<String, Object> newMeeting(Map<String, Object> map) {
|
||||||
|
|
||||||
|
@ -283,7 +282,6 @@ public class NewMeetingServiceProxy extends AbstractServiceProxy implements Meet
|
||||||
// throw new RuntimeException("全时会议添加失败!");
|
// throw new RuntimeException("全时会议添加失败!");
|
||||||
return result;*/
|
return result;*/
|
||||||
|
|
||||||
@Override
|
|
||||||
@ServiceMethodDynamicProxy(desc = "删除会议时, 需要判断是否需要对全时会议的会议进行取消预约")
|
@ServiceMethodDynamicProxy(desc = "删除会议时, 需要判断是否需要对全时会议的会议进行取消预约")
|
||||||
public Map<String, Object> deleteMeeting(Map<String, Object> map) {
|
public Map<String, Object> deleteMeeting(Map<String, Object> map) {
|
||||||
Map<String, Object> result = (Map<String, Object>) executeMethod(map);
|
Map<String, Object> result = (Map<String, Object>) executeMethod(map);
|
||||||
|
@ -325,17 +323,14 @@ public class NewMeetingServiceProxy extends AbstractServiceProxy implements Meet
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> editMeeting(Map<String, Object> map) {
|
public Map<String, Object> editMeeting(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> overMeeting(Map<String, Object> map) {
|
public Map<String, Object> overMeeting(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@ServiceMethodDynamicProxy(desc = "取消会议时,需要对全时会议的会议也进行同步取消")
|
@ServiceMethodDynamicProxy(desc = "取消会议时,需要对全时会议的会议也进行同步取消")
|
||||||
public Map<String, Object> cancelMeeting(Map<String, Object> map) {
|
public Map<String, Object> cancelMeeting(Map<String, Object> map) {
|
||||||
String meetingId = String.valueOf(map.get("meetingid"));
|
String meetingId = String.valueOf(map.get("meetingid"));
|
||||||
|
@ -377,147 +372,118 @@ public class NewMeetingServiceProxy extends AbstractServiceProxy implements Meet
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> chkMember(Map<String, Object> map) {
|
public Map<String, Object> chkMember(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> chkRoom(Map<String, Object> map) {
|
public Map<String, Object> chkRoom(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> chkservice(Map<String, Object> map) {
|
public Map<String, Object> chkservice(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> chkRoomAttribute(Map<String, Object> map) {
|
public Map<String, Object> chkRoomAttribute(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> chkWPMember(Map<String, Object> map) {
|
public Map<String, Object> chkWPMember(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> updateCkIsck(Map<String, Object> map) {
|
public Map<String, Object> updateCkIsck(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> chkMeeting(Map<String, Object> map) {
|
public Map<String, Object> chkMeeting(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> customMeetingChk(Map<String, Object> map) {
|
public Map<String, Object> customMeetingChk(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> changeMeeting(Map<String, Object> map) {
|
public Map<String, Object> changeMeeting(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> submitMeeting(Map<String, Object> map) {
|
public Map<String, Object> submitMeeting(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> afterMeetingNormal(Map<String, Object> map) {
|
public Map<String, Object> afterMeetingNormal(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> afterMeetingChange(Map<String, Object> map) {
|
public Map<String, Object> afterMeetingChange(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getUnReadCount(Map<String, Object> map) {
|
public Map<String, Object> getUnReadCount(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> doSubmit(Map<String, Object> map) {
|
public Map<String, Object> doSubmit(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> selRejectNode(Map<String, Object> map) {
|
public Map<String, Object> selRejectNode(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> doReject(Map<String, Object> map) {
|
public Map<String, Object> doReject(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getUserDefInfo(Map<String, Object> map) {
|
public Map<String, Object> getUserDefInfo(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getNowMeeting(Map<String, Object> map) {
|
public Map<String, Object> getNowMeeting(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getMoreMeeting(Map<String, Object> map) {
|
public Map<String, Object> getMoreMeeting(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getMeetingCornerMark(Map<String, Object> map) {
|
public Map<String, Object> getMeetingCornerMark(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getRequestParams(Map<String, Object> map) {
|
public Map<String, Object> getRequestParams(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> exportExcel(Map<String, Object> map) {
|
public Map<String, Object> exportExcel(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> chkRight(Map<String, Object> map) {
|
public Map<String, Object> chkRight(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> customChangeHrm(Map<String, Object> map) {
|
public Map<String, Object> customChangeHrm(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getMeetingTabElement(Map<String, Object> map) {
|
public Map<String, Object> getMeetingTabElement(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> chkRepeatMeeting(Map<String, Object> map) {
|
public Map<String, Object> chkRepeatMeeting(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> afterMeetingDelete(Map<String, Object> map) {
|
public Map<String, Object> afterMeetingDelete(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> meetingToGovern(Map<String, Object> map) {
|
public Map<String, Object> meetingToGovern(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> meetingDecisionToGovern(Map<String, Object> map) {
|
public Map<String, Object> meetingDecisionToGovern(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -527,17 +493,14 @@ public class NewMeetingServiceProxy extends AbstractServiceProxy implements Meet
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getMeetingSysWorkRecordList(Map<String, Object> map) {
|
public Map<String, Object> getMeetingSysWorkRecordList(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getDefalutByLevel(Map<String, Object> map) {
|
public Map<String, Object> getDefalutByLevel(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Map<String, Object> getMeetingBaseInfo(Map<String, Object> map) {
|
public Map<String, Object> getMeetingBaseInfo(Map<String, Object> map) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import weaver.aiyh_pcn.async_organization.model.Department;
|
||||||
import weaver.aiyh_pcn.async_organization.model.Employee;
|
import weaver.aiyh_pcn.async_organization.model.Employee;
|
||||||
import weaver.aiyh_pcn.async_organization.model.Position;
|
import weaver.aiyh_pcn.async_organization.model.Position;
|
||||||
import weaver.conn.RecordSet;
|
import weaver.conn.RecordSet;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -49,6 +50,7 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
writeErrorLog("error info:" + e.getMessage() + "\n");
|
writeErrorLog("error info:" + e.getMessage() + "\n");
|
||||||
successMark.put("code", "0");
|
successMark.put("code", "0");
|
||||||
successMark.put("msg", "查询分部信息出错,错误SQL:" + querySql);
|
successMark.put("msg", "查询分部信息出错,错误SQL:" + querySql);
|
||||||
|
return successMark;
|
||||||
}
|
}
|
||||||
if (rs.next()) {
|
if (rs.next()) {
|
||||||
subcompanyid1 = Util.getIntValue(rs.getString("subcompany"), 0);
|
subcompanyid1 = Util.getIntValue(rs.getString("subcompany"), 0);
|
||||||
|
@ -67,6 +69,7 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
writeErrorLog("error info:" + e.getMessage() + "\n");
|
writeErrorLog("error info:" + e.getMessage() + "\n");
|
||||||
successMark.put("code", "0");
|
successMark.put("code", "0");
|
||||||
successMark.put("msg", "查询分部信息出错,错误SQL:" + "select hrmdepartment error in 51 line,sql: select * from hrmdepartment where outkey = " + Util.null2String(String.valueOf(department.getPARENTDEPARTMENDID())));
|
successMark.put("msg", "查询分部信息出错,错误SQL:" + "select hrmdepartment error in 51 line,sql: select * from hrmdepartment where outkey = " + Util.null2String(String.valueOf(department.getPARENTDEPARTMENDID())));
|
||||||
|
return successMark;
|
||||||
}
|
}
|
||||||
rs.next();
|
rs.next();
|
||||||
// 将上级部门的分部id保存起来
|
// 将上级部门的分部id保存起来
|
||||||
|
@ -89,6 +92,7 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
writeErrorLog("error info:" + e.getMessage() + "\n");
|
writeErrorLog("error info:" + e.getMessage() + "\n");
|
||||||
successMark.put("code", "0");
|
successMark.put("code", "0");
|
||||||
successMark.put("msg", "查询分部信息出错,错误SQL:" + depSql);
|
successMark.put("msg", "查询分部信息出错,错误SQL:" + depSql);
|
||||||
|
return successMark;
|
||||||
}
|
}
|
||||||
int finalSubcompanyid = subcompanyid1;
|
int finalSubcompanyid = subcompanyid1;
|
||||||
if (rs.next()) {
|
if (rs.next()) {
|
||||||
|
@ -150,6 +154,7 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
writeErrorLog("error info:" + e.getMessage() + "\n");
|
writeErrorLog("error info:" + e.getMessage() + "\n");
|
||||||
successMark.put("code", "0");
|
successMark.put("code", "0");
|
||||||
successMark.put("msg", "查询分部信息出错,错误SQL:" + "select * from hrmdepartment where outkey = " + Util.null2String(String.valueOf(department.getDEPARTMENTID())));
|
successMark.put("msg", "查询分部信息出错,错误SQL:" + "select * from hrmdepartment where outkey = " + Util.null2String(String.valueOf(department.getDEPARTMENTID())));
|
||||||
|
return successMark;
|
||||||
}
|
}
|
||||||
rs.next();
|
rs.next();
|
||||||
departmentId = Util.getIntValue(Util.null2String(rs.getString("id")));
|
departmentId = Util.getIntValue(Util.null2String(rs.getString("id")));
|
||||||
|
@ -178,6 +183,7 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
writeErrorLog("error info:" + e.getMessage() + "\n");
|
writeErrorLog("error info:" + e.getMessage() + "\n");
|
||||||
successMark.put("code", "0");
|
successMark.put("code", "0");
|
||||||
successMark.put("msg", "查询职位错误,错误SQL:" + "select id from hrmjobtitles where outkey = " + Util.getIntValues(String.valueOf(position.getJOBCODEID())));
|
successMark.put("msg", "查询职位错误,错误SQL:" + "select id from hrmjobtitles where outkey = " + Util.getIntValues(String.valueOf(position.getJOBCODEID())));
|
||||||
|
return successMark;
|
||||||
}
|
}
|
||||||
// 判断该职位是否存在于系统中
|
// 判断该职位是否存在于系统中
|
||||||
if (rs.next()) {
|
if (rs.next()) {
|
||||||
|
@ -197,6 +203,7 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
writeErrorLog("error info:" + e.getMessage() + "\n");
|
writeErrorLog("error info:" + e.getMessage() + "\n");
|
||||||
successMark.put("code", "0");
|
successMark.put("code", "0");
|
||||||
successMark.put("msg", "更新职位失败,错误SQL:" + updateSqlStr);
|
successMark.put("msg", "更新职位失败,错误SQL:" + updateSqlStr);
|
||||||
|
return successMark;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -300,6 +307,7 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
writeErrorLog("error info:" + e.getMessage() + "\n");
|
writeErrorLog("error info:" + e.getMessage() + "\n");
|
||||||
successMark.put("code", "0");
|
successMark.put("code", "0");
|
||||||
successMark.put("msg", "查询出错,错误SQL:" + "select hrmresource error: " + query + Util.null2String(String.valueOf(employee.getUserID())));
|
successMark.put("msg", "查询出错,错误SQL:" + "select hrmresource error: " + query + Util.null2String(String.valueOf(employee.getUserID())));
|
||||||
|
return successMark;
|
||||||
}
|
}
|
||||||
if (rs.next()) {
|
if (rs.next()) {
|
||||||
// 存在人员信息,获取到人员id
|
// 存在人员信息,获取到人员id
|
||||||
|
@ -381,10 +389,7 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
if (managerId == 0) {
|
if (managerId == 0) {
|
||||||
managerId = hrmid;
|
managerId = hrmid;
|
||||||
}
|
}
|
||||||
// 拼接插入SQL
|
|
||||||
Map<String, StringBuilder> insertSysBuilderMap = this.builderSql(sysDep, 2);
|
|
||||||
StringBuilder sysInsertSqlField = insertSysBuilderMap.get("insertField");
|
|
||||||
StringBuilder sysInsertSqlValue = insertSysBuilderMap.get("insertValue");
|
|
||||||
// 加入默认值
|
// 加入默认值
|
||||||
String finalSeclevel = seclevel;
|
String finalSeclevel = seclevel;
|
||||||
Map<String, Object> map = new HashMap<String, Object>() {{
|
Map<String, Object> map = new HashMap<String, Object>() {{
|
||||||
|
@ -427,7 +432,9 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
// userCode不为null的人员
|
// userCode不为null的人员
|
||||||
if (!StringUtils.isNullOrEmpty(employee.getUSERCODE())) {
|
if (!StringUtils.isNullOrEmpty(employee.getUSERCODE())) {
|
||||||
// 登录名
|
// 登录名
|
||||||
|
if(!map.containsKey("loginid")){
|
||||||
map.put("loginid", employee.getUSERCODE());
|
map.put("loginid", employee.getUSERCODE());
|
||||||
|
}
|
||||||
// 密码
|
// 密码
|
||||||
map.put("password", EncryptHelper.encodeMd5(password).toUpperCase());
|
map.put("password", EncryptHelper.encodeMd5(password).toUpperCase());
|
||||||
} else {
|
} else {
|
||||||
|
@ -440,9 +447,17 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
map.put("managerid", managerId);
|
map.put("managerid", managerId);
|
||||||
// 创建时间
|
// 创建时间
|
||||||
map.put("created", this.getTime());
|
map.put("created", this.getTime());
|
||||||
|
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||||
|
sysDep.remove(entry.getKey());
|
||||||
|
}
|
||||||
|
// 拼接插入SQL
|
||||||
|
Map<String, StringBuilder> insertSysBuilderMap = this.builderSql(sysDep, 2);
|
||||||
|
StringBuilder sysInsertSqlField = insertSysBuilderMap.get("insertField");
|
||||||
|
StringBuilder sysInsertSqlValue = insertSysBuilderMap.get("insertValue");
|
||||||
// 拼接默认值SQL
|
// 拼接默认值SQL
|
||||||
this.addDefaultInsertSql(sysInsertSqlField, sysInsertSqlValue, map);
|
this.addDefaultInsertSql(sysInsertSqlField, sysInsertSqlValue, map);
|
||||||
// 插入数据
|
// 插入数据
|
||||||
|
writeErrorLog("人员数据:" + employee.toString());
|
||||||
this.executeInsertData(sysInsertSqlField, sysInsertSqlValue, "hrmresource");
|
this.executeInsertData(sysInsertSqlField, sysInsertSqlValue, "hrmresource");
|
||||||
try {
|
try {
|
||||||
if (departmentid == null || "".equals(departmentid)) {
|
if (departmentid == null || "".equals(departmentid)) {
|
||||||
|
@ -564,7 +579,8 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
}*/
|
}*/
|
||||||
while (cmsSupId >= 0) {
|
while (cmsSupId >= 0) {
|
||||||
// 表示该职位拥有上级职位,需要查询上级职位对应的人员
|
// 表示该职位拥有上级职位,需要查询上级职位对应的人员
|
||||||
String queryManagerId = "select h.id,h.managerstr from hrmresource as h join hrmjobtitles as j on h.jobtitle = j.id where j.outkey = ?";
|
// 新增 2022 04 22 根据日期排序
|
||||||
|
String queryManagerId = "select h.id,h.managerstr from hrmresource as h join hrmjobtitles as j on h.jobtitle = j.id where j.outkey = ? and h.status in (0,1,2) ORDER BY h.id DESC";
|
||||||
try {
|
try {
|
||||||
rs.executeQuery(queryManagerId, Util.null2String(String.valueOf(cmsSupId)));
|
rs.executeQuery(queryManagerId, Util.null2String(String.valueOf(cmsSupId)));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -618,8 +634,8 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
writeErrorLog("insert " + table + " error: " + insertSysSql);
|
writeErrorLog("insert " + table + " error: " + insertSysSql);
|
||||||
writeErrorLog("error info:" + e.getMessage() + "\n");
|
writeErrorLog("error info:" + e.getMessage() + "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
writeWarningLog("不满足条件: " + insertFieldBuilder + ", " + insertValueBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -878,10 +894,10 @@ public class SyncOrganizationUtils extends ToolUtil {
|
||||||
}
|
}
|
||||||
// 如果属于系统字段
|
// 如果属于系统字段
|
||||||
if ("0".equals(oaFieldType)) {
|
if ("0".equals(oaFieldType)) {
|
||||||
sysDep.put(Util.null2String(rs.getString("ao_field").replace(apiFieldType + oaFieldType, "")), apiField);
|
sysDep.put(Util.null2String(rs.getString("ao_field").replace(apiFieldType + oaFieldType, "")).toLowerCase(), apiField);
|
||||||
} else {
|
} else {
|
||||||
// 属于自定义字段
|
// 属于自定义字段
|
||||||
defDep.put(Util.null2String(rs.getString("ao_field").replace(apiFieldType + oaFieldType, "")), apiField);
|
defDep.put(Util.null2String(rs.getString("ao_field").replace(apiFieldType + oaFieldType, "")).toLowerCase(), apiField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
configResults.put("sys", sysDep);
|
configResults.put("sys", sysDep);
|
||||||
|
|
|
@ -53,13 +53,13 @@ public class CopyAttachmentAction extends ToolUtil implements Action {
|
||||||
String overrideValue = String.valueOf(requestMap.get(overrideField));
|
String overrideValue = String.valueOf(requestMap.get(overrideField));
|
||||||
this.writeDebuggerLog(requestMap.toString());
|
this.writeDebuggerLog(requestMap.toString());
|
||||||
// 查询这些文件的相关信息
|
// 查询这些文件的相关信息
|
||||||
query = "select docid,imagefilename from docimagefile where docid in (" + attachmentValue + ")";
|
query = "select distinct docid,imagefilename from docimagefile where docid in (" + attachmentValue + ")";
|
||||||
this.writeDebuggerLog(query);
|
this.writeDebuggerLog("查询附件信息说sql:" + query);
|
||||||
rs.executeQuery(query);
|
rs.executeQuery(query);
|
||||||
List<AttachmentIdName> attachmentList = Util.recordeSet2Array(rs, AttachmentIdName.class);
|
List<AttachmentIdName> attachmentList = Util.recordeSet2Array(rs, AttachmentIdName.class);
|
||||||
query = "select docid,imagefilename from docimagefile where docid in (" + overrideValue + ")";
|
query = "select distinct docid,imagefilename from docimagefile where docid in (" + overrideValue + ")";
|
||||||
rs.executeQuery(query);
|
rs.executeQuery(query);
|
||||||
this.writeDebuggerLog(query);
|
this.writeDebuggerLog("查询覆盖文件信息:" + query);
|
||||||
List<AttachmentIdName> overrideList = Util.recordeSet2Array(rs, AttachmentIdName.class);
|
List<AttachmentIdName> overrideList = Util.recordeSet2Array(rs, AttachmentIdName.class);
|
||||||
this.writeDebuggerLog(attachmentList.toString());
|
this.writeDebuggerLog(attachmentList.toString());
|
||||||
this.writeDebuggerLog(overrideList.toString());
|
this.writeDebuggerLog(overrideList.toString());
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package weaver.aiyh_pcn.fadada.entity;
|
package weaver.aiyh_pcn.fadada.entity;
|
||||||
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
package weaver.aiyh_quanshi;
|
package weaver.aiyh_quanshi;
|
||||||
|
|
||||||
import weaver.aiyh_quanshi.entity.QsAccount;
|
|
||||||
import weaver.aiyh_quanshi.entity.QsConfParty;
|
import weaver.aiyh_quanshi.entity.QsConfParty;
|
||||||
import weaver.aiyh_quanshi.entity.QsResponse;
|
import weaver.aiyh_quanshi.entity.QsResponse;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
|
@ -8,10 +8,10 @@ aiyh.patentWall.voMapping.activeIcon=patent_active.png
|
||||||
aiyh.patentWall.voMapping.title=#sql{select imagefilename from docimagefile where docid = #{zlzs} }
|
aiyh.patentWall.voMapping.title=#sql{select imagefilename from docimagefile where docid = #{zlzs} }
|
||||||
# labelName labelIndex linkUrl
|
# labelName labelIndex linkUrl
|
||||||
aiyh.patentWall.voMapping.linkList[0].labelName=\u67E5\u770B\u6587\u6863
|
aiyh.patentWall.voMapping.linkList[0].labelName=\u67E5\u770B\u6587\u6863
|
||||||
aiyh.patentWall.voMapping.linkList[0].labelIndex=-199
|
aiyh.patentWall.voMapping.linkList[0].labelIndex=-93792
|
||||||
aiyh.patentWall.voMapping.linkList[0].linkUrl=/spa/document/index.jsp?id=${zlzs}
|
aiyh.patentWall.voMapping.linkList[0].linkUrl=/spa/document/index.jsp?id=${zlzs}
|
||||||
aiyh.patentWall.voMapping.linkList[1].labelName=\u8DF3\u8F6C\u6D41\u7A0B
|
aiyh.patentWall.voMapping.linkList[1].labelName=\u8DF3\u8F6C\u6D41\u7A0B
|
||||||
aiyh.patentWall.voMapping.linkList[1].labelIndex=-199
|
aiyh.patentWall.voMapping.linkList[1].labelIndex=-93793
|
||||||
aiyh.patentWall.voMapping.linkList[1].linkUrl=/spa/document/index.jsp?id=${zlzs}
|
aiyh.patentWall.voMapping.linkList[1].linkUrl=/spa/document/index.jsp?id=${zlzs}
|
||||||
#aiyh.patentWall.voMapping.linkUrl=/spa/document/index.jsp?id=${zlzs}
|
#aiyh.patentWall.voMapping.linkUrl=/spa/document/index.jsp?id=${zlzs}
|
||||||
aiyh.patentWall.voMapping.docId=${zlzs}
|
aiyh.patentWall.voMapping.docId=${zlzs}
|
||||||
|
@ -28,28 +28,28 @@ aiyh.patentWall.search.dataResource=uf_zlqzsb
|
||||||
aiyh.patentWall.search.inputs[0].type=2
|
aiyh.patentWall.search.inputs[0].type=2
|
||||||
aiyh.patentWall.search.inputs[0].dbFieldName=zlqr
|
aiyh.patentWall.search.inputs[0].dbFieldName=zlqr
|
||||||
aiyh.patentWall.search.inputs[0].labelName=\u4E13\u5229\u6743\u4EBA
|
aiyh.patentWall.search.inputs[0].labelName=\u4E13\u5229\u6743\u4EBA
|
||||||
aiyh.patentWall.search.inputs[0].labelIndex=-1023
|
aiyh.patentWall.search.inputs[0].labelIndex=-95588
|
||||||
aiyh.patentWall.search.inputs[0].searchType=1
|
aiyh.patentWall.search.inputs[0].searchType=1
|
||||||
aiyh.patentWall.search.inputs[0].value=
|
aiyh.patentWall.search.inputs[0].value=
|
||||||
|
|
||||||
aiyh.patentWall.search.inputs[1].type=2
|
aiyh.patentWall.search.inputs[1].type=2
|
||||||
aiyh.patentWall.search.inputs[1].dbFieldName=fmrsjr
|
aiyh.patentWall.search.inputs[1].dbFieldName=fmrsjr
|
||||||
aiyh.patentWall.search.inputs[1].labelName=\u53D1\u660E\u4EBA/\u8BBE\u8BA1\u4EBA
|
aiyh.patentWall.search.inputs[1].labelName=\u53D1\u660E\u4EBA/\u8BBE\u8BA1\u4EBA
|
||||||
aiyh.patentWall.search.inputs[1].labelIndex=-1023
|
aiyh.patentWall.search.inputs[1].labelIndex=-95589
|
||||||
aiyh.patentWall.search.inputs[1].searchType=1
|
aiyh.patentWall.search.inputs[1].searchType=1
|
||||||
aiyh.patentWall.search.inputs[1].value=
|
aiyh.patentWall.search.inputs[1].value=
|
||||||
|
|
||||||
aiyh.patentWall.search.inputs[2].type=2
|
aiyh.patentWall.search.inputs[2].type=2
|
||||||
aiyh.patentWall.search.inputs[2].dbFieldName=zlcpmc
|
aiyh.patentWall.search.inputs[2].dbFieldName=zlcpmc
|
||||||
aiyh.patentWall.search.inputs[2].labelName=\u4E13\u5229\u4EA7\u54C1\u540D\u79F0
|
aiyh.patentWall.search.inputs[2].labelName=\u4E13\u5229\u4EA7\u54C1\u540D\u79F0
|
||||||
aiyh.patentWall.search.inputs[2].labelIndex=-1023
|
aiyh.patentWall.search.inputs[2].labelIndex=-95590
|
||||||
aiyh.patentWall.search.inputs[2].searchType=1
|
aiyh.patentWall.search.inputs[2].searchType=1
|
||||||
aiyh.patentWall.search.inputs[2].value=
|
aiyh.patentWall.search.inputs[2].value=
|
||||||
|
|
||||||
aiyh.patentWall.search.inputs[3].type=1
|
aiyh.patentWall.search.inputs[3].type=1
|
||||||
aiyh.patentWall.search.inputs[3].dbFieldName=zllx
|
aiyh.patentWall.search.inputs[3].dbFieldName=zllx
|
||||||
aiyh.patentWall.search.inputs[3].labelName=\u4E13\u5229\u7C7B\u578B
|
aiyh.patentWall.search.inputs[3].labelName=\u4E13\u5229\u7C7B\u578B
|
||||||
aiyh.patentWall.search.inputs[3].labelIndex=-1023
|
aiyh.patentWall.search.inputs[3].labelIndex=-95591
|
||||||
aiyh.patentWall.search.inputs[3].searchType=1
|
aiyh.patentWall.search.inputs[3].searchType=1
|
||||||
aiyh.patentWall.search.inputs[3].multiple=true
|
aiyh.patentWall.search.inputs[3].multiple=true
|
||||||
aiyh.patentWall.search.inputs[3].value=
|
aiyh.patentWall.search.inputs[3].value=
|
||||||
|
@ -57,21 +57,21 @@ aiyh.patentWall.search.inputs[3].value=
|
||||||
aiyh.patentWall.search.inputs[4].type=3
|
aiyh.patentWall.search.inputs[4].type=3
|
||||||
aiyh.patentWall.search.inputs[4].dbFieldName=zlsqrq
|
aiyh.patentWall.search.inputs[4].dbFieldName=zlsqrq
|
||||||
aiyh.patentWall.search.inputs[4].labelName=\u4E13\u5229\u7533\u8BF7\u65E5\u671F
|
aiyh.patentWall.search.inputs[4].labelName=\u4E13\u5229\u7533\u8BF7\u65E5\u671F
|
||||||
aiyh.patentWall.search.inputs[4].labelIndex=-1023
|
aiyh.patentWall.search.inputs[4].labelIndex=-95592
|
||||||
aiyh.patentWall.search.inputs[4].searchType=1
|
aiyh.patentWall.search.inputs[4].searchType=1
|
||||||
aiyh.patentWall.search.inputs[4].value=
|
aiyh.patentWall.search.inputs[4].value=
|
||||||
|
|
||||||
aiyh.patentWall.search.inputs[5].type=1
|
aiyh.patentWall.search.inputs[5].type=1
|
||||||
aiyh.patentWall.search.inputs[5].dbFieldName=zlzt
|
aiyh.patentWall.search.inputs[5].dbFieldName=zlzt
|
||||||
aiyh.patentWall.search.inputs[5].labelName=\u4E13\u5229\u72B6\u6001
|
aiyh.patentWall.search.inputs[5].labelName=\u4E13\u5229\u72B6\u6001
|
||||||
aiyh.patentWall.search.inputs[5].labelIndex=-1023
|
aiyh.patentWall.search.inputs[5].labelIndex=-95593
|
||||||
aiyh.patentWall.search.inputs[5].searchType=1
|
aiyh.patentWall.search.inputs[5].searchType=1
|
||||||
aiyh.patentWall.search.inputs[5].value=
|
aiyh.patentWall.search.inputs[5].value=
|
||||||
|
|
||||||
aiyh.patentWall.search.inputs[6].type=1
|
aiyh.patentWall.search.inputs[6].type=1
|
||||||
aiyh.patentWall.search.inputs[6].dbFieldName=sqlx
|
aiyh.patentWall.search.inputs[6].dbFieldName=sqlx
|
||||||
aiyh.patentWall.search.inputs[6].labelName=\u6388\u6743\u7C7B\u578B
|
aiyh.patentWall.search.inputs[6].labelName=\u6388\u6743\u7C7B\u578B
|
||||||
aiyh.patentWall.search.inputs[6].labelIndex=-1023
|
aiyh.patentWall.search.inputs[6].labelIndex=-95594
|
||||||
aiyh.patentWall.search.inputs[6].searchType=1
|
aiyh.patentWall.search.inputs[6].searchType=1
|
||||||
aiyh.patentWall.search.inputs[6].value=
|
aiyh.patentWall.search.inputs[6].value=
|
||||||
|
|
||||||
|
@ -85,10 +85,10 @@ aiyh.copyrightWall.voMapping.activeIcon=patent_active.png
|
||||||
aiyh.copyrightWall.voMapping.title=#sql{select imagefilename from docimagefile where docid = #{zlzs} }
|
aiyh.copyrightWall.voMapping.title=#sql{select imagefilename from docimagefile where docid = #{zlzs} }
|
||||||
# labelName labelIndex linkUrl
|
# labelName labelIndex linkUrl
|
||||||
aiyh.copyrightWall.voMapping.linkList[0].labelName=\u67E5\u770B\u6587\u6863
|
aiyh.copyrightWall.voMapping.linkList[0].labelName=\u67E5\u770B\u6587\u6863
|
||||||
aiyh.copyrightWall.voMapping.linkList[0].labelIndex=-199
|
aiyh.copyrightWall.voMapping.linkList[0].labelIndex=-93802
|
||||||
aiyh.copyrightWall.voMapping.linkList[0].linkUrl=/spa/document/index.jsp?id=${zlzs}
|
aiyh.copyrightWall.voMapping.linkList[0].linkUrl=/spa/document/index.jsp?id=${zlzs}
|
||||||
aiyh.copyrightWall.voMapping.linkList[1].labelName=\u8DF3\u8F6C\u6D41\u7A0B
|
aiyh.copyrightWall.voMapping.linkList[1].labelName=\u8DF3\u8F6C\u6D41\u7A0B
|
||||||
aiyh.copyrightWall.voMapping.linkList[1].labelIndex=-199
|
aiyh.copyrightWall.voMapping.linkList[1].labelIndex=-93803
|
||||||
aiyh.copyrightWall.voMapping.linkList[1].linkUrl=/spa/document/index.jsp?id=${zlzs}
|
aiyh.copyrightWall.voMapping.linkList[1].linkUrl=/spa/document/index.jsp?id=${zlzs}
|
||||||
#aiyh.copyrightWall.voMapping.linkUrl=/spa/document/index.jsp?id=${zlzs}
|
#aiyh.copyrightWall.voMapping.linkUrl=/spa/document/index.jsp?id=${zlzs}
|
||||||
aiyh.copyrightWall.voMapping.docId=${zlzs}
|
aiyh.copyrightWall.voMapping.docId=${zlzs}
|
||||||
|
@ -101,28 +101,28 @@ aiyh.copyrightWall.search.dataResource=uf_zlqzsb
|
||||||
aiyh.copyrightWall.search.inputs[0].type=2
|
aiyh.copyrightWall.search.inputs[0].type=2
|
||||||
aiyh.copyrightWall.search.inputs[0].dbFieldName=zlqr
|
aiyh.copyrightWall.search.inputs[0].dbFieldName=zlqr
|
||||||
aiyh.copyrightWall.search.inputs[0].labelName=\u4E13\u5229\u6743\u4EBA
|
aiyh.copyrightWall.search.inputs[0].labelName=\u4E13\u5229\u6743\u4EBA
|
||||||
aiyh.copyrightWall.search.inputs[0].labelIndex=-1023
|
aiyh.copyrightWall.search.inputs[0].labelIndex=-95595
|
||||||
aiyh.copyrightWall.search.inputs[0].searchType=1
|
aiyh.copyrightWall.search.inputs[0].searchType=1
|
||||||
aiyh.copyrightWall.search.inputs[0].value=
|
aiyh.copyrightWall.search.inputs[0].value=
|
||||||
|
|
||||||
aiyh.copyrightWall.search.inputs[1].type=2
|
aiyh.copyrightWall.search.inputs[1].type=2
|
||||||
aiyh.copyrightWall.search.inputs[1].dbFieldName=fmrsjr
|
aiyh.copyrightWall.search.inputs[1].dbFieldName=fmrsjr
|
||||||
aiyh.copyrightWall.search.inputs[1].labelName=\u53D1\u660E\u4EBA/\u8BBE\u8BA1\u4EBA
|
aiyh.copyrightWall.search.inputs[1].labelName=\u53D1\u660E\u4EBA/\u8BBE\u8BA1\u4EBA
|
||||||
aiyh.copyrightWall.search.inputs[1].labelIndex=-1023
|
aiyh.copyrightWall.search.inputs[1].labelIndex=-95598
|
||||||
aiyh.copyrightWall.search.inputs[1].searchType=1
|
aiyh.copyrightWall.search.inputs[1].searchType=1
|
||||||
aiyh.copyrightWall.search.inputs[1].value=
|
aiyh.copyrightWall.search.inputs[1].value=
|
||||||
|
|
||||||
aiyh.copyrightWall.search.inputs[2].type=2
|
aiyh.copyrightWall.search.inputs[2].type=2
|
||||||
aiyh.copyrightWall.search.inputs[2].dbFieldName=zlcpmc
|
aiyh.copyrightWall.search.inputs[2].dbFieldName=zlcpmc
|
||||||
aiyh.copyrightWall.search.inputs[2].labelName=\u4E13\u5229\u4EA7\u54C1\u540D\u79F0
|
aiyh.copyrightWall.search.inputs[2].labelName=\u4E13\u5229\u4EA7\u54C1\u540D\u79F0
|
||||||
aiyh.copyrightWall.search.inputs[2].labelIndex=-1023
|
aiyh.copyrightWall.search.inputs[2].labelIndex=-95597
|
||||||
aiyh.copyrightWall.search.inputs[2].searchType=1
|
aiyh.copyrightWall.search.inputs[2].searchType=1
|
||||||
aiyh.copyrightWall.search.inputs[2].value=
|
aiyh.copyrightWall.search.inputs[2].value=
|
||||||
|
|
||||||
aiyh.copyrightWall.search.inputs[3].type=1
|
aiyh.copyrightWall.search.inputs[3].type=1
|
||||||
aiyh.copyrightWall.search.inputs[3].dbFieldName=zllx
|
aiyh.copyrightWall.search.inputs[3].dbFieldName=zllx
|
||||||
aiyh.copyrightWall.search.inputs[3].labelName=\u4E13\u5229\u7C7B\u578B
|
aiyh.copyrightWall.search.inputs[3].labelName=\u4E13\u5229\u7C7B\u578B
|
||||||
aiyh.copyrightWall.search.inputs[3].labelIndex=-1023
|
aiyh.copyrightWall.search.inputs[3].labelIndex=-95599
|
||||||
aiyh.copyrightWall.search.inputs[3].searchType=1
|
aiyh.copyrightWall.search.inputs[3].searchType=1
|
||||||
aiyh.copyrightWall.search.inputs[3].multiple=true
|
aiyh.copyrightWall.search.inputs[3].multiple=true
|
||||||
aiyh.copyrightWall.search.inputs[3].value=
|
aiyh.copyrightWall.search.inputs[3].value=
|
||||||
|
@ -130,20 +130,20 @@ aiyh.copyrightWall.search.inputs[3].value=
|
||||||
aiyh.copyrightWall.search.inputs[4].type=3
|
aiyh.copyrightWall.search.inputs[4].type=3
|
||||||
aiyh.copyrightWall.search.inputs[4].dbFieldName=zlsqrq
|
aiyh.copyrightWall.search.inputs[4].dbFieldName=zlsqrq
|
||||||
aiyh.copyrightWall.search.inputs[4].labelName=\u4E13\u5229\u7533\u8BF7\u65E5\u671F
|
aiyh.copyrightWall.search.inputs[4].labelName=\u4E13\u5229\u7533\u8BF7\u65E5\u671F
|
||||||
aiyh.copyrightWall.search.inputs[4].labelIndex=-1023
|
aiyh.copyrightWall.search.inputs[4].labelIndex=-95600
|
||||||
aiyh.copyrightWall.search.inputs[4].searchType=1
|
aiyh.copyrightWall.search.inputs[4].searchType=1
|
||||||
aiyh.copyrightWall.search.inputs[4].value=
|
aiyh.copyrightWall.search.inputs[4].value=
|
||||||
|
|
||||||
aiyh.copyrightWall.search.inputs[5].type=1
|
aiyh.copyrightWall.search.inputs[5].type=1
|
||||||
aiyh.copyrightWall.search.inputs[5].dbFieldName=zlzt
|
aiyh.copyrightWall.search.inputs[5].dbFieldName=zlzt
|
||||||
aiyh.copyrightWall.search.inputs[5].labelName=\u4E13\u5229\u72B6\u6001
|
aiyh.copyrightWall.search.inputs[5].labelName=\u4E13\u5229\u72B6\u6001
|
||||||
aiyh.copyrightWall.search.inputs[5].labelIndex=-1023
|
aiyh.copyrightWall.search.inputs[5].labelIndex=-95601
|
||||||
aiyh.copyrightWall.search.inputs[5].searchType=1
|
aiyh.copyrightWall.search.inputs[5].searchType=1
|
||||||
aiyh.copyrightWall.search.inputs[5].value=
|
aiyh.copyrightWall.search.inputs[5].value=
|
||||||
|
|
||||||
aiyh.copyrightWall.search.inputs[6].type=1
|
aiyh.copyrightWall.search.inputs[6].type=1
|
||||||
aiyh.copyrightWall.search.inputs[6].dbFieldName=sqlx
|
aiyh.copyrightWall.search.inputs[6].dbFieldName=sqlx
|
||||||
aiyh.copyrightWall.search.inputs[6].labelName=\u6388\u6743\u7C7B\u578B
|
aiyh.copyrightWall.search.inputs[6].labelName=\u6388\u6743\u7C7B\u578B
|
||||||
aiyh.copyrightWall.search.inputs[6].labelIndex=-1023
|
aiyh.copyrightWall.search.inputs[6].labelIndex=-95594
|
||||||
aiyh.copyrightWall.search.inputs[6].searchType=1
|
aiyh.copyrightWall.search.inputs[6].searchType=1
|
||||||
aiyh.copyrightWall.search.inputs[6].value=
|
aiyh.copyrightWall.search.inputs[6].value=
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
# \u5047\u671F\u7C7B\u578B\u6620\u5C04\u5173\u7CFB
|
||||||
|
# its\u5E74\u5047\u6620\u5C04OA\u5176\u4ED6
|
||||||
|
holidaySync.its_type.1=9
|
||||||
|
# its\u8C03\u4F11\u6620\u5C04OA\u8C03\u4F11\u5047
|
||||||
|
holidaySync.its_type.2=10
|
||||||
|
|
||||||
|
|
||||||
|
# \u5047\u671F\u4F7F\u7528\u989D
|
||||||
|
holidaySync.its_oa_holiday_viw.used_amount=usedamount
|
||||||
|
holidaySync.its_oa_holiday_viw.total_amount=baseAmount
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
# \u6388\u6743\u7801
|
||||||
|
aiyh.client.clientId=100001
|
||||||
|
aiyh.client.clientSecret=1099af237ed347b19a992a5e46520241
|
||||||
|
|
||||||
|
# \u6620\u5C04\u89C4\u5219
|
||||||
|
aiyh.sqlMapper.ee_no=#{loginid}
|
||||||
|
aiyh.sqlMapper.org_code=ford
|
|
@ -0,0 +1,25 @@
|
||||||
|
# ${id}\u8868\u793A\u8BFB\u53D6\u6570\u636E\u5E93\u4E2D\u7684id\uFF0C\u4E0D\u5BF9\u7ED3\u679C\u8F6C\u4E49\uFF0C#{id}\u8868\u793A\u8BFB\u53D6\u6570\u636E\u5E93\u4E2D\u7684id\uFF0C\u5E76\u5C06\u7ED3\u679C\u8FDB\u884C\u8F6C\u4E49\u4F7F\u7528?\u4EE3\u66FF\u540E\u62FC\u63A5\u5230sql\u5B57\u7B26\u4E32\u4E2D
|
||||||
|
# #sql{select xx from xxx } \u8868\u793A\u67E5\u8BE2SQL\uFF0C\u5C06\u7ED3\u679C\u7684\u7B2C\u4E00\u4E2A\u5B57\u6BB5\u5F53\u505A\u503C
|
||||||
|
# \u67E5\u8BE2\u7ED3\u679C\u914D\u7F6E
|
||||||
|
aiyh.sourceWall.voMapping.dataResource=uf_zfzy
|
||||||
|
# \u6DFB\u52A0\u8D44\u6E90\u6309\u94AE\u94FE\u63A5
|
||||||
|
aiyh.sourceWall.voMapping.addSourceUrl=http://www.baidu.com
|
||||||
|
aiyh.sourceWall.voMapping.addSourceLabelIndex=-1000
|
||||||
|
aiyh.sourceWall.voMapping.addSourceLabelName=\u6DFB\u52A0\u8D44\u6E90
|
||||||
|
# \u6570\u636EID
|
||||||
|
aiyh.sourceWall.voMapping.id=${id}
|
||||||
|
# \u56FA\u5B9A\u503C\u56FE\u7247\u540D\u79F0ecode\u56FE\u7247\u540D\u79F0
|
||||||
|
aiyh.sourceWall.voMapping.icon=patent.png
|
||||||
|
aiyh.sourceWall.voMapping.activeIcon=patent_active.png
|
||||||
|
# \u4E0B\u811A\u663E\u793A\u7684\u6807\u9898
|
||||||
|
aiyh.sourceWall.voMapping.title=${mc}
|
||||||
|
aiyh.sourceWall.voMapping.titleEn=${mc}
|
||||||
|
# labelName labelIndex linkUrl
|
||||||
|
aiyh.sourceWall.voMapping.linkList[0].labelName=\u67E5\u770B\u6587\u6863
|
||||||
|
aiyh.sourceWall.voMapping.linkList[0].labelIndex=-93792
|
||||||
|
aiyh.sourceWall.voMapping.linkList[0].linkUrl=/spa/document/index.jsp?id=${id}
|
||||||
|
aiyh.sourceWall.voMapping.linkList[1].labelName=\u8DF3\u8F6C\u6D41\u7A0B
|
||||||
|
aiyh.sourceWall.voMapping.linkList[1].labelIndex=-93793
|
||||||
|
aiyh.sourceWall.voMapping.linkList[1].linkUrl=/spa/document/index.jsp?id=${id}
|
||||||
|
aiyh.sourceWall.voMapping.docId=0
|
||||||
|
aiyh.sourceWall.voMapping.imageFileId=0
|
|
@ -2,3 +2,5 @@ aiyh.htmlLabel.porsche.FaDDContractController.pushErr.labelIndex=-1
|
||||||
aiyh.htmlLabel.porsche.FaDDContractController.pushErr.defaultStr=\u90AE\u4EF6\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01
|
aiyh.htmlLabel.porsche.FaDDContractController.pushErr.defaultStr=\u90AE\u4EF6\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\uFF01
|
||||||
aiyh.htmlLabel.porsche.FaDDContractController.pushSuccess.labelIndex=-1
|
aiyh.htmlLabel.porsche.FaDDContractController.pushSuccess.labelIndex=-1
|
||||||
aiyh.htmlLabel.porsche.FaDDContractController.pushSuccess.defaultStr=\u7B7E\u7F72\u90AE\u4EF6\u53D1\u9001\u6210\u529F\uFF01
|
aiyh.htmlLabel.porsche.FaDDContractController.pushSuccess.defaultStr=\u7B7E\u7F72\u90AE\u4EF6\u53D1\u9001\u6210\u529F\uFF01
|
||||||
|
attachment_sort.AnnexSortAction.sortErr.labelIndex=-1
|
||||||
|
attachment_sort.AnnexSortAction.sortErr.defaultStr=\u6587\u4EF6\u6392\u5E8F\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7CFB\u7EDF\u7BA1\u7406\u5458\uFF01
|
|
@ -15,10 +15,28 @@
|
||||||
#LOG_FORMAT = yyyy.MM.dd'-'hh:mm:ss
|
#LOG_FORMAT = yyyy.MM.dd'-'hh:mm:ss
|
||||||
#DEBUG_MODE = false
|
#DEBUG_MODE = false
|
||||||
|
|
||||||
|
#DriverClasses = com.mysql.cj.jdbc.Driver
|
||||||
|
#ecology.url = jdbc:mysql://112.124.13.227:3306/ecology?characterEncoding=utf8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai
|
||||||
|
#ecology.user = root
|
||||||
|
#ecology.password = ygy516160
|
||||||
|
#ecology.charset = ISO
|
||||||
|
#ecology.maxconn = 300
|
||||||
|
#ecology.minconn = 50
|
||||||
|
#ecology.maxusecount = 6000
|
||||||
|
#ecology.maxidletime = 600
|
||||||
|
#ecology.maxalivetime = 10
|
||||||
|
#ecology.checktime = 3600
|
||||||
|
#
|
||||||
|
#ecology.isgoveproj = 0
|
||||||
|
#LOG_FORMAT = yyyy.MM.dd'-'hh:mm:ss
|
||||||
|
#DEBUG_MODE = false
|
||||||
|
|
||||||
|
|
||||||
DriverClasses = com.mysql.cj.jdbc.Driver
|
DriverClasses = com.mysql.cj.jdbc.Driver
|
||||||
|
|
||||||
ecology.url = jdbc:mysql://112.124.13.227:3306/ecology_dev?characterEncoding=utf8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai
|
ecology.url = jdbc:mysql://112.124.13.227:3306/ecology_dev?characterEncoding=utf8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai
|
||||||
ecology.user = root
|
ecology.user = root
|
||||||
ecology.password = ygy516160
|
ecology.password = RJGC182ban@ygy
|
||||||
ecology.charset = ISO
|
ecology.charset = ISO
|
||||||
ecology.maxconn = 300
|
ecology.maxconn = 300
|
||||||
ecology.minconn = 50
|
ecology.minconn = 50
|
||||||
|
@ -30,3 +48,20 @@ ecology.checktime = 3600
|
||||||
ecology.isgoveproj = 0
|
ecology.isgoveproj = 0
|
||||||
LOG_FORMAT = yyyy.MM.dd'-'hh:mm:ss
|
LOG_FORMAT = yyyy.MM.dd'-'hh:mm:ss
|
||||||
DEBUG_MODE = false
|
DEBUG_MODE = false
|
||||||
|
#
|
||||||
|
#DriverClasses = com.mysql.cj.jdbc.Driver
|
||||||
|
#
|
||||||
|
#ecology.url = jdbc:mysql://192.168.3.35:3306/ecology?characterEncoding=utf8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai
|
||||||
|
#ecology.user = ecology
|
||||||
|
#ecology.password = ecology
|
||||||
|
#ecology.charset = ISO
|
||||||
|
#ecology.maxconn = 300
|
||||||
|
#ecology.minconn = 50
|
||||||
|
#ecology.maxusecount = 6000
|
||||||
|
#ecology.maxidletime = 600
|
||||||
|
#ecology.maxalivetime = 10
|
||||||
|
#ecology.checktime = 3600
|
||||||
|
#
|
||||||
|
#ecology.isgoveproj = 0
|
||||||
|
#LOG_FORMAT = yyyy.MM.dd'-'hh:mm:ss
|
||||||
|
#DEBUG_MODE = false
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||||
<beans>
|
<beans>
|
||||||
<bean class="weaver.schedule.aiyh_calculate_overtime.entity.WorkdayInfo" id="workdayInfo">
|
<bean class="weaver.schedule.aiyh_bao_shan.entity.WorkdayInfo" id="workdayInfo">
|
||||||
<property name="relateWeekday" value="10"/>
|
<property name="relateWeekday" value="10"/>
|
||||||
<property name="workday" value="false"/>
|
<property name="workday" value="false"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue