diff --git a/.gitignore b/.gitignore
index 42e92c5..a1f5db0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,4 +46,5 @@ src/test/resources/font
src/main/resources/WEB-INF/vm/outFile
target/
*.back
+src/main/old_src/
diff --git a/javascript/youhong.ai/pcn/workflow_code_block.js b/javascript/youhong.ai/pcn/workflow_code_block.js
index 869e200..9212a06 100644
--- a/javascript/youhong.ai/pcn/workflow_code_block.js
+++ b/javascript/youhong.ai/pcn/workflow_code_block.js
@@ -563,9 +563,11 @@ $(() => {
"Content-Type": "application/json"
},
complete: (res) => {
- if (res && res.code === 200) {
- callback();
- }
+ res.then(r => {
+ if (r && r.code === 200) {
+ callback();
+ }
+ })
}
})
});
diff --git a/pom.xml b/pom.xml
index 365f87d..5b8411e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,6 +56,12 @@
${lombok.version}
provided
+
+
+ com.drewnoakes
+ metadata-extractor
+ ${metadata-extractor.version}
+
diff --git a/src/main/java/aiyh/utils/entity/FieldViewInfo.java b/src/main/java/aiyh/utils/entity/FieldViewInfo.java
index c76e2bb..0240c5f 100644
--- a/src/main/java/aiyh/utils/entity/FieldViewInfo.java
+++ b/src/main/java/aiyh/utils/entity/FieldViewInfo.java
@@ -6,7 +6,7 @@ import lombok.Setter;
import lombok.ToString;
/**
- *
+ * 流程建模字段信息
*
* create: 2023/2/20 11:01
*
diff --git a/src/main/java/aiyh/utils/entity/ModelTableInfo.java b/src/main/java/aiyh/utils/entity/ModelTableInfo.java
new file mode 100644
index 0000000..e763cf7
--- /dev/null
+++ b/src/main/java/aiyh/utils/entity/ModelTableInfo.java
@@ -0,0 +1,28 @@
+package aiyh.utils.entity;
+
+import aiyh.utils.annotation.recordset.SqlOracleDbFieldAnn;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+/**
+ * 建模表信息
+ *
+ * create: 2023/3/14 17:05
+ *
+ * @author youHong.ai
+ */
+@Getter
+@Setter
+@ToString
+public class ModelTableInfo {
+ /** id */
+ @SqlOracleDbFieldAnn("ID")
+ private String id;
+
+ @SqlOracleDbFieldAnn("INDEX_DESC")
+ private String indexDesc;
+ /** 字段表名 */
+ @SqlOracleDbFieldAnn("TABLE_NAME")
+ private String tableName;
+}
diff --git a/src/main/java/aiyh/utils/entity/SelectValueEntity.java b/src/main/java/aiyh/utils/entity/SelectValueEntity.java
index 6411a50..28ba419 100644
--- a/src/main/java/aiyh/utils/entity/SelectValueEntity.java
+++ b/src/main/java/aiyh/utils/entity/SelectValueEntity.java
@@ -3,7 +3,7 @@ package aiyh.utils.entity;
import lombok.Data;
/**
- *
+ * 下拉框字段信息
* create 2022/6/10 21:21
*
* @author ayh
@@ -11,10 +11,10 @@ import lombok.Data;
@Data
public class SelectValueEntity {
- private String id;
- private String fieldname;
- private String fieldlabel;
- private String tablename;
- private String selectname;
- private Integer selectvalue;
+ private String id;
+ private String fieldname;
+ private String fieldlabel;
+ private String tablename;
+ private String selectname;
+ private Integer selectvalue;
}
diff --git a/src/main/java/aiyh/utils/httpUtil/util/HttpUtils.java b/src/main/java/aiyh/utils/httpUtil/util/HttpUtils.java
index 05491b2..6aabc85 100644
--- a/src/main/java/aiyh/utils/httpUtil/util/HttpUtils.java
+++ b/src/main/java/aiyh/utils/httpUtil/util/HttpUtils.java
@@ -86,6 +86,10 @@ public class HttpUtils {
}
+ public void setCredentialsProvider(CredentialsProvider credentialsProvider) {
+ this.credentialsProvider = credentialsProvider;
+ }
+
public HttpUtils(CredentialsProvider credentialsProvider) {
this.credentialsProvider = credentialsProvider;
}
diff --git a/src/main/java/aiyh/utils/mapper/UtilMapper.java b/src/main/java/aiyh/utils/mapper/UtilMapper.java
index c35ed85..7382768 100644
--- a/src/main/java/aiyh/utils/mapper/UtilMapper.java
+++ b/src/main/java/aiyh/utils/mapper/UtilMapper.java
@@ -1,10 +1,7 @@
package aiyh.utils.mapper;
import aiyh.utils.annotation.recordset.*;
-import aiyh.utils.entity.DocImageInfo;
-import aiyh.utils.entity.FieldViewInfo;
-import aiyh.utils.entity.SelectValueEntity;
-import aiyh.utils.entity.WorkflowNodeConfig;
+import aiyh.utils.entity.*;
import java.util.List;
import java.util.Map;
@@ -190,4 +187,14 @@ public interface UtilMapper {
" fieldhtmltype field_html_type\n" +
"from workflow_field_table_view where id = #{id}")
FieldViewInfo selectFieldInfo(Integer id);
+
+ /**
+ * 查询建模表表信息
+ *
+ * @param id id
+ * @return 建模表信息
+ */
+
+ @Select("select id, tablename table_name, indexdesc index_desc from mode_bill_info_view where id = #{id}")
+ ModelTableInfo selectModelTableInfo(Integer id);
}
diff --git a/src/main/java/aiyh/utils/recordset/FormatSqlUtil.java b/src/main/java/aiyh/utils/recordset/FormatSqlUtil.java
new file mode 100644
index 0000000..0a6303b
--- /dev/null
+++ b/src/main/java/aiyh/utils/recordset/FormatSqlUtil.java
@@ -0,0 +1,38 @@
+package aiyh.utils.recordset;
+
+import com.alibaba.druid.sql.SQLUtils;
+import com.alibaba.druid.sql.parser.ParserException;
+import weaver.conn.RecordSet;
+
+import java.util.Objects;
+
+/**
+ * 格式化sql字符串
+ *
+ * create: 2023/3/5 11:45
+ *
+ * @author youHong.ai
+ */
+public class FormatSqlUtil {
+ private static String dbType = null;
+ private static RecordSet recordSet = null;
+
+ public static String formatSql(String sql) {
+
+ if (Objects.isNull(FormatSqlUtil.dbType)) {
+ if (recordSet == null) {
+ recordSet = new RecordSet();
+ }
+ FormatSqlUtil.dbType = recordSet.getDBType();
+ }
+ try {
+ return SQLUtils.format(sql, dbType);
+ } catch (ParserException e) {
+ return toSqlString(sql);
+ }
+ }
+
+ private static String toSqlString(String sql) {
+ return sql;
+ }
+}
diff --git a/src/main/java/aiyh/utils/recordset/RecordsetUtil.java b/src/main/java/aiyh/utils/recordset/RecordsetUtil.java
index f9664c8..1b78fd5 100644
--- a/src/main/java/aiyh/utils/recordset/RecordsetUtil.java
+++ b/src/main/java/aiyh/utils/recordset/RecordsetUtil.java
@@ -64,12 +64,13 @@ public class RecordsetUtil implements InvocationHandler {
SqlHandler sqlHandler = new SqlHandler();
ResultMapper resultMapper = new ResultMapper();
PrepSqlResultImpl handler = sqlHandler.handler(sql, custom, method, args);
+ String invokeMethod = method.getDeclaringClass().getName() + ":" + method.getName() + " : ";
switch (type) {
case 1: {
if (!handler.getSqlStr().trim().toLowerCase().startsWith("select ")) {
throw new CustomerException("The sql statement does not match, the @Select annotation can only execute the select statement, please check whether the sql statement matches!");
}
- Util.getLogger(SQL_LOG).info("解析sql===>" + handler);
+ Util.getLogger(SQL_LOG).info(invokeMethod + handler);
if (handler.getArgs().isEmpty()) {
rs.executeQuery(handler.getSqlStr());
} else {
@@ -81,7 +82,7 @@ public class RecordsetUtil implements InvocationHandler {
if (!handler.getSqlStr().trim().toLowerCase().startsWith("update ")) {
throw new CustomerException("The sql statement does not match, the @Update annotation can only execute the update statement, please check whether the sql statement matches!");
}
- Util.getLogger(SQL_LOG).info(handler.toString());
+ Util.getLogger(SQL_LOG).info(invokeMethod + handler);
Class> returnType = method.getReturnType();
boolean b;
if (handler.getArgs().isEmpty()) {
@@ -107,7 +108,7 @@ public class RecordsetUtil implements InvocationHandler {
if (!handler.getSqlStr().trim().toLowerCase().startsWith("insert ")) {
throw new CustomerException("The sql statement does not match, the @Insert annotation can only execute the insert statement, please check whether the sql statement matches!");
}
- Util.getLogger(SQL_LOG).info(handler.toString());
+ Util.getLogger(SQL_LOG).info(invokeMethod + handler);
Class> returnType = method.getReturnType();
boolean b;
if (handler.getArgs().isEmpty()) {
@@ -126,7 +127,7 @@ public class RecordsetUtil implements InvocationHandler {
if (!handler.getSqlStr().trim().toLowerCase().startsWith("delete ")) {
throw new CustomerException("The sql statement does not match, the @Delete annotation can only execute the delete statement, please check whether the sql statement matches!");
}
- Util.getLogger(SQL_LOG).info(handler.toString());
+ Util.getLogger(SQL_LOG).info(invokeMethod + handler);
Class> returnType = method.getReturnType();
boolean b;
if (handler.getArgs().isEmpty()) {
@@ -144,7 +145,7 @@ public class RecordsetUtil implements InvocationHandler {
case 5: {
Class> returnType = method.getReturnType();
BatchSqlResultImpl batchSqlResult = sqlHandler.handlerBatch(sql, custom, method, args);
- Util.getLogger(SQL_LOG).info(batchSqlResult.toString());
+ Util.getLogger(SQL_LOG).info(invokeMethod + batchSqlResult.toString());
if (batchSqlResult.getBatchList().isEmpty()) {
throw new CustomerException("execute batch sql error , batch sql args is empty!");
}
@@ -162,7 +163,7 @@ public class RecordsetUtil implements InvocationHandler {
case 6: {
Class> returnType = method.getReturnType();
BatchSqlResultImpl batchSqlResult = sqlHandler.handlerBatch(sql, custom, method, args);
- Util.getLogger(SQL_LOG).info(batchSqlResult.toString());
+ Util.getLogger(SQL_LOG).info(invokeMethod + batchSqlResult.toString());
if (batchSqlResult.getBatchList().isEmpty()) {
throw new CustomerException("execute batch sql error , batch sql args is empty!");
}
@@ -180,7 +181,7 @@ public class RecordsetUtil implements InvocationHandler {
case 7: {
Class> returnType = method.getReturnType();
BatchSqlResultImpl batchSqlResult = sqlHandler.handlerBatch(sql, custom, method, args);
- Util.getLogger(SQL_LOG).info(batchSqlResult.toString());
+ Util.getLogger(SQL_LOG).info(invokeMethod + batchSqlResult.toString());
if (batchSqlResult.getBatchList().isEmpty()) {
throw new CustomerException("execute batch sql error , batch sql args is empty!");
}
@@ -304,6 +305,7 @@ public class RecordsetUtil implements InvocationHandler {
private Object invokeRsTrans(Object proxy, Method method, Object[] args, String name) {
String mapperKey = method.getDeclaringClass().getName();
+ String invokeMethod = method.getDeclaringClass().getName() + ":" + method.getName() + " : ";
if (!"".equals(name) && null != name) {
mapperKey += "." + name;
}
@@ -323,7 +325,7 @@ public class RecordsetUtil implements InvocationHandler {
if (!handler.getSqlStr().trim().toLowerCase().startsWith("select ")) {
throw new CustomerException("The sql statement does not match, the @Select annotation can only execute the select statement, please check whether the sql statement matches!");
}
- Util.getLogger(SQL_LOG).info("解析sql===>" + handler);
+ Util.getLogger(SQL_LOG).info(invokeMethod + handler);
try {
if (handler.getArgs().isEmpty()) {
rs.executeQuery(handler.getSqlStr());
@@ -346,7 +348,7 @@ public class RecordsetUtil implements InvocationHandler {
if (!handler.getSqlStr().trim().toLowerCase().startsWith("update ")) {
throw new CustomerException("The sql statement does not match, the @Update annotation can only execute the update statement, please check whether the sql statement matches!");
}
- Util.getLogger(SQL_LOG).info(handler.toString());
+ Util.getLogger(SQL_LOG).info(invokeMethod + handler);
Class> returnType = method.getReturnType();
boolean b;
try {
@@ -382,7 +384,7 @@ public class RecordsetUtil implements InvocationHandler {
if (!handler.getSqlStr().trim().toLowerCase().startsWith("insert ")) {
throw new CustomerException("The sql statement does not match, the @Insert annotation can only execute the insert statement, please check whether the sql statement matches!");
}
- Util.getLogger(SQL_LOG).info(handler.toString());
+ Util.getLogger(SQL_LOG).info(invokeMethod + handler);
Class> returnType = method.getReturnType();
boolean b;
try {
@@ -411,7 +413,7 @@ public class RecordsetUtil implements InvocationHandler {
if (!handler.getSqlStr().trim().toLowerCase().startsWith("delete ")) {
throw new CustomerException("The sql statement does not match, the @Delete annotation can only execute the delete statement, please check whether the sql statement matches!");
}
- Util.getLogger(SQL_LOG).info(handler.toString());
+ Util.getLogger(SQL_LOG).info(invokeMethod + handler);
Class> returnType = method.getReturnType();
boolean b;
try {
@@ -438,7 +440,7 @@ public class RecordsetUtil implements InvocationHandler {
Class> returnType = method.getReturnType();
boolean custom = batchInsert.custom();
BatchSqlResultImpl batchSqlResult = sqlHandler.handlerBatch(sql, custom, method, args);
- Util.getLogger(SQL_LOG).info(batchSqlResult.toString());
+ Util.getLogger(SQL_LOG).info(invokeMethod + batchSqlResult.toString());
List batchList = batchSqlResult.getBatchList();
if (batchList.isEmpty()) {
throw new CustomerException("execute batch sql error , batch sql args is empty!");
@@ -477,7 +479,7 @@ public class RecordsetUtil implements InvocationHandler {
Class> returnType = method.getReturnType();
boolean custom = batchUpdate.custom();
BatchSqlResultImpl batchSqlResult = sqlHandler.handlerBatch(sql, custom, method, args);
- Util.getLogger(SQL_LOG).info(batchSqlResult.toString());
+ Util.getLogger(SQL_LOG).info(invokeMethod + batchSqlResult.toString());
if (batchSqlResult.getBatchList().isEmpty()) {
throw new CustomerException("execute batch sql error , batch sql args is empty!");
}
@@ -518,7 +520,7 @@ public class RecordsetUtil implements InvocationHandler {
Class> returnType = method.getReturnType();
boolean custom = batchDelete.custom();
BatchSqlResultImpl batchSqlResult = sqlHandler.handlerBatch(sql, custom, method, args);
- Util.getLogger(SQL_LOG).info(batchSqlResult.toString());
+ Util.getLogger(SQL_LOG).info(invokeMethod + batchSqlResult.toString());
if (batchSqlResult.getBatchList().isEmpty()) {
throw new CustomerException("execute batch sql error , batch sql args is empty!");
}
diff --git a/src/main/java/aiyh/utils/sqlUtil/sqlResult/impl/BatchSqlResultImpl.java b/src/main/java/aiyh/utils/sqlUtil/sqlResult/impl/BatchSqlResultImpl.java
index c6c5cc9..cc4e2c1 100644
--- a/src/main/java/aiyh/utils/sqlUtil/sqlResult/impl/BatchSqlResultImpl.java
+++ b/src/main/java/aiyh/utils/sqlUtil/sqlResult/impl/BatchSqlResultImpl.java
@@ -1,5 +1,7 @@
package aiyh.utils.sqlUtil.sqlResult.impl;
+import aiyh.utils.recordset.FormatSqlUtil;
+
import java.util.List;
/**
@@ -10,27 +12,27 @@ import java.util.List;
public class BatchSqlResultImpl implements aiyh.utils.sqlUtil.sqlResult.SqlResult {
- private final String sqlStr;
- private final List batchList;
-
- public BatchSqlResultImpl(String sqlStr, List batchList) {
- this.sqlStr = sqlStr;
- this.batchList = batchList;
- }
-
- public String getSqlStr() {
- return sqlStr;
- }
-
- public List getBatchList() {
- return batchList;
- }
-
- @Override
- public String toString() {
- return "BatchSqlResultImpl{" +
- "sqlStr='" + sqlStr + '\'' +
- ", batchList=" + batchList +
- '}';
- }
+ private final String sqlStr;
+ private final List batchList;
+
+ public BatchSqlResultImpl(String sqlStr, List batchList) {
+ this.sqlStr = sqlStr;
+ this.batchList = batchList;
+ }
+
+ public String getSqlStr() {
+ return sqlStr;
+ }
+
+ public List getBatchList() {
+ return batchList;
+ }
+
+ @Override
+ public String toString() {
+ return "BatchSqlResultImpl{" +
+ "sqlStr='\n" + FormatSqlUtil.formatSql(sqlStr) + "\n'" +
+ ", batchList=" + batchList +
+ '}';
+ }
}
diff --git a/src/main/java/aiyh/utils/sqlUtil/sqlResult/impl/PrepSqlResultImpl.java b/src/main/java/aiyh/utils/sqlUtil/sqlResult/impl/PrepSqlResultImpl.java
index 4c6e478..5acf3ee 100644
--- a/src/main/java/aiyh/utils/sqlUtil/sqlResult/impl/PrepSqlResultImpl.java
+++ b/src/main/java/aiyh/utils/sqlUtil/sqlResult/impl/PrepSqlResultImpl.java
@@ -1,5 +1,6 @@
package aiyh.utils.sqlUtil.sqlResult.impl;
+import aiyh.utils.recordset.FormatSqlUtil;
import aiyh.utils.sqlUtil.sqlResult.SqlResult;
import java.util.List;
@@ -14,25 +15,25 @@ import java.util.List;
public class PrepSqlResultImpl implements SqlResult {
private final String sqlStr;
private final List