| | |
| | | import org.jeecg.modules.base.entity.UserFactory; |
| | | import org.jeecg.modules.base.mapper.UserFactoryMapper; |
| | | import org.jeecg.modules.base.service.BaseCommonService; |
| | | import org.jeecg.modules.mdc.entity.MdcUserProduction; |
| | | import org.jeecg.modules.mdc.mapper.MdcUserProductionMapper; |
| | | import org.jeecg.modules.system.entity.*; |
| | | import org.jeecg.modules.system.mapper.*; |
| | | import org.jeecg.modules.system.model.SysUserSysDepartModel; |
| | |
| | | SysRoleIndexMapper sysRoleIndexMapper; |
| | | @Resource |
| | | UserFactoryMapper userFactoryMapper; |
| | | @Resource |
| | | MdcUserProductionMapper mdcUserProductionMapper; |
| | | @Resource |
| | | private ISysDictService sysDictService; |
| | | |
| | |
| | | //step.4 保存所属产线 |
| | | if (oConvertUtils.isNotEmpty(selectedProductions)) { |
| | | arr = selectedProductions.split(","); |
| | | for (String factoryId : arr) { |
| | | UserFactory userFactory = new UserFactory(user.getId(), factoryId); |
| | | userFactoryMapper.insert(userFactory); |
| | | for (String productionId : arr) { |
| | | UserFactory mdcUserProduction = new UserFactory(productionId, user.getId()); |
| | | userFactoryMapper.insert(mdcUserProduction); |
| | | } |
| | | } |
| | | //step.5 保存设备权限 |
| | |
| | | //先删后加 |
| | | userFactoryMapper.delete(new QueryWrapper<UserFactory>().lambda().eq(UserFactory::getUserId, user.getId())); |
| | | if (oConvertUtils.isNotEmpty(productions)) { |
| | | for (String factoryId : array) { |
| | | UserFactory userFactory = new UserFactory(user.getId(), factoryId); |
| | | userFactoryMapper.insert(userFactory); |
| | | for (String productionId : array) { |
| | | UserFactory mdcUserProduction = new UserFactory(productionId, user.getId()); |
| | | userFactoryMapper.insert(mdcUserProduction); |
| | | } |
| | | } |
| | | |
| | | //step.5 修改设备权限 |
| | | //先删后加 |
| | | // dncDevicePermissionMapper.delete(new QueryWrapper<DncDevicePermission>().lambda().eq(DncDevicePermission::getUserId, user.getId())); |