Exemplo n.º 1
0
        /// <summary>
        /// 会员状态调整
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button14_Click(object sender, EventArgs e)
        {
            ////如果是待激活状态那么就要激活
            dt_Dyn_ChangeMemberStatus_req reqs = new dt_Dyn_ChangeMemberStatus_req();

            reqs.ZVTWEG     = "102";
            reqs.STATUS_OLD = "E0005";
            reqs.STATUS_NEW = "E0001";
            reqs.ACCOUNT_ID = "15222196580";
            reqs.FLAG       = "I";//激活

            reqs.DATA_SOURCE   = AppConfig.DATA_SOURCE;
            reqs.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌
            reqs.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统
            reqs.VGROUP        = AppConfig.VGROUP;        //销售组织
            reqs.PASS_FLAG     = "N";
            reqs.REASON        = "激活";

            //dt_Dyn_ChangeMemberStatus_req req = new dt_Dyn_ChangeMemberStatus_req();
            //req.ZVTWEG = "102";
            ////req.STATUS_OLD = "E0000";
            ////req.STATUS_NEW = "E0001";
            //req.ACCOUNT_ID = "15222196580";
            //req.FLAG = "Q";//查询

            //req.DATA_SOURCE = AppConfig.DATA_SOURCE;
            //req.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND;//忠诚度品牌
            //req.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM;//来源系统
            //req.VGROUP = AppConfig.VGROUP; //销售组织
            //req.PASS_FLAG = "Y";
            //req.REASON = "查询密码";

            dt_Dyn_ChangeMemberStatus_res res = WebHmjApiHelp.ChangeMemberStatus(reqs, true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 激活
        /// </summary>
        /// <param name="mobile"></param>
        public void ChageSatus(string mobile)
        {
            //如果是待激活状态那么就要激活
            dt_Dyn_ChangeMemberStatus_req reqs = new dt_Dyn_ChangeMemberStatus_req();

            reqs.DATA_SOURCE   = "0002";
            reqs.ZVTWEG        = "102";
            reqs.STATUS_OLD    = "E0005";
            reqs.STATUS_NEW    = "E0001";
            reqs.ACCOUNT_ID    = mobile;
            reqs.FLAG          = "I";                     //激活
            reqs.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌
            reqs.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统
            reqs.VGROUP        = AppConfig.VGROUP;        //销售组织
            reqs.PASS_FLAG     = "N";
            reqs.REASON        = "激活";
            dt_Dyn_ChangeMemberStatus_res resok = WebApiHelp.ChangeMemberStatus(reqs);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 会员状态调整
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public static dt_Dyn_ChangeMemberStatus_res ChangeMemberStatus(dt_Dyn_ChangeMemberStatus_req req,
                                                                       bool isdebug = false)
        {
            string   reqStr    = js.Serialize(req);
            string   resStr    = string.Empty;
            DateTime?timeStart = null;
            DateTime?timeEnd   = null;
            string   isok      = "OK";

            try
            {
                timeStart = DateTime.Now;
                logger.Info("会员状态调整si_Dyn_ChangeMemberStatus_obService请求信息:" + reqStr);
                si_Dyn_ChangeMemberStatus_obService web = new si_Dyn_ChangeMemberStatus_obService();

                dt_Dyn_ChangeMemberStatus_res res = web.si_Dyn_ChangeMemberStatus_ob(req);

                resStr  = js.Serialize(res);
                timeEnd = DateTime.Now;
                logger.Info("响应信息" + resStr + "\r\n");

                if (res == null)
                {
                    isok = "NO";
                }

                return(res);
            }
            catch (Exception ex)
            {
                resStr = ex.Message;
                isok   = "NO";
                return(null);
            }
            finally
            {
                if (!isdebug)
                {
                    datalog.DataInfo(reqStr, resStr, timeStart, timeEnd, 0, SystemCode.ChangeMemberStatus.ToString(), isok);
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 会员状态调整
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public static dt_Dyn_ChangeMemberStatus_res ChangeMemberStatus(dt_Dyn_ChangeMemberStatus_req req)
        {
            try
            {
                string   reqStr    = js.Serialize(req);
                DateTime timeStart = DateTime.Now;
                logger.Info("会员状态调整si_Dyn_ChangeMemberStatus_obService请求信息:" + reqStr);
                si_Dyn_ChangeMemberStatus_obService web = new si_Dyn_ChangeMemberStatus_obService();

                dt_Dyn_ChangeMemberStatus_res res = web.si_Dyn_ChangeMemberStatus_ob(req);

                string   resStr  = js.Serialize(res);
                DateTime timeEnd = DateTime.Now;
                logger.Info("响应信息" + resStr + "\r\n");

                datalog.DataInfo(reqStr, resStr, timeStart, timeEnd, 0, "si_Dyn_ChangeMemberStatus_obService", "会员状态调整");
                return(res);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取并更新会员信息
        /// </summary>
        /// <param name="openid"></param>
        /// <returns></returns>
        public MemberInfo GetLoadMember(string openid)
        {
            //查询会员主数据信息
            CUST_MEMBER member = _repo.GetMemberByOpenId(openid);

            #region 得到最新会员信息
            //接口查询会员主数据
            dt_Dyn_DispMember_req w = new dt_Dyn_DispMember_req();
            w.DATA_SOURCE   = "0002";
            w.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌
            w.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统
            w.VGROUP        = AppConfig.VGROUP;        //销售组织
            w.PARTNER       = member.PARTNER;          //会员唯一标示
            dt_Dyn_DispMember_res dt = WebApiHelp.DispMember(w);

            if (dt.ZCRMT316 == null || dt.ZCRMT316.Count() <= 0)
            {
                return(null);
            }

            if (dt.ZCRMT316.Count() > 1)
            {
                return(null);
            }

            ZCRMT302_Dyn newmeber = dt.ZCRMT316[0];

            #region 接口查询兑礼密码
            dt_Dyn_ChangeMemberStatus_req req = new dt_Dyn_ChangeMemberStatus_req();
            req.DATA_SOURCE   = AppConfig.DATA_SOURCE;
            req.ZVTWEG        = "102";                   //来源渠道
            req.ACCOUNT_ID    = newmeber.ACCOUNT_ID;
            req.FLAG          = "Q";                     //查询
            req.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌
            req.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统
            req.VGROUP        = AppConfig.VGROUP;        //销售组织
            req.PASS_FLAG     = "Y";
            req.REASON        = "查询密码";
            dt_Dyn_ChangeMemberStatus_res res = WebApiHelp.ChangeMemberStatus(req);
            #endregion

            CUST_MEMBER mebers = new CUST_MEMBER()
            {
                ID         = member.ID,
                ADDRESS    = newmeber.PSTREET,
                AVA_POINTS = (int?)newmeber.ZCCUR_POINT,
                BIRTHDAY   = string.IsNullOrEmpty(newmeber.BIRTHDT) ? null :
                             (DateTime?)DateTime.Parse(newmeber.BIRTHDT),
                GENDER       = newmeber.XSEX == "2" ? true : false,
                MEMBERNO     = newmeber.ACCOUNT_ID,
                MOBILE       = newmeber.MOB_NUMBER,
                MEM_LEVEL    = newmeber.ZTIER,
                NAME         = newmeber.NAME1_TEXT,
                PARTNER      = newmeber.PARTNER,
                STORE        = newmeber.ZH003,
                LOGINPASSON  = res.ZPASS,
                NAME_FIRST   = newmeber.NAME_FIRST,
                NAME_LAST    = newmeber.NAME_LAST,
                ZZAFLD000004 = newmeber.ZZAFLD000004
            };
            #endregion

            dt_Dyn_PosCpSearch_req reqs = new dt_Dyn_PosCpSearch_req();
            reqs.ACCOUNT_ID  = member.MEMBERNO;//会员账号和MOB_NUMBER至少输入一个
            reqs.DATA_SOURCE = AppConfig.DATA_SOURCE;

            reqs.LOYALTY_BRAND = AppConfig.LOYALTY_BRAND; //忠诚度品牌
            reqs.SOURCE_SYSTEM = AppConfig.SOURCE_SYSTEM; //来源系统
            reqs.VGROUP        = AppConfig.VGROUP;        //销售组织

            dt_Dyn_PosCpSearch_res resok = WebApiHelp.PosCpSearch(reqs);

            int allcount = 0;

            foreach (ZPARTERN_CP2 item in resok.ZPARTERN_CP2)
            {
                //未使用
                if (string.IsNullOrEmpty(item.ZCP_USE_FLAG))
                {
                    //查询另外一个集合的数据
                    dt_Dyn_PosCpSearch_resITEM resout = resok.ZCPQ_RESULT.Where(a => a.ZCP_NUM == item.ZCP_NUM).
                                                        ToList().FirstOrDefault();

                    DateTime endTime = resout.ZCP_EDATE;// DateTime.Parse(resout.ZCP_EDATE);
                    if (endTime >= DateTime.Now)
                    {
                        allcount++;
                    }
                }
            }

            //更新本地会员信息
            int count = _repo.UpdateMember(mebers);

            return(new MemberInfo()
            {
                AVA_POINTS = (int?)newmeber.ZCCUR_POINT,
                MOBILE = newmeber.MOB_NUMBER,
                SEX = newmeber.XSEX == "2" ? 1 : 0,
                COUPON_COUNT = allcount.ToString(),
                MEM_LEVEL = Utility.GetMemberLvl(newmeber.ZTIER)
            });
        }