示例#1
0
文件: Order.cs 项目: tynr426/ict
        /// <summary>
        /// 订单支付
        /// </summary>
        /// <param name="para"></param>
        /// <returns></returns>
        public static IResultResponse OrderUpdate(SysParameter para)
        {
            int sellerId  = para.ToInt("FKId");
            int dbId      = para.ToInt("DBId");
            int orderId   = para.ToInt("OrderId");
            int upBuyerId = para.ToInt("BuyerId");

            try
            {
                ConnectorRelation connectorEntity = new ConnectorBusiness(para.dapperFactory).GetDownConnector(sellerId, upBuyerId, dbId);
                if (connectorEntity.Id == null)
                {
                    return(ResultResponse.ExceptionResult("没有找到对应的下游"));
                }
                RelationMappingEntity orderMappingEntity = new OrderRelationBusiness(para.dapperFactory).GetDownOrder(sellerId, dbId, orderId, upBuyerId);
                if (!orderMappingEntity.OrderMapping.ContainsKey(orderId))
                {
                    return(ResultResponse.ExceptionResult("没有找到对应的订单"));
                }

                new OrderRelationBusiness(para.dapperFactory).UpdateUpOrder(connectorEntity, para.ToDictionary());

                return(ResultResponse.GetSuccessResult(200));
            }
            catch (Exception ex)
            {
                return(ResultResponse.ExceptionResult(ex));
            }
        }