From af4cfe9ff8c9edde06c7afa002eb09e54082e10f Mon Sep 17 00:00:00 2001 From: haha Date: Wed, 8 Jan 2025 00:24:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=E5=91=98=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yanzhu/manage/domain/ProDept.java | 9 ++++++ .../mapper/manage/ProProjectInfoMapper.xml | 3 ++ .../impl/ProProjectInfoServiceImpl.java | 1 + .../service/impl/SysUserServiceImpl.java | 5 +++- .../proProjectInfoSubdeptsUsers/index.vue | 2 -- .../src/views/system/user/index.vue | 29 +++++++++++++++++-- yanzhu-ui-vue3/vite.config.js | 4 +-- 7 files changed, 46 insertions(+), 7 deletions(-) diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProDept.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProDept.java index bf135ce8..af053cb1 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProDept.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProDept.java @@ -9,6 +9,9 @@ public class ProDept extends BaseEntity /** 部门ID */ private Long deptId; + + + private Long comId; /** 父部门ID */ private Long parentId; @@ -38,7 +41,13 @@ public class ProDept extends BaseEntity /** 联系电话 */ private String phone; + public Long getComId() { + return comId; + } + public void setComId(Long comId) { + this.comId = comId; + } public Long getDeptId() { return deptId; } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoMapper.xml index 0ad3a2dc..84cbf06b 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoMapper.xml @@ -300,6 +300,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into sys_dept( parent_id, + com_id, ancestors, dept_name, dept_short_name, @@ -313,6 +314,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time )values( #{parentId}, + #{comId}, #{ancestors}, #{deptName}, #{deptShortName}, @@ -331,6 +333,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update sys_dept parent_id = #{parentId}, + com_id = #{comId}, ancestors = #{ancestors}, dept_name = #{deptName}, dept_short_name = #{deptShortName}, diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoServiceImpl.java index 951224b7..4d021b51 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoServiceImpl.java @@ -143,6 +143,7 @@ public class ProProjectInfoServiceImpl implements IProProjectInfoService proDept.setDeptName(proProjectInfo.getProjectName()); proDept.setDeptShortName(proProjectInfo.getSimpleName()); proDept.setDeptType("4"); + proDept.setComId(sysDept.getComId()); proDept.setOrderNum(100); proDept.setLeader(proProjectInfo.getProjectPerson()); proDept.setPhone(proProjectInfo.getProjectPersonPhone()); diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysUserServiceImpl.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysUserServiceImpl.java index 10ec95e6..98e35734 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysUserServiceImpl.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysUserServiceImpl.java @@ -5,9 +5,11 @@ import java.util.stream.Collectors; import javax.validation.Validator; 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.UserTypeEnums; 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.RemoteUserService; 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")){ Map data = packageSubDeptUsers(user,sysDept); - remoteProService.syspushSubDeptsUser(data, SecurityConstants.INNER); + R res= remoteProService.syspushSubDeptsUser(data, SecurityConstants.INNER); + } } }catch (Exception e){ diff --git a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue index 7573f666..8e677b3e 100644 --- a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue +++ b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue @@ -513,7 +513,6 @@ function doSubDeptChange(type) { } function doDeptGroupChange() { - debugger data.isManager = false if (!form.value.subDeptGroup) { form.value.groupName = ""; @@ -699,7 +698,6 @@ function imgUrl(url) { function submitForm() { proxy.$refs["proProjectInfoSubdeptsUsersRef"].validate(valid => { if (valid) { - debugger let depts = data.subdepts.filter(d => d.id == form.value.subDeptId); let groups = data.deptGroups.filter(d => d.id == form.value.subDeptGroup); let info = { diff --git a/yanzhu-ui-vue3/src/views/system/user/index.vue b/yanzhu-ui-vue3/src/views/system/user/index.vue index 24729003..ae1a19a5 100644 --- a/yanzhu-ui-vue3/src/views/system/user/index.vue +++ b/yanzhu-ui-vue3/src/views/system/user/index.vue @@ -135,7 +135,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -331,6 +331,31 @@ function getDeptTree() { 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() { loading.value = true; diff --git a/yanzhu-ui-vue3/vite.config.js b/yanzhu-ui-vue3/vite.config.js index f90127df..125dfb1e 100644 --- a/yanzhu-ui-vue3/vite.config.js +++ b/yanzhu-ui-vue3/vite.config.js @@ -44,8 +44,8 @@ export default defineConfig(({ mode, command }) => { rewrite: (p) => p.replace(/^\/dev-api/, '') }, '/statics': { - //target: `http://localhost:9300`, - target: 'http://62.234.3.186', + target: `http://localhost:9300`, + //target: 'http://62.234.3.186', changeOrigin: true, pathRewrite: { "^/statics": "/",