From dcffd347f5ab47d3d158afddb86249fe8bc7e3e7 Mon Sep 17 00:00:00 2001
From: lius <Lius2225@163.com>
Date: 星期三, 12 七月 2023 13:56:56 +0800
Subject: [PATCH] 扭矩配置导入导出分页列表接口bug修复

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEfficiencyReportServiceImpl.java |   44 ++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEfficiencyReportServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEfficiencyReportServiceImpl.java
index 7cddfa0..2e732c1 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEfficiencyReportServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEfficiencyReportServiceImpl.java
@@ -13,6 +13,7 @@
 import org.jeecg.modules.mdc.util.DateUtils;
 import org.jeecg.modules.mdc.vo.MdcEfficiencyReportQueryVo;
 import org.jeecg.modules.mdc.vo.MdcEfficiencyReportShiftQueryVo;
+import org.jeecg.modules.mdc.vo.MdcEfficiencyShiftVo;
 import org.jeecg.modules.mdc.vo.MdcEfficiencyVo;
 import org.jeecg.modules.system.entity.MdcProduction;
 import org.jeecg.modules.system.entity.SysDepart;
@@ -414,8 +415,47 @@
      * @return
      */
     @Override
-    public MdcEfficiencyVo efficiencyShiftList(String userId, MdcEfficiencyReportShiftQueryVo vo) {
-        return null;
+    public MdcEfficiencyShiftVo efficiencyShiftList(String userId, MdcEfficiencyReportShiftQueryVo vo) {
+        MdcEfficiencyShiftVo result = new MdcEfficiencyShiftVo();
+        List<MdcEfficiencyShiftListDto> listDtos = new ArrayList<>();
+        List<String> equipmentIds = new ArrayList<>();
+        if (StringUtils.isNotEmpty(vo.getParentId()) && StringUtils.isEmpty(vo.getEquipmentId())) {
+            if ("2".equals(vo.getTypeTree())) {
+                // 閮ㄩ棬灞傜骇
+                equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, vo.getParentId());
+            } else {
+                // 浜х嚎灞傜骇
+                equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, vo.getParentId());
+            }
+        } else if (StringUtils.isNotEmpty(vo.getEquipmentId())) {
+            // 鍗曞彴璁惧淇℃伅
+            vo.setEquipmentIdList(Collections.singletonList(vo.getEquipmentId()));
+        } else {
+            // 鏌ヨ鐢ㄦ埛鎷ユ湁鐨勬墍鏈夎澶囦俊鎭�
+            if ("2".equals(vo.getTypeTree())) {
+                // 閮ㄩ棬灞傜骇
+                equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, null);
+            } else {
+                // 浜х嚎灞傜骇
+                equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, null);
+            }
+        }
+        if (vo.getEquipmentIdList() == null || vo.getEquipmentIdList().isEmpty()) {
+            vo.setEquipmentIdList(equipmentIds);
+        }
+
+        List<String> dates = DateUtils.getDatesStringList2(DateUtils.getShortDate2(vo.getStartTime()), DateUtils.getShortDate2(vo.getEndTime()));
+        result.setDates(dates);
+
+        if (vo.getEquipmentIdList() == null || vo.getEquipmentIdList().isEmpty()) {
+            result.setMdcEfficiencyList(listDtos);
+        } else {
+            // 鐝鍒╃敤鐜囩瓑绾�
+            List<MdcUtilizationRate> mdcUtilizationRateList = mdcUtilizationRateService.listByType("kdl");
+
+        }
+
+        return result;
     }
 
     private MdcEfficiencyResultDto efficiencyRate(List<MdcEfficiencyDto> efficiencyList, String date, String equipmentId, List<MdcUtilizationRate> mdcUtilizationRateList) {

--
Gitblit v1.9.3