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; }