| | |
| | | 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; |
| | |
| | | @Resource |
| | | private MdcProductionEquipmentMapper productionEquipmentMapper; |
| | | |
| | | @Resource |
| | | private DncDeviceGroupPermissionMapper dncDeviceGroupPermissionMapper; |
| | | /** |
| | | * queryTreeList 对应 queryTreeList 查询所有的产线数据,以树结构形式响应给前端 |
| | | */ |
| | |
| | | mdcProduction.setOrgType(String.valueOf(orgType)); |
| | | mdcProduction.setDelFlag(CommonConstant.DEL_FLAG_0.toString()); |
| | | this.save(mdcProduction); |
| | | //新增DNC车间权限 |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | DncDeviceGroupPermission dncDeviceGroupPermission=new DncDeviceGroupPermission(); |
| | | dncDeviceGroupPermission.setGroupPermId(mdcProduction.getId()); |
| | | dncDeviceGroupPermission.setUserId(userId); |
| | | dncDeviceGroupPermissionMapper.insert(dncDeviceGroupPermission); |
| | | } |
| | | } |
| | | |
| | |
| | | @Override |
| | | public List<MdcProduction> queryProdByPid(String pid) { |
| | | return this.baseMapper.queryProdByPid(pid); |
| | | } |
| | | |
| | | /** |
| | | * 递归查询所有子节点 |
| | | */ |
| | | @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)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | 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; |
| | | } |
| | | } |