Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
0d96e549
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0d96e549
编写于
1月 06, 2021
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
系统设计搜索返回内容增加匹配结果
上级
0dc9b7fb
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
94 addition
and
33 deletion
+94
-33
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WrapDesigner.java
...main/java/com/x/base/core/project/jaxrs/WrapDesigner.java
+66
-16
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/designer/ActionSearch.java
...m/x/cms/assemble/control/jaxrs/designer/ActionSearch.java
+1
-1
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/designer/ActionSearch.java
...portal/assemble/designer/jaxrs/designer/ActionSearch.java
+1
-1
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/ActionSearch.java
...atform/assemble/designer/jaxrs/designer/ActionSearch.java
+1
-1
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/designer/ActionSearch.java
...ava/com/x/program/center/jaxrs/designer/ActionSearch.java
+1
-1
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/designer/ActionSearch.java
.../query/assemble/designer/jaxrs/designer/ActionSearch.java
+1
-1
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/design/ActionSearch.java
...x/query/service/processing/jaxrs/design/ActionSearch.java
+14
-3
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/design/BaseAction.java
...m/x/query/service/processing/jaxrs/design/BaseAction.java
+9
-9
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/jaxrs/WrapDesigner.java
浏览文件 @
0d96e549
...
...
@@ -4,10 +4,7 @@ import com.x.base.core.entity.enums.DesignerType;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
public
class
WrapDesigner
extends
GsonPropertyObject
{
...
...
@@ -93,7 +90,13 @@ public class WrapDesigner extends GsonPropertyObject {
for
(
String
key
:
map
.
keySet
()){
DesignerPattern
pattern
=
new
DesignerPattern
();
pattern
.
setProperty
(
key
);
pattern
.
setPropertyValue
(
map
.
get
(
key
));
String
propertyValue
=
map
.
get
(
key
);
if
(!
DesignerType
.
script
.
toString
().
equals
(
this
.
getDesignerType
()))
{
if
(
propertyValue
!=
null
&&
propertyValue
.
length
()
>
255
)
{
propertyValue
=
propertyValue
.
substring
(
0
,
255
);
}
}
pattern
.
setPropertyValue
(
propertyValue
);
patternList
.
add
(
pattern
);
}
this
.
patternList
=
patternList
;
...
...
@@ -106,7 +109,13 @@ public class WrapDesigner extends GsonPropertyObject {
DesignerPattern
pattern
=
new
DesignerPattern
();
pattern
.
setElementType
(
elementType
);
pattern
.
setProperty
(
key
);
pattern
.
setPropertyValue
(
map
.
get
(
key
));
String
propertyValue
=
map
.
get
(
key
);
if
(!
DesignerType
.
script
.
toString
().
equals
(
this
.
getDesignerType
()))
{
if
(
propertyValue
!=
null
&&
propertyValue
.
length
()
>
255
)
{
propertyValue
=
propertyValue
.
substring
(
0
,
255
);
}
}
pattern
.
setPropertyValue
(
propertyValue
);
this
.
patternList
.
add
(
pattern
);
}
}
...
...
@@ -120,7 +129,13 @@ public class WrapDesigner extends GsonPropertyObject {
pattern
.
setElementId
(
elementId
);
pattern
.
setElementName
(
elementName
);
pattern
.
setProperty
(
key
);
pattern
.
setPropertyValue
(
map
.
get
(
key
));
String
propertyValue
=
map
.
get
(
key
);
if
(!
DesignerType
.
script
.
toString
().
equals
(
this
.
getDesignerType
()))
{
if
(
propertyValue
!=
null
&&
propertyValue
.
length
()
>
255
)
{
propertyValue
=
propertyValue
.
substring
(
0
,
255
);
}
}
pattern
.
setPropertyValue
(
propertyValue
);
this
.
patternList
.
add
(
pattern
);
}
}
...
...
@@ -138,12 +153,8 @@ public class WrapDesigner extends GsonPropertyObject {
for
(
DesignerPattern
pattern
:
this
.
patternList
){
if
(
"text"
.
equals
(
pattern
.
getProperty
())){
designerPattern
=
pattern
;
}
else
{
pattern
.
setPropertyValue
(
null
);
}
}
}
else
{
this
.
clearPatternValue
();
}
return
designerPattern
;
}
...
...
@@ -160,11 +171,27 @@ public class WrapDesigner extends GsonPropertyObject {
@FieldDescribe
(
"设计属性."
)
private
String
property
;
@FieldDescribe
(
"设计属性."
)
@FieldDescribe
(
"设计属性
值
."
)
private
String
propertyValue
;
@FieldDescribe
(
"匹配行"
)
private
List
<
Integer
>
lines
;
@FieldDescribe
(
"script匹配行"
)
private
List
<
PatternLine
>
lines
;
public
void
setLines
(
Map
<
Integer
,
String
>
map
){
if
(
map
!=
null
){
List
<
PatternLine
>
lines
=
new
ArrayList
<>();
Iterator
<
Map
.
Entry
<
Integer
,
String
>>
iterator
=
map
.
entrySet
().
iterator
();
while
(
iterator
.
hasNext
()){
Map
.
Entry
<
Integer
,
String
>
entry
=
iterator
.
next
();
PatternLine
patternLine
=
new
PatternLine
();
patternLine
.
setLine
(
entry
.
getKey
());
patternLine
.
setLineValue
(
entry
.
getValue
());
lines
.
add
(
patternLine
);
}
this
.
lines
=
lines
;
map
.
clear
();
}
}
public
String
getElementType
()
{
return
elementType
;
...
...
@@ -198,11 +225,11 @@ public class WrapDesigner extends GsonPropertyObject {
this
.
property
=
property
;
}
public
List
<
Integer
>
getLines
()
{
public
List
<
PatternLine
>
getLines
()
{
return
lines
;
}
public
void
setLines
(
List
<
Integer
>
lines
)
{
public
void
setLines
(
List
<
PatternLine
>
lines
)
{
this
.
lines
=
lines
;
}
...
...
@@ -215,4 +242,27 @@ public class WrapDesigner extends GsonPropertyObject {
}
}
public
class
PatternLine
extends
GsonPropertyObject
{
@FieldDescribe
(
"第几行匹配到"
)
private
Integer
line
;
@FieldDescribe
(
"匹配行内容"
)
private
String
lineValue
;
public
Integer
getLine
()
{
return
line
;
}
public
void
setLine
(
Integer
line
)
{
this
.
line
=
line
;
}
public
String
getLineValue
()
{
return
lineValue
;
}
public
void
setLineValue
(
String
lineValue
)
{
this
.
lineValue
=
lineValue
;
}
}
}
o2server/x_cms_assemble_control/src/main/java/com/x/cms/assemble/control/jaxrs/designer/ActionSearch.java
浏览文件 @
0d96e549
...
...
@@ -37,7 +37,7 @@ class ActionSearch extends BaseAction {
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
logger
.
info
(
"{}开始内容管理设计搜索,关键字:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
.
getKeyword
());
logger
.
debug
(
"{}开始内容管理设计搜索,关键字:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
.
getKeyword
());
if
(
StringUtils
.
isBlank
(
wi
.
getKeyword
())){
throw
new
ExceptionFieldEmpty
(
"keyword"
);
}
...
...
o2server/x_portal_assemble_designer/src/main/java/com/x/portal/assemble/designer/jaxrs/designer/ActionSearch.java
浏览文件 @
0d96e549
...
...
@@ -38,7 +38,7 @@ class ActionSearch extends BaseAction {
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
logger
.
info
(
"{}开始门户设计搜索,关键字:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
.
getKeyword
());
logger
.
debug
(
"{}开始门户设计搜索,关键字:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
.
getKeyword
());
if
(
StringUtils
.
isBlank
(
wi
.
getKeyword
())){
throw
new
ExceptionFieldEmpty
(
"keyword"
);
}
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/designer/ActionSearch.java
浏览文件 @
0d96e549
...
...
@@ -39,7 +39,7 @@ class ActionSearch extends BaseAction {
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
logger
.
info
(
"{}开始流程平台设计搜索,关键字:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
.
getKeyword
());
logger
.
debug
(
"{}开始流程平台设计搜索,关键字:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
.
getKeyword
());
if
(
StringUtils
.
isBlank
(
wi
.
getKeyword
())){
throw
new
ExceptionFieldEmpty
(
"keyword"
);
}
...
...
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/designer/ActionSearch.java
浏览文件 @
0d96e549
...
...
@@ -35,7 +35,7 @@ class ActionSearch extends BaseAction {
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
logger
.
info
(
"{}开始服务管理设计搜索,关键字:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
.
getKeyword
());
logger
.
debug
(
"{}开始服务管理设计搜索,关键字:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
.
getKeyword
());
if
(
StringUtils
.
isBlank
(
wi
.
getKeyword
())){
throw
new
ExceptionFieldEmpty
(
"keyword"
);
}
...
...
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/designer/ActionSearch.java
浏览文件 @
0d96e549
...
...
@@ -38,7 +38,7 @@ class ActionSearch extends BaseAction {
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
logger
.
info
(
"{}开始数据中心设计搜索,关键字:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
.
getKeyword
());
logger
.
debug
(
"{}开始数据中心设计搜索,关键字:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
.
getKeyword
());
if
(
StringUtils
.
isBlank
(
wi
.
getKeyword
())){
throw
new
ExceptionFieldEmpty
(
"keyword"
);
}
...
...
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/design/ActionSearch.java
浏览文件 @
0d96e549
...
...
@@ -19,10 +19,12 @@ import org.apache.commons.lang3.StringUtils;
import
java.util.*
;
import
java.util.concurrent.*
;
import
java.util.concurrent.locks.ReentrantLock
;
class
ActionSearch
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionSearch
.
class
);
private
static
ReentrantLock
lock
=
new
ReentrantLock
();
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
...
...
@@ -31,8 +33,17 @@ class ActionSearch extends BaseAction {
if
(
StringUtils
.
isBlank
(
wi
.
getKeyword
())){
throw
new
ExceptionFieldEmpty
(
"keyword"
);
}
logger
.
print
(
"{}搜索全局设计:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
);
logger
.
info
(
"{}搜索全局设计:{}"
,
effectivePerson
.
getDistinguishedName
(),
wi
);
if
(
ListTools
.
isEmpty
(
wi
.
getModuleList
()))
{
result
.
setData
(
search
(
wi
));
}
else
{
lock
.
lock
();
try
{
result
.
setData
(
search
(
wi
));
}
finally
{
lock
.
unlock
();
}
}
return
result
;
}
...
...
@@ -132,7 +143,7 @@ class ActionSearch extends BaseAction {
for
(
WrapDesigner
designer
:
designerList
)
{
WrapDesigner
.
DesignerPattern
pattern
=
designer
.
getScriptDesigner
();
if
(
pattern
!=
null
)
{
List
<
Integer
>
lines
=
patternLines
(
designer
.
getDesignerId
()
+
"-"
+
designer
.
getUpdateTime
().
getTime
(),
Map
<
Integer
,
String
>
lines
=
patternLines
(
designer
.
getDesignerId
()
+
"-"
+
designer
.
getUpdateTime
().
getTime
(),
wi
.
getKeyword
(),
pattern
.
getPropertyValue
(),
wi
.
getCaseSensitive
(),
wi
.
getMatchWholeWord
(),
wi
.
getMatchRegExp
());
pattern
.
setLines
(
lines
);
pattern
.
setPropertyValue
(
null
);
...
...
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/design/BaseAction.java
浏览文件 @
0d96e549
...
...
@@ -2,24 +2,21 @@ package com.x.query.service.processing.jaxrs.design;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.base.core.project.jaxrs.WrapDesigner
;
import
com.x.base.core.project.tools.DefaultCharset
;
import
com.x.base.core.project.tools.FileTools
;
import
com.x.base.core.project.tools.StringTools
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.File
;
import
java.io.RandomAccessFile
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.*
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
protected
List
<
Integer
>
patternLines
(
String
id
,
String
keyword
,
String
content
,
Boolean
caseSensitive
,
Boolean
matchWholeWord
,
Boolean
matchRegExp
){
List
<
Integer
>
list
=
new
ArrayList
<>();
protected
Map
<
Integer
,
String
>
patternLines
(
String
id
,
String
keyword
,
String
content
,
Boolean
caseSensitive
,
Boolean
matchWholeWord
,
Boolean
matchRegExp
){
Map
<
Integer
,
String
>
map
=
new
LinkedHashMap
<>();
File
file
=
readFile
(
id
,
content
);
if
(
file
!=
null
){
try
(
RandomAccessFile
randomFile
=
new
RandomAccessFile
(
file
,
"r"
))
{
...
...
@@ -31,7 +28,10 @@ abstract class BaseAction extends StandardJaxrsAction {
String
lineStr
=
new
String
(
bytes
);
if
(
StringUtils
.
isNotBlank
(
lineStr
)
&&
lineStr
.
length
()>=
keyword
.
length
()){
if
(
StringTools
.
matchKeyword
(
keyword
,
lineStr
,
caseSensitive
,
matchWholeWord
,
matchRegExp
)){
list
.
add
(
curReadLine
);
if
(
lineStr
.
length
()>
500
){
lineStr
=
lineStr
.
substring
(
0
,
500
);
}
map
.
put
(
curReadLine
,
lineStr
);
}
}
}
...
...
@@ -39,7 +39,7 @@ abstract class BaseAction extends StandardJaxrsAction {
e
.
printStackTrace
();
}
}
return
list
;
return
map
;
}
private
synchronized
File
readFile
(
String
id
,
String
content
){
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录