package com.brilliance.isc.common.trndoc.service;

import com.brilliance.isc.bo.Spt;
import com.brilliance.isc.common.doc.TextResultVo;
import com.brilliance.isc.common.transaction.vo.BaseTransactionVo;
import com.brilliance.isc.common.trndoc.vo.DoceotVo;
import com.brilliance.isc.common.trndoc.vo.TrndocVo;
import com.brilliance.isc.common.vo.AbstractCommonVo;
import com.brilliance.isc.common.vo.FremsgVo;
import com.brilliance.isc.common.vo.PtsptaVo;
import com.brilliance.mda.runtime.mda.IStream;
import com.brilliance.mda.runtime.mda.impl.Argument;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface TrndocService {

    void defDocEot(TrndocVo trndoc, String trigger, String subId, String argdocpannam, String apfcod, int mandatoryFlag, String argptainr, String objmod, String pandsc, String role, String argadrblk);

    boolean isConInPdxChanged(TrndocVo trndoc);

    void trnDOCFillDOCTree();

    void assertDOCS(TrndocVo trndoc);

    void saveDocuments(TrndocVo trndoc);

    void clearCorTypeList();

    List<String> getCortypeList();

    void registerCorType(String... cortyps);

    void setCORTYPList(TrndocVo trndocVo, String trigger, String subId, String corTYPList);

    String docEOTGetORISMHINR(List<DoceotVo> doceots, String refid);

    String docEOTGetCORTYP(TrndocVo trndoc, String trigger, String subId);

    void documentToAllApplicants(TrndocVo trndocVo, String subId, String argdocpannam, String apfcod, BigDecimal mandatoryFlag, String pandsc, String excluderole);

    String streamGet2SWIFT(IStream argStm, int argMaxLin, int argMaxLen, String argCharSet);

    boolean docEOTIsCORTYPUsed(String argCorTyp, TrndocVo trndoc);

    void defDocAtt(TrndocVo trndocVO, String trigger, String argID, String argSUBID, String argDsc, String argATTTYP, String argATTINR, String argIDREF);

    void setDOCUIL(TrndocVo trndocVo, String trigger, String subId, String docUil);


    String docEOTGetField(TrndocVo trndocVo, String refid, String fieldName);

    String showDOCS(Map<String, Object> paramMap) throws IOException;

    void wordToPdf(String filePath, String targetPath) throws IOException;

    int docEOTGetRow(List<DoceotVo> doceotList, String refid);

    void removeCORTYPFromList(TrndocVo trndocVo, String trigger, String subId, String cortyp);

    void setMdtFlg(TrndocVo trndocVo, String subID, Argument<BigDecimal> mdt);

    String convertDocx2Pdf(String filePath, String targetPath) throws Exception;

    void setUseTag79Z(TrndocVo trndoc, String set, String s, String swt);

    void printheaderen(Map<String, Object> map);

    void printfooteren(Map<String, Object> map);

    void xmlPrtAdrOfReceiver(Map<String, List<String[]>> dataMap, DoceotVo doceotVo);

    void xmlPrtEmptyLine(Map<String, List<String[]>> dataMap, int argNumber);

    int getCurrentCORLineLength(DoceotVo doceotVo);

    String xmlGetTxtSepTxt(String argTxt1, String argSep, String argTxt2);

    void xmlPrintTitleBold(Map<String, List<String[]>> dataMap, DoceotVo doceotVo, String argTitle);

    void xmlPrtRefLine(Map<String, List<String[]>> dataMap, DoceotVo doceotVo, String argText, String argValue);

    void xmlPrtSalutation(Map<String, List<String[]>> dataMap, DoceotVo doceotVo);

    <T extends BaseTransactionVo> void xmlPrtRefLineYourRef(Map<String, List<String[]>> dataMap, T transactionVo, DoceotVo doceotVo);
    <T extends BaseTransactionVo> void xmlPrtRefLineOwnRef(Map<String, List<String[]>> dataMap, T transactionVo, DoceotVo doceotVo);

    String xmlFmtCurAmt(DoceotVo doceotVo, String argCUR, BigDecimal argAMT);

    String xmlFmtAmount(DoceotVo doceotVo, BigDecimal argAMT, String argCUR);

    String xmlFmtDate(DoceotVo doceotVo, String argDatTyp, Date argDate);

    void xmlPrtRefLinePty(Map<String, List<String[]>> dataMap, DoceotVo doceotVo, PtsptaVo argGrpRol);

    void xmlPrtReplyStart(Map<String, List<String[]>> dataMap, DoceotVo doceotVo);

    void xmlPrintTitleUnderlineFS11(Map<String, List<String[]>> dataMap, DoceotVo doceotVo, String txt);

    void xmlPrtTxtBlk(Map<String, List<String[]>> dataMap, String argNam, String argText);

    <T extends BaseTransactionVo> void xmlPrtAmeFields(Map<String, List<String[]>> dataMap, T transactionVo, List<String> excludeList);

    void xmlDocEnd(Map<String, List<String[]>> dataMap, DoceotVo doceotVo, String argEncInf);

    void xmlPrtTxtAboveBlk(Map<String, List<String[]>> dataMap, String argText, String argValue);

    void printTwoAddresses(Map<String, List<String[]>> dataMap, DoceotVo doceotVo, PtsptaVo ptsptaVo1, PtsptaVo ptsptaVo2);

    String xmlGetTblText(DoceotVo doceotVo, String argKey, String argTable);

    <T extends AbstractCommonVo> boolean isRmbCancel(T grp, T oldGrp);

    void xmlPrtAPPRULRMB(Map<String, List<String[]>> dataMap, String argAPPRULRMB);

    TextResultVo outputMessage(DoceotVo doceotVo);

    String getScore23X(DoceotVo doceotVo);

    void fillCONDOCSTM(TrndocVo trndocVo);
    <T> String getFretxt(DoceotVo doceotVo, T transactionVo);


     String getFretxt(DoceotVo doceotVo, FremsgVo fremsg, Spt spt);

    /**
     * 根据ID为SWIFT格式报文设置报文
     * 使用字段DOCSNF
     * @param trndocVo
     * @param id
     * @param cortyp
     * @param docsnf
     */
    void setDocSendFormat(TrndocVo trndocVo, String id, String cortyp, String docsnf);

    /**
     * 根据ID为SWIFT格式报文设置报文
     * 使用字段DOCSNF
     * @param trndocVo
     * @param id
     * @param cortyp
     * @param mt
     */
    void setMt(TrndocVo trndocVo, String id, String cortyp, String mt);

    /**
     *
     */
    boolean existDocidAndCortyp(List<DoceotVo> doceots, String docnam, String cortyp);
}
