Пример #1
0
        /// <summary>
        /// 获取XingYe同步数据
        /// </summary>
        /// <param name="model">XingYe</param>
        /// <returns></returns>
        /// <remarks>2013-9-27 杨浩 添加</remarks>
        public Result <string> GetData(CBXingYeSyncLog model)
        {
            var easModel = new Hyt.Model.Generated.XingYeSyncLog
            {
                SysNo   = model.SysNo,
                Data    = model.Data,
                DataMd5 = model.DataMd5
            };
            var iType  = (接口类型)(model.InterfaceType);
            var result = new Result <string> {
            };

            switch (iType)
            {
            case 接口类型.配送员借货还货:
                var borrow = model.Data.ToObject <BorrowInfoWraper>();
                result = XingYeCore.OtherIssueBillFacade(borrow.Model, borrow.Type, borrow.Description, "", model.DataMd5, true, true, true);
                break;

            case 接口类型.销售出库退货:
                //var sale = model.Data.ToObject<SaleInfoWraper>();
                result = XingYeCore.SaleIssueBillFacade(easModel, false, true, true, true);
                break;

            case 接口类型.收款单据导入:
                var receiving = model.Data.ToObject <ReceivingInfoWraper>();
                result = XingYeCore.ReceivingBillFacade(0, receiving.Model, receiving.ReceivingType, receiving.Customer, receiving.Description, "", model.DataMd5, true, true, true);
                break;
            }
            return(result);
        }
Пример #2
0
        /// <summary>
        /// 采购退货
        /// </summary>
        /// <param name="model">出库明细</param>
        /// <param name="description">XingYe单据摘要(出库单号)</param>
        /// <param name="flowIdentify">采购订单系统编号</param>
        /// <param name="purchaseOrderSysNo">采购订单系统编号</param>
        /// <returns>bool</returns>
        /// <remarks>2013-9-27 杨浩 添加</remarks>
        public Result PurchaseOutStock(List <PurchaseInfo> model, string description, string flowIdentify, string purchaseOrderSysNo)
        {
            var datajson = new PurchaseInfoWraper
            {
                Model              = model,
                Type               = 采购状态.退货,
                Description        = description,
                PurchaseOrderSysNo = purchaseOrderSysNo
            }.ToJson();

            var easModel = new Hyt.Model.Generated.XingYeSyncLog
            {
                Data         = datajson,
                FlowIdentify = flowIdentify
            };
            var status = XingYeCore.PurchaseIssueBillFacade(easModel);

            //同步利嘉
            //LiJia.LiJiaProviderFactory.CreateProvider().PurchaseOutStock(model,description,flowIdentify,purchaseOrderSysNo);

            //同步兴业嘉
            //XingYe.XingYeProviderFactory.CreateProvider().PurchaseOutStock(model, description, flowIdentify, purchaseOrderSysNo);

            return(status);
        }
Пример #3
0
        /// <summary>
        /// 销售出库
        /// </summary>
        /// <param name="model">出库明细</param>
        /// <param name="customer">分销商erp编号</param>
        /// <param name="description">单据摘要(商城订单号/升舱订单号)</param>
        /// <param name="flowIdentify">出库单事务编号</param>
        /// <returns></returns>
        /// <remarks>2013-9-27 杨浩 添加</remarks>
        public Result SaleOutStock(List <SaleInfo> model, string customer, string description, string flowIdentify)
        {
            var datajson = new SaleInfoWraper
            {
                Model       = model,
                Type        = 出库状态.出库,
                Customer    = customer,
                Description = description
            }.ToJson();

            var easModel = new Hyt.Model.Generated.XingYeSyncLog
            {
                Data         = datajson,
                FlowIdentify = flowIdentify
            };
            var status = XingYeCore.SaleIssueBillFacade(easModel);

            //同步利嘉
            LiJia.LiJiaProviderFactory.CreateProvider().SaleOutStock(model, customer, description, flowIdentify);

            //同步兴业嘉
            //XingYe.XingYeProviderFactory.CreateProvider().SaleOutStock(model, customer, description, flowIdentify);

            return(status);
        }
Пример #4
0
        /// <summary>
        /// 调拨单导入
        /// </summary>
        /// <param name="model">调拨明细</param>
        /// <param name="description">XingYe单据摘要(调拨出库单号_调拨入库单号)</param>
        /// <param name="flowIdentify">调拨单系统编号</param>
        /// <returns></returns>
        /// <remarks>2017-1-04 杨浩 创建</remarks>
        public Result TransferStock(List <TransferStockInfo> model, string description, string flowIdentify)
        {
            var datajson = new TransferStockInfoWraper
            {
                Model       = model,
                Type        = 调拨状态.入库,
                Description = description
            }.ToJson();

            var easModel = new Hyt.Model.Generated.XingYeSyncLog
            {
                Data         = datajson,
                FlowIdentify = flowIdentify
            };
            var status = XingYeCore.TransferStocXingYesueBillFacade(easModel);

            //同步利嘉
            //LiJia.LiJiaProviderFactory.CreateProvider().TransferStock(model, description, flowIdentify);
            //同步兴业嘉
            //XingYe.XingYeProviderFactory.CreateProvider().TransferStock(model, description, flowIdentify);

            return(status);
        }