package com.engine.recruit.entity.resume;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;

/**
 * @author:dxfeng
 * @createTime: 2023/11/10
 * @version: 1.0
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class OcrResumePo {
    private String id;
    private String xm;
    private String xb;
    private String csrq;
    private String jg;
    private String yx;
    private String wx;
    private String qq;
    private String xjzd;
    private String ah;
    private String grys;
    private String jyjl;
    private String bysj;
    private String zgxl;
    private String zyjn;
    private String sxjl;
    private String yysp;
    private String zs;
    private String gzjl;
    private String ypzw;
    private String gzjy;
    private String xmjl;
    private String sjhm;
    private String nl;
    private String sfz;
    private String jlfj;

    public String getXb() {
        if ("男".equals(xb)) {
            return "0";
        } else if ("女".equals(xb)) {
            return "1";
        }
        return null;
    }

    public Integer getNl() {
        if (StringUtils.isNotBlank(nl)) {
            try {
                return Integer.parseInt(nl);
            } catch (Exception e) {
                new BaseBean().writeLog(e);
            }
        }
        return null;
    }

    public String getYpzw() {
        String id = null;
        if (StringUtils.isNotBlank(ypzw)) {
            RecordSet rs = new RecordSet();
            rs.executeQuery("select id from uf_jcl_zp_zpzw where zpzwmc = ? ", ypzw);
            if (rs.next()) {
                id = rs.getString("id");
            }
        }
        return id;
    }
}
