|
|
@ -15,6 +15,7 @@ import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgVo; |
|
|
|
import com.yxt.anrui.portal.api.sysstaffpost.SysStaffPostDetailsVo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.*; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.app.AppUserOrgInfoVo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.app.OrgList; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.wx.WxHomePageVo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.wx.WxMySysUserInfoVo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.wx.WxSysUserVo; |
|
|
@ -303,6 +304,7 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> { |
|
|
|
userInfoOneVo.setRoleName(""); |
|
|
|
String dwjb = ""; |
|
|
|
// 系统管理员(没有对应的人员和单位)
|
|
|
|
//是否是管理员:1管理员,2一般用户,0是超级管理员,3尚无单位人员
|
|
|
|
if ("0".equals(user.getIsAdmin())) { |
|
|
|
userInfoOneVo.setName("系统管理员"); |
|
|
|
userInfoOneVo.setMobile(""); |
|
|
@ -318,6 +320,7 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> { |
|
|
|
userInfoOneVo.setStaffSid(staffVo.getSid()); |
|
|
|
userInfoOneVo.setOrgNamePath(sysStaffOrg.getOrgNamePath()); |
|
|
|
userInfoOneVo.setOrgSidPath(sysStaffOrg.getOrgSidPath()); |
|
|
|
|
|
|
|
} |
|
|
|
// 尚无单位人员,没有单位和部门信息
|
|
|
|
if ("3".equals(user.getIsAdmin())) { |
|
|
@ -330,18 +333,26 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> { |
|
|
|
SysStaffPostDetailsVo staffPostDetailsVo = sysStaffPostService.getPostByStaffSid(user.getStaffSid()); |
|
|
|
userInfoOneVo.setPostSid(staffPostDetailsVo.getPostSid()); |
|
|
|
userInfoOneVo.setPostName(staffPostDetailsVo.getName()); |
|
|
|
if (orgVoList.size() > 0) { // 手机端销售人员用到orgsid,目前按唯一算
|
|
|
|
if (orgVoList.size() > 0) { |
|
|
|
SysStaffOrgVo sysStaffOrgVo = orgVoList.get(0); |
|
|
|
userInfoOneVo.setDepartmentName(sysStaffOrgVo.getOrgName()); |
|
|
|
userInfoOneVo.setDepartmentSid(sysStaffOrgVo.getOrgSid()); |
|
|
|
String psid = sysOrganizationService.fetchBySid(sysStaffOrgVo.getOrgSid()).getPsid(); |
|
|
|
String name = sysOrganizationService.fetchBySid(psid).getName(); |
|
|
|
// userInfoOneVo.setPNameAndDepartmentNameAndPostName(name + "-" + sysStaffOrgVo.getOrgName() + " " + userInfoOneVo.getPostName());
|
|
|
|
userInfoOneVo.setPNameAndDepartmentNameAndPostName(name + "-" + sysStaffOrgVo.getOrgName()); |
|
|
|
userInfoOneVo.setOrganizationSid(sysStaffOrgVo.getOrgSid()); |
|
|
|
userInfoOneVo.setOrganizationName(sysStaffOrgVo.getOrgName()); |
|
|
|
userInfoOneVo.setOrgNamePath(sysStaffOrg.getOrgNamePath()); |
|
|
|
userInfoOneVo.setOrgSidPath(sysStaffOrg.getOrgSidPath()); |
|
|
|
//根据orgSidPath查询分公司sid=====
|
|
|
|
String orgSid = sysStaffOrgService.getOrgByOrgSid(sysStaffOrgVo.getOrgSid()); |
|
|
|
SysOrganization sysOrganization = sysOrganizationService.fetchBySid(orgSid); |
|
|
|
if(sysOrganization != null){ |
|
|
|
userInfoOneVo.setDefaultOrgPathName(sysOrganization.getName()); |
|
|
|
userInfoOneVo.setDefaultOrgPath(sysStaffOrgVo.getOrgSidPath()); |
|
|
|
}else{ |
|
|
|
userInfoOneVo.setDefaultOrgPathName("暂无组织机构"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -350,6 +361,21 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> { |
|
|
|
userInfoOneVo.setRoleSids(roleSids); |
|
|
|
String roleName = sysRoleService.selectByUserSid(user.getSid()); |
|
|
|
userInfoOneVo.setRoleName(roleName); |
|
|
|
List<SysStaffOrgVo> sysStaffOrgVos = sysStaffOrgService.selectByStaffS(user.getStaffSid()); |
|
|
|
List<OrgList> orgList = new ArrayList<>(); |
|
|
|
if (sysStaffOrgVos.size() > 0) { |
|
|
|
for (SysStaffOrgVo vv : sysStaffOrgVos) { |
|
|
|
OrgList orgList1 = new OrgList(); |
|
|
|
String orgSid = sysStaffOrgService.getOrgByOrgSid(vv.getOrgSid()); |
|
|
|
SysOrganization sysOrganization = sysOrganizationService.fetchBySid(orgSid); |
|
|
|
if(sysOrganization != null){ |
|
|
|
orgList1.setOrgName(sysOrganization.getName()); |
|
|
|
orgList1.setOrgPath(vv.getOrgSidPath()); |
|
|
|
} |
|
|
|
orgList.add(orgList1); |
|
|
|
} |
|
|
|
} |
|
|
|
userInfoOneVo.setOrgList(orgList); |
|
|
|
return userInfoOneVo; |
|
|
|
} |
|
|
|
|
|
|
|