|
|
@ -4,9 +4,10 @@ import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganization; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.*; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserInfoVo; |
|
|
|
import com.yxt.anrui.portal.biz.sysorganization.SysOrganizationService; |
|
|
|
import com.yxt.anrui.portal.biz.sysuser.SysUserService; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
@ -37,6 +38,8 @@ public class SysStaffOrgService extends MybatisBaseService<SysStaffOrgMapper, Sy |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SysOrganizationService sysOrganizationService; |
|
|
|
@Autowired |
|
|
|
private SysUserService sysUserService; |
|
|
|
|
|
|
|
public PagerVo<SysStaffOrg> listPage(PagerQuery<SysStaffOrgQuery> pq) { |
|
|
|
SysStaffOrgQuery query = pq.getParams(); |
|
|
@ -171,7 +174,7 @@ public class SysStaffOrgService extends MybatisBaseService<SysStaffOrgMapper, Sy |
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
|
SysOrganization sysOrganization = sysOrganizationService.fetchBySid(list.get(i)); |
|
|
|
if (sysOrganization != null) { |
|
|
|
if (sysOrganization.getIsDept() != null){ |
|
|
|
if (sysOrganization.getIsDept() != null) { |
|
|
|
if (sysOrganization.getIsDept() == 0 && !"0".equals(sysOrganization.getPsid())) { |
|
|
|
sid = list.get(i); |
|
|
|
break; |
|
|
@ -194,4 +197,20 @@ public class SysStaffOrgService extends MybatisBaseService<SysStaffOrgMapper, Sy |
|
|
|
public SysStaffOrg getOrgByStaffSid(String sid) { |
|
|
|
return baseMapper.getOrgByStaffSid(sid); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 根据用户sid获取分公司sid |
|
|
|
* |
|
|
|
* @param applySid 用户sid |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean<String> getPathSidByUserSid(String applySid) { |
|
|
|
ResultBean<String> rb = ResultBean.fireFail(); |
|
|
|
SysUserInfoVo sysUserInfoVo = sysUserService.selectUserInfoByUserSid(applySid); |
|
|
|
if (sysUserInfoVo == null) { |
|
|
|
return rb; |
|
|
|
} |
|
|
|
ResultBean<String> resultBean = selectSidPathByStaffSid(sysUserInfoVo.getStaffSid()); |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
} |