Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
baaf0445
Commit
baaf0445
authored
Feb 14, 2025
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改部分一键部署功能
parent
c52ebdc3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
12 deletions
+80
-12
base-manager/src/main/java/com/mortals/xhx/common/key/RedisKey.java
...er/src/main/java/com/mortals/xhx/common/key/RedisKey.java
+1
-1
base-manager/src/main/java/com/mortals/xhx/module/window/service/impl/WindowBusinessServiceImpl.java
...module/window/service/impl/WindowBusinessServiceImpl.java
+78
-10
base-manager/src/test/java/com/mortals/httpclient/window/WindowBusinessController.http
...m/mortals/httpclient/window/WindowBusinessController.http
+1
-1
No files found.
base-manager/src/main/java/com/mortals/xhx/common/key/RedisKey.java
View file @
baaf0445
...
...
@@ -36,7 +36,7 @@ public class RedisKey {
/**
* 缓存过期时间(秒)
*/
public
static
final
Long
KEY_SEARCH_TIMEOUTT_CACHE
=
36
00L
;
public
static
final
Long
KEY_SEARCH_TIMEOUTT_CACHE
=
18
00L
;
/**
...
...
base-manager/src/main/java/com/mortals/xhx/module/window/service/impl/WindowBusinessServiceImpl.java
View file @
baaf0445
package
com.mortals.xhx.module.window.service.impl
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
...
...
@@ -165,25 +166,28 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
*/
@Override
protected
void
removeBefore
(
Long
[]
ids
,
Context
context
)
throws
AppException
{
/*
Arrays.asList(ids).forEach(id -> {
Arrays
.
asList
(
ids
).
forEach
(
id
->
{
WindowBusinessEntity
windowBusinessEntity
=
this
.
get
(
id
,
context
);
pushChangeMsg(windowBusinessEntity);
});*/
//更新站点业务缓存 SiteBusinessId
updateWindowBusinessCacheResult
(
windowBusinessEntity
,
context
);
// pushChangeMsg(windowBusinessEntity);
});
super
.
removeBefore
(
ids
,
context
);
}
/*
*//*
*
/**
* @param entity
* @param context
* @throws AppException
*/
/*
*/
@Override
protected
void
saveAfter
(
WindowBusinessEntity
entity
,
Context
context
)
throws
AppException
{
//通知php更新
pushChangeMsg(entity);
//更新站点业务缓存 SiteBusinessId
updateWindowBusinessCacheResult
(
entity
,
context
);
super
.
saveAfter
(
entity
,
context
);
}
*/
}
/* */
...
...
@@ -192,12 +196,76 @@ public class WindowBusinessServiceImpl extends AbstractCRUDServiceImpl<WindowBus
* @param entity
* @param context
* @throws AppException
*/
/*
*/
@Override
protected
void
updateAfter
(
WindowBusinessEntity
entity
,
Context
context
)
throws
AppException
{
pushChangeMsg(entity);
//pushChangeMsg(entity);
//更新站点业务缓存 SiteBusinessId
updateWindowBusinessCacheResult
(
entity
,
context
);
super
.
updateAfter
(
entity
,
context
);
}*/
}
private
void
updateWindowBusinessCacheResult
(
WindowBusinessEntity
entity
,
Context
context
)
{
Long
siteBusinessId
=
entity
.
getSiteBusinessId
();
String
cacheResult
=
cacheService
.
get
(
KEY_SEARCH_SITEBUSINESSID_CACHE
+
siteBusinessId
,
String
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
cacheResult
))
{
//更新查询结果
//查询数据库
PageInfo
pageInfo
=
new
PageInfo
();
pageInfo
.
setPrePageResult
(-
1
);
Result
<
WindowBusinessEntity
>
result
=
this
.
dao
.
getList
(
new
WindowBusinessQuery
().
siteBusinessId
(
siteBusinessId
),
pageInfo
);
this
.
findAfter
(
entity
,
pageInfo
,
context
,
result
.
getList
());
if
(!
ObjectUtils
.
isEmpty
(
result
.
getList
()))
{
cacheService
.
set
(
KEY_SEARCH_SITEBUSINESSID_CACHE
+
siteBusinessId
,
JSON
.
toJSONString
(
result
),
KEY_SEARCH_TIMEOUTT_CACHE
);
}
}
Long
windowId
=
entity
.
getWindowId
();
cacheResult
=
cacheService
.
get
(
KEY_SEARCH_WINDOWID_CACHE
+
windowId
,
String
.
class
);
if
(!
ObjectUtils
.
isEmpty
(
cacheResult
))
{
//查询数据库
PageInfo
pageInfo
=
new
PageInfo
();
pageInfo
.
setPrePageResult
(-
1
);
Result
<
WindowBusinessEntity
>
result
=
this
.
dao
.
getList
(
new
WindowBusinessQuery
().
siteBusinessId
(
siteBusinessId
),
pageInfo
);
this
.
findAfter
(
entity
,
pageInfo
,
context
,
result
.
getList
());
//无查询结果的不做保存
if
(!
ObjectUtils
.
isEmpty
(
result
.
getList
()))
{
cacheService
.
set
(
KEY_SEARCH_WINDOWID_CACHE
+
windowId
,
JSON
.
toJSONString
(
result
),
KEY_SEARCH_TIMEOUTT_CACHE
);
}
}
//窗口列表更新
Set
<
String
>
scanKeys
=
cacheService
.
scan
(
KEY_SEARCH_WINDOWID_LIST_CACHE
);
for
(
String
scanKey
:
scanKeys
)
{
log
.
info
(
"scanKey:{}"
,
scanKey
);
List
<
String
>
split
=
StrUtil
.
split
(
scanKey
,
"#"
);
List
<
Long
>
windowIdlist
=
split
.
stream
().
map
(
m
->
Long
.
parseLong
(
m
)).
collect
(
Collectors
.
toList
());
if
(
windowIdlist
.
contains
(
windowId
))
{
//更新窗口列表缓存
WindowBusinessQuery
windowBusinessQuery
=
new
WindowBusinessQuery
();
windowBusinessQuery
.
setWindowIdList
(
windowIdlist
);
//查询数据库
PageInfo
pageInfo
=
new
PageInfo
();
pageInfo
.
setPrePageResult
(-
1
);
Result
<
WindowBusinessEntity
>
result
=
this
.
dao
.
getList
(
windowBusinessQuery
,
pageInfo
);
this
.
findAfter
(
entity
,
pageInfo
,
context
,
result
.
getList
());
if
(!
ObjectUtils
.
isEmpty
(
result
.
getList
()))
{
String
windowIdlistStr
=
windowIdlist
.
stream
().
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
"#"
));
cacheService
.
set
(
KEY_SEARCH_WINDOWID_LIST_CACHE
+
windowIdlistStr
,
JSON
.
toJSONString
(
result
),
KEY_SEARCH_TIMEOUTT_CACHE
);
}
}
}
}
private
void
pushChangeMsg
(
WindowBusinessEntity
entity
)
{
String
phpUrl
=
GlobalSysInfo
.
getParamValue
(
PARAM_SERVER_PHP_HTTP_URL
,
"http://127.0.0.1:11078/zwfw_api"
);
phpUrl
+=
"/api/window/winNameChange"
;
...
...
base-manager/src/test/java/com/mortals/httpclient/window/WindowBusinessController.http
View file @
baaf0445
...
...
@@ -17,7 +17,7 @@ Content-Type: application/json
POST {{baseUrl}}/window/business/interlist
Content-Type: application/json
{"siteBusinessId":
212
,"searchCache": 1}
{"siteBusinessId":
43
,"searchCache": 1}
###窗口业务列表缓存2
POST {{baseUrl}}/window/business/interlist
...
...
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