Example #1
0
        /// <summary>
        /// 查询实物库存-总库 第一层
        /// </summary>
        /// <param name="WERKS">工厂名称</param>
        /// <returns></returns>
        public Dictionary <string, object> GetSWKCDW(string ISWZ, string WERKS, string LGPLA, int page, int limit)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt = db.GetSWKCDW(ISWZ, WERKS, LGPLA);
                if (dt.Rows.Count > 0)
                {
                    r["code"]    = 2000;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));//dt
                    r["message"] = "成功!";
                    r["total"]   = dt.Rows.Count;
                }
                else
                {
                    r["code"]    = 2000;
                    r["message"] = "成功!但是没有数据";
                    r["items"]   = new DataTable();//dt
                    r["total"]   = 0;
                }
            }
            catch (Exception e)
            {
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #2
0
        /// <summary>
        /// 重点物资出入库明细-去向明细
        /// </summary>
        /// <param name="MATNR"></param>
        /// <param name="MONTH"></param>
        /// <param name="MATKL"></param>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        public Dictionary <string, object> getZDWZCRKDetail(string MATNR, string MONTH, int page, int limit)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt = db.getZDWZCRKDetail(MATNR, MONTH);
                if (dt.Rows.Count > 0)
                {
                    r["code"]    = 2000;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));//dt
                    r["message"] = "success";
                    r["total"]   = dt.Rows.Count;
                }
                else
                {
                    r["code"]    = 2000;
                    r["message"] = "success,but no info";
                    r["items"]   = new DataTable();//dt
                    r["total"]   = 0;
                }
            }
            catch (Exception e)
            {
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
        public Dictionary <string, object> getTaxComputeconfig(string limit, string page)
        {
            int lit = int.Parse(limit);
            int pa  = int.Parse(page);
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt = db.getTaxComputeconfig();
                if (dt.Rows.Count != 0)
                {
                    r["message"] = "成功";
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, pa, lit));
                    r["code"]    = 2000;
                    r["total"]   = dt.Rows.Count;
                }
                else
                {
                    r["message"] = "成功";
                    r["code"]    = 2000;
                    r["total"]   = 0;
                }
            }
            catch (Exception e)
            {
                r["message"] = e.Message;
                r["code"]    = -1;
            }
            return(r);
        }
Example #4
0
        /// <summary>
        /// 总库存保管员工作量明细查询
        /// </summary>
        /// <param name="nianyue">年月</param>
        /// <param name="TZDType">1 入库单 2 出库单</param>
        /// <param name="workerCode">员工编号</param>
        public Dictionary <string, object> getBGYGZLDetail(string nianyue, string TZDType, string workerCode, int page, int limit)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt = db.getBGYGZLDetail(nianyue, TZDType, workerCode);
                if (dt.Rows.Count > 0)
                {
                    r["code"]    = 2000;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));//dt
                    r["message"] = "成功!";
                    r["total"]   = dt.Rows.Count;
                }
                else
                {
                    r["code"]    = 2000;
                    r["message"] = "成功!,但是没有数据";
                    r["items"]   = new DataTable();//dt
                    r["total"]   = 0;
                }
            }
            catch (Exception e)
            {
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #5
0
        /// <summary>
        /// 重点物资储备查询-分库明细
        /// </summary>
        /// <param name="WERKS"></param>
        /// <param name="DKCODE"></param>
        /// <param name="WERKS_NAME"></param>
        /// <param name="MATNR"></param>
        /// <param name="MATKL"></param>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        public Dictionary <string, object> getDetailZDWZCBTOTALDETAIL(string WERKS, string DKCODE, string WERKS_NAME, string MATNR, string MATKL, int page, int limit)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt = new DataTable();
                dt = db.getDetailZDWZCBTOTALDETAIL(WERKS, DKCODE, WERKS_NAME, MATNR, MATKL);
                if (dt.Rows.Count > 0)
                {
                    r["code"]    = 2000;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));//dt
                    r["message"] = "success";
                    r["total"]   = dt.Rows.Count;
                }
                else
                {
                    r["code"]    = 2000;
                    r["message"] = "success,but no info";
                    r["items"]   = new DataTable();//dt
                    r["total"]   = 0;
                }
            }
            catch (Exception e)
            {
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #6
0
        /// <summary>
        /// 查询积压物资-总库页面
        /// </summary>
        /// <param name="WERKS_NAME">工厂名称</param>
        /// <param name="LGORTNAME">库存地点名称</param>
        /// <param name="MATNR">物料编码</param>
        /// <param name="MATKL">物料组编码</param>
        /// <returns></returns>
        public Dictionary <string, object> GetJYWZ(string DLCODE, string MEINS, string ISWZ, string WERKS, string WERKS_NAME, string LGORTNAME, string MATNR, string MATKL, int page, int limit)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt = db.GetJYWZ(DLCODE, ISWZ, MEINS, WERKS, WERKS_NAME, LGORTNAME, MATNR, MATKL);
                if (dt.Rows.Count > 0)
                {
                    r["code"]    = 2000;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));//dt
                    r["message"] = "成功!";
                    r["total"]   = dt.Rows.Count;
                }
                else
                {
                    r["code"]    = 2000;
                    r["message"] = "成功!但是没有数据";
                    r["items"]   = new DataTable();//dt
                    r["total"]   = 0;
                }
            }
            catch (Exception e)
            {
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #7
0
        /// <summary>
        /// 总库存-查询出库如明细金额
        /// </summary>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <returns></returns>
        public Dictionary <string, object> getCRKDetail(string year, string month, int ISWZ, int page, int limit)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataSet ds = db.getCRKDetail(year, month, ISWZ);
                if (ds.Tables.Count > 0)
                {
                    DataTable dtNew = new DataTable();
                    dtNew.Columns.Add("WERKS_NAME");
                    dtNew.Columns.Add("RKJE");
                    //dtNew.Columns.Add("RKL");
                    dtNew.Columns.Add("CKJE");
                    //dtNew.Columns.Add("CKL");
                    foreach (DataRow rowDKName in ds.Tables["DK_NAME"].Rows)
                    {
                        int       i      = 0;//判断下面是否有数据,有才会add到dtnew里
                        DataRow   newRow = dtNew.NewRow();
                        DataRow[] rowRK  = ds.Tables["RKJE_Detail"].Select("WERKS_NAME='" + rowDKName["WERKS_NAME"] + "'");
                        if (rowRK.Length > 0)
                        {
                            i = 1;
                            newRow["WERKS_NAME"] = rowRK[0]["WERKS_NAME"];
                            newRow["RKJE"]       = rowRK[0]["RKJE"];
                            // newRow["RKL"] = rowRK[0]["RKL"];
                        }
                        rowRK = ds.Tables["CKJE_Detail"].Select("WERKS_NAME='" + rowDKName["WERKS_NAME"] + "'");
                        if (rowRK.Length > 0)
                        {
                            i = 1;
                            newRow["WERKS_NAME"] = rowRK[0]["WERKS_NAME"];
                            newRow["CKJE"]       = rowRK[0]["CKJE"];
                            //      newRow["CKL"] = rowRK[0]["CKL"];
                        }
                        if (i == 1)
                        {
                            dtNew.Rows.Add(newRow);
                        }
                    }
                    r["code"]    = 2000;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dtNew, page, limit));//dt
                    r["message"] = "成功!";
                    r["total"]   = dtNew.Rows.Count;
                }
                else
                {
                    r["code"]    = 2000;
                    r["message"] = "成功!,但是没有数据";
                    r["items"]   = new DataTable();//dt
                    r["total"]   = 0;
                }
            }
            catch (Exception e)
            {
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
        /// <summary>
        /// 获取服务信息
        /// </summary>
        public Dictionary <string, object> fetchServerList(Dictionary <string, object> d)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();
            int    limit = d["limit"] == null ? 100 : int.Parse(d["limit"].ToString());
            int    page  = d["page"] == null ? 1 : int.Parse(d["page"].ToString());
            string name  = d["name"] == null ? "" : d["name"].ToString();

            try
            {
                DataTable dt = db.getServer(name);
                if (dt != null && dt.Rows.Count > 0)
                {
                    r["code"]    = 2000;
                    r["message"] = "";
                    r["total"]   = dt.Rows.Count;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));
                    return(r);
                }
                r["code"]    = 2000;
                r["message"] = "";
                r["total"]   = 0;
                r["items"]   = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(new DataTable()));
            }
            catch (Exception e)
            {
                r["total"]   = 0;
                r["items"]   = new Dictionary <string, object>();
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #9
0
        public Dictionary <string, object> getDepartmentStatus(Dictionary <string, object> d)
        {
            int limit = d["limit"] == null ? 100 : int.Parse(d["limit"].ToString());
            int page  = d["page"] == null ? 1 : int.Parse(d["page"].ToString());
            Dictionary <string, object> r = new Dictionary <string, object>();
            DataTable dt = DB.getDepartmentStatus(d);

            try
            {
                if (dt != null && dt.Rows.Count > 0)
                {
                    r["total"]   = dt.Rows.Count;
                    r["message"] = "成功";
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));
                    r["code"]    = 2000;
                }
                else
                {
                    r["total"]   = 0;
                    r["message"] = "成功";
                    r["code"]    = 2000;
                }
            }
            catch (Exception e)
            {
                r["message"] = e.Message;
                r["code"]    = -1;
            }
            return(r);
        }
Example #10
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, object> fetchSyncConfList(Dictionary <string, object> d)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                //DataTable dt = db.fetchSyncConfList(d);
                //string jsonStr = "";
                //if (dt != null && dt.Rows.Count > 0)
                //{
                //    jsonStr = GetSubMenu("", dt);
                //}
                //r["items"] = JsonConvert.DeserializeObject("["+jsonStr+"]");
                //r["code"] = 2000;
                //r["message"] = "查询成功";

                int limit = d["limit"] == null ? 100 : int.Parse(d["limit"].ToString());
                int page  = d["page"] == null ? 1 : int.Parse(d["page"].ToString());

                DataTable dt = db.fetchSyncConfList(d);
                r["total"]   = dt.Rows.Count;
                r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));
                r["code"]    = 2000;
                r["message"] = "查询成功";
            }
            catch (Exception ex)
            {
                r["items"]   = null;
                r["code"]    = -1;
                r["message"] = ex.Message;
            }
            return(r);
        }
Example #11
0
        public Dictionary <string, object> getSWCRKDetail(string year, string month, string dkcode, string typ, int limit, int page)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt = db.getSWCRKDetail(year, month, dkcode, typ);
                if (dt.Rows.Count > 0)
                {
                    r["code"]    = 2000;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));//dt
                    r["message"] = "成功!";
                    r["total"]   = 0;
                }
                else
                {
                    r["code"]    = 2000;
                    r["message"] = "成功!,但是没有数据";
                    r["items"]   = new DataTable();//dt
                    r["total"]   = 0;
                }
            }
            catch (Exception e)
            {
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #12
0
        public Dictionary <string, object> GetGetFloatWindowDetailInfo(string LGPLA, string DLCODE, string LGORT, string MATNR, string MATKL, int page, int limit)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt = db.GetGetFloatWindowDetailInfo(LGPLA, DLCODE, LGORT, MATNR, MATKL);
                //DataTable dt = db.getZDWZCRKDetail(DKCODE,MATNR, MONTH);
                if (dt.Rows.Count > 0)
                {
                    r["code"]    = 2000;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));//dt
                    r["message"] = "success";
                    r["total"]   = dt.Rows.Count;
                }
                else
                {
                    r["code"]    = 2000;
                    r["message"] = "success,but no info";
                    r["items"]   = new DataTable();//dt
                    r["total"]   = 0;
                }
            }
            catch (Exception e)
            {
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #13
0
        /// <summary>
        /// 查询用户信息
        /// </summary>
        /// <param name="d"></param>
        /// <returns></returns>
        public Dictionary <string, object> fetchUserForLoginList(string limit, string page, string USER_ID)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                int limit1 = limit == null ? 100 : int.Parse(limit);
                int page1  = page == null ? 1 : int.Parse(page);

                DataTable dt = db.fetchUserForLoginList(USER_ID);
                if (dt != null && dt.Rows.Count > 0)
                {
                    r["total"]   = dt.Rows.Count;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page1, limit1));
                    r["code"]    = 2000;
                    r["message"] = "查询成功";
                }
                else
                {
                    r["total"]   = 0;
                    r["items"]   = new Dictionary <string, object>();
                    r["code"]    = 2000;
                    r["message"] = "查询成功";
                }
            }
            catch (Exception e)
            {
                r["total"]   = 0;
                r["items"]   = new Dictionary <string, object>();
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #14
0
        /// <summary>
        /// 查询用户信息(包含组织结构)
        /// </summary>
        /// <param name="d"></param>
        /// <returns></returns>
        public Dictionary <string, object> fetchUserOrgList(Dictionary <string, object> d)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                int limit = d["limit"] == null ? 100 : int.Parse(d["limit"].ToString());
                int page  = d["page"] == null ? 1 : int.Parse(d["page"].ToString());

                DataTable dt = db.fetchUserOrgList(d);
                if (dt != null && dt.Rows.Count > 0)
                {
                    //DataTable dtName = dt.DefaultView.ToTable(true, "USER_ID", "USER_DOMAIN", "USER_NAME", "USER_CODE", "USER_PASS", "PHONE_MOBILE", "PHONE_OFFICE",
                    //    "USER_EMAIL", "USER_IP", "USER_SEX", "FLAG", "AUTHENTICATION_TYPE", "ASSOCIATED_ACCOUNT", "REMARK");
                    //dtName.Columns.Add("orgId");
                    //dtName.Columns.Add("orgName");
                    //foreach (DataRow row in dtName.Rows)
                    //{
                    //    string fengefu = "";
                    //    foreach (DataRow item in dt.Rows)
                    //    {
                    //        if (row["USER_ID"].ToString() == item["USER_ID"].ToString() && item["orgId"] != null && item["orgId"].ToString() != "")
                    //        {
                    //            if (!row["orgId"].ToString().Contains(item["orgId"].ToString()))
                    //            {
                    //                row["orgId"] += fengefu + item["orgId"].ToString();
                    //                row["orgName"] += fengefu + item["orgName"].ToString();
                    //                fengefu = ",";
                    //            }
                    //        }
                    //    }
                    //}
                    //r["total"] = dtName.Rows.Count;
                    //r["items"] = KVTool.TableToListDic(KVTool.GetPagedTable(dtName, page, limit));
                    r["total"]   = dt.Rows.Count;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));
                    r["code"]    = 2000;
                    r["message"] = "查询成功";
                }
                else
                {
                    r["total"]   = 0;
                    r["items"]   = null;
                    r["code"]    = 2000;
                    r["message"] = "查询成功";
                }
            }
            catch (Exception e)
            {
                r["total"]   = 0;
                r["items"]   = null;
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #15
0
        /// <summary>
        /// 查询用户信息
        /// </summary>
        /// <param name="d"></param>
        /// <returns></returns>
        public Dictionary <string, object> fetchUserList(Dictionary <string, object> d)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                int limit = d["limit"] == null ? 100 : int.Parse(d["limit"].ToString());
                int page  = d["page"] == null ? 1 : int.Parse(d["page"].ToString());

                DataTable dt = db.fetchUserList(d);
                if (dt != null && dt.Rows.Count > 0)
                {
                    DataTable dtName = dt.DefaultView.ToTable(true, "USER_ID", "REG_TIME", "USER_NAME", "USER_CODE", "USER_PASS", "PHONE_MOBILE", "PHONE_OFFICE", "USER_EMAIL", "USER_IP", "FLAG", "USER_DOMAIN", "REMARK", "USER_SEX", "USER_ERP");
                    dtName.Columns.Add("ORG_ID");
                    dtName.Columns.Add("ORG_NAME");
                    foreach (DataRow row in dtName.Rows)
                    {
                        string fengefu = "";
                        foreach (DataRow item in dt.Rows)
                        {
                            if (row["USER_ID"].ToString() == item["USER_ID"].ToString() && item["ORG_ID"] != null && item["ORG_ID"].ToString() != "")
                            {
                                if (!row["ORG_ID"].ToString().Contains(item["ORG_ID"].ToString()))
                                {
                                    row["ORG_ID"]   += fengefu + item["ORG_ID"].ToString();
                                    row["ORG_NAME"] += fengefu + item["ORG_NAME"].ToString();
                                    fengefu          = ",";
                                }
                            }
                        }
                    }
                    r["total"]   = dtName.Rows.Count;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dtName, page, limit));
                    r["code"]    = 2000;
                    r["message"] = "查询成功";
                }
                else
                {
                    r["total"]   = dt.Rows.Count;
                    r["items"]   = new Dictionary <string, object>();
                    r["code"]    = 2000;
                    r["message"] = "查询成功";
                }
            }
            catch (Exception e)
            {
                r["total"]   = 0;
                r["items"]   = new Dictionary <string, object>();
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
        public Dictionary <string, object> fetchApplyRecordList(Dictionary <string, object> d)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                int limit = d["limit"] == null ? 100 : int.Parse(d["limit"].ToString());
                int page  = d["page"] == null ? 1 : int.Parse(d["page"].ToString());
                if (d["userId"] == null || d["userId"].ToString() == "")
                {
                    r["total"]       = 0;
                    r["items"]       = null;
                    r["noReadCount"] = 0;
                    r["code"]        = -1;
                    r["message"]     = "查询失败,用户id为空";
                    return(r);
                }
                DataSet ds = db.getApplyRecord(d["userId"].ToString());
                if (ds != null && ds.Tables.Count > 0)
                {
                    DataTable dtDetail = ds.Tables["detail"];
                    DataTable dtNoRead = ds.Tables["noReadCount"];
                    if (dtDetail != null && dtDetail.Rows.Count > 0)
                    {
                        r["total"]       = dtDetail.Rows.Count;
                        r["items"]       = KVTool.TableToListDic(KVTool.GetPagedTable(dtDetail, page, limit));
                        r["noReadCount"] = 0;
                        if (dtNoRead != null && dtNoRead.Rows.Count > 0)
                        {
                            r["noReadCount"] = dtNoRead.Rows[0][0] == null ? 0 : int.Parse(dtNoRead.Rows[0][0].ToString());
                        }
                        r["code"]    = 2000;
                        r["message"] = "success";
                        return(r);
                    }

                    r["noReadCount"] = 0;
                    r["total"]       = 0;
                    r["items"]       = null;
                    r["code"]        = 2000;
                    r["message"]     = "";
                }
            }
            catch (Exception e)
            {
                r["total"]   = 0;
                r["items"]   = new Dictionary <string, object>();
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #17
0
        /// <summary>
        /// 查询用户信息
        /// </summary>
        /// <param name="d"></param>
        /// <returns></returns>
        public Dictionary <string, object> fetchUserLoginList(string limit, string page, string LOGIN_REMARK, string sort)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                int limit1 = limit == null ? 100 : int.Parse(limit);
                int page1  = page == null ? 1 : int.Parse(page);

                DataTable dt = db.fetchUserLoginList(LOGIN_REMARK, sort);
                if (dt != null && dt.Rows.Count > 0)
                {
                    DataTable dtName = dt.DefaultView.ToTable(true, "LOGIN_ID", "LOGIN_CODE", "LOGIN_PASS", "LOGIN_REMARK");
                    dtName.Columns.Add("USER_NAME");
                    foreach (DataRow row in dtName.Rows)
                    {
                        string fengefu = "";
                        foreach (DataRow item in dt.Rows)
                        {
                            if (row["LOGIN_ID"].ToString() == item["LOGIN_ID"].ToString() && item["USER_NAME"] != null && item["USER_NAME"].ToString() != "")
                            {
                                if (!row["USER_NAME"].ToString().Contains(item["USER_NAME"].ToString()))
                                {
                                    row["USER_NAME"] += fengefu + item["USER_NAME"].ToString();
                                    fengefu           = ",";
                                }
                            }
                        }
                    }
                    r["total"]   = dtName.Rows.Count;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dtName, page1, limit1));
                    r["code"]    = 2000;
                    r["message"] = "查询成功";
                }
                else
                {
                    r["total"]   = dt.Rows.Count;
                    r["items"]   = new Dictionary <string, object>();
                    r["code"]    = 2000;
                    r["message"] = "查询成功";
                }
            }
            catch (Exception e)
            {
                r["total"]   = 0;
                r["items"]   = new Dictionary <string, object>();
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #18
0
        public List <Dictionary <string, object> > getSyncConfList()
        {
            List <Dictionary <string, object> > r = new List <Dictionary <string, object> >();

            try
            {
                Dictionary <string, object> d = new Dictionary <string, object>();
                DataTable dt = db.fetchSyncConfList(d);
                r = KVTool.TableToListDic(dt);
                return(r);
            }
            catch (Exception)
            {
                return(null);
            }
        }
Example #19
0
        /// <summary>
        /// 获取系统颜色
        /// </summary>
        /// <param name=""></param>
        /// <returns></returns>

        public Dictionary <string, object> ConfigColor(Dictionary <string, object> d)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt  = db.SysColor(d);
                var       lst = KVTool.TableToListDic(dt);
                r["item"]    = lst[0];
                r["code"]    = 2000;
                r["message"] = "查询成功";
            }
            catch (Exception e)
            {
                r["total"]   = 0;
                r["items"]   = null;
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #20
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        public Dictionary <string, object> fetchSyncResultList(Dictionary <string, object> d)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                int       limit = d["limit"] == null ? 100 : int.Parse(d["limit"].ToString());
                int       page  = d["page"] == null ? 1 : int.Parse(d["page"].ToString());
                DataTable dt    = db.fetchSyncResultList(d);
                r["total"]   = dt.Rows.Count;
                r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));
                r["code"]    = 2000;
                r["message"] = "查询成功";
            }
            catch (Exception ex)
            {
                r["items"]   = null;
                r["code"]    = -1;
                r["message"] = ex.Message;
            }
            return(r);
        }
Example #21
0
        public List <Dictionary <string, object> > fetchSyncOrgList()
        {
            List <Dictionary <string, object> > r = new List <Dictionary <string, object> >();

            try
            {
                DataTable dt = db.fetchOrgList();
                return(KVTool.TableToListDic(dt));
                //r["total"] = dt.Rows.Count;
                //r["items"] = KVTool.TableToListDic(dt);
                //r["code"] = 2000;
                //r["message"] = "查询成功";
            }
            catch (Exception)
            {
                //r["total"] = 0;
                //r["items"] = null;
                //r["code"] = -1;
                //r["message"] = e.Message;
            }
            return(r);
        }
Example #22
0
        /// <summary>
        /// 登录读取配置信息
        /// </summary>
        /// <param name="d">CONF_NAME:配置项Code</param>
        /// <returns></returns>
        public Dictionary <string, object> loginConfig(Dictionary <string, object> d)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt = db.loginConfig(d);
                r["total"] = dt.Rows.Count;
                var lst = KVTool.TableToListDic(dt);
                r["copyright"] = lst[1];
                r["sysname"]   = lst[4];
                //var t = lst[lst.Count - 1];
                var t = lst[0];
                t["CONF_VALUE"] = t["CONF_VALUE"].ToString() == "true" ? 1 : 0;
                r["cloudorg"]   = t;
                List <object> typeList = new List <object>();
                for (int i = 2; i < lst.Count - 1; i++)
                {
                    if (lst[i]["CONF_VALUE"].ToString() == "true")
                    {
                        object obj = new { key = lst[i]["CONF_NAME"], user_code = lst[i]["CONF_CODE"] };
                        typeList.Add(obj);
                    }
                }
                r["itemtype"] = typeList;
                r["code"]     = 2000;
                r["message"]  = "查询成功";
            }
            catch (Exception e)
            {
                r["total"]   = 0;
                r["items"]   = null;
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #23
0
        /// <summary>
        /// 获取单位上报状态
        /// </summary>
        /// <param name="d"></param>
        /// <returns></returns>
        public Dictionary <string, object> getOrgStatus(Dictionary <string, object> d)
        {
            int page  = int.Parse(d["page"].ToString());
            int limit = int.Parse(d["limit"].ToString());
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt = db.getOrgStatus(d);
                if (dt != null && dt.Rows.Count > 0)
                {
                    DataView dv = dt.DefaultView;
                    dv.Sort = "ReportStatus ASC,S_OrgCode";
                    dt      = dv.ToTable();
                }
                if (dt.Rows.Count > 0)
                {
                    r["total"]   = dt.Rows.Count;
                    r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, page, limit));
                    r["message"] = "成功";
                    r["code"]    = 2000;
                }
                else
                {
                    r["total"]   = 0;
                    r["message"] = "成功";
                    r["code"]    = 2000;
                }
            }
            catch (Exception e)
            {
                r["message"] = e.Message;
                r["code"]    = -1;
            }
            return(r);
        }
Example #24
0
        /// <summary>
        /// 获取帖子top
        /// </summary>
        /// <returns></returns>

        public Dictionary <string, object> getTopPost()
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                DataTable dt = db.getTopPost();
                if (dt != null && dt.Rows.Count > 0)
                {
                    if (dt.Rows.Count > 10)
                    {
                        r["items"]   = KVTool.TableToListDic(KVTool.GetPagedTable(dt, 1, 10));
                        r["code"]    = 2000;
                        r["message"] = "查询成功";
                    }
                    else
                    {
                        r["items"]   = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(dt));
                        r["code"]    = 2000;
                        r["message"] = "查询成功";
                    }
                    return(r);
                }
                r["items"]   = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(new DataTable()));
                r["code"]    = 2000;
                r["message"] = "查询成功";
            }

            catch (Exception e)
            {
                r["items"]   = JsonConvert.DeserializeObject(JsonConvert.SerializeObject(new DataTable()));
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }
Example #25
0
        public List <Dictionary <string, object> > fetchRoleMenuList(Dictionary <string, object> sysCode)
        {
            List <Dictionary <string, object> > d = KVTool.TableToListDic(db.fetchRoleMenuList(sysCode));

            return(d);
        }
Example #26
0
        /// <summary>
        /// 查询用户信息(包含角色信息)
        /// </summary>
        /// <param name="d"></param>
        /// <returns></returns>
        public Dictionary <string, object> fetchUserRoleList(Dictionary <string, object> d)
        {
            Dictionary <string, object> r = new Dictionary <string, object>();

            try
            {
                int limit = d["limit"] == null ? 100 : int.Parse(d["limit"].ToString());
                int page  = d["page"] == null ? 1 : int.Parse(d["page"].ToString());

                DataTable dt = db.fetchUserRoleList(d);
                if (dt != null && dt.Rows.Count > 0)
                {
                    // "USER_ID", "REG_TIME", "USER_NAME", "USER_CODE", "USER_ALIAS", "USER_PASS", "PHONE_MOBILE", "PHONE_OFFICE", "PHONE_ORG", "USER_EMAIL", "EMAIL_OFFICE", "USER_IP", "FLAG", "USER_DOMAIN", "REMARK"
                    //"USER_ID", "USER_NAME", "USER_CODE", "PHONE_MOBILE","PHONE_ORG",  "FLAG", "USER_DOMAIN", "REMARK"
                    DataTable dtName = dt.DefaultView.ToTable(true, "USER_ID");
                    DataTable dtrole = KVTool.GetPagedTable(dtName, page, limit);
                    dtrole.Columns.Add("USER_NAME");
                    dtrole.Columns.Add("USER_CODE");
                    dtrole.Columns.Add("PHONE_MOBILE");
                    dtrole.Columns.Add("FLAG");
                    dtrole.Columns.Add("USER_DOMAIN");
                    dtrole.Columns.Add("REMARK");
                    dtrole.Columns.Add("roleId");
                    dtrole.Columns.Add("groupName");
                    foreach (DataRow row in dtrole.Rows)
                    {
                        DataRow[] arr = dt.Select("USER_ID='" + row["USER_ID"].ToString() + "'");
                        if (arr.Length > 0)
                        {
                            row["USER_NAME"]    = arr[0]["USER_NAME"] == null ? "" : arr[0]["USER_NAME"].ToString();
                            row["USER_CODE"]    = arr[0]["USER_CODE"] == null ? "" : arr[0]["USER_CODE"].ToString();
                            row["PHONE_MOBILE"] = arr[0]["PHONE_MOBILE"] == null ? "" : arr[0]["PHONE_MOBILE"].ToString();
                            row["USER_DOMAIN"]  = arr[0]["USER_DOMAIN"] == null ? "" : arr[0]["USER_DOMAIN"].ToString();
                            row["FLAG"]         = arr[0]["FLAG"] == null ? "" : arr[0]["FLAG"].ToString();
                            row["REMARK"]       = arr[0]["REMARK"] == null ? "" : arr[0]["REMARK"].ToString();
                            string fengefu = "";
                            foreach (var item in arr)
                            {
                                if (item["roleId"] != null && item["roleId"].ToString() != "")
                                {
                                    if (!row["roleId"].ToString().Contains(item["roleId"].ToString()))
                                    {
                                        row["roleId"]    += fengefu + item["roleId"].ToString();
                                        row["groupName"] += fengefu + item["groupName"].ToString();
                                        fengefu           = ",";
                                    }
                                }
                            }
                        }
                    }
                    r["total"]   = dtName.Rows.Count;
                    r["items"]   = KVTool.TableToListDic(dtrole);
                    r["code"]    = 2000;
                    r["message"] = "查询成功";
                }
                else
                {
                    r["total"]   = 0;
                    r["items"]   = null;
                    r["code"]    = 2000;
                    r["message"] = "查询成功";
                }
            }
            catch (Exception e)
            {
                r["total"]   = 0;
                r["items"]   = null;
                r["code"]    = -1;
                r["message"] = e.Message;
            }
            return(r);
        }