generated from dxfeng/secondev-wugang-dxfeng
fix(portal): 增加花名册邮箱重复性检查- 在 EmailAccountGenerateAction 中添加检查花名册是否存在相同邮箱的方法
- 在 EmailAccountGenerateMapper接口中新增 checkEmployeeSameEmail 方法 - 在 EmailAccountGenerateMapper.xml 中添加 checkEmployeeSameEmail 的 SQL 查询
This commit is contained in:
parent
01daf17c15
commit
9f3a40aade
|
|
@ -61,7 +61,7 @@ public class EmailAccountGenerateAction implements EsbServerlessRpcRemoteInterfa
|
|||
String baseEmail = pinyinName + EMAIL_DOMAIN;
|
||||
|
||||
// 首先检查基础邮箱是否已存在
|
||||
if (!isEmailExists(baseEmail,requestId)) {
|
||||
if (!isEmailExists(baseEmail, requestId)) {
|
||||
return baseEmail;
|
||||
}
|
||||
|
||||
|
|
@ -77,13 +77,29 @@ public class EmailAccountGenerateAction implements EsbServerlessRpcRemoteInterfa
|
|||
}
|
||||
|
||||
/**
|
||||
* 检查邮箱是否已存在
|
||||
* 检查入职管理表是否已存在相同邮箱
|
||||
*
|
||||
* @param email 邮箱账号
|
||||
* @return 是否存在
|
||||
*/
|
||||
private boolean isEmailExists(String email, Long requestId) {
|
||||
Integer checkCount = emailAccountGenerateMapper.checkSameEmailAccount(baseParam, email, requestId);
|
||||
boolean isSame = checkCount != null && checkCount > 0;
|
||||
if (isSame) {
|
||||
return true;
|
||||
}
|
||||
return isEmailExists(email);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验花名册是否存在相同邮箱
|
||||
*
|
||||
* @param email
|
||||
* @return
|
||||
*/
|
||||
private boolean isEmailExists(String email) {
|
||||
Integer checkCount = emailAccountGenerateMapper.checkEmployeeSameEmail(baseParam, email);
|
||||
return checkCount != null && checkCount > 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,4 +13,6 @@ import org.apache.ibatis.annotations.Param;
|
|||
public interface EmailAccountGenerateMapper {
|
||||
|
||||
Integer checkSameEmailAccount(@Param("param") BaseParam param, @Param("email") String email, @Param("requestId") Long requestId);
|
||||
|
||||
Integer checkEmployeeSameEmail(@Param("param") BaseParam param, @Param("email") String email);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,4 +11,11 @@
|
|||
and t1.form_data_id != #{requestId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="checkEmployeeSameEmail" resultType="java.lang.Integer">
|
||||
select count(t1.id) from ${param.e10_common}.uf_jcl_employee_information t1
|
||||
where t1.tenant_key = #{param.tenantKey}
|
||||
<!-- and t1.delete_type = 0-->
|
||||
and t1.email = #{email}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue