package com.brilliance.isc.swift.objmtconvert.model.mt2xx.tag.tag201;

import com.brilliance.isc.swift.objmtconvert.model.AbsMTCreator;
import com.brilliance.isc.swift.objmtconvert.model.AbsTagCreate;
import com.brilliance.isc.swift.objmtconvert.model.mt2xx.mt2XXAbsCreator.MT201AbsCreator;
import com.brilliance.isc.swift.objmtconvert.model.mt2xx.MT201Creator;

import java.util.List;

/**
 * @Description：
 * @Author：夏猛
 * @CreateTime：2023/2/24 16:24
 **/
public class TagCycleCreator extends AbsTagCreate {
    private MT201Creator mT201Creator;

    public TagCycleCreator(AbsMTCreator absMTCreator)
    {
        super(absMTCreator);
        this.mT201Creator= (MT201Creator) absMTCreator;
    }

    public  void creator()
    {
        List<MT201AbsCreator> tagList = mT201Creator.getCycleDomain();
        for (MT201AbsCreator abs201:tagList) {
            System.out.println(tagList.toString());
            mT201Creator.set("20",abs201.getTransactionReferenceNumber());
            mT201Creator.set("32B",abs201.getCurrencyCodeAmount().getTagResult().getValue());
           if (abs201.getIntermediary()!=null){
            mT201Creator.set("56"+abs201.getIntermediary().getTagResult().getTagEnd(),abs201.getIntermediary().getTagResult().getValue());
           }
            mT201Creator.set("57"+abs201.getAccountWithInstitution().getTagResult().getTagEnd(),abs201.getAccountWithInstitution().getTagResult().getValue());
            mT201Creator.set("72",abs201.getSendertoReceiverInformationB());
        }


    }


}
