Commit 8d52008d by wuchengwu

根据人员编号获取人员所有信息

parent 46af64d5
...@@ -70,7 +70,18 @@ ...@@ -70,7 +70,18 @@
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version> <thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
</properties> </properties>
<dependencies> <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> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
......
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
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
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
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;
}
}
...@@ -20,8 +20,8 @@ public class FilterConfig extends WebMvcConfigurerAdapter { ...@@ -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", 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", "/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", "/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" "/getYhkDetail","/getSwDetail","/getRyzjzpimages","/getRyzpimages","/getPmimages","/getGdimages","/zipurlzw","/dataAssess","/sendMessage","/toSavaRybdxx","/queryZwbzds","/getYthcjryxxByRybh","/checkClientVp","/insertZwbhAndZwfkxxByRybh","/getXsjsbdxq",
,"/getRyxx" "/getRyxx"
); );
......
...@@ -58,14 +58,15 @@ public class TbStRyController { ...@@ -58,14 +58,15 @@ public class TbStRyController {
*/ */
@PostMapping("/getRyxx") @PostMapping("/getRyxx")
public XzResult ryxxsb(@RequestBody Jsythcjsj jsythcjsj) { public XzResult ryxxsb(@RequestBody Jsythcjsj jsythcjsj) {
if (StringUtils.isEmpty(jsythcjsj.getRycjbh())) { if (StringUtils.isEmpty(jsythcjsj.getSfhm())) {
return XzResult.error("查询失败").data("code", JZWFW_CODE_FAIL).data("info", "人员编号不能为空!"); return XzResult.error("查询失败").data("code", JZWFW_CODE_FAIL).data("info", "身份号码不能为空!");
} }
Ryjbxx ryjbxx = mapper.queryRycj(jsythcjsj.getRycjbh()); Ryjbxx ryjbxx = mapper.queryRycj(jsythcjsj.getSfhm());
if (ryjbxx == null) { 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); return tbStRyService.jsythcjsj(jsythcjsj);
} }
......
...@@ -64,7 +64,7 @@ public interface TbXwRycjDao { ...@@ -64,7 +64,7 @@ public interface TbXwRycjDao {
* @param rybh * @param rybh
* @return * @return
*/ */
public Ryjbxx queryRycj(@Param("rybh") String rybh); public Ryjbxx queryRycj(@Param("sfhm") String sfhm);
public List<ShangbaoRxzp> queryShangbaoRyzpList(@Param("rybh") String rybh); public List<ShangbaoRxzp> queryShangbaoRyzpList(@Param("rybh") String rybh);
public ShangbaoSwxx queryShangbaoRycjSw(@Param("rybh") String rybh); public ShangbaoSwxx queryShangbaoRycjSw(@Param("rybh") String rybh);
public List<ShangbaoHmxx> queryShangbaoRycjHmList(@Param("rybh") String rybh); public List<ShangbaoHmxx> queryShangbaoRycjHmList(@Param("rybh") String rybh);
......
...@@ -25,6 +25,7 @@ public class Jsythcjsj { ...@@ -25,6 +25,7 @@ public class Jsythcjsj {
* 人员采集编号 * 人员采集编号
*/ */
private String rycjbh; private String rycjbh;
private String sfhm;
private String starttime; private String starttime;
} }
...@@ -915,7 +915,7 @@ ...@@ -915,7 +915,7 @@
cj.LRDWDM AS CJDW_GAJGJGDM, cj.LRDWDM AS CJDW_GAJGJGDM,
cj.LRDWMC AS CJDW_DWMC, cj.LRDWMC AS CJDW_DWMC,
to_char( cj.lrsj,'yyyy-mm-dd hh24:mi:ss') AS CJSJ, 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.LRR AS CJR_XM,
cj.SGSX as SG, cj.SGSX as SG,
cj.TZSX as TZ, cj.TZSX as TZ,
...@@ -923,7 +923,7 @@ ...@@ -923,7 +923,7 @@
FROM FROM
TB_RY_RYCJ cj TB_RY_RYCJ cj
WHERE WHERE
cj.rybh = #{rybh , jdbcType=VARCHAR } cj.gmsfhm = #{sfhm , jdbcType=VARCHAR }
and ( cj.SCBZ = '0' OR cj.SCBZ IS NULL ) and ( cj.SCBZ = '0' OR cj.SCBZ IS NULL )
ORDER BY ORDER BY
cj.gxsj DESC cj.gxsj DESC
...@@ -932,17 +932,16 @@ ...@@ -932,17 +932,16 @@
<select id="queryShangbaoRyzpList" parameterType="java.lang.String" resultType="com.founder.model.xz.ShangbaoRxzp"> <select id="queryShangbaoRyzpList" parameterType="java.lang.String" resultType="com.founder.model.xz.ShangbaoRxzp">
select select
rybh as RYCJBH, ASJXGRYBH as RYCJBH,
rybh as RYBH, ASJXGRYBH as RYBH,
dzwjnr as RXZP, RYZP_DZWJNR as RXZP,
zpbw as RYZPLXDM, ZPBW as RYZPLXDM,
LRDWDM as CJDW_GAJGJGDM, XXDJDW_GAJGJGDM as CJDW_GAJGJGDM,
LRDWMC as CJDW_DWMC, XXDJDW_GAJGMC as CJDW_DWMC,
LRR as CJR_XM, XXDJRY_XM as CJR_XM,
to_char( DJSJ,'yyyy-mm-dd hh24:mi:ss') as CJSJ
to_char( lrsj,'yyyy-mm-dd hh24:mi:ss') as CJSJ from tb_rycj_zp
from TB_RY_RYZP where ASJXGRYBH = #{rybh} and xxsc_pdbz ='0'
where rybh = #{rybh} and SCBZ ='0'and length(dzwjnr)>0
order by zpbw desc order by zpbw desc
</select> </select>
...@@ -1024,6 +1023,7 @@ ...@@ -1024,6 +1023,7 @@
LRR as CJR_XM, LRR as CJR_XM,
to_char( CJSJ,'yyyy-mm-dd hh24:mi:ss') as CJSJ 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) from TB_XW_YTHCJ_SSXDWP where RYBH = #{rybh , jdbcType=VARCHAR } and (XXSC_PDBZ='0' or XXSC_PDBZ is null)
</select> </select>
<select id="queryShangbaoRycjTstzList" parameterType="java.lang.String" resultType="com.founder.model.xz.ShangbaoTstzxx"> <select id="queryShangbaoRycjTstzList" parameterType="java.lang.String" resultType="com.founder.model.xz.ShangbaoTstzxx">
......
...@@ -204,7 +204,7 @@ ...@@ -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 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 scbz='0'
and username=#{userName} and username=#{userName}
and password=#{password} and password_yrhcj=#{password}
</select> </select>
<update id="updateUser" parameterType="com.founder.model.User"> <update id="updateUser" parameterType="com.founder.model.User">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment