|
@@ -3,6 +3,7 @@ package com.ruoyi.app.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
import com.ruoyi.app.annotation.LoginAppUser;
|
|
|
import com.ruoyi.app.controller.base.AppBaseController;
|
|
|
import com.ruoyi.app.domain.TbAppUser;
|
|
@@ -21,6 +22,7 @@ import com.ruoyi.common.utils.bean.BeanUtils;
|
|
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
@@ -175,32 +177,51 @@ public class FamilyController extends AppBaseController {
|
|
|
return AjaxResult.success("申请成功");
|
|
|
}
|
|
|
|
|
|
- // 申请列表
|
|
|
+
|
|
|
+ @ApiOperation("申请列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "familyId", value = "家族id",paramType="Long"),
|
|
|
+ @ApiImplicitParam(name = "pageNum", value = "当前页",paramType="int"),
|
|
|
+ @ApiImplicitParam(name = "pageSize", value = "每页行数",paramType="int")
|
|
|
+ })
|
|
|
@GetMapping("/selectApply")
|
|
|
- public TableDataInfo selectApply(@LoginAppUser TbAppUser user, Long familyId){
|
|
|
+ public TableDataInfo selectApply(@LoginAppUser TbAppUser user, Long familyId,Integer pageNum,Integer pageSize){
|
|
|
if (familyId == null){
|
|
|
return new TableDataInfo();
|
|
|
}
|
|
|
+ pageNum = pageNum == null ? 1 : pageNum;
|
|
|
+ pageSize = pageSize == null ? 10 : pageSize;
|
|
|
+ PageHelper.startPage(pageNum, pageSize, "mi.create_time desc");
|
|
|
// 获取申请列表 1申请 3拒绝 4退出
|
|
|
- List<TbMemberMiddle> middleList = middleService.list(new LambdaQueryWrapper<TbMemberMiddle>()
|
|
|
+ List<TbMemberMiddle> list = middleService.selectApplyMember(new LambdaQueryWrapper<TbMemberMiddle>()
|
|
|
.eq(TbMemberMiddle::getFamilyId,familyId)
|
|
|
.in(TbMemberMiddle::getStatus, Arrays.asList("1","3","4"))
|
|
|
);
|
|
|
- if (middleList.size() <= 0){
|
|
|
- return new TableDataInfo();
|
|
|
- }
|
|
|
- // 查询申请的会员
|
|
|
- List<Long> ids = new ArrayList<>();
|
|
|
- middleList.forEach(item -> {
|
|
|
- ids.add(item.getMemberId());
|
|
|
- });
|
|
|
- return null;
|
|
|
+ return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
- // 通过申请
|
|
|
-// public AjaxResult pass(){
|
|
|
-//
|
|
|
-// }
|
|
|
+ @ApiOperation("通过申请")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "memberId", value = "申请的成员id",paramType="Long"),
|
|
|
+ @ApiImplicitParam(name = "familyId", value = "家族id",paramType="Long")
|
|
|
+ })
|
|
|
+ @GetMapping("/pass")
|
|
|
+ public AjaxResult pass(Long memberId,Long familyId){
|
|
|
+ TbMemberMiddle middle = middleService.getOne(new LambdaQueryWrapper<TbMemberMiddle>()
|
|
|
+ .eq(TbMemberMiddle::getFamilyId,familyId)
|
|
|
+ .eq(TbMemberMiddle::getMemberId,memberId)
|
|
|
+ .eq(TbMemberMiddle::getStatus,"1")
|
|
|
+ .last("limit 1")
|
|
|
+ );
|
|
|
+ if (middle == null) {
|
|
|
+ return AjaxResult.error("查无申请信息");
|
|
|
+ }
|
|
|
+ middle.setStatus("2"); //通过申请
|
|
|
+ if(!middleService.updateById(middle)){
|
|
|
+ return AjaxResult.error("通过失败");
|
|
|
+ }
|
|
|
+ return AjaxResult.success("申请通过");
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 退出家族
|