예제 #1
0
        /// <param name=""begintime"">查询年份(*)
        /// <param name=""endtime""> 结束日期(*)
        /// <param name=""groupid"">集团id
        /// <param name=""companyid"">公司id
        /// <param name=""foundryid"">车间id
        /// <param name=""ProductLineId"">产线id"
        public string DeviceErrYearRpt(string begintime, int?groupid, int?companyid, int?foundryid, int?ProductLineId, string devicemodel, int islisterr = 1)
        {
            if (groupid == null && companyid == null && foundryid == null && ProductLineId == null)
            {
                return(Global.RETURN_ERROR("部门编号不能全部为空"));
            }
            ProductionLinesServer pls = new ProductionLinesServer();
            string       lineids      = Global.GetLinesStr(groupid, companyid, foundryid, ProductLineId);
            ReportServer rps          = new ReportServer();

            return(rps.DeviceErrYearRpt(begintime, lineids, devicemodel, islisterr));
        }
예제 #2
0
        /// <param name=""begintime"">查询月份(*)
        /// <param name=""endtime""> 结束日期(*)
        /// <param name=""groupid"">集团id
        /// <param name=""companyid"">公司id
        /// <param name=""foundryid"">车间id
        /// <param name=""ProductLineId"">产线id"

        public string LineMonthRpt(string begintime, int?groupid, int?companyid, int?foundryid, int?ProductLineId)
        {
            if (groupid == null && companyid == null && foundryid == null && ProductLineId == null)
            {
                return(Global.RETURN_ERROR("部门编号不能全部为空"));
            }
            ProductionLinesServer pls = new ProductionLinesServer();
            string       lineids      = Global.GetLinesStr(groupid, companyid, foundryid, ProductLineId);
            ReportServer rps          = new ReportServer();

            return(rps.LineMonthRpt(begintime, lineids));
        }
예제 #3
0
        public string GetUsage( )
        {
            string strJsonString = string.Empty;

            try
            {
                ProductionLinesServer pServer = new ProductionLinesServer();

                DataTable linedt = pServer.GetLinesList();

                if (linedt.Rows.Count < 0)
                {
                    return(strJsonString = "{\"ErrorType\":1,\"ErrorMessage\":\"生产线数量为0!\"}");
                }
                List <Hashtable> list = new List <Hashtable> ();

                for (int x = 0; x < linedt.Rows.Count - 1; x++)
                {
                    Hashtable dic      = new Hashtable();
                    int       lineid   = 0;
                    string    linename = string.Empty;;
                    int.TryParse(linedt.Rows[x][0].ToString(), out lineid);
                    linename = linedt.Rows[x][1].ToString();

                    dic.Add("ProductLineId", lineid.ToString());
                    dic.Add("ProductLineName", linename);
                    Dictionary <string, DataTable> dString = new Dictionary <string, DataTable>();

                    DateTime time  = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd"));
                    long     lTime = TimeHelper.ConvertDateTimeToInt(time);
                    //string strSql = string.Format("SELECT  *  FROM  `usage` a  LEFT JOIN  `line` b ON a.id_usage=b.id_usage  WHERE UpData_Time>{0}  ORDER BY  ct DESC LIMIT 0,1", lTime);
                    string    strSql = string.Format("SELECT  a.ID_Usage, a.ChildID, a.OrderID, a.ChildN, a.ProductionT, a.ProductionBeat, round(a.NowN/2) as NowN, round(a.OldN/2) as OldN ,round(a.AllN/2) as AllN , a.WeiTiaoConsumption, a.HuChiConsumption, a.BiaoQianConsumption, a.DaDiConsumption,  a.ProductLineId ,b.*  FROM  `usage` a  LEFT JOIN  `line` b ON a.id_usage=b.id_usage  where a.ProductLineId={0}    ORDER BY  ct DESC LIMIT 0,1", lineid);
                    DataTable tb     = MySqlHelper.ExecuteQuery(strSql);
                    if (tb.Rows.Count > 0)
                    {
                        dic.Add("Data", JsonHelper.DataRowToDic(tb.Columns, tb.Rows[0]));
                    }
                    else
                    {
                        dic.Add("Data", "");
                    }
                    list.Add(dic);
                }
                return(JsonConvert.SerializeObject(list));
            }
            catch (Exception ex)
            {
                return(Global.RETURN_ERROR(ex.Message));
            }
        }
예제 #4
0
        //获取生产线列表

        /// 测试数据 /ProductionLines/GetLineList
        public string GetLineList()
        {
            string role     = "01";
            string departid = "";

            if (HttpContext.Session["user"] != null)
            {
                role     = (HttpContext.Session["user"] as SessionUser).roleid;
                departid = (HttpContext.Session["user"] as SessionUser).departid;
            }

            ProductionLinesServer pLinesServer = new ProductionLinesServer();

            return(JsonConvert.SerializeObject(pLinesServer.GetLinesList(role, departid)));
        }
예제 #5
0
        public DataTable GetLineDt(SessionUser user)
        {
            string role     = string.Empty;
            string departid = "";

            if (user != null)
            {
                role     = user.roleid;
                departid = user.departid;
            }


            ProductionLinesServer pServer = new ProductionLinesServer();

            return(pServer.GetLinesList(role, departid));
        }
예제 #6
0
        //产线生产计划设置
        // 测试数据 /ProductionLines/ProductionCalSet?ProductLineId=1&ProductionDays=1,2,3,4,5,6&ProductionBeat=600&ProductionShifts=1

        public string ProductionCalSet()
        {
            if (Request["ProductLineId"] == null || Request["ProductionBeat"] == null || Request["ProductionShifts"] == null || Request["ProductionDays"] == null || Request["ProductionTimes"] == null)
            {
                return(Global.RETURN_ERROR("参数不完整!"));
            }

            int    ProductLineId    = Convert.ToInt32(Request["ProductLineId"]);
            int    ProductionBeat   = Convert.ToInt32(Request["ProductionBeat"]);
            int    ProductionShifts = Convert.ToInt32(Request["ProductionShifts"]);
            int    ProductionTimes  = Convert.ToInt32(Request["ProductionTimes"]);
            string ProductionDays   = Convert.ToString(Request["ProductionDays"]);
            string oper             = Convert.ToString(HttpContext.Session["user"] == null?"": (HttpContext.Session["user"] as SessionUser).username);


            ProductionLinesServer pLinesServer = new ProductionLinesServer();

            return(pLinesServer.ProductionCalSet(ProductLineId, ProductionBeat, ProductionShifts, ProductionDays, ProductionDays, oper));
        }
예제 #7
0
        /// <summary>
        /// 产线信息总表接口
        /// </summary>
        /// <param name="ProductLineId">产线Id</param>
        /// <param name="OrderID">产线名</param>
        /// <param name="CompanyId">公司Id</param>
        /// <param name="telephone">固定电话</param>
        /// <param name="registertime">注册时间</param>
        /// <param name="role">角色</param>
        /// <param name="status">状态</param>
        /// <param name="IsEnable">是否活跃</param>
        /// <param name="KeyWord">查询关键字</param>
        /// <param name="PageIndex">页数</param>
        /// <param name="PageSize">每页条数</param>
        /// <returns>Json数组</returns>
        /// 测试数据:/ProductionLines/ProductionLinesData?CompanyId=1&keyword=1号生产线

        public string ProductionLinesData(int?LineId, string OrderID
                                          , string CompanyId, string telephone, string registertime,
                                          string role, string status, string GroupId, string FoundryId,
                                          string IsEnable, string KeyWord
                                          , int?PageIndex = 0, int?PageSize = 5)
        {
            //if (Session["Role"].ToString() != "1")
            //{
            //    return "没有权限访问!";
            //}

            role = "01";
            string departid = "";

            if (HttpContext.Session["user"] != null)
            {
                role     = (HttpContext.Session["user"] as SessionUser).roleid;
                departid = (HttpContext.Session["user"] as SessionUser).departid;
                if ("02".Equals(role))
                {
                    GroupId = departid;
                }
                if ("03".Equals(role))
                {
                    CompanyId = departid;
                }
                if ("04".Equals(role))
                {
                    FoundryId = departid;
                }
            }
            ProductionLinesServer pServer = new ProductionLinesServer();

            return(pServer.GetProductionLinesData(LineId
                                                  , CompanyId, telephone, registertime, role,
                                                  status, GroupId, FoundryId, IsEnable, KeyWord, PageIndex, PageSize));
        }
예제 #8
0
        public string GetGroupList()
        {
            ProductionLinesServer pLinesServer = new ProductionLinesServer();

            return(pLinesServer.GetGroupList());
        }