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/StatusRecordServiceImpl.java | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/StatusRecordServiceImpl.java b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/StatusRecordServiceImpl.java
index e175dae..843f0f4 100644
--- a/smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/StatusRecordServiceImpl.java
+++ b/smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/StatusRecordServiceImpl.java
@@ -39,10 +39,10 @@
import com.qianwen.smartman.common.utils.CommonUtil;
import com.qianwen.smartman.common.utils.ListUtils;
import com.qianwen.smartman.common.utils.LocalDateTimeUtils;
-import com.qianwen.smartman.modules.cps.entity.GlobalWcs;
-import com.qianwen.smartman.modules.cps.entity.Workstation;
-import com.qianwen.smartman.modules.cps.enums.WorkstationTypeEnum;
-import com.qianwen.smartman.modules.cps.service.IWorkstationService;
+import com.qianwen.smartman.modules.smis.entity.GlobalWcs;
+import com.qianwen.smartman.modules.smis.entity.Workstation;
+import com.qianwen.smartman.modules.smis.enums.WorkstationTypeEnum;
+import com.qianwen.smartman.modules.smis.service.IWorkstationService;
import com.qianwen.smartman.modules.mdc.convert.StatusRecordConvert;
import com.qianwen.smartman.modules.mdc.dto.GroupWorkDTO;
import com.qianwen.smartman.modules.mdc.dto.ShiftIndexNameDTO;
@@ -91,7 +91,7 @@
List<StatusRecordDateVO> result = new ArrayList<>();
List<WorkstationInfoVO> workstationList = statusRecordDateSelectVO.getWorkstationInfoList();
if (Func.isEmpty(workstationList)) {
- workstationList = (List<WorkstationInfoVO>)this.workstationService.list(Wrappers.<Workstation>lambdaQuery().eq(Workstation::getType, WorkstationTypeEnum.MACHINE.getCode()).eq(BaseEntity::getStatus, CommonConstant.ENABLE)).stream().map(s -> {
+ workstationList = this.workstationService.list(Wrappers.<Workstation>lambdaQuery().eq(Workstation::getType, WorkstationTypeEnum.MACHINE.getCode()).eq(BaseEntity::getStatus, CommonConstant.ENABLE)).stream().map(s -> {
WorkstationInfoVO workstationInfoVO = new WorkstationInfoVO();
workstationInfoVO.setId(s.getId());
workstationInfoVO.setName(s.getName());
@@ -113,13 +113,10 @@
}
page.setTotal(workstationList.size());
List<WorkstationInfoVO> workstationList2 = workstationList.stream().skip((page.getCurrent() - 1) * page.getSize()).limit(page.getSize()).collect(Collectors.toList());
- List<Long> workstationIdList = workstationList2.stream().map((v0) -> {
- return v0.getId();
- }).collect(Collectors.toList());
+ List<Long> workstationIdList = workstationList2.stream().map(WorkstationInfoVO::getId).collect(Collectors.toList());
+
List<SuperAggregateState> superAggregateStateList = this.superAggregateStateService.getStatusData(workstationIdList, null, statusRecordDateSelectVO.getDate(), statusRecordDateSelectVO.getDate());
- Map<Long, List<SuperAggregateState>> workstationStatusMap = superAggregateStateList.stream().collect(Collectors.groupingBy((v0) -> {
- return v0.getWorkstationId();
- }));
+ Map<Long, List<SuperAggregateState>> workstationStatusMap = superAggregateStateList.stream().collect(Collectors.groupingBy(SuperAggregateState::getWorkstationId));
workstationList2.forEach(x -> {
StatusRecordDateVO statusRecord = new StatusRecordDateVO().setWorkstationInfo(x).setStatusRecordList(StatusRecordConvert.INSTANCE.convert(workstationStatusMap.get(x.getId())));
result.add(statusRecord);
@@ -169,12 +166,16 @@
public List<ChartDataVO> getEquipmentEfficiency(StatusRecordDetailSelectVO statusRecordDetailSelectVO) {
List<ChartDataVO> result = new ArrayList<>();
List<SuperAggregateState> superAggregateStateList = this.superAggregateStateService.getStatusData(Arrays.asList(statusRecordDetailSelectVO.getWorkstationId()), null, statusRecordDetailSelectVO.getDate(), statusRecordDetailSelectVO.getDate());
- List<SuperAggregateState> oeeAggregateStateList = this.superAggregateStateService.getStatusDataWithFeedback(Arrays.asList(statusRecordDetailSelectVO.getWorkstationId()), null, statusRecordDetailSelectVO.getDate(), statusRecordDetailSelectVO.getDate());
+
+ //涓嬮潰涓�琛屼笉鐢ㄤ簡锛屽簲涓虹鍔ㄧ巼鍐嶅垎鏋愯缃晫闈㈠拰杩欓噷涓嶇浉绗︼紝鎴戜滑鍚屾剰浣跨敤鐘舵�佹暟鎹紝涓嶇敤feedback鐨�
+ //List<SuperAggregateState> oeeAggregateStateList = this.superAggregateStateService.getStatusDataWithFeedback(Arrays.asList(statusRecordDetailSelectVO.getWorkstationId()), null, statusRecordDetailSelectVO.getDate(), statusRecordDetailSelectVO.getDate());
ProductivityTypeEnum[] values = ProductivityTypeEnum.values();
int length = values.length;
for (int i = 0; i < length; i++) {
ProductivityTypeEnum productivityTypeEnum = values[i];
- ChartDataVO chartData = new ChartDataVO().setName(productivityTypeEnum.getMessage()).setValue(EifficiencyUtils.calculationResults(productivityTypeEnum == ProductivityTypeEnum.OEE ? oeeAggregateStateList : superAggregateStateList, productivityTypeEnum));
+ //ChartDataVO chartData = new ChartDataVO().setName(productivityTypeEnum.getMessage()).setValue(EifficiencyUtils.calculationResults(productivityTypeEnum == ProductivityTypeEnum.OEE ? oeeAggregateStateList : superAggregateStateList, productivityTypeEnum));
+ //涓婇潰涓�琛岋紝鍘绘帀oee鐨勪紶鍊�
+ ChartDataVO chartData = new ChartDataVO().setName(productivityTypeEnum.getMessage()).setValue(EifficiencyUtils.calculationResults(superAggregateStateList, productivityTypeEnum));
result.add(chartData);
}
return result;
@@ -227,7 +228,7 @@
HashMap<String, String> hashMap = new HashMap<>(16);
hashMap.put("shiftIndex", x.getShiftIndex() + "");
hashMap.put("shiftIndexName", x.getShiftIndexName());
- List<SuperAggregateState> shiftIndexStatusList = shiftIndexStatusMap.get(x.getShiftIndex());
+ List<SuperAggregateState> shiftIndexStatusList = shiftIndexStatusMap.get(x.getShiftIndex());//null
if (Func.isNotEmpty(shiftIndexStatusList)) {
hashMap.put("oee", EifficiencyUtils.calculationResults(shiftIndexStatusList, ProductivityTypeEnum.OEE) + "");
hashMap.put("fault", EifficiencyUtils.calculationResults(shiftIndexStatusList, ProductivityTypeEnum.ALARM) + "");
@@ -315,7 +316,7 @@
MultipartFile multipartFile = ExcelUtil.exportToMultipartFile(fileName, ExcelConstant.STATUS_RECORD, exportList, StatusRecordExport.class);
return this.ossBuilder.tempTemplate().putFile(multipartFile.getOriginalFilename(), multipartFile);
}
-
+ /*
@Override
public List<List<SuperAggregateStateVO>> crossDayState(CrossDayStateVO vo) {
LocalDate date = vo.getDate();
@@ -334,7 +335,7 @@
}).collect(Collectors.toList());
this.superAggregateStateService.saveState(collect);
return list;
- }
+ }*/
@Override
public IPage<StatusRecordDateVO> getStatusRecordByDates(IPage<StatusRecordDateVO> page, StatusRecordDateTimeSelectVO statusRecordDateTimeSelectVO) {
--
Gitblit v1.9.3