Commit f32380a7 authored by 朱晨阳's avatar 朱晨阳

修改经销商管理员注册时手机号和用户名校验错误

parent 10db47a8
...@@ -36,4 +36,6 @@ public interface UnitInfoMapper extends BaseMapper<UnitInfo> { ...@@ -36,4 +36,6 @@ public interface UnitInfoMapper extends BaseMapper<UnitInfo> {
Integer getUserListHuiCount(String phone, String userName); Integer getUserListHuiCount(String phone, String userName);
Integer getUserListPauCount(String phone, String userName); Integer getUserListPauCount(String phone, String userName);
Integer getUserListSubCount(String phone, String userName);
} }
...@@ -150,4 +150,16 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP' ...@@ -150,4 +150,16 @@ from privilege_company where IS_DELETED=0 and AGENCY_CODE='JXIOP'
</where> </where>
</select> </select>
<select id="getUserListSubCount" resultType="integer">
select count(*) from std_user_biz
<where>
<if test="phone != null and phone !=''">
and emergency_telephone = #{phone}
</if>
<if test="userName != null and userName !=''">
and amos_user_name = #{userName}
</if>
</where>
</select>
</mapper> </mapper>
...@@ -1060,12 +1060,13 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn ...@@ -1060,12 +1060,13 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
public Boolean hasExistPhoneOrUserName(String phone, String userName) { public Boolean hasExistPhoneOrUserName(String phone, String userName) {
Integer userListHuiCount = unitInfoMapper.getUserListHuiCount(phone, userName); Integer userListHuiCount = unitInfoMapper.getUserListHuiCount(phone, userName);
Integer userListPauCount = unitInfoMapper.getUserListPauCount(phone, userName); Integer userListPauCount = unitInfoMapper.getUserListPauCount(phone, userName);
Integer userListSubCount = unitInfoMapper.getUserListSubCount(phone, userName);
if((userListHuiCount != 0 || userListPauCount != 0) && phone != null) { if((userListHuiCount != 0 || userListPauCount != 0 || userListSubCount != 0) && phone != null) {
throw new BadRequest("该手机号已经注册"); throw new BadRequest("该手机号已经注册");
} }
if((userListHuiCount != 0 || userListPauCount != 0) && userName != null) { if((userListHuiCount != 0 || userListPauCount != 0 || userListSubCount != 0) && userName != null) {
throw new BadRequest("该用户名已经注册"); throw new BadRequest("该用户名已经注册");
} }
return true; return true;
......
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