From ed9f1d757d6d3486dd69a726454eb69c3c9bc538 Mon Sep 17 00:00:00 2001 From: lyh <liuyuanheng@xalxzn.com> Date: 星期二, 25 二月 2025 11:28:04 +0800 Subject: [PATCH] flowable工作流 config配置 --- lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcProductionServiceImpl.java | 95 +++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 87 insertions(+), 8 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 e0511bb..ceba76d 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 @@ -1,22 +1,20 @@ package org.jeecg.modules.system.service.impl; +import cn.hutool.core.util.StrUtil; 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; +import org.apache.shiro.SecurityUtils; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.FillRuleConstant; +import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.util.FillRuleUtil; import org.jeecg.common.util.oConvertUtils; -import org.jeecg.modules.system.entity.MdcProduction; -import org.jeecg.modules.system.entity.MdcProductionEquipment; -import org.jeecg.modules.system.entity.MdcUserProduction; -import org.jeecg.modules.system.entity.SysUser; -import org.jeecg.modules.system.mapper.MdcProductionEquipmentMapper; -import org.jeecg.modules.system.mapper.MdcProductionMapper; -import org.jeecg.modules.system.mapper.MdcUserProductionMapper; -import org.jeecg.modules.system.mapper.SysUserMapper; +import org.jeecg.modules.system.entity.*; +import org.jeecg.modules.system.mapper.*; import org.jeecg.modules.system.model.MdcProductionTreeModel; import org.jeecg.modules.system.model.ProductionIdModel; import org.jeecg.modules.system.service.IMdcProductionService; @@ -77,6 +75,9 @@ query.orderByAsc(MdcProduction::getProductionOrder); List<MdcProduction> list = this.list(query); for (MdcProduction production : list) { + if (production.getDescription().isEmpty()){ + production.setDescription(""); + } listResult.add(new MdcProductionTreeModel(production)); } return listResult; @@ -196,6 +197,15 @@ } /** + * 閫掑綊鏌ヨ鎵�鏈夊瓙鑺傜偣 + */ + @Override + public List<MdcProduction> recursionChildrenByPid(String pid){ + List<String> ids=this.recursionChildren(pid); + return super.list(new LambdaQueryWrapper<MdcProduction>().eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString()).in(MdcProduction::getId, ids)); + } + + /** * 鏍规嵁鐢ㄦ埛id鑾峰彇浜х嚎涓嬫媺鏍戦�夐」 */ @Override @@ -309,4 +319,73 @@ } } } + + /** + * 鏌ヨ鎵�鏈夌埗鑺傜偣鍜屾湰鑺傜偣鍚嶇О + * @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; + } + + /** + * 鑾峰彇鐢ㄦ埛宸插垎閰嶇殑閮ㄩ棬鍒楄〃 + * @param userId + * @return + */ + @Override + public Map<String, MdcProduction> getUserAssignedDepart(String userId){ + if(StrUtil.isEmpty(userId)) + return null; + List<MdcProduction> userPermDepart = this.baseMapper.findAllProductionId(userId); + if(userPermDepart == null || userPermDepart.isEmpty()) + return null; + Map<String, MdcProduction> map = new HashMap<>(); + userPermDepart.forEach(item -> { + map.put(item.getId(), item); + }); + return map; + } } -- Gitblit v1.9.3