生产设备大屏 功能添加 5.11

master
zhc077 2 years ago
parent 3a12eaa987
commit 60036523fc
  1. 30
      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<String, Object> getData() {
Map<String, Object> resultMap = new HashMap<>();
//1,吊挂 分组统计,获取最新时间5条吊挂运行记录
//1,吊挂
// 分组统计,获取最新时间5条吊挂运行记录
List<HangRecord> recordList = iHangRecordService.list(new LambdaQueryWrapper<HangRecord>().groupBy(HangRecord::getHangCode));
Map<String, Object> 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<ZyProductPlan> planList = iZyProductPlanService.list(new LambdaQueryWrapper<ZyProductPlan>().eq(ZyProductPlan::getStatus, ProductPlanStatusEnum.PRODUCTION.getCode()));
Map<String, Object> shengchanxianMap = new HashMap<>();
if (!ObjectUtils.isEmpty(planList)) {
planList.stream().forEach(e -> {
List<ZyPlanProcess> planProcessList = iZyPlanProcessService.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, e.getId()));
if (!ObjectUtils.isEmpty(planProcessList)) {
shengchanxianMap.put(e.getId(), planProcessList);
}
});
}
resultMap.put("shengchanxian_data", shengchanxianMap);
return resultMap;
}

Loading…
Cancel
Save