From 60036523fcf5578ac58f633d562cd5551afda8a4 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Fri, 12 May 2023 08:35:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=BE=E5=A4=87=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=20=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0=205.11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ProductionLargeServiceImpl.java | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java index 330f8f6d..41fde517 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/largeScreen/service/impl/ProductionLargeServiceImpl.java @@ -4,6 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.jeecg.modules.hanger.entity.HangRecord; import org.jeecg.modules.hanger.service.IHangRecordService; import org.jeecg.modules.largeScreen.service.ProductionLargeService; +import org.jeecg.modules.productplan.entity.ZyPlanProcess; +import org.jeecg.modules.productplan.entity.ZyProductPlan; +import org.jeecg.modules.productplan.enums.ProductPlanStatusEnum; +import org.jeecg.modules.productplan.service.IZyPlanProcessService; +import org.jeecg.modules.productplan.service.IZyProductPlanService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.ObjectUtils; @@ -18,12 +23,19 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { @Autowired private IHangRecordService iHangRecordService; + @Autowired + private IZyPlanProcessService iZyPlanProcessService; + + @Autowired + private IZyProductPlanService iZyProductPlanService; + @Override public Map getData() { Map resultMap = new HashMap<>(); - //1,吊挂 分组统计,获取最新时间5条吊挂运行记录 + //1,吊挂 + // 分组统计,获取最新时间5条吊挂运行记录 List recordList = iHangRecordService.list(new LambdaQueryWrapper().groupBy(HangRecord::getHangCode)); Map diaoguaData = new HashMap<>(); if (!ObjectUtils.isEmpty(recordList)) { @@ -36,10 +48,22 @@ public class ProductionLargeServiceImpl implements ProductionLargeService { diaoguaData.put(e.getHangCode(), records); }); } - resultMap.put("diaogua_Data", diaoguaData); + resultMap.put("diaogua_data", diaoguaData); - //2,TODO + //2,生产线实时状态 + // 统计生产计划状为生产中的数据 + List planList = iZyProductPlanService.list(new LambdaQueryWrapper().eq(ZyProductPlan::getStatus, ProductPlanStatusEnum.PRODUCTION.getCode())); + Map shengchanxianMap = new HashMap<>(); + if (!ObjectUtils.isEmpty(planList)) { + planList.stream().forEach(e -> { + List planProcessList = iZyPlanProcessService.list(new LambdaQueryWrapper().eq(ZyPlanProcess::getPlanId, e.getId())); + if (!ObjectUtils.isEmpty(planProcessList)) { + shengchanxianMap.put(e.getId(), planProcessList); + } + }); + } + resultMap.put("shengchanxian_data", shengchanxianMap); return resultMap; }