コード例 #1
0
        /// <summary>
        /// 微信下单
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public CreateOrder_Response CreateOrder(string req)
        {
            string res = HttpMethods.Post(InsideApiUrlUtil.createorder, req);

            return(JsonConvert.DeserializeObject <CreateOrder_Response>(res));
        }
コード例 #2
0
        /// <summary>
        /// 任务执行方法
        /// </summary>
        /// <param name="keyValue">任务进程主键</param>
        /// <returns></returns>
        private bool _Execute(string keyValue)
        {
            bool   isOk = true;
            string msg  = "执行成功";

            TSProcessEntity tSProcessEntity = null;
            TSSchemeEntity  tSSchemeEntity  = null;

            // 获取一个任务进程
            try
            {
                tSProcessEntity = tSProcessIBLL.GetProcessEntity(keyValue);
            }
            catch (Exception ex)
            {
                isOk = false;
                msg  = "获取任务进程异常:" + ex.Message;
            }

            if (tSProcessEntity != null && tSProcessEntity.F_State != 1 && tSProcessEntity.F_State != 2)
            {
                return(true);
            }

            // 获取对应的任务模板
            if (isOk)
            {
                try
                {
                    tSSchemeEntity = tSSchemeIBLL.GetSchemeEntity(tSProcessEntity.F_SchemeId);
                }
                catch (Exception ex)
                {
                    isOk = false;
                    msg  = "获取任务模板异常:" + ex.Message;
                }
            }

            bool flag = false;

            // 执行任务
            if (isOk)
            {
                try
                {
                    TSSchemeModel tSSchemeModel = tSSchemeEntity.F_Scheme.ToObject <TSSchemeModel>();
                    switch (tSSchemeModel.methodType)
                    {
                    case 1:    // sql
                        databaseLinkIBLL.ExecuteBySql(tSSchemeModel.dbId, tSSchemeModel.strSql);
                        break;

                    case 2:    // 存储过程
                        databaseLinkIBLL.ExecuteByProc(tSSchemeModel.dbId, tSSchemeModel.procName);
                        break;

                    case 3:    // 接口
                        if (tSSchemeModel.urlType == "1")
                        {
                            HttpMethods.Get(tSSchemeModel.url);
                        }
                        else
                        {
                            HttpMethods.Post(tSSchemeModel.url);
                        }
                        break;

                    case 4:    // 依赖注入
                        if (!string.IsNullOrEmpty(tSSchemeModel.iocName) && UnityIocHelper.TsInstance.IsResolve <ITsMethod>(tSSchemeModel.iocName))
                        {
                            ITsMethod iTsMethod = UnityIocHelper.TsInstance.GetService <ITsMethod>(tSSchemeModel.iocName);
                            iTsMethod.Execute();
                        }
                        break;
                    }

                    if (tSSchemeModel.executeType == 1)
                    {
                        flag = true;
                    }
                }
                catch (Exception ex)
                {
                    isOk = false;
                    msg  = "执行方法出错:" + ex.Message;
                }
            }

            try
            {
                // 新增一条任务日志
                TSLogEntity logEntity = new TSLogEntity()
                {
                    F_ExecuteResult = isOk ? 1 : 2,
                    F_Des           = msg,
                    F_ProcessId     = keyValue
                };
                logEntity.Create();
                tSLogIBLL.SaveEntity("", logEntity);

                if (tSProcessEntity.F_State == 1)
                {
                    tSProcessEntity.F_State = 2;
                    if (flag)
                    {
                        tSProcessEntity.F_State = 4;
                    }

                    tSProcessIBLL.SaveEntity(tSProcessEntity.F_Id, tSProcessEntity);
                }
            }
            catch (Exception)
            {
            }


            return(isOk);
        }
コード例 #3
0
        /// <summary>
        /// 订单查询
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public OrderInfo_Response OrderInfo(string req)
        {
            string res = HttpMethods.Post(InsideApiUrlUtil.orderinfo, req);

            return(JsonConvert.DeserializeObject <OrderInfo_Response>(res));
        }
コード例 #4
0
        /// <summary>
        /// 备件基础信息
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public Product_Response product(string req)
        {
            string res = HttpMethods.Post(InsideApiUrlUtil.product, req);

            return(JsonConvert.DeserializeObject <Product_Response>(res));
        }
コード例 #5
0
        public async Task <ActionResult> ActiveCamera(VideoChannelsEntity entity)
        {
            var result = HttpMethods.Post(GlobalContext.SystemConfig.MediaServerUrl + "/MediaServer/ActiveVideoChannel?mainId=" + entity.MainId, JsonConvert.SerializeObject(entity));

            return(Json(result));
        }
コード例 #6
0
        /// <summary>
        /// 库存查询
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public StockInfo_Response stockinfo(string req)
        {
            string res = HttpMethods.Post(InsideApiUrlUtil.stockinfo, req);

            return(JsonConvert.DeserializeObject <StockInfo_Response>(res));
        }
コード例 #7
0
        /// <summary>
        /// 运单号查询备件详情
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public ExpressProducts_Response ExpressProducts(string req)
        {
            string res = HttpMethods.Post(InsideApiUrlUtil.expressproducts, req);

            return(JsonConvert.DeserializeObject <ExpressProducts_Response>(res));
        }
コード例 #8
0
        /// <summary>
        /// 运单跟踪
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public WaybillTrack_Response WaybillTrack(string req)
        {
            string res = HttpMethods.Post(InsideApiUrlUtil.waybilltrack, req);

            return(JsonConvert.DeserializeObject <WaybillTrack_Response>(res));
        }
コード例 #9
0
        /// <summary>
        /// 库区
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public Locations_Response locations(string req)
        {
            string res = HttpMethods.Post(InsideApiUrlUtil.locations, req);

            return(JsonConvert.DeserializeObject <Locations_Response>(res));
        }
コード例 #10
0
        /// <summary>
        /// 公司名称
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public Companys_Response companys(string req)
        {
            string res = HttpMethods.Post(InsideApiUrlUtil.companys, req);

            return(JsonConvert.DeserializeObject <Companys_Response>(res));
        }