From e0f827f71f5bb9d1ed9f6414221e90eeb34632a7 Mon Sep 17 00:00:00 2001 From: cuilei <ray_tsu1@163.com> Date: 星期四, 04 九月 2025 11:07:01 +0800 Subject: [PATCH] 排产工单模块设备点检涉及接口 --- src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java b/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java index 4583f8f..732defb 100644 --- a/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java +++ b/src/main/java/org/jeecg/modules/eam/controller/EamEquipmentController.java @@ -12,15 +12,21 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.util.TranslateDictTextUtils; +import org.jeecg.modules.eam.constant.AssetStatusEnum; +import org.jeecg.modules.eam.constant.MaintenanceCategoryEnum; +import org.jeecg.modules.eam.constant.MaintenanceStandardStatusEnum; import org.jeecg.modules.eam.entity.EamEquipment; import org.jeecg.modules.eam.entity.EamEquipmentExtend; import org.jeecg.modules.eam.request.EamEquipmentQuery; import org.jeecg.modules.eam.service.IEamEquipmentExtendService; import org.jeecg.modules.eam.service.IEamEquipmentService; import org.jeecg.modules.eam.vo.EquipmentSearchResult; +import org.jeecg.modules.mes.entity.MesProductionWorkOrder; +import org.jeecg.modules.mes.service.IMesProductionWorkOrderService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.entity.ImportParams; import org.springframework.beans.factory.annotation.Autowired; @@ -33,8 +39,10 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * @Description: 璁惧鍙拌处 @@ -60,6 +68,8 @@ private ObjectMapper objectMapper; @Autowired private TranslateDictTextUtils translateDictTextUtils; + @Autowired + private IMesProductionWorkOrderService mesProductionWorkOrderService; /** * 鍒嗛〉鍒楄〃鏌ヨ @@ -335,4 +345,26 @@ return Result.ok(resultList); } + @AutoLog(value = "鏌ヨ鎺掍骇宸ュ崟鎵�灞炰骇绾夸笅闇�瑕佺偣妫�鐨勮澶囧垪琛�") + @ApiOperation(value = "鏌ヨ鎺掍骇宸ュ崟鎵�灞炰骇绾夸笅闇�瑕佺偣妫�鐨勮澶囧垪琛�", notes = "鏌ヨ鎺掍骇宸ュ崟鎵�灞炰骇绾夸笅闇�瑕佺偣妫�鐨勮澶囧垪琛�") + @GetMapping(value = "/listProductionLineInspectionEquipment") + public Result<?> listProductionLineInspectionEquipment(@RequestParam("orderId") String orderId) { + MesProductionWorkOrder workOrder = mesProductionWorkOrderService.getById(orderId); + if (workOrder == null) { + return Result.error("宸ュ崟涓嶅瓨鍦紒"); + } + List<Map<String, Object>> equipmentMapList = eamEquipmentService.list(new LambdaQueryWrapper<EamEquipment>() + .eq(EamEquipment::getOrgId, workOrder.getFactoryId()) + .eq(EamEquipment::getDelFlag, CommonConstant.DEL_FLAG_0) + .apply("NOT EXISTS (SELECT 1 FROM eam_inspection_order t WHERE t.equipment_id = eam_equipment.id AND t.work_order_id = {0})", orderId) + .apply("EXISTS (SELECT 1 FROM eam_maintenance_standard t WHERE t.equipment_id = eam_equipment.id AND t.del_flag = {0} " + + "AND t.standard_status = {1} AND t.maintenance_category = {2})", + CommonConstant.DEL_FLAG_0, MaintenanceStandardStatusEnum.NORMAL.name(), MaintenanceCategoryEnum.POINT_INSPECTION.name())) + .stream().map(e -> (Map<String, Object>) new HashMap<String, Object>() {{ + put("value", e.getId()); + put("label", e.getEquipmentCode() + "[" + e.getEquipmentName() + "]"); + put("text", e.getEquipmentCode() + "[" + e.getEquipmentName() + "]"); + }}).collect(Collectors.toList()); + return Result.ok(equipmentMapList); + } } -- Gitblit v1.9.3