• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ORD.OrderMaster类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中com.Sconit.Entity.ORD.OrderMaster的典型用法代码示例。如果您正苦于以下问题:C# OrderMaster类的具体用法?C# OrderMaster怎么用?C# OrderMaster使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OrderMaster类属于com.Sconit.Entity.ORD命名空间,在下文中一共展示了OrderMaster类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreatePickTask

 public void CreatePickTask(OrderMaster orderMaster)
 {
     if (orderMaster.Status == CodeMaster.OrderStatus.Submit
      || orderMaster.Status == CodeMaster.OrderStatus.InProcess)
     {
         IList<OrderDetail> ods = this.genericMgr.FindAll<OrderDetail>("from OrderDetail where OrderNo = ? ", orderMaster.OrderNo);
         if (ods != null)
         {
             foreach (OrderDetail od in ods)
             {
                 if (od.IsCreatePickList)
                 {
                     PickTask task = this.genericMgr.FindAll<PickTask>("from PickTask where OrderNo = ? and OrdDetId = ? ",
                         new object[] { od.OrderNo, od.Id }).SingleOrDefault();
                     if (task == null)
                     {
                         CreatePickTaskFromOrder(orderMaster, od);
                     }
                     else
                     {
                         throw new BusinessException("task already exists!");
                     }
                 }
             }
         }
     }
     else
     {
         throw new BusinessException("bad status!");
     }
 }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:31,代码来源:PickTaskMgrImpl.cs


示例2: CreateExScrapOrder

        public OrderMaster CreateExScrapOrder(MrpExScrap mrpExScrap)
        {
            var newOrder = new OrderMaster();
            Item item = this.itemMgr.GetCacheItem(mrpExScrap.Item);
            mrpExScrap.ItemDescription = item.Description;
            this.genericMgr.Create(mrpExScrap);
            if(mrpExScrap.Item == BusinessConstants.VIRTUALSECTION)
            {
                //nothing todo
            }
            else if(mrpExScrap.ScrapType == CodeMaster.ScheduleType.MES24 || mrpExScrap.ScrapType == CodeMaster.ScheduleType.MES25)
            {
                //只记录废品数,无材料消耗
                DateTime startTime = mrpExScrap.EffectDate;
                DateTime windowTime = mrpExScrap.EffectDate;
                workingCalendarMgr.GetStartTimeAndWindowTime(mrpExScrap.Shift, mrpExScrap.EffectDate, out startTime, out windowTime);

                FlowMaster flowMaster = this.genericMgr.FindById<FlowMaster>(mrpExScrap.Flow);
                newOrder = orderMgr.TransferFlow2Order(flowMaster, false);
                newOrder.Shift = mrpExScrap.Shift;
                newOrder.StartTime = startTime;
                newOrder.WindowTime = windowTime;
                newOrder.EffectiveDate = mrpExScrap.EffectDate;
                newOrder.ReferenceOrderNo = mrpExScrap.Id.ToString();
                newOrder.Priority = CodeMaster.OrderPriority.Normal;

                OrderDetail newOrderDetail = new OrderDetail();
                newOrderDetail.Item = item.Code;
                newOrderDetail.UnitCount = (decimal)item.UnitCount;
                newOrderDetail.Uom = "KG";
                newOrderDetail.BaseUom = item.Uom;
                newOrderDetail.ItemDescription = item.Description;
                newOrderDetail.Sequence = 10;
                newOrderDetail.MinUnitCount = item.UnitCount;
                newOrderDetail.OrderedQty = (decimal)mrpExScrap.ScrapQty;
                newOrderDetail.LocationFrom = flowMaster.LocationFrom;
                newOrderDetail.LocationTo = flowMaster.LocationTo;
                newOrderDetail.CurrentScrapQty = newOrderDetail.OrderedQty;
                newOrderDetail.ScheduleType = mrpExScrap.ScrapType;

                newOrder.ExternalOrderNo = newOrderDetail.ScheduleType.ToString();
                newOrder.AddOrderDetail(newOrderDetail);
                newOrder.SubType = CodeMaster.OrderSubType.Other;
                newOrder.IsQuick = true;
                newOrder.IsShipScanHu = false;
                newOrder.IsReceiveScanHu = false;
                newOrder.CreateHuOption = CodeMaster.CreateHuOption.None;
                orderMgr.CreateOrder(newOrder, true);
                mrpExScrap.OrderNo = newOrder.OrderNo;
            }
            return newOrder;
        }
开发者ID:zhsh1241,项目名称:Sconit5_Shenya,代码行数:52,代码来源:MrpOrderMgrImpl.cs


示例3: GetOrderNo

        public string GetOrderNo(OrderMaster orderMaster)
        {
            SqlParameter[] parm = new SqlParameter[13];

            parm[0] = new SqlParameter("@Flow", SqlDbType.VarChar, 50);
            parm[0].Value = orderMaster.Flow;

            parm[1] = new SqlParameter("@OrderStrategy", SqlDbType.TinyInt);
            parm[1].Value = orderMaster.OrderStrategy;

            parm[2] = new SqlParameter("@Type", SqlDbType.TinyInt);
            parm[2].Value = orderMaster.Type;

            parm[3] = new SqlParameter("@SubType", SqlDbType.TinyInt);
            parm[3].Value = orderMaster.SubType;

            parm[4] = new SqlParameter("@QualityType", SqlDbType.TinyInt);
            parm[4].Value = orderMaster.QualityType;

            parm[5] = new SqlParameter("@Priority", SqlDbType.TinyInt);
            parm[5].Value = orderMaster.Priority;

            parm[6] = new SqlParameter("@PartyFrom", SqlDbType.VarChar, 50);
            parm[6].Value = orderMaster.PartyFrom;

            parm[7] = new SqlParameter("@PartyTo", SqlDbType.VarChar, 50);
            parm[7].Value = orderMaster.PartyTo;

            parm[8] = new SqlParameter("@LocTo", SqlDbType.VarChar, 50);
            parm[8].Value = orderMaster.LocationTo;

            parm[9] = new SqlParameter("@LocFrom", SqlDbType.VarChar, 50);
            parm[9].Value = orderMaster.LocationFrom;

            parm[10] = new SqlParameter("@Dock", SqlDbType.VarChar, 50);
            parm[10].Value = orderMaster.Dock;

            parm[11] = new SqlParameter("@IsQuick", SqlDbType.Bit);
            parm[11].Value = orderMaster.IsQuick;

            parm[12] = new SqlParameter("@OrderNo", SqlDbType.VarChar, 100);
            parm[12].Direction = ParameterDirection.InputOutput;

            sqlDao.ExecuteStoredProcedure("USP_GetDocNo_ORD", parm);

            return parm[12].Value.ToString();
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:47,代码来源:NumberControlMgrImpl.cs


示例4: DistributionReceiveOrder

        public void DistributionReceiveOrder(OrderMaster orderMaster)
        {

            #region 检查交货单明细是否一起过账
            IList<OrderDetail> selectOrderDetailList = this.genericMgr.FindAll<OrderDetail>("select d from OrderDetail as d where d.OrderNo='" + orderMaster.OrderNo + "'");

            foreach (OrderDetail orderDetail in selectOrderDetailList)
            {
                bool b = false;
                foreach (OrderDetail item in orderMaster.OrderDetails)
                {
                    if (orderDetail.Id == item.Id)
                    {
                        b = true;
                        break;
                    }
                }

                if (b == false)
                {
                    string externalNo = this.genericMgr.FindById<OrderMaster>(orderDetail.OrderNo).ExternalOrderNo;
                    throw new BusinessException("交货单的明细必须一起过账。订单号为" + orderDetail.OrderNo);
                }
            }
            #endregion

            #region 把创建状态的OrderMaster释放
            this.genericMgr.CleanSession();
            if (orderMaster.Status == com.Sconit.CodeMaster.OrderStatus.Create)
            {
                this.ReleaseOrder(orderMaster);
            }

            #endregion

            #region 过账
            this.ReceiveOrder(orderMaster.OrderDetails);
            #endregion

            #region 把OrderMaster的状态关闭
            if (orderMaster.Status != com.Sconit.CodeMaster.OrderStatus.Close)
            {
                this.ManualCloseOrder(orderMaster);
            }
            #endregion

        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:47,代码来源:OrderMgrImpl.cs


示例5: BeforeUpdateOrderDetails

 private void BeforeUpdateOrderDetails(OrderMaster orderMaster)
 {
     if (orderMaster.Status != com.Sconit.CodeMaster.OrderStatus.Create)
     {
         throw new BusinessException(Resources.ORD.OrderMaster.Errors_StatusErrorWhenModifyOrderDetail, orderMaster.OrderNo, systemMgr.GetCodeDetailDescription(com.Sconit.CodeMaster.CodeMaster.OrderStatus, int.Parse(((int)orderMaster.Status).ToString())));
     }
 }
开发者ID:druidwang,项目名称:Les_parts,代码行数:7,代码来源:OrderMgrImpl.cs


示例6: TryLoadOrderBomDetails

        private IList<OrderBomDetail> TryLoadOrderBomDetails(OrderMaster orderMaster)
        {
            if (orderMaster.OrderNo != null)
            {
                TryLoadOrderDetails(orderMaster);

                IList<OrderBomDetail> orderBomDetailList = new List<OrderBomDetail>();

                string hql = string.Empty;
                IList<object> para = new List<object>();
                foreach (OrderDetail orderDetail in orderMaster.OrderDetails)
                {
                    if (orderDetail.OrderBomDetails != null && orderDetail.OrderBomDetails.Count > 0)
                    {
                        ((List<OrderBomDetail>)orderBomDetailList).AddRange(orderDetail.OrderBomDetails);
                    }
                    else
                    {
                        if (hql == string.Empty)
                        {
                            hql = "from OrderBomDetail where OrderDetailId in (?";
                        }
                        else
                        {
                            hql += ",?";
                        }
                        para.Add(orderDetail.Id);
                    }
                }

                if (hql != string.Empty)
                {
                    hql += ") order by OrderDetailId, Operation, OpReference";

                    ((List<OrderBomDetail>)orderBomDetailList).AddRange(this.genericMgr.FindAll<OrderBomDetail>(hql, para.ToArray()));
                }

                foreach (OrderDetail orderDetail in orderMaster.OrderDetails)
                {
                    if (orderDetail.OrderBomDetails == null || orderDetail.OrderBomDetails.Count == 0)
                    {
                        orderDetail.OrderBomDetails = orderBomDetailList.Where(o => o.OrderDetailId == orderDetail.Id).ToList();
                    }
                }

                return orderBomDetailList;
            }
            else
            {
                return null;
            }
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:52,代码来源:OrderMgrImpl.cs


示例7: TryLoadOrderBindings

        private IList<OrderBinding> TryLoadOrderBindings(OrderMaster orderMaster)
        {
            if (!string.IsNullOrWhiteSpace(orderMaster.OrderNo))
            {
                if (orderMaster.OrderBindings == null)
                {
                    string hql = "from OrderBinding where OrderNo = ?";

                    orderMaster.OrderBindings = this.genericMgr.FindAll<OrderBinding>(hql, orderMaster.OrderNo);
                }

                return orderMaster.OrderBindings;
            }
            else
            {
                return null;
            }
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:18,代码来源:OrderMgrImpl.cs


示例8: CalculateOrderDetailPrice

        private void CalculateOrderDetailPrice(OrderDetail orderDetail, OrderMaster orderMaster, DateTime? effectiveDate)
        {
            string priceList = !string.IsNullOrWhiteSpace(orderDetail.PriceList) ? orderDetail.PriceList : orderMaster.PriceList;

            if (string.IsNullOrWhiteSpace(priceList))
            {
                bool isAllowCreateOrderWithNoPrice = true;
                if (orderMaster.Type == com.Sconit.CodeMaster.OrderType.Distribution)
                {
                    isAllowCreateOrderWithNoPrice = bool.Parse(systemMgr.GetEntityPreferenceValue(EntityPreference.CodeEnum.IsAllowCreateSalesOrderWithNoPrice));
                }
                else
                {
                    isAllowCreateOrderWithNoPrice = bool.Parse(systemMgr.GetEntityPreferenceValue(EntityPreference.CodeEnum.IsAllowCreatePurchaseOrderWithNoPrice));
                }

                if (isAllowCreateOrderWithNoPrice)
                {
                    return;
                }
                else
                {
                    throw new BusinessException("没有指定价格单。");
                }
            }

            #region 币种
            PriceListMaster priceListMaster = orderDetail.CurrentPriceListMaster != null ? orderDetail.CurrentPriceListMaster : orderMaster.CurrentPriceListMaster;
            if (priceListMaster == null)
            {
                if (!string.IsNullOrWhiteSpace(orderDetail.PriceList))
                {
                    orderDetail.CurrentPriceListMaster = this.genericMgr.FindById<PriceListMaster>(orderDetail.PriceList);
                    priceListMaster = orderDetail.CurrentPriceListMaster;
                }
                else if (!string.IsNullOrWhiteSpace(orderMaster.PriceList))
                {
                    orderMaster.CurrentPriceListMaster = this.genericMgr.FindById<PriceListMaster>(orderMaster.PriceList);
                    priceListMaster = orderMaster.CurrentPriceListMaster;
                }
            }

            orderDetail.Currency = priceListMaster.Currency;
            #endregion

            #region 价格
            PriceListDetail priceListDetail = itemMgr.GetItemPrice(orderDetail.Item, orderDetail.Uom, priceList, orderMaster.Currency, effectiveDate);
            if (priceListDetail != null)
            {
                orderDetail.UnitPrice = priceListDetail.UnitPrice;
                orderDetail.IsProvisionalEstimate = priceListDetail.IsProvisionalEstimate;
                orderDetail.Tax = priceListDetail.PriceList.Tax;
                orderDetail.IsIncludeTax = priceListDetail.PriceList.IsIncludeTax;
            }
            #endregion
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:56,代码来源:OrderMgrImpl.cs


示例9: ProcessNewOrderDetail

        private IList<OrderDetail> ProcessNewOrderDetail(OrderDetail orderDetail, OrderMaster orderMaster, ref int seq)
        {
            IList<OrderDetail> activeOrderDetails = new List<OrderDetail>();

            if (orderDetail.OrderedQty != 0) //过滤数量为0的明细
            {
                #region 整包校验
                CheckOrderedQtyFulfillment(orderMaster, orderDetail);
                #endregion

                Item item = orderDetail.CurrentItem != null ? orderDetail.CurrentItem : genericMgr.FindById<Item>(orderDetail.Item);

                if (item.IsKit && false)  //暂时不支持套件
                {
                    #region 分解套件
                    //没有考虑套件下面还是套件的情况
                    IList<ItemKit> itemKitList = itemMgr.GetKitItemChildren(item.Code);

                    if (itemKitList != null && itemKitList.Count() > 0)
                    {
                        foreach (ItemKit kit in itemKitList)
                        {
                            //检查订单明细的零件类型
                            CheckOrderDetailItemType(kit.ChildItem, (com.Sconit.CodeMaster.OrderType)orderMaster.Type);

                            OrderDetail activeOrderDetail = new OrderDetail();
                            activeOrderDetail.OrderType = orderMaster.Type;
                            activeOrderDetail.OrderSubType = orderMaster.SubType;
                            activeOrderDetail.Sequence = ++seq;
                            activeOrderDetail.Item = kit.ChildItem.Code;
                            activeOrderDetail.ItemDescription = kit.ChildItem.Description;
                            activeOrderDetail.Uom = orderDetail.Uom;
                            activeOrderDetail.BaseUom = kit.ChildItem.Uom;
                            activeOrderDetail.UnitCount = orderDetail.UnitCount;
                            activeOrderDetail.RequiredQty = orderDetail.RequiredQty * kit.Qty;
                            activeOrderDetail.OrderedQty = orderDetail.OrderedQty * kit.Qty;
                            if (activeOrderDetail.Uom != kit.ChildItem.Uom)
                            {
                                activeOrderDetail.UnitQty = kit.Qty;
                            }
                            else
                            {
                                activeOrderDetail.UnitQty = itemMgr.ConvertItemUomQty(kit.ChildItem.Code, kit.ChildItem.Uom, kit.Qty, activeOrderDetail.Uom);
                            }
                            activeOrderDetail.ReceiveLotSize = orderDetail.ReceiveLotSize * kit.Qty;
                            activeOrderDetail.LocationFrom = orderDetail.LocationFrom;
                            activeOrderDetail.LocationFromName = orderDetail.LocationFromName;
                            activeOrderDetail.LocationTo = orderDetail.LocationTo;
                            activeOrderDetail.LocationToName = orderDetail.LocationToName;
                            activeOrderDetail.IsInspect = orderDetail.IsInspect;
                            //activeOrderDetail.InspectLocation = orderDetail.InspectLocation;
                            //activeOrderDetail.InspectLocationName = orderDetail.InspectLocationName;
                            //activeOrderDetail.RejectLocation = orderDetail.RejectLocation;
                            //activeOrderDetail.RejectLocationName = orderDetail.RejectLocationName;
                            activeOrderDetail.BillAddress = orderDetail.BillAddress;
                            activeOrderDetail.BillAddressDescription = orderDetail.BillAddressDescription;
                            activeOrderDetail.PriceList = orderDetail.PriceList;
                            activeOrderDetail.Routing = activeOrderDetail.Routing;
                            //activeOrderDetail.HuLotSize = activeOrderDetail.HuLotSize * kit.Qty;
                            activeOrderDetail.BillTerm = activeOrderDetail.BillTerm;
                            //activeOrderDetail.OldOption = CodeMaster.HuOption.

                            activeOrderDetails.Add(activeOrderDetail);
                        }
                    }
                    else
                    {
                        throw new BusinessException(Resources.MD.Item.Errors_ItemKit_ChildrenItemNotFound, orderDetail.Item);
                    }
                    #endregion
                }
                else
                {
                    orderDetail.Sequence = ++seq;
                    orderDetail.OrderType = orderMaster.Type;
                    orderDetail.OrderSubType = orderMaster.SubType;
                    orderDetail.BaseUom = item.Uom;
                    orderDetail.ItemDescription = item.Description;

                    #region 零件类型校验
                    CheckOrderDetailItemType(item, (com.Sconit.CodeMaster.OrderType)orderMaster.Type);
                    activeOrderDetails.Add(orderDetail);
                    #endregion

                    #region 设置和库存单位的转换
                    if (string.Compare(orderDetail.Uom, item.Uom) != 0)
                    {
                        orderDetail.UnitQty = itemMgr.ConvertItemUomQty(orderDetail.Item, orderDetail.Uom, 1, item.Uom);
                    }
                    else
                    {
                        orderDetail.UnitQty = 1;
                    }
                    #endregion
                }
            }

            return activeOrderDetails;
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:99,代码来源:OrderMgrImpl.cs


示例10: DoPauseOrder

        private void DoPauseOrder(OrderMaster orderMaster, IList<SequenceMaster> sequenceMasterList, IList<SequenceDetail> sequenceDetailList, IList<string> pausedOrderNoList, DateTime dateTimeNow)
        {
            if (orderMaster.OrderStrategy == CodeMaster.FlowStrategy.KIT)
            {
                orderMaster.IsPause = true;
                orderMaster.PauseTime = dateTimeNow;
                this.genericMgr.Update(orderMaster);
                pausedOrderNoList.Add(orderMaster.OrderNo);

                log.Debug("Success pause kit order, orderNo[" + orderMaster.OrderNo + "].");
            }
            else if (orderMaster.OrderStrategy == CodeMaster.FlowStrategy.SEQ
                && sequenceDetailList != null && sequenceDetailList.Count > 0)
            {
                //如果排序装箱单已经收货,sequenceDetail为空。
                SequenceDetail sequenceDetail = sequenceDetailList.Where(s => s.OrderNo == orderMaster.OrderNo).SingleOrDefault();

                if (sequenceDetail != null)
                {
                    SequenceMaster sequenceMaster = sequenceMasterList.Where(s => s.SequenceNo == sequenceDetail.SequenceNo).Single();

                    if (sequenceMaster.Status == CodeMaster.SequenceStatus.Submit
                        || sequenceMaster.Status == CodeMaster.SequenceStatus.Pack)  //没有发货前都可以取消
                    {
                        //先取消排序装箱单明细 
                        sequenceDetail.IsClose = true;
                        this.genericMgr.Update(sequenceDetail);

                        //再暂停排序单
                        //orderMaster.Status = CodeMaster.OrderStatus.Submit;
                        //可能一个零件有多个排序件,即多张排序装箱单对应一张排序单
                        if (!orderMaster.IsPause)
                        {
                            orderMaster.IsPause = true;
                            orderMaster.PauseTime = dateTimeNow;
                            this.genericMgr.Update(orderMaster);
                            pausedOrderNoList.Add(orderMaster.OrderNo);

                            log.Debug("Success pause sequence order, orderNo[" + orderMaster.OrderNo + "].");
                        }
                        else
                        {
                            log.Debug("Sequence order already paused, orderNo[" + orderMaster.OrderNo + "].");
                        }

                        //string loc = systemMgr.GetEntityPreferenceValue(Entity.SYS.EntityPreference.CodeEnum.WMSAnjiRegion);
                        //if (sequenceMaster.PartyFrom.Equals(loc, StringComparison.OrdinalIgnoreCase))
                        //{
                        //    //this.genericMgr.FlushSession();
                        //    //AsyncRecourdMessageQueue(MethodNameType.CancelSequenceDetail, sequenceDetail.Id.ToString());
                        //    this.CreateMessageQueue("CancelSequenceDetail", sequenceDetail.Id.ToString());
                        //}
                    }
                }
                else
                {
                    orderMaster.IsPause = true;
                    orderMaster.PauseTime = dateTimeNow;
                    this.genericMgr.Update(orderMaster);

                    log.Debug("Success pause sequence order, orderNo[" + orderMaster.OrderNo + "].");
                }
            }
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:64,代码来源:OrderMgrImpl.cs


示例11: PauseSequenceAndKitOrder

        private void PauseSequenceAndKitOrder(OrderMaster productOrder, int? pauseOperation)
        {
            //todo:发送暂停通知邮件
            DateTime dateTimeNow = DateTime.Now;

            #region 查找需要暂停的工位
            string selectPauseLocationStatement = "select distinct Location from OrderBomDetail where OrderNo = ?";
            IList<object> selectPauseLocationParm = new List<object>();
            selectPauseLocationParm.Add(productOrder.OrderNo);
            if (pauseOperation.HasValue)
            {
                selectPauseLocationStatement += " and Operation > ?";  //在指定工序之后暂停,大于工序后的排序单/Kit单全部暂停
                selectPauseLocationParm.Add(pauseOperation.Value);
            }
            IList<string> pauseLocationList = this.genericMgr.FindAll<string>(selectPauseLocationStatement, selectPauseLocationParm.ToArray());

            ProductLineMap productLineMap = genericMgr.FindAll<ProductLineMap>(@"from ProductLineMap as p 
                                                                                    where (p.ProductLine = ? or p.CabFlow = ? or p.ChassisFlow = ?) 
                                                                                    and p.ProductLine is not null 
                                                                                    and p.CabFlow is not null 
                                                                                    and p.ChassisFlow is not null", new object[] { productOrder.Flow, productOrder.Flow, productOrder.Flow }).Single();

            #region 添加生产线的虚拟库位
            if (productLineMap.ProductLine == productOrder.Flow)
            {
                pauseLocationList.Add(productLineMap.VanLocation);
            }
            else if (productLineMap.CabFlow == productOrder.Flow)
            {
                pauseLocationList.Add(productLineMap.CabLocation);
            }
            else if (productLineMap.ChassisFlow == productOrder.Flow)
            {
                pauseLocationList.Add(productLineMap.ChassisLocation);
            }
            #endregion
            #endregion

            #region 循环查找OrderBinding
            IList<OrderBinding> orderBindingList = NestGetOrderBinding(productOrder.OrderNo);

            if (orderBindingList == null || orderBindingList.Count == 0)
            {
                log.Debug("No order binding.");
                return;
            }
            #endregion

            #region 查询Kit单和排序单
            string selectKitOrderStatement = string.Empty;
            string selectSeqOrderStatement = string.Empty;

            IList<object> selectKitOrderParm = new List<object>();
            IList<object> selectSeqOrderParm = new List<object>();

            foreach (OrderBinding orderBinding in orderBindingList)
            {
                if (selectKitOrderStatement == string.Empty)
                {
                    selectKitOrderStatement = "from OrderMaster where OrderStrategy = ? and Status = ? and IsPause = ? and OrderNo in (?";
                    selectSeqOrderStatement = "from OrderMaster where OrderStrategy = ? and Status in (?, ?) and IsPause = ? and OrderNo in (?";

                    selectKitOrderParm.Add(CodeMaster.FlowStrategy.KIT);
                    selectKitOrderParm.Add(CodeMaster.OrderStatus.Submit);
                    selectKitOrderParm.Add(false);

                    selectSeqOrderParm.Add(CodeMaster.FlowStrategy.SEQ);
                    selectSeqOrderParm.Add(CodeMaster.OrderStatus.Submit);
                    selectSeqOrderParm.Add(CodeMaster.OrderStatus.InProcess);
                    selectSeqOrderParm.Add(false);
                }
                else
                {
                    selectKitOrderStatement += ", ?";
                    selectSeqOrderStatement += ", ?";
                }

                selectKitOrderParm.Add(orderBinding.BindOrderNo);
                selectSeqOrderParm.Add(orderBinding.BindOrderNo);
            }

            selectKitOrderStatement += ")";
            selectSeqOrderStatement += ")";

            IList<OrderMaster> kitOrderList = this.genericMgr.FindAll<OrderMaster>(selectKitOrderStatement, selectKitOrderParm.ToArray());
            IList<OrderMaster> seqOrderList = this.genericMgr.FindAll<OrderMaster>(selectSeqOrderStatement, selectSeqOrderParm.ToArray());

            if ((kitOrderList == null || kitOrderList.Count == 0) && (seqOrderList == null || seqOrderList.Count == 0))
            {
                log.Debug("No sequence and kit order to pause.");
                return;
            }
            #endregion

            #region 查询排序装箱单
            #region 查询排序装箱单头
            IList<SequenceMaster> sequenceMasterList = null;
            if (seqOrderList != null && seqOrderList.Count > 0)
            {
                string selectSequenceMasterStatement = string.Empty;
//.........这里部分代码省略.........
开发者ID:druidwang,项目名称:Les_parts,代码行数:101,代码来源:OrderMgrImpl.cs


示例12: PauseProductOrder

        public void PauseProductOrder(OrderMaster orderMaster, int? pauseOperation)  //在指定工序之后暂停
        {
            log.Debug("Start pause product order, orderNo[" + orderMaster.OrderNo + "], operation[" + pauseOperation + "].");
            try
            {
                #region 检查
                if (orderMaster.Status != CodeMaster.OrderStatus.Submit && orderMaster.Status != CodeMaster.OrderStatus.InProcess)
                {
                    throw new BusinessException("生产单{0}的状态为{1},不能暂停。", orderMaster.OrderNo,
                        systemMgr.GetCodeDetailDescription(com.Sconit.CodeMaster.CodeMaster.OrderStatus, ((int)orderMaster.Status).ToString()));
                }

                if (orderMaster.IsPause || orderMaster.IsPlanPause)
                {
                    throw new BusinessException("生产单{0}已经暂停。", orderMaster.OrderNo);
                }

                if (orderMaster.IsProductLinePause)
                {
                    throw new BusinessException("生产线{0}已经暂停。", orderMaster.Flow);
                }

                if (orderMaster.Status == CodeMaster.OrderStatus.InProcess)
                {
                    if (!pauseOperation.HasValue)
                    {
                        throw new BusinessException("没有指定暂停的工序。");
                    }
                    else
                    {
                        #region 检查工序合法性
                        IList<OrderOperation> orderOperationList = this.genericMgr.FindAll<OrderOperation>("from OrderOperation where OrderNo = ? and Operation = ?", new object[] { orderMaster.OrderNo, pauseOperation.Value });

                        if (orderOperationList == null || orderOperationList.Count == 0)
                        {
                            throw new BusinessException("生产单{0}没有工序{1}。", orderMaster.OrderNo, pauseOperation.Value.ToString());
                        }

                        //if (orderOperationList.Where(o => o.IsBackflush).Count() > 0)
                        //{
                        //    throw new BusinessException("生产单{0}的工序{1}已经回冲物料,不能选择该工序暂停。", orderMaster.OrderNo, pauseOperation.Value.ToString());
                        //}
                        #endregion
                    }
                }
                #endregion

                #region 更新生产单
                if (orderMaster.Status == CodeMaster.OrderStatus.Submit)
                {
                    orderMaster.IsPause = true;
                    orderMaster.PauseTime = DateTime.Now;
                }
                else
                {
                    orderMaster.IsPlanPause = true;
                    orderMaster.PauseSequence = pauseOperation.Value;
                }
                this.genericMgr.Update(orderMaster);

                log.Debug("Success pause main product order, orderNo[" + orderMaster.OrderNo + "]");
                #endregion

                #region 暂停排序单和KIT
                PauseSequenceAndKitOrder(orderMaster, pauseOperation);
                #endregion
            }
            catch (Exception ex)
            {
                log.Error("Fail pause product order, orderNo[" + orderMaster.OrderNo + "], operation[" + pauseOperation + "].", ex);
                throw ex;
            }
            log.Debug("Success pause product order, orderNo[" + orderMaster.OrderNo + "], operation[" + pauseOperation + "].");
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:74,代码来源:OrderMgrImpl.cs


示例13: VerifyVanOrderClose

        private BusinessException VerifyVanOrderClose(OrderMaster orderMaster, ProductLineMap productLineMap)
        {
            BusinessException businessException = new BusinessException();
            #region 生产单关闭校验
            #region 条件5生产单的PlanBackflush全部关闭
            if (orderMaster.Type == CodeMaster.OrderType.Production
                || orderMaster.Type == CodeMaster.OrderType.SubContract)
            {

                #region 总装生产要校验总装、驾驶室和底盘的PlanBackflush
                string hql = "select count(*) as counter from PlanBackflush where OrderNo in (?, ?, ?) and IsClose = ?";
                long counter = this.genericMgr.FindAll<long>(hql, new Object[] { productLineMap.ProductLine, productLineMap.CabFlow, productLineMap.ChassisFlow, false })[0];
                if (counter > 0)
                {
                    businessException.AddMessage("加权平均扣料的零件还没有进行回冲,不能关闭订单{0}。", orderMaster.OrderNo);
                }
                #endregion
            }
            #endregion

            #region 条件6生产线上没有订单的投料
            if (orderMaster.Type == CodeMaster.OrderType.Production
                || orderMaster.Type == CodeMaster.OrderType.SubContract)
            {
                #region 总装生产要校验总装、驾驶室和底盘的订单投料
                string hql = "select count(*) as counter from ProductLineLocationDetail where OrderNo in (?, ?, ?) and IsClose = ?";
                long counter = this.genericMgr.FindAll<long>(hql, new Object[] { productLineMap.ProductLine, productLineMap.CabFlow, productLineMap.ChassisFlow, false })[0];
                if (counter > 0)
                {
                    businessException.AddMessage("生产线上还有投料的零件没有回冲,不能关闭订单{0}。", orderMaster.OrderNo);
                }
                #endregion
            }
            #endregion

            #region 条件7和TraceCode所有的失效模式关闭
            if ((orderMaster.Type == CodeMaster.OrderType.Production
               || orderMaster.Type == CodeMaster.OrderType.SubContract)
               && !string.IsNullOrWhiteSpace(orderMaster.TraceCode))
            {
                #region 只有总装的生产单关闭才需要校验,驾驶室和底盘的不需要
                string hql = "select count(*) as counter from IssueMaster where BackYards = ? and Status in (?,?,?)";
                long issueCounter = this.genericMgr.FindAll<long>(hql, new Object[] { orderMaster.TraceCode, CodeMaster.IssueStatus.Create, CodeMaster.IssueStatus.Submit, CodeMaster.IssueStatus.InProcess })[0];
                if (issueCounter > 0)
                {
                    businessException.AddMessage("失效模式没有全部关闭,不能关闭订单{0}。", orderMaster.OrderNo);
                }
                #endregion
            }
            #endregion

            #region 条件8生产单上的所有关键件全部投料,考虑到搭错的关键件Bom,不需要校验这条,可以给出警告信息
            if ((orderMaster.Type == CodeMaster.OrderType.Production
               || orderMaster.Type == CodeMaster.OrderType.SubContract))
            {
                //throw new NotImplementedException();
            }
            #endregion
            #endregion

            return businessException;
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:62,代码来源:OrderMgrImpl.cs


示例14: CloseVanOrder

        private void CloseVanOrder(OrderMaster vanOrder, ProductLineMap productLineMap)
        {
            DateTime dateTimeNow = DateTime.Now;
            User user = SecurityContextHolder.Get();

            #region 总装生产单关闭时,关闭所有子生产单
            IList<OrderMaster> subOrderMasterList = this.genericMgr.FindAll<OrderMaster>("from OrderMaster where Type = ? and Flow in (?,?) and Status <> ?", new object[] { CodeMaster.OrderType.Production, productLineMap.CabFlow, productLineMap.ChassisFlow, CodeMaster.OrderStatus.Close });

            if (subOrderMasterList != null && subOrderMasterList.Count > 0)
            {
                foreach (OrderMaster subOrderMaster in subOrderMasterList)
                {
                    if (subOrderMaster.Status != CodeMaster.OrderStatus.Complete)
                    {
                        throw new BusinessException("子生产单{0}的状态为{1},整车生产单{2}不能关闭。", subOrderMaster.OrderNo,
                            systemMgr.GetCodeDetailDescription(com.Sconit.CodeMaster.CodeMaster.OrderStatus, ((int)subOrderMaster.Status).ToString()),
                            vanOrder.OrderNo);
                    }
                    else
                    {
                        subOrderMaster.Status = CodeMaster.OrderStatus.Close;
                        subOrderMaster.CloseDate = dateTimeNow;
                        subOrderMaster.CloseUserId = user.Id;
                        subOrderMaster.CloseUserName = user.FullName;
                        this.genericMgr.Update(subOrderMaster);
                    }
                }
            }
            #endregion

            #region 关闭总装生产单
            vanOrder.Status = CodeMaster.OrderStatus.Close;
            vanOrder.CloseDate = dateTimeNow;
            vanOrder.CloseUserId = user.Id;
            vanOrder.CloseUserName = user.FullName;
            this.genericMgr.Update(vanOrder);
            #endregion
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:38,代码来源:OrderMgrImpl.cs


示例15: CompleteVanSubOrder

        private void CompleteVanSubOrder(OrderMaster vanSubOrder)
        {
            DateTime dateTimeNow = DateTime.Now;
            User user = SecurityContextHolder.Get();

            vanSubOrder.Status = CodeMaster.OrderStatus.Complete;
            vanSubOrder.CompleteDate = dateTimeNow;
            vanSubOrder.CompleteUserId = user.Id;
            vanSubOrder.CompleteUserName = user.FullName;
            this.genericMgr.Update(vanSubOrder);
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:11,代码来源:OrderMgrImpl.cs


示例16: GenerateOrderBomDetail

        private void GenerateOrderBomDetail(OrderDetail orderDetail, OrderMaster orderMaster)
        {
            if (orderDetail.ScheduleType == CodeMaster.ScheduleType.MES21 || orderDetail.ScheduleType == CodeMaster.ScheduleType.MES22
                || orderDetail.ScheduleType == CodeMaster.ScheduleType.MES23)
            {
                //只记录废品数,无材料消耗
                return;
            }
            if (orderMaster.ProductLineFacility == "EXV")
            {

                //不消耗材料

                return;
            }
            //if (orderMaster.SubType == com.Sconit.CodeMaster.OrderSubType.Return)
            //{
            //    //直接退成品
            //}

            #region 查找成品单位和Bom单位的转换关系
            //把OrderDetail的收货单位和单位用量转换为BOM单位和单位用量
            //fgUom,fgUnityQty代表接收一个orderDetail.Uom单位(等于订单的收货单位)的FG,等于单位(fgUom)有多少(fgUnityQty)值
            string fgUom = orderDetail.Uom;
            //如果和Bom上的单位不一致,转化为Bom上的单位,不然会导致物料回冲不正确。  

            //查找Bom
            BomMaster bomMaster = FindOrderDetailBom(orderDetail);
            decimal fgUnityQty = 1;

            #region 判断Bom是否有效
            if (!bomMaster.IsActive)
            {
                throw new BusinessException(Resources.ORD.OrderMaster.Errors_BomInActive, orderDetail.Bom);
            }
            #endregion

            //订单单位和Bom单位不一致,需要做单位转换
            if (string.Compare(orderDetail.Uom, bomMaster.Uom) != 0)
            {
                fgUom = bomMaster.Uom;
                fgUnityQty = itemMgr.ConvertItemUomQty(orderDetail.Item, orderDetail.Uom, fgUnityQty, fgUom);
            }
            #endregion

            #region 创建OrderBomDetail
            //Item fgItem = genericMgr.FindById<Item>(orderDetail.Item);

            #region 查询Bom明细
            IList<BomDetail> bomDetailList = bomMgr.GetFlatBomDetail(bomMaster, orderMaster.StartTime);
            #endregion

            var itemCodes = bomDetailList.Select(b => b.Item).Distinct();
            #region 查询Bom Item
            IList<Item> bomItemList = this.genericMgr.FindAllIn<Item>("from Item where Code in(?", itemCodes);
            #endregion

            #region 查询工艺流程明细
            //IList<RoutingDetail> routingDetailList = null;
            //if (!string.IsNullOrEmpty(orderDetail.Routing))
            //{
            //    RoutingMaster routing = this.genericMgr.FindById<RoutingMaster>(orderDetail.Routing);
            //    if (!routing.IsActive)
            //    {
            //        throw new BusinessErrorException(Resources.ORD.OrderMaster.Errors_RoutingInActive, orderDetail.Routing);
            //    }
            //    routingDetailList = routingMgr.GetRoutingDetails(orderDetail.Routing, orderMaster.StartTime);
            //}
            #endregion

            #region 查询生产防错明细 SIH客户化是从零件追溯表中取需要扫描的零件。
            IList<string> itemTraceList = this.genericMgr.FindAllIn<string>
                ("select it.Item From ItemTrace as it where it.Item in (?", itemCodes);
            #endregion

            foreach (BomDetail bomDetail in bomDetailList)
            {
                #region 查找物料的来源库位和提前期
                string bomLocFrom = string.Empty;
                //来源库位查找逻辑RoutingDetail-->OrderDetail-->Order-->BomDetail 
                //工序的优先级最大,因为同一个OrderMaster可以有不同的工艺流程,其次OrderMaster,最后BomDetail
                TryLoadOrderOperations(orderDetail);
                if (orderDetail.Or 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SmartDeviceRef.User类代码示例发布时间:2022-05-26
下一篇:
C# MasterData.User类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap