From 4cac17b9bb497e87539c97d5f3777c547dba88cd Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Fri, 20 Oct 2023 16:10:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E8=AE=A1=E5=88=92=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/EquPlanServiceImpl.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java index a779aa4c..39ce38da 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquPlanServiceImpl.java @@ -88,7 +88,27 @@ public class EquPlanServiceImpl implements IEquPlanService { equPlan.setUpdateTimeEnd(formatter.format(equPlan.getUpdateTimeArray().get(1))); } } - return equPlanMapper.selectEquPlanList(equPlan); + List equPlans = equPlanMapper.selectEquPlanList(equPlan); + + //获取当前所选工厂 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + String str = request.getHeader(key.substring(8)); + int index = str.indexOf("_"); + String factory = str.substring(index + 1); + + List workCenters = equPlanMapper.selectWorkCenter(factory); + + + for (EquPlan plan : equPlans) { + for (WorkCenter center : workCenters) { + if (plan.getPlanWorkshop().equals(center.getFactoryCode())) { + plan.setWorkCenterName(center.getFactoryName()); + } + } + } + + return equPlans; } /** @@ -270,7 +290,6 @@ public class EquPlanServiceImpl implements IEquPlanService { String str = request.getHeader(key.substring(8)); int index = str.indexOf("_"); String factory = str.substring(index + 1); - equPlanMapper.selectWorkCenter(factory); return success(equPlanMapper.selectWorkCenter(factory)); }