2 Commits 8bb5c62b20 ... d15c010f70

Author SHA1 Message Date
  loovi d15c010f70 Merge remote-tracking branch 'origin/dev' into dev 1 year ago
  loovi 91708169a8 增加边民申请加入互助组,组长查看申请人列表,批准是否同意申请功能 1 year ago

+ 6 - 6
sp-core/sp-base/pom.xml

@@ -185,16 +185,16 @@
         <dependency>
             <groupId>cn.hutool</groupId>
             <artifactId>hutool-all</artifactId>
-            <version>5.0.7</version>
+            <version>5.7.15</version>
         </dependency>
-        
-        <!--Alijson插件-->
+
         <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>fastjson</artifactId>
-            <version>1.2.73</version>
+            <groupId>cglib</groupId>
+            <artifactId>cglib</artifactId>
+            <version>3.2.8</version>
         </dependency>
 
+
 		<!-- ConfigurationProperties -->
         <dependency>
         	<groupId>org.springframework.boot</groupId>

+ 2 - 2
sp-generate/src/main/java/com/pj/SpGenerateApplication.java

@@ -38,7 +38,7 @@ public class SpGenerateApplication {
 		// ===================================  一些全局设置  =================================== 
 		GenCfgManager.cfg
 			.setProjectPath("D://project//market")	// 总项目地址 (生成代码的路径)
-	        .setServerProjectName("market-server/sp-service/sp-admin")				// 服务端 - 项目名称
+	        .setServerProjectName("market-server/sp")				// 服务端 - 项目名称
 //	        .setServerProjectName("sp-com/sp-core")			// 服务端 - 项目名称 (sp-com多模块版填此格式)
 	        .setCodePath("src/main/java/")					// 服务端代码 - 存放路径 
 	        .setPackagePath( "com.pj.project")				// 服务端代码 - 总包名 
@@ -64,7 +64,7 @@ public class SpGenerateApplication {
 			.setOutFC(false)					// 是否输出FC.java工厂类
 			.setDefaultMeunIcon("el-icon-folder-opened")	// 生成后台管理页面时,默认的菜单图标
 			.setWebLibImportWay(2) 			// 前端js库导入方式(1=cdn导入, 2=本地导入[需将sa-admin附带js包复制到kj文件夹])
-			 .addTableName("app_user","app_user_login_log")	// 添加要生成的表 (单个添加)
+			 .addTableName("app_menu","app_role")	// 添加要生成的表 (单个添加)
 //			.addTableAll()		// 添加要生成的表 (一次性添加所有表)
             .removeTableName("sp_role", "sp_role_permission", "sp_admin", "sp_apilog", "sp_cfg")	// 移除这些内置的表,不必生成代码
             ; 

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

@@ -3,7 +3,9 @@ package com.pj.tb_people;
 import java.io.IOException;
 import java.util.List;
 
+import cn.hutool.extra.cglib.CglibUtil;
 import com.pj.tb_people.dto.StartStopDto;
+import com.pj.tb_people.vo.ApplyPeopleVo;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -115,6 +117,49 @@ public class TbPeopleController {
 	}
 
 	/**
+	*边民申请加入互助组
+	*
+	* @author loovi
+	* @date
+	*/
+	@RequestMapping("applyAddGroup")
+	public AjaxJson addAppleGroup(@RequestParam("peopleId") Long peopleId, @RequestParam("groupId") Long groupId){
+		int i = tbPeopleService.applyAddGroup(peopleId, groupId);
+		return AjaxJson.getSuccess("申请成功等待组长批准",i);
+	}
+   /**
+   *获取申请互助组的申请人列表
+   *
+   * @author loovi
+   * @date
+   */
+   @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);
+	}
+	/**
+	*组长是否同意申请
+	*
+	* @author loovi
+	* @date
+	*/
+	@RequestMapping("passApply")
+	public AjaxJson passApply(@RequestParam("leaderId") Long leaderId,@RequestParam("peopleId") Long peopleId,@RequestParam("approve")int approve){
+		int line = tbPeopleService.passApply(leaderId, peopleId, approve);
+		return AjaxJson.getByLine(line);
+
+	}
+
+
+
+
+
+
+
+
+	/**
 	 * 数据导入接口
 	 * @param file
 	 * @return

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

@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Mapper;
 
 import com.pj.utils.so.*;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 /**
@@ -25,6 +26,11 @@ public interface TbPeopleMapper extends BaseMapper <TbPeople> {
 	 * @return 数据列表 
 	 */
 	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);
+
+	int updateApplyStatus(@Param("status") int status,@Param("peopleId") Long peopleId);
 
 
 }

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

@@ -9,92 +9,134 @@
 	<!-- select id, name, code, sex, age, id_card, id_card_img, phone, bank_no, bank_code, bank_name, group_id, group_name, status, role, lng, lat, last_location, address, address_ids, detail_address, is_lock, left_price, judge_status, judge_content, register_time, judge_time, person_id, create_time, create_by, create_name, update_time, update_by, update_name, delete_status from tb_people  -->
 	
 	<!-- 通用映射:自动模式 -->
-	<resultMap id="model" autoMapping="true" type="com.pj.tb_people.TbPeople"></resultMap>
+	<resultMap id="model" autoMapping="true" type="com.pj.tb_people.TbPeople">
+
+	</resultMap>
+	<sql id="select_tbPeople">
+		select p.id, p.name, p.code, p.sex, p.age, p.id_card, p.id_card_img, p.phone, p.bank_no, p.bank_code, p.bank_name,
+			   p.group_id, p.group_name, p.status, p.role, p.lng, p.lat, p.last_location, p.address, p.address_ids,
+			   p.detail_address, p.is_lock, p.left_price, p.judge_status, p.judge_content, p.register_time, p.judge_time,
+			   p.person_id, p.create_time, p.create_by, p.create_name, p.update_time, p.update_by, p.update_name,
+			   p.delete_status
+		from  tb_people p
+	</sql>
+
 	
 	<!-- 公共查询sql片段 -->
 	<sql id="select_sql">
-		select * 
-		from tb_people 
+		select * from tb_people
 	</sql>
+	<insert id="addApply">
+		insert into tb_people_apply
+		(people_id,group_id,status)
+		values
+		(
+		<if test="peopleId">#{peopleId},</if>
+		<if test="groupId"> #{groupId}</if>
+		 0
+		)
+	</insert>
+
+	<update id="updateApplyStatus" >
+		update  tb_people_apply
+		set
+		<if test="status !=  null and status != '' ">status=#{status}</if>
+		<where>
+			<if test="peopleId != null and peopleId != ''"> people_id=#{peopleId}</if>
+			and status=0
+		</where>
+
+	</update>
+
+	<select id="checkApplyExist" resultType="Integer">
+		select  count(1) from tb_people_apply where people_id=#{peopleId} and status=0
+	</select>
+
+	<select id="getApplyList"  resultType="com.pj.tb_people.TbPeople">
+		<include refid="select_tbPeople"></include>
+		 right join
+			 tb_people_apply ap
+			 on p.id = ap.people_id
+		where ap.group_id = (select id from tb_group g where g.leader_id =#{leaderId})and ap.status=0
+	</select>
 
-	
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
 	<select id="getList" resultMap="model">
 		<include refid="select_sql"></include>
-		<where>
-			<if test=' this.has("id") '> and id = #{id} </if>
-			<if test=' this.has("name") '> and name = #{name} </if>
-			<if test=' this.has("code") '> and code = #{code} </if>
-			<if test=' this.has("sex") '> and sex = #{sex} </if>
-			<if test=' this.has("age") '> and age = #{age} </if>
-			<if test=' this.has("idCard") '> and id_card = #{idCard} </if>
-			<if test=' this.has("phone") '> and phone = #{phone} </if>
-			<if test=' this.has("bankNo") '> and bank_no = #{bankNo} </if>
-			<if test=' this.has("bankCode") '> and bank_code = #{bankCode} </if>
-			<if test=' this.has("bankName") '> and bank_name = #{bankName} </if>
-			<if test=' this.has("groupId") '> and group_id = #{groupId} </if>
-			<if test=' this.has("groupName") '> and group_name = #{groupName} </if>
-			<if test=' this.has("status") '> and status = #{status} </if>
-			<if test=' this.has("role") '> and role = #{role} </if>
-			<if test=' this.has("lng") '> and lng = #{lng} </if>
-			<if test=' this.has("lat") '> and lat = #{lat} </if>
-			<if test=' this.has("lastLocation") '> and last_location = #{lastLocation} </if>
-			<if test=' this.has("address") '> and address = #{address} </if>
-			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>
-			<if test=' this.has("detailAddress") '> and detail_address = #{detailAddress} </if>
-			<if test=' this.has("isLock") '> and is_lock = #{isLock} </if>
-			<if test=' this.has("leftPrice") '> and left_price = #{leftPrice} </if>
-			<if test=' this.has("judgeStatus") '> and judge_status = #{judgeStatus} </if>
-			<if test=' this.has("judgeContent") '> and judge_content = #{judgeContent} </if>
-			<if test=' this.has("registerTime") '> and register_time = #{registerTime} </if>
-			<if test=' this.has("judgeTime") '> and judge_time = #{judgeTime} </if>
-			<if test=' this.has("personId") '> and person_id = #{personId} </if>
-			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
-			<if test=' this.has("createBy") '> and create_by = #{createBy} </if>
-			<if test=' this.has("createName") '> and create_name = #{createName} </if>
-			<if test=' this.has("updateTime") '> and update_time = #{updateTime} </if>
-			<if test=' this.has("updateBy") '> and update_by = #{updateBy} </if>
-			<if test=' this.has("updateName") '> and update_name = #{updateName} </if>
-			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>
-		</where>
-		order by
-		<choose>
-			<when test='sortType == 1'> id desc </when>
-			<when test='sortType == 2'> name desc </when>
-			<when test='sortType == 3'> code desc </when>
-			<when test='sortType == 4'> sex desc </when>
-			<when test='sortType == 5'> age desc </when>
-			<when test='sortType == 6'> id_card desc </when>
-			<when test='sortType == 7'> phone desc </when>
-			<when test='sortType == 8'> bank_no desc </when>
-			<when test='sortType == 9'> bank_code desc </when>
-			<when test='sortType == 10'> bank_name desc </when>
-			<when test='sortType == 11'> group_id desc </when>
-			<when test='sortType == 12'> group_name desc </when>
-			<when test='sortType == 13'> status desc </when>
-			<when test='sortType == 14'> role desc </when>
-			<when test='sortType == 15'> lng desc </when>
-			<when test='sortType == 16'> lat desc </when>
-			<when test='sortType == 17'> last_location desc </when>
-			<when test='sortType == 18'> address desc </when>
-			<when test='sortType == 19'> address_ids desc </when>
-			<when test='sortType == 20'> detail_address desc </when>
-			<when test='sortType == 21'> is_lock desc </when>
-			<when test='sortType == 22'> left_price desc </when>
-			<when test='sortType == 23'> judge_status desc </when>
-			<when test='sortType == 24'> judge_content desc </when>
-			<when test='sortType == 25'> register_time desc </when>
-			<when test='sortType == 26'> judge_time desc </when>
-			<when test='sortType == 27'> person_id desc </when>
-			<when test='sortType == 28'> create_time desc </when>
-			<when test='sortType == 29'> create_by desc </when>
-			<when test='sortType == 30'> create_name desc </when>
-			<when test='sortType == 31'> update_time desc </when>
-			<when test='sortType == 32'> update_by desc </when>
-			<when test='sortType == 33'> update_name desc </when>
-			<when test='sortType == 34'> delete_status desc </when>
-			<otherwise> id desc </otherwise>
-		</choose>
+<!--		<where>-->
+<!--			<if test=' this.has("id") '> and id = #{id} </if>-->
+<!--			<if test=' this.has("name") '> and name = #{name} </if>-->
+<!--			<if test=' this.has("code") '> and code = #{code} </if>-->
+<!--			<if test=' this.has("sex") '> and sex = #{sex} </if>-->
+<!--			<if test=' this.has("age") '> and age = #{age} </if>-->
+<!--			<if test=' this.has("idCard") '> and id_card = #{idCard} </if>-->
+<!--			<if test=' this.has("phone") '> and phone = #{phone} </if>-->
+<!--			<if test=' this.has("bankNo") '> and bank_no = #{bankNo} </if>-->
+<!--			<if test=' this.has("bankCode") '> and bank_code = #{bankCode} </if>-->
+<!--			<if test=' this.has("bankName") '> and bank_name = #{bankName} </if>-->
+<!--			<if test=' this.has("groupId") '> and group_id = #{groupId} </if>-->
+<!--			<if test=' this.has("groupName") '> and group_name = #{groupName} </if>-->
+<!--			<if test=' this.has("status") '> and status = #{status} </if>-->
+<!--			<if test=' this.has("role") '> and role = #{role} </if>-->
+<!--			<if test=' this.has("lng") '> and lng = #{lng} </if>-->
+<!--			<if test=' this.has("lat") '> and lat = #{lat} </if>-->
+<!--			<if test=' this.has("lastLocation") '> and last_location = #{lastLocation} </if>-->
+<!--			<if test=' this.has("address") '> and address = #{address} </if>-->
+<!--			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>-->
+<!--			<if test=' this.has("detailAddress") '> and detail_address = #{detailAddress} </if>-->
+<!--			<if test=' this.has("isLock") '> and is_lock = #{isLock} </if>-->
+<!--			<if test=' this.has("leftPrice") '> and left_price = #{leftPrice} </if>-->
+<!--			<if test=' this.has("judgeStatus") '> and judge_status = #{judgeStatus} </if>-->
+<!--			<if test=' this.has("judgeContent") '> and judge_content = #{judgeContent} </if>-->
+<!--			<if test=' this.has("registerTime") '> and register_time = #{registerTime} </if>-->
+<!--			<if test=' this.has("judgeTime") '> and judge_time = #{judgeTime} </if>-->
+<!--			<if test=' this.has("personId") '> and person_id = #{personId} </if>-->
+<!--			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>-->
+<!--			<if test=' this.has("createBy") '> and create_by = #{createBy} </if>-->
+<!--			<if test=' this.has("createName") '> and create_name = #{createName} </if>-->
+<!--			<if test=' this.has("updateTime") '> and update_time = #{updateTime} </if>-->
+<!--			<if test=' this.has("updateBy") '> and update_by = #{updateBy} </if>-->
+<!--			<if test=' this.has("updateName") '> and update_name = #{updateName} </if>-->
+<!--			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>-->
+<!--		</where>-->
+<!--		order by-->
+<!--		<choose>-->
+<!--			<when test='sortType == 1'> id desc </when>-->
+<!--			<when test='sortType == 2'> name desc </when>-->
+<!--			<when test='sortType == 3'> code desc </when>-->
+<!--			<when test='sortType == 4'> sex desc </when>-->
+<!--			<when test='sortType == 5'> age desc </when>-->
+<!--			<when test='sortType == 6'> id_card desc </when>-->
+<!--			<when test='sortType == 7'> phone desc </when>-->
+<!--			<when test='sortType == 8'> bank_no desc </when>-->
+<!--			<when test='sortType == 9'> bank_code desc </when>-->
+<!--			<when test='sortType == 10'> bank_name desc </when>-->
+<!--			<when test='sortType == 11'> group_id desc </when>-->
+<!--			<when test='sortType == 12'> group_name desc </when>-->
+<!--			<when test='sortType == 13'> status desc </when>-->
+<!--			<when test='sortType == 14'> role desc </when>-->
+<!--			<when test='sortType == 15'> lng desc </when>-->
+<!--			<when test='sortType == 16'> lat desc </when>-->
+<!--			<when test='sortType == 17'> last_location desc </when>-->
+<!--			<when test='sortType == 18'> address desc </when>-->
+<!--			<when test='sortType == 19'> address_ids desc </when>-->
+<!--			<when test='sortType == 20'> detail_address desc </when>-->
+<!--			<when test='sortType == 21'> is_lock desc </when>-->
+<!--			<when test='sortType == 22'> left_price desc </when>-->
+<!--			<when test='sortType == 23'> judge_status desc </when>-->
+<!--			<when test='sortType == 24'> judge_content desc </when>-->
+<!--			<when test='sortType == 25'> register_time desc </when>-->
+<!--			<when test='sortType == 26'> judge_time desc </when>-->
+<!--			<when test='sortType == 27'> person_id desc </when>-->
+<!--			<when test='sortType == 28'> create_time desc </when>-->
+<!--			<when test='sortType == 29'> create_by desc </when>-->
+<!--			<when test='sortType == 30'> create_name desc </when>-->
+<!--			<when test='sortType == 31'> update_time desc </when>-->
+<!--			<when test='sortType == 32'> update_by desc </when>-->
+<!--			<when test='sortType == 33'> update_name desc </when>-->
+<!--			<when test='sortType == 34'> delete_status desc </when>-->
+<!--			<otherwise> id desc </otherwise>-->
+<!--		</choose>-->
 	</select>
 	
 	

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

@@ -1,18 +1,20 @@
 package com.pj.tb_people;
 
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.Date;
-import java.util.List;
-
-import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.extra.cglib.CglibUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.api.client.admin.AdminInterface;
+import com.pj.enummj.DeleteStatus;
+import com.pj.enummj.IsLock;
 import com.pj.enummj.People;
-import com.pj.tb_goods_transit.TbGoodsTransit;
+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.so.SoMap;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFRow;
@@ -20,13 +22,17 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.transaction.annotation.Transactional;
-import com.pj.utils.sg.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.swing.filechooser.FileSystemView;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
 
 /**
  * Service: tb_people -- 边民
@@ -46,6 +52,8 @@ public class TbPeopleService extends ServiceImpl<TbPeopleMapper, TbPeople> imple
 	@Autowired
 	private AdminInterface adminInterface;
 
+	@Autowired
+	TbGroupMapper tbGroupMapper;
 	/** 增 */
 	void add(TbPeople t){
 		save(t);
@@ -141,7 +149,94 @@ public class TbPeopleService extends ServiceImpl<TbPeopleMapper, TbPeople> imple
 //
 //	}
 
-
+	/**
+	*边民申请加入互助组
+	*
+	* @author loovi
+	* @date
+	*/
+   public int applyAddGroup(Long peopleId, Long groupId){
+	   // 检查是否有待通过的申请
+	   int res = tbPeopleMapper.checkApplyExist(peopleId);
+	   if(res > 0){
+		   throw new RuntimeException("存在带通过的申请");
+	   }
+	   // 获取边民信息
+	   TbPeople tbPeople = tbPeopleMapper.selectById(peopleId);
+		// 获取互助组信息
+	   TbGroup tbGroup = tbGroupMapper.selectById(groupId);
+	   // 如果互助组不存在抛出异常
+	   if(Objects.isNull(tbGroup)){
+		   throw new RuntimeException("该互助组不存在");
+	   }
+	   // 如果互助组已删除抛出异常
+	   if(tbGroup.getDeleteStatus()== DeleteStatus.DELETE_STATUS_OFF.getCode()){
+		   throw new RuntimeException("该互助组已被删除");
+	   }
+	   // 如果边民已加入此互助组,信息提示已加入
+	   if(tbPeople.getGroupId()==groupId){
+		   throw new RuntimeException("您已加入该互助组");
+	   }
+	   // 如果边民没有加入任何互助组则可以申请加入
+	   int i = 0;
+	   if(Objects.isNull(tbPeople.getGroupId())&& StrUtil.isEmpty(tbPeople.getGroupName())){
+		   // 将申请边民和所申请的互助组id写入申请表
+		  i = tbPeopleMapper.addApply(peopleId, groupId);
+	   }else{
+		   throw new RuntimeException("您已加入互助组");
+	   }
+	   return i;
+   }
+   /**
+   *组长获取待通过申请人列表
+   *
+   * @author loovi
+   * @date
+   */
+   public List<TbPeople> getApplyList(Long leaderId){
+	   // 根据组长id获取申请该互助组的所有申请人信息
+	   List<TbPeople> list = tbPeopleMapper.getApplyList(leaderId);
+	   return list;
+   }
+	/**
+	 *组长批准是否同意加入申请
+	 *
+	 * @author loovi
+	 * @date
+	 */
+	public int passApply(Long leaderId,Long peopleId,int approve){
+		// 组长不同意申请
+		if(approve==2){
+			int i = tbPeopleMapper.updateApplyStatus(approve,peopleId);
+			return i;
+		}
+		// 组长同意申请
+		// 获取申请人信息
+		TbPeople tbPeople = tbPeopleMapper.selectById(peopleId);
+		// 用户不存在抛异常
+		if(Objects.isNull(tbPeople)){
+			throw new RuntimeException("用户不存在");
+		}
+		// 用户被锁定抛异常
+		if(tbPeople.getIsLock()== IsLock.IS_LOCK_OFF.getCode()){
+			throw new RuntimeException("用户已被锁定");
+		}
+		// 用户已删除抛异常
+		if(tbPeople.getIsLock()== DeleteStatus.DELETE_STATUS_OFF.getCode()){
+			throw new RuntimeException("用户已删除");
+		}
+		//根据互助组组长id查询互助组
+		QueryWrapper<TbGroup> queryWrapper = new QueryWrapper<>();
+		queryWrapper.eq("leader_id", leaderId);
+		TbGroup tbGroup = tbGroupMapper.selectOne(queryWrapper);
+		// 修改申请表状态为1通过
+		tbPeopleMapper.updateApplyStatus(approve,peopleId);
+		// 把互助组信息写入申请的边民表
+		tbPeople.setGroupId(tbGroup.getId());
+		tbPeople.setGroupName(tbGroup.getName());
+		int line = tbPeopleMapper.updateById(tbPeople);
+		return line;
+	}
 
 
 

+ 68 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_people/vo/ApplyPeopleVo.java

@@ -0,0 +1,68 @@
+package com.pj.tb_people.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ApplyPeopleVo {
+
+    /**
+     * 主键
+     */
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 边民号
+     */
+    private String code;
+
+    /**
+     * 性别(1=男,2=女)
+     */
+    private Integer sex;
+
+    /**
+     * 年龄
+     */
+    private Integer age;
+
+    /**
+     * 手机号码
+     */
+    private String phone;
+
+    /**
+     * 角色(1=普通边民,2=兼组长)
+     */
+    private Integer role;
+
+
+    /**
+     * 联系地址
+     */
+    private String address;
+
+
+    /**
+     * 详细地址
+     */
+    private String detailAddress;
+
+
+}