From e8ed1a91c77ab62a924f12acd55777f227bacd7e Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期五, 21 十一月 2025 17:15:17 +0800
Subject: [PATCH] 工位组删除后,其下工位移动到默认组
---
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/SuperAggregateStateServiceImpl.java | 32 ++++++++++----------------------
1 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/SuperAggregateStateServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/SuperAggregateStateServiceImpl.java
index be6c444..3c91cd0 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/SuperAggregateStateServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/SuperAggregateStateServiceImpl.java
@@ -26,8 +26,8 @@
import com.qianwen.smartman.common.constant.CommonConstant;
import com.qianwen.smartman.common.constant.DateConstant;
import com.qianwen.smartman.common.utils.LocalDateTimeUtils;
-import com.qianwen.smartman.modules.cps.entity.Workstation;
-import com.qianwen.smartman.modules.cps.service.IWorkstationService;
+import com.qianwen.smartman.modules.smis.entity.Workstation;
+import com.qianwen.smartman.modules.smis.service.IWorkstationService;
import com.qianwen.smartman.modules.mdc.entity.SuperAggregate;
import com.qianwen.smartman.modules.mdc.entity.SuperAggregateState;
import com.qianwen.smartman.modules.mdc.enums.OpenTypeEnums;
@@ -71,7 +71,6 @@
@Override
public List<SuperAggregateState> getStatusDataWithFeedback(List<Long> workstationIds, StatisticalMethodEnum statisticalMethod, LocalDate startDate, LocalDate endDate) {
//绋煎姩鐜囨煡璇�
-
List<SuperAggregateState> statusDataList;
if (StatisticalMethodEnum.SHIFT.equals(statisticalMethod) || StatisticalMethodEnum.DAY.equals(statisticalMethod) || StatisticalMethodEnum.WEEK.equals(statisticalMethod) || StatisticalMethodEnum.MONTH.equals(statisticalMethod)) {
//statusDataList = this.aggregateStateFeedbackMapper.getStatusDataByFactoryDate(workstationIds, LocalDateTimeUtil.format(startDate, "yyyyMMdd"), LocalDateTimeUtil.format(endDate, "yyyyMMdd"));
@@ -105,25 +104,19 @@
@Override
public List<StatusTimeTopVO> getStatusTimeByWcs(List<Long> workstationIds, LocalDateTime startTime, LocalDateTime endTime, Integer status, Integer top) {
List<StatusTimeTopVO> voList = new ArrayList<>();
-
+ //鏌ヨ闄ゆ墍鏈夌姸鎬佹椂鍙敤鐨勫伐浣嶏紝杞崲浣� 宸ヤ綅id -> 宸ヤ綅 鐨刴ap
Map<Long, Workstation> workstationMap = this.workstationService.list(Wrappers.<Workstation>lambdaQuery()
.eq(Workstation::getStatus, CommonConstant.ENABLE)).stream().collect(Collectors.toMap(Workstation::getId, Function.identity()));
- /*
- Map<Long, Workstation> workstationMap = (Map) this.workstationService.list((Wrapper) Wrappers.lambdaQuery().eq((v0) -> {
- return v0.getStatus();
- }, CommonConstant.ENABLE)).stream().collect(Collectors.toMap((v0) -> {
- return v0.getId();
- }, Function.identity()));*/
- //List<SuperAggregateState> equipmentStatusDuration = this.baseMapper.getEquipmentStatusDuration(workstationIds, LocalDateTimeUtil.format(startTime, DateConstant.PATTERN_DATE_TIME), LocalDateTimeUtil.format(endTime, DateConstant.PATTERN_DATE_TIME), status);
-
+
// Date startTimeD = LocalDateUtil.localDateTimeToDate(startTime);
//startTimeD = new Date(124,8,2);
//Date endTimeD = LocalDateUtil.localDateTimeToDate(endTime);
//endTimeD = new Date(124,8,3);
+ //鏌ヨ鍑烘椂闂存鍐厀cs=status鐨勬墍鏈夋暟鎹�
List<SuperAggregateState> equipmentStatusDuration = this.baseMapper.getEquipmentStatusDuration(workstationIds, DateTimeUtil.toDate(startTime), DateTimeUtil.toDate(endTime), status);
- List<SuperAggregateState> equipmentStatusDuration2 = FilterOffUtils.filterOffDay(equipmentStatusDuration, OpenTypeEnums.TIME_USED_ANALYSIS);
+ List<SuperAggregateState> equipmentStatusDuration2 = FilterOffUtils.filterOffDay(equipmentStatusDuration, OpenTypeEnums.TIME_USED_ANALYSIS);//杩囨护鏁版嵁锛孴IME_USED_ANALYSIS open =1鍒欒繃婊�
Map<Long, Long> timeMap = buildDuration(startTime, equipmentStatusDuration2).stream().collect(Collectors.groupingBy(SuperAggregate::getWorkstationId, Collectors.summingLong(SuperAggregateState::getDurationCollect))).entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(top.intValue()).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, java.util.LinkedHashMap::new));
//yangys鏀逛簡buildDuration锛屽幓鎺変簡startTime鍙傛暟
//Map<Long, Long> timeMap = buildDuration(equipmentStatusDuration2,ChronoUnit.SECONDS).stream().collect(Collectors.groupingBy(SuperAggregate::getWorkstationId, Collectors.summingLong(SuperAggregateState::getDurationCollect))).entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(top.intValue()).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, java.util.LinkedHashMap::new));
@@ -185,6 +178,7 @@
@Override
public List<SuperAggregateState> getDataByMonth(List<Long> ids, Integer year, List<Integer> monthList) {
List<SuperAggregateState> data = this.baseMapper.getDataByMonth(ids, year, monthList);
+
return buildDuration(data);
}
@@ -195,20 +189,14 @@
List<SuperAggregateState> res = this.baseMapper.listCrossDay(startTime, endTime);
return buildDuration(res);
}
-
+ /*
@Override
public void saveState(List<SuperAggregateState> collect) {
Map<Long, List<SuperAggregateState>> map = collect.stream().collect(Collectors.groupingBy(SuperAggregate::getWorkstationId));
map.forEach(this.baseMapper::saveState);
- /*
- Map<Long, List<SuperAggregateState>> map = collect.stream().collect(Collectors.groupingBy((v0) -> {
- return v0.getWorkstationId();
- }));
- SuperAggregateStateMapper superAggregateStateMapper = this.baseMapper;
- superAggregateStateMapper.getClass();
- map.forEach(this::saveState);*/
+
}
-
+*/
@Override
public List<SuperAggregateState> getStatusDataByTime(List<Long> workstationIdList, LocalDateTime start, LocalDateTime end) {
List<SuperAggregateState> superAggregateStateList = new ArrayList<>();
--
Gitblit v1.9.3