示例#1
0
 //保存文件到服务器
 object fileServerSave(string path, string filename, HttpPostedFileBase file
                       , int proid, int bankselid)
 {
     using (FxtAPIClient client = new FxtAPIClient())
     {
         string        filetype   = Path.GetExtension(file.FileName);
         SysUploadFile uploadFile = new SysUploadFile()
         {
             UserId    = "ddd",
             FilePath  = filename,
             FileType  = filetype,
             FileSize  = file.ContentLength,
             Name      = file.FileName.Replace(filetype, ""),
             Count     = new ExcelHelper(Path.Combine(path, filename)).GetExcelCount(),
             BankProid = proid,
             BankId    = bankselid
         };
         JObject obj = new JObject();
         obj.Add("model", Serialize(uploadFile));
         obj.Add("otype", "C");
         result = client.Entrance(Utils.CommonKey, Utils.GetWcfCode(Utils.CommonKey),
                                  "C", _Uploads, Utils.Serialize(obj)).ToString();
     }
     return(new
     {
         type = result,
         message = file.FileName
     });
 }
示例#2
0
 public SysUploadFiles(SysUploadFile sysUploadFile)
 {
     this.Id         = sysUploadFile.Id;
     this.Name       = sysUploadFile.Name;
     this.FilePath   = sysUploadFile.FilePath;
     this.FileType   = sysUploadFile.FileType;
     this.FileSize   = sysUploadFile.FileSize;
     this.UserId     = sysUploadFile.UserId;
     this.CreateDate = sysUploadFile.CreateDate;
     this.PageIndex  = sysUploadFile.PageIndex;
     this.Count      = sysUploadFile.Count;
     this.BankProid  = sysUploadFile.BankProid;
     this.BankId     = sysUploadFile.BankId;
 }
示例#3
0
 public ActionResult SetFilePageIndex(int fileId, int pageIndex)
 {
     using (FxtAPIClient client = new FxtAPIClient())
     {
         SysUploadFile uploadFile = new SysUploadFile()
         {
             Id        = fileId,
             PageIndex = pageIndex
         };
         JObject send = new JObject();
         send.Add("model", Serialize(uploadFile));
         send.Add("otype", "U");
         result = client.Entrance(Utils.CommonKey, Utils.GetWcfCode(Utils.CommonKey), "A", "Uploads", Utils.Serialize(send));
         return(Json(ResultServerJson("", (bool)result)));
     }
 }
示例#4
0
        /// <summary>
        /// 获取任务列表
        /// </summary>
        /// <returns></returns>
        public ResultData TaskList()
        {
            MSSQLADODAL mssqlado = new MSSQLADODAL(Utility.DBFxtLoan);
            //获取状态为开始、暂停的任务
            string sql = string.Format("{0} [Status]=0 or [Status]=2",
                                       Utility.GetMSSQL_SQL(typeof(SysTask), Utility.loand_Sys_Task));
            List <TaskToFile> list = mssqlado.GetList <TaskToFile>(sql);

            foreach (var item in list)
            {
                MSSQLADODAL.SetConnection(Utility.DBFxtLoan);
                //文件地址
                SysUploadFile sysUploadFile = CAS.DataAccess.DA.BaseDA
                                              .ExecuteToEntityByPrimaryKey <SysUploadFile>(item.UploadFileId);
                item.FileUrl = sysUploadFile != null ? sysUploadFile.FilePath : "";

                //银行所属项目名称
                SysBankProject sysBankProject = CAS.DataAccess.DA.BaseDA
                                                .ExecuteToEntityByPrimaryKey <SysBankProject>(item.BankProjectId);
                item.BankProjectName = sysBankProject != null ? sysBankProject.ProjectName : "";

                //任务所属用户名称
                SysUser sysUser = CAS.DataAccess.DA.BaseDA
                                  .ExecuteToEntityByPrimaryKey <SysUser>(item.UserId);
                item.UserName = sysUser != null ? sysUser.TrueName : "";

                //公司、银行、评估机构
                SysCustomer sysCustomer = CAS.DataAccess.DA.BaseDA
                                          .ExecuteToEntityByPrimaryKey <SysCustomer>(item.BankId);
                item.BankName = sysCustomer != null ? sysCustomer.CustomerName : "";
            }
            if (list.Count > 0)
            {
                return(Utility.GetObjJson(1, "成功", list));
            }
            return(Utility.GetObjJson(0, ""));
        }