Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fill-system
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
廖旭伟
fill-system
Commits
0715e197
Commit
0715e197
authored
Feb 17, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加应用白名单接口
parent
a484c38c
Pipeline
#2477
failed with stages
Changes
6
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1488 additions
and
11 deletions
+1488
-11
common-lib/src/main/java/com/mortals/xhx/common/pdu/site/SiteMatterPdu.java
...n/java/com/mortals/xhx/common/pdu/site/SiteMatterPdu.java
+1303
-0
common-lib/src/main/java/com/mortals/xhx/feign/site/ISiteMatterFeign.java
...ain/java/com/mortals/xhx/feign/site/ISiteMatterFeign.java
+99
-0
fill-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteMatterTaskImpl.java
...a/com/mortals/xhx/daemon/task/SyncSiteMatterTaskImpl.java
+73
-0
fill-manager/src/main/java/com/mortals/xhx/module/home/web/HomeController.java
.../java/com/mortals/xhx/module/home/web/HomeController.java
+6
-4
fill-manager/src/main/resources/sqlmap/module/sheet/SheetMatterMapper.xml
.../main/resources/sqlmap/module/sheet/SheetMatterMapper.xml
+5
-5
fill-manager/src/main/resources/sqlmap/module/sheet/SheetMatterMapperExt.xml
...in/resources/sqlmap/module/sheet/SheetMatterMapperExt.xml
+2
-2
No files found.
common-lib/src/main/java/com/mortals/xhx/common/pdu/site/SiteMatterPdu.java
0 → 100644
View file @
0715e197
This diff is collapsed.
Click to expand it.
common-lib/src/main/java/com/mortals/xhx/feign/site/ISiteMatterFeign.java
0 → 100644
View file @
0715e197
package
com.mortals.xhx.feign.site
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.site.SiteMatterPdu
;
import
com.alibaba.fastjson.JSON
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.feign.IFeign
;
import
feign.hystrix.FallbackFactory
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 站点事项 Feign接口
* @author zxfei
* @date 2023-02-17
*/
@FeignClient
(
name
=
""
,
path
=
""
,
fallbackFactory
=
SiteMatterFeignFallbackFactory
.
class
)
public
interface
ISiteMatterFeign
extends
IFeign
{
/**
* 查看站点事项列表
*
* @param siteMatterPdu
* @return
*/
@PostMapping
(
value
=
"/site/matter/list"
)
Rest
<
RespData
<
List
<
SiteMatterPdu
>>>
list
(
@RequestBody
SiteMatterPdu
siteMatterPdu
);
/**
* 查看站点事项
*
* @param id
* @return
*/
@GetMapping
(
value
=
"/site/matter/info"
)
Rest
<
SiteMatterPdu
>
info
(
@RequestParam
(
value
=
"id"
)
Long
id
);
/**
* 删除站点事项
*
* @param ids
* @return
*/
@GetMapping
(
value
=
"/site/matter/delete"
)
Rest
<
Void
>
delete
(
Long
[]
ids
,
@RequestHeader
(
"Authorization"
)
String
authorization
);
/**
* 站点事项保存更新
*
* @param siteMatterPdu
* @return
*/
@PostMapping
(
value
=
"/site/matter/save"
)
Rest
<
RespData
<
SiteMatterPdu
>>
save
(
@RequestBody
SiteMatterPdu
siteMatterPdu
,
@RequestHeader
(
"Authorization"
)
String
authorization
);
}
@Slf4j
@Component
class
SiteMatterFeignFallbackFactory
implements
FallbackFactory
<
ISiteMatterFeign
>
{
@Override
public
ISiteMatterFeign
create
(
Throwable
t
)
{
return
new
ISiteMatterFeign
()
{
@Override
public
Rest
<
RespData
<
List
<
SiteMatterPdu
>>>
list
(
SiteMatterPdu
siteMatterPdu
)
{
return
Rest
.
fail
(
"暂时无法获取站点事项列表,请稍后再试!"
);
}
@Override
public
Rest
<
SiteMatterPdu
>
info
(
Long
id
)
{
return
Rest
.
fail
(
"暂时无法获取站点事项详细,请稍后再试!"
);
}
@Override
public
Rest
<
Void
>
delete
(
Long
[]
ids
,
String
authorization
)
{
return
Rest
.
fail
(
"暂时无法删除站点事项,请稍后再试!"
);
}
@Override
public
Rest
<
RespData
<
SiteMatterPdu
>>
save
(
SiteMatterPdu
siteMatterPdu
,
String
authorization
)
{
return
Rest
.
fail
(
"暂时无法保存站点事项,请稍后再试!"
);
}
};
}
}
fill-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteMatterTaskImpl.java
0 → 100644
View file @
0715e197
package
com.mortals.xhx.daemon.task
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.service.ITask
;
import
com.mortals.framework.service.ITaskExcuteService
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.site.SiteMatterPdu
;
import
com.mortals.xhx.common.pdu.site.SitePdu
;
import
com.mortals.xhx.feign.site.ISiteFeign
;
import
com.mortals.xhx.feign.site.ISiteMatterFeign
;
import
com.mortals.xhx.module.sheet.model.SheetMatterEntity
;
import
com.mortals.xhx.module.sheet.service.SheetMatterService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 同步事项列表
*/
@Slf4j
@Service
(
"SyncSiteMatterTask"
)
public
class
SyncSiteMatterTaskImpl
implements
ITaskExcuteService
{
@Autowired
private
ISiteFeign
siteFeign
;
@Autowired
private
ISiteMatterFeign
siteMatterFeign
;
@Autowired
private
SheetMatterService
sheetMatterService
;
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
SitePdu
sitePdu
=
new
SitePdu
();
sitePdu
.
setId
(
1L
);
Rest
<
List
<
SitePdu
>>
siteRest
=
siteFeign
.
getFlatSitesBySiteId
(
sitePdu
);
if
(
siteRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
siteRest
.
getData
().
forEach
(
site
->
{
SiteMatterPdu
siteMatterPdu
=
new
SiteMatterPdu
();
siteMatterPdu
.
setPage
(
1
);
siteMatterPdu
.
setSize
(-
1
);
Rest
<
RespData
<
List
<
SiteMatterPdu
>>>
siteMatterRest
=
siteMatterFeign
.
list
(
siteMatterPdu
);
if
(
siteMatterRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
//删除后新增
List
<
SheetMatterEntity
>
sheetMatterEntities
=
siteMatterRest
.
getData
().
getData
().
stream
().
map
(
siteMatter
->
{
SheetMatterEntity
sheetMatterEntity
=
new
SheetMatterEntity
();
sheetMatterEntity
.
initAttrValue
();
sheetMatterEntity
.
setSiteId
(
siteMatter
.
getSiteId
());
sheetMatterEntity
.
setMatterName
(
siteMatter
.
getMatterName
());
sheetMatterEntity
.
setMatterNo
(
siteMatter
.
getMatterCode
());
sheetMatterEntity
.
setDeptCode
(
siteMatter
.
getDeptCode
());
sheetMatterEntity
.
setDeptName
(
siteMatter
.
getDeptCode
());
return
sheetMatterEntity
;
}).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
sheetMatterEntities
))
{
sheetMatterService
.
save
(
sheetMatterEntities
);
}
}
});
}
}
@Override
public
void
stopTask
(
ITask
task
)
throws
AppException
{
}
}
fill-manager/src/main/java/com/mortals/xhx/module/home/web/HomeController.java
View file @
0715e197
...
...
@@ -319,9 +319,10 @@ public class HomeController extends BaseJsonBodyController {
model
.
put
(
"dayThrift"
,
todaySum
);
//今日节约
long
sum
=
matterDatumPrintOnlineEntities
.
stream
().
collect
(
Collectors
.
summarizingInt
(
x
->
x
.
getPage
())).
getSum
();
model
.
put
(
"totalThrift"
,
sum
*
2
);
//累计节约
model
.
put
(
"totalThrift"
,
sum
*
2
);
//累计节约
Rest
<
com
.
mortals
.
xhx
.
common
.
pdu
.
site
.
SitePdu
>
info
=
siteFeign
.
info
(
homeQueryPdu
.
getSiteId
());
model
.
put
(
"title"
,
info
==
null
?
""
:
info
.
getData
().
getSiteName
());
//标题
model
.
put
(
"title"
,
info
.
getData
()
==
null
?
""
:
info
.
getData
().
getSiteName
());
//标题
BasesetEntity
basesetEntity
=
basesetService
.
selectOne
(
new
BasesetQuery
().
siteId
(
homeQueryPdu
.
getSiteId
()));
...
...
@@ -344,6 +345,7 @@ public class HomeController extends BaseJsonBodyController {
/**
* 自助服务应用
*
* @return
*/
@GetMapping
({
"app/list"
})
...
...
@@ -352,13 +354,13 @@ public class HomeController extends BaseJsonBodyController {
String
appWhiteStr
=
GlobalSysInfo
.
getParamValue
(
Constant
.
PARAMS_WHITE_APP_LIST
,
"中心简介,办事指南,意见建议,中心简介"
);
Set
<
String
>
appWhiteSet
=
StrUtil
.
split
(
appWhiteStr
,
","
).
stream
().
collect
(
Collectors
.
toSet
());
Rest
<
List
<
AppPdu
>>
ret
=
new
Rest
();
List
<
AppPdu
>
collect
=
new
ArrayList
<>();
List
<
AppPdu
>
collect
=
new
ArrayList
<>();
int
code
=
VALUE_RESULT_SUCCESS
;
try
{
AppPdu
appPdu
=
new
AppPdu
();
appPdu
.
setSiteId
(
siteId
);
Rest
<
RespData
<
List
<
AppPdu
>>>
appRest
=
appFeign
.
list
(
appPdu
);
if
(
appRest
.
getCode
()==
YesNoEnum
.
YES
.
getValue
())
{
if
(
appRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
collect
=
appRest
.
getData
().
getData
().
stream
().
filter
(
f
->
appWhiteSet
.
contains
(
f
.
getAppName
())).
collect
(
Collectors
.
toList
());
}
}
catch
(
Exception
e
)
{
...
...
fill-manager/src/main/resources/sqlmap/module/sheet/SheetMatterMapper.xml
View file @
0715e197
This diff is collapsed.
Click to expand it.
fill-manager/src/main/resources/sqlmap/module/sheet/SheetMatterMapperExt.xml
View file @
0715e197
...
...
@@ -21,7 +21,7 @@
and a.matterName like #{condition.matterName}
</if>
<if
test=
"condition.matterFullName != null and condition.matterFullName != ''"
>
and a.matter
FullName like #{condition.matterFull
Name}
and a.matter
Name like #{condition.matter
Name}
</if>
</trim>
</trim>
...
...
@@ -47,7 +47,7 @@
and a.matterName like #{condition.matterName}
</if>
<if
test=
"condition.matterFullName != null and condition.matterFullName != ''"
>
and a.matter
FullName like #{condition.matterFull
Name}
and a.matter
Name like #{condition.matter
Name}
</if>
</trim>
</trim>
...
...
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