From d9a4cdac395572d68248acd53d9049a713a9870a Mon Sep 17 00:00:00 2001 From: zhuxinru Date: Fri, 10 Apr 2026 15:00:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=88=91=E5=88=86=E5=8F=91=E7=9A=84/?= =?UTF-8?q?=E6=88=91=E6=89=A7=E8=A1=8C=E7=9A=84=E6=8A=A5=E5=B7=A5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/SimulationWorkServiceImpl.java | 189 +++++++++--------- 1 file changed, 97 insertions(+), 92 deletions(-) diff --git a/project/src/main/java/com/sdm/project/service/impl/SimulationWorkServiceImpl.java b/project/src/main/java/com/sdm/project/service/impl/SimulationWorkServiceImpl.java index 6bceddeb..d93fdafb 100644 --- a/project/src/main/java/com/sdm/project/service/impl/SimulationWorkServiceImpl.java +++ b/project/src/main/java/com/sdm/project/service/impl/SimulationWorkServiceImpl.java @@ -189,89 +189,89 @@ public class SimulationWorkServiceImpl extends ServiceImpl taskVoList = (List) dataObj.get("data"); - if (CollectionUtils.isNotEmpty(taskVoList)) { - SpdmNewTaskVo taskVo = taskVoList.get(0); - // 构造EP创建任务参数 - // 项目号 - - // 机台号 - - // 工位号 - - String projectCode = getNodeCodeByType(taskVo, req.getIdMap(), "project"); - String machineCode = getNodeCodeByType(taskVo, req.getIdMap(), "machine"); - String workspaceCode = getNodeCodeByType(taskVo, req.getIdMap(), "workspace"); - - // 工序 任务名称-学科 -// taskVo.getTaskName() + "-" + taskVo.getDiscipline(); - - // 任务详情 报工名称-应完成阶段 - Map taskProgressMap = taskProgressService.getNameByValueMap(); -// simulationWork.getWorkName() + "-" + taskProgressMap.get(simulationWork.getShouldProgress()); - - // 创建时间 - - // 计划开始时间 - simulationWork.getPlanBeginTime(); - if (ObjectUtils.isEmpty(simulationWork.getPlanBeginTime())) { - return SdmResponse.failed("计划开始时间不能为空"); - } - - // 计划完成时间 - simulationWork.getPlanFinishTime(); - if (ObjectUtils.isEmpty(simulationWork.getPlanFinishTime())) { - return SdmResponse.failed("计划完成时间不能为空"); - } - - // 实际开始时间 - - // 报工日期 当天 - - // 计划工时 - simulationWork.getPlanWorkHour(); - if (ObjectUtils.isEmpty(simulationWork.getPlanWorkHour())) { - return SdmResponse.failed("计划工时不能为空"); - } - - // 标准工时 - simulationWork.getPlanWorkHour(); - - // 责任人工号 - // 根据userId查询工号 - UserQueryReq userReq = new UserQueryReq(); - userReq.setUserId(Long.valueOf(simulationWork.getOwner())); - userReq.setTenantId(ThreadLocalContext.getTenantId()); - SdmResponse sdmResponse = sysUserFeignClient.queryUserDetail(userReq); - if (sdmResponse.getData() != null) { - sdmResponse.getData().getUsername(); - } - - // 确认人工号 - userReq.setUserId(Long.valueOf(simulationWork.getCreator())); - SdmResponse sdmResponse2 = sysUserFeignClient.queryUserDetail(userReq); - if (sdmResponse2.getData() != null) { - sdmResponse2.getData().getUsername(); - } - - // SAP工序ID 固定为2C - - // 工时属性 固定为研发 - - } - } +// SimulationWork simulationWork = this.getById(workId); +// +// // 查询此条报工对应的task +// SpdmTaskListReq taskListReq = new SpdmTaskListReq(); +// taskListReq.setTaskId(simulationWork.getTaskId()); +// taskListReq.setType(TaskQryTypeEnum.ALL.getCode()); +// taskListReq.setIdMap(req.getIdMap()); +// taskListReq.setCurrent(1); +// taskListReq.setSize(10); +// SdmResponse response = taskService.list(taskListReq); +// if (response.isSuccess()) { +// JSONObject dataObj = (JSONObject) response.getData(); +// List taskVoList = (List) dataObj.get("data"); +// if (CollectionUtils.isNotEmpty(taskVoList)) { +// SpdmNewTaskVo taskVo = taskVoList.get(0); +// // 构造EP创建任务参数 +// // 项目号 +// +// // 机台号 +// +// // 工位号 +// +// String projectCode = getNodeCodeByType(taskVo, req.getIdMap(), "project"); +// String machineCode = getNodeCodeByType(taskVo, req.getIdMap(), "machine"); +// String workspaceCode = getNodeCodeByType(taskVo, req.getIdMap(), "workspace"); +// +// // 工序 任务名称-学科 +//// taskVo.getTaskName() + "-" + taskVo.getDiscipline(); +// +// // 任务详情 报工名称-应完成阶段 +// Map taskProgressMap = taskProgressService.getNameByValueMap(); +//// simulationWork.getWorkName() + "-" + taskProgressMap.get(simulationWork.getShouldProgress()); +// +// // 创建时间 +// +// // 计划开始时间 +// simulationWork.getPlanBeginTime(); +// if (ObjectUtils.isEmpty(simulationWork.getPlanBeginTime())) { +// return SdmResponse.failed("计划开始时间不能为空"); +// } +// +// // 计划完成时间 +// simulationWork.getPlanFinishTime(); +// if (ObjectUtils.isEmpty(simulationWork.getPlanFinishTime())) { +// return SdmResponse.failed("计划完成时间不能为空"); +// } +// +// // 实际开始时间 +// +// // 报工日期 当天 +// +// // 计划工时 +// simulationWork.getPlanWorkHour(); +// if (ObjectUtils.isEmpty(simulationWork.getPlanWorkHour())) { +// return SdmResponse.failed("计划工时不能为空"); +// } +// +// // 标准工时 +// simulationWork.getPlanWorkHour(); +// +// // 责任人工号 +// // 根据userId查询工号 +// UserQueryReq userReq = new UserQueryReq(); +// userReq.setUserId(Long.valueOf(simulationWork.getOwner())); +// userReq.setTenantId(ThreadLocalContext.getTenantId()); +// SdmResponse sdmResponse = sysUserFeignClient.queryUserDetail(userReq); +// if (sdmResponse.getData() != null) { +// sdmResponse.getData().getUsername(); +// } +// +// // 确认人工号 +// userReq.setUserId(Long.valueOf(simulationWork.getCreator())); +// SdmResponse sdmResponse2 = sysUserFeignClient.queryUserDetail(userReq); +// if (sdmResponse2.getData() != null) { +// sdmResponse2.getData().getUsername(); +// } +// +// // SAP工序ID 固定为2C +// +// // 工时属性 固定为研发 +// +// } +// } boolean updateFlag = this.lambdaUpdate() @@ -510,17 +510,22 @@ public class SimulationWorkServiceImpl extends ServiceImpl wrapper - .eq(SimulationWork::getOwner, userId) - .or() - .eq(SimulationWork::getCreator, userId)) - .list(); + if (req.getType() != null && req.getType() == 1) { + // type=1:查询当前登录人为owner(我执行的) + workList = this.lambdaQuery() + .eq(SimulationWork::getTaskId, req.getTaskId()) + .eq(SimulationWork::getOwner, userId) + .list(); + } else { + // type=0或其他:查询当前任务下所有报工 + workList = this.lambdaQuery() + .eq(SimulationWork::getTaskId, req.getTaskId()) + .list(); + } } else { - // 不传taskId,根据type查询,将filteredTaskIds条件加入SQL + // 不传taskId,查询的是报工列表,根据type查询,将filteredTaskIds条件加入SQL PageHelper.startPage(req.getCurrent(), req.getSize()); if (req.getType() != null && req.getType() == 0) { // type=0:查询当前登录人为creator(我确认的)