Example #1
0
        public bool GiveScoreBtpShare(Guid userId, Guid appId, int srore, Guid commodityOrderId, string commodityOrderCode, Jinher.AMP.Sign.Deploy.Enum.ScoringType scoringType, decimal money, int scale, ScoreTypeEnum scoreType)
        {
            bool   result          = false;
            string scoringTypeName = string.Empty;
            //设置积分显示名称
            string bizName = commodityOrderCode;

            if (scoringType == Jinher.AMP.Sign.Deploy.Enum.ScoringType.BtpDistributeSale)
            {
                scoringTypeName = "分销";
                bizName         = "分销佣金" + money + "元(1元=" + scale + "积分)";
            }
            else if (scoringType == Jinher.AMP.Sign.Deploy.Enum.ScoringType.BtpShareSale)
            {
                scoringTypeName = "众销";
                bizName         = "众销佣金" + money + "元(1元=" + scale + "积分)";
            }
            else if (scoringType == Jinher.AMP.Sign.Deploy.Enum.ScoringType.BtpChannelBrokerage)
            {
                scoringTypeName = "渠道";
                bizName         = "渠道佣金" + money + "元(1元=" + scale + "积分)";
            }
            try
            {
                //获取用户账号,那边显示用
                var          jsonr        = CBCSV.GetUserNameAndCode(userId);
                var          userCode     = jsonr.Item2;
                GiveScoreDTO giveScoreDTO = new GiveScoreDTO()
                {
                    Account   = userCode,
                    AppId     = appId,
                    UserId    = userId,
                    BizId     = commodityOrderId,
                    BizName   = bizName,
                    BizType   = Jinher.AMP.Sign.Deploy.Enum.BizType.CustomBtp,
                    Scores    = srore,
                    SubId     = userId,
                    ScoreType = scoringType
                };
                Jinher.AMP.Sign.IBP.Facade.GiveRewardsFacade grFacade = new GiveRewardsFacade();
                grFacade.ContextDTO = AuthorizeHelper.CoinInitAuthorizeInfo();
                LogHelper.Info(scoringTypeName + string.Format("发放积分GiveScoreBtpShare。giveScoreDTO:{0};scoreType:{1}", JsonHelper.JsonSerializer(giveScoreDTO), scoreType));
                Jinher.AMP.Sign.Deploy.CustomDTO.ReturnInfoDTO signResult = grFacade.GiveScoreBtpShareNew(giveScoreDTO, DateTime.Now, scoreType == ScoreTypeEnum.Currency);
                if (!signResult.IsSuccess)
                {
                    LogHelper.Error(scoringTypeName + string.Format("发放积分失败。giveScoreDTO:{0}", JsonHelper.JsonSerializer(giveScoreDTO)));
                    return(result);
                }
                result = true;
            }
            catch (Exception ex)
            {
                LogHelper.Error(scoringTypeName + string.Format("发放积分异常。userId:{0},appId:{1},srore:{2},commodityOrderId:{3},commodityOrderCode:{4},scoringType:{5},money:{6},scale:{7}", userId, appId, srore, commodityOrderId, commodityOrderCode, (int)scoringType, money, scale), ex);
            }
            return(result);
        }
Example #2
0
        public bool GiveScoreBtpComment(Guid userId, Guid appId, string bizUrl, Guid commodityOrderId, string commodityOrderCode, Guid reviewId)
        {
            bool result = false;

            try
            {
                //获取用户账号,那边显示用
                var          jsonr        = CBCSV.GetUserNameAndCode(userId);
                var          userCode     = jsonr.Item2;
                GiveScoreDTO giveScoreDTO = new GiveScoreDTO()
                {
                    Account   = userCode,
                    AppId     = appId,
                    UserId    = userId,
                    BizId     = commodityOrderId,
                    BiztId    = reviewId,
                    BizName   = commodityOrderCode,
                    BizType   = Jinher.AMP.Sign.Deploy.Enum.BizType.CustomBtp,
                    BizUrl    = bizUrl,
                    ScoreType = Jinher.AMP.Sign.Deploy.Enum.ScoringType.Comment
                };
                Jinher.AMP.Sign.IBP.Facade.GiveRewardsFacade grFacade = new GiveRewardsFacade();
                grFacade.ContextDTO = AuthorizeHelper.CoinInitAuthorizeInfo();
                LogHelper.Info(string.Format("评价送积分GiveScoreBtpComment。giveScoreDTO:{0}", JsonHelper.JsonSerializer(giveScoreDTO)));
                Jinher.AMP.Sign.Deploy.CustomDTO.ReturnInfoDTO signResult = grFacade.GiveScoreBtpComment(giveScoreDTO);
                if (!signResult.IsSuccess)
                {
                    LogHelper.Error(string.Format("评价送积分失败。giveScoreDTO:{0}", JsonHelper.JsonSerializer(giveScoreDTO)));
                    return(result);
                }
                result = true;
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("评价送积分异常。userId:{0},appId:{1},bizUrl:{2},commodityOrderId:{3},commodityOrderCode:{4},reviewId:{5}", userId, appId, bizUrl, commodityOrderId, commodityOrderCode, reviewId), ex);
            }
            return(result);
        }
Example #3
0
        public bool RefundScore(Guid userId, Guid appId, int srore, Guid commodityOrderId, string commodityOrderCode, ScoreTypeEnum type)
        {
            bool result = false;

            try
            {
                //获取用户账号,那边显示用
                var          jsonr        = CBCSV.GetUserNameAndCode(userId);
                var          userCode     = jsonr.Item2;
                GiveScoreDTO giveScoreDTO = new GiveScoreDTO()
                {
                    Account = userCode,
                    AppId   = appId,
                    UserId  = userId,
                    BizId   = commodityOrderId,
                    BizName = commodityOrderCode,
                    BizType = Jinher.AMP.Sign.Deploy.Enum.BizType.CustomBtp,
                    Scores  = srore,
                    SubId   = userId
                };
                Jinher.AMP.Sign.IBP.Facade.GiveRewardsFacade grFacade = new GiveRewardsFacade();
                grFacade.ContextDTO = AuthorizeHelper.CoinInitAuthorizeInfo();
                LogHelper.Info(string.Format("回退积分GiveScoreBtpBackNew。giveScoreDTO:{0}", JsonHelper.JsonSerializer(giveScoreDTO)));
                Jinher.AMP.Sign.Deploy.CustomDTO.ReturnInfoDTO signResult = grFacade.GiveScoreBtpBackNew(giveScoreDTO, DateTime.Now, type == ScoreTypeEnum.Currency);
                if (!signResult.IsSuccess)
                {
                    LogHelper.Error(string.Format("回退积分失败。giveScoreDTO:{0}", JsonHelper.JsonSerializer(giveScoreDTO)));
                    return(result);
                }
                result = true;
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("回退积分异常。userId:{0},appId:{1},srore:{2},commodityOrderId:{3},commodityOrderCode:{4},type:{5}", userId, appId, srore, commodityOrderId, commodityOrderCode, type), ex);
            }
            return(result);
        }