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
a7755e1c
Commit
a7755e1c
authored
Mar 07, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加部门事项过滤
parent
4d07e3b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
14 deletions
+38
-14
base-manager/doc/api.md
base-manager/doc/api.md
+1
-0
base-manager/src/main/java/com/mortals/xhx/common/utils/MatterHtmlParseUtil.java
...ava/com/mortals/xhx/common/utils/MatterHtmlParseUtil.java
+34
-4
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteBusinessServiceImpl.java
...xhx/module/site/service/impl/SiteBusinessServiceImpl.java
+2
-7
base-manager/src/test/java/com/mortals/httpclient/dept/DeptController.http
...test/java/com/mortals/httpclient/dept/DeptController.http
+1
-3
No files found.
base-manager/doc/api.md
View file @
a7755e1c
...
...
@@ -4938,6 +4938,7 @@ size|Integer|每页条数|否|-
name|String|部门名称|否|-
deptAbb|String|部门简称|否|-
deptNumber|String|部门编号|否|-
filter|Integer|是否过滤没有事项的部门(0.否,1.是)|否|-
**请求样例:**
...
...
base-manager/src/main/java/com/mortals/xhx/common/utils/MatterHtmlParseUtil.java
View file @
a7755e1c
...
...
@@ -51,6 +51,33 @@ public class MatterHtmlParseUtil {
return
Rest
.
ok
(
resultMap
);
}
public
static
Rest
<
Map
<
String
,
Integer
>>
statSiteMatterDeptCount
(
Map
<
String
,
String
>
params
,
String
url
)
{
String
matterTotalExp
=
"//input[@id=\"result_countDept\"]"
;
String
matterPageExp
=
"//input[@id=\"pageNumDept\"]"
;
Map
<
String
,
Integer
>
resultMap
=
new
HashMap
<>();
try
{
Document
dom
=
Jsoup
.
connect
(
url
).
data
(
params
).
get
();
Elements
elements
=
dom
.
selectXpath
(
matterTotalExp
);
if
(
elements
.
size
()
>
0
)
{
Integer
total
=
elements
.
get
(
0
)
==
null
?
0
:
DataUtil
.
converStr2Int
(
elements
.
get
(
0
).
attr
(
"value"
),
0
);
resultMap
.
put
(
"total"
,
total
);
}
elements
=
dom
.
selectXpath
(
matterPageExp
);
if
(
elements
.
size
()
>
0
)
{
Integer
pageNum
=
elements
.
get
(
0
)
==
null
?
0
:
DataUtil
.
converStr2Int
(
elements
.
get
(
0
).
attr
(
"value"
),
0
);
resultMap
.
put
(
"pageNum"
,
pageNum
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"获取事项数量异常!params:"
+
JSON
.
toJSONString
(
params
),
e
);
return
Rest
.
fail
(
e
.
getMessage
());
}
return
Rest
.
ok
(
resultMap
);
}
public
static
Rest
<
List
<
MatterEntity
>>
getMatterList
(
Map
<
String
,
String
>
params
,
String
url
)
{
String
matterListExp
=
"//div[@class=\"sx_list\"]//span[1]"
;
String
matterListLiExp
=
"//div[@class=\"sx_list\"]//li/a[1]"
;
...
...
@@ -245,15 +272,17 @@ public class MatterHtmlParseUtil {
String
url
=
"http://www.sczwfw.gov.cn/jiq/interface/item/tags"
;
HashMap
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"areaCode"
,
"51
0110006007
"
);
params
.
put
(
"dxType"
,
"
56
"
);
params
.
put
(
"areaCode"
,
"51
1500000000
"
);
params
.
put
(
"dxType"
,
"
3
"
);
params
.
put
(
"deptCode"
,
""
);
params
.
put
(
"searchtext"
,
""
);
params
.
put
(
"type"
,
"2"
);
//类型 2.部门 1.主题 3.热度
params
.
put
(
"taskType"
,
""
);
params
.
put
(
"pageno"
,
"1"
);
Rest
<
Map
<
String
,
Integer
>>
rest
=
MatterHtmlParseUtil
.
statSiteMatterCount
(
params
,
url
);
//
params.put("pageno", "1");
Rest
<
Map
<
String
,
Integer
>>
rest
=
MatterHtmlParseUtil
.
statSiteMatter
Dept
Count
(
params
,
url
);
System
.
out
.
println
(
JSON
.
toJSONString
(
rest
));
/*
List<MatterEntity> allList = new ArrayList<>();
String url1 = "http://www.sczwfw.gov.cn/jiq/interface/item/tags";
...
...
@@ -282,6 +311,7 @@ public class MatterHtmlParseUtil {
Rest<Map<String, String>> rest1 = MatterHtmlParseUtil.syncDeptBySiteId(params, url);
System.out.println(JSON.toJSONString(rest1));
*/
}
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteBusinessServiceImpl.java
View file @
a7755e1c
...
...
@@ -85,7 +85,6 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
@Override
protected
void
findAfter
(
SiteBusinessEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
SiteBusinessEntity
>
list
)
throws
AppException
{
if
(!
ObjectUtils
.
isEmpty
(
params
.
getIdNotList
()))
{
//排除掉已经存在的ids
log
.
info
(
"idNotList:{}"
,
JSON
.
toJSONString
(
params
.
getIdNotList
()));
...
...
@@ -103,15 +102,15 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
//子节点已经全部选中,删除父节点
iterator
.
remove
();
pageInfo
.
setTotalResult
(
pageInfo
.
getTotalResult
()
-
1
);
}
else
{
childs
.
stream
().
forEach
(
item1
->
{
buildChildBusiness
(
item1
);
});
item
.
setChildren
(
childs
);
buildChildBusiness
(
item
);
}
}
buildChildBusiness
(
item
);
}
}
else
{
list
.
stream
().
peek
(
item
->
{
...
...
@@ -187,10 +186,6 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
//删除
businessService
.
remove
(
mainIds
,
context
);
}
}
...
...
base-manager/src/test/java/com/mortals/httpclient/dept/DeptController.http
View file @
a7755e1c
...
...
@@ -4,9 +4,7 @@ POST {{baseUrl}}/dept/list
Content-Type: application/json
{
"name":"qwudiq" ,
"deptAbb":"zudynx" ,
"deptNumber":"w2q60e" ,
"filter":1 ,
"page":1,
"size":10
}
...
...
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