Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hnxtbaboot
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
杨亮
hnxtbaboot
Commits
8d52008d
Commit
8d52008d
authored
Mar 07, 2023
by
wuchengwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据人员编号获取人员所有信息
parent
46af64d5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
285 additions
and
22 deletions
+285
-22
pom.xml
+12
-1
src/main/java/com/founder/common/AuthConfigurer.java
+30
-0
src/main/java/com/founder/common/CacheUtils.java
+128
-0
src/main/java/com/founder/common/RequestLimitException.java
+31
-0
src/main/java/com/founder/common/RequestLimitInterceptor.java
+61
-0
src/main/java/com/founder/config/FilterConfig.java
+2
-2
src/main/java/com/founder/controller/TbStRyController.java
+5
-4
src/main/java/com/founder/controller/TbXwRycjController.java
+0
-0
src/main/java/com/founder/dao/TbXwRycjDao.java
+1
-1
src/main/java/com/founder/model/xz/Jsythcjsj.java
+1
-0
src/main/java/com/founder/service/impl/TbStRyServiceImpl.java
+0
-0
src/main/java/com/founder/utils/FileUtils.java
+0
-0
src/main/resources/mapper/AutoTbXwRycjSqlMap.xml
+13
-13
src/main/resources/mapper/loginSqlMap.xml
+1
-1
No files found.
pom.xml
View file @
8d52008d
...
...
@@ -70,7 +70,18 @@
<thymeleaf-layout-dialect.version>
2.2.2
</thymeleaf-layout-dialect.version>
</properties>
<dependencies>
<!-- 日志 -->
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
<version>
1.7.30
</version>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.18
</version>
</dependency>
<!-- 日志 -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
...
...
src/main/java/com/founder/common/AuthConfigurer.java
0 → 100644
View file @
8d52008d
package
com
.
founder
.
common
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistry
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
/**
* @Projectname: hnxtbabootHaiNan
* @Filename: AuthConfigurer
* @Author: wcw
* @Description: TODO
* @since 2023/3/3 10:33
*/
@Configuration
public
class
AuthConfigurer
implements
WebMvcConfigurer
{
@Autowired
RequestLimitInterceptor
requestLimitInterceptor
;
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
registry
.
addInterceptor
(
requestLimitInterceptor
);
}
}
\ No newline at end of file
src/main/java/com/founder/common/CacheUtils.java
0 → 100644
View file @
8d52008d
package
com
.
founder
.
common
;
import
java.util.Map
;
import
java.util.concurrent.*
;
/**
* @Projectname: hnxtbabootHaiNan
* @Filename: CacheUtils
* @Author: wcw
* @Description: TODO
* @since 2023/3/3 10:34
*/
public
class
CacheUtils
{
// 键值对集合
private
final
static
Map
<
String
,
Entity
>
map
=
new
ConcurrentHashMap
<>();
// 定时器线程池, 用于清除过期缓存
private
final
static
ScheduledExecutorService
executor
=
Executors
.
newSingleThreadScheduledExecutor
();
/**
* 添加缓存
*/
public
synchronized
static
void
put
(
String
key
,
Object
data
)
{
CacheUtils
.
put
(
key
,
data
,
0
);
}
/**
* 添加缓存
* 过期时间: 单位毫秒, 0表示无限长
*/
public
synchronized
static
void
put
(
String
key
,
Object
data
,
long
expire
)
{
// 清除原键值对
CacheUtils
.
remove
(
key
);
// 设置过期时间
if
(
expire
>
0
)
{
Future
future
=
executor
.
schedule
(()
->
{
// 过期后清除该键值对
synchronized
(
CacheUtils
.
class
)
{
map
.
remove
(
key
);
}
},
expire
,
TimeUnit
.
MILLISECONDS
);
map
.
put
(
key
,
new
Entity
(
data
,
future
));
}
else
{
// 不设置过期时间
map
.
put
(
key
,
new
Entity
(
data
,
null
));
}
}
/**
* 读取缓存
*/
public
synchronized
static
Object
get
(
String
key
)
{
Entity
entity
=
map
.
get
(
key
);
return
entity
==
null
?
null
:
entity
.
getValue
();
}
/**
* 读取缓存
* clazz 值类型
*/
public
synchronized
static
<
T
>
T
get
(
String
key
,
Class
<
T
>
clazz
)
{
return
clazz
.
cast
(
CacheUtils
.
get
(
key
));
}
/**
* 清除指定缓存
* 返回值为指定key的value
*/
public
synchronized
static
Object
remove
(
String
key
)
{
// 清除指定缓存数据
Entity
entity
=
map
.
remove
(
key
);
if
(
entity
==
null
)
return
null
;
// 清除指定键值对定时器
Future
future
=
entity
.
getFuture
();
if
(
future
!=
null
)
future
.
cancel
(
true
);
return
entity
.
getValue
();
}
/**
* 清除所有缓存
*/
public
synchronized
static
void
removeAll
()
{
map
.
clear
();
}
/**
* 查询当前缓存的键值对数量
*/
public
synchronized
static
int
size
()
{
return
map
.
size
();
}
/**
* 缓存实体类
*/
private
static
class
Entity
{
// 键值对的value
private
Object
value
;
// 定时器的future
private
Future
future
;
/**
* 创建实体类
*/
public
Entity
(
Object
value
,
Future
future
)
{
this
.
value
=
value
;
this
.
future
=
future
;
}
/**
* 获取value值
*/
public
Object
getValue
()
{
return
value
;
}
/**
* 获取future对象
*/
public
Future
getFuture
()
{
return
future
;
}
}
}
\ No newline at end of file
src/main/java/com/founder/common/RequestLimitException.java
0 → 100644
View file @
8d52008d
package
com
.
founder
.
common
;
/**
* @Projectname: hnxtbabootHaiNan
* @Filename: RequestLimitException
* @Author: wcw
* @Description: TODO
* @since 2023/3/3 10:36
*/
public
class
RequestLimitException
extends
Exception
{
private
static
final
long
serialVersionUID
=
1364225358754654702L
;
/**
* Instantiates a new Request limit exception.
*/
public
RequestLimitException
()
{
super
(
"HTTP请求超出设定的限制"
);
}
/**
* Instantiates a new Request limit exception.
*
* @param message the message
*/
public
RequestLimitException
(
String
message
)
{
super
(
message
);
}
}
\ No newline at end of file
src/main/java/com/founder/common/RequestLimitInterceptor.java
0 → 100644
View file @
8d52008d
package
com
.
founder
.
common
;
import
com.founder.utils.SysUitl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
@Slf4j
@Component
public
class
RequestLimitInterceptor
implements
HandlerInterceptor
{
@Override
public
boolean
preHandle
(
HttpServletRequest
httpServletRequest
,
HttpServletResponse
httpServletResponse
,
Object
object
)
throws
RequestLimitException
{
try
{
Integer
limit_count
=
25
;
Integer
limit_time
=
1000
*
60
;
String
ip
=
SysUitl
.
getIp
(
httpServletRequest
);
String
url
=
httpServletRequest
.
getRequestURL
().
toString
();
String
key
=
"req_limit_"
.
concat
(
url
).
concat
(
ip
);
String
cache
=
(
String
)
CacheUtils
.
get
(
key
);
if
(
null
==
cache
)
{
String
value
=
"1_"
+
System
.
currentTimeMillis
();
CacheUtils
.
put
(
key
,
value
,
limit_time
);
}
else
{
String
value
=
(
String
)
cache
;
String
[]
s
=
value
.
split
(
"_"
);
int
count
=
Integer
.
parseInt
(
s
[
0
]);
if
(
count
>
limit_count
)
{
log
.
info
(
"用户IP[{}], 访问地址[{}], 超过了限定的次数[{}]"
,
ip
,
url
,
limit_count
);
throw
new
RequestLimitException
();
}
value
=
(
count
+
1
)
+
"_"
+
s
[
1
];
long
last
=
limit_time
-
(
System
.
currentTimeMillis
()
-
Long
.
parseLong
(
s
[
1
]));
if
(
last
>
0
)
{
CacheUtils
.
put
(
key
,
value
,
limit_time
);
}
}
}
catch
(
RequestLimitException
e
)
{
throw
e
;
}
catch
(
Exception
e
)
{
log
.
error
(
"发生异常"
,
e
);
}
return
true
;
}
}
src/main/java/com/founder/config/FilterConfig.java
View file @
8d52008d
...
...
@@ -20,8 +20,8 @@ public class FilterConfig extends WebMvcConfigurerAdapter {
excludePathPatterns
(
"/"
,
"/toLogin"
,
"/hncsLogin"
,
"/hnzzLogin"
,
"/hnxtLogin"
,
"/hnhyLogin"
,
"/hnsyLogin"
,
"/hnyueyLogin"
,
"/hnzjjLogin"
,
"/hncdLogin"
,
"/hnyiyLogin"
,
"/hnczLogin"
,
"/hnyzLogin"
,
"/hnhhLogin"
,
"/hnldLogin"
,
"/hnxxLogin"
,
"/hainanLogin"
,
"/neimengLogin"
,
"/getSjcntDetail"
,
"/noLogin"
,
"/saveSwSjXx"
,
"/saveHmSjXx"
,
"/getSwSjXx"
,
"/getYthcjryxxByZjhm"
,
"/getYthcjUser"
,
"/getZfbaUser"
,
"/getZwbzJbxxCnt"
,
"/getCcbzJbxxCnt"
,
"/toswcj"
,
"/getJasypt"
,
"/doLogin"
,
"/toHome"
,
"/static*//**"
,
"/refreshCodeCache"
,
"/qxdoLogin"
,
"/queryNameByCode"
,
"/queryTypeCode"
,
"/toFjxz"
,
"/toCzsmxz"
,
"/download/**"
,
"/toObjectKJ"
,
"/catchimg"
,
"/iframe1"
,
"/iframe2"
,
"/xj"
,
"/report"
,
"/SavePersonInfo4Nmtc"
,
"/singleLoginAct"
,
"/getZjxxbdjg"
,
"/toShowScan"
,
"/ajaxGettoAfisStr"
,
"/getTime"
,
"/savePersonScanBackInfo"
,
"/getYhkDetail"
,
"/getSwDetail"
,
"/getRyzjzpimages"
,
"/getRyzpimages"
,
"/getPmimages"
,
"/getGdimages"
,
"/zipurlzw"
,
"/dataAssess"
,
"/sendMessage"
,
"/toSavaRybdxx"
,
"/queryZwbzds"
,
"/getYthcjryxxByRybh"
,
"/checkClientVp"
,
"/insertZwbhAndZwfkxxByRybh"
,
"/getXsjsbdxq"
,
"/getRyxx"
"/getYhkDetail"
,
"/getSwDetail"
,
"/getRyzjzpimages"
,
"/getRyzpimages"
,
"/getPmimages"
,
"/getGdimages"
,
"/zipurlzw"
,
"/dataAssess"
,
"/sendMessage"
,
"/toSavaRybdxx"
,
"/queryZwbzds"
,
"/getYthcjryxxByRybh"
,
"/checkClientVp"
,
"/insertZwbhAndZwfkxxByRybh"
,
"/getXsjsbdxq"
,
"/getRyxx"
);
...
...
src/main/java/com/founder/controller/TbStRyController.java
View file @
8d52008d
...
...
@@ -58,14 +58,15 @@ public class TbStRyController {
*/
@PostMapping
(
"/getRyxx"
)
public
XzResult
ryxxsb
(
@RequestBody
Jsythcjsj
jsythcjsj
)
{
if
(
StringUtils
.
isEmpty
(
jsythcjsj
.
get
Rycjbh
()))
{
return
XzResult
.
error
(
"查询失败"
).
data
(
"code"
,
JZWFW_CODE_FAIL
).
data
(
"info"
,
"
人员编号
不能为空!"
);
if
(
StringUtils
.
isEmpty
(
jsythcjsj
.
get
Sfhm
()))
{
return
XzResult
.
error
(
"查询失败"
).
data
(
"code"
,
JZWFW_CODE_FAIL
).
data
(
"info"
,
"
身份号码
不能为空!"
);
}
Ryjbxx
ryjbxx
=
mapper
.
queryRycj
(
jsythcjsj
.
get
Rycjbh
());
Ryjbxx
ryjbxx
=
mapper
.
queryRycj
(
jsythcjsj
.
get
Sfhm
());
if
(
ryjbxx
==
null
)
{
return
XzResult
.
error
(
"查询失败"
).
data
(
"code"
,
JZWFW_CODE_FAIL
).
data
(
"info"
,
"没有查到此
人员编号
基本信息"
);
return
XzResult
.
error
(
"查询失败"
).
data
(
"code"
,
JZWFW_CODE_FAIL
).
data
(
"info"
,
"没有查到此
身份号码
基本信息"
);
}
jsythcjsj
.
setRycjbh
(
ryjbxx
.
getRYCJBH
());
return
tbStRyService
.
jsythcjsj
(
jsythcjsj
);
}
...
...
src/main/java/com/founder/controller/TbXwRycjController.java
View file @
8d52008d
This diff is collapsed.
Click to expand it.
src/main/java/com/founder/dao/TbXwRycjDao.java
View file @
8d52008d
...
...
@@ -64,7 +64,7 @@ public interface TbXwRycjDao {
* @param rybh
* @return
*/
public
Ryjbxx
queryRycj
(
@Param
(
"
rybh"
)
String
rybh
);
public
Ryjbxx
queryRycj
(
@Param
(
"
sfhm"
)
String
sfhm
);
public
List
<
ShangbaoRxzp
>
queryShangbaoRyzpList
(
@Param
(
"rybh"
)
String
rybh
);
public
ShangbaoSwxx
queryShangbaoRycjSw
(
@Param
(
"rybh"
)
String
rybh
);
public
List
<
ShangbaoHmxx
>
queryShangbaoRycjHmList
(
@Param
(
"rybh"
)
String
rybh
);
...
...
src/main/java/com/founder/model/xz/Jsythcjsj.java
View file @
8d52008d
...
...
@@ -25,6 +25,7 @@ public class Jsythcjsj {
* 人员采集编号
*/
private
String
rycjbh
;
private
String
sfhm
;
private
String
starttime
;
}
src/main/java/com/founder/service/impl/TbStRyServiceImpl.java
View file @
8d52008d
This diff is collapsed.
Click to expand it.
src/main/java/com/founder/utils/FileUtils.java
View file @
8d52008d
This diff is collapsed.
Click to expand it.
src/main/resources/mapper/AutoTbXwRycjSqlMap.xml
View file @
8d52008d
...
...
@@ -915,7 +915,7 @@
cj.LRDWDM AS CJDW_GAJGJGDM,
cj.LRDWMC AS CJDW_DWMC,
to_char( cj.lrsj,'yyyy-mm-dd hh24:mi:ss') AS CJSJ,
cj.LRRSFZH AS
CJR_SFHM,
(SELECT uu.identitycard FROM sys_user uu WHERE uu.username = cj.LRR and rownum =1 ) as
CJR_SFHM,
cj.LRR AS CJR_XM,
cj.SGSX as SG,
cj.TZSX as TZ,
...
...
@@ -923,7 +923,7 @@
FROM
TB_RY_RYCJ cj
WHERE
cj.
rybh = #{rybh
, jdbcType=VARCHAR }
cj.
gmsfhm = #{sfhm
, jdbcType=VARCHAR }
and ( cj.SCBZ = '0' OR cj.SCBZ IS NULL )
ORDER BY
cj.gxsj DESC
...
...
@@ -932,17 +932,16 @@
<select
id=
"queryShangbaoRyzpList"
parameterType=
"java.lang.String"
resultType=
"com.founder.model.xz.ShangbaoRxzp"
>
select
rybh as RYCJBH,
rybh as RYBH,
dzwjnr as RXZP,
zpbw as RYZPLXDM,
LRDWDM as CJDW_GAJGJGDM,
LRDWMC as CJDW_DWMC,
LRR as CJR_XM,
to_char( lrsj,'yyyy-mm-dd hh24:mi:ss') as CJSJ
from TB_RY_RYZP
where rybh = #{rybh} and SCBZ ='0'and length(dzwjnr)>0
ASJXGRYBH as RYCJBH,
ASJXGRYBH as RYBH,
RYZP_DZWJNR as RXZP,
ZPBW as RYZPLXDM,
XXDJDW_GAJGJGDM as CJDW_GAJGJGDM,
XXDJDW_GAJGMC as CJDW_DWMC,
XXDJRY_XM as CJR_XM,
to_char( DJSJ,'yyyy-mm-dd hh24:mi:ss') as CJSJ
from tb_rycj_zp
where ASJXGRYBH = #{rybh} and xxsc_pdbz ='0'
order by zpbw desc
</select>
...
...
@@ -1024,6 +1023,7 @@
LRR as CJR_XM,
to_char( CJSJ,'yyyy-mm-dd hh24:mi:ss') as CJSJ
from TB_XW_YTHCJ_SSXDWP where RYBH = #{rybh , jdbcType=VARCHAR } and (XXSC_PDBZ='0' or XXSC_PDBZ is null)
</select>
<select
id=
"queryShangbaoRycjTstzList"
parameterType=
"java.lang.String"
resultType=
"com.founder.model.xz.ShangbaoTstzxx"
>
...
...
src/main/resources/mapper/loginSqlMap.xml
View file @
8d52008d
...
...
@@ -204,7 +204,7 @@
t.true_name trueName,(select name from sys_dictitem s where s.groupid='CODE_UNIT' and s.code = t.unitcode) as unitname from SYS_USER t where 1=1
and scbz='0'
and username=#{userName}
and password=#{password}
and password
_yrhcj
=#{password}
</select>
<update
id=
"updateUser"
parameterType=
"com.founder.model.User"
>
...
...
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