保时捷政府资源墙

dev
it_xiaoxiong 2022-05-23 15:50:40 +08:00
parent 138947dc15
commit be949e910e
132 changed files with 234030 additions and 2495 deletions

View File

BIN
src/.DS_Store vendored Normal file

Binary file not shown.

BIN
src/main/.DS_Store vendored Normal file

Binary file not shown.

BIN
src/main/java/aiyh.zip Normal file

Binary file not shown.

View File

@ -33,4 +33,8 @@ public class MybatisUtil {
} }
return sqlSessionManager; return sqlSessionManager;
} }
public static <T> T getMapper(Class<T> tClass){
return sqlSessionManager.getMapper(tClass);
}
} }

View File

@ -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()) {
return (T) Boolean.valueOf(rs.getBoolean(1)); try {
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;
}
/** /**
* listlist * listlist
@ -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);
}
} }

View File

@ -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;
}

View File

@ -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
}

View File

@ -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;
} }
} }

View File

@ -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) {

View File

@ -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);
}

View File

@ -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

View File

@ -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

View File

@ -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) {

View File

@ -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);

View File

@ -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());

View File

@ -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

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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(() -&gt; "1").&lt;Integer&gt;map((x) -&gt; Integer.valueOf(x))
*
* @param f function to apply to successful value.
* @param <U> new type (optional)
* @return Success&lt;U&gt; or Failure&lt;U&gt;
*/
public abstract <U> Try<U> map(TryMapFunction<? super T, ? extends U> f);
/**
* Transform success or pass on failure, taking a Try&lt;U&gt; 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(() -&gt; "1").&lt;Integer&gt;flatMap((x) -&gt; Try.ofFailable(() -&gt; 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(() -&gt; "not a number")
* .&lt;Integer&gt;flatMap((x) -&gt; Try.ofFailable(() -&gt;Integer.valueOf(x)))
* .recover((t) -&gt; 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;
}
}

View File

@ -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;
}

View File

@ -0,0 +1,5 @@
package aiyh.utils.excention.monad;
public interface TryMapFunction<T, R> {
R apply(T t) throws Throwable;
}

View File

@ -0,0 +1,6 @@
package aiyh.utils.excention.monad;
public interface TrySupplier<T>{
T get() throws Throwable;
}

View File

@ -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;
}
}

View File

@ -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 +
'}';
}
}

View File

@ -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);
}
}
}
}

View File

@ -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;

View File

@ -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,23 +23,36 @@ 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
* @throws JsonProcessingException JSON * @throws JsonProcessingException JSON
@ -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,13 +124,29 @@ public class ResponeVo {
this.entityString = entityString; this.entityString = entityString;
} }
@Override public InputStream getContent() {
public String toString() { return content;
return "ResponeVo{" + }
"code=" + code +
", entityString='" + entityString + '\'' + public byte[] getContentByteArr() {
", locale=" + locale + return contentByteArr;
'}'; }
}
public void setContentByteArr(byte[] contentByteArr) {
this.contentByteArr = contentByteArr;
}
public void setContent(InputStream content) {
this.content = content;
}
@Override
public String toString() {
return "ResponeVo{" +
"code=" + code +
", entityString='" + entityString + '\'' +
", otherParam=" + requestData +
'}';
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -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);
}

View File

@ -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));
}
}

View File

@ -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);
} }

View File

@ -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);
}
}

View File

@ -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);
} }
} }

View File

@ -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");
} }
} }

View File

@ -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;
@ -48,7 +55,7 @@ public class ResultMapper {
} }
if (ResultMapper.typeHandler.containsKey(tClass)) { if (ResultMapper.typeHandler.containsKey(tClass)) {
rs.next(); rs.next();
return (T) ResultMapper.typeHandler.get(tClass).getValue(rs, 1,null); return (T) ResultMapper.typeHandler.get(tClass).getValue(rs, 1, null);
} }
T t = tClass.newInstance(); T t = tClass.newInstance();
if (t instanceof Collection) { if (t instanceof Collection) {
@ -62,7 +69,7 @@ public class ResultMapper {
} }
while (rs.next()) { while (rs.next()) {
Object o = rawType.newInstance(); Object o = rawType.newInstance();
Object object = getObject(rs, o,method); Object object = getObject(rs, o, method);
((Collection<? super Object>) t).add(object); ((Collection<? super Object>) t).add(object);
} }
return t; return t;
@ -82,16 +89,16 @@ public class ResultMapper {
if (o instanceof Map || o instanceof Collection) { if (o instanceof Map || o instanceof Collection) {
throw new TypeNonsupportException("An unsupported return type!"); throw new TypeNonsupportException("An unsupported return type!");
} }
if(rs.next()){ if (rs.next()) {
return (T) getObject(rs, t,method); return (T) getObject(rs, t, method);
} }
return null; return null;
} }
if (t.getClass().isArray()) { if (t.getClass().isArray()) {
throw new TypeNonsupportException("An unsupported return type!"); throw new TypeNonsupportException("An unsupported return type!");
} }
if(rs.next()){ if (rs.next()) {
return (T) getObject(rs, t,method); return (T) getObject(rs, t, method);
} }
return null; return null;
} catch (InstantiationException | IllegalAccessException e) { } catch (InstantiationException | IllegalAccessException e) {
@ -100,17 +107,17 @@ public class ResultMapper {
return null; return null;
} }
public Object getObject(RecordSet rs, Object o,Method method) { public Object getObject(RecordSet rs, Object o, Method method) {
CaseConversion annotation = method.getAnnotation(CaseConversion.class); CaseConversion annotation = method.getAnnotation(CaseConversion.class);
boolean enable = annotation == null ? true : annotation.value(); boolean enable = annotation == null ? true : annotation.value();
String[] columnName = rs.getColumnName(); String[] columnName = rs.getColumnName();
String[] columnTypeName = rs.getColumnTypeName(); String[] columnTypeName = rs.getColumnTypeName();
int[] columnTypes = rs.getColumnType(); int[] columnTypes = rs.getColumnType();
if(columnTypeName == null){ if (columnTypeName == null) {
columnTypeName = new String[columnTypes.length]; columnTypeName = new String[columnTypes.length];
for (int i = 0 ; i < columnTypes.length; i ++) { for (int i = 0; i < columnTypes.length; i++) {
int type = columnTypes[i]; int type = columnTypes[i];
switch (type){ switch (type) {
case -1: case -1:
columnTypeName[i] = "TEXT"; columnTypeName[i] = "TEXT";
break; break;
@ -127,87 +134,88 @@ 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) || if (enable) {
"long".equalsIgnoreCase(columnType) || ((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getInt(i + 1));
"number".equalsIgnoreCase(columnType) ||
"MEDIUMINT".equalsIgnoreCase(columnType) ||
"TINYINT".equalsIgnoreCase(columnType) ||
"SMALLINT".equalsIgnoreCase(columnType) ||
"BIGINT".equalsIgnoreCase(columnType) ||
"INTEGER".equalsIgnoreCase(columnType)) {
if(enable){
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getInt(i + 1));
continue;
}
((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getInt(i + 1));
continue; continue;
} }
if ("FLOAT".equalsIgnoreCase(columnType) || ((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getInt(i + 1));
"DOUBLE".equalsIgnoreCase(columnType) ||
"DECIMAL".equalsIgnoreCase(columnType)) {
if(enable){
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getFloat(i + 1));
continue;
}
((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getFloat(i + 1));
continue;
}
if(enable){
((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getString(i + 1));
continue;
}
((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getString(i + 1));
continue; continue;
} }
if (o instanceof Collection) { if ("FLOAT".equalsIgnoreCase(columnType) || "DOUBLE".equalsIgnoreCase(columnType) || "DECIMAL".equalsIgnoreCase(columnType)) {
throw new TypeNonsupportException("An unsupported return type!"); if (enable) {
} ((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getFloat(i + 1));
if (o instanceof Number) { continue;
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)) {
return rs.getInt(i + 1);
}
if ("FLOAT".equalsIgnoreCase(columnType) ||
"DOUBLE".equalsIgnoreCase(columnType) ||
"DECIMAL".equalsIgnoreCase(columnType)) {
return rs.getFloat(i + 1);
} }
((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getFloat(i + 1));
continue;
} }
if (o instanceof String) { if (enable) {
return rs.getString(i + 1); ((Map<? super Object, ? super Object>) o).put(Util.toCamelCase(columnName[i]), rs.getString(i + 1));
continue;
} }
if (o instanceof Boolean) { ((Map<? super Object, ? super Object>) o).put(columnName[i], rs.getString(i + 1));
return rs.getBoolean(i + 1); continue;
}
return o;
}
if (o instanceof Collection) {
throw new TypeNonsupportException("An unsupported return type!");
}
if (o instanceof Number) {
for (int i = 0; i < columnName.length; i++) {
String columnType = columnTypeName[i];
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)) {
return rs.getInt(i + 1);
} }
if ("FLOAT".equalsIgnoreCase(columnType) || "DOUBLE".equalsIgnoreCase(columnType) || "DECIMAL".equalsIgnoreCase(columnType)) {
return rs.getFloat(i + 1);
}
}
return o;
}
if (o instanceof String) {
for (int i = 0; i < columnName.length; i++) {
return rs.getString(i + 1);
}
return o;
}
if (o instanceof Boolean) {
for (int i = 0; i < columnName.length; i++) {
return rs.getBoolean(i + 1);
}
return o;
}
BeanInfo beanInfo = Introspector.getBeanInfo(o.getClass(), Object.class); // Util.getLogger().info("获取对象:" + o.toString());
PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); BeanInfo beanInfo = Introspector.getBeanInfo(o.getClass(), Object.class);
for (PropertyDescriptor propertyDescriptor : propertyDescriptors) { PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
Class<?> propertyType = propertyDescriptor.getPropertyType(); for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
Object value = null; Class<?> propertyType = propertyDescriptor.getPropertyType();
String fieldName = propertyDescriptor.getName(); Object value = null;
Field declaredField = o.getClass().getDeclaredField(fieldName); String fieldName = propertyDescriptor.getName();
if(enable){
value = ResultMapper.typeHandler.get(propertyType) == null ? null : ResultMapper.typeHandler.get(propertyType).getValue(rs, Util.toUnderlineCase(fieldName),declaredField);
}else {
value = ResultMapper.typeHandler.get(propertyType) == null ? null : ResultMapper.typeHandler.get(propertyType).getValue(rs, fieldName,declaredField);
}
propertyDescriptor.getWriteMethod().invoke(o, value);
}
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);
if (enable) {
value = ResultMapper.typeHandler.get(propertyType) == null ? null : ResultMapper.typeHandler.get(propertyType).getValue(rs, Util.toUnderlineCase(fieldName), declaredField);
} else {
value = ResultMapper.typeHandler.get(propertyType) == null ? null : ResultMapper.typeHandler.get(propertyType).getValue(rs, fieldName, declaredField);
}
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;
} }

View File

@ -27,7 +27,7 @@ public class SqlHandler {
public PrepSqlResultImpl handler(String sql, boolean custom, Method method, Object[] args) { public PrepSqlResultImpl handler(String sql, boolean custom, Method method, Object[] args) {
String findSql = findSql(sql, custom, method, args); String findSql = findSql(sql, custom, method, args);
Map<String, Object> methodArgNameMap = buildMethodArgNameMap(method, args); Map<String, Object> methodArgNameMap = buildMethodArgNameMap(method, args);
// 处理基本类型以及包装类 // 处理基本类型以及包装类
String parse; String parse;
if (methodArgNameMap.size() == 0) { if (methodArgNameMap.size() == 0) {
@ -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.

View File

@ -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,23 +78,14 @@ 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 outputStream.write(bytes);
public void write(OutputStream outputStream) throws IOException, WebApplicationException { outputStream.close();
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();
}
};
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",
"attachment; filename=image_from_server.jpg"); "attachment; filename=image_from_server.jpg");
@ -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("成功");
} }
} }

View File

@ -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;

View File

@ -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;
} }
/** /**

View File

@ -422,7 +422,7 @@ public class FaDDContractService {
toolUtil.writeErrorLog("创建文档发生错误:" + e); toolUtil.writeErrorLog("创建文档发生错误:" + e);
} }
toolUtil.writeDebuggerLog("生成的文档的id" + docIds); toolUtil.writeDebuggerLog("生成的文档的id" + docIds);
// 将id保存到流程字段中 // 将id保存到流程字段中
PrepSqlResultImpl sqlResult = PrepSqlResultImpl sqlResult =
Util.createSqlBuilder() Util.createSqlBuilder()
.updateSql( .updateSql(
@ -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("查询到状态为nullsql" + query + " ---> " + requestId); toolUtil.writeDebuggerLog("查询到状态为nullsql" + 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;

View File

@ -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

View File

@ -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") +
"&timestamp=" + header.get("timestamp"); "&timestamp=" + 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,23 +201,26 @@ 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));
} }
/**
public static String builderBizContent(Map<String, Object> data) { *
String jsonString = JSONUtil.toJsonStr(data); * @param data
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码" + jsonString); * @return
String encode; */
// encode = URLEncoder.encode(jsonString, "UTF-8"); public static String builderBizContent(Map<String, Object> data) {
encode = URLUtil.encodeAll(jsonString, StandardCharsets.UTF_8); String jsonString = JSONUtil.toJsonStr(data);
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码后URLEncoder编码" + encode); TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码" + jsonString);
String s = Base64.getEncoder().encodeToString(encode.getBytes(StandardCharsets.UTF_8)); TreeMap<String,Object> treeMap = JSONUtil.parseObj(jsonString).toBean(TreeMap.class);
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码后URLEncoder编码后进行base64编码" + s); jsonString = JSONUtil.toJsonStr(treeMap);
return s; String encode;
} encode = URLUtil.encodeAll(jsonString, StandardCharsets.UTF_8);
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码后URLEncoder编码" + encode);
String s = cn.hutool.core.codec.Base64.encode(StrUtil.bytes(encode, StandardCharsets.UTF_8));
TOOL_UTIL.writeDebuggerLog("bizContent进行JSON编码后URLEncoder编码后进行base64编码" + s);
return s;
}
private static String string2SHA256(String str) { private static String string2SHA256(String str) {
MessageDigest messageDigest; MessageDigest messageDigest;

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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;
} }

View File

@ -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;
} }

View File

@ -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;
} }

View File

@ -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())) {
// 登录名 // 登录名
map.put("loginid", employee.getUSERCODE()); if(!map.containsKey("loginid")){
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) {
@ -613,13 +629,13 @@ public class SyncOrganizationUtils extends ToolUtil {
String insertValueStr = this.removeLastComma(insertValueBuilder); String insertValueStr = this.removeLastComma(insertValueBuilder);
String insertSysSql = "insert into " + table + " (" + insertFiledStr + ") values (" + insertValueStr + ")"; String insertSysSql = "insert into " + table + " (" + insertFiledStr + ") values (" + insertValueStr + ")";
try { try {
rs.executeUpdate(insertSysSql); rs.executeUpdate(insertSysSql);
} catch (Exception e) { } catch (Exception e) {
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);

View File

@ -22,111 +22,111 @@ import java.util.Map;
public class CopyAttachmentAction extends ToolUtil implements Action { public class CopyAttachmentAction extends ToolUtil implements Action {
//当前类名称 //当前类名称
private final String className = "AddCustomer_Action"; private final String className = "AddCustomer_Action";
private String overrideField; private String overrideField;
@Override @Override
public String execute(RequestInfo requestInfo) { public String execute(RequestInfo requestInfo) {
this.writeDebuggerLog(className + "======>" + overrideField); this.writeDebuggerLog(className + "======>" + overrideField);
try { try {
String workflowid = requestInfo.getWorkflowid(); String workflowid = requestInfo.getWorkflowid();
//流程请求ID //流程请求ID
String requestid = Util.null2String(requestInfo.getRequestid()); String requestid = Util.null2String(requestInfo.getRequestid());
//流程表单名称 //流程表单名称
String tableName = requestInfo.getRequestManager().getBillTableName(); String tableName = requestInfo.getRequestManager().getBillTableName();
ConfigEmpty config = ConfigTableData.getConfig(workflowid); ConfigEmpty config = ConfigTableData.getConfig(workflowid);
// 查询是流程数据 // 查询是流程数据
String query = "select * from " + tableName + " where requestid = ?"; String query = "select * from " + tableName + " where requestid = ?";
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
rs.executeQuery(query,requestid); rs.executeQuery(query, requestid);
Map<String, Object> requestMap = Util.recordSet2Map(rs); Map<String, Object> requestMap = Util.recordSet2Map(rs);
if(requestMap == null || config == null){ if (requestMap == null || config == null) {
return Action.SUCCESS; return Action.SUCCESS;
} }
if(!requestMap.get(config.getShowField()).equals(config.getShowValue())){ if (!requestMap.get(config.getShowField()).equals(config.getShowValue())) {
return Action.SUCCESS; return Action.SUCCESS;
} }
// 需要模板覆盖 // 需要模板覆盖
String attachmentValue = String.valueOf(requestMap.get(config.getAttachmentField())); String attachmentValue = String.valueOf(requestMap.get(config.getAttachmentField()));
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());
if (attachmentList.size() != overrideList.size()){ if (attachmentList.size() != overrideList.size()) {
requestInfo.getRequestManager().setMessagecontent("合同模板与上传模板数量不一致"); requestInfo.getRequestManager().setMessagecontent("合同模板与上传模板数量不一致");
requestInfo.getRequestManager().setMessageid("合同模板与上传模板数量不一致"); requestInfo.getRequestManager().setMessageid("合同模板与上传模板数量不一致");
return Action.FAILURE_AND_CONTINUE; return Action.FAILURE_AND_CONTINUE;
} }
// 需要移除的文件 // 需要移除的文件
List<AttachmentIdName> removeFile = new ArrayList<>(); List<AttachmentIdName> removeFile = new ArrayList<>();
// 移除所有的pdf文件 // 移除所有的pdf文件
for (AttachmentIdName overrideIdName : overrideList) { for (AttachmentIdName overrideIdName : overrideList) {
String fileName = overrideIdName.getImagefilename(); String fileName = overrideIdName.getImagefilename();
String extension = ""; String extension = "";
this.writeDebuggerLog(overrideIdName.toString()); this.writeDebuggerLog(overrideIdName.toString());
int index = fileName.lastIndexOf('.'); int index = fileName.lastIndexOf('.');
if (index > 0) { if (index > 0) {
extension = fileName.substring(index + 1); extension = fileName.substring(index + 1);
} }
this.writeDebuggerLog(extension); this.writeDebuggerLog(extension);
if("pdf".equalsIgnoreCase(extension)){ if ("pdf".equalsIgnoreCase(extension)) {
removeFile.add(overrideIdName); removeFile.add(overrideIdName);
} }
} }
// 删除文件 // 删除文件
for (AttachmentIdName overrideIdName : removeFile) { for (AttachmentIdName overrideIdName : removeFile) {
overrideList.remove(overrideIdName); overrideList.remove(overrideIdName);
} }
// 添加pdf文件 // 添加pdf文件
for (AttachmentIdName attachmentIdName : attachmentList) { for (AttachmentIdName attachmentIdName : attachmentList) {
String fileName = attachmentIdName.getImagefilename(); String fileName = attachmentIdName.getImagefilename();
String extension = ""; String extension = "";
this.writeDebuggerLog(attachmentIdName.toString()); this.writeDebuggerLog(attachmentIdName.toString());
int index = fileName.lastIndexOf('.'); int index = fileName.lastIndexOf('.');
if (index > 0) { if (index > 0) {
extension = fileName.substring(index + 1); extension = fileName.substring(index + 1);
} }
this.writeDebuggerLog(extension); this.writeDebuggerLog(extension);
if("pdf".equalsIgnoreCase(extension)){ if ("pdf".equalsIgnoreCase(extension)) {
overrideList.add(attachmentIdName); overrideList.add(attachmentIdName);
} }
} }
if (attachmentList.size() != overrideList.size()){ if (attachmentList.size() != overrideList.size()) {
requestInfo.getRequestManager().setMessagecontent("合同模板与上传模板数量不一致"); requestInfo.getRequestManager().setMessagecontent("合同模板与上传模板数量不一致");
requestInfo.getRequestManager().setMessageid("合同模板与上传模板数量不一致"); requestInfo.getRequestManager().setMessageid("合同模板与上传模板数量不一致");
return Action.FAILURE_AND_CONTINUE; return Action.FAILURE_AND_CONTINUE;
} }
StringBuilder overrideBuilder = new StringBuilder(); StringBuilder overrideBuilder = new StringBuilder();
for (AttachmentIdName overrideIdName : overrideList) { for (AttachmentIdName overrideIdName : overrideList) {
overrideBuilder.append(",").append(overrideIdName.getDocid()); overrideBuilder.append(",").append(overrideIdName.getDocid());
} }
String overrideResult = Util.removeSeparator(overrideBuilder); String overrideResult = Util.removeSeparator(overrideBuilder);
this.writeDebuggerLog(overrideResult); this.writeDebuggerLog(overrideResult);
PrepSqlResultImpl sqlResult = Util.createSqlBuilder().updateSql(tableName, ParaMap.create().put(this.overrideField, overrideResult), PrepSqlResultImpl sqlResult = Util.createSqlBuilder().updateSql(tableName, ParaMap.create().put(this.overrideField, overrideResult),
Util.createPrepWhereImpl().whereAnd("requestid").whereEqual(requestid)); Util.createPrepWhereImpl().whereAnd("requestid").whereEqual(requestid));
rs.executeUpdate(sqlResult.getSqlStr(),sqlResult.getArgs()); rs.executeUpdate(sqlResult.getSqlStr(), sqlResult.getArgs());
}catch (Exception e){ } catch (Exception e) {
this.writeErrorLog(e.getMessage()); this.writeErrorLog(e.getMessage());
} }
return Action.SUCCESS; return Action.SUCCESS;
} }
public String getOverrideField() { public String getOverrideField() {
return overrideField; return overrideField;
} }
public void setOverrideField(String overrideField) { public void setOverrideField(String overrideField) {
this.overrideField = overrideField; this.overrideField = overrideField;
} }
} }

View File

@ -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;
/** /**

View File

@ -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

BIN
src/main/resources/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

View File

@ -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=

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,6 @@
aiyh.htmlLabel.porsche.FaDDContractController.pushErr.labelIndex=-1 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

View File

@ -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

View File

@ -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>

BIN
src/main/resources/filesystem/.DS_Store vendored Normal file

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.

Some files were not shown because too many files have changed in this diff Show More