Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzxt-app-report
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
xzxt-app-report
Commits
2c0f847b
Commit
2c0f847b
authored
Apr 01, 2022
by
wang_jiaxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
背景核查加入手机号查询,上传新版本时保存文件名称
parent
a7412503
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
668 additions
and
18 deletions
+668
-18
src/main/java/org/springblade/founder/bbgx/entity/AppBbgx.java
+1
-0
src/main/java/org/springblade/founder/bbgx/service/impl/AppBbgxServiceImpl.java
+1
-0
src/main/java/org/springblade/founder/log/EventLogAspect.java
+6
-8
src/main/java/org/springblade/founder/log/dao/LogDao.xml
+70
-0
src/main/java/org/springblade/founder/log/entity/SysGnsyrz.java
+140
-8
src/main/java/org/springblade/founder/log/service/LogMysqlService.java
+7
-0
src/main/java/org/springblade/founder/log/service/impl/LogMysqlServiceImpl.java
+25
-0
src/main/java/org/springblade/founder/utils/HttpUtils.java
+182
-0
src/main/java/org/springblade/founder/utils/JzInterfaceUtils.java
+156
-0
src/main/java/org/springblade/founder/ydjwhc/entity/Jzxx.java
+78
-0
src/main/java/org/springblade/founder/ydjwhc/entity/TbStAppRxhcrw.java
+1
-0
src/main/java/org/springblade/founder/ydjwhc/service/impl/BjHcServiceImpl.java
+0
-0
src/main/java/org/springblade/founder/ydjwhc/service/impl/TbStAppRxhcrwServiceImpl.java
+1
-2
No files found.
src/main/java/org/springblade/founder/bbgx/entity/AppBbgx.java
View file @
2c0f847b
...
@@ -16,4 +16,5 @@ public class AppBbgx {
...
@@ -16,4 +16,5 @@ public class AppBbgx {
private
String
appGxwjwz
;
//更新文件
private
String
appGxwjwz
;
//更新文件
private
Date
rksj
;
//入库时间
private
Date
rksj
;
//入库时间
private
String
xxscPdbz
;
//删除标志
private
String
xxscPdbz
;
//删除标志
private
String
filename
;
//文件名称
}
}
src/main/java/org/springblade/founder/bbgx/service/impl/AppBbgxServiceImpl.java
View file @
2c0f847b
...
@@ -84,6 +84,7 @@ public class AppBbgxServiceImpl extends ServiceImpl<AppBbgxMapper, AppBbgx> impl
...
@@ -84,6 +84,7 @@ public class AppBbgxServiceImpl extends ServiceImpl<AppBbgxMapper, AppBbgx> impl
bbgx
.
setAppVersion
(
version
);
bbgx
.
setAppVersion
(
version
);
bbgx
.
setAppGxbz
(
gxbz
);
bbgx
.
setAppGxbz
(
gxbz
);
String
fileName
=
file
.
getOriginalFilename
();
String
fileName
=
file
.
getOriginalFilename
();
bbgx
.
setFilename
(
fileName
);
File
file1
=
new
File
(
bbgxfjPath
+
File
.
separator
);
File
file1
=
new
File
(
bbgxfjPath
+
File
.
separator
);
if
(!
file1
.
exists
())
{
if
(!
file1
.
exists
())
{
if
(!
file1
.
mkdir
())
{
if
(!
file1
.
mkdir
())
{
...
...
src/main/java/org/springblade/founder/log/EventLogAspect.java
View file @
2c0f847b
package
org
.
springblade
.
founder
.
log
;
package
org
.
springblade
.
founder
.
log
;
import
com.alibaba.druid.sql.visitor.functions.Char
;
import
com.alibaba.druid.sql.visitor.functions.Char
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.JoinPoint
;
...
@@ -10,8 +9,8 @@ import org.aspectj.lang.annotation.Aspect;
...
@@ -10,8 +9,8 @@ import org.aspectj.lang.annotation.Aspect;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.aspectj.lang.annotation.Pointcut
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.aspectj.lang.reflect.MethodSignature
;
import
org.springblade.core.secure.utils.SecureUtil
;
import
org.springblade.core.secure.utils.SecureUtil
;
import
org.springblade.founder.log.dao.LogDao
;
import
org.springblade.founder.log.entity.SysGnsyrz
;
import
org.springblade.founder.log.entity.SysGnsyrz
;
import
org.springblade.founder.log.service.LogMysqlService
;
import
org.springblade.modules.system.entity.XzxtUser
;
import
org.springblade.modules.system.entity.XzxtUser
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -33,14 +32,13 @@ import java.util.UUID;
...
@@ -33,14 +32,13 @@ import java.util.UUID;
@Aspect
@Aspect
@Component
@Component
@Slf4j
@Slf4j
@DS
(
"db1"
)
public
class
EventLogAspect
{
public
class
EventLogAspect
{
@Value
(
"${gnsyrzFlag}"
)
@Value
(
"${gnsyrzFlag}"
)
private
String
gnsyrzFlag
;
private
String
gnsyrzFlag
;
@Autowired
@Autowired
private
Log
Dao
logDao
;
private
Log
MysqlService
logMysqlService
;
@Pointcut
(
" (execution(* org.springblade.founder.*.controller.*.*(..)))"
)
@Pointcut
(
" (execution(* org.springblade.founder.*.controller.*.*(..)))"
)
public
void
excudeService
()
{
public
void
excudeService
()
{
...
@@ -187,7 +185,7 @@ public class EventLogAspect {
...
@@ -187,7 +185,7 @@ public class EventLogAspect {
sysGnsyrz
.
setYymcJyqk
(
yymcJyqk
);
sysGnsyrz
.
setYymcJyqk
(
yymcJyqk
);
sysGnsyrz
.
setYhGmsfhm
(
user
.
getIdentitycard
());
sysGnsyrz
.
setYhGmsfhm
(
user
.
getIdentitycard
());
// 1.6新增字段
// 1.6新增字段
sysGnsyrz
.
setYhXm
(
user
.
get
UserN
ame
());
sysGnsyrz
.
setYhXm
(
user
.
get
Realn
ame
());
sysGnsyrz
.
setYymcdm
(
""
);
sysGnsyrz
.
setYymcdm
(
""
);
sysGnsyrz
.
setYwbhlxdm
(
""
);
sysGnsyrz
.
setYwbhlxdm
(
""
);
sysGnsyrz
.
setYwbh
(
""
);
sysGnsyrz
.
setYwbh
(
""
);
...
@@ -204,16 +202,16 @@ public class EventLogAspect {
...
@@ -204,16 +202,16 @@ public class EventLogAspect {
sysGnsyrz
.
setXxscPdbz
(
"0"
);
sysGnsyrz
.
setXxscPdbz
(
"0"
);
sysGnsyrz
.
setXxdjdwGajgjgdm
(
user
.
getUnitcode
());
sysGnsyrz
.
setXxdjdwGajgjgdm
(
user
.
getUnitcode
());
sysGnsyrz
.
setXxdjdwGajgmc
(
user
.
getUnitname
());
sysGnsyrz
.
setXxdjdwGajgmc
(
user
.
getUnitname
());
sysGnsyrz
.
setXxdjryXm
(
user
.
get
UserN
ame
());
sysGnsyrz
.
setXxdjryXm
(
user
.
get
Realn
ame
());
sysGnsyrz
.
setXxdjryGmsfhm
(
user
.
getIdentitycard
());
sysGnsyrz
.
setXxdjryGmsfhm
(
user
.
getIdentitycard
());
sysGnsyrz
.
setXxdjryLxdh
(
user
.
getPhone
());
sysGnsyrz
.
setXxdjryLxdh
(
user
.
getPhone
());
sysGnsyrz
.
setXxczdwGajgjgdm
(
user
.
getUnitcode
());
sysGnsyrz
.
setXxczdwGajgjgdm
(
user
.
getUnitcode
());
sysGnsyrz
.
setXxczdwGajgmc
(
user
.
getUnitname
());
sysGnsyrz
.
setXxczdwGajgmc
(
user
.
getUnitname
());
sysGnsyrz
.
setXxczryXm
(
user
.
get
UserN
ame
());
sysGnsyrz
.
setXxczryXm
(
user
.
get
Realn
ame
());
sysGnsyrz
.
setXxczryGmsfhm
(
user
.
getIdentitycard
());
sysGnsyrz
.
setXxczryGmsfhm
(
user
.
getIdentitycard
());
sysGnsyrz
.
setXxlyms
(
"系统功能日志"
);
sysGnsyrz
.
setXxlyms
(
"系统功能日志"
);
try
{
try
{
log
Dao
.
addGnsyrz
(
sysGnsyrz
);
log
MysqlService
.
addGnsyrz
(
sysGnsyrz
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"记录录入功能日志发生异常"
+
e
.
getMessage
());
log
.
error
(
"记录录入功能日志发生异常"
+
e
.
getMessage
());
}
}
...
...
src/main/java/org/springblade/founder/log/dao/LogDao.xml
0 → 100644
View file @
2c0f847b
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"org.springblade.founder.log.dao.LogDao"
>
<insert
id=
"addGnsyrz"
>
INSERT INTO sys_gnsyrz (
rzlsh
,fwsj
,yymc_jyqk
,yh_gmsfhm
,yh_ip
,yhdw_gajgjgdm
,yhdw_gajgmc
,czlxdm
,czxx_jyqk
,czxx_param
,xxsc_pdbz
,xxdjdw_gajgjgdm
,xxdjdw_gajgmc
,xxdjry_xm
,xxdjry_gmsfhm
,xxdjry_lxdh
,djsj
,xxczdw_gajgjgdm
,xxczdw_gajgmc
,xxczry_xm
,xxczry_gmsfhm
,gxsj
,xxlyms
,yymcdm
,ywbhlxdm
,ywbh
,yh_xm
,cxnrlbdm
,cxnrbh
,cxxxjg
)
VALUES(
#{ rzlsh , jdbcType=VARCHAR }
,now()
,#{ yymcJyqk , jdbcType=VARCHAR }
,#{ yhGmsfhm , jdbcType=VARCHAR }
,#{ yhIp , jdbcType=VARCHAR }
,#{ yhdwGajgjgdm , jdbcType=VARCHAR }
,#{ yhdwGajgmc , jdbcType=VARCHAR }
,#{ czlxdm , jdbcType=VARCHAR }
,#{ czxxJyqk , jdbcType=VARCHAR }
,#{ czxxParam , jdbcType=VARCHAR }
,#{ xxscPdbz , jdbcType=VARCHAR }
,#{ xxdjdwGajgjgdm , jdbcType=VARCHAR }
,#{ xxdjdwGajgmc , jdbcType=VARCHAR }
,#{ xxdjryXm , jdbcType=VARCHAR }
,#{ xxdjryGmsfhm , jdbcType=VARCHAR }
,#{ xxdjryLxdh , jdbcType=VARCHAR }
,now()
,#{ xxczdwGajgjgdm , jdbcType=VARCHAR }
,#{ xxczdwGajgmc , jdbcType=VARCHAR }
,#{ xxczryXm , jdbcType=VARCHAR }
,#{ xxczryGmsfhm , jdbcType=VARCHAR }
,now()
,#{ xxlyms , jdbcType=VARCHAR }
,#{ yymcdm , jdbcType=VARCHAR }
,#{ ywbhlxdm , jdbcType=VARCHAR }
,#{ ywbh , jdbcType=VARCHAR }
,#{ yhXm , jdbcType=VARCHAR }
,#{ cxnrlbdm , jdbcType=VARCHAR }
,#{ cxnrbh , jdbcType=VARCHAR }
,#{ cxxxjg , jdbcType=VARCHAR }
)
</insert>
</mapper>
src/main/java/org/springblade/founder/log/entity/SysGnsyrz.java
View file @
2c0f847b
package
org
.
springblade
.
founder
.
log
.
entity
;
package
org
.
springblade
.
founder
.
log
.
entity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
import
org.springblade.founder.entity.BaseModel
;
import
org.springblade.founder.entity.BaseModel
;
import
org.springblade.modules.system.entity.XzxtUser
;
/**
/**
* 功能使用日志
* 功能使用日志
...
@@ -11,9 +14,9 @@ import org.springblade.founder.entity.BaseModel;
...
@@ -11,9 +14,9 @@ import org.springblade.founder.entity.BaseModel;
* @date 2020/12/28 17:20
* @date 2020/12/28 17:20
*
*
*/
*/
@
Getter
@
Data
@
Setter
@
ApiModel
(
value
=
"SysGnsyrz"
,
description
=
"功能使用日志"
)
public
class
SysGnsyrz
extends
BaseModel
{
public
class
SysGnsyrz
{
//日志流水号
//日志流水号
@ApiModelProperty
(
value
=
"日志流水号"
)
@ApiModelProperty
(
value
=
"日志流水号"
)
private
String
rzlsh
;
private
String
rzlsh
;
...
@@ -80,9 +83,138 @@ public class SysGnsyrz extends BaseModel {
...
@@ -80,9 +83,138 @@ public class SysGnsyrz extends BaseModel {
@ApiModelProperty
(
value
=
"操作(查询)信息结果"
)
@ApiModelProperty
(
value
=
"操作(查询)信息结果"
)
private
String
cxxxjg
;
private
String
cxxxjg
;
/**
* 登记时间
*/
@ApiModelProperty
(
value
=
"登记时间"
)
private
String
djsj
;
/**
* 更新时间
*/
@ApiModelProperty
(
value
=
"更新时间"
)
private
String
gxsj
;
/**
* 信息删除_判断标识/1-是,0-否/CODE_IF
*/
@ApiModelProperty
(
value
=
"信息删除_判断标识"
)
private
String
xxscPdbz
;
/**
* 信息登记单位_公安机关机构代码/采用GA 380《全国公安机关机构代码编码规则》统一编制的代码/CODE_GXS
*/
@ApiModelProperty
(
value
=
"信息登记单位_公安机关机构代码"
)
private
String
xxdjdwGajgjgdm
;
/**
* 信息登记单位_公安机关名称
*/
@ApiModelProperty
(
value
=
"信息登记单位_公安机关名称"
)
private
String
xxdjdwGajgmc
;
/**
* 信息登记人员_公民身份号码/符合GB 11643《公民身份号码》
*/
@ApiModelProperty
(
value
=
"信息登记人员_公民身份号码"
)
private
String
xxdjryGmsfhm
;
/**
* 信息登记人员_联系电话
*/
@ApiModelProperty
(
value
=
"信息登记人员_联系电话"
)
private
String
xxdjryLxdh
;
/**
* 信息登记人员_姓名
*/
@ApiModelProperty
(
value
=
"信息登记人员_姓名"
)
private
String
xxdjryXm
;
/**
* 信息操作单位_公安机关机构代码/采用GA 380《全国公安机关机构代码编码规则》统一编制的代码/CODE_GXS
*/
@ApiModelProperty
(
value
=
"信息操作单位_公安机关机构代码"
)
private
String
xxczdwGajgjgdm
;
/**
* 信息操作单位_公安机关名称
*/
@ApiModelProperty
(
value
=
"信息操作单位_公安机关名称"
)
private
String
xxczdwGajgmc
;
/**
* 信息操作人员_公民身份号码/符合GB 11643《公民身份号码》
*/
@ApiModelProperty
(
value
=
"信息操作人员_公民身份号码"
)
private
String
xxczryGmsfhm
;
/**
* 信息操作人员_联系电话
*/
@ApiModelProperty
(
value
=
"信息操作人员_联系电话"
)
private
String
xxczryLxdh
;
/**
* 信息操作人员_姓名
*/
@ApiModelProperty
(
value
=
"信息操作人员_姓名"
)
private
String
xxczryXm
;
/**
* 信息入部库时间
*/
@ApiModelProperty
(
value
=
"信息入部库时间"
)
private
String
xxrbksj
;
/**
* 信息入省库时间
*/
@ApiModelProperty
(
value
=
"信息入省库时间"
)
private
String
xxrsksj
;
/**
* 信息来源描述
*/
@ApiModelProperty
(
value
=
"信息来源描述"
)
private
String
xxlyms
;
/**
* 信息入部库_判断标识/1-是,0-否/CODE_IF
*/
@ApiModelProperty
(
value
=
"信息入部库_判断标识"
)
private
String
xxrbkPdbz
;
/**
* 信息入省库_判断标识/1-是,0-否/CODE_IF
*/
@ApiModelProperty
(
value
=
"信息入省库_判断标识"
)
private
String
xxrskPdbz
;
@ApiModelProperty
(
value
=
"第几页"
)
private
int
page
;
@ApiModelProperty
(
value
=
"每页行数"
)
private
int
rows
;
private
int
limit
;
@ApiModelProperty
(
value
=
"开始行"
)
private
int
begin
;
@ApiModelProperty
(
value
=
"结束行"
)
private
int
end
;
//登录人员
public
void
setDjUser
(
XzxtUser
user
){
this
.
xxdjryXm
=
user
.
getRealname
();
this
.
xxdjdwGajgjgdm
=
user
.
getUnitcode
();
this
.
xxdjdwGajgmc
=
user
.
getUnitname
();
this
.
xxdjryGmsfhm
=
user
.
getIdentitycard
();
this
.
xxdjryLxdh
=
user
.
getPhone
();
this
.
xxczryXm
=
user
.
getRealname
();
this
.
xxczdwGajgjgdm
=
user
.
getUnitcode
();
this
.
xxczdwGajgmc
=
user
.
getUnitname
();
this
.
xxczryGmsfhm
=
user
.
getIdentitycard
();
this
.
xxczryLxdh
=
user
.
getPhone
();
}
// 更新人员
public
void
setUpUser
(
XzxtUser
user
){
this
.
xxczryXm
=
user
.
getRealname
();
this
.
xxczdwGajgjgdm
=
user
.
getUnitcode
();
this
.
xxczdwGajgmc
=
user
.
getUnitname
();
this
.
xxczryGmsfhm
=
user
.
getIdentitycard
();
this
.
xxczryLxdh
=
user
.
getPhone
();
}
}
}
src/main/java/org/springblade/founder/log/service/LogMysqlService.java
0 → 100644
View file @
2c0f847b
package
org
.
springblade
.
founder
.
log
.
service
;
import
org.springblade.founder.log.entity.SysGnsyrz
;
public
interface
LogMysqlService
{
public
void
addGnsyrz
(
SysGnsyrz
sysGnsyrz
);
}
src/main/java/org/springblade/founder/log/service/impl/LogMysqlServiceImpl.java
0 → 100644
View file @
2c0f847b
package
org
.
springblade
.
founder
.
log
.
service
.
impl
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springblade.founder.log.dao.LogDao
;
import
org.springblade.founder.log.entity.SysGnsyrz
;
import
org.springblade.founder.log.service.LogMysqlService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Slf4j
@Service
@DS
(
"db1"
)
public
class
LogMysqlServiceImpl
implements
LogMysqlService
{
@Autowired
private
LogDao
logDao
;
public
void
addGnsyrz
(
SysGnsyrz
sysGnsyrz
){
try
{
logDao
.
addGnsyrz
(
sysGnsyrz
);
}
catch
(
Exception
e
)
{
log
.
error
(
"记录录入功能日志发生异常"
+
e
.
getMessage
());
}
}
}
src/main/java/org/springblade/founder/utils/HttpUtils.java
0 → 100644
View file @
2c0f847b
package
org
.
springblade
.
founder
.
utils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpStatus
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.StringEntity
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.impl.conn.PoolingHttpClientConnectionManager
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
java.io.IOException
;
import
java.util.Map
;
@Slf4j
public
class
HttpUtils
{
private
static
RequestConfig
requestConfig
=
null
;
private
static
String
tokenPath
=
""
;
static
{
// 设置请求和传输超时时间
//setConnectTimeout:设置连接超时时间,单位毫秒。
//setSocketTimeout:请求获取数据的超时时间,单位毫秒。 如果访问一个接口,多少时间内无法返回数据,就直接放弃此次调用。
//setConnectionRequestTimeout:设置从connect Manager获取Connection 超时时间,单位毫秒
requestConfig
=
RequestConfig
.
custom
().
setSocketTimeout
(
120000
).
setConnectTimeout
(
120000
).
build
();
}
/**
* 静态属性注册配置文件中的值
* @param tokenPath
*/
@Value
(
"${tokenPath}"
)
void
setTokenPath
(
String
tokenPath
){
HttpUtils
.
tokenPath
=
tokenPath
;
}
private
static
PoolingHttpClientConnectionManager
cm
=
new
PoolingHttpClientConnectionManager
();
public
static
String
ytkdUrl
;
@Value
(
"${ytkdUrl}"
)
public
void
setYtkdUrl
(
String
ytkdUrl
)
{
HttpUtils
.
ytkdUrl
=
ytkdUrl
;
}
public
static
String
doGet
(
String
url
)
{
// 不是每次创建新的HttpClient对象,而是从连接池中获取HttpClient对象
CloseableHttpClient
httpClient
=
HttpClients
.
custom
()
.
setConnectionManager
(
cm
).
build
();
HttpGet
httpget
=
new
HttpGet
(
url
);
String
entityStr
=
""
;
CloseableHttpResponse
response
=
null
;
try
{
response
=
httpClient
.
execute
(
httpget
);
HttpEntity
entity
=
response
.
getEntity
();
if
(
entity
!=
null
)
{
entityStr
=
EntityUtils
.
toString
(
entity
,
"UTF-8"
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
response
!=
null
)
{
response
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
entityStr
;
}
public
static
String
doGetAddHeader
(
String
url
,
String
headerName
,
String
headerValue
)
{
// 不是每次创建新的HttpClient对象,而是从连接池中获取HttpClient对象
CloseableHttpClient
httpClient
=
HttpClients
.
custom
()
.
setConnectionManager
(
cm
).
build
();
HttpGet
httpget
=
new
HttpGet
(
url
);
String
entityStr
=
""
;
CloseableHttpResponse
response
=
null
;
try
{
httpget
.
setHeader
(
headerName
,
headerValue
);
response
=
httpClient
.
execute
(
httpget
);
HttpEntity
entity
=
response
.
getEntity
();
if
(
entity
!=
null
)
{
entityStr
=
EntityUtils
.
toString
(
entity
,
"UTF-8"
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
response
!=
null
)
{
response
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
entityStr
;
}
public
static
String
doPost
(
String
url
){
// 不是每次创建新的HttpClient对象,而是从连接池中获取HttpClient对象
CloseableHttpClient
httpClient
=
HttpClients
.
custom
()
.
setConnectionManager
(
cm
).
build
();
HttpPost
httpPost
=
new
HttpPost
(
url
);
String
entityStr
=
""
;
CloseableHttpResponse
response
=
null
;
try
{
response
=
httpClient
.
execute
(
httpPost
);
HttpEntity
entity
=
response
.
getEntity
();
if
(
entity
!=
null
)
{
entityStr
=
EntityUtils
.
toString
(
entity
,
"UTF-8"
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
response
!=
null
)
{
response
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
return
entityStr
;
}
/**
* 请求的参数类型为json
* @param url
* @param json
* @return {username:"",pass:""}
*/
public
static
String
doPostJson
(
String
url
,
Map
<
String
,
String
>
headers
,
String
json
)
{
// post请求返回结果
CloseableHttpClient
httpClient
=
HttpClients
.
custom
()
.
setConnectionManager
(
cm
).
build
();
String
jsonResult
=
null
;
HttpPost
httpPost
=
new
HttpPost
(
url
);
// 设置请求和传输超时时间
httpPost
.
setConfig
(
requestConfig
);
if
(
headers
!=
null
)
{
for
(
String
key
:
headers
.
keySet
())
{
httpPost
.
setHeader
(
key
,
headers
.
get
(
key
));
}
}
try
{
//设置参数解决中文乱码
if
(
null
!=
json
){
StringEntity
entity
=
new
StringEntity
(
json
,
"utf-8"
);
entity
.
setContentEncoding
(
"UTF-8"
);
entity
.
setContentType
(
"application/json"
);
httpPost
.
setEntity
(
entity
);
}
//发送请求
CloseableHttpResponse
result
=
httpClient
.
execute
(
httpPost
);
if
(
result
.
getStatusLine
().
getStatusCode
()
==
HttpStatus
.
SC_OK
){
// 读取服务器返回的json数据(然后解析)
jsonResult
=
EntityUtils
.
toString
(
result
.
getEntity
(),
"utf-8"
);
}
else
{
throw
new
Exception
();
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
finally
{
httpPost
.
releaseConnection
();
}
return
jsonResult
;
}
}
src/main/java/org/springblade/founder/utils/JzInterfaceUtils.java
0 → 100644
View file @
2c0f847b
package
org
.
springblade
.
founder
.
utils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.extern.log4j.Log4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.dom4j.Document
;
import
org.dom4j.DocumentException
;
import
org.dom4j.DocumentHelper
;
import
org.dom4j.Element
;
import
org.dom4j.io.SAXReader
;
import
org.springblade.founder.ydjwhc.entity.Jzxx
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.ArrayList
;
import
java.util.List
;
@Log4j
@Service
public
class
JzInterfaceUtils
{
private
static
String
jzUrl
;
@Value
(
"http://74.6.57.208:30030/S-460000000000-ZNB-22-00190"
)
private
void
setJzUrl
(
String
jzUrl
)
{
JzInterfaceUtils
.
jzUrl
=
jzUrl
;
}
private
static
final
String
userParam
=
"{'approveDeptName':'海南省公安厅','approveName':'刘建民','userName':'刘建民','userIDCard':'220103196204020613','approveId':'220103196204020613','12312':'123123'}"
;
private
static
final
String
caseInfoParam
=
"{'caseId':'A4602050300002021120026','caseName':'12.27组织卖淫案','remark':''}"
;
public
static
List
<
String
>
getPhoneNumsByZjhm
(
String
zjhm
)
throws
DocumentException
,
UnsupportedEncodingException
{
String
url
=
""
;
String
resultString
=
""
;
// 创建Http Get请求
String
searchParam
=
"{'sfzh':'"
+
zjhm
+
"','startTime':'','phonenum':'','endTime':''}"
;
String
param
=
"endUser="
+
URLEncoder
.
encode
(
userParam
,
"utf-8"
)
+
"&caseInfoBean="
+
URLEncoder
.
encode
(
caseInfoParam
,
"utf-8"
)
+
"&searchBean="
+
URLEncoder
.
encode
(
searchParam
,
"utf-8"
);
url
=
jzUrl
+
"?"
+
param
;
try
{
resultString
=
HttpUtils
.
doGetAddHeader
(
url
,
"apikey"
,
"AZNB46000000000000032"
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
1
);
e
.
printStackTrace
();
}
JSONObject
jsonObject
=
JSON
.
parseObject
(
resultString
);
String
xml
=
jsonObject
.
getString
(
"responseMsg"
);
List
<
String
>
phoneList
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
xml
)){
phoneList
=
getPhoneNums
(
xml
);
}
return
phoneList
;
}
public
static
List
<
Jzxx
>
getJzxxByPhoneNum
(
String
phoneNum
)
throws
DocumentException
,
UnsupportedEncodingException
{
//idCard-身份证号
//totalResults-返回数量
//openDate-开户日期
//userName-户主姓名
//address-地址(具体是什么地址呢)
String
url
=
""
;
String
resultString
=
""
;
// 创建Http Get请求
String
searchParam
=
"{'sfzh':'','startTime':'','phonenum':'"
+
phoneNum
+
"','endTime':''}"
;
String
param
=
"endUser="
+
URLEncoder
.
encode
(
userParam
,
"utf-8"
)
+
"&caseInfoBean="
+
URLEncoder
.
encode
(
caseInfoParam
,
"utf-8"
)
+
"&searchBean="
+
URLEncoder
.
encode
(
searchParam
,
"utf-8"
);
url
=
jzUrl
+
"?"
+
param
;
System
.
out
.
println
(
"转义后的url是"
+
url
);
try
{
System
.
out
.
println
(
"1"
);
resultString
=
HttpUtils
.
doGetAddHeader
(
url
,
"apikey"
,
"AZNB46000000000000032"
);
System
.
out
.
println
(
"resultString是"
+
resultString
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"2"
);
e
.
printStackTrace
();
}
JSONObject
jsonObject
=
JSON
.
parseObject
(
resultString
);
System
.
out
.
println
(
"jsonObject="
+
jsonObject
);
List
<
Jzxx
>
jzxx
=
new
ArrayList
<>();
if
(
jsonObject
!=
null
){
String
xml
=
jsonObject
.
getString
(
"responseMsg"
);
System
.
out
.
println
(
"xml="
+
xml
);
jzxx
=
getZjhm
(
xml
);
}
return
jzxx
;
}
//根据身份证号获取手机号列表
public
static
List
<
String
>
getPhoneNums
(
String
xml
)
throws
DocumentException
{
List
<
String
>
resList
=
new
ArrayList
<>();
List
<
Element
>
userInfosList
=
getElementList
(
xml
);
for
(
Element
ii
:
userInfosList
)
{
String
number
=
ii
.
element
(
"phoneNo"
).
getText
();
System
.
out
.
println
(
number
);
resList
.
add
(
number
);
}
return
resList
;
}
public
static
List
<
Jzxx
>
getZjhm
(
String
xml
)
throws
DocumentException
{
List
<
Element
>
userInfosList
=
getElementList
(
xml
);
System
.
out
.
println
(
"userInfosList="
+
userInfosList
);
List
<
Jzxx
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
userInfosList
.
size
();
i
++)
{
String
zjhm
=
userInfosList
.
get
(
0
).
element
(
"idCard"
).
getText
();
String
userName
=
userInfosList
.
get
(
0
).
element
(
"userName"
).
getText
();
String
address
=
userInfosList
.
get
(
0
).
element
(
"address"
).
getText
();
String
openDate
=
userInfosList
.
get
(
0
).
element
(
"openDate"
).
getText
();
//20200805184139
Jzxx
jzxx
=
new
Jzxx
();
jzxx
.
setZjhm
(
zjhm
);
jzxx
.
setAddress
(
address
);
jzxx
.
setOpenDate
(
handleDate
(
openDate
));
jzxx
.
setXm
(
userName
);
System
.
out
.
println
(
"机主信息是="
+
jzxx
);
list
.
add
(
jzxx
);
}
return
list
;
}
public
static
List
<
Element
>
getElementList
(
String
xml
)
throws
DocumentException
{
Document
doc
=
null
;
// 创建SAXReader阅读器对象
SAXReader
reader
=
new
SAXReader
();
doc
=
DocumentHelper
.
parseText
(
xml
);
//获取根节点
Element
rootElt
=
doc
.
getRootElement
();
System
.
out
.
println
(
"rootElt是"
+
rootElt
.
getName
());
Element
ele
=
rootElt
.
element
(
"Method"
).
element
(
"Items"
).
element
(
"Item"
).
element
(
"Value"
);
List
<
Element
>
list
=
ele
.
elements
();
Element
res
=
list
.
get
(
list
.
size
()
-
1
);
List
<
Element
>
resultsElementList
=
res
.
element
(
"Data"
).
element
(
"Result"
).
elements
();
Element
e
=
resultsElementList
.
get
(
resultsElementList
.
size
()
-
1
).
element
(
"OTTOMsg"
).
element
(
"uqs"
);
List
<
Element
>
tempList
=
e
.
elements
();
return
(
List
<
Element
>)
tempList
.
get
(
tempList
.
size
()
-
1
).
elements
();
}
public
static
String
handleDate
(
String
openDate
){
String
year
=
openDate
.
substring
(
0
,
4
);
String
month
=
openDate
.
substring
(
4
,
6
);
String
day
=
openDate
.
substring
(
6
,
8
);
String
hour
=
openDate
.
substring
(
8
,
10
);
String
minute
=
openDate
.
substring
(
10
,
12
);
String
seconds
=
openDate
.
substring
(
12
,
14
);
return
year
+
"-"
+
month
+
"-"
+
day
+
" "
+
hour
+
":"
+
minute
+
":"
+
seconds
;
}
}
src/main/java/org/springblade/founder/ydjwhc/entity/Jzxx.java
0 → 100644
View file @
2c0f847b
package
org
.
springblade
.
founder
.
ydjwhc
.
entity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
@ApiModel
(
value
=
"机主信息"
,
description
=
"机主信息"
)
public
class
Jzxx
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"机主身份证号码"
)
private
String
zjhm
;
@ApiModelProperty
(
value
=
"手机号码"
)
private
String
phoneNum
;
@ApiModelProperty
(
value
=
"机主姓名"
)
private
String
xm
;
@ApiModelProperty
(
value
=
"机主户籍地址"
)
private
String
address
;
@ApiModelProperty
(
value
=
"机主开户时间"
)
private
String
openDate
;
public
String
getZjhm
()
{
return
zjhm
;
}
public
void
setZjhm
(
String
zjhm
)
{
this
.
zjhm
=
zjhm
;
}
public
String
getPhoneNum
()
{
return
phoneNum
;
}
public
void
setPhoneNum
(
String
phoneNum
)
{
this
.
phoneNum
=
phoneNum
;
}
public
String
getXm
()
{
return
xm
;
}
public
void
setXm
(
String
xm
)
{
this
.
xm
=
xm
;
}
public
String
getAddress
()
{
return
address
;
}
public
void
setAddress
(
String
address
)
{
this
.
address
=
address
;
}
public
String
getOpenDate
()
{
return
openDate
;
}
public
void
setOpenDate
(
String
openDate
)
{
this
.
openDate
=
openDate
;
}
@Override
public
String
toString
()
{
return
"Jzxx{"
+
"zjhm='"
+
zjhm
+
'\''
+
", phoneNum='"
+
phoneNum
+
'\''
+
", xm='"
+
xm
+
'\''
+
", address='"
+
address
+
'\''
+
", openDate='"
+
openDate
+
'\''
+
'}'
;
}
}
src/main/java/org/springblade/founder/ydjwhc/entity/TbStAppRxhcrw.java
View file @
2c0f847b
...
@@ -19,6 +19,7 @@ public class TbStAppRxhcrw extends BaseModel {
...
@@ -19,6 +19,7 @@ public class TbStAppRxhcrw extends BaseModel {
private
String
zpDzwjwz
;
private
String
zpDzwjwz
;
private
String
zpDzwjgs
;
private
String
zpDzwjgs
;
private
String
zpDzwjmc
;
private
String
zpDzwjmc
;
private
String
rwzt
;
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
String
base64Img
;
private
String
base64Img
;
...
...
src/main/java/org/springblade/founder/ydjwhc/service/impl/BjHcServiceImpl.java
View file @
2c0f847b
This diff is collapsed.
Click to expand it.
src/main/java/org/springblade/founder/ydjwhc/service/impl/TbStAppRxhcrwServiceImpl.java
View file @
2c0f847b
package
org
.
springblade
.
founder
.
ydjwhc
.
service
.
impl
;
package
org
.
springblade
.
founder
.
ydjwhc
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
@@ -22,7 +21,6 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -22,7 +21,6 @@ import org.springframework.web.multipart.MultipartFile;
import
sun.misc.BASE64Decoder
;
import
sun.misc.BASE64Decoder
;
import
sun.misc.BASE64Encoder
;
import
sun.misc.BASE64Encoder
;
import
javax.xml.bind.DatatypeConverter
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -61,6 +59,7 @@ public class TbStAppRxhcrwServiceImpl extends ServiceImpl<TbStAppRxhcrwMapper, T
...
@@ -61,6 +59,7 @@ public class TbStAppRxhcrwServiceImpl extends ServiceImpl<TbStAppRxhcrwMapper, T
rxhcrw
.
setZpDzwjwz
(
dzwjwz
);
rxhcrw
.
setZpDzwjwz
(
dzwjwz
);
rxhcrw
.
setZpDzwjmc
(
fileName
);
rxhcrw
.
setZpDzwjmc
(
fileName
);
rxhcrw
.
setZpDzwjgs
(
suffix
);
rxhcrw
.
setZpDzwjgs
(
suffix
);
rxhcrw
.
setRwzt
(
"0"
);
this
.
saveOrUpdate
(
rxhcrw
);
this
.
saveOrUpdate
(
rxhcrw
);
}
}
}
}
...
...
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