Exemple #1
0
        //添加app
        public static string AddPavilionApp(Jinher.AMP.BTP.Deploy.CustomDTO.MallApply.MallApplyDTO model)
        {
            ResultDTO dto = null;

            try
            {
                PavilionAppFacade facade = new PavilionAppFacade();
                if (string.IsNullOrWhiteSpace(model.AppId.ToString()) && (!model.AppId.ToString().Contains("00000000-0000-0000-0000-000000000000")))
                {
                    throw new Exception("appId不能为空");
                }
                if (string.IsNullOrWhiteSpace(model.EsAppId.ToString()) && (!model.EsAppId.ToString().Contains("00000000-0000-0000-0000-000000000000")))
                {
                    throw new Exception("esappId不能为空");
                }
                Jinher.AMP.ZPH.Deploy.CustomDTO.PavilionAppCDTO pavilionapp = new Jinher.AMP.ZPH.Deploy.CustomDTO.PavilionAppCDTO();
                pavilionapp.id       = Guid.NewGuid();
                pavilionapp.appId    = model.AppId;
                pavilionapp.appName  = model.AppName;
                pavilionapp.belongTo = model.EsAppId;
                var result = APPSV.GetAppNameIcon(model.AppId);
                if (!string.IsNullOrEmpty(result.AppIcon))
                {
                    pavilionapp.appIcon = result.AppIcon;
                }
                else
                {
                    pavilionapp.appIcon = "找不到";
                }
                if (!string.IsNullOrEmpty(result.OwnerId.ToString()) && (!result.OwnerId.ToString().Contains("00000000-0000-0000-0000-000000000000")))
                {
                    pavilionapp.appAccount = result.OwnerId.ToString();
                }
                else
                {
                    pavilionapp.appAccount = Guid.NewGuid().ToString();
                }
                pavilionapp.appCreateOn = result.CreateDate;
                pavilionapp.subId       = model.UserId;
                pavilionapp.subTime     = DateTime.Now;
                pavilionapp.modifiedOn  = DateTime.Now;
                dto = facade.SavePavilionApp(pavilionapp);
            }
            catch (Exception ex)
            {
                dto = new ResultDTO {
                    ResultCode = 1, Message = ex.Message, isSuccess = false
                };
            }
            return(dto.Message);
        }
Exemple #2
0
        /// <summary>
        /// 售中发送消息
        /// </summary>
        /// <param name="commodityOrderMessages">售中消息发送实体</param>
        /// <returns></returns>
        public ResultDTO AddMessagesCommodityOrder(CommodityOrderMessages commodityOrderMessages)
        {
            try
            {
                string contentCode = string.Empty;

                //发送到:1卖家,2买家,3卖家与买家
                int sendTO     = 0;
                int sendToTool = 0;

                string refundTypeText = "";
                if (commodityOrderMessages.RefundType == 0)
                {
                    refundTypeText = "退款";
                    //commodityOrderMessages.Messages = "您的订单" + commodityOrderMessages.Code + ",客户已申请退款,请关注!";
                }
                //退款退货
                else if (commodityOrderMessages.RefundType == 1)
                {
                    refundTypeText = "退款/退货";
                    //commodityOrderMessages.Messages = "您的订单" + commodityOrderMessages.Code + ",客户已申请退款/退货,请关注!";
                }

                //买家延长3天时
                if (commodityOrderMessages.IsBuyersDelayTime)
                {
                    sendTO = 1;
                    commodityOrderMessages.Messages = "编号为" + commodityOrderMessages.Code + "订单买家申请延长收货时间3天!";
                }
                //卖家延长3天时
                else if (commodityOrderMessages.IsSellerDelayTime)
                {
                    sendTO = 2;
                    commodityOrderMessages.Messages = "编号为" + commodityOrderMessages.Code + "订单商家申请延长收货时间3天!";
                }
                //申请时
                else if ((commodityOrderMessages.State == 8 || commodityOrderMessages.State == 9 || commodityOrderMessages.State == 14) && commodityOrderMessages.orderRefundState == 0)
                {
                    sendTO = 1;
                    //sendToTool = 1;
                    commodityOrderMessages.Messages = "您的订单" + commodityOrderMessages.Code + ",客户已申请" + refundTypeText + ",请关注!";
                }
                //撤消
                else if ((commodityOrderMessages.State == 1 || commodityOrderMessages.State == 2 || commodityOrderMessages.State == 13) && commodityOrderMessages.orderRefundState == 3)
                {
                    sendTO = 1;
                    commodityOrderMessages.Messages = "订单" + commodityOrderMessages.Code + ",客户已撤销" + refundTypeText + "申请,请关注!";
                }
                //拒绝申请
                else if ((commodityOrderMessages.State == 1 || commodityOrderMessages.State == 2 || commodityOrderMessages.State == 13) && commodityOrderMessages.orderRefundState == 2)
                {
                    sendTO = 2;
                    commodityOrderMessages.Messages = "由于" + commodityOrderMessages.RefuseReason + ",您的订单" + commodityOrderMessages.Code + ",商家拒绝了您的" + refundTypeText + "申请,请关注!";
                }
                //拒绝收货
                else if ((commodityOrderMessages.State == 2 || commodityOrderMessages.State == 13) && commodityOrderMessages.orderRefundState == 4)
                {
                    sendTO = 2;
                    commodityOrderMessages.Messages = "由于" + commodityOrderMessages.RefuseReason + ",您的订单" + commodityOrderMessages.Code + ",商家拒绝接受您的退货,请关注!";
                }
                //退款
                else if (commodityOrderMessages.State == 7 && commodityOrderMessages.orderRefundState == 1)
                {
                    sendTO = 2;
                    //仅退款
                    if (commodityOrderMessages.RefundType == 0)
                    {
                        if (commodityOrderMessages.PayType == 0)   //金币=0
                        {
                            commodityOrderMessages.Messages = "您的订单" + commodityOrderMessages.Code + "已完成退款,退款金额" + commodityOrderMessages.RefundMoney + "元,请到金币账户确认!";
                        }
                        else if (commodityOrderMessages.PayType == 3)   //支付宝担保
                        {
                            commodityOrderMessages.Messages = "您的订单" + commodityOrderMessages.Code + "已完成退款,退款金额" + commodityOrderMessages.RefundMoney + "元,请到支付宝账户确认!";
                        }
                        else if (commodityOrderMessages.PayType == 4)   //U付
                        {
                            commodityOrderMessages.Messages = "您的订单" + commodityOrderMessages.Code + "已完成退款,退款金额" + commodityOrderMessages.RefundMoney + "元,请到支付账户确认!";
                        }
                    }
                    //退款退货
                    else if (commodityOrderMessages.RefundType == 1)
                    {
                        if (commodityOrderMessages.PayType == 0)   //金币=0
                        {
                            commodityOrderMessages.Messages = "您的订单" + commodityOrderMessages.Code + "已完成退款,退款金额" + commodityOrderMessages.RefundMoney + "元,请到金币账户确认!";
                        }
                        else if (commodityOrderMessages.PayType == 3)   //支付宝担保
                        {
                            commodityOrderMessages.Messages = "您的订单" + commodityOrderMessages.Code + "已完成退款,退款金额" + commodityOrderMessages.RefundMoney + "元,请到支付宝账户确认!";
                        }
                        else if (commodityOrderMessages.PayType == 4)   //U付
                        {
                            commodityOrderMessages.Messages = "您的订单" + commodityOrderMessages.Code + "已完成退款,退款金额" + commodityOrderMessages.RefundMoney + "元,请到支付账户确认!";
                        }
                    }
                }
                //退货申请 同意
                else if (commodityOrderMessages.State == 10 && commodityOrderMessages.orderRefundState == 10)
                {
                    sendTO = 2;
                    commodityOrderMessages.Messages = "您的订单" + commodityOrderMessages.Code + "商家已同意退款/退货,请在7天内发货!";
                }
                //填写退货信息后
                else if (commodityOrderMessages.State == 10 && commodityOrderMessages.orderRefundState == 11)
                {
                    sendTO = 1;
                    commodityOrderMessages.Messages = "退款/退货中的订单" + commodityOrderMessages.Code + ",客户已发货,请注意查收!";
                }


                if (sendTO == 1)
                {
                    //发给商家
                    string _appName = APPSV.GetAppName(commodityOrderMessages.AppId);
                    commodityOrderMessages.Messages = "【" + _appName + "】" + commodityOrderMessages.Messages;
                    SendMessageCommon(commodityOrderMessages.Messages, commodityOrderMessages.Messages, commodityOrderMessages.Messages, 3, commodityOrderMessages.AppId, commodityOrderMessages.Id, commodityOrderMessages.Code, null, false);
                }
                else if (sendTO == 2)
                {
                    //发给买家
                    contentCode = "BTP002";
                    PublishOrderMessage(commodityOrderMessages.Id, commodityOrderMessages.UserIds, commodityOrderMessages.EsAppId, commodityOrderMessages.Messages, contentCode, false);
                    ////正品会发送消息
                    //if (new ZPHSV().CheckIsAppInZPH(commodityOrderMessages.AppId))
                    //{
                    //    //addmassage.AddMessages(odid, usid, CustomConfig.ZPHAppId, order.Code, order.State, "", type);
                    //    PublishOrderMessage(commodityOrderMessages.Id, commodityOrderMessages.UserIds, CustomConfig.ZPHAppId, commodityOrderMessages.Messages, contentCode, false);
                    //}
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("推送消息服务异常。commodityOrderMessages:{0}", JsonHelper.JsonSerializer(commodityOrderMessages)), ex);
                return(new ResultDTO {
                    ResultCode = 1, Message = "Error"
                });
            }
            return(new ResultDTO {
                ResultCode = 0, Message = "Success"
            });
        }
Exemple #3
0
        /// <summary>
        /// 售后发送消息
        /// </summary>
        /// <param name="afterSalesMessages">售后消息发送实体</param>
        /// <returns></returns>
        public ResultDTO AddMessagesAfterSales(AfterSalesMessages afterSalesMessages)
        {
            try
            {
                string contentCode = string.Empty;

                //发送到:1卖家,2买家,3卖家与买家
                int sendTO     = 0;
                int sendToTool = 0;

                //卖家延长3天时
                if (afterSalesMessages.IsSellerDelayTime)
                {
                    sendTO = 2;
                    afterSalesMessages.Messages = "编号为" + afterSalesMessages.Code + "订单商家申请延长收货时间3天!";
                }
                //申请时
                else if (afterSalesMessages.State == 5 && afterSalesMessages.orderRefundAfterSalesState == 0)
                {
                    sendTO     = 1;
                    sendToTool = 1;
                    //仅退款
                    if (afterSalesMessages.RefundType == 0)
                    {
                        afterSalesMessages.Messages = "您的订单" + afterSalesMessages.Code + ",客户已申请退款,请关注!";
                    }
                    //退款退货
                    else if (afterSalesMessages.RefundType == 1)
                    {
                        afterSalesMessages.Messages = "您的订单" + afterSalesMessages.Code + ",客户已申请退款/退货,请关注!";
                    }
                }
                //撤消
                else if (afterSalesMessages.State == 3 && afterSalesMessages.orderRefundAfterSalesState == 3)
                {
                    sendTO = 1;
                    afterSalesMessages.Messages = "订单" + afterSalesMessages.Code + ",客户已撤销退款/退货申请,请关注!";
                }
                //拒绝申请
                else if (afterSalesMessages.State == 3 && afterSalesMessages.orderRefundAfterSalesState == 2)
                {
                    sendTO = 2;
                    //仅退款
                    if (afterSalesMessages.RefundType == 0)
                    {
                        afterSalesMessages.Messages = "由于" + afterSalesMessages.RefuseReason + ",您的订单" + afterSalesMessages.Code + ",商家拒绝了您的退款申请,请关注!";
                    }
                    //退款退货
                    else if (afterSalesMessages.RefundType == 1)
                    {
                        afterSalesMessages.Messages = "由于" + afterSalesMessages.RefuseReason + ",您的订单" + afterSalesMessages.Code + ",商家拒绝了您的退款/退货申请,请关注!";
                    }
                }
                //拒绝收货
                else if (afterSalesMessages.State == 3 && afterSalesMessages.orderRefundAfterSalesState == 4)
                {
                    sendTO = 2;
                    afterSalesMessages.Messages = "由于" + afterSalesMessages.RefuseReason + ",您的订单" + afterSalesMessages.Code + ",商家拒绝接受您的退货,请关注!";
                }
                //退款
                else if (afterSalesMessages.State == 7 && afterSalesMessages.orderRefundAfterSalesState == 1)
                {
                    sendTO = 2;
                    //仅退款
                    if (afterSalesMessages.RefundType == 0)
                    {
                        if (afterSalesMessages.PayType == 0)   //金币=0
                        {
                            afterSalesMessages.Messages = "您的订单" + afterSalesMessages.Code + "已完成退款,退款金额" + afterSalesMessages.RefundMoney + "元,请到金币账户确认!";
                        }
                        else if (afterSalesMessages.PayType == 3)   //支付宝担保
                        {
                            afterSalesMessages.Messages = "您的订单" + afterSalesMessages.Code + "已完成退款,退款金额" + afterSalesMessages.RefundMoney + "元,请到支付宝账户确认!";
                        }
                        else if (afterSalesMessages.PayType == 4)   //U付
                        {
                            afterSalesMessages.Messages = "您的订单" + afterSalesMessages.Code + "已完成退款,退款金额" + afterSalesMessages.RefundMoney + "元,请到支付账户确认!";
                        }
                    }
                    //退款退货
                    else if (afterSalesMessages.RefundType == 1)
                    {
                        if (afterSalesMessages.PayType == 0)   //金币=0
                        {
                            afterSalesMessages.Messages = "您的订单" + afterSalesMessages.Code + "已完成退款,退款金额" + afterSalesMessages.RefundMoney + "元,请到金币账户确认!";
                        }
                        else if (afterSalesMessages.PayType == 3)   //支付宝担保
                        {
                            afterSalesMessages.Messages = "您的订单" + afterSalesMessages.Code + "已完成退款,退款金额" + afterSalesMessages.RefundMoney + "元,请到支付宝账户确认!";
                        }
                        else if (afterSalesMessages.PayType == 4)   //U付
                        {
                            afterSalesMessages.Messages = "您的订单" + afterSalesMessages.Code + "已完成退款,退款金额" + afterSalesMessages.RefundMoney + "元,请到支付账户确认!";
                        }
                    }
                }
                //退货申请 同意
                else if (afterSalesMessages.State == 10 && afterSalesMessages.orderRefundAfterSalesState == 10)
                {
                    sendTO = 2;
                    afterSalesMessages.Messages = "您的订单" + afterSalesMessages.Code + "商家已同意退款/退货,请在7天内发货!";
                }
                //填写退货信息后
                else if (afterSalesMessages.State == 10 && afterSalesMessages.orderRefundAfterSalesState == 11)
                {
                    sendTO = 1;
                    afterSalesMessages.Messages = "退款/退货中的订单" + afterSalesMessages.Code + ",客户已发货,请注意查收!";
                }

                if (sendTO == 1)
                {
                    //发给商家
                    string _appName = APPSV.GetAppName(afterSalesMessages.AppId);
                    afterSalesMessages.Messages = "【" + _appName + "】" + afterSalesMessages.Messages;
                    SendMessageCommon(afterSalesMessages.Messages, afterSalesMessages.Messages, afterSalesMessages.Messages, 3, afterSalesMessages.AppId, afterSalesMessages.Id, afterSalesMessages.Code, null, true);
                }
                else if (sendTO == 2)
                {
                    //发给买家
                    contentCode = "BTP002";
                    PublishOrderMessage(afterSalesMessages.Id, afterSalesMessages.UserIds, afterSalesMessages.EsAppId, afterSalesMessages.Messages, contentCode, true);
                    ////正品会发送消息
                    //if (new ZPHSV().CheckIsAppInZPH(afterSalesMessages.AppId))
                    //{
                    //    //addmassage.AddMessages(odid, usid, CustomConfig.ZPHAppId, order.Code, order.State, "", type);
                    //    PublishOrderMessage(afterSalesMessages.Id, afterSalesMessages.UserIds, CustomConfig.ZPHAppId, afterSalesMessages.Messages, contentCode, true);
                    //}
                }

                //发送运营工具
                if (sendToTool == 1)
                {
                    //只有自提,并且代运营时才发
                    if (afterSalesMessages.SelfTakeFlag == 1)
                    {
                        contentCode = "BTP006";
                        if (ZPHSV.Instance.CheckIsAppInZPH(afterSalesMessages.AppId))
                        {
                            SendMessageToSelfTakeManager(afterSalesMessages.Id, afterSalesMessages.SelfTakeManagerIds, CustomConfig.SelfTakeAppId, afterSalesMessages.Messages, contentCode);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(string.Format("推送消息服务异常。afterSalesMessages:{0}", JsonHelper.JsonSerializer(afterSalesMessages)), ex);
                return(new ResultDTO {
                    ResultCode = 1, Message = "Error"
                });
            }
            return(new ResultDTO {
                ResultCode = 0, Message = "Success"
            });
        }