Esempio n. 1
0
        public bool InHouseResponse(List <View_PlanListModel> planList, ref string jsonStr, ref string reStr)
        {
            try
            {
                if (planList == null || planList.Count == 0)
                {
                    return(false);
                }
                InHouseOrderResponse inHouseResponse = new InHouseOrderResponse();//入库完成给erp反馈,否则没有货位信息
                inHouseResponse.wms_order_code = planList[0].Plan_Code;
                inHouseResponse.order_code     = Guid.NewGuid().ToString();
                if (planList[0].Plan_Create_Time != null)
                {
                    inHouseResponse.order_date = planList[0].Plan_Create_Time.ToString();
                }
                inHouseResponse.order_maker       = planList[0].Plan_From_User;
                inHouseResponse.order_voucherType = planList[0].Plan_List_Resever1;
                inHouseResponse.warehouse_code    = planList[0].Plan_Remark;
                WH_WareHouseModel house = bllWareHouse.GetModelByCode(planList[0].Plan_Remark);
                if (house != null)
                {
                    inHouseResponse.warehouse_name = house.WareHouse_Name;
                }
                List <InventoryInfo> inventoryInfoList = new List <InventoryInfo>();
                foreach (View_PlanListModel plan in planList)
                {
                    InventoryInfo inventoryInfo = new InventoryInfo();
                    inventoryInfo.serial = plan.Plan_List_Remark;//批次
                    View_StockListModel stock = bllViewStockList.GetModeByPlanListID(plan.Plan_List_ID);
                    if (stock != null)
                    {
                        inventoryInfo.inventory_code = stock.Cell_Code;
                        inventoryInfo.inventory_name = stock.Cell_Name + "-" + stock.Cell_Chlid_Position;
                    }
                    inventoryInfo.quantity = plan.Plan_List_Finished_Quantity;
                    inventoryInfo.serial   = plan.Plan_List_Remark;

                    inventoryInfoList.Add(inventoryInfo);
                }
                inHouseResponse.InventoryList = inventoryInfoList;
                reStr   = "获取成功!";
                jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(inHouseResponse);

                return(true);
            }
            catch (Exception ex)
            {
                reStr = ex.StackTrace;
                return(false);
            }
        }
Esempio n. 2
0
        public bool InHouseResponse(List <View_PlanListModel> planList, ref string jsonStr, ref string reStr)
        {
            try
            {
                if (planList == null || planList.Count == 0)
                {
                    return(false);
                }
                InHouseOrderResponse inHouseResponse = new InHouseOrderResponse();//入库完成给erp反馈,否则没有货位信息
                inHouseResponse.erp_receipt_no = planList[0].Plan_Code;
                inHouseResponse.mes_receipt_no = Guid.NewGuid().ToString();
                if (planList[0].Plan_Create_Time != null)
                {
                    inHouseResponse.mes_into_date = planList[0].Plan_Create_Time.ToString();
                }
                View_StockListModel stockList = bllViewStockList.GetModeByPlanListID(planList[0].Plan_List_ID);//只有入库可这么查询,出库就没有库存了
                if (stockList != null)
                {
                    inHouseResponse.mes_warehouse_code = stockList.WareHouse_Code;
                }
                inHouseResponse.mes_creator      = planList[0].Plan_Operater;
                inHouseResponse.mes_receipt_type = planList[0].Plan_List_Resever1;

                List <InventoryInfo> inventoryInfoList = new List <InventoryInfo>();
                foreach (View_PlanListModel plan in planList)
                {
                    InventoryInfo inventoryInfo = new InventoryInfo();
                    inventoryInfo.mes_lot_no = plan.Plan_List_Remark;//批次
                    View_StockListModel stock = bllViewStockList.GetModeByPlanListID(plan.Plan_List_ID);
                    if (stock != null)
                    {
                        inventoryInfo.mes_materiel_code = stock.Goods_Code;
                        inventoryInfo.mes_unit          = stock.Goods_Unit;
                    }
                    inventoryInfo.mes_total_qty = plan.Plan_List_Finished_Quantity;

                    inventoryInfoList.Add(inventoryInfo);
                }
                inHouseResponse.backIntoDetails = inventoryInfoList;
                reStr   = "获取成功!";
                jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(inHouseResponse);

                return(true);
            }
            catch (Exception ex)
            {
                reStr = ex.StackTrace;
                return(false);
            }
        }
Esempio n. 3
0
        public bool OutHouseResponse(List <View_PlanListModel> planList, ref string jsonStr, ref string reStr)
        {
            try
            {
                if (planList == null || planList.Count == 0)
                {
                    return(false);
                }
                OutHouseOrderResponse inhouseResponse = new OutHouseOrderResponse();
                inhouseResponse.order_code        = planList[0].Plan_Code;
                inhouseResponse.order_date        = planList[0].Plan_Create_Time.ToString();
                inhouseResponse.order_maker       = planList[0].Plan_Operater;
                inhouseResponse.order_voucherType = planList[0].Plan_List_Resever1;
                inhouseResponse.warehouse_code    = planList[0].Plan_Remark;
                WH_WareHouseModel wareHouse = bllWareHouse.GetModelByCode(planList[0].Plan_Remark);
                if (wareHouse != null)
                {
                    inhouseResponse.warehouse_name = wareHouse.WareHouse_Name;
                }

                List <InventoryInfo>         inventoryList = new List <InventoryInfo>();
                List <View_Manage_CellModel> manageList    = bllViewManageCell.GetListByPlanID(planList[0].Plan_ID);
                foreach (View_Manage_CellModel manage in manageList)
                {
                    InventoryInfo inventInfo = new InventoryInfo();
                    inventInfo.inventory_code = manage.Cell_Code;
                    inventInfo.inventory_name = manage.Cell_Name + "-" + manage.Cell_Chlid_Position;
                    Manage_ListModel manageListModel = bllManageList.GetModelByManageID(manage.Mange_ID);
                    if (manageListModel != null)
                    {
                        inventInfo.quantity = manageListModel.Manage_List_Quantity;
                    }

                    inventoryList.Add(inventInfo);
                }
                inhouseResponse.MaterilaList = inventoryList;

                reStr   = "获取成功!";
                jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(inhouseResponse);
                return(true);
            }
            catch (Exception ex)
            {
                reStr = ex.StackTrace;
                return(false);
            }
        }