|
@@ -2,22 +2,22 @@ package com.wtkj.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
-import com.wtkj.service.IContactDeptService;
|
|
|
+import com.wtkj.entity.ContactOuter;
|
|
|
+import com.wtkj.service.IContactOuterService;
|
|
|
+import com.wtkj.wrapper.ContactOuterUserWrapper;
|
|
|
+import com.wtkj.wrapper.ContactOuterWrapper;
|
|
|
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.springblade.system.feign.ISysClient;
|
|
|
-import org.springblade.system.vo.DeptVO;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
/**
|
|
|
* @author Blizzard
|
|
|
* @create at 2023-09-20 11:58
|
|
@@ -29,34 +29,29 @@ import java.util.List;
|
|
|
@Api(value = "联系人模块", tags = "联系人模块")
|
|
|
public class ContactController {
|
|
|
|
|
|
- private final ISysClient sysClient;
|
|
|
- private final IContactDeptService contactsService;
|
|
|
+ private final IContactOuterService contactOuterService;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
- * 本机构下的机构
|
|
|
+ * 外部联系人
|
|
|
*/
|
|
|
- @GetMapping("/dept-by-parentId")
|
|
|
- @ApiOperation(value = "内部通讯录or懒加载树形结构", notes = "传入上级机构id")
|
|
|
+ @GetMapping("/outer-dept")
|
|
|
+ @ApiOperation(value = "外部联系人机构分页", notes = "传入分页参数")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
- public R<List<DeptVO>> deptList(@RequestParam Long parentId) {
|
|
|
- List<DeptVO> res = new ArrayList<>();
|
|
|
- R<List<DeptVO>> rpc = sysClient.getDeptLazyList(parentId);
|
|
|
- if (rpc.isSuccess()) {
|
|
|
- res = rpc.getData();
|
|
|
- }
|
|
|
- return R.data(res);
|
|
|
+ public R address(Query query) {
|
|
|
+ IPage<ContactOuter> page = contactOuterService.selectPage(AuthUtil.getUserId(), Condition.getPage(query));
|
|
|
+ return R.data(ContactOuterWrapper.build().pageVO(page));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
- * 外部联系人
|
|
|
+ * 外部联系人分页
|
|
|
*/
|
|
|
- @GetMapping("/outer-dept")
|
|
|
- @ApiOperation(value = "外部联系人", notes = "传入登录用户的topDept,分页参数")
|
|
|
+ @GetMapping("/outer-contact")
|
|
|
+ @ApiOperation(value = "外部联系人分页", notes = "传入deptId 分页参数")
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
- public R address(@RequestParam Long topDept, Query query) {
|
|
|
- IPage<DeptVO> page = contactsService.deptPage(topDept, query);
|
|
|
- return R.data(page);
|
|
|
+ public R contactPage(@RequestParam Long deptId, Query query) {
|
|
|
+ IPage<ContactOuter> page = contactOuterService.contactPage(deptId, AuthUtil.getUserId(), Condition.getPage(query));
|
|
|
+ return R.data(ContactOuterUserWrapper.build().pageVO(page));
|
|
|
}
|
|
|
|
|
|
|