Commit 342d465e by 墨竹

feat:通讯录同步bug修改

parent 66441658
...@@ -93,4 +93,16 @@ public interface StaffMapper { ...@@ -93,4 +93,16 @@ public interface StaffMapper {
*/ */
TabHaobanStaff selectByOpenUserIdAndEnterpriseId(@Param("wxOpenUseId") String wxOpenUseId, TabHaobanStaff selectByOpenUserIdAndEnterpriseId(@Param("wxOpenUseId") String wxOpenUseId,
@Param("wxEnterpriseId") String wxEnterpriseId); @Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 选择电话号码和企业标识
*
* @param phoneNumber 电话号码
* @param wxEnterpriseId wx企业标识
* @return {@link TabHaobanStaff }
* @author mozhu
* @date 2022-01-12 17:20:16
*/
TabHaobanStaff selectByPhoneNumberAndEnterpriseId(@Param("phoneNumber") String phoneNumber,
@Param("wxEnterpriseId") String wxEnterpriseId);
} }
\ No newline at end of file
...@@ -23,6 +23,18 @@ public interface StaffService { ...@@ -23,6 +23,18 @@ public interface StaffService {
TabHaobanStaff selectByUserIdAndEnterpriseId(String userId, String wxEnterpriseId); TabHaobanStaff selectByUserIdAndEnterpriseId(String userId, String wxEnterpriseId);
/**
* 选择电话号码和企业标识
*
* @param phoneNumber 电话号码
* @param wxEnterpriseId wx企业标识
* @return {@link TabHaobanStaff }
* @author mozhu
* @date 2022-01-12 17:19:28
*/
TabHaobanStaff selectByPhoneNumberAndEnterpriseId(String phoneNumber, String wxEnterpriseId);
List<StaffDTO> listByUserIdsAndWxEnterpriseId(List<String> userIds, String wxEnterpriseId); List<StaffDTO> listByUserIdsAndWxEnterpriseId(List<String> userIds, String wxEnterpriseId);
/** /**
......
...@@ -82,6 +82,11 @@ public class StaffServiceImpl implements StaffService { ...@@ -82,6 +82,11 @@ public class StaffServiceImpl implements StaffService {
} }
@Override @Override
public TabHaobanStaff selectByPhoneNumberAndEnterpriseId(String phoneNumber, String wxEnterpriseId) {
return mapper.selectByPhoneNumberAndEnterpriseId(phoneNumber, wxEnterpriseId);
}
@Override
public void updateByPrimaryKey(TabHaobanStaff tab) { public void updateByPrimaryKey(TabHaobanStaff tab) {
tab.setUpdateTime(new Date()); tab.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(tab); mapper.updateByPrimaryKeySelective(tab);
......
...@@ -384,8 +384,9 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -384,8 +384,9 @@ public class StaffApiServiceImpl implements StaffApiService {
res.setCode(3); res.setCode(3);
return res; return res;
} }
String phoneNumber = user.getMobile();
String imageUrl = changeHeaderImageUrl(user.getAvatar()); String imageUrl = changeHeaderImageUrl(user.getAvatar());
TabHaobanStaff staff = staffService.selectByUserIdAndEnterpriseId(userId, wxEnterpriseId); TabHaobanStaff staff = staffService.selectByPhoneNumberAndEnterpriseId(phoneNumber, wxEnterpriseId);
staff = (staff == null ? new TabHaobanStaff() : staff); staff = (staff == null ? new TabHaobanStaff() : staff);
staff.setWxUserId(userId); staff.setWxUserId(userId);
staff.setUpdateTime(new Date()); staff.setUpdateTime(new Date());
...@@ -402,7 +403,6 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -402,7 +403,6 @@ public class StaffApiServiceImpl implements StaffApiService {
user.setAlias(EmojiFilterUtil.removeAllEmoji(user.getAlias())); user.setAlias(EmojiFilterUtil.removeAllEmoji(user.getAlias()));
staff.setNickName((user.getAlias())); staff.setNickName((user.getAlias()));
} }
String phoneNumber = user.getMobile();
String[] arr = getNationCodeAndPhoneNumber(phoneNumber); String[] arr = getNationCodeAndPhoneNumber(phoneNumber);
staff.setPhoneNumber(arr[1]); staff.setPhoneNumber(arr[1]);
staff.setNationCode(arr[0]); staff.setNationCode(arr[0]);
......
...@@ -415,4 +415,13 @@ ...@@ -415,4 +415,13 @@
and status_flag = 1 limit 1 and status_flag = 1 limit 1
</select> </select>
<select id="selectByPhoneNumberAndEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from tab_haoban_staff
where phone_number = #{phoneNumber}
and wx_enterprise_id = #{wxEnterpriseId}
and status_flag = 1 limit 1
</select>
</mapper> </mapper>
\ No newline at end of file
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