From b0f56573ea27a8798764314c72cf39e9eb0651dc Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期四, 27 三月 2025 16:04:31 +0800
Subject: [PATCH] 综合利用率图表接口

---
 lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcProductionServiceImpl.java |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcProductionServiceImpl.java b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcProductionServiceImpl.java
index f94adf6..5bfc7ff 100644
--- a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcProductionServiceImpl.java
+++ b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcProductionServiceImpl.java
@@ -11,6 +11,7 @@
 import org.apache.commons.lang3.StringUtils;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.constant.FillRuleConstant;
+import org.jeecg.common.system.vo.DictModel;
 import org.jeecg.common.util.FillRuleUtil;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.system.entity.*;
@@ -21,8 +22,10 @@
 import org.jeecg.modules.system.model.MdcProductionTreeModel;
 import org.jeecg.modules.system.model.ProductionIdModel;
 import org.jeecg.modules.system.service.IMdcProductionService;
+import org.jeecg.modules.system.service.ISysDictService;
 import org.jeecg.modules.system.service.ISysParamsService;
 import org.jeecg.modules.system.util.FindsProductionsChildrenUtil;
+import org.jeecg.modules.system.vo.MdcProOptionsVo;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -51,6 +54,9 @@
 
     @Resource
     private ISysParamsService sysParamsService;
+
+    @Resource
+    private ISysDictService sysDictService;
     /**
      * queryTreeList 瀵瑰簲 queryTreeList 鏌ヨ鎵�鏈夌殑浜х嚎鏁版嵁,浠ユ爲缁撴瀯褰㈠紡鍝嶅簲缁欏墠绔�
      */
@@ -521,6 +527,54 @@
         return FindsProductionsChildrenUtil.wrapTreeDataToTreeList(list);
     }
 
+    @Override
+    public List<String> findChildren(List<String> mdcProductionIds) {
+        return this.baseMapper.findChildren(mdcProductionIds);
+    }
+
+    /**
+     * 鏍规嵁鐢ㄦ埛id鑾峰彇浜х嚎(涓績)鎴栫彮缁勪笅鎷夐�夐」
+     * @param userId
+     * @param productionId
+     * @return
+     */
+    @Override
+    public List<MdcProOptionsVo> loadProductionOptions(String userId, String productionId) {
+        List<MdcProOptionsVo> result = new ArrayList<>();
+        List<MdcProduction> mdcProductionList = this.baseMapper.loadProductionOptions(userId, productionId);
+        if (mdcProductionList != null && !mdcProductionList.isEmpty()) {
+            for (MdcProduction mdcProduction : mdcProductionList) {
+                MdcProOptionsVo vo = new MdcProOptionsVo().convert(mdcProduction);
+                result.add(vo);
+            }
+        }
+        return result;
+    }
+
+    @Override
+    public List<MdcProOptionsVo> loadTeamOptions(String userId, String productionId) {
+        List<MdcProOptionsVo> result = new ArrayList<>();
+        List<String> productionList = this.findChildren(Arrays.asList(productionId.split(",")));
+        if (productionList != null && !productionList.isEmpty()) {
+            List<String> dictValues = this.baseMapper.findTeamValue(userId, productionList);
+            if (dictValues != null && !dictValues.isEmpty()) {
+                List<DictModel> dictModels = sysDictService.queryEnableDictItemsByCode(CommonConstant.DICT_MDC_STAFF_TEAM);
+                if (dictModels != null && !dictModels.isEmpty()) {
+                    for (DictModel dictModel : dictModels) {
+                        if (dictValues.contains(dictModel.getValue())) {
+                            MdcProOptionsVo vo = new MdcProOptionsVo();
+                            vo.setKey(dictModel.getValue());
+                            vo.setValue(dictModel.getValue());
+                            vo.setTitle(dictModel.getText());
+                            result.add(vo);
+                        }
+                    }
+                }
+            }
+        }
+        return result;
+    }
+
     /**
      * 鎵撳紑 鐖惰妭鐐� 鍙� 浠ヤ笂鐨刴dc鏍囪
      * @param parentId

--
Gitblit v1.9.3