示例#1
0
        private static void ImportQS(string base64Str, string sLBH, string userName)
        {
            string      path        = sLBH + "_完税凭证.jpg";
            string      cid         = GetCID(sLBH, "完税凭证", "文件夹", userName);
            DOC_BINFILE doc_binfile = new DOC_BINFILE();

            string binid = GetCID(sLBH, "完税凭证", "文件", userName, cid);//att.CID;

            doc_binfile.BINID        = binid;
            doc_binfile.FTPATH       = path;
            doc_binfile.FILEID       = Guid.NewGuid().ToString();
            doc_binfile.FILENAME     = "完税凭证";
            doc_binfile.EXTNAME      = "jpg";//GetExtName(v.imgName);
            doc_binfile.ISCOMPRESSED = "否";
            doc_binfile.ISENCRYPTED  = "否";

            QSPicUploadToFtp(sLBH, base64Str, doc_binfile);


            if (ImportDAL.ExistDoc_binfile(doc_binfile))
            {
                ImportDAL.UpDateDoc_binfile(doc_binfile);
            }
            else
            {
                ImportDAL.InsertDoc_binfile(doc_binfile);
            }
        }
示例#2
0
        private static void ImportFCDA(string slbh, string FCslbh, string user, ref int count)
        {
            List <Result>    list     = new List <Result>();
            List <VolEleArc> vol_list = ImportDAL.GetVolEleArc_list(FCslbh);
            string           errStr   = "";

            foreach (VolEleArc vol in vol_list)
            {
                Result res = new Result();
                string cid = GetCID(slbh, vol.EleArcName, "文件夹", user);
                List <VolEleArcDtl> dtlList = ImportDAL.GetVolEleArcDtlByVol(vol.EleArcVol_ID);
                if (null != dtlList && dtlList.Count > 0)
                {
                    count = dtlList.Count;
                    for (int i = 0; i < dtlList.Count; i++)
                    {
                        try
                        {
                            VolEleArcDtl v = dtlList[i];
                            v.imgName = v.imgName.Replace(@"\\192.168.134.245\", "").Replace(@"\\192.168.100.202\", "").Replace(@"K:\", "").Replace(@"\\192.168.100.202 \", "");
                            v.imgName = v.imgName.Replace("\\", "/");
                            DOC_BINFILE doc_binfile = new DOC_BINFILE();
                            string      EleArcName  = "";
                            if (i == 0)
                            {
                                EleArcName = vol.EleArcName;
                            }
                            if (i > 0)
                            {
                                EleArcName = vol.EleArcName + "-" + i;
                            }
                            string binid = GetCID(slbh, EleArcName, "文件", user, cid);//att.CID;
                            doc_binfile.BINID        = binid;
                            doc_binfile.FTPATH       = v.imgName;
                            doc_binfile.FILEID       = Guid.NewGuid().ToString();
                            doc_binfile.FILENAME     = vol.EleArcName;
                            doc_binfile.EXTNAME      = GetExtName(v.imgName);
                            doc_binfile.ISCOMPRESSED = "否";
                            doc_binfile.ISENCRYPTED  = "否";

                            UploadToFtp(FCslbh, doc_binfile);


                            if (ImportDAL.ExistDoc_binfile(doc_binfile))
                            {
                                ImportDAL.UpDateDoc_binfile(doc_binfile);
                            }
                            else
                            {
                                ImportDAL.InsertDoc_binfile(doc_binfile);
                            }
                        }
                        catch (Exception ex)
                        {
                            if (!errStr.Contains(ex.Message))
                            {
                                errStr += ex.Message;
                            }
                            continue;
                        }
                    }
                }
            }

            if (!string.IsNullOrEmpty(errStr))
            {
                throw new Exception(errStr);
            }
        }
示例#3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="IsCL"></param>
        /// <returns></returns>
        public static BDCFilterResult ImportFromFC(bool IsCL)
        {
            int             fileCount = 0;
            bool            IsSuccess = false;
            BDCFilterResult res       = new BDCFilterResult();

            DataTable dt = null;

            if (IsCL)
            {
                dt = ImportBLL.GetCLSLBH();
            }
            else
            {
                dt = ImportDAL.GetPushedSLBH();
            }
            if (null != dt && dt.Rows.Count > 0)
            {
                FC_REWRITE_TAG tag = new FC_REWRITE_TAG();
                foreach (DataRow row in dt.Rows)
                {
                    string slbh   = row[0].ToString();
                    string fcslbh = "";
                    if (CanImport(slbh))
                    {
                        try
                        {
                            List <DOC_BINFILE> doc_bin = GetDoc_Binfile(slbh, fcslbh);

                            if (UseFtp.Equals("是") || UseFtp.ToLower().Equals("true"))
                            {
                                if (null != doc_bin && doc_bin.Count > 0)
                                {
                                    fileCount = doc_bin.Count;
                                    foreach (DOC_BINFILE item in doc_bin)
                                    {
                                        tag.FILENAME += tag.FILENAME != null ? item.FILENAME : ("," + item.FILENAME);
                                        //using (TransactionScope ts = new TransactionScope())
                                        //{
                                        UploadToFtp(slbh, item);
                                        item.FTPATH = ChangeFTPPath(item.FTPATH);
                                        ImportDAL.InsertDoc_binfile(item);

                                        //ts.Complete();
                                        //}
                                    }
                                    tag.FILECOUNT = fileCount.ToString();
                                    //tag.FILENAME =doc_bin[0].BINID
                                    tag.ID        = Guid.NewGuid().ToString();
                                    tag.SLBH      = slbh;
                                    tag.PUSHDATE  = DateTime.Now;
                                    tag.ISSUCCESS = "1";
                                    tag.MESSAGE   = "成功";
                                    IsSuccess     = true;
                                    ImportDAL.InsertLog(tag);
                                }
                                else
                                {
                                    tag.FILECOUNT = fileCount.ToString();
                                    //tag.FILENAME =doc_bin[0].BINID
                                    tag.ID        = Guid.NewGuid().ToString();
                                    tag.SLBH      = slbh;
                                    tag.PUSHDATE  = DateTime.Now;
                                    tag.ISSUCCESS = "0";
                                    tag.MESSAGE   = "失败!不动产库中无此受理编号记录。";
                                    //IsSuccess = true;
                                    ImportDAL.InsertLog(tag);
                                }
                            }
                            else
                            {
                                DOC_FILE doc_file = GetDoc_file(slbh);
                                ImportDAL.InsertDoc_File(doc_file);
                            }
                        }
                        catch (Exception ex)
                        {
                            tag.FILECOUNT = fileCount.ToString();
                            //tag.FILENAME =doc_bin[0].BINID
                            tag.ID        = Guid.NewGuid().ToString();
                            tag.SLBH      = slbh;
                            tag.PUSHDATE  = DateTime.Now;
                            tag.ISSUCCESS = "0";
                            tag.MESSAGE   = "失败!" + ex.Message;
                            ImportDAL.InsertLog(tag);
                            continue;
                        }
                    }
                }
                res.ConfirmType = 0;
                res.IsSuccess   = IsSuccess;
                res.Message     = tag.MESSAGE;
            }
            return(res);
        }
示例#4
0
        public static BDCFilterResult ImportFromFC(string slbh)
        {
            int             fileCount = 0;
            bool            IsSuccess = false;
            BDCFilterResult res       = new BDCFilterResult();


            FC_REWRITE_TAG tag    = new FC_REWRITE_TAG();
            string         FCslbh = GetRealSLBH(slbh);

            //string slbh = row[0].ToString();
            if (CanImport(FCslbh))
            {
                try
                {
                    List <DOC_BINFILE> doc_bin = GetDoc_Binfile(slbh, FCslbh);

                    if (UseFtp.Equals("是") || UseFtp.ToLower().Equals("true"))
                    {
                        if (null != doc_bin && doc_bin.Count > 0)
                        {
                            fileCount = doc_bin.Count;
                            //using (TransactionScope ts = new TransactionScope())
                            //{
                            foreach (DOC_BINFILE item in doc_bin)
                            {
                                try
                                {
                                    tag.FILENAME += tag.FILENAME != null ? item.FILENAME : ("," + item.FILENAME);

                                    UploadToFtp(FCslbh, item);

                                    //item.FTPATH = ChangeFTPPath(item.FTPATH);
                                    if (ImportDAL.ExistDoc_binfile(item))
                                    {
                                        ImportDAL.UpDateDoc_binfile(item);
                                    }
                                    else
                                    {
                                        ImportDAL.InsertDoc_binfile(item);
                                    }
                                }
                                catch
                                {
                                    continue;
                                }
                            }
                            //ts.Complete();
                            //}
                            tag.FILECOUNT = fileCount.ToString();
                            //tag.FILENAME =doc_bin[0].BINID
                            tag.ID        = Guid.NewGuid().ToString();
                            tag.SLBH      = slbh;
                            tag.PUSHDATE  = DateTime.Now;
                            tag.ISSUCCESS = "1";
                            tag.MESSAGE   = "成功";
                            IsSuccess     = true;
                            ImportDAL.InsertLog(tag);
                        }
                        else
                        {
                            tag.FILECOUNT = fileCount.ToString();
                            //tag.FILENAME =doc_bin[0].BINID
                            tag.ID        = Guid.NewGuid().ToString();
                            tag.SLBH      = slbh;
                            tag.PUSHDATE  = DateTime.Now;
                            tag.ISSUCCESS = "0";
                            tag.MESSAGE   = "失败!不动产库中无此受理编号记录。";
                            //IsSuccess = true;
                            ImportDAL.InsertLog(tag);
                        }
                    }
                }
                catch (Exception ex)
                {
                    tag.FILECOUNT = fileCount.ToString();
                    //tag.FILENAME =doc_bin[0].BINID
                    tag.ID        = Guid.NewGuid().ToString();
                    tag.SLBH      = slbh;
                    tag.PUSHDATE  = DateTime.Now;
                    tag.ISSUCCESS = "0";
                    tag.MESSAGE   = "失败!" + ex.Message;
                    ImportDAL.InsertLog(tag);
                }



                res.ConfirmType = 0;
                res.IsSuccess   = IsSuccess;
                res.Message     = tag.MESSAGE;
            }
            else
            {
                res.ConfirmType = 0;
                res.IsSuccess   = false;
                res.Message     = "失败!图像尚未扫描入库!";
            }
            return(res);
        }