예제 #1
0
        /// <summary>
        /// 呼叫维修完成
        /// </summary>
        /// <param name="selectCall"></param>
        /// <returns></returns>
        async Task execCallRepairComplete(MqCall selectCall)
        {
            var call = new Redux.Models.MqCall()
            {
                machineCode = selectCall.MachineCode,
                callType    = Redux.Models.MqCallType.RepairComplete,
                CallId      = Guid.NewGuid().GetHashCode(),
            };

            App.Logger.Info("维修完成: " + JsonConvert.SerializeObject(call));
            var callSuccess = await App.Store.Dispatch(UnityIocService.ResolveDepend <MqEffects>().CallSystem(new MqActions.CallSystem(selectCall.MachineCode, call)));

            if (callSuccess)
            {
                App.Store.Dispatch(new SysActions.ShowNotification(new SysNotificationMsg()
                {
                    Title   = "通知",
                    Content = $"{selectCall.MachineCode} 维修完成"
                }));
            }
            else
            {
                App.Store.Dispatch(new SysActions.ShowNotification(new SysNotificationMsg()
                {
                    Title   = "警告",
                    Content = $"{selectCall.MachineCode} 维修完成状态上传失败,请重试"
                }));
            }
        }
예제 #2
0
        /// <summary>
        /// 呼叫维修
        /// </summary>
        /// <param name="selectCall"></param>
        void execCallRepair(MqCall selectCall)
        {
            var frm = new CallRepairForm()
            {
                OnOkPressed = async f => {
                    var repairForm = f as CallRepairForm;
                    var call       = new Redux.Models.MqCall()
                    {
                        machineCode = selectCall.MachineCode,
                        callType    = Redux.Models.MqCallType.Repair,
                        callAction  = repairForm.RepairType.GetAttribute <DisplayAttribute>().Name,
                        CallId      = Guid.NewGuid().GetHashCode(),
                    };
                    App.Logger.Info("呼叫维修: " + JsonConvert.SerializeObject(call));
                    var callSuccess = await App.Store.Dispatch(UnityIocService.ResolveDepend <MqEffects>().CallSystem(new MqActions.CallSystem(selectCall.MachineCode, call)));

                    if (callSuccess)
                    {
                        App.Store.Dispatch(new SysActions.ShowNotification(new SysNotificationMsg()
                        {
                            Title   = "通知",
                            Content = $"{selectCall.MachineCode} 申报维修成功 {repairForm.RepairType.GetAttribute<DisplayAttribute>().Name }"
                        }));
                    }
                    else
                    {
                        App.Store.Dispatch(new SysActions.ShowNotification(new SysNotificationMsg()
                        {
                            Title   = "警告",
                            Content = $"{selectCall.MachineCode} 申报维修失败 {repairForm.RepairType.GetAttribute<DisplayAttribute>().Name },请重试"
                        }));
                    }
                }
            };

            App.Store.Dispatch(new SysActions.ShowFormView("选择故障类型", frm, false));
        }