Commit adbccc8d by yaosai

bugfix-删除导购逻辑调整

parent bee8a5f3
......@@ -132,4 +132,14 @@ public interface StaffMapper {
*/
TabHaobanStaff selectByPhoneNumberAndEnterpriseId(@Param("phoneNumber") String phoneNumber,
@Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 删除除了当前staffId以外其他的staff
*
* @param staffId staffId
* @param wxEnterpriseId wx企业标识
* @param wxUserId wx用户id
*/
void delOtherStaff(@Param("staffId")String staffId,
@Param("wxEnterpriseId")String wxEnterpriseId,
@Param("wxUserId")String wxUserId);
}
\ No newline at end of file
......@@ -98,4 +98,12 @@ public interface StaffService {
int updateOpenUserIdsByUserId(String wxEnterpriseId, String wxUserId, String wxOpenUseId);
/**
* 删除除了当前staffId以外其他的staff
*
* @param staffId staffId
* @param wxEnterpriseId wx企业标识
* @param wxUserId wx用户id
*/
void delOtherStaff(String staffId, String wxEnterpriseId, String wxUserId);
}
......@@ -120,4 +120,9 @@ public class StaffServiceImpl implements StaffService {
return mapper.updateOpenUserIdsByUserId(wxEnterpriseId, wxUserId, wxOpenUseId);
}
@Override
public void delOtherStaff(String staffId, String wxEnterpriseId, String wxUserId) {
mapper.delOtherStaff(staffId, wxEnterpriseId, wxUserId);
}
}
......@@ -390,6 +390,10 @@ public class StaffApiServiceImpl implements StaffApiService {
String nationCode = arr[0];
String phoneNumber = arr[1];
TabHaobanStaff staff = staffService.selectByPhoneNumberAndEnterpriseId(phoneNumber.trim(), wxEnterpriseId);
if (staff != null) {
//兼容导购调整手机号逻辑
staffService.delOtherStaff(staff.getStaffId(),staff.getWxEnterpriseId(),staff.getWxUserId());
}
staff = (staff == null ? new TabHaobanStaff() : staff);
staff.setWxUserId(userId);
staff.setUpdateTime(new Date());
......@@ -1519,7 +1523,7 @@ public class StaffApiServiceImpl implements StaffApiService {
return staffQrCodeDTO;
}
String qr_code = user.getQr_code();
staffMapper.updateQrCodeByStaffId(staffId,qr_code);
staffMapper.updateQrCodeByStaffId(staffId, qr_code);
staffQrCodeDTO.setQrCode(qr_code);
return staffQrCodeDTO;
}
......
......@@ -26,7 +26,8 @@
</resultMap>
<sql id="Base_Column_List">
staff_id, wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion,
staff_id
, wx_user_id, phone_number, staff_name, nation_code, nick_name, sex, postion,
active_flag, extend_postion, status_flag, create_time, update_time,wx_enterprise_id,head_img,
sort,sync_postion_flag,super_manager_flag,wx_open_user_id,wx_open_id,qr_code
</sql>
......@@ -42,6 +43,15 @@
where staff_id = #{staffId,jdbcType=VARCHAR}
</delete>
<update id="delOtherStaff">
update tab_haoban_staff
set status_flag = 0
where wx_enterprise_id = #{wxEnterpriseId}
and wx_user_id = #{wxUserId}
and status_flag = 1
and staff_id != #{staffId}
</update>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff">
insert into tab_haoban_staff
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -438,15 +448,15 @@
<update id="updateOpenIdByStaffId" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff">
update tab_haoban_staff
set wx_open_id = #{openId},
update_time = now()
set wx_open_id = #{openId},
update_time = now()
where staff_id = #{staffId}
</update>
<update id="updateQrCodeByStaffId" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff">
update tab_haoban_staff
set qr_code = #{qrCode},
update_time = now()
set qr_code = #{qrCode},
update_time = now()
where staff_id = #{staffId}
</update>
......
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