From 438b6be5ea9ed484b50a45a0f210b80180473491 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期二, 11 二月 2025 11:51:45 +0800 Subject: [PATCH] dnc与mdc部门进行整合 使用Mdc部门进行处理 修改所属部门为所属车间 修改yml文件数据库地址 --- lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcProductionServiceImpl.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 51 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 120968b..1e330f5 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 @@ -2,6 +2,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.commons.lang3.StringUtils; @@ -312,4 +313,54 @@ } } } + + /** + * 鏌ヨ鎵�鏈夌埗鑺傜偣鍜屾湰鑺傜偣鍚嶇О + * @param id + * @return + */ + @Override + public List<String> findListParentTreeAll(String id){ + MdcProductionEquipment mdcProductionEquipment=productionEquipmentMapper.selectOne(new QueryWrapper<MdcProductionEquipment>().eq("equipment_id",id)); + if (mdcProductionEquipment==null) { + return null; + } + List<String> strings = new ArrayList<>(); + MdcProduction en=super.getById(mdcProductionEquipment.getProductionId()); + if (en == null) { + return null; + } + strings.add(en.getProductionName()); + if (StringUtils.isEmpty(en.getParentId())) { + return strings; + } else { + return findListParentTree(en.getParentId(),strings); + } + } + + // 鏌ヨ鎵�浠ョ埗鑺傜偣 + @Override + public List<String> findListParentTree(String parentId,List<String> stringList){ + if (StringUtils.isEmpty(parentId)) { + return null; + } + if (stringList == null || stringList.isEmpty()) { + stringList = new ArrayList<>(); + } + boolean p = true; + if (p) { + MdcProduction en = super.getById(parentId); + if (en != null) { + stringList.add(0,en.getProductionName()); + } + if (StringUtils.isNotBlank(en.getParentId())) { + parentId = en.getParentId(); + findListParentTree(parentId,stringList); + } else { + p = false; + return stringList; + } + } + return stringList; + } } -- Gitblit v1.9.3