From 331ecbd17b7d3c908e0bd77ceae4ca4f5e4a09dc Mon Sep 17 00:00:00 2001 From: liyawei Date: Fri, 5 Aug 2022 10:21:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81-=E5=8F=82=E6=95=B0=E9=A1=B9?= =?UTF-8?q?=E6=94=B6=E9=9B=86-=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=9A=E8=B0=83=E6=95=B4=E8=B4=A3=E4=BB=BB=E9=A2=86=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParamsCollectManifestEOController.java | 14 ++++ .../IParamsCollectManifestEOService.java | 3 + .../ParamsCollectManifestEOServiceImpl.java | 81 +++++++++++++++++-- 3 files changed, 93 insertions(+), 5 deletions(-) diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestEOController.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestEOController.java index c797b78a3..349d8ced7 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestEOController.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestEOController.java @@ -530,6 +530,20 @@ public class ParamsCollectManifestEOController extends JeroController> updateBatchDutyTerritory(@RequestBody ParamsCollectManifestVO paramsCollectManifestVO) { + List msgList = paramsCollectManifestEOService.updateBatchDutyTerritory(paramsCollectManifestVO); + return Result.OK(msgList); + } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java index fac103ab5..8904cd11c 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java @@ -161,4 +161,7 @@ public interface IParamsCollectManifestEOService extends IService updateBatchDutyTerritory(ParamsCollectManifestVO paramsCollectManifestVO); } diff --git a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index 9efca35d4..f6870131d 100644 --- a/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -1532,7 +1532,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl getMsgOfIssueCollection(List> msgMapList, String cut) { + private List getMsgOfIssueCollection(List> msgMapList, String cut, String operation) { List msgList = new ArrayList<>(); Map collectManifestStateEnumMap = CollectManifestStateEnum.toMap(cut); @@ -1698,9 +1698,17 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImplHomologation Engineer can operate when data state is 'Wait Collect'、'Sdt Back' or 'Change'"); + if ("1".equals(operation)) { + msgList.add("Homologation Engineer can operate when data state is 'Wait Collect','Sdt Back' or 'Change'."); + } else if("2".equals(operation)) { + msgList.add("Homologation Engineer can operate when data state is 'Wait Collect','Sdt Back'."); + } } else { - msgList.add("认证工程师数据状态为 '待发起收集'、'工程接口人退回'或'变更' 时,才有权限操作此按钮。"); + if ("1".equals(operation)) { + msgList.add("认证工程师数据状态为 '待发起收集'、'工程接口人退回'或'变更' 时,才有权限操作此按钮。"); + } else if("2".equals(operation)) { + msgList.add("认证工程师数据状态为 '待发起收集'、'工程接口人退回 时,才有权限操作此按钮。"); + } } } return msgList; @@ -2228,6 +2236,69 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl updateBatchDutyTerritory(ParamsCollectManifestVO paramsCollectManifestVO) { + if (StringUtils.isEmpty(paramsCollectManifestVO.getIds()) + || StringUtils.isEmpty(paramsCollectManifestVO.getParamsManifestId()) + || StringUtils.isEmpty(paramsCollectManifestVO.getDutyTerritory())) { + throw new JeroBootException("参数不能为空!"); + } + List paramsCollectManifestIdList = Arrays.asList(paramsCollectManifestVO.getIds().split(",")); + String dutyTerritory = paramsCollectManifestVO.getDutyTerritory(); + String paramsManifestId = paramsCollectManifestVO.getParamsManifestId(); + String projectId = paramsCollectManifestVO.getProjectId(); + String cut = paramsCollectManifestVO.getCut(); + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(ParamsCollectManifestEO::getId, paramsCollectManifestIdList); + List paramsCollectManifestEOList = paramsCollectManifestEOMapper.selectList(queryWrapper); + + List updateEOList = new ArrayList<>(); + List> msgMapList = new ArrayList<>(); + paramsCollectManifestEOList.forEach(paramsCollectManifestEO -> { + if (CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(paramsCollectManifestEO.getState()) + || CollectManifestStateEnum.SDT_BACK.getValue().equals(paramsCollectManifestEO.getState())) { + + ParamsCollectManifestEO updateEO = new ParamsCollectManifestEO(); + updateEO.setId(paramsCollectManifestEO.getId()); + updateEO.setDutyTerritory(dutyTerritory); + + // 根据负责领域处理工程接口人(零个,一个,多个): 领域中仅有一个人时,添加该字段 + ProjectRelatedPersonnel projectRelatedPersonnel = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritory(projectId, dutyTerritory); + if (ObjectUtil.isNotEmpty(projectRelatedPersonnel)) { + String sdtId = projectRelatedPersonnel.getEngineeringInterfacePerson(); + if (org.apache.commons.lang.StringUtils.isNotBlank(sdtId) && !sdtId.contains(",")) { // 领域中仅有一个人时,添加该字段 + SysUser sysUser = sysUserService.getById(sdtId); + if (ObjectUtil.isNotEmpty(sysUser)) { + updateEO.setSdt(sysUser.getUsername()); // 设置工程接口人 + } else { + updateEO.setSdt(""); // 设置工程接口人 + } + } else { + updateEO.setSdt(""); // 设置工程接口人 + } + } else { + updateEO.setSdt(""); // 设置工程接口人 + } + + updateEOList.add(updateEO); + + } else { + Map msgMap = new HashMap<>(); + msgMap.put("nioNumber", paramsCollectManifestEO.getNioNumber()); + msgMap.put("state", paramsCollectManifestEO.getState()); + msgMap.put("type", "2"); + msgMapList.add(msgMap); + } + }); + + // 修改责任领域及工程接口人 + updateBatchById(updateEOList); + + // 返回不符合参数项的提示信息 + return getMsgOfIssueCollection(msgMapList, cut, "2"); + } + private String[] getWorkbookTitleForExport(ParamsCollectManifestVO paramsCollectManifestVO) { String cut = paramsCollectManifestVO.getCut(); String paramsManifestId = paramsCollectManifestVO.getParamsManifestId();