Commit c277c5ba by liuyang

2024-07-22 用户管理新增身份证号码字段,电子邮箱非必填

parent 2458165b
......@@ -45,6 +45,7 @@ public class User extends DaoEPBase {
public static final String FIELD_ACCOUNT_CODE = "accountCode"; /* 帐套编码*/
public static final String FIELD_DEP_CODE = "depCode"; /* 部门编码*/
public static final String FIELD_DEP_NAME = "depName"; /* 部门名称*/
public static final String FIELD_ID_CODE = "idCode";
public static final String COL_USER_ID = "USER_ID"; /* 用户ID*/
public static final String COL_LOGIN_NAME = "LOGIN_NAME";
......@@ -97,7 +98,7 @@ public class User extends DaoEPBase {
private String accountCode = " "; /* 帐套编码*/
private String depCode = ""; /* 部门编码*/
private String depName = ""; /* 部门名称*/
private String idCode = "";
/**
* initialize the metadata.
*/
......@@ -196,6 +197,10 @@ public class User extends DaoEPBase {
eiColumn = new EiColumn(FIELD_DEP_NAME);
eiColumn.setDescName("部门名称");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_ID_CODE);
eiColumn.setDescName("身份证号码");
eiMetadata.addMeta(eiColumn);
}
......@@ -563,6 +568,13 @@ public class User extends DaoEPBase {
public void setDepName(String depName) {
this.depName = depName;
}
public String getIdCode() {
return idCode;
}
public void setIdCode(String idCode) {
this.idCode = idCode;
}
/**
* get the value from Map.
......@@ -595,6 +607,7 @@ public class User extends DaoEPBase {
setAccountCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ACCOUNT_CODE)), accountCode));
setDepCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_CODE)), depCode));
setDepName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_DEP_NAME)), depName));
setIdCode(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_ID_CODE)), idCode));
}
/**
......@@ -627,6 +640,7 @@ public class User extends DaoEPBase {
map.put(FIELD_ACCOUNT_CODE, StringUtils.toString(accountCode, eiMetadata.getMeta(FIELD_ACCOUNT_CODE)));
map.put(FIELD_DEP_CODE, StringUtils.toString(depCode, eiMetadata.getMeta(FIELD_DEP_CODE)));
map.put(FIELD_DEP_NAME, StringUtils.toString(depName, eiMetadata.getMeta(FIELD_DEP_NAME)));
map.put(FIELD_ID_CODE, StringUtils.toString(idCode, eiMetadata.getMeta(FIELD_ID_CODE)));
return map;
}
......
......@@ -61,6 +61,7 @@ public class ServiceXS0102 extends ServiceEPBase implements LoginConstants {
String rePass = (String) inInfoRowMap.get("rePass");
String mobile = (String) inInfoRowMap.get("mobile");
String email = (String) inInfoRowMap.get("email");
String idCard = (String) inInfoRowMap.get("idCard");
if ("on".equals(StringUtils.defaultIfEmpty(
PlatApplicationContext.getProperty("xservices.security.cryptoPasswordEnable"), "on"))) {
password = LoginRsaKeyUtil.decrypt(password);
......@@ -72,10 +73,10 @@ public class ServiceXS0102 extends ServiceEPBase implements LoginConstants {
}
boolean flag = "".equals(userName) || "".equals(loginName) || "".equals(password) || "".equals(rePass)
|| "".equals(mobile) || "".equals(email);
|| "".equals(mobile) || "".equals(idCard);
if (flag) {
inInfo.setStatus(-1);
inInfo.setMsg("注册失败!登录账号,用户姓名,密码,确认密码,手机及邮箱信息都必须填写");
inInfo.setMsg("注册失败!登录账号,用户姓名,密码,确认密码,手机及身份证信息都必须填写");
return inInfo;
}
......
......@@ -108,9 +108,9 @@ public class ServiceXSUserManage extends ServiceEPBase {
inInfoRowMap.put("gender", " ");
}
if (!com.baosight.iplat4j.core.util.StringUtils.isNotEmpty(mobile)) {
/*if (!com.baosight.iplat4j.core.util.StringUtils.isNotEmpty(mobile)) {
inInfoRowMap.put("mobile", " ");
}
}*/
inInfoRowMap.put("recCreateTime", DateUtils.curDateTimeStr14());
accountExpireDays = StringUtils.defaultIfEmpty(PlatApplicationContext.getProperty("xservices.security.accountExpireDays"), "90");
......
......@@ -25,7 +25,8 @@
PWD_REVISOR,
ARCHIVE_FLAG,
USER_GROUP_ENAME,
ACCOUNT_CODE
ACCOUNT_CODE,
ID_CARD
) VALUES (
#userId#,
#loginName#,
......@@ -48,7 +49,8 @@
#pwdRevisor#,
#archiveFlag#,
#userGroupEname#,
#accountCode#
#accountCode#,
#idCard#
)
</insert>
<select id="query" resultClass="java.util.HashMap">
......@@ -74,7 +76,8 @@
t1.archive_flag as "archiveFlag",
t1.USER_GROUP_ENAME as "userGroupEname",
t1.ACCOUNT_CODE as "accountCode",
t2.group_cname as "userGroupCname"
t2.group_cname as "userGroupCname",
t1.ID_CARD as "idCard"
FROM ${platSchema}.XS_USER t1
left join ${platSchema}.XS_USER_GROUP t2 on t2.group_ename=t1.USER_GROUP_ENAME
where t1.login_name != 'admin'
......@@ -102,6 +105,9 @@
<isNotEmpty prepend=" AND " property="accountCode">
t1.account_code = #accountCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="idCard">
t1.ID_CARD LIKE CONCAT('%',#idCard#,'%')
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -175,6 +181,9 @@
<isNotEmpty prepend=" AND " property="isLocked">
t1.is_locked = #isLocked#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="idCard">
t1.ID_CARD LIKE CONCAT('%',#idCard#,'%')
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -207,6 +216,9 @@
<isNotEmpty prepend="," property="email">
email = #email#
</isNotEmpty>
<isNotEmpty prepend="," property="idCard">
ID_CARD = #idCard#
</isNotEmpty>
<isNotEmpty prepend="," property="userType">
user_type = #userType#
</isNotEmpty>
......@@ -332,7 +344,8 @@
JOB_ID,
JOB_NAME,
EHR_ORG_ID,
ACCOUNT_CODE
ACCOUNT_CODE,
ID_CARD
) VALUES (
#userId#,
#loginName#,
......@@ -358,7 +371,8 @@
#jobId#,
#jobName#,
#ehrOrgId#,
#accountCode#
#accountCode#,
#idCard#
)
</insert>
......@@ -387,7 +401,8 @@
t1.pwd_revisor as "pwdRevisor",
t1.archive_flag as "archiveFlag",
t1.USER_GROUP_ENAME as "userGroupEname",
t2.group_cname as "userGroupCname"
t2.group_cname as "userGroupCname",
t1.id_card as "idCard"
FROM ${platSchema}.XS_USER t1
left join ${platSchema}.XS_USER_GROUP t2 on t2.group_ename=t1.USER_GROUP_ENAME
where t1.login_name != 'admin'
......@@ -421,6 +436,9 @@
<isNotEmpty prepend=" AND " property="ehrOrgId">
t1.ehr_org_id = #ehrOrgId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="idCard">
t1.id_card = #idCard#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -464,6 +482,9 @@
<isNotEmpty prepend=" AND " property="ehrOrgId">
t1.ehr_org_id = #ehrOrgId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="idCard">
t1.id_card = #idCard#
</isNotEmpty>
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
......@@ -532,6 +553,9 @@
<isNotEmpty prepend="," property="ehrOrgId">
EHR_ORG_ID = #ehrOrgId#
</isNotEmpty>
<isNotEmpty prepend="," property="idCard">
id_card = #idCard#
</isNotEmpty>
</dynamic>
WHERE user_id = #userId#
</update>
......
......@@ -193,6 +193,7 @@ $(function () {
$("#details-0-rePass").val("");
$("#details-0-mobile").val("");
$("#details-0-email").val("");
$("#details-0-idCard").val("");
IPLAT.EFSelect.value($("#details-0-gender"), 1)
}
});
......
......@@ -59,6 +59,7 @@
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFComboColumn>
<EF:EFColumn ename="mobile" style="text-align:right;" cname="手机" data-rules="mobile_phone"/>
<EF:EFColumn ename="idCard" style="text-align:right;" cname="身份证号码" />
<EF:EFColumn ename="email" cname="邮箱" data-rules="email" style="text-align:left;"/>
<EF:EFColumn ename="userId" cname="用户ID" readonly="false" primaryKey="true" hidden="true"/>
<EF:EFColumn ename="password" cname="用户密码" hidden="true"/>
......@@ -334,6 +335,22 @@
<div class="row">
<div class="col-xs-2 control-label" style="text-align:right">
<span class="i-input-required">*</span>
<span>身份证号码</span>
</div>
<div class="col-xs-3">
<EF:EFInput blockId="details" cname="身份证号码" ename="idCard" row="0" trim="false"
data-regex="/^\d{17}(\d|X|x)$/" data-errorPrompt="身份证号码只能是15 或 18 位"
validateGroupName="group1" inline="true" value=""/>
</div>
<div class="col-xs-7">
<span id="details-0-idCard-prompt">【请输入身份证号码】</span>
</div>
</div>
</br>
<div class="row">
<div class="col-xs-2 control-label" style="text-align:right">
<span class="i-input-required"></span>
<span>电子邮件</span>
</div>
<div class="col-xs-3">
......
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