Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
65e8a3f5
Commit
65e8a3f5
authored
Jul 15, 2024
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
企微托管
parent
4c735ce4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
9 deletions
+48
-9
OpenStaffServiceImpl.java
...ban/manage/service/service/impl/OpenStaffServiceImpl.java
+5
-1
CustomSwitcher.java
...va/com/gic/haoban/manage/service/util/CustomSwitcher.java
+16
-0
OpenUtils.java
...in/java/com/gic/haoban/manage/service/util/OpenUtils.java
+10
-8
SwitcherInitialization.java
...ic/haoban/manage/service/util/SwitcherInitialization.java
+17
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/OpenStaffServiceImpl.java
View file @
65e8a3f5
...
...
@@ -291,7 +291,11 @@ public class OpenStaffServiceImpl implements OpenStaffService {
List
<
TabOpenStaff
>
staffList
=
this
.
openStaffMapper
.
listAllOnline
(
wxEnterpriseId
,
enterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
staffList
))
{
staffList
.
forEach
(
o
->{
this
.
logout
(
o
.
getUuid
(),
"服务过期"
,
0
,
null
);
try
{
this
.
logout
(
o
.
getUuid
(),
"服务过期"
,
0
,
null
);
}
catch
(
Exception
e
)
{
log
.
info
(
"异常"
,
e
);
}
});
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/CustomSwitcher.java
0 → 100644
View file @
65e8a3f5
package
com
.
gic
.
haoban
.
manage
.
service
.
util
;
import
com.gic.commons.switcher.Switcher
;
import
com.gic.commons.switcher.SwitcherNamespace
;
@SwitcherNamespace
(
"BUZ.qywx.open"
)
public
class
CustomSwitcher
{
/**
* 积分触不通知会员名单
*/
@Switcher
public
static
String
qywx_open_host
;
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/OpenUtils.java
View file @
65e8a3f5
...
...
@@ -19,14 +19,16 @@ public class OpenUtils {
private
static
final
String
gicCallbackHost
=
GlobalVar
.
ctxPropertiesMap
.
get
(
"haoban_service_host"
)
+
"/haoban-manage3-operation-web/qywx-msg-notice"
;
private
static
final
String
openHost
=
ConfigService
.
getConfig
(
"BUZ.qywx.open"
).
getProperty
(
"qywx_open_host"
,
""
)
;
private
static
String
getHost
()
{
return
CustomSwitcher
.
qywx_open_host
;
}
public
static
ServiceResponse
<
QwOpenResultInitBO
>
init
(
Long
qwUserId
,
boolean
qrcodeFlag
)
{
JSONObject
initJson
=
new
JSONObject
();
if
(
null
!=
qwUserId
)
{
initJson
.
put
(
"vid"
,
qwUserId
);
}
String
initStr
=
HttpClient
.
sendPostJSON
(
String
.
format
(
openHost
,
"init"
),
initJson
.
toJSONString
(),
"utf-8"
);
String
initStr
=
HttpClient
.
sendPostJSON
(
String
.
format
(
getHost
()
,
"init"
),
initJson
.
toJSONString
(),
"utf-8"
);
logger
.
info
(
"企微初始化,req={},{}"
,
initJson
.
toJSONString
(),
initStr
);
QwOpenResultBO
initResult
=
result
(
initStr
);
if
(!
initResult
.
isOk
())
{
...
...
@@ -55,7 +57,7 @@ public class OpenUtils {
json
.
put
(
"uuid"
,
uuid
);
json
.
put
(
"qrcodeKey"
,
qrcodeKey
);
json
.
put
(
"code"
,
validCode
);
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
openHost
,
"CheckCode"
),
json
.
toJSONString
(),
"utf-8"
);
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
getHost
()
,
"CheckCode"
),
json
.
toJSONString
(),
"utf-8"
);
logger
.
info
(
"校验验证码={},uuid={}"
,
backJson
,
uuid
);
QwOpenResultBO
bo
=
result
(
backJson
);
if
(!
bo
.
isOk
())
{
...
...
@@ -67,7 +69,7 @@ public class OpenUtils {
public
static
void
logout
(
String
uuid
)
{
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"uuid"
,
uuid
);
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
openHost
,
"LoginOut"
),
json
.
toJSONString
(),
"utf-8"
);
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
getHost
()
,
"LoginOut"
),
json
.
toJSONString
(),
"utf-8"
);
logger
.
info
(
"退出={},uuid={}"
,
backJson
,
uuid
);
}
...
...
@@ -75,7 +77,7 @@ public class OpenUtils {
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"uuid"
,
uuid
);
json
.
put
(
"url"
,
gicCallbackHost
);
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
openHost
,
"SetCallbackUrl"
),
json
.
toJSONString
(),
"utf-8"
);
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
getHost
()
,
"SetCallbackUrl"
),
json
.
toJSONString
(),
"utf-8"
);
logger
.
info
(
"设置回调={},uuid={}"
,
backJson
,
uuid
);
}
...
...
@@ -86,7 +88,7 @@ public class OpenUtils {
}
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"uuid"
,
uuid
);
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
openHost
,
req
),
json
.
toJSONString
(),
"utf-8"
);
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
getHost
()
,
req
),
json
.
toJSONString
(),
"utf-8"
);
logger
.
info
(
"获取qrcode={},uuid={},times={}"
,
backJson
,
uuid
,
times
);
QwOpenResultBO
initResult
=
result
(
backJson
);
if
(!
initResult
.
isOk
())
{
...
...
@@ -115,7 +117,7 @@ public class OpenUtils {
public
static
boolean
autoLogin
(
String
uuid
)
{
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"uuid"
,
uuid
);
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
openHost
,
"automaticLogin"
),
json
.
toJSONString
(),
"utf-8"
);
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
getHost
()
,
"automaticLogin"
),
json
.
toJSONString
(),
"utf-8"
);
logger
.
info
(
"自动登录={},uuid={}"
,
backJson
,
uuid
);
JSONObject
resultJson
=
JSONObject
.
parseObject
(
backJson
);
int
errcode
=
resultJson
.
getIntValue
(
"errcode"
);
...
...
@@ -135,7 +137,7 @@ public class OpenUtils {
public
static
boolean
isLogin
(
String
uuid
)
{
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"uuid"
,
uuid
);
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
openHost
,
"GetProfile"
),
json
.
toJSONString
(),
"utf-8"
);
String
backJson
=
HttpClient
.
sendPostJSON
(
String
.
format
(
getHost
()
,
"GetProfile"
),
json
.
toJSONString
(),
"utf-8"
);
logger
.
info
(
"获取当前账号详情={},uuid={}"
,
backJson
,
uuid
);
JSONObject
resultJson
=
JSONObject
.
parseObject
(
backJson
);
int
errcode
=
resultJson
.
getIntValue
(
"errcode"
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/util/SwitcherInitialization.java
0 → 100644
View file @
65e8a3f5
package
com
.
gic
.
haoban
.
manage
.
service
.
util
;
import
com.gic.commons.switcher.SwitcherApplication
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.stereotype.Component
;
import
java.util.concurrent.atomic.AtomicBoolean
;
@Component
public
class
SwitcherInitialization
implements
InitializingBean
{
static
AtomicBoolean
INIT
=
new
AtomicBoolean
(
false
);
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
SwitcherApplication
.
init
(
CustomSwitcher
.
class
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment