bug修复

This commit is contained in:
liang.chao 2025-07-08 17:06:55 +08:00
parent a18ec54d1d
commit 0dcd14e887
2 changed files with 93 additions and 56 deletions

View File

@ -2,15 +2,28 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bonus.gs.sub.evaluate.evaluate.dao.PersonDao"> <mapper namespace="com.bonus.gs.sub.evaluate.evaluate.dao.PersonDao">
<insert id="addPersonInfo" keyProperty="userId" useGeneratedKeys="true"> <insert id="addPersonInfo" keyProperty="userId" useGeneratedKeys="true">
insert into sys_user(username, password, nickname, id_card, phone, sex, status, org_id) INSERT INTO sys_user
values (#{name}, <trim prefix="(" suffix=")" suffixOverrides=",">
#{password}, <if test="name != null and name != ''">username,</if>
#{name}, <if test="password != null and password != ''">password,</if>
#{idCard}, <if test="name != null and name != ''">nickname,</if>
#{phone}, <if test="idCard != null and idCard != ''">id_card,</if>
#{sex}, <if test="phone != null and phone != ''">phone,</if>
'1', <if test="sex != null">sex,</if>
#{deptId}) <if test="deptId != null and deptId != ''">org_id,</if>
status
</trim>
VALUES
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
<if test="password != null and password != ''">#{password},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="idCard != null and idCard != ''">#{idCard},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="sex != null">#{sex},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
'1'
</trim>
</insert> </insert>
<insert id="addPersonRole"> <insert id="addPersonRole">
insert into sys_role_user(userId, roleId) values insert into sys_role_user(userId, roleId) values
@ -22,14 +35,30 @@
insert into sys_role_user(userId, roleId) values (#{id}, #{roleId}) insert into sys_role_user(userId, roleId) values (#{id}, #{roleId})
</insert> </insert>
<update id="updatePerson"> <update id="updatePerson">
update sys_user UPDATE sys_user
set username = #{name}, <set>
id_card = #{idCard}, <if test="name != null and name != ''">
phone = #{phone}, username = #{name},
nickname = #{name}, nickname = #{name},
sex =#{sex}, </if>
org_id = #{deptId}
where id = #{id} <if test="idCard != null and idCard != ''">
id_card = #{idCard},
</if>
<if test="phone != null and phone != ''">
phone = #{phone},
</if>
<if test="sex != null">
sex = #{sex},
</if>
<if test="deptId != null and deptId != ''">
org_id = #{deptId}
</if>
</set>
WHERE id = #{id}
</update> </update>
<update id="updateOldUser"> <update id="updateOldUser">
<foreach collection="list" item="item" separator=";"> <foreach collection="list" item="item" separator=";">

View File

@ -47,14 +47,14 @@
autocomplete="off" class="layui-input" lay-verify="required" maxlength="20"> autocomplete="off" class="layui-input" lay-verify="required" maxlength="20">
</div> </div>
</div>--> </div>-->
<!-- <div class="layui-form-item" style="width: 90%"> <!-- <div class="layui-form-item" style="width: 90%">
<label class="layui-form-label" style="width: 150px"><span <label class="layui-form-label" style="width: 150px"><span
style="color: red">*</span>身份证号码:</label> style="color: red">*</span>身份证号码:</label>
<div class="layui-input-inline" style="width: 60%"> <div class="layui-input-inline" style="width: 60%">
<input class="layui-input" id="idCard" name="idCard" lay-verify="required\|idCard" <input class="layui-input" id="idCard" name="idCard" lay-verify="required\|idCard"
lay-affix="clear" autocomplete="off" maxlength="18"> lay-affix="clear" autocomplete="off" maxlength="18">
</div> </div>
</div>--> </div>-->
<div class="layui-form-item" style="width: 90%"> <div class="layui-form-item" style="width: 90%">
<label class="layui-form-label" style="width: 150px"><span style="color: red">*</span>姓名:</label> <label class="layui-form-label" style="width: 150px"><span style="color: red">*</span>姓名:</label>
<div class="layui-input-inline" style="width: 60%"> <div class="layui-input-inline" style="width: 60%">
@ -64,15 +64,15 @@
autocomplete="off" maxlength="30"> autocomplete="off" maxlength="30">
</div> </div>
</div> </div>
<!-- <div class="layui-form-item" style="width: 90%"> <!-- <div class="layui-form-item" style="width: 90%">
<label class="layui-form-label" style="width: 150px"><span style="color: red">*</span>性别:</label> <label class="layui-form-label" style="width: 150px"><span style="color: red">*</span>性别:</label>
<div class="layui-input-inline" style="width: 60%"> <div class="layui-input-inline" style="width: 60%">
<select id="sex" name="sex" class="layui-select" lay-search> <select id="sex" name="sex" class="layui-select" lay-search>
<option value="1"></option> <option value="1"></option>
<option value="2"></option> <option value="2"></option>
</select> </select>
</div> </div>
</div>--> </div>-->
<div class="layui-form-item" style="width: 90%"> <div class="layui-form-item" style="width: 90%">
<label class="layui-form-label" style="width: 150px"><span style="color: red">*</span>联系电话:</label> <label class="layui-form-label" style="width: 150px"><span style="color: red">*</span>联系电话:</label>
<div class="layui-input-inline" style="width: 60%"> <div class="layui-input-inline" style="width: 60%">
@ -89,7 +89,7 @@
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item" id="dept">
<label class="layui-form-label" style="width: 150px"><span <label class="layui-form-label" style="width: 150px"><span
style="color: red">*</span>所属项目/部门:</label> style="color: red">*</span>所属项目/部门:</label>
<div class="layui-input-inline" style="width: 60%"> <div class="layui-input-inline" style="width: 60%">
@ -148,6 +148,7 @@
} }
}); });
} }
function getDeptSelect() { function getDeptSelect() {
$.ajax({ $.ajax({
type: 'post', type: 'post',
@ -158,15 +159,16 @@
} }
}); });
} }
layui.use(['form', 'laydate'], function () { layui.use(['form', 'laydate'], function () {
var form = layui.form; var form = layui.form;
var laydate = layui.laydate; var laydate = layui.laydate;
form.verify({ form.verify({
/* idCard: function (value, item) { /* idCard: function (value, item) {
if (!checkPsidno(value)) { if (!checkPsidno(value)) {
return '请输入正确的身份证号'; return '请输入正确的身份证号';
} }
},*/ },*/
phone: function (value, item) { phone: function (value, item) {
if (!phone_reg(value)) { if (!phone_reg(value)) {
return '请输入正确的手机号'; return '请输入正确的手机号';
@ -178,32 +180,38 @@
if (obj.value == 5) { if (obj.value == 5) {
$('#deptId').val(7); // 设置为发展运营中心 $('#deptId').val(7); // 设置为发展运营中心
$('#deptId').attr('disabled', 'disabled'); $('#deptId').attr('disabled', 'disabled');
} else if (obj.value == 7) {
$('#deptId').val("");
$('#deptId').removeAttr('lay-verify');
$('#dept').hide();
} else { } else {
$('#deptId').val(""); $('#deptId').val("");
$('#deptId').removeAttr('disabled'); $('#deptId').removeAttr('disabled');
$('#deptId').attr('lay-verify','required');
$('#dept').show();
} }
layui.form.render('select'); // 刷新下拉框 layui.form.render('select'); // 刷新下拉框
}); });
// 提交事件 // 提交事件
form.on('submit(formSubmit)', function (data) { form.on('submit(formSubmit)', function (data) {
//对身份证和手机号验证 //对身份证和手机号验证
/* if ($('#idCard').val() == null || $('#idCard').val() == "") { /* if ($('#idCard').val() == null || $('#idCard').val() == "") {
layer.msg("请输入身份证号", {icon: 2, time: 2000}); layer.msg("请输入身份证号", {icon: 2, time: 2000});
return false; return false;
}*/ }*/
/* if (!checkPsidno($("#idCard").val())) { /* if (!checkPsidno($("#idCard").val())) {
layer.msg("身份证号码格式不正确", {icon: 2, time: 2000}); layer.msg("身份证号码格式不正确", {icon: 2, time: 2000});
return false; return false;
}*/ }*/
if ($('#name').val() == null || $('#name').val() == "") { if ($('#name').val() == null || $('#name').val() == "") {
layer.msg("请输入姓名", {icon: 2, time: 2000}); layer.msg("请输入姓名", {icon: 2, time: 2000});
return false; return false;
} }
/* if ($('#sex').val() == null || $('#sex').val() == "") { /* if ($('#sex').val() == null || $('#sex').val() == "") {
layer.msg("请选择性别", {icon: 2, time: 2000}); layer.msg("请选择性别", {icon: 2, time: 2000});
return false; return false;
}*/ }*/
if ($('#phone').val() == null || $('#phone').val() == "") { if ($('#phone').val() == null || $('#phone').val() == "") {
layer.msg("请输入手机号", {icon: 2, time: 2000}); layer.msg("请输入手机号", {icon: 2, time: 2000});
return false; return false;
@ -216,10 +224,10 @@
layer.msg("请选择角色", {icon: 2, time: 2000}); layer.msg("请选择角色", {icon: 2, time: 2000});
return false; return false;
} }
if ($('#deptId').val() == null || $('#deptId').val() == "") { // if ($('#deptId').val() == null || $('#deptId').val() == "") {
layer.msg("请选择所属部门", {icon: 2, time: 2000}); // layer.msg("请选择所属部门", {icon: 2, time: 2000});
return false; // return false;
} // }
$.ajax({ $.ajax({
url: ctxPath + '/evaluatePerson/addPersonInfo', url: ctxPath + '/evaluatePerson/addPersonInfo',