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
7e80949f
Commit
7e80949f
authored
Dec 08, 2022
by
“yiyousong”
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.scsmile.cn/zxf/smart_gov_platform
parents
28f86b73
67c1a627
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
8 deletions
+45
-8
base-manager/src/main/java/com/mortals/xhx/common/utils/SyncGovMatterDetailThread.java
...m/mortals/xhx/common/utils/SyncGovMatterDetailThread.java
+16
-6
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteThemeMatterServiceImpl.java
.../module/site/service/impl/SiteThemeMatterServiceImpl.java
+28
-1
base-manager/src/test/java/com/mortals/httpclient/site/SiteController.http
...test/java/com/mortals/httpclient/site/SiteController.http
+1
-1
No files found.
base-manager/src/main/java/com/mortals/xhx/common/utils/SyncGovMatterDetailThread.java
View file @
7e80949f
...
@@ -4,10 +4,12 @@ import cn.hutool.core.collection.ListUtil;
...
@@ -4,10 +4,12 @@ import cn.hutool.core.collection.ListUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICacheService
;
import
com.mortals.xhx.ManagerBaseApplication
;
import
com.mortals.xhx.ManagerBaseApplication
;
import
com.mortals.xhx.common.code.DxTypeEnum
;
import
com.mortals.xhx.common.code.DxTypeEnum
;
import
com.mortals.xhx.common.code.SourceEnum
;
import
com.mortals.xhx.common.code.SourceEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.keys.RedisCacheKeys
;
import
com.mortals.xhx.module.area.model.AreaEntity
;
import
com.mortals.xhx.module.area.model.AreaEntity
;
import
com.mortals.xhx.module.area.service.AreaService
;
import
com.mortals.xhx.module.area.service.AreaService
;
import
com.mortals.xhx.module.dept.service.DeptService
;
import
com.mortals.xhx.module.dept.service.DeptService
;
...
@@ -52,6 +54,8 @@ public class SyncGovMatterDetailThread implements Runnable {
...
@@ -52,6 +54,8 @@ public class SyncGovMatterDetailThread implements Runnable {
private
Context
context
;
private
Context
context
;
private
ICacheService
cacheService
;
public
SyncGovMatterDetailThread
(
SiteEntity
siteEntity
,
Context
context
)
{
public
SyncGovMatterDetailThread
(
SiteEntity
siteEntity
,
Context
context
)
{
this
.
siteEntity
=
siteEntity
;
this
.
siteEntity
=
siteEntity
;
...
@@ -63,6 +67,7 @@ public class SyncGovMatterDetailThread implements Runnable {
...
@@ -63,6 +67,7 @@ public class SyncGovMatterDetailThread implements Runnable {
this
.
siteMatterService
=
SpringUtils
.
getBean
(
SiteMatterService
.
class
);
this
.
siteMatterService
=
SpringUtils
.
getBean
(
SiteMatterService
.
class
);
this
.
siteThemeService
=
SpringUtils
.
getBean
(
SiteThemeService
.
class
);
this
.
siteThemeService
=
SpringUtils
.
getBean
(
SiteThemeService
.
class
);
this
.
siteThemeMatterService
=
SpringUtils
.
getBean
(
SiteThemeMatterService
.
class
);
this
.
siteThemeMatterService
=
SpringUtils
.
getBean
(
SiteThemeMatterService
.
class
);
this
.
cacheService
=
SpringUtils
.
getBean
(
ICacheService
.
class
);
}
}
@Override
@Override
...
@@ -120,13 +125,18 @@ public class SyncGovMatterDetailThread implements Runnable {
...
@@ -120,13 +125,18 @@ public class SyncGovMatterDetailThread implements Runnable {
//街道,镇,乡
//街道,镇,乡
Rest
<
String
>
themeTownRest
=
siteThemeService
.
syncTownThemeBySiteId
(
siteEntity
,
context
);
Rest
<
String
>
themeTownRest
=
siteThemeService
.
syncTownThemeBySiteId
(
siteEntity
,
context
);
log
.
info
(
"同步乡镇站点主题:"
+
JSON
.
toJSONString
(
themeTownRest
));
log
.
info
(
"同步乡镇站点主题:"
+
JSON
.
toJSONString
(
themeTownRest
));
siteThemeMatterService
.
deleteGovBySiteId
(
siteEntity
.
getId
(),
context
);
if
(
themeTownRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
String
dxType
=
DxTypeEnum
.
街道镇服务
.
getValue
();
siteThemeMatterService
.
deleteGovBySiteId
(
siteEntity
.
getId
(),
context
);
if
(
areaEntity
.
getAreaLevel
()
==
5
)
{
String
dxType
=
DxTypeEnum
.
街道镇服务
.
getValue
();
dxType
=
DxTypeEnum
.
乡村服务
.
getValue
();
if
(
areaEntity
.
getAreaLevel
()
==
5
)
{
dxType
=
DxTypeEnum
.
乡村服务
.
getValue
();
}
Rest
<
String
>
townThemeRest
=
siteThemeMatterService
.
syncTownThemeMatterBySiteId
(
siteEntity
,
dxType
,
context
);
log
.
info
(
"同步站点乡镇主题事项:"
+
JSON
.
toJSONString
(
townThemeRest
));
}
else
{
cacheService
.
hdel
(
RedisCacheKeys
.
getSyncMatterLockKey
()
+
siteEntity
.
getAreaCode
(),
siteEntity
.
getAreaCode
());
log
.
info
(
"同步站点乡镇主题事项失败:"
+
themeTownRest
.
getData
());
}
}
Rest
<
String
>
townThemeRest
=
siteThemeMatterService
.
syncTownThemeMatterBySiteId
(
siteEntity
,
dxType
,
context
);
log
.
info
(
"同步站点乡镇主题事项:"
+
JSON
.
toJSONString
(
townThemeRest
));
}
}
log
.
info
(
"同步站点事项结束....."
);
log
.
info
(
"同步站点事项结束....."
);
}
}
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteThemeMatterServiceImpl.java
View file @
7e80949f
...
@@ -138,6 +138,7 @@ public class SiteThemeMatterServiceImpl extends AbstractCRUDServiceImpl<SiteThem
...
@@ -138,6 +138,7 @@ public class SiteThemeMatterServiceImpl extends AbstractCRUDServiceImpl<SiteThem
params
.
put
(
"dxType"
,
dxType
);
params
.
put
(
"dxType"
,
dxType
);
params
.
put
(
"areaCode"
,
siteEntity
.
getAreaCode
());
params
.
put
(
"areaCode"
,
siteEntity
.
getAreaCode
());
List
<
SiteThemeEntity
>
siteThemeEntities
=
siteThemeService
.
find
(
new
SiteThemeQuery
().
siteId
(
siteEntity
.
getId
()));
List
<
SiteThemeEntity
>
siteThemeEntities
=
siteThemeService
.
find
(
new
SiteThemeQuery
().
siteId
(
siteEntity
.
getId
()));
int
sum
=
0
;
for
(
SiteThemeEntity
item
:
siteThemeEntities
)
{
for
(
SiteThemeEntity
item
:
siteThemeEntities
)
{
params
.
put
(
"theme"
,
item
.
getThemeCode
());
params
.
put
(
"theme"
,
item
.
getThemeCode
());
params
.
put
(
"userType"
,
item
.
getUserType
());
params
.
put
(
"userType"
,
item
.
getUserType
());
...
@@ -160,9 +161,35 @@ public class SiteThemeMatterServiceImpl extends AbstractCRUDServiceImpl<SiteThem
...
@@ -160,9 +161,35 @@ public class SiteThemeMatterServiceImpl extends AbstractCRUDServiceImpl<SiteThem
if
(
count
!=
total
)
{
if
(
count
!=
total
)
{
log
.
info
(
String
.
format
(
"获取数量异常,count:%s,total:%s,theme:%s"
,
count
,
total
,
item
.
getThemeName
()));
log
.
info
(
String
.
format
(
"获取数量异常,count:%s,total:%s,theme:%s"
,
count
,
total
,
item
.
getThemeName
()));
}
}
sum
+=
count
;
}
if
(!
ObjectUtils
.
isEmpty
(
allList
))
{
//当前主题列表 查找站点事项id列表,保存站点主题事项
List
<
String
>
matterCodeList
=
allList
.
stream
().
map
(
m
->
m
.
getMatterNo
()).
collect
(
Collectors
.
toList
());
SiteMatterQuery
siteMatterQuery
=
new
SiteMatterQuery
();
siteMatterQuery
.
setSiteId
(
siteEntity
.
getId
());
siteMatterQuery
.
setMatterCodeList
(
matterCodeList
);
List
<
SiteMatterEntity
>
siteMatterEntities
=
siteMatterService
.
find
(
siteMatterQuery
,
context
);
log
.
info
(
String
.
format
(
"size1:%d,size2:%d"
,
allList
.
size
(),
siteMatterEntities
.
size
()));
if
(!
ObjectUtils
.
isEmpty
(
siteMatterEntities
))
{
List
<
SiteThemeMatterEntity
>
collect
=
siteMatterEntities
.
stream
().
map
(
siteMatterEntity
->
{
SiteThemeMatterEntity
siteThemeMatterEntity
=
new
SiteThemeMatterEntity
();
siteThemeMatterEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
siteMatterEntity
,
siteThemeMatterEntity
,
BeanUtil
.
getNullPropertyNames
(
siteMatterEntity
));
siteThemeMatterEntity
.
setThemeCode
(
item
.
getThemeCode
());
siteThemeMatterEntity
.
setThemeName
(
item
.
getThemeName
());
siteThemeMatterEntity
.
setUserType
(
item
.
getUserType
());
return
siteThemeMatterEntity
;
}).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
collect
))
{
this
.
save
(
collect
,
context
);
}
}
}
}
}
}
return
Rest
.
ok
(
"乡镇主题更新完成"
);
return
Rest
.
ok
(
"乡镇主题更新完成"
,
"更新条数:"
+
sum
);
}
}
@Override
@Override
...
...
base-manager/src/test/java/com/mortals/httpclient/site/SiteController.http
View file @
7e80949f
...
@@ -86,7 +86,7 @@ Authorization: {{authToken}}
...
@@ -86,7 +86,7 @@ Authorization: {{authToken}}
Content-Type: application/json
Content-Type: application/json
{
{
"id":
7
"id":
26
}
}
...
...
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