| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.catalina.User; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.constant.CacheConstant; |
| | |
| | | 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())); |
| | |
| | | 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); |
| | | } |
| | | |
| | | @Override |
| | | public void editUser(SysUser sysUser) { |
| | | userMapper.updateById(sysUser); |
| | | } |
| | | } |