Ejemplo n.º 1
0
        public FlowView CheckAndLoadFlowView(string flowCode, string userCode, string locationFromCode, string locationToCode, Hu hu, List <string> flowTypes)
        {
            //按物料号,单位,单包装
            FlowView flowView = LoadFlowView(flowCode, userCode, locationFromCode, locationToCode, hu, flowTypes);

            //看是否允许新建明细
            if (flowView == null)
            {
                IList <Flow> flowList = this.GetFlows(flowCode, locationFromCode, locationToCode, true, userCode, flowTypes);
                if (flowList != null && flowList.Count > 0)
                {
                    flowView      = new FlowView();
                    flowView.Flow = flowList[0];
                    FlowDetail flowDetail = new FlowDetail();
                    flowDetail.Item       = hu.Item;
                    flowDetail.Uom        = hu.Uom;
                    flowDetail.UnitCount  = hu.UnitCount;
                    flowView.LocationFrom = flowView.Flow.LocationFrom;
                    flowView.LocationTo   = flowView.Flow.LocationTo;
                }
            }
            if (flowView != null)
            {
                return(flowView);
            }
            else
            {
                throw new BusinessErrorException("Flow.Error.NotFoundMacthFlow", hu.HuId, flowCode);
            }
        }
Ejemplo n.º 2
0
        protected override void SetDetail(Resolver resolver)
        {
            List <string> flowTypes = new List <string>();

            flowTypes.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PRODUCTION);
            bool isHaslocationLotDetail = locationLotDetailMgr.CheckHuLocationExist(resolver.Input);

            if (!isHaslocationLotDetail)
            {
                throw new BusinessErrorException("Hu.Error.NoInventory", resolver.Input);
            }
            Hu       hu       = huMgr.CheckAndLoadHu(resolver.Input);
            FlowView flowView = null;

            //如果是扫描Bin,根据Hu和Bin匹配出flow
            if (resolver.CodePrefix == null || resolver.CodePrefix.Trim() == string.Empty)
            {
                //确定flow和flowView
                flowView = flowMgr.CheckAndLoadFlowView(null, resolver.UserCode, string.Empty, null, hu, flowTypes);
                setBaseMgr.FillResolverByFlow(resolver, flowView.Flow);
            }
            //如果已经确定了Flow
            else
            {
                //根据Flow和Hu匹配出flowView
                flowView = flowMgr.CheckAndLoadFlowView(resolver.Code, null, null, null, hu, flowTypes);
            }
            setDetailMgr.MatchHuByFlowView(resolver, flowView, hu);
        }
Ejemplo n.º 3
0
        public FlowView GetFlowViewInfo(int flowid)
        {
            using (var dal = BaseInfo._container.Resolve <UnitOfWork>())
            {
                var fv = new FlowView();
                var fa = dal.GetRepository <FlowActive>();
                var fs = dal.GetRepository <FlowStep>();

                var nodesModel = fs.Get(a => a.FlowId == flowid).ToList();

                var nodes = new ExpandoObject() as IDictionary <string, Object>;
                nodesModel.ForEach(a =>
                {
                    nodes.Add(a.flowNodeName, a);
                });

                fv.nodes = nodes;

                var linesModel = fa.Get(a => a.FlowId == flowid, includeProperties: "ConditionInfo").ToList();
                var lines      = new ExpandoObject() as IDictionary <string, Object>;
                linesModel.ForEach(a =>
                {
                    lines.Add(a.FlowLineName, a);
                });

                fv.lines = lines;
                fv.title = "dditFlow";
                fv.areas = new { };

                return(fv);
            }
        }
Ejemplo n.º 4
0
 public void Init(FlowView _view, int _id)
 {
     m_text      = this.transform.GetChild(0).GetComponent <Text>();
     m_view      = _view;
     m_id        = _id;
     m_text.text = "";
 }
Ejemplo n.º 5
0
                #pragma warning disable 612,618
        public bool UpgradeTo105()
        {
            this.flowView = FlowView.Layout | FlowView.Transitions;

            UnityEditor.EditorUtility.SetDirty(this);

            return(true);
        }
Ejemplo n.º 6
0
    public void AwakeMgr()
    {
        m_model = Utils.MakeObjectWithComponent <FlowModel>("FlowModel", this.gameObject);
        m_model.Init(this);

        m_view = Utils.MakeObjectWithComponent <FlowView>("FlowView", this.gameObject);
        m_view.Init(this);
    }
Ejemplo n.º 7
0
        public static TransformerDetail ConvertHuToTransformerDetail(FlowView flowView, Hu hu)
        {
            TransformerDetail transformerDetail = ConvertHuToTransformerDetail(hu);
            transformerDetail.LocationFromCode = flowView.LocationFrom != null ? flowView.LocationFrom.Code : null;
            transformerDetail.LocationToCode = flowView.LocationTo != null ? flowView.LocationTo.Code : null;
            transformerDetail.StorageBinCode = hu.StorageBin == null ? string.Empty : hu.StorageBin;

            return transformerDetail;
        }
Ejemplo n.º 8
0
        public static TransformerDetail ConvertHuToTransformerDetail(FlowView flowView, Hu hu)
        {
            TransformerDetail transformerDetail = ConvertHuToTransformerDetail(hu);

            transformerDetail.LocationFromCode = flowView.LocationFrom != null ? flowView.LocationFrom.Code : null;
            transformerDetail.LocationToCode   = flowView.LocationTo != null ? flowView.LocationTo.Code : null;
            transformerDetail.StorageBinCode   = hu.StorageBin == null ? string.Empty : hu.StorageBin;

            return(transformerDetail);
        }
Ejemplo n.º 9
0
        public ActionResult ActivityForm(Guid flowId)
        {
            IExecutionApplication executionApplication = null;

            executionApplication = ServiceLocator.Current.GetInstance <IExecutionApplication>();
            FlowView flow = executionApplication.GetFlow(flowId);

            //create Form
            ActivityFormView activityForm = executionApplication.GetActivityForm(flowId);

            return(View(flow.ProcessDefinitionName.Replace(" ", ""), activityForm));
        }
Ejemplo n.º 10
0
    public void InitPageParameter(FlowView flowView)
    {
        this.SafeStock    = flowView.FlowDetail.SafeStock.HasValue ? flowView.FlowDetail.SafeStock.Value : 0;
        this.MaxStock     = flowView.FlowDetail.MaxStock.HasValue ? flowView.FlowDetail.MaxStock.Value : 0;
        this.UC           = flowView.FlowDetail.UnitCount;
        this.InvQty       = flowView.LocationDetail.Qty;
        this.QtyToBeIn    = flowView.LocationDetail.QtyToBeIn;
        this.InTransitQty = flowView.LocationDetail.InTransitQty;
        this.QtyToBeOut   = flowView.LocationDetail.QtyToBeOut;

        this.GenKanbanCard();
    }
Ejemplo n.º 11
0
    public void InitPageParameter(FlowView flowView)
    {
        this.SafeStock = flowView.FlowDetail.SafeStock.HasValue ? flowView.FlowDetail.SafeStock.Value : 0;
        this.MaxStock = flowView.FlowDetail.MaxStock.HasValue ? flowView.FlowDetail.MaxStock.Value : 0;
        this.UC = flowView.FlowDetail.UnitCount;
        this.InvQty = flowView.LocationDetail.Qty;
        this.QtyToBeIn = flowView.LocationDetail.QtyToBeIn;
        this.InTransitQty = flowView.LocationDetail.InTransitQty;
        this.QtyToBeOut = flowView.LocationDetail.QtyToBeOut;

        this.GenKanbanCard();
    }
Ejemplo n.º 12
0
    protected void GV_List_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //生成看板图片
            FlowView       flowView = (FlowView)e.Row.DataItem;
            LocationDetail ld       = flowView.LocationDetail;
            GetKanbanControl(e.Row).InitPageParameter(flowView);

            this.SetLinkButton(e.Row, "lbQtyToBeIn", new string[] { ld.Item.Code, ld.Location.Code, BusinessConstants.IO_TYPE_IN }, ld.QtyToBeIn != 0);
            this.SetLinkButton(e.Row, "lbQtyToBeOut", new string[] { ld.Item.Code, ld.Location.Code, BusinessConstants.IO_TYPE_OUT }, ld.QtyToBeOut != 0);
            this.SetLinkButton(e.Row, "lbInTransitQty", new string[] { ld.Item.Code, ld.Location.Code, BusinessConstants.IO_TYPE_IN }, ld.InTransitQty != 0);

            if (e.Row.RowIndex == 0)
            {
                this.ltlLocation.Text = StringHelper.GetCodeDescriptionString(ld.Location.Code, ld.Location.Name);
            }
        }
    }
Ejemplo n.º 13
0
        public QuestsViewer()
        {
            KeyPreview = true;

            InitializeComponent();

            templates       = new ShapeTemplatesFactory(project);
            loader          = new Loader(code);
            editor          = new CodeEditor(code);
            flowView        = new FlowView(diagramSetController, project, display, templates);
            toolsManager    = new ToolsManager(toolSetController, flowView);
            editingContext  = new EditingContext(flow, history, code, editor);
            shortcutsReader = new ShortcutsReader(code, history);

            code.Saved += Code_Saved;

            history.Done   += History_Done;
            history.Undone += History_Undone;
        }
Ejemplo n.º 14
0
 public static RemoveLinkCommand RemoveLink(Link link, EditingContext context, FlowView flowView) =>
 new RemoveLinkCommand(link, context)
 {
     Done   = (_) => flowView.RemoveShapeLink(link),
     Undone = () => flowView.AddShapeLink(link),
 };
Ejemplo n.º 15
0
 public static DeactivateQuestCommand DeactivateQuest(Quest quest, EditingContext context, FlowView flowView) =>
 new DeactivateQuestCommand(quest, context)
 {
     Done   = (_) => flowView.Update(),
     Undone = flowView.Update,
 };
Ejemplo n.º 16
0
 public static RemoveQuestCommand RemoveQuest(Quest quest, EditingContext context, Node node, FlowView flowView, Shape shape) =>
 new RemoveQuestCommand(quest, context)
 {
     Done = (firstTime) => {
         if (!firstTime)
         {
             flowView.RemoveNodeShape(shape);
         }
     },
     Undone = () => flowView.AddShapeForNode(node, shape),
 };
Ejemplo n.º 17
0
 public static AddQuestCommand AddQuest(Quest quest, Sector sector, EditingContext context, FlowView flowView, Shape shape) =>
 new AddQuestCommand(quest, sector, context)
 {
     Done = (firstTime) => {
         var n = context.Flow.Graph.FindNodeForQuest(quest);
         if (firstTime)
         {
             flowView.RegisterShapeForNode(n, shape);
         }
         else
         {
             flowView.AddShapeForNode(n, shape);
         }
     },
     Undone = () => {
         flowView.RemoveNodeShape(shape);
     },
 };
Ejemplo n.º 18
0
 public virtual void DeleteFlowView(FlowView entity)
 {
     entityDao.DeleteFlowView(entity);
 }
Ejemplo n.º 19
0
 public virtual void UpdateFlowView(FlowView entity)
 {
     Update(entity);
 }
 public virtual void UpdateFlowView(FlowView entity)
 {
     Update(entity);
 }
Ejemplo n.º 21
0
 public virtual void DeleteFlowView(FlowView entity)
 {
     Delete(entity);
 }
Ejemplo n.º 22
0
 public void MatchHuByFlowView(Resolver resolver, FlowView flowView, Hu hu)
 {
     TransformerDetail transformerDetail = Utility.TransformerHelper.ConvertHuToTransformerDetail(flowView, hu);
     transformerDetail.StorageBinCode = resolver.BinCode;//库格
     resolver.AddTransformerDetail(transformerDetail);
 }
Ejemplo n.º 23
0
 public static RenameQuestCommand RenameQuest(Quest quest, string oldName, string newName, EditingContext context, FlowView flowView, Box shape) =>
 new RenameQuestCommand(quest, oldName, newName, context)
 {
     Done   = (_) => SetCaption(shape, newName),
     Undone = () => SetCaption(shape, oldName),
 };
Ejemplo n.º 24
0
 public virtual void DeleteFlowView(FlowView entity)
 {
     entityDao.DeleteFlowView(entity);
 }
Ejemplo n.º 25
0
 public virtual void UpdateFlowView(FlowView entity)
 {
     entityDao.UpdateFlowView(entity);
 }
Ejemplo n.º 26
0
 public virtual void CreateFlowView(FlowView entity)
 {
     entityDao.CreateFlowView(entity);
 }
Ejemplo n.º 27
0
        /// <summary>
        /// 只有发货扫描条码才支持不扫物流路线,扫描库格移库
        /// </summary>
        /// <param name="resolver"></param>
        protected override void SetDetail(Resolver resolver)
        {
            List <string> flowTypes = new List <string>();

            flowTypes.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER);
            Hu hu = huMgr.CheckAndLoadHu(resolver.Input);

            if (this.locationMgr.IsHuOcuppyByPickList(resolver.Input))
            {
                throw new BusinessErrorException("Order.Error.PickUp.HuOcuppied", resolver.Input);
            }
            FlowView flowView = null;


            if (hu.Location != null && hu.Location.Contains("MLAT") && hu.IsInspect == false)
            {
                throw new BusinessErrorException("Hu.Error.HuIdNotInspect", resolver.Input);
            }


            if (resolver.CodePrefix != null && resolver.CodePrefix.Trim() != string.Empty)
            {
                flowView = flowMgr.CheckAndLoadFlowView(resolver.Code, null, null, null, hu, flowTypes);
            }
            else
            {
                if (resolver.BinCode == null || resolver.BinCode == string.Empty)
                {
                    throw new BusinessErrorException("Common.Business.Error.ScanFlowOrStorageBinFirst");
                }
                else
                {
                    flowView = flowMgr.CheckAndLoadFlowView(null, resolver.UserCode, hu.Location, resolver.LocationToCode, hu, flowTypes);
                    setBaseMgr.FillResolverByFlow(resolver, flowView.Flow);
                }
            }

            #region 先进先出校验
            if (flowView.Flow.IsGoodsReceiveFIFO)
            {
                IList <string> huIdList = new List <string>();
                if (resolver.Transformers != null && resolver.Transformers.Count > 0)
                {
                    foreach (Transformer transformer in resolver.Transformers)
                    {
                        if (transformer.TransformerDetails != null && transformer.TransformerDetails.Count > 0)
                        {
                            foreach (TransformerDetail det in transformer.TransformerDetails)
                            {
                                if (det.CurrentQty != decimal.Zero)
                                {
                                    huIdList.Add(det.HuId);
                                }
                            }
                        }
                    }
                }

                string minLot = setDetailMgr.CheckFIFO(hu, huIdList);
                if (minLot != string.Empty && minLot != null)
                {
                    throw new BusinessErrorException("FIFO.ERROR", hu.HuId, minLot);
                }
            }
            #endregion

            setDetailMgr.MatchHuByFlowView(resolver, flowView, hu);
        }
Ejemplo n.º 28
0
 public virtual void UpdateFlowView(FlowView entity)
 {
     entityDao.UpdateFlowView(entity);
 }
Ejemplo n.º 29
0
 public static ActivateQuestCommand ActivateQuest(Quest quest, Sector sector, EditingContext context, FlowView flowView) =>
 new ActivateQuestCommand(quest, sector, context)
 {
     Done   = (_) => flowView.Update(),
     Undone = flowView.Update,
 };
Ejemplo n.º 30
0
 public virtual void CreateFlowView(FlowView entity)
 {
     Create(entity);
 }
Ejemplo n.º 31
0
 public bool HasView(FlowView view)
 {
     return((this.flowView & view) != 0);
 }
Ejemplo n.º 32
0
		#pragma warning disable 612,618
		public bool UpgradeTo105() {

			this.flowView = FlowView.Layout | FlowView.Transitions;
			
			UnityEditor.EditorUtility.SetDirty(this);

			return true;
			
		}
 public virtual void CreateFlowView(FlowView entity)
 {
     Create(entity);
 }
Ejemplo n.º 34
0
		public bool HasView(FlowView view) {

			return (this.flowView & view) != 0;

		}
 public virtual void DeleteFlowView(FlowView entity)
 {
     Delete(entity);
 }
Ejemplo n.º 36
0
        protected override void SetDetail(Resolver resolver)
        {
            List <string> flowTypes = new List <string>();

            flowTypes.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER);
            flowTypes.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT);
            flowTypes.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_DISTRIBUTION);
            flowTypes.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_CUSTOMERGOODS);
            Hu hu = huMgr.CheckAndLoadHu(resolver.Input);

            if (this.locationMgr.IsHuOcuppyByPickList(resolver.Input))
            {
                throw new BusinessErrorException("Order.Error.PickUp.HuOcuppied", resolver.Input);
            }

            FlowView flowView = null;

            //移库路线类型退货(退库)可以跟据库格和库位找出相对应的移库路线
            if (resolver.CodePrefix == null || resolver.CodePrefix.Trim() == string.Empty)
            {
                if (resolver.BinCode == null || resolver.BinCode.Trim() == string.Empty)
                {
                    throw new BusinessErrorException("Common.Business.Error.ScanFlowOrStorageBinFirst");
                }
                if (resolver.LocationFormCode == null || resolver.LocationFormCode.Trim() == string.Empty)
                {
                    throw new BusinessErrorException("Common.Business.Error.ScanFlowOrLocationFirst");
                }
                if (hu.Location != null)
                {
                    if (hu.Location != resolver.LocationFormCode)
                    {
                        throw new BusinessErrorException("Common.Business.Error.HuNoInventory", resolver.LocationFormCode, hu.HuId);
                    }
                }
                //确定flow和flowView
                List <string> transferType = new List <string>();
                transferType.Add(BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER);
                flowView = flowMgr.CheckAndLoadFlowView(null, resolver.UserCode, resolver.LocationToCode, resolver.LocationFormCode, hu, transferType);
                setBaseMgr.FillResolverByFlow(resolver, flowView.Flow);
                resolver.Result = resolver.LocationFormCode + " => " + resolver.LocationToCode;
            }

            //已经确定了Flow,匹配新的Hu
            if (resolver.CodePrefix != null && resolver.CodePrefix.Trim() != string.Empty)
            {
                flowView = flowMgr.CheckAndLoadFlowView(resolver.Code, null, null, null, hu, null);
                //退库检查库存
                if ((resolver.OrderType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_TRANSFER ||
                     resolver.OrderType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_PROCUREMENT ||
                     resolver.OrderType == BusinessConstants.CODE_MASTER_ORDER_TYPE_VALUE_CUSTOMERGOODS) &&
                    flowView.Flow.IsReceiptScanHu
                    )
                {
                    LocationLotDetail locationLotDetail = locationLotDetailMgr.CheckLoadHuLocationLotDetail(hu.HuId);
                    hu.Qty = locationLotDetail.Qty / hu.UnitQty;
                }
            }
            else
            {
                throw new BusinessErrorException("Common.Business.Error.ScanFlowFirst");
            }
            setDetailMgr.MatchHuByFlowView(resolver, flowView, hu);
        }
Ejemplo n.º 37
0
        public FlowView CheckAndLoadFlowView(string flowCode, string userCode, string locationFromCode, string locationToCode, Hu hu, List<string> flowTypes)
        {

            //按物料号,单位,单包装
            FlowView flowView = LoadFlowView(flowCode, userCode, locationFromCode, locationToCode, hu, flowTypes);

            //看是否允许新建明细
            if (flowView == null)
            {
                IList<Flow> flowList = this.GetFlows(flowCode, locationFromCode, locationToCode, true, userCode, flowTypes);
                if (flowList != null && flowList.Count > 0)
                {
                    flowView = new FlowView();
                    flowView.Flow = flowList[0];
                    FlowDetail flowDetail = new FlowDetail();
                    flowDetail.Item = hu.Item;
                    flowDetail.Uom = hu.Uom;
                    flowDetail.UnitCount = hu.UnitCount;
                    flowView.LocationFrom = flowView.Flow.LocationFrom;
                    flowView.LocationTo = flowView.Flow.LocationTo;
                }
            }
            if (flowView != null)
            {
                return flowView;
            }
            else
            {
                throw new BusinessErrorException("Flow.Error.NotFoundMacthFlow", hu.HuId, flowCode);
            }
        }
Ejemplo n.º 38
0
 public virtual void CreateFlowView(FlowView entity)
 {
     entityDao.CreateFlowView(entity);
 }