Commit 6750b671 by yaosai

Merge branch 'bugfix-0214' into 'developer'

修复导购删除bug和导购重复bug

See merge request !167
parents 5c6bfe56 d0eeff3c
......@@ -134,24 +134,13 @@ public interface StaffMapper {
@Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 删除同微信用户id的其他导购
* 删除同wxUserId的其他staff
*
* @param wxEnterpriseId 微信企业id
* @param wxUserId 微信用户id
* @param staffId 导购id
* @param wxEnterpriseId wx企业标识
*/
void delStaffByWxUserId(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("wxUserId") String wxUserId,
@Param("staffId") String staffId);
/**
* 删除同手机号的其他导购
*
* @param wxEnterpriseId 微信企业id
* @param phoneNumber 手机号
* @param staffId 导购id
*/
void delStaffByPhoneNumber(@Param("wxEnterpriseId") String wxEnterpriseId,
@Param("phoneNumber") String phoneNumber,
@Param("staffId") String staffId);
void delOtherStaffByWxUserId(@Param("wxUserId") String wxUserId,
@Param("staffId") String staffId,
@Param("wxEnterpriseId") String wxEnterpriseId);
}
\ No newline at end of file
......@@ -98,12 +98,11 @@ public interface StaffService {
int updateOpenUserIdsByUserId(String wxEnterpriseId, String wxUserId, String wxOpenUseId);
/**
* 删除同手机号同wxUserId的其他用户
* 删除同wxUserId的其他staff
*
* @param wxUserId 微信用户id
* @param staffId 导购id
* @param wxUserId wx用户id
* @param phoneNumber 手机号
* @param wxEnterpriseId 微信企业id
* @param wxEnterpriseId wx企业标识
*/
void delOtherStaffById(String staffId, String wxUserId, String phoneNumber, String wxEnterpriseId);
void delOtherStaffByWxUserId(String wxUserId, String staffId, String wxEnterpriseId);
}
......@@ -121,9 +121,8 @@ public class StaffServiceImpl implements StaffService {
}
@Override
public void delOtherStaffById(String staffId, String wxUserId, String phoneNumber, String wxEnterpriseId) {
mapper.delStaffByWxUserId(wxEnterpriseId, wxUserId, staffId);
mapper.delStaffByPhoneNumber(wxEnterpriseId, phoneNumber, staffId);
public void delOtherStaffByWxUserId(String wxUserId, String staffId, String wxEnterpriseId) {
mapper.delOtherStaffByWxUserId(wxUserId, staffId, wxEnterpriseId);
}
}
......@@ -390,9 +390,8 @@ public class StaffApiServiceImpl implements StaffApiService {
String nationCode = arr[0];
String phoneNumber = arr[1];
TabHaobanStaff staff = staffService.selectByPhoneNumberAndEnterpriseId(phoneNumber.trim(), wxEnterpriseId);
if (staff != null) {
//同手机号或者同wxUerId的导购只存在一个
staffService.delOtherStaffById(staff.getStaffId(), staff.getWxUserId(), staff.getPhoneNumber(), wxEnterpriseId);
if (staff != null){
staffService.delOtherStaffByWxUserId(staff.getWxUserId(),staff.getStaffId(), wxEnterpriseId);
}
staff = (staff == null ? new TabHaobanStaff() : staff);
staff.setWxUserId(userId);
......
......@@ -43,9 +43,9 @@
where staff_id = #{staffId,jdbcType=VARCHAR}
</delete>
<update id="delOtherStaff">
<update id="delOtherStaffByWxUserId">
update tab_haoban_staff
set status_flag = 0
set status_flag = 0,update_time = now()
where wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id = #{wxUserId}
and status_flag = 1
......
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