Commit 7b92d793 by wuchengwu

登录页面增加用户信息不完善补足功能

parent 32876d21
......@@ -3,7 +3,6 @@ package com.founder.login.controller;
import cn.hutool.core.date.StopWatch;
import com.founder.login.service.LoginService;
import com.founder.model.AutoTbStRy;
import com.founder.model.Param;
import com.founder.model.User;
import com.founder.module.redis.service.IDicItemService;
import com.founder.service.AutoTbXwRycjService;
......@@ -13,6 +12,7 @@ import com.founder.service.SequenceService;
import com.founder.util.Encrpt;
import com.founder.util.HttpClientUtil;
import com.founder.utils.DateFormatUtils;
import com.founder.utils.SysUitl;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
......@@ -61,7 +61,11 @@ public class LoginController {
private IParamService paramService;
@Autowired
private LoginService loginService;
/**
* 文件下载路径
*/
@Value("${wjxzlj}")
private String wjxzlj;
@Resource
private SequenceService sequenceService;
@Autowired
......@@ -73,10 +77,14 @@ public class LoginController {
@Value("${qxUrl}")
private String qxUrl;
@GetMapping(value = "/perTest")
@ResponseBody
public String perTest(){
return "连接成功!";
@RequestMapping(value = "/perTest")
public String perTest(HttpServletRequest request,Model model) throws Exception {
String newip = SysUitl.getIp();
String oldip = SysUitl.getIp(request);
model.addAttribute("newip",newip);
model.addAttribute("oldip",oldip);
return "login/test.html";
}
@RequestMapping(value = "/pkiLogin/", method = {RequestMethod.POST, RequestMethod.GET})
......@@ -233,8 +241,9 @@ public class LoginController {
String savePath = "/personphoto/" + rybhstr.substring(rybhstr.length() - 10, rybhstr.length() - 4) + "/" + rybhstr.substring(rybhstr.length() - 3, rybhstr.length());
//String hcfilePath = request.getServletContext().getRealPath("/").replaceAll("\\\\","/");
Param param = paramService.getParamById("0100");
String zplj = param.getParamvalue();
// Param param = paramService.getParamById("0100");
// String zplj = param.getParamvalue();
String zplj = wjxzlj;
String filePath = zplj;
filePath = filePath + savePath;
File filejia1 = new File(filePath + "/" + rybhstr + "1.jpg");
......@@ -345,6 +354,7 @@ public class LoginController {
s.stop();
log.info("user=" + user);
if (user != null) {
s.start("日志响应时间");
//进行日志登录
sysLogSystemService.saveSysLogSystem(user.getUnitcode(), user.getUsername(), user.getIdentitycard(),
......@@ -370,12 +380,18 @@ public class LoginController {
log.info("共耗费毫秒数=" + seconds);
System.out.println("用户登录耗费时间统计"+s.prettyPrint());
}
if (StringUtils.isBlank(user.getIdentitycard()) || StringUtils.isBlank(user.getRylx())){
returnMap.put("state", "noIdcard");
}else {
returnMap.put("state", "success");
}
returnMap.put("msg", "登陆成功!");
returnMap.put("user", user);
//returnMap.put("user",user);
} else {
returnMap.put("state", "failed");
returnMap.put("msg", "用户名或密码错误!");
returnMap.put("user", null);
}
} catch (Exception e) {
......@@ -486,6 +502,29 @@ public class LoginController {
return user;
}
@RequestMapping("/updateUser")
@ResponseBody
public Map<String, Object> updateUser(HttpServletRequest request,String jh,String zsxm,String sfhm,String rylx,String zrmj) {
Map<String, Object> map = new HashMap<>();
User user = new User();
user.setIdentitycard(sfhm);
user.setTrueName(zsxm);
user.setUsername(jh);
user.setZrmjjh(zrmj);
user.setRylx(rylx);
boolean b = loginService.updateUser(user);
if (b){
map.put("state", "success");
map.put("msg", "修改成功!");
}else {
map.put("state", "failed");
map.put("msg", "修改失败!");
}
map.put("user", user);
return map;
}
@RequestMapping(value = "/", method = {RequestMethod.POST, RequestMethod.GET})
public String toLogin(HttpServletRequest request, Model model, HttpServletResponse response) {
......
......@@ -182,6 +182,30 @@ public class User {
private String tqyhbz;
private String countryCode;
/**
* 责任民警警号
*/
private String zrmjjh;
/**
* 人员类型
*/
private String rylx;
public String getRylx() {
return rylx;
}
public void setRylx(String rylx) {
this.rylx = rylx;
}
public String getZrmjjh() {
return zrmjjh;
}
public void setZrmjjh(String zrmjjh) {
this.zrmjjh = zrmjjh;
}
public String getId() {
return id;
......
......@@ -22,6 +22,8 @@
telephone,
grade,
policemanid,
zrmjjh,
rylx,
scbz,
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'
......@@ -47,6 +49,8 @@
t.password,
t.true_name,
t.identitycard,
t.zrmjjh,
t.rylx,
t.telephone,
t.sex
</select>
......@@ -66,6 +70,8 @@
lrdwdm,
lrdwmc,
identitycard,
zrmjjh,
rylx,
sex,
birthday,
telephone,
......@@ -92,6 +98,8 @@
lrdwdm,
lrdwmc,
identitycard,
zrmjjh,
rylx,
sex,
birthday,
telephone,
......@@ -111,6 +119,8 @@
<if test="identitycard != null and identitycard != ''">identitycard= #{identitycard , jdbcType=VARCHAR },</if>
<if test="telephone != null and telephone != ''">telephone= #{telephone , jdbcType=VARCHAR },</if>
<if test="unitname != null and unitname != ''">unitname= #{unitname , jdbcType=VARCHAR },</if>
<if test="zrmjjh != null and zrmjjh != ''">zrmjjh= #{zrmjjh , jdbcType=VARCHAR },</if>
<if test="rylx != null and rylx != ''">rylx= #{rylx , jdbcType=VARCHAR },</if>
GXSJ = sysdate
WHERE username=#{username , jdbcType=VARCHAR }
</update>
......
$(function(){
// document.cookie = "KOAL_CERT_CN =项目撒大声地as430102196510012099";
console.log("获取本地cookie:"+document.cookie)
getHeight();
$(window).resize(function(){
getHeight();
});
//点击警号登录弹出登录框
$("#btn-alarm").click(function(){
$("#dlc").show();
$("#login-btn").hide();
});
$("#btn-pki").click(function(){
window.location.href = 'https://65.25.0.57:9034';
});
//关闭事件
$(".back").click(function() {
$("#login-btn").show();
$("#dlc").hide();
});
var mySwiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
autoplay:7500,
autoplayDisableOnInteraction : false,
paginationClickable: true,
on:{
init: function(){
swiperAnimateCache(this); //隐藏动画元素
swiperAnimate(this); //初始化完成开始动画
},
slideChangeTransitionEnd: function(){
swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
//this.slides.eq(this.activeIndex).find('.ani').removeClass('ani'); 动画只展现一次,去除ani类名
}
},
//回调函数 具体查看swiper文档
onSlideChangeStart: function(swiper){
//因index是从0开始 所以+1
$(".gdp-info-num span").text(swiper.activeIndex+1);
}
});
$("#xtyhts_wrap .close_btn").click(function(){
$("#wrap_mask_yhts").fadeOut();
$("#xtyhts_wrap").fadeOut();
});
$("#xtyhts1_wrap .close_btn").click(function(){
$("#xtyhts1_wrap").fadeOut();
$("#xtyhts_wrap").show();
});
});
$('#rylx').on('change', function () {debugger
var rylx=$(this).val();
if(rylx=="1"){
// $("#dazt-text").attr("style","color:black;");
// $(".mj").hide();
document.getElementById('mj').style.display="none";
}else{
document.getElementById('mj').style.display="block";
}
});
//获取高度
function getHeight(){
if($(window).height()<=630){
$(".login-btn").css({"margin":"2% auto 3% auto","height":"41%"});
}else if($(window).height()<=768){
$(".login-btn").css({"margin":"6% auto 3% auto","height":"33%"});
$(".wrap-content").css({"height":$(window).height()-180});
}else{
$(".wrap-content").css({"height":$(window).height()-160});
}
$(".radar").css("top",($(".wrap-content").height()-$(".radar").height())/2);
$(".swiper-container,.swiper-slide").css({"width":$(".earth").width(),"height":$(".wrap-content").height(),"overflow":'hidden'});
$(".radar02").css("top",($(".swiper-slide").height()-$(".radar02").height())/2);
$(".radar03").css("top",($(".swiper-slide").height()-$(".radar03").height())/2);
}
document.onkeydown=function(event){
var e = event || window.event || arguments.callee.caller.arguments[0];
if(e && e.keyCode==13){ // enter 键
doLogin()
}
};
function doLogin(){
$("#loadgif").show();
var username=$("#username").val();
var password=$("#password").val();
var perurl="admin";//默认权限
var user;
// alert("1.人员查询页面:增加声纹,虹膜,足迹,手机,案件类型等查询项。\n" +
// "2.采集设备管理:页面布局调整及设备注册流程变更,设备监控管理统计、导出。\n" +
// "3、系统管理:增加用户权限、字典修改、人员采集信息统计。","2021/07/19协同系统更新内容:");
$.ajax({
url:"qxdoLogin",//权限登陆
data:{"username":username,"password":password},
type:"post",
async: false,
dataType:"json",
success:function(mgs){
setTimeout("hide()",500);
perurl=mgs.perurl;
$.ajax({
url:"doLogin",
data:{"userId":username,"psw":password,"perurl":perurl},
type:"post",
dataType:"json",
async: false,
success:function(data){
var state=data.state;
var msg=data.msg;
user=data.user;
if(state&&state=="success"){
window.location.href="toHome";
}else{
if (state&&state=="noIdcard"){
//进行用户身份证判断,若没有身份证,需要重新填写身份证后重新登录。如果是辅警,需要填写责任民警是谁
if (user != 'undefined' && user != null &&( (user.identitycard =='' || user.identitycard == null) || (user.rylx =='' || user.rylx == null))){
$('#jh').val(user.username);
$('#zsxm').val(user.trueName);
$('#sfhm').val(user.identitycard);
$('#dls').show();
$('#rg').hide();
}
}else {
alert(msg);
}
}
}
});
}
});
}
function doSfhm(){debugger
var jh=$("#jh").val();
var zsxm=$("#zsxm").val();
var sfhm=$("#sfhm").val();
var rylx=$("#rylx").val();
var zrmj=$("#zrmj").val();
var flag =true;
if(sfhm==null||sfhm==""){
layer.alert("<span style ='color:#000000'>身份证号不能为空!</span>",{icon: 7, title: '提示'});
flag = false;
return;
}
if(rylx==null||rylx==""){
layer.alert("<span style ='color:#000000'>警员类别不能为空!</span>",{icon: 7, title: '提示'});
flag = false;
return;
}
var reg=/^[1-9]([0-9]{14}|[0-9X]{17})$/;
if(sfhm!="无"&&!reg.test(sfhm)){
layer.alert("<span style ='color:#000000'>请输入正确的身份证号!!</span>",{icon: 7, title: '提示'});
flag = false;
return;
}
if(rylx =="2"){
if(zrmj==null||zrmj==""){
layer.alert("<span style ='color:#000000'>责任民警不能为空!</span>",{icon: 7, title: '提示'});
flag = false;
return;
}
}
if(flag){
$.ajax({
url:"updateUser",//权限登陆
data:{"jh":jh,"zsxm":zsxm,"sfhm":sfhm,"rylx":rylx,"zrmj":zrmj},
type:"get",
async: false,
dataType:"json",
success:function(mgs){
var state=mgs.state;
var msg=mgs.msg;
if(state&&state=="success"){
doLogin();
}
}
});
}
}
function hide(){
$("#loadgif").hide();
}
function openUrlpage(dkh){
window.location.href="http://65.26.10.49:"+dkh;
// window.location.href="http://65.26.10.121:"+dkh;
}
function toFjxz(){
window.open('/toFjxz','_blank');
}
function toCzsmxz(){
window.open('/toCzsmxz','_blank');
}
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
......@@ -8,7 +7,106 @@
<link rel="stylesheet" type="text/css" href="/static/xtba/login/css/style-hn.css">
<link rel="stylesheet" type="text/css" href="/static/xtba/login/css/login.css">
<link rel="stylesheet" type="text/css" href="/static/xtba/login/css/animate.min.css">
<link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
<script src="/static/layui/layui.js" charset="utf-8"></script>
<script src="/static/layui/layui.all.js" charset="utf-8"></script>
</head>
<style>
.layui-form-item{
width: 25%!important;
height: 14px!important;
}
.layui-form-checkbox i {
position: absolute;
right: 0;
top: 0;
width: 30px;
height: 28px;
border: 1px solid #d2d2d2;
/* border-left: darkblue; */
border-radius: 0 2px 2px 0;
color: #fff;
font-size: 20px;
text-align: center;
}
.layui-form-checked i, .layui-form-checked:hover i {
/*color: #5FB878;*/
border-color:#5FB878 !important;
background-color:#FFF !important;
color:#5FB878 !important;
font-weight: bold;
}
.layui-form-checkbox:hover i{
border-color:#5FB878 !important;
}
.layui-form-radio>i:hover, .layui-form-radioed>i{
color: #5FB878 !important;
}
.layui-form-checkbox {
margin-right: 4px!important;
}
.oy-btn{
display: inline-block;
height: 38px;
line-height: 38px;
padding: 0 18px;
background-color: #17bd88;
color: #fff;
white-space: nowrap;
text-align: center;
font-size: 14px;
border: none;
border-radius: 2px;
cursor: pointer;
}
.layui-input, .layui-textarea, .layui-form-select dl {
width: 84% !important;
}
.layui-form-label {
width: 90px !important;
padding: 9px 10px !important;
line-height: 7px!important;
}
.layui-input-block {
margin-left: 110px;
min-height: 36px;
}
.jh {
margin-left: 10px!important;
min-height: 16px;
}
.drk2 {
margin-top: 10px!important;
width: 267px;
height: 342px;
max-height: 25%;
display: inline-block;
background: rgba(0,0,0,0.2);
border-radius: 5px;
box-shadow: -1px 1px 13px #000000;
}
.dran2 {
cursor: pointer;
display: inline-block;
width: 110px;
height: 24px;
background: rgba(0, 153, 255, 0.73) !important;
margin: 5px 28px 10px 80px;
line-height: 24px;
color: #fff;
font-size: 16px;
text-align: center;
font-weight: 600;
border-radius:8px;
}
/*.dran2:hover {*/
/* background: url(../images/btn2.png) no-repeat;*/
/*}*/
a{
color: #fbfbfb!important;
}
</style>
<body>
<!--标题-->
<div class="login-header">
......@@ -42,7 +140,7 @@
<div class="swiper-pagination" style="display:none;"></div>
</div>
</div>
<div class="rg login-wrap">
<div class="rg login-wrap" id="rg">
<div class="login-btn" id="login-btn">
<a class="btn-alarm" id="btn-alarm">&nbsp;&nbsp;&nbsp;<img src="/static/xtba/login/images/ps.png"/></a>
<a class="btn-pki" id="btn-pki">PKI证书登录<img src="/static/xtba/login/images/usb.png"/></a>
......@@ -85,6 +183,47 @@
</p>
</div>
</div>
<div class="rg " id="dls" style="display: none;float: right;width:35%;height: 100%;position: relative;margin-top: 65px;">
<h5 style="color: yellow;font-size: 24px;font-weight: bold">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</h5>
<div class="drk2">
<div class="layui-form-item" style="margin-top: 10px!important;">
<label class="layui-form-label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</label>
<div class="layui-input-block">
<input class="layui-input-block jh" name="jh" id="jh" type="text" readonly/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:</label>
<div class="layui-input-block">
<input class="layui-input-block jh" name="zsxm" id="zsxm" type="text"/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">身份证号码:</label>
<div class="layui-input-block">
<input class="layui-input-block jh" name="sfhm" id="sfhm" type="text/">
</div>
</div>
<div class="layui-form-item" >
<div ><label class="layui-form-label">警员类别:</label></div>
<div class="layui-input-block">
<select style="width: 134px!important;" name="rylx" class="jh" id="rylx">
<option value="">请选择</option>
<option value="1">民警</option>
<option value="2">辅警</option>
</select>
</div>
</div>
<div class="layui-form-item" id="mj" style="display: none">
<label class="layui-form-label">责任民警警号:</label>
<div class="layui-input-block">
<input class="layui-input-block jh" name="zrmj" id="zrmj" type="text"/>
</div>
</div>
<span id="bcyhxx" onclick="doSfhm();" class="dran2">保存&登录</span>
</div>
</div>
</div>
<div class="ds-wrap">
<span class="border-wrap">
......@@ -145,143 +284,6 @@
<script type="text/javascript" src="/static/xtba/login/js/swiper-3.4.2.jquery.min.js"></script>
<script type="text/javascript" src="/static/xtba/login/js/goods.js" ></script>
<script type="text/javascript" src="/static/xtba/login/js/swiper.animate.min.js" ></script>
<script>
$(function(){
// document.cookie = "KOAL_CERT_CN =项目撒大声地as430102196510012099";
console.log("获取本地cookie:"+document.cookie)
getHeight();
$(window).resize(function(){
getHeight();
});
//点击警号登录弹出登录框
$("#btn-alarm").click(function(){
$("#dlc").show();
$("#login-btn").hide();
});
$("#btn-pki").click(function(){
window.location.href = 'https://65.25.0.57:9034';
//window.location.href ='http://localhost:9101/';
// window.location.href ='http://65.26.10.121:80/';
});
//关闭事件
$(".back").click(function() {
$("#login-btn").show();
$("#dlc").hide();
});
var mySwiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
    autoplay:7500,
autoplayDisableOnInteraction : false,
paginationClickable: true,
on:{
init: function(){
swiperAnimateCache(this); //隐藏动画元素
swiperAnimate(this); //初始化完成开始动画
},
slideChangeTransitionEnd: function(){
swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
//this.slides.eq(this.activeIndex).find('.ani').removeClass('ani'); 动画只展现一次,去除ani类名
}
},
//回调函数 具体查看swiper文档
onSlideChangeStart: function(swiper){
//因index是从0开始 所以+1
$(".gdp-info-num span").text(swiper.activeIndex+1);
}
});
$("#xtyhts_wrap .close_btn").click(function(){
$("#wrap_mask_yhts").fadeOut();
$("#xtyhts_wrap").fadeOut();
});
$("#xtyhts1_wrap .close_btn").click(function(){
$("#xtyhts1_wrap").fadeOut();
$("#xtyhts_wrap").show();
});
});
//获取高度
function getHeight(){
if($(window).height()<=630){
$(".login-btn").css({"margin":"2% auto 3% auto","height":"41%"});
}else if($(window).height()<=768){
$(".login-btn").css({"margin":"6% auto 3% auto","height":"33%"});
$(".wrap-content").css({"height":$(window).height()-180});
}else{
$(".wrap-content").css({"height":$(window).height()-160});
}
$(".radar").css("top",($(".wrap-content").height()-$(".radar").height())/2);
$(".swiper-container,.swiper-slide").css({"width":$(".earth").width(),"height":$(".wrap-content").height(),"overflow":'hidden'});
$(".radar02").css("top",($(".swiper-slide").height()-$(".radar02").height())/2);
$(".radar03").css("top",($(".swiper-slide").height()-$(".radar03").height())/2);
}
document.onkeydown=function(event){
var e = event || window.event || arguments.callee.caller.arguments[0];
if(e && e.keyCode==13){ // enter 键
doLogin()
}
};
function doLogin(){
$("#loadgif").show();
var username=$("#username").val();
var password=$("#password").val();
var perurl="admin";//默认权限
var user;
// alert("1.人员查询页面:增加声纹,虹膜,足迹,手机,案件类型等查询项。\n" +
// "2.采集设备管理:页面布局调整及设备注册流程变更,设备监控管理统计、导出。\n" +
// "3、系统管理:增加用户权限、字典修改、人员采集信息统计。","2021/07/19协同系统更新内容:");
$.ajax({
url:"qxdoLogin",//权限登陆
data:{"username":username,"password":password},
type:"post",
async: false,
dataType:"json",
success:function(mgs){
setTimeout("hide()",500);
perurl=mgs.perurl;
$.ajax({
url:"doLogin",
data:{"userId":username,"psw":password,"perurl":perurl},
type:"post",
dataType:"json",
async: false,
success:function(data){
var state=data.state;
var msg=data.msg;
user=data.user;
if(state&&state=="success"){
window.location.href="toHome";
}else{
alert(msg);
}
}
});
}
});
}
function hide(){
$("#loadgif").hide();
}
function openUrlpage(dkh){
window.location.href="http://65.26.10.49:"+dkh;
// window.location.href="http://65.26.10.121:"+dkh;
}
function toFjxz(){
window.open('/toFjxz','_blank');
}
function toCzsmxz(){
window.open('/toCzsmxz','_blank');
}
</script>
<script type="text/javascript" src="/static/login/js/login.js" ></script>
</body>
</html>
\ No newline at end of file
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