Example #1
0
        public ActionResult Item(string obj)
        /// 出库/出货记录详
        /// cxb
        {
            BaseResult br      = new BaseResult();
            Hashtable  paramli = new Hashtable();

            try
            {
                Hashtable param = JSON.Deserialize <Hashtable>(obj);
                //param.Add("dh", "DH20150504000020");
                Hashtable model = new Hashtable();
                //ParamVessel p = new ParamVessel();
                //p.Add("dh", String.Empty, HandleType.ReturnMsg);
                //param = param.Trim(p);
                br = BusinessFactory.Order.Get(param);
                Td_Sale_Order_Head_Query list0 = (Td_Sale_Order_Head_Query)br.Data;
                list0.order_body = new List <Td_Sale_Order_Body_Query>();
                //获取订单单体
                param["sort"]             = "sl_ck";
                param["dir"]              = "desc";
                br                        = BusinessFactory.Order.GetAll(param);
                ViewData["OrderbodyList"] = br.Data;
                List <Td_Sale_Order_Body_Query> list1      = (List <Td_Sale_Order_Body_Query>)br.Data;
                List <Td_Sale_Order_Body_Query> body_list0 = list1.Where(e => e.dh == list0.dh).ToList();
                list0.order_body = body_list0;
                if (list0.ToString() == "")
                {
                    model["order"] = "{}";
                }
                else
                {
                    model["order"] = list0;
                }
                //获取出库单头
                paramli["dh_order"]       = param["dh"];
                paramli["sort"]           = "flag_state asc, rq_fh desc  , rq_create";
                paramli["dir"]            = "desc";
                paramli["not_flag_state"] = OrderFlag.Deleted;
                br = BusinessFactory.ShippingRecord.Get(paramli);
                List <Td_Sale_Out_Head_Query> list2 = (List <Td_Sale_Out_Head_Query>)br.Data;


                //获取出库单单体
                paramli["sort"] = "dh";
                br = BusinessFactory.ShippingRecord.GetAll(paramli);
                List <Td_Sale_Out_Body_Query> list3 = (List <Td_Sale_Out_Body_Query>)br.Data;
                foreach (Td_Sale_Out_Head_Query item in list2)
                {
                    List <Td_Sale_Out_Body_Query> body_list = list3.Where(e => e.dh == item.dh).ToList();
                    foreach (Td_Sale_Out_Body_Query item0 in body_list)
                    {
                        item.out_body.Add(item0);
                    }
                }
                model["out"] = list2;
                br.Data      = model;
            }
            catch (CySoftException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Json(br.Data));
        }