portal
This commit is contained in:
@@ -12,6 +12,10 @@ import com.yxt.portal.biz.sysorganization.SysOrganization;
|
|||||||
import com.yxt.portal.biz.sysorganization.SysOrganizationService;
|
import com.yxt.portal.biz.sysorganization.SysOrganizationService;
|
||||||
import com.yxt.portal.biz.syspost.SysPost;
|
import com.yxt.portal.biz.syspost.SysPost;
|
||||||
import com.yxt.portal.biz.syspost.SysPostService;
|
import com.yxt.portal.biz.syspost.SysPostService;
|
||||||
|
import com.yxt.portal.biz.sysrole.SysRole;
|
||||||
|
import com.yxt.portal.biz.sysrole.SysRoleDto;
|
||||||
|
import com.yxt.portal.biz.sysrole.SysRoleService;
|
||||||
|
import com.yxt.portal.biz.sysroleauthorize.SysRoleAuthorizeService;
|
||||||
import com.yxt.portal.biz.sysstaffinfo.SysStaffinfo;
|
import com.yxt.portal.biz.sysstaffinfo.SysStaffinfo;
|
||||||
import com.yxt.portal.biz.sysstaffinfo.SysStaffinfoService;
|
import com.yxt.portal.biz.sysstaffinfo.SysStaffinfoService;
|
||||||
import com.yxt.portal.biz.sysstaffinfo.SysStaffinfoVo;
|
import com.yxt.portal.biz.sysstaffinfo.SysStaffinfoVo;
|
||||||
@@ -22,6 +26,9 @@ import com.yxt.portal.biz.sysstaffpost.SysStaffPost;
|
|||||||
import com.yxt.portal.biz.sysstaffpost.SysStaffPostService;
|
import com.yxt.portal.biz.sysstaffpost.SysStaffPostService;
|
||||||
import com.yxt.portal.biz.sysuser.*;
|
import com.yxt.portal.biz.sysuser.*;
|
||||||
import com.yxt.portal.biz.sysuser.app.OrgList;
|
import com.yxt.portal.biz.sysuser.app.OrgList;
|
||||||
|
import com.yxt.portal.biz.sysuserrole.SysUserRole;
|
||||||
|
import com.yxt.portal.biz.sysuserrole.SysUserRoleDto;
|
||||||
|
import com.yxt.portal.biz.sysuserrole.SysUserRoleService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
@@ -67,6 +74,13 @@ public class SysUserRest {
|
|||||||
private SysPostService sysPostService;
|
private SysPostService sysPostService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private HttpServletRequest httpServletRequest;
|
private HttpServletRequest httpServletRequest;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysRoleService sysRoleService;
|
||||||
|
@Autowired
|
||||||
|
private SysUserRoleService sysUserRoleService;
|
||||||
|
@Autowired
|
||||||
|
private SysRoleAuthorizeService sysRoleAuthorizeService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
// private SystemLogService systemLogService;
|
// private SystemLogService systemLogService;
|
||||||
// 定义点选文字图片验证码允许的误差值
|
// 定义点选文字图片验证码允许的误差值
|
||||||
@@ -520,16 +534,12 @@ public class SysUserRest {
|
|||||||
@ApiOperation(value = "绑定组织")
|
@ApiOperation(value = "绑定组织")
|
||||||
@ApiOperationSupport(order = 30)
|
@ApiOperationSupport(order = 30)
|
||||||
public ResultBean bindOrganization(@RequestBody SysUserDto dto) {
|
public ResultBean bindOrganization(@RequestBody SysUserDto dto) {
|
||||||
|
|
||||||
//部门sid
|
|
||||||
String deptSid = dto.getDeptSid();
|
|
||||||
//岗位sid
|
|
||||||
String postSid = dto.getPostSid();
|
|
||||||
SysUser sysUser=sysUserService.getOne(new QueryWrapper<SysUser>().eq("sid",dto.getUserSid()));
|
SysUser sysUser=sysUserService.getOne(new QueryWrapper<SysUser>().eq("sid",dto.getUserSid()));
|
||||||
SysOrganization sysOrg=new SysOrganization();
|
SysOrganization sysOrg=new SysOrganization();
|
||||||
sysOrg.setName(dto.getCompanyName());
|
sysOrg.setName(dto.getCompanyName());
|
||||||
sysOrg.setLinkPhone(dto.getContacts());
|
sysOrg.setLinkPhone(dto.getContacts());
|
||||||
sysOrganizationService.save(sysOrg);
|
sysOrganizationService.save(sysOrg);
|
||||||
|
|
||||||
SysStaffOrg sysStaffOrg=new SysStaffOrg();
|
SysStaffOrg sysStaffOrg=new SysStaffOrg();
|
||||||
sysStaffOrg.setStaffSid(sysUser.getStaffSid());
|
sysStaffOrg.setStaffSid(sysUser.getStaffSid());
|
||||||
sysStaffOrg.setOrgSid(sysOrg.getSid());
|
sysStaffOrg.setOrgSid(sysOrg.getSid());
|
||||||
@@ -537,33 +547,25 @@ public class SysUserRest {
|
|||||||
sysStaffOrg.setManageType("3");
|
sysStaffOrg.setManageType("3");
|
||||||
sysStaffOrgService.save(sysStaffOrg);
|
sysStaffOrgService.save(sysStaffOrg);
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(deptSid)) {
|
// SysRole sysRole=new SysRole();
|
||||||
SysOrganization sysOrganization = sysOrganizationService.fetchBySid(deptSid);
|
// sysRole.setCode("");
|
||||||
SysStaffOrg sso = new SysStaffOrg();
|
// sysRole.setName("单位管理员");
|
||||||
sso.setOrgName(sysOrganization.getName());
|
// sysRole.setSort(0);
|
||||||
sso.setOrgSid(sysOrganization.getSid());
|
// sysRole.setType(1);
|
||||||
sso.setStaffSid(sysUser.getStaffSid());
|
// sysRole.setOrgSid(sysOrg.getSid());
|
||||||
// sso.setOrgSidPath(sysOrganization.getOrgSidPath());
|
// sysRoleService.save(sysRole);
|
||||||
// sso.setOrgNamePath(sysOrganization.getName());
|
//
|
||||||
sso.setManageType("3");
|
// SysUserRole sysUserRole=new SysUserRole();
|
||||||
sysStaffOrgService.save(sso);
|
// sysUserRole.setRoleSid(sysRole.getSid());
|
||||||
}
|
// sysUserRole.setUserSid(sysUser.getSid());
|
||||||
if (StringUtils.isNotBlank(postSid)) {
|
// sysUserRoleService.save(sysUserRole);
|
||||||
SysPost sysPost = sysPostService.fetchBySid(postSid);
|
|
||||||
SysStaffPost ssp = new SysStaffPost();
|
|
||||||
ssp.setStaffSid(sysUser.getStaffSid());
|
|
||||||
ssp.setOrgSid(deptSid);
|
|
||||||
ssp.setPostSid(postSid);
|
|
||||||
ssp.setStartDate(new Date());
|
|
||||||
ssp.setIsDepetHead(0);
|
|
||||||
sysStaffPostService.save(ssp);
|
|
||||||
}
|
|
||||||
SysUser user = null;
|
SysUser user = null;
|
||||||
user = sysUserService.selectByUserName(sysUser.getUserName());
|
user = sysUserService.selectByUserName(sysUser.getUserName());
|
||||||
user.setOrgSid(sysOrg.getSid());
|
user.setOrgSid(sysOrg.getSid());
|
||||||
SysUserVo userInfoOneVo = sysUserService.setUserRedisSessionToken(user);
|
SysUserVo userInfoOneVo = sysUserService.setUserRedisSessionToken(user);
|
||||||
userInfoOneVo.setOrgSid(sysOrg.getSid());
|
userInfoOneVo.setOrgSid(sysOrg.getSid());
|
||||||
userInfoOneVo.setOrgName(sysOrg.getName());
|
userInfoOneVo.setOrgName(sysOrg.getName());
|
||||||
|
|
||||||
return new ResultBean<SysUserVo>().success().setData(userInfoOneVo);
|
return new ResultBean<SysUserVo>().success().setData(userInfoOneVo);
|
||||||
}
|
}
|
||||||
@PostMapping("/loginByNoVeriCode")
|
@PostMapping("/loginByNoVeriCode")
|
||||||
@@ -916,4 +918,5 @@ public class SysUserRest {
|
|||||||
ResultBean removeRedis() {
|
ResultBean removeRedis() {
|
||||||
return sysUserService.removeRedis();
|
return sysUserService.removeRedis();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -376,8 +376,10 @@ public class SysMenuService extends MybatisBaseService<SysMenuMapper, SysMenu> {
|
|||||||
map_menu.put("path", menuVo.getPageUrl() != null && !menuVo.getPageUrl().equals("") ? menuVo.getPageUrl() : "/" + menuVo.getPageName());
|
map_menu.put("path", menuVo.getPageUrl() != null && !menuVo.getPageUrl().equals("") ? menuVo.getPageUrl() : "/" + menuVo.getPageName());
|
||||||
map_menu.put("name", menuVo.getPageAliasName() != null && !menuVo.getPageAliasName().equals("") ? menuVo.getPageAliasName() : menuVo.getPageUrl());
|
map_menu.put("name", menuVo.getPageAliasName() != null && !menuVo.getPageAliasName().equals("") ? menuVo.getPageAliasName() : menuVo.getPageUrl());
|
||||||
//组件名
|
//组件名
|
||||||
if(StringUtils.isBlank(menuVo.getMenuName())){
|
if(StringUtils.isBlank(menuVo.getPageName())){
|
||||||
map_menu.put("component","");
|
map_menu.put("component","");
|
||||||
|
}else {
|
||||||
|
map_menu.put("component", menuVo.getPageName());
|
||||||
}
|
}
|
||||||
if (menuVo.getAlwaysShow() == 0) {
|
if (menuVo.getAlwaysShow() == 0) {
|
||||||
map_menu.put("alwaysShow", false);
|
map_menu.put("alwaysShow", false);
|
||||||
|
|||||||
@@ -169,11 +169,14 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
|||||||
//从本级部门信息中获取本级部门名称
|
//从本级部门信息中获取本级部门名称
|
||||||
String bjName = sysOrganization.getName();
|
String bjName = sysOrganization.getName();
|
||||||
//获取上级sid获取上级部门信息
|
//获取上级sid获取上级部门信息
|
||||||
if(!psid.equals("0")){
|
SysOrganization sysOrganization1 = sysOrganizationService.fetchBySid(psid);
|
||||||
SysOrganization sysOrganization1 = sysOrganizationService.fetchBySid(psid);
|
//从上级部门信息中获取上级部门名称
|
||||||
//从上级部门信息中获取上级部门名称
|
|
||||||
|
if(null!=sysOrganization1){
|
||||||
String sjName = sysOrganization1.getName();
|
String sjName = sysOrganization1.getName();
|
||||||
orgName += sjName + "-" + bjName + ",";
|
orgName += sjName + "-" + bjName + ",";
|
||||||
|
}else{
|
||||||
|
orgName+=bjName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
orgName = orgName.substring(0, orgName.length() - 1);
|
orgName = orgName.substring(0, orgName.length() - 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user