修改人员增加

dev_xd
haha 2025-01-08 00:24:03 +08:00
parent 7b08ca2043
commit af4cfe9ff8
7 changed files with 46 additions and 7 deletions

View File

@ -9,6 +9,9 @@ public class ProDept extends BaseEntity
/** 部门ID */ /** 部门ID */
private Long deptId; private Long deptId;
private Long comId;
/** 父部门ID */ /** 父部门ID */
private Long parentId; private Long parentId;
@ -38,7 +41,13 @@ public class ProDept extends BaseEntity
/** 联系电话 */ /** 联系电话 */
private String phone; private String phone;
public Long getComId() {
return comId;
}
public void setComId(Long comId) {
this.comId = comId;
}
public Long getDeptId() { public Long getDeptId() {
return deptId; return deptId;
} }

View File

@ -300,6 +300,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertDept" parameterType="ProDept" useGeneratedKeys="true" keyProperty="deptId"> <insert id="insertDept" parameterType="ProDept" useGeneratedKeys="true" keyProperty="deptId">
insert into sys_dept( insert into sys_dept(
<if test="parentId != null and parentId != 0">parent_id,</if> <if test="parentId != null and parentId != 0">parent_id,</if>
<if test="comId != null and comId != 0">com_id,</if>
<if test="ancestors != null and ancestors != ''">ancestors,</if> <if test="ancestors != null and ancestors != ''">ancestors,</if>
<if test="deptName != null and deptName != ''">dept_name,</if> <if test="deptName != null and deptName != ''">dept_name,</if>
<if test="deptShortName != null and deptShortName != ''">dept_short_name,</if> <if test="deptShortName != null and deptShortName != ''">dept_short_name,</if>
@ -313,6 +314,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
create_time create_time
)values( )values(
<if test="parentId != null and parentId != 0">#{parentId},</if> <if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="comId != null and comId != 0">#{comId},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if> <if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="deptName != null and deptName != ''">#{deptName},</if> <if test="deptName != null and deptName != ''">#{deptName},</if>
<if test="deptShortName != null and deptShortName != ''">#{deptShortName},</if> <if test="deptShortName != null and deptShortName != ''">#{deptShortName},</if>
@ -331,6 +333,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update sys_dept update sys_dept
<set> <set>
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if> <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
<if test="comId != null and comId != 0">com_id = #{comId},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if> <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if> <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
<if test="deptShortName != null and deptShortName != ''">dept_short_name = #{deptShortName},</if> <if test="deptShortName != null and deptShortName != ''">dept_short_name = #{deptShortName},</if>

View File

@ -143,6 +143,7 @@ public class ProProjectInfoServiceImpl implements IProProjectInfoService
proDept.setDeptName(proProjectInfo.getProjectName()); proDept.setDeptName(proProjectInfo.getProjectName());
proDept.setDeptShortName(proProjectInfo.getSimpleName()); proDept.setDeptShortName(proProjectInfo.getSimpleName());
proDept.setDeptType("4"); proDept.setDeptType("4");
proDept.setComId(sysDept.getComId());
proDept.setOrderNum(100); proDept.setOrderNum(100);
proDept.setLeader(proProjectInfo.getProjectPerson()); proDept.setLeader(proProjectInfo.getProjectPerson());
proDept.setPhone(proProjectInfo.getProjectPersonPhone()); proDept.setPhone(proProjectInfo.getProjectPersonPhone());

View File

@ -5,9 +5,11 @@ import java.util.stream.Collectors;
import javax.validation.Validator; import javax.validation.Validator;
import com.yanzhu.common.core.constant.SecurityConstants; import com.yanzhu.common.core.constant.SecurityConstants;
import com.yanzhu.common.core.domain.R;
import com.yanzhu.common.core.enums.ShiFouEnums; import com.yanzhu.common.core.enums.ShiFouEnums;
import com.yanzhu.common.core.enums.UserTypeEnums; import com.yanzhu.common.core.enums.UserTypeEnums;
import com.yanzhu.common.core.utils.DateUtils; import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.core.web.domain.AjaxResult;
import com.yanzhu.system.api.RemoteProService; import com.yanzhu.system.api.RemoteProService;
import com.yanzhu.system.api.RemoteUserService; import com.yanzhu.system.api.RemoteUserService;
import com.yanzhu.system.api.domain.SysDept; import com.yanzhu.system.api.domain.SysDept;
@ -327,7 +329,8 @@ public class SysUserServiceImpl implements ISysUserService
// 是项目单位时,将人员信息加入到花名册 // 是项目单位时,将人员信息加入到花名册
if(StringUtils.isNotEmpty(sysDept.getDeptType()) && Objects.equals(sysDept.getDeptType(),"4")){ if(StringUtils.isNotEmpty(sysDept.getDeptType()) && Objects.equals(sysDept.getDeptType(),"4")){
Map<String, Object> data = packageSubDeptUsers(user,sysDept); Map<String, Object> data = packageSubDeptUsers(user,sysDept);
remoteProService.syspushSubDeptsUser(data, SecurityConstants.INNER); R<AjaxResult> res= remoteProService.syspushSubDeptsUser(data, SecurityConstants.INNER);
} }
} }
}catch (Exception e){ }catch (Exception e){

View File

@ -513,7 +513,6 @@ function doSubDeptChange(type) {
} }
function doDeptGroupChange() { function doDeptGroupChange() {
debugger
data.isManager = false data.isManager = false
if (!form.value.subDeptGroup) { if (!form.value.subDeptGroup) {
form.value.groupName = ""; form.value.groupName = "";
@ -699,7 +698,6 @@ function imgUrl(url) {
function submitForm() { function submitForm() {
proxy.$refs["proProjectInfoSubdeptsUsersRef"].validate(valid => { proxy.$refs["proProjectInfoSubdeptsUsersRef"].validate(valid => {
if (valid) { if (valid) {
debugger
let depts = data.subdepts.filter(d => d.id == form.value.subDeptId); let depts = data.subdepts.filter(d => d.id == form.value.subDeptId);
let groups = data.deptGroups.filter(d => d.id == form.value.subDeptGroup); let groups = data.deptGroups.filter(d => d.id == form.value.subDeptGroup);
let info = { let info = {

View File

@ -135,7 +135,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="用户类型" prop="userType"> <el-form-item label="用户类型" prop="userType">
<el-select v-model="form.userType" placeholder="请选择用户类型" style="width: 100%"> <el-select v-model="form.userType" placeholder="请选择用户类型" style="width: 100%" @change="doRoleChange">
<el-option v-for="dict in sys_user_type" :key="dict.value" :label="dict.label" <el-option v-for="dict in sys_user_type" :key="dict.value" :label="dict.label"
:value="dict.value" /> :value="dict.value" />
</el-select> </el-select>
@ -179,7 +179,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="用户角色" prop="roleIds"> <el-form-item label="用户角色" prop="roleIds">
<el-select v-model="form.roleIds" multiple placeholder="请选择用户角色" style="width:100%"> <el-select v-model="form.roleIds" multiple placeholder="请选择用户角色" style="width:100%" >
<el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName"
:value="item.roleId" :disabled="item.status == 1"></el-option> :value="item.roleId" :disabled="item.status == 1"></el-option>
</el-select> </el-select>
@ -331,6 +331,31 @@ function getDeptTree() {
defaultEK.value.push(response.data[0].id); defaultEK.value.push(response.data[0].id);
}); });
}; };
function doRoleChange(){
if(form.value.userType==99){
data.rules={
deptId: [{ required: true, message: "所属单位不能为空", trigger: "change" }],
userName: [{ required: true, message: "用户名称不能为空", trigger: "blur" }, { min: 2, max: 20, message: "用户名称长度必须介于 2 和 20 之间", trigger: "blur" }],
nickName: [{ required: true, message: "用户名称不能为空", trigger: "blur" }],
userType: [{ required: true, message: "用户类型不能为空", trigger: "change" }],
password: [{ required: true, message: "用户密码不能为空", trigger: "blur" }, { min: 5, max: 20, message: "用户密码长度必须介于 5 和 20 之间", trigger: "blur" }],
phonenumber: [{ required: true, message: "手机号码不能为空", trigger: "blur" }, { pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }],
cardCode: [{ required: true, message: "用户名称不能为空", trigger: "blur" }],
avatar: [{ required: true, message: "入场近照不能为空", trigger: "change" }],
roleIds: [{ required: true, message: "用户角色不能为空", trigger: "change" }],
}
}else{
data.rules={
deptId: [{ required: true, message: "所属单位不能为空", trigger: "change" }],
userName: [{ required: true, message: "用户名称不能为空", trigger: "blur" }, { min: 2, max: 20, message: "用户名称长度必须介于 2 和 20 之间", trigger: "blur" }],
nickName: [{ required: true, message: "用户名称不能为空", trigger: "blur" }],
userType: [{ required: true, message: "用户类型不能为空", trigger: "change" }],
password: [{ required: true, message: "用户密码不能为空", trigger: "blur" }, { min: 5, max: 20, message: "用户密码长度必须介于 5 和 20 之间", trigger: "blur" }],
phonenumber: [{ required: true, message: "手机号码不能为空", trigger: "blur" }, { pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }]
}
}
}
/** 查询用户列表 */ /** 查询用户列表 */
function getList() { function getList() {
loading.value = true; loading.value = true;

View File

@ -44,8 +44,8 @@ export default defineConfig(({ mode, command }) => {
rewrite: (p) => p.replace(/^\/dev-api/, '') rewrite: (p) => p.replace(/^\/dev-api/, '')
}, },
'/statics': { '/statics': {
//target: `http://localhost:9300`, target: `http://localhost:9300`,
target: 'http://62.234.3.186', //target: 'http://62.234.3.186',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
"^/statics": "/", "^/statics": "/",