/// <summary> /// 管理员进行手动同步流水状态 /// </summary> /// <param name="tradeSysID"></param> /// <param name="resMsg"></param> /// <returns></returns> public static bool GetOrderInfoPaymentStatusSync(string tradeSysID, out string resMsg) { resMsg = string.Empty; DB.Model.M_OrderTrade orderTradeInfo = new DB.BLL.MY_Bll(DBEnum.Slave).GetModel <DB.Model.M_OrderTrade>(" TradeSysID=@_TradeSysID ", new { _TradeSysID = tradeSysID }); if (orderTradeInfo != null) { DSMT_TAE_ServiceSoapClient taeCilent = new DSMT_TAE_ServiceSoapClient(); GetQueryTradeStatusEntity queryTradeStatusEntity = null; VerifyHelper verifyHelper = new VerifyHelper(); BackQueryTradeStatusEntity backQueryTradeStatusEntity = null; DateTime nowTime = DateTime.Now; string outOpenID = string.Empty; queryTradeStatusEntity = new GetQueryTradeStatusEntity(); //初始化 backQueryTradeStatusEntity = null; if (!string.IsNullOrEmpty(orderTradeInfo.TradeNo) && !string.IsNullOrEmpty(orderTradeInfo.CpySysID)) //判断流水号公司ID都存在的情况下调用XF接口,并且流水号的创建时间超时10分钟 { queryTradeStatusEntity.CpySysID = orderTradeInfo.CpySysID; queryTradeStatusEntity.TradeNo = orderTradeInfo.TradeNo; queryTradeStatusEntity.TradeTime = Convert.ToString(orderTradeInfo.PayTime); //流水时间是XF系统返回给我的时间 verifyHelper.EncryptPmtEntity(queryTradeStatusEntity); //加密加签 try { backQueryTradeStatusEntity = taeCilent.QueryTradeStatus(queryTradeStatusEntity); //调用XF接口 } catch (Exception e) //通讯异常 { resMsg = "与XF系统扣款状态同步查询出错,错误信息:" + e.Message; } if (verifyHelper.CheckPmtSign(ref backQueryTradeStatusEntity)) //尝试解签,解签失败的话不执行任何代码 { if (backQueryTradeStatusEntity.TradeType == "0") //交易类型是0 { if (backQueryTradeStatusEntity.TradeStatus == "10" || backQueryTradeStatusEntity.TradeStatus == "20") //交易状态10-已完成20-已撤销(余额不足付款失败?)30-待同步40-交易信息不存在 { if (new DB.BLL.MY_Bll(DBEnum.Master).UpdateOrderStatusByXFPaymentToComfirm(ToolHelper.ConventToDecimal(backQueryTradeStatusEntity.TradeMoney, 999), orderTradeInfo.TradeSysID, backQueryTradeStatusEntity.TradeStatus, out outOpenID)) { //WeChatAPI.SendMsg("付款审核成功", "您有一笔订单流水付款审核已通过,正等待仓库发货", outOpenID); return(true); } } else if (backQueryTradeStatusEntity.TradeStatus == "40") { resMsg = "与XF系统扣款状态同步查询出错,错误信息:XF系统该笔流水号信息不存在"; } else if (backQueryTradeStatusEntity.TradeStatus == "30") { resMsg = "XF系统尚未同步,扣款尚未完成"; } } else { resMsg = "XF系统返回的数据有误,返回的流水类型是退款流水"; } } else { resMsg = "XF系统返回的解签数据出错"; } } else { resMsg = "该流水号数据存在问题"; } } else { resMsg = "该流水号数据存在问题"; } return(false); }
/// <summary> /// 将订单的付款金额推送给XF系统进行资金结算 /// </summary> /// <param name="pushType">推送类型</param> /// <param name="pushOrderSn">推送订单编号</param> /// <param name="pushOrderAmount">推送订单总金额</param> /// <param name="pushFeeAmount">推送订单运费金额</param> /// <param name="resPayInfo">返回的支付信息</param> /// <returns></returns> public static bool SeacherThisOrderTrade(string orderID, out string resPayInfo) { resPayInfo = string.Empty; DSMT_TAE_ServiceSoapClient taeCilent = new DSMT_TAE_ServiceSoapClient(); GetQueryOrderStatusEntity getQueryOrderStatusEntity = new GetQueryOrderStatusEntity(); BackQueryOrderStatusEntity backQueryOrderStatusEntity = new BackQueryOrderStatusEntity(); VerifyHelper verifyHelper = new VerifyHelper(); DB.Model.M_OrderInfo orderInfo = new DB.BLL.MB_Bll(DBEnum.Slave).GetModel <DB.Model.M_OrderInfo>(" OrderID=@_OrderID ", new { _OrderID = orderID }); DB.Model.M_Payment payMentInfo = new DB.BLL.MB_Bll(DBEnum.Slave).GetModel <DB.Model.M_Payment>(" PayID=@_PayID ", new { _PayID = 20 }); if (orderInfo != null && payMentInfo != null) { getQueryOrderStatusEntity.OpenID = orderInfo.OpenID; getQueryOrderStatusEntity.OrderNo = orderInfo.OrderSn; getQueryOrderStatusEntity.UnifyOrderNo = orderInfo.OrderUnifySn; getQueryOrderStatusEntity.OrderTime = Convert.ToString(orderInfo.AddTime); string resMsg = string.Empty; string orderSn = string.Empty; verifyHelper.EncryptPmtEntity(getQueryOrderStatusEntity); try { backQueryOrderStatusEntity = taeCilent.QueryOrderStatus(getQueryOrderStatusEntity);//调xf接口 if (verifyHelper.CheckPmtSign(ref backQueryOrderStatusEntity)) { /// 交易状态10-成功20-失败30-待同步40-交易信息不存在 if (backQueryOrderStatusEntity != null && !string.IsNullOrEmpty(backQueryOrderStatusEntity.TradeStatus) && !string.IsNullOrEmpty(backQueryOrderStatusEntity.TradeNo))//XF系统返回的数据不为空,并且状态信息不为空 { if (backQueryOrderStatusEntity.TradeStatus == "10" || backQueryOrderStatusEntity.TradeStatus == "20" || backQueryOrderStatusEntity.TradeStatus == "30") { orderSn = (backQueryOrderStatusEntity.IsUnify == "0")? orderInfo.OrderSn:orderSn; if (new DB.BLL.MB_Bll(DBEnum.Master).UpdateOrderInfoFromXFPayment(orderInfo.OrderUnifySn, orderSn, ToolHelper.ConventToDecimal(backQueryOrderStatusEntity.TradeMoney, 9999), backQueryOrderStatusEntity.TradeNo, ToolHelper.ConventToDateTime(backQueryOrderStatusEntity.TradeTime, DateTime.Now), payMentInfo, backQueryOrderStatusEntity.CpySysID, backQueryOrderStatusEntity.CpyName, out resMsg)) { //WeChatAPI.SendMsg("异常订单处理成功", "您有一笔异常订单已被成功处理,请关注最新的订单状态",orderInfo.OpenID); return(true); } else { resPayInfo = resMsg; } } else { resPayInfo = "交易信息不存在"; } } else { resPayInfo = "XF系统返回数据出错,请稍后再试"; } } else//验签失败 { resPayInfo = "从XF系统返回的数据通讯错误,签名验证失败"; } } catch (Exception e) { resPayInfo = "与XF系统的通讯出错,返回错误信息:" + e.Message; } } else { resPayInfo = "获取相应的数据出错"; } return(false); }
/// <summary> /// 调用XF系统接口进行交易退款状态同步查询 /// </summary> public static void GetReBackPayAccStatusSync() { List <DSMTMALL.DB.Model.M_ReBackTrade> orderTradeList = new DSMTMALL.DB.BLL.MY_Bll(DBEnum.Slave).GetModelList <DSMTMALL.DB.Model.M_ReBackTrade>(" ComfirmStatus=10 ORDER BY CreateTime ASC LIMIT 50 ", null); if (orderTradeList != null && orderTradeList.Count > 0) { DSMT_TAE_ServiceSoapClient taeCilent = new DSMT_TAE_ServiceSoapClient(); GetQueryTradeStatusEntity queryTradeStatusEntity = null; VerifyHelper verifyHelper = new VerifyHelper(); BackQueryTradeStatusEntity backQueryTradeStatusEntity = null; DateTime nowTime = DateTime.Now; string outOpenID = string.Empty; foreach (var item in orderTradeList) { queryTradeStatusEntity = new GetQueryTradeStatusEntity(); //初始化 backQueryTradeStatusEntity = null; if (!string.IsNullOrEmpty(item.TradeNo) && !string.IsNullOrEmpty(item.CpySysID) && item.CreateTime.AddMinutes(10) < nowTime) //判断流水号公司ID都存在的情况下调用XF接口,并且流水号的创建时间超时10分钟 { if (item.CreateTime.AddMinutes(360) > nowTime) //如果超过6个小时,XF系统还未同步完成,记录异常 { queryTradeStatusEntity.CpySysID = item.CpySysID; queryTradeStatusEntity.TradeNo = item.ReBackTradeNo; verifyHelper.EncryptPmtEntity(queryTradeStatusEntity);//加密加签 try { backQueryTradeStatusEntity = taeCilent.QueryTradeStatus(queryTradeStatusEntity); //调用XF接口 } catch (Exception e) //通讯异常 { ToolHelper.WriteTxt(logPathErr, DateTime.Now + "退款流水号:" + item.ReBackTradeNo + "与XF系统退款状态同步查询出错,错误信息:" + e.Message, false); continue; } if (verifyHelper.CheckPmtSign(ref backQueryTradeStatusEntity))//尝试解签,解签失败的话不执行任何代码 { if (backQueryTradeStatusEntity.TradeType == "1") { if (backQueryTradeStatusEntity.TradeStatus == "10" || backQueryTradeStatusEntity.TradeStatus == "20") //交易状态10-已完成20-已撤销(即失败)30-待同步40-交易信息不存在 { if (new DSMTMALL.DB.BLL.MY_Bll(DBEnum.Master).UpdateReBackPayAccByXFPaymentToComfirm(ToolHelper.ConventToDecimal(backQueryTradeStatusEntity.TradeMoney, 999), item.ReBackTradeSysID, backQueryTradeStatusEntity.TradeStatus, out outOpenID)) { WeChatAPI.SendMsg("退款资金到账通知", "您有一笔退款金额已通过原支付方式退还至您的账户,请注意查收", outOpenID); } } else if (backQueryTradeStatusEntity.TradeStatus == "40") { string resMsg = DateTime.Now + "退款流水号:" + item.ReBackTradeNo + "与XF系统退款状态同步查询出错,错误信息:XF系统该笔流水号信息不存在"; new DSMTMALL.DB.BLL.MB_Bll(DBEnum.Master).RecordErrInfoNote("同步程序查询XF系统退款状态发现异常", resMsg); new TryCatchErrHelper().HandlerReBackTradeError(item.ReBackTradeSysID); ToolHelper.WriteTxt(logPathErr, resMsg, false); }//30就不做任何处理 } } } else { new DSMTMALL.DB.BLL.MB_Bll(DBEnum.Master).RecordErrInfoNote("同步程序查询XF系统退款状态发现异常", "退款流水号:" + item.TradeNo + "与XF系统退款状态同步查询已过6个小时,XF系统仍未同步完成"); new TryCatchErrHelper().HandlerReBackTradeError(item.ReBackTradeSysID); } } } } }
/// <summary> /// 获取XF系统的回调的订单扣款状态 /// </summary> /// <param name="getXFVerifyActPayment"></param> /// <returns></returns> public static bool GetXFVerifyActualPayment(GetXFVerifyActPayment getXFVerifyActPayment) { string outMsg = string.Empty; string outOpenID = string.Empty; if (getXFVerifyActPayment.TradeType == "0") { if (new DB.BLL.MY_Bll(DBEnum.Master).UpdateOrderStatusByXFPaymentToComfirm(ToolHelper.ConventToDecimal(getXFVerifyActPayment.PayMoney, 999), getXFVerifyActPayment.TradeNo, getXFVerifyActPayment.TradeStatus, out outMsg, out outOpenID)) { //WeChatAPI.SendMsg("付款审核成功", "您有一笔订单流水付款审核已通过,正等待仓库发货", outOpenID); return(true); } if (!string.IsNullOrEmpty(outMsg)) { new DB.BLL.MB_Bll(DBEnum.Master).RecordErrInfoNote("XF系统回调的订单和扣款状态", outMsg); } } else if (getXFVerifyActPayment.TradeType == "1") { if (new DB.BLL.MY_Bll(DBEnum.Master).UpdateReBackPayAccByXFPaymentToComfirm(ToolHelper.ConventToDecimal(getXFVerifyActPayment.PayMoney, 999), getXFVerifyActPayment.TradeNo, getXFVerifyActPayment.TradeStatus, out outMsg, out outOpenID)) { //WeChatAPI.SendMsg("退款资金到账通知", "您有一笔退款金额已通过原支付方式退还至您的账户,请注意查收", outOpenID); return(true); } if (!string.IsNullOrEmpty(outMsg)) { new DB.BLL.MB_Bll(DBEnum.Master).RecordErrInfoNote("XF系统回调的订单和扣款状态", outMsg); } } return(false); }
protected void Page_Load(object sender, EventArgs e) { WebAjaxHelper ajax = new WebAjaxHelper(); //实例化 WebAjaxHelper类 if (Request.HttpMethod.ToLower() == "post") //获取用户端的传输方法(全转化为小写)是否为post { string jsonType = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["jsonType"], ""); string id = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["id"], ""); string name = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["name"], ""); string pwd = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["pwd"], ""); string newPwd = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["newPwd"], ""); string remark = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["remark"], ""); string type = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["type"], ""); string number = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["number"], ""); string count = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["count"], ""); string typeC = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["typeC"], ""); string typeT = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["typeT"], ""); string typeB = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["typeB"], ""); string isVal = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["isVal"], ""); string cid = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["cid"], ""); string price_s = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["price_s"], ""); string price_m = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["price_m"], ""); string status = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["status"], ""); string url = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["url"], ""); string word = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["word"], ""); string endTime = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["endTime"], ""); string startTime = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["startTime"], ""); string token = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["token"], ""); string code = ToolHelper.GetPostOrGetPar(HttpContext.Current.Request.Form["code"], ""); if (!string.IsNullOrEmpty(jsonType)) { if (jsonType == "adminLogin") { if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(pwd)) { ajax.AdminLogin(name, pwd, code); } else if (string.IsNullOrEmpty(name)) { Response.Write("提示:用户名不能为空"); HttpContext.Current.ApplicationInstance.CompleteRequest(); } else { Response.Write("提示:密码不能为空"); HttpContext.Current.ApplicationInstance.CompleteRequest(); } return; } else if (jsonType == "checkAdminLogin")//校验读卡登陆 { if (!string.IsNullOrEmpty(code)) { ajax.CheckAdminLogin(code); } return; } else if (jsonType == "adminIsEnable")//账户的启用 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(status)) { ajax.ChangeCheckBox(id, status, "IsEnable", "M_AdminUser"); return; } } else if (jsonType == "addAdminAmount")//添加账户信息 { if (!string.IsNullOrEmpty(name)) { ajax.AddAdminAmount(name, cid, number, remark); return; } } else if (jsonType == "AdminLogout")//用户退出 { ajax.AdminLogout(); return; } else if (jsonType == "assignCard")//分配卡片 { ajax.AssignCardToAdmin(); return; } else if (jsonType == "checkAdminAssign")//校验分配卡号 { if (!string.IsNullOrEmpty(code) && !string.IsNullOrEmpty(id)) { ajax.CheckAdminReadCardNum(code, id); } return; } else if (jsonType == "getFareCarry")//获取配送信息 { ajax.GetFareCarry(id); return; } else if (jsonType == "getProvience")//获取所有的省 { ajax.GetProvience(); return; } else if (jsonType == "addNewFareTemp")//添加运费模板 { if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(url) && !string.IsNullOrEmpty(type) && !string.IsNullOrEmpty(typeB)) { ajax.AddNewFareTemplate(name, url, ToolHelper.ConventToInt32(startTime, 48), ToolHelper.ConventToInt32(type, 20), typeB, typeC); return; } } else if (jsonType == "deleteFareTemp")//删除运费模板 { if (!string.IsNullOrEmpty(id)) { ajax.DeleteFareTemp(id); return; } } else if (jsonType == "updateFirstMoney")//更新首次运费金额 { if (!string.IsNullOrEmpty(id)) { ajax.UpdateFareCarryFirstMoney(id, number); return; } } else if (jsonType == "updateContunueMoney")//更新续费金额 { if (!string.IsNullOrEmpty(id)) { ajax.UpdateFareCarryContinueMoney(id, number); return; } } else if (jsonType == "deleteAdmin")//删除账户 { if (!string.IsNullOrEmpty(id)) { ajax.DeleteAdminAmount(id); return; } } else if (jsonType == "updateAdminPwd")//更改密码 { if (!string.IsNullOrEmpty(pwd) && !string.IsNullOrEmpty(newPwd)) { ajax.UpdateAdminPwd(pwd, newPwd); return; } } else if (jsonType == "updataAdminName")//更改管理员名称 { if (!string.IsNullOrEmpty(id)) { ajax.UpdataAdminName(number, id); return; } } else if (jsonType == "updataAdminPhone")//更改管理员联系方式 { if (!string.IsNullOrEmpty(id)) { ajax.UpdataAdminPhone(number, id); return; } } else if (jsonType == "updataAdminPwd")//重置管理员账户密码 { if (!string.IsNullOrEmpty(id)) { ajax.UpdataAdminPwd(id); return; } } else if (jsonType == "xfOrderTradeGetAgain")//重新获取XF系统该笔订单的流水号信息 { if (!string.IsNullOrEmpty(id)) { ajax.XFOrderTradeGetAgain(id); return; } } else if (jsonType == "xfTradeSyncAgain") { if (!string.IsNullOrEmpty(id)) { ajax.XFTradeSyncAgain(id); return; } } else if (jsonType == "addSuppliers")//添加供应商 { if (!string.IsNullOrEmpty(number) && !string.IsNullOrEmpty(name)) { ajax.AddSuppliers(number, name); return; } } else if (jsonType == "deleteSuppliers")//删除供应商 { if (!string.IsNullOrEmpty(id)) { ajax.DeleteSuppliers(id); return; } } else if (jsonType == "suppliersIsEnable")//供应商的启用 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(status)) { ajax.ChangeCheckBox(id, status, "IsEnable", "M_Suppliers"); return; } } else if (jsonType == "suppliersDesc")//供应商描述 { if (!string.IsNullOrEmpty(id)) { ajax.ChangeTextarea(id, number, "M_Suppliers"); return; } } #region 类目管理 else if (jsonType == "categoryOrderBy")//更新类目排序 { int outSysID; if (!string.IsNullOrEmpty(id) && int.TryParse(id, out outSysID)) { ajax.UpdateOrderBy(outSysID, number, "M_Category"); return; } } else if (jsonType == "categoryIsEnable")//设置类目的启禁 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(status)) { ajax.ChangeCheckBox(id, status, "IsEnable", "M_Category"); return; } } else if (jsonType == "deleteCategory")//删除类目信息 { if (!string.IsNullOrEmpty(id)) { ajax.DeleteCategory(id); return; } } else if (jsonType == "addCategory")//添加类目信息 { int outParentID = 0; if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(id) && int.TryParse(id, out outParentID)) //父类不为空 { ajax.AddCategory(ToolHelper.DelRepeatData(name.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries)), outParentID); //一维数组去重复 return; } else if (!string.IsNullOrEmpty(name) && string.IsNullOrEmpty(id)) { ajax.AddCategory(ToolHelper.DelRepeatData(name.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries)), outParentID);//一维数组去重复 return; } } else if (jsonType == "updateCategory")//更新类目信息 { int outSysID = 0; if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(cid) && int.TryParse(cid, out outSysID))//父类不为空 { ajax.UpdateCategory(name, outSysID, id); return; } } #endregion #region 品牌管理 else if (jsonType == "deleteBrand")//删除品牌信息 { if (!string.IsNullOrEmpty(id)) { ajax.DeleteBrand(id); return; } } else if (jsonType == "brandIsShow")//设置品牌的启禁 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(status)) { ajax.ChangeCheckBox(id, status, "IsShow", "M_Brand"); return; } } else if (jsonType == "brandOrderBy")//更新品牌排序 { int outSysID; if (!string.IsNullOrEmpty(id) && int.TryParse(id, out outSysID)) { ajax.UpdateOrderBy(outSysID, number, "M_Brand"); return; } } else if (jsonType == "brandDescribe")//更改品牌描述 { if (!string.IsNullOrEmpty(id)) { ajax.ChangeTextarea(id, word, "M_Brand"); return; } } else if (jsonType == "addBrand")//添加品牌名称 { if (!string.IsNullOrEmpty(name)) { ajax.AddBrand(ToolHelper.DelRepeatData(name.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries)));//一维数组去重复 return; } } else if (jsonType == "updateBrand")//修改品牌信息 { int outSysID = 0; if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(id) && int.TryParse(id, out outSysID)) { ajax.UpdateBrand(name, outSysID); return; } } #endregion #region 轮播管理 else if (jsonType == "rollIsEnable")//设置轮播的启禁 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(status)) { ajax.ChangeCheckBox(id, status, "IsEnable", "M_Roll"); return; } } else if (jsonType == "deleteRoll")//删除轮播信息 { if (!string.IsNullOrEmpty(id)) { ajax.DeleteRoll(id); return; } } else if (jsonType == "rollOrderBy")//轮播信息排序 { int outSysID; if (!string.IsNullOrEmpty(id) && int.TryParse(id, out outSysID)) { ajax.UpdateOrderBy(outSysID, number, "M_Roll"); return; } } else if (jsonType == "addRoll")//添加轮播信息 { ajax.AddRoll(); return; } else if (jsonType == "updateRoll")//更新轮播信息 { int outSysID = 0; if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(cid) && int.TryParse(cid, out outSysID)) { ajax.UpdateRoll(id, type, outSysID); return; } } #endregion #region 联想数据 else if (jsonType == "searchCates")//联想类目信息 { ajax.SearchCates(name); return; } else if (jsonType == "searchBrands")//联想品牌信息 { ajax.SearchBrand(name); return; } else if (jsonType == "searchGoods")//联想商品信息 { ajax.SearchGoods(name); return; } else if (jsonType == "searchAdvs")//联想广告信息 { ajax.SearchAdvs(name); return; } #endregion else if (jsonType == "exportOrderInfo")//导出订单信息 { ajax.ExportOrderInfoList(url); return; } #region 产品操作 else if (jsonType == "chooseCpyInfo")//选择公司信息 { ajax.ChooseCpyInfo(); return; } else if (jsonType == "assignCpyToGoods")//分配当前商品指向公司 { string[] cpyInfo = word.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); ajax.AssignCpyToGoods(id, ToolHelper.DelRepeatData(cpyInfo)); return; } else if (jsonType == "deleteGoods")//删除产品信息 { if (!string.IsNullOrEmpty(id)) { ajax.DeleteGoods(id); return; } } else if (jsonType == "changePrice")//更改商品价格 { decimal outShopPrice; decimal outMarketPrice; if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(price_s) && !string.IsNullOrEmpty(price_m) && decimal.TryParse(price_s, out outShopPrice) && decimal.TryParse(price_m, out outMarketPrice)) { ajax.ChangePrice(id, outShopPrice, outMarketPrice); return; } } else if (jsonType == "updateInverntory")//更新商品库存 { if (!string.IsNullOrEmpty(id)) { ajax.UpdateInverntory(id, number); return; } } else if (jsonType == "updateQuotaNumber")//更新商品限购件数 { if (!string.IsNullOrEmpty(id)) { ajax.UpdateQuotalNumber(id, number); return; } } else if (jsonType == "updateWeight")//更新商品重量 { if (!string.IsNullOrEmpty(id)) { ajax.UpdateWeight(id, number); return; } } else if (jsonType == "goodsSellerNote")//更改商品备注信息 { if (!string.IsNullOrEmpty(id)) { ajax.ChangeTextarea(id, word, "M_Goods"); return; } } else if (jsonType == "exportGoodsInfo")//导出商品信息 { ajax.ExportGoodsInfoList(type, url); return; } else if (jsonType == "goodsOrderBy")//更新产品排序 { if (!string.IsNullOrEmpty(id)) { ajax.UpdateGoodsOrderBy(id, number); return; } } else if (jsonType == "goodsNew")//设置上新产品 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(status)) { ajax.ChangeCheckBox(id, status, "IsNew", "M_Goods"); return; } } else if (jsonType == "goodsIsEnable")//设置产品的启禁 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(status)) { ajax.ChangeCheckBox(id, status, "IsEnable", "M_Goods"); return; } } else if (jsonType == "goodsIsPromote")//设置产品的启禁 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(status)) { ajax.ChangeCheckBox(id, status, "IsPromote", "M_Goods"); return; } } else if (jsonType == "addGoodsInfo")//添加新的商品信息 { if (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(cid) && !string.IsNullOrEmpty(price_s) && !string.IsNullOrEmpty(price_m) && !string.IsNullOrEmpty(type) && !string.IsNullOrEmpty(typeC) && !string.IsNullOrEmpty(typeT) && !string.IsNullOrEmpty(count)) { try { ajax.AddNewGoods(name, cid, Convert.ToDecimal(price_s), Convert.ToDecimal(price_m), Convert.ToInt32(typeC), Convert.ToInt32(typeT), ToolHelper.ConventToInt32(typeB, 0), Convert.ToInt32(count), word, remark, ToolHelper.ConventToDouble(number, 0), type); return; } catch { } } } else if (jsonType == "updataGoodsDetial")//更新商品详情 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(typeB) && !string.IsNullOrEmpty(typeC) && !string.IsNullOrEmpty(price_m) && !string.IsNullOrEmpty(price_s) && !string.IsNullOrEmpty(isVal) && !string.IsNullOrEmpty(cid)) { try { ajax.UpdataGoodsDetial(id, name, Convert.ToInt32(typeB), ToolHelper.ConventToInt32(typeT, 0), Convert.ToInt32(typeC), word, url, remark, Convert.ToDecimal(price_s), Convert.ToDecimal(price_m), isVal, cid); return; } catch { } } } else if (jsonType == "deleteCpyGoods")//取消当前商品的推荐 { if (!string.IsNullOrEmpty(id)) { ajax.DeleteCpyGoods(id); return; } } else if (jsonType == "deleteErrLog")//删除错误日志 { if (!string.IsNullOrEmpty(id)) { ajax.DeleteErrLog(id); return; } } else if (jsonType == "getBrandName")//获取品牌名称 { ajax.GetBrandName(id); return; } #endregion #region 模块处理 else if (jsonType == "getModalList")//获取所有模块 { ajax.GetModalList(); return; } else if (jsonType == "getAdminModalList")//获取当前用户模块 { ajax.GetAdminModalList(id); return; } else if (jsonType == "assignAdminModal")//分配用户模块 { ajax.AssignAdminModal(id, ToolHelper.DelRepeatData(word.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries))); return; } #endregion #region 相册管理 else if (jsonType == "getGalleryImgList")//获取商品的相册图片 { ajax.GetGalleryImgList(id); return; } else if (jsonType == "deleteGalleryImg")//删除商品图册轮播图 { if (!string.IsNullOrEmpty(id)) { ajax.DeleteGalleryImg(id); return; } } else if (jsonType == "deleteImgs")//图片管理-删除图片 { if (!string.IsNullOrEmpty(id)) { ajax.DeleteFileManageImgs(id); return; } } #endregion #region 退货商品处理 else if (jsonType == "orderGoods")//获取当前订单的商品信息 { if (!string.IsNullOrEmpty(id)) { ajax.SearchOrderGoods(id); return; } } else if (jsonType == "reBackOrderGoods")//获取当前退货订单的退货商品信息 { if (!string.IsNullOrEmpty(id)) { ajax.SearchReBackOrderGoods(id); return; } } else if (jsonType == "confirmDelivery")//确认当前订单的物流信息 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(number)) { ajax.ConfirmDelivery(id, name, number, remark); return; } } else if (jsonType == "rebackGoods")//提交退货申请 { if (!string.IsNullOrEmpty(number) && !string.IsNullOrEmpty(type) && !string.IsNullOrEmpty(remark) && !string.IsNullOrEmpty(cid)) { ajax.ReBackOrderGoods(id, number, type, remark, cid); return; } } else if (jsonType == "reBackOrderIsPass")//通过退换货订单申请 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(type) && !string.IsNullOrEmpty(url)) { int outType = 0; if (int.TryParse(type, out outType)) { ajax.ReBackOrderIsPass(id, outType, remark, url); return; } } } else if (jsonType == "reBackOrderGoodsIsOK")//退货商品确认无误 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(remark) && !string.IsNullOrEmpty(type)) { int outType = 0; if (int.TryParse(type, out outType)) { ajax.ReBackOrderGoodsIsOK(id, outType, remark); return; } } } else if (jsonType == "reBackOrderMoney")//用户执行退款操作 { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(number)) { ajax.ReBackOrderMoney(id, ToolHelper.ConventToDecimal(number, 0)); return; } } else if (jsonType == "changeGoodsForCustomer") { if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(number)) { ajax.ChangeGoodsForCustomer(id, name, number); return; } } #endregion #region 异常订单处理 else if (jsonType == "htOrderToSuccess")//海淘推送至海关出错-恢复正常 { if (!string.IsNullOrEmpty(id)) { ajax.HtOrderToSuccess(id); return; } } #endregion Response.Write("UNLOGIN"); HttpContext.Current.ApplicationInstance.CompleteRequest(); } } else { Response.Write("UNLOGIN"); HttpContext.Current.ApplicationInstance.CompleteRequest();//结束执行 } }