修改正则表达式可以匹配'`?`'的形式

main
youHong.ai 2022-12-06 19:21:31 +08:00
parent e83d55c455
commit 501bddf2f1
5 changed files with 46 additions and 27 deletions

1
.gitignore vendored
View File

@ -39,6 +39,7 @@ DirectoryV2.xml
/lib/weaverLib/
*.groovy
*.log
*.iml
src/main/resources/WEB-INF/sqllog/
java.io.tempdir/

View File

@ -73,8 +73,7 @@ import java.util.zip.ZipEntry;
/**
* @author EBU7-dev1-ayh
* @date 2021/8/23 0023 11:42
* mybatisTest.dao
* @date 2021/8/23 0023 11:42 mybatisTest.dao
*/
@ -91,16 +90,15 @@ public class Util extends weaver.general.Util {
public static final char UNICODE_END = 65374;
public static final char DBC_SBC_STEP = 65248; // 全角半角转换间隔
public static final ExecutorService threadPool = ThreadPoolConfig.createThreadPoolInstance();
public static final String UF_CUS_DEV_CONFIG = "uf_cus_dev_config";
private static final UtilService utilService = new UtilService();
private static final RecordsetUtil recordsetUtil = new RecordsetUtil();
private static final UtilMapper mapper = recordsetUtil.getMapper(UtilMapper.class);
public static final String UF_CUS_DEV_CONFIG = "uf_cus_dev_config";
private static final Map<String, Logger> otherLog = new HashMap<>(8);
static ToolUtil toolUtil = new ToolUtil();
private static RecordSet rs;
private static volatile Logger log = null;
private static final Map<String, Logger> otherLog = new HashMap<>(8);
static {
try {
rs = new RecordSet();
@ -3463,7 +3461,7 @@ public class Util extends weaver.general.Util {
// 最终通过反射调用weaver.aiyh_jitu.pushdata.service.GetAssignProcessorProcessorImpl类将参数传递给这个类
// String pattern = "&?(?<key>([#.\\w\\u4E00-\\u9FA5]+))=(?<value>((#(\\{|sql\\{))?([()\\-$#={ }.\\w\\u4E00-\\u9FA5?]+)?}?))&?";
String pattern = "&?(?<key>([#.\\w\\u4E00-\\u9FA5]+))=" +
"(?<value>((`([():/\\-&$#={ }.\\w\\u4E00-\\u9FA5?]*)`)|" +
"(?<value>((`([():/\\-&?$#={ }.\\w\\u4E00-\\u9FA5?]*)`)|" +
"((#(\\{|sql\\{))?([():/\\-$#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
Pattern compile = Pattern.compile(pattern);
Matcher matcher = compile.matcher(paramStr);

View File

@ -57,7 +57,28 @@ public class OrgChartService {
Builder.startSet(item).with(HrmResourceDto::setShow, 1).with(HrmResourceDto::setShowBrother, 1).with(HrmResourceDto::setShowChildren, 1).with(HrmResourceDto::setCurrent, true).endSet();
currentUser.set(item);
});
Assert.notNull(currentUser, "not find current login user info!");
/* ******************* 系统管理员默认全部展开哦 ******************* */
if (userId == 1) {
List<OrgChartNodeVo> collect = hrmResourceDtoList.stream()
.map(struct::hrmResourceDtoToVo)
.peek(item -> Builder.startSet(item)
.with(OrgChartNodeVo::setShow, 1)
.with(OrgChartNodeVo::setShowBrother, 1)
.with(OrgChartNodeVo::setShowChildren, 1)
.with(OrgChartNodeVo::setCurrent, true)
.endSet())
.collect(Collectors.toList());
return Util.listToTree(collect, OrgChartNodeVo::getId, OrgChartNodeVo::getManagerId,
OrgChartNodeVo::getChildren, OrgChartNodeVo::setChildren,
parentId -> parentId == null || parentId <= 0)
.stream().peek(item -> Builder.startSet(item)
.with(OrgChartNodeVo::setIsRoot, true)
.with(OrgChartNodeVo::setCurrentParent, true)
.endSet())
.peek(item -> recursionChildrenNums(item, 0))
.collect(Collectors.toList());
}
Assert.notNull(currentUser.get(), "not find current login user info!");
/* ******************* 查找当前登陆人员的所有上级 ******************* */
String currentUserManagerStr = currentUser.get().getManagerStr();
if (Objects.isNull(currentUserManagerStr)) {
@ -100,8 +121,7 @@ public class OrgChartService {
*
* @param chartNodeVo
* @return Integer
* @author youHong.ai
* ******************************************
* @author youHong.ai ******************************************
*/
private Integer recursionChildrenNums(OrgChartNodeVo chartNodeVo, int n) {
List<OrgChartNodeVo> children = chartNodeVo.getChildren();

View File

@ -540,8 +540,7 @@ public class DealWithMapping extends ToolUtil {
*
* <h1>:</h1>
* <p>
* v2.0 xuanran.wang
* {?requestid}requestid {?}
* v2.0 xuanran.wang {?requestid}requestid {?}
* <p>
*/
private Object normalValueDeal(Map<String, Object> mainMap, Map<String, Object> detailMap, MappingDetail mappingDetail) {
@ -783,7 +782,8 @@ public class DealWithMapping extends ToolUtil {
break;
case Object: {
// 当是object类型时不转换 保留原有格式
}break;
}
break;
default:
return value;
}
@ -801,8 +801,7 @@ public class DealWithMapping extends ToolUtil {
*
* <h1>:</h1>
* <p>
* v2.0 xuanran.wang
* {?requestid}requestid {?}
* v2.0 xuanran.wang {?requestid}requestid {?}
* <p>
*/
private Object normalValueDeal(Map<String, Object> mainMap, Map<String, Object> detailMap, RecordSet relationRs, MappingDetail mappingDetail) {
@ -1070,7 +1069,8 @@ public class DealWithMapping extends ToolUtil {
break;
case Object: {
// 当是object类型时不转换 保留原有格式
}break;
}
break;
default:
return value;
}
@ -1337,7 +1337,7 @@ public class DealWithMapping extends ToolUtil {
value:haode*/
// 最终通过反射调用weaver.aiyh_jitu.pushdata.service.GetAssignProcessorProcessorImpl类将参数传递给这个类 使用``包裹的字符串会被解析为一个字符串
String pattern = "&?(?<key>([#.\\w\\u4E00-\\u9FA5]+))=" +
"(?<value>((`([():/\\-&$#={ }.\\w\\u4E00-\\u9FA5?]*)`)|" +
"(?<value>((`([():/\\-&$?#={ }.\\w\\u4E00-\\u9FA5?]*)`)|" +
"((#(\\{|sql\\{))?([():/\\-$#={ }.\\w\\u4E00-\\u9FA5?]+)?}?)))&?";
Pattern compile = Pattern.compile(pattern);
Matcher matcher = compile.matcher(paramStr);

View File

@ -195,7 +195,7 @@ public class TestOrganization extends BaseTest {
@Test
public void testOrgChart() {
User user = new User(84);
User user = new User(1);
OrgChartService orgChartService = new OrgChartService();
List<OrgChartNodeVo> orgChartTree = orgChartService.getOrgChartTree(user);
System.out.println(JSON.toJSONString(orgChartTree));