Ejemplo n.º 1
0
        public static int UpdatePromotionTaskStatus(int id, PromotionConsts.PromotionTaskStatusEnum taskStatus,
                                                    string operateBy)
        {
            int result = DalPromotionJob.UpdatePromotionTaskStatus(id, taskStatus, operateBy);

            if (result > 0)
            {
                var promotionTask = DalPromotionJob.GetPromotionTaskById(id);
                if (promotionTask == null)
                {
                    return(0);
                }
                if (promotionTask.IsImmediately == 1) //需要立即执行
                {
                    if (taskStatus == PromotionConsts.PromotionTaskStatusEnum.Executed)
                    {
                        TuhuNotification.SendNotification("ExecutePromotionTask.setting", new
                        {
                            PromotionTaskId = id
                        }, 10000);
                    }
                }
            }
            return(result);
        }