From 42e68faca0756d44b7c880c9876810ee47d6e92b Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期一, 17 二月 2025 17:57:25 +0800 Subject: [PATCH] 1.DNC模块,设备结构树权限分配优化与修改bug 2.MDC模块,设备编辑车间同步平移设备send目录 3.优化原有指派设备代码 --- lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcUserProductionServiceImpl.java | 75 +++++++++++++++++++++++++++++++++++++ 1 files changed, 75 insertions(+), 0 deletions(-) diff --git a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcUserProductionServiceImpl.java b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcUserProductionServiceImpl.java index 789406c..bbe3b74 100644 --- a/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcUserProductionServiceImpl.java +++ b/lxzn-module-system/lxzn-system-biz/src/main/java/org/jeecg/modules/system/service/impl/MdcUserProductionServiceImpl.java @@ -1,14 +1,17 @@ package org.jeecg.modules.system.service.impl; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.jeecg.modules.system.entity.MdcProduction; import org.jeecg.modules.system.entity.MdcUserProduction; +import org.jeecg.modules.system.entity.SysUser; import org.jeecg.modules.system.mapper.MdcUserProductionMapper; import org.jeecg.modules.system.model.ProductionIdModel; import org.jeecg.modules.system.service.IMdcProductionService; import org.jeecg.modules.system.service.IMdcUserProductionService; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.ArrayList; @@ -63,4 +66,76 @@ public List<String> queryProductionIdsByUserId(String userId) { return this.baseMapper.queryProductionIdsByUserId(userId); } + + /** + * 鏍规嵁涓�缁勮溅闂磇d鏌ヨ鐢ㄦ埛浜х嚎淇℃伅 + * @param productionIds + */ + @Override + public List<MdcUserProduction> queryByProductionIds(List<String> productionIds){ + if (!productionIds.isEmpty()){ + return super.list(new LambdaQueryWrapper<MdcUserProduction>().in(MdcUserProduction::getProId, productionIds)); + } + return null; + } + + @Override + @Transactional(rollbackFor = {Exception.class}) + public boolean removeByCollection(List<MdcUserProduction> mdcUserProductions) { + if(mdcUserProductions == null || mdcUserProductions.isEmpty()) + return false; + if(mdcUserProductions.size() == 1){ + return super.removeById(mdcUserProductions.get(0).getId()); + } + List<String> ids = new ArrayList<>(); + mdcUserProductions.forEach(item -> { + ids.add(item.getId()); + }); + return super.removeByIds(ids); + } + + /** + * 鑾峰彇宸插垎閰嶇殑鐢ㄦ埛鍒楄〃 + * @param proId + * @return + */ + @Override + public List<SysUser> getUserPermsByGroupId(String proId){ + return super.getBaseMapper().getUserPermsByGroupId(proId); + } + + /** + * 鑾峰彇鏈垎閰嶇殑鐢ㄦ埛鍒楄〃 + * @param proId + * @return + */ + @Override + public List<SysUser> getUserNonPermsByGroupId(String proId){ + return super.getBaseMapper().getUserNonPermsByGroupId(proId); + } + + /** + * 鑾峰彇鏈垎閰嶇殑鐢ㄦ埛 + * @param proId + * @return + */ + @Override + public List<SysUser> getUserNonPermsByDeviceId(String proId){ + return super.getBaseMapper().getUserNonPermsByDeviceId(proId); + } + + @Override + public List<SysUser> getUserPermsByDeviceId(String proId) { + return super.getBaseMapper().getUserPermsByDeviceId(proId); + } + + @Override + public MdcUserProduction getByUserIdAndGroupId(String userId, String proId){ + if(StrUtil.isEmpty(userId) || StrUtil.isEmpty(proId)) + return null; + List<MdcUserProduction> list = super.lambdaQuery().eq(MdcUserProduction::getUserId, userId).eq(MdcUserProduction::getProId, proId).list(); + if(list == null || list.isEmpty()) + return null; + return list.get(0); + } } -- Gitblit v1.9.3