Пример #1
0
        public string downloadCorpCertFromMohurd(HttpContext context)
        {
            string            qyID   = context.Request.Params["qyID"];
            ProcessResultData result = new ProcessResultData();

            try
            {
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://localhost:8181/crawler/qyzs/kanchashejiByZzjgdm?zzjgdm=" + qyID);
                request.Method      = "GET";
                request.ContentType = "text/html;charset=UTF-8";

                HttpWebResponse response         = (HttpWebResponse)request.GetResponse();
                Stream          myResponseStream = response.GetResponseStream();
                StreamReader    myStreamReader   = new StreamReader(myResponseStream, Encoding.GetEncoding("utf-8"));
                string          retString        = myStreamReader.ReadToEnd();
                myStreamReader.Close();
                myResponseStream.Close();
                result.message = retString;
            }
            catch (Exception ex)
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = ex.Message;
            }
            return(result.ResultMessage);
        }
Пример #2
0
        public ProcessResultData saveProjectDocInfoAdd(DataTable dt)
        {
            ProcessResultData result     = new ProcessResultData();
            DataTable         dt_InfoAdd = DAL.GetProjectDocAdd();
            DataRow           row;
            List <string>     notCopyFields = new List <string>()
            {
                "PKID", "CreateDate", "UpdateDate"
            };

            foreach (DataRow item in dt.Rows)
            {
                row = dt_InfoAdd.NewRow();
                DataTableHelp.DataRow2DataRow(item, row, notCopyFields);
                row["PKID"]       = Guid.NewGuid();
                row["CreateDate"] = DateTime.Now;
                row["UpdateDate"] = DateTime.Now;
                dt_InfoAdd.Rows.Add(row);
            }

            bool flag = DAL.SaveProjectDocAdd(dt_InfoAdd);

            if (flag)
            {
                result.code = ProcessResult.数据保存成功;
            }
            else
            {
                result.code = ProcessResult.保存失败和失败原因;
            }

            return(result);
        }
Пример #3
0
        /// <summary>
        /// 手动从一站式申报平台按uuid下行安监、质监申报数据
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public string downloadByUuid(HttpContext context)
        {
            DataExchangeBLLForYZSSBDownload BLL = new DataExchangeBLLForYZSSBDownload();

            string            uuid     = context.Request.Params["uuid"];
            string            deptType = context.Request.Params["deptType"];
            ProcessResultData result   = new ProcessResultData();

            try
            {
                string msg = null;
                if ("AJ".Equals(deptType))
                {
                    msg = BLL.PullAJSBDataFromSythptByUUID(uuid);
                }
                else
                {
                    msg = BLL.PullZJSBDataFromSythptByUUID(uuid);
                }
                result.message = msg;
            }
            catch (Exception ex)
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = ex.Message;
            }
            return(result.ResultMessage);
        }
Пример #4
0
        /// <summary>
        /// 接收单体项目档案相关信息
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        public ProcessResultData saveSubProjectDocInfo(DataRow item)
        {
            ProcessResultData result = new ProcessResultData();

            DataTable dt_SubPrjDoc = DAL.GetSubProjectDocInfo(item["PrjNum"].ToString2(), item["Fxbm"].ToString2(), item["Xmmc"].ToString2());
            DataRow   rowInDb;

            if (dt_SubPrjDoc != null && dt_SubPrjDoc.Rows.Count > 0)
            {
                rowInDb = dt_SubPrjDoc.Rows[0];
                DataTableHelp.DataRow2DataRow(item, rowInDb, new List <string>()
                {
                    "PKID", "PrjNum", "Fxbm", "Xmmc"
                });
                rowInDb["UpdateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            }
            else
            {
                rowInDb = dt_SubPrjDoc.NewRow();
                DataTableHelp.DataRow2DataRow(item, rowInDb);
                rowInDb["PKID"]       = Guid.NewGuid();
                rowInDb["CreateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                rowInDb["UpdateDate"] = rowInDb["CreateDate"];
                dt_SubPrjDoc.Rows.Add(rowInDb);
            }

            if (dt_SubPrjDoc.Rows.Count > 0)
            {
                bool successFlag = DAL.SaveSubProjectDocInfo(dt_SubPrjDoc);
                if (successFlag)
                {
                    result.code = ProcessResult.数据保存成功;
                }
                else
                {
                    result.code = ProcessResult.保存失败和失败原因;
                }
            }

            /**
             * int effects = DAL.SaveSubProjectDoc(row);
             *
             * if (effects > 0)
             * {
             *  result.code = ProcessResult.数据保存成功;
             * }
             * else
             * {
             *  result.code = ProcessResult.保存失败和失败原因;
             * }*/


            return(result);
        }
Пример #5
0
        /// <summary>
        /// 接收项目位置相关信息
        /// </summary>
        /// <param name="row"></param>
        /// <returns></returns>
        public ProcessResultData saveProjectPositionInfo(DataRow row)
        {
            ProcessResultData result = new ProcessResultData();

            int effects = DAL.SaveProjectPosition(row);

            if (effects > 0)
            {
                result.code = ProcessResult.数据保存成功;
            }
            else
            {
                result.code = ProcessResult.保存失败和失败原因;
            }

            return(result);
        }
Пример #6
0
        /// <summary>
        /// 手动往省厅上传项目补充信息
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public string uploadToStTBProjectAddInfo(HttpContext context)
        {
            DataExchangeBLLForUpload BLL = new DataExchangeBLLForUpload();

            string            prjNum = context.Request.Params["PrjNum"];
            ProcessResultData result = new ProcessResultData();

            try
            {
                result = BLL.SaveTBData_TBProjectAddInfo(WorkUser.LoginName, prjNum);
            }
            catch (Exception ex)
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = ex.Message;
            }
            return(result.ResultMessage);
        }
Пример #7
0
        public string downloadCorpCert(HttpContext context)
        {
            DataExchangeBLLForJSCEDC BLL = new DataExchangeBLLForJSCEDC();

            string            qyID   = context.Request.Params["qyID"];
            ProcessResultData result = new ProcessResultData();

            try
            {
                string msg = null;
                msg            = BLL.PullDataCorpCert(qyID);
                result.message = msg;
            }
            catch (Exception ex)
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = ex.Message;
            }
            return(result.ResultMessage);
        }
Пример #8
0
        public string saveHtbaPrjType(HttpContext context)
        {
            HtbaBLL BLL = new HtbaBLL();

            string recordNum = context.Request.Params["RecordNum"];
            string prjType   = context.Request.Params["prjType"];

            ProcessResultData result = new ProcessResultData();

            try
            {
                //BLLCommon.WriteLog("recordNum : " + recordNum + ",prjType:" + prjType);
                BLL.saveHtbaPrjType(recordNum, prjType);
                result.message = "OK";
            }
            catch (Exception ex)
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = ex.Message;
                BLLCommon.WriteLog("message:" + result.message);
            }
            return(result.ResultMessage);
        }
Пример #9
0
        public string saveHtbaUnion(HttpContext context)
        {
            HtbaBLL BLL = new HtbaBLL();

            string recordNum     = context.Request.Params["RecordNum"];
            string unionCorpName = context.Request.Params["unionCorpName"];
            string unionCorpCode = context.Request.Params["unionCorpCode"];

            ProcessResultData result = new ProcessResultData();

            try
            {
                //BLLCommon.WriteLog("recordNum : " + recordNum + ",unionCorpName:" + unionCorpName + ",unionCorpCode" + unionCorpCode);
                BLL.saveHtbaUnion(recordNum, unionCorpName, unionCorpCode);
                result.message = "OK";
            }
            catch (Exception ex)
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = ex.Message;
                BLLCommon.WriteLog("message:" + result.message);
            }
            return(result.ResultMessage);
        }
Пример #10
0
        /// <summary>
        /// 往省厅推送项目信息
        /// </summary>
        /// <param name="user"></param>
        /// <param name="dt_Data"></param>
        /// <returns></returns>
        public ProcessResultData SaveTBData_TBProjectInfo(string user, string pKID)
        {
            ProcessResultData result = new ProcessResultData();

            DataTable dt_TBProjectInfo = DAL.GetTBData_TBProjectInfoByPKID(pKID);
            DataRow   row;

            if (dt_TBProjectInfo.Rows.Count > 0)
            {
                DataRow dataRow = dt_TBProjectInfo.Rows[0];

                try
                {
                    string xmlData = "";

                    dataRow["sbdqbm"] = "320200";
                    if (dataRow["BuildCorpCode"].ToString2().Length == 18)
                    {
                        string shxydm = dataRow["BuildCorpCode"].ToString2();
                        dataRow["BuildCorpCode"] = shxydm.Substring(8, 8) + "-" + shxydm.Substring(16, 1);
                    }

                    xmlData = xmlHelper.ConvertDataRowToXMLWithBase64Encoding(dataRow);
                    BLLCommon.WriteLog("SaveTBData_TBProjectInfo 上传省厅数据:" + xmlData);
                    string resultSt = client.SaveTBDataToSt("TBProjectInfo", xmlData, userName, password);
                    //string resultSt = "OK";
                    BLLCommon.WriteLog("\nSaveTBData_TBProjectInfo 上传省厅结果:" + resultSt);

                    DataTable dt = DAL.GetTBData_SaveToStLog("TBProjectInfo", dataRow["PKID"].ToString());

                    if (dt.Rows.Count > 0)
                    {
                        row = dt.Rows[0];
                        row["UpdateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        row["TableName"]  = "TBProjectInfo";
                    }
                    else
                    {
                        row = dt.NewRow();
                        row["CreateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                        row["UpdateDate"] = row["CreateDate"];
                        row["TableName"]  = "TBProjectInfo";
                        row["PKID"]       = dataRow["PKID"];
                        dt.Rows.Add(row);
                    }
                    if (resultSt != "OK")
                    {
                        row["OperateState"] = 1;
                        row["Msg"]          = resultSt;
                        result.code         = ProcessResult.保存失败和失败原因;
                    }
                    else
                    {
                        row["OperateState"] = 0;
                        row["Msg"]          = "上传成功";
                        result.code         = ProcessResult.数据保存成功;
                    }
                    result.message = resultSt;
                    if (dt.Rows.Count > 0)
                    {
                        DAL.SaveTBData_SaveToStLog(dt);
                    }
                }
                catch (Exception ex)
                {
                    BLLCommon.WriteLog("执行SaveTBData_TBProjectInfo异常:" + ex.Message);
                    result.code    = ProcessResult.保存失败和失败原因;
                    result.message = ex.Message;
                }
            }

            return(result);
        }
Пример #11
0
        /// <summary>
        /// 往省厅推送项目补充信息
        /// </summary>
        /// <param name="user"></param>
        /// <param name="dt_Data"></param>
        /// <returns></returns>
        public ProcessResultData SaveTBData_TBProjectAddInfo(string user, string prjNum)
        {
            ProcessResultData result = new ProcessResultData();

            DataTable dt_TBProjectAddInfo = DAL.GetTBData_TBProjectAdditionalInfo(prjNum);
            DataRow   row;

            string[] fields = new string[] { "prjnum", "prjpassword", "gyzzpl", "dzyx", "lxr", "yddh", "xmtz", "gytze", "gytzbl", "lxtzze", "sbdqbm" };


            if (dt_TBProjectAddInfo.Rows.Count > 0)
            {
                DataRow dataRow = dt_TBProjectAddInfo.Rows[0];

                string xmlData = "";
                dataRow["sbdqbm"] = "320200";//设置上报地区编码为无锡市

                DataTable dt = DAL.GetTBData_SaveToStLog("TBProjectAdditionalInfo", dataRow["PKID"].ToString());
                if (dt.Rows.Count > 0)
                {
                    row = dt.Rows[0];
                    row["UpdateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    row["TableName"]  = "TBProjectAdditionalInfo";
                }
                else
                {
                    row = dt.NewRow();
                    row["CreateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                    row["UpdateDate"] = row["CreateDate"];
                    row["TableName"]  = "TBProjectAdditionalInfo";
                    row["PKID"]       = dataRow["PKID"];
                    dt.Rows.Add(row);
                }
                try
                {
                    //向省一体化平台传送项目登记补充数据
                    xmlData = xmlHelper.ConvertDataRowToXMLWithBase64EncodingIncludeForAddPrj(dataRow, fields);
                    string addResultSt = client.getProjectAdd(dataRow["prjnum"].ToString(), xmlData, userName, password);
                    //string addResultSt = "OK";
                    BLLCommon.WriteLog("向省一体化平台传送项目登记补充数据:" + xmlData + "\n结果1:" + addResultSt);

                    if (addResultSt != "OK")
                    {
                        row["OperateState"] = 1;
                        row["Msg"]          = addResultSt;
                        result.code         = ProcessResult.保存失败和失败原因;
                    }
                    else
                    {
                        row["OperateState"] = 0;
                        row["Msg"]          = "上传成功";
                        result.code         = ProcessResult.数据保存成功;
                    }

                    result.message = addResultSt;
                }
                catch (Exception ex)
                {
                    BLLCommon.WriteLog(ex.Message);
                    row["OperateState"] = 1;
                    row["Msg"]          = ex.Message;
                    result.code         = ProcessResult.保存失败和失败原因;
                    result.message      = ex.Message;
                }
                finally
                {
                    if (dt.Rows.Count > 0)
                    {
                        DAL.SaveTBData_SaveToStLog(dt);
                    }
                }
            }
            else
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = "请先填写项目补充信息.";
            }

            return(result);
        }
Пример #12
0
        /// <summary>
        /// 推送质监通知书
        /// </summary>
        /// <param name="user"></param>
        /// <param name="deptcode"></param>
        /// <param name="sbPassword"></param>
        /// <param name="dt_Data"></param>
        /// <returns></returns>
        public ProcessResultData pushZJTZS(string user, string deptcode, string sbPassword, DataTable dt_Data, DataTable jdryDtData)
        {
            ProcessResultData result        = new ProcessResultData();
            StringBuilder     prjInnerNumSb = new StringBuilder();

            string msg = String.Empty;

            string[] fields = new string[] { "uuid", "tzrq", "tzdw" };

            DataRow       item        = dt_Data.Rows[0];
            List <string> novalidates = new List <string>();

            novalidates.Add(String.Empty);
            novalidates.Add(" ");
            novalidates.Add("无");
            novalidates.Add("无数据");
            novalidates.Add("/");

            if (BLLCommon.DataFieldIsNullOrEmpty(novalidates, fields, item, out msg))
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = msg + "不能为空!";
                return(result);
            }

            DataTable dt_ajtzs = DAL.GetApTable("Ap_zjtzs");
            DataRow   row      = dt_ajtzs.NewRow();

            DataTableHelp.DataRow2DataRow(item, row);

            row["id"]         = Guid.NewGuid();
            row["UpdateTime"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            dt_ajtzs.Rows.Add(row);
            row["deptcode"]   = deptcode;
            row["sbPassword"] = sbPassword;
            row["UpdateUser"] = user;

            //保存监督人员列表
            DataTable dt_tzs_jdry = null;

            if (jdryDtData != null && jdryDtData.Rows.Count > 0)
            {
                dt_tzs_jdry = DAL.GetApTable("Ap_zjtzs_jdry");

                foreach (DataRow jdryItem in jdryDtData.Rows)
                {
                    DataRow jdryRow = dt_tzs_jdry.NewRow();
                    DataTableHelp.DataRow2DataRow(jdryItem, jdryRow);
                    jdryRow["id"]   = Guid.NewGuid();
                    jdryRow["uuid"] = row["uuid"];
                    dt_tzs_jdry.Rows.Add(jdryRow);
                }
            }

            if (dt_ajtzs.Rows.Count > 0)
            {
                if (DAL.SaveApTable("Ap_zjtzs", dt_ajtzs) && DAL.SaveApTable("Ap_zjtzs_jdry", dt_tzs_jdry))
                {
                    try
                    {
                        StringBuilder str         = new StringBuilder();
                        string        xmlData     = string.Empty;
                        string        jdryXmlData = string.Empty;
                        DataRow       dataRow     = dt_ajtzs.Rows[0];

                        //向省一站式申报平台推送质监通知书
                        List <string> excludeColumns = new List <string>();
                        excludeColumns.Add("id");
                        excludeColumns.Add("deptcode");
                        excludeColumns.Add("sbPassword");
                        excludeColumns.Add("UpdateTime");
                        excludeColumns.Add("UpdateUser");
                        xmlData = xmlHelper.ConvertDataRowToXML(dataRow, excludeColumns);


                        str.Append("<?xml version=\"1.0\" encoding=\"gb2312\"?>");
                        str.AppendFormat("<{0}>", "data");
                        str.AppendFormat("<{0}>", "result");
                        str.Append(xmlData);

                        foreach (DataRow jdryItem in jdryDtData.Rows)
                        {
                            str.AppendFormat("<{0}>", "jdryList");
                            DataRow jdryRow = dt_tzs_jdry.NewRow();
                            jdryXmlData = xmlHelper.ConvertDataRowToXML(jdryItem);
                            str.Append(jdryXmlData);
                            str.AppendFormat("</{0}>", "jdryList");
                        }

                        str.AppendFormat("</{0}>", "result");
                        str.AppendFormat("</{0}>", "data");

                        string addResultSt = client.pushZJTZS(deptcode, sbPassword, str.ToString());
                        BLLCommon.WriteLog("deptcode:" + deptcode);
                        BLLCommon.WriteLog("向省一站式申报平台推送质监监督通知书:" + str.ToString() + "\n结果:" + addResultSt);

                        DataTable dt = DAL.GetTBData_SaveToStLog("Ap_zjtzs", dataRow["id"].ToString());

                        if (dt.Rows.Count > 0)
                        {
                            row = dt.Rows[0];
                            row["UpdateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                            row["TableName"]  = "Ap_zjtzs";
                        }
                        else
                        {
                            row = dt.NewRow();
                            row["CreateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                            row["UpdateDate"] = row["CreateDate"];
                            row["TableName"]  = "Ap_zjtzs";
                            row["PKID"]       = dataRow["id"];
                            dt.Rows.Add(row);
                        }
                        if (addResultSt != "OK")
                        {
                            row["OperateState"] = 1;
                            row["Msg"]          = addResultSt;
                            result.code         = ProcessResult.保存失败和失败原因;
                            result.message      = "数据上传省厅失败:" + addResultSt;
                        }
                        else
                        {
                            //已办结
                            updateZJSBStatus(dataRow["uuid"].ToString2(), (int)ApproveStatus.已办结);

                            row["OperateState"] = 0;
                            row["Msg"]          = "上传成功";
                            result.code         = ProcessResult.数据保存成功;
                            result.message      = "数据保存成功!";
                        }
                        if (dt.Rows.Count > 0)
                        {
                            DAL.SaveTBData_SaveToStLog(dt);
                        }
                    }
                    catch (Exception ex)
                    {
                        try
                        {
                            BLLCommon.WriteLog(ex.Message);
                        }
                        catch
                        {
                        }
                        result.code    = ProcessResult.保存失败和失败原因;
                        result.message = ex.Message;
                        return(result);
                    }
                }
                else
                {
                    result.code    = ProcessResult.保存失败和失败原因;
                    result.message = "网络故障,数据保存失败!";
                }
            }
            else
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = "非法格式的数据!";
            }
            return(result);
        }
Пример #13
0
        /// <summary>
        /// 向省一站式申报平台推送质监申报结果
        /// </summary>
        /// <param name="user"></param>
        /// <param name="dt_Data"></param>
        /// <returns></returns>
        public ProcessResultData pushZJSBJG(string user, string deptcode, string sbPassword, DataTable dt_Data, DataTable dwgcDt)
        {
            ProcessResultData result        = new ProcessResultData();
            StringBuilder     prjInnerNumSb = new StringBuilder();

            string msg = String.Empty;

            string[] fields = new string[] { "uuid", "success", "slry", "slrq" };

            DataRow       item        = dt_Data.Rows[0];
            List <string> novalidates = new List <string>();

            novalidates.Add(String.Empty);
            novalidates.Add(" ");
            novalidates.Add("无");
            novalidates.Add("无数据");
            novalidates.Add("/");

            if (BLLCommon.DataFieldIsNullOrEmpty(novalidates, fields, item, out msg))
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = msg + "不能为空!";
                return(result);
            }

            DataTable dt_zjsbjg = DAL.GetAp_zjsbjg();
            DataRow   row       = dt_zjsbjg.NewRow();

            DataTableHelp.DataRow2DataRow(item, row);
            row["id"]         = Guid.NewGuid();
            row["UpdateTime"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            dt_zjsbjg.Rows.Add(row);
            row["deptcode"]   = deptcode;
            row["sbPassword"] = sbPassword;
            row["UpdateUser"] = user;

            //保存单位工程列表
            DataTable dt_zjsbjg_dwgc = null;

            if (dwgcDt != null && dwgcDt.Rows.Count > 0)
            {
                dt_zjsbjg_dwgc = DAL.GetAp_zjsbjg_dwgc();

                foreach (DataRow dwgcItem in dwgcDt.Rows)
                {
                    DataRow dwgcRow = dt_zjsbjg_dwgc.NewRow();
                    DataTableHelp.DataRow2DataRow(dwgcItem, dwgcRow);
                    dwgcRow["uuid"] = row["uuid"];
                    dt_zjsbjg_dwgc.Rows.Add(dwgcRow);
                }
            }

            if (row["success"].ToString().Equals("Yes") && dt_zjsbjg_dwgc != null)
            {
                DAL.SaveAp_zjsbjg_dwgc(dt_zjsbjg_dwgc);
            }


            if (dt_zjsbjg.Rows.Count > 0)
            {
                if (DAL.SaveAp_zjsbjg(dt_zjsbjg))
                {
                    try
                    {
                        StringBuilder str         = new StringBuilder();
                        string        xmlData     = "";
                        string        dwgcXmlData = string.Empty;
                        //向省一站式申报平台推送质监申报结果
                        DataRow dataRow = dt_zjsbjg.Rows[0];

                        //string[] excludeColumns = new string[] { "id", "deptcode", "sbPassword", "UpdateTime", "UpdateUser" };
                        xmlData = xmlHelper.ConvertDataRowToXML(dataRow);

                        //string[] dwgcExcludeCols = new string[] { "id", "uuid" };
                        List <string> dwgcExcludeCols = new List <string>();
                        dwgcExcludeCols.Add("id");
                        dwgcExcludeCols.Add("uuid");
                        //dwgcXmlData = xmlHelper.ConvertDataTableToXML(dwgcDt, "dwgcList", "dwgccontent");

                        str.Append("<?xml version=\"1.0\" encoding=\"gb2312\"?>");
                        str.AppendFormat("<{0}>", "data");
                        str.AppendFormat("<{0}>", "result");
                        str.Append(xmlData);
                        //单位工程列表
                        if (row["success"].ToString().Equals("Yes"))
                        {
                            if (dwgcDt != null && dwgcDt.Rows.Count > 0)
                            {
                                foreach (DataRow dwgcItem in dwgcDt.Rows)
                                {
                                    str.AppendFormat("<{0}>", "dwgcList");
                                    dwgcXmlData = xmlHelper.ConvertDataRowToXML(dwgcItem, dwgcExcludeCols);
                                    str.Append(dwgcXmlData);
                                    str.AppendFormat("</{0}>", "dwgcList");
                                }
                                str.Append(dwgcXmlData);
                            }
                        }
                        str.AppendFormat("</{0}>", "result");
                        str.AppendFormat("</{0}>", "data");

                        string addResultSt = client.pushZJSBJG(deptcode, sbPassword, str.ToString());
                        //string addResultSt = string.Empty;
                        BLLCommon.WriteLog("deptcode:" + deptcode);
                        BLLCommon.WriteLog("向省一站式申报平台推送质监申报结果:" + str.ToString() + "\n结果:" + addResultSt);
                        BLLCommon.WriteLog("id" + dataRow["id"].ToString());
                        DataTable dt     = DAL.GetTBData_SaveToStLog("Ap_zjsbjg", dataRow["id"].ToString());
                        DataRow   logRow = null;
                        if (dt.Rows.Count > 0)
                        {
                            logRow = dt.Rows[0];
                            logRow["UpdateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                            logRow["TableName"]  = "Ap_zjsbjg";
                        }
                        else
                        {
                            logRow = dt.NewRow();
                            logRow["CreateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                            logRow["UpdateDate"] = logRow["CreateDate"];
                            logRow["TableName"]  = "Ap_zjsbjg";
                            logRow["PKID"]       = dataRow["id"];
                            dt.Rows.Add(logRow);
                        }
                        if (addResultSt != "OK")
                        {
                            logRow["OperateState"] = 1;
                            logRow["Msg"]          = addResultSt;
                            result.code            = ProcessResult.保存失败和失败原因;
                            result.message         = "数据上传省厅失败:" + addResultSt;
                        }
                        else
                        {
                            //更新质监申报结果审批状态
                            if (row["success"].ToString().Equals("Yes"))
                            {
                                updateZJSBStatus(row["uuid"].ToString2(), (int)ApproveStatus.已推送申报结果);
                            }
                            else
                            {
                                updateZJSBStatus(row["uuid"].ToString2(), (int)ApproveStatus.已退回);
                            }

                            logRow["OperateState"] = 0;
                            logRow["Msg"]          = "上传成功";
                            result.code            = ProcessResult.数据保存成功;
                            result.message         = "数据保存成功!";
                        }
                        if (dt.Rows.Count > 0)
                        {
                            DAL.SaveTBData_SaveToStLog(dt);
                        }
                    }
                    catch (Exception ex)
                    {
                        try
                        {
                            BLLCommon.WriteLog(ex.Message);
                        }
                        catch
                        {
                        }
                        result.code    = ProcessResult.保存失败和失败原因;
                        result.message = ex.Message;
                        return(result);
                    }
                }
                else
                {
                    result.code    = ProcessResult.保存失败和失败原因;
                    result.message = "网络故障,数据保存失败!";
                }
            }
            else
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = "非法格式的数据!";
            }
            return(result);
        }
Пример #14
0
        /// <summary>
        /// 向省一站式申报平台推送终止施工安全监督告知书
        /// </summary>
        /// <param name="user"></param>
        /// <param name="deptcode"></param>
        /// <param name="sbPassword"></param>
        /// <param name="dt_Data"></param>
        /// <returns></returns>
        public ProcessResultData pushAJZZGZ(string user, string deptcode, string sbPassword, DataTable dt_Data)
        {
            ProcessResultData result        = new ProcessResultData();
            StringBuilder     prjInnerNumSb = new StringBuilder();

            string msg = String.Empty;

            string[] fields = new string[] { "uuid", "zzyy", "zzrq" };

            DataRow       item        = dt_Data.Rows[0];
            List <string> novalidates = new List <string>();

            novalidates.Add(String.Empty);
            novalidates.Add(" ");
            novalidates.Add("无");
            novalidates.Add("无数据");
            novalidates.Add("/");

            if (BLLCommon.DataFieldIsNullOrEmpty(novalidates, fields, item, out msg))
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = msg + "不能为空!";
                return(result);
            }

            DataTable dt_ajzzgz = DAL.GetApTable(AP_AJZZGZ);
            DataRow   row       = dt_ajzzgz.NewRow();

            DataTableHelp.DataRow2DataRow(item, row);

            row["id"]         = Guid.NewGuid();
            row["UpdateTime"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            dt_ajzzgz.Rows.Add(row);
            row["deptcode"]   = deptcode;
            row["sbPassword"] = sbPassword;
            row["UpdateUser"] = user;

            if (dt_ajzzgz.Rows.Count > 0)
            {
                if (DAL.SaveApTable(AP_AJZZGZ, dt_ajzzgz))
                {
                    try
                    {
                        StringBuilder str     = new StringBuilder();
                        string        xmlData = "";
                        DataRow       dataRow = dt_ajzzgz.Rows[0];

                        //向省一站式申报平台推送安监申报结果
                        List <string> excludeColumns = new List <string>();
                        excludeColumns.Add("id");
                        excludeColumns.Add("deptcode");
                        excludeColumns.Add("sbPassword");
                        excludeColumns.Add("UpdateTime");
                        excludeColumns.Add("UpdateUser");
                        xmlData = xmlHelper.ConvertDataRowToXML(dataRow, excludeColumns);

                        str.Append("<?xml version=\"1.0\" encoding=\"gb2312\"?>");
                        str.AppendFormat("<{0}>", "data");
                        str.AppendFormat("<{0}>", "result");
                        str.Append(xmlData);
                        str.AppendFormat("</{0}>", "result");
                        str.AppendFormat("</{0}>", "data");

                        string addResultSt = client.pushAJZZGZ(deptcode, sbPassword, str.ToString());
                        BLLCommon.WriteLog("deptcode:" + deptcode);
                        BLLCommon.WriteLog("向省一站式申报平台推送终止施工安全监督告知书:" + str.ToString() + "\n结果:" + addResultSt);

                        DataTable dt = DAL.GetTBData_SaveToStLog(AP_AJZZGZ, dataRow["id"].ToString());

                        if (dt.Rows.Count > 0)
                        {
                            row = dt.Rows[0];
                            row["UpdateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                            row["TableName"]  = AP_AJZZGZ;
                        }
                        else
                        {
                            row = dt.NewRow();
                            row["CreateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                            row["UpdateDate"] = row["CreateDate"];
                            row["TableName"]  = AP_AJZZGZ;
                            row["PKID"]       = dataRow["id"];
                            dt.Rows.Add(row);
                        }
                        if (addResultSt != "OK")
                        {
                            row["OperateState"] = 1;
                            row["Msg"]          = addResultSt;
                            result.code         = ProcessResult.保存失败和失败原因;
                            result.message      = "数据上传省厅失败:" + addResultSt;
                        }
                        else
                        {
                            row["OperateState"] = 0;
                            row["Msg"]          = "上传成功";
                            result.code         = ProcessResult.数据保存成功;
                            result.message      = "数据保存成功!";
                        }
                        if (dt.Rows.Count > 0)
                        {
                            DAL.SaveTBData_SaveToStLog(dt);
                        }
                    }
                    catch (Exception ex)
                    {
                        try
                        {
                            BLLCommon.WriteLog(ex.Message);
                        }
                        catch
                        {
                        }
                        result.code    = ProcessResult.保存失败和失败原因;
                        result.message = ex.Message;
                        return(result);
                    }
                }
                else
                {
                    result.code    = ProcessResult.保存失败和失败原因;
                    result.message = "网络故障,数据保存失败!";
                }
            }
            else
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = "非法格式的数据!";
            }
            return(result);
        }
Пример #15
0
        /// <summary>
        /// 向省一站式申报平台推送安监申报结果
        /// </summary>
        /// <param name="user"></param>
        /// <param name="dt_Data"></param>
        /// <returns></returns>
        public ProcessResultData pushAJSBJG(string user, string deptcode, string sbPassword, DataTable dt_Data)
        {
            ProcessResultData result        = new ProcessResultData();
            StringBuilder     prjInnerNumSb = new StringBuilder();

            string msg = String.Empty;

            string[] fields = new string[] { "uuid", "success", "slry", "slrq" };

            DataRow       item        = dt_Data.Rows[0];
            List <string> novalidates = new List <string>();

            novalidates.Add(String.Empty);
            novalidates.Add(" ");
            novalidates.Add("无");
            novalidates.Add("无数据");
            novalidates.Add("/");

            if (BLLCommon.DataFieldIsNullOrEmpty(novalidates, fields, item, out msg))
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = msg + "不能为空!";
                return(result);
            }

            DataTable dt_ajsbjg = DAL.GetAp_ajsbjg();
            DataRow   row       = dt_ajsbjg.NewRow();

            DataTableHelp.DataRow2DataRow(item, row);

            row["id"]         = Guid.NewGuid();
            row["UpdateTime"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            dt_ajsbjg.Rows.Add(row);
            row["deptcode"]   = deptcode;
            row["sbPassword"] = sbPassword;
            row["UpdateUser"] = user;



            if (dt_ajsbjg.Rows.Count > 0)
            {
                if (DAL.SaveAp_ajsbjg(dt_ajsbjg))
                {
                    try
                    {
                        StringBuilder str     = new StringBuilder();
                        string        xmlData = "";
                        DataRow       dataRow = dt_ajsbjg.Rows[0];

                        //向省一站式申报平台推送安监申报结果
                        string[] excludeColumns = new string[] { "id", "deptcode", "", "sbPassword", "UpdateTime", "UpdateUser" };
                        xmlData = xmlHelper.ConvertDataRowToXML(dataRow);

                        str.Append("<?xml version=\"1.0\" encoding=\"gb2312\"?>");
                        str.AppendFormat("<{0}>", "data");
                        str.AppendFormat("<{0}>", "result");
                        str.Append(xmlData);
                        str.AppendFormat("</{0}>", "result");
                        str.AppendFormat("</{0}>", "data");

                        string addResultSt = client.pushAJSBJG(deptcode, sbPassword, str.ToString());
                        BLLCommon.WriteLog("deptcode:" + deptcode);
                        BLLCommon.WriteLog("向省一站式申报平台推送安监申报结果:" + xmlData + "\n结果:" + addResultSt);

                        DataTable dt = DAL.GetTBData_SaveToStLog("Ap_ajsbjg", dataRow["id"].ToString());

                        if (dt.Rows.Count > 0)
                        {
                            row = dt.Rows[0];
                            row["UpdateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                            row["TableName"]  = "Ap_ajsbjg";
                        }
                        else
                        {
                            row = dt.NewRow();
                            row["CreateDate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                            row["UpdateDate"] = row["CreateDate"];
                            row["TableName"]  = "Ap_ajsbjg";
                            row["PKID"]       = dataRow["id"];
                            dt.Rows.Add(row);
                        }
                        if (addResultSt == "未找到申报流水号")
                        {
                            //此申报流水号已删除,标记为已删除
                            deleteAjsbbByUuid(dataRow["uuid"].ToString());
                        }

                        if (addResultSt != "OK")
                        {
                            row["OperateState"] = 1;
                            row["Msg"]          = addResultSt;
                            result.code         = ProcessResult.保存失败和失败原因;
                            result.message      = "上传到省厅失败:" + addResultSt;
                        }
                        else
                        {
                            //更新申报结果审批状态
                            if (dataRow["success"].ToString().Equals("Yes"))
                            {
                                updateAJSBStatus(dataRow["uuid"].ToString2(), (int)ApproveStatus.已推送申报结果);
                            }
                            else
                            {
                                updateAJSBStatus(dataRow["uuid"].ToString2(), (int)ApproveStatus.已退回);
                            }
                            row["OperateState"] = 0;
                            row["Msg"]          = "上传成功";
                            result.code         = ProcessResult.数据保存成功;
                            result.message      = "数据保存成功!";
                        }
                        if (dt.Rows.Count > 0)
                        {
                            DAL.SaveTBData_SaveToStLog(dt);
                        }
                    }
                    catch (Exception ex)
                    {
                        try
                        {
                            BLLCommon.WriteLog(ex.Message);
                        }
                        catch
                        {
                        }
                        result.code    = ProcessResult.保存失败和失败原因;
                        result.message = ex.Message;
                        return(result);
                    }
                }
                else
                {
                    result.code    = ProcessResult.保存失败和失败原因;
                    result.message = "网络故障,数据保存失败!";
                }
            }
            else
            {
                result.code    = ProcessResult.保存失败和失败原因;
                result.message = "非法格式的数据!";
            }
            return(result);
        }