diff --git a/pom.xml b/pom.xml index 60972cb6..d5b93127 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,7 @@ 0.9.1 8.2.2 4.1.2 + 2.5.1 2.14.2 @@ -143,6 +144,13 @@ ${transmittable-thread-local.version} + + + com.belerweb + pinyin4j + ${pinyin4j.version} + + com.yanzhu diff --git a/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysDept.java b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysDept.java index a7d571d4..54b1f74d 100644 --- a/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysDept.java +++ b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysDept.java @@ -31,6 +31,18 @@ public class SysDept extends BaseEntity /** 部门名称 */ private String deptName; + /** 部门简称 */ + private String deptShortName; + + /** 部门简称 */ + private String deptCode; + + /** 部门详情 */ + private String deptType; + + /** 部门详情 */ + private String deptInfos; + /** 显示顺序 */ private Integer orderNum; @@ -181,6 +193,38 @@ public class SysDept extends BaseEntity this.children = children; } + public String getDeptShortName() { + return deptShortName; + } + + public void setDeptShortName(String deptShortName) { + this.deptShortName = deptShortName; + } + + public String getDeptCode() { + return deptCode; + } + + public void setDeptCode(String deptCode) { + this.deptCode = deptCode; + } + + public String getDeptType() { + return deptType; + } + + public void setDeptType(String deptType) { + this.deptType = deptType; + } + + public String getDeptInfos() { + return deptInfos; + } + + public void setDeptInfos(String deptInfos) { + this.deptInfos = deptInfos; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -188,6 +232,10 @@ public class SysDept extends BaseEntity .append("parentId", getParentId()) .append("ancestors", getAncestors()) .append("deptName", getDeptName()) + .append("deptShortName", getDeptShortName()) + .append("deptCode", getDeptCode()) + .append("deptType", getDeptType()) + .append("deptInfos", getDeptInfos()) .append("orderNum", getOrderNum()) .append("leader", getLeader()) .append("phone", getPhone()) diff --git a/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysRole.java b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysRole.java index afaf1e03..2ce3968a 100644 --- a/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysRole.java +++ b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysRole.java @@ -1,5 +1,6 @@ package com.yanzhu.system.api.domain; +import java.util.List; import java.util.Set; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -58,12 +59,17 @@ public class SysRole extends BaseEntity /** 菜单组 */ private Long[] menuIds; + /** 部门主键 */ + private Long deptId; + /** 部门组(数据权限) */ private Long[] deptIds; /** 角色菜单权限 */ private Set permissions; + private List roleDeptList; + public SysRole() { @@ -219,6 +225,22 @@ public class SysRole extends BaseEntity this.permissions = permissions; } + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public List getRoleDeptList() { + return roleDeptList; + } + + public void setRoleDeptList(List roleDeptList) { + this.roleDeptList = roleDeptList; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/domain/SysRoleDept.java b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysRoleDept.java similarity index 77% rename from yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/domain/SysRoleDept.java rename to yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysRoleDept.java index 8199cf07..fe84fd10 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/domain/SysRoleDept.java +++ b/yanzhu-api/yanzhu-api-system/src/main/java/com/yanzhu/system/api/domain/SysRoleDept.java @@ -1,4 +1,4 @@ -package com.yanzhu.system.domain; +package com.yanzhu.system.api.domain; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -16,6 +16,9 @@ public class SysRoleDept /** 部门ID */ private Long deptId; + /** 部门名称 */ + private String deptName; + public Long getRoleId() { return roleId; @@ -36,6 +39,14 @@ public class SysRoleDept this.deptId = deptId; } + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 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 3c0fe041..be77b67a 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 @@ -37,6 +37,22 @@ public class SysUser extends BaseEntity @Excel(name = "用户名称") private String nickName; + /** 用户类型 */ + @Excel(name = "用户类型") + private String userType; + + /** 证件类型 */ + @Excel(name = "证件类型") + private String cardType; + + /** 证件号码 */ + @Excel(name = "证件号码") + private String cardCode; + + /** 用户详情 */ + @Excel(name = "用户详情") + private String userInfos; + /** 用户邮箱 */ @Excel(name = "用户邮箱") private String email; @@ -129,6 +145,19 @@ public class SysUser extends BaseEntity this.deptId = deptId; } + @Xss(message = "用户账号不能包含脚本字符") + @NotBlank(message = "用户账号不能为空") + @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") + public String getUserName() + { + return userName; + } + + public void setUserName(String userName) + { + this.userName = userName; + } + @Xss(message = "用户昵称不能包含脚本字符") @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符") public String getNickName() @@ -141,17 +170,36 @@ public class SysUser extends BaseEntity this.nickName = nickName; } - @Xss(message = "用户账号不能包含脚本字符") - @NotBlank(message = "用户账号不能为空") - @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") - public String getUserName() - { - return userName; + public String getUserType() { + return userType; } - public void setUserName(String userName) - { - this.userName = userName; + public void setUserType(String userType) { + this.userType = userType; + } + + public String getCardType() { + return cardType; + } + + public void setCardType(String cardType) { + this.cardType = cardType; + } + + public String getCardCode() { + return cardCode; + } + + public void setCardCode(String cardCode) { + this.cardCode = cardCode; + } + + public String getUserInfos() { + return userInfos; + } + + public void setUserInfos(String userInfos) { + this.userInfos = userInfos; } @Email(message = "邮箱格式不正确") @@ -296,6 +344,7 @@ public class SysUser extends BaseEntity { this.roleId = roleId; } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -303,6 +352,10 @@ public class SysUser extends BaseEntity .append("deptId", getDeptId()) .append("userName", getUserName()) .append("nickName", getNickName()) + .append("userType", getUserType()) + .append("cardType", getCardType()) + .append("cardCode", getCardCode()) + .append("userInfos", getUserInfos()) .append("email", getEmail()) .append("phonenumber", getPhonenumber()) .append("sex", getSex()) diff --git a/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/web/domain/BaseEntity.java b/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/web/domain/BaseEntity.java index 394281f9..cd717c82 100644 --- a/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/web/domain/BaseEntity.java +++ b/yanzhu-common/yanzhu-common-core/src/main/java/com/yanzhu/common/core/web/domain/BaseEntity.java @@ -41,6 +41,9 @@ public class BaseEntity implements Serializable /** 选中页签 */ private String activeName; + /** 所属单位 */ + private Long activeDeptId; + /** 请求参数 */ @JsonInclude(JsonInclude.Include.NON_EMPTY) private Map params; @@ -126,4 +129,12 @@ public class BaseEntity implements Serializable public void setActiveName(String activeName) { this.activeName = activeName; } + + public Long getActiveDeptId() { + return activeDeptId; + } + + public void setActiveDeptId(Long activeDeptId) { + this.activeDeptId = activeDeptId; + } } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfo.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfo.java index b78fa9f7..eb233864 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfo.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfo.java @@ -22,6 +22,10 @@ public class ProProjectInfo extends BaseEntity @Excel(name = "所属单位") private Long deptId; + /** 单位名称 */ + @Excel(name = "单位名称") + private String deptName; + /** 部门主键 */ @Excel(name = "部门主键") private Long visDeptId; @@ -48,7 +52,7 @@ public class ProProjectInfo extends BaseEntity /** 项目等级 */ @Excel(name = "项目等级") - private String projiectLevel; + private String projectLevel; /** 项目区县 */ @Excel(name = "项目区县") @@ -222,14 +226,14 @@ public class ProProjectInfo extends BaseEntity { return projectType; } - public void setProjiectLevel(String projiectLevel) + public void setprojectLevel(String projectLevel) { - this.projiectLevel = projiectLevel; + this.projectLevel = projectLevel; } - public String getProjiectLevel() + public String getprojectLevel() { - return projiectLevel; + return projectLevel; } public void setProjectRegional(String projectRegional) { @@ -457,6 +461,14 @@ public class ProProjectInfo extends BaseEntity return isDel; } + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -468,7 +480,7 @@ public class ProProjectInfo extends BaseEntity .append("projectCode", getProjectCode()) .append("simpleName", getSimpleName()) .append("projectType", getProjectType()) - .append("projiectLevel", getProjiectLevel()) + .append("projectLevel", getprojectLevel()) .append("projectRegional", getProjectRegional()) .append("projectAddress", getProjectAddress()) .append("projectNature", getProjectNature()) diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdepts.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdepts.java index 09029288..48da6134 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdepts.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdepts.java @@ -22,10 +22,18 @@ public class ProProjectInfoSubdepts extends BaseEntity @Excel(name = "单位主键") private Long deptId; + /** 单位名称 */ + @Excel(name = "单位名称") + private String deptName; + /** 项目主键 */ @Excel(name = "项目主键") private Long projectId; + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + /** 分包单位 */ @Excel(name = "分包单位") private Long subDeptId; @@ -210,6 +218,22 @@ public class ProProjectInfoSubdepts extends BaseEntity return isDel; } + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsGroup.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsGroup.java index 5d01d05a..1ad26027 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsGroup.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoSubdeptsGroup.java @@ -22,6 +22,10 @@ public class ProProjectInfoSubdeptsGroup extends BaseEntity @Excel(name = "项目主键") private Long projectId; + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + /** 分包单位 */ @Excel(name = "分包单位") private Long subDeptId; @@ -236,6 +240,14 @@ public class ProProjectInfoSubdeptsGroup extends BaseEntity return isDel; } + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 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 fd186276..ab46d9bc 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 @@ -25,6 +25,10 @@ public class ProProjectInfoSubdeptsUsers extends BaseEntity @Excel(name = "项目主键") private Long projectId; + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + /** 分包单位 */ @Excel(name = "分包单位") private Long subDeptId; @@ -253,6 +257,14 @@ public class ProProjectInfoSubdeptsUsers extends BaseEntity return isDel; } + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoUsers.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoUsers.java index 7407a3ac..23f1aa51 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoUsers.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProProjectInfoUsers.java @@ -22,10 +22,18 @@ public class ProProjectInfoUsers extends BaseEntity @Excel(name = "单位主键") private Long deptId; + /** 单位名称 */ + @Excel(name = "单位名称") + private String deptName; + /** 项目主键 */ @Excel(name = "项目主键") private Long projectId; + /** 项目名称 */ + @Excel(name = "项目名称") + private String projectName; + /** 用户主键 */ @Excel(name = "用户主键") private Long userId; @@ -132,6 +140,22 @@ public class ProProjectInfoUsers extends BaseEntity return isDel; } + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoDeptsMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoDeptsMapper.xml index 3e0ce8cf..7992474c 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoDeptsMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoDeptsMapper.xml @@ -22,15 +22,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select pd.id, pd.project_id, pi.project_name, pd.dept_type, pd.dept_name, pd.dept_code, pd.is_del, pd.create_by, pd.create_time, pd.update_by, pd.update_time, pd.remark from pro_project_info_depts pd left join pro_project_info pi on pi.id = pd.project_id + left join sys_dept sd on sd.dept_id = pi.dept_id - + + and sd.dept_id = #{activeDeptId} and pd.project_id = #{projectId} + and pi.project_name like concat('%', #{projectName}, '%') and pd.dept_type = #{deptType} and pd.dept_name like concat('%', #{deptName}, '%') - and pi.project_name like concat('%', #{projectName}, '%') and pd.dept_code = #{deptCode} and pd.is_del = #{isDel} 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 978f8334..c99578a8 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 @@ -7,13 +7,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - + @@ -47,30 +48,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, dept_id, vis_dept_id, dis_dept_id, project_name, project_code, simple_name, project_type, projiect_level, project_regional, project_address, project_nature, licence_number, project_person, project_person_phone, longitude, latitude, project_time_limit, total_investment, floor_area, total_output_value, planned_completion_time, scheduled_start_time, actual_operating_time, actual_completion_time, contract_amount, paid_amount, on_account_amount, project_schedule, project_summarize, project_qr_code, project_status, project_sort, is_del, create_by, create_time, update_by, update_time, remark from pro_project_info + select pi.id, pi.dept_id, sd.dept_name, pi.vis_dept_id, pi.dis_dept_id, pi.project_name, pi.project_code, pi.simple_name, pi.project_type, pi.project_level, pi.project_regional, pi.project_address, pi.project_nature, pi.licence_number, pi.project_person, pi.project_person_phone, pi.longitude, pi.latitude, pi.project_time_limit, pi.total_investment, pi.floor_area, pi.total_output_value, pi.planned_completion_time, pi.scheduled_start_time, pi.actual_operating_time, pi.actual_completion_time, pi.contract_amount, pi.paid_amount, pi.on_account_amount, pi.project_schedule, pi.project_summarize, pi.project_qr_code, pi.project_status, pi.project_sort, pi.is_del, pi.create_by, pi.create_time, pi.update_by, pi.update_time, pi.remark from pro_project_info pi + left join sys_dept sd on sd.dept_id = pi.dept_id - and dept_id = #{deptId} - and vis_dept_id = #{visDeptId} - and dis_dept_id = #{disDeptId} - and project_name like concat('%', #{projectName}, '%') - and project_code = #{projectCode} - and simple_name like concat('%', #{simpleName}, '%') - and project_type = #{projectType} - and projiect_level = #{projiectLevel} - and project_person = #{projectPerson} - and project_person_phone = #{projectPersonPhone} - and project_status = #{projectStatus} - and is_del = #{isDel} + and pi.dept_id = #{deptId} + and pi.vis_dept_id = #{visDeptId} + and pi.dis_dept_id = #{disDeptId} + and sd.dept_id = #{activeDeptId} + and pi.project_name like concat('%', #{projectName}, '%') + and pi.project_code = #{projectCode} + and pi.simple_name like concat('%', #{simpleName}, '%') + and pi.project_type = #{projectType} + and pi.project_level = #{projectLevel} + and pi.project_person = #{projectPerson} + and pi.project_person_phone = #{projectPersonPhone} + and pi.project_status = #{projectStatus} + and pi.is_del = #{isDel} + order by id project_sort, id desc - where id = #{id} + where pi.id = #{id} @@ -83,7 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" project_code, simple_name, project_type, - projiect_level, + project_level, project_regional, project_address, project_nature, @@ -123,7 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{projectCode}, #{simpleName}, #{projectType}, - #{projiectLevel}, + #{projectLevel}, #{projectRegional}, #{projectAddress}, #{projectNature}, @@ -167,7 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" project_code = #{projectCode}, simple_name = #{simpleName}, project_type = #{projectType}, - projiect_level = #{projiectLevel}, + project_level = #{projectLevel}, project_regional = #{projectRegional}, project_address = #{projectAddress}, project_nature = #{projectNature}, diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSettingMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSettingMapper.xml index aec269fd..04ca98a3 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSettingMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSettingMapper.xml @@ -24,14 +24,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select ps.id, ps.project_id, pi.project_name, ps.org_name, ps.org_logo, ps.org_image, ps.org_video, ps.org_plane, ps.is_del, ps.create_by, ps.create_time, ps.update_by, ps.update_time, ps.remark from pro_project_info_setting ps left join pro_project_info pi on pi.id = ps.project_id + left join sys_dept sd on sd.dept_id = pi.dept_id - + + and sd.dept_id = #{activeDeptId} and ps.project_id = #{projectId} - and ps.org_name like concat('%', #{orgName}, '%') and pi.project_name like concat('%', #{projectName}, '%') + and ps.org_name like concat('%', #{orgName}, '%') and ps.is_del = #{isDel} diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroupMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroupMapper.xml index b9e28547..34b8edf1 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroupMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroupMapper.xml @@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -30,34 +31,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, project_id, sub_dept_id, sub_dept_type, sub_dept_name, sub_dept_code, group_name, group_code, craft_type, craft_post, group_leader_name, group_leader_code, group_leader_phone, use_status, approve_status, qr_code, is_del, create_by, create_time, update_by, update_time, remark from pro_project_info_subdepts_group + select psg.id, psg.project_id, pi.project_name, psg.sub_dept_id, psg.sub_dept_type, psg.sub_dept_name, psg.sub_dept_code, psg.group_name, psg.group_code, psg.craft_type, psg.craft_post, psg.group_leader_name, psg.group_leader_code, psg.group_leader_phone, psg.use_status, psg.approve_status, psg.qr_code, psg.is_del, psg.create_by, psg.create_time, psg.update_by, psg.update_time, psg.remark from pro_project_info_subdepts_group psg + left join pro_project_info pi on pi.id = psg.project_id + left join sys_dept sd on sd.dept_id = pi.dept_id - - and project_id = #{projectId} - and sub_dept_id = #{subDeptId} - and sub_dept_type = #{subDeptType} - and sub_dept_name like concat('%', #{subDeptName}, '%') - and sub_dept_code = #{subDeptCode} - and group_name like concat('%', #{groupName}, '%') - and group_code = #{groupCode} - and craft_type = #{craftType} - and craft_post = #{craftPost} - and group_leader_name like concat('%', #{groupLeaderName}, '%') - and group_leader_code = #{groupLeaderCode} - and group_leader_phone = #{groupLeaderPhone} - and use_status = #{useStatus} - and approve_status = #{approveStatus} - and qr_code = #{qrCode} - and is_del = #{isDel} + + and sd.dept_id = #{activeDeptId} + and psg.project_id = #{projectId} + and pi.project_name like concat('%', #{projectName}, '%') + and psg.sub_dept_id = #{subDeptId} + and psg.sub_dept_type = #{subDeptType} + and psg.sub_dept_name like concat('%', #{subDeptName}, '%') + and psg.sub_dept_code = #{subDeptCode} + and psg.group_name like concat('%', #{groupName}, '%') + and psg.group_code = #{groupCode} + and psg.craft_type = #{craftType} + and psg.craft_post = #{craftPost} + and psg.group_leader_name like concat('%', #{groupLeaderName}, '%') + and psg.group_leader_code = #{groupLeaderCode} + and psg.group_leader_phone = #{groupLeaderPhone} + and psg.use_status = #{useStatus} + and psg.approve_status = #{approveStatus} + and psg.is_del = #{isDel} - where id = #{id} + where psg.id = #{id} diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsMapper.xml index 9e272e8a..848f2abb 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsMapper.xml @@ -7,7 +7,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -28,32 +30,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, dept_id, project_id, sub_dept_id, sub_dept_type, sub_dept_name, sub_dept_code, sub_dept_leader_id, sub_dept_leader_name, sub_dept_leader_code, sub_dept_leader_phone, use_status, approve_status, qr_code, is_del, create_by, create_time, update_by, update_time, remark from pro_project_info_subdepts + select ps.id, dept_id, sd.dept_name, ps.project_id, pi.project_name, ps.sub_dept_id, ps.sub_dept_type, ps.sub_dept_name, ps.sub_dept_code, ps.sub_dept_leader_id, ps.sub_dept_leader_name, ps.sub_dept_leader_code, ps.sub_dept_leader_phone, ps.use_status, ps.approve_status, ps.qr_code, ps.is_del, ps.create_by, ps.create_time, ps.update_by, ps.update_time, ps.remark from pro_project_info_subdepts ps + left join pro_project_info pi on pi.id = ps.project_id + left join sys_dept sd on sd.dept_id = pi.dept_id - and dept_id = #{deptId} - and project_id = #{projectId} - and sub_dept_id = #{subDeptId} - and sub_dept_type = #{subDeptType} - and sub_dept_name like concat('%', #{subDeptName}, '%') - and sub_dept_code = #{subDeptCode} - and sub_dept_leader_id = #{subDeptLeaderId} - and sub_dept_leader_name like concat('%', #{subDeptLeaderName}, '%') - and sub_dept_leader_code = #{subDeptLeaderCode} - and sub_dept_leader_phone = #{subDeptLeaderPhone} - and use_status = #{useStatus} - and approve_status = #{approveStatus} - and qr_code = #{qrCode} - and is_del = #{isDel} + and ps.dept_id = #{deptId} + and sd.dept_id = #{activeDeptId} + and ps.project_id = #{projectId} + and pi.project_name like concat('%', #{projectName}, '%') + and ps.sub_dept_id = #{subDeptId} + and ps.sub_dept_type = #{subDeptType} + and ps.sub_dept_name like concat('%', #{subDeptName}, '%') + and ps.sub_dept_code = #{subDeptCode} + and ps.sub_dept_leader_id = #{subDeptLeaderId} + and ps.sub_dept_leader_name like concat('%', #{subDeptLeaderName}, '%') + and ps.sub_dept_leader_code = #{subDeptLeaderCode} + and ps.sub_dept_leader_phone = #{subDeptLeaderPhone} + and ps.use_status = #{useStatus} + and ps.approve_status = #{approveStatus} + and ps.is_del = #{isDel} + order by ps.id desc - where id = #{id} + where ps.id = #{id} 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 19e4b304..02a5d0bc 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 @@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -31,35 +32,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, project_id, sub_dept_id, sub_dept_name, user_id, user_name, craft_type, craft_post, edu_status, edu_file_path, edu_sign_path, edu_date, approve_status, use_status, sub_step, illness_status, sup_illness_status, is_del, create_by, create_time, update_by, update_time, remark from pro_project_info_subdepts_users + select psu.id, psu.project_id, pi.project_name, psu.sub_dept_id, psu.sub_dept_name, psu.user_id, psu.user_name, psu.craft_type, psu.craft_post, psu.edu_status, psu.edu_file_path, psu.edu_sign_path, psu.edu_date, psu.approve_status, psu.use_status, 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 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.dept_id - - and project_id = #{projectId} - and sub_dept_id = #{subDeptId} - and sub_dept_name like concat('%', #{subDeptName}, '%') - and user_id = #{userId} - and user_name like concat('%', #{userName}, '%') - and craft_type = #{craftType} - and craft_post = #{craftPost} - and edu_status = #{eduStatus} - and edu_file_path = #{eduFilePath} - and edu_sign_path = #{eduSignPath} - and edu_date = #{eduDate} - and approve_status = #{approveStatus} - and use_status = #{useStatus} - and sub_step = #{subStep} - and illness_status = #{illnessStatus} - and sup_illness_status = #{supIllnessStatus} - and is_del = #{isDel} + + and sd.dept_id = #{activeDeptId} + and psu.project_id = #{projectId} + and pi.project_name like concat('%', #{projectName}, '%') + and psu.sub_dept_id = #{subDeptId} + and psu.sub_dept_name like concat('%', #{subDeptName}, '%') + and psu.user_id = #{userId} + and psu.user_name like concat('%', #{userName}, '%') + and psu.craft_type = #{craftType} + and psu.craft_post = #{craftPost} + and psu.edu_status = #{eduStatus} + and psu.approve_status = #{approveStatus} + and psu.use_status = #{useStatus} + and psu.sub_step = #{subStep} + and psu.illness_status = #{illnessStatus} + and psu.sup_illness_status = #{supIllnessStatus} + and psu.is_del = #{isDel} + order by psu.id desc - where id = #{id} + where psu.id = #{id} diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoUsersMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoUsersMapper.xml index 70c6de32..65ec69ab 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoUsersMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoUsersMapper.xml @@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -22,26 +23,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, dept_id, project_id, user_id, user_name, user_code, user_phone, use_status, is_del, create_by, create_time, update_by, update_time, remark from pro_project_info_users + select pu.id, pu.dept_id, sd.dept_name, pu.project_id, pi.project_name, pu.user_id, pu.user_name, pu.user_code, pu.user_phone, pu.use_status, pu.is_del, pu.create_by, pu.create_time, pu.update_by, pu.update_time, pu.remark from pro_project_info_users pu + left join pro_project_info pi on pi.id = pu.project_id + left join sys_dept sd on sd.dept_id = pi.dept_id - - and dept_id = #{deptId} - and project_id = #{projectId} - and user_id = #{userId} - and user_name like concat('%', #{userName}, '%') - and user_code = #{userCode} - and user_phone = #{userPhone} - and use_status = #{useStatus} - and is_del = #{isDel} + + and sd.dept_id = #{activeDeptId} + and pu.dept_id = #{deptId} + and pu.project_id = #{projectId} + and pi.project_name like concat('%', #{projectName}, '%') + and pu.user_id = #{userId} + and pu.user_name like concat('%', #{userName}, '%') + and pu.user_code = #{userCode} + and pu.user_phone = #{userPhone} + and pu.use_status = #{useStatus} + and pu.is_del = #{isDel} + order by pu.id desc - where id = #{id} + where pu.id = #{id} diff --git a/yanzhu-modules/yanzhu-system/pom.xml b/yanzhu-modules/yanzhu-system/pom.xml index cda38909..b3bb669f 100644 --- a/yanzhu-modules/yanzhu-system/pom.xml +++ b/yanzhu-modules/yanzhu-system/pom.xml @@ -78,11 +78,19 @@ com.yanzhu yanzhu-common-swagger + + com.yanzhu yanzhu-common-datascope + + + com.belerweb + pinyin4j + + diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysRoleController.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysRoleController.java index 1f16669a..892a8c91 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysRoleController.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysRoleController.java @@ -245,10 +245,26 @@ public class SysRoleController extends BaseController return ajax; } + /** + * 指定流程办理组列表 + */ @ApiOperation(value = "指定流程办理组列表") @GetMapping("/roleList") public AjaxResult roleList(SysRole role) { List list = roleService.selectRoleList(role); return AjaxResult.success(list); } + + /** + * 根据部门ID查询角色列表 + * @param deptId + * @return + */ + @GetMapping("/deptRole/{deptId}") + public AjaxResult list(@PathVariable("roleId") Long deptId) + { + List list = roleService.findDeptRoleList(deptId); + return success(list); + } + } diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysUserController.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysUserController.java index 3ca6e74d..c8dec51f 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysUserController.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysUserController.java @@ -224,7 +224,7 @@ public class SysUserController extends BaseController @PostMapping public AjaxResult add(@Validated @RequestBody SysUser user) { - if (!userService.checkUserNameUnique(user)) + if (StringUtils.isNotEmpty(user.getUserName()) && !userService.checkUserNameUnique(user)) { return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); } @@ -251,7 +251,7 @@ public class SysUserController extends BaseController { userService.checkUserAllowed(user); userService.checkUserDataScope(user.getUserId()); - if (!userService.checkUserNameUnique(user)) + if (StringUtils.isNotEmpty(user.getUserName()) && !userService.checkUserNameUnique(user)) { return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); } @@ -320,7 +320,7 @@ public class SysUserController extends BaseController { AjaxResult ajax = AjaxResult.success(); SysUser user = userService.selectUserById(userId); - List roles = roleService.selectRolesByUserId(userId); + List roles = roleService.findDeptRoleList(user.getDeptId()); ajax.put("user", user); ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); return ajax; diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/mapper/SysRoleDeptMapper.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/mapper/SysRoleDeptMapper.java index 7253270d..09faae70 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/mapper/SysRoleDeptMapper.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/mapper/SysRoleDeptMapper.java @@ -1,7 +1,7 @@ package com.yanzhu.system.mapper; import java.util.List; -import com.yanzhu.system.domain.SysRoleDept; +import com.yanzhu.system.api.domain.SysRoleDept; /** * 角色与部门关联表 数据层 diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/mapper/SysRoleMapper.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/mapper/SysRoleMapper.java index 261822d2..c03caf6b 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/mapper/SysRoleMapper.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/mapper/SysRoleMapper.java @@ -104,4 +104,12 @@ public interface SysRoleMapper * @return 结果 */ public int deleteRoleByIds(Long[] roleIds); + + /** + * 根据部门ID查询角色列表 + * + * @param deptId 部门ID + * @return 角色列表 + */ + public List findDeptRoleList(Long deptId); } diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/ISysRoleService.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/ISysRoleService.java index 6941bd8a..79b1a6fe 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/ISysRoleService.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/ISysRoleService.java @@ -170,4 +170,12 @@ public interface ISysRoleService * @return 结果 */ public int insertAuthUsers(Long roleId, Long[] userIds); + + /** + * 根据部门ID查询角色列表 + * + * @param deptId 部门ID + * @return 角色列表 + */ + public List findDeptRoleList(Long deptId); } diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysRoleServiceImpl.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysRoleServiceImpl.java index 376803e8..ee6adddc 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysRoleServiceImpl.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/service/impl/SysRoleServiceImpl.java @@ -7,7 +7,7 @@ import java.util.List; import java.util.Set; import com.yanzhu.common.datascope.annotation.DataScope; -import com.yanzhu.system.domain.SysRoleDept; +import com.yanzhu.system.api.domain.SysRoleDept; import com.yanzhu.system.domain.SysRoleMenu; import com.yanzhu.system.domain.SysUserRole; import com.yanzhu.system.mapper.SysRoleDeptMapper; @@ -234,7 +234,12 @@ public class SysRoleServiceImpl implements ISysRoleService { // 新增角色信息 roleMapper.insertRole(role); - return insertRoleMenu(role); + int res = insertRoleMenu(role); + // 角色和部门信息 + if(res>0 && role.getDeptId()!=null){ + insertRoleDept(role); + } + return res; } /** @@ -248,10 +253,15 @@ public class SysRoleServiceImpl implements ISysRoleService public int updateRole(SysRole role) { // 修改角色信息 - roleMapper.updateRole(role); + int res = roleMapper.updateRole(role); // 删除角色与菜单关联 roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId()); - return insertRoleMenu(role); + insertRoleMenu(role); + // 角色和部门信息 + if(res>0 && role.getDeptId()!=null){ + insertRoleDept(role); + } + return res; } /** @@ -281,7 +291,7 @@ public class SysRoleServiceImpl implements ISysRoleService // 删除角色与部门关联 roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId()); // 新增角色和部门信息(数据权限) - return insertRoleDept(role); + return insertRoleDeptList(role); } /** @@ -314,6 +324,27 @@ public class SysRoleServiceImpl implements ISysRoleService * @param role 角色对象 */ public int insertRoleDept(SysRole role) + { + int rows = 1; + // 新增角色与部门(数据权限)管理 + List list = new ArrayList(); + SysRoleDept rd = new SysRoleDept(); + rd.setRoleId(role.getRoleId()); + rd.setDeptId(role.getDeptId()); + list.add(rd); + if (list.size() > 0) + { + rows = roleDeptMapper.batchRoleDept(list); + } + return rows; + } + + /** + * 新增角色部门信息(数据权限) + * + * @param role 角色对象 + */ + public int insertRoleDeptList(SysRole role) { int rows = 1; // 新增角色与部门(数据权限)管理 @@ -422,4 +453,15 @@ public class SysRoleServiceImpl implements ISysRoleService } return userRoleMapper.batchUserRole(list); } + + /** + * 根据部门ID查询角色列表 + * + * @param deptId 部门ID + * @return 角色列表 + */ + @Override + public List findDeptRoleList(Long deptId){ + return roleMapper.findDeptRoleList(deptId); + } } 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 5953b30b..1eb2021d 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 @@ -12,6 +12,8 @@ import com.yanzhu.system.domain.SysUserRole; import com.yanzhu.system.mapper.SysRoleMapper; import com.yanzhu.system.mapper.SysUserMapper; import com.yanzhu.system.mapper.SysUserPostMapper; +import net.sourceforge.pinyin4j.PinyinHelper; +import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -270,6 +272,7 @@ public class SysUserServiceImpl implements ISysUserService public int insertUser(SysUser user) { // 新增用户信息 + user.setUserName(userNameAndCout(user.getNickName())); int rows = userMapper.insertUser(user); // 新增用户岗位关联 insertUserPost(user); @@ -309,9 +312,43 @@ public class SysUserServiceImpl implements ISysUserService userPostMapper.deleteUserPostByUserId(userId); // 新增用户与岗位管理 insertUserPost(user); + //这里不允许修改密码 + user.setPassword(null); return userMapper.updateUser(user); } + /** + * 查询用户名称 + * @param name + * @return + */ + private String userNameAndCout(String name){ + // 设置不带声调的输出选项 + HanyuPinyinOutputFormat format = new net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat(); + format.setToneType(net.sourceforge.pinyin4j.format.HanyuPinyinToneType.WITHOUT_TONE); + + StringBuilder output = new StringBuilder(); + for (char c : name.toCharArray()) { + try { + String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c, format); + if (pinyinArray != null && pinyinArray.length > 0) { + output.append(pinyinArray[0]); + } else { + output.append(c); + } + } catch (Exception e) { + output.append(c); + } + } + SysUser query = new SysUser(); + query.setUserName(output.toString()); + List cout = userMapper.selectUserList(query); + if(StringUtils.isNotEmpty(cout)){ + output.append(String.format("%02d", cout.size())); + } + return output.toString(); + } + /** * 用户授权角色 * diff --git a/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysDeptMapper.xml b/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysDeptMapper.xml index 89ef5fe8..0f7e0c31 100644 --- a/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -9,6 +9,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + @@ -23,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time + select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_short_name, d.dept_code, d.dept_type, d.dept_infos, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time from sys_dept d @@ -31,16 +35,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where d.del_flag = '0' - AND dept_id = #{deptId} + AND d.dept_id = #{deptId} - AND parent_id = #{parentId} + AND d.parent_id = #{parentId} - AND dept_name like concat('%', #{deptName}, '%') + AND d.dept_name like concat('%', #{deptName}, '%') + + + AND d.dept_short_name like concat('%', #{deptShortName}, '%') + + + AND d.dept_type = #{deptType} - AND status = #{status} + AND d.status = #{status} ${params.dataScope} @@ -89,8 +99,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into sys_dept( dept_id, parent_id, + ancestors, dept_name, - ancestors, + dept_short_name, + dept_code, + dept_type, + dept_infos, order_num, leader, phone, @@ -101,8 +115,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" )values( #{deptId}, #{parentId}, + #{ancestors}, #{deptName}, - #{ancestors}, + #{deptShortName}, + #{deptCode}, + #{deptType}, + #{deptInfos}, #{orderNum}, #{leader}, #{phone}, @@ -117,8 +135,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update sys_dept parent_id = #{parentId}, - dept_name = #{deptName}, ancestors = #{ancestors}, + dept_name = #{deptName}, + dept_short_name = #{deptShortName}, + dept_code = #{deptCode}, + dept_type = #{deptType}, + dept_infos = #{deptInfos}, order_num = #{orderNum}, leader = #{leader}, phone = #{phone}, diff --git a/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysRoleMapper.xml b/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysRoleMapper.xml index f2304b03..c519c225 100644 --- a/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysRoleMapper.xml +++ b/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysRoleMapper.xml @@ -20,22 +20,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + + + + + + + + + + + select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, - r.status, r.del_flag, r.create_time, r.remark + r.status, r.del_flag, r.create_time, r.remark, rd.role_id as sub_role_id, rd.dept_id as sub_dept_id, rdd.dept_name as sub_dept_name from sys_role r left join sys_user_role ur on ur.role_id = r.role_id left join sys_user u on u.user_id = ur.user_id left join sys_dept d on u.dept_id = d.dept_id + left join sys_role_dept rd on rd.role_id = r.role_id + left join sys_dept rdd on rd.dept_id = rdd.dept_id - + where r.del_flag = '0' AND r.role_id = #{roleId} + + AND rdd.dept_id = #{deptId} + AND r.role_name like concat('%', #{roleName}, '%') @@ -55,13 +70,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ${params.dataScope} order by r.role_sort + + + select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, + r.status, r.del_flag, r.create_time, r.remark + from sys_role r + left join sys_role_dept rd on rd.role_id = r.role_id + where r.del_flag = '0' and rd.dept_id = ${deptId} + order by r.role_sort + - + WHERE r.del_flag = '0' and ur.user_id = #{userId} - + @@ -73,22 +97,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where u.user_id = #{userId} - + where r.role_id = #{roleId} - + WHERE r.del_flag = '0' and u.user_name = #{userName} - + where r.role_name=#{roleName} and r.del_flag = '0' limit 1 - + where r.role_key=#{roleKey} and r.del_flag = '0' limit 1 diff --git a/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysUserMapper.xml b/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysUserMapper.xml index 66ec36f5..1bef0379 100644 --- a/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/yanzhu-modules/yanzhu-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -9,6 +9,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + @@ -30,8 +34,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - + + + @@ -47,8 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, - d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, + select u.user_id, u.dept_id, u.user_name, u.nick_name, u.user_type, u.card_type, u.card_code, u.user_infos, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, + d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.dept_short_name, d.dept_code, d.dept_type, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status from sys_user u left join sys_dept d on u.dept_id = d.dept_id @@ -57,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, 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 + select u.user_id, u.dept_id, u.nick_name, u.user_name, u.user_type, u.card_type, u.card_code, u.user_infos, u.email, u.avatar, u.phonenumber, u.sex, u.status, 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 where u.del_flag = '0' @@ -66,6 +73,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND u.user_name like concat('%', #{userName}, '%') + + AND u.user_name like concat('%', #{userName}, '%') + + + AND u.nick_name = #{nickName} + + + AND u.card_code like concat('%', #{cardCode}, '%') + AND u.status = #{status} @@ -86,7 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time + select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.user_type, u.card_type, u.card_code, u.email, u.phonenumber, u.status, u.create_time from sys_user u left join sys_dept d on u.dept_id = d.dept_id left join sys_user_role ur on u.user_id = ur.user_id @@ -103,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time + select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.user_type, u.card_type, u.card_code, u.email, u.phonenumber, u.status, u.create_time from sys_user u left join sys_dept d on u.dept_id = d.dept_id left join sys_user_role ur on u.user_id = ur.user_id @@ -152,6 +168,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dept_id, user_name, nick_name, + user_type, + card_type, + card_code, + user_infos, email, avatar, phonenumber, @@ -166,6 +186,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{deptId}, #{userName}, #{nickName}, + #{userType}, + #{cardType}, + #{cardCode}, + #{userInfos}, #{email}, #{avatar}, #{phonenumber}, @@ -184,6 +208,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" dept_id = #{deptId}, user_name = #{userName}, nick_name = #{nickName}, + user_type = #{userType}, + card_type = #{cardType}, + card_code = #{cardCode}, + user_infos = #{userInfos}, email = #{email}, phonenumber = #{phonenumber}, sex = #{sex}, diff --git a/yanzhu-ui-vue3/src/api/system/role.js b/yanzhu-ui-vue3/src/api/system/role.js index f13e6f40..29763ccd 100644 --- a/yanzhu-ui-vue3/src/api/system/role.js +++ b/yanzhu-ui-vue3/src/api/system/role.js @@ -117,3 +117,11 @@ export function deptTreeSelect(roleId) { method: 'get' }) } + +//根据部门选择角色 +export function getDeptRole(deptId) { + return request({ + url: '/system/role/deptRole/' + deptId, + method: 'get' + }) +} diff --git a/yanzhu-ui-vue3/src/api/system/user.js b/yanzhu-ui-vue3/src/api/system/user.js index f2f76ef9..09edfe1c 100644 --- a/yanzhu-ui-vue3/src/api/system/user.js +++ b/yanzhu-ui-vue3/src/api/system/user.js @@ -133,3 +133,11 @@ export function deptTreeSelect() { method: 'get' }) } + +// 查询部门下拉树结构 +export function deptFirTreeSelect() { + return request({ + url: '/system/user/deptTree', + method: 'get' + }) +} \ No newline at end of file diff --git a/yanzhu-ui-vue3/src/views/manage/proProjectInfo/index.vue b/yanzhu-ui-vue3/src/views/manage/proProjectInfo/index.vue index 028b0f21..63b1e3de 100644 --- a/yanzhu-ui-vue3/src/views/manage/proProjectInfo/index.vue +++ b/yanzhu-ui-vue3/src/views/manage/proProjectInfo/index.vue @@ -1,7 +1,7 @@ - + - + - + @@ -213,8 +213,8 @@ - - + + @@ -337,7 +337,7 @@ const data = reactive({ projectCode: null, simpleName: null, projectType: null, - projiectLevel: null, + projectLevel: null, projectPerson: null, projectPersonPhone: null, projectStatus: null, @@ -376,7 +376,7 @@ function reset() { projectCode: null, simpleName: null, projectType: null, - projiectLevel: null, + projectLevel: null, projectRegional: null, projectAddress: null, projectNature: null, diff --git a/yanzhu-ui-vue3/src/views/manage/proProjectInfoDepts/index.vue b/yanzhu-ui-vue3/src/views/manage/proProjectInfoDepts/index.vue index c4f9d108..a72a3a0d 100644 --- a/yanzhu-ui-vue3/src/views/manage/proProjectInfoDepts/index.vue +++ b/yanzhu-ui-vue3/src/views/manage/proProjectInfoDepts/index.vue @@ -1,10 +1,10 @@ - + @@ -27,24 +27,6 @@ @keyup.enter="handleQuery" /> - - - - - - - - 搜索 重置 @@ -95,8 +77,7 @@ - - + @@ -104,7 +85,7 @@ - + @@ -126,10 +107,10 @@ /> - - - - + + + + @@ -147,19 +128,6 @@ - - - - - - - -