예제 #1
0
        private static Tb_User GetUser(DataRow dr, Tb_User user)
        {
            if (dr.Table.Columns.Contains("Name"))
            {
                user.Name = dr["Name"].ToString();
            }
            if (dr.Table.Columns.Contains("Birthday"))
            {
                user.Birthday = dr["Birthday"].ToString();
            }

            if (dr.Table.Columns.Contains("Mobile"))
            {
                user.Mobile = dr["Mobile"].ToString();
            }
            if (dr.Table.Columns.Contains("Email"))
            {
                user.Email = dr["Email"].ToString();
            }
            if (dr.Table.Columns.Contains("QQ"))
            {
                user.QQ = dr["QQ"].ToString();
            }
            if (dr.Table.Columns.Contains("QQToken"))
            {
                user.QQToken = dr["QQToken"].ToString();
            }
            if (dr.Table.Columns.Contains("WeChatNum"))
            {
                user.WeChatNum = dr["WeChatNum"].ToString();
            }
            if (dr.Table.Columns.Contains("WeChatToken"))
            {
                user.WeChatToken = dr["WeChatToken"].ToString();
            }
            if (dr.Table.Columns.Contains("NickName"))
            {
                user.NickName = dr["NickName"].ToString();
            }
            if (dr.Table.Columns.Contains("Pwd"))
            {
                user.Pwd = dr["Pwd"].ToString();
            }
            if (dr.Table.Columns.Contains("UserPic"))
            {
                user.UserPic = dr["UserPic"].ToString();
            }
            if (dr.Table.Columns.Contains("Sex"))
            {
                user.Sex = AppGlobal.StrToInt(dr["Sex"].ToString());
            }
            if (dr.Table.Columns.Contains("RegDate"))
            {
                user.RegDate = AppGlobal.StrToDate(dr["RegDate"].ToString());
            }
            return(user);
        }
예제 #2
0
        /// <summary>
        /// 收费动态
        /// </summary>
        /// <returns></returns>
        public string GetChargeDynamic(DataRow row)
        {
            #region
            int iCommID = 0;
            if (row.Table.Columns.Contains("CommID"))
            {
                iCommID = AppGlobal.StrToInt(row["CommID"].ToString());
            }
            string strCommName  = AppGlobal.GetCommName(iCommID);
            string strOrganName = "";

            string strDate   = "";
            string strReText = "";

            decimal iChargeRate1   = 0;
            decimal iChargeRate2   = 0;
            decimal iChargeRate3   = 0;
            int     iFeesCreateNum = 0;
            int     iFeesCancelNum = 0;

            #endregion

            string strSQL = "";
            int    temp   = 3;

            // 项目收费动态
            if (iCommID != 0)
            {
                strSQL = " and CommID = " + iCommID.ToString() + " and datediff(day,StatDate,getdate()) = 1 and StatType = 1 ";
            }
            else
            {
                string organCode = null;

                if (row.Table.Columns.Contains("OrganCode"))
                {
                    organCode = row["OrganCode"].ToString();
                }

                if (string.IsNullOrEmpty(organCode))
                {
                    organCode = "01";
                }

                strOrganName = AppGlobal.GetOrganName4(organCode);

                // 分公司
                if (organCode.Length == 4)
                {
                    temp   = 2;
                    strSQL = " and OrganCode like '" + organCode + "%' and datediff(day,StatDate,getdate()) = 1 and StatType = 2 ";
                }

                // 总公司
                if (organCode.Length == 2)
                {
                    temp   = 1;
                    strSQL = " and datediff(day,StatDate,getdate()) = 1 and StatType = 3 ";
                }
            }

            MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePic Bll = new MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePic();

            DataTable dTable = Bll.GetListFromProc(strSQL).Tables[0];

            if (dTable.Rows.Count > 0)
            {
                DataRow DRow = dTable.Rows[0];

                iChargeRate1 = AppGlobal.StrToDec(DRow["ChargeRate1"].ToString());
                iChargeRate2 = AppGlobal.StrToDec(DRow["ChargeRate2"].ToString());
                iChargeRate3 = AppGlobal.StrToDec(DRow["ChargeRate3"].ToString());

                iFeesCreateNum = AppGlobal.StrToInt(DRow["FeesCreateNum"].ToString());
                iFeesCancelNum = AppGlobal.StrToInt(DRow["FeesCancelNum"].ToString());

                strDate = AppGlobal.StrToDate(DRow["StatDate"].ToString()).ToString("yyyy年MM月dd日");
            }
            DataTable dt = new DataTable();
            dt.Columns.AddRange(new DataColumn[] {
                new DataColumn()
                {
                    ColumnName = dTable.Columns["ChargeRate1"].ColumnName, DataType = dTable.Columns["ChargeRate1"].DataType
                },
                new DataColumn()
                {
                    ColumnName = dTable.Columns["ChargeRate2"].ColumnName, DataType = dTable.Columns["ChargeRate2"].DataType
                },
                new DataColumn()
                {
                    ColumnName = "Info", DataType = typeof(string)
                }
            });
            DataRow resultRow = dt.NewRow();

            if (dTable.Rows.Count > 0)
            {
                DataRow DRow = dTable.Rows[0];
                resultRow["ChargeRate1"] = DRow["ChargeRate1"];
                resultRow["ChargeRate2"] = DRow["ChargeRate2"];
            }
            else
            {
                resultRow["ChargeRate1"] = 0;
                resultRow["ChargeRate2"] = 0;
            }

            dTable.Dispose();

            switch (temp)
            {
            case 3:
                strReText = string.Format(@"【{0}】<br/>1、截止到{1},物管费本月收费率{2}%,本年累计收费率{3}%,以前年度欠费回收率{4}%。<br/>2、截止到{5},本月共有{6}笔审核费用入账,{7}笔费用撤销。",
                                          strCommName, strDate, iChargeRate1.ToString("N2"), iChargeRate2.ToString("N2"), iChargeRate3.ToString("N2"), strDate, iFeesCreateNum.ToString(), iFeesCancelNum.ToString());
                break;

            case 2:
            case 1:
                strReText = string.Format(@"【{0}】<br/>1、截止到{1},物管费本月收费率{2}%,本年累计收费率{3}%,以前年度欠费回收率{4}%。<br/>2、截止到{5},本月共有{6}笔审核费用入账,{7}笔费用撤销。",
                                          strOrganName, strDate, iChargeRate1.ToString("N2"), iChargeRate2.ToString("N2"), iChargeRate3.ToString("N2"), strDate, iFeesCreateNum.ToString(), iFeesCancelNum.ToString());
                break;
            }

            resultRow["Info"] = strReText;
            dt.Rows.Add(resultRow);

            return(JSONHelper.FromString(dt));
        }
예제 #3
0
        /// <summary>
        /// 客服动态
        /// </summary>
        /// <returns></returns>
        public string GetIncidentDynamic(DataRow row)
        {
            #region
            int iCommID = 0;
            if (row.Table.Columns.Contains("CommID"))
            {
                iCommID = AppGlobal.StrToInt(row["CommID"].ToString());
            }
            string userCode = Global_Var.LoginUserCode;
            if (row.Table.Columns.Contains("UserCode"))
            {
                userCode = row["UserCode"].ToString();
            }
            string organCode    = null;
            string strCommName  = AppGlobal.GetCommName(iCommID);
            string strOrganName = "";

            //未分派的报事
            int NoDispIncidentNum = 0;
            //未完结的协调单
            int NoCoordinateIncidentNum = 0;
            //逾期的协调单
            int BeOverdueIncidentNum = 0;

            string strDate   = "";
            string strReText = "";

            int iIncidentNum1 = 0;
            int iIncidentNum2 = 0;
            int iIncidentNum3 = 0;
            int iIncidentNum4 = 0;
            int iIncidentNum5 = 0;

            decimal iIncidentRate1 = 0;
            decimal iIncidentRate2 = 0;
            decimal iIncidentRate3 = 0;
            decimal iIncidentRate4 = 0;
            #endregion

            string strSQL = "";
            int    temp   = 3;

            // 项目客服动态
            if (iCommID != 0)
            {
                strSQL = " and CommID = " + iCommID.ToString() + " and datediff(day,StatDate,getdate()) = 1 and StatType = 1 ";
            }
            else
            {
                if (row.Table.Columns.Contains("OrganCode"))
                {
                    organCode = row["OrganCode"].ToString();
                }

                if (string.IsNullOrEmpty(organCode))
                {
                    organCode = "01";
                }

                strOrganName = AppGlobal.GetOrganName4(organCode);

                // 分公司
                if (organCode.Length == 4)
                {
                    temp   = 2;
                    strSQL = " and OrganCode like '" + organCode + "%' and datediff(day,StatDate,getdate()) = 1 and StatType = 2 ";
                }

                // 总公司
                if (organCode.Length == 2)
                {
                    temp   = 1;
                    strSQL = " and datediff(day,StatDate,getdate()) = 1 and StatType = 3 ";
                }
            }

            MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePic Bll = new MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePic();

            DataTable dTable = Bll.GetListFromProc(strSQL).Tables[0];

            if (dTable.Rows.Count > 0)
            {
                DataRow DRow = dTable.Rows[0];

                NoDispIncidentNum       = AppGlobal.StrToInt(DRow["NoDispIncidentNum"].ToString());
                NoCoordinateIncidentNum = AppGlobal.StrToInt(DRow["NoCoordinateIncidentNum"].ToString());
                BeOverdueIncidentNum    = AppGlobal.StrToInt(DRow["BeOverdueIncidentNum"].ToString());

                iIncidentNum1 = AppGlobal.StrToInt(DRow["IncidentNum1"].ToString());
                iIncidentNum2 = AppGlobal.StrToInt(DRow["IncidentNum2"].ToString());
                iIncidentNum3 = AppGlobal.StrToInt(DRow["IncidentNum3"].ToString());
                iIncidentNum4 = AppGlobal.StrToInt(DRow["IncidentNum4"].ToString());
                iIncidentNum5 = AppGlobal.StrToInt(DRow["IncidentNum5"].ToString());

                iIncidentRate1 = AppGlobal.StrToDec(DRow["IncidentRate1"].ToString());
                iIncidentRate2 = AppGlobal.StrToDec(DRow["IncidentRate2"].ToString());
                iIncidentRate3 = AppGlobal.StrToDec(DRow["IncidentRate3"].ToString());
                iIncidentRate4 = AppGlobal.StrToDec(DRow["IncidentRate4"].ToString());

                strDate = AppGlobal.StrToDate(DRow["StatDate"].ToString()).ToString("yyyy年MM月dd日");
            }
            dTable.Dispose();

            if (string.IsNullOrEmpty(strDate))
            {
                strDate = DateTime.Now.ToString("yyyy年MM月dd日");
            }

            // 读取报时预警信息
            MobileSoft.BLL.HSPR.Bll_Tb_HSPR_TempIncidentWarning Bll3 = new MobileSoft.BLL.HSPR.Bll_Tb_HSPR_TempIncidentWarning();
            DataTable dTable3 = Bll3.GetList(userCode, iCommID).Tables[0];

            string value1 = "";
            string value2 = "";
            string value3 = "";

            if (dTable3.Rows.Count > 0)
            {
                DataRow DRow = dTable3.Rows[0];
                value1 = DRow[0].ToString();
                value2 = DRow[1].ToString();
                value3 = DRow[2].ToString();
            }

            switch (temp)
            {
            case 3:
                strReText = string.Format(@"【{0}】<br/>1、截止到{1},未分派报事{2}件,未完结的派工单{3}件(其中逾期{4}件),未完结的协调单{5}件(其中逾期{6}件);本月派工单完结率{7}%,本年累计{8}%;本月协调单完结率{9}%,本年累计{10}%。<br/>2、{11},共有{12}件报事,其中{13}件未完结。<br/>3、超时预警:已受理未分派超时工单{14}件,已分派未处理超时工单{15}件,已处理未回访超时工单{16}件;",
                                          strCommName, strDate, NoDispIncidentNum.ToString(), iIncidentNum1.ToString(), iIncidentNum2.ToString(), NoCoordinateIncidentNum.ToString(), BeOverdueIncidentNum.ToString(), iIncidentRate1.ToString("N2"), iIncidentRate2.ToString("N2"), iIncidentRate3.ToString("N2"), iIncidentRate4.ToString("N2"), strDate, iIncidentNum4.ToString(), iIncidentNum5.ToString(), value1, value2, value3);
                break;

            case 2:
            case 1:
                strReText = string.Format(@"【{0}】<br/>1、截止到{1},未分派报事{2}件,未完结的派工单{3}件(其中逾期{4}件),未完结的协调单{5}件(其中逾期{6}件);本月派工单完结率{7}%,本年累计{8}%;本月协调单完结率{9}%,本年累计{10}%。<br/>2、{11},共有{12}件报事,其中{13}件未完结。<br/>3、超时预警:已受理未分派超时工单{14}件,已分派未处理超时工单{15}件,已处理未回访超时工单{16}件;",
                                          strOrganName, strDate, NoDispIncidentNum.ToString(), iIncidentNum1.ToString(), iIncidentNum2.ToString(), NoCoordinateIncidentNum.ToString(), BeOverdueIncidentNum.ToString(), iIncidentRate1.ToString("N2"), iIncidentRate2.ToString("N2"), iIncidentRate3.ToString("N2"), iIncidentRate4.ToString("N2"), strDate, iIncidentNum4.ToString(), iIncidentNum5.ToString(), value1, value2, value3);
                break;
            }

            // 客服动态图表统计
            MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicIncidentTypeDeskTop Bll2 = new MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicIncidentTypeDeskTop();
            DataTable dTable2 = Bll2.GetList(organCode, iCommID).Tables[0];

            string chart = JSONHelper.FromDataTable(dTable2);

            return(JSONHelper.FromJsonString(true, "{\"Info\":\"" + strReText + "\", \"Chart\":" + chart + "}"));
        }
예제 #4
0
        private string GetSunPropertyTask(DataRow row)
        {
            if (!row.Table.Columns.Contains("CommunityId") || string.IsNullOrEmpty(row["CommunityId"].AsString()))
            {
                return(new ApiResult(false, "缺少参数CommunityId").toJson());
            }

            var communityId = row["CommunityId"].ToString();
            var community   = GetCommunity(communityId);

            if (community == null)
            {
                return(JSONHelper.FromString(false, "未查询到小区信息"));
            }
            var commID = AppGlobal.StrToInt(community.CommID);

            PubConstant.tw2bsConnectionString  = Global_Fun.Tw2bsConnectionString("1");
            PubConstant.hmWyglConnectionString = GetConnectionStr(community);

            var personCount = 0;
            var safeDate    = "";
            var fireDate    = "";
            var list        = new List <TaskInfo>();

            using (var conn = new SqlConnection(PubConstant.hmWyglConnectionString))
            {
                var sql = @"SELECT COUNT(*) AS COUNT FROM Tb_Sys_RoleData a
                            LEFT JOIN Tb_Sys_Role b ON a.RoleCode = b.RoleCode
                            LEFT JOIN Tb_Sys_Department c ON b.DepCode = c.DepCode
                            LEFT JOIN tb_sys_userrole d ON b.RoleCode = d.RoleCode
                            LEFT JOIN tb_sys_user e ON d.UserCode = e.UserCode
                            WHERE a.CommID = @CommID AND e.IsDelete=0
                            AND DepType = '项目级'";
                // 长城要求首页显示
                sql = "SELECT COUNT(1) FROM Tb_Sys_User WHERE CommID = @CommID";

                sql = @"SELECT  COUNT(DISTINCT(e.USERCODE)  ) AS Number FROM Tb_Sys_RoleData a
                            LEFT JOIN Tb_Sys_Role b ON a.RoleCode = b.RoleCode
                            LEFT JOIN tb_sys_userrole d ON b.RoleCode = d.RoleCode
                            LEFT JOIN tb_sys_user e ON d.UserCode = e.UserCode
                            WHERE a.CommID = @CommID AND e.IsDelete = 0  ";

                personCount = conn.Query <int>(sql, new { CommID = commID }).FirstOrDefault();
            }

            // 安全
            using (var safeConn = new SqlConnection(Global_Fun.BurstConnectionString(commID, Global_Fun.BURST_TYPE_SAFE)))
            {
                // 安全巡更
                var sql = $@"SELECT TOP 1 convert(varchar(20),LastExecuteTime,120) FROM
                            (
                                SELECT BeginTime AS LastExecuteTime FROM Tb_CP_Task_Safe
                                WHERE IsClose=0 AND IsDelete=0 AND BeginTime<=getdate() AND TaskLevelName='安全巡更' AND CommId={commID}
                            ) AS t
                            ORDER BY LastExecuteTime DESC;";

                safeDate = safeConn.Query <string>(sql).FirstOrDefault();
            }

            // 设备
            using (var eqConn = new SqlConnection(Global_Fun.BurstConnectionString(commID, Global_Fun.BURST_TYPE_EQ)))
            {
                var sql = $@"SELECT TOP 1 convert(varchar(20),LastExecuteTime,120) FROM
                            (
                                SELECT TaskBeginTime AS LastExecuteTime FROM Tb_Eq_Task_Inspection
                                WHERE IsClose=0 AND IsDelete=0 AND TaskBeginTime<=getdate() AND IsFireControl=0 AND CommId={commID}
                            ) AS t
                            ORDER BY LastExecuteTime DESC;


                            SELECT TOP 1 convert(varchar(20),LastExecuteTime,120) FROM     
                            (
                                SELECT TaskBeginTime AS LastExecuteTime FROM Tb_Eq_Task_Inspection
                                WHERE IsClose=0 AND IsDelete=0 AND TaskBeginTime<=getdate() AND IsFireControl=1 AND CommId={commID}
                            ) AS t
                            ORDER BY LastExecuteTime DESC;";

                var reader = eqConn.QueryMultiple(sql);
                var eqDate = reader.Read <string>().FirstOrDefault();
                fireDate = reader.Read <string>().FirstOrDefault();

                // 比较安全最大值
                var maxDate = AppGlobal.StrToDate(safeDate) > AppGlobal.StrToDate(fireDate) ? safeDate : fireDate;

                list.Add(new TaskInfo
                {
                    TaskType        = "安全巡检",
                    LastExecuteTime = maxDate ?? "暂无巡检记录"
                });

                list.Add(GetEnvironment(commID));

                list.Add(new TaskInfo
                {
                    TaskType        = "设备巡检",
                    LastExecuteTime = eqDate ?? "暂无巡检记录"
                });
            }
            return(new ApiResult(true, new { PeoCount = personCount, List = list }).toJson());
        }
예제 #5
0
        /// <summary>
        /// 添加出售信息
        /// </summary>
        private string AddSaleInfo(DataRow row)
        {
            #region 参数校验
            if (!row.Table.Columns.Contains("UserId") || string.IsNullOrEmpty(row["UserId"].AsString()))
            {
                return(new ApiResult(false, "缺少参数UserId").toJson());
            }
            if (!row.Table.Columns.Contains("CommunityId") || string.IsNullOrEmpty(row["CommunityId"].AsString()))
            {
                return(new ApiResult(false, "缺少参数CommunityId").toJson());
            }
            if (!row.Table.Columns.Contains("Address") || string.IsNullOrEmpty(row["Address"].AsString()))
            {
                return(new ApiResult(false, "缺少参数Address").toJson());
            }
            if (!row.Table.Columns.Contains("Title") || string.IsNullOrEmpty(row["Title"].AsString()))
            {
                return(new ApiResult(false, "缺少参数Title").toJson());
            }
            if (!row.Table.Columns.Contains("LivingRooms") || string.IsNullOrEmpty(row["LivingRooms"].AsString()))
            {
                return(new ApiResult(false, "缺少参数LivingRooms").toJson());
            }
            if (!row.Table.Columns.Contains("BedRooms") || string.IsNullOrEmpty(row["BedRooms"].AsString()))
            {
                return(new ApiResult(false, "缺少参数BedRooms").toJson());
            }
            if (!row.Table.Columns.Contains("BathRooms") || string.IsNullOrEmpty(row["BathRooms"].AsString()))
            {
                return(new ApiResult(false, "缺少参数BathRooms").toJson());
            }
            if (!row.Table.Columns.Contains("KitchenRooms") || string.IsNullOrEmpty(row["KitchenRooms"].AsString()))
            {
                return(new ApiResult(false, "缺少参数KitchenRooms").toJson());
            }
            if (!row.Table.Columns.Contains("Orientation") || string.IsNullOrEmpty(row["Orientation"].AsString()))
            {
                return(new ApiResult(false, "缺少参数Orientation").toJson());
            }
            if (!row.Table.Columns.Contains("BuildingAge") || string.IsNullOrEmpty(row["BuildingAge"].AsString()))
            {
                return(new ApiResult(false, "缺少参数BuildingAge").toJson());
            }
            if (!row.Table.Columns.Contains("BuildingArea") || string.IsNullOrEmpty(row["BuildingArea"].AsString()))
            {
                return(new ApiResult(false, "缺少参数BuildingArea").toJson());
            }
            if (!row.Table.Columns.Contains("BuildingType") || string.IsNullOrEmpty(row["BuildingType"].AsString()))
            {
                return(new ApiResult(false, "缺少参数BuildingType").toJson());
            }
            if (!row.Table.Columns.Contains("TranRoomTime") || string.IsNullOrEmpty(row["TranRoomTime"].AsString()))
            {
                return(new ApiResult(false, "缺少参数TranRoomTime").toJson());
            }
            if (!row.Table.Columns.Contains("Floor") || string.IsNullOrEmpty(row["Floor"].AsString()))
            {
                return(new ApiResult(false, "缺少参数Floor").toJson());
            }
            if (!row.Table.Columns.Contains("FloorCount") || string.IsNullOrEmpty(row["FloorCount"].AsString()))
            {
                return(new ApiResult(false, "缺少参数FloorCount").toJson());
            }
            if (!row.Table.Columns.Contains("Renovation") || string.IsNullOrEmpty(row["Renovation"].AsString()))
            {
                return(new ApiResult(false, "缺少参数Renovation").toJson());
            }
            if (!row.Table.Columns.Contains("Amount") || string.IsNullOrEmpty(row["Amount"].AsString()))
            {
                return(new ApiResult(false, "缺少参数Amount").toJson());
            }
            if (!row.Table.Columns.Contains("Linkman") || string.IsNullOrEmpty(row["Linkman"].AsString()))
            {
                return(new ApiResult(false, "缺少参数Linkman").toJson());
            }
            if (!row.Table.Columns.Contains("LinkmanTel") || string.IsNullOrEmpty(row["LinkmanTel"].AsString()))
            {
                return(new ApiResult(false, "缺少参数LinkmanTel").toJson());
            }
            if (!row.Table.Columns.Contains("LinkmanSex") || string.IsNullOrEmpty(row["LinkmanSex"].AsString()))
            {
                return(new ApiResult(false, "缺少参数LinkmanSex").toJson());
            }
            if (!row.Table.Columns.Contains("HasElevator") || string.IsNullOrEmpty(row["HasElevator"].AsString()))
            {
                return(new ApiResult(false, "缺少参数HasElevator").toJson());
            }
            if (!row.Table.Columns.Contains("Imgs") || string.IsNullOrEmpty(row["Imgs"].AsString()))
            {
                return(new ApiResult(false, "缺少参数Imgs").toJson());
            }

            #endregion

            var title       = row["Title"].ToString();
            var userId      = row["UserId"].ToString();
            var communityId = row["CommunityId"].ToString();
            var address     = row["Address"].ToString();

            var livingRooms  = AppGlobal.StrToInt(row["LivingRooms"].ToString());
            var bedRooms     = AppGlobal.StrToInt(row["BedRooms"].ToString());
            var bathRooms    = AppGlobal.StrToInt(row["BathRooms"].ToString());
            var kitchenRooms = AppGlobal.StrToInt(row["KitchenRooms"].ToString());

            var buildingAge  = AppGlobal.StrToInt(row["BuildingAge"].ToString());
            var buildingType = row["BuildingType"].ToString();
            var buildingArea = AppGlobal.StrToDec(row["BuildingArea"].ToString());
            var tranRoomTime = AppGlobal.StrToDate(row["TranRoomTime"].ToString());
            var orientation  = row["Orientation"].ToString();
            var floor        = row["Floor"].ToString();
            var floorCount   = AppGlobal.StrToInt(row["FloorCount"].ToString());
            var bussType     = "出售";
            var renovation   = row["Renovation"].ToString();
            var amount       = AppGlobal.StrToDec(row["Amount"].ToString());
            var linkman      = row["Linkman"].ToString();
            var linkmanTel   = row["LinkmanTel"].ToString();
            var linkmanSex   = AppGlobal.StrToInt(row["LinkmanSex"].ToString());
            var hasElevator  = AppGlobal.StrToInt(row["HasElevator"].ToString());
            var imgs         = row["Imgs"].ToString();

            var description = default(string);
            if (row.Table.Columns.Contains("Description") && !string.IsNullOrEmpty(row["Description"].AsString()))
            {
                description = row["Description"].AsString();
            }

            var community = GetCommunity(communityId);
            if (community == null)
            {
                return(JSONHelper.FromString(false, "未查询到小区信息"));
            }

            using (var conn = new SqlConnection(PubConstant.UnifiedContionString))
            {
                conn.Open();

                var trans = conn.BeginTransaction();

                try
                {
                    var iid = Guid.NewGuid().ToString();
                    var sql = @"INSERT INTO Tb_Rental(Id,CommunityId,Address,UserId,Title,BussType,Province,City,Area,
                                    BuildingAge,BuildingArea,BuildingType,Floor,FloorCount,LivingRooms,BedRooms,
                                    BathRooms,KitchenRooms,Orientation,TranRoomTime,
                                    Renovation,Amount,Description,Img,LinkMan,LinkManTel,LinkManSex,PubDate,HasElevator,RegisterDate,InformationSource)
                                VALUES(@Id,@CommunityId,@Address,@UserId,@Title,@BussType,@Province,@City,@Area,
                                    @BuildingAge,@BuildingArea,@BuildingType,@Floor,@FloorCount,@LivingRooms,@BedRooms,
                                    @BathRooms,@KitchenRooms,@Orientation,@TranRoomTime,
                                    @Renovation,@Amount,@Description,@Img,@LinkMan,@LinkManTel,@LinkManSex,getdate(),@HasElevator,GETDATE(),'客户线上提交');";

                    var i = conn.Execute(sql, new
                    {
                        Id           = iid,
                        CommunityId  = community.Id,
                        Address      = address,
                        UserId       = userId,
                        Title        = title,
                        BussType     = bussType,
                        Province     = community.Province,
                        City         = community.City,
                        Area         = community.Area,
                        LivingRooms  = livingRooms,
                        BedRooms     = bedRooms,
                        BathRooms    = bathRooms,
                        KitchenRooms = kitchenRooms,
                        BuildingAge  = buildingAge,
                        BuildingArea = buildingArea,
                        BuildingType = buildingType,
                        Floor        = floor,
                        FloorCount   = floorCount,
                        Orientation  = orientation,
                        TranRoomTime = tranRoomTime,
                        Renovation   = renovation,
                        Amount       = amount,
                        Description  = description,
                        Img          = imgs,
                        LinkMan      = linkman,
                        LinkManTel   = linkmanTel,
                        LinkManSex   = linkmanSex,
                        HasElevator  = hasElevator
                    }, trans);

                    if (i == 1)
                    {
                        // 读取标签信息
                        var tags = (JArray)JsonConvert.DeserializeObject(row["Tags"].ToString());

                        foreach (var item in tags)
                        {
                            sql = @"INSERT INTO Tb_Rental_RoomTag(RentalID,CategoryID,Tags)
                                    VALUES(@RentalID,@CategoryID,@Tags);";

                            conn.Execute(sql, new
                            {
                                RentalID   = iid,
                                CategoryID = item["ID"].ToString(),
                                Tags       = string.Join(",", ((JArray)item["Tags"]).ToArray().Select(obj => obj.ToString()))
                            }, trans);
                        }
                    }

                    trans.Commit();
                    return(JSONHelper.FromString(true, "添加成功"));
                }
                catch (Exception ex)
                {
                    trans.Rollback();
                    return(JSONHelper.FromString(false, ex.Message));
                }
            }
        }
예제 #6
0
        public string GetDynamic(DataRow row, string Type)
        {
            String        result    = "";
            StringBuilder strReText = new StringBuilder("");

            #region 变量定义
            //int iCommID = AppGlobal.StrToInt(Global_Var.LoginCommID);
            int iCommID = 0;
            if (row.Table.Columns.Contains("CommID"))
            {
                iCommID = AppGlobal.StrToInt(row["CommID"].ToString());
            }
            string  strCommName       = AppGlobal.GetCommName(iCommID);
            string  strOrganName      = AppGlobal.GetOrganName4(Global_Var.LoginOrganCorp);
            string  strDate           = "";
            string  strPark           = "";
            string  strRoomState      = "";
            string  strOrganParkList  = "";
            string  strStateList      = "";
            string  strParkList       = "";
            string  strOrganDate      = "";
            string  strOrganRoomState = "";
            string  strOrganPark      = "";
            string  strOrganStateList = "";
            decimal iAllArea          = 0;
            decimal iOrganAllArea     = 0;
            decimal iChargeRate1      = 0;
            decimal iChargeRate2      = 0;
            decimal iChargeRate3      = 0;

            int iRoomNum4      = 0;
            int iRoomNum5      = 0;
            int iRoomNum6      = 0;
            int iFeesCreateNum = 0;
            int iFeesCancelNum = 0;

            int iIncidentNum1 = 0;
            int iIncidentNum2 = 0;
            int iIncidentNum3 = 0;
            int iIncidentNum4 = 0;
            int iIncidentNum5 = 0;

            decimal iIncidentRate1 = 0;
            decimal iIncidentRate2 = 0;
            decimal iIncidentRate3 = 0;
            decimal iIncidentRate4 = 0;
            #endregion

            // 项目
            if (iCommID != 0)
            {
                string strSQL = " CommID = " + iCommID.ToString() + " and datediff(day,StatDate,getdate()) = 1 and StatType = 1 ";

                MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePic Bll = new MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePic();

                //DataTable dTable = Bll.GetList(strSQL, "RoomNum4,RoomNum5,RoomNum6,ChargeRate1,ChargeRate2,ChargeRate3,FeesCreateNum,FeesCancelNum,AllArea,StatDate,IncidentNum1,IncidentNum2,IncidentNum3,IncidentNum4,IncidentNum5,IncidentRate1,IncidentRate2,IncidentRate3,IncidentRate4").Tables[0];
                DataTable dTable = Bll.GetList(1000, strSQL, "CommID").Tables[0];
                if (dTable.Rows.Count > 0)
                {
                    DataRow DRow = dTable.Rows[0];
                    iRoomNum4      = AppGlobal.StrToInt(DRow["RoomNum4"].ToString());
                    iRoomNum5      = AppGlobal.StrToInt(DRow["RoomNum5"].ToString());
                    iRoomNum6      = AppGlobal.StrToInt(DRow["RoomNum6"].ToString());
                    iChargeRate1   = AppGlobal.StrToDec(DRow["ChargeRate1"].ToString());
                    iChargeRate2   = AppGlobal.StrToDec(DRow["ChargeRate2"].ToString());
                    iChargeRate3   = AppGlobal.StrToDec(DRow["ChargeRate3"].ToString());
                    iFeesCreateNum = AppGlobal.StrToInt(DRow["FeesCreateNum"].ToString());
                    iFeesCancelNum = AppGlobal.StrToInt(DRow["FeesCancelNum"].ToString());
                    iAllArea       = AppGlobal.StrToDec(DRow["AllArea"].ToString());
                    strDate        = AppGlobal.StrToDate(DRow["StatDate"].ToString()).ToString("yyyy年MM月dd日");

                    iIncidentNum1 = AppGlobal.StrToInt(DRow["IncidentNum1"].ToString());
                    iIncidentNum2 = AppGlobal.StrToInt(DRow["IncidentNum2"].ToString());
                    iIncidentNum3 = AppGlobal.StrToInt(DRow["IncidentNum3"].ToString());
                    iIncidentNum4 = AppGlobal.StrToInt(DRow["IncidentNum4"].ToString());
                    iIncidentNum5 = AppGlobal.StrToInt(DRow["IncidentNum5"].ToString());

                    iIncidentRate1 = AppGlobal.StrToDec(DRow["IncidentRate1"].ToString());
                    iIncidentRate2 = AppGlobal.StrToDec(DRow["IncidentRate2"].ToString());
                    iIncidentRate3 = AppGlobal.StrToDec(DRow["IncidentRate3"].ToString());
                    iIncidentRate4 = AppGlobal.StrToDec(DRow["IncidentRate4"].ToString());
                }

                #region 房屋状态
                string strSQL2 = " CommID = " + iCommID.ToString() + " and datediff(day,StatDate,getdate()) = 1 and StatType = 1 ";
                MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicRoomState BllState = new MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicRoomState();
                DataTable dTable2 = BllState.GetList(strSQL2).Tables[0];
                if (dTable2.Rows.Count > 0)
                {
                    strRoomState = ",其中";
                }
                else
                {
                    strRoomState = "。";
                }

                foreach (DataRow DRow in dTable2.Rows)
                {
                    string strStateName = DRow["StateName"].ToString();
                    if (strStateName == "")
                    {
                        strStateName = "[无]";
                    }

                    if (strStateList != "")
                    {
                        strStateList = strStateList + "," + strStateName + "" + DRow["Counts"].ToString() + "" + "套";
                    }
                    else
                    {
                        strStateList = strStateName + "" + DRow["Counts"].ToString() + "" + "套";
                    }
                }

                if (strStateList != "")
                {
                    strRoomState = strRoomState + strStateList + "。";
                }

                dTable2.Dispose();
                #endregion

                #region 车位数
                string strSQL3 = " CommID = " + iCommID.ToString() + " and datediff(day,StatDate,getdate()) = 1 and StatType = 1 ";

                MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicPark BllPark = new MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicPark();

                DataTable dTable3 = BllPark.GetList(strSQL3).Tables[0];

                if (dTable3.Rows.Count > 0)
                {
                    strPark = "车位:";
                }
                else
                {
                    strPark = "无车位信息";
                }


                foreach (DataRow DRow in dTable3.Rows)
                {
                    string strParkTypeName = DRow["ParkTypeName"].ToString();

                    if (strParkTypeName == "")
                    {
                        strParkTypeName = "[无]";
                    }

                    if (strParkList != "")
                    {
                        strParkList = strParkList + "," + strParkTypeName + "" + DRow["Counts"].ToString() + "" + "个";
                    }
                    else
                    {
                        strParkList = strParkTypeName + "" + DRow["Counts"].ToString() + "" + "个";
                    }
                }

                if (strParkList != "")
                {
                    strPark = strPark + strParkList + "。";
                }
                dTable3.Dispose();
                #endregion

                #region 设置社区


                switch (Type)
                {
                case "1":
                    //获取资源动态
                    strReText.Append("【" + strCommName + "】<br/>");
                    strReText.Append("1、截止到" + strDate + ",可收物管费面积共" + iAllArea.ToString() + "平方米" + strRoomState + "<br/>2、截止到" + strDate + "," + strPark + "<br/>");
                    strReText.Append("3、" + strDate + "共有" + iRoomNum4.ToString() + "套办理转让," + iRoomNum5.ToString() + "套办理租赁," + iRoomNum6.ToString() + "套车位办理转让。");
                    break;

                case "2":
                    //收费动态
                    strReText.Append("【" + strCommName + "】<br/>");
                    strReText.Append("1、截止到" + strDate + ",物管费本月收费率" + iChargeRate1.ToString("N2") + "%,本年累计收费率" + iChargeRate2.ToString("N2") + "%,以前年度欠费回收率" + iChargeRate3.ToString("N2") + "%。" + "<br/>");
                    strReText.Append("2、" + strDate + ",共有" + iFeesCreateNum.ToString() + "笔审核费用入账," + iFeesCancelNum.ToString() + "笔费用撤销。");

                    break;

                case "3":
                    //客服动态
                    strReText.Append("【" + strCommName + "】<br/>");
                    strReText.Append("1、截止到" + strDate + ",未完结的派工单" + iIncidentNum1.ToString() + "件(其中逾期" + iIncidentNum2.ToString() + "件),超过60天未完结的协调单" + iIncidentNum3.ToString() + "件;本月派工单完结率" + iIncidentRate1.ToString("N2") + "%,本年累计" + iIncidentRate2.ToString("N2") + "%;本月协调单完结率" + iIncidentRate3.ToString("N2") + "%,本年累计" + iIncidentRate4.ToString("N2") + "%。<br/>");
                    strReText.Append("2、" + strDate + ",共有" + iIncidentNum4.ToString() + "件报事,其中" + iIncidentNum5.ToString() + "件未完结;<br/>");
                    break;
                }
                #endregion
            }

            else
            {
                #region
                if (Global_Var.LoginOrganCode == "" || Global_Var.LoginOrganCode == "01")
                {
                    #region 集团

                    #region 集团
                    string strSQLOrgan = " datediff(day,StatDate,getdate()) = 1 and StatType = 3 ";

                    MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePic Bll = new MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePic();
                    DataTable dTableOrgan = Bll.GetList(strSQLOrgan, "AllArea,StatDate,ChargeRate1,ChargeRate2,ChargeRate3,IncidentNum1,IncidentNum2,IncidentNum3,IncidentNum4,IncidentNum5,IncidentRate1,IncidentRate2,IncidentRate3,IncidentRate4").Tables[0];
                    // DataTable dTableOrgan = Bll.GetList(strSQLOrgan).Tables[0];
                    decimal iOrganChargeRate1   = 0;
                    decimal iOrganChargeRate2   = 0;
                    decimal iOrganChargeRate3   = 0;
                    int     iOrganIncidentNum1  = 0;
                    int     iOrganIncidentNum2  = 0;
                    int     iOrganIncidentNum3  = 0;
                    int     iOrganIncidentNum4  = 0;
                    int     iOrganIncidentNum5  = 0;
                    decimal iOrganIncidentRate1 = 0;
                    decimal iOrganIncidentRate2 = 0;
                    decimal iOrganIncidentRate3 = 0;
                    decimal iOrganIncidentRate4 = 0;
                    if (dTableOrgan.Rows.Count > 0)
                    {
                        DataRow DRow = dTableOrgan.Rows[0];
                        iOrganAllArea = AppGlobal.StrToDec(DRow["AllArea"].ToString());
                        strOrganDate  = AppGlobal.StrToDate(DRow["StatDate"].ToString()).ToString("yyyy年MM月dd日");

                        iOrganChargeRate1 = AppGlobal.StrToDec(DRow["ChargeRate1"].ToString());
                        iOrganChargeRate2 = AppGlobal.StrToDec(DRow["ChargeRate2"].ToString());
                        iOrganChargeRate3 = AppGlobal.StrToDec(DRow["ChargeRate3"].ToString());

                        iOrganIncidentNum1 = AppGlobal.StrToInt(DRow["IncidentNum1"].ToString());
                        iOrganIncidentNum2 = AppGlobal.StrToInt(DRow["IncidentNum2"].ToString());
                        iOrganIncidentNum3 = AppGlobal.StrToInt(DRow["IncidentNum3"].ToString());
                        iOrganIncidentNum4 = AppGlobal.StrToInt(DRow["IncidentNum4"].ToString());
                        iOrganIncidentNum5 = AppGlobal.StrToInt(DRow["IncidentNum5"].ToString());

                        iOrganIncidentRate1 = AppGlobal.StrToDec(DRow["IncidentRate1"].ToString());
                        iOrganIncidentRate2 = AppGlobal.StrToDec(DRow["IncidentRate2"].ToString());
                        iOrganIncidentRate3 = AppGlobal.StrToDec(DRow["IncidentRate3"].ToString());
                        iOrganIncidentRate4 = AppGlobal.StrToDec(DRow["IncidentRate4"].ToString());
                    }
                    dTableOrgan.Dispose();
                    #endregion

                    #region 房屋状态(集团)
                    string strSQLOrgan2 = " OrganCode like '" + Global_Var.LoginOrganCorp + "%' and datediff(day,StatDate,getdate()) = 1 and StatType = 3 ";

                    MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicRoomState BllState = new MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicRoomState();

                    DataTable dTableOrgan2 = BllState.GetList(strSQLOrgan2).Tables[0];
                    if (dTableOrgan2.Rows.Count > 0)
                    {
                        strOrganRoomState = ",其中";
                    }
                    else
                    {
                        strOrganRoomState = "。";
                    }
                    foreach (DataRow DRow in dTableOrgan2.Rows)
                    {
                        string strStateName = DRow["StateName"].ToString();
                        if (strStateName == "")
                        {
                            strStateName = "[无]";
                        }

                        if (strOrganStateList != "")
                        {
                            strOrganStateList = strOrganStateList + "," + strStateName + "" + DRow["Counts"].ToString() + "" + "套";
                        }
                        else
                        {
                            strOrganStateList = strStateName + "" + DRow["Counts"].ToString() + "" + "套";
                        }
                    }
                    if (strOrganStateList != "")
                    {
                        strOrganRoomState = strOrganRoomState + strOrganStateList + "。";
                    }
                    dTableOrgan2.Dispose();
                    #endregion

                    #region 车位数(集团)
                    string strSQLOrgan3 = " OrganCode like '" + Global_Var.LoginOrganCorp + "%' and datediff(day,StatDate,getdate()) = 1 and StatType = 3 ";
                    MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicPark BllPark = new MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicPark();
                    DataTable dTableOrgan3 = BllPark.GetList(strSQLOrgan3).Tables[0];
                    if (dTableOrgan3.Rows.Count > 0)
                    {
                        strOrganPark = "车位:";
                    }
                    else
                    {
                        strOrganPark = "无车位信息";
                    }
                    foreach (DataRow DRow in dTableOrgan3.Rows)
                    {
                        string strParkTypeName = DRow["ParkTypeName"].ToString();
                        if (strParkTypeName == "")
                        {
                            strParkTypeName = "[无]";
                        }

                        if (strOrganParkList != "")
                        {
                            strOrganParkList = strOrganParkList + "," + strParkTypeName + "" + DRow["Counts"].ToString() + "" + "个";
                        }
                        else
                        {
                            strOrganParkList = strParkTypeName + "" + DRow["Counts"].ToString() + "" + "个";
                        }
                    }
                    if (strOrganParkList != "")
                    {
                        strOrganPark = strOrganPark + strOrganParkList + "。";
                    }
                    dTableOrgan3.Dispose();
                    #endregion

                    #region 设置集团

                    switch (Type)
                    {
                    case "1":
                        strReText.Append("1、截止到" + strOrganDate + ",可收物管费面积共" + iOrganAllArea.ToString() + "平方米" + strOrganRoomState + "<br/>2、截止到" + strOrganDate + "," + strOrganPark);
                        break;

                    case "2":
                        strReText.Append("截止到" + strOrganDate + ":<br/>1、物管费本月收费率" + iOrganChargeRate1.ToString("N2") + "%;<br/>2、本年累计收费率" + iOrganChargeRate2.ToString("N2") + "%;<br/>3、以前年度欠费回收率" + iOrganChargeRate3.ToString("N2") + "%。");

                        break;

                    case "3":
                        strReText.Append("1、截止到" + strOrganDate + ",未完结的派工单" + iOrganIncidentNum1.ToString() + "件(其中逾期" + iOrganIncidentNum2.ToString() + "件),超过60天未完结的协调单" + iOrganIncidentNum3.ToString() + "件;<br/>2、本月派工单完结率" + iOrganIncidentRate1.ToString("N2") + "%,本年累计" + iOrganIncidentRate2.ToString("N2") + "%;本月协调单完结率" + iOrganIncidentRate3.ToString("N2") + "%,本年累计" + iOrganIncidentRate4.ToString("N2") + "%;<br/>");
                        break;
                    }

                    #endregion
                    #endregion
                }
                else
                {
                    #region 公司

                    #region 地区公司
                    string strSQLOrgan = " OrganCode like '" + Global_Var.LoginOrganCorp + "%' and datediff(day,StatDate,getdate()) = 1 and StatType = 2 ";

                    MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePic Bll = new MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePic();
                    decimal iOrganChargeRate1 = 0;
                    decimal iOrganChargeRate2 = 0;
                    decimal iOrganChargeRate3 = 0;

                    int iOrganIncidentNum1 = 0;
                    int iOrganIncidentNum2 = 0;
                    int iOrganIncidentNum3 = 0;
                    int iOrganIncidentNum4 = 0;

                    decimal   iOrganIncidentRate1 = 0;
                    decimal   iOrganIncidentRate2 = 0;
                    decimal   iOrganIncidentRate3 = 0;
                    decimal   iOrganIncidentRate4 = 0;
                    DataTable dTableOrgan         = Bll.GetList(strSQLOrgan, "AllArea,StatDate,ChargeRate1,ChargeRate2,ChargeRate3,IncidentNum1,IncidentNum2,IncidentNum3,IncidentNum4,IncidentRate1,IncidentRate2,IncidentRate3,IncidentRate4").Tables[0];
                    if (dTableOrgan.Rows.Count > 0)
                    {
                        #region 取值
                        DataRow DRow = dTableOrgan.Rows[0];
                        iOrganAllArea     = AppGlobal.StrToDec(DRow["AllArea"].ToString());
                        strOrganDate      = AppGlobal.StrToDate(DRow["StatDate"].ToString()).ToString("yyyy年MM月dd日");
                        iOrganChargeRate1 = AppGlobal.StrToDec(DRow["ChargeRate1"].ToString());
                        iOrganChargeRate2 = AppGlobal.StrToDec(DRow["ChargeRate2"].ToString());
                        iOrganChargeRate3 = AppGlobal.StrToDec(DRow["ChargeRate3"].ToString());

                        iOrganIncidentNum1 = AppGlobal.StrToInt(DRow["IncidentNum1"].ToString());
                        iOrganIncidentNum2 = AppGlobal.StrToInt(DRow["IncidentNum2"].ToString());
                        iOrganIncidentNum3 = AppGlobal.StrToInt(DRow["IncidentNum3"].ToString());
                        iOrganIncidentNum4 = AppGlobal.StrToInt(DRow["IncidentNum4"].ToString());

                        iOrganIncidentRate1 = AppGlobal.StrToDec(DRow["IncidentRate1"].ToString());
                        iOrganIncidentRate2 = AppGlobal.StrToDec(DRow["IncidentRate2"].ToString());
                        iOrganIncidentRate3 = AppGlobal.StrToDec(DRow["IncidentRate3"].ToString());
                        iOrganIncidentRate4 = AppGlobal.StrToDec(DRow["IncidentRate4"].ToString());

                        #endregion
                    }

                    dTableOrgan.Dispose();
                    #endregion

                    #region 房屋状态(地区公司)
                    string strSQLOrgan2 = " OrganCode like '" + Global_Var.LoginOrganCorp + "%' and datediff(day,StatDate,getdate()) = 1 and StatType = 2 ";
                    MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicRoomState BllState = new MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicRoomState();
                    DataTable dTableOrgan2 = BllState.GetList(strSQLOrgan2).Tables[0];
                    if (dTableOrgan2.Rows.Count > 0)
                    {
                        strOrganRoomState = ",其中";
                    }
                    else
                    {
                        strOrganRoomState = "。";
                    }


                    foreach (DataRow DRow in dTableOrgan2.Rows)
                    {
                        string strStateName = DRow["StateName"].ToString();
                        if (strStateName == "")
                        {
                            strStateName = "[无]";
                        }

                        if (strOrganStateList != "")
                        {
                            strOrganStateList = strOrganStateList + "," + strStateName + "" + DRow["Counts"].ToString() + "" + "套";
                        }
                        else
                        {
                            strOrganStateList = strStateName + "" + DRow["Counts"].ToString() + "" + "套";
                        }
                    }

                    if (strOrganStateList != "")
                    {
                        strOrganRoomState = strOrganRoomState + strOrganStateList + "。";
                    }

                    dTableOrgan2.Dispose();
                    #endregion

                    #region 车位数(地区公司)
                    string strSQLOrgan3 = " OrganCode like '" + Global_Var.LoginOrganCorp + "%' and datediff(day,StatDate,getdate()) = 1 and StatType = 2  ";
                    MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicPark BllPark = new MobileSoft.BLL.Sys.Bll_Tb_Sys_TakePicPark();
                    DataTable dTableOrgan3 = BllPark.GetList(strSQLOrgan3).Tables[0];
                    if (dTableOrgan3.Rows.Count > 0)
                    {
                        strOrganPark = "车位:";
                    }
                    else
                    {
                        strOrganPark = "无车位信息";
                    }
                    foreach (DataRow DRow in dTableOrgan3.Rows)
                    {
                        string strParkTypeName = DRow["ParkTypeName"].ToString();
                        if (strParkTypeName == "")
                        {
                            strParkTypeName = "[无]";
                        }
                        if (strOrganParkList != "")
                        {
                            strOrganParkList = strOrganParkList + "," + strParkTypeName + "" + DRow["Counts"].ToString() + "" + "个";
                        }
                        else
                        {
                            strOrganParkList = strParkTypeName + "" + DRow["Counts"].ToString() + "" + "个";
                        }
                    }
                    if (strOrganParkList != "")
                    {
                        strOrganPark = strOrganPark + strOrganParkList + "。";
                    }
                    dTableOrgan3.Dispose();
                    #endregion

                    #region 设置地区公司
                    switch (Type)
                    {
                    case "1":
                        strReText.Append("1、截止到" + strOrganDate + ",可收物管费面积共" + iOrganAllArea.ToString() + "平方米" + strOrganRoomState + "<br/>2、截止到" + strOrganDate + "," + strOrganPark);
                        break;

                    case "2":
                        strReText.Append("截止到" + strOrganDate + ",物管费本月收费率" + iOrganChargeRate1.ToString("N2") + "%,本年累计收费率" + iOrganChargeRate2.ToString("N2") + "%,以前年度欠费回收率" + iOrganChargeRate3.ToString("N2") + "%。");
                        break;

                    case "3":
                        strReText.Append("1、截止到" + strOrganDate + ",未完结的派工单" + iOrganIncidentNum1.ToString() + "件(其中逾期" + iOrganIncidentNum2.ToString() + "件),超过60天未完结的协调单" + iOrganIncidentNum3.ToString() + "件;<br/>2、本月派工单完结率" + iOrganIncidentRate1.ToString("N2") + "%,本年累计" + iOrganIncidentRate2.ToString("N2") + "%;本月协调单完结率" + iOrganIncidentRate3.ToString("N2") + "%,本年累计" + iOrganIncidentRate4.ToString("N2") + "%;<br/>");
                        break;
                    }
                    #endregion

                    #endregion
                }
                #endregion
            }

            if (strReText.ToString().Trim() == "")
            {
                result = "暂无内容";
            }
            else
            {
                result = JSONHelper.FromString(true, strReText.ToString());
            }
            return(result);
        }