package com.docus.server.archive.converter;

import com.docus.server.archive.entity.PowerDept;
import com.docus.server.zqdyry.entity.ZqDyRyDeptInfoView;

import java.util.Objects;

/**
 * @author YongBin Wen
 * @date 2024/5/24 14:17
 */
public class ZqDyRyDeptInfoConverter {
    public static PowerDept convertDeptInfo(ZqDyRyDeptInfoView view) {
        if (view == null) {
            return null;
        }
        PowerDept powerDept = new PowerDept();
        powerDept.setDeptCode(view.getID());
        powerDept.setDeptName(view.getFDEPTNAME());
        powerDept.setEffective(Objects.isNull(view.getSTATUS()) ? 1 : Integer.parseInt(view.getSTATUS()));
        return powerDept;
    }
}
