Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //身份校验
            if (!InterfaceTool.IdentityVerify(Request))
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, "身份认证错误!").DicInfo());
                return;
            }

            //航次编码
            string strShip_Id = Request.Params["Ship_Id"];

            //strShip_Id = "2014";


            try
            {
                if (strShip_Id == null)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, "参数错误,获取个统计操作员数据数据失败!").DicInfo());
                    return;
                }

                //strShip_Id = string.IsNullOrWhiteSpace(strShip_Id) ? string.Empty : strShip_Id;


                string          strSql          = string.Empty;
                string          strTallySql     = string.Empty;
                FullStatisticsE fullStatisticsE = new FullStatisticsE();


                strTallySql =
                    string.Format(@"select distinct(OPER_NAME) 
                                    FROM (SELECT I.SIZE_CON,I.FULLOREMPTY,I.UNLOAD_MARK,I.CONTAINER_NO,CASE WHEN T.NAME IS NOT NULL THEN  T.NAME ELSE I.USER_NAME END as OPER_NAME
                                    from con_image I LEFT JOIN TALLY_CLERK  T ON  I.USER_NAME=T.WORK_NO
                                    where I.SHIP_ID='{0}' and MOVED='1' AND I.USER_NAME is not null)
                                    group by size_con,fullorempty,OPER_NAME",
                                  strShip_Id);

                strSql =
                    string.Format(@"select SIZE_CON,FULLOREMPTY,OPER_NAME,count(case when unload_mark='1' then 1 end) operCon
                                    FROM (SELECT I.SIZE_CON,I.FULLOREMPTY,I.UNLOAD_MARK,I.CONTAINER_NO,CASE WHEN T.NAME IS NOT NULL THEN  T.NAME ELSE I.USER_NAME END as OPER_NAME
                                    from con_image I LEFT JOIN TALLY_CLERK  T ON  I.USER_NAME=T.WORK_NO
                                    where I.SHIP_ID='{0}' and MOVED='1')
                                    group by size_con,fullorempty,OPER_NAME",
                                  strShip_Id);

                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathTally).ExecuteTable(strTallySql);
                if (dt.Rows.Count <= 0)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, "暂无数据!").DicInfo());
                    return;
                }

                List <SingleStatisticsE> singleStatisticsList = new List <SingleStatisticsE>();

                for (int iRow = 0; iRow < dt.Rows.Count; iRow++)
                {
                    SingleStatisticsE singleStatisticsE = new SingleStatisticsE();
                    singleStatisticsE.Name = Convert.ToString(dt.Rows[iRow]["OPER_NAME"]);
                    singleStatisticsList.Add(singleStatisticsE);
                }

                dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathTally).ExecuteTable(strSql);


                for (int iRow = 0; iRow < dt.Rows.Count; iRow++)
                {
                    string name = Convert.ToString(dt.Rows[iRow]["OPER_NAME"]);

                    for (int j = 0; j < singleStatisticsList.Count; j++)
                    {
                        SingleStatisticsE s = singleStatisticsList[j];

                        if (s.Name.Equals(name))
                        {
                            if (dt.Rows[iRow]["FULLOREMPTY"].Equals("E"))
                            {
                                if (dt.Rows[iRow]["SIZE_CON"].Equals("20"))
                                {
                                    s.E_20 = Convert.ToInt16(dt.Rows[iRow]["OPERCON"]);
                                }
                                else if (dt.Rows[iRow]["SIZE_CON"].Equals("40"))
                                {
                                    s.E_40 = Convert.ToInt16(dt.Rows[iRow]["OPERCON"]);
                                }
                                else
                                {
                                    s.E_other = Convert.ToInt16(dt.Rows[iRow]["OPERCON"]);
                                }
                            }
                            if (dt.Rows[iRow]["FULLOREMPTY"].Equals("F"))
                            {
                                if (dt.Rows[iRow]["SIZE_CON"].Equals("20"))
                                {
                                    s.F_20 = Convert.ToInt16(dt.Rows[iRow]["OPERCON"]);
                                }
                                else if (dt.Rows[iRow]["SIZE_CON"].Equals("40"))
                                {
                                    s.F_40 = Convert.ToInt16(dt.Rows[iRow]["OPERCON"]);
                                }
                                else
                                {
                                    s.F_other = Convert.ToInt16(dt.Rows[iRow]["OPERCON"]);
                                }
                            }
                        }
                    }
                }


                Json = JsonConvert.SerializeObject(new DicPackage(true, singleStatisticsList, null).DicInfo());
            }
            catch (Exception ex)
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, string.Format("{0}:获取个统计操作员数据发生异常。{1}", ex.Source, ex.Message)).DicInfo());
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //身份校验
            if (!InterfaceTool.IdentityVerify(Request))
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, "身份认证错误!").DicInfo());
                return;
            }

            //航次编码
            string strShip_Id = Request.Params["Ship_Id"];
            //进出口编码
            string strCodeInOut = Request.Params["CodeInOut"];

            //strShip_Id = "2014";
            //strCodeInOut = "0";


            try
            {
                if (strShip_Id == null || strCodeInOut == null)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, "参数错误,获取个统计理货员数据失败!").DicInfo());
                    return;
                }

                //strShip_Id = string.IsNullOrWhiteSpace(strShip_Id) ? string.Empty : strShip_Id;
                //strCodeInOut = string.IsNullOrWhiteSpace(strCodeInOut) ? string.Empty : strCodeInOut;

                string          strSql          = string.Empty;
                string          strTallySql     = string.Empty;
                FullStatisticsE fullStatisticsE = new FullStatisticsE();


                //进
                if (strCodeInOut.Equals("0"))
                {
                    strTallySql =
                        string.Format(@"select distinct(c.name) 
                                        from con_image i left join TALLY_CLERK c on c.work_no = i.work_no  
                                        where i.SHIP_ID = '{0}' and i.CODE_UNLOAD_PORT LIKE '%LYG' AND MOVED = '0' AND c.NAME is not null",
                                      strShip_Id);

                    strSql =
                        string.Format(@"select SIZE_CON,FULLOREMPTY,c.name,count(case when unload_mark='1' then 1 end) tallyCon 
                                        from con_image i left join TALLY_CLERK c on c.work_no=i.work_no  
                                        where i.SHIP_ID='{0}' and i.CODE_UNLOAD_PORT LIKE '%LYG' AND MOVED='0'  
                                        group by size_con,fullorempty,c.name",
                                      strShip_Id);
                }
                else
                {
                    strTallySql =
                        string.Format(@"select distinct(c.name) 
                                             from con_image i left join TALLY_CLERK c on c.work_no = i.work_no  
                                             where i.SHIP_ID = '{0}' and i.CODE_LOAD_PORT LIKE '%LYG' AND MOVED = '0' AND c.NAME is not null",
                                      strShip_Id);

                    strSql =
                        string.Format(@"select SIZE_CON,FULLOREMPTY,c.name,count(case when unload_mark='1' then 1 end) tallyCon 
                                        from con_image i left join TALLY_CLERK c on c.work_no=i.work_no  
                                        where i.SHIP_ID='{0}' and i.CODE_LOAD_PORT LIKE '%LYG' AND MOVED='0'  
                                        group by size_con,fullorempty,c.name",
                                      strShip_Id);
                }

                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathTally).ExecuteTable(strTallySql);
                if (dt.Rows.Count <= 0)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, "暂无数据!").DicInfo());
                    return;
                }

                List <SingleStatisticsE> singleStatisticsList = new List <SingleStatisticsE>();

                for (int iRow = 0; iRow < dt.Rows.Count; iRow++)
                {
                    SingleStatisticsE singleStatisticsE = new SingleStatisticsE();
                    singleStatisticsE.Name = Convert.ToString(dt.Rows[iRow]["NAME"]);
                    singleStatisticsList.Add(singleStatisticsE);
                }

                dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathTally).ExecuteTable(strSql);


                for (int iRow = 0; iRow < dt.Rows.Count; iRow++)
                {
                    string name = Convert.ToString(dt.Rows[iRow]["NAME"]);

                    for (int j = 0; j < singleStatisticsList.Count; j++)
                    {
                        SingleStatisticsE s = singleStatisticsList[j];

                        if (s.Name.Equals(name))
                        {
                            if (dt.Rows[iRow]["FULLOREMPTY"].Equals("E"))
                            {
                                if (dt.Rows[iRow]["SIZE_CON"].Equals("20"))
                                {
                                    s.E_20 = Convert.ToInt16(dt.Rows[iRow]["TALLYCON"]);
                                }
                                else if (dt.Rows[iRow]["SIZE_CON"].Equals("40"))
                                {
                                    s.E_40 = Convert.ToInt16(dt.Rows[iRow]["TALLYCON"]);
                                }
                                else
                                {
                                    s.E_other = Convert.ToInt16(dt.Rows[iRow]["TALLYCON"]);
                                }
                            }
                            if (dt.Rows[iRow]["FULLOREMPTY"].Equals("F"))
                            {
                                if (dt.Rows[iRow]["SIZE_CON"].Equals("20"))
                                {
                                    s.F_20 = Convert.ToInt16(dt.Rows[iRow]["TALLYCON"]);
                                }
                                else if (dt.Rows[iRow]["SIZE_CON"].Equals("40"))
                                {
                                    s.F_40 = Convert.ToInt16(dt.Rows[iRow]["TALLYCON"]);
                                }
                                else
                                {
                                    s.F_other = Convert.ToInt16(dt.Rows[iRow]["TALLYCON"]);
                                }
                            }
                        }
                    }
                }


                Json = JsonConvert.SerializeObject(new DicPackage(true, singleStatisticsList, null).DicInfo());
            }
            catch (Exception ex)
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, string.Format("{0}:获取个统计理货员数据发生异常。{1}", ex.Source, ex.Message)).DicInfo());
            }
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //身份校验
            if (!InterfaceTool.IdentityVerify(Request))
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, "身份认证错误!").DicInfo());
                return;
            }

            //航次编码
            string strShip_Id   = Request.Params["Ship_Id"];
            string strCodeInOut = Request.Params["CodeInOut"];

            //strShip_Id = "2015";
            //strCodeInOut = "1";


            try
            {
                if (strShip_Id == null || strCodeInOut == null)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, "参数错误,获取个统计理货员数据数据失败!").DicInfo());
                    return;
                }

                //strShip_Id = string.IsNullOrWhiteSpace(strShip_Id) ? string.Empty : strShip_Id;
                //strCodeInOut = string.IsNullOrWhiteSpace(strCodeInOut) ? string.Empty : strCodeInOut;

                string          strSql          = string.Empty;
                string          strAbnormalSql  = string.Empty;
                FullStatisticsE fullStatisticsE = new FullStatisticsE();


                if (strCodeInOut.Equals("0"))
                {
                    strSql =
                        string.Format(@"select SIZE_CON,FULLOREMPTY,count(*) allCon,count(case when unload_mark='1' then 1 end) tallyCon 
                                        from con_image t 
                                        WHERE SHIP_ID='{0}' and CODE_UNLOAD_PORT LIKE '%LYG' AND MOVED='0'  
                                        GROUP BY  SIZE_CON,FULLOREMPTY",
                                      strShip_Id);

                    strAbnormalSql =
                        string.Format(@"select SIZE_CON,FULLOREMPTY,count(*) abnormalCon 
                                        from con_image t 
                                        WHERE SHIP_ID='{0}' and CODE_UNLOAD_PORT LIKE '%LYG' AND BAY_OPERTIME is not null 
                                        GROUP BY  SIZE_CON,FULLOREMPTY",
                                      strShip_Id);
                }
                else
                {
                    strSql =
                        string.Format(@"select SIZE_CON,FULLOREMPTY,count(*) allCon,count(case when unload_mark='1' then 1 end) tallyCon 
                                             from con_image t 
                                             WHERE SHIP_ID='{0}' and CODE_LOAD_PORT LIKE '%LYG' AND MOVED='0'  
                                             GROUP BY  SIZE_CON,FULLOREMPTY",
                                      strShip_Id);
                    strAbnormalSql =
                        string.Format(@"select SIZE_CON,FULLOREMPTY,count(*) abnormalCon 
                                             from con_image t 
                                             WHERE SHIP_ID='{0}' and CODE_LOAD_PORT LIKE '%LYG' AND BAY_OPERTIME is not null 
                                             GROUP BY  SIZE_CON,FULLOREMPTY",
                                      strShip_Id);
                }

                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathTally).ExecuteTable(strSql);
                if (dt.Rows.Count > 0)
                {
                    for (int iRow = 0; iRow < dt.Rows.Count; iRow++)
                    {
                        if (dt.Rows[iRow]["FULLOREMPTY"].Equals("E"))
                        {
                            if (dt.Rows[iRow]["SIZE_CON"].Equals("20"))
                            {
                                fullStatisticsE.Forecast_E_20 = Convert.ToInt16(dt.Rows[iRow]["ALLCON"]);
                                fullStatisticsE.Tally_E_20    = Convert.ToInt16(dt.Rows[iRow]["TALLYCON"]);
                            }
                            else if (dt.Rows[iRow]["SIZE_CON"].Equals("40"))
                            {
                                fullStatisticsE.Forecast_E_40 = Convert.ToInt16(dt.Rows[iRow]["ALLCON"]);
                                fullStatisticsE.Tally_E_40    = Convert.ToInt16(dt.Rows[iRow]["TALLYCON"]);
                            }
                            else
                            {
                                fullStatisticsE.Forecast_E_other = Convert.ToInt16(dt.Rows[iRow]["ALLCON"]);
                                fullStatisticsE.Tally_E_other    = Convert.ToInt16(dt.Rows[iRow]["TALLYCON"]);
                            }
                        }
                        if (dt.Rows[iRow]["FULLOREMPTY"].Equals("F"))
                        {
                            if (dt.Rows[iRow]["SIZE_CON"].Equals("20"))
                            {
                                fullStatisticsE.Forecast_F_20 = Convert.ToInt16(dt.Rows[iRow]["ALLCON"]);
                                fullStatisticsE.Tally_F_20    = Convert.ToInt16(dt.Rows[iRow]["TALLYCON"]);
                            }
                            else if (dt.Rows[iRow]["SIZE_CON"].Equals("40"))
                            {
                                fullStatisticsE.Forecast_F_40 = Convert.ToInt16(dt.Rows[iRow]["ALLCON"]);
                                fullStatisticsE.Tally_F_40    = Convert.ToInt16(dt.Rows[iRow]["TALLYCON"]);
                            }
                            else
                            {
                                fullStatisticsE.Forecast_F_other = Convert.ToInt16(dt.Rows[iRow]["ALLCON"]);
                                fullStatisticsE.Tally_F_other    = Convert.ToInt16(dt.Rows[iRow]["TALLYCON"]);
                            }
                        }
                    }
                }



                dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathTally).ExecuteTable(strAbnormalSql);
                if (dt.Rows.Count > 0)
                {
                    for (int iRow = 0; iRow < dt.Rows.Count; iRow++)
                    {
                        if (dt.Rows[iRow]["FULLOREMPTY"].Equals("E"))
                        {
                            if (dt.Rows[iRow]["SIZE_CON"].Equals("20"))
                            {
                                fullStatisticsE.Abnormal_E_20 = Convert.ToInt16(dt.Rows[iRow]["ABNORMALCON"]);
                            }
                            else if (dt.Rows[iRow]["SIZE_CON"].Equals("40"))
                            {
                                fullStatisticsE.Abnormal_E_40 = Convert.ToInt16(dt.Rows[iRow]["ABNORMALCON"]);
                            }
                            else
                            {
                                fullStatisticsE.Abnormal_E_other = Convert.ToInt16(dt.Rows[iRow]["ABNORMALCON"]);
                            }
                        }
                        if (dt.Rows[iRow]["FULLOREMPTY"].Equals("F"))
                        {
                            if (dt.Rows[iRow]["SIZE_CON"].Equals("20"))
                            {
                                fullStatisticsE.Abnormal_F_20 = Convert.ToInt16(dt.Rows[iRow]["ABNORMALCON"]);
                            }
                            else if (dt.Rows[iRow]["SIZE_CON"].Equals("40"))
                            {
                                fullStatisticsE.Abnormal_F_40 = Convert.ToInt16(dt.Rows[iRow]["ABNORMALCON"]);
                            }
                            else
                            {
                                fullStatisticsE.Abnormal_F_other = Convert.ToInt16(dt.Rows[iRow]["ABNORMALCON"]);
                            }
                        }
                    }
                }



                int[] strArray = new int[27];
                strArray[0]  = fullStatisticsE.Forecast_total;
                strArray[1]  = fullStatisticsE.Forecast_E_20;
                strArray[2]  = fullStatisticsE.Forecast_E_40;
                strArray[3]  = fullStatisticsE.Forecast_E_other;
                strArray[4]  = fullStatisticsE.Forecast_E_total;
                strArray[5]  = fullStatisticsE.Forecast_F_20;
                strArray[6]  = fullStatisticsE.Forecast_F_40;
                strArray[7]  = fullStatisticsE.Forecast_F_other;
                strArray[8]  = fullStatisticsE.Forecast_F_total;
                strArray[9]  = fullStatisticsE.Tally_total;
                strArray[10] = fullStatisticsE.Tally_E_20;
                strArray[11] = fullStatisticsE.Tally_E_40;
                strArray[12] = fullStatisticsE.Tally_E_other;
                strArray[13] = fullStatisticsE.Tally_E_total;
                strArray[14] = fullStatisticsE.Tally_F_20;
                strArray[15] = fullStatisticsE.Tally_F_40;
                strArray[16] = fullStatisticsE.Tally_F_other;
                strArray[17] = fullStatisticsE.Tally_F_total;
                strArray[18] = fullStatisticsE.Abnormal_total;
                strArray[19] = fullStatisticsE.Abnormal_E_20;
                strArray[20] = fullStatisticsE.Abnormal_E_40;
                strArray[21] = fullStatisticsE.Abnormal_E_other;
                strArray[22] = fullStatisticsE.Abnormal_E_total;
                strArray[23] = fullStatisticsE.Abnormal_F_20;
                strArray[24] = fullStatisticsE.Abnormal_F_40;
                strArray[25] = fullStatisticsE.Abnormal_F_other;
                strArray[26] = fullStatisticsE.Abnormal_F_total;


                Json = JsonConvert.SerializeObject(new DicPackage(true, strArray, null).DicInfo());
            }
            catch (Exception ex)
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, string.Format("{0}:获取全统计数据发生异常。{1}", ex.Source, ex.Message)).DicInfo());
            }
        }