com.dahuatech.icc.multiinone.brm.vo.QueryPersonDetailRequest Maven / Gradle / Ivy
package com.dahuatech.icc.multiinone.brm.vo;
import com.dahuatech.icc.multiinone.brm.enums.QueryPersonTypeEnums;
import com.dahuatech.icc.multiinone.exception.BusinessException;
import com.dahuatech.icc.multiinone.utils.StringUtils;
import com.dahuatech.icc.multiinone.vo.BaseRequest;
public class QueryPersonDetailRequest extends BaseRequest {
/**1:按人员id 2:按人员编码 3:按证件号*/
private String queryPersonType;
private Long personId;
private String code;
private Integer paperType;
private String paperNumber;
public void businessValid() {
if(QueryPersonTypeEnums.QueryById.type.equals(queryPersonType)){
if(personId == null){
throw new BusinessException("人员id为空");
}
}else if(QueryPersonTypeEnums.QueryByCode.type.equals(queryPersonType)){
if(StringUtils.isEmpty(code)){
throw new BusinessException("人员编码为空");
}
}else if(QueryPersonTypeEnums.QueryByPaperNumber.type.equals(queryPersonType)){
if(StringUtils.isEmpty(paperNumber)){
throw new BusinessException("证件号码为空");
}
}else{
throw new BusinessException("查询类型非法");
}
}
public Long getPersonId() {
return personId;
}
public void setPersonId(Long personId) {
this.personId = personId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Integer getPaperType() {
return paperType;
}
public void setPaperType(Integer paperType) {
this.paperType = paperType;
}
public String getPaperNumber() {
return paperNumber;
}
public void setPaperNumber(String paperNumber) {
this.paperNumber = paperNumber;
}
public String getQueryPersonType() {
return queryPersonType;
}
public void setQueryPersonType(String queryPersonType) {
this.queryPersonType = queryPersonType;
}
}