public void SetRedisToSuperRetailTraderOrder(LoggingSessionInfo loggingSessionInfo, T_InoutEntity orderInfo)
        {
            var response = RedisOpenAPI.Instance.CCSuperRetailTraderOrder().SetSuperRetailTraderOrder(new CC_Order
            {
                CustomerID = loggingSessionInfo.ClientID,
                OrderId    = orderInfo.order_id,
                LogSession = loggingSessionInfo.JsonSerialize(),
                OrderInfo  = orderInfo.JsonSerialize()
            });

            if (response.Code == ResponseCode.Fail)
            {
                //直接计算
                T_InoutBLL inoutBLL = new T_InoutBLL(loggingSessionInfo);
                inoutBLL.CalculateSuperRetailTraderOrder(loggingSessionInfo, orderInfo);
            }
        }
        public void OrderPushMessage(string orderId, string orderStatus, LoggingSessionInfo loggingSessionInfo, SqlTransaction tran)
        {
            //下面往redis里存入数据
            var response = RedisOpenAPI.Instance.CCOrderPushMessage().SetOrderPushMessage(new CC_OrderPushMessage()
            {
                CustomerID  = loggingSessionInfo.ClientID,
                LogSession  = loggingSessionInfo.JsonSerialize(),
                OrderID     = orderId,
                OrderStauts = orderStatus
            });

            //如果往缓存redis里写入不成功,还是按照原来的老方法往数据库里写
            if (response.Code != ResponseCode.Success)
            {
                new InoutService(loggingSessionInfo).OrderPushMessage(orderId, orderStatus);
                new RedisXML().RedisReadDBCount("OrderPushMessage", "根据订单状态,做出不同的推送消息", 2);
            }
            else
            {
                new RedisXML().RedisReadDBCount("OrderPushMessage", "根据订单状态,做出不同的推送消息", 1);
            }
        }
        public void OrderReward(T_InoutEntity orderInfo, LoggingSessionInfo loggingSessionInfo, SqlTransaction tran)
        {
            //下面往redis里存入数据
            var response = RedisOpenAPI.Instance.CCOrderReward().SeOrderReward(new CC_OrderReward
            {
                CustomerID = loggingSessionInfo.ClientID,
                LogSession = loggingSessionInfo.JsonSerialize(),
                OrderInfo  = orderInfo.JsonSerialize(),
                OrderID    = orderInfo.order_id
            });

            //如果往缓存redis里写入不成功,还是按照原来的老方法往数据库里写
            if (response.Code != ResponseCode.Success)
            {
                new VipIntegralBLL(loggingSessionInfo).OrderReward(orderInfo, tran);//还是把原来的事务传进去
                new RedisXML().RedisReadDBCount("OrderReward", "确认收货/完成订单 - 处理奖励", 2);
            }
            else
            {
                new RedisXML().RedisReadDBCount("OrderReward", "确认收货/完成订单 - 处理奖励", 1);
            }
        }
示例#4
0
        public void CouponsUpcomingExpiredMessage(string CouponType, string CouponCode, string EffectiveData, string FailData, string OpenID, LoggingSessionInfo loggingSessionInfo)
        {
            var CommonBLL      = new JIT.CPOS.BS.BLL.WX.CommonBLL();
            var WXTMConfigData = new WXTMConfigBLL(loggingSessionInfo).QueryByEntity(new WXTMConfigEntity()
            {
                TemplateIdShort = "OPENTM206623166", CustomerId = loggingSessionInfo.ClientID, IsDelete = 0
            }, null).FirstOrDefault();

            var Data = new JIT.CPOS.BS.Entity.WX.CouponsUpcomingExpired();

            Data.first = new DataInfo()
            {
                value = WXTMConfigData.FirstText, color = WXTMConfigData.FirstColour
            };
            Data.keyword1 = new DataInfo()
            {
                value = CouponType, color = WXTMConfigData.Colour1
            };                                                                                    //券类型
            Data.keyword2 = new DataInfo()
            {
                value = CouponCode, color = WXTMConfigData.Colour1
            };                                                                                    //券码
            Data.keyword3 = new DataInfo()
            {
                value = EffectiveData, color = WXTMConfigData.Colour1
            };                                                                                       //生效日期
            Data.keyword4 = new DataInfo()
            {
                value = FailData, color = WXTMConfigData.Colour1
            };                                                                                  //失效日期
            Data.remark = new DataInfo()
            {
                value = WXTMConfigData.RemarkText, color = WXTMConfigData.RemarkColour
            };

            //  return SendMatchWXTemplateMessage(WXTMConfigData.TemplateID, null, null, null, null, null, null, Data, null, "1", OpenID, null, loggingSessionInfo);

            //下面往redis里存入数据
            var response = RedisOpenAPI.Instance.CCCouponToBeExpired().SetCouponToBeExpired(new CC_CouponToBeExpired
            {
                CustomerID = loggingSessionInfo.ClientID,
                ConfigData = new CC_ConfigData
                {
                    LogSession = loggingSessionInfo.JsonSerialize(),
                    OpenID     = OpenID,
                    TemplateID = WXTMConfigData.TemplateID,
                    //   VipID = VipID
                },
                CouponToBeExpiredData = new CC_CouponToBeExpiredData
                {
                    first = new CC_DataInfo {
                        value = Data.first.value, color = Data.first.color
                    },
                    keyword1 = new CC_DataInfo {
                        value = Data.keyword1.value, color = Data.keyword1.color
                    },
                    keyword2 = new CC_DataInfo {
                        value = Data.keyword2.value, color = Data.keyword2.color
                    },
                    keyword3 = new CC_DataInfo {
                        value = Data.keyword3.value, color = Data.keyword3.color
                    },
                    keyword4 = new CC_DataInfo {
                        value = Data.keyword4.value, color = Data.keyword4.color
                    },
                    remark = new CC_DataInfo {
                        value = Data.remark.value, color = Data.remark.color
                    }
                }
            });

            //如果往缓存redis里写入不成功,还是按照原来的老方法直接发送**
            if (response.Code != ResponseCode.Success)
            {
                CommonBLL.SendMatchWXTemplateMessage(WXTMConfigData.TemplateID, null, null, null, null, null, null, Data, null, "1", OpenID, null, loggingSessionInfo);

                new RedisXML().RedisReadDBCount("CouponsUpcomingExpired", "优惠券即将过期通知", 2);
            }
            else
            {
                new RedisXML().RedisReadDBCount("CouponsUpcomingExpired", "优惠券即将过期通知", 1);
            }

            //return  CommonBLL.SendMatchWXTemplateMessage(WXTMConfigData.TemplateID, CommonData, null, null, null, null, "8", OpenID, VipID, loggingSessionInfo);
        }
示例#5
0
        public void SentShipMessage(InoutInfo Inout, string OpenID, string VipID, LoggingSessionInfo loggingSessionInfo)
        {
            //这里保持了源代码
            if (string.IsNullOrWhiteSpace(OpenID))
            {
                var VipInfo = new VipBLL(loggingSessionInfo).GetByID(Inout.vipId);
                OpenID = VipInfo == null ? "" : VipInfo.WeiXinUserId;
            }
            var CommonBLL = new JIT.CPOS.BS.BLL.WX.CommonBLL();
            //根据模板信息的简称和商户的标识获取模板消息的模板内容
            var WXTMConfigData = new WXTMConfigBLL(loggingSessionInfo).QueryByEntity(new WXTMConfigEntity()
            {
                TemplateIdShort = "OPENTM200565259", CustomerId = loggingSessionInfo.ClientID, IsDelete = 0
            }, null).FirstOrDefault();

            if (WXTMConfigData == null)
            {
                return;
            }
            CommonData CommonData = new CommonData();

            CommonData.first = new DataInfo()
            {
                value = WXTMConfigData.FirstText, color = WXTMConfigData.FirstColour
            };
            CommonData.keyword1 = new DataInfo()
            {
                value = Inout.order_no, color = WXTMConfigData.Colour1
            };
            CommonData.keyword2 = new DataInfo()
            {
                value = Inout.carrier_name, color = WXTMConfigData.Colour2
            };
            CommonData.keyword3 = new DataInfo()
            {
                value = Inout.Field2, color = WXTMConfigData.Colour3
            };
            CommonData.remark = new DataInfo()
            {
                value = WXTMConfigData.RemarkText, color = WXTMConfigData.RemarkColour
            };

            //下面往redis里存入数据
            var response = RedisOpenAPI.Instance.CCOrderSend().SetOrderSend(new CC_OrderSend
            {
                CustomerID = loggingSessionInfo.ClientID,
                ConfigData = new CC_ConfigData
                {
                    LogSession = loggingSessionInfo.JsonSerialize(),
                    OpenID     = OpenID,
                    TemplateID = WXTMConfigData.TemplateID,
                    VipID      = VipID
                },
                OrderSendData = new CC_OrderSendData
                {
                    first = new CC_DataInfo {
                        value = CommonData.first.value, color = CommonData.first.color
                    },
                    keyword1 = new CC_DataInfo {
                        value = CommonData.keyword1.value, color = CommonData.keyword1.color
                    },
                    keyword2 = new CC_DataInfo {
                        value = CommonData.keyword2.value, color = CommonData.keyword2.color
                    },
                    keyword3 = new CC_DataInfo {
                        value = CommonData.keyword3.value, color = CommonData.keyword3.color
                    },

                    remark = new CC_DataInfo {
                        value = CommonData.remark.value, color = CommonData.remark.color
                    }
                }
            });

            //如果往缓存redis里写入不成功,还是按照原来的老方法直接发送
            if (response.Code != ResponseCode.Success)
            {
                CommonBLL.SendMatchWXTemplateMessage(WXTMConfigData.TemplateID, CommonData, null, null, null, null, null, null, null, "8", OpenID, VipID, loggingSessionInfo);
                new RedisXML().RedisReadDBCount("OrderSend", "确认收货/完成订单 - 处理奖励", 2);
            }
            else
            {
                new RedisXML().RedisReadDBCount("OrderSend", "确认收货/完成订单 - 处理奖励", 1);
            }
            //return  CommonBLL.SendMatchWXTemplateMessage(WXTMConfigData.TemplateID, CommonData, null, null, null, null, "8", OpenID, VipID, loggingSessionInfo);
        }
        public void CouponsArrivalMessage(string CouponCode, string CouponName, string ValidityData, string Scope, string OpenID, LoggingSessionInfo loggingSessionInfo, string CouponCount = "1")
        {
            var CommonBLL      = new JIT.CPOS.BS.BLL.WX.CommonBLL();
            var WXTMConfigData = new WXTMConfigBLL(loggingSessionInfo).QueryByEntity(new WXTMConfigEntity()
            {
                TemplateIdShort = "OPENTM207444083", CustomerId = loggingSessionInfo.ClientID, IsDelete = 0
            }, null).FirstOrDefault();


            var CouponsArrivalData = new CouponsArrival();

            CouponsArrivalData.first = new DataInfo()
            {
                value = WXTMConfigData.FirstText, color = WXTMConfigData.FirstColour
            };
            CouponsArrivalData.keyword1 = new DataInfo()
            {
                value = CouponCode, color = WXTMConfigData.Colour1
            };                                                                                                  //券码
            CouponsArrivalData.keyword2 = new DataInfo()
            {
                value = CouponName, color = WXTMConfigData.Colour1
            };                                                                                                  //券名称
            CouponsArrivalData.keyword3 = new DataInfo()
            {
                value = CouponCount, color = WXTMConfigData.Colour1
            };                                                                                                   //可用数量
            CouponsArrivalData.keyword4 = new DataInfo()
            {
                value = ValidityData, color = WXTMConfigData.Colour1
            };                                                                                                    //有效期
            CouponsArrivalData.keyword5 = new DataInfo()
            {
                value = Scope, color = WXTMConfigData.Colour1
            };                                                                                             //
            CouponsArrivalData.Remark = new DataInfo()
            {
                value = WXTMConfigData.RemarkText, color = WXTMConfigData.RemarkColour
            };

            //下面往redis里存入数据
            var response = RedisOpenAPI.Instance.CCCouponNotice().SetCouponNotice(new CC_CouponNotice
            {
                CustomerID = loggingSessionInfo.ClientID,
                ConfigData = new CC_ConfigData
                {
                    LogSession = loggingSessionInfo.JsonSerialize(),
                    OpenID     = OpenID,
                    TemplateID = WXTMConfigData.TemplateID,
                    //   VipID = VipID
                },
                CouponNoticeData = new CC_CouponNoticeData
                {
                    first = new CC_DataInfo {
                        value = CouponsArrivalData.first.value, color = CouponsArrivalData.first.color
                    },
                    keyword1 = new CC_DataInfo {
                        value = CouponsArrivalData.keyword1.value, color = CouponsArrivalData.keyword1.color
                    },
                    keyword2 = new CC_DataInfo {
                        value = CouponsArrivalData.keyword2.value, color = CouponsArrivalData.keyword2.color
                    },
                    keyword3 = new CC_DataInfo {
                        value = CouponsArrivalData.keyword3.value, color = CouponsArrivalData.keyword3.color
                    },
                    keyword4 = new CC_DataInfo {
                        value = CouponsArrivalData.keyword4.value, color = CouponsArrivalData.keyword4.color
                    },
                    keyword5 = new CC_DataInfo {
                        value = CouponsArrivalData.keyword5.value, color = CouponsArrivalData.keyword4.color
                    },
                    remark = new CC_DataInfo {
                        value = CouponsArrivalData.Remark.value, color = CouponsArrivalData.Remark.color
                    }
                }
            });

            //如果往缓存redis里写入不成功,还是按照原来的老方法直接发送**
            if (response.Code != ResponseCode.Success)
            {
                CommonBLL.CouponsArrivalMessage(CouponCode, CouponName, ValidityData, Scope, OpenID, loggingSessionInfo, CouponCount);//传入优惠券数量

                new RedisXML().RedisReadDBCount("CouponsUpcomingExpired", "优惠券发送成功通知", 2);
            }
            else
            {
                new RedisXML().RedisReadDBCount("CouponsUpcomingExpired", "优惠券发送成功通知", 1);
            }
        }
        /// <summary>
        /// 入 订单支付完成 队列
        /// </summary>
        public void SentPaymentMessage(T_InoutEntity Inout, string OpenID, string VipID, LoggingSessionInfo loggingSessionInfo)
        {
            //
            var commonBLL = new CommonBLL();

            //
            var wxTMConfigData = new WXTMConfigBLL(loggingSessionInfo).QueryByEntity(new WXTMConfigEntity
            {
                TemplateIdShort = "TM00398",
                CustomerId      = loggingSessionInfo.ClientID,
                IsDelete        = 0
            }, null).FirstOrDefault();

            if (wxTMConfigData == null)
            {
                return;
            }

            //
            string     ItemName       = commonBLL.GetItemName(Inout.order_no, loggingSessionInfo);
            PaySuccess PaySuccessData = new PaySuccess();

            PaySuccessData.first = new DataInfo()
            {
                value = wxTMConfigData.FirstText, color = wxTMConfigData.FirstColour
            };
            PaySuccessData.orderProductPrice = new DataInfo()
            {
                value = Math.Round(Inout.actual_amount ?? 0, 2).ToString(), color = wxTMConfigData.Colour1
            };
            PaySuccessData.orderProductName = new DataInfo()
            {
                value = ItemName, color = wxTMConfigData.Colour2
            };
            PaySuccessData.orderAddress = new DataInfo()
            {
                value = Inout.Field4, color = wxTMConfigData.Colour3
            };
            PaySuccessData.orderName = new DataInfo()
            {
                value = Inout.order_no, color = wxTMConfigData.Colour3
            };
            PaySuccessData.remark = new DataInfo()
            {
                value = wxTMConfigData.RemarkText, color = wxTMConfigData.RemarkColour
            };

            //
            var response = RedisOpenAPI.Instance.CCOrderPaySuccess().SetPaySuccess(new CC_PaySuccess
            {
                CustomerID = loggingSessionInfo.ClientID,
                ConfigData = new CC_ConfigData
                {
                    LogSession = loggingSessionInfo.JsonSerialize(),
                    OpenID     = OpenID,
                    TemplateID = wxTMConfigData.TemplateID,
                    VipID      = VipID
                },
                PaySuccessData = new CC_PaySuccessData
                {
                    first = new CC_DataInfo {
                        value = PaySuccessData.first.value, color = PaySuccessData.first.color
                    },
                    orderAddress = new CC_DataInfo {
                        value = PaySuccessData.orderAddress.value, color = PaySuccessData.orderAddress.color
                    },
                    orderName = new CC_DataInfo {
                        value = PaySuccessData.orderName.value, color = PaySuccessData.orderName.color
                    },
                    orderProductName = new CC_DataInfo {
                        value = PaySuccessData.orderProductName.value, color = PaySuccessData.orderProductName.color
                    },
                    orderProductPrice = new CC_DataInfo {
                        value = PaySuccessData.orderProductPrice.value, color = PaySuccessData.orderProductPrice.color
                    },
                    remark = new CC_DataInfo {
                        value = PaySuccessData.remark.value, color = PaySuccessData.remark.color
                    }
                }
            });

            if (response.Code != ResponseCode.Success)
            {
                commonBLL.SendMatchWXTemplateMessage(wxTMConfigData.TemplateID, null, null, null, PaySuccessData, null, null, null, null, "15", OpenID, VipID, loggingSessionInfo);
                new RedisXML().RedisReadDBCount("OrderPaySuccess", "微信端支付成功通知", 2);
            }
            else
            {
                new RedisXML().RedisReadDBCount("OrderPaySuccess", "微信端支付成功通知", 1);
            }
            //return commonBLL.SendMatchWXTemplateMessage(wxTMConfigData.TemplateID, null, null, null, PaySuccessData, null, "15", OpenID, VipID, loggingSessionInfo);
        }
        public void NotPayMessage(string orderProductPrice, string orderProductName, string orderAddress, string orderName, string OpenID, LoggingSessionInfo loggingSessionInfo)
        {
            var CommonBLL      = new JIT.CPOS.BS.BLL.WX.CommonBLL();
            var WXTMConfigData = new WXTMConfigBLL(loggingSessionInfo).QueryByEntity(new WXTMConfigEntity()
            {
                TemplateIdShort = "TM00701", CustomerId = loggingSessionInfo.ClientID, IsDelete = 0
            }, null).FirstOrDefault();

            var Data = new NotPay();

            Data.first = new DataInfo()
            {
                value = WXTMConfigData.FirstText, color = WXTMConfigData.FirstColour
            };
            Data.orderProductPrice = new DataInfo()
            {
                value = orderProductPrice, color = WXTMConfigData.Colour1
            };                                                                                                   //订单金额
            Data.orderProductName = new DataInfo()
            {
                value = orderProductName, color = WXTMConfigData.Colour1
            };                                                                                                 //商品详情
            Data.orderAddress = new DataInfo()
            {
                value = orderAddress, color = WXTMConfigData.Colour1
            };                                                                                         //收货信息
            Data.orderName = new DataInfo()
            {
                value = orderName, color = WXTMConfigData.Colour1
            };                                                                                   //订单编号
            Data.remark = new DataInfo()
            {
                value = WXTMConfigData.RemarkText, color = WXTMConfigData.RemarkColour
            };                                                                                                        //remark是从模板里取出来的

            //下面往redis里存入数据
            var response = RedisOpenAPI.Instance.CCOrderNotPay().SetOrderNotPay(new CC_OrderNotPay
            {
                CustomerID = loggingSessionInfo.ClientID,
                ConfigData = new CC_ConfigData
                {
                    LogSession = loggingSessionInfo.JsonSerialize(),
                    OpenID     = OpenID,
                    TemplateID = WXTMConfigData.TemplateID,
                    //   VipID = VipID
                },
                OrderNotPayData = new CC_OrderNotPayData
                {
                    first = new CC_DataInfo {
                        value = Data.first.value, color = Data.first.color
                    },
                    orderProductPrice = new CC_DataInfo {
                        value = Data.orderProductPrice.value, color = Data.orderProductPrice.color
                    },
                    orderProductName = new CC_DataInfo {
                        value = Data.orderProductName.value, color = Data.orderProductName.color
                    },
                    orderAddress = new CC_DataInfo {
                        value = Data.orderAddress.value, color = Data.orderAddress.color
                    },
                    orderName = new CC_DataInfo {
                        value = Data.orderName.value, color = Data.orderName.color
                    },
                    remark = new CC_DataInfo {
                        value = Data.remark.value, color = Data.remark.color
                    }
                }
            });

            //如果往缓存redis里写入不成功,还是按照原来的老方法直接发送**
            if (response.Code != ResponseCode.Success)
            {
                CommonBLL.SendMatchWXTemplateMessage(WXTMConfigData.TemplateID, null, null, null, null, null, null, null, Data, "2", OpenID, null, loggingSessionInfo);

                new RedisXML().RedisReadDBCount("OrderNotPay", "订单未付款通知", 2);
            }
            else
            {
                new RedisXML().RedisReadDBCount("OrderNotPay", "订单未付款通知", 1);
            }

            //return  CommonBLL.SendMatchWXTemplateMessage(WXTMConfigData.TemplateID, CommonData, null, null, null, null, "8", OpenID, VipID, loggingSessionInfo);
        }