Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var bindId = Request.Params["BindId"];

            //bindId = "369949";

            try
            {
                var strSql =
                    string.Format(@"select spmc,sl,ddzt,to_char(cjsj, 'yyyy/mm/dd hh24:mi:ss') as cjsj 
                                    from BO_TX_DDMX 
                                    where cgdid='{0}'
                                    order by cjsj desc",
                                  bindId);
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathAws).ExecuteTable(strSql);
                if (dt.Rows.Count <= 0)
                {
                    var arry = 0;
                    Json = JsonConvert.SerializeObject(arry);
                    return;
                }

                var arrays = new Leo.Data.Table(dt).ToArray();
                Json = Request.QueryString.Get("callback") + "(" + JsonConvert.SerializeObject(arrays) + ")";
            }
            catch (Exception ex)
            {
                LogTool.WriteLog(typeof(GetPurchasingOrderDetail), ex);
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ////身份校验
            //if (!InterfaceTool.IdentityVerify(Request))
            //{
            //    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "身份认证错误").DicInfo());
            //    return;
            //}

            try
            {
                //获取上一个已评价
                string strSql =
                    string.Format(@"select b.id from SER_EVALUATE a, HARBOR.TB_PRO_CONSIGNVEHICLE b 
                                    where a.createtime=(select max(createtime) from ser_evaluate) and a.veh_attest_no=b.ingateno");
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathCGate).ExecuteTable(strSql);
                if (dt.Rows.Count <= 0)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, null).DicInfo());
                    return;
                }

                string strId = Convert.ToString(dt.Rows[0]["id"]);

                Json = JsonConvert.SerializeObject(new DicPackage(true, strId, null).DicInfo());
            }
            catch (Exception ex)
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, string.Format("{0}:获取上一个已评价数据发生异常。{1}", ex.Source, ex.Message)).DicInfo());
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="strCodeCompany"></param>
        /// <param name="strCodeStorage"></param>
        /// <param name="strCodeAllocation"></param>
        /// <param name="strCodeBooth"></param>
        /// <returns></returns>
        private string InsertAllocation(string strCodeCompany, string strCodeStorage, string strAllocation, string strCodeBooth)
        {
            string strSql  = string.Empty;
            string strCode = string.Empty;

            strSql = string.Format(@"select count(*) as total  from  TB_CODE_ALLOCATION 
                where code_company='" + strCodeCompany + "' and code_storage='" + strCodeStorage + "' and  code_booth='" + strCodeBooth + "' and allocation='" + strAllocation + "' ");
            var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCBase).ExecuteTable(strSql);

            if (Convert.ToString(dt.Rows[0]["total"]) == "0")
            {
                //执行语句
                strSql = string.Format(@"insert into TB_CODE_ALLOCATION(code_company,code_storage,code_booth,allocation)
                                       values('{0}','{1}','{2}','{3}')", strCodeCompany, strCodeStorage, strCodeBooth, strAllocation);
                new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCBase).ExecuteNonQuery(strSql);
                strSql = string.Format(@"select CODE_ALLOCATION  from TB_CODE_ALLOCATION 
                    where code_company='" + strCodeCompany + "' and code_storage='" + strCodeStorage + "' and  code_booth='" + strCodeBooth + "' and allocation='" + strAllocation + "' ");
                dt     = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCBase).ExecuteTable(strSql);
                if (dt.Rows.Count >= 0)
                {
                    strCode = Convert.ToString(dt.Rows[0]["CODE_ALLOCATION"]);
                }
            }
            else
            {
                strSql = "select distinct CODE_ALLOCATION from baseresource.TB_CODE_ALLOCATION where  code_company='" + strCodeCompany + "' and ALLOCATION='" + strAllocation + "'";
                dt     = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCBase).ExecuteTable(strSql);
                if (dt.Rows.Count >= 0)
                {
                    strCode = Convert.ToString(dt.Rows[0]["CODE_ALLOCATION"]);
                }
            }
            return(strCode);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 获取原始票货编码
        /// </summary>
        /// <param name="strGbno">源票货编码</param>
        /// <returns></returns>
        public string GetGbnofirst(string strGbno)
        {
            string strGbno2 = string.Empty;
            string lGbno    = string.Empty;
            int    c        = 1;
            string strSql   = "select gbno from tb_hc_consign where gbno is not null and gbno<>'" + strGbno + "' and GBNO_FORCONSIGN='" + strGbno + "'";
            var    dt       = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCHarbor).ExecuteTable(strSql);

            if (dt.Rows.Count == 0)
            {
                return(strGbno);
            }
            strGbno2 = dt.Rows[0]["gbno"].ToString();
            lGbno    = strGbno + "," + strGbno2;
            while (c > 0)
            {
                strSql = "select gbno from tb_hc_consign where gbno is not null and gbno not in (" + lGbno + ") and GBNO_FORCONSIGN='" + strGbno2 + "'";
                dt     = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCHarbor).ExecuteTable(strSql);
                c      = dt.Rows.Count;
                if (c == 0)
                {
                    return(strGbno2);
                }
                strGbno2 = dt.Rows[0]["gbno"].ToString();
                lGbno    = lGbno + "," + strGbno2;
            }
            return(string.Empty);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取理货单编码
        /// </summary>
        /// <param name="strCodeCompany">公司编码</param>
        /// <returns></returns>
        private string GetTbno()
        {
            string strJson = string.Empty;
            string strSql  = "select to_char(sysdate,'yyyymmdd') || lpad(to_char(TBNO_ID.Nextval),6,'0') as tbno from dual";
            var    dt      = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCHarbor).ExecuteTable(strSql);

            if (dt.Rows.Count <= 0)
            {
                strJson = JsonConvert.SerializeObject(new DicPackage(false, null, "网络连接异常!").DicInfo());
                return(strJson);
            }

            return(Convert.ToString(dt.Rows[0]["tbno"]));;
        }
Exemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //身份校验
            if (!InterfaceTool.IdentityVerify(Request))
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, "身份认证错误").DicInfo());
                return;
            }

            //ID
            string strId = Request.Params["Id"];

            //strId = "41";

            try
            {
                if (strId == null)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "参数错误,获取我的评价数据失败").DicInfo());
                    return;
                }

                //获取我的评价(处理结果)
                string strSql =
                    string.Format(@"select evaluate,index_satisfy,to_char(evaluate_time, 'yyyy/mm/dd hh24:mi:ss') as evaluate_time 
                                    from ser_complain  
                                    where id='{0}'",
                                  strId);
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathCGate).ExecuteTable(strSql);
                if (dt.Rows.Count <= 0)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, null).DicInfo());
                    return;
                }

                string[] strArray = new string[3];

                strArray[0] = Convert.ToString(dt.Rows[0]["evaluate"]);
                string strIndex_satisfy = string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[0]["index_satisfy"])) == true ? string.Empty : GetChineseEvaluate(Convert.ToInt16(dt.Rows[0]["index_satisfy"]));
                strArray[1] = strIndex_satisfy;
                strArray[2] = Convert.ToString(dt.Rows[0]["evaluate_time"]);

                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());
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// 更新采购订单明细
        /// </summary>
        /// <param name="strOrderId">采购单ID</param>
        /// <param name="strOrderId">货物ID</param>
        /// <param name="strOrderId">订单ID</param>
        /// <param name="strOrderId">创建者</param>
        /// <param name="strOrderState">订单状态</param>
        /// <param name="strNum">数量</param>
        /// <param name="strGoods">货物名称</param>
        /// <returns>状态消息</returns>
        private string UpdatePurchasingOrderDetail(string strPurchaseOrderId, string strGoodsId, string strOrderId, string strCreateUser, string strOrderState, int strNum, string strGoods)
        {
            string strJson = string.Empty;

            try
            {
                //校验采购单货物数据
                string strSql =
                    string.Format("select * from BO_TX_WZCGMX where BINDID='{0}' and ID='{1}'", strPurchaseOrderId, strGoodsId);
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathAws).ExecuteTable(strSql);
                if (dt.Rows.Count <= 0)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "采购单ID、货物ID不存在!").DicInfo());
                    return(strJson);
                }

                strSql =
                    string.Format(@"select * from BO_TX_DDMX 
                                    where CGDID='{0}' and CPID='{1}' and DDID='{2}'",
                                  strPurchaseOrderId, strGoodsId, strOrderId);
                dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathAws).ExecuteTable(strSql);
                if (dt.Rows.Count <= 0)
                {
                    strSql =
                        string.Format(@"insert into BO_TX_DDMX(CGDID,CPID,DDID,DDZT,SL,SPMC) 
                                      values('{0}','{1}','{2}','{3}','{4}','{5}')",
                                      strPurchaseOrderId, strGoodsId, strOrderId, strOrderState, Convert.ToString(strNum), strGoods);
                }
                else
                {
                    strSql =
                        string.Format(@"update BO_TX_DDMX set DDZT='{0}',SL='{1}',SPMC='{2}'
                                      where CGDID='{3}' and CPID='{4}' and DDID='{5}'",
                                      strOrderState, Convert.ToString(strNum), strGoods, strPurchaseOrderId, strGoodsId, strOrderId);

//                    strSql =
//                      string.Format(@"update BO_DDMX set DDZT='{0}',SL='{1}',UPDATEDATE=to_date('{2}','yyyy/mm/dd hh24:mi:ss')
//                                                      where CGDID='{3}' and CPID='{4}' and DDID='{5}'",
//                                      strOrderState, Convert.ToString(strNum), DateTime.Now, strPurchaseOrderId, strGoodsId, strOrderId);
                }
                new Leo.Oracle.DataAccess(RegistryKey.KeyPathAws).ExecuteNonQuery(strSql);
            }
            catch (Exception ex)
            {
                strJson = JsonConvert.SerializeObject(new DicPackage(false, null, string.Format("{0}:更新采购订单明细数据发生异常。{1}", ex.Source, ex.Message)).DicInfo());
            }
            return(strJson);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 更新物资采购
        /// </summary>
        /// <param name="strPurchaseOrderId">采购单ID</param>
        /// <param name="strGoodsId">货物ID</param>
        /// <returns>状态消息</returns>
        private string UpdateMaterialsPurchasing(string strPurchaseOrderId, string strGoodsId)
        {
            string strJson = string.Empty;

            try
            {
                //订单收货数量总和
                int sumOrderGoodsNum = 0;
                //实际收货数量
                int actualGoodsNum = 0;
                //校验采购单货物数据
                string strSql =
                    string.Format("select * from BO_TX_WZCGMX where BINDID='{0}' and ID='{1}'", strPurchaseOrderId, strGoodsId);
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathAws).ExecuteTable(strSql);
                if (dt.Rows.Count <= 0)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "采购单ID、货物ID不存在!").DicInfo());
                    return(strJson);
                }
                actualGoodsNum = string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[0]["SJDH"])) == true ? 0 : Convert.ToInt32(dt.Rows[0]["SJDH"]);

                //校验数量
                strSql =
                    string.Format("select SL from BO_TX_DDMX where CGDID='{0}' and CPID='{1}'", strPurchaseOrderId, strGoodsId);
                dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathAws).ExecuteTable(strSql);
                if (dt.Rows.Count > 0)
                {
                    for (int iRow = 0; iRow < dt.Rows.Count; iRow++)
                    {
                        sumOrderGoodsNum += Convert.ToInt32(dt.Rows[iRow]["SL"]);
                    }
                }
                if (sumOrderGoodsNum != actualGoodsNum)
                {
                    strSql =
                        string.Format("update BO_TX_WZCGMX set SJDH='{0}' where BINDID='{1}' and ID='{2}'", sumOrderGoodsNum, strPurchaseOrderId, strGoodsId);
                    new Leo.Oracle.DataAccess(RegistryKey.KeyPathAws).ExecuteNonQuery(strSql);
                }
            }
            catch (Exception ex)
            {
                strJson = JsonConvert.SerializeObject(new DicPackage(false, null, string.Format("{0}:更新物资采购数据发生异常。{1}", ex.Source, ex.Message)).DicInfo());
            }
            return(strJson);
        }
Exemplo n.º 9
0
        /// <summary>
        /// 保存作业票
        /// </summary>
        /// <param name="strGbno">TallyBillE对象</param>
        /// <returns></returns>
        public bool SaveTB(TallyBillE tb)
        {
            //校验作业票是否是重复生成
            if (tb.Pmno != string.Empty)
            {
                string strFilter = string.Format(" where tbno='{0}'", tb.Tbno);
                string strSql    = string.Format("select * from tb_hs_tallybill{0}", strFilter);
                var    dt        = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCHarbor).ExecuteTable(strSql);
                if (dt.Rows.Count > 0)//已存在,更新
                {
                    string strUpdate_Hs_Tallybill = @"update vw_reg_tallybill set code_department='{0}',amount='{1}',weight='{2}',code_tallyman='{3}',tallyman='{4}',code_company='{5}', modifier='{6}',modifiername='{7}',modifytime=to_date('{10}', 'yyyy/mm/dd hh24:mi:ss'),amount2='{8}',mark_finish='{9}'" + strFilter;
                    strSql = string.Format(strUpdate_Hs_Tallybill, tb.Code_Department, tb.Amount, tb.Weight, tb.Code_Tallyman, tb.Tallyman, tb.Code_Company,
                                           tb.Creator, tb.Creatorname, tb.Amount2, tb.Mark_finish, tb.AuditTime);
                    da.ExecuteNonQuery(strSql);
                }
                else//不存在,插入
                {
                    string strInsert_Hs_Tallybill = "insert into vw_reg_tallybill(tbno,pmno,gbno,signdate,code_department,taskno,cgno,code_storage,code_booth,CODE_ALLOCATION,vgno,cabin,code_carrier,carriernum,NSNO_BARGE,bargepro,pieceweight,amount,weight,volume,code_measure,begintime,endtime,code_operation,code_operation_fact,code_quality,code_workflow,code_trainroad,workteam,code_worktime,code_teamtype,code_tallyman,tallyman,code_storagelast,code_boothlast,CODE_ALLOCATIONLAST,vgnolast,cabinlast,code_carrierlast,carriernumlast,NSNO_BARGELAST,bargeprolast,carrier1,carrier1num,carrier2,carrier2num,code_opstype,remark,gbdisplay,tallynum,gbnolast,gbdisplaylast,gbnofirst,containernum,parenttbno,gbnofromstock,code_company,code_section,trainnum,tallydate,mark_comp_plan,mark_comp_goodsbill,mark_comp_ship,code_billtype,creator,creatorname,createtime,code_motorcade,code_storage_stock,code_booth_stock,CODE_ALLOCATION_STOCK,code_opstype_fact,drivernum,workernum,amount2,code_workteam,machine,CODE_WORKINGAREA,CODE_WORKINGAREALAST,mark_finish,CARRIER1A,CARRIER2A) " +
                                                    " values('{0}','{1}','{2}',to_date('{3}','yyyy-mm-dd hh24:mi:ss'),'{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}', '{16}','{17}','{18}','{19}','{20}','{21}','{22}','{23}','{24}','{25}','{26}','{27}','{28}','{29}','{30}','{31}','{32}','{33}','{34}','{35}','{36}','{37}','{38}','{39}','{40}','{41}','{42}','{43}','{44}','{45}','{46}','{47}','{48}','{49}','{50}','{51}','{52}','{53}','{54}','{55}','{56}','{57}','{58}',to_date('{59}','yyyy-mm-dd hh24:mi:ss'),'{60}','{61}','{62}','{63}','{64}','{65}',to_date('{79}', 'yyyy/mm/dd hh24:mi:ss'),'{66}','{67}','{68}','{69}','{70}','{71}','{72}','{73}','{74}','{75}','{76}','{77}','{78}','{79}','{80}')";
                    strSql = string.Format(strInsert_Hs_Tallybill, tb.Tbno, tb.Pmno, tb.Gbno, tb.Signdate.ToString(),
                                           tb.Code_Department, tb.Taskno, tb.Cgno, tb.Code_Storage, tb.Code_Booth, tb.code_allocation, tb.Vgno,
                                           tb.Cabin, tb.Code_Carrier, tb.Carriernum, tb.NSNO_BARGE, tb.Bargepro, tb.Pieceweight,
                                           tb.Amount, tb.Weight, tb.Volume, tb.Code_Measure, tb.Begintime, tb.Endtime,
                                           tb.Code_Operation, tb.Code_Operation_Fact, tb.Code_Quality, tb.Code_workflow, tb.Code_trainroad, tb.Workteam,
                                           tb.Code_Worktime, tb.Code_Teamtype, tb.Code_Tallyman, tb.Tallyman, tb.Code_Storagelast,
                                           tb.Code_Boothlast, tb.code_allocationlast, tb.Vgnolast, tb.Cabinlast, tb.Code_Carrierlast,
                                           tb.Carriernumlast, tb.NSNO_BARGELAST, tb.Bargeprolast, tb.Carrier1, tb.Carrier1num, tb.Carrier2, tb.Carrier2num,
                                           tb.Code_Opstype, tb.Remark, tb.Gbdisplay, tb.Tallynum, tb.Gbnolast,
                                           tb.Gbdisplaylast, tb.Gbnofirst, tb.Containernum,
                                           tb.Parenttbno, tb.Gbnofromstock, tb.Code_Company, tb.Code_Section, tb.Trainnum, tb.Tallydate,
                                           tb.Mark_comp_plan, tb.Mark_comp_goodsbill, tb.Mark_comp_ship, tb.Code_billtype,
                                           tb.Creator, tb.Creatorname, tb.Code_motorcade, tb.Code_Storage_Stock, tb.Code_Booth_Stock, tb.code_allocationstock,
                                           tb.Code_opstype_fact, tb.Drivernum,
                                           tb.Workernum, tb.Amount2, tb.Code_Workteam, tb.Machine, tb.code_workingarea, tb.code_workingarealast, tb.Mark_finish, tb.Carrier1A, tb.Carrier2A);
                    da.ExecuteNonQuery(strSql);
                }
            }

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

            //ID
            string strId = Request.Params["Id"];

            //strId = "211";

            try
            {
                if (strId == null)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "参数错误,获取评价详情数据失败").DicInfo());
                    return;
                }

                //获取待评价详情
                string strSql =
                    string.Format(@"select t.id,t.veh_attest_no,t.driverphone,t.finish_mark,t.evaluate_hall,t.evaluate_dock,t.evaluate_gate,t.index_attitude,t.index_audit,t.index_make,t.index_overall,to_char(t.createtime, 'yyyy/mm/dd hh24:ss:mi') as evaluatetime,
                                    t.hall_comment,to_char(t.hall_time, 'yyyy/mm/dd hh24:mi:ss') as hall_time,t.dock_comment,to_char(t.dock_time, 'yyyy/mm/dd hh24:ss:mi') as dock_time,t.gate_comment,to_char(t.gate_time, 'yyyy/mm/dd hh24:ss:mi') as gate_time 
                                    from ser_evaluate t where t.id='{0}'",
                                  strId);
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathCGate).ExecuteTable(strSql);
                if (dt.Rows.Count <= 0)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, null).DicInfo());
                    return;
                }

                string[] strArray = new string[18];

                strArray[0] = Convert.ToString(dt.Rows[0]["id"]);
                strArray[1] = Convert.ToString(dt.Rows[0]["veh_attest_no"]);
                strArray[2] = Convert.ToString(dt.Rows[0]["driverphone"]);
                string strExplain = string.Empty;
                if (!string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[0]["hall_time"])) || !string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[0]["dock_time"])) || !string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[0]["gate_time"])))
                {
                    strExplain = "有说明";
                }
                strArray[3]  = strExplain;
                strArray[4]  = Convert.ToString(dt.Rows[0]["evaluate_hall"]);
                strArray[5]  = Convert.ToString(dt.Rows[0]["evaluate_dock"]);
                strArray[6]  = Convert.ToString(dt.Rows[0]["evaluate_gate"]);
                strArray[7]  = GetChineseEvaluate(Convert.ToInt16(dt.Rows[0]["index_attitude"]));
                strArray[8]  = GetChineseEvaluate(Convert.ToInt16(dt.Rows[0]["index_audit"]));
                strArray[9]  = GetChineseEvaluate(Convert.ToInt16(dt.Rows[0]["index_make"]));
                strArray[10] = GetChineseEvaluate(Convert.ToInt16(dt.Rows[0]["index_overall"]));
                strArray[11] = Convert.ToString(dt.Rows[0]["evaluatetime"]);
                strArray[12] = Convert.ToString(dt.Rows[0]["hall_comment"]);
                strArray[13] = Convert.ToString(dt.Rows[0]["hall_time"]);
                strArray[14] = Convert.ToString(dt.Rows[0]["dock_comment"]);
                strArray[15] = Convert.ToString(dt.Rows[0]["dock_time"]);
                strArray[16] = Convert.ToString(dt.Rows[0]["gate_comment"]);
                strArray[17] = Convert.ToString(dt.Rows[0]["gate_time"]);

                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());
            }
        }
Exemplo n.º 11
0
        /// <summary>
        /// 保存班组
        /// </summary>
        /// <param name="strGbno">TallyBillE对象</param>
        /// <returns></returns>
        private string SaveWorkTeam(TallyBillE tb)
        {
            string strJson = string.Empty;

            if (tb.TeamWorkData != string.Empty)
            {
                List <TeamWork> listTeamWork = JsonConvert.DeserializeObject <List <TeamWork> >(tb.TeamWorkData);
                for (int iList = 0; iList < listTeamWork.Count; iList++)
                {
                    Nullable <int>     amount = null;
                    Nullable <decimal> weight = null;
                    Nullable <decimal> count  = null;
                    TeamWork           tw     = listTeamWork[iList];

                    /*
                     *判断班组是否被选中,
                     * 1选中:判断是否已经存在;存在,更新;不存在,插入;
                     * 2未选中:判断是否已经存在;存在,删除;不存在,不用管;
                     */
                    string strFilter = string.Format(" where tbno='{0}' and pmno='{1}' and code_workteam='{2}' and workno='{3}'", tb.Tbno, tb.Pmno, tw.code_workteam, tw.workno);
                    string strSql    = string.Format("select * from TB_TALLY_WORKER{0}", strFilter);
                    var    dt        = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCHarbor).ExecuteTable(strSql);
                    if (tw.select == "1")
                    {
                        if (string.IsNullOrWhiteSpace(tw.begintime) || string.IsNullOrWhiteSpace(tw.endtime))
                        {
                            strJson = JsonConvert.SerializeObject(new DicPackage(false, null, "班组起、至时间不能为空!").DicInfo());
                            return(strJson);
                        }
                        if (!TokenTool.VerifyHoursAndMinute(tw.begintime) || !TokenTool.VerifyHoursAndMinute(tw.endtime))
                        {
                            strJson = JsonConvert.SerializeObject(new DicPackage(false, null, "班组起、至时间格式不正确!").DicInfo());
                            return(strJson);
                        }

                        strJson = VerifyAndSetQuantityData(tw.amount, tw.weight, tw.count, ref amount, ref weight, ref count);
                        if (!string.IsNullOrWhiteSpace(strJson))
                        {
                            return(strJson);
                        }
                        Nullable <decimal> strWeightConfirm = tb.Mark_finish == '1' ? count : null;

                        if (dt.Rows.Count > 0)//已存在,更新
                        {
                            strSql =
                                string.Format(@"update TB_TALLY_WORKER set start_time='{0}',end_time='{1}',amount='{2}',weight='{3}',worknum='{4}',weight_confirm='{5}',modifytime=to_date('{6}','yyyy-mm-dd hh24:mi:ss'),modifier='{7}',modifiername='{8}'",
                                              tw.begintime.Remove(2, 1), tw.endtime.Remove(2, 1), amount, weight, count, strWeightConfirm, tb.AuditTime, tb.Creator, tb.Creatorname);
                        }
                        else//不存在,插入
                        {
                            strSql =
                                string.Format(@"insert into TB_TALLY_WORKER(pmno,tbno,code_workteam,workno,start_time,end_time,amount,weight,worknum,code_department,weight_confirm,createtime,creator,creatorname)
                                                values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}',to_date('{11}','yyyy-mm-dd hh24:mi:ss'),'{12}','{13}')",
                                              tb.Pmno, tb.Tbno, tw.code_workteam, tw.workno, tw.begintime.Remove(2, 1), tw.endtime.Remove(2, 1), amount, weight, count, tb.Code_Department, strWeightConfirm, tb.AuditTime, tb.Creator, tb.Creatorname);
                        }
                    }
                    else
                    {
                        if (dt.Rows.Count > 0)//已存在,删除
                        {
                            strSql =
                                string.Format("delete from TB_TALLY_WORKER{0}", strFilter);
                        }
                    }
                    da.ExecuteNonQuery(strSql);
                }
            }

            return(strJson);
        }
Exemplo n.º 12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ////http://218.92.115.55/M_Lhgl/Service/Slip/SaveTallyBill.aspx
            var codeCompany    = Request.Params["CodeCompany"];
            var codeDepartment = Request.Params["CodeDepartment"];
            var pmno           = Request.Params["Pmno"];
            var cgno           = Request.Params["Cgno"];
            var codeTallyman   = Request.Params["CodeTallyman"];
            var tallyman       = Request.Params["Tallyman"];
            var vgno           = Request.Params["Vgno"];
            var cabin          = Request.Params["Cabin"];
            var codeCarrier    = Request.Params["CodeCarrier"];
            var carrierNum     = Request.Params["CarrierNum"];
            var codeNvessel    = Request.Params["CodeNvessel"];
            var bargepro       = Request.Params["Bargepro"];
            var codeStorage    = Request.Params["CodeStorage"];
            var codeBooth      = Request.Params["CodeBooth"];
            var codeAllocation = Request.Params["CodeAllocation"];
            var allocation     = Request.Params["Allocation"].Trim();
            //var allocation = Request.Params["CodeAllocation"];
            var carrier1           = Request.Params["Carrier1"];
            var carrier1Num        = Request.Params["Carrier1Num"];
            var vgnoLast           = Request.Params["VgnoLast"];
            var cabinLast          = Request.Params["CabinLast"];
            var codeCarrierLast    = Request.Params["CodeCarrierLast"];
            var carrierNumLast     = Request.Params["CarrierNumLast"];
            var codeNvesselLast    = Request.Params["CodeNvesselLast"];
            var bargeproLast       = Request.Params["BargeproLast"];
            var codeStorageLast    = Request.Params["CodeStorageLast"];
            var codeBoothLast      = Request.Params["CodeBoothLast"];
            var codeAllocationLast = Request.Params["CodeAllocationLast"].Trim();
            var allocationLast     = Request.Params["AllocationLast"].Trim();
            //var allocationLast = Request.Params["CodeAllocationLast"].Trim();
            var carrier2            = Request.Params["Carrier2"];
            var carrier2Num         = Request.Params["Carrier2num"];
            var codeGoodsBill       = Request.Params["CodeGoodsBill"];
            var goodsBillDisplay    = Request.Params["GoodsBillDisplay"];
            var codeGbBusiness      = Request.Params["CodeGbBusiness"];
            var gbBusinessDisplay   = Request.Params["GbBusinessDisplay"];
            var codeSpecialMark     = Request.Params["CodeSpecialMark"];
            var codeWorkingArea     = Request.Params["CodeWorkingArea"];
            var codeWorkingAreaLast = Request.Params["CodeWorkingAreaLast"];
            var quality             = Request.Params["Quality"];
            var amount            = Request.Params["Amount"].Trim();
            var weight            = Request.Params["Weight"].Trim();
            var count             = Request.Params["Count"].Trim();
            var amount2           = Request.Params["Amount2"].Trim();
            var weight2           = Request.Params["Weight2"].Trim();
            var count2            = Request.Params["Count2"].Trim();
            var trainNum          = Request.Params["TrainNum"].Trim();
            var machine           = Request.Params["Machine"];
            var workTeam          = Request.Params["WorkTeam"];
            var tbno              = Request.Params["Tbno"].Trim();
            var markFinish        = Request.Params["MarkFinish"].Trim();
            var codeOperationFact = Request.Params["CodeOperationFact"];

            tallyman = "PDA测试员";

//            string message = string.Format(@"vgno:'{0}', cabin:'{1}', codeCarrier:'{2}', carrierNum:'{3}',codeNvessel:'{4}',
//                                             bargepro:'{5}',codeStorage:'{6}',codeBooth:'{7}',codeAllocation:'{8}', +
//                                             vgnoLast:'{9}', cabinLast:'{10}', codeCarrierLast:'{11}', carrierNumLast:'{12}',codeNvesselLast:'{13}',
//                                             bargeproLast:'{14}',codeStorageLast:'{15}',codeBoothLast:'{16}',codeAllocationLast:'{17}' , +
//                                             carrier1:'{18}', carrier1Num:'{19}', carrier2:'{20}', carrier2Num:'{21}'",
//                                             vgno, cabin, codeCarrier, carrierNum, codeNvessel, bargepro, codeStorage, codeBooth, codeAllocation, vgnoLast, cabinLast, codeCarrierLast, carrierNumLast, codeNvesselLast, bargeproLast, codeStorageLast, codeBoothLast, codeAllocationLast, carrier1, carrier1Num, carrier2, carrier2Num);

//            Json = JsonConvert.SerializeObject(new DicPackage(false, null, message).DicInfo());
//            return;

            ////测试
            //codeCompany = "14";
            //codeDepartment = "24";
            //pmno = "20151010000161";
            //cgno = "d1bff20fa2d54a0b87e4385a5cb46914";
            //codeTallyman = "227";
            //tallyman = "申";
            //vgno = "20151003000002";
            //cabin = "";
            //codeCarrier = "";
            //carrierNum = "";
            //CodeNvessel = "";
            //bargepro = "";
            //codeStorage = "1";
            //codeBooth = "185";
            //codeAllocation = "";
            //carrier1 = "中韩之星_2099999";
            //carrier1Num = "";
            //vgnoLast = "";
            //cabinLast = "";
            //codeCarrierLast = "";
            //carrierNumLast = "";
            //codeNvesselLast = "";
            //bargeproLast = "";
            //codeStorageLast = "111";
            //codeBoothLast = "183";
            //codeAllocationLast = "";
            //carrier2 = "009场";
            //carrier2Num = "无";
            //codeGoodsBill = "1facb087e4654ddead033fb25552e358";
            //goodsBillDisplay = "淮钢/铁矿石/散/0吨/进口/内贸/中韩之星_20151003_1/b/0/12232";
            //codeGbBusiness = "1facb087e4654ddead033fb25552e358";
            //gbBusinessDisplay = "淮钢/铁矿石/散/0吨/进口/内贸/中韩之星_20151003_1/b/0/12232";
            //codeSpecialMark = "";
            //codeWorkingArea = "";
            //codeWorkingAreaLast = "";
            //quality = "合格";
            //amount = "123";
            //weight = "123.4";
            //count = Request.Params["Count"];
            //amount2 = Request.Params["Amount2"];
            //weight2 = Request.Params["Weight2"];
            //count2 = Request.Params["Count2"];
            //machine = Request.Params["Machine"];
            //workTeam = Request.Params["WorkTeam"];
            //trainNum = "23";
            //tbno = "20151112064082";
            ////tbno = string.Empty;
            //markFinish = "1";

            //var codeCompany = "14";
            //var codeDepartment = "24";
            //var pmno = "20151010000161";
            //var cgno = "d1bff20fa2d54a0b87e4385a5cb46914";
            //var codeTallyman = "227";
            //var tallyman = "薛辉";
            //var vgno = "20151003000002";
            //var cabin = "";
            //var codeCarrier = "";
            //var carrierNum = "";
            //var codeNvessel = "";
            //var bargepro = "";
            //var codeStorage = "";
            //var codeBooth = "";
            //var codeAllocation = "";
            //var carrier1 = "中韩之星_2099999";
            //var carrier1Num = "";
            //var vgnoLast = "";
            //var cabinLast = "";
            //var codeCarrierLast = "";
            //var carrierNumLast = "";
            //var codeNvesselLast = "";
            //var bargeproLast = "";
            //var codeStorageLast = "";
            //var codeBoothLast = "";
            //var codeAllocationLast = "";
            //var carrier2 = "";
            //var carrier2Num = "";
            //var codeGoodsBill = "1facb087e4654ddead033fb25552e358";
            //var goodsBillDisplay = "淮钢/铁矿石/散/0吨/进口/内贸/中韩之星_20151003_1/b/0/12232";
            //var codeGbBusiness = "";
            //var gbBusinessDisplay = "";
            //var codeSpecialMark = "101";
            //var codeWorkingArea = "66D0FE5D86DB45AFB4B572C9AF09D939";
            //var codeWorkingAreaLast = "66D0FE5D86DB45AFB4B572C9AF09D939";
            //var quality = "合格";
            //var amount = "10";
            //var weight = "123";
            //var count = "11";
            //var amount2 = "";
            //var weight2 = "";
            //var count2 = "";
            ////var machine = "[{\"endtime\"1412\"\",\"amount\":\"\",\"pmno\":\"20151021000241\",\"weight\":\"\",\"workno\":\"\",\"count\":\"\",\"begintime\":\"1512\",\"select\":\"1\",\"name\":\"111\",\"code_machine\":\"2C-6-11\",\"machine\":\"6t叉车\"},{\"endtime\":\"\",\"amount\":\"\",\"pmno\":\"20151021000241\",\"weight\":\"\",\"workno\":\"\",\"count\":\"\",\"begintime\":\"\",\"select\":\"1\",\"name\":\"\",\"code_machine\":\"2Q-25-01\",\"machine\":\"牵引车\"}]";
            //var machine = "[{\"endtime\":\"15:33\",\"amount\":\"11\",\"pmno\":\"20151010000161\",\"weight\":\"12.3\",\"workno\":\"3\",\"count\":\"\",\"begintime\":\"14:12\",\"select\":\"1\",\"name\":\"\",\"code_machine\":\"2ZJK-2D-12\",\"machine\":\"集卡\"}]";
            //var workTeam = "";
            //var trainNum = "";
            ////var tbno = "20151112064117";
            //var tbno = string.Empty;
            //var markFinish = "0";


            //调发货标志
            string     strMarkExchange        = string.Empty;
            string     strTallydate           = string.Empty;
            string     strTaskNo              = string.Empty;
            string     strGbno                = string.Empty;
            string     strGbdisplay           = string.Empty;
            string     strGbnolast            = string.Empty;
            string     strGbdisplaylast       = string.Empty;
            string     strCodeMeasure         = string.Empty;
            string     strCodeOpstype         = string.Empty;
            string     strCodeBillType        = string.Empty;
            string     strGbnoFromStock       = string.Empty;
            string     strCodeStorageStock    = string.Empty;
            string     strCodeBoothStock      = string.Empty;
            string     strCodeAllocationStock = string.Empty;
            string     strGbnoFirst           = string.Empty;
            string     strCodeOperation       = string.Empty;
            string     strCodeOperationFact   = string.Empty;
            string     strCodeOpstypeFact     = string.Empty;
            string     strCodeWorkflow        = string.Empty;
            string     strCodeWorkTime        = string.Empty;
            string     strCodeTeamType        = string.Empty;
            string     strCodeTrainRode       = string.Empty;
            string     strCodeMotorcade       = string.Empty;
            string     strBeginTime           = string.Empty;
            string     strEndTime             = string.Empty;
            string     strNsnoBarge           = string.Empty;
            string     strNsnoBargeLast       = string.Empty;
            DateTime   strCurTime             = DateTime.Now;
            TallyBillE tallybille             = new TallyBillE();

            try
            {
                //获取调发货标志
                string strSql =
                    string.Format("select mark_exchange,mark_last from vw_hc_consign where cgno='{0}'", cgno);
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCHarbor).ExecuteTable(strSql);
                if (dt.Rows.Count > 0)
                {
                    strMarkExchange = Convert.ToString(dt.Rows[0]["mark_exchange"]);;
                }

                //获取理货日期、进出库类别代码、分解过程的进出库类别代码
                strSql =
                    string.Format(@"select code_storage,code_storagelast,mark_tallybill,code_operation,code_operation_fact,CODE_CARRIER_S,CODE_CARRIER_E,vgdisplay,vgno,cabin,code_carrier,nvessel,
                                        code_nvessel,carrier1,nsno,tallydate,code_opstype,code_workflow,code_worktime,code_teamtype,code_trainroad,code_motorcade,begintime,endtime,nsno_barge,nsno_bargelast          
                                        from vw_ps_mission where pmno='{0}'",
                                  pmno);
                dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCHarbor).ExecuteTable(strSql);
                if (dt.Rows.Count > 0)
                {
                    strTallydate         = Convert.ToString(dt.Rows[0]["tallydate"]);
                    strCodeOpstype       = Convert.ToString(dt.Rows[0]["code_opstype"]);
                    strCodeOpstypeFact   = Convert.ToString(dt.Rows[0]["code_opstype"]);
                    strCodeWorkflow      = Convert.ToString(dt.Rows[0]["code_workflow"]);
                    strCodeWorkTime      = Convert.ToString(dt.Rows[0]["code_worktime"]);
                    strCodeTeamType      = Convert.ToString(dt.Rows[0]["code_teamtype"]);
                    strCodeTrainRode     = Convert.ToString(dt.Rows[0]["code_trainroad"]);
                    strCodeMotorcade     = Convert.ToString(dt.Rows[0]["code_motorcade"]);
                    strBeginTime         = Convert.ToString(dt.Rows[0]["begintime"]);
                    strEndTime           = Convert.ToString(dt.Rows[0]["endtime"]);
                    strNsnoBarge         = Convert.ToString(dt.Rows[0]["nsno_barge"]);
                    strNsnoBargeLast     = Convert.ToString(dt.Rows[0]["nsno_bargelast"]);
                    strCodeOperation     = Convert.ToString(dt.Rows[0]["code_operation"]);
                    strCodeOperationFact = Convert.ToString(dt.Rows[0]["code_operation_fact"]);
                }

                //获取任务号、目的票货编码、目的票货描述
                strSql =
                    string.Format(@"select GBDISPLAY,GBNO,MARK_EXCHANGE,HZGOODSBILL,MARK_LAST,CODE_CARRIER_S,CODE_CARRIER_E,TASKNO from VW_HC_CONSIGN_GBNO where code_company='{0}' and cgno='{1}'",
                                  codeCompany, cgno);
                dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCHarbor).ExecuteTable(strSql);
                if (dt.Rows.Count > 0)
                {
                    strTaskNo = Convert.ToString(dt.Rows[0]["taskno"]);
                }

                strGbnolast      = codeGbBusiness;
                strGbdisplaylast = gbBusinessDisplay;

                //获取计量单位编码、票货类型、源票货编码、源票货描述....
                strSql =
                    string.Format(@"select code_measure from tb_hc_goodsbill where gbno='{0}'",
                                  codeGoodsBill);
                dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCHarbor).ExecuteTable(strSql);
                if (dt.Rows.Count > 0)
                {
                    strCodeMeasure = Convert.ToString(dt.Rows[0]["code_measure"]);
                }

                strCodeBillType = "0";
                strGbno         = codeGoodsBill;
                strGbdisplay    = goodsBillDisplay;

                //校验和赋值货位(堆)数据
                Json = VerifyAndSetAllocationData(codeCompany, codeStorage, allocation, codeBooth, strCodeOpstype, ref codeAllocation);
                if (!string.IsNullOrWhiteSpace(Json))
                {
                    return;
                }
                Json = VerifyAndSetAllocationData(codeCompany, codeStorageLast, allocationLast, codeBoothLast, strCodeOpstype, ref codeAllocationLast);
                if (!string.IsNullOrWhiteSpace(Json))
                {
                    return;
                }

                if (strMarkExchange == "1")//调发货
                {
                    strGbno      = codeGbBusiness;
                    strGbdisplay = gbBusinessDisplay;

                    //strSql =
                    //       string.Format("select gbno,exdisplay,gbdisplay,code_storage,code_booth,storage,booth from vw_hc_consign_adjust2 where cgno='{0}'", cgno);
                    //dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathZCHarbor).ExecuteTable(strSql);
                    //if (dt.Rows.Count > 0)
                    //{
                    //    codeStorage = Convert.ToString(dt.Rows[0]["code_storage"]);
                    //    codeBooth = Convert.ToString(dt.Rows[0]["code_booth"]);
                    //    carrier1 = Convert.ToString(dt.Rows[0]["storage"]);
                    //    carrier1Num = Convert.ToString(dt.Rows[0]["booth"]);
                    //}

                    //codeStorage = Convert.ToString(dt.Rows[0]["code_storage"]);
                    //codeBooth = Convert.ToString(dt.Rows[0]["code_booth"]);
                    //carrier1 = Convert.ToString(dt.Rows[0]["storage"]);
                    //carrier1Num = Convert.ToString(dt.Rows[0]["booth"]);

                    strGbnoFromStock    = codeGoodsBill;
                    strCodeStorageStock = codeStorage;
                    strCodeBoothStock   = codeBooth;

                    if (strCodeOpstype == "1")//作业方式属于进港
                    {
                        //判断是否已存在,存在返回编码,不存在则插入,并取回生成的编码
                        strCodeAllocationStock = InsertAllocation(codeCompany, strCodeStorageStock, allocation, strCodeBoothStock);
                    }
                    else
                    {
                        strCodeAllocationStock = codeAllocation;
                    }
                }


                //获取原始票货编码
                strGbnoFirst = GetGbnofirst(strGbno);
                //获取理货单编码
                if (markFinish == "0" && string.IsNullOrWhiteSpace(tbno))
                {
                    tbno = GetTbno();
                }
                if (markFinish == "1" && string.IsNullOrWhiteSpace(tbno))
                {
                    tbno = GetTbno();
                }

                //赋值
                tallybille.Code_Company         = codeCompany;
                tallybille.Code_Department      = codeDepartment;
                tallybille.Cgno                 = cgno;
                tallybille.Pmno                 = pmno;
                tallybille.Code_Tallyman        = codeTallyman;
                tallybille.Tallyman             = tallyman;
                tallybille.Vgno                 = vgno;
                tallybille.Cabin                = cabin;
                tallybille.Code_Carrier         = codeCarrier;
                tallybille.Carriernum           = carrierNum;
                tallybille.Code_nvessel         = codeNvessel;
                tallybille.Bargepro             = bargepro;
                tallybille.Code_Storage         = codeStorage;
                tallybille.Code_Booth           = codeBooth;
                tallybille.code_allocation      = codeAllocation;
                tallybille.Carrier1             = carrier1;
                tallybille.Carrier1num          = carrier1Num;
                tallybille.Vgnolast             = vgnoLast;
                tallybille.Cabinlast            = cabinLast;
                tallybille.Code_Carrierlast     = codeCarrierLast;
                tallybille.Carriernumlast       = carrierNumLast;
                tallybille.Code_nvessellast     = codeNvesselLast;
                tallybille.Bargeprolast         = bargeproLast;
                tallybille.Code_Storagelast     = codeStorageLast;
                tallybille.Code_Boothlast       = codeBoothLast;
                tallybille.code_allocationlast  = codeAllocationLast;
                tallybille.Carrier2             = carrier2;
                tallybille.Carrier2num          = carrier2Num;
                tallybille.Code_SpecialMark     = codeSpecialMark;
                tallybille.code_workingarea     = codeWorkingArea;
                tallybille.code_workingarealast = codeWorkingAreaLast;
                tallybille.Code_Quality         = quality == "合格" ? "01" : "02";
                tallybille.Creator              = codeTallyman;
                tallybille.Creatorname          = tallyman;
                tallybille.Carrier1A            = allocation;
                tallybille.Carrier2A            = allocationLast;

                tallybille.Signdate          = Convert.ToDateTime(strTallydate);
                tallybille.Tallydate         = Convert.ToDateTime(strTallydate);
                tallybille.Code_Opstype      = strCodeOpstype;
                tallybille.Code_opstype_fact = strCodeOpstypeFact;
                tallybille.Code_workflow     = strCodeWorkflow;
                tallybille.Code_Worktime     = strCodeWorkTime;
                tallybille.Code_Teamtype     = strCodeTeamType;
                tallybille.Code_trainroad    = strCodeTrainRode;
                tallybille.Code_motorcade    = strCodeMotorcade;
                tallybille.Begintime         = strBeginTime;
                tallybille.Endtime           = strEndTime;
                tallybille.NSNO_BARGE        = strNsnoBarge;
                tallybille.NSNO_BARGELAST    = strNsnoBargeLast;
                tallybille.Taskno            = strTaskNo;
                tallybille.Gbnolast          = strGbnolast;
                tallybille.Gbdisplaylast     = strGbdisplaylast;
                tallybille.Gbno                 = strGbno;
                tallybille.Gbdisplay            = strGbdisplay;
                tallybille.Code_billtype        = strCodeBillType;
                tallybille.Gbnofromstock        = strGbnoFromStock;
                tallybille.Code_Storage_Stock   = strCodeStorageStock;
                tallybille.Code_Booth_Stock     = strCodeBoothStock;
                tallybille.code_allocationstock = strCodeAllocationStock;
                tallybille.Gbnofirst            = strGbnoFirst;
                tallybille.Code_Operation       = strCodeOperation;
                tallybille.Code_Operation_Fact  = strCodeOperationFact;
                tallybille.Tbno                 = tbno;
                tallybille.Mark_finish          = Convert.ToChar(markFinish);
                tallybille.MachineData          = machine;
                tallybille.TeamWorkData         = workTeam;
                tallybille.Mark_Audit           = "1";
                tallybille.AuditTime            = strCurTime;
                tallybille.Auditor              = codeTallyman;
                tallybille.Auditorname          = tallyman;

                //Json = JsonConvert.SerializeObject(new DicPackage(false, null, machine + '+' + workTeam).DicInfo());
                //return;
                //Json = JsonConvert.SerializeObject(new DicPackage(false, null, amount + weight).DicInfo());

                //校验和赋值数量数据
                Json = VerifyAndSetQuantityData(amount, amount2, weight, count, trainNum, ref tallybille);
                if (!string.IsNullOrWhiteSpace(Json))
                {
                    return;
                }

                da.BeginTransaction();
                //暂存或提交数据
                if (tallybille.Mark_finish == '1')//提交
                {
                    if (!SaveTB(tallybille))
                    {
                        Json = JsonConvert.SerializeObject(new DicPackage(false, null, "提交失败!").DicInfo());
                    }
                    Json = SaveMachine(tallybille);
                    if (!string.IsNullOrWhiteSpace(Json))
                    {
                        return;
                    }
                    Json = SaveWorkTeam(tallybille);
                    if (!string.IsNullOrWhiteSpace(Json))
                    {
                        return;
                    }
                    //if (!AuditTB(tallybille))
                    //{
                    //    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "提交失败!").DicInfo());
                    //}

                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, "提交成功!").DicInfo());
                }
                else//暂存
                {
                    if (!SaveTB(tallybille))
                    {
                        Json = JsonConvert.SerializeObject(new DicPackage(false, null, "暂存失败!").DicInfo());
                    }
                    Json = SaveMachine(tallybille);
                    if (!string.IsNullOrWhiteSpace(Json))
                    {
                        return;
                    }
                    Json = SaveWorkTeam(tallybille);
                    if (!string.IsNullOrWhiteSpace(Json))
                    {
                        return;
                    }

                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, "暂存成功!").DicInfo());
                }
                da.CommitTransaction();

                //string strKeyPath = "Software\\HarborSoft\\NHarborService";
                //new DataAccessC(strKeyPath).GetDataSetByStoredProcedure("{ call  PK_TALLYBILL_ACCOUNT.P_TALLYBILL_PIECERATE_MATCH('" + tallybille.Tbno + "')}");
            }
            catch (Exception ex)
            {
                da.RollbackTransaction();
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, string.Format("{0}:提交数据发生异常。{1}", ex.Source, ex.Message)).DicInfo());
            }
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //账号
            var account = Request.Params["Account"];
            //交易源ID(货源ID)
            var originId = Request.Params["OriginId"];

            Dictionary <string, string> info = new Dictionary <string, string>();

            try
            {
                if (account == null || originId == null)
                {
                    info.Add("参数Account,OriginId不能为空!举例", "http://218.92.115.55/M_Sph/Deal/DealForDriver.aspx?Account=1F4BA283C3F95122E053A86401695122&OriginId=944");
                    Json = JsonConvert.SerializeObject(info);
                    return;
                }

                //查询此货物是否已结束交易
                string sql =
                    string.Format("select MARK_DEAL from TB_SPH_ORDER where CODE_CARGO_SOURCE = '{0}' and CODE_USER_SECOND='{1}'", originId, account);
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathWlxgx).ExecuteTable(sql);
                if (dt.Rows.Count == 0)
                {
                    info.Add("IsDeal", "No");
                    info.Add("Message", "网络错误,请稍后再试!");
                    Json = JsonConvert.SerializeObject(info);
                    return;
                }
                else
                {
                    if (dt.Rows[0]["MARK_DEAL"].ToString() == "1")
                    {
                        info.Add("IsDeal", "No");
                        info.Add("Message", "网络错误,请稍后再试!");
                        Json = JsonConvert.SerializeObject(info);
                        return;
                    }
                }

                da.BeginTransaction();
                //更新乙方订单记录
                Json = UpdateSecondOrderRecord(account, originId);
                if (Json != string.Empty)
                {
                    return;
                }
                //更新货源交易标志(货源表)
                Json = UpdateCargoSourceDealMark(originId);
                if (Json != string.Empty)
                {
                    return;
                }

                ////甲方账号
                //string firstAccount = dt.Rows[0]["firstaccount"].ToString();
                ////交易金额
                //string amount = dt.Rows[0]["amount"].ToString();

                ////获取甲方交易后余额
                //sql =
                //    string.Format("select * from TB_YGPH_FUND where account='{0}' and roletype='{1}' order by dealtime desc", firstAccount, "2");
                //dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathHmw).ExecuteTable(sql);
                //if (dt.Rows.Count == 0)
                //{
                //    info.Add("IsDeal", "No");
                //    info.Add("Message", "网络错误,请稍后再试!");
                //    Json = JsonConvert.SerializeObject(info);
                //    return;
                //}
                //string firstBalance =  Convert.ToString( Convert.ToDouble(dt.Rows[0]["balance"]) - Convert.ToDouble(amount));
                ////获取乙方交易后余额
                //sql =
                //    string.Format("select * from TB_YGPH_FUND where account='{0}' and roletype='{1}' order by dealtime desc", account, "1");
                //dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathHmw).ExecuteTable(sql);
                //if (dt.Rows.Count == 0)
                //{
                //    info.Add("IsDeal", "No");
                //    info.Add("Message", "网络错误,请稍后再试!");
                //    Json = JsonConvert.SerializeObject(info);
                //    return;
                //}
                //string secondBalance =  Convert.ToString( Convert.ToDouble(dt.Rows[0]["balance"]) + Convert.ToDouble(amount));

                ////插入资金交易记录
                ////甲方(货主)为支出
                //sql =
                //    string.Format("insert into TB_YGPH_FUND (account,expense,balance,dealtime,roletype,content) values('{0}','{1}','{2}',to_date('{3}','YYYY-MM-DD HH24:MI:SS'),'{4}','{5}')", firstAccount, amount, firstBalance, DateTime.Now, "1", "交易");
                //dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathHmw).ExecuteTable(sql);
                ////乙方(司机)为收入
                //sql =
                //  string.Format("insert into TB_YGPH_FUND (account,income,balance,dealtime,roletype,content) values('{0}','{1}','{2}',to_date('{3}','YYYY-MM-DD HH24:MI:SS'),'{4}','{5}')", account, amount, secondBalance, DateTime.Now, "2", "交易");
                //dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathHmw).ExecuteTable(sql);

                info.Add("IsDeal", "Yes");
                info.Add("Message", "交易成功!");
                Json = JsonConvert.SerializeObject(info);
                da.CommitTransaction();
            }
            catch (Exception ex)
            {
                info.Add("IsDeal", "No");
                info.Add("Message", string.Format("{0}:提交数据发生异常。{1}", ex.Source, ex.Message));
                Json = JsonConvert.SerializeObject(info);
                da.RollbackTransaction();
            }
        }
Exemplo n.º 14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //身份校验
            if (!InterfaceTool.IdentityVerify(Request))
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, "身份认证错误").DicInfo());
                return;
            }

            //ID
            string strId = Request.Params["Id"];

            //strId = "6";

            try
            {
                if (strId == null)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "参数错误,获取问题详情数据失败").DicInfo());
                    return;
                }

                //获取问题详情
                string strSql =
                    string.Format(@"select a.id,a.type_mark,c.complain_name,b.department,a.vehicle,a.driverphone,to_char(a.createtime, 'yyyy/mm/dd hh24:mi:ss') as createtime,a.anonymous_mark,a.finish_mark,a.title,a.detail,a.deal_result,to_char(a.deal_time, 'yyyy/mm/dd hh24:ss:mi') as deal_time,a.evaluate,a.index_satisfy,to_char(a.evaluate_time, 'yyyy/mm/dd hh24:mi:ss') as evaluate_time,a.adjust_time,e.complain_name as complain_name_org,d.department as department_org
                                    from SER_COMPLAIN a
                                    left join HARBOR.V_SYS_DEPART_CONVERT b on a.code_company=b.code_department
                                    left join SER_CODE_COMPLAIN c on a.code_complain=c.code_complain
                                    left join HARBOR.V_SYS_DEPART_CONVERT d on a.code_company_org=d.code_department
                                    left join SER_CODE_COMPLAIN e on a.code_complain_org=e.code_complain
                                    where a.id='{0}'
                                    order by a.finish_mark asc,a.createtime desc",
                                  strId);
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathCGate).ExecuteTable(strSql);
                if (dt.Rows.Count <= 0)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, null).DicInfo());
                    return;
                }

                string[] strArray = new string[16];

                strArray[0] = Convert.ToString(dt.Rows[0]["id"]);
                string strType = Convert.ToString(dt.Rows[0]["type_mark"]).Equals("0") == true ? "投诉" : "问题";
                strArray[1] = strType;
                string strComplain_Name = Convert.ToString(dt.Rows[0]["complain_name_org"]);
                string strDepartment    = Convert.ToString(dt.Rows[0]["department_org"]);
                if (!string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[0]["complain_name"])))
                {
                    strComplain_Name = Convert.ToString(dt.Rows[0]["complain_name"]);
                    strDepartment    = Convert.ToString(dt.Rows[0]["department"]);
                }
                strArray[2] = strComplain_Name;
                strArray[3] = strDepartment;
                strArray[4] = Convert.ToString(dt.Rows[0]["vehicle"]);
                strArray[5] = Convert.ToString(dt.Rows[0]["driverphone"]);
                strArray[6] = Convert.ToString(dt.Rows[0]["createtime"]);
                string strAnonymous = Convert.ToString(dt.Rows[0]["anonymous_mark"]).Equals("0") == true ? "" : "匿名";
                strArray[7] = strAnonymous;
                string strState = string.Empty;
                if (!string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[0]["evaluate_time"])))
                {
                    strState = "已评价";
                }
                else if (!string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[0]["deal_time"])))
                {
                    strState = "已解决";
                }
                else if (!string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[0]["adjust_time"])))
                {
                    strState = "已受理";
                }
                else
                {
                    strState = "待受理";
                }

                strArray[8]  = strState;
                strArray[9]  = Convert.ToString(dt.Rows[0]["title"]);
                strArray[10] = Convert.ToString(dt.Rows[0]["detail"]);
                strArray[11] = Convert.ToString(dt.Rows[0]["deal_result"]);
                strArray[12] = Convert.ToString(dt.Rows[0]["deal_time"]);
                strArray[13] = Convert.ToString(dt.Rows[0]["evaluate"]);
                string strIndex_satisfy = string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[0]["index_satisfy"])) == true ? string.Empty : GetChineseEvaluate(Convert.ToInt16(dt.Rows[0]["index_satisfy"]));
                strArray[14] = strIndex_satisfy;
                strArray[15] = Convert.ToString(dt.Rows[0]["evaluate_time"]);

                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());
            }
        }
Exemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //身份校验
            if (!InterfaceTool.IdentityVerify(Request))
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, "身份认证错误").DicInfo());
                return;
            }

            //数据起始行
            var strStartRow = Request.Params["StartRow"];
            //数据结束行
            var strEndRow = Request.Params["EndRow"];
            //账户
            string strAccount = Request.Params["Account"];

            //strStartRow = "1";
            //strEndRow = "15";
            //strAccount = "18936578716";

            try
            {
                if (strStartRow == null || strEndRow == null || strAccount == null)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "参数错误,获取待评价列表数据失败").DicInfo());
                    return;
                }

                //获取待评价列表数据
                string strSql =
                    string.Format(@"select a.id,a.ingateno,b.fullorempty,b.vessel,b.cargo,a.vehicle,to_char(a.submittime, 'yyyy/mm/dd hh24:mi') as submittime,b.department 
                                    from TB_PRO_CONSIGNVEHICLE a, V_CONSIGN_QUICK b 
                                    where a.cgno=b.cgno and a.driverphone='{0}' and a.delete_mark_ser_evaluate='0'
                                    order by a.submittime desc",
                                  strAccount);
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathHarbor).ExecuteTable(strSql, Convert.ToInt32(strStartRow), Convert.ToInt32(strEndRow));;
                if (dt.Rows.Count <= 0)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, null).DicInfo());
                    return;
                }

                string[,] strArray = new string[dt.Rows.Count, 7];
                for (int iRow = 0; iRow < dt.Rows.Count; iRow++)
                {
                    strArray[iRow, 0] = Convert.ToString(dt.Rows[iRow]["id"]);
                    strArray[iRow, 1] = Convert.ToString(dt.Rows[iRow]["ingateno"]);
                    strArray[iRow, 2] = Convert.ToString(dt.Rows[iRow]["department"]);
                    strArray[iRow, 3] = Convert.ToString(dt.Rows[iRow]["vessel"]);
                    strArray[iRow, 4] = Convert.ToString(dt.Rows[iRow]["cargo"]);
                    strArray[iRow, 5] = Convert.ToString(dt.Rows[iRow]["vehicle"]);
                    strArray[iRow, 6] = Convert.ToString(dt.Rows[iRow]["submittime"]);
                }



                ////获取待评价列表数据
                //string strSql =
                //    string.Format(@"select a.id,a.ingateno,a.vehicle,to_char(a.submittime, 'yyyy/mm/dd hh24:mi') as submittime,a.cgno
                //                    from TB_PRO_CONSIGNVEHICLE a
                //                    where a.driverphone='{0}' and a.delete_mark_ser_evaluate='0'
                //                    order by a.submittime desc",
                //                    strAccount);
                //var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathHarbor).ExecuteTable(strSql); ;
                //if (dt.Rows.Count <= 0)
                //{
                //    Json = JsonConvert.SerializeObject(new DicPackage(true, null, null).DicInfo());
                //    return;
                //}

                //List<List<string>> listArray = new List<List<string>>();
                //for (int iRow = 0; iRow < dt.Rows.Count; iRow++)
                //{
                //    strSql =
                //        string.Format(@"select b.fullorempty,b.vessel,b.cargo
                //                        from V_CONSIGN_QUICK b
                //                        where  b.cgno='{0}'",
                //                        Convert.ToString(dt.Rows[iRow]["cgno"]));
                //    var dt1 = new Leo.Oracle.DataAccess(RegistryKey.KeyPathHarbor).ExecuteTable(strSql);
                //    if (dt1.Rows.Count > 0)
                //    {
                //        List<string> list = new List<string>();
                //        list.Add(Convert.ToString(dt.Rows[iRow]["id"]));
                //        list.Add(Convert.ToString(dt.Rows[iRow]["ingateno"]));
                //        list.Add(Convert.ToString(dt1.Rows[0]["fullorempty"]));
                //        list.Add(Convert.ToString(dt1.Rows[0]["vessel"]));
                //        list.Add(Convert.ToString(dt1.Rows[0]["cargo"]));
                //        list.Add(Convert.ToString(dt.Rows[iRow]["vehicle"]));
                //        list.Add(Convert.ToString(dt.Rows[iRow]["submittime"]));
                //        listArray.Add(list);
                //    }
                //}

                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());
            }
        }
Exemplo n.º 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //身份校验
            if (!InterfaceTool.IdentityVerify(Request))
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, "身份认证错误").DicInfo());
                return;
            }

            //账户
            string strAccount = Request.Params["Account"];
            //ID
            string strId = Request.Params["Id"];
            //停车办证
            string strParkingCard = Request.Params["ParkingCard"];
            //放行装卸
            string strReleaseCargo = Request.Params["ReleaseCargo"];
            //港区卡口
            string strPortBayonet = Request.Params["PortBayonet"];
            //服务态度
            string strServiceAttitude = Request.Params["ServiceAttitude"];
            //放行速度
            string strReleaseSpeed = Request.Params["ReleaseSpeed"];
            //装卸速度
            string strUninstallSpeed = Request.Params["UninstallSpeed"];
            //总体评价
            string strOverallEvaluation = Request.Params["OverallEvaluation"];


            AppLog log = new AppLog(Request);

            log.strBehavior    = "发布评价";
            log.strBehaviorURL = "/Service/Evaluate/ReleaseEvaluate.aspx";
            log.strAccount     = strAccount;

            try
            {
                if (strAccount == null || strId == null || strParkingCard == null || strReleaseCargo == null || strPortBayonet == null || strServiceAttitude == null || strReleaseSpeed == null || strUninstallSpeed == null || strOverallEvaluation == null)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "参数错误,发布评价失败").DicInfo());
                    return;
                }

                //运输申报编号
                string strVehicleAttestNo = string.Empty;
                //部门
                string strCodeDepartment = string.Empty;
                //车号
                string strVehicle = string.Empty;
                //内部委托号
                string strCgno = string.Empty;
                //纸面委托号
                string strTaskno = string.Empty;
                //货名
                string strCargo = string.Empty;
                //船名
                string strVessel = string.Empty;
                //集疏运类别
                string strFullorempty = string.Empty;
                //手机号
                string strMobile = string.Empty;

                //获取运输申报数据
                string strSql =
                    string.Format(@"select a.ingateno,a.code_department,a.vehicle,a.driverphone,a.cgno,b.taskno,b.cargo,b.vessel,b.fullorempty  
                                    from TB_PRO_CONSIGNVEHICLE a, V_CONSIGN_QUICK b 
                                    where a.cgno=b.cgno and a.id='{0}'",
                                  strId);
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathHarbor).ExecuteTable(strSql);
                if (dt.Rows.Count > 0)
                {
                    strVehicleAttestNo = Convert.ToString(dt.Rows[0]["ingateno"]);
                    strCodeDepartment  = Convert.ToString(dt.Rows[0]["code_department"]);
                    strVehicle         = Convert.ToString(dt.Rows[0]["vehicle"]);
                    strCgno            = Convert.ToString(dt.Rows[0]["cgno"]);
                    strTaskno          = Convert.ToString(dt.Rows[0]["taskno"]);
                    strCargo           = Convert.ToString(dt.Rows[0]["cargo"]);
                    strVessel          = Convert.ToString(dt.Rows[0]["vessel"]);
                    strFullorempty     = Convert.ToString(dt.Rows[0]["fullorempty"]);
                    strMobile          = Convert.ToString(dt.Rows[0]["driverphone"]);;
                }

                //发布评价
                strSql =
                    string.Format(@"insert into SER_EVALUATE (veh_attest_no,code_company,taskno,fullorempty,vessel,cargo,vehicle,driverphone,cgno,
                                    evaluate_hall,evaluate_dock,evaluate_gate,index_attitude,index_audit,index_make,index_overall,account) 
                                    values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}',{12},{13},{14},{15},'{16}')",
                                  strVehicleAttestNo, strCodeDepartment, strTaskno, strFullorempty, strVessel, strCargo, strVehicle, strMobile, strCargo,
                                  strParkingCard, strReleaseCargo, strPortBayonet, strServiceAttitude, strReleaseSpeed, strUninstallSpeed, strOverallEvaluation, strAccount);
                new Leo.Oracle.DataAccess(RegistryKey.KeyPathCGate).ExecuteNonQuery(strSql);

                //删除我的评估
                strSql =
                    string.Format(@"update TB_PRO_CONSIGNVEHICLE t 
                                    set t.delete_mark_ser_evaluate='1' 
                                    where t.id='{0}'",
                                  strId);
                new Leo.Oracle.DataAccess(RegistryKey.KeyPathHarbor).ExecuteNonQuery(strSql);

                Json = JsonConvert.SerializeObject(new DicPackage(true, null, "发布成功").DicInfo());
                log.LogCatalogSuccess();
            }
            catch (Exception ex)
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, string.Format("{0}:发布评价发生异常。{1}", ex.Source, ex.Message)).DicInfo());
                log.LogCatalogFailure(string.Format("{0}:发布评价发生异常。{1}", ex.Source, ex.Message));
            }
        }
Exemplo n.º 17
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());
            }
        }
Exemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //身份校验
            if (!InterfaceTool.IdentityVerify(Request))
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, "身份认证错误").DicInfo());
                return;
            }

            //数据起始行
            var strStartRow = Request.Params["StartRow"];
            //数据结束行
            var strEndRow = Request.Params["EndRow"];
            //账户
            string strAccount = Request.Params["Account"];

            //strStartRow = "1";
            //strEndRow = "15";
            //strAccount = "13812347543";

            try
            {
                if (strStartRow == null || strEndRow == null || strAccount == null)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "参数错误,获取我的评价列表数据失败").DicInfo());
                    return;
                }

                //获取我的评价列表数据
                string strSql =
                    string.Format(@"select t.id,t.veh_attest_no,t.driverphone,t.finish_mark,to_char(t.createtime, 'yyyy/mm/dd') as createtime,t.evaluate_hall,t.evaluate_dock,t.evaluate_gate,t.index_attitude,t.index_audit,t.index_make,t.index_overall,t.hall_time,t.dock_time,t.gate_time 
                                    from SER_EVALUATE t where t.account='{0}' and t.finish_mark = '0'
                                    order by t.createtime desc",
                                  strAccount);
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathCGate).ExecuteTable(strSql, Convert.ToInt32(strStartRow), Convert.ToInt32(strEndRow));;
                if (dt.Rows.Count <= 0)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, null).DicInfo());
                    return;
                }

                string[,] strArray = new string[dt.Rows.Count, 12];
                for (int iRow = 0; iRow < dt.Rows.Count; iRow++)
                {
                    strArray[iRow, 0] = Convert.ToString(dt.Rows[iRow]["id"]);
                    strArray[iRow, 1] = Convert.ToString(dt.Rows[iRow]["veh_attest_no"]);
                    strArray[iRow, 2] = Convert.ToString(dt.Rows[iRow]["driverphone"]);
                    string strExplain = string.Empty;
                    if (!string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[iRow]["hall_time"])) || !string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[iRow]["dock_time"])) || !string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[iRow]["gate_time"])))
                    {
                        strExplain = "有说明";
                    }
                    strArray[iRow, 3]  = strExplain;
                    strArray[iRow, 4]  = Convert.ToString(dt.Rows[iRow]["createtime"]);
                    strArray[iRow, 5]  = Convert.ToString(dt.Rows[iRow]["evaluate_hall"]);
                    strArray[iRow, 6]  = Convert.ToString(dt.Rows[iRow]["evaluate_dock"]);
                    strArray[iRow, 7]  = Convert.ToString(dt.Rows[iRow]["evaluate_gate"]);
                    strArray[iRow, 8]  = GetChineseEvaluate(Convert.ToInt16(dt.Rows[iRow]["index_attitude"]));
                    strArray[iRow, 9]  = GetChineseEvaluate(Convert.ToInt16(dt.Rows[iRow]["index_audit"]));
                    strArray[iRow, 10] = GetChineseEvaluate(Convert.ToInt16(dt.Rows[iRow]["index_make"]));
                    strArray[iRow, 11] = GetChineseEvaluate(Convert.ToInt16(dt.Rows[iRow]["index_overall"]));
                }

                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());
            }
        }
Exemplo n.º 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //身份校验
            if (!InterfaceTool.IdentityVerify(Request))
            {
                Json = JsonConvert.SerializeObject(new DicPackage(false, null, "身份认证错误").DicInfo());
                return;
            }

            //数据起始行
            var strStartRow = Request.Params["StartRow"];
            //数据结束行
            var strEndRow = Request.Params["EndRow"];
            //账户
            string strAccount = Request.Params["Account"];

            try
            {
                if (strAccount == null)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(false, null, "参数错误,获取我的投诉列表数据失败").DicInfo());
                    return;
                }

                //获取我的投诉列表
                string strSql =
                    string.Format(@"select a.id,a.type_mark,c.complain_name,b.department,a.vehicle,a.driverphone,to_char(a.createtime, 'yyyy/mm/dd') as createtime,a.anonymous_mark,a.finish_mark,a.title,a.detail,a.adjust_time,a.deal_time,a.evaluate_time,e.complain_name as complain_name_org,d.department as department_org
                                    from SER_COMPLAIN a
                                    left join HARBOR.V_SYS_DEPART_CONVERT b on a.code_company=b.code_department
                                    left join SER_CODE_COMPLAIN c on a.code_complain=c.code_complain
                                    left join HARBOR.V_SYS_DEPART_CONVERT d on a.code_company_org=d.code_department
                                    left join SER_CODE_COMPLAIN e on a.code_complain_org=e.code_complain
                                    where a.type_mark='0' and a.account='{0}' and a.finish_mark='0'
                                    order by a.createtime desc",
                                  strAccount);
                var dt = new Leo.Oracle.DataAccess(RegistryKey.KeyPathCGate).ExecuteTable(strSql, Convert.ToInt32(strStartRow), Convert.ToInt32(strEndRow));
                if (dt.Rows.Count <= 0)
                {
                    Json = JsonConvert.SerializeObject(new DicPackage(true, null, null).DicInfo());
                    return;
                }

                string[,] strArray = new string[dt.Rows.Count, 12];
                for (int iRow = 0; iRow < dt.Rows.Count; iRow++)
                {
                    strArray[iRow, 0] = Convert.ToString(dt.Rows[iRow]["id"]);
                    string strType = Convert.ToString(dt.Rows[iRow]["type_mark"]).Equals("0") == true ? "投诉" : "问题";
                    strArray[iRow, 1] = strType;
                    string strComplain_Name = Convert.ToString(dt.Rows[iRow]["complain_name_org"]);
                    string strDepartment    = Convert.ToString(dt.Rows[iRow]["department_org"]);
                    if (!string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[iRow]["complain_name"])))
                    {
                        strComplain_Name = Convert.ToString(dt.Rows[iRow]["complain_name"]);
                        strDepartment    = Convert.ToString(dt.Rows[iRow]["department"]);
                    }
                    strArray[iRow, 2] = strComplain_Name;
                    strArray[iRow, 3] = strDepartment;
                    strArray[iRow, 4] = Convert.ToString(dt.Rows[iRow]["vehicle"]);
                    strArray[iRow, 5] = Convert.ToString(dt.Rows[iRow]["driverphone"]);
                    strArray[iRow, 6] = Convert.ToString(dt.Rows[iRow]["createtime"]);
                    string strAnonymous = Convert.ToString(dt.Rows[iRow]["anonymous_mark"]).Equals("0") == true ? "" : "匿名";
                    strArray[iRow, 7] = strAnonymous;
                    string strState = string.Empty;
                    if (!string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[iRow]["evaluate_time"])))
                    {
                        strState = "已评价";
                    }
                    else if (!string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[iRow]["deal_time"])))
                    {
                        strState = "已解决";
                    }
                    else if (!string.IsNullOrWhiteSpace(Convert.ToString(dt.Rows[iRow]["adjust_time"])))
                    {
                        strState = "已受理";
                    }
                    else
                    {
                        strState = "待受理";
                    }

                    strArray[iRow, 8]  = strState;
                    strArray[iRow, 9]  = Convert.ToString(dt.Rows[iRow]["title"]);
                    strArray[iRow, 10] = Convert.ToString(dt.Rows[iRow]["detail"]);
                }

                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());
            }
        }