using ICS.CreateLotMaster;
using ICS.WCF.Base;
using ICSSoft.Entity;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using UFIDA.ISV.BFTransferInApprove;
using UFIDA.ISV.BFTransferINDelete;
using UFIDA.ISV.TransferInBatchApproveSRV;
using UFIDA.ISV.TransferInBatchCommitSRV;
using UFSoft.UBF.Service;
using UFSoft.UBF.Util.Context;
using www.ufida.org.EntityData;
//using UFIDA.ISV.CreateLotMaster;

namespace UFIDA.ISV.CreateTransferINForJOB
{

    public class CustCreateTransferINForJOB
    {
        public OperationResult CreateTransferINForJOB(List<TransferINHead> TransferInList)
        {
            #region 入口日志
            StringBuilder beginstrlog = new StringBuilder();
            beginstrlog.AppendLine("日志记录开始");
            beginstrlog.AppendLine("*****************************************************");
            foreach (TransferINHead TransferInInfo in TransferInList)
            {
                beginstrlog.AppendLine("调入单单据类型:" + TransferInInfo.DocType);
                beginstrlog.AppendLine("组织编码:" + TransferInInfo.WorkPoint);
                //beginstrlog.AppendLine("领料单号:" + TransferInInfo.LLCode);
                foreach (var line in TransferInInfo.details)
                {
                    beginstrlog.AppendLine("供应商编码:" + line.SupplierCode);
                    beginstrlog.AppendLine("调入物料编码:" + line.InvCode);
                    beginstrlog.AppendLine("调入数量:" + line.Quantity);
                    beginstrlog.AppendLine("调入仓库" + line.INWhCode);
                    beginstrlog.AppendLine("调出仓库" + line.OutWhCode);
                    beginstrlog.AppendLine("批号" + line.BatchCode);
                    beginstrlog.AppendLine("LogId" + line.LogId);
                }
            }
            beginstrlog.AppendLine("*****************************************************");
            Appconfig.WriteLogFile(beginstrlog.ToString(), "创建调拨单");
            #endregion
            #region 服务调用框架结构
            UFIDAU9ISVTransferInISVICommonCreateTransferInSVClient client = new UFIDAU9ISVTransferInISVICommonCreateTransferInSVClient();
            //服务返回结果
            UFIDAU9CBOPubControllerCommonArchiveDataDTOData[] returnItems;
            //返回异常信息，目前还没有使用此属性
            OperationResult res = new OperationResult();
            UFSoft.UBF.Exceptions.MessageBase[] outMessages;

            long[] TransferInID;

            string[] splitMergeRule = null;
            //上下文信息
            object context;
            //传入 参数
            UFIDAU9ISVTransferInISVIC_TransferInDTOData[] TransferInfoArray;
            //空
            string[] splitBy = new string[] { };
            string UserID = "";
            string WHCode = "";
            long WHID = 0;
            StringBuilder strlog = new StringBuilder();
            try
            {
                List<rtnTransferInfo> rtnpos = new List<rtnTransferInfo>();

                if (TransferInList == null)
                {
                    strlog.AppendLine("*****************************************************");
                    strlog.AppendLine("错误消息:传入数据不能为空");
                    strlog.AppendLine("*****************************************************");
                    Appconfig.WriteLogFile(strlog.ToString(), "创建调拨单");
                    res.Success = false;
                    res.Message = "传入数据不能为空";
                    return res;
                }
                string OrgID = "";
                string orgsql = @"select ID from Base_Organization
                                  where Code='{0}'";
                orgsql = string.Format(orgsql, TransferInList[0].WorkPoint);
                DataTable orgdt = DBhlper.Query(orgsql, Appconfig.GetU9ConnStr());
                if (orgdt.Rows.Count != 0)
                {
                    OrgID = orgdt.Rows[0]["ID"].ToString();
                }
                else
                {
                    strlog.AppendLine("*****************************************************");
                    strlog.AppendLine("错误消息:传入的组织:'" + TransferInList[0].WorkPoint + "'不存在");
                    strlog.AppendLine("*****************************************************");
                    Appconfig.WriteLogFile(strlog.ToString(), "创建调拨单");
                    res.Success = false;
                    res.Message = "传入的组织:'" + TransferInList[0].WorkPoint + "'不存在";
                    return res;

                }

                if (TransferInList[0].DocType == "TransIn001")
                {
                    string OutOrgID = "";
                    string Outorgsql = @"select ID from Base_Organization
                                  where Code='{0}'";
                    Outorgsql = string.Format(Outorgsql, TransferInList[0].OutOrgCode);
                    DataTable Outorgdt = DBhlper.Query(Outorgsql, Appconfig.GetU9ConnStr());
                    if (Outorgdt.Rows.Count != 0)
                    {
                        OutOrgID = Outorgdt.Rows[0]["ID"].ToString();
                    }
                    else
                    {
                        strlog.AppendLine("*****************************************************");
                        strlog.AppendLine("错误消息:传出的组织:'" + TransferInList[0].OutOrgCode + "'不存在");
                        strlog.AppendLine("*****************************************************");
                        Appconfig.WriteLogFile(strlog.ToString(), "创建调拨单");
                        res.Success = false;
                        res.Message = "传出的组织:'" + TransferInList[0].WorkPoint + "'不存在";
                        return res;
                    }
                }

                #region 获取传入单据类型对应的ID
                string DocTypeID = "";
                string doctypesql = @"select ID from InvDoc_TransInDocType
                                     where Code='{0}' AND Org='{1}'";
                doctypesql = string.Format(doctypesql, TransferInList[0].DocType, OrgID);
                DataTable DocTypedt = DBhlper.Query(doctypesql, Appconfig.GetU9ConnStr());
                if (DocTypedt.Rows.Count == 0)
                {
                    strlog.AppendLine("*****************************************************");
                    strlog.AppendLine("错误消息:传入的单据类型:'" + TransferInList[0].DocType + "'在U9中不存在");
                    strlog.AppendLine("*****************************************************");
                    Appconfig.WriteLogFile(strlog.ToString(), "创建调拨单");

                    res.Success = false;
                    res.Message = "传入的单据类型:'" + TransferInList[0].DocType + "'在U9中不存在";
                    return res;

                }
                else
                {
                    DocTypeID = DocTypedt.Rows[0]["ID"].ToString();
                }
                #endregion

                List<UFIDAU9ISVTransferInISVIC_TransferInDTOData> TransferInfoList = new List<UFIDAU9ISVTransferInISVIC_TransferInDTOData>();
                UFIDAU9ISVTransferInISVIC_TransferInDTOData TransferInfo = new UFIDAU9ISVTransferInISVIC_TransferInDTOData();
                List<UFIDAU9ISVTransferInISVIC_TransInLineDTOData> TransferLineInfoList = new List<UFIDAU9ISVTransferInISVIC_TransInLineDTOData>();
                UFIDAU9ISVTransferInISVIC_TransInLineDTOData TransferLineInfo = new UFIDAU9ISVTransferInISVIC_TransInLineDTOData();
                List<UFIDAU9ISVTransferInISVIC_TransInSubLineDTOData> TransferOutLineInfoList = new List<UFIDAU9ISVTransferInISVIC_TransInSubLineDTOData>();
                UFIDAU9ISVTransferInISVIC_TransInSubLineDTOData TransferOutLineInfo = new UFIDAU9ISVTransferInISVIC_TransInSubLineDTOData();
                foreach (TransferINHead TransferIN in TransferInList)
                {
                    TransferInfo.m_docNo = TransferIN.DocNo;
                    TransferInfo.m_businessDate = Convert.ToDateTime(TransferIN.DocDate);
                    TransferInfo.m_transferType = 0;
                    TransferInfo.m_transInDocType = new UFIDAU9CBOPubControllerCommonArchiveDataDTOData();
                    TransferInfo.m_transInDocType.m_iD = long.Parse(DocTypeID);
                    TransferInfo.m_transInDocType.m_code = TransferIN.DocType;
                    TransferInfo.m_transferDirection = 0;
                    TransferInfo.m_descFlexField = new UFIDAU9BaseFlexFieldDescFlexFieldDescFlexSegmentsData();
                    //TransferInfo.m_descFlexField.m_pubDescSeg1 = TransferIN.cFree1;
                    //TransferInfo.m_descFlexField.m_pubDescSeg2 = TransferIN.cFree2;
                    //TransferInfo.m_descFlexField.m_pubDescSeg3 = TransferIN.cFree3;
                    //TransferInfo.m_descFlexField.m_pubDescSeg4 = TransferIN.cFree4;
                    //TransferInfo.m_descFlexField.m_pubDescSeg5 = TransferIN.cFree5;
                    //TransferInfo.m_descFlexField.m_pubDescSeg6 = TransferIN.cFree6;
                    //TransferInfo.m_descFlexField.m_pubDescSeg7 = TransferIN.cFree7;
                    //TransferInfo.m_descFlexField.m_pubDescSeg8 = TransferIN.cFree8;
                    //TransferInfo.m_descFlexField.m_pubDescSeg9 = TransferIN.cFree9;
                    //TransferInfo.m_descFlexField.m_pubDescSeg10 = TransferIN.cFree10;
                    TransferInfo.m_descFlexField.m_privateDescSeg1 = TransferIN.cFree1;
                    TransferInfo.m_descFlexField.m_privateDescSeg2 = TransferIN.cFree2;
                    TransferInfo.m_descFlexField.m_privateDescSeg3 = TransferIN.cFree3;
                    TransferInfo.m_descFlexField.m_privateDescSeg4 = TransferIN.cFree4;
                    TransferInfo.m_descFlexField.m_privateDescSeg5 = TransferIN.cFree5;
                    TransferInfo.m_descFlexField.m_privateDescSeg6 = TransferIN.cFree6;
                    TransferInfo.m_descFlexField.m_privateDescSeg7 = TransferIN.cFree7;
                    TransferInfo.m_descFlexField.m_privateDescSeg8 = TransferIN.cFree8;
                    TransferInfo.m_descFlexField.m_privateDescSeg9 = TransferIN.cFree9;
                    TransferInfo.m_descFlexField.m_privateDescSeg10 = TransferIN.cFree10;

                    //TransferInfo.m_descFlexField.m_privateDescSeg1 = TransferIN.LLCode;
                    foreach (TransferINBody line in TransferIN.details)
                    {
                        #region 根据传入物料编码获取物料ID
                        string ITEMID = "";
                        string itemsql = @"select ID from CBO_ItemMaster
                                           where Code='{0}' AND Org='{1}'";
                        itemsql = string.Format(itemsql, line.InvCode, OrgID);
                        DataTable itemdt = DBhlper.Query(itemsql, Appconfig.GetU9ConnStr());
                        if (itemdt.Rows.Count == 0)
                        {
                            strlog.AppendLine("*****************************************************");
                            strlog.AppendLine("错误消息:传入的物料编码:'" + line.InvCode + "'在U9中不存在");
                            strlog.AppendLine("*****************************************************");
                            Appconfig.WriteLogFile(strlog.ToString(), "创建调拨单");


                            res.Success = false;
                            res.Message = "传入的物料编码:'" + line.InvCode + "'在U9中不存在";
                            return res;

                        }
                        else
                        {
                            ITEMID = itemdt.Rows[0]["ID"].ToString();
                        }
                        #endregion
                        #region 根据传入仓库获取仓库ID
                        string INWHID = "";
                        string OUTWHID = "";
                        string whsql = @"select ID from CBO_WH
                                         where Code='{0}' AND Org='{1}'";
                        whsql = string.Format(whsql, line.INWhCode, OrgID);
                        DataTable whdt = DBhlper.Query(whsql, Appconfig.GetU9ConnStr());
                        if (whdt.Rows.Count == 0)
                        {
                            strlog.AppendLine("*****************************************************");
                            strlog.AppendLine("错误消息:传入的调入仓库编码:'" + line.INWhCode + "'在U9中不存在");
                            strlog.AppendLine("*****************************************************");
                            Appconfig.WriteLogFile(strlog.ToString(), "创建调拨单");

                            res.Success = false;
                            res.Message = "传入的调入仓库编码:'" + line.INWhCode + "'在U9中不存在";
                            return res;
                        }
                        else
                        {
                            INWHID = whdt.Rows[0]["ID"].ToString();
                        }
                        whsql = @"select ID from CBO_WH
                                  where Code='{0}' AND Org='{1}'";
                        whsql = string.Format(whsql, line.OutWhCode, OrgID);
                        whdt = DBhlper.Query(whsql, Appconfig.GetU9ConnStr());
                        if (whdt.Rows.Count == 0)
                        {
                            strlog.AppendLine("*****************************************************");
                            strlog.AppendLine("错误消息:传入的调出仓库编码:'" + line.OutWhCode + "'在U9中不存在");
                            strlog.AppendLine("*****************************************************");
                            Appconfig.WriteLogFile(strlog.ToString(), "创建调拨单");

                            res.Success = false;
                            res.Message = "传入的调出仓库编码:'" + line.OutWhCode + "'在U9中不存在";
                            return res;

                        }
                        else
                        {
                            OUTWHID = whdt.Rows[0]["ID"].ToString();
                        }
                        #endregion
                        #region 根据传入供应商编码获取供应商ID
                        if (!string.IsNullOrWhiteSpace(line.SupplierCode))
                        {
                            long SupplierID = 0;
                            string supsql = @"select ID from CBO_Supplier
                                              where Code='{0}' AND Org='{1}'";
                            supsql = string.Format(supsql, line.SupplierCode, OrgID);
                            DataTable supdt = DBhlper.Query(supsql, Appconfig.GetU9ConnStr());
                            if (supdt.Rows.Count == 0)
                            {
                                strlog.AppendLine("*****************************************************");
                                strlog.AppendLine("错误消息:传入的供应商编码:'" + line.SupplierCode + "'在U9中不存在");
                                strlog.AppendLine("*****************************************************");
                                Appconfig.WriteLogFile(strlog.ToString(), "创建调拨单");

                                res.Success = false;
                                res.Message = "传入的供应商编码:'" + line.SupplierCode + "'在U9中不存在";
                                return res;

                            }
                        }
                        #endregion
                        TransferLineInfo = new UFIDAU9ISVTransferInISVIC_TransInLineDTOData();
                        TransferLineInfo.m_costUOMQty = line.Quantity;
                        TransferLineInfo.m_storeUOMQty = line.Quantity;
                        TransferLineInfo.m_itemInfo = new UFIDAU9CBOSCMItemItemInfoData();
                        TransferLineInfo.m_itemInfo.m_itemCode = line.InvCode;
                        TransferLineInfo.m_itemInfo.ItemID = long.Parse(ITEMID);
                        TransferLineInfo.m_storageType = 4;
                        TransferLineInfo.m_transInWh = new UFIDAU9CBOPubControllerCommonArchiveDataDTOData();
                        TransferLineInfo.m_transInWh.m_iD = long.Parse(INWHID);
                        TransferLineInfo.m_transInWh.m_code = line.INWhCode;
                        TransferLineInfo.m_docLineNo = line.Sequence;

                        #region 批号
                        if (line.BatchCode != "")
                        {
                            string LotID = "";
                            if (!string.IsNullOrWhiteSpace(Appconfig.GetLotNOByBinid(line.BatchCode, OrgID, ITEMID)))
                            {
                                TransferLineInfo.m_lotInfo = new UFIDAU9CBOSCMPropertyTypesLotInfoData();
                                TransferLineInfo.m_lotInfo.m_lotCode = line.BatchCode;
                                TransferLineInfo.m_lotInfo.m_lotMaster = new UFIDAU9BasePropertyTypesBizEntityKeyData();
                                TransferLineInfo.m_lotInfo.m_lotMaster.m_entityID = Convert.ToInt64(Appconfig.GetLotNOByBinid(line.BatchCode, OrgID, ITEMID));
                            }
                            else
                            {
                                CustCreateLotMaster LotMasterCreate = new CustCreateLotMaster();
                                string lotWHCode = line.INWhCode;
                                string lotItemCode = line.InvCode;
                                string LotCode = line.BatchCode;
                                LotMasterCreate.CustCreateRCVLotMaster(lotWHCode, lotItemCode, LotCode, OrgID, ref LotID);
                                if (LotID != "")
                                {
                                    TransferLineInfo.m_lotInfo = new UFIDAU9CBOSCMPropertyTypesLotInfoData();
                                    TransferLineInfo.m_lotInfo.m_lotCode = line.BatchCode;
                                    TransferLineInfo.m_lotInfo.m_lotMaster = new UFIDAU9BasePropertyTypesBizEntityKeyData();
                                    TransferLineInfo.m_lotInfo.m_lotMaster.m_entityID = long.Parse(LotID);
                                }

                            }
                        }

                        #endregion


                        TransferOutLineInfoList = new List<UFIDAU9ISVTransferInISVIC_TransInSubLineDTOData>();
                        TransferOutLineInfo = new UFIDAU9ISVTransferInISVIC_TransInSubLineDTOData();
                        TransferOutLineInfo.m_costUOMQty = line.Quantity;
                        TransferOutLineInfo.m_storeUOMQty = line.Quantity;
                        TransferOutLineInfo.m_storageType = 4;
                        if (line.SupplierCode != "")
                        {
                            TransferOutLineInfo.m_transOutSuppInfo = new UFIDAU9CBOSCMSupplierSupplierMISCInfoData();
                            TransferOutLineInfo.m_transOutSuppInfo.m_code = line.SupplierCode;
                        }
                        TransferOutLineInfo.m_transOutWh = new UFIDAU9CBOPubControllerCommonArchiveDataDTOData();
                        TransferOutLineInfo.m_transOutWh.m_code = line.OutWhCode;
                        TransferOutLineInfo.m_transOutWh.m_iD = long.Parse(OUTWHID);

                        if (line.BatchCode != "")
                        {
                            string OutLotID = "";

                            if (!string.IsNullOrWhiteSpace(Appconfig.GetLotNOByBinid(line.BatchCode, OrgID, ITEMID)))
                            {
                                TransferOutLineInfo.m_lotInfo = new UFIDAU9CBOSCMPropertyTypesLotInfoData();
                                TransferOutLineInfo.m_lotInfo.m_lotCode = line.BatchCode;
                                TransferOutLineInfo.m_lotInfo.m_lotMaster = new UFIDAU9BasePropertyTypesBizEntityKeyData();
                                TransferOutLineInfo.m_lotInfo.m_lotMaster.m_entityID = Convert.ToInt64(Appconfig.GetLotNOByBinid(line.OutBatchCode, OrgID, ITEMID));
                            }
                        }


                        TransferOutLineInfoList.Add(TransferOutLineInfo);
                        TransferLineInfo.m_transInSubLines = TransferOutLineInfoList.ToArray();
                        TransferLineInfoList.Add(TransferLineInfo);
                    }
                    TransferInfo.m_transInLines = TransferLineInfoList.ToArray();
                    TransferInfoList.Add(TransferInfo);
                }



                //给传入参数赋值

                //pOList = SetrCVDtos(rCVInfoList);
                strlog.AppendLine("创建调入单");
                strlog.AppendLine("*****************************************************");
                long TransferInType = 0;
                //给上下文信息赋值
                context = CreateContextObj(OrgID, "", "");
                (client.Endpoint.Binding as BasicHttpBinding).MaxReceivedMessageSize = int.MaxValue;
                (client.Endpoint.Binding as BasicHttpBinding).MaxBufferSize = int.MaxValue;

                //创建调入单
                returnItems = client.Do(context, TransferInfoList.ToArray(), out outMessages);
                foreach (var returnline in returnItems)
                {
                    if (returnline.m_code == null)
                    {
                        strlog.AppendLine("错误消息:调入单创建失败");
                        strlog.AppendLine("*****************************************************");
                        Appconfig.WriteLogFile(strlog.ToString(), "创建调拨单");
                        res.Success = false;
                        res.Message = returnline.ExtensionData.ToString();
                        return res;

                    }
                    else
                    {

                        TransferInBatchCommitSRV.OperationResult result = new TransferInBatchCommitSRV.OperationResult();
                        CustTransferInBatchCommitSRV CommitTransferIN = new CustTransferInBatchCommitSRV();
                        TransferInBatchCommitSRV.InPut commitinfo = new TransferInBatchCommitSRV.InPut();
                        commitinfo.DocID = returnline.m_iD;
                        commitinfo.DocNo = returnline.m_code;
                        commitinfo.OrgCode = TransferInList[0].WorkPoint;
                        result = CommitTransferIN.CustCommitTransferIn(commitinfo);
                        if (result.IsSuccess == true)
                        {
                            TransferInBatchApproveSRV.OperationResult approveresult = new TransferInBatchApproveSRV.OperationResult();
                            CustTransferInBatchApproveSRV ApproveTransferIN = new CustTransferInBatchApproveSRV();
                            TransferInBatchApproveSRV.InPut approveinfo = new TransferInBatchApproveSRV.InPut();
                            approveinfo.DocNo = returnline.m_code;
                            approveinfo.approvedBy = "admin";
                            approveinfo.OrgCode = TransferInList[0].WorkPoint;
                            approveresult = ApproveTransferIN.CustApproveTransferIn(approveinfo);
                            if (approveresult.IsSuccess == true)
                            {
                                strlog.AppendLine("正确消息:调入单审核成功，单号：'" + returnline.m_code + "'");
                                strlog.AppendLine("*****************************************************");
                                Appconfig.WriteLogFile(strlog.ToString(), "创建调拨单");

                                res.Success = true;
                                res.Message = "调入单审核成功";
                                res.DocCode = returnline.m_code;
                                return res;
                            }
                            else
                            {
                                CustDeleteBFTransfer delTransferIN = new CustDeleteBFTransfer();
                                delTransferIN.CustBFTransferDelete(returnline.m_iD, OrgID);
                                strlog.AppendLine("错误消息:调入单审核失败，单号：'" + returnline.m_code + "'");
                                strlog.AppendLine("*****************************************************");
                                Appconfig.WriteLogFile(strlog.ToString(), "创建调拨单");
                                res.Success = false;
                                res.Message = approveresult.Message.ToString();
                                return res;
                            }
                        }
                        else
                        {
                            CustDeleteBFTransfer delTransferIN = new CustDeleteBFTransfer();
                            delTransferIN.CustBFTransferDelete(returnline.m_iD, OrgID);
                            strlog.AppendLine("错误消息:调入单提交失败，单号：'" + returnline.m_code + "'");
                            strlog.AppendLine("*****************************************************");
                            Appconfig.WriteLogFile(strlog.ToString(), "创建调拨单");
                            res.Success = false;
                            res.Message = result.Message.ToString();
                            return res;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                StringBuilder strerrorlog = new StringBuilder();
                strerrorlog.AppendLine("错误消息:" + GetExceptionMessage(ex));
                strerrorlog.AppendLine("*****************************************************");
                Appconfig.WriteLogFile(strerrorlog.ToString(), "创建调拨单");

                res.Success = false;
                res.Message = GetExceptionMessage(ex);
                return res;

            }
            #endregion

            return res;
        }

        public Result NOConfirmTransIN(List<ICSTransfer> TransferInList)
        {
            Result res = new Result();
            var datalist = new List<ICSTransfer>();


            foreach (var info in TransferInList)
            {
                try
                {
                    #region 服务调用框架结构
                    UFIDAU9ISVTransferInISVICommonCreateTransferInSVClient client = new UFIDAU9ISVTransferInISVICommonCreateTransferInSVClient();
                    //服务返回结果
                    UFIDAU9CBOPubControllerCommonArchiveDataDTOData[] returnItems;

                    UFSoft.UBF.Exceptions.MessageBase[] outMessages;

                    long[] TransferInID;

                    string[] splitMergeRule = null;
                    //上下文信息
                    object context;
                    //传入 参数
                    UFIDAU9ISVTransferInISVIC_TransferInDTOData[] TransferInfoArray;
                    //空
                    string[] splitBy = new string[] { };
                    string WHCode = "";
                    long WHID = 0;

                    string OrgID = "";
                    string orgsql = @"select ID from Base_Organization
                                  where Code='{0}'";
                    orgsql = string.Format(orgsql, info.WorkPoint);
                    DataTable orgdt = DBhlper.Query(orgsql, Appconfig.GetU9ConnStr());
                    if (orgdt.Rows.Count != 0)
                    {
                        OrgID = orgdt.Rows[0]["ID"].ToString();
                    }
                    else
                    {
                        throw new Exception("传入的组织:'" + info.WorkPoint + "'不存在");
                    }

                    string sql = "select ID,Name,Code from Base_User where Code ='" + info.User + "'";
                    DataTable dt = DBhlper.Query(sql, Appconfig.GetU9ConnStr());
                    if (dt.Rows.Count == 0)
                    {
                        sql = "select ID,Name,Code from Base_User where Code ='" +  Appconfig.GetDefaultUser() + "'";
                        dt = DBhlper.Query(sql, Appconfig.GetU9ConnStr());
                        if (dt.Rows.Count == 0)
                        {
                            throw new Exception("用户不存在");
                        } 
                    }

                    var UserID = dt.Rows[0]["ID"].ToString();
                    var UserName = dt.Rows[0]["Name"].ToString();
                    var UserCode = dt.Rows[0]["Code"].ToString();

                    #region 无源头调拨默认仓库转储，查询对应单据类型ID
                    string DocTypeID = "";
                    string DocTypeCode = "";
                    string doctypesql = @"select ID,Code from InvDoc_TransInDocType
                                      where Org='{0}' AND TransferType=1";
                    doctypesql = string.Format(doctypesql, OrgID);
                    DataTable DocTypedt = DBhlper.Query(doctypesql, Appconfig.GetU9ConnStr());
                    if (DocTypedt.Rows.Count == 0)
                    {
                        throw new Exception("未维护对应仓库转储类型的单据类型，请先到U9维护!");

                    }

                    DocTypeID = DocTypedt.Rows[0]["ID"].ToString();
                    DocTypeCode = DocTypedt.Rows[0]["Code"].ToString();

                    #endregion

                    List<UFIDAU9ISVTransferInISVIC_TransferInDTOData> TransferInfoList = new List<UFIDAU9ISVTransferInISVIC_TransferInDTOData>();
                    UFIDAU9ISVTransferInISVIC_TransferInDTOData TransferInfo = new UFIDAU9ISVTransferInISVIC_TransferInDTOData();
                    List<UFIDAU9ISVTransferInISVIC_TransInLineDTOData> TransferLineInfoList = new List<UFIDAU9ISVTransferInISVIC_TransInLineDTOData>();
                    UFIDAU9ISVTransferInISVIC_TransInLineDTOData TransferLineInfo = new UFIDAU9ISVTransferInISVIC_TransInLineDTOData();
                    List<UFIDAU9ISVTransferInISVIC_TransInSubLineDTOData> TransferOutLineInfoList = new List<UFIDAU9ISVTransferInISVIC_TransInSubLineDTOData>();
                    UFIDAU9ISVTransferInISVIC_TransInSubLineDTOData TransferOutLineInfo = new UFIDAU9ISVTransferInISVIC_TransInSubLineDTOData();

                    TransferInfo.m_businessDate = Convert.ToDateTime(info.MTime);
                    TransferInfo.m_transferType = 0;
                    TransferInfo.m_transInDocType = new UFIDAU9CBOPubControllerCommonArchiveDataDTOData();
                    TransferInfo.m_transInDocType.m_iD = long.Parse(DocTypeID);
                    TransferInfo.m_transInDocType.m_code = DocTypeCode;
                    TransferInfo.m_transferDirection = 0;


                    foreach (ICSTransfers line in info.details)
                    {
                        var RowNO = int.Parse(line.Sequence) * 10;
                        #region 根据传入物料编码获取物料ID
                        string ITEMID = "";
                        string itemsql = @"select ID from CBO_ItemMaster
                                           where Code='{0}' AND Org='{1}'";
                        itemsql = string.Format(itemsql, line.InvCode, OrgID, line.Version);
                        DataTable itemdt = DBhlper.Query(itemsql, Appconfig.GetU9ConnStr());
                        if (itemdt.Rows.Count == 0)
                        {

                            throw new Exception("传入的物料编码:'" + line.InvCode + "'在U9中不存在");

                        }

                        ITEMID = itemdt.Rows[0]["ID"].ToString();

                        #endregion
                        #region 根据传入仓库获取仓库ID
                        string INWHID = "";
                        string OUTWHID = "";
                        string whsql = @"select ID from CBO_WH
                                         where Code='{0}' AND Org='{1}'";
                        whsql = string.Format(whsql, line.INWhCode, OrgID);
                        DataTable whdt = DBhlper.Query(whsql, Appconfig.GetU9ConnStr());
                        if (whdt.Rows.Count == 0)
                        {
                            throw new Exception("传入的调入仓库编码:'" + line.INWhCode + "'在U9中不存在");
                        }

                        INWHID = whdt.Rows[0]["ID"].ToString();

                        whsql = @"select ID from CBO_WH
                                  where Code='{0}' AND Org='{1}'";
                        whsql = string.Format(whsql, line.OutWhCode, OrgID);
                        whdt = DBhlper.Query(whsql, Appconfig.GetU9ConnStr());
                        if (whdt.Rows.Count == 0)
                        {
                            throw new Exception("传入的调出仓库编码:'" + line.OutWhCode + "'在U9中不存在");

                        }

                        OUTWHID = whdt.Rows[0]["ID"].ToString();

                        #endregion
                        #region 根据传入供应商编码获取供应商ID
                        if (!string.IsNullOrWhiteSpace(line.SupplierCode))
                        {
                            long SupplierID = 0;
                            string supsql = @"select ID from CBO_Supplier
                                              where Code='{0}' AND Org='{1}'";
                            supsql = string.Format(supsql, line.SupplierCode, OrgID);
                            DataTable supdt = DBhlper.Query(supsql, Appconfig.GetU9ConnStr());
                            if (supdt.Rows.Count == 0)
                            {
                                throw new Exception("传入的供应商编码:'" + line.SupplierCode + "'在U9中不存在");

                            }
                        }
                        #endregion
                        TransferLineInfo = new UFIDAU9ISVTransferInISVIC_TransInLineDTOData();
                        TransferLineInfo.m_costUOMQty = line.Quantity;
                        TransferLineInfo.m_storeUOMQty = line.Quantity;
                        TransferLineInfo.m_itemInfo = new UFIDAU9CBOSCMItemItemInfoData();
                        TransferLineInfo.m_itemInfo.m_itemCode = line.InvCode;
                        TransferLineInfo.m_itemInfo.ItemID = long.Parse(ITEMID);
                        TransferLineInfo.m_storageType = 4;
                        TransferLineInfo.m_transInWh = new UFIDAU9CBOPubControllerCommonArchiveDataDTOData();
                        TransferLineInfo.m_transInWh.m_iD = long.Parse(INWHID);
                        TransferLineInfo.m_transInWh.m_code = line.INWhCode;
                        TransferLineInfo.m_docLineNo = RowNO;

                        TransferLineInfo.m_descFlexSegments = new UFIDAU9BaseFlexFieldDescFlexFieldDescFlexSegmentsData();
                        TransferLineInfo.m_descFlexSegments.m_privateDescSeg30 = line.LogIds;

                        #region 批号
                        if (line.BatchCode != "")
                        {
                            if (!string.IsNullOrWhiteSpace(Appconfig.GetLotNOByBinid(line.BatchCode, OrgID, ITEMID)))
                            {
                                TransferLineInfo.m_lotInfo = new UFIDAU9CBOSCMPropertyTypesLotInfoData();
                                TransferLineInfo.m_lotInfo.m_lotCode = line.BatchCode;
                                TransferLineInfo.m_lotInfo.m_lotMaster = new UFIDAU9BasePropertyTypesBizEntityKeyData();
                                TransferLineInfo.m_lotInfo.m_lotMaster.m_entityID = Convert.ToInt64(Appconfig.GetLotNOByBinid(line.BatchCode, OrgID, ITEMID));
                            }
                        }

                        #endregion


                        TransferOutLineInfoList = new List<UFIDAU9ISVTransferInISVIC_TransInSubLineDTOData>();
                        TransferOutLineInfo = new UFIDAU9ISVTransferInISVIC_TransInSubLineDTOData();
                        TransferOutLineInfo.m_costUOMQty = line.Quantity;
                        TransferOutLineInfo.m_storeUOMQty = line.Quantity;
                        TransferOutLineInfo.m_storageType = 4;
                        if (line.SupplierCode != "")
                        {
                            TransferOutLineInfo.m_transOutSuppInfo = new UFIDAU9CBOSCMSupplierSupplierMISCInfoData();
                            TransferOutLineInfo.m_transOutSuppInfo.m_code = line.SupplierCode;
                        }
                        TransferOutLineInfo.m_transOutWh = new UFIDAU9CBOPubControllerCommonArchiveDataDTOData();
                        TransferOutLineInfo.m_transOutWh.m_code = line.OutWhCode;
                        TransferOutLineInfo.m_transOutWh.m_iD = long.Parse(OUTWHID);

                        if (line.BatchCode != "")
                        {
                            if (!string.IsNullOrWhiteSpace(Appconfig.GetLotNOByBinid(line.BatchCode, OrgID, ITEMID)))
                            {
                                TransferOutLineInfo.m_lotInfo = new UFIDAU9CBOSCMPropertyTypesLotInfoData();
                                TransferOutLineInfo.m_lotInfo.m_lotCode = line.BatchCode;
                                TransferOutLineInfo.m_lotInfo.m_lotMaster = new UFIDAU9BasePropertyTypesBizEntityKeyData();
                                TransferOutLineInfo.m_lotInfo.m_lotMaster.m_entityID = Convert.ToInt64(Appconfig.GetLotNOByBinid(line.BatchCode, OrgID, ITEMID));
                            }
                        }


                        TransferOutLineInfoList.Add(TransferOutLineInfo);
                        TransferLineInfo.m_transInSubLines = TransferOutLineInfoList.ToArray();
                        TransferLineInfoList.Add(TransferLineInfo);
                    }
                    TransferInfo.m_transInLines = TransferLineInfoList.ToArray();
                    TransferInfoList.Add(TransferInfo);


                    long TransferInType = 0;
                    //给上下文信息赋值
                    context = CreateContextObj(OrgID, UserID, UserCode);
                    (client.Endpoint.Binding as BasicHttpBinding).MaxReceivedMessageSize = int.MaxValue;
                    (client.Endpoint.Binding as BasicHttpBinding).MaxBufferSize = int.MaxValue;

                    //创建调入单
                    string TransferDocNOList = "";
                    returnItems = client.Do(context, TransferInfoList.ToArray(), out outMessages);


                    foreach (var returnline in returnItems)
                    {
                        if (returnline.m_code == null)
                        {

                            throw new Exception("错误消息: 调入单创建失败");

                        }


                        try
                        {
                            TransferInBatchCommitSRV.OperationResult result = new TransferInBatchCommitSRV.OperationResult();
                            CustTransferInBatchCommitSRV CommitTransferIN = new CustTransferInBatchCommitSRV();
                            TransferInBatchCommitSRV.InPut commitinfo = new TransferInBatchCommitSRV.InPut();
                            commitinfo.DocID = returnline.m_iD;
                            commitinfo.DocNo = returnline.m_code;
                            commitinfo.OrgCode = info.WorkPoint;
                            result = CommitTransferIN.CustCommitTransferIn(commitinfo);
                            if (result.IsSuccess)
                            {
                                TransferInBatchApproveSRV.OperationResult approveresult = new TransferInBatchApproveSRV.OperationResult();
                                CustTransferInBatchApproveSRV ApproveTransferIN = new CustTransferInBatchApproveSRV();
                                TransferInBatchApproveSRV.InPut approveinfo = new TransferInBatchApproveSRV.InPut();
                                approveinfo.DocNo = returnline.m_code;
                                approveinfo.approvedBy = UserName;
                                approveinfo.OrgCode = info.WorkPoint;
                                approveresult = ApproveTransferIN.CustApproveTransferIn(approveinfo);
                                if (approveresult.IsSuccess == true)
                                {
                                    string sqlqry = @"select a.ID,a.DocNo, b.DescFlexSegments_PrivateDescSeg30,b.ID LineID,b.DocLineNo FROM InvDoc_TransferIn a
                                                        LEFT JOIN InvDoc_TransInLine b ON b.TransferIn=a.ID
                                                        where a.ID ='" + returnline.m_iD + "'";
                                    DataTable dtqry = DBhlper.Query(sqlqry, Appconfig.GetU9ConnStr());
                                    if (dtqry.Rows.Count > 0)
                                    {
                                        var linelist = new List<ICSTransfers>();
                                        foreach (DataRow dr in dtqry.Rows)
                                        {
                                            linelist.Add(new ICSTransfers
                                            {
                                                Sequence = dr["DocLineNo"].ToString(),
                                                TADetailID = dr["LineID"].ToString(),
                                                LogIds = dr["DescFlexSegments_PrivateDescSeg30"].ToString()
                                            });
                                        }

                                        datalist.Add(new ICSTransfer
                                        {
                                            IsSuccess = true,
                                            Message = "成功",
                                            ID = dtqry.Rows[0]["ID"].ToString(),
                                            TACode = dtqry.Rows[0]["DocNo"].ToString(),
                                            details = linelist
                                        });
                                    }
                                    else
                                    {
                                        throw new Exception("U9标准服务返回的单据ID未查询到相关信息");
                                    }
                                }
                                else
                                {
                                    throw new Exception("审核失败，异常：" + approveresult.Message);
                                }
                            }
                            else
                            {
                                throw new Exception("调入单提交失败，单号：'" + returnline.m_code + "'，异常信息：" + result.Message);
                            }
                        }
                        catch (Exception ex)
                        {
                            try
                            {
                                CustDeleteBFTransfer delTransferIN = new CustDeleteBFTransfer();
                                Result deleteres = delTransferIN.CustBFTransferDelete(returnline.m_iD, OrgID);

                                if (deleteres.Success)
                                {
                                    var linelist = new List<ICSTransfers>();
                                    foreach (var item in info.details)
                                    {
                                        linelist.Add(new ICSTransfers
                                        {
                                            Sequence = item.Sequence,
                                            LogIds = item.LogIds
                                        });
                                    }

                                    datalist.Add(new ICSTransfer
                                    {
                                        IsSuccess = false,
                                        Message = "创建成功，提交失败：" + ex.Message + "，删除成功",
                                        details = linelist
                                    });
                                }
                                else
                                {
                                    throw new Exception(deleteres.Message);
                                }
                            }
                            catch (Exception exdelete)
                            {
                                var linelist = new List<ICSTransfers>();
                                foreach (var item in info.details)
                                {
                                    linelist.Add(new ICSTransfers
                                    {
                                        Sequence = item.Sequence,
                                        LogIds = item.LogIds
                                    });
                                }

                                datalist.Add(new ICSTransfer
                                {
                                    IsSuccess = false,
                                    Message = "创建成功，提交失败：" + ex.Message + "，删除失败：" + exdelete.Message,
                                    details = linelist
                                });
                            }
                        }
                    }
                    #endregion
                }
                catch (Exception ex)
                {
                    var linelist = new List<ICSTransfers>();
                    foreach (var item in info.details)
                    {
                        linelist.Add(new ICSTransfers
                        {
                            Sequence = item.Sequence,
                            LogIds = item.LogIds
                        });
                    }

                    datalist.Add(new ICSTransfer
                    {
                        IsSuccess = false,
                        Message = "创建失败：" + ex.Message,
                        details = linelist
                    });
                }
            }

            res.Success = true;
            res.Message = "成功";
            res.Data = datalist;


            return res;
        }

        #region 表头类
        public class TransferINHead
        {
            private TransferINBody[] _lines;

            private string _DocType;

            private string _OrgCode;

            private string _DocNo;
            public string DocDate { get; set; }
            private string _LLCode;

            public TransferINBody[] details
            {
                get { return _lines; }
                set { _lines = value; }
            }

            public string DocNo
            {
                get { return _DocNo; }
                set { _DocNo = value; }
            }
            public string DocType
            {
                get { return _DocType; }
                set { _DocType = value; }
            }

            public string WorkPoint
            {
                get { return _OrgCode; }
                set { _OrgCode = value; }
            }

            public string OutOrgCode { get; set; }

            public string LLCode
            {
                get { return _LLCode; }
                set { _LLCode = value; }
            }
            public string cFree1 { get; set; }
            public string cFree2 { get; set; }
            public string cFree3 { get; set; }
            public string cFree4 { get; set; }
            public string cFree5 { get; set; }
            public string cFree6 { get; set; }
            public string cFree7 { get; set; }
            public string cFree8 { get; set; }
            public string cFree9 { get; set; }
            public string cFree10 { get; set; }


        }
        #endregion
        public class OperationResult
        {
            /// <summary>
            /// 结果状态,默认值false
            /// </summary>
            public bool Success { get; set; }

            /// <summary>
            ///处理消息
            /// </summary>
            public string Message { get; set; }

            /// <summary>
            /// 输出领料订单
            /// </summary>
            public string DocCode { get; set; }
        }
        #region 表体类
        public class TransferINBody
        {


            public int Sequence { get; set; }

            /// <summary>
            /// 数量
            /// </summary>
            public decimal Quantity { get; set; }
            /// <summary>
            /// 调入仓库
            /// </summary>
            public string INWhCode { get; set; }
            /// <summary>
            /// 调入库位
            /// </summary>
            public string INBinCode { get; set; }
            public string BatchCode { get; set; }

            /// <summary>
            /// 调出库位
            /// </summary>
            public string OutBinCode { get; set; }
            /// <summary>
            /// 调出仓库
            /// </summary>
            public string OutWhCode { get; set; }
            /// <summary>
            /// 调拨物料
            /// </summary>
            public string InvCode { get; set; }
            /// <summary>
            /// 供应商编码
            /// </summary>
            public string SupplierCode { get; set; }


            /// <summary>
            /// 调出批号
            /// </summary>
            public string OutBatchCode { get; set; }

            //public string cFree1 { get; set; }
            //public string cFree2 { get; set; }
            //public string cFree3 { get; set; }
            //public string cFree4 { get; set; }
            //public string cFree5 { get; set; }
            //public string cFree6 { get; set; }
            //public string cFree7 { get; set; }
            //public string cFree8 { get; set; }
            //public string cFree9 { get; set; }
            //public string cFree10 { get; set; }
            public string cFree1 { get; set; }
            public string cFree2 { get; set; }
            public string cFree3 { get; set; }
            public string cFree4 { get; set; }
            public string cFree5 { get; set; }
            public string cFree6 { get; set; }
            public string cFree7 { get; set; }
            public string cFree8 { get; set; }
            public string cFree9 { get; set; }
            public string cFree10 { get; set; }

            public string LogId { get; set; }
        }
        #endregion


        #region 提取异常信息
        /// <summary>
        /// 提取异常信息
        /// </summary>
        /// <param name="ex"></param>
        private string GetExceptionMessage(Exception ex)
        {
            string faultMessage = "未知错误，请查看ERP日志！";

            System.TimeoutException timeoutEx = ex as System.TimeoutException;
            if (timeoutEx != null)
            {
                faultMessage = "访问服务超时，请修改配置信息！";
            }
            else
            {
                FaultException<ServiceException> faultEx = ex as FaultException<ServiceException>;
                if (faultEx == null)
                {
                    faultMessage = ex.Message;
                }
                else
                {
                    ServiceException serviceEx = faultEx.Detail;
                    if (serviceEx != null && !string.IsNullOrEmpty(serviceEx.Message)
                        && !serviceEx.Message.Equals("fault", StringComparison.OrdinalIgnoreCase))
                    {
                        // 错误信息在faultEx.Message中，请提取，
                        // 格式为"Fault:料品不能为空，请录入\n 在....."
                        int startIndex = serviceEx.Message.IndexOf(":");
                        int endIndex = serviceEx.Message.IndexOf("\n");
                        if (endIndex == -1)
                            endIndex = serviceEx.Message.Length;
                        if (endIndex > 0 && endIndex > startIndex + 1)
                        {
                            faultMessage = serviceEx.Message.Substring(startIndex + 1, endIndex - startIndex - 1);
                        }
                        else
                        {
                            faultMessage = serviceEx.Message;
                        }
                    }
                }
            }
            return faultMessage;
        }
        #endregion

        #region 给上下文信息赋值
        /// <summary>
        /// 给上下文信息赋值
        /// </summary>
        /// <returns></returns>
        private ThreadContext CreateContextObj(string OrgID, string UserID, string UserCode)
        {
            // 实例化应用上下文对象
            ThreadContext thContext = new ThreadContext();

            System.Collections.Generic.Dictionary<object, object> ns = new Dictionary<object, object>();
            ns.Add("OrgID", OrgID);
            ns.Add("UserID", UserID);
            ns.Add("UserCode", UserCode);
            ns.Add("Datetime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            ns.Add("CultureName", ConfigurationManager.AppSettings["cultureName"].ToString());
            ns.Add("EnterpriseID", ConfigurationManager.AppSettings["enterpriseID"].ToString());
            ns.Add("DefaultCultureName", ConfigurationManager.AppSettings["cultureName"].ToString());
            ns.Add("Support_CultureNameList", "zh-CN");
            thContext.nameValueHas = ns;

            return thContext;
        }
        #endregion

        #region 时间戳方法
        private DateTime TimestampToDateTime(long timestamp)
        {
            DateTime dateTimeStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
            long lTime = timestamp * 10000000;
            TimeSpan nowTimeSpan = new TimeSpan(lTime);
            DateTime resultDateTime = dateTimeStart.Add(nowTimeSpan);
            return resultDateTime;
        }
        #endregion
    }

    #region 上下文类信息
    public class contextInfo
    {
        private long _OrgID;
        private string _OrgCode;
        private long _UserID;
        private string _UserCode;
        private DateTime _Datetime;
        private string _CultureName;
        private string _EnterpriseID;


        /// <summary>
        /// 组织ID
        /// </summary>
        public long OrgID
        {
            get { return _OrgID; }
            set { _OrgID = value; }
        }

        /// <summary>
        /// 组织编码
        /// </summary>
        public string WorkPoint
        {
            get { return _OrgCode; }
            set { _OrgCode = value; }
        }

        /// <summary>
        /// 操作员ID
        /// </summary>
        public long UserID
        {
            get { return _UserID; }
            set { _UserID = value; }
        }

        /// <summary>
        /// 操作员编码
        /// </summary>
        public string UserCode
        {
            get { return _UserCode; }
            set { _UserCode = value; }
        }

        /// <summary>
        /// 时间
        /// </summary>
        public DateTime Datetime
        {
            get { return _Datetime; }
            set { _Datetime = value; }
        }

        /// <summary>
        /// 语言
        /// </summary>
        public string CultureName
        {
            get { return _CultureName; }
            set { _CultureName = value; }
        }

        /// <summary>
        /// 企业ID号
        /// </summary>
        public string EnterpriseID
        {
            get { return _EnterpriseID; }
            set { _EnterpriseID = value; }
        }

        public contextInfo()
        {
            CultureName = "zh-CN";
            Datetime = DateTime.Now;
        }
    }
    #endregion



    #region 返回信息类
    public class rtnTransferInfo
    {
        public string DocNo { get; set; }
        public bool IsSuccess { get; set; }
        public string Message { get; set; }
        public List<Data> Data { get; set; }
    }
    public class Data
    {
        public string ID { get; set; }
        public string TransCode { get; set; }
        public string CreateUser { get; set; }
        public DateTime CreateDateTime { get; set; }
        public string Checker { get; set; }
        public DateTime CheckDateTime { get; set; }
        public List<DataLine> details { get; set; }
    }
    public class DataLine
    {
        public string DetailID { get; set; }
        public int Sequence { get; set; }
        public string InvCode { get; set; }
        public string FromWHCode { get; set; }
        public string FromWHName { get; set; }
        public string ToWHCode { get; set; }
        public string ToWHName { get; set; }

        public Decimal Quantity { get; set; }
        public Decimal Amount { get; set; }
        public string ProjectCode { get; set; }
        public string BatchCode { get; set; }

        public string version { get; set; }
        public string brand { get; set; }
        public string cFree1 { get; set; }
        public string cFree2 { get; set; }
        public string cFree3 { get; set; }
        public string cFree4 { get; set; }
        public string cFree5 { get; set; }
        public string cFree6 { get; set; }
        public string cFree7 { get; set; }
        public string cFree8 { get; set; }
        public string cFree9 { get; set; }
        public string cFree10 { get; set; }

        public string LogId { get; set; }
    }
    #endregion


    #region 表体类
    //public class rCVLine
    //{
    //    /// <summary>
    //    ///  来源采购订单
    //    /// </summary>
    //    public string srcDocPONo { get; set; }

    //    private int _srcDocPOLineNo;
    //    private decimal _reqQty;
    //    public string WhCode { get; set; }

    //    /// <summary>
    //    /// 炉号
    //    /// </summary>
    //    public string FurnaceNo { get; set; }

    //    /// <summary>
    //    /// 数量
    //    /// </summary>
    //    public decimal ReqQty
    //    {
    //        get { return _reqQty; }
    //        set { _reqQty = value; }
    //    }

    //    /// <summary>
    //    /// 来源采购订单行
    //    /// </summary>
    //    public int srcDocPOLineNo
    //    {
    //        get { return _srcDocPOLineNo; }
    //        set { _srcDocPOLineNo = value; }
    //    }
    //}
    #endregion


}
