From bee4e892f33543d47454df1f5d66e345840c2934 Mon Sep 17 00:00:00 2001 From: zhuxinru Date: Thu, 2 Apr 2026 14:12:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=B8=9A=E5=8A=A1=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B7=A5=E7=A7=8D=EF=BC=8C=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=88=A9=E5=85=83=E4=BA=A8=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/lyric/LyricIntegrateService.java | 12 +++++ .../src/main/resources/common-dev-100.yml | 2 +- .../src/main/resources/common-dev-190.yml | 2 +- .../src/main/resources/common-dev-65.yml | 2 +- outbridge/src/main/resources/common-local.yml | 2 +- outbridge/src/main/resources/common-lyric.yml | 2 +- .../controller/LyricUserController.java | 52 +++++++++++++++++-- .../sdm/system/service/ISysTenantService.java | 2 + .../impl/CID/CIDtenantServiceImpl.java | 15 ++++++ .../impl/LocalSysTenantServiceImpl.java | 5 ++ .../main/resources/application-dev-100.yml | 1 + .../main/resources/application-dev-190.yml | 1 + .../src/main/resources/application-dev-65.yml | 1 + .../src/main/resources/application-local.yml | 1 + .../src/main/resources/application-lyric.yml | 1 + .../src/main/resources/application-test.yml | 1 + .../src/main/resources/application-yian.yml | 1 + 17 files changed, 95 insertions(+), 8 deletions(-) diff --git a/outbridge/src/main/java/com/sdm/outbridge/service/lyric/LyricIntegrateService.java b/outbridge/src/main/java/com/sdm/outbridge/service/lyric/LyricIntegrateService.java index 24118c3f..a7237e26 100644 --- a/outbridge/src/main/java/com/sdm/outbridge/service/lyric/LyricIntegrateService.java +++ b/outbridge/src/main/java/com/sdm/outbridge/service/lyric/LyricIntegrateService.java @@ -503,6 +503,16 @@ public class LyricIntegrateService { } public SdmResponse queryUserList(String workType) + { + return queryUserList(workType, null); + } + + public SdmResponse queryUserList(List workTypeList) + { + return queryUserList(null, workTypeList); + } + + private SdmResponse queryUserList(String workType, List workTypeListParam) { SdmResponse response = SdmResponse.failed("获取用户列表失败"); String url = USER_URL + USER_URL_SUFFIX; @@ -514,6 +524,8 @@ public class LyricIntegrateService { GetUserListReq req = new GetUserListReq(); if (StringUtils.isNotEmpty(workType)) { req.setWorkType(workType); + } else if (workTypeListParam != null && !workTypeListParam.isEmpty()) { + req.setWorkTypeList(workTypeListParam); } else { req.setWorkTypeList(workTypeList); } diff --git a/outbridge/src/main/resources/common-dev-100.yml b/outbridge/src/main/resources/common-dev-100.yml index c9808819..15eb71df 100644 --- a/outbridge/src/main/resources/common-dev-100.yml +++ b/outbridge/src/main/resources/common-dev-100.yml @@ -49,6 +49,6 @@ 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: 机械设计工种,电气设计工种,工模设计工种,动画设计工种,设计品质保证设计工种,仿真工种,产品工艺工种,PLC程序工种,研发质量管理(程序软控)工种,激光光学工种,激光工艺工种,激光程序工种,激光装调工种,研发质量管理(测试软控)工种 + workType: 机械设计工种,电气设计工种,工模设计工种,动画设计工种,设计品质保证设计工种,仿真工种,产品工艺工种,PLC程序工种,研发质量管理(程序软控)工种,激光光学工种,激光工艺工种,激光程序工种,激光装调工种,研发质量管理(测试软控)工种,标准化管理工种(机械) account: lyric password: Lyric#$12389..@ \ No newline at end of file diff --git a/outbridge/src/main/resources/common-dev-190.yml b/outbridge/src/main/resources/common-dev-190.yml index 883122d3..ac91e06b 100644 --- a/outbridge/src/main/resources/common-dev-190.yml +++ b/outbridge/src/main/resources/common-dev-190.yml @@ -50,6 +50,6 @@ 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: 机械设计工种,电气设计工种,工模设计工种,动画设计工种,设计品质保证设计工种,仿真工种,产品工艺工种,PLC程序工种,研发质量管理(程序软控)工种,激光光学工种,激光工艺工种,激光程序工种,激光装调工种,研发质量管理(测试软控)工种 + workType: 机械设计工种,电气设计工种,工模设计工种,动画设计工种,设计品质保证设计工种,仿真工种,产品工艺工种,PLC程序工种,研发质量管理(程序软控)工种,激光光学工种,激光工艺工种,激光程序工种,激光装调工种,研发质量管理(测试软控)工种,标准化管理工种(机械) account: lyric password: Lyric#$12389..@ \ No newline at end of file diff --git a/outbridge/src/main/resources/common-dev-65.yml b/outbridge/src/main/resources/common-dev-65.yml index c9808819..15eb71df 100644 --- a/outbridge/src/main/resources/common-dev-65.yml +++ b/outbridge/src/main/resources/common-dev-65.yml @@ -49,6 +49,6 @@ 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: 机械设计工种,电气设计工种,工模设计工种,动画设计工种,设计品质保证设计工种,仿真工种,产品工艺工种,PLC程序工种,研发质量管理(程序软控)工种,激光光学工种,激光工艺工种,激光程序工种,激光装调工种,研发质量管理(测试软控)工种 + workType: 机械设计工种,电气设计工种,工模设计工种,动画设计工种,设计品质保证设计工种,仿真工种,产品工艺工种,PLC程序工种,研发质量管理(程序软控)工种,激光光学工种,激光工艺工种,激光程序工种,激光装调工种,研发质量管理(测试软控)工种,标准化管理工种(机械) account: lyric password: Lyric#$12389..@ \ No newline at end of file diff --git a/outbridge/src/main/resources/common-local.yml b/outbridge/src/main/resources/common-local.yml index 883122d3..ac91e06b 100644 --- a/outbridge/src/main/resources/common-local.yml +++ b/outbridge/src/main/resources/common-local.yml @@ -50,6 +50,6 @@ 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: 机械设计工种,电气设计工种,工模设计工种,动画设计工种,设计品质保证设计工种,仿真工种,产品工艺工种,PLC程序工种,研发质量管理(程序软控)工种,激光光学工种,激光工艺工种,激光程序工种,激光装调工种,研发质量管理(测试软控)工种 + workType: 机械设计工种,电气设计工种,工模设计工种,动画设计工种,设计品质保证设计工种,仿真工种,产品工艺工种,PLC程序工种,研发质量管理(程序软控)工种,激光光学工种,激光工艺工种,激光程序工种,激光装调工种,研发质量管理(测试软控)工种,标准化管理工种(机械) account: lyric password: Lyric#$12389..@ \ No newline at end of file diff --git a/outbridge/src/main/resources/common-lyric.yml b/outbridge/src/main/resources/common-lyric.yml index be74dbae..fd8f83f0 100644 --- a/outbridge/src/main/resources/common-lyric.yml +++ b/outbridge/src/main/resources/common-lyric.yml @@ -63,6 +63,6 @@ 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: 机械设计工种,电气设计工种,工模设计工种,动画设计工种,设计品质保证设计工种,仿真工种,产品工艺工种,PLC程序工种,研发质量管理(程序软控)工种,激光光学工种,激光工艺工种,激光程序工种,激光装调工种,研发质量管理(测试软控)工种 + workType: 机械设计工种,电气设计工种,工模设计工种,动画设计工种,设计品质保证设计工种,仿真工种,产品工艺工种,PLC程序工种,研发质量管理(程序软控)工种,激光光学工种,激光工艺工种,激光程序工种,激光装调工种,研发质量管理(测试软控)工种,标准化管理工种(机械) account: lyric password: Lyric#$12389..@ diff --git a/system/src/main/java/com/sdm/system/controller/LyricUserController.java b/system/src/main/java/com/sdm/system/controller/LyricUserController.java index fd2c1c2e..80473d52 100644 --- a/system/src/main/java/com/sdm/system/controller/LyricUserController.java +++ b/system/src/main/java/com/sdm/system/controller/LyricUserController.java @@ -1,13 +1,19 @@ package com.sdm.system.controller; -import com.alibaba.fastjson2.JSONArray; +import com.alibaba.fastjson2.JSONObject; import com.sdm.common.common.SdmResponse; +import com.sdm.common.common.ThreadLocalContext; import com.sdm.outbridge.entity.LyricVUserToDm; import com.sdm.outbridge.service.lyric.*; +import com.sdm.system.model.entity.SystemParamConfigBean; +import com.sdm.system.service.ISimulationSystemConfigService; +import com.sdm.system.service.ISysTenantService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; @@ -24,11 +30,51 @@ public class LyricUserController { @Autowired private LyricIntegrateService lyricIntegrateService; + @Autowired + private ISimulationSystemConfigService configService; + + @Autowired + private ISysTenantService tenantService; + + @Value("${defaultTenantId}") + private String defaultTenantId; + @PostMapping("/queryUserList") @Operation(summary = "查询利元亨用户列表") public SdmResponse> queryUserList(@RequestParam(required = false) String workType) { - SdmResponse sdmResponse = lyricIntegrateService.queryUserList(workType); - return sdmResponse; + if (workType != null && !workType.isEmpty()) { + return lyricIntegrateService.queryUserList(workType); + } + // 从系统参数配置获取工种列表 + List workTypeList = new ArrayList<>(); + try { + SdmResponse configResponse = configService.querySystemParamConfig("WORKFORCE_ALLOCATION"); + if (configResponse != null && configResponse.getData() != null) { + SystemParamConfigBean configBean = (SystemParamConfigBean) configResponse.getData(); + List values = configBean.values; + for (String value : values) { + JSONObject jsonObj = JSONObject.parseObject(value); + String wt = jsonObj.getString("workType"); + if (wt != null) { + workTypeList.add(wt); + } + } + } + } catch (Exception e) { + log.error("解析工种配置失败", e); + } + log.info("[queryUserList] workTypeList:{}", workTypeList); + return lyricIntegrateService.queryUserList(workTypeList); + } + + @PostMapping("/syncLyricUsers") + @Operation(summary = "同步利元亨用户") + public SdmResponse syncLyricUsers() { + if (StringUtils.equals(defaultTenantId, String.valueOf(ThreadLocalContext.getTenantId()))) { + return SdmResponse.success(); + } + log.info("[syncLyricUsers] start......"); + return tenantService.allSyncLyricUsers(); } } diff --git a/system/src/main/java/com/sdm/system/service/ISysTenantService.java b/system/src/main/java/com/sdm/system/service/ISysTenantService.java index 40bf82a6..b867af79 100644 --- a/system/src/main/java/com/sdm/system/service/ISysTenantService.java +++ b/system/src/main/java/com/sdm/system/service/ISysTenantService.java @@ -63,4 +63,6 @@ public interface ISysTenantService extends IService { */ SdmResponse getTenantDetailById(Long tenantId); + SdmResponse allSyncLyricUsers(); + } \ No newline at end of file diff --git a/system/src/main/java/com/sdm/system/service/impl/CID/CIDtenantServiceImpl.java b/system/src/main/java/com/sdm/system/service/impl/CID/CIDtenantServiceImpl.java index f86c21aa..112f9f1f 100644 --- a/system/src/main/java/com/sdm/system/service/impl/CID/CIDtenantServiceImpl.java +++ b/system/src/main/java/com/sdm/system/service/impl/CID/CIDtenantServiceImpl.java @@ -39,6 +39,9 @@ public class CIDtenantServiceImpl extends ServiceImpl