浏览框带出模板复制后的文件,流程和浏览框一对多,浏览框和附件字段一对多

dev
IT-xiaoXiong 2022-01-12 11:20:45 +08:00
parent d719cd4eb5
commit 9ee2c73a3e
13 changed files with 202 additions and 30 deletions

View File

@ -20,17 +20,17 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
<excludeFolder url="file://$MODULE_DIR$/log" /> <excludeFolder url="file://$MODULE_DIR$/log" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="classbean" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.22" level="project" /> <orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.22" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.7.12" level="project" /> <orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.7.12" level="project" />
<orderEntry type="library" name="Maven: com.drewnoakes:metadata-extractor:2.16.0" level="project" /> <orderEntry type="library" name="Maven: com.drewnoakes:metadata-extractor:2.16.0" level="project" />
<orderEntry type="library" name="Maven: com.adobe.xmp:xmpcore:6.1.11" level="project" /> <orderEntry type="library" name="Maven: com.adobe.xmp:xmpcore:6.1.11" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.12" level="project" /> <orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" /> <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="classbean" level="project" />
</component> </component>
</module> </module>

14
pom.xml
View File

@ -73,13 +73,13 @@
<configuration> <configuration>
<source>8</source> <source>8</source>
<target>8</target> <target>8</target>
<annotationProcessors> <!-- <annotationProcessors>-->
<path> <!-- <annotationProcessor>-->
<groupId>org.projectors</groupId> <!-- <groupId>org.projectors</groupId>-->
<artifactId>lombok</artifactId> <!-- <artifactId>lombok</artifactId>-->
<version>${lombok.version}</version> <!-- <version>${lombok.version}</version>-->
</path> <!-- </annotationProcessor>-->
</annotationProcessors> <!-- </annotationProcessors>-->
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>

View File

@ -14,6 +14,7 @@ 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.ibm.icu.text.SimpleDateFormat; import com.ibm.icu.text.SimpleDateFormat;
import org.apache.dubbo.common.utils.CollectionUtils;
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;
@ -1618,6 +1619,10 @@ public class Util extends weaver.general.Util {
return docCategorys; return docCategorys;
} }
public static String getDocCategorys(int workflowId, String docField) {
return getDocCategorys(String.valueOf(workflowId),docField);
}
/** /**
* *
* *
@ -1814,4 +1819,55 @@ public class Util extends weaver.general.Util {
public static <T> T getMapper(Class<T> t) { public static <T> T getMapper(Class<T> t) {
return recordsetUtil.getMapper(t); return recordsetUtil.getMapper(t);
} }
/**
* join
* @param coll
* @param split
* @return
*/
public static String join(Collection<String> coll, String split) {
if (CollectionUtils.isEmpty(coll)) {
return "";
} else {
StringBuilder sb = new StringBuilder();
boolean isFirst = true;
String s;
for(Iterator 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) {
if (CollectionUtils.isEmpty(coll)) {
return "";
} else {
StringBuilder sb = new StringBuilder();
boolean isFirst = true;
String s;
for(Iterator item = coll.iterator(); item.hasNext(); sb.append(s)) {
Object next = item.next();
s = next == null ? "" : String.valueOf(next);
if (isFirst) {
isFirst = false;
} else {
sb.append(split);
}
}
return sb.toString();
}
}
} }

View File

@ -26,9 +26,9 @@ public class HttpManager {
*/ */
private static final int CONNECT_TIMEOUT = 30000; private static final int CONNECT_TIMEOUT = 1000 * 60 * 3;
private static final int CONNECTION_REQUEST_TIMEOUT = 10000; private static final int CONNECTION_REQUEST_TIMEOUT = 1000 * 60 * 3;
private static final int SOCKET_TIMEOUT = 30000; private static final int SOCKET_TIMEOUT = 10000 * 60 * 3;
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

@ -32,19 +32,19 @@ public class RecordsetUtil implements InvocationHandler {
@Override @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { 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())); toolUtil.writeDebuggerLog(String.format("%s===>Preparing to parse SQL", proxy.getClass().getName()));
RecordSet rs = new RecordSet();
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) {
// 查询 // 查询
RecordSet rs = new RecordSet();
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);
System.out.println(handler); toolUtil.writeDebuggerLog(handler.toString());
if (handler.getArgs().isEmpty()) { if (handler.getArgs().isEmpty()) {
rs.executeQuery(handler.getSqlStr()); rs.executeQuery(handler.getSqlStr());
} else { } else {
@ -56,9 +56,11 @@ 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());
Class<?> returnType = method.getReturnType(); Class<?> returnType = method.getReturnType();
boolean b; boolean b;
if (handler.getArgs().isEmpty()) { if (handler.getArgs().isEmpty()) {
@ -83,9 +85,11 @@ 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());
Class<?> returnType = method.getReturnType(); Class<?> returnType = method.getReturnType();
boolean b; boolean b;
if (handler.getArgs().isEmpty()) { if (handler.getArgs().isEmpty()) {
@ -103,9 +107,11 @@ 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());
Class<?> returnType = method.getReturnType(); Class<?> returnType = method.getReturnType();
boolean b; boolean b;
if (handler.getArgs().isEmpty()) { if (handler.getArgs().isEmpty()) {

View File

@ -105,6 +105,27 @@ public class ResultMapper {
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();
if(columnTypeName == null){
columnTypeName = new String[columnTypes.length];
for (int i = 0 ; i < columnTypes.length; i ++) {
int type = columnTypes[i];
switch (type){
case -1:
columnTypeName[i] = "TEXT";
break;
case 4:
columnTypeName[i] = "INT";
break;
case 12:
columnTypeName[i] = "VARCHAR";
break;
default:
columnTypeName[i] = "VARCHAR";
}
}
}
try { try {
for (int i = 0; i < columnName.length; i++) { for (int i = 0; i < columnName.length; i++) {
String columnType = columnTypeName[i]; String columnType = columnTypeName[i];

View File

@ -124,6 +124,16 @@ public class SqlHandler {
Object value = getValueByRegx(regx, field, other, arg, false); Object value = getValueByRegx(regx, field, other, arg, false);
parseSql = parseSql.replaceFirst(pattern, value.toString()); 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()) {
String regx = matcher.group("regx");
String field = matcher.group("field");
String other = matcher.group("other");
Object value = getValueByRegx(regx, field, other, arg, true);
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); compile = Pattern.compile(pattern);
matcher = compile.matcher(parseSql); matcher = compile.matcher(parseSql);

View File

@ -2,7 +2,8 @@ package com.api.aiyh_pcn.patentWall.entity;
/** /**
* @author EBU7-dev1-ayh * @author EBU7-dev1-ayh
* @create 2021/11/25 0025 15:30 * create 2021/11/25 0025 15:30
*
*/ */

View File

@ -165,9 +165,10 @@ log4j.additivity.cloudstore=false
#cus log #cus log
log4j.logger.cus=INFO,ERROR,cus log4j.logger.cus=INFO,ERROR,cus
log4j.appender.cus=org.apache.log4j.DailyRollingFileAppender log4j.appender.cus=org.apache.log4j.DailyRollingFileAppender
log4j.appender.cus.Encoding=UTF-8
log4j.appender.cus.DatePattern='_'yyyyMMdd'.log' log4j.appender.cus.DatePattern='_'yyyyMMdd'.log'
log4j.appender.cus.File=@cus/cus.log log4j.appender.cus.File=@cus/cus.log
log4j.appender.cus.layout=org.apache.log4j.PatternLayout log4j.appender.cus.layout=org.apache.log4j.PatternLayout
log4j.appender.cus.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %m%n log4j.appender.cus.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p %m%n
#log4j.appender.cuslog.Threshold = INFO #log4j.appender.cuslog.Threshold = INFO
log4j.additivity.cus=false log4j.additivity.cus=false

View File

@ -0,0 +1,11 @@
package apiTest.httputils_test;
/**
* create 2021/12/23 0023 14:29
*
* @author EBU7-dev1-ayh
*/
public class HttpUtilsTest {
}

View File

@ -1,6 +1,8 @@
package pcn.copy; package pcn.copy;
import aiyh.utils.Util;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.api.aiyh_pcn.multipleCopy.mapper.MultipleCopyMapper;
import com.api.aiyh_pcn.multipleCopy.pojo.CopyMultipleMain; import com.api.aiyh_pcn.multipleCopy.pojo.CopyMultipleMain;
import com.api.aiyh_pcn.multipleCopy.services.MultipleCopyService; import com.api.aiyh_pcn.multipleCopy.services.MultipleCopyService;
import com.api.aiyh_pcn.multipleCopy.vo.MultipleCopyConfigVO; import com.api.aiyh_pcn.multipleCopy.vo.MultipleCopyConfigVO;
@ -8,6 +10,9 @@ import org.apache.commons.lang.StringUtils;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import java.util.List;
import java.util.Map;
/** /**
* @author EBU7-dev1-ayh * @author EBU7-dev1-ayh
* create 2021/12/22 0022 17:27 * create 2021/12/22 0022 17:27
@ -25,10 +30,20 @@ public class TestCopy {
@Test @Test
public void test(){ public void test(){
MultipleCopyService multipleCopyService = new MultipleCopyService(); MultipleCopyService multipleCopyService = new MultipleCopyService();
MultipleCopyConfigVO configInfo = multipleCopyService.getConfigInfo("48"); List<MultipleCopyConfigVO> configInfo = multipleCopyService.getConfigInfo("48");
System.out.println(JSON.toJSONString(configInfo)); System.out.println(JSON.toJSONString(configInfo));
} }
@Test
public void test1(){
MultipleCopyMapper mapper = Util.getMapper(MultipleCopyMapper.class);
Map<String, Object> info = mapper.selectModelFiles("uf_copy_test2021011", 1);
System.out.println(info);
Map<String, Object> info1 = mapper.selectModelFiles("uf_copy_test2021011", 1);
System.out.println(info1);
}
@Test @Test
public void testUtil(){ public void testUtil(){
String str = "1,2"; String str = "1,2";

View File

@ -1,11 +1,12 @@
package utilTest; package utilTest;
import aiyh.utils.Util; import aiyh.utils.Util;
import aiyh.utils.entity.ApiConfigMainDTO;
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.sqlUtil.sqlResult.impl.PrepSqlResultImpl; import aiyh.utils.sqlUtil.sqlResult.impl.PrepSqlResultImpl;
import aiyh.utils.sqlUtil.whereUtil.Where;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.api.aiyh_pcn.fadada.service.impl.FaDDContractService;
import entity.ImageInfo; import entity.ImageInfo;
import mybatisTest.mapper.IMapperTest; import mybatisTest.mapper.IMapperTest;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -178,12 +179,12 @@ public class UtilTest {
@Test @Test
public void builderSelect(){ public void builderSelect() {
// 将以下数据插入到数据库中,比如 inset into name ,email values('update_name','update_email') // 将以下数据插入到数据库中,比如 inset into name ,email values('update_name','update_email')
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("name","update_name"); map.put("name", "update_name");
map.put("email","update_email"); map.put("email", "update_email");
map.put("phone","update_phone"); map.put("phone", "update_phone");
// 构建SQL // 构建SQL
PrepSqlResultImpl sqlResult = Util.createSqlBuilder().insertSql( PrepSqlResultImpl sqlResult = Util.createSqlBuilder().insertSql(
@ -192,11 +193,11 @@ public class UtilTest {
System.out.println(sqlResult); System.out.println(sqlResult);
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
// 执行SQL // 执行SQL
rs.executeUpdate(sqlResult.getSqlStr(),sqlResult.getArgs()); rs.executeUpdate(sqlResult.getSqlStr(), sqlResult.getArgs());
} }
@Test @Test
public void getRsValue(){ public void getRsValue() {
String sql = "select * from table"; String sql = "select * from table";
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
rs.executeQuery(sql); rs.executeQuery(sql);
@ -216,9 +217,8 @@ public class UtilTest {
} }
@Test @Test
public void testSqlUtil(){ public void testSqlUtil() {
// 获取代理对象 // 获取代理对象
IMapperTest mapper = Util.getMapper(IMapperTest.class); IMapperTest mapper = Util.getMapper(IMapperTest.class);
// 调用方法并获取返回值 // 调用方法并获取返回值
@ -228,7 +228,7 @@ public class UtilTest {
@Test @Test
public void testRequest(){ public void testRequest() {
// 构建工具实体 // 构建工具实体
HttpUtils httpUtils = new HttpUtils(); HttpUtils httpUtils = new HttpUtils();
// 获取该对象内的全局 请求头可以对put来添加请求头信息 // 获取该对象内的全局 请求头可以对put来添加请求头信息
@ -252,9 +252,32 @@ public class UtilTest {
} }
@Test @Test
public void testReadProp(){ public void testReadProp() {
Map<String, Object> patentWall = Util.readProperties2Map("PatentWall", "aiyh.patentWall.search"); Map<String, Object> patentWall = Util.readProperties2Map("PatentWall", "aiyh.patentWall.search");
System.out.println(JSON.toJSONString(patentWall)); System.out.println(JSON.toJSONString(patentWall));
} }
@Test
public void testTerr() {
FaDDContractService faDDContractService = new FaDDContractService();
ApiConfigMainDTO apiConfigMainDTO = Util.queryApiConfigTree("2");
System.out.println(JSON.toJSONString(apiConfigMainDTO));
// 查询签署数据
List<Map<String, Object>> dataArr = faDDContractService.getDataArr("68071", "45", "formtable_main_17", "formtable_main_17_dt1");
// 处理数据
List<Map<String, Object>> maps = faDDContractService.objectAndListHandle(apiConfigMainDTO.getDetails(), dataArr);
System.out.println(JSON.toJSONString(maps));
}
@Test
public void te(){
String test = ",7629,7632,";
System.out.println(test.contains(",7632,"));
}
} }

View File

@ -0,0 +1,28 @@
package utilTest;
import aiyh.utils.annotation.recordset.*;
import utilTest.entity.TestEntity;
import java.util.List;
import java.util.Map;
/**
* create 2022/1/10 0010 19:57
*
* @author EBU7-dev1-ayh
*/
@SqlMapper
public interface UtilsTestMapper {
@Select(value = "select * from uf_copy_multiple")
public List<Map<String,Object>> selectAll();
@Select(custom = true)
// @CaseConversion(false)
public TestEntity selectOne(@SqlString String sql, @ParamMapper("id") int id);
@Select(value = "select * from uf_copy_multiple where name = #{name} and age = #{age} and sex = ${sex}")
void selectOneByMap(Map<String, Object> map);
}