feat:同步利元亨用户部门数据
This commit is contained in:
@@ -84,6 +84,12 @@
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.38</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
<version>2.0.50</version>
|
||||
</dependency>
|
||||
<!--必备: 操作数据源相关-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.honeycombis</groupId>-->
|
||||
|
||||
@@ -19,9 +19,11 @@
|
||||
|
||||
package com.honeycombis.honeycom.spdm.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.honeycombis.honeycom.common.core.util.R;
|
||||
import com.honeycombis.honeycom.spdm.dto.LyricUserDto;
|
||||
import com.honeycombis.honeycom.spdm.dto.TenantPageQueryDto;
|
||||
import com.honeycombis.honeycom.spdm.feign.RemoteTenantServiceFeign;
|
||||
import com.honeycombis.honeycom.spdm.feign.SpdmServiceFeignClient;
|
||||
@@ -35,8 +37,10 @@ import jakarta.annotation.Resource;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -88,4 +92,18 @@ public class SpdmTenantController {
|
||||
log.info("[initNewTenant] tenantId:{}, responseR:{}", tenantId, responseR);
|
||||
}
|
||||
|
||||
@PostMapping("/queryUserList")
|
||||
public R<List<LyricUserDto>> queryUserList(@RequestParam String workType) {
|
||||
ResponseR sdmResponse = spdmServiceFeignClient.queryUserList(workType);
|
||||
log.info("[queryUserList] sdmResponse:{}", sdmResponse);
|
||||
if (sdmResponse.isSuccess() && sdmResponse.getData() != null) {
|
||||
JSONArray jsonArray = (JSONArray) sdmResponse.getData();
|
||||
List<LyricUserDto> userToDmList = jsonArray.toJavaList(LyricUserDto.class);
|
||||
return R.ok(userToDmList);
|
||||
} else {
|
||||
return R.ok(new ArrayList<LyricUserDto>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.honeycombis.honeycom.spdm.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LyricUserDto {
|
||||
/**
|
||||
* 部门编码
|
||||
*/
|
||||
private String dept_code;
|
||||
/**
|
||||
* 三级部门编码
|
||||
*/
|
||||
private String dept_grp_code3;
|
||||
/**
|
||||
* 四级部门编码
|
||||
*/
|
||||
private String dept_grp_code4;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String dept_name;
|
||||
/**
|
||||
* 一级部门编码
|
||||
*/
|
||||
private String dept_grp_code1;
|
||||
/**
|
||||
* 二级部门编码
|
||||
*/
|
||||
private String dept_grp_code2;
|
||||
/**
|
||||
* 人员姓名
|
||||
*/
|
||||
private String psn_name;
|
||||
/**
|
||||
* 人员编码
|
||||
*/
|
||||
private String psn_code;
|
||||
/**
|
||||
* 完整部门名称
|
||||
*/
|
||||
private String full_dept_name;
|
||||
/**
|
||||
* 工种名称
|
||||
*/
|
||||
private String work_type_name;
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
private String job_name;
|
||||
/**
|
||||
* 四级部门名称
|
||||
*/
|
||||
private String dept_grp_name4;
|
||||
/**
|
||||
* 三级部门名称
|
||||
*/
|
||||
private String dept_grp_name3;
|
||||
/**
|
||||
* 二级部门名称
|
||||
*/
|
||||
private String dept_grp_name2;
|
||||
/**
|
||||
* 一级部门名称
|
||||
*/
|
||||
private String dept_grp_name1;
|
||||
}
|
||||
@@ -22,4 +22,7 @@ public interface SpdmServiceFeignClient {
|
||||
@PostMapping("/tenant/initNewTenant")
|
||||
ResponseR initNewTenant(@RequestParam Long tenantId);
|
||||
|
||||
@PostMapping("/lyricUser/queryUserList")
|
||||
ResponseR queryUserList(@RequestParam String workType);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user