Commit 8c233bfe by yaosai

Merge branch 'bugfix-0214' into 'master'

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

See merge request !166
parents fbedf0c7 148f6b10
...@@ -132,4 +132,15 @@ public interface StaffMapper { ...@@ -132,4 +132,15 @@ public interface StaffMapper {
*/ */
TabHaobanStaff selectByPhoneNumberAndEnterpriseId(@Param("phoneNumber") String phoneNumber, TabHaobanStaff selectByPhoneNumberAndEnterpriseId(@Param("phoneNumber") String phoneNumber,
@Param("wxEnterpriseId") String wxEnterpriseId); @Param("wxEnterpriseId") String wxEnterpriseId);
/**
* 删除同wxUserId的其他staff
*
* @param wxUserId 微信用户id
* @param staffId 导购id
* @param wxEnterpriseId wx企业标识
*/
void delOtherStaffByWxUserId(@Param("wxUserId") String wxUserId,
@Param("staffId") String staffId,
@Param("wxEnterpriseId") String wxEnterpriseId);
} }
\ No newline at end of file
...@@ -97,5 +97,12 @@ public interface StaffService { ...@@ -97,5 +97,12 @@ public interface StaffService {
*/ */
int updateOpenUserIdsByUserId(String wxEnterpriseId, String wxUserId, String wxOpenUseId); int updateOpenUserIdsByUserId(String wxEnterpriseId, String wxUserId, String wxOpenUseId);
/**
* 删除同wxUserId的其他staff
*
* @param wxUserId 微信用户id
* @param staffId 导购id
* @param wxEnterpriseId wx企业标识
*/
void delOtherStaffByWxUserId(String wxUserId, String staffId, String wxEnterpriseId);
} }
...@@ -120,4 +120,9 @@ public class StaffServiceImpl implements StaffService { ...@@ -120,4 +120,9 @@ public class StaffServiceImpl implements StaffService {
return mapper.updateOpenUserIdsByUserId(wxEnterpriseId, wxUserId, wxOpenUseId); return mapper.updateOpenUserIdsByUserId(wxEnterpriseId, wxUserId, wxOpenUseId);
} }
@Override
public void delOtherStaffByWxUserId(String wxUserId, String staffId, String wxEnterpriseId) {
mapper.delOtherStaffByWxUserId(wxUserId, staffId, wxEnterpriseId);
}
} }
...@@ -390,6 +390,9 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -390,6 +390,9 @@ public class StaffApiServiceImpl implements StaffApiService {
String nationCode = arr[0]; String nationCode = arr[0];
String phoneNumber = arr[1]; String phoneNumber = arr[1];
TabHaobanStaff staff = staffService.selectByPhoneNumberAndEnterpriseId(phoneNumber.trim(), wxEnterpriseId); TabHaobanStaff staff = staffService.selectByPhoneNumberAndEnterpriseId(phoneNumber.trim(), wxEnterpriseId);
if (staff != null){
staffService.delOtherStaffByWxUserId(staff.getWxUserId(),staff.getStaffId(), 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());
......
...@@ -42,6 +42,15 @@ ...@@ -42,6 +42,15 @@
where staff_id = #{staffId,jdbcType=VARCHAR} where staff_id = #{staffId,jdbcType=VARCHAR}
</delete> </delete>
<update id="delOtherStaffByWxUserId">
update tab_haoban_staff
set status_flag = 0,update_time = now()
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 id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanStaff">
insert into tab_haoban_staff insert into tab_haoban_staff
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
......
...@@ -122,7 +122,7 @@ public class ClerkController extends WebBaseController { ...@@ -122,7 +122,7 @@ public class ClerkController extends WebBaseController {
resultList.add(dto); resultList.add(dto);
} }
} }
return resultResponse(HaoBanErrCode.ERR_1, resultlist); return resultResponse(HaoBanErrCode.ERR_1, resultList);
} }
......
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