|
|
@@ -1,14 +1,19 @@
|
|
|
package com.linkwechat.controller;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.linkwechat.common.annotation.Log;
|
|
|
import com.linkwechat.common.core.controller.BaseController;
|
|
|
import com.linkwechat.common.core.domain.AjaxResult;
|
|
|
import com.linkwechat.common.core.page.TableDataInfo;
|
|
|
import com.linkwechat.common.core.page.TableSupport;
|
|
|
import com.linkwechat.common.enums.BusinessType;
|
|
|
+import com.linkwechat.domain.WeUser;
|
|
|
import com.linkwechat.domain.customer.query.WeCuUserQuery;
|
|
|
import com.linkwechat.domain.customer.vo.WeUserDetailInfoVo;
|
|
|
import com.linkwechat.domain.customer.vo.WeUserVo;
|
|
|
+import com.linkwechat.domain.wecom.query.customer.WeCustomerQuery;
|
|
|
+import com.linkwechat.domain.wecom.vo.customer.WeCustomerDetailVo;
|
|
|
+import com.linkwechat.fegin.QwCustomerClient;
|
|
|
import com.linkwechat.service.IWeUserService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
@@ -33,12 +38,15 @@ public class WeUserController extends BaseController {
|
|
|
@Autowired
|
|
|
private IWeUserService weUserService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private QwCustomerClient qwCustomerClient;
|
|
|
+
|
|
|
/**
|
|
|
* 查询同步用户列表(分页),索引优化用户列表,未使用默认分页
|
|
|
*/
|
|
|
@GetMapping("/findWeUserList")
|
|
|
@ApiOperation(value = "询同步用户列表(分页)",httpMethod = "GET")
|
|
|
- public TableDataInfo findWeCustomerList(WeCuUserQuery weUserQuery) {
|
|
|
+ public TableDataInfo findWeUserList(WeCuUserQuery weUserQuery) {
|
|
|
List<WeUserVo> list = weUserService.findWeUserList(weUserQuery, TableSupport.buildPageRequest());
|
|
|
TableDataInfo dataTable = getDataTable(list);
|
|
|
//设置总条数
|
|
|
@@ -49,6 +57,18 @@ public class WeUserController extends BaseController {
|
|
|
return dataTable;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询同步用户列表(本地生活)
|
|
|
+ */
|
|
|
+ @GetMapping("/findUserList")
|
|
|
+ @ApiOperation(value = "询同步用户列表",httpMethod = "GET")
|
|
|
+ public AjaxResult findUserList() {
|
|
|
+ LambdaQueryWrapper<WeUser> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(WeUser::getSource,1);
|
|
|
+ List<WeUser> list = weUserService.list(wrapper);
|
|
|
+ return AjaxResult.success(list);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 分配/转移
|
|
|
@@ -59,7 +79,7 @@ public class WeUserController extends BaseController {
|
|
|
@Log(title = "分配/转出", businessType = BusinessType.UPDATE)
|
|
|
@ApiOperation(value = "分配/转移",httpMethod = "POST")
|
|
|
@PostMapping("/transferOwner/{id}")
|
|
|
- public AjaxResult transferOwner(@PathVariable("id") Long id, @RequestBody Long userId){
|
|
|
+ public AjaxResult transferOwner(@PathVariable("id") Long id, @RequestParam Long userId){
|
|
|
|
|
|
weUserService.transferOwner(id, userId);
|
|
|
return AjaxResult.success();
|
|
|
@@ -78,5 +98,15 @@ public class WeUserController extends BaseController {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ @GetMapping("/test")
|
|
|
+ @ApiOperation(value = "同步用户详情基础",httpMethod = "GET")
|
|
|
+ public AjaxResult test(){
|
|
|
+
|
|
|
+ WeCustomerQuery weCustomerQuery = new WeCustomerQuery();
|
|
|
+ weCustomerQuery.setExternal_userid("wmKy90DgAAiVxlyi0-UT60f-cAjiIMUQ");
|
|
|
+ weCustomerQuery.setCorpid("wwfe67d19509d43ec5");
|
|
|
+ WeCustomerDetailVo customerDetail = qwCustomerClient.getCustomerDetail(weCustomerQuery).getData();
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
|
|
|
}
|