Пример #1
0
        /// <summary>
        /// 修改任务成功及失败条数
        /// </summary>
        /// <param name="data">任务模型</param>
        /// <returns></returns>
        public ResultData TaskSuccessFail(string data)
        {
            SysTask sysTask = Utils.Deserialize <SysTask>(data);

            MSSQLADODAL.SetConnection(Utility.DBFxtLoan);
            int objId = CAS.DataAccess.DA.BaseDA.UpdateFromEntity <SysTask>(sysTask);

            if (objId > 0)
            {
                return(Utility.GetObjJson(1, "成功"));
            }
            return(Utility.GetObjJson(0, ""));
        }
Пример #2
0
        /// <summary>
        /// 新增任务日志
        /// </summary>
        /// <param name="data">任务日志实体</param>
        /// <returns></returns>
        public ResultData TaskLogAdd(string data)
        {
            SysTaskLog sysTaskLog = Utils.Deserialize <SysTaskLog>(data);

            MSSQLADODAL.SetConnection(Utility.DBFxtLoan);
            int flag = CAS.DataAccess.DA.BaseDA.InsertFromEntity <SysTaskLog>(sysTaskLog);

            if (flag > 0)
            {
                return(Utility.GetObjJson(1, "Success"));
            }
            return(Utility.GetObjJson(0, ""));
        }
Пример #3
0
        /// <summary>
        /// 押品拆分保存
        /// </summary>
        /// <param name="dataCollateral">押品对象</param>
        /// <param name="uploadFileId">文件ID</param>
        /// <returns></returns>
        public ResultData DataCollateralAdd(string data)
        {
            DataCollateral collateral = Utils.Deserialize <DataCollateral>(data);

            if (collateral.MatchStatus != null)
            {
                collateral.Status = 1;
            }
            collateral.CreateDate = DateTime.Now;

            MSSQLADODAL.SetConnection(Utility.DBFxtLoan);
            int objId = CAS.DataAccess.DA.BaseDA.InsertFromEntity <DataCollateral>(collateral);

            if (objId > 0)
            {
                return(Utility.GetObjJson(1, "成功"));
            }
            return(Utility.GetObjJson(0, ""));
        }
Пример #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, ""));
        }