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
020cb085
Commit
020cb085
authored
Apr 23, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加文档接口设备统计
parent
e09aecae
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1783 additions
and
1014 deletions
+1783
-1014
base-manager/db/add.sql
base-manager/db/add.sql
+7
-1
base-manager/pom.xml
base-manager/pom.xml
+6
-1
base-manager/src/main/java/com/mortals/xhx/base/framework/filter/SampleFilter.java
...a/com/mortals/xhx/base/framework/filter/SampleFilter.java
+23
-0
base-manager/src/main/java/com/mortals/xhx/base/system/resource/dao/ResourceDao.java
...com/mortals/xhx/base/system/resource/dao/ResourceDao.java
+11
-9
base-manager/src/main/java/com/mortals/xhx/common/utils/SyncGovMatterDetailThread.java
...m/mortals/xhx/common/utils/SyncGovMatterDetailThread.java
+1
-1
base-manager/src/main/java/com/mortals/xhx/module/dept/service/impl/DeptServiceImpl.java
...mortals/xhx/module/dept/service/impl/DeptServiceImpl.java
+3
-1
base-manager/src/main/java/com/mortals/xhx/module/matter/dao/MatterDao.java
...ain/java/com/mortals/xhx/module/matter/dao/MatterDao.java
+3
-0
base-manager/src/main/java/com/mortals/xhx/module/matter/dao/ibatis/MatterDaoImpl.java
...m/mortals/xhx/module/matter/dao/ibatis/MatterDaoImpl.java
+10
-0
base-manager/src/main/java/com/mortals/xhx/module/matter/service/MatterService.java
.../com/mortals/xhx/module/matter/service/MatterService.java
+2
-0
base-manager/src/main/java/com/mortals/xhx/module/site/model/SiteThemeMatterEntity.java
.../mortals/xhx/module/site/model/SiteThemeMatterEntity.java
+46
-182
base-manager/src/main/java/com/mortals/xhx/module/site/model/SiteThemeMatterQuery.java
...m/mortals/xhx/module/site/model/SiteThemeMatterQuery.java
+951
-392
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteMatterServiceImpl.java
...s/xhx/module/site/service/impl/SiteMatterServiceImpl.java
+29
-1
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
...mortals/xhx/module/site/service/impl/SiteServiceImpl.java
+43
-8
base-manager/src/main/resources/config/mybatis-sqlmap-config.xml
...nager/src/main/resources/config/mybatis-sqlmap-config.xml
+2
-1
base-manager/src/main/resources/logback-spring.xml
base-manager/src/main/resources/logback-spring.xml
+39
-0
base-manager/src/main/resources/sqlmap/base/system/task.xml
base-manager/src/main/resources/sqlmap/base/system/task.xml
+2
-0
base-manager/src/main/resources/sqlmap/module/matter/MatterMapperExt.xml
...c/main/resources/sqlmap/module/matter/MatterMapperExt.xml
+18
-4
base-manager/src/main/resources/sqlmap/module/site/SiteThemeMatterMapper.xml
...in/resources/sqlmap/module/site/SiteThemeMatterMapper.xml
+586
-412
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/db/add.sql
View file @
020cb085
...
...
@@ -39,4 +39,10 @@ INSERT INTO `mortals_xhx_param` VALUES (null, '应用主题 ', 'App', 'appThemeN
2023
-
4
-
12
-- ----------------------------
ALTER
TABLE
mortals_sys_site_matter
ADD
COLUMN
`hot`
tinyint
(
2
)
DEFAULT
'0'
COMMENT
'热门(0.否,1.是)'
AFTER
eventTypeShow
;
ALTER
TABLE
mortals_sys_site_matter
ADD
COLUMN
`display`
tinyint
(
2
)
DEFAULT
'0'
COMMENT
'显示(0.否,1.是)'
AFTER
hot
;
ALTER
TABLE
mortals_sys_site_matter
ADD
COLUMN
`display`
tinyint
(
2
)
DEFAULT
'1'
COMMENT
'显示(0.否,1.是)'
AFTER
hot
;
-- ----------------------------
2023
-
4
-
23
-- ----------------------------
ALTER
TABLE
mortals_sys_site_theme_matter
ADD
COLUMN
`hot`
tinyint
(
2
)
DEFAULT
'0'
COMMENT
'热门(0.否,1.是)'
AFTER
userType
;
ALTER
TABLE
mortals_sys_site_theme_matter
ADD
COLUMN
`display`
tinyint
(
2
)
DEFAULT
'1'
COMMENT
'显示(0.否,1.是)'
AFTER
hot
;
base-manager/pom.xml
View file @
020cb085
...
...
@@ -36,7 +36,7 @@
<profiles.nacos.group>
DEFAULT_GROUP
</profiles.nacos.group>
<profiles.nacos.namespace>
smart-gov
</profiles.nacos.namespace>
<profiles.log.path>
/home/mortals/app/logs
</profiles.log.path>
<profiles.log.level>
INFO
</profiles.log.level>
<profiles.log.level>
debug
</profiles.log.level>
<package.environment>
test
</package.environment>
<skipUi>
false
</skipUi>
</properties>
...
...
@@ -119,6 +119,11 @@
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
</dependency>
<dependency>
<groupId>
org.codehaus.janino
</groupId>
<artifactId>
janino
</artifactId>
<version>
3.1.2
</version>
</dependency>
<dependency>
<groupId>
org.springframework.data
</groupId>
...
...
base-manager/src/main/java/com/mortals/xhx/base/framework/filter/SampleFilter.java
0 → 100644
View file @
020cb085
package
com.mortals.xhx.base.framework.filter
;
import
ch.qos.logback.classic.spi.ILoggingEvent
;
import
ch.qos.logback.core.filter.Filter
;
import
ch.qos.logback.core.spi.FilterReply
;
import
lombok.extern.slf4j.Slf4j
;
@Slf4j
public
class
SampleFilter
extends
Filter
<
ILoggingEvent
>
{
@Override
public
FilterReply
decide
(
ILoggingEvent
event
)
{
System
.
out
.
println
(
"message==>"
+
event
.
getMessage
());
if
(
event
.
getMessage
().
contains
(
"sample"
))
{
return
FilterReply
.
ACCEPT
;
}
else
{
return
FilterReply
.
NEUTRAL
;
}
}
}
base-manager/src/main/java/com/mortals/xhx/base/system/resource/dao/ResourceDao.java
View file @
020cb085
/**
* 文件:ResourceDao.java
* 版本:1.0.0
* 日期:
* Copyright ®
* All right reserved.
*/
* 文件:ResourceDao.java
* 版本:1.0.0
* 日期:
* Copyright ®
* All right reserved.
*/
package
com.mortals.xhx.base.system.resource.dao
;
import
com.mortals.framework.dao.ICRUDDao
;
import
com.mortals.xhx.base.system.resource.model.ResourceEntity
;
import
com.mortals.xhx.module.matter.model.MatterEntity
;
import
java.util.List
;
...
...
@@ -19,12 +20,13 @@ import java.util.List;
* <p>Description: ResourceDao DAO接口 </p>
* <p>Copyright: Copyright ® </p>
* <p>Company: </p>
* @author
* @author
* @version 1.0.0
*/
public
interface
ResourceDao
extends
ICRUDDao
<
ResourceEntity
,
Long
>
{
public
List
<
ResourceEntity
>
getListByUserId
(
Long
userId
);
public
interface
ResourceDao
extends
ICRUDDao
<
ResourceEntity
,
Long
>
{
List
<
ResourceEntity
>
getListByUserId
(
Long
userId
);
List
<
ResourceEntity
>
getAll
(
int
userType
);
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/common/utils/SyncGovMatterDetailThread.java
View file @
020cb085
...
...
@@ -70,7 +70,7 @@ public class SyncGovMatterDetailThread implements Runnable {
@Override
public
void
run
()
{
log
.
info
(
"同步站点事项开始....."
);
Rest
<
String
>
deptRest
=
deptService
.
syncDeptBySiteId
(
siteEntity
,
context
);
//
Rest<String> deptRest = deptService.syncDeptBySiteId(siteEntity, context);
//log.info("同步站点部门:" + JSON.toJSONString(deptRest));
Rest
<
String
>
rest
=
siteService
.
syncMatterBySiteId
(
siteEntity
,
context
);
//Rest<String> rest = Rest.ok();
...
...
base-manager/src/main/java/com/mortals/xhx/module/dept/service/impl/DeptServiceImpl.java
View file @
020cb085
...
...
@@ -125,7 +125,9 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
for
(
Map
.
Entry
<
String
,
String
>
item
:
data
.
entrySet
())
{
String
deptCode
=
item
.
getKey
();
String
deptName
=
item
.
getValue
();
DeptEntity
deptEntity
=
deptService
.
selectOne
(
new
DeptQuery
().
siteId
(
siteId
).
deptNumber
(
deptCode
),
context
);
DeptEntity
deptEntity
=
deptService
.
getExtCache
(
deptCode
);
// DeptEntity deptEntity = deptService.selectOne(new DeptQuery().siteId(siteId).deptNumber(deptCode), context);
if
(
ObjectUtils
.
isEmpty
(
deptEntity
))
{
deptEntity
=
new
DeptEntity
();
deptEntity
.
initAttrValue
();
...
...
base-manager/src/main/java/com/mortals/xhx/module/matter/dao/MatterDao.java
View file @
020cb085
...
...
@@ -20,5 +20,8 @@ public interface MatterDao extends ICRUDDao<MatterEntity, Long> {
String
SQLID_SUB_LIST
=
"getSubList"
;
String
SQLID_SUB_COUNT
=
"getSubListCount"
;
Result
<
MatterEntity
>
getSubList
(
MatterEntity
matterQuery
,
PageInfo
pageInfo
);
List
<
MatterEntity
>
getMatterListByAreaCode
(
MatterEntity
matterQuery
);
}
base-manager/src/main/java/com/mortals/xhx/module/matter/dao/ibatis/MatterDaoImpl.java
View file @
020cb085
...
...
@@ -26,6 +26,7 @@ import java.util.List;
public
class
MatterDaoImpl
extends
BaseCRUDDaoMybatis
<
MatterEntity
,
Long
>
implements
MatterDao
{
@Override
public
Result
<
MatterEntity
>
getSubList
(
MatterEntity
matterQuery
,
PageInfo
pageInfo
)
{
Result
<
MatterEntity
>
result
=
new
Result
();
...
...
@@ -49,4 +50,13 @@ public class MatterDaoImpl extends BaseCRUDDaoMybatis<MatterEntity, Long> implem
public
int
getSubCount
(
ParamDto
paramDto
)
{
return
this
.
getSqlSession
().
selectOne
(
this
.
getSqlId
(
SQLID_SUB_COUNT
),
this
.
cpyQueryParamDto
(
paramDto
));
}
@Override
public
List
<
MatterEntity
>
getMatterListByAreaCode
(
MatterEntity
matterQuery
)
{
ParamDto
param
=
new
ParamDto
();
param
.
getCondition
().
put
(
"areaCode"
,
matterQuery
.
getAreaCode
());
return
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
"getMatterListByAreaCode"
),
param
);
}
}
base-manager/src/main/java/com/mortals/xhx/module/matter/service/MatterService.java
View file @
020cb085
...
...
@@ -6,6 +6,7 @@ import com.mortals.framework.model.Context;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.Result
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.matter.dao.MatterDao
;
import
com.mortals.xhx.module.matter.model.MatterEntity
;
import
com.mortals.xhx.module.matter.model.MatterQuery
;
import
com.mortals.xhx.module.matter.model.vo.MatterInfo
;
...
...
@@ -25,6 +26,7 @@ import java.util.Map;
public
interface
MatterService
extends
ICRUDService
<
MatterEntity
,
Long
>
{
MatterDao
getDao
();
/**
* 添加业务到站点
*
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/model/SiteThemeMatterEntity.java
View file @
020cb085
package
com.mortals.xhx.module.site.model
;
import
java.util.List
;
import
java.util.ArrayList
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.mortals.framework.annotation.Excel
;
import
com.mortals.framework.model.BaseEntityLong
;
import
com.mortals.xhx.module.site.model.vo.SiteThemeMatterVo
;
import
lombok.Data
;
/**
* 站点主题事项实体对象
*
* @author zxfei
* @date 2022-11
-23
*/
* 站点主题事项实体对象
*
* @author zxfei
* @date 2023-04
-23
*/
@Data
public
class
SiteThemeMatterEntity
extends
SiteThemeMatterVo
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 站点ID
*/
* 站点ID
*/
private
Long
siteId
;
/**
* 站点名称
*/
* 站点名称
*/
private
String
siteName
;
/**
* 事项ID
*/
* 事项ID
*/
private
Long
matterId
;
/**
* 事项名称
*/
* 事项名称
*/
private
String
matterName
;
/**
* 事项编码
*/
* 事项编码
*/
private
String
matterCode
;
/**
* 服务类型(1.公共服务,2.个人服务,3.法人服务)
*/
* 服务类型(1.公共服务,2.个人服务,3.法人服务)
*/
private
String
userType
;
/**
* 主题编码
*/
* 主题编码
*/
private
String
themeCode
;
/**
* 主题名称
*/
* 主题名称
*/
private
String
themeName
;
/**
* 事项来源
*/
* 事项来源
*/
private
Integer
source
;
public
SiteThemeMatterEntity
(){}
/**
* 获取 站点ID
* @return Long
*/
public
Long
getSiteId
(){
return
siteId
;
}
/**
* 设置 站点ID
* @param siteId
*/
public
void
setSiteId
(
Long
siteId
){
this
.
siteId
=
siteId
;
}
/**
* 获取 站点名称
* @return String
*/
public
String
getSiteName
(){
return
siteName
;
}
/**
* 设置 站点名称
* @param siteName
*/
public
void
setSiteName
(
String
siteName
){
this
.
siteName
=
siteName
;
}
/**
* 获取 事项ID
* @return Long
*/
public
Long
getMatterId
(){
return
matterId
;
}
/**
* 设置 事项ID
* @param matterId
*/
public
void
setMatterId
(
Long
matterId
){
this
.
matterId
=
matterId
;
}
/**
* 获取 事项名称
* @return String
*/
public
String
getMatterName
(){
return
matterName
;
}
/**
* 设置 事项名称
* @param matterName
*/
public
void
setMatterName
(
String
matterName
){
this
.
matterName
=
matterName
;
}
/**
* 获取 事项编码
* @return String
*/
public
String
getMatterCode
(){
return
matterCode
;
}
/**
* 设置 事项编码
* @param matterCode
*/
public
void
setMatterCode
(
String
matterCode
){
this
.
matterCode
=
matterCode
;
}
* 热门(0.否,1.是)
*/
private
Integer
hot
;
/**
* 获取 服务类型(1.公共服务,2.个人服务,3.法人服务)
* @return String
*/
public
String
getUserType
(){
return
userType
;
}
/**
* 设置 服务类型(1.公共服务,2.个人服务,3.法人服务)
* @param userType
*/
public
void
setUserType
(
String
userType
){
this
.
userType
=
userType
;
}
/**
* 获取 主题编码
* @return String
*/
public
String
getThemeCode
(){
return
themeCode
;
}
/**
* 设置 主题编码
* @param themeCode
*/
public
void
setThemeCode
(
String
themeCode
){
this
.
themeCode
=
themeCode
;
}
/**
* 获取 主题名称
* @return String
*/
public
String
getThemeName
(){
return
themeName
;
}
/**
* 设置 主题名称
* @param themeName
*/
public
void
setThemeName
(
String
themeName
){
this
.
themeName
=
themeName
;
}
/**
* 获取 事项来源
* @return Integer
*/
public
Integer
getSource
(){
return
source
;
}
/**
* 设置 事项来源
* @param source
*/
public
void
setSource
(
Integer
source
){
this
.
source
=
source
;
}
* 显示(0.否,1.是)
*/
private
Integer
display
;
@Override
public
int
hashCode
()
{
return
this
.
getId
().
hashCode
();
return
this
.
getId
().
hashCode
();
}
@Override
public
boolean
equals
(
Object
obj
)
{
...
...
@@ -196,44 +70,34 @@ public class SiteThemeMatterEntity extends SiteThemeMatterVo {
if
(
obj
instanceof
SiteThemeMatterEntity
)
{
SiteThemeMatterEntity
tmp
=
(
SiteThemeMatterEntity
)
obj
;
if
(
this
.
getId
()
==
tmp
.
getId
())
{
return
true
;
return
true
;
}
}
return
false
;
}
public
String
toString
(){
StringBuilder
sb
=
new
StringBuilder
(
""
);
sb
.
append
(
",siteId:"
).
append
(
getSiteId
());
sb
.
append
(
",siteName:"
).
append
(
getSiteName
());
sb
.
append
(
",matterId:"
).
append
(
getMatterId
());
sb
.
append
(
",matterName:"
).
append
(
getMatterName
());
sb
.
append
(
",matterCode:"
).
append
(
getMatterCode
());
sb
.
append
(
",userType:"
).
append
(
getUserType
());
sb
.
append
(
",themeCode:"
).
append
(
getThemeCode
());
sb
.
append
(
",themeName:"
).
append
(
getThemeName
());
sb
.
append
(
",source:"
).
append
(
getSource
());
return
sb
.
toString
();
}
public
void
initAttrValue
(){
this
.
siteId
=
null
;
this
.
siteId
=
null
;
this
.
siteName
=
""
;
this
.
matterId
=
null
;
this
.
siteName
=
null
;
this
.
matterName
=
""
;
this
.
matterId
=
null
;
this
.
matterCode
=
null
;
this
.
matterNam
e
=
null
;
this
.
userTyp
e
=
null
;
this
.
matterCode
=
null
;
this
.
themeCode
=
""
;
this
.
userType
=
null
;
this
.
themeName
=
""
;
this
.
themeCode
=
null
;
this
.
source
=
1
;
this
.
themeName
=
null
;
this
.
hot
=
0
;
this
.
source
=
null
;
this
.
display
=
1
;
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/site/model/SiteThemeMatterQuery.java
View file @
020cb085
This diff is collapsed.
Click to expand it.
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteMatterServiceImpl.java
View file @
020cb085
...
...
@@ -6,6 +6,10 @@ import com.mortals.framework.model.PageInfo;
import
com.mortals.xhx.module.matter.model.MatterEntity
;
import
com.mortals.xhx.module.matter.model.MatterQuery
;
import
com.mortals.xhx.module.matter.service.MatterService
;
import
com.mortals.xhx.module.site.model.SiteThemeMatterEntity
;
import
com.mortals.xhx.module.site.model.SiteThemeMatterQuery
;
import
com.mortals.xhx.module.site.service.SiteThemeMatterService
;
import
com.mortals.xhx.module.site.service.SiteThemeService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
...
...
@@ -31,10 +35,12 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao
@Autowired
private
MatterService
matterService
;
@Autowired
private
SiteThemeMatterService
siteThemeMatterService
;
@Override
protected
void
findAfter
(
SiteMatterEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
SiteMatterEntity
>
list
)
throws
AppException
{
// List<Long> matterIdlist = list.parallelStream().map(item -> item.getMatterId()).collect(Collectors.toList());
// List<Long> matterIdlist = list.parallelStream().map(item -> item.getMatterId()).collect(Collectors.toList());
//Map<Long, MatterEntity> matterEntityMap = matterService.find(new MatterQuery().idList(matterIdlist)).parallelStream().collect(Collectors.toMap(x -> x.getId(), y -> y, (o, n) -> n));
list
.
forEach
(
item
->
{
if
(!
ObjectUtils
.
isEmpty
(
item
.
getMatterId
()))
{
...
...
@@ -69,6 +75,28 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao
matterService
.
update
(
matterEntity
,
context
);
}
}
SiteThemeMatterEntity
siteThemeMatterEntity
=
siteThemeMatterService
.
selectOne
(
new
SiteThemeMatterQuery
().
matterId
(
entity
.
getMatterId
()));
if
(!
ObjectUtils
.
isEmpty
(
siteThemeMatterEntity
))
{
siteThemeMatterEntity
.
setHot
(
entity
.
getHot
());
siteThemeMatterEntity
.
setDisplay
(
entity
.
getDisplay
());
}
}
/**
* @param entity
* @param context
* @throws AppException
*/
@Override
protected
void
saveBefore
(
SiteMatterEntity
entity
,
Context
context
)
throws
AppException
{
super
.
saveBefore
(
entity
,
context
);
SiteThemeMatterEntity
siteThemeMatterEntity
=
siteThemeMatterService
.
selectOne
(
new
SiteThemeMatterQuery
().
matterId
(
entity
.
getMatterId
()));
if
(!
ObjectUtils
.
isEmpty
(
siteThemeMatterEntity
))
{
siteThemeMatterEntity
.
setHot
(
entity
.
getHot
());
siteThemeMatterEntity
.
setDisplay
(
entity
.
getDisplay
());
}
}
@Override
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
View file @
020cb085
...
...
@@ -403,7 +403,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
PageInfo
pageInfo
=
new
PageInfo
();
pageInfo
.
setCurrPage
(
1
);
pageInfo
.
setPrePageResult
(
10
);
return
siteEntities
;
...
...
@@ -466,7 +465,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
areaQuery
.
setPid
(
areaEntity
.
getIid
());
List
<
AreaEntity
>
childList
=
areaService
.
find
(
areaQuery
,
context
);
for
(
AreaEntity
child
:
childList
)
{
siteAreaVo
=
new
SiteAreaVo
();
siteAreaVo
=
new
SiteAreaVo
();
siteAreaVo
.
setAreaCode
(
child
.
getAreaCode
());
siteAreaVo
.
setAreaName
(
child
.
getName
());
...
...
@@ -480,7 +479,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
if
(!
ObjectUtils
.
isEmpty
(
siteEntities
))
{
siteAreaVo
.
setSiteList
(
siteEntities
);
//map.put(child.getName(), siteEntities);
}
else
{
}
else
{
//没有站点
siteAreaVo
.
setSiteList
(
Collections
.
EMPTY_LIST
);
}
...
...
@@ -502,14 +501,14 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
query
.
setAreaLevel
(
siteEntity
.
getAreaLevel
());
}
}
//获取所有层级的区域
//获取所有层级的区域
List
<
AreaEntity
>
areaEntities
=
areaService
.
find
(
new
AreaQuery
().
areaLevel
(
query
.
getAreaLevel
()));
List
<
SiteEntity
>
list
=
new
ArrayList
<>();
for
(
AreaEntity
areaEntity
:
areaEntities
)
{
List
<
SiteEntity
>
siteEntityList
=
this
.
find
(
new
SiteQuery
().
areaCode
(
areaEntity
.
getAreaCode
()));
if
(!
ObjectUtils
.
isEmpty
(
siteEntityList
))
{
if
(!
ObjectUtils
.
isEmpty
(
siteEntityList
))
{
list
.
addAll
(
siteEntityList
);
}
}
...
...
@@ -628,6 +627,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
//String dxType = AreaLevelDxTypeEnum.getByValue(areaEntity == null ? 2 : areaEntity.getAreaLevel()).getDesc();
// String dxType="2";
//String dxType = "3";
log
.
info
(
"抓取事项开始"
);
List
<
MatterEntity
>
govMatterList
=
new
ArrayList
<>();
List
<
DeptEntity
>
deptEntities
=
deptService
.
find
(
new
DeptQuery
().
siteId
(
siteEntity
.
getId
()).
source
(
0
));
for
(
DeptEntity
deptEntity
:
deptEntities
)
{
...
...
@@ -643,6 +643,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
govMatterList
.
addAll
(
deptMatterList
);
}
}
log
.
info
(
"抓取事项结束"
);
/* HashMap<String, String> params = new HashMap<>();
params.put("dxType", dxType);
params.put("areaCode", siteEntity.getAreaCode());
...
...
@@ -666,11 +667,40 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
List<MatterEntity> mattersTwo = this.getMatters(params, context);
govMatterList.addAll(mattersTwo);*/
List
<
MatterEntity
>
localMatterList
=
matterService
.
find
(
new
MatterQuery
().
areaCode
(
siteEntity
.
getAreaCode
()));
List
<
MatterEntity
>
subList
=
this
.
subList
(
govMatterList
,
localMatterList
);
// new MatterQuery().setMatterNoNotList();
// List<MatterEntity> localMatterList = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()));
//HashSet<String> matterNoSet = new HashSet<>();
Set
<
String
>
matterNoSet
=
matterService
.
getDao
().
getMatterListByAreaCode
(
new
MatterQuery
().
areaCode
(
siteEntity
.
getAreaCode
())).
parallelStream
().
map
(
i
->
i
.
getMatterNo
()).
collect
(
Collectors
.
toSet
());
/* Integer page = 1;
Integer size = 200;
PageInfo pageInfo = new PageInfo();
pageInfo.setCountPage(false);
while (true) {
pageInfo.setCurrPage(page);
pageInfo.setPrePageResult(size);
Result<MatterEntity> matterEntityResult = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()), pageInfo, context);
if (ObjectUtils.isEmpty(matterEntityResult.getList())) {
break;
}
Set<String> collect = matterEntityResult.getList().parallelStream().map(i -> i.getMatterNo()).collect(Collectors.toSet());
matterNoSet.addAll(collect);
page++;
log.info("page:{},size:{}", page, collect.size());
}*/
log
.
info
(
"计算差集"
);
// List<MatterEntity> subList = this.subList(govMatterList, localMatterList);
List
<
MatterEntity
>
subList
=
this
.
subListSet
(
govMatterList
,
matterNoSet
);
log
.
info
(
"抓取事项总数:{}需要添加事项数量:{}"
,
govMatterList
.
size
(),
subList
.
size
());
subList
=
subList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
log
.
info
(
"需要添加事项过滤后数量:{}"
,
subList
.
size
());
log
.
info
(
"需要添加事项过滤后数量:{}"
,
subList
.
size
());
//差集进行插入并更新详细数据
if
(!
ObjectUtils
.
isEmpty
(
subList
))
{
for
(
MatterEntity
matterEntity
:
subList
)
{
...
...
@@ -736,5 +766,10 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
return
firstList
.
parallelStream
().
filter
(
item
->
!
secondSet
.
contains
(
item
.
getMatterNo
())).
collect
(
Collectors
.
toList
());
}
public
List
<
MatterEntity
>
subListSet
(
List
<
MatterEntity
>
firstList
,
Set
<
String
>
secondSet
)
{
// Set<String> secondSet = secondList.parallelStream().map(e -> e.getMatterNo()).collect(Collectors.toSet());
return
firstList
.
parallelStream
().
filter
(
item
->
!
secondSet
.
contains
(
item
.
getMatterNo
())).
collect
(
Collectors
.
toList
());
}
}
\ No newline at end of file
base-manager/src/main/resources/config/mybatis-sqlmap-config.xml
View file @
020cb085
...
...
@@ -9,7 +9,8 @@
<setting
name=
"useGeneratedKeys"
value=
"false"
/>
<setting
name=
"defaultExecutorType"
value=
"REUSE"
/>
<!-- 是否开始sql日志控制台打印 -->
<!-- <setting name="logImpl" value="STDOUT_LOGGING" />-->
<setting
name=
"logPrefix"
value=
"com.mapper"
/>
<!-- <setting name="logImpl" value="SLF4J" />-->
</settings>
<plugins>
<plugin
interceptor=
"com.mortals.framework.thirty.mybatis.MortalsPagePlugin"
>
...
...
base-manager/src/main/resources/logback-spring.xml
View file @
020cb085
...
...
@@ -9,13 +9,47 @@
<!-- appender用来格式化日志输出节点,有俩个属性name和class,class用来指定哪种输出策略,常用就是控制台输出策略和文件输出策略 -->
<!-- 控制台输出策略-->
<appender
name=
"console"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<!-- 添加过滤器 -->
<!-- <filter class="com.mortals.xhx.base.framework.filter.SampleFilter" />-->
<!-- <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator>
<expression>
return false;
</expression>
</evaluator>
<OnMatch>ACCEPT</OnMatch>
<OnMismatch>DENY</OnMismatch>
</filter>-->
<encoder>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%X{traceId}] [%thread] [%.50c\(%L\)] - %msg%n
</pattern>
</encoder>
</appender>
<!-- 文件输出策略-->
<appender
name=
"fileInfo"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<!-- 添加过滤器 -->
<!--<filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator>
<expression>
// 判断 SQL 语句是否包含 "<!– no log –>" 注释
return !message.contains("<!– no log –>");
</expression>
</evaluator>
<OnMismatch>DENY</OnMismatch>
</filter>-->
<!-- 添加过滤器 -->
<!-- <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
<evaluator>
<expression>
return false;
</expression>
</evaluator>
<OnMatch>ACCEPT</OnMatch>
<OnMismatch>DENY</OnMismatch>
</filter>-->
<encoder>
<pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%X{traceId}] [%thread] [%.50c\(%L\)] - %msg%n
</pattern>
</encoder>
...
...
@@ -27,6 +61,7 @@
<!--日志文件保留天数-->
<MaxHistory>
15
</MaxHistory>
</rollingPolicy>
</appender>
<!-- 异常文件输出策略-->
<appender
name=
"fileError"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
...
...
@@ -57,6 +92,10 @@
<!-- level 用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。如果未设置此属性,那么当前logger将会继承上级的级别-->
<!-- additivity 是否向上级logger传递打印信息。默认是true。false:表示只用当前logger的appender-ref。true:表示当前logger的appender-ref和rootLogger的appender-ref都有效。-->
<logger
name=
"com.mapper"
level=
"debug"
additivity=
"false"
>
<appender-ref
ref=
"console"
/>
</logger>
<logger
name=
"com.mortals"
level=
"${logLevel}"
additivity=
"false"
>
<appender-ref
ref=
"console"
/>
<appender-ref
ref=
"fileInfo"
/>
...
...
base-manager/src/main/resources/sqlmap/base/system/task.xml
View file @
020cb085
...
...
@@ -189,6 +189,7 @@
<!-- 根据主健查询 -->
<select
id=
"getByKey"
parameterType=
"paramDto"
resultMap=
"TaskEntity-Map"
>
<!-- no log -->
select
<include
refid=
"_columns"
/>
from mortals_xhx_task as a
where a.id=#{condition.id}
...
...
@@ -216,6 +217,7 @@
</delete>
<!-- 获取列表 -->
<select
id=
"getList"
parameterType=
"paramDto"
resultMap=
"TaskEntity-Map"
>
<!-- no log -->
select
<include
refid=
"_columns"
/>
from mortals_xhx_task as a
<trim
suffixOverrides=
"where"
suffix=
""
>
...
...
base-manager/src/main/resources/sqlmap/module/matter/MatterMapperExt.xml
View file @
020cb085
...
...
@@ -10,10 +10,10 @@
LEFT JOIN ( SELECT matterCode FROM mortals_sys_site_matter
<trim
suffixOverrides=
"where"
suffix=
""
>
<if
test=
"condition.siteId!=null and condition.siteId!=''"
>
where
siteId = #{condition.siteId}
where siteId = #{condition.siteId}
</if>
</trim>
)AS b ON a.matterNo = b.matterCode
)AS b ON a.matterNo = b.matterCode
<trim
suffixOverrides=
"where"
suffix=
""
>
where b.matterCode IS NULL and
<trim
prefixOverrides=
"and"
prefix=
""
>
...
...
@@ -42,7 +42,7 @@
LEFT JOIN ( SELECT matterCode FROM mortals_sys_site_matter
<trim
suffixOverrides=
"where"
suffix=
""
>
<if
test=
"condition.siteId!=null and condition.siteId!=''"
>
where
siteId = #{condition.siteId,jdbcType=VARCHAR}
where siteId = #{condition.siteId,jdbcType=VARCHAR}
</if>
</trim>
) AS b ON a.matterNo = b.matterCode
...
...
@@ -56,7 +56,7 @@
and a.deptCode = #{condition.deptCode,jdbcType=VARCHAR}
</if>
<if
test=
"condition.matterName != null and condition.matterName != ''"
>
and a.matterName like #{condition.matterName}
and a.matterName like #{condition.matterName}
</if>
<if
test=
"condition.source!=null"
>
and a.source = #{condition.source,jdbcType=INTEGER}
...
...
@@ -64,4 +64,18 @@
</trim>
</trim>
</select>
<select
id=
"getMatterListByAreaCode"
parameterType=
"paramDto"
resultMap=
"MatterEntity-Map"
>
select
a.matterNo
FROM
mortals_sys_matter AS a
where
<trim
prefixOverrides=
"and"
prefix=
""
>
<if
test=
"condition.areaCode!=null and condition.areaCode!=''"
>
and a.areaCode = #{condition.areaCode,jdbcType=VARCHAR}
</if>
</trim>
</select>
</mapper>
\ No newline at end of file
base-manager/src/main/resources/sqlmap/module/site/SiteThemeMatterMapper.xml
View file @
020cb085
This diff is collapsed.
Click to expand it.
base-manager/src/test/java/com/mortals/httpclient/site/SiteController.http
View file @
020cb085
...
...
@@ -104,7 +104,7 @@ POST {{baseUrl}}/site/syncGovMatterBySiteId
Content-Type: application/json
{
"id":
3
"id":
1
}
...
...
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