修改 bug

This commit is contained in:
lcj
2025-12-17 19:11:22 +08:00
parent e36b76f3dc
commit e7ce0875d4
4 changed files with 110 additions and 80 deletions

View File

@ -284,7 +284,7 @@ public class MaterialsManagementServiceImpl implements IMaterialsManagementServi
inventoryHashMap.put(item.getMaterialsId(), new BigDecimal(item.getNumber()));
}
});
Set<Long> mids = inventories.stream().map(MatMaterialsInventory::getMaterialsId).collect(Collectors.toSet());
Set<Long> mids = inventories.stream().filter(item -> item.getMaterialsId() != null).map(MatMaterialsInventory::getMaterialsId).collect(Collectors.toSet());
if (CollUtil.isEmpty(mids)){
return List.of();
}
@ -344,7 +344,7 @@ public class MaterialsManagementServiceImpl implements IMaterialsManagementServi
if (CollUtil.isEmpty(warehouseCameraList)){
return list;
}
Set<Long> cameraIds = warehouseCameraList.stream().map(MatWarehouseCamera::getCameraId).collect(Collectors.toSet());
Set<Long> cameraIds = warehouseCameraList.stream().filter(item -> item.getCameraId() != null).map(MatWarehouseCamera::getCameraId).collect(Collectors.toSet());
//生成摄像头与仓库关系
Map<Long, Long> warehouseCameraMap = warehouseCameraList.stream().collect(Collectors.toMap(MatWarehouseCamera::getCameraId, MatWarehouseCamera::getWarehouseId));
//根据摄像头id列表获取摄像头列表

View File

@ -415,6 +415,7 @@ public class BusMrpBaseServiceImpl extends ServiceImpl<BusMrpBaseMapper, BusMrpB
return new HashMap<>();
}
Map<Long, BigDecimal> planMap = matMaterialReceiveItems.stream()
.filter(matMaterialReceiveItem -> matMaterialReceiveItem.getPlanId() != null)
.collect(Collectors.groupingBy(
MatMaterialReceiveItem::getPlanId,
Collectors.reducing(BigDecimal.ZERO, MatMaterialReceiveItem::getQuantity, BigDecimal::add)

View File

@ -862,7 +862,7 @@ public class MatMaterialsServiceImpl extends ServiceImpl<MatMaterialsMapper, Mat
.list();
}
// 查询仓库列表
Set<Long> warehouseIds = matMaterials.stream().map(MatMaterials::getWarehouseId).collect(Collectors.toSet());
Set<Long> warehouseIds = matMaterials.stream().filter(material -> material.getWarehouseId() != null).map(MatMaterials::getWarehouseId).collect(Collectors.toSet());
List<MatWarehouse> warehouseList = new ArrayList<>();
if (CollUtil.isNotEmpty(warehouseIds)) {
warehouseList = warehouseService.lambdaQuery()

View File

@ -1,5 +1,6 @@
package org.dromara.websocket.websocket.service;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
@ -367,31 +368,34 @@ public class BigScreenWebSocketServer {
// 查询大屏-质安管理-安全员分布情况
List<DpznglAqyVo> dpznglAqyVos = dpzaglService.listByAqy(dpznglBo);
if (dpznglAqyVos != null && dpznglAqyVos.size() > 0) {
Map<String, String> map = new HashMap<>();
map.put("type", "aqy");
map.put("data", JSONUtil.toJsonStr(dpznglAqyVos));
maps.add(map);
Map<String, String> map1 = new HashMap<>();
map1.put("type", "aqy");
if (CollUtil.isNotEmpty(dpznglAqyVos)) {
map1.put("data", JSONUtil.toJsonStr(dpznglAqyVos));
} else {
map1.put("data", "[]");
}
maps.add(map1);
// 查询大屏-质安管理-站班会,巡检工单,整改情况
DpznglVo dpznglVo = dpzaglService.queryList(dpznglBo);
Map<String, String> map2 = new HashMap<>();
map2.put("type", "zagl");
if (dpznglVo != null) {
Map<String, String> map = new HashMap<>();
map.put("type", "zagl");
map.put("data", JSONUtil.toJsonStr(dpznglVo));
maps.add(map);
map2.put("data", JSONUtil.toJsonStr(dpznglVo));
} else {
map2.put("data", "{}");
}
maps.add(map2);
//查询大屏-质安管理-站班会
DpznglVo byzbh = dpzaglService.listByzbh(dpznglBo);
Map<String, String> map3 = new HashMap<>();
map3.put("type", "zbh");
if (byzbh != null) {
Map<String, String> map = new HashMap<>();
map.put("type", "zbh");
map.put("data", JSONUtil.toJsonStr(byzbh));
maps.add(map);
map3.put("data", JSONUtil.toJsonStr(byzbh));
} else {
map3.put("data", "{}");
}
maps.add(map3);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
@ -410,11 +414,11 @@ public class BigScreenWebSocketServer {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd", Locale.CHINA);
if (startDate != null && startDate.size() > 0) {
if (CollUtil.isNotEmpty(startDate)) {
String first = startDate.getFirst();
dpznglBo.setStartDate(LocalDate.parse(first, formatter));
}
if (endDate != null && endDate.size() > 0) {
if (CollUtil.isNotEmpty(endDate)) {
String first = endDate.getFirst();
dpznglBo.setEndDate(LocalDate.parse(first, formatter));
}
@ -422,30 +426,34 @@ public class BigScreenWebSocketServer {
// 查询大屏-质安管理-安全员分布情况
List<DpznglAqyVo> dpznglAqyVos = dpzaglService.listByAqy(dpznglBo);
if (dpznglAqyVos != null && dpznglAqyVos.size() > 0) {
Map<String, String> map = new HashMap<>();
map.put("type", "aqy");
map.put("data", JSONUtil.toJsonStr(dpznglAqyVos));
maps.add(map);
Map<String, String> map1 = new HashMap<>();
map1.put("type", "aqy");
if (CollUtil.isNotEmpty(dpznglAqyVos)) {
map1.put("data", JSONUtil.toJsonStr(dpznglAqyVos));
} else {
map1.put("data", "[]");
}
maps.add(map1);
// 查询大屏-质安管理-站班会,巡检工单,整改情况
DpznglVo dpznglVo = dpzaglService.queryList(dpznglBo);
Map<String, String> map2 = new HashMap<>();
map2.put("type", "zagl");
if (dpznglVo != null) {
Map<String, String> map = new HashMap<>();
map.put("type", "zagl");
map.put("data", JSONUtil.toJsonStr(dpznglVo));
maps.add(map);
map2.put("data", JSONUtil.toJsonStr(dpznglVo));
} else {
map2.put("data", "{}");
}
maps.add(map2);
//查询大屏-质安管理-站班会
DpznglVo byzbh = dpzaglService.listByzbh(dpznglBo);
Map<String, String> map3 = new HashMap<>();
map3.put("type", "zbh");
if (byzbh != null) {
Map<String, String> map = new HashMap<>();
map.put("type", "zbh");
map.put("data", JSONUtil.toJsonStr(byzbh));
maps.add(map);
map3.put("data", JSONUtil.toJsonStr(byzbh));
} else {
map3.put("data", "{}");
}
maps.add(map3);
}
/**
@ -455,33 +463,41 @@ public class BigScreenWebSocketServer {
ProgressBigScreenService service = SpringUtils.getBean(ProgressBigScreenService.class);
if (service != null) {
DesignProgressVo designProgress = service.getDesignProgress(projectId);
Map<String, String> map1 = new HashMap<>();
map1.put("type", "progressDesignProgress");
if (designProgress != null) {
Map<String, String> map = new HashMap<>();
map.put("type", "progressDesignProgress");
map.put("data", JSONUtil.toJsonStr(designProgress));
maps.add(map);
map1.put("data", JSONUtil.toJsonStr(designProgress));
} else {
map1.put("data", "{}");
}
maps.add(map1);
ProjectTotalProgressVo projectTotalProgress = service.getProjectTotalProgress(projectId);
Map<String, String> map2 = new HashMap<>();
map2.put("type", "progressProjectTotalProgress");
if (projectTotalProgress != null) {
Map<String, String> map = new HashMap<>();
map.put("type", "progressProjectTotalProgress");
map.put("data", JSONUtil.toJsonStr(projectTotalProgress));
maps.add(map);
map2.put("data", JSONUtil.toJsonStr(projectTotalProgress));
} else {
map2.put("data", "{}");
}
maps.add(map2);
List<MilestoneProgressVo> milestoneProgress = service.getMilestoneProgress(projectId);
Map<String, String> map3 = new HashMap<>();
map3.put("type", "progressMilestoneProgress");
if (milestoneProgress != null) {
Map<String, String> map = new HashMap<>();
map.put("type", "progressMilestoneProgress");
map.put("data", JSONUtil.toJsonStr(milestoneProgress));
maps.add(map);
map3.put("data", JSONUtil.toJsonStr(milestoneProgress));
} else {
map3.put("data", "[]");
}
maps.add(map3);
List<wzxqysjdhdbVo> materialProgress = service.getMaterialProgress(projectId);
Map<String, String> map4 = new HashMap<>();
map4.put("type", "progressMaterialProgress");
if (materialProgress != null) {
Map<String, String> map = new HashMap<>();
map.put("type", "progressMaterialProgress");
map.put("data", JSONUtil.toJsonStr(materialProgress));
maps.add(map);
map4.put("data", JSONUtil.toJsonStr(materialProgress));
} else {
map4.put("data", "[]");
}
maps.add(map4);
}
}
@ -492,69 +508,82 @@ public class BigScreenWebSocketServer {
if (materialsService != null) {
//库存结构分析
InventoryStructureAnalysisVo vo = managementService.inventoryStructureAnalysis(projectId);
Map<String, String> map = new HashMap<>();
map.put("type", "inventoryStructureAnalysis");
if (vo != null) {
Map<String, String> map = new HashMap<>();
map.put("type", "inventoryStructureAnalysis");
map.put("data", JSONUtil.toJsonStr(vo));
maps.add(map);
} else {
map.put("data", "{}");
}
maps.add(map);
//消耗趋势对比
List<xhqsdbVo> xhqsdb = managementService.xhqsdb(projectId);
Map<String, String> map1 = new HashMap<>();
map1.put("type", "xhqsdb");
if (xhqsdb != null && !xhqsdb.isEmpty()) {
Map<String, String> map = new HashMap<>();
map.put("type", "xhqsdb");
map.put("data", JSONUtil.toJsonStr(xhqsdb));
maps.add(map);
map1.put("data", JSONUtil.toJsonStr(xhqsdb));
} else {
map1.put("data", "[]");
}
maps.add(map1);
//仓库监控
List<WarehouseMonitoringVo> warehouseMonitoringVos = managementService.warehouseMonitoring(projectId);
Map<String, String> map2 = new HashMap<>();
map2.put("type", "warehouseMonitoring");
if (warehouseMonitoringVos != null && !warehouseMonitoringVos.isEmpty()) {
Map<String, String> map = new HashMap<>();
map.put("type", "warehouseMonitoring");
map.put("data", JSONUtil.toJsonStr(warehouseMonitoringVos));
maps.add(map);
map2.put("data", JSONUtil.toJsonStr(warehouseMonitoringVos));
} else {
map2.put("data", "[]");
}
maps.add(map2);
}
if (purchaseDocService != null) {
//采购单
List<BusPurchaseDocVo> purchaseDocVos = purchaseDocService.purchaseNote(projectId);
Map<String, String> map3 = new HashMap<>();
map3.put("type", "purchaseNote");
if (purchaseDocVos != null && !purchaseDocVos.isEmpty()) {
Map<String, String> map = new HashMap<>();
map.put("type", "purchaseNote");
map.put("data", JSONUtil.toJsonStr(purchaseDocVos));
maps.add(map);
map3.put("data", JSONUtil.toJsonStr(purchaseDocVos));
} else {
map3.put("data", "[]");
}
maps.add(map3);
}
if (mrpBaseService != null) {
//设计量与到货量对比
List<designAndArrivalComparisonVo> designAndArrivalComparisonVos = mrpBaseService.designAndArrivalComparison(projectId);
Map<String, String> map4 = new HashMap<>();
map4.put("type", "designAndArrivalComparison");
if (designAndArrivalComparisonVos != null && !designAndArrivalComparisonVos.isEmpty()) {
Map<String, String> map = new HashMap<>();
map.put("type", "designAndArrivalComparison");
map.put("data", JSONUtil.toJsonStr(designAndArrivalComparisonVos));
maps.add(map);
map4.put("data", JSONUtil.toJsonStr(designAndArrivalComparisonVos));
} else {
map4.put("data", "[]");
}
maps.add(map4);
//物资需求与实际到货对比
List<wzxqysjdhdbVo> wzxqysjdhdbVos = mrpBaseService.wzxqysjdhdb(projectId);
Map<String, String> map5 = new HashMap<>();
map5.put("type", "wzxqysjdhdb");
if (wzxqysjdhdbVos != null && !wzxqysjdhdbVos.isEmpty()) {
Map<String, String> map = new HashMap<>();
map.put("type", "wzxqysjdhdb");
map.put("data", JSONUtil.toJsonStr(wzxqysjdhdbVos));
maps.add(map);
map5.put("data", JSONUtil.toJsonStr(wzxqysjdhdbVos));
} else {
map5.put("data", "[]");
}
maps.add(map5);
}
if (materialsService != null) {
//物资跟踪管理台账
List<MatMaterialsUseDetailVo> useDetailVos = materialsService.listUseDetail(projectId);
Map<String, String> map6 = new HashMap<>();
map6.put("type", "listUseDetail");
if (useDetailVos != null && !useDetailVos.isEmpty()) {
Map<String, String> map = new HashMap<>();
map.put("type", "listUseDetail");
map.put("data", JSONUtil.toJsonStr(useDetailVos));
maps.add(map);
map6.put("data", JSONUtil.toJsonStr(useDetailVos));
} else {
map6.put("data", "[]");
}
maps.add(map6);
}
}
}