添加证件类型
This commit is contained in:
parent
3cebfb7d25
commit
f1637a3383
@ -4,6 +4,7 @@ package cn.com.tenlion.staff.service.basicstaffinfo;
|
||||
import cn.com.tenlion.staff.pojo.dtos.basicstaffinfo.BasicStaffInfoDTO;
|
||||
import cn.com.tenlion.staff.pojo.vos.basicstaffinfo.BasicStaffInfoVO;
|
||||
import ink.wgink.exceptions.RemoveException;
|
||||
import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
@ -28,9 +29,9 @@ public interface IBasicStaffInfoService {
|
||||
* @param basicStaffInfoVO
|
||||
* @param token
|
||||
* @return
|
||||
* @throws Exception
|
||||
* @throws SaveException
|
||||
*/
|
||||
SuccessResultData save(String token, BasicStaffInfoVO basicStaffInfoVO) throws Exception;
|
||||
SuccessResultData save(String token, BasicStaffInfoVO basicStaffInfoVO) throws SaveException;
|
||||
|
||||
|
||||
/**
|
||||
@ -89,4 +90,10 @@ public interface IBasicStaffInfoService {
|
||||
*/
|
||||
SuccessResultList<List<BasicStaffInfoDTO>> listPage(ListPage page) throws SearchException;
|
||||
|
||||
/**
|
||||
* 根据token查询个人信息
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
BasicStaffInfoDTO getBindUserAccount(String token);
|
||||
}
|
@ -28,4 +28,5 @@ public interface IBasicStaffInfoDao {
|
||||
void remove(Map<String, Object> params);
|
||||
|
||||
void delete(Map<String, Object> params);
|
||||
|
||||
}
|
||||
|
@ -8,10 +8,12 @@ import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import ink.wgink.common.base.DefaultBaseService;
|
||||
import ink.wgink.exceptions.RemoveException;
|
||||
import ink.wgink.exceptions.SaveException;
|
||||
import ink.wgink.exceptions.SearchException;
|
||||
import ink.wgink.module.dictionary.pojo.dtos.AreaDTO;
|
||||
import ink.wgink.module.dictionary.service.IAreaService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.app.AppTokenUser;
|
||||
import ink.wgink.pojo.result.SuccessResult;
|
||||
import ink.wgink.pojo.result.SuccessResultData;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
@ -21,9 +23,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 人员基础信息接口实现类
|
||||
@ -41,12 +41,21 @@ public class BasicStaffInfoServiceImpl extends DefaultBaseService implements IBa
|
||||
private IAreaService areaService;
|
||||
|
||||
@Override
|
||||
public SuccessResultData save(String token, BasicStaffInfoVO basicStaffInfoVO) throws Exception {
|
||||
public SuccessResultData save(String token, BasicStaffInfoVO basicStaffInfoVO) throws SaveException {
|
||||
String basicStaffInfoId = UUIDUtil.getUUID();
|
||||
Map<String, Object> params = HashMapUtil.beanToMap(basicStaffInfoVO);
|
||||
params.put("basicStaffInfoId", basicStaffInfoId);
|
||||
if (!StringUtils.isEmpty(token)) {
|
||||
setAppSaveInfo(token, params);
|
||||
params.put("bindUserAccount",params.get("creator").toString());
|
||||
params.put("tags","普通用户");
|
||||
Map<String, Object> query = new HashMap<>(4);
|
||||
query.put("bindUserAccount",params.get("creator").toString());
|
||||
BasicStaffInfoDTO dto = basicStaffInfoDao.getById(query);
|
||||
List<String> ids = new ArrayList<>();
|
||||
ids.add(dto.getBasicStaffInfoId());
|
||||
query.put("ids",ids);
|
||||
basicStaffInfoDao.delete(query);
|
||||
} else {
|
||||
setSaveInfo(params);
|
||||
}
|
||||
@ -75,6 +84,15 @@ public class BasicStaffInfoServiceImpl extends DefaultBaseService implements IBa
|
||||
return dto;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BasicStaffInfoDTO getBindUserAccount(String token) {
|
||||
AppTokenUser appTokenUser = getAppTokenUser(token);
|
||||
Map<String, Object> param = getHashMap(8);
|
||||
param.put("bindUserAccount",appTokenUser.getId());
|
||||
BasicStaffInfoDTO dto = basicStaffInfoDao.getById(param);
|
||||
return dto != null ? dto : new BasicStaffInfoDTO();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BasicStaffInfoDTO> list(Map<String, Object> params) throws SearchException {
|
||||
return null;
|
||||
@ -93,6 +111,10 @@ public class BasicStaffInfoServiceImpl extends DefaultBaseService implements IBa
|
||||
if(dataId.equals(item.getGender())){
|
||||
item.setGender(dataItem.get("data_name").toString());
|
||||
}
|
||||
//证件类型
|
||||
if(dataId.equals(item.getCardType())){
|
||||
item.setCardType(dataItem.get("data_name").toString());
|
||||
}
|
||||
//民族
|
||||
if(dataId.equals(item.getNation())){
|
||||
item.setNation(dataItem.get("data_name").toString());
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
<resultMap id="basicStaffInfoDTO" type="cn.com.tenlion.staff.pojo.dtos.basicstaffinfo.BasicStaffInfoDTO">
|
||||
<id column="basic_staff_info_id" property="basicStaffInfoId"></id>
|
||||
<result column="card_type" property="cardType"/>
|
||||
<result column="id_card_number" property="idCardNumber"/>
|
||||
<result column="full_name" property="fullName"/>
|
||||
<result column="name_used_before" property="nameUsedBefore"/>
|
||||
@ -37,6 +38,7 @@
|
||||
SELECT
|
||||
t1.basic_staff_info_id,
|
||||
t1.id_card_number,
|
||||
t1.card_type,
|
||||
t1.full_name,
|
||||
t1.name_used_before,
|
||||
t1.gender,
|
||||
@ -86,6 +88,7 @@
|
||||
<insert id="save" parameterType="map">
|
||||
INSERT INTO m_basic_staff_info (
|
||||
basic_staff_info_id,
|
||||
card_type,
|
||||
id_card_number,
|
||||
full_name,
|
||||
name_used_before,
|
||||
@ -120,6 +123,7 @@
|
||||
is_delete
|
||||
) VALUES(
|
||||
#{basicStaffInfoId},
|
||||
#{cardType},
|
||||
#{idCardNumber},
|
||||
#{fullName},
|
||||
#{nameUsedBefore},
|
||||
@ -158,6 +162,7 @@
|
||||
<select id="getById" parameterType="map" resultMap="basicStaffInfoDTO">
|
||||
SELECT
|
||||
t1.basic_staff_info_id,
|
||||
t1.card_type,
|
||||
t1.id_card_number,
|
||||
t1.full_name,
|
||||
t1.name_used_before,
|
||||
@ -192,12 +197,19 @@
|
||||
<if test="basicStaffInfoId != null and basicStaffInfoId != ''">
|
||||
AND t1.basic_staff_info_id = #{basicStaffInfoId}
|
||||
</if>
|
||||
<if test="bindUserAccount != null and bindUserAccount != ''">
|
||||
AND t1.bind_user_account = #{bindUserAccount}
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<update id="update" parameterType="map">
|
||||
UPDATE
|
||||
m_basic_staff_info
|
||||
SET
|
||||
<if test="cardType != null and cardType != ''">
|
||||
card_type = #{cardType},
|
||||
</if>
|
||||
<if test="idCardNumber != null and idCardNumber != ''">
|
||||
id_card_number = #{idCardNumber},
|
||||
</if>
|
||||
|
@ -227,13 +227,27 @@
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">身份证号</label>
|
||||
<label class="layui-form-label">证件类型</label>
|
||||
<div class="layui-input-block layui-form" id="cardTypeSelectTemplateBox" lay-filter="cardTypeSelectTemplateBox"></div>
|
||||
<script id="cardTypeSelectTemplate" type="text/html">
|
||||
<select id="cardType" name="cardType" lay-search>
|
||||
<option value="">请选择证件类型(支持搜索)</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.dataId}}">{{item.dataName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">证件证号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="idCardNumber" name="idCardNumber" class="layui-input" value="" autocomplete="off" placeholder="请输入公民身份证号">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-col-md2">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">出生日期</label>
|
||||
<div class="layui-input-block">
|
||||
@ -241,7 +255,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-col-md2">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">民族</label>
|
||||
<div class="layui-input-block layui-form" id="nationSelectTemplateBox" lay-filter="nationSelectTemplateBox"></div>
|
||||
@ -255,7 +269,7 @@
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-col-md2">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">宗教信仰</label>
|
||||
<div class="layui-input-block layui-form" id="religionSelectTemplateBox" lay-filter="religionSelectTemplateBox"></div>
|
||||
@ -532,7 +546,8 @@
|
||||
// 初始化内容
|
||||
function initData() {
|
||||
initBirthDateDate();
|
||||
initGenderSelect();
|
||||
initGenderSelect()
|
||||
initCardTypeSelect();
|
||||
initNationSelect();
|
||||
initPoliticalStatusSelect();
|
||||
initMaritalStatusSelect();
|
||||
@ -823,6 +838,18 @@
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化证件类别下拉选择
|
||||
function initCardTypeSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/76c5044f-805a-4313-b1e8-79e966b97c0d', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('cardTypeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('cardTypeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'cardTypeSelectTemplateBox');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化民族下拉选择
|
||||
function initNationSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/a981579c-572b-4fd1-8e76-5d17df97f6a4', []), {}, null, function(code, data, args) {
|
||||
|
@ -225,6 +225,20 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">证件类型</label>
|
||||
<div class="layui-input-block layui-form" id="cardTypeSelectTemplateBox" lay-filter="cardTypeSelectTemplateBox"></div>
|
||||
<script id="cardTypeSelectTemplate" type="text/html">
|
||||
<select id="cardType" name="cardType" lay-search>
|
||||
<option value="">请选择证件类型(支持搜索)</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.dataId}}">{{item.dataName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">身份证号</label>
|
||||
@ -233,7 +247,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-col-md2">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">出生日期</label>
|
||||
<div class="layui-input-block">
|
||||
@ -241,7 +255,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-col-md2">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">民族</label>
|
||||
<div class="layui-input-block layui-form" id="nationSelectTemplateBox" lay-filter="nationSelectTemplateBox"></div>
|
||||
@ -255,7 +269,7 @@
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-col-md2">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">宗教信仰</label>
|
||||
<div class="layui-input-block layui-form" id="religionSelectTemplateBox" lay-filter="religionSelectTemplateBox"></div>
|
||||
@ -564,6 +578,7 @@
|
||||
currentResidence2 = currentResidence[2];
|
||||
initBirthDateDate();
|
||||
initGenderSelect(data['gender']);
|
||||
initCardTypeSelect(data['cardType']);
|
||||
initNationSelect(data['nation']);
|
||||
initReligionSelect(data['religion']);
|
||||
initEducationSelect(data['education']);
|
||||
@ -860,6 +875,21 @@
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化证件类别下拉选择
|
||||
function initCardTypeSelect(selectValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/76c5044f-805a-4313-b1e8-79e966b97c0d', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('cardTypeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('cardTypeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select', 'cardTypeSelectTemplateBox');
|
||||
var selectObj = {};
|
||||
selectObj['cardType'] = selectValue;
|
||||
form.val('dataForm', selectObj);
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化民族下拉选择
|
||||
function initNationSelect(selectValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/a981579c-572b-4fd1-8e76-5d17df97f6a4', []), {}, null, function(code, data, args) {
|
||||
|
@ -16,7 +16,9 @@ public class BasicStaffInfoDTO {
|
||||
|
||||
@ApiModelProperty(name = "basicStaffInfoId", value = "主键")
|
||||
private String basicStaffInfoId;
|
||||
@ApiModelProperty(name = "idCardNumber", value = "公民身份证号")
|
||||
@ApiModelProperty(name = "cardType", value = "证件类型")
|
||||
private String cardType;
|
||||
@ApiModelProperty(name = "idCardNumber", value = "证件号码")
|
||||
private String idCardNumber;
|
||||
@ApiModelProperty(name = "fullName", value = "全名")
|
||||
private String fullName;
|
||||
@ -79,6 +81,14 @@ public class BasicStaffInfoDTO {
|
||||
this.basicStaffInfoId = basicStaffInfoId;
|
||||
}
|
||||
|
||||
public String getCardType() {
|
||||
return cardType == null ? "" : cardType;
|
||||
}
|
||||
|
||||
public void setCardType(String cardType) {
|
||||
this.cardType = cardType;
|
||||
}
|
||||
|
||||
public String getIdCardNumber() {
|
||||
return idCardNumber == null ? "" : idCardNumber;
|
||||
}
|
||||
|
@ -14,7 +14,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
@ApiModel
|
||||
public class BasicStaffInfoVO {
|
||||
|
||||
@ApiModelProperty(name = "idCardNumber", value = "公民身份证号")
|
||||
@ApiModelProperty(name = "cardType", value = "证件类型")
|
||||
private String cardType;
|
||||
@ApiModelProperty(name = "idCardNumber", value = "证件号码")
|
||||
private String idCardNumber;
|
||||
@ApiModelProperty(name = "fullName", value = "全名")
|
||||
private String fullName;
|
||||
@ -69,6 +71,14 @@ public class BasicStaffInfoVO {
|
||||
@ApiModelProperty(name = "tags", value = "用户标签")
|
||||
private String tags;
|
||||
|
||||
public String getCardType() {
|
||||
return cardType == null ? "" : cardType;
|
||||
}
|
||||
|
||||
public void setCardType(String cardType) {
|
||||
this.cardType = cardType;
|
||||
}
|
||||
|
||||
public String getIdCardNumber() {
|
||||
return idCardNumber == null ? "" : idCardNumber;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user