Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
civil-bigdata
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
civil
civil-bigdata
Commits
ce1dad44
Commit
ce1dad44
authored
Jan 13, 2022
by
韦华德
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
4ec094d4
9cd4cab6
Hide whitespace changes
Inline
Side-by-side
Showing
56 changed files
with
796 additions
and
695 deletions
+796
-695
api-server/src/main/java/com/zq/api/constant/ApiMethod.java
+26
-0
api-server/src/main/java/com/zq/api/controller/ApiController.java
+39
-3
api-server/src/main/java/com/zq/api/feign/PortalFeign.java
+6
-0
api-server/src/main/java/com/zq/api/service/IApiLogic.java
+36
-180
api-server/src/main/java/com/zq/api/service/impl/ApiV100Logic.java
+5
-0
api-server/src/main/resources/application.yml
+2
-1
civil-common-utils/pom.xml
+9
-3
civil-common-utils/src/main/java/com/zq/common/config/mybatis/MybatisConfig.java
+7
-8
oauth-server/src/main/java/com/zq/oauth/config/TokenFilter.java
+1
-20
oauth-server/src/main/java/com/zq/oauth/config/TokenProvider.java
+8
-6
oauth-server/src/main/resources/application.yml
+1
-1
open-server/src/main/java/com/zq/open/config/TokenFilter.java
+1
-20
open-server/src/main/java/com/zq/open/config/TokenProvider.java
+8
-6
open-server/src/main/resources/application.yml
+2
-1
pom.xml
+6
-3
portal-server/src/main/java/com/zq/portal/config/TokenFilter.java
+1
-20
portal-server/src/main/java/com/zq/portal/config/TokenProvider.java
+8
-6
portal-server/src/main/java/com/zq/portal/controller/app/CjStatsController.java
+8
-0
portal-server/src/main/java/com/zq/portal/dao/CjStatsDao.java
+4
-0
portal-server/src/main/java/com/zq/portal/dao/ShjzStatsDao.java
+2
-0
portal-server/src/main/java/com/zq/portal/manager/PortalCacheKeys.java
+9
-0
portal-server/src/main/java/com/zq/portal/service/CjStatsService.java
+53
-3
portal-server/src/main/java/com/zq/portal/service/ShjzStatsService.java
+17
-3
portal-server/src/main/java/com/zq/portal/vo/StatsVo.java
+8
-0
portal-server/src/main/resources/application.yml
+1
-1
portal-server/src/main/resources/mapper/CjStatsMapper.xml
+18
-0
portal-server/src/main/resources/mapper/ShjzStatsDao.xml
+24
-15
resource-server/src/main/java/com/zq/resource/config/TokenFilter.java
+1
-20
resource-server/src/main/java/com/zq/resource/config/TokenProvider.java
+8
-6
resource-server/src/main/resources/application.yml
+1
-1
sync-server/src/main/java/com/zq/sync/dao/ReportErroorDao.java
+12
-0
sync-server/src/main/java/com/zq/sync/entity/Fdx01.java
+17
-4
sync-server/src/main/java/com/zq/sync/entity/Fdx02.java
+17
-4
sync-server/src/main/java/com/zq/sync/entity/Fdx03.java
+17
-4
sync-server/src/main/java/com/zq/sync/entity/Fdx04.java
+17
-4
sync-server/src/main/java/com/zq/sync/entity/Fdx05.java
+17
-4
sync-server/src/main/java/com/zq/sync/entity/Fdx06.java
+17
-4
sync-server/src/main/java/com/zq/sync/entity/Fdx07.java
+16
-4
sync-server/src/main/java/com/zq/sync/entity/Fdx88.java
+14
-4
sync-server/src/main/java/com/zq/sync/entity/ReportError.java
+58
-0
sync-server/src/main/java/com/zq/sync/service/DisabledService.java
+218
-250
sync-server/src/main/java/com/zq/sync/task/ReportTask.java
+1
-1
sync-server/src/main/java/com/zq/sync/vo/Fdx01Vo.java
+4
-4
sync-server/src/main/java/com/zq/sync/vo/Fdx02Vo.java
+4
-4
sync-server/src/main/java/com/zq/sync/vo/Fdx03Vo.java
+4
-4
sync-server/src/main/java/com/zq/sync/vo/Fdx04Vo.java
+4
-4
sync-server/src/main/java/com/zq/sync/vo/Fdx05Vo.java
+4
-4
sync-server/src/main/java/com/zq/sync/vo/Fdx06Vo.java
+5
-5
sync-server/src/main/java/com/zq/sync/vo/Fdx07Vo.java
+4
-4
sync-server/src/main/java/com/zq/sync/vo/Fdx88Vo.java
+5
-5
sync-server/src/main/resources/application.yml
+3
-2
sys-server/src/main/java/com/zq/system/config/security/TokenFilter.java
+1
-20
sys-server/src/main/java/com/zq/system/config/security/TokenProvider.java
+7
-2
user-server/src/main/java/com/zq/user/config/TokenFilter.java
+1
-20
user-server/src/main/java/com/zq/user/config/TokenProvider.java
+8
-6
user-server/src/main/resources/application.yml
+1
-1
No files found.
api-server/src/main/java/com/zq/api/constant/ApiMethod.java
0 → 100644
View file @
ce1dad44
package
com
.
zq
.
api
.
constant
;
import
org.springframework.core.annotation.AliasFor
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
/**
* @author wilmiam
* @since 2022/1/5 10:42
*/
@Target
({
ElementType
.
METHOD
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
public
@interface
ApiMethod
{
@AliasFor
(
"name"
)
String
value
()
default
""
;
@AliasFor
(
"value"
)
String
name
()
default
""
;
String
service
()
default
""
;
}
api-server/src/main/java/com/zq/api/controller/ApiController.java
View file @
ce1dad44
...
...
@@ -5,20 +5,29 @@ import cn.hutool.core.util.StrUtil;
import
cn.hutool.extra.servlet.ServletUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.zq.api.constant.ApiCodeEnum
;
import
com.zq.api.constant.ApiMethod
;
import
com.zq.api.form.ApiForm
;
import
com.zq.api.form.ApiResp
;
import
com.zq.api.service.ApiService
;
import
com.zq.api.service.IApiLogic
;
import
com.zq.api.utils.ApiUtils
;
import
com.zq.common.utils.ThrowableUtil
;
import
com.zq.common.vo.ResultVo
;
import
feign.FeignException
;
import
io.swagger.annotations.Api
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.core.annotation.AnnotationUtils
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Api
(
tags
=
"API接口"
)
@RestController
...
...
@@ -87,9 +96,7 @@ public class ApiController {
// 调试日志
if
(
ApiUtils
.
DEBUG
)
{
System
.
out
.
println
(
"API DEBUG ACTION \n[from="
+
form
+
"]"
+
"\n[resp="
+
JSON
.
toJSONString
(
resp
)
+
"]"
+
"\n[time="
+
(
System
.
currentTimeMillis
()
-
start
)
+
"ms]"
);
System
.
out
.
println
(
"API DEBUG ACTION \n[from="
+
form
+
"]"
+
"\n[resp="
+
JSON
.
toJSONString
(
resp
)
+
"]"
+
"\n[time="
+
(
System
.
currentTimeMillis
()
-
start
)
+
"ms]"
);
}
String
clientIP
=
ServletUtil
.
getClientIP
(
request
);
...
...
@@ -109,4 +116,33 @@ public class ApiController {
ApiUtils
.
DEBUG
=
!
ApiUtils
.
DEBUG
;
return
new
ApiResp
(
from
).
setData
(
ApiUtils
.
DEBUG
);
}
@RequestMapping
(
"/method"
)
public
ApiResp
getAllMethod
(
@RequestParam
(
required
=
false
)
String
service
,
@RequestParam
(
required
=
false
)
String
name
)
{
List
<
Map
<
String
,
Object
>>
methodList
=
new
ArrayList
<>();
Method
[]
methods
=
IApiLogic
.
class
.
getMethods
();
for
(
Method
method
:
methods
)
{
Class
<?>[]
params
=
method
.
getParameterTypes
();
if
(
params
.
length
==
1
&&
(
params
[
0
]
==
ApiForm
.
class
))
{
ApiMethod
apiMethod
=
AnnotationUtils
.
getAnnotation
(
method
,
ApiMethod
.
class
);
if
(
StrUtil
.
isNotBlank
(
service
))
{
if
(
apiMethod
==
null
||
!
apiMethod
.
service
().
equals
(
service
))
{
continue
;
}
}
if
(
StrUtil
.
isNotBlank
(
name
))
{
if
((
apiMethod
==
null
||
!
apiMethod
.
value
().
contains
(
name
))
&&
!
method
.
getName
().
toLowerCase
().
contains
(
name
.
toLowerCase
()))
{
continue
;
}
}
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"value"
,
method
.
getName
());
data
.
put
(
"name"
,
apiMethod
==
null
?
""
:
apiMethod
.
value
());
data
.
put
(
"service"
,
apiMethod
==
null
?
""
:
apiMethod
.
service
());
methodList
.
add
(
data
);
}
}
return
ApiUtils
.
toApiResp
(
new
ApiForm
(),
ResultVo
.
success
(
methodList
));
}
}
api-server/src/main/java/com/zq/api/feign/PortalFeign.java
View file @
ce1dad44
...
...
@@ -67,4 +67,10 @@ public interface PortalFeign {
@PostMapping
(
"/stats/getAreaUnderNumStats"
)
ResultVo
getAreaUnderNumStats
(
@RequestBody
Map
<
String
,
Object
>
paramsMap
);
@PostMapping
(
"/stats/getEnjoySubsidyStats"
)
ResultVo
getEnjoySubsidyStats
(
@RequestBody
Map
<
String
,
Object
>
paramsMap
);
@PostMapping
(
"/stats/getEnjoySumStatsData"
)
ResultVo
getEnjoySumStatsData
(
@RequestBody
Map
<
String
,
Object
>
paramsMap
);
}
api-server/src/main/java/com/zq/api/service/IApiLogic.java
View file @
ce1dad44
package
com
.
zq
.
api
.
service
;
import
com.zq.api.constant.ApiMethod
;
import
com.zq.api.form.ApiForm
;
import
com.zq.api.form.ApiResp
;
...
...
@@ -9,250 +10,105 @@ import com.zq.api.form.ApiResp;
* 2016年9月29日 上午11:45:08
*/
public
interface
IApiLogic
extends
IApiCommon
{
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓SYS APP接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
/**
* 获取用户信息
*
* @return
*/
@ApiMethod
(
name
=
"获取用户信息"
,
service
=
"SYS-SERVER"
)
ApiResp
getUserInfo
(
ApiForm
form
);
/**
* 发送验证码
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"发送验证码"
,
service
=
"SYS-SERVER"
)
ApiResp
sendCode
(
ApiForm
form
);
/**
* 重置密码
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"重置密码"
,
service
=
"SYS-SERVER"
)
ApiResp
resetPassword
(
ApiForm
form
);
/**
* 用户手机号登录
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"用户手机号登录"
,
service
=
"SYS-SERVER"
)
ApiResp
phoneLogin
(
ApiForm
form
);
/**
* 密码登录
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"密码登录"
,
service
=
"SYS-SERVER"
)
ApiResp
passwdLogin
(
ApiForm
form
);
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓门户接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
/**
* 获取婚姻统计
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取婚姻统计"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getMarriageStats
(
ApiForm
form
);
/**
* 获取区域下的婚姻统计列表
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取区域下的婚姻统计列表"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getAreaUnderMarriageStatsList
(
ApiForm
form
);
/**
* 获取近5年婚姻走势
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取近5年婚姻走势"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getFivesYearMarriageLine
(
ApiForm
form
);
/**
* 获取区域残疾发放统计
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取区域残疾发放统计"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getAreaDisabledIssueStats
(
ApiForm
form
);
/**
* 近五年发放人数和金额统计
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"近五年发放人数和金额统计"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getYearDisabledIssueStats
(
ApiForm
form
);
/**
* 获取区域社会救助统计列表
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取在享补贴统计"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getEnjoySubsidyStats
(
ApiForm
form
);
@ApiMethod
(
name
=
"获取区域统计列表"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getAreaShjzStats
(
ApiForm
form
);
/**
* 获取区域社会救助统计列表
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取区域社会救助统计列表"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getAreaUnderNumStats
(
ApiForm
form
);
/**
* 获取近五年城市农村低保发放人数统计
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取近五年城市农村低保发放人数统计"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getFivesYearShjzAchieveStats
(
ApiForm
form
);
/**
* 获取近五年城市农村低保发放金额统计
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取近五年城市农村低保发放金额统计"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getFivesYearShjzProvideStats
(
ApiForm
form
);
/**
* 修改登录密码
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"修改登录密码"
,
service
=
"PORTAL-SERVER"
)
ApiResp
modifyPasswd
(
ApiForm
form
);
/**
* 获取App最新版本
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取App最新版本"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getAppVersion
(
ApiForm
form
);
/**
* 获取子区域列表
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取子区域列表"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getChildAreaList
(
ApiForm
form
);
/**
* 获取社会机构统计
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取社会机构统计"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getSoorganStats
(
ApiForm
form
);
/**
* 获取地区下面社会机构统计列表
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取地区下面社会机构统计列表"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getAreaUnderSoorganStatsList
(
ApiForm
form
);
/**
* 获取App首页地图数据
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取App首页地图数据"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getAppMapStats
(
ApiForm
form
);
/**
* 汇总搜索
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"汇总搜索"
,
service
=
"PORTAL-SERVER"
)
ApiResp
gatherSearch
(
ApiForm
form
);
/**
* 指定区域下的儿童福利数据统计
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"指定区域下的儿童福利数据统计"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getAgencyChildStats
(
ApiForm
form
);
/**
* 指定区域下级区域的儿童福利数据统计列表
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"指定区域下级区域的儿童福利数据统计列表"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getAgencyChildStatsList
(
ApiForm
form
);
/**
* 火化量统计
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"火化量统计"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getCremationStats
(
ApiForm
form
);
/**
* 火化量统计列表
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"火化量统计列表"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getCremationStatsList
(
ApiForm
form
);
/**
* 殡仪馆火化量统计列表
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"殡仪馆火化量统计列表"
,
service
=
"PORTAL-SERVER"
)
ApiResp
getCremationStatsById
(
ApiForm
form
);
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓SYS接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓SYS
单点登录
接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
/**
* 获取单点登录用户信息
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"获取单点登录用户信息"
,
service
=
"SYS-SERVER"
)
ApiResp
getSsoUserInfo
(
ApiForm
form
);
/**
* 单点登出
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"单点登出"
,
service
=
"SYS-SERVER"
)
ApiResp
ssoLogout
(
ApiForm
form
);
/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓开放接口↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
/**
* 婚姻搜索接口
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"婚姻搜索接口"
,
service
=
"OPEN-SERVER"
)
ApiResp
marriageSearch
(
ApiForm
form
);
/**
* 自然人搜索接口
*
* @param form
* @return
*/
@ApiMethod
(
name
=
"自然人搜索接口"
,
service
=
"OPEN-SERVER"
)
ApiResp
naturalPersonSearch
(
ApiForm
form
);
}
api-server/src/main/java/com/zq/api/service/impl/ApiV100Logic.java
View file @
ce1dad44
...
...
@@ -91,6 +91,11 @@ public class ApiV100Logic extends BaseApiLogic implements IApiLogic {
}
@Override
public
ApiResp
getEnjoySubsidyStats
(
ApiForm
form
)
{
return
ApiUtils
.
toApiResp
(
form
,
portalFeign
.
getEnjoySubsidyStats
(
form
.
getParamsMap
()));
}
@Override
public
ApiResp
getAreaShjzStats
(
ApiForm
form
)
{
return
ApiUtils
.
toApiResp
(
form
,
portalFeign
.
getAreaShjzStats
(
form
.
getParamsMap
()));
}
...
...
api-server/src/main/resources/application.yml
View file @
ce1dad44
...
...
@@ -69,7 +69,7 @@ spring:
mybatis-plus
:
global-config
:
db-config
:
select
-strategy
:
not_empty
where
-strategy
:
not_empty
update-strategy
:
not_empty
#logging.level.com.zq.drug.dao: debug
\ No newline at end of file
civil-common-utils/pom.xml
View file @
ce1dad44
...
...
@@ -62,7 +62,7 @@
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper
</artifactId>
<version>
5.
2.1
</version>
<version>
5.
3.0
</version>
</dependency>
<!--spring boot 集成redis所需common-pool2-->
...
...
@@ -82,7 +82,7 @@
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<version>
2.
8
.0
</version>
<version>
2.
11
.0
</version>
</dependency>
<!--工具包-->
...
...
@@ -119,12 +119,18 @@
<dependency>
<groupId>
com.jfinal
</groupId>
<artifactId>
jfinal-weixin
</artifactId>
<version>
3.
1
</version>
<version>
3.
4
</version>
</dependency>
<dependency>
<groupId>
com.jfinal
</groupId>
<artifactId>
jfinal-ext3
</artifactId>
<version>
4.0.3
</version>
<exclusions>
<exclusion>
<groupId>
log4j
</groupId>
<artifactId>
log4j
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
...
...
civil-common-utils/src/main/java/com/zq/common/config/mybatis/MybatisConfig.java
View file @
ce1dad44
...
...
@@ -21,7 +21,11 @@ public class MybatisConfig {
@Bean
public
MybatisPlusInterceptor
mybatisPlusInterceptor
()
{
MybatisPlusInterceptor
interceptor
=
new
MybatisPlusInterceptor
();
interceptor
.
addInnerInterceptor
(
new
PaginationInnerInterceptor
());
// 分页插件
PaginationInnerInterceptor
paginationInnerInterceptor
=
new
PaginationInnerInterceptor
();
interceptor
.
addInnerInterceptor
(
paginationInnerInterceptor
);
return
interceptor
;
}
...
...
@@ -34,13 +38,8 @@ public class MybatisConfig {
public
PageInterceptor
pageInterceptor
()
{
PageInterceptor
pageInterceptor
=
new
PageInterceptor
();
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
"offsetAsPageNum"
,
"false"
);
properties
.
setProperty
(
"rowBoundsWithCount"
,
"false"
);
properties
.
setProperty
(
"pageSizeZero"
,
"true"
);
properties
.
setProperty
(
"reasonable"
,
"false"
);
properties
.
setProperty
(
"supportMethodsArguments"
,
"false"
);
properties
.
setProperty
(
"returnPageInfo"
,
"none"
);
properties
.
setProperty
(
"autoRuntimeDialect"
,
"true"
);
// properties.setProperty("helperDialect", "mysql");//指定方言
properties
.
setProperty
(
"autoRuntimeDialect"
,
"true"
);
//自动获取方言
pageInterceptor
.
setProperties
(
properties
);
return
pageInterceptor
;
}
...
...
oauth-server/src/main/java/com/zq/oauth/config/TokenFilter.java
View file @
ce1dad44
...
...
@@ -62,7 +62,7 @@ public class TokenFilter extends GenericFilterBean {
public
void
doFilter
(
ServletRequest
servletRequest
,
ServletResponse
servletResponse
,
FilterChain
filterChain
)
throws
IOException
,
ServletException
{
HttpServletRequest
httpServletRequest
=
(
HttpServletRequest
)
servletRequest
;
String
token
=
resolve
Token
(
httpServletRequest
);
String
token
=
tokenProvider
.
get
Token
(
httpServletRequest
);
// 对于 Token 为空的不需要去查 Redis
if
(
StrUtil
.
isNotBlank
(
token
))
{
OnlineUserDto
onlineUserDto
=
null
;
...
...
@@ -90,23 +90,4 @@ public class TokenFilter extends GenericFilterBean {
filterChain
.
doFilter
(
servletRequest
,
servletResponse
);
}
/**
* 初步检测Token
*
* @param request /
* @return /
*/
private
String
resolveToken
(
HttpServletRequest
request
)
{
String
bearerToken
=
request
.
getHeader
(
properties
.
getHeader
());
if
(
StringUtils
.
isBlank
(
bearerToken
))
{
return
null
;
}
if
(
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
// 去掉令牌前缀
return
bearerToken
.
replace
(
properties
.
getTokenStartWith
(),
""
);
}
else
{
log
.
debug
(
"非法Token:{}"
,
bearerToken
);
}
return
null
;
}
}
oauth-server/src/main/java/com/zq/oauth/config/TokenProvider.java
View file @
ce1dad44
...
...
@@ -25,6 +25,7 @@ import io.jsonwebtoken.Jwts;
import
io.jsonwebtoken.SignatureAlgorithm
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
...
...
@@ -32,7 +33,6 @@ import org.springframework.security.core.GrantedAuthority;
import
org.springframework.security.core.authority.SimpleGrantedAuthority
;
import
org.springframework.security.core.userdetails.User
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean {
}
public
Authentication
getAuthentication
(
String
token
)
{
Claims
claims
=
Jwts
.
parser
()
.
setSigningKey
(
DatatypeConverter
.
parseBase64Binary
(
properties
.
getBase64Secret
()))
.
parseClaimsJws
(
token
)
.
getBody
();
Claims
claims
=
getClaims
(
token
);
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
Object
authoritiesStr
=
claims
.
get
(
AUTHORITIES_KEY
);
...
...
@@ -125,9 +122,14 @@ public class TokenProvider implements InitializingBean {
public
String
getToken
(
HttpServletRequest
request
)
{
String
bearerToken
=
request
.
getHeader
(
properties
.
getHeader
());
if
(
StringUtils
.
hasText
(
bearerToken
)
&&
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
if
(
StringUtils
.
isBlank
(
bearerToken
))
{
return
null
;
}
if
(
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
// 去掉令牌前缀
return
bearerToken
.
replace
(
properties
.
getTokenStartWith
(),
""
);
}
else
{
log
.
debug
(
"非法Token:{}"
,
bearerToken
);
}
return
null
;
}
...
...
oauth-server/src/main/resources/application.yml
View file @
ce1dad44
...
...
@@ -71,7 +71,7 @@ spring:
mybatis-plus
:
global-config
:
db-config
:
select
-strategy
:
not_empty
where
-strategy
:
not_empty
update-strategy
:
not_empty
#日志等级
...
...
open-server/src/main/java/com/zq/open/config/TokenFilter.java
View file @
ce1dad44
...
...
@@ -62,7 +62,7 @@ public class TokenFilter extends GenericFilterBean {
public
void
doFilter
(
ServletRequest
servletRequest
,
ServletResponse
servletResponse
,
FilterChain
filterChain
)
throws
IOException
,
ServletException
{
HttpServletRequest
httpServletRequest
=
(
HttpServletRequest
)
servletRequest
;
String
token
=
resolve
Token
(
httpServletRequest
);
String
token
=
tokenProvider
.
get
Token
(
httpServletRequest
);
// 对于 Token 为空的不需要去查 Redis
if
(
StrUtil
.
isNotBlank
(
token
))
{
OnlineUserDto
onlineUserDto
=
null
;
...
...
@@ -90,23 +90,4 @@ public class TokenFilter extends GenericFilterBean {
filterChain
.
doFilter
(
servletRequest
,
servletResponse
);
}
/**
* 初步检测Token
*
* @param request /
* @return /
*/
private
String
resolveToken
(
HttpServletRequest
request
)
{
String
bearerToken
=
request
.
getHeader
(
properties
.
getHeader
());
if
(
StringUtils
.
isBlank
(
bearerToken
))
{
return
null
;
}
if
(
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
// 去掉令牌前缀
return
bearerToken
.
replace
(
properties
.
getTokenStartWith
(),
""
);
}
else
{
log
.
debug
(
"非法Token:{}"
,
bearerToken
);
}
return
null
;
}
}
open-server/src/main/java/com/zq/open/config/TokenProvider.java
View file @
ce1dad44
...
...
@@ -25,6 +25,7 @@ import io.jsonwebtoken.Jwts;
import
io.jsonwebtoken.SignatureAlgorithm
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
...
...
@@ -32,7 +33,6 @@ import org.springframework.security.core.GrantedAuthority;
import
org.springframework.security.core.authority.SimpleGrantedAuthority
;
import
org.springframework.security.core.userdetails.User
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean {
}
public
Authentication
getAuthentication
(
String
token
)
{
Claims
claims
=
Jwts
.
parser
()
.
setSigningKey
(
DatatypeConverter
.
parseBase64Binary
(
properties
.
getBase64Secret
()))
.
parseClaimsJws
(
token
)
.
getBody
();
Claims
claims
=
getClaims
(
token
);
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
Object
authoritiesStr
=
claims
.
get
(
AUTHORITIES_KEY
);
...
...
@@ -125,9 +122,14 @@ public class TokenProvider implements InitializingBean {
public
String
getToken
(
HttpServletRequest
request
)
{
String
bearerToken
=
request
.
getHeader
(
properties
.
getHeader
());
if
(
StringUtils
.
hasText
(
bearerToken
)
&&
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
if
(
StringUtils
.
isBlank
(
bearerToken
))
{
return
null
;
}
if
(
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
// 去掉令牌前缀
return
bearerToken
.
replace
(
properties
.
getTokenStartWith
(),
""
);
}
else
{
log
.
debug
(
"非法Token:{}"
,
bearerToken
);
}
return
null
;
}
...
...
open-server/src/main/resources/application.yml
View file @
ce1dad44
...
...
@@ -77,5 +77,5 @@ spring:
mybatis-plus
:
global-config
:
db-config
:
select
-strategy
:
not_empty
where
-strategy
:
not_empty
update-strategy
:
not_empty
\ No newline at end of file
pom.xml
View file @
ce1dad44
...
...
@@ -23,11 +23,14 @@
<swagger.version>
2.9.2
</swagger.version>
<alibaba.druid.version>
1.1.22
</alibaba.druid.version>
<mybatis.plus.version>
3.
4.3
</mybatis.plus.version>
<mybatis.plus.version>
3.
5.0
</mybatis.plus.version>
<pagehelper.version>
5.2.0
</pagehelper.version>
<jjwt.version>
0.9.1
</jjwt.version>
<fastjson.version>
1.2.76
</fastjson.version>
<hutool.version>
5.7.16
</hutool.version>
<fastjson.version>
1.2.79
</fastjson.version>
<hutool.version>
5.7.18
</hutool.version>
<logback.version>
1.2.10
</logback.version>
<log4j2.version>
2.17.1
</log4j2.version>
</properties>
<modules>
...
...
portal-server/src/main/java/com/zq/portal/config/TokenFilter.java
View file @
ce1dad44
...
...
@@ -62,7 +62,7 @@ public class TokenFilter extends GenericFilterBean {
public
void
doFilter
(
ServletRequest
servletRequest
,
ServletResponse
servletResponse
,
FilterChain
filterChain
)
throws
IOException
,
ServletException
{
HttpServletRequest
httpServletRequest
=
(
HttpServletRequest
)
servletRequest
;
String
token
=
resolve
Token
(
httpServletRequest
);
String
token
=
tokenProvider
.
get
Token
(
httpServletRequest
);
// 对于 Token 为空的不需要去查 Redis
if
(
StrUtil
.
isNotBlank
(
token
))
{
OnlineUserDto
onlineUserDto
=
null
;
...
...
@@ -90,23 +90,4 @@ public class TokenFilter extends GenericFilterBean {
filterChain
.
doFilter
(
servletRequest
,
servletResponse
);
}
/**
* 初步检测Token
*
* @param request /
* @return /
*/
private
String
resolveToken
(
HttpServletRequest
request
)
{
String
bearerToken
=
request
.
getHeader
(
properties
.
getHeader
());
if
(
StringUtils
.
isBlank
(
bearerToken
))
{
return
null
;
}
if
(
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
// 去掉令牌前缀
return
bearerToken
.
replace
(
properties
.
getTokenStartWith
(),
""
);
}
else
{
log
.
debug
(
"非法Token:{}"
,
bearerToken
);
}
return
null
;
}
}
portal-server/src/main/java/com/zq/portal/config/TokenProvider.java
View file @
ce1dad44
...
...
@@ -25,6 +25,7 @@ import io.jsonwebtoken.Jwts;
import
io.jsonwebtoken.SignatureAlgorithm
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
...
...
@@ -32,7 +33,6 @@ import org.springframework.security.core.GrantedAuthority;
import
org.springframework.security.core.authority.SimpleGrantedAuthority
;
import
org.springframework.security.core.userdetails.User
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean {
}
public
Authentication
getAuthentication
(
String
token
)
{
Claims
claims
=
Jwts
.
parser
()
.
setSigningKey
(
DatatypeConverter
.
parseBase64Binary
(
properties
.
getBase64Secret
()))
.
parseClaimsJws
(
token
)
.
getBody
();
Claims
claims
=
getClaims
(
token
);
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
Object
authoritiesStr
=
claims
.
get
(
AUTHORITIES_KEY
);
...
...
@@ -125,9 +122,14 @@ public class TokenProvider implements InitializingBean {
public
String
getToken
(
HttpServletRequest
request
)
{
String
bearerToken
=
request
.
getHeader
(
properties
.
getHeader
());
if
(
StringUtils
.
hasText
(
bearerToken
)
&&
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
if
(
StringUtils
.
isBlank
(
bearerToken
))
{
return
null
;
}
if
(
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
// 去掉令牌前缀
return
bearerToken
.
replace
(
properties
.
getTokenStartWith
(),
""
);
}
else
{
log
.
debug
(
"非法Token:{}"
,
bearerToken
);
}
return
null
;
}
...
...
portal-server/src/main/java/com/zq/portal/controller/app/CjStatsController.java
View file @
ce1dad44
...
...
@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
@Api
(
tags
=
"残疾统计相关接口"
)
@RequiredArgsConstructor
@RestController
...
...
@@ -39,4 +41,10 @@ public class CjStatsController {
return
ResultVo
.
success
(
cjStatsService
.
getCacheAreaDisabledIssueStats
(
vo
));
}
@ApiOperation
(
"区域在享发放统计"
)
@PostMapping
(
value
=
"/getEnjoySubsidyStats"
)
public
ResultVo
getEnjoySubsidyStats
(
@RequestBody
StatsReqVo
vo
)
{
return
ResultVo
.
success
(
cjStatsService
.
getEnjoySubsidyStats
(
vo
));
}
}
portal-server/src/main/java/com/zq/portal/dao/CjStatsDao.java
View file @
ce1dad44
...
...
@@ -69,4 +69,8 @@ public interface CjStatsDao {
List
<
StatsVo
>
getYearIssueStats
(
StatsReqVo
vo
);
List
<
Map
<
String
,
Object
>>
search
(
SearchReqVo
vo
);
List
<
StatsVo
>
getAreaSubsidyStats
(
StatsReqVo
vo
);
StatsVo
getEnjoySumStats
(
StatsReqVo
vo
);
}
portal-server/src/main/java/com/zq/portal/dao/ShjzStatsDao.java
View file @
ce1dad44
...
...
@@ -77,4 +77,6 @@ public interface ShjzStatsDao {
* @return
*/
List
<
StatsVo
>
getMonyNumStats
(
StatsReqVo
vo
);
List
<
StatsVo
>
getAreaTotalNumStats
(
StatsReqVo
vo
);
}
portal-server/src/main/java/com/zq/portal/manager/PortalCacheKeys.java
View file @
ce1dad44
...
...
@@ -76,6 +76,10 @@ public abstract class PortalCacheKeys {
return
PREFIX
+
"getAreaDisabledIssueStats."
+
vo
.
getAreaCode
()
+
"."
+
vo
.
getYear
();
}
public
static
String
getEnjoySubsidyStatsKey
(
StatsReqVo
vo
)
{
return
PREFIX
+
"getEnjoySubsidyStats."
+
vo
.
getAreaCode
()
+
"."
+
vo
.
getYear
();
}
// 获取区域养老院统计列表
public
static
String
getAreaNursingStatsListKey
(
StatsReqVo
vo
)
{
return
PREFIX
+
"getAreaNursingStatsList."
+
vo
.
getAreaCode
()
+
"."
+
vo
.
getYear
()
+
"."
+
vo
.
getType
();
...
...
@@ -135,4 +139,9 @@ public abstract class PortalCacheKeys {
public
static
String
getAreaShjzStats
(
StatsReqVo
vo
)
{
return
PREFIX
+
"getAreaShjzStats."
+
vo
.
getAreaCode
();
}
//获取两项补贴统计
public
static
String
getEnjoySumStatsKey
(
StatsReqVo
vo
)
{
return
PREFIX
+
"getEnjoySumStats."
+
vo
.
getAreaCode
();
}
}
portal-server/src/main/java/com/zq/portal/service/CjStatsService.java
View file @
ce1dad44
...
...
@@ -224,7 +224,7 @@ public class CjStatsService {
List
<
StatsVo
>
severeAreaIssueStats
=
cjStatsDao
.
getAreaIssueStats
(
vo
);
for
(
StatsVo
severeAreaIssueStat
:
severeAreaIssueStats
)
{
SystemArea
area
=
areaDao
.
selectById
(
SystemArea
.
patchZero
(
severeAreaIssueStat
.
getCode
()));
if
(
area
==
null
)
{
if
(
area
==
null
)
{
continue
;
}
areaList
.
add
(
area
.
getName
());
...
...
@@ -234,9 +234,9 @@ public class CjStatsService {
vo
.
setSubAreaCode
(
severeAreaIssueStat
.
getCode
());
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"areaName"
,
area
.
getName
());
data
.
put
(
"areaCode"
,
severeAreaIssueStat
.
getCode
());
data
.
put
(
"areaCode"
,
severeAreaIssueStat
.
getCode
());
data
.
put
(
"severePeopleNum"
,
cjStatsDao
.
getSeverePeopleNumStats
(
vo
).
getNum
());
data
.
put
(
"difficultPeopleNum"
,
cjStatsDao
.
getDifficultPeopleNumStats
(
vo
).
getNum
());
data
.
put
(
"difficultPeopleNum"
,
cjStatsDao
.
getDifficultPeopleNumStats
(
vo
).
getNum
());
data
.
put
(
"issueNum"
,
severeAreaIssueStat
.
getNum
());
data
.
put
(
"issueAmount"
,
severeAreaIssueStat
.
getAmount
());
areaPeopleNumList
.
add
(
data
);
...
...
@@ -278,4 +278,54 @@ public class CjStatsService {
}
return
PagingUtils
.
paging
(
vo
,
cjStatsDao:
:
search
);
}
// public Object getCacheEnjoySubsidyStats(StatsReqVo vo) {
// Object obj = redisUtils.getObj(PortalCacheKeys.getEnjoySubsidyStatsKey(vo));
// if (obj != null) {
// return obj;
// }
// return getEnjoySubsidyStats(vo);
// }
//区域补贴在享人和钱数
public
Object
getEnjoySubsidyStats
(
StatsReqVo
vo
)
{
if
(
StringUtils
.
isBlank
(
vo
.
getAreaCode
()))
{
vo
.
setAreaCode
(
"450000000000"
);
}
SystemArea
systemArea
=
areaDao
.
selectById
(
vo
.
getAreaCode
());
vo
.
setSubAreaCode
(
systemArea
.
subAreaCode
());
vo
.
setSize
(
SystemArea
.
getNextLevelLength
(
systemArea
.
getType
()));
StatsVo
stats
=
cjStatsDao
.
getEnjoySumStats
(
vo
);
Map
<
String
,
Object
>
totalData
=
new
HashMap
<>();
totalData
.
put
(
"totalNum"
,
stats
.
getNum
());
totalData
.
put
(
"totalAmount"
,
stats
.
getAmount
());
List
<
Map
<
String
,
Object
>>
areaPeopleNumList
=
new
ArrayList
<>();
List
<
StatsVo
>
subsidyStats
=
cjStatsDao
.
getAreaSubsidyStats
(
vo
);
for
(
StatsVo
subsidyStat
:
subsidyStats
)
{
SystemArea
area
=
areaDao
.
selectById
(
SystemArea
.
patchZero
(
subsidyStat
.
getCode
()));
if
(
area
==
null
)
{
continue
;
}
Map
<
String
,
Object
>
data
=
new
HashMap
<>();
data
.
put
(
"areaCode"
,
subsidyStat
.
getCode
());
data
.
put
(
"areaName"
,
area
.
getName
());
data
.
put
(
"nursingSubsidyNum"
,
subsidyStat
.
getHlnum
());
data
.
put
(
"nursingSubsidyAmount"
,
subsidyStat
.
getHlamount
());
data
.
put
(
"livingAllowanceNum"
,
subsidyStat
.
getShnum
());
data
.
put
(
"livingAllowanceAmount"
,
subsidyStat
.
getShamount
());
areaPeopleNumList
.
add
(
data
);
}
Map
<
String
,
Object
>
returnData
=
new
HashMap
<>();
returnData
.
put
(
"total"
,
totalData
);
returnData
.
put
(
"stats"
,
areaPeopleNumList
);
// redisUtils.setObj(PortalCacheKeys.getEnjoySubsidyStatsKey(vo), returnData);
return
returnData
;
}
}
portal-server/src/main/java/com/zq/portal/service/ShjzStatsService.java
View file @
ce1dad44
...
...
@@ -353,16 +353,27 @@ public class ShjzStatsService {
List
<
StatsVo
>
peopleNumStats
=
shjzStatsDao
.
getPeopleNumStats
(
vo
);
// 金额
List
<
StatsVo
>
monyStats
=
shjzStatsDao
.
getMonyNumStats
(
vo
);
//总人数
List
<
StatsVo
>
stats
=
shjzStatsDao
.
getAreaTotalNumStats
(
vo
);
Map
<
String
,
Object
>
totalData
=
new
HashMap
<>();
for
(
StatsVo
totalStat
:
stats
)
{
if
(
"0"
.
equals
(
totalStat
.
getType
()))
{
totalData
.
put
(
"villageTotal"
,
totalStat
.
getNum
());
//农村低保
}
else
{
totalData
.
put
(
"cityTotal"
,
totalStat
.
getNum
());
//城市低保
}
}
Map
<
String
,
Map
<
String
,
Object
>>
map
=
new
HashMap
<>();
// 添加城市低保人数
List
<
StatsVo
>
cityPeopleNumStats
=
peopleNumStats
.
stream
().
filter
(
statsVo
->
"
农村
低保"
.
equals
(
statsVo
.
getType
())).
collect
(
Collectors
.
toList
());
List
<
StatsVo
>
cityPeopleNumStats
=
peopleNumStats
.
stream
().
filter
(
statsVo
->
"
城市
低保"
.
equals
(
statsVo
.
getType
())).
collect
(
Collectors
.
toList
());
cityPeopleNumStats
.
forEach
(
statsVo
->
{
Map
<
String
,
Object
>
data
=
map
.
computeIfAbsent
(
statsVo
.
getCode
(),
k
->
new
HashMap
<>());
data
.
put
(
"cityPeopleNum"
,
statsVo
.
getNum
());
});
// 添加农村低保人数
List
<
StatsVo
>
villagePeopleNumStats
=
peopleNumStats
.
stream
().
filter
(
statsVo
->
"
城市
低保"
.
equals
(
statsVo
.
getType
())).
collect
(
Collectors
.
toList
());
List
<
StatsVo
>
villagePeopleNumStats
=
peopleNumStats
.
stream
().
filter
(
statsVo
->
"
农村
低保"
.
equals
(
statsVo
.
getType
())).
collect
(
Collectors
.
toList
());
villagePeopleNumStats
.
forEach
(
statsVo
->
{
Map
<
String
,
Object
>
data
=
map
.
computeIfAbsent
(
statsVo
.
getCode
(),
k
->
new
HashMap
<>());
data
.
put
(
"villagePeopleNum"
,
statsVo
.
getNum
());
...
...
@@ -388,7 +399,10 @@ public class ShjzStatsService {
v
.
put
(
"city"
,
area
!=
null
?
area
.
getName
():
""
);
dataList
.
add
(
v
);
});
List
<
Map
<
String
,
Object
>>
returnData
=
dataList
.
stream
().
sorted
(
Comparator
.
comparing
(
m
->
m
.
get
(
"areaCode"
).
toString
())).
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
Object
>>
mapData
=
dataList
.
stream
().
sorted
(
Comparator
.
comparing
(
m
->
m
.
get
(
"areaCode"
).
toString
())).
collect
(
Collectors
.
toList
());
Map
<
String
,
Object
>
returnData
=
new
HashMap
<>();
returnData
.
put
(
"map"
,
mapData
);
returnData
.
put
(
"total"
,
totalData
);
redisUtils
.
setObj
(
PortalCacheKeys
.
getAreaShjzStats
(
vo
),
returnData
);
...
...
portal-server/src/main/java/com/zq/portal/vo/StatsVo.java
View file @
ce1dad44
...
...
@@ -24,6 +24,14 @@ public class StatsVo {
private
String
amount
;
private
String
hlnum
;
private
String
hlamount
;
private
String
shnum
;
private
String
shamount
;
private
String
code
;
private
String
date
;
...
...
portal-server/src/main/resources/application.yml
View file @
ce1dad44
...
...
@@ -121,5 +121,5 @@ spring:
mybatis-plus
:
global-config
:
db-config
:
select
-strategy
:
not_empty
where
-strategy
:
not_empty
update-strategy
:
not_empty
portal-server/src/main/resources/mapper/CjStatsMapper.xml
View file @
ce1dad44
...
...
@@ -99,6 +99,24 @@
GROUP BY LEFT(UNIT_ID, #{size})
</select>
<select
id=
"getAreaSubsidyStats"
resultType=
"com.zq.portal.vo.StatsVo"
>
SELECT LEFT(AREACODE, #{size}) 'code', FF_DATE 'month',SUM(FF_ZD_PC ) 'hlnum', SUM(FF_ZD_MC) 'hlamount',SUM(FF_KUN_PC) 'shnum', SUM(FF_KUN_MC) 'shamount'
FROM `ff_data_jm`
WHERE
CHAR_LENGTH (LEFT ( AREACODE, #{size} )) = #{size}
AND FF_DATE = DATE_FORMAT(NOW(),'%Y-%m')
<if
test=
"subAreaCode != null and subAreaCode != ''"
>
AND AREACODE LIKE CONCAT(#{subAreaCode}, '%')
</if>
GROUP BY LEFT(AREACODE, #{size})
</select>
<select
id=
"getEnjoySumStats"
resultType=
"com.zq.portal.vo.StatsVo"
>
SELECT SUM(S_PC) 'num' , SUM(S_MC) 'amount'
FROM ff_data_jm
WHERE FF_DATE = DATE_FORMAT(NOW(),'%Y-%m')
</select>
<select
id=
"getYearIssueStats"
resultType=
"com.zq.portal.vo.StatsVo"
>
SELECT APPLY_TYPE_ID 'type', GRANT_YEAR 'year', SUM( COUNT_PEOPLE ) 'num', SUM( SUM_MONEY ) 'amount'
FROM `statics_grant`
...
...
portal-server/src/main/resources/mapper/ShjzStatsDao.xml
View file @
ce1dad44
...
...
@@ -110,15 +110,7 @@
<select
id=
"getAreaUnderNumStats"
resultType=
"com.zq.portal.vo.StatsVo"
>
SELECT
LEFT(h.UNIT_ID, #{size}) 'code',
( CASE h.ISCITY
WHEN 0 THEN '农村低保'
WHEN 1 THEN '城市低保'
WHEN 6 THEN '特困供养'
WHEN 10 THEN '农村低收入'
WHEN 11 THEN '城市低收入'
WHEN 21 THEN '住房救助'
WHEN 31 THEN '城市特困'
ELSE '其他' END ) 'type',
h.ISCITY 'type',
SUM( h.SURE_POPULATION ) 'num'
FROM
ENBUZ_APPLY_HOME h
...
...
@@ -127,11 +119,28 @@
<if
test=
"subAreaCode != null and subAreaCode != ''"
>
AND h.UNIT_ID LIKE CONCAT(#{subAreaCode}, '%')
</if>
AND DATE_FORMAT( h.PERMIT_DATE, "%Y-%m-%d" )
<
= #{date}
AND DATE_FORMAT( h.STOP_DATE, "%Y-%m-%d" ) >= #{date}
<if
test=
"type != null and type != ''"
>
AND h.ISCITY = #{type}
</if>
AND DATE_FORMAT( h.PERMIT_DATE, "%Y-%m-%d" )
<
= '2021-12-01'
AND DATE_FORMAT( h.STOP_DATE, "%Y-%m-%d" ) >= '2021-12-01'
GROUP BY
LEFT(h.UNIT_ID, #{size}),
ISCITY
type
</select>
<select
id=
"getAreaTotalNumStats"
resultType=
"com.zq.portal.vo.StatsVo"
>
SELECT
h.ISCITY 'type',
SUM( h.SURE_POPULATION ) 'num'
FROM
ENBUZ_APPLY_HOME h
WHERE h.VP_STATE = 4
AND DATE_FORMAT( h.PERMIT_DATE, "%Y-%m-%d" )
<
= '2021-12-01'
AND DATE_FORMAT( h.STOP_DATE, "%Y-%m-%d" ) >= '2021-12-01'
AND h.ISCITY IN(0,1)
GROUP BY
type
</select>
<!--
...
...
@@ -214,10 +223,10 @@
FROM
mon_pay p
WHERE
p.pmonth >= CONCAT(DATE_FORMAT( NOW(), '%Y' ), '-01-01')
AND p.pmonth
<
= DATE_FORMAT( NOW(), '%Y%m%d' )
p.pay_state = 2
AND p.vp_state = 4
AND p.pay_state = 2
AND DATE_FORMAT( p.pmonth, "%Y-%m-%d" ) >= '2021-12-01'
AND DATE_FORMAT( p.pmonth, "%Y-%m-%d" )
<
= '2021-12-01'
AND CHAR_LENGTH (LEFT ( p.unit_id, #{size} )) = #{size}
<if
test=
"subAreaCode != null and subAreaCode != ''"
>
AND p.unit_id LIKE CONCAT(#{subAreaCode}, '%')
...
...
resource-server/src/main/java/com/zq/resource/config/TokenFilter.java
View file @
ce1dad44
...
...
@@ -62,7 +62,7 @@ public class TokenFilter extends GenericFilterBean {
public
void
doFilter
(
ServletRequest
servletRequest
,
ServletResponse
servletResponse
,
FilterChain
filterChain
)
throws
IOException
,
ServletException
{
HttpServletRequest
httpServletRequest
=
(
HttpServletRequest
)
servletRequest
;
String
token
=
resolve
Token
(
httpServletRequest
);
String
token
=
tokenProvider
.
get
Token
(
httpServletRequest
);
// 对于 Token 为空的不需要去查 Redis
if
(
StrUtil
.
isNotBlank
(
token
))
{
OnlineUserDto
onlineUserDto
=
null
;
...
...
@@ -90,23 +90,4 @@ public class TokenFilter extends GenericFilterBean {
filterChain
.
doFilter
(
servletRequest
,
servletResponse
);
}
/**
* 初步检测Token
*
* @param request /
* @return /
*/
private
String
resolveToken
(
HttpServletRequest
request
)
{
String
bearerToken
=
request
.
getHeader
(
properties
.
getHeader
());
if
(
StringUtils
.
isBlank
(
bearerToken
))
{
return
null
;
}
if
(
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
// 去掉令牌前缀
return
bearerToken
.
replace
(
properties
.
getTokenStartWith
(),
""
);
}
else
{
log
.
debug
(
"非法Token:{}"
,
bearerToken
);
}
return
null
;
}
}
resource-server/src/main/java/com/zq/resource/config/TokenProvider.java
View file @
ce1dad44
...
...
@@ -25,6 +25,7 @@ import io.jsonwebtoken.Jwts;
import
io.jsonwebtoken.SignatureAlgorithm
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
...
...
@@ -32,7 +33,6 @@ import org.springframework.security.core.GrantedAuthority;
import
org.springframework.security.core.authority.SimpleGrantedAuthority
;
import
org.springframework.security.core.userdetails.User
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean {
}
public
Authentication
getAuthentication
(
String
token
)
{
Claims
claims
=
Jwts
.
parser
()
.
setSigningKey
(
DatatypeConverter
.
parseBase64Binary
(
properties
.
getBase64Secret
()))
.
parseClaimsJws
(
token
)
.
getBody
();
Claims
claims
=
getClaims
(
token
);
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
Object
authoritiesStr
=
claims
.
get
(
AUTHORITIES_KEY
);
...
...
@@ -125,9 +122,14 @@ public class TokenProvider implements InitializingBean {
public
String
getToken
(
HttpServletRequest
request
)
{
String
bearerToken
=
request
.
getHeader
(
properties
.
getHeader
());
if
(
StringUtils
.
hasText
(
bearerToken
)
&&
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
if
(
StringUtils
.
isBlank
(
bearerToken
))
{
return
null
;
}
if
(
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
// 去掉令牌前缀
return
bearerToken
.
replace
(
properties
.
getTokenStartWith
(),
""
);
}
else
{
log
.
debug
(
"非法Token:{}"
,
bearerToken
);
}
return
null
;
}
...
...
resource-server/src/main/resources/application.yml
View file @
ce1dad44
...
...
@@ -71,7 +71,7 @@ spring:
mybatis-plus
:
global-config
:
db-config
:
select
-strategy
:
not_empty
where
-strategy
:
not_empty
update-strategy
:
not_empty
#日志等级
...
...
sync-server/src/main/java/com/zq/sync/dao/ReportErroorDao.java
0 → 100644
View file @
ce1dad44
package
com
.
zq
.
sync
.
dao
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zq.common.constant.DBName
;
import
com.zq.sync.entity.ReportError
;
import
org.springframework.stereotype.Repository
;
@DS
(
DBName
.
GXCJ
)
@Repository
public
interface
ReportErroorDao
extends
BaseMapper
<
ReportError
>
{
}
sync-server/src/main/java/com/zq/sync/entity/Fdx01.java
View file @
ce1dad44
package
com
.
zq
.
sync
.
entity
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
...
...
@@ -17,9 +21,17 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName
(
"fdx01"
)
public
class
Fdx01
{
/**
* 主键
*/
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 残疾人姓名
*/
@ApiModelProperty
(
"残疾人姓名"
)
...
...
@@ -287,23 +299,23 @@ public class Fdx01 {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
data
T
ime
;
private
Date
data
t
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
\ No newline at end of file
sync-server/src/main/java/com/zq/sync/entity/Fdx02.java
View file @
ce1dad44
package
com
.
zq
.
sync
.
entity
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
...
...
@@ -17,9 +21,17 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName
(
"fdx02"
)
public
class
Fdx02
{
/**
* 主键
*/
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 残疾人姓名
*/
@ApiModelProperty
(
"残疾人姓名"
)
...
...
@@ -287,23 +299,23 @@ public class Fdx02 {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
data
T
ime
;
private
Date
data
t
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
\ No newline at end of file
sync-server/src/main/java/com/zq/sync/entity/Fdx03.java
View file @
ce1dad44
package
com
.
zq
.
sync
.
entity
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
...
...
@@ -17,9 +21,17 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName
(
"fdx03"
)
public
class
Fdx03
{
/**
* 主键
*/
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 残疾人姓名
*/
@ApiModelProperty
(
"残疾人姓名"
)
...
...
@@ -125,23 +137,23 @@ public class Fdx03 {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
data
T
ime
;
private
Date
data
t
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
\ No newline at end of file
sync-server/src/main/java/com/zq/sync/entity/Fdx04.java
View file @
ce1dad44
package
com
.
zq
.
sync
.
entity
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
...
...
@@ -17,9 +21,17 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName
(
"fdx04"
)
public
class
Fdx04
{
/**
* 主键
*/
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 残疾人姓名
*/
@ApiModelProperty
(
"残疾人姓名"
)
...
...
@@ -149,23 +161,23 @@ public class Fdx04 {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
data
T
ime
;
private
Date
data
t
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
\ No newline at end of file
sync-server/src/main/java/com/zq/sync/entity/Fdx05.java
View file @
ce1dad44
package
com
.
zq
.
sync
.
entity
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
...
...
@@ -17,9 +21,17 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName
(
"fdx05"
)
public
class
Fdx05
{
/**
* 主键
*/
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 残疾人姓名
*/
@ApiModelProperty
(
"残疾人姓名"
)
...
...
@@ -149,23 +161,23 @@ public class Fdx05 {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
data
T
ime
;
private
Date
data
t
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
\ No newline at end of file
sync-server/src/main/java/com/zq/sync/entity/Fdx06.java
View file @
ce1dad44
package
com
.
zq
.
sync
.
entity
;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
...
...
@@ -17,9 +21,17 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName
(
"fdx06"
)
public
class
Fdx06
{
/**
* 主键
*/
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 残疾人姓名
*/
@ApiModelProperty
(
"残疾人姓名"
)
...
...
@@ -293,23 +305,23 @@ public class Fdx06 {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
data
T
ime
;
private
Date
data
t
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
\ No newline at end of file
sync-server/src/main/java/com/zq/sync/entity/Fdx07.java
View file @
ce1dad44
...
...
@@ -2,6 +2,9 @@ package com.zq.sync.entity;
import
java.util.Date
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
...
...
@@ -19,9 +22,17 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName
(
"fdx07"
)
public
class
Fdx07
{
/**
* 主键
*/
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 省
*/
@ApiModelProperty
(
"省"
)
...
...
@@ -175,23 +186,23 @@ public class Fdx07 {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
data
T
ime
;
private
Date
data
t
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
\ No newline at end of file
sync-server/src/main/java/com/zq/sync/entity/Fdx88.java
View file @
ce1dad44
package
com
.
zq
.
sync
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
...
...
@@ -23,6 +25,13 @@ import java.util.Date;
public
class
Fdx88
{
/**
* 主键
*/
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 补贴对象类型名称
*/
@ApiModelProperty
(
"补贴对象类型名称"
)
...
...
@@ -128,23 +137,23 @@ public class Fdx88 {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
data
T
ime
;
private
Date
data
t
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
\ No newline at end of file
sync-server/src/main/java/com/zq/sync/entity/ReportError.java
0 → 100644
View file @
ce1dad44
package
com
.
zq
.
sync
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName
(
"reporterror"
)
public
class
ReportError
{
/**
* 主键
*/
@ApiModelProperty
(
"主键"
)
@TableId
(
type
=
IdType
.
AUTO
)
private
Long
id
;
/**
* 表名
*/
@ApiModelProperty
(
"表名"
)
private
String
tableName
;
/**
* 流水号
*/
@ApiModelProperty
(
"流水号"
)
private
String
serialNumber
;
/**
* 错误信息
*/
@ApiModelProperty
(
"错误信息"
)
private
String
errorInfo
;
/**
* 状态
*/
@ApiModelProperty
(
"状态"
)
private
Integer
state
;
/**
* 创建时间
*/
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
}
sync-server/src/main/java/com/zq/sync/service/DisabledService.java
View file @
ce1dad44
...
...
@@ -2,11 +2,13 @@ package com.zq.sync.service;
import
cn.hutool.core.date.DatePattern
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.http.HttpRequest
;
import
cn.hutool.http.HttpResponse
;
import
cn.hutool.json.JSONArray
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.zq.sync.dao.*
;
import
com.zq.sync.entity.*
;
...
...
@@ -32,62 +34,91 @@ public class DisabledService {
private
final
Fdx03Dao
fdx03Dao
;
private
final
Fdx02Dao
fdx02Dao
;
private
final
Fdx01Dao
fdx01Dao
;
private
ReportErroorDao
erroorDao
;
public
void
fdx88
(){
public
void
reportCommon
(
HttpRequest
request
,
String
tableName
)
{
HttpResponse
response
=
request
.
execute
();
if
(
response
.
getStatus
()
!=
200
)
{
log
.
error
(
"接口请求失败 => {}"
,
request
);
}
String
body
=
response
.
body
();
JSONObject
obj
=
JSONUtil
.
parseObj
(
body
);
Integer
code
=
obj
.
getInt
(
"code"
);
if
(
code
==
null
||
code
!=
1
)
{
log
.
warn
(
"上报错误:{}, => {}"
,
request
.
getUrl
(),
body
);
}
JSONObject
bizData
=
obj
.
getJSONObject
(
"biz_data"
);
if
(
bizData
!=
null
)
{
Integer
workStatus
=
bizData
.
getInt
(
"work_status"
);
if
(
workStatus
==
2
)
{
log
.
warn
(
"上报错误biz_data.work_status=2"
);
}
JSONArray
errorList
=
bizData
.
getJSONArray
(
"error_list"
);
if
(
errorList
!=
null
&&
errorList
.
size
()
>
0
)
{
for
(
Object
o
:
errorList
)
{
JSONObject
object
=
JSONUtil
.
parseObj
(
o
);
String
serialNumber
=
object
.
getStr
(
"serialNumber"
);
String
errorInfo
=
object
.
getStr
(
"error_info"
);
erroorDao
.
insert
(
ReportError
.
builder
()
.
tableName
(
tableName
)
.
serialNumber
(
serialNumber
)
.
errorInfo
(
errorInfo
)
.
state
(
0
)
.
createTime
(
DateUtil
.
date
())
.
build
());
}
}
}
}
public
void
fdx88
()
{
int
page
=
1
;
int
size
=
10000
;
while
(
true
){
Page
<
Fdx88
>
fdx88Page
=
fdx88Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
null
);
int
size
=
1000
;
while
(
true
)
{
LambdaQueryWrapper
<
Fdx88
>
lambdaQuery
=
Wrappers
.
lambdaQuery
(
Fdx88
.
class
).
orderByAsc
(
Fdx88:
:
getId
);
Page
<
Fdx88
>
fdx88Page
=
fdx88Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
lambdaQuery
);
List
<
Fdx88
>
records
=
fdx88Page
.
getRecords
();
for
(
Fdx88
fdx88
:
records
)
{
Fdx88Vo
build
=
Fdx88Vo
.
builder
()
.
afdx0801
(
fdx88
.
getAfdx0801
())
.
axcp0004
(
fdx88
.
getAxcp0004
())
.
afdx0803
(
fdx88
.
getAfdx0803
()
!=
null
?
BigDecimal
.
valueOf
(
fdx88
.
getAfdx0803
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
afdx0803
(
fdx88
.
getAfdx0803
()
!=
null
?
BigDecimal
.
valueOf
(
fdx88
.
getAfdx0803
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
afdx0804
(
fdx88
.
getAfdx0804
())
.
afdx0805
(
fdx88
.
getAfdx0805
())
.
afdx0806
(
fdx88
.
getAfdx0806
())
.
afdx0807
(
fdx88
.
getAfdx0807
())
.
afdx0808
(
fdx88
.
getAfdx0808
())
.
afdx0809
(
fdx88
.
getAfdx0809
())
.
afdx0810
(
fdx88
.
getAfdx0810
()
!=
null
?
DateUtil
.
format
(
fdx88
.
getAfdx0810
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0811
(
fdx88
.
getAfdx0811
()
!=
null
?
DateUtil
.
format
(
fdx88
.
getAfdx0811
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0810
(
fdx88
.
getAfdx0810
()
!=
null
?
DateUtil
.
format
(
fdx88
.
getAfdx0810
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
afdx0811
(
fdx88
.
getAfdx0811
()
!=
null
?
DateUtil
.
format
(
fdx88
.
getAfdx0811
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
afdx0812
(
fdx88
.
getAfdx0812
())
.
afdx0814
(
fdx88
.
getAfdx0814
())
.
afdx0815
(
fdx88
.
getAfdx0815
())
.
afdx0816
(
fdx88
.
getAfdx0816
())
.
afdx0817
(
fdx88
.
getAfdx0817
()
!=
null
?
DateUtil
.
format
(
fdx88
.
getAfdx0817
(),
DatePattern
.
NORM_DATETIME_PATTERN
):
""
)
.
afdx0818
(
fdx88
.
getAfdx0818
()
!=
null
?
DateUtil
.
format
(
fdx88
.
getAfdx0818
(),
DatePattern
.
NORM_DATETIME_PATTERN
):
""
)
.
serial
Numner
(
fdx88
.
getSerialNumn
er
())
.
data
Status
(
fdx88
.
getDataS
tatus
())
.
data
Time
(
fdx88
.
getDataTime
()
)
.
area
Code
(
fdx88
.
getAreaC
ode
())
.
afdx0817
(
fdx88
.
getAfdx0817
()
!=
null
?
DateUtil
.
format
(
fdx88
.
getAfdx0817
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0818
(
fdx88
.
getAfdx0818
()
!=
null
?
DateUtil
.
format
(
fdx88
.
getAfdx0818
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
serial
number
(
fdx88
.
getSerialnumb
er
())
.
data
status
(
fdx88
.
getDatas
tatus
())
.
data
time
(
fdx88
.
getDatatime
()
!=
null
?
DateUtil
.
format
(
fdx88
.
getDatatime
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
area
code
(
fdx88
.
getAreac
ode
())
.
build
();
HttpRequest
request
=
HttpRequest
.
post
(
"https://59.255.186.1/yhbcp-engine_gov/rest/cjrfl_report_btdxlxxx"
)
HttpRequest
request
=
HttpRequest
.
post
(
"https://zwxt.mca.gov.cn/yhbcp-engine_gov/rest/cjrfl_report_btdxlxxx"
)
.
contentType
(
"application/x-www-form-urlencoded"
)
.
form
(
"access_key"
,
"mzb_gx_450000"
)
.
form
(
"format"
,
"json"
)
.
form
(
"request_id"
,
IdUtil
.
simpleUUID
())
.
form
(
"sign"
,
""
)
.
form
(
"timestamp"
,
System
.
currentTimeMillis
())
.
form
(
"version"
,
"1.0"
)
.
form
(
"biz_content"
,
JSONUtil
.
toJsonStr
(
build
));
HttpResponse
response
=
request
.
execute
();
if
(
response
.
getStatus
()!=
200
){
log
.
error
(
"接口请求失败 => {}"
,
request
);
}
String
body
=
response
.
body
();
JSONObject
obj
=
JSONUtil
.
parseObj
(
body
);
Integer
code
=
obj
.
getInt
(
"code"
);
if
(
code
==
null
||
code
!=
1
){
log
.
warn
(
"上报错误 => {}"
,
body
);
}
System
.
out
.
println
(
request
);
reportCommon
(
request
,
"fdx88"
);
}
if
(!
fdx88Page
.
hasNext
())
{
if
(!
fdx88Page
.
hasNext
())
{
break
;
}
page
++;
...
...
@@ -96,94 +127,86 @@ public class DisabledService {
public
void
fdx07
()
{
int
page
=
1
;
int
size
=
10000
;
while
(
true
){
Page
<
Fdx07
>
fdx07Page
=
fdx07Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
null
);
int
size
=
5000
;
while
(
true
)
{
LambdaQueryWrapper
<
Fdx07
>
lambdaQuery
=
Wrappers
.
lambdaQuery
(
Fdx07
.
class
).
orderByAsc
(
Fdx07:
:
getId
);
Page
<
Fdx07
>
fdx07Page
=
fdx07Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
lambdaQuery
);
List
<
Fdx07
>
records
=
fdx07Page
.
getRecords
();
for
(
Fdx07
fdx07
:
records
)
{
Fdx07Vo
build
=
Fdx07Vo
.
builder
()
.
agax0806
(
fdx07
.
getAgax0806
())
.
agax0807
(
fdx07
.
getAgax0807
())
.
agax0808
(
fdx07
.
getAgax0808
())
.
agax0901
(
fdx07
.
getAgax0901
()
!=
null
?
DateUtil
.
format
(
fdx07
.
getAgax0901
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
agax0901
(
fdx07
.
getAgax0901
()
!=
null
?
DateUtil
.
format
(
fdx07
.
getAgax0901
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
agax0902
(
fdx07
.
getAgax0902
())
.
agax0903
(
fdx07
.
getAgax0903
())
.
agax0904
(
fdx07
.
getAgax0904
())
.
agax0905
(
fdx07
.
getAgax0905
()
!=
null
?
BigDecimal
.
valueOf
(
fdx07
.
getAgax0905
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
agax0906
(
fdx07
.
getAgax0906
()
!=
null
?
BigDecimal
.
valueOf
(
fdx07
.
getAgax0906
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
agax0907
(
fdx07
.
getAgax0907
()
!=
null
?
BigDecimal
.
valueOf
(
fdx07
.
getAgax0907
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
agax0905
(
fdx07
.
getAgax0905
()
!=
null
?
BigDecimal
.
valueOf
(
fdx07
.
getAgax0905
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
agax0906
(
fdx07
.
getAgax0906
()
!=
null
?
BigDecimal
.
valueOf
(
fdx07
.
getAgax0906
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
agax0907
(
fdx07
.
getAgax0907
()
!=
null
?
BigDecimal
.
valueOf
(
fdx07
.
getAgax0907
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
agax0908
(
fdx07
.
getAgax0908
())
.
agax0909
(
fdx07
.
getAgax0909
()
!=
null
?
BigDecimal
.
valueOf
(
fdx07
.
getAgax0909
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
agax0909
(
fdx07
.
getAgax0909
()
!=
null
?
BigDecimal
.
valueOf
(
fdx07
.
getAgax0909
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
agax0910
(
fdx07
.
getAgax0910
())
.
agax0911
(
fdx07
.
getAgax0911
()
!=
null
?
BigDecimal
.
valueOf
(
fdx07
.
getAgax0911
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
agax0911
(
fdx07
.
getAgax0911
()
!=
null
?
BigDecimal
.
valueOf
(
fdx07
.
getAgax0911
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
agax0912
(
fdx07
.
getAgax0912
())
.
agax0913
(
fdx07
.
getAgax0913
())
.
agax0914
(
fdx07
.
getAgax0914
())
.
agax0915
(
fdx07
.
getAgax0915
())
.
agax0916
(
fdx07
.
getAgax0916
())
.
agax0917
(
fdx07
.
getAgax0917
())
.
agax0918
(
fdx07
.
getAgax0918
()
!=
null
?
BigDecimal
.
valueOf
(
fdx07
.
getAgax0918
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
agax0918
(
fdx07
.
getAgax0918
()
!=
null
?
BigDecimal
.
valueOf
(
fdx07
.
getAgax0918
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
agax0919
(
fdx07
.
getAgax0919
())
.
agax0920
(
fdx07
.
getAgax0920
())
.
agax0921
(
fdx07
.
getAgax0921
())
.
agax0922
(
fdx07
.
getAgax0922
())
.
serial
Numner
(
fdx07
.
getSerialNumn
er
())
.
data
Status
(
fdx07
.
getDataS
tatus
())
.
data
Time
(
fdx07
.
getDataTime
()
)
.
area
Code
(
fdx07
.
getAreaC
ode
())
.
serial
number
(
fdx07
.
getSerialnumb
er
())
.
data
status
(
fdx07
.
getDatas
tatus
())
.
data
time
(
fdx07
.
getDatatime
()
!=
null
?
DateUtil
.
format
(
fdx07
.
getDatatime
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
area
code
(
fdx07
.
getAreac
ode
())
.
build
();
HttpRequest
request
=
HttpRequest
.
post
(
"https://59.255.186.1/yhbcp-engine_gov/rest/cjrfl_report_ffhzxx"
)
HttpRequest
request
=
HttpRequest
.
post
(
"https://zwxt.mca.gov.cn/yhbcp-engine_gov/rest/cjrfl_report_ffhzxx"
)
.
contentType
(
"application/x-www-form-urlencoded"
)
.
form
(
"access_key"
,
"mzb_gx_450000"
)
.
form
(
"format"
,
"json"
)
.
form
(
"request_id"
,
IdUtil
.
simpleUUID
())
.
form
(
"sign"
,
""
)
.
form
(
"timestamp"
,
System
.
currentTimeMillis
())
.
form
(
"version"
,
"1.0"
)
.
form
(
"biz_content"
,
JSONUtil
.
toJsonStr
(
build
));
HttpResponse
response
=
request
.
execute
();
if
(
response
.
getStatus
()!=
200
){
log
.
error
(
"接口请求失败 => {}"
,
request
);
}
String
body
=
response
.
body
();
JSONObject
obj
=
JSONUtil
.
parseObj
(
body
);
Integer
code
=
obj
.
getInt
(
"code"
);
if
(
code
==
null
||
code
!=
1
){
log
.
warn
(
"上报错误 => {}"
,
body
);
}
reportCommon
(
request
,
"fdx07"
);
}
if
(!
fdx07Page
.
hasNext
())
{
if
(!
fdx07Page
.
hasNext
())
{
break
;
}
page
++;
}
}
public
void
fdx06
(){
public
void
fdx06
()
{
int
page
=
1
;
int
size
=
10000
;
while
(
true
){
Page
<
Fdx06
>
fdx06Page
=
fdx06Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
null
);
int
size
=
5000
;
while
(
true
)
{
LambdaQueryWrapper
<
Fdx06
>
lambdaQuery
=
Wrappers
.
lambdaQuery
(
Fdx06
.
class
).
orderByAsc
(
Fdx06:
:
getId
);
Page
<
Fdx06
>
fdx06Page
=
fdx06Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
lambdaQuery
);
List
<
Fdx06
>
records
=
fdx06Page
.
getRecords
();
for
(
Fdx06
fdx06
:
records
)
{
Fdx06Vo
build
=
Fdx06Vo
.
builder
()
Fdx06Vo
build
=
Fdx06Vo
.
builder
()
.
axcp0002
(
fdx06
.
getAxcp0002
())
.
axcp0006
(
fdx06
.
getAxcp0006
())
.
agax0823
(
fdx06
.
getAgax0823
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAgax0823
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
agax0823
(
fdx06
.
getAgax0823
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAgax0823
(),
DatePattern
.
NORM_DATE_PATTERN
)
:
""
)
.
axcp0008
(
fdx06
.
getAxcp0008
())
.
axcp0005
(
fdx06
.
getAxcp0005
())
.
afdp0505
(
fdx06
.
getAfdp0505
())
.
afdx0831
(
fdx06
.
getAfdx0831
())
.
afdx0831
(
fdx06
.
getAfdx0831
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0831
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0852
(
fdx06
.
getAfdx0852
())
.
afdp0504
(
fdx06
.
getAfdp0504
())
.
afdp0503
(
fdx06
.
getAfdp0503
())
.
afdx0053
(
fdx06
.
getAfdx0053
())
.
axcp0014
(
fdx06
.
getAxcp0014
())
.
afdx0054
(
fdx06
.
getAfdx0054
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0054
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0055
(
fdx06
.
getAfdx0055
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0055
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0851
(
fdx06
.
getAfdx0851
()
!=
null
?
BigDecimal
.
valueOf
(
fdx06
.
getAfdx0851
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
afdx0561
(
fdx06
.
getAfdx0561
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0561
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0054
(
fdx06
.
getAfdx0054
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0054
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
afdx0055
(
fdx06
.
getAfdx0055
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0055
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
afdx0851
(
fdx06
.
getAfdx0851
()
!=
null
?
BigDecimal
.
valueOf
(
fdx06
.
getAfdx0851
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
afdx0561
(
fdx06
.
getAfdx0561
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0561
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
afdx0829
(
fdx06
.
getAfdx0829
())
.
afdx0830
(
fdx06
.
getAfdx0830
())
.
afdx0820
(
fdx06
.
getAfdx0820
())
...
...
@@ -208,54 +231,45 @@ public class DisabledService {
.
afdx1017
(
fdx06
.
getAfdx1017
())
.
afdx0574
(
fdx06
.
getAfdx0574
())
.
afdx0572
(
fdx06
.
getAfdx0572
())
.
afdx0868
(
fdx06
.
getAfdx0868
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0868
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0869
(
fdx06
.
getAfdx0869
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0869
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0870
(
fdx06
.
getAfdx0870
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0870
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0817
(
fdx06
.
getAfdx0817
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0817
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0818
(
fdx06
.
getAfdx0818
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0818
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
serial
Numner
(
fdx06
.
getSerialNumn
er
())
.
data
Status
(
fdx06
.
getDataS
tatus
())
.
data
Time
(
fdx06
.
getDataTime
()
)
.
area
Code
(
fdx06
.
getAreaC
ode
())
.
afdx0868
(
fdx06
.
getAfdx0868
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0868
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0869
(
fdx06
.
getAfdx0869
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0869
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0870
(
fdx06
.
getAfdx0870
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0870
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0817
(
fdx06
.
getAfdx0817
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0817
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0818
(
fdx06
.
getAfdx0818
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getAfdx0818
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
serial
number
(
fdx06
.
getSerialnumb
er
())
.
data
status
(
fdx06
.
getDatas
tatus
())
.
data
time
(
fdx06
.
getDatatime
()
!=
null
?
DateUtil
.
format
(
fdx06
.
getDatatime
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
area
code
(
fdx06
.
getAreac
ode
())
.
build
();
HttpRequest
request
=
HttpRequest
.
post
(
"https://59.255.186.1/yhbcp-engine_gov/rest/cjrfl_report_lsxx"
)
HttpRequest
request
=
HttpRequest
.
post
(
"https://zwxt.mca.gov.cn/yhbcp-engine_gov/rest/cjrfl_report_lsxx"
)
.
contentType
(
"application/x-www-form-urlencoded"
)
.
form
(
"access_key"
,
"mzb_gx_450000"
)
.
form
(
"format"
,
"json"
)
.
form
(
"request_id"
,
IdUtil
.
simpleUUID
())
.
form
(
"sign"
,
""
)
.
form
(
"timestamp"
,
System
.
currentTimeMillis
())
.
form
(
"version"
,
"1.0"
)
.
form
(
"biz_content"
,
JSONUtil
.
toJsonStr
(
build
));
HttpResponse
response
=
request
.
execute
();
if
(
response
.
getStatus
()!=
200
){
log
.
error
(
"接口请求失败 => {}"
,
request
);
}
String
body
=
response
.
body
();
JSONObject
obj
=
JSONUtil
.
parseObj
(
body
);
Integer
code
=
obj
.
getInt
(
"code"
);
if
(
code
==
null
||
code
!=
1
){
log
.
warn
(
"上报错误 => {}"
,
body
);
}
}
if
(!
fdx06Page
.
hasNext
()){
break
;
}
page
++;
reportCommon
(
request
,
"fdx06"
);
}
if
(!
fdx06Page
.
hasNext
())
{
break
;
}
page
++;
}
}
public
void
fdx05
(){
public
void
fdx05
()
{
int
page
=
1
;
int
size
=
10000
;
while
(
true
){
Page
<
Fdx05
>
fdx05Page
=
fdx05Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
null
);
int
size
=
5000
;
while
(
true
)
{
LambdaQueryWrapper
<
Fdx05
>
lambdaQuery
=
Wrappers
.
lambdaQuery
(
Fdx05
.
class
).
orderByAsc
(
Fdx05:
:
getId
);
Page
<
Fdx05
>
fdx05Page
=
fdx05Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
lambdaQuery
);
List
<
Fdx05
>
records
=
fdx05Page
.
getRecords
();
for
(
Fdx05
fdx05
:
records
)
{
Fdx05Vo
build
=
Fdx05Vo
.
builder
()
.
axcp0002
(
fdx05
.
getAxcp0002
())
.
axcp0006
(
fdx05
.
getAxcp0006
())
.
afdx0823
(
fdx05
.
getAfdx0823
()
!=
null
?
DateUtil
.
format
(
fdx05
.
getAfdx0823
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0823
(
fdx05
.
getAfdx0823
()
!=
null
?
DateUtil
.
format
(
fdx05
.
getAfdx0823
(),
DatePattern
.
NORM_DATE_PATTERN
)
:
""
)
.
axcp0008
(
fdx05
.
getAxcp0008
())
.
axcp0005
(
fdx05
.
getAxcp0005
())
.
afdp0505
(
fdx05
.
getAfdp0505
())
...
...
@@ -265,60 +279,51 @@ public class DisabledService {
.
afdx0830
(
fdx05
.
getAfdx0830
())
.
axcp0009
(
fdx05
.
getAxcp0009
())
.
axcp0010
(
fdx05
.
getAxcp0010
())
.
axcp0011
(
fdx05
.
getAxcp0011
()
!=
null
?
DateUtil
.
format
(
fdx05
.
getAxcp0011
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
axcp0012
(
fdx05
.
getAxcp0012
()
!=
null
?
DateUtil
.
format
(
fdx05
.
getAxcp0012
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
axcp0013
(
fdx05
.
getAxcp0013
()
!=
null
?
DateUtil
.
format
(
fdx05
.
getAxcp0013
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
axcp0011
(
fdx05
.
getAxcp0011
()
!=
null
?
DateUtil
.
format
(
fdx05
.
getAxcp0011
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
axcp0012
(
fdx05
.
getAxcp0012
()
!=
null
?
DateUtil
.
format
(
fdx05
.
getAxcp0012
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
axcp0013
(
fdx05
.
getAxcp0013
()
!=
null
?
DateUtil
.
format
(
fdx05
.
getAxcp0013
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
axcp0014
(
fdx05
.
getAxcp0014
())
.
axcp0015
(
fdx05
.
getAxcp0015
())
.
afdx0806
(
fdx05
.
getAfdx0806
())
.
afdx0807
(
fdx05
.
getAfdx0807
())
.
afdx0808
(
fdx05
.
getAfdx0808
())
.
afdx0802
(
fdx05
.
getAfdx0802
())
.
serial
Numner
(
fdx05
.
getSerialNumn
er
())
.
data
Status
(
fdx05
.
getDataS
tatus
())
.
data
Time
(
fdx05
.
getDataTime
()
)
.
area
Code
(
fdx05
.
getAreaC
ode
())
.
serial
number
(
fdx05
.
getSerialnumb
er
())
.
data
status
(
fdx05
.
getDatas
tatus
())
.
data
time
(
fdx05
.
getDatatime
()
!=
null
?
DateUtil
.
format
(
fdx05
.
getDatatime
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
area
code
(
fdx05
.
getAreac
ode
())
.
build
();
HttpRequest
request
=
HttpRequest
.
post
(
"https://59.255.186.1/yhbcp-engine_gov/rest/cjrfl_report_zjryxx"
)
HttpRequest
request
=
HttpRequest
.
post
(
"https://zwxt.mca.gov.cn/yhbcp-engine_gov/rest/cjrfl_report_zjryxx"
)
.
contentType
(
"application/x-www-form-urlencoded"
)
.
form
(
"access_key"
,
"mzb_gx_450000"
)
.
form
(
"format"
,
"json"
)
.
form
(
"request_id"
,
IdUtil
.
simpleUUID
())
.
form
(
"sign"
,
""
)
.
form
(
"timestamp"
,
System
.
currentTimeMillis
())
.
form
(
"version"
,
"1.0"
)
.
form
(
"biz_content"
,
JSONUtil
.
toJsonStr
(
build
));
HttpResponse
response
=
request
.
execute
();
if
(
response
.
getStatus
()!=
200
){
log
.
error
(
"接口请求失败 => {}"
,
request
);
}
String
body
=
response
.
body
();
JSONObject
obj
=
JSONUtil
.
parseObj
(
body
);
Integer
code
=
obj
.
getInt
(
"code"
);
if
(
code
==
null
||
code
!=
1
){
log
.
warn
(
"上报错误 => {}"
,
body
);
}
}
if
(!
fdx05Page
.
hasNext
()){
break
;
}
page
++;
reportCommon
(
request
,
"fdx05"
);
}
if
(!
fdx05Page
.
hasNext
())
{
break
;
}
page
++;
}
}
public
void
fdx04
(){
public
void
fdx04
()
{
int
page
=
1
;
int
size
=
10000
;
while
(
true
){
Page
<
Fdx04
>
fdx04Page
=
fdx04Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
null
);
int
size
=
5000
;
while
(
true
)
{
LambdaQueryWrapper
<
Fdx04
>
lambdaQuery
=
Wrappers
.
lambdaQuery
(
Fdx04
.
class
).
orderByAsc
(
Fdx04:
:
getId
);
Page
<
Fdx04
>
fdx04Page
=
fdx04Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
lambdaQuery
);
List
<
Fdx04
>
records
=
fdx04Page
.
getRecords
();
for
(
Fdx04
fdx04
:
records
){
for
(
Fdx04
fdx04
:
records
)
{
Fdx04Vo
build
=
Fdx04Vo
.
builder
()
.
axcp0002
(
fdx04
.
getAxcp0002
())
.
axcp0006
(
fdx04
.
getAxcp0006
())
.
afdx0823
(
fdx04
.
getAfdx0823
()
!=
null
?
DateUtil
.
format
(
fdx04
.
getAfdx0823
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0823
(
fdx04
.
getAfdx0823
()
!=
null
?
DateUtil
.
format
(
fdx04
.
getAfdx0823
(),
DatePattern
.
NORM_DATE_PATTERN
)
:
""
)
.
axcp0008
(
fdx04
.
getAxcp0008
())
.
axcp0005
(
fdx04
.
getAxcp0005
())
.
afdp0505
(
fdx04
.
getAfdp0505
())
...
...
@@ -328,58 +333,49 @@ public class DisabledService {
.
afdx0830
(
fdx04
.
getAfdx0830
())
.
axcp0009
(
fdx04
.
getAxcp0009
())
.
axcp0010
(
fdx04
.
getAxcp0010
())
.
axcp0011
(
fdx04
.
getAxcp0011
()
!=
null
?
DateUtil
.
format
(
fdx04
.
getAxcp0011
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
axcp0012
(
fdx04
.
getAxcp0012
()
!=
null
?
DateUtil
.
format
(
fdx04
.
getAxcp0012
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
axcp0013
(
fdx04
.
getAxcp0013
()
!=
null
?
DateUtil
.
format
(
fdx04
.
getAxcp0013
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
axcp0011
(
fdx04
.
getAxcp0011
()
!=
null
?
DateUtil
.
format
(
fdx04
.
getAxcp0011
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
axcp0012
(
fdx04
.
getAxcp0012
()
!=
null
?
DateUtil
.
format
(
fdx04
.
getAxcp0012
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
axcp0013
(
fdx04
.
getAxcp0013
()
!=
null
?
DateUtil
.
format
(
fdx04
.
getAxcp0013
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
axcp0014
(
fdx04
.
getAxcp0014
())
.
afdx0055
(
fdx04
.
getAfdx0055
()
!=
null
?
BigDecimal
.
valueOf
(
fdx04
.
getAfdx0055
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
afdx0055
(
fdx04
.
getAfdx0055
()
!=
null
?
BigDecimal
.
valueOf
(
fdx04
.
getAfdx0055
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
afdx0806
(
fdx04
.
getAfdx0806
())
.
afdx0807
(
fdx04
.
getAfdx0807
())
.
afdx0808
(
fdx04
.
getAfdx0808
())
.
afdx0802
(
fdx04
.
getAfdx0802
())
.
serial
Numner
(
fdx04
.
getSerialNumn
er
())
.
data
Status
(
fdx04
.
getDataS
tatus
())
.
data
Time
(
fdx04
.
getDataTime
()
)
.
area
Code
(
fdx04
.
getAreaC
ode
())
.
serial
number
(
fdx04
.
getSerialnumb
er
())
.
data
status
(
fdx04
.
getDatas
tatus
())
.
data
time
(
fdx04
.
getDatatime
()
!=
null
?
DateUtil
.
format
(
fdx04
.
getDatatime
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
area
code
(
fdx04
.
getAreac
ode
())
.
build
();
HttpRequest
request
=
HttpRequest
.
post
(
"https://59.255.186.1/yhbcp-engine_gov/rest/cjrfl_report_bfryxx"
)
HttpRequest
request
=
HttpRequest
.
post
(
"https://zwxt.mca.gov.cn/yhbcp-engine_gov/rest/cjrfl_report_bfryxx"
)
.
contentType
(
"application/x-www-form-urlencoded"
)
.
form
(
"access_key"
,
"mzb_gx_450000"
)
.
form
(
"format"
,
"json"
)
.
form
(
"request_id"
,
IdUtil
.
simpleUUID
())
.
form
(
"sign"
,
""
)
.
form
(
"timestamp"
,
System
.
currentTimeMillis
())
.
form
(
"version"
,
"1.0"
)
.
form
(
"biz_content"
,
JSONUtil
.
toJsonStr
(
build
));
HttpResponse
response
=
request
.
execute
();
if
(
response
.
getStatus
()!=
200
){
log
.
error
(
"接口请求失败 => {}"
,
request
);
}
String
body
=
response
.
body
();
JSONObject
obj
=
JSONUtil
.
parseObj
(
body
);
Integer
code
=
obj
.
getInt
(
"code"
);
if
(
code
==
null
||
code
!=
1
){
log
.
warn
(
"上报错误 => {}"
,
body
);
}
}
if
(!
fdx04Page
.
hasNext
()){
break
;
}
page
++;
reportCommon
(
request
,
"fdx04"
);
}
if
(!
fdx04Page
.
hasNext
())
{
break
;
}
page
++;
}
}
public
void
fdx03
()
{
int
page
=
1
;
int
size
=
10000
;
while
(
true
){
Page
<
Fdx03
>
fdx03Page
=
fdx03Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
null
);
int
size
=
5000
;
while
(
true
)
{
LambdaQueryWrapper
<
Fdx03
>
lambdaQuery
=
Wrappers
.
lambdaQuery
(
Fdx03
.
class
).
orderByAsc
(
Fdx03:
:
getId
);
Page
<
Fdx03
>
fdx03Page
=
fdx03Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
lambdaQuery
);
List
<
Fdx03
>
records
=
fdx03Page
.
getRecords
();
for
(
Fdx03
fdx03
:
records
)
{
Fdx03Vo
build
=
Fdx03Vo
.
builder
()
.
axcp0002
(
fdx03
.
getAxcp0002
())
.
axcp0006
(
fdx03
.
getAxcp0006
())
.
afdx0823
(
fdx03
.
getAfdx0823
()
!=
null
?
DateUtil
.
format
(
fdx03
.
getAfdx0823
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0823
(
fdx03
.
getAfdx0823
()
!=
null
?
DateUtil
.
format
(
fdx03
.
getAfdx0823
(),
DatePattern
.
NORM_DATE_PATTERN
)
:
""
)
.
axcp0008
(
fdx03
.
getAxcp0008
())
.
axcp0005
(
fdx03
.
getAxcp0005
())
.
afdp0505
(
fdx03
.
getAfdp0505
())
...
...
@@ -388,68 +384,59 @@ public class DisabledService {
.
afdx0829
(
fdx03
.
getAfdx0829
())
.
afdx0830
(
fdx03
.
getAfdx0830
())
.
afdx0831
(
fdx03
.
getAfdx0831
())
.
afdx0832
(
fdx03
.
getAfdx0832
()
!=
null
?
DateUtil
.
format
(
fdx03
.
getAfdx0832
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0832
(
fdx03
.
getAfdx0832
()
!=
null
?
DateUtil
.
format
(
fdx03
.
getAfdx0832
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
axcp0004
(
fdx03
.
getAxcp0004
())
.
afdx0806
(
fdx03
.
getAfdx0806
())
.
afdx0807
(
fdx03
.
getAfdx0807
())
.
afdx0808
(
fdx03
.
getAfdx0808
())
.
afdx0802
(
fdx03
.
getAfdx0802
())
.
serial
Numner
(
fdx03
.
getSerialNumn
er
())
.
data
Status
(
fdx03
.
getDataS
tatus
())
.
data
Time
(
fdx03
.
getDataTime
()
)
.
area
Code
(
fdx03
.
getAreaC
ode
())
.
serial
number
(
fdx03
.
getSerialnumb
er
())
.
data
status
(
fdx03
.
getDatas
tatus
())
.
data
time
(
fdx03
.
getDatatime
()
!=
null
?
DateUtil
.
format
(
fdx03
.
getDatatime
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
area
code
(
fdx03
.
getAreac
ode
())
.
build
();
HttpRequest
request
=
HttpRequest
.
post
(
"https://59.255.186.1/yhbcp-engine_gov/rest/cjrfl_report_tfryxx"
)
HttpRequest
request
=
HttpRequest
.
post
(
"https://zwxt.mca.gov.cn/yhbcp-engine_gov/rest/cjrfl_report_tfryxx"
)
.
contentType
(
"application/x-www-form-urlencoded"
)
.
form
(
"access_key"
,
"mzb_gx_450000"
)
.
form
(
"format"
,
"json"
)
.
form
(
"request_id"
,
IdUtil
.
simpleUUID
())
.
form
(
"sign"
,
""
)
.
form
(
"timestamp"
,
System
.
currentTimeMillis
())
.
form
(
"version"
,
"1.0"
)
.
form
(
"biz_content"
,
JSONUtil
.
toJsonStr
(
build
));
HttpResponse
response
=
request
.
execute
();
if
(
response
.
getStatus
()
!=
200
)
{
log
.
error
(
"接口请求失败 => {}"
,
request
);
}
String
body
=
response
.
body
();
JSONObject
obj
=
JSONUtil
.
parseObj
(
body
);
Integer
code
=
obj
.
getInt
(
"code"
);
if
(
code
==
null
||
code
!=
1
)
{
log
.
warn
(
"上报错误 => {}"
,
body
);
}
}
if
(!
fdx03Page
.
hasNext
())
{
break
;
}
page
++;
reportCommon
(
request
,
"fdx03"
);
}
if
(!
fdx03Page
.
hasNext
())
{
break
;
}
page
++;
}
}
public
void
fdx02
(){
public
void
fdx02
()
{
int
page
=
1
;
int
size
=
10000
;
while
(
true
){
Page
<
Fdx02
>
fdx02Page
=
fdx02Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
null
);
int
size
=
5000
;
while
(
true
)
{
LambdaQueryWrapper
<
Fdx02
>
lambdaQuery
=
Wrappers
.
lambdaQuery
(
Fdx02
.
class
).
orderByAsc
(
Fdx02:
:
getId
);
Page
<
Fdx02
>
fdx02Page
=
fdx02Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
lambdaQuery
);
List
<
Fdx02
>
records
=
fdx02Page
.
getRecords
();
for
(
Fdx02
fdx02
:
records
)
{
Fdx02Vo
build
=
Fdx02Vo
.
builder
()
Fdx02Vo
build
=
Fdx02Vo
.
builder
()
.
axcp0002
(
fdx02
.
getAxcp0002
())
.
axcp0006
(
fdx02
.
getAxcp0006
())
.
afdx0823
(
fdx02
.
getAfdx0823
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0823
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0823
(
fdx02
.
getAfdx0823
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0823
(),
DatePattern
.
NORM_DATE_PATTERN
)
:
""
)
.
axcp0008
(
fdx02
.
getAxcp0008
())
.
axcp0005
(
fdx02
.
getAxcp0005
())
.
afdp0505
(
fdx02
.
getAfdp0505
())
.
afdx0831
(
fdx02
.
getAfdx0831
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0831
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0831
(
fdx02
.
getAfdx0831
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0831
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0852
(
fdx02
.
getAfdx0852
())
.
afdp0504
(
fdx02
.
getAfdp0504
())
.
afdp0503
(
fdx02
.
getAfdp0503
())
.
afdx0053
(
fdx02
.
getAfdx0053
())
.
axcp0014
(
fdx02
.
getAxcp0014
())
.
afdx0055
(
fdx02
.
getAfdx0055
()
!=
null
?
BigDecimal
.
valueOf
(
fdx02
.
getAfdx0055
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
afdx0851
(
fdx02
.
getAfdx0851
()
!=
null
?
BigDecimal
.
valueOf
(
fdx02
.
getAfdx0851
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
afdx0561
(
fdx02
.
getAfdx0561
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0561
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0055
(
fdx02
.
getAfdx0055
()
!=
null
?
BigDecimal
.
valueOf
(
fdx02
.
getAfdx0055
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
afdx0851
(
fdx02
.
getAfdx0851
()
!=
null
?
BigDecimal
.
valueOf
(
fdx02
.
getAfdx0851
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
afdx0561
(
fdx02
.
getAfdx0561
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0561
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
afdx0829
(
fdx02
.
getAfdx0829
())
.
afdx0830
(
fdx02
.
getAfdx0830
())
.
afdx0820
(
fdx02
.
getAfdx0820
())
...
...
@@ -474,39 +461,29 @@ public class DisabledService {
.
afdx1017
(
fdx02
.
getAfdx1017
())
.
afdx0574
(
fdx02
.
getAfdx0574
())
.
afdx0572
(
fdx02
.
getAfdx0572
())
.
afdx0868
(
fdx02
.
getAfdx0868
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0868
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0869
(
fdx02
.
getAfdx0869
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0869
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0870
(
fdx02
.
getAfdx0870
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0870
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0817
(
fdx02
.
getAfdx0817
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0817
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0818
(
fdx02
.
getAfdx0818
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0818
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
serial
Numner
(
fdx02
.
getSerialNumn
er
())
.
data
Status
(
fdx02
.
getDataS
tatus
())
.
data
Time
(
fdx02
.
getDataTime
()
)
.
area
Code
(
fdx02
.
getAreaC
ode
())
.
afdx0868
(
fdx02
.
getAfdx0868
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0868
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0869
(
fdx02
.
getAfdx0869
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0869
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0870
(
fdx02
.
getAfdx0870
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0870
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0817
(
fdx02
.
getAfdx0817
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0817
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0818
(
fdx02
.
getAfdx0818
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getAfdx0818
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
serial
number
(
fdx02
.
getSerialnumb
er
())
.
data
status
(
fdx02
.
getDatas
tatus
())
.
data
time
(
fdx02
.
getDatatime
()
!=
null
?
DateUtil
.
format
(
fdx02
.
getDatatime
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
area
code
(
fdx02
.
getAreac
ode
())
.
build
();
HttpRequest
request
=
HttpRequest
.
post
(
"https://59.255.186.1/yhbcp-engine_gov/rest/cjrfl_report_xzryxx"
)
HttpRequest
request
=
HttpRequest
.
post
(
"https://zwxt.mca.gov.cn/yhbcp-engine_gov/rest/cjrfl_report_xzryxx"
)
.
contentType
(
"application/x-www-form-urlencoded"
)
.
form
(
"access_key"
,
"mzb_gx_450000"
)
.
form
(
"format"
,
"json"
)
.
form
(
"request_id"
,
IdUtil
.
simpleUUID
())
.
form
(
"sign"
,
""
)
.
form
(
"timestamp"
,
System
.
currentTimeMillis
())
.
form
(
"version"
,
"1.0"
)
.
form
(
"biz_content"
,
JSONUtil
.
toJsonStr
(
build
));
HttpResponse
response
=
request
.
execute
();
if
(
response
.
getStatus
()!=
200
){
log
.
error
(
"接口请求失败 => {}"
,
request
);
}
String
body
=
response
.
body
();
JSONObject
obj
=
JSONUtil
.
parseObj
(
body
);
Integer
code
=
obj
.
getInt
(
"code"
);
if
(
code
==
null
||
code
!=
1
){
log
.
warn
(
"上报错误 => {}"
,
body
);
}
reportCommon
(
request
,
"fdx02"
);
}
if
(!
fdx02Page
.
hasNext
())
{
if
(!
fdx02Page
.
hasNext
())
{
break
;
}
page
++;
...
...
@@ -515,27 +492,28 @@ public class DisabledService {
public
void
fdx01
()
{
int
page
=
1
;
int
size
=
10000
;
while
(
true
){
Page
<
Fdx01
>
fdx01Page
=
fdx01Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
null
);
int
size
=
5000
;
while
(
true
)
{
LambdaQueryWrapper
<
Fdx01
>
lambdaQuery
=
Wrappers
.
lambdaQuery
(
Fdx01
.
class
).
orderByAsc
(
Fdx01:
:
getId
);
Page
<
Fdx01
>
fdx01Page
=
fdx01Dao
.
selectPage
(
new
Page
<>(
page
,
size
),
lambdaQuery
);
List
<
Fdx01
>
records
=
fdx01Page
.
getRecords
();
for
(
Fdx01
fdx01
:
records
)
{
Fdx01Vo
build
=
Fdx01Vo
.
builder
()
.
axcp0002
(
fdx01
.
getAxcp0002
())
.
axcp0006
(
fdx01
.
getAxcp0006
())
.
afdx0823
(
fdx01
.
getAfdx0823
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0823
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0823
(
fdx01
.
getAfdx0823
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0823
(),
DatePattern
.
NORM_DATE_PATTERN
)
:
""
)
.
axcp0008
(
fdx01
.
getAxcp0008
())
.
axcp0005
(
fdx01
.
getAxcp0005
())
.
afdp0505
(
fdx01
.
getAfdp0505
())
.
afdx0831
(
fdx01
.
getAfdx0831
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0831
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0831
(
fdx01
.
getAfdx0831
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0831
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0852
(
fdx01
.
getAfdx0852
())
.
afdp0504
(
fdx01
.
getAfdp0504
())
.
afdp0503
(
fdx01
.
getAfdp0503
())
.
afdx0053
(
fdx01
.
getAfdx0053
())
.
axcp0014
(
fdx01
.
getAxcp0014
())
.
afdx0055
(
fdx01
.
getAfdx0055
()
!=
null
?
BigDecimal
.
valueOf
(
fdx01
.
getAfdx0055
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
afdx0851
(
fdx01
.
getAfdx0851
()
!=
null
?
BigDecimal
.
valueOf
(
fdx01
.
getAfdx0851
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
():
""
)
.
afdx0561
(
fdx01
.
getAfdx0561
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0561
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0055
(
fdx01
.
getAfdx0055
()
!=
null
?
BigDecimal
.
valueOf
(
fdx01
.
getAfdx0055
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
afdx0851
(
fdx01
.
getAfdx0851
()
!=
null
?
BigDecimal
.
valueOf
(
fdx01
.
getAfdx0851
()).
setScale
(
2
,
RoundingMode
.
HALF_UP
).
toString
()
:
""
)
.
afdx0561
(
fdx01
.
getAfdx0561
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0561
(),
DatePattern
.
NORM_MONTH_PATTERN
)
:
""
)
.
afdx0829
(
fdx01
.
getAfdx0829
())
.
afdx0830
(
fdx01
.
getAfdx0830
())
.
afdx0820
(
fdx01
.
getAfdx0820
())
...
...
@@ -560,44 +538,34 @@ public class DisabledService {
.
afdx1017
(
fdx01
.
getAfdx1017
())
.
afdx0574
(
fdx01
.
getAfdx0574
())
.
afdx0572
(
fdx01
.
getAfdx0572
())
.
afdx0868
(
fdx01
.
getAfdx0868
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0868
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0869
(
fdx01
.
getAfdx0869
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0869
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0870
(
fdx01
.
getAfdx0870
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0870
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0817
(
fdx01
.
getAfdx0817
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0817
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
afdx0818
(
fdx01
.
getAfdx0818
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0818
(),
DatePattern
.
NORM_MONTH_PATTERN
):
""
)
.
serial
Numner
(
fdx01
.
getSerialNumn
er
())
.
data
Status
(
fdx01
.
getDataS
tatus
())
.
data
Time
(
fdx01
.
getDataTime
()
)
.
area
Code
(
fdx01
.
getAreaC
ode
())
.
afdx0868
(
fdx01
.
getAfdx0868
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0868
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0869
(
fdx01
.
getAfdx0869
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0869
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0870
(
fdx01
.
getAfdx0870
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0870
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0817
(
fdx01
.
getAfdx0817
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0817
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
afdx0818
(
fdx01
.
getAfdx0818
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getAfdx0818
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
serial
number
(
fdx01
.
getSerialnumb
er
())
.
data
status
(
fdx01
.
getDatas
tatus
())
.
data
time
(
fdx01
.
getDatatime
()
!=
null
?
DateUtil
.
format
(
fdx01
.
getDatatime
(),
DatePattern
.
NORM_DATETIME_PATTERN
)
:
""
)
.
area
code
(
fdx01
.
getAreac
ode
())
.
build
();
HttpRequest
request
=
HttpRequest
.
post
(
"https://59.255.186.1/yhbcp-engine_gov/rest/cjrfl_report_zcryxx"
)
HttpRequest
request
=
HttpRequest
.
post
(
"https://zwxt.mca.gov.cn/yhbcp-engine_gov/rest/cjrfl_report_zcryxx"
)
.
contentType
(
"application/x-www-form-urlencoded"
)
.
form
(
"access_key"
,
"mzb_gx_450000"
)
.
form
(
"format"
,
"json"
)
.
form
(
"request_id"
,
IdUtil
.
simpleUUID
())
.
form
(
"sign"
,
""
)
.
form
(
"timestamp"
,
System
.
currentTimeMillis
())
.
form
(
"version"
,
"1.0"
)
.
form
(
"biz_content"
,
JSONUtil
.
toJsonStr
(
build
));
HttpResponse
response
=
request
.
execute
();
if
(
response
.
getStatus
()!=
200
){
log
.
error
(
"接口请求失败 => {}"
,
request
);
}
String
body
=
response
.
body
();
JSONObject
obj
=
JSONUtil
.
parseObj
(
body
);
Integer
code
=
obj
.
getInt
(
"code"
);
if
(
code
==
null
||
code
!=
1
){
log
.
warn
(
"上报错误 => {}"
,
body
);
}
reportCommon
(
request
,
"fdx01"
);
}
if
(!
fdx01Page
.
hasNext
())
{
if
(!
fdx01Page
.
hasNext
())
{
break
;
}
page
++;
}
}
}
}
sync-server/src/main/java/com/zq/sync/task/ReportTask.java
View file @
ce1dad44
...
...
@@ -8,7 +8,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
//
@Component
@RequiredArgsConstructor
public
class
ReportTask
{
...
...
sync-server/src/main/java/com/zq/sync/vo/Fdx01Vo.java
View file @
ce1dad44
...
...
@@ -283,23 +283,23 @@ public class Fdx01Vo {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
dataT
ime
;
private
String
datat
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
sync-server/src/main/java/com/zq/sync/vo/Fdx02Vo.java
View file @
ce1dad44
...
...
@@ -284,23 +284,23 @@ public class Fdx02Vo {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
dataT
ime
;
private
String
datat
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
sync-server/src/main/java/com/zq/sync/vo/Fdx03Vo.java
View file @
ce1dad44
...
...
@@ -122,23 +122,23 @@ public class Fdx03Vo {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
dataT
ime
;
private
String
datat
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
sync-server/src/main/java/com/zq/sync/vo/Fdx04Vo.java
View file @
ce1dad44
...
...
@@ -145,23 +145,23 @@ public class Fdx04Vo {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
dataT
ime
;
private
String
datat
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
sync-server/src/main/java/com/zq/sync/vo/Fdx05Vo.java
View file @
ce1dad44
...
...
@@ -147,23 +147,23 @@ public class Fdx05Vo {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
dataT
ime
;
private
String
datat
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
sync-server/src/main/java/com/zq/sync/vo/Fdx06Vo.java
View file @
ce1dad44
...
...
@@ -54,7 +54,7 @@ public class Fdx06Vo {
* 发证时间
*/
@ApiModelProperty
(
"发证时间"
)
private
Date
afdx0831
;
private
String
afdx0831
;
/**
* 档案编号
...
...
@@ -288,23 +288,23 @@ public class Fdx06Vo {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
dataT
ime
;
private
String
datat
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
sync-server/src/main/java/com/zq/sync/vo/Fdx07Vo.java
View file @
ce1dad44
...
...
@@ -171,23 +171,23 @@ public class Fdx07Vo {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
dataT
ime
;
private
String
datat
ime
;
/**
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
sync-server/src/main/java/com/zq/sync/vo/Fdx88Vo.java
View file @
ce1dad44
...
...
@@ -121,23 +121,23 @@ public class Fdx88Vo {
* 数据唯一流水号
*/
@ApiModelProperty
(
"数据唯一流水号"
)
private
String
serial
Numn
er
;
private
String
serial
numb
er
;
/**
* 数据状态
*/
@ApiModelProperty
(
"数据状态"
)
private
String
data
S
tatus
;
private
String
data
s
tatus
;
/**
* 数据上报时间
*/
@ApiModelProperty
(
"数据上报时间"
)
private
Date
dataT
ime
;
private
String
datat
ime
;
/**
/**
s
* 区划代码
*/
@ApiModelProperty
(
"区划代码"
)
private
String
area
C
ode
;
private
String
area
c
ode
;
}
sync-server/src/main/resources/application.yml
View file @
ce1dad44
...
...
@@ -14,7 +14,7 @@ spring:
url-pattern
:
/druid/*
reset-enable
:
false
dynamic
:
# mybatis plus多数据源插件
primary
:
master
#设置默认的数据源或者数据源组,默认值即为master
primary
:
gxcj
#设置默认的数据源或者数据源组,默认值即为master
strict
:
true
#严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
datasource
:
gxcj
:
...
...
@@ -53,5 +53,5 @@ spring:
mybatis-plus
:
global-config
:
db-config
:
select
-strategy
:
not_empty
where
-strategy
:
not_empty
update-strategy
:
not_empty
\ No newline at end of file
sys-server/src/main/java/com/zq/system/config/security/TokenFilter.java
View file @
ce1dad44
...
...
@@ -66,7 +66,7 @@ public class TokenFilter extends GenericFilterBean {
public
void
doFilter
(
ServletRequest
servletRequest
,
ServletResponse
servletResponse
,
FilterChain
filterChain
)
throws
IOException
,
ServletException
{
HttpServletRequest
httpServletRequest
=
(
HttpServletRequest
)
servletRequest
;
String
token
=
resolve
Token
(
httpServletRequest
);
String
token
=
tokenProvider
.
get
Token
(
httpServletRequest
);
// 对于 Token 为空的不需要去查 Redis
if
(
StrUtil
.
isNotBlank
(
token
))
{
OnlineUserDto
onlineUserDto
=
null
;
...
...
@@ -94,23 +94,4 @@ public class TokenFilter extends GenericFilterBean {
filterChain
.
doFilter
(
servletRequest
,
servletResponse
);
}
/**
* 初步检测Token
*
* @param request /
* @return /
*/
private
String
resolveToken
(
HttpServletRequest
request
)
{
String
bearerToken
=
request
.
getHeader
(
properties
.
getHeader
());
if
(
StringUtils
.
isBlank
(
bearerToken
))
{
return
null
;
}
if
(
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
// 去掉令牌前缀
return
bearerToken
.
replace
(
properties
.
getTokenStartWith
(),
""
);
}
else
{
log
.
debug
(
"非法Token:{}"
,
bearerToken
);
}
return
null
;
}
}
sys-server/src/main/java/com/zq/system/config/security/TokenProvider.java
View file @
ce1dad44
...
...
@@ -27,6 +27,7 @@ import io.jsonwebtoken.Jwts;
import
io.jsonwebtoken.SignatureAlgorithm
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
...
...
@@ -34,7 +35,6 @@ import org.springframework.security.core.GrantedAuthority;
import
org.springframework.security.core.authority.SimpleGrantedAuthority
;
import
org.springframework.security.core.userdetails.User
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -132,9 +132,14 @@ public class TokenProvider implements InitializingBean {
public
String
getToken
(
HttpServletRequest
request
)
{
String
bearerToken
=
request
.
getHeader
(
properties
.
getHeader
());
if
(
StringUtils
.
hasText
(
bearerToken
)
&&
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
if
(
StringUtils
.
isBlank
(
bearerToken
))
{
return
null
;
}
if
(
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
// 去掉令牌前缀
return
bearerToken
.
replace
(
properties
.
getTokenStartWith
(),
""
);
}
else
{
log
.
debug
(
"非法Token:{}"
,
bearerToken
);
}
return
null
;
}
...
...
user-server/src/main/java/com/zq/user/config/TokenFilter.java
View file @
ce1dad44
...
...
@@ -62,7 +62,7 @@ public class TokenFilter extends GenericFilterBean {
public
void
doFilter
(
ServletRequest
servletRequest
,
ServletResponse
servletResponse
,
FilterChain
filterChain
)
throws
IOException
,
ServletException
{
HttpServletRequest
httpServletRequest
=
(
HttpServletRequest
)
servletRequest
;
String
token
=
resolve
Token
(
httpServletRequest
);
String
token
=
tokenProvider
.
get
Token
(
httpServletRequest
);
// 对于 Token 为空的不需要去查 Redis
if
(
StrUtil
.
isNotBlank
(
token
))
{
OnlineUserDto
onlineUserDto
=
null
;
...
...
@@ -90,23 +90,4 @@ public class TokenFilter extends GenericFilterBean {
filterChain
.
doFilter
(
servletRequest
,
servletResponse
);
}
/**
* 初步检测Token
*
* @param request /
* @return /
*/
private
String
resolveToken
(
HttpServletRequest
request
)
{
String
bearerToken
=
request
.
getHeader
(
properties
.
getHeader
());
if
(
StringUtils
.
isBlank
(
bearerToken
))
{
return
null
;
}
if
(
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
// 去掉令牌前缀
return
bearerToken
.
replace
(
properties
.
getTokenStartWith
(),
""
);
}
else
{
log
.
debug
(
"非法Token:{}"
,
bearerToken
);
}
return
null
;
}
}
user-server/src/main/java/com/zq/user/config/TokenProvider.java
View file @
ce1dad44
...
...
@@ -25,6 +25,7 @@ import io.jsonwebtoken.Jwts;
import
io.jsonwebtoken.SignatureAlgorithm
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
...
...
@@ -32,7 +33,6 @@ import org.springframework.security.core.GrantedAuthority;
import
org.springframework.security.core.authority.SimpleGrantedAuthority
;
import
org.springframework.security.core.userdetails.User
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
javax.crypto.spec.SecretKeySpec
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -89,10 +89,7 @@ public class TokenProvider implements InitializingBean {
}
public
Authentication
getAuthentication
(
String
token
)
{
Claims
claims
=
Jwts
.
parser
()
.
setSigningKey
(
DatatypeConverter
.
parseBase64Binary
(
properties
.
getBase64Secret
()))
.
parseClaimsJws
(
token
)
.
getBody
();
Claims
claims
=
getClaims
(
token
);
// fix bug: 当前用户如果没有任何权限时,在输入用户名后,刷新验证码会抛IllegalArgumentException
Object
authoritiesStr
=
claims
.
get
(
AUTHORITIES_KEY
);
...
...
@@ -125,9 +122,14 @@ public class TokenProvider implements InitializingBean {
public
String
getToken
(
HttpServletRequest
request
)
{
String
bearerToken
=
request
.
getHeader
(
properties
.
getHeader
());
if
(
StringUtils
.
hasText
(
bearerToken
)
&&
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
if
(
StringUtils
.
isBlank
(
bearerToken
))
{
return
null
;
}
if
(
bearerToken
.
startsWith
(
properties
.
getTokenStartWith
()))
{
// 去掉令牌前缀
return
bearerToken
.
replace
(
properties
.
getTokenStartWith
(),
""
);
}
else
{
log
.
debug
(
"非法Token:{}"
,
bearerToken
);
}
return
null
;
}
...
...
user-server/src/main/resources/application.yml
View file @
ce1dad44
...
...
@@ -63,5 +63,5 @@ spring:
mybatis-plus
:
global-config
:
db-config
:
select
-strategy
:
not_empty
where
-strategy
:
not_empty
update-strategy
:
not_empty
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