From 6bfedf8cfeed6f400a1527b45c6eec14bffd75d8 Mon Sep 17 00:00:00 2001
From: lius <Lius2225@163.com>
Date: 星期五, 01 九月 2023 10:24:50 +0800
Subject: [PATCH] 加班管理

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentOvertimeServiceImpl.java |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentOvertimeServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentOvertimeServiceImpl.java
index 42cd183..06e7f9b 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentOvertimeServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentOvertimeServiceImpl.java
@@ -1,11 +1,21 @@
 package org.jeecg.modules.mdc.service.impl;
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.apache.commons.lang.StringUtils;
 import org.jeecg.modules.mdc.entity.MdcEquipmentOvertime;
 import org.jeecg.modules.mdc.mapper.MdcEquipmentOvertimeMapper;
 import org.jeecg.modules.mdc.service.IMdcEquipmentOvertimeService;
+import org.jeecg.modules.mdc.service.IMdcEquipmentService;
 import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 
 /**
  * @Description: 璁惧鍔犵彮绠$悊
@@ -16,4 +26,41 @@
 @Service
 public class MdcEquipmentOvertimeServiceImpl extends ServiceImpl<MdcEquipmentOvertimeMapper, MdcEquipmentOvertime> implements IMdcEquipmentOvertimeService {
 
+    @Resource
+    private IMdcEquipmentService mdcEquipmentService;
+
+    @Override
+    public IPage<MdcEquipmentOvertime> pageList(String userId, Page<MdcEquipmentOvertime> page, MdcEquipmentOvertime mdcEquipmentOvertime, HttpServletRequest req) {
+        List<String> equipmentIds = new ArrayList<>();
+        if (StringUtils.isNotEmpty(mdcEquipmentOvertime.getParentId()) && StringUtils.isEmpty(mdcEquipmentOvertime.getEquipmentId())) {
+            if ("2".equals(mdcEquipmentOvertime.getTypeTree())) {
+                //閮ㄩ棬灞傜骇
+                equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, mdcEquipmentOvertime.getParentId());
+            } else {
+                //浜х嚎灞傜骇
+                equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, mdcEquipmentOvertime.getParentId());
+            }
+        } else if (StringUtils.isNotEmpty(mdcEquipmentOvertime.getEquipmentId())) {
+            //鍗曞彴璁惧淇℃伅
+            mdcEquipmentOvertime.setMdcSectionIds(Collections.singletonList(mdcEquipmentOvertime.getEquipmentId()));
+        } else {
+            //鏌ヨ鐢ㄦ埛鎷ユ湁鐨勬墍鏈夎澶囦俊鎭�
+            if ("2".equals(mdcEquipmentOvertime.getTypeTree())) {
+                //閮ㄩ棬灞傜骇
+                equipmentIds = mdcEquipmentService.getEquipmentIdsByDepart(userId, null);
+            } else {
+                //浜х嚎灞傜骇
+                equipmentIds = mdcEquipmentService.getEquipmentIdsProduction(userId, null);
+            }
+        }
+
+        if (mdcEquipmentOvertime.getMdcSectionIds() == null || mdcEquipmentOvertime.getMdcSectionIds().isEmpty()) {
+            mdcEquipmentOvertime.setMdcSectionIds(equipmentIds);
+        }
+
+        if (mdcEquipmentOvertime.getMdcSectionIds() == null || mdcEquipmentOvertime.getMdcSectionIds().isEmpty()) {
+            return null;
+        }
+        return this.baseMapper.pageList(page, mdcEquipmentOvertime);
+    }
 }

--
Gitblit v1.9.3