修改了添加成员方法
This commit is contained in:
parent
e1be4fdc6a
commit
b705a1ea2c
@ -90,8 +90,8 @@ public class PersonController {
|
||||
@Operation(summary = "根据用户ID更新家庭组号")
|
||||
@Parameter(name = "id", description = "用户编号", required = true)
|
||||
@Parameter(name = "familyid", description = "家庭组号", required = true)
|
||||
public CommonResult<Boolean> addMembers(@RequestParam("id") Integer id, @RequestParam("familyid") String familyid) {
|
||||
personService.updatePersonFamilyId(id, familyid);
|
||||
public CommonResult<Boolean> addMembers(@RequestParam("id") Integer id, @RequestParam("familyid") String familyid, @RequestParam("familyrelation") Integer familyrelation) {
|
||||
personService.updatePersonFamilyId(id, familyid,familyrelation);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ public interface PersonService {
|
||||
* @param id 用户编号
|
||||
* @param familyid 家庭组号
|
||||
*/
|
||||
void updatePersonFamilyId(Integer id, String familyid);
|
||||
void updatePersonFamilyId(Integer id, String familyid, Integer familyrelation);
|
||||
|
||||
/**
|
||||
* 移除用户家庭组号
|
||||
|
||||
@ -73,12 +73,13 @@ public class PersonServiceImpl implements PersonService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePersonFamilyId(Integer id, String familyid) {
|
||||
public void updatePersonFamilyId(Integer id, String familyid, Integer familyrelation) {
|
||||
// 校验存在
|
||||
validatePersonExists(id);
|
||||
// 更新
|
||||
personMapper.update(null, new LambdaUpdateWrapper<PersonDO>()
|
||||
.eq(PersonDO::getId, id)
|
||||
.set(PersonDO::getFamilyrelation, familyrelation)
|
||||
.set(PersonDO::getFamilyid, familyid));
|
||||
}
|
||||
|
||||
@ -89,6 +90,7 @@ public class PersonServiceImpl implements PersonService {
|
||||
// 更新
|
||||
personMapper.update(null, new LambdaUpdateWrapper<PersonDO>()
|
||||
.eq(PersonDO::getId, id)
|
||||
.set(PersonDO::getFamilyrelation, null)
|
||||
.set(PersonDO::getFamilyid, null));
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user