package com.docus.server.collection.converter;

import com.docus.server.collection.dto.FirstPageCheckoutInDTO;
import com.docus.server.collection.dto.FirstPageCheckoutRequest;

import java.util.Objects;

/**
 * 首页签出转换
 *
 * @author WYBDEV
 */
public class FirstPageCheckoutConverter {
    private FirstPageCheckoutRequest firstPageCheckoutRequest;

    public FirstPageCheckoutConverter(FirstPageCheckoutRequest firstPageCheckoutRequest) {
        this.firstPageCheckoutRequest = firstPageCheckoutRequest;
    }

    public FirstPageCheckoutConverter() {

    }

    /**
     * 请求参数转service处理参数
     *
     * @return service处理参数
     */
    public FirstPageCheckoutInDTO req2dto() {
        FirstPageCheckoutRequest firstPageCheckoutRequest = this.firstPageCheckoutRequest;
        if (Objects.isNull(firstPageCheckoutRequest)) {
            return null;
        }
        FirstPageCheckoutInDTO dto = new FirstPageCheckoutInDTO();
        dto.setSyncMethod(firstPageCheckoutRequest.getSyncMethod());
        dto.setPatientInfo(firstPageCheckoutRequest.getPatientInfo());
        dto.setSysId(firstPageCheckoutRequest.getSysId());
        return dto;
    }
}
