package com.jeeplus.human.depart.handover.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jeeplus.core.domain.BaseEntity;
import com.jeeplus.sys.domain.WorkAttachmentInfo;
import lombok.Data;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.apache.pdfbox.pdmodel.font.PDType0Font;

import org.apache.pdfbox.pdmodel.graphics.state.RenderingMode;
import org.apache.pdfbox.util.Matrix;
import org.dom4j.Attribute;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.io.File;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * 离职交接表
 * @author 王强
 * @version 1.0
 * @date 2023-10-27 9:00
 */
@Data
@TableName("human_resources_depart_handover")
public class Handover extends BaseEntity {

    private String name;
    private String projectManager;      //项目经理
    @TableField(exist = false)
    private String projectManagerName;      //项目经理名称
    private String remarks;                 //备注
    private String department;              //所属部门
    @TableField(exist = false)
    private String departmentName;              //所属部门名称
    private String type;                //流程状态
    private String procInsId;
    private String processDefinitionId;
    private String draftAdministrator;  //底稿管理员
    private String registrationId;      //离职申请表id

    private String xmlFilePath;         //生成的xml文件的地址
    private String pdfFilePath;         //生成的xml文件的地址
    private String wordFilePath;         //生成的word文件的地址
    private String signatureContractId; //签章流程contractId
    private String signatureUrl;    //签章服务器签章文件存储路径
    private String signatureFlag;    //离职证明是否签章(1：已签章，2：未签章（需线下盖章）)

    @TableField(exist = false)
    private List<WorkAttachmentInfo> workAttachments;
    @TableField(exist = false)
    private String arrivalDate;             //到岗日期
    @TableField(exist = false)
    private String departResignationDate;   //预定离职日期

}
