feat:查询OA用户列表

This commit is contained in:
2026-01-27 09:04:36 +08:00
parent d048efe94d
commit 9ded8a078b
10 changed files with 203 additions and 4 deletions

View File

@@ -0,0 +1,67 @@
package com.sdm.outbridge.entity;
import lombok.Data;
@Data
public class LyricVUserToDm {
/**
* 部门编码
*/
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;
}

View File

@@ -0,0 +1,12 @@
package com.sdm.outbridge.mode;
import lombok.Data;
@Data
public class GetUserListReq {
/**
* 工种
*/
private String workType;
}

View File

@@ -6,10 +6,7 @@ import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSONWriter;
import com.sdm.common.common.SdmResponse;
import com.sdm.common.utils.HttpUtil;
import com.sdm.outbridge.mode.FreeLinkMsg;
import com.sdm.outbridge.mode.FreelinkAndDingdingInformReq;
import com.sdm.outbridge.mode.GetProcessDataReq;
import com.sdm.outbridge.mode.HkUploadFileReq;
import com.sdm.outbridge.mode.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.apache.http.NameValuePair;
@@ -86,6 +83,18 @@ public class LyricIntegrateService {
@Value("${FREELINK_PUSH_MSG_SUFFIX}")
private String FREELINK_PUSH_MSG_SUFFIX;
// 获取OA用户列表url
@Value("${USER_URL}")
private String USER_URL;
// 获取OA用户列表url后缀
@Value("${USER_URL_SUFFIX}")
private String USER_URL_SUFFIX;
@Value("${user.account}")
private String userAccount;
@Value("${user.password}")
private String userPassword;
/**
* 生成海葵云token签名
@@ -489,6 +498,41 @@ public class LyricIntegrateService {
return response;
}
public SdmResponse queryUserList(String workType)
{
SdmResponse response = SdmResponse.failed("获取用户列表失败");
String url = USER_URL + USER_URL_SUFFIX;
Map<String,String> headerMap = new HashMap<>();
headerMap.put("Content-Type","application/json");
headerMap.put("account",userAccount);
headerMap.put("password", userPassword);
GetUserListReq req = new GetUserListReq();
req.setWorkType(workType);
try
{
String result = HttpUtil.httpPost(url, headerMap, JSONObject.toJSONString(req));
if(result != null && !result.isEmpty())
{
JSONObject responseJson = JSONObject.parseObject(result);
if(responseJson != null && responseJson.containsKey("data")) {
JSONObject data = responseJson.getJSONObject("data");
if (data != null && data.containsKey("dataList")) {
JSONArray dataList = data.getJSONArray("dataList");
response = SdmResponse.success();
response.setData(dataList);
}
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
return response;
}
}

View File

@@ -40,3 +40,10 @@ QUERY_TOD_ATTACHMENT_SUFFIX: /todoApi/todo/emulation/dm/attachments
# 即时通url
FREELINK_URL: http://freelink.haikui.com
FREELINK_PUSH_MSG_SUFFIX: /webchat/InformApi/FreelinkAndDingdingInform
USER_URL: https://url.lyh.haikuicloud.com
USER_URL_SUFFIX: /integrated/service/api/dynamic/auth/e906d13947944947921bb32c8fcffc6e/2014614168006742016/listPsnByWorkType
user:
workType: 设计,仿真,产品工艺,方案,程序,激光
account: lyric
password: Lyric#$12389..@

View File

@@ -40,3 +40,10 @@ QUERY_TOD_ATTACHMENT_SUFFIX: /todoApi/todo/emulation/dm/attachments
# 即时通url
FREELINK_URL: http://freelink.haikui.com
FREELINK_PUSH_MSG_SUFFIX: /webchat/InformApi/FreelinkAndDingdingInform
USER_URL: https://url.lyh.haikuicloud.com
USER_URL_SUFFIX: /integrated/service/api/dynamic/auth/e906d13947944947921bb32c8fcffc6e/2014614168006742016/listPsnByWorkType
user:
workType: 设计,仿真,产品工艺,方案,程序,激光
account: lyric
password: Lyric#$12389..@

View File

@@ -40,3 +40,10 @@ QUERY_TOD_ATTACHMENT_SUFFIX: /todoApi/todo/emulation/dm/attachments
# 即时通url
FREELINK_URL: http://freelink.haikui.com
FREELINK_PUSH_MSG_SUFFIX: /webchat/InformApi/FreelinkAndDingdingInform
USER_URL: https://url.lyh.haikuicloud.com
USER_URL_SUFFIX: /integrated/service/api/dynamic/auth/e906d13947944947921bb32c8fcffc6e/2014614168006742016/listPsnByWorkType
user:
workType: 设计,仿真,产品工艺,方案,程序,激光
account: lyric
password: Lyric#$12389..@

View File

@@ -40,3 +40,10 @@ QUERY_TOD_ATTACHMENT_SUFFIX: /todoApi/todo/emulation/dm/attachments
# 即时通url
FREELINK_URL: http://freelink.haikui.com
FREELINK_PUSH_MSG_SUFFIX: /webchat/InformApi/FreelinkAndDingdingInform
USER_URL: https://url.lyh.haikuicloud.com
USER_URL_SUFFIX: /integrated/service/api/dynamic/auth/e906d13947944947921bb32c8fcffc6e/2014614168006742016/listPsnByWorkType
user:
workType: 设计,仿真,产品工艺,方案,程序,激光
account: lyric
password: Lyric#$12389..@

View File

@@ -40,3 +40,10 @@ QUERY_TOD_ATTACHMENT_SUFFIX: /todoApi/todo/emulation/dm/attachments
# 即时通url
FREELINK_URL: http://freelink.haikui.com
FREELINK_PUSH_MSG_SUFFIX: /webchat/InformApi/FreelinkAndDingdingInform
USER_URL: https://url.lyh.haikuicloud.com
USER_URL_SUFFIX: /integrated/service/api/dynamic/auth/e906d13947944947921bb32c8fcffc6e/2014614168006742016/listPsnByWorkType
user:
workType: 设计,仿真,产品工艺,方案,程序,激光
account: lyric
password: Lyric#$12389..@

View File

@@ -40,3 +40,10 @@ QUERY_TOD_ATTACHMENT_SUFFIX: /todoApi/todo/emulation/dm/attachments
# 即时通url
FREELINK_URL: http://freelink.haikui.com
FREELINK_PUSH_MSG_SUFFIX: /webchat/InformApi/FreelinkAndDingdingInform
USER_URL: https://url.lyh.haikuicloud.com
USER_URL_SUFFIX: /integrated/service/api/dynamic/auth/e906d13947944947921bb32c8fcffc6e/2014614168006742016/listPsnByWorkType
user:
workType: 设计,仿真,产品工艺,方案,程序,激光
account: lyric
password: Lyric#$12389..@

View File

@@ -0,0 +1,34 @@
package com.sdm.system.controller;
import com.alibaba.fastjson2.JSONArray;
import com.sdm.common.common.SdmResponse;
import com.sdm.outbridge.entity.LyricVUserToDm;
import com.sdm.outbridge.service.lyric.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@RestController
@RequestMapping(value = "/lyricUser")
@Tag(name = "外部模块系统交互", description = "外部模块系统交互")
public class LyricUserController {
/*利元亨现场对接接口方法*/
@Autowired
private LyricIntegrateService lyricIntegrateService;
@PostMapping("/queryUserList")
@Operation(summary = "查询利元亨用户列表")
public SdmResponse<List<LyricVUserToDm>> queryUserList(@RequestParam String workType) {
SdmResponse sdmResponse = lyricIntegrateService.queryUserList(workType);
return sdmResponse;
}
}