Merge branch 'dev/feat/partner1.5_20231106' into hxd/feat/partner1.5

This commit is contained in:
xiaodong.hu
2023-11-06 18:14:45 +08:00
5 changed files with 16 additions and 7 deletions

View File

@@ -147,7 +147,7 @@ public class EnterpriseUserDAO {
return userList.stream().filter(o->!StringUtils.isAnyBlank(o.getMobile(), o.getName())).collect(Collectors.toMap(k -> k.getUserId(), Function.identity()));
}
public String selectByMobile(String mobile) {
public EnterpriseUserDO selectByMobile(String mobile) {
return enterpriseUserMapper.selectByMobile(mobile);
}

View File

@@ -101,7 +101,7 @@ public interface EnterpriseUserMapper {
*/
List<EnterpriseUserDO> getUserListByRegionIds(@Param("regionIds") List<String> regionIds);
String selectByMobile(@Param("mobile") String mobile);
EnterpriseUserDO selectByMobile(@Param("mobile") String mobile);
EnterpriseUserDO selectByInvestmentManager(@Param("investmentManager") String investmentManager);

View File

@@ -332,8 +332,8 @@
SUBSTR(jobnumber,1,1),
CAST(SUBSTR(jobnumber,2) AS UNSIGNED) ASC
</select>
<select id="selectByMobile" resultType="java.lang.String">
SELECT user_id FROM enterprise_user WHERE mobile =#{mobile} and deleted=0 LIMIT 1
<select id="selectByMobile" resultMap="BaseResultMap">
SELECT <include refid="Base_Column_List"/> FROM enterprise_user WHERE mobile =#{mobile} and deleted=0 LIMIT 1
</select>
<select id="selectByInvestmentManager" resultMap="BaseResultMap">
SELECT

View File

@@ -429,13 +429,13 @@ public class EcSyncServiceImpl implements EcSyncService {
private String getInvestmentManager(String followUserName, String followUserMobile) throws ApiException {
//传递过来有跟进人的情况下查询跟进人是否存在
if (StringUtil.isNotEmpty(followUserMobile) && StringUtil.isNotEmpty(followUserName)) {
String userId = enterpriseUserDAO.selectByMobile(followUserMobile);
if (StringUtil.isEmpty(userId)) {
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.selectByMobile(followUserMobile);
if (enterpriseUserDO==null) {
// 给飞书群发送消息 跟进人找不到
sendFeiShuRobotMessage("推送:飞书架构中找不到该用户:【" + followUserName + "】,该用户电话号码为:" + followUserMobile, "27243d49-97ca-4981-8aec-7c3bf84eb660");
throw new ApiException("飞书架构中找不到该用户:【" + followUserName + "】,该用户电话号码为:" + followUserMobile);
}
return userId;
return enterpriseUserDO.getUserId();
}
return "";
}

View File

@@ -211,6 +211,15 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
enterpriseUserRoleDAO.deleteUserRole(userDetail.getUserId());
}
EnterpriseUserDO enterpriseUser = EnterpriseUserDTO.transUserDtoToDo(userDetail, regionPathMap, leaderDeptMap, eventType);
if(StringUtils.isNotBlank(enterpriseUser.getMobile())){
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.selectByMobile(enterpriseUser.getMobile());
//如果没有用户信息 但是飞书推的是更新的事件
if (enterpriseUserDO==null&&enterpriseUser.getIsLeader()==null){
log.info("没有用户信息 但是飞书推的是更新的事件");
enterpriseUser.setIsLeader(Boolean.FALSE);
enterpriseUser.setLeaderDeptIds("[]");
}
}
enterpriseUserDAO.batchInsertOrUpdate(new ArrayList<>(Arrays.asList(enterpriseUser)));
userRegionMappingDAO.batchInsertOrUpdateUserRegion(UserRegionMappingDO.convertSyncDO(Arrays.asList(enterpriseUser)));
userRegionMappingDAO.deleteUserRegionByUserId(userDetail.getUserId(), DataSourceEnum.SYNC, departmentLists);