| | |
| | | }}).collect(Collectors.toList()); |
| | | return Result.ok(equipmentMapList); |
| | | } |
| | | |
| | | @AutoLog(value = "查询排产工单所属产线下需要工艺点检的设备列表") |
| | | @ApiOperation(value = "查询排产工单所属产线下需要工艺点检的设备列表", notes = "查询排产工单所属产线下需要工艺点检的设备列表") |
| | | @GetMapping(value = "/listProductionLineProcessCheckEquipment") |
| | | public Result<?> listProductionLineProcessCheckEquipment(@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("EXISTS (SELECT 1 FROM eam_equipment_process_parameters t WHERE t.equipment_id = eam_equipment.id)") |
| | | .apply("NOT EXISTS (SELECT 1 FROM eam_process_check t WHERE t.equipment_id = eam_equipment.id AND t.work_order_id = {0})", orderId)) |
| | | .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); |
| | | } |
| | | } |