| | |
| | | UserFactoryMapper userFactoryMapper; |
| | | @Resource |
| | | private ISysDictService sysDictService; |
| | | @Resource |
| | | private MdcProductionEquipmentMapper mdcProductionEquipmentMapper; |
| | | @Resource |
| | | private DncDevicePermissionMapper dncDevicePermissionMapper; |
| | | |
| | | @Override |
| | | @CacheEvict(value = {CacheConstant.SYS_USERS_CACHE}, allEntries = true) |
| | |
| | | } |
| | | } |
| | | //step.5 保存设备权限 |
| | | List<String> EquipmentIds= mdcProductionEquipmentMapper.selectList(new QueryWrapper<MdcProductionEquipment>().in("production_id",arr)) |
| | | .stream().map(MdcProductionEquipment::getEquipmentId).collect(Collectors.toList()); |
| | | if (oConvertUtils.isNotEmpty(EquipmentIds)) { |
| | | for (String equipmentId : EquipmentIds) { |
| | | DncDevicePermission dncDevicePermission=new DncDevicePermission(); |
| | | dncDevicePermission.setDeviceId(equipmentId); |
| | | dncDevicePermission.setUserId(user.getId()); |
| | | dncDevicePermissionMapper.insert(dncDevicePermission); |
| | | } |
| | | } |
| | | // List<String> EquipmentIds= mdcProductionEquipmentMapper.selectList(new QueryWrapper<MdcProductionEquipment>().in("production_id",arr)) |
| | | // .stream().map(MdcProductionEquipment::getEquipmentId).collect(Collectors.toList()); |
| | | // if (oConvertUtils.isNotEmpty(EquipmentIds)) { |
| | | // for (String equipmentId : EquipmentIds) { |
| | | // DncDevicePermission dncDevicePermission=new DncDevicePermission(); |
| | | // dncDevicePermission.setDeviceId(equipmentId); |
| | | // dncDevicePermission.setUserId(user.getId()); |
| | | // dncDevicePermissionMapper.insert(dncDevicePermission); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | //step.5 修改设备权限 |
| | | //先删后加 |
| | | dncDevicePermissionMapper.delete(new QueryWrapper<DncDevicePermission>().lambda().eq(DncDevicePermission::getUserId, user.getId())); |
| | | List<String> EquipmentIds= mdcProductionEquipmentMapper.selectList(new QueryWrapper<MdcProductionEquipment>().in("production_id",array)) |
| | | .stream().map(MdcProductionEquipment::getEquipmentId).collect(Collectors.toList()); |
| | | if (oConvertUtils.isNotEmpty(EquipmentIds)) { |
| | | for (String equipmentId : EquipmentIds) { |
| | | DncDevicePermission dncDevicePermission=new DncDevicePermission(); |
| | | dncDevicePermission.setDeviceId(equipmentId); |
| | | dncDevicePermission.setUserId(user.getId()); |
| | | dncDevicePermissionMapper.insert(dncDevicePermission); |
| | | } |
| | | } |
| | | // dncDevicePermissionMapper.delete(new QueryWrapper<DncDevicePermission>().lambda().eq(DncDevicePermission::getUserId, user.getId())); |
| | | // List<String> EquipmentIds= mdcProductionEquipmentMapper.selectList(new QueryWrapper<MdcProductionEquipment>().in("production_id",array)) |
| | | // .stream().map(MdcProductionEquipment::getEquipmentId).collect(Collectors.toList()); |
| | | // if (oConvertUtils.isNotEmpty(EquipmentIds)) { |
| | | // for (String equipmentId : EquipmentIds) { |
| | | // DncDevicePermission dncDevicePermission=new DncDevicePermission(); |
| | | // dncDevicePermission.setDeviceId(equipmentId); |
| | | // dncDevicePermission.setUserId(user.getId()); |
| | | // dncDevicePermissionMapper.insert(dncDevicePermission); |
| | | // } |
| | | // } |
| | | //step.6 修改手机号和邮箱 |
| | | // 更新手机号、邮箱空字符串为 null |
| | | userMapper.updateNullByEmptyString("email"); |
| | |
| | | public IPage<SysUser> getUserByGroupId(Page<SysUser> page, String groupId, String username) { |
| | | return userMapper.getUserByGroupId(page,groupId,username); |
| | | } |
| | | |
| | | /** |
| | | * 根据产线Id查询 |
| | | * @param page |
| | | * @param factoryId 班组id |
| | | * @param username 用户账户名称 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<SysUser> getUserByFactoryId(Page<SysUser> page, String factoryId, String username) { |
| | | return userMapper.getUserByFactoryId(page,factoryId,username); |
| | | } |
| | | } |