package com.brilliance.isc.common.lendoc;

import com.brilliance.isc.common.context.SettleContext;
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.mda.runtime.mda.util.MdaUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class LendocDocumentRegister implements IDocumentRegister {
    @Autowired
    private TrndocService trndocService;
    @Override
    public void registerDocument(TrndocVo trndoc) {
        String frame = SettleContext.getTransName();
        if (MdaUtils.compareTo(frame, "NETSET") == 0) {
            trndocService.defDocEot(trndoc, "TRN", "", "\\BOTSETL1", "LET", 0, "", "\\GCDGRP\\REC", "收账通知", "BEN", "");
        }
        if (MdaUtils.compareTo(frame, "BTTSET") == 0) {
            trndocService.defDocEot(trndoc, "TRN", "", "\\BOTSETL1", "LET", 0, "", "\\BTDGRP\\REC", "收账通知", "BE1", "");
        }
        if (MdaUtils.compareTo(frame, "BOTSET") == 0) {
            trndocService.defDocEot(trndoc, "TRN", "", "\\BOTSETL1", "LET", 0, "", "\\BOTGRP\\REC", "收账通知", "DRR", "");
        }
        if (MdaUtils.compareTo(frame, "BETSET") == 0) {
            trndocService.defDocEot(trndoc, "TRN", "", "\\BOTSETL1", "LET", 0, "", "\\BEDGRP\\REC", "收账通知", "BEN", "");
        }
    }
}
