Commit 5d527d73 by 墨竹

Merge branch 'feature/01-10' into developer

# Conflicts:
#	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
#	haoban-manage3-service/src/main/resources/mapper/StaffMapper.xml
parents 5dff9390 a13a9080
......@@ -111,4 +111,16 @@ public interface StaffMapper {
* @return int
*/
int updateQrCodeByStaffId(@Param("staffId") String staffId, @Param("qrCode") String qrCode);
/**
* 选择电话号码和企业标识
*
* @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 {
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);
/**
......
......@@ -78,6 +78,11 @@ public class StaffServiceImpl implements StaffService {
}
@Override
public TabHaobanStaff selectByPhoneNumberAndEnterpriseId(String phoneNumber, String wxEnterpriseId) {
return mapper.selectByPhoneNumberAndEnterpriseId(phoneNumber, wxEnterpriseId);
}
@Override
public void updateByPrimaryKey(TabHaobanStaff tab) {
tab.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(tab);
......
......@@ -385,7 +385,11 @@ public class StaffApiServiceImpl implements StaffApiService {
return res;
}
String imageUrl = changeHeaderImageUrl(user.getAvatar());
TabHaobanStaff staff = staffService.selectByUserIdAndEnterpriseId(userId, wxEnterpriseId);
String mobile = user.getMobile();
String[] arr = getNationCodeAndPhoneNumber(mobile);
String nationCode = arr[0];
String phoneNumber = arr[1];
TabHaobanStaff staff = staffService.selectByPhoneNumberAndEnterpriseId(phoneNumber.trim(), wxEnterpriseId);
staff = (staff == null ? new TabHaobanStaff() : staff);
staff.setWxUserId(userId);
staff.setUpdateTime(new Date());
......@@ -402,10 +406,8 @@ public class StaffApiServiceImpl implements StaffApiService {
user.setAlias(EmojiFilterUtil.removeAllEmoji(user.getAlias()));
staff.setNickName((user.getAlias()));
}
String phoneNumber = user.getMobile();
String[] arr = getNationCodeAndPhoneNumber(phoneNumber);
staff.setPhoneNumber(arr[1]);
staff.setNationCode(arr[0]);
staff.setPhoneNumber(phoneNumber);
staff.setNationCode(nationCode);
staff.setSex(user.getGender() == null ? 1 : Integer.parseInt(user.getGender()));
staff.setPostion(user.getPosition());
staff.setExtendPostion(user.getExternal_position());
......
......@@ -450,4 +450,13 @@
where staff_id = #{staffId}
</update>
<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>
\ 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