From d17d3b179d842efb6f0d754502a7c623d5ea1c84 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Tue, 3 Dec 2024 10:53:00 +0800 Subject: [PATCH] =?UTF-8?q?2024-12-03=20=E6=8A=80=E6=9C=AF=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=8D=A1=E5=AE=A1=E6=89=B9=E5=A4=9A=E9=80=89=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TechnicalSpecificationServiceImpl.java | 24 +++++++++++++++++-- .../mapper/change/ChangeManagementMapper.xml | 4 ++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java b/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java index 08ce7483..e152c9f3 100644 --- a/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java +++ b/src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java @@ -1159,6 +1159,7 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification List operatorList = technicalSpecificationMapper.selectTechnicalSpecificationTeam(data.getSite(), data.getCodeNo()); List engineers = operatorList.stream().filter(a -> "engineer".equals(a.getType())).collect(Collectors.toList()); List technicians = operatorList.stream().filter(a -> "technician".equals(a.getType())).collect(Collectors.toList()); + List dccs = operatorList.stream().filter(a -> "dcc".equals(a.getType())).collect(Collectors.toList()); // 根据字段对应的数据库表+字段查询出数据 for (PlmRequestDetailVo nodeDetail : nodeDetails) { @@ -1201,7 +1202,7 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification } fieldValues.append(oaIds.get(0).getId()).append(","); } - } else if ("technician".equals(nodeDetail.getPlmField().split("#")[1])) { + } else if ("technician".equals(nodeDetail.getPlmField().split("#")[1])) { for (PlmTechnicalSpecificationTeamData technician : technicians) { // 根据域控账号获取oa人员id List oaIds = sysUserDao.selectOaIdByAccount(technician.getDomainControlAccount()); @@ -1210,6 +1211,15 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification } fieldValues.append(oaIds.get(0).getId()).append(","); } + } else if ("dcc".equals(nodeDetail.getPlmField().split("#")[1])) { + for (PlmTechnicalSpecificationTeamData dcc : dccs) { + // 根据域控账号获取oa人员id + List oaIds = sysUserDao.selectOaIdByAccount(dcc.getDomainControlAccount()); + if (oaIds.isEmpty()) { + throw new RuntimeException("未获取到域控账号对应的OA人员!"); + } + fieldValues.append(oaIds.get(0).getId()).append(","); + } } fieldValue = fieldValues.length() > 0 ? fieldValues.substring(0, fieldValues.length() - 1) : ""; } @@ -1265,6 +1275,7 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification List operatorList = technicalSpecificationMapper.selectTechnicalSpecificationTeam(data.getSite(), data.getCodeNo()); List engineers = operatorList.stream().filter(a -> "engineer".equals(a.getType())).collect(Collectors.toList()); List technicians = operatorList.stream().filter(a -> "technician".equals(a.getType())).collect(Collectors.toList()); + List dccs = operatorList.stream().filter(a -> "dcc".equals(a.getType())).collect(Collectors.toList()); ParamData paramData = new ParamData(data.getSite(), baseData.get("nodeId"), data.getCodeNo(), data.getUserName(), baseData.get("classificationNo"), baseData.get("userId"), baseData.get("workflowId"), baseData.get("workflowname"), baseData.get("requestName"), baseData.get("path"), baseData.get("requestId"), @@ -1278,7 +1289,7 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification cData.setNodeId(paramData.getNodeId()); cData.setWorkflowId(paramData.getWorkflowId()); List controlList = requestManageService.getProcessSelect(cData); - if(controlList.size()>0){ + if(!controlList.isEmpty()){ for (int i = 0; i < controlList.size(); i++) { requestManageService.doProcessControl(controlList.get(i).getRoleId(),data.getSite(),data.getCodeNo()); } @@ -1337,6 +1348,15 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification } fieldValues.append(oaIds.get(0).getId()).append(","); } + } else if ("dcc".equals(nodeDetail.getPlmField().split("#")[1])) { + for (PlmTechnicalSpecificationTeamData dcc : dccs) { + // 根据域控账号获取oa人员id + List oaIds = sysUserDao.selectOaIdByAccount(dcc.getDomainControlAccount()); + if (oaIds.isEmpty()) { + throw new RuntimeException("未获取到域控账号对应的OA人员!"); + } + fieldValues.append(oaIds.get(0).getId()).append(","); + } } fieldValue = fieldValues.length() > 0 ? fieldValues.substring(0, fieldValues.length() - 1) : ""; } diff --git a/src/main/resources/mapper/change/ChangeManagementMapper.xml b/src/main/resources/mapper/change/ChangeManagementMapper.xml index 5208bf1e..fa60bb7f 100644 --- a/src/main/resources/mapper/change/ChangeManagementMapper.xml +++ b/src/main/resources/mapper/change/ChangeManagementMapper.xml @@ -1074,7 +1074,7 @@ node_conclusion, nodeConclusionDesc, update_date, - create_by, + username as create_by, reject_opinion, updateBy from (select @@ -1089,7 +1089,7 @@ c.node_conclusion, case when c.node_conclusion = 'Y' then '同意' when c.node_conclusion = 'N' then '驳回' else '' end as nodeConclusionDesc, CAST(c.update_date AS DATETIME2(0)) AS update_date, - c.create_by, + d.username, CAST(c.create_date AS DATETIME2(0)) AS create_date, c.reject_opinion, case when c.update_by is null then d.username else c.update_by end as updateBy