bug修复

This commit is contained in:
liang.chao 2025-07-08 17:48:58 +08:00
parent 0dcd14e887
commit d146a6f218
3 changed files with 24 additions and 21 deletions

View File

@ -8,6 +8,7 @@ import com.bonus.gs.sub.evaluate.manager.utils.AesCbcUtils;
import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes; import com.bonus.gs.sub.evaluate.manager.utils.AjaxRes;
import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst; import com.bonus.gs.sub.evaluate.manager.utils.GlobalConst;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
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;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
@ -46,8 +47,8 @@ public class PersonServiceImpl implements PersonService {
list.forEach(personBean -> { list.forEach(personBean -> {
personBean.setSex("".equals(personBean.getSex()) ? "1" : "0"); personBean.setSex("".equals(personBean.getSex()) ? "1" : "0");
personBean.setPassword(passwordEncoder.encode(password)); personBean.setPassword(passwordEncoder.encode(password));
// personBean.setEvaluatePassWord(AesCbcUtils.encrypt(password));
personBean.setEvaluatePassWord(password); personBean.setEvaluatePassWord(password);
personBean.setDeptId(StringUtils.isBlank(personBean.getDeptId()) ? "0" : personBean.getDeptId());
}); });
for (PersonBean personBean : list) { for (PersonBean personBean : list) {
dao.addPersonInfo(personBean); dao.addPersonInfo(personBean);
@ -68,6 +69,7 @@ public class PersonServiceImpl implements PersonService {
public AjaxRes updatePerson(PersonBean o) { public AjaxRes updatePerson(PersonBean o) {
AjaxRes ar = new AjaxRes(); AjaxRes ar = new AjaxRes();
try { try {
o.setDeptId(StringUtils.isBlank(o.getDeptId()) ? "0" : o.getDeptId());
dao.deletePersonRole(o.getId()); dao.deletePersonRole(o.getId());
dao.updatePerson(o); dao.updatePerson(o);
dao.addPersonRoleById(o); dao.addPersonRoleById(o);

View File

@ -180,8 +180,9 @@
if (obj.value == 5) { if (obj.value == 5) {
$('#deptId').val(7); // 设置为发展运营中心 $('#deptId').val(7); // 设置为发展运营中心
$('#deptId').attr('disabled', 'disabled'); $('#deptId').attr('disabled', 'disabled');
$('#dept').show();
} else if (obj.value == 7) { } else if (obj.value == 7) {
$('#deptId').val(""); $('#deptId').val('');
$('#deptId').removeAttr('lay-verify'); $('#deptId').removeAttr('lay-verify');
$('#dept').hide(); $('#dept').hide();
} else { } else {

View File

@ -19,15 +19,15 @@
class="layui-input"> class="layui-input">
</div> </div>
</div> </div>
<!-- <div class="layui-form-item"> <!-- <div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>性别</label> <label class="layui-form-label"><span style="color: red">*</span>性别</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select class="layui-select" id="sex" name="sex" lay-verify="required"> <select class="layui-select" id="sex" name="sex" lay-verify="required">
<option value="1"></option> <option value="1"></option>
<option value="0"></option> <option value="0"></option>
</select> </select>
</div> </div>
</div>--> </div>-->
<!-- <div class="layui-form-item"> <!-- <div class="layui-form-item">
<label class="layui-form-label"><span style="color: red">*</span>身份证号</label> <label class="layui-form-label"><span style="color: red">*</span>身份证号</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
@ -51,7 +51,7 @@
</select> </select>
</div> </div>
</div> </div>
<div class="layui-form-item"> <div class="layui-form-item" id="dept">
<label class="layui-form-label"><span style="color: red">*</span>所属部门/项目</label> <label class="layui-form-label"><span style="color: red">*</span>所属部门/项目</label>
<div class="layui-input-inline"> <div class="layui-input-inline">
<select id="deptId" style="width: 100%;" name="deptId" class="layui-select" lay-search <select id="deptId" style="width: 100%;" name="deptId" class="layui-select" lay-search
@ -117,6 +117,7 @@
form.render(); form.render();
}) })
function initData(data) { function initData(data) {
$("#name").val(data.name); $("#name").val(data.name);
$("#sex").val(data.sex === '男' ? 1 : 0); $("#sex").val(data.sex === '男' ? 1 : 0);
@ -128,25 +129,23 @@
function changeDept(value, name) { function changeDept(value, name) {
let elem = $("#deptId"); let elem = $("#deptId");
if (value == '7' || name === '项目经理') { if (value == 7) {
//清空部门 $('#deptId').val('');
elem.empty(); $('#deptId').removeAttr('lay-verify');
//设置不可选并去除验证 $('#dept').hide();
elem.attr("disabled", "disabled");
elem.addClass('layui-disabled');
elem.removeAttr("lay-verify");
//删除所属部门/项目前面的*
$(".layui-form-label:eq(5)").html("所属部门/项目");
} else if (value == 5) { } else if (value == 5) {
$('#deptId').val(7); // 设置为发展运营中心 $('#deptId').val(7); // 设置为发展运营中心
$('#deptId').attr('disabled', 'disabled'); $('#deptId').attr('disabled', 'disabled');
$('#dept').show();
} else { } else {
$('#dept').show();
elem.removeAttr("disabled"); elem.removeAttr("disabled");
elem.attr("lay-verify", "required"); elem.attr("lay-verify", "required");
elem.removeClass('layui-disabled'); elem.removeClass('layui-disabled');
$(".layui-form-label:eq(5)").html("<span style='color: red'>*</span>所属部门/项目"); $(".layui-form-label:eq(5)").html("<span style='color: red'>*</span>所属部门/项目");
getDeptSelect(); getDeptSelect();
} }
form.render();
} }
function getRoleSelect() { function getRoleSelect() {
@ -189,6 +188,7 @@
function submit(data) { function submit(data) {
data.id = personInfo.id; data.id = personInfo.id;
console.log(JSON.stringify( data)+"data")
$.ajax({ $.ajax({
type: 'post', type: 'post',
url: ctxPath + '/evaluatePerson/updatePerson', url: ctxPath + '/evaluatePerson/updatePerson',