|
@@ -1,12 +1,19 @@
|
|
|
package com.wtkj.controller;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import com.wtkj.dto.InviteToDeptDTO;
|
|
|
+import com.wtkj.entity.ApplyJoin;
|
|
|
import com.wtkj.entity.FileShare;
|
|
|
+import com.wtkj.service.IApplyJoinService;
|
|
|
import com.wtkj.service.IQrcodeService;
|
|
|
+import com.wtkj.wrapper.ApplyJoinWrapper;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import org.springblade.core.mp.support.Condition;
|
|
|
+import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -25,6 +32,7 @@ import javax.validation.Valid;
|
|
|
public class QrCodeController {
|
|
|
|
|
|
private final IQrcodeService qrcodeService;
|
|
|
+ private final IApplyJoinService applyJoinService;
|
|
|
|
|
|
/**
|
|
|
* 生成二维码
|
|
@@ -46,12 +54,41 @@ public class QrCodeController {
|
|
|
return R.status(qrcodeService.inviteToDept(dto.getCreateUser(), dto.getType(), dto.getQrcodeId(), AuthUtil.getUserId(), dto.getDeptId()));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @PostMapping("/apply-to-dept")
|
|
|
+ @ApiOperation(value = "申请加入机构", notes = "")
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
+ public R applyToDept(@RequestBody @Valid ApplyJoin join) {
|
|
|
+ return R.status(applyJoinService.saveOrUpdate(join));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 申请列表
|
|
|
+ */
|
|
|
+ @GetMapping("/apply-page")
|
|
|
+ @ApiOperation(value = "申请列表", notes = "传入当前登录用户顶级机构id")
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
+ public R applyPage(@RequestParam Long topDept, Query query) {
|
|
|
+ IPage<ApplyJoin> page = applyJoinService.page(Condition.getPage(query), new LambdaQueryWrapper<ApplyJoin>().eq(ApplyJoin::getDeptId, topDept));
|
|
|
+ return R.data(ApplyJoinWrapper.build().pageVO(page));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 同意加入组织
|
|
|
+ */
|
|
|
+ @GetMapping("/agree-apply")
|
|
|
+ @ApiOperation(value = "同意加入机构", notes = "传入记录主键id")
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
+ public R agreeJoinDept(@RequestParam Long id) {
|
|
|
+ return R.status(applyJoinService.agreeApply(id));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 生成邀请至项目组二维码
|
|
|
*/
|
|
|
@GetMapping("/create-group-qrcode")
|
|
|
@ApiOperation(value = "生成邀请至项目组二维码", notes = "")
|
|
|
- @ApiOperationSupport(order = 3)
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
public R createGroupQrcode(@RequestParam Long projectId) {
|
|
|
return R.data(qrcodeService.createGroupQrcode(projectId));
|
|
|
}
|
|
@@ -62,7 +99,7 @@ public class QrCodeController {
|
|
|
*/
|
|
|
@GetMapping("/invite-to-project")
|
|
|
@ApiOperation(value = "接受邀请至项目组", notes = "deptId:服务商的顶级机构id")
|
|
|
- @ApiOperationSupport(order = 4)
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
public R inviteToProject(@RequestParam String qrcodeId, @RequestParam Long topDept, @RequestParam Long projectId) {
|
|
|
return R.status(qrcodeService.inviteToProject(qrcodeId, topDept, projectId));
|
|
|
}
|
|
@@ -72,7 +109,7 @@ public class QrCodeController {
|
|
|
* 生成一条分享记录
|
|
|
*/
|
|
|
@PostMapping("/save-share")
|
|
|
- @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperationSupport(order = 8)
|
|
|
@ApiOperation(value = "生成文件分享", notes = "ids:文件的")
|
|
|
public R saveShare(@RequestBody FileShare share) {
|
|
|
return R.data(qrcodeService.savaShare(share));
|
|
@@ -82,10 +119,11 @@ public class QrCodeController {
|
|
|
* 查看分享
|
|
|
*/
|
|
|
@PostMapping("/get-share")
|
|
|
- @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
|
@ApiOperation(value = "查看文件分享", notes = "传入二维码返回ID")
|
|
|
public R getShare(@RequestParam Long id) {
|
|
|
return R.data(qrcodeService.getShare(id));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|