package com.brilliance.isc.common.register.document.common;

import com.brilliance.isc.common.register.document.IDocumentRegister;
import com.brilliance.isc.common.trndoc.service.TrndocService;
import com.brilliance.isc.common.trndoc.vo.TrndocVo;
import com.brilliance.isc.vo.component.dftcre.DftcreVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DftcreDocumentRegister implements IDocumentRegister {

    @Autowired
    private TrndocService trndocService;

    @Override
    public void registerDocument(TrndocVo trndoc) {
        DftcreVo dftcreVo = trndoc.getRec().getDftcreVo();
        if (dftcreVo != null && "X".equalsIgnoreCase(dftcreVo.getDfflag())) {
            String fintyp = dftcreVo.getDfdgrp().getRec().getFintyp();
            if ("A".equalsIgnoreCase(fintyp) || "B".equalsIgnoreCase(fintyp)) {
                trndocService.defDocEot(trndoc,"TRN", "APL", "\\DFTPAYL1", "LET", 0, "", "", "委托方代付业务开户转账工作联系单", "APL", "" );
            }
        }
    }
}
