Ver Fonte

支部成员管理列表查询

Wang Zi Wen há 2 anos atrás
pai
commit
c9670aa8a0

+ 8 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/branch/TBranchMemberController.java

@@ -2,6 +2,8 @@ package com.ruoyi.web.controller.branch;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.service.ISysUserService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -34,6 +36,9 @@ public class TBranchMemberController extends BaseController
     @Autowired
     private ITBranchMemberService tBranchMemberService;
 
+    @Autowired
+    private ISysUserService userService;
+
     /**
      * 查询支部成员管理列表
      */
@@ -77,6 +82,9 @@ public class TBranchMemberController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TBranchMember tBranchMember)
     {
+        Long userId = getUserId();
+        Long deptId = userService.selectUserById(userId).getDeptId();
+        tBranchMember.setDeptId(deptId);
         return toAjax(tBranchMemberService.insertTBranchMember(tBranchMember));
     }
 

+ 88 - 24
ruoyi-system/src/main/java/com/ruoyi/branch/domain/TBranchMember.java

@@ -1,7 +1,11 @@
 package com.ruoyi.branch.domain;
 
 import java.util.Date;
+import java.util.List;
+
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.core.domain.entity.SysRole;
+import com.ruoyi.system.domain.SysPost;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -29,8 +33,9 @@ public class TBranchMember extends BaseEntity
     @Excel(name = "成员类型")
     private String memberType;
 
-    /** $column.columnComment */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    /** 出生年月 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "出生年月", width = 30, dateFormat = "yyyy-MM-dd")
     private Date birthday;
 
     /** 学历 */
@@ -70,10 +75,6 @@ public class TBranchMember extends BaseEntity
     @Excel(name = "离任时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date labourLeaveTime;
 
-    /** 联系方式 */
-    @Excel(name = "联系方式")
-    private String contact;
-
     /** 调进时间 */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "调进时间", width = 30, dateFormat = "yyyy-MM-dd")
@@ -103,8 +104,9 @@ public class TBranchMember extends BaseEntity
     private String currentMentor;
 
     /** 计划发展时间 */
-    @Excel(name = "计划发展时间")
-    private String planDevelopDuration;
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "计划发展时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date planDevelopDuration;
 
     /** 是否参加过入党前培训(2年有效) */
     @Excel(name = "是否参加过入党前培训", readConverterExp = "2=年有效")
@@ -121,6 +123,78 @@ public class TBranchMember extends BaseEntity
     @Excel(name = "部门id")
     private Long deptId;
 
+    /** 用户昵称 */
+    @Excel(name = "用户名称")
+    private String nickName;
+
+    /** 用户性别 */
+    @Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
+    private String sex;
+
+    /** 手机号码 */
+    @Excel(name = "手机号码")
+    private String phonenumber;
+
+    /** 角色对象 */
+    private List<SysRole> roles;
+
+    /** 岗位对象 */
+    private List<SysPost> posts;
+
+    /** 民族 */
+    @Excel(name = "民族")
+    private String ethnic;
+
+    public String getEthnic() {
+        return ethnic;
+    }
+
+    public void setEthnic(String ethnic) {
+        this.ethnic = ethnic;
+    }
+
+    public List<SysPost> getPosts() {
+        return posts;
+    }
+
+    public void setPosts(List<SysPost> posts) {
+        this.posts = posts;
+    }
+
+    public String getPhonenumber() {
+        return phonenumber;
+    }
+
+    public void setPhonenumber(String phonenumber) {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getNickName() {
+        return nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getSex() {
+        return sex;
+    }
+
+    public void setSex(String sex) {
+        this.sex = sex;
+    }
+
+    public List<SysRole> getRoles()
+    {
+        return roles;
+    }
+
+    public void setRoles(List<SysRole> roles)
+    {
+        this.roles = roles;
+    }
+
     public void setMemberId(Long memberId) 
     {
         this.memberId = memberId;
@@ -229,15 +303,6 @@ public class TBranchMember extends BaseEntity
     {
         return labourLeaveTime;
     }
-    public void setContact(String contact) 
-    {
-        this.contact = contact;
-    }
-
-    public String getContact() 
-    {
-        return contact;
-    }
     public void setEntryTime(Date entryTime) 
     {
         this.entryTime = entryTime;
@@ -256,12 +321,12 @@ public class TBranchMember extends BaseEntity
     {
         return leaveTime;
     }
-    public void setIsLeague(String isLeague) 
+    public void setIsLeague(String isLeague)
     {
         this.isLeague = isLeague;
     }
 
-    public String getIsLeague() 
+    public String getIsLeague()
     {
         return isLeague;
     }
@@ -292,21 +357,21 @@ public class TBranchMember extends BaseEntity
     {
         return currentMentor;
     }
-    public void setPlanDevelopDuration(String planDevelopDuration) 
+    public void setPlanDevelopDuration(Date planDevelopDuration)
     {
         this.planDevelopDuration = planDevelopDuration;
     }
 
-    public String getPlanDevelopDuration() 
+    public Date getPlanDevelopDuration()
     {
         return planDevelopDuration;
     }
-    public void setIsTrained(String isTrained) 
+    public void setIsTrained(String isTrained)
     {
         this.isTrained = isTrained;
     }
 
-    public String getIsTrained() 
+    public String getIsTrained()
     {
         return isTrained;
     }
@@ -353,7 +418,6 @@ public class TBranchMember extends BaseEntity
             .append("labourDivision", getLabourDivision())
             .append("labourEntryTime", getLabourEntryTime())
             .append("labourLeaveTime", getLabourLeaveTime())
-            .append("contact", getContact())
             .append("entryTime", getEntryTime())
             .append("leaveTime", getLeaveTime())
             .append("isLeague", getIsLeague())

+ 41 - 6
ruoyi-system/src/main/resources/mapper/branch/TBranchMemberMapper.xml

@@ -17,7 +17,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="labourDivision"    column="labour_division"    />
         <result property="labourEntryTime"    column="labour_entry_time"    />
         <result property="labourLeaveTime"    column="labour_leave_time"    />
-        <result property="contact"    column="contact"    />
         <result property="entryTime"    column="entry_time"    />
         <result property="leaveTime"    column="leave_time"    />
         <result property="isLeague"    column="is_league"    />
@@ -33,10 +32,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
         <result property="deptId"    column="dept_id"    />
+        <result property="nickName"    column="nick_name"    />
+        <result property="sex"    column="sex"    />
+        <result property="phonenumber"    column="phonenumber"    />
+        <result property="ethnic"    column="ethnic"    />
+        <collection  property="roles"   javaType="java.util.List" resultMap="RoleResult" />
+        <collection  property="posts"   javaType="java.util.List" resultMap="PostResult" />
+    </resultMap>
+
+    <resultMap id="RoleResult" type="SysRole">
+        <id     property="roleId"       column="role_id"        />
+        <result property="roleName"     column="role_name"      />
+        <result property="roleKey"      column="role_key"       />
+        <result property="roleSort"     column="role_sort"      />
+        <result property="dataScope"     column="data_scope"    />
+        <result property="status"       column="role_status"    />
+    </resultMap>
+
+    <resultMap id="PostResult" type="SysPost">
+        <id     property="postId"       column="post_id"        />
+        <result property="postCode"     column="post_code"      />
+        <result property="postName"      column="post_name"       />
+        <result property="postSort"     column="post_sort"      />
+        <result property="status"    column="post_status"    />
     </resultMap>
 
     <sql id="selectTBranchMemberVo">
-        select u.member_id, u.user_id, u.member_type, u.birthday, u.education_level, u.work_join_time, u.work_entry_time, u.party_entry_time, u.current_post, u.labour_division, u.labour_entry_time, u.labour_leave_time, u.contact, u.entry_time, u.leave_time, u.is_league, u.apply_time, u.form_create_time, u.current_mentor, u.plan_develop_duration, u.is_trained, u.remarks, u.del_flag, u.create_by, u.create_time, u.update_by, u.update_time, u.dept_id from t_branch_member u left join sys_dept d on u.dept_id = d.dept_id
+        select u.member_id, u.user_id, u.ethnic, u.member_type, u.birthday, u.education_level, u.work_join_time, u.work_entry_time, u.party_entry_time, u.current_post, u.labour_division, u.labour_entry_time, u.labour_leave_time, u.entry_time, u.leave_time, u.is_league, u.apply_time, u.form_create_time, u.current_mentor, u.plan_develop_duration, u.is_trained, u.remarks, u.del_flag, u.create_by, u.create_time, u.update_by, u.update_time, u.dept_id,
+        us.NICK_NAME, us.SEX, us.PHONENUMBER,
+        r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,
+        p.post_id, p.post_code, p.post_name, p.post_sort, p.status as post_status
+        from t_branch_member u
+            left join sys_dept d on u.dept_id = d.dept_id
+            left join SYS_USER us on us.user_id = u.user_id
+            left join sys_user_role ur on us.user_id = ur.user_id
+            left join sys_role r on r.role_id = ur.role_id
+            left join sys_user_post up on us.user_id = up.user_id
+            left join sys_post p on p.post_id = up.post_id
     </sql>
 
     <select id="selectTBranchMemberList" parameterType="TBranchMember" resultMap="TBranchMemberResult">
@@ -45,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="memberId != null "> and u.member_id = #{memberId}</if>
             <if test="userId != null "> and u.user_id = #{userId}</if>
             <if test="memberType != null  and memberType != ''"> and u.member_type = #{memberType}</if>
+            <if test="ethnic != null  and ethnic != ''"> and u.ethnic = #{ethnic}</if>
             <if test="birthday != null "> and u.birthday = #{birthday}</if>
             <if test="educationLevel != null  and educationLevel != ''"> and u.education_level = #{educationLevel}</if>
             <if test="workJoinTime != null "> and u.work_join_time = #{workJoinTime}</if>
@@ -54,7 +87,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="labourDivision != null  and labourDivision != ''"> and u.labour_division = #{labourDivision}</if>
             <if test="labourEntryTime != null "> and u.labour_entry_time = #{labourEntryTime}</if>
             <if test="labourLeaveTime != null "> and u.labour_leave_time = #{labourLeaveTime}</if>
-            <if test="contact != null  and contact != ''"> and u.contact = #{contact}</if>
             <if test="entryTime != null "> and u.entry_time = #{entryTime}</if>
             <if test="leaveTime != null "> and u.leave_time = #{leaveTime}</if>
             <if test="isLeague != null  and isLeague != ''"> and u.is_league = #{isLeague}</if>
@@ -78,11 +110,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
         
     <insert id="insertTBranchMember" parameterType="TBranchMember">
+        <selectKey keyProperty="memberId" resultType="long" order="BEFORE">
+            SELECT seq_t_branch_member.NEXTVAL as memberId FROM DUAL
+        </selectKey>
         insert into t_branch_member
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="memberId != null">member_id,</if>
             <if test="userId != null">user_id,</if>
             <if test="memberType != null">member_type,</if>
+            <if test="ethnic != null">ethnic,</if>
             <if test="birthday != null">birthday,</if>
             <if test="educationLevel != null">education_level,</if>
             <if test="workJoinTime != null">work_join_time,</if>
@@ -92,7 +128,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="labourDivision != null">labour_division,</if>
             <if test="labourEntryTime != null">labour_entry_time,</if>
             <if test="labourLeaveTime != null">labour_leave_time,</if>
-            <if test="contact != null">contact,</if>
             <if test="entryTime != null">entry_time,</if>
             <if test="leaveTime != null">leave_time,</if>
             <if test="isLeague != null">is_league,</if>
@@ -113,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="memberId != null">#{memberId},</if>
             <if test="userId != null">#{userId},</if>
             <if test="memberType != null">#{memberType},</if>
+            <if test="ethnic != null">#{ethnic},</if>
             <if test="birthday != null">#{birthday},</if>
             <if test="educationLevel != null">#{educationLevel},</if>
             <if test="workJoinTime != null">#{workJoinTime},</if>
@@ -122,7 +158,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="labourDivision != null">#{labourDivision},</if>
             <if test="labourEntryTime != null">#{labourEntryTime},</if>
             <if test="labourLeaveTime != null">#{labourLeaveTime},</if>
-            <if test="contact != null">#{contact},</if>
             <if test="entryTime != null">#{entryTime},</if>
             <if test="leaveTime != null">#{leaveTime},</if>
             <if test="isLeague != null">#{isLeague},</if>
@@ -146,6 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="userId != null">user_id = #{userId},</if>
             <if test="memberType != null">member_type = #{memberType},</if>
+            <if test="ethnic != null">ethnic = #{ethnic},</if>
             <if test="birthday != null">birthday = #{birthday},</if>
             <if test="educationLevel != null">education_level = #{educationLevel},</if>
             <if test="workJoinTime != null">work_join_time = #{workJoinTime},</if>
@@ -155,7 +191,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="labourDivision != null">labour_division = #{labourDivision},</if>
             <if test="labourEntryTime != null">labour_entry_time = #{labourEntryTime},</if>
             <if test="labourLeaveTime != null">labour_leave_time = #{labourLeaveTime},</if>
-            <if test="contact != null">contact = #{contact},</if>
             <if test="entryTime != null">entry_time = #{entryTime},</if>
             <if test="leaveTime != null">leave_time = #{leaveTime},</if>
             <if test="isLeague != null">is_league = #{isLeague},</if>

Diff do ficheiro suprimidas por serem muito extensas
+ 480 - 617
ruoyi-ui/src/views/branch/member1/index.vue


Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff