Exemple #1
0
        public void Execute()
        {
            string errMsg = string.Empty;

            try
            {
                if (!Check(out errMsg))
                {
                    // 只要这里有错误 必须还原到原来的状态,英文前面已经更新过
                    if (this.existingPayEntity != null)
                    {
                        new RepositoryFactory().BaseRepository().Update(this.existingPayEntity);
                    }
                    else
                    {
                        new RepositoryFactory().BaseRepository().Delete(this.inputPayEntity);
                    }
                    throw new Exception(errMsg);
                }
                AdjustTheFundsPool();
                GenerateFlowOrders();

                Transdb.Commit();
            }
            catch (Exception ex)
            {
                Transdb.Rollback();
                throw new Exception(ex.Message);
            }
        }
Exemple #2
0
 public void Execute()
 {
     try
     {
         AdjustTheFundsPool();
         GenerateFlowOrders();
         NoteFlowInformation();
         Transdb.Commit();
     }
     catch (Exception ex)
     {
         Transdb.Rollback();
         throw new Exception(ex.Message);
     }
 }
Exemple #3
0
        public void Execute()
        {
            string errMsg = string.Empty;

            try
            {
                if (!Check(out errMsg))
                {
                    // 只要这里有错误 必须还原到原来的状态,英文前面已经更新过
                    if (this.existingPayEntity != null)
                    {
                        new RepositoryFactory().BaseRepository().Update(this.existingPayEntity);
                    }
                    else
                    {
                        ////如果是第一次调用占用接口 失败了,应该把刚插入的付款单数据删除了
                        ////判断是不是有过流水记录
                        //if (lastPayInfoDetailsEntity == null)
                        //{
                        new RepositoryFactory().BaseRepository().Delete(this.inputPayEntity);
                        // }
                    }
                    throw new Exception(errMsg);
                }
                //特殊情况判断,因为共享平台会重复调用占用接口,判断最后一条流水是占用状态,且金相同时不用生成流水或调整金额
                if (lastPayInfoDetailsEntity == null || !(lastPayInfoDetailsEntity.Details_Type == (int)PayDetailsTypeEnum.Lock && lastPayInfoDetailsEntity.Amount == operationAmount))
                {
                    AdjustTheFundsPool();
                    GenerateFlowOrders();
                }


                Transdb.Commit();
            }
            catch (Exception ex)
            {
                Transdb.Rollback();
                throw new Exception(ex.Message);
            }
        }