public string GetWorkPlanBars(string plan, string ViewName)
        {
            GetWorkplanBars PlanInfo = new GetWorkplanBars();
            DataTable       table    = PlanInfo.GetPlanBars(plan, ViewName);

            return(PMPublicFuncs.DatatableToJson(table));
        }
Exemple #2
0
        public string GetLog()
        {
            //获取日志,返回数据
            Loglist list = new Loglist();

            return(PMPublicFuncs.DatatableToJson(list.Getlist()));
        }
        /// <summary>
        /// 获取设备利用率
        /// </summary>
        /// <param name="resName">线体名称</param>
        /// <returns>Json</returns>
        public string GetResUsuage(string resName)
        {
            DataTable data = ResourceModels.GetResUsuage(resName);

            //useDate,dayAllWorkHour,dayPlanWorkHour,dayResRatio
            data.Columns["useDate"].ColumnName         = "日期";
            data.Columns["dayAllWorkHour"].ColumnName  = "当日总工时";
            data.Columns["dayPlanWorkHour"].ColumnName = "计划工时";
            data.Columns["dayResRatio"].ColumnName     = "稼动率";
            return(PMPublicFuncs.DatatableToJson(data));
        }
        /// <summary>
        /// 从静态模型中获取辅助资源数据
        /// </summary>
        /// <returns>Json</returns>
        public string GetScndUsuageData()
        {
            DataTable data = ScndUsuageModels.GetScndUsuageData();

            //scndResName,scndResType,allQty,useQty,startDateTime,endDateTime
            data.Columns["scndResName"].ColumnName   = "辅助资源名";
            data.Columns["scndResType"].ColumnName   = "辅助资源类型";
            data.Columns["allQty"].ColumnName        = "可用总数";
            data.Columns["useQty"].ColumnName        = "使用数量";
            data.Columns["startDateTime"].ColumnName = "使用开始时间";
            data.Columns["endDateTime"].ColumnName   = "使用结束时间";
            return(PMPublicFuncs.DatatableToJson(data));
        }
        public string GetMaterials(int choose)
        {
            DataTable data = MaterialsModels.MaterialTable(choose);

            data.Columns["useDate"].ColumnName     = "使用日期";
            data.Columns["csmItemCode"].ColumnName = "物料编码";
            data.Columns["useQty"].ColumnName      = "使用数量";
            data.Columns["itemUnit"].ColumnName    = "单位";
            data.Columns["itemDesp"].ColumnName    = "物料描述";
            data.Columns["itemAttr1"].ColumnName   = "备注";
            data.Columns["buyDate"].ColumnName     = "物料需求日";
            if (choose == 0)
            {
                data.Columns["sysType"].ColumnName = "类型";
            }
            return(PMPublicFuncs.DatatableToJson(data));
        }
        public static string GetPmViewGroupTable(string value)
        {
            DataTable  table = new DataTable();
            SqlCommand cmd   = PMCommand.SchCmd();

            cmd.CommandText = "SELECT resName  FROM View_PmViewGroup where sysID ='" + PMStaticModels.UserModels.PMUser.UserSysID + "' and ViewName  = '" + value + "'";
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            da.Fill(table);
            da.Dispose();
            cmd.Connection.Dispose();
            if (table.Rows.Count == 0)
            {
                return("视图中没有设备");
            }
            else
            {
                return(PMPublicFuncs.DatatableToJson(table));
            }
        }
        public string ProductOutput(int isfinal, string opname)
        {
            //Finished参数判断是否是成品
            //获取每日产出数据
            DataTable temptable = StatisticalModels.GetProductOutPut(isfinal, opname);

            //获取工序名称
            //汉化
            temptable.Columns["itemname"].ColumnName   = "产品名称";
            temptable.Columns["outputqty"].ColumnName  = "产出数量";
            temptable.Columns["exportdate"].ColumnName = "产出日期";
            if (isfinal == 0)
            {
                temptable.Columns["opName"].ColumnName = "工序名称";
            }
            for (int i = 0; i < Convert.ToInt32(PMAppSettings.ItemAttrCount); i++)
            {
                string temp = "itemattr" + (i + 1);
                string item = "ItemAttr" + (i + 1);
                temptable.Columns[temp].ColumnName = PMAppSettings.ItemGroup.Rows[0][item].ToString();
            }
            temptable.Columns["desp"].ColumnName = "描述";
            return(PMPublicFuncs.DatatableToJson(temptable));
        }
 /// <summary>
 /// 获取设备名称列表
 /// </summary>
 /// <param name="resGroup">设备组名称</param>
 /// <returns>Json</returns>
 public string GetResNameList(string resGroup)
 {
     return(PMPublicFuncs.DatatableToJson(ResourceModels.GetResList(resGroup)));
 }
 /// <summary>
 /// 获取设备组
 /// </summary>
 /// <returns>Json</returns>
 public string GetResGroup()
 {
     return(PMPublicFuncs.DatatableToJson(ResourceModels.GetResGroup()));
 }