|
@@ -5,14 +5,13 @@ import com.github.microservice.auth.security.helper.AuthHelper;
|
|
|
import com.github.microservice.auth.security.type.AuthType;
|
|
import com.github.microservice.auth.security.type.AuthType;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
import com.github.microservice.net.ResultContent;
|
|
|
import com.zhongshu.card.client.model.base.IDParam;
|
|
import com.zhongshu.card.client.model.base.IDParam;
|
|
|
-import com.zhongshu.card.client.model.visitor.VisitorMainModel;
|
|
|
|
|
-import com.zhongshu.card.client.model.visitor.VisitorMainParam;
|
|
|
|
|
-import com.zhongshu.card.client.model.visitor.VisitorMainSearch;
|
|
|
|
|
-import com.zhongshu.card.client.model.visitor.VisitorReViewParam;
|
|
|
|
|
|
|
+import com.zhongshu.card.client.model.visitor.*;
|
|
|
import com.zhongshu.card.server.core.service.visitor.VisitorMainService;
|
|
import com.zhongshu.card.server.core.service.visitor.VisitorMainService;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
+import jakarta.servlet.http.HttpServletRequest;
|
|
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Pageable;
|
|
@@ -23,6 +22,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 访客管理
|
|
* 访客管理
|
|
|
*
|
|
*
|
|
@@ -53,13 +54,20 @@ public class VisitorMainController {
|
|
|
return this.visitorMainService.deleteInfo(param.getId());
|
|
return this.visitorMainService.deleteInfo(param.getId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
|
|
+ @Operation(summary = "所有数据列表-分页查询", description = "数据列表-分页查询")
|
|
|
|
|
+ @RequestMapping(value = {"page"}, method = {RequestMethod.POST})
|
|
|
|
|
+ public ResultContent<Page<VisitorMainModel>> page(@Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable, @Parameter(required = false) VisitorMainSearch param) {
|
|
|
|
|
+ Assert.hasText(param.getProjectOid(), "projectOid不能为空");
|
|
|
|
|
+ return visitorMainService.page(param, pageable);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "我的审核列表-分页查询", description = "数据列表-分页查询")
|
|
@Operation(summary = "我的审核列表-分页查询", description = "数据列表-分页查询")
|
|
|
@RequestMapping(value = {"myReViewPage"}, method = {RequestMethod.POST})
|
|
@RequestMapping(value = {"myReViewPage"}, method = {RequestMethod.POST})
|
|
|
- public ResultContent<Page<VisitorMainModel>> myReViewPage(
|
|
|
|
|
- @Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
|
|
|
|
|
- @Parameter(required = false) VisitorMainSearch param) {
|
|
|
|
|
|
|
+ public ResultContent<Page<VisitorMainModel>> myReViewPage(@Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable, @Parameter(required = false) VisitorMainSearch param) {
|
|
|
Assert.hasText(param.getProjectOid(), "projectOid不能为空");
|
|
Assert.hasText(param.getProjectOid(), "projectOid不能为空");
|
|
|
|
|
+ // 被访人为当前用户
|
|
|
String visitorUserId = "";
|
|
String visitorUserId = "";
|
|
|
if (authHelper.getCurrentUser() != null) {
|
|
if (authHelper.getCurrentUser() != null) {
|
|
|
visitorUserId = authHelper.getCurrentUser().getUserId();
|
|
visitorUserId = authHelper.getCurrentUser().getUserId();
|
|
@@ -71,9 +79,7 @@ public class VisitorMainController {
|
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
@ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "我的申请列表-分页查询(已登录的)", description = "数据列表-分页查询")
|
|
@Operation(summary = "我的申请列表-分页查询(已登录的)", description = "数据列表-分页查询")
|
|
|
@RequestMapping(value = {"myApplyPage"}, method = {RequestMethod.POST})
|
|
@RequestMapping(value = {"myApplyPage"}, method = {RequestMethod.POST})
|
|
|
- public ResultContent<Page<VisitorMainModel>> myApplyPage(
|
|
|
|
|
- @Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
|
|
|
|
|
- @Parameter(required = false) VisitorMainSearch param) {
|
|
|
|
|
|
|
+ public ResultContent<Page<VisitorMainModel>> myApplyPage(@Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable, @Parameter(required = false) VisitorMainSearch param) {
|
|
|
Assert.hasText(param.getProjectOid(), "projectOid不能为空");
|
|
Assert.hasText(param.getProjectOid(), "projectOid不能为空");
|
|
|
String applyUserId = "";
|
|
String applyUserId = "";
|
|
|
if (authHelper.getCurrentUser() != null) {
|
|
if (authHelper.getCurrentUser() != null) {
|
|
@@ -85,11 +91,10 @@ public class VisitorMainController {
|
|
|
|
|
|
|
|
@Operation(summary = "我的申请列表-分页查询(未登录的)", description = "数据列表-分页查询")
|
|
@Operation(summary = "我的申请列表-分页查询(未登录的)", description = "数据列表-分页查询")
|
|
|
@RequestMapping(value = {"myApplyPageUnLogin"}, method = {RequestMethod.POST})
|
|
@RequestMapping(value = {"myApplyPageUnLogin"}, method = {RequestMethod.POST})
|
|
|
- public ResultContent<Page<VisitorMainModel>> myApplyPageUnLogin(
|
|
|
|
|
- @Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
|
|
|
|
|
- @Parameter(required = false) VisitorMainSearch param) {
|
|
|
|
|
|
|
+ public ResultContent<Page<VisitorMainModel>> myApplyPageUnLogin(@Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable, @Parameter(required = false) VisitorMainSearch param) {
|
|
|
Assert.hasText(param.getProjectOid(), "projectOid不能为空");
|
|
Assert.hasText(param.getProjectOid(), "projectOid不能为空");
|
|
|
Assert.hasText(param.getOpenId(), "openId不能为空");
|
|
Assert.hasText(param.getOpenId(), "openId不能为空");
|
|
|
|
|
+ param.setIsDesen(Boolean.TRUE);
|
|
|
return visitorMainService.page(param, pageable);
|
|
return visitorMainService.page(param, pageable);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -113,4 +118,24 @@ public class VisitorMainController {
|
|
|
return this.visitorMainService.passVisitApply(param);
|
|
return this.visitorMainService.passVisitApply(param);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
|
|
+ @Operation(summary = "取消申请", description = "取消申请")
|
|
|
|
|
+ @RequestMapping(value = "cancelVisitApply", method = {RequestMethod.POST})
|
|
|
|
|
+ public ResultContent cancelVisitApply(@RequestBody IDParam param) {
|
|
|
|
|
+ return this.visitorMainService.cancelVisitApply(param.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
|
|
+ @Operation(summary = "当前用户信息统计(被访人员)", description = "当前用户信息统计")
|
|
|
|
|
+ @RequestMapping(value = "staticCurrentUserTotal", method = {RequestMethod.POST})
|
|
|
|
|
+ public ResultContent staticCurrentUserTotal(@RequestBody VisitorStaticParam param) {
|
|
|
|
|
+ return this.visitorMainService.staticCurrentUserTotal(param);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
|
|
+ @RequestMapping(value = "exportData", method = RequestMethod.POST)
|
|
|
|
|
+ @Operation(summary = "导出访客数据", description = "导出访客数据")
|
|
|
|
|
+ public void exportData(HttpServletRequest request, HttpServletResponse response, VisitorMainSearch param) throws IOException {
|
|
|
|
|
+ visitorMainService.exportData(request, response, param);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|