Commit c5db5d23 by fudahua

离职基础优化

parent 7cf75421
...@@ -7,6 +7,8 @@ import com.gic.haoban.base.api.common.BasePageInfo; ...@@ -7,6 +7,8 @@ import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil; import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.HandoverExternalDTO; import com.gic.haoban.manage.api.dto.HandoverExternalDTO;
import com.gic.haoban.manage.api.dto.HandoverStaffFriendCountDTO; import com.gic.haoban.manage.api.dto.HandoverStaffFriendCountDTO;
import com.gic.haoban.manage.api.dto.SecretSettingDTO;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService; import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.*; import com.gic.haoban.manage.service.dao.mapper.*;
...@@ -16,6 +18,7 @@ import com.gic.haoban.manage.service.service.SecretSettingService; ...@@ -16,6 +18,7 @@ import com.gic.haoban.manage.service.service.SecretSettingService;
import com.gic.haoban.manage.service.service.StaffClerkRelationService; import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.wechat.api.dto.qywx.QywxTransferCustomerInfoDTO; import com.gic.wechat.api.dto.qywx.QywxTransferCustomerInfoDTO;
import com.gic.wechat.api.dto.qywx.QywxUnassignedInfoDTO; import com.gic.wechat.api.dto.qywx.QywxUnassignedInfoDTO;
import com.gic.wechat.api.dto.qywx.UserDTO;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -83,8 +86,19 @@ public class HandoverServiceImpl implements HandoverService { ...@@ -83,8 +86,19 @@ public class HandoverServiceImpl implements HandoverService {
delHandoverStaff(wxEnterpriseId, null); delHandoverStaff(wxEnterpriseId, null);
return false; return false;
} }
SecretSettingDTO secretSetting = secretSettingService.getSecretSetting(wxEnterprise.getWxEnterpriseId(), SecretTypeEnum.HAOBAN_HELP.getVal());
if (null == secretSetting || secretSetting.getCheckFlag() == 0) {
logger.info("没有配置secret:{}", JSONObject.toJSONString(wxEnterprise));
return false;
}
Map<String, List<QywxUnassignedInfoDTO>> handoverUserMap = infoList.stream().collect(Collectors.groupingBy(dto -> dto.getHandoverUserid())); Map<String, List<QywxUnassignedInfoDTO>> handoverUserMap = infoList.stream().collect(Collectors.groupingBy(dto -> dto.getHandoverUserid()));
handoverUserMap.forEach((userId, list) -> { handoverUserMap.forEach((userId, list) -> {
boolean checkFlag = checkStaffOver(secretSetting, userId, wxEnterprise.getCorpid());
if (!checkFlag) {
logger.info("该用户存在,不需要离职基础:{},{}", userId, wxEnterpriseId);
return;
}
TabHandoverStaff handoverStaff = getHandoverStaff(wxEnterpriseId, userId); TabHandoverStaff handoverStaff = getHandoverStaff(wxEnterpriseId, userId);
if (null == handoverStaff) { if (null == handoverStaff) {
return; return;
...@@ -129,6 +143,14 @@ public class HandoverServiceImpl implements HandoverService { ...@@ -129,6 +143,14 @@ public class HandoverServiceImpl implements HandoverService {
return false; return false;
} }
private boolean checkStaffOver(SecretSettingDTO secretSetting, String userId, String corpId) {
UserDTO user = qywxUserApiService.getSelfWorkWxUser(corpId, secretSetting.getSecretVal(), userId);
if (null == user) {
return false;
}
return true;
}
/** /**
* 删除企业下的数据 * 删除企业下的数据
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment