Kaynağa Gözat

增加组长查看组内成员列表,修改分页查询

loovi 1 yıl önce
ebeveyn
işleme
02e23df083

+ 19 - 4
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleController.java

@@ -4,6 +4,7 @@ import java.io.IOException;
 import java.util.List;
 
 import cn.hutool.extra.cglib.CglibUtil;
+import com.pj.tb_group.TbGroup;
 import com.pj.tb_people.dto.StartStopDto;
 import com.pj.tb_people.vo.ApplyPeopleVo;
 import com.pj.utils.so.SoMap;
@@ -135,9 +136,10 @@ public class TbPeopleController {
    */
    @RequestMapping("getApplyList")
 	public AjaxJson getApplyList(@RequestParam("leaderId") Long leaderId){
-		List<TbPeople> list = tbPeopleService.getApplyList(leaderId);
-		List<ApplyPeopleVo> resList = CglibUtil.copyList(list, ApplyPeopleVo::new);
-		return AjaxJson.getSuccess( "返回申请人列表",resList);
+	   SoMap so = SoMap.getRequestSoMap();
+	   so.set("leader_id",leaderId);
+		AjaxJson ajaxJson = tbPeopleService.getApplyList(so);
+		return ajaxJson;
 	}
 	/**
 	*组长是否同意申请
@@ -152,7 +154,20 @@ public class TbPeopleController {
 
 	}
 
-
+	/**
+	 *查看互助组内成员列表
+	 *
+	 * @author loovi
+	 * @date
+	 */
+	@RequestMapping("getMemberList")
+//	@SaCheckPermission(TbGroup.PERMISSION_CODE_EDIT)
+	public AjaxJson getMemberList(@RequestParam("leaderId") Long leaderId){
+		SoMap so = SoMap.getRequestSoMap();
+		so.set("leader_id",leaderId);
+		AjaxJson ajaxJson =  tbPeopleService.getMemberList(so);
+		return ajaxJson;
+	}
 
 
 

+ 2 - 2
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleMapper.java

@@ -28,8 +28,8 @@ public interface TbPeopleMapper extends BaseMapper <TbPeople> {
 	List<TbPeople> getList(SoMap so);
 	int checkApplyExist(@Param("peopleId") Long peopleId);
 	int addApply(@Param("peopleId") Long peopleId, @Param("groupId") Long groupId);
-	List <TbPeople>getApplyList(@Param("leaderId") Long leaderId);
-
+	List <TbPeople>getApplyList(SoMap so);
+	List <TbPeople>getMemberList(SoMap so);
 	int updateApplyStatus(@Param("status") int status,@Param("peopleId") Long peopleId);
 
 

+ 6 - 9
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleMapper.xml

@@ -60,6 +60,10 @@
 		where ap.group_id = (select id from tb_group g where g.leader_id =#{leaderId})and ap.status=0
 	</select>
 
+	<select id="getMemberList" resultType="com.pj.tb_people.TbPeople">
+		<include refid="select_tbPeople"></include>
+		where group_id = (select id from tb_group where leader_id =#{leaderId})
+	</select>
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
 	<select id="getList" resultMap="model">
 		<include refid="select_sql"></include>
@@ -138,14 +142,7 @@
 <!--			<otherwise> id desc </otherwise>-->
 <!--		</choose>-->
 	</select>
-	
-	
-	
-	
-	
-	
-	
-	
-	
+
+
 
 </mapper>

+ 15 - 3
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleService.java

@@ -15,6 +15,7 @@ import com.pj.tb_group.TbGroup;
 import com.pj.tb_group.TbGroupMapper;
 import com.pj.tb_people.dto.StartStopDto;
 import com.pj.tb_people.vo.ApplyPeopleVo;
+import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFRow;
@@ -193,12 +194,23 @@ public class TbPeopleService extends ServiceImpl<TbPeopleMapper, TbPeople> imple
    * @author loovi
    * @date
    */
-   public List<TbPeople> getApplyList(Long leaderId){
+   public AjaxJson getApplyList(SoMap so){
 	   // 根据组长id获取申请该互助组的所有申请人信息
-	   List<TbPeople> list = tbPeopleMapper.getApplyList(leaderId);
-	   return list;
+	   List<TbPeople> list = tbPeopleMapper.getApplyList(so.startPage());
+	   List<ApplyPeopleVo> resList = CglibUtil.copyList(list, ApplyPeopleVo::new);
+	   return AjaxJson.getPageData(so.getDataCount(), resList);
    }
 	/**
+	 *查看互助组内成员
+	 *
+	 * @author loovi
+	 * @date
+	 */
+	public AjaxJson getMemberList(SoMap so){
+		List<TbPeople> list = tbPeopleMapper.getMemberList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	/**
 	 *组长批准是否同意加入申请
 	 *
 	 * @author loovi