From 049a04bcc7e82edecc0aecabc439426794590efc Mon Sep 17 00:00:00 2001 From: haha Date: Sun, 9 Feb 2025 21:56:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E8=A1=A8=E4=B8=AD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=BA=E5=91=98=E5=B2=97=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yanzhu/system/api/domain/SysUser.java | 10 +++ .../domain/ProProjectInfoSubdeptsUsers.java | 10 +++ .../com/yanzhu/system/domain/SysUserExt.java | 10 +++ .../ProProjectInfoSubdeptsUsersMapper.xml | 7 +- .../mapper/system/SysUserExtMapper.xml | 7 +- .../resources/mapper/system/SysUserMapper.xml | 16 ++-- ...roProjectInfoSubdeptsUsersServiceImpl.java | 1 + .../manage/service/impl/UniServiceImpl.java | 2 +- .../service/impl/SysUserExtServiceImpl.java | 1 + .../service/impl/SysUserServiceImpl.java | 17 +++- yanzhu-ui-vue3/src/api/system/user.js | 1 + .../src/components/DictTag/index.vue | 4 +- .../proProjectInfoSubdeptsUsers/index.vue | 52 +++++++++-- .../src/views/system/user/index.vue | 89 +++++++++++++++---- 14 files changed, 194 insertions(+), 33 deletions(-) diff --git a/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysUser.java b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysUser.java index 4ef7a0ea..d569cefe 100644 --- a/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysUser.java +++ b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysUser.java @@ -113,6 +113,16 @@ public class SysUser extends BaseEntity /** 角色ID */ private Long roleId; + private Long workType; + + public Long getWorkType() { + return workType; + } + + public void setWorkType(Long workType) { + this.workType = workType; + } + /** * 用于修改 */ diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsUsers.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsUsers.java index f727343d..370a4a9b 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsUsers.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsUsers.java @@ -46,6 +46,16 @@ public class ProProjectInfoSubdeptsUsers extends BaseEntity @Excel(name = "单位类型") private String subDeptTypeName; + private Long workType; + + public Long getWorkType() { + return workType; + } + + public void setWorkType(Long workType) { + this.workType = workType; + } + /** * 用户岗位&&判断用户权限--- */ diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/system/domain/SysUserExt.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/system/domain/SysUserExt.java index 44d4aa3b..144b4ae4 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/system/domain/SysUserExt.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/system/domain/SysUserExt.java @@ -29,6 +29,16 @@ public class SysUserExt extends BaseEntity @Excel(name = "用户类型", readConverterExp = "0=0系统用户") private String userType; + private Long workType; + + public Long getWorkType() { + return workType; + } + + public void setWorkType(Long workType) { + this.workType = workType; + } + private Long comId; public Long getComId() { diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml index b32535de..2cc90d2e 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml @@ -22,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -57,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select psu.id, psu.par_id, psu.com_id, psu.project_id, pi.project_name, psu.sub_dept_id, psu.sub_dept_type, dic3.dict_label as sub_dept_type_name, psu.sub_dept_name, psu.sub_dept_power_path, psu.user_id, psu.user_post, psu.sub_dept_group, psu.sub_dept_group_name, psu.user_name, psu.card_type, psu.card_code, psu.user_sex, psu.user_picture, psu.user_phone, psu.degree_grade, dic4.dict_label as degree_grade_name, psu.user_infos, psu.craft_type, dic1.dict_label as craft_type_name, psu.craft_post, dic2.dict_label as craft_post_name, psu.edu_status, psu.edu_file_path, psu.edu_date, psu.approve_status, psu.use_date, psu.use_status, psu.admit_guid, psu.qr_code, psu.sub_step, psu.illness_status, psu.sup_illness_status, psu.is_del, psu.create_by, psu.create_time, psu.update_by, psu.update_time, - psu.remark,psu.face_guid,sd.dept_name com_name + psu.remark,psu.face_guid,sd.dept_name com_name,psu.work_type from pro_project_info_subdepts_users psu left join pro_project_info pi on pi.id = psu.project_id left join sys_dept sd on sd.dept_id = pi.com_id @@ -80,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and psu.user_post = #{userPost} and psu.sub_dept_group = #{subDeptGroup} and psu.sub_dept_group_name like concat('%', #{subDeptGroupName}, '%') + and psu.work_type = #{workType} and psu.craft_type = #{craftType} and psu.craft_post = #{craftPost} and psu.edu_status = #{eduStatus} @@ -125,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sub_dept_group_name, user_name, card_type, + work_type, card_code, user_sex, user_picture, @@ -166,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{subDeptGroupName}, #{userName}, #{cardType}, + #{workType}, #{cardCode}, #{userSex}, #{userPicture}, @@ -211,6 +215,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sub_dept_group_name = #{subDeptGroupName}, user_name = #{userName}, card_type = #{cardType}, + work_type = #{workType}, card_code = #{cardCode}, user_sex = #{userSex}, user_picture = #{userPicture}, diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/system/SysUserExtMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/system/SysUserExtMapper.xml index 3ba65353..d888a126 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/system/SysUserExtMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/system/SysUserExtMapper.xml @@ -9,18 +9,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select user_id, project_id, status, user_type,com_id,is_active from sys_user_ext + select user_id, project_id, status,work_type, user_type,com_id,is_active from sys_user_ext - select u.user_id, u.com_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, + select u.user_id, u.com_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status,ex.user_type,ex.work_type, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u left join sys_dept d on u.dept_id = d.dept_id + left join sys_user_ext ex on u.user_id=ex.user_id where u.del_flag = '0' AND u.user_id = #{userId} @@ -113,11 +116,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select pi.com_id, sd.dept_name as com_name, pu.project_id, pi.project_name from pro_project_info_subdepts_users pu + select pi.com_id, sd.dept_name as com_name, pu.project_id, pi.project_name + from pro_project_info_subdepts_users pu left join pro_project_info pi on pi.id = pu.project_id left join sys_dept sd on sd.dept_id = pi.com_id where pu.user_id=#{userId} and pu.approve_status = ]]> 100 and pu.is_del=0 and pu.use_status=0 order by pu.sort_by asc diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java index 615af13f..d14424ef 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java @@ -188,6 +188,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu } sysUser.setActiveProjectId(proProjectInfoSubdeptsUsers.getProjectId()); + sysUser.setWorkType(proProjectInfoSubdeptsUsers.getWorkType()); R obj= remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER); Long userId= obj.getData(); diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/UniServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/UniServiceImpl.java index f42b2348..bdd45a7d 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/UniServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/UniServiceImpl.java @@ -515,7 +515,7 @@ public class UniServiceImpl implements IUniService{ faceJo.put("admitGuid",admitGuid); puser.setAdmitGuid(admitGuid); String url=puser.getUserPicture(); - if(!url.startsWith("http")){ + if(!StringUtils.isBlank(url) && !url.startsWith("http")){ url="http://62.234.3.186"+url; } faceJo.put("url",url); diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysUserExtServiceImpl.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysUserExtServiceImpl.java index f65e4750..c283fbcc 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysUserExtServiceImpl.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysUserExtServiceImpl.java @@ -85,6 +85,7 @@ public class SysUserExtServiceImpl implements ISysUserExtService List userExts=sysUserExtMapper.selectSysUserExtList(where); where.setProjectId(sysUser.getDeptId()); where.setIsActive(userExts.size()==0?1l:0l); + where.setWorkType(sysUser.getWorkType()); SysUserExt old=selectSysUserExtById(where); if(Objects.nonNull(old)){ old.setUserType(sysUser.getUserType()); 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 87e45ed7..c53e2093 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 @@ -393,7 +393,9 @@ public class SysUserServiceImpl implements ISysUserService }else{//此电话号码未注册 user.setCreateBy(user.getUpdateBy()); user.setCreateTime(user.getUpdateTime()); - user.setUserType("99"); + if(StringUtils.isBlank(user.getUserType())) { + user.setUserType("99"); + } rows=userMapper.insertUser(user); user.setIsActive(1l); if(isPrjUser) { @@ -436,6 +438,7 @@ public class SysUserServiceImpl implements ISysUserService data.put("userId",user.getUserId()); data.put("userName",user.getNickName()); data.put("cardType","1"); + data.put("workType",user.getWorkType()); data.put("cardCode",user.getCardCode()); data.put("userSex",user.getSex()); data.put("userPicture",user.getAvatar()); @@ -467,6 +470,7 @@ public class SysUserServiceImpl implements ISysUserService user.setCreateBy(user.getUpdateBy()); user.setCreateTime(user.getUpdateTime()); user.setUserType("99"); + user.setWorkType(user.getWorkType()); userMapper.insertUser(user); try { String maOpenId = Convert.toStr(redisService.getCacheObject("SysUserUniopen::"+user.getPhonenumber()),null); @@ -496,6 +500,7 @@ public class SysUserServiceImpl implements ISysUserService SysUserExt where=new SysUserExt(); where.setUserId(user.getUserId()); where.setComId(user.getComId()); + where.setWorkType(user.getWorkType()); List userExts=userExtService.selectSysUserExtList(where); if(userExts.size()==0){ where.setIsActive(1l); @@ -678,7 +683,15 @@ public class SysUserServiceImpl implements ISysUserService throw new ServiceException("所属单位选择异常,必须选择子公司及下属单位"); } user.setComId(dept.getComId()); - + SysUserExt userExtWhere = new SysUserExt(); + userExtWhere.setUserId(userId); + List extList=userExtService.selectSysUserExtList(userExtWhere); + if(extList.size()>0){ + SysUserExt oldExt=extList.get(0); + oldExt.setWorkType(user.getWorkType()); + oldExt.setUserType(user.getUserType()); + userExtService.updateSysUserExt(oldExt); + } try { if(Objects.equals(user.getUserType(),"99")){ // 根据单位递归查询项目信息 diff --git a/yanzhu-ui-vue3/src/api/system/user.js b/yanzhu-ui-vue3/src/api/system/user.js index 4f059a54..66abf907 100644 --- a/yanzhu-ui-vue3/src/api/system/user.js +++ b/yanzhu-ui-vue3/src/api/system/user.js @@ -45,6 +45,7 @@ export function updateUser(data) { userId:data.userId, userName:data.userName, userType:data.userType, + workType:data.workType, sex:data.sex, status:data.status, postIds:data.postIds, diff --git a/yanzhu-ui-vue3/src/components/DictTag/index.vue b/yanzhu-ui-vue3/src/components/DictTag/index.vue index 4806fdb4..a5f96e8e 100644 --- a/yanzhu-ui-vue3/src/components/DictTag/index.vue +++ b/yanzhu-ui-vue3/src/components/DictTag/index.vue @@ -9,12 +9,12 @@ :class="item.elTagClass" >{{ item.label + " " }} - {{ item.label + " " }} diff --git a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue index 4ea2738c..d006fab5 100644 --- a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue +++ b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue @@ -181,15 +181,31 @@
+ + + minlength="11" maxlength="11" style="width: 150px;" /> + style="width: 150px;" /> 查询 此电话号码将用作登录 + + + + + + + + + + + +
@@ -280,7 +296,9 @@ import useUserStore from '@/store/modules/user' import dayjs from 'dayjs' const userStore = useUserStore() const { proxy } = getCurrentInstance(); -const { sys_use_status, pro_craft_type, sys_is_del, pro_craft_post, certificate_type, educational_type,sys_user_sex } = proxy.useDict('sys_use_status', 'pro_craft_type', 'sys_is_del', 'pro_craft_post', 'certificate_type', 'educational_type','sys_user_sex'); +const { sys_use_status, pro_craft_type, sys_is_del, pro_craft_post, certificate_type, educational_type,sys_user_sex,user_work_type } = +proxy.useDict('sys_use_status', 'pro_craft_type', 'sys_is_del', 'pro_craft_post', 'certificate_type', +'educational_type','sys_user_sex','user_work_type'); const proProjectInfoSubdeptsUsersList = ref([]); const open = ref(false); @@ -324,10 +342,13 @@ const data = reactive({ illnessStatus: null, supIllnessStatus: null, isDel: null, + userWorkType:null, + workType:null, }, rules: { subDeptId: [{ required: true, trigger: ['blur', 'change'], message: "请选择所属单位" }], userName: [{ required: true, trigger: ['blur', 'change'], message: "请输入姓名" }], + workType: [{ required: true, trigger: ['blur', 'change'], message: "请选择用户岗位" }], userPhone: [ { required: true, trigger: ['blur', 'change'], message: "请输入手机号码" }, { min: 11, max: 11, message: '请输入有效手机号码', trigger: 'blur' }, @@ -349,6 +370,9 @@ const data = reactive({ mode: '', editData: null, craftPostList:[], + prjWorkTypeObj:{}, + prjWorkCategories:[],//项目人员岗位大类 + prjWorkTypes:[],//项目人员岗位类型 }); const { queryParams, form, rules } = toRefs(data); @@ -366,7 +390,9 @@ function handleEnter(row) { }); } } - +function doWorkTypeChange(){ + data.prjWorkTypes = data.prjWorkTypeObj[form.value.userWorkType] +} //批量入场,批量离场 function handleBatchEnterState(state) { if (ids.value.length == 0) { @@ -820,7 +846,23 @@ function handleExport() { ...queryParams.value }, `proProjectInfoSubdeptsUsers_${new Date().getTime()}.xlsx`) } -loadSubDepts(); +function getUserWorkType(){ + let obj={}; + user_work_type.value.filter(d=>d.elTagClass=="项目人员").forEach(d=>{ + let bigType=d.remark; + d.value=""+d.value; + if(!obj[bigType]){ + obj[bigType]=[]; + data.prjWorkCategories.push(bigType); + } + obj[bigType].push(d); + }); + data.prjWorkTypeObj=obj; +} + +loadSubDepts(()=>{ + getUserWorkType(); +}); getList();