| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.biz.system.SystemDictBiz; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | |
| | | import com.doumee.dao.business.join.CompanyJoinMapper; |
| | | import com.doumee.dao.business.model.Company; |
| | | import com.doumee.dao.business.model.dto.CompanyCreatOrUpdateRequest; |
| | | import com.doumee.dao.system.SystemDictMapper; |
| | | import com.doumee.dao.system.SystemUserMapper; |
| | | import com.doumee.dao.system.SystemUserRoleMapper; |
| | | import com.doumee.dao.system.model.SystemDict; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.dao.system.model.SystemUserRole; |
| | | import com.doumee.service.business.CompanyService; |
| | | import com.doumee.service.system.SystemDictService; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | |
| | | |
| | | @Autowired |
| | | private SystemUserMapper systemUserMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private SystemUserRoleMapper systemUserRoleMapper; |
| | | |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | @Override |
| | |
| | | .eq(SystemUser::getId,company.getManagerId()) |
| | | .set(SystemUser::getCompanyId,insert.getId()); |
| | | systemUserMapper.update(null,systemUserQuery); |
| | | |
| | | |
| | | SystemDictData dictData = systemDictDataBiz.queryByCode(Constants.SYSTEM, Constants.COMPANY_MANAGE_ROLE); |
| | | |
| | | SystemUserRole systemUserRole = new SystemUserRole(); |
| | | systemUserRole.setUserId(company.getManagerId()); |
| | | systemUserRole.setRoleId(Integer.valueOf(dictData.getCode())); |
| | | systemUserRole.setCreateTime(new Date()); |
| | | systemUserRole.setUpdateTime(new Date()); |
| | | systemUserRole.setCreateUser(userInfo.getId()); |
| | | systemUserRole.setUpdateUser(userInfo.getId()); |
| | | systemUserRole.setDeleted(Boolean.FALSE); |
| | | |
| | | systemUserRoleMapper.insert(systemUserRole); |
| | | return company.getId(); |
| | | } |
| | | |