예제 #1
0
        /// <summary>
        /// ConversionToCentreInfo
        /// </summary>
        /// <param name="sapMaterialReservationInfo"></param>
        /// <returns></returns>
        public SapMaterialReservationInfo ConversionToCentreInfo(BFDASapMaterialReservationInfo sapMaterialReservationInfo)
        {
            SapMaterialReservationInfo materialReservationInfo = new SapMaterialReservationInfo();

            //if (string.IsNullOrEmpty(sapMaterialReservationInfo.RSPOS) || string.IsNullOrEmpty(sapMaterialReservationInfo.LGORT) || string.IsNullOrEmpty(sapMaterialReservationInfo.LIFNR) || string.IsNullOrEmpty(sapMaterialReservationInfo.MATNR))
            //    throw new Exception("MC:0x00000470");///预留号,收货方,供应商,物料号都不能为空

            materialReservationInfo.Rsnum = sapMaterialReservationInfo.RSNUM; ///预留号
            materialReservationInfo.Rspos = sapMaterialReservationInfo.RSPOS; ///	预留行号
            materialReservationInfo.Lgort = sapMaterialReservationInfo.LGORT; ///	收货方
            materialReservationInfo.Lifnr = sapMaterialReservationInfo.LIFNR; ///	供应商
            materialReservationInfo.Matnr = sapMaterialReservationInfo.MATNR; ///	物料
            materialReservationInfo.Ebeln = sapMaterialReservationInfo.EBELN; ///	采购订单
            if (!int.TryParse(sapMaterialReservationInfo.EBELP, out int intEbelp))
            {
                throw new Exception("MC:0x00000398"); ///采购订单行项目号错误
            }
            materialReservationInfo.Ebelp = intEbelp; ///采购订单行项目号
            if (!decimal.TryParse(sapMaterialReservationInfo.MENGE.Trim(), out decimal intMenge))
            {
                throw new Exception("MC:0x00000395");                                                            ///物料数量格式错误
            }
            materialReservationInfo.Menge = intMenge;                                                            ///数量
            materialReservationInfo.Bdter = BFDASapCommonBLL.TryParseDatetime(sapMaterialReservationInfo.BDTER); ///需求日期
            return(materialReservationInfo);
        }
        /// <summary>
        /// 转换为中间对象
        /// </summary>
        /// <param name="sapProductOrderInfo"></param>
        /// <returns></returns>
        public SapProductOrderInfo ConversionToCentreInfo(BFDASapProductOrderInfo sapProductOrderInfo)
        {
            SapProductOrderInfo productOrderInfo = new SapProductOrderInfo();

            ///1 物料编号
            productOrderInfo.Matnr = sapProductOrderInfo.Matnr;
            ///2 工厂
            productOrderInfo.Dwerk = sapProductOrderInfo.Dwerk;
            ///3 销售订单
            productOrderInfo.Kdauf = sapProductOrderInfo.Kdauf;
            ///4 行项目
            productOrderInfo.Kdpos = sapProductOrderInfo.Kdpos;
            ///5 订单号
            productOrderInfo.Aufnr = sapProductOrderInfo.Aufnr;
            ///6 锁定标识
            productOrderInfo.LockFlag = sapProductOrderInfo.LockFlag == "10" ? false : true;
            ///7 生产版本
            productOrderInfo.Verid = sapProductOrderInfo.Verid;
            ///8 订单数量
            productOrderInfo.Psmng = Convert.ToInt32(sapProductOrderInfo.Psmng);
            ///9 上线顺序
            productOrderInfo.OnlineSeq = sapProductOrderInfo.OnlineSeq;
            ///10 上线日期
            productOrderInfo.OnlineDate = BFDASapCommonBLL.TryParseDatetime(sapProductOrderInfo.OnlineDate);
            ///11 下线日期
            productOrderInfo.OfflineDate = BFDASapCommonBLL.TryParseDatetime(sapProductOrderInfo.OfflineDate);
            ///13 公告编号
            productOrderInfo.Notice = sapProductOrderInfo.Notice;
            ///14 整车颜色
            productOrderInfo.CarColor = sapProductOrderInfo.CarColor;
            ///删除标记
            productOrderInfo.Zsc = sapProductOrderInfo.Zsc;
            ///
            return(productOrderInfo);
        }
        /// <summary>
        /// 接口数据转中间表集合
        /// </summary>
        /// <param name="interfaceInfo"></param>
        /// <returns></returns>
        public SapSupplierQuotaInfo ConversionToCentreInfo(BFDASupplierQuotaInfo interfaceInfo)
        {
            SapSupplierQuotaInfo sapSupplierQuotaInfo = new SapSupplierQuotaInfo();

            if (string.IsNullOrEmpty(interfaceInfo.Werks) || string.IsNullOrEmpty(interfaceInfo.Lifnr) || string.IsNullOrEmpty(interfaceInfo.Name1) || string.IsNullOrEmpty(interfaceInfo.Matnr))
            {
                throw new Exception("MC:0x00000467");                                                    ///工厂,供应商编号,供应商名称,物料号都不能为空
            }
            sapSupplierQuotaInfo.Werks = interfaceInfo.Werks;                                            ///WERKS,2,工厂

            sapSupplierQuotaInfo.Lifnr        = interfaceInfo.Lifnr;                                     ///LIFNR,3,供应商
            sapSupplierQuotaInfo.SupplierName = interfaceInfo.Name1;                                     ///SUPPLIER_NAME,4,供应商名称 过滤单引号!
            sapSupplierQuotaInfo.PartNo       = interfaceInfo.Matnr;                                     ///PART_NO,5,物料编号
            sapSupplierQuotaInfo.Qtype        = interfaceInfo.Qtype;                                     ///QTYPE,6,平台系数
            sapSupplierQuotaInfo.IDate        = BFDASapCommonBLL.TryParseDatetime(interfaceInfo.I_Date); ///I_DATE,7,有效起始日期
            sapSupplierQuotaInfo.EDate        = BFDASapCommonBLL.TryParseDatetime(interfaceInfo.E_Date); ///E_DATE,8,有效截止日期
            sapSupplierQuotaInfo.Znrmm        = interfaceInfo.Znrmm;                                     ///ZNRMM,9,配额协议编号
            int.TryParse(interfaceInfo.Qupos, out int qupos);
            sapSupplierQuotaInfo.Qupos = qupos;                                                          ///QUPOS,10,配额协议行项目编号
            int.TryParse(interfaceInfo.Quote, out int quote);
            sapSupplierQuotaInfo.Quote = quote;                                                          ///QUOTE,11,配额
            sapSupplierQuotaInfo.Zstop = interfaceInfo.Zstop;                                            ///ZSTOP,12,停供标识
            sapSupplierQuotaInfo.Flag  = interfaceInfo.Flag;                                             ///FLAG,13,状态标识(U:更改; D:删除)
            return(sapSupplierQuotaInfo);
        }
        /// <summary>
        /// 接口数据转中间表集合
        /// </summary>
        /// <param name="bFDASapInventoryCheckPlanInfo"></param>
        /// <returns></returns>
        public SapInventoryCheckPlanInfo ConversionToCentreInfo(BFDASapInventoryCheckPlanInfo bFDASapInventoryCheckPlanInfo)
        {
            SapInventoryCheckPlanInfo sapInventoryCheckPlanInfo = new SapInventoryCheckPlanInfo();

            sapInventoryCheckPlanInfo.Werks = bFDASapInventoryCheckPlanInfo.WERKS;  ///工厂
            sapInventoryCheckPlanInfo.Iblnr = bFDASapInventoryCheckPlanInfo.IBLNR;  ///盘点凭证号
            sapInventoryCheckPlanInfo.Matnr = bFDASapInventoryCheckPlanInfo.MATNR;  ///物料
            decimal decCount = default(decimal);

            decimal.TryParse(bFDASapInventoryCheckPlanInfo.MENGE.Trim(), out decCount);
            sapInventoryCheckPlanInfo.Menge       = decCount;                                                                               ///数量
            sapInventoryCheckPlanInfo.Lgort       = bFDASapInventoryCheckPlanInfo.LGORT;                                                    ///库存地点
            sapInventoryCheckPlanInfo.Zldat       = BFDASapCommonBLL.TryParseDatetime(bFDASapInventoryCheckPlanInfo.GIDAT, dateTimeFormat); ///计划盘点日期
            sapInventoryCheckPlanInfo.ProcessFlag = (int)ProcessFlagConstants.Untreated;
            return(sapInventoryCheckPlanInfo);
        }
        /// <summary>
        /// 接口数据转中间表集合
        /// </summary>
        /// <param name="interfaceInfo"></param>
        /// <returns></returns>
        public SapWorkCalendarInfo ConversionToCentreInfo(BFDASapWorkCalendarInfo interfaceInfo)
        {
            SapWorkCalendarInfo sapWorkCalendarInfo = new SapWorkCalendarInfo();

            //if(string.IsNullOrEmpty(interfaceInfo.DWERK) || string.IsNullOrEmpty(interfaceInfo.ZCJ) || string.IsNullOrEmpty(interfaceInfo.LINENO) )
            //    throw new Exception("MC:0x00000468");///工厂, 车间, 生产线都不能为空
            sapWorkCalendarInfo.Dwerk          = interfaceInfo.DWERK;                                                                                         ///工厂
            sapWorkCalendarInfo.Zcj            = interfaceInfo.ZCJ;                                                                                           ///车间
            sapWorkCalendarInfo.LineNo         = interfaceInfo.LINENO;                                                                                        ///产线
            sapWorkCalendarInfo.ProductionDate = BFDASapCommonBLL.TryParseDatetime(interfaceInfo.PRODUCTIONDATE);                                             ///工作时间
            sapWorkCalendarInfo.Shift          = interfaceInfo.SHIFT;                                                                                         ///班次 默认0,白班. 1夜班.
            sapWorkCalendarInfo.BeginTime      = BFDASapCommonBLL.TryParseDatetime(interfaceInfo.PRODUCTIONDATE + interfaceInfo.BEGINTIME, "yyyyMMddHHmmss"); ///开始时间
            sapWorkCalendarInfo.EndTime        = BFDASapCommonBLL.TryParseDatetime(interfaceInfo.PRODUCTIONDATE + interfaceInfo.ENDTIME, "yyyyMMddHHmmss");   ///结束时间
            sapWorkCalendarInfo.MinCapacity    = interfaceInfo.MINCAPACITY;                                                                                   ///最小产能
            sapWorkCalendarInfo.MaxCapacity    = interfaceInfo.MAXCAPACITY;                                                                                   ///最大产能
            sapWorkCalendarInfo.Version        = interfaceInfo.VERSION;                                                                                       ///版本
            return(sapWorkCalendarInfo);
        }
예제 #6
0
        /// <summary>
        /// 转换为中间对象
        /// </summary>
        /// <param name="sapProductOrderBomInfo"></param>
        /// <returns></returns>
        public SapProductOrderBomInfo ConversionToCentreInfo(BFDASapProductOrderBomInfo sapProductOrderBomInfo)
        {
            SapProductOrderBomInfo productOrderInfo = new SapProductOrderBomInfo();


            ///1 总成物料编号
            productOrderInfo.Fmatnr = sapProductOrderBomInfo.Fmatnr;
            ///2 工厂
            productOrderInfo.Dwerk = sapProductOrderBomInfo.Dwerk;
            ///3 生产订单
            productOrderInfo.Aufnr = sapProductOrderBomInfo.Aufnr;
            ///4 生产版本
            productOrderInfo.Verid = sapProductOrderBomInfo.Verid;
            ///5 上线日期
            productOrderInfo.OnlineDate = BFDASapCommonBLL.TryParseDatetime(sapProductOrderBomInfo.OnlineTime);
            ///6 下线日期
            productOrderInfo.OfflineDate = BFDASapCommonBLL.TryParseDatetime(sapProductOrderBomInfo.OfflineTime);
            ///子订单号 char15
            productOrderInfo.Zzdd = sapProductOrderBomInfo.Zzdd;
            ///当子订单不为空时,LES认为子订单号即为生产订单号
            if (!string.IsNullOrEmpty(productOrderInfo.Zzdd))
            {
                productOrderInfo.Aufnr = productOrderInfo.Zzdd;
            }
            if (!decimal.TryParse(sapProductOrderBomInfo.Bdmng, out decimal bdmng))
            {
                throw new Exception("0x00000395");///物料数量格式错误
            }
            ///物料图号 CHAR
            productOrderInfo.Matnrs = sapProductOrderBomInfo.Matnr;
            ///数量
            productOrderInfo.Bdmng = bdmng;
            ///更改单号  CHAR
            productOrderInfo.Aennr = sapProductOrderBomInfo.Aennr;
            ///工位   CHAR
            productOrderInfo.Ebort = sapProductOrderBomInfo.Ebort;
            ///供应商 NVARCHAR(8)
            productOrderInfo.Lifnr = sapProductOrderBomInfo.Lifnr;
            ///平台 NVARCHAR(20)
            productOrderInfo.Platform = sapProductOrderBomInfo.Platform;

            return(productOrderInfo);
        }
예제 #7
0
        public SapBreakpointChangesInfo ConversionToCentreInfo(BFDASapBreakpointChangesInfo bfdaInfo)
        {
            SapBreakpointChangesInfo sapInfo = new SapBreakpointChangesInfo();

            if (string.IsNullOrEmpty(bfdaInfo.WERKS) || string.IsNullOrEmpty(bfdaInfo.ZCJ) || string.IsNullOrEmpty(bfdaInfo.AENNR) || string.IsNullOrEmpty(bfdaInfo.MATNR) || string.IsNullOrEmpty(bfdaInfo.CHANGE_FLAG))
            {
                throw new Exception("MC:0x00000470");                               ///工厂,车间,变更单号,收货方,供应商,物料号都不能为空
            }
            sapInfo.Aennr      = bfdaInfo.AENNR;                                    ///变更单号     CHAR
            sapInfo.Matnr      = bfdaInfo.MATNR;                                    ///父物料  CHAR(18)
            sapInfo.ChangeFlag = bfdaInfo.CHANGE_FLAG;                              ///更改标识     NVARCHAR(30)
            sapInfo.Oidnrk     = bfdaInfo.OIDNRK;                                   ///旧物料  CHAR(18)
            sapInfo.Nidnrk     = bfdaInfo.NIDNRK;                                   ///新物料  CHAR(18)
            sapInfo.Menge      = bfdaInfo.MENGE;                                    ///更改数量     decimal(18," 3)
            sapInfo.Ebort      = bfdaInfo.EBORT;                                    ///工位   CHAR
            sapInfo.Datuv      = BFDASapCommonBLL.TryParseDatetime(bfdaInfo.DATUV); ///生效日期     DATS
            sapInfo.Datub      = BFDASapCommonBLL.TryParseDatetime(bfdaInfo.DATUB); ///有效截止日期	Nvarchar(10)
            sapInfo.Zcj        = bfdaInfo.ZCJ;                                      ///车间	Nvarchar(4)
            sapInfo.Ktsch      = bfdaInfo.KTSCH;                                    ///工位	Nvarchar(7)
            sapInfo.Werks      = bfdaInfo.WERKS;                                    ///工厂	Nvarchar(4)
            sapInfo.Sortf      = bfdaInfo.SORTF;                                    ///排序字符串	Nvarchar(10)
            return(sapInfo);
        }