|
@ -12,6 +12,7 @@ import com.yxt.anrui.portal.api.sysstaffinfo.app.AppSysStaffVo; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgDetailsVo; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgDetailsVo; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgDto; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgDto; |
|
|
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgVo; |
|
|
import com.yxt.anrui.portal.api.sysstaffpost.SysStaffPost; |
|
|
import com.yxt.anrui.portal.api.sysstaffpost.SysStaffPost; |
|
|
import com.yxt.anrui.portal.api.sysstaffpost.SysStaffPostDetailsVo; |
|
|
import com.yxt.anrui.portal.api.sysstaffpost.SysStaffPostDetailsVo; |
|
|
import com.yxt.anrui.portal.api.sysstaffpost.SysStaffPostDto; |
|
|
import com.yxt.anrui.portal.api.sysstaffpost.SysStaffPostDto; |
|
@ -24,6 +25,7 @@ import com.yxt.anrui.portal.biz.sysstafforg.SysStaffOrgService; |
|
|
import com.yxt.anrui.portal.biz.sysstaffpost.SysStaffPostService; |
|
|
import com.yxt.anrui.portal.biz.sysstaffpost.SysStaffPostService; |
|
|
import com.yxt.anrui.portal.biz.sysuser.SysUserService; |
|
|
import com.yxt.anrui.portal.biz.sysuser.SysUserService; |
|
|
import com.yxt.anrui.portal.biz.sysuserrole.SysUserRoleService; |
|
|
import com.yxt.anrui.portal.biz.sysuserrole.SysUserRoleService; |
|
|
|
|
|
import com.yxt.common.base.config.RedisUtil; |
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
import com.yxt.common.base.utils.Encodes; |
|
|
import com.yxt.common.base.utils.Encodes; |
|
@ -39,6 +41,8 @@ import org.springframework.stereotype.Service; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
|
|
import static java.util.stream.Collectors.toList; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Project: anrui_portal(门户建设) <br/> |
|
|
* Project: anrui_portal(门户建设) <br/> |
|
|
* File: SysStaffinfoService.java <br/> |
|
|
* File: SysStaffinfoService.java <br/> |
|
@ -71,6 +75,8 @@ public class SysStaffinfoService extends MybatisBaseService<SysStaffinfoMapper, |
|
|
private SysUserRoleService sysUserRoleService; |
|
|
private SysUserRoleService sysUserRoleService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private SysRoleService sysRoleService; |
|
|
private SysRoleService sysRoleService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private RedisUtil redisUtil; |
|
|
|
|
|
|
|
|
public List<SysStaffinfoAppContactsVo> selectAppContactsList() { |
|
|
public List<SysStaffinfoAppContactsVo> selectAppContactsList() { |
|
|
List<SysStaffinfoAppContactsVo> list = baseMapper.selectAppContactsList(); |
|
|
List<SysStaffinfoAppContactsVo> list = baseMapper.selectAppContactsList(); |
|
@ -413,6 +419,20 @@ public class SysStaffinfoService extends MybatisBaseService<SysStaffinfoMapper, |
|
|
*/ |
|
|
*/ |
|
|
public ResultBean updateStaffInfo(SysStaffinfoDto dto, String sid) { |
|
|
public ResultBean updateStaffInfo(SysStaffinfoDto dto, String sid) { |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
|
|
//查询该人员的组织机构list
|
|
|
|
|
|
List<SysStaffOrgVo> sysStaffOrgVos = sysStaffOrgService.selectByStaffS(sid); |
|
|
|
|
|
List<String> orgList = new ArrayList<>(); |
|
|
|
|
|
if (sysStaffOrgVos.size() > 0) { |
|
|
|
|
|
for (SysStaffOrgVo vv : sysStaffOrgVos) { |
|
|
|
|
|
String orgSid = sysStaffOrgService.getOrgByOrgSid(vv.getOrgSid()); |
|
|
|
|
|
SysOrganization sysOrganization = sysOrganizationService.fetchBySid(orgSid); |
|
|
|
|
|
if (sysOrganization != null) { |
|
|
|
|
|
orgList.add(orgSid); |
|
|
|
|
|
} else { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
//根据员工sid查询员工的信息
|
|
|
//根据员工sid查询员工的信息
|
|
|
SysStaffinfo sysStaffinfo = fetchBySid(sid); |
|
|
SysStaffinfo sysStaffinfo = fetchBySid(sid); |
|
|
if (sysStaffinfo == null) { |
|
|
if (sysStaffinfo == null) { |
|
@ -519,6 +539,26 @@ public class SysStaffinfoService extends MybatisBaseService<SysStaffinfoMapper, |
|
|
if (!isUpdate) { |
|
|
if (!isUpdate) { |
|
|
return rb.setMsg("更新员工信息失败"); |
|
|
return rb.setMsg("更新员工信息失败"); |
|
|
} |
|
|
} |
|
|
|
|
|
List<SysStaffOrgVo> sysStaffOrgVos1 = sysStaffOrgService.selectByStaffS(sid); |
|
|
|
|
|
List<String> orgList1 = new ArrayList<>(); |
|
|
|
|
|
if (sysStaffOrgVos1.size() > 0) { |
|
|
|
|
|
for (SysStaffOrgVo vv : sysStaffOrgVos1) { |
|
|
|
|
|
String orgSid = sysStaffOrgService.getOrgByOrgSid(vv.getOrgSid()); |
|
|
|
|
|
SysOrganization sysOrganization = sysOrganizationService.fetchBySid(orgSid); |
|
|
|
|
|
if (sysOrganization != null) { |
|
|
|
|
|
orgList1.add(orgSid); |
|
|
|
|
|
} else { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
List<String> reduce1 = orgList.stream().filter(item -> !orgList1.contains(item)).collect(toList()); |
|
|
|
|
|
if (reduce1.size() > 0) { |
|
|
|
|
|
//根据staffSid查询token
|
|
|
|
|
|
String token = sysUserService.selectByStaffsid(sid).getToken(); |
|
|
|
|
|
//清空该token
|
|
|
|
|
|
redisUtil.remove(token); |
|
|
|
|
|
} |
|
|
return rb.success().setMsg("更新员工信息成功"); |
|
|
return rb.success().setMsg("更新员工信息成功"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|