Commit 40d460dd by fudahua

Merge branch 'developer' into 'master'

Developer

See merge request haoban3.0/haoban-manage3.0!112
parents e432283b c5db5d23
......@@ -7,6 +7,8 @@ import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.HandoverExternalDTO;
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.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.*;
......@@ -16,6 +18,7 @@ import com.gic.haoban.manage.service.service.SecretSettingService;
import com.gic.haoban.manage.service.service.StaffClerkRelationService;
import com.gic.wechat.api.dto.qywx.QywxTransferCustomerInfoDTO;
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.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
......@@ -83,8 +86,19 @@ public class HandoverServiceImpl implements HandoverService {
delHandoverStaff(wxEnterpriseId, null);
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()));
handoverUserMap.forEach((userId, list) -> {
boolean checkFlag = checkStaffOver(secretSetting, userId, wxEnterprise.getCorpid());
if (!checkFlag) {
logger.info("该用户存在,不需要离职基础:{},{}", userId, wxEnterpriseId);
return;
}
TabHandoverStaff handoverStaff = getHandoverStaff(wxEnterpriseId, userId);
if (null == handoverStaff) {
return;
......@@ -129,6 +143,14 @@ public class HandoverServiceImpl implements HandoverService {
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;
}
/**
* 删除企业下的数据
*
......
......@@ -61,7 +61,8 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
@Override
public void update(MemberUnionidRelatedDTO exsitDTO) {
mapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(MemberUnionidRelated.class, exsitDTO));
exsitDTO.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(EntityUtil.changeEntityByJSON(MemberUnionidRelated.class, exsitDTO));
}
......
......@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.out.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.digest.MD5;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
......@@ -430,7 +431,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
String avatar = dto.getAvatar();
String unionId = dto.getUnionid();
if (StringUtils.isAnyBlank(wxUserId, wxEnterpriseId, name, createTime, externalUserId)) {
log.info("【新增外部联系人】wxUserId={},wxEnterpriseId={},name={},createTime={},avatar={},unionId={}", wxUserId, wxEnterpriseId, name, createTime, avatar, unionId, externalUserId);
log.info("【新增外部联系人】wxUserId={},wxEnterpriseId={},name={},createTime={},avatar={},unionId={},externalUserId={}", wxUserId, wxEnterpriseId, name, createTime, avatar, unionId, externalUserId);
checkQywxSettingApiService.saveFriendCallback(wxEnterpriseId, null, dto);
return;
}
......@@ -766,6 +767,7 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
}
memberUnionRelatedService.update(dto);
RedisUtil.unlock(lockKey);
RedisUtil.delCache(key);
return dto;
} else {
String memberUnionidRelatedId = memberUnionRelatedService.addMemberUnionidRelated(dto);
......
......@@ -12,9 +12,13 @@ public class EmojiFilterUtil {
}
String s = EmojiParser.removeAllEmojis(content);
if (StringUtils.isBlank(s)) {
return "";
return "未知用户";
}
return EmojiFilterUtil.filterEmojiLast(s,false);
String ret = EmojiFilterUtil.filterEmojiLast(s, false);
if (StringUtils.isBlank(ret)) {
return "未知用户";
}
return ret;
}
/**
......
......@@ -167,7 +167,8 @@
<include refid="Base_Column_List"/>
from tab_haoban_handover_staff
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and handover_user_id=#{staffId}
and staff_id=#{staffId}
and status_flag = 1
</select>
<select id="listByStoreId" resultMap="BaseResultMap">
......
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