|
@@ -108,7 +108,7 @@ public class SapUserService extends BaseService {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public void updateAbnormalResult() throws Exception {
|
|
|
- List<SapUser> normalList = selectListByResult(SapUserResultEnum.NORMAL.getCode());
|
|
|
+ List<SapUser> normalList = selectPrimaryListByResult(SapUserResultEnum.NORMAL.getCode());
|
|
|
SapUserResultEnum resultEnum = null;
|
|
|
for (SapUser sapUser : normalList) {
|
|
|
resultEnum = checkSensitiveOrEntryData(sapUser);
|
|
@@ -150,8 +150,8 @@ public class SapUserService extends BaseService {
|
|
|
|
|
|
private String createOrUpdateWXUser(String personId) throws Exception {
|
|
|
List<SapUser> sapUsers = selectListByPersonId(personId);
|
|
|
- SapUser wxSapUser = sapUsers.get(0);
|
|
|
- String mobile = wxSapUser.getFormatBusinessPhone();
|
|
|
+ SapUser primarySapUser = sapUsers.get(0);
|
|
|
+ String mobile = primarySapUser.getFormatBusinessPhone();
|
|
|
// 测试企业微信,手机号码脱敏
|
|
|
// fouram wxCp.corpId = ww51602aeb8dab7a95
|
|
|
// prod wxCp.corpId = ww911e29458d3a46fd
|
|
@@ -177,9 +177,10 @@ public class SapUserService extends BaseService {
|
|
|
thirdWxDepartIdList[i] = sapUser.getThirdWxDepartId();
|
|
|
fourthWxDepartIdList[i] = sapUser.getFourthWxDepartId();
|
|
|
}
|
|
|
- return WXCpUserUtil.createOrUpdate(personId, wxSapUser.getName(), firstWxDepartIdList, secondWxDepartIdList,
|
|
|
- thirdWxDepartIdList, fourthWxDepartIdList, wxSapUser.getFormatPosition(), wxSapUser.getFormatMobile(),
|
|
|
- wxSapUser.getGender(), wxSapUser.getUsername(), mobile, wxSapUser.getFirstOrgName());
|
|
|
+ return WXCpUserUtil.createOrUpdate(personId, primarySapUser.getName(), firstWxDepartIdList,
|
|
|
+ secondWxDepartIdList, thirdWxDepartIdList, fourthWxDepartIdList, primarySapUser.getFormatPosition(),
|
|
|
+ primarySapUser.getFormatMobile(), primarySapUser.getGender(), primarySapUser.getUsername(), mobile,
|
|
|
+ primarySapUser.getFirstOrgName());
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -230,22 +231,22 @@ public class SapUserService extends BaseService {
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- public List<SapUser> selectListByName(String name) throws Exception {
|
|
|
- return (List<SapUser>) findList("SapUserMapper.selectListByName", name);
|
|
|
+ public List<SapUser> selectPrimaryListByName(String name) throws Exception {
|
|
|
+ return (List<SapUser>) findList("SapUserMapper.selectPrimaryListByName", name);
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- public List<SapUser> selectListByResult(String result) throws Exception {
|
|
|
- return (List<SapUser>) findList("SapUserMapper.selectListByResult", result);
|
|
|
+ public List<SapUser> selectPrimaryListByResult(String result) throws Exception {
|
|
|
+ return (List<SapUser>) findList("SapUserMapper.selectPrimaryListByResult", result);
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- public List<SapUser> selectListByDelFlag(Integer delFlag) throws Exception {
|
|
|
- return (List<SapUser>) findList("SapUserMapper.selectListByDelFlag", delFlag);
|
|
|
+ public List<SapUser> selectPrimaryListByDelFlag(Integer delFlag) throws Exception {
|
|
|
+ return (List<SapUser>) findList("SapUserMapper.selectPrimaryListByDelFlag", delFlag);
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- public List<SapUser> selectListByDepartIdAndLevel(String departId) throws Exception {
|
|
|
+ public List<SapUser> selectPrimaryListByDepartIdAndLevel(String departId) throws Exception {
|
|
|
SapOrg sapOrg = sapOrgService.selectById(departId);
|
|
|
if (StringUtils.isBlank(departId) || WebConstants.TOP_DEPART.toString().equals(departId)) {
|
|
|
departId = WebConstants.TOP_DEPART.toString();
|
|
@@ -255,7 +256,7 @@ public class SapUserService extends BaseService {
|
|
|
PageData pd = new PageData();
|
|
|
pd.put("departId", departId);
|
|
|
pd.put("level", sapOrg.getLevel());
|
|
|
- return (List<SapUser>) findList("SapUserMapper.selectListByDepartIdAndLevel", pd);
|
|
|
+ return (List<SapUser>) findList("SapUserMapper.selectPrimaryListByDepartIdAndLevel", pd);
|
|
|
}
|
|
|
|
|
|
public SapUser toInfoDetail(SapUser sapUser) throws Exception {
|
|
@@ -298,7 +299,7 @@ public class SapUserService extends BaseService {
|
|
|
|
|
|
// 更新用户头像
|
|
|
public void updateAvatars() throws Exception {
|
|
|
- List<SapUser> successUsers = selectListByResult(SapUserResultEnum.SUCCESS.getCode());
|
|
|
+ List<SapUser> successUsers = selectPrimaryListByResult(SapUserResultEnum.SUCCESS.getCode());
|
|
|
for (SapUser sapUser : successUsers) {
|
|
|
WxCpUser user = WXCpUserUtil.getByIdOrEmail(sapUser.getPersonId(), sapUser.getEmail());
|
|
|
if (user != null && StringUtils.isNotBlank(user.getAvatar())) {
|