Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
3e06d377
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,发现更多精彩内容 >>
提交
3e06d377
编写于
11月 18, 2021
作者:
F
fancy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
钉钉 企业微信单点的bug修复
上级
87eed6f7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
83 addition
and
3 deletion
+83
-3
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/MD5Tool.java
.../src/main/java/com/x/base/core/project/tools/MD5Tool.java
+37
-0
o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/DingdingConsumeQueue.java
.../x/message/assemble/communicate/DingdingConsumeQueue.java
+4
-2
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/factory/PersonFactory.java
...zation/assemble/authentication/factory/PersonFactory.java
+26
-0
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/jaxrs/qiyeweixin/ActionGetLogin.java
...emble/authentication/jaxrs/qiyeweixin/ActionGetLogin.java
+4
-1
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/jaxrs/qiyeweixin/ExceptionQywexinRepeated.java
...entication/jaxrs/qiyeweixin/ExceptionQywexinRepeated.java
+12
-0
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/MD5Tool.java
浏览文件 @
3e06d377
...
...
@@ -2,6 +2,8 @@ package com.x.base.core.project.tools;
import
org.apache.commons.lang3.StringUtils
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
/**
...
...
@@ -53,6 +55,41 @@ public class MD5Tool {
// TODO Auto-generated method stub
String
test
=
MD5Tool
.
getMD5
(
"1qaz2wsx"
.
getBytes
());
System
.
out
.
println
(
test
);
/*String str="this is (Tom) and \"Eric\", this is \"Bruce lee\", he is a chinese, name is \"李小龙\"。";
Pattern p= Pattern.compile("\"(.*?)\"");
Matcher m=p.matcher(str);
while(m.find()){
System.out.println(m.group());
}*/
String
str
=
"this is [Tom] and , he is a [李小花], name [is]。"
;
Matcher
mat
=
Pattern
.
compile
(
"(?<=\\[)(\\S+)(?=\\])"
).
matcher
(
str
);
while
(
mat
.
find
()){
System
.
out
.
println
(
mat
.
group
());
}
String
filetext
=
"//[张小名] 25分//[李小花] 43分//[王力] 100分"
;
Pattern
p
=
Pattern
.
compile
(
"\\[(.*?)\\]"
);
//正则表达式,取=和|之间的字符串,不包括=和|
Matcher
m
=
p
.
matcher
(
filetext
);
while
(
m
.
find
())
{
System
.
out
.
println
(
m
.
group
(
1
));
//m.group(1)不包括这两个字符
}
String
url
=
"http://ip:20020/x_meeting_assemble_control/jaxrs/meeting/adf3c245-dbef-41ef-b323-dfb5fae4afb7/checkin"
;
Pattern
purl
=
Pattern
.
compile
(
"x_meeting_assemble_control\\/jaxrs\\/meeting\\/(.*?)\\/checkin"
);
//正则表达式
Matcher
murl
=
purl
.
matcher
(
url
);
if
(
murl
.
find
())
{
System
.
out
.
println
(
murl
.
group
(
1
));
//m.group(1)不包括这两个字符
}
}
}
o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/DingdingConsumeQueue.java
浏览文件 @
3e06d377
...
...
@@ -81,10 +81,12 @@ public class DingdingConsumeQueue extends AbstractQueue<Message> {
String
messageRedirectPortal
=
Config
.
dingding
().
getMessageRedirectPortal
();
if
(
messageRedirectPortal
!=
null
&&
!
""
.
equals
(
messageRedirectPortal
))
{
String
portal
=
"portalmobile.html?id="
+
messageRedirectPortal
;
portal
=
URLEncoder
.
encode
(
portal
,
DefaultCharset
.
name
);
// 2021-11-1 钉钉那边无法使用了 不能进行encode 否则签名不通过
// portal = URLEncoder.encode(portal, DefaultCharset.name);
workUrl
+=
"&redirectlink="
+
portal
;
}
workUrl
=
URLEncoder
.
encode
(
workUrl
,
DefaultCharset
.
name
);
// 2021-11-1 钉钉那边无法使用了 不能进行encode 否则签名不通过
// workUrl = URLEncoder.encode(workUrl, DefaultCharset.name);
logger
.
info
(
"o2oa workUrl:"
+
workUrl
);
o2oaUrl
=
o2oaUrl
+
"ddsso.html?redirect="
+
workUrl
;
logger
.
info
(
"o2oa 地址:"
+
o2oaUrl
);
...
...
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/factory/PersonFactory.java
浏览文件 @
3e06d377
...
...
@@ -135,4 +135,30 @@ public class PersonFactory extends AbstractFactory {
return
null
;
}
}
public
String
getPersonIdWithQywxid
(
String
credential
)
throws
Exception
{
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
Person
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Person
>
root
=
cq
.
from
(
Person
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Person_
.
qiyeweixinId
),
credential
);
cq
.
select
(
root
.
get
(
Person_
.
id
)).
where
(
p
);
List
<
String
>
list
=
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
if
(
list
.
size
()
==
1
)
{
return
list
.
get
(
0
);
}
else
if
(
list
.
size
()
>
1
){
String
temp
=
""
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
if
(
temp
.
equalsIgnoreCase
(
""
))
{
temp
=
list
.
get
(
i
);
}
else
{
temp
=
temp
+
","
+
list
.
get
(
i
);
}
}
return
temp
;
}
else
{
return
null
;
}
}
}
\ No newline at end of file
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/jaxrs/qiyeweixin/ActionGetLogin.java
浏览文件 @
3e06d377
...
...
@@ -52,10 +52,13 @@ class ActionGetLogin extends BaseAction {
String
userId
=
jsonElement
.
getAsJsonObject
().
get
(
"UserId"
).
getAsString
();
Business
business
=
new
Business
(
emc
);
String
personId
=
business
.
person
().
get
WithCredential
(
userId
);
String
personId
=
business
.
person
().
get
PersonIdWithQywxid
(
userId
);
if
(
StringUtils
.
isEmpty
(
personId
))
{
throw
new
ExceptionPersonNotExist
(
userId
);
}
if
(
personId
.
indexOf
(
","
)
>
0
)
{
throw
new
ExceptionQywexinRepeated
(
userId
);
}
Person
person
=
emc
.
find
(
personId
,
Person
.
class
);
Wo
wo
=
Wo
.
copier
.
copy
(
person
);
List
<
String
>
roles
=
business
.
organization
().
role
().
listWithPerson
(
person
.
getDistinguishedName
());
...
...
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/jaxrs/qiyeweixin/ExceptionQywexinRepeated.java
0 → 100644
浏览文件 @
3e06d377
package
com.x.organization.assemble.authentication.jaxrs.qiyeweixin
;
import
com.x.base.core.project.exception.PromptException
;
class
ExceptionQywexinRepeated
extends
PromptException
{
private
static
final
long
serialVersionUID
=
4132300948670472899L
;
ExceptionQywexinRepeated
(
String
userId
)
{
super
(
"查询到重复的企业微信userid. {} "
,
userId
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录