Exemple #1
0
 /// <summary>
 /// 报错文件到本地
 /// </summary>
 /// <param name="data"></param>
 public void SavaTagsFile(UploadContract data)
 {
     try
     {
         FileDbContract file = new FileDbContract();
         file.Id   = data.FileId.ToString();
         file.data = SerializeHelper.serializeToString(data);
         this._dbContext.FileDB.Save <FileDbContract>(file.Id, file);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        private void DeleteFile(UploadContract fileContract)
        {
            if (!fileContract.IsUpload)
            {
                return;
            }
            //文件上传成功 删除文件
            if (fileContract.IsFailure) //如果是上传失败的文件
            {
                System.IO.File.Delete(FailureWorkDir + Path.DirectorySeparatorChar + fileContract.NewFileName);
            }
            else
            {
                System.IO.File.Delete(UploadFileWorkDir + Path.DirectorySeparatorChar + fileContract.NewFileName);
            }

            //删除json
            _dbContext.FileDB.Delete <FileDbContract>(fileContract.FileId.ToString());
        }
Exemple #3
0
 public void BigVideo()
 {
     try
     {
         AliyunOSSHepler oss = new AliyunOSSHepler();
         //获取文件所在路径
         string        workDir = AppDomain.CurrentDomain.BaseDirectory + ConfigHelper.ReadConfigByName("UploadFilePath");
         DirectoryInfo folder  = new DirectoryInfo(workDir);
         //回写数据库的上云路径
         string osspath = "";
         //本地全部上云
         FileInfo[] list = folder.GetFiles("*");
         LogHelper.logError("获取大文件路径:" + workDir);
         LogHelper.logError("获取大文件数量:" + list.Length.ToString());
         for (int i = 0; i < list.Length; i++)
         {
             if (!CommonDictionary.GetInstance().KafkaIsOnline)
             {
                 continue;
             }
             bool returnType = oss.UploadFiles(workDir, list[i].Name, ref osspath);
             LogHelper.logError("上云路径:" + osspath);
             if (returnType)
             {
                 string         fileid   = list[i].Name.Split(".")[0];
                 UploadContract contract = new UploadContract();
                 contract.FileId      = Guid.Parse(fileid);
                 contract.IsUpload    = true;
                 contract.Url         = osspath;
                 contract.NewFileName = list[i].Name;
                 KafKaContract kafka = new KafKaContract();
                 kafka.MsgId   = fileid;
                 kafka.MsgCode = KafkaMsgCodeEnum.Update;
                 kafka.Msg     = SerializeHelper.serializeToString(contract);
                 KafKaLogic.GetInstance().Push(kafka, KafkaTopic);
             }
         }
     }
     catch (Exception e)
     {
         LogHelper.logError("上云异常:" + e.Message);
     }
 }
 /// <summary>
 /// ES新增数据
 /// </summary>
 /// <param name="contract"></param>
 /// <returns></returns>
 public bool InsertES(UploadContract contract)
 {
     try
     {
         var data = new EsContract()
         {
             fileId       = contract.FileId,
             userId       = contract.UserId,
             orgId        = contract.OrgId,
             appId        = contract.AppId,
             orgName      = contract.OrgName,
             fileName     = contract.FileName,
             thumbnailUrl = contract.ThumbnailUrl,
             newFileName  = contract.NewFileName,
             upload       = contract.IsUpload,
             url          = contract.Url,
             tags         = contract.Tags,
             uploadTime   = contract.UploadTime,
             insertTime   = DateTime.Now,
             displayName  = contract.DisplayName,
             fileType     = contract.FileType,
             groupId      = contract.GroupId,
             remark       = contract.Remark,
             order        = contract.Order,
             themeType    = contract.ThemeType
         };
         LogHelper.logInfo("单个添加:" + SerializeHelper.serializeToString(data));
         var result = HttpHelper.HttpPost(SerializeHelper.serializeToString(data), ESAddress + "/document/addTaginfo");
         ResultContract <object> res = SerializeHelper.deserializeToObject <ResultContract <object> >(result);
         if (res.Code == 200)
         {
             return(true);
         }
         return(false);
     }
     catch (Exception e)
     {
         LogHelper.logInfo("单个添加异常:" + e.ToString());
         return(false);
     }
 }
Exemple #5
0
        /// <summary>
        /// 上传 MonitorLog 信息接口
        /// </summary>
        public UploadContract UploadMonitorLog(TransType transType,
                                               MonitorLogContract order, string userId, string token, string unitId)
        {
            string    bizId     = Utils.NewGuid();
            string    methodKey = "ComService.UploadMonitorLog";
            string    ifCode    = "C001";
            var       data      = new UploadContract();
            Hashtable htLogExt  = new Hashtable();

            htLogExt["customer_code"] = null;
            htLogExt["customer_id"]   = null;
            htLogExt["unit_code"]     = null;
            htLogExt["unit_id"]       = unitId;
            htLogExt["user_code"]     = null;
            htLogExt["user_id"]       = userId;
            htLogExt["if_code"]       = ifCode;
            htLogExt["app_code"]      = AppType.Client;
            try
            {
                Hashtable htParams = new Hashtable();
                htParams.Add("trans_type", transType);
                htParams.Add("order", order);
                htParams.Add("user_id", userId);
                htParams.Add("token", token);
                htParams.Add("unit_id", unitId);
                LogService.WriteTrace(bizId, methodKey, TraceLogType.Params.ToString(), htParams, userId, htLogExt);

                bool      statusFlag = false;
                Hashtable htError    = null;
                CertInfo  certInfo   = null;

                #region 检查参数
                Hashtable htResult       = new Hashtable();
                bool      paramCheckFlag = false;
                htResult = ErrorService.CheckLength("用户ID", userId, 1, 32, true, false, ref paramCheckFlag);
                if (!paramCheckFlag)
                {
                    return(ErrorConvert.Export <UploadContract>(htResult));
                }
                //htResult = ErrorService.CheckLength("令牌", token, 1, 32, true, false, ref paramCheckFlag);
                //if (!paramCheckFlag) return ErrorConvert.Export<UploadContract>(htResult);
                //htResult = ErrorService.CheckLength("门店ID", unitId, 1, 32, true, false, ref paramCheckFlag);
                //if (!paramCheckFlag) return ErrorConvert.Export<UploadContract>(htResult);
                #endregion

                #region 检查权限
                Dex.Services.AuthService authService = new Dex.Services.AuthService();

                // 检查User和Customer
                certInfo = authService.GetCertByUserId(userId);
                if (certInfo == null)
                {
                    htError              = ErrorService.OutputError(ErrorCode.A006, "用户ID不存在", true);
                    data.status          = Utils.GetStatus(false);
                    data.error_code      = htError["error_code"].ToString();
                    data.error_full_desc = htError["error_desc"].ToString();
                    LogService.WriteError(bizId, methodKey, data.error_code, data.ToString(), userId, htLogExt);
                    return(data);
                }

                statusFlag = true;
                //// 检查Token是否不匹配或过期
                //statusFlag = authService.CheckCertToken(token, certInfo.CertId, userId);
                //if (!statusFlag)
                //{
                //    htError = ErrorService.OutputError(ErrorCode.A005, "令牌不匹配或过期", true);
                //    data.status = Utils.GetStatus(false);
                //    data.error_code = htError["error_code"].ToString();
                //    data.error_full_desc = htError["error_desc"].ToString();
                //    LogService.WriteError(bizId, methodKey, data.error_code, data.ToString(), userId, htLogExt);
                //    return data;
                //}

                // 查询凭证
                certInfo = authService.GetCertByUserId(userId);
                if (certInfo == null || certInfo.CustomerId == null || certInfo.CustomerId.Length == 0)
                {
                    htError              = ErrorService.OutputError(ErrorCode.A007, "获取后台数据(客户ID)失败", true);
                    data.status          = Utils.GetStatus(false);
                    data.error_code      = htError["error_code"].ToString();
                    data.error_full_desc = htError["error_desc"].ToString();
                    LogService.WriteError(bizId, methodKey, data.error_code, data.ToString(), userId, htLogExt);
                    return(data);
                }

                string customerId = certInfo.CustomerId;

                htLogExt["customer_code"] = certInfo.CustomerCode;
                htLogExt["customer_id"]   = certInfo.CustomerId;
                htLogExt["user_code"]     = certInfo.UserCode;
                #endregion

                #region 检查单据参数
                Dex.ServicesBs.ComService orderService = new Dex.ServicesBs.ComService();
                if (order.user_id == null || order.user_id.Trim().Length == 0)
                {
                    order.user_id = userId;
                }
                htError = orderService.CheckMonitorLog(order);
                if (!Convert.ToBoolean(htError["status"]))
                {
                    data.status          = Utils.GetStatus(false);
                    data.error_code      = htError["error_code"].ToString();
                    data.error_full_desc = htError["error_desc"].ToString();
                    LogService.WriteError(bizId, methodKey, data.error_code, data.ToString(), userId, htLogExt);
                    return(data);
                }
                #endregion

                // 保存
                ConfigService cfgService         = new ConfigService();
                bool          enableConnectPosBS = cfgService.GetEnableConnectPosBSCfg();
                if (enableConnectPosBS)
                {
                    try
                    {
                        orderService.SaveMonitorLog(order, customerId, unitId, userId);
                    }
                    catch (Exception ex)
                    {
                        data.status          = Utils.GetStatus(false);
                        data.error_code      = ErrorCode.A018.ToString();
                        data.error_full_desc = ex.ToString();
                        LogService.WriteError(bizId, methodKey, data.error_code, data.ToString(), userId, htLogExt);
                        return(data);
                    }
                }
                else
                {
                    htError              = ErrorService.OutputError(ErrorCode.A012, "连接业务平台数据通道已关闭", true);
                    data.status          = Utils.GetStatus(false);
                    data.error_code      = htError["error_code"].ToString();
                    data.error_full_desc = htError["error_desc"].ToString();
                    LogService.WriteError(bizId, methodKey, data.error_code, data.ToString(), userId, htLogExt);
                    return(data);
                }

                data.status = Utils.GetStatus(statusFlag);
                LogService.WriteTrace(bizId, methodKey, TraceLogType.Return.ToString(), data.ToString(), userId, htLogExt);
            }
            catch (Exception ex)
            {
                data.status          = Utils.GetStatus(false);
                data.error_code      = ErrorCode.A000.ToString();
                data.error_full_desc = ex.ToString();
                LogService.WriteError(bizId, methodKey, data.error_code, data.ToString(), userId, htLogExt);
            }
            return(data);
        }
Exemple #6
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime lifetime)
        {
            app.UseAuthentication();
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseStaticFiles();

            app.UseCors("default");
            app.UseMvc();

            var confRegisterConsul = ConfigHelper.ReadConfigByName("IsRegisterConsul", "");
            var IsRegisterConsul   = false;

            Boolean.TryParse(confRegisterConsul, out IsRegisterConsul);

            //注册服务
            if (IsRegisterConsul)
            {
                ServiceContract serviceEntity = new ServiceContract
                {
                    IP          = Configuration["Service:Ip"],
                    Port        = Convert.ToInt32(Configuration["Service:Port"]),
                    ServiceName = Configuration["Service:Name"],
                    ConsulIP    = Configuration["Consul:IP"],
                    ConsulPort  = Convert.ToInt32(Configuration["Consul:Port"])
                };
                ConsulCommon.RegisterConsul(app, lifetime, serviceEntity);
            }

            string      KafkaUploadTopic = ConfigHelper.ReadConfigByName("KafkaUploadTopic");
            string      KafkaMsgTopic    = ConfigHelper.ReadConfigByName("KafkaMsgTopic");
            UploadLogic uploadLogic      = new UploadLogic();


            //总署订阅消息
            KafKaLogic.GetInstance().Pull((KafKaContract, topic) =>
            {
                if (topic == KafkaUploadTopic)       //总署订阅消息
                {
                    Task.Run(() =>
                    {
                        uploadLogic.PullUploadMsg(KafKaContract);
                    });
                }
                else if (topic == KafkaMsgTopic)      //隶属关订阅消息
                {
                    Task.Run(() =>
                    {
                        uploadLogic.PullMsg(KafKaContract);
                    });
                }
            });

            var model = new UploadContract();

            model.InsertTime = DateTime.Now;

            var str = SerializeHelper.serializeToString(model);

            LogHelper.logInfo(str);
            //定时任务
            QuartzLogic quartz = new QuartzLogic();
            var         cron   = ConfigHelper.ReadConfigByName("QuartzTime");

            quartz.ExecuteByCron <MyJobLogic>(cron);
        }
        public async Task <ResultContract <string> > UploadFile(BaseUploadContract data)
        {
            var result = new ResultContract <string>()
            {
                Code = 0, Msg = "上传成功"
            };

            try
            {
                //验证参数
                var orgInfo = new OrganizationContract();
                this.CheckParameter(data, ref result, ref orgInfo);
                if (result.Code == -1)
                {
                    return(result);
                }

                List <UploadContract> fileList = new List <UploadContract>();
                var files   = Request.Form.Files;
                var groupId = Guid.NewGuid().ToString();
                int order   = 1;
                foreach (var file in files)
                {
                    var fileModel = new UploadContract()
                    {
                        UserId      = data.UserId,
                        OrgId       = data.OrgId,
                        AppId       = data.AppId,
                        Tags        = data.Tags,
                        UploadTime  = DateTime.Now,
                        DisplayName = data.DisplayName,
                        Remark      = data.Remark,
                        OrgName     = orgInfo.OrganizationName,
                        Order       = order,
                        ThemeType   = data.ThemeType
                    };

                    //分组id
                    fileModel.GroupId = groupId;
                    var fileData = new MultipartFormDataContent();

                    //判断文件夹是否存在
                    if (!Directory.Exists(uploadFilePath))
                    {
                        Directory.CreateDirectory(uploadFilePath);
                    }
                    var imgPath = AppDomain.CurrentDomain.BaseDirectory + ConfigHelper.ReadConfigByName("ImgsPath");
                    if (!Directory.Exists(imgPath))
                    {
                        Directory.CreateDirectory(imgPath);
                    }

                    fileModel.FileName = file.FileName;
                    var lastName = file.FileName.Substring(file.FileName.LastIndexOf(".") + 1, (file.FileName.Length - file.FileName.LastIndexOf(".") - 1)); //扩展名
                    fileModel.FileId      = Guid.NewGuid();
                    fileModel.NewFileName = fileModel.FileId + "." + lastName;
                    var fileLocalFullName = uploadFilePath + Path.DirectorySeparatorChar + fileModel.NewFileName;
                    var stream            = file.OpenReadStream();
                    //文件保存到本地
                    double fileSize = 0;
                    //保存文件
                    FileHelper.SavaFile(fileLocalFullName, stream, ref fileSize);
                    //文件上传成功 修改model
                    fileModel.IsUpload = false;
                    fileModel.Url      = fileLocalFullName;
                    fileModel.FileType = lastName;
                    //组织名称。后期加上
                    //判断文件大小
                    double uploadLimitSize = 0;
                    double.TryParse(ConfigHelper.ReadConfigByName("UploadLimitSizeM"), out uploadLimitSize);

                    //如果是视频截取封面
                    if (CommonDictionary.GetInstance().VideoType.Count(d => d.ToLower() == lastName.ToLower()) > 0)
                    {
                        var thumbnailPath = AliyunOSSHepler.GetInstance().GetPicFromVideo(fileLocalFullName, imgPath + Path.DirectorySeparatorChar + fileModel.FileId + ".jpg", "1");
                        var thumbnailUrl  = "";
                        var isUpload      = AliyunOSSHepler.GetInstance().UploadFiles(imgPath, fileModel.FileId + ".jpg", ref
                                                                                      thumbnailUrl, true);

                        fileModel.ThumbnailUrl = thumbnailPath;

                        if (isUpload && !string.IsNullOrWhiteSpace(thumbnailUrl))
                        {
                            fileModel.ThumbnailUrl = thumbnailUrl;
                        }
                        else
                        {
                            fileModel.IsFailure = true;
                            this._uploadHandService.SavaTagsFile(fileModel);
                            //把文件 移动到错误文件 文件夹
                            System.IO.File.Move(uploadFilePath + Path.DirectorySeparatorChar + fileModel.NewFileName, FailurePath + Path.DirectorySeparatorChar + fileModel.NewFileName);
                            result.Code = -1;
                            result.Msg  = "截图失败";
                            return(result);
                        }
                    }

                    //如果断网把标签和文件都存到本地
                    if (!CommonDictionary.GetInstance().KafkaIsOnline)
                    {
                        this._uploadHandService.SavaTagsFile(fileModel);
                    }
                    else
                    {
                        //如果文件大小比预设大小 小 直接上云
                        if (fileSize < uploadLimitSize)
                        {
                            var url = "";
                            fileModel.IsUpload = AliyunOSSHepler.GetInstance().UploadFiles(uploadFilePath, fileModel.NewFileName, ref
                                                                                           url, false);

                            //如果上传失败  标签存本地
                            if (!fileModel.IsUpload)
                            {
                                fileModel.IsFailure = true;
                                this._uploadHandService.SavaTagsFile(fileModel);
                                //把文件 移动到错误文件 文件夹
                                System.IO.File.Move(uploadFilePath + Path.DirectorySeparatorChar + fileModel.NewFileName, FailurePath + Path.DirectorySeparatorChar + fileModel.NewFileName);
                            }
                            else
                            {
                                fileModel.Url = url;
                            }
                        }

                        fileList.Add(fileModel);
                        order++;
                    }
                }

                ////把标签 推送到总署
                KafKaContract kafkaModel = new KafKaContract();
                if (fileList.Count > 1)  //批量添加
                {
                    kafkaModel.MsgCode = KafkaMsgCodeEnum.AddList;
                    kafkaModel.Msg     = SerializeHelper.serializeToString(fileList);
                    KafKaLogic.GetInstance().Push(kafkaModel, KafkaTopic);
                }
                else if (fileList.Count() == 1) //单个文件添加
                {
                    kafkaModel.MsgCode  = KafkaMsgCodeEnum.Add;
                    fileList[0].GroupId = Guid.NewGuid().ToString();
                    kafkaModel.Msg      = SerializeHelper.serializeToString(fileList[0]);
                    KafKaLogic.GetInstance().Push(kafkaModel, KafkaTopic);
                }
            }
            catch (Exception e)
            {
                LogHelper.logError("上传文件失败:" + e.StackTrace);
                result.Code = -1;
                result.Msg  = e.Message;
            }

            return(result);
        }
Exemple #8
0
        public static T Export <T>(Hashtable htError) where T : BaseContract
        {
            BaseContract contract = null;

            if (typeof(T) == typeof(BaseContract))
            {
                contract = new BaseContract();
            }
            if (typeof(T) == typeof(ValidateContract))
            {
                contract = new ValidateContract();
            }
            if (typeof(T) == typeof(GetUserUnitRelationsContract))
            {
                contract = new GetUserUnitRelationsContract();
            }
            if (typeof(T) == typeof(GetUsersProfileContract))
            {
                contract = new GetUsersProfileContract();
            }
            if (typeof(T) == typeof(GetPosCodeContract))
            {
                contract = new GetPosCodeContract();
            }
            if (typeof(T) == typeof(GetLogsContract))
            {
                contract = new GetLogsContract();
            }
            if (typeof(T) == typeof(GetLogContract))
            {
                contract = new GetLogContract();
            }
            if (typeof(T) == typeof(GetPackagesContract))
            {
                contract = new GetPackagesContract();
            }
            if (typeof(T) == typeof(GetPackagesCountContract))
            {
                contract = new GetPackagesCountContract();
            }
            if (typeof(T) == typeof(GetPackageFilesContract))
            {
                contract = new GetPackageFilesContract();
            }
            if (typeof(T) == typeof(GetPackageFilesCountContract))
            {
                contract = new GetPackageFilesCountContract();
            }
            if (typeof(T) == typeof(UploadInoutOrdersContract))
            {
                contract = new UploadInoutOrdersContract();
            }
            if (typeof(T) == typeof(GetCountContract))
            {
                contract = new GetCountContract();
            }
            if (typeof(T) == typeof(GetStockBalancesContract))
            {
                contract = new GetStockBalancesContract();
            }
            if (typeof(T) == typeof(UploadContract))
            {
                contract = new UploadContract();
            }
            if (typeof(T) == typeof(GetVipsContract))
            {
                contract = new GetVipsContract();
            }
            if (typeof(T) == typeof(GetVipContract))
            {
                contract = new GetVipContract();
            }
            if (typeof(T) == typeof(ExistVipNoContract))
            {
                contract = new ExistVipNoContract();
            }
            if (typeof(T) == typeof(DownloadInoutOrdersContract))
            {
                contract = new DownloadInoutOrdersContract();
            }
            if (typeof(T) == typeof(DownloadCcOrdersContract))
            {
                contract = new DownloadCcOrdersContract();
            }
            if (typeof(T) == typeof(GetAnnsContract))
            {
                contract = new GetAnnsContract();
            }
            if (typeof(T) == typeof(GetPriceOrdersContract))
            {
                contract = new GetPriceOrdersContract();
            }
            if (typeof(T) == typeof(CheckVersionContract))
            {
                contract = new CheckVersionContract();
            }
            if (typeof(T) == typeof(GetUnitXmlConfigInfoContract))
            {
                contract = new GetUnitXmlConfigInfoContract();
            }
            if (typeof(T) == typeof(GetItemInfoContract))
            {
                contract = new GetItemInfoContract();
            }
            if (typeof(T) == typeof(ApplyCustomerAndUnitContract))
            {
                contract = new ApplyCustomerAndUnitContract();
            }

            contract.status          = htError["status"].ToString();
            contract.error_code      = htError["error_code"].ToString();
            contract.error_full_desc = htError["error_desc"].ToString();
            return((T)contract);
        }
        public void FailureVideo()
        {
            try
            {
                //获取文件所在路径
                string workDir = AppDomain.CurrentDomain.BaseDirectory + ConfigHelper.ReadConfigByName("FailurePath");
                if (System.IO.Directory.Exists(workDir))
                {
                    var list = this._dbContext.FileDB.FindAll <FileDbContract>();
                    LogHelper.logError("读取失败json");
                    foreach (var entity in list)
                    {
                        if (!CommonDictionary.GetInstance().KafkaIsOnline)
                        {
                            continue;
                        }
                        if (!string.IsNullOrEmpty(entity.Id))
                        {
                            LogHelper.logInfo("读取json文件:" + entity.Id);
                            DirectoryInfo folder = new DirectoryInfo(workDir);
                            //回写数据库的上云路径
                            string osspath = "";
                            //本地全部上云
                            FileInfo[] fileList = folder.GetFiles(entity.Id + ".*");
                            for (int i = 0; i < fileList.Length; i++)
                            {
                                UploadContract contract  = SerializeHelper.deserializeToObject <UploadContract>(entity.data);
                                bool           imgupload = true;
                                string         imgurl    = "";

                                if (contract.IsUpload == true)
                                {
                                    KafKaContract kafka = new KafKaContract();
                                    kafka.MsgId   = entity.Id;
                                    kafka.MsgCode = KafkaMsgCodeEnum.Add;
                                    kafka.Msg     = SerializeHelper.serializeToString(contract);
                                    KafKaLogic.GetInstance().Push(kafka, KafkaTopic);
                                    continue;
                                }

                                if (CommonDictionary.GetInstance().VideoType.Count(d => d.ToLower() == contract.FileType.ToLower()) > 0)
                                {
                                    imgurl    = AliyunOSSHepler.GetInstance().GetPicFromVideo(workDir + fileList[i].Name, imgPath + Path.DirectorySeparatorChar + contract.FileId + ".jpg", "1");
                                    imgupload = AliyunOSSHepler.GetInstance().UploadFiles(imgPath, contract.FileId + ".jpg", ref imgurl);
                                }

                                if (imgupload)
                                {
                                    bool returnType = AliyunOSSHepler.GetInstance().UploadFiles(workDir, fileList[i].Name, ref osspath);

                                    if (returnType)
                                    {
                                        LogHelper.logInfo("上云封面地址:" + imgurl + "_______上云视频路径:" + osspath);
                                        try
                                        {
                                            contract.IsUpload     = true;
                                            contract.Url          = osspath;
                                            contract.ThumbnailUrl = imgurl;
                                            entity.data           = SerializeHelper.serializeToString(contract);
                                            this._dbContext.FileDB.Save <FileDbContract>(contract.FileId.ToString(), entity);
                                            KafKaContract kafka = new KafKaContract();
                                            kafka.MsgId   = entity.Id;
                                            kafka.MsgCode = KafkaMsgCodeEnum.Add;
                                            kafka.Msg     = SerializeHelper.serializeToString(contract);
                                            KafKaLogic.GetInstance().Push(kafka, KafkaTopic);
                                        }
                                        catch (Exception e)
                                        {
                                            LogHelper.logError("解析json数据推送kafka异常:文件名-" + fileList[i].Name + "__" + e.ToString());
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    LogHelper.logError("失败任务无数据,本次不执行");
                }
            }
            catch (Exception e)
            {
                LogHelper.logError("失败文件推送异常:" + e.Message + "__" + e.ToString());
            }
        }