修改兑换商品管理

This commit is contained in:
lym
2026-03-13 00:35:44 +08:00
parent 92ced2aad2
commit be6ee77e38
44 changed files with 396 additions and 323 deletions

View File

@@ -1,4 +1,4 @@
using Mtxfw.Utility;
using Mtxfw.Utility;
using Mtxfw.VipSite.api;
using Newtonsoft.Json;
using Pathoschild.Http.Client.Internal;
@@ -4450,7 +4450,7 @@ namespace Mtxfw.VipSite
bmodel.ContactPeople = accountname;//银行开户人
bmodel.ContactPhone = tel;//联系电话
bmodel.ApplyTime = DateTime.Now;
bmodel.CompanyId = "0";//0银花优选1普民慧2普惠生活
bmodel.CompanyId = "0";//0任E森命1普民慧2普惠生活
bmodel.Discount = (image7.IndexOf("http") == -1 ? config.webUrl : "") + image7;
bmodel.xcoo = latitude;
bmodel.ycoo = longitude;
@@ -4471,7 +4471,7 @@ namespace Mtxfw.VipSite
logmodel.MemberId = model.Id;
logmodel.AddTime = DateTime.Now;
logmodel.IP = Mtxfw.Utility.Common.GetIP;
logmodel.Body = "银花优选微信申请线下门店";
logmodel.Body = "任E森命微信申请线下门店";
logmodel.UType = 2;
logmodel.gtype = model.gtype;
new DAL.User_CZ_log().Add(logmodel);
@@ -4663,7 +4663,7 @@ namespace Mtxfw.VipSite
bmodel.ContactPeople = accountname;//银行开户人
bmodel.ContactPhone = tel;//联系电话
bmodel.ApplyTime = DateTime.Now;
bmodel.CompanyId = "0";//0银花优选1普民慧2普惠生活
bmodel.CompanyId = "0";//0任E森命1普民慧2普惠生活
bmodel.Discount = "";
bmodel.xcoo = latitude;
bmodel.ycoo = longitude;
@@ -4677,7 +4677,7 @@ namespace Mtxfw.VipSite
logmodel.MemberId = model.Id;
logmodel.AddTime = DateTime.Now;
logmodel.IP = Mtxfw.Utility.Common.GetIP;
logmodel.Body = "银花优选微信申请修改门店资料";
logmodel.Body = "任E森命微信申请修改门店资料";
logmodel.UType = 2;
logmodel.gtype = model.gtype;
new DAL.User_CZ_log().Add(logmodel);
@@ -9320,22 +9320,26 @@ namespace Mtxfw.VipSite
nav = Convert.ToInt32(Mtxfw.Utility.Tools.SafeSQL(context.Request["nav"].ToString()));
}
}
if (nav == 0)
{
strsql += " And P_CATEGORYs like '%,139,%'";
}
else if (nav == 1)
{
strsql += " And P_CATEGORYs like '%,140,%'";
}
else if (nav == 2)
{
strsql += " And P_CATEGORYs like '%,141,%'";
}
else if (nav == 3)
{
strsql += " And P_CATEGORYs like '%,142,%'";
}
//if (nav == 0)
//{
// strsql += " And P_CATEGORYs like '%,139,%'";
//}
//if (nav == 0)
//{
// strsql += " And P_CATEGORYs like '%,277,287,%'";
//}
//else if (nav == 1)
//{
// strsql += " And P_CATEGORYs like '%,140,%'";
//}
//else if (nav == 2)
//{
// strsql += " And P_CATEGORYs like '%,141,%'";
//}
//else if (nav == 3)
//{
// strsql += " And P_CATEGORYs like '%,142,%'";
//}
string strdata = "";
int IFAuto = 0, ywccount = 0, ypzcount = 0, P_ID0 = 0;
int userId = 0;
@@ -9402,7 +9406,16 @@ namespace Mtxfw.VipSite
strdata += "\"Products2\":[";
DataSet Ds_Product0 = daoProduct.GetDataSet(groupby, strOrder, "P_ID,P_NAME,P_images,P_JiangLi", "", "gtype=" + gtype + " and utype='6' And P_State=N'已处理' And IFDelete=0 " + strsql + " And (((Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID And G_KC>0)>0 And (Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID)>0) Or ((Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID)=0 And P_Inventory>0))", Start, Limit, out Recount);
string filter = "gtype=" + gtype + " and utype='0' And P_State=N'已处理' And IFDelete=0 " + strsql + " And (((Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID And G_KC>0)>0 And (Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID)>0) Or ((Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID)=0 And P_Inventory>0))";
#if DEBUG
System.Diagnostics.Debug.WriteLine("--- 调用 GetDataSet 前的参数 ---");
System.Diagnostics.Debug.WriteLine("groupby: " + groupby);
System.Diagnostics.Debug.WriteLine("strOrder: " + strOrder);
System.Diagnostics.Debug.WriteLine("filter: " + filter);
System.Diagnostics.Debug.WriteLine("Start: " + Start);
System.Diagnostics.Debug.WriteLine("Limit: " + Limit);
#endif
DataSet Ds_Product0 = daoProduct.GetDataSet(groupby, strOrder, "P_ID,P_NAME,P_images,P_JiangLi", "", filter, Start, Limit, out Recount);
int dtcount = Recount;
if (Ds_Product0.Tables[1].Rows.Count > 0)
@@ -9484,15 +9497,22 @@ namespace Mtxfw.VipSite
{
strdata += ",\"pic\":[";
DataSet ds = daoGoods.GetList1("id,GoodsName,GoodsPic,GoodsUrl", "gtype=0 and utype=5 Order By addtime asc");
DataSet ds = daoGoods.GetList1("id,GoodsName,GoodsPic,GoodsUrl", "gtype=0 and utype=10 Order By addtime asc");
//DataSet ds = daoProduct.GetList1("top 3 P_ID as id ,P_NAME as GoodsName,P_images as GoodsPic ", "gtype=0 and utype=0 and IFDelete =0 Order By P_ADDATE desc");
if (ds.Tables[0].Rows.Count > 0)
{
foreach (System.Data.DataRow Dr in ds.Tables[0].Rows)
{
int id = Convert.ToInt32(Dr["id"]);
string GoodsName = Dr["GoodsName"].ToString();
string GoodsUrl = Dr["GoodsUrl"].ToString();
string GoodsPic = Dr["GoodsPic"].ToString();
string GoodsUrl = "";
var GoodsPic = Dr["GoodsPic"].ToString();
if (GoodsPic.Contains("|"))
{
GoodsPic = GoodsPic.Split('|')[0];
}
strdata += "{\"img\":\"" + (GoodsPic.IndexOf("http") != -1 ? GoodsPic + "?imageView2/2/w/720/h/460/q/75" : config.webUrl + Mtxfw.Utility.Common.GetCoverPic(GoodsPic, "720x460", "cut")) + "\",\"label\":\"" + GoodsName + "\",\"url\":\"" + GoodsUrl + "\"},";
}
if (strdata.Substring(strdata.Length - 1, 1) == ",")
@@ -9504,8 +9524,8 @@ namespace Mtxfw.VipSite
strdata += "]";
strdata += ",\"pic1\":[";
System.Data.DataSet Ds_Productlb = new DAL.P_Category().GetList1("C_ID,C_NAME,C_images", "gtype=" + gtype + " and ttype=6 And C_Layer=1 And IfShow=0 Order By C_LinkID Asc");
if (Ds_Productlb.Tables[0].Rows.Count > 0)
System.Data.DataSet Ds_Productlb = new DAL.P_Category().GetList1("C_ID,C_NAME,C_images", "gtype=" + gtype + " and ttype=0 And C_Layer=2 And IfShow=0 Order By C_LinkID Asc");
//if (Ds_Productlb.Tables[0].Rows.Count > 0)
{
for (int i = 0; i < (Ds_Productlb.Tables[0].Rows.Count); i++)
{
@@ -9516,10 +9536,10 @@ namespace Mtxfw.VipSite
C_ID = Ds_Productlb.Tables[0].Rows[i]["C_ID"].ToString();
C_NAME = Ds_Productlb.Tables[0].Rows[i]["C_NAME"].ToString();
C_images = Ds_Productlb.Tables[0].Rows[i]["C_images"].ToString();
if (C_images != "")
{
C_images = config.webUrl + config.webUpPath + C_images;
}
//if (C_images != "")
//{
// C_images = config.webUrl + config.webUpPath + C_images;
//}
strdata += "{\"id\":\"" + C_ID + "\",\"img\":\"" + C_images + "\",\"label\":\"" + C_NAME + "\"";
@@ -9534,7 +9554,7 @@ namespace Mtxfw.VipSite
strdata += "]";
strdata += ",\"products\":[";
DataSet Ds_Product = daoProduct.GetList1("P_ID,P_NAME,P_images", "gtype=" + gtype + " And utype=5 And P_State=N'已处理' And IFDelete=0 " + strsql + " And (((Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID And G_KC>0)>0 And (Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID)>0) Or ((Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID)=0 And P_Inventory>0)) order by " + strOrder);
DataSet Ds_Product = daoProduct.GetList1("P_ID,P_NAME,P_images", "gtype=" + gtype + " And utype=0 And P_State=N'已处理' And IFDelete=0 " + strsql + " And (((Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID And G_KC>0)>0 And (Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID)>0) Or ((Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID)=0 And P_Inventory>0)) order by " + strOrder);
if (Ds_Product.Tables[0].Rows.Count > 0)
{
@@ -10122,7 +10142,7 @@ namespace Mtxfw.VipSite
Int64 rid = Convert.ToInt64(Dr["Id"].ToString());
Int32 zftype = Convert.ToInt32(Dr["OrdersID"].ToString());
Double money = Convert.ToDouble(Dr["Totalmoney"].ToString());
string strq = "银花优选" + (zftype == 2 ? "微信收款" : zftype == 1 ? "支付宝收款" : "积分兑付") + "" + money + "元";
string strq = "任E森命" + (zftype == 2 ? "微信收款" : zftype == 1 ? "支付宝收款" : "积分兑付") + "" + money + "元";
daojl2.UpdateSeef(1, rid);
strdata += "{\"video\":\"http://211.149.175.190:29998/tts.mp3?v=F-zh-CN-Xiaoxiao&txt=" + HttpUtility.UrlEncode(strq) + "\"}";
if (i != ds.Tables[0].Rows.Count - 1)
@@ -10146,7 +10166,7 @@ namespace Mtxfw.VipSite
Int64 rid = Convert.ToInt64(Dr["Id"].ToString());
Int32 zftype = Convert.ToInt32(Dr["b17"].ToString().Split('.')[0]);
Double money = Convert.ToDouble(Dr["b0"].ToString());
string strq = "银花优选" + (zftype == 2 ? "微信收款" : zftype == 1 ? "支付宝收款" : "积分兑付") + "" + money + "元";
string strq = "任E森命" + (zftype == 2 ? "微信收款" : zftype == 1 ? "支付宝收款" : "积分兑付") + "" + money + "元";
daojl2.UpdateSeef(1, rid);
strdata0 += "{\"id\":" + rid + ",\"video\":\"http://211.149.175.190:29998/tts.mp3?v=F-zh-CN-Xiaoxiao&txt=" + HttpUtility.UrlEncode(strq) + "\"}";
if (i != ds.Tables[0].Rows.Count - 1)
@@ -12415,7 +12435,19 @@ namespace Mtxfw.VipSite
}
Int32 Recount = 0;//
System.Data.DataSet Ds_Product = new DAL.P_Product().GetDataSet(groupby, strOrder, "P_ID,P_NAME,P_NAME2,P_CATEGORYs,P_Market_P,P_VIP_P,P_M_P,P_images", "", "gtype=" + gtype + " and P_State=N'已处理' And IFDelete=0" + sql + " And (((Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID And G_KC>0)>0 And (Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID)>0) Or ((Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID)=0 And P_Inventory>0))", Start, Limit, out Recount);
string filter = "gtype=" + gtype + " and P_State=N'已处理' And IFDelete=0" + sql + " And (((Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID And G_KC>0)>0 And (Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID)>0) Or ((Select count(c.G_ID) From P_Guige c where c.G_PID=P_ID)=0 And P_Inventory>0))";
#if DEBUG
System.Diagnostics.Debug.WriteLine("========== GetDataSet SQL 调试信息 ==========");
System.Diagnostics.Debug.WriteLine("表名: P_Product");
System.Diagnostics.Debug.WriteLine("分组: " + groupby);
System.Diagnostics.Debug.WriteLine("排序: " + strOrder);
System.Diagnostics.Debug.WriteLine("字段: P_ID,P_NAME,P_NAME2,P_CATEGORYs,P_Market_P,P_VIP_P,P_M_P,P_images");
System.Diagnostics.Debug.WriteLine("查询条件: " + filter);
System.Diagnostics.Debug.WriteLine("起始位置: " + Start);
System.Diagnostics.Debug.WriteLine("每页数量: " + Limit);
System.Diagnostics.Debug.WriteLine("=============================================");
#endif
System.Data.DataSet Ds_Product = new DAL.P_Product().GetDataSet(groupby, strOrder, "P_ID,P_NAME,P_NAME2,P_CATEGORYs,P_Market_P,P_VIP_P,P_M_P,P_images", "", filter, Start, Limit, out Recount);
if (Ds_Product.Tables[1].Rows.Count > 0)
{
@@ -14733,8 +14765,9 @@ namespace Mtxfw.VipSite
{
peitype = Convert.ToInt32(Mtxfw.Utility.Tools.SafeSQL(HttpUtility.UrlDecode(context.Request["peitype"].ToString())));
}
//Mtxfw.Utility.Common.WriteHtml("/weixin/qygmHttpContext.txt", context.Request["zftype"]);
//Mtxfw.Utility.Common.WriteHtml("/weixin/qygmHttpContext1.txt", context.Request.ToString());
int zftype = 0;
if (!String.IsNullOrEmpty(context.Request["zftype"]))
{
@@ -16008,7 +16041,7 @@ namespace Mtxfw.VipSite
Modelorder.ptgroup = 0;
Modelorder.ifxnhy = 0;
Modelorder.ypznum = 0;
Modelorder.ifxhpt = 1;//0银花优选订单1银花优选订单
Modelorder.ifxhpt = 1;//0任E森命订单1任E森命订单
Modelorder.peitype = peitype;
Modelorder.gtype = gtype;
int OrderID = daoorder.Add(Modelorder);
@@ -16339,13 +16372,14 @@ namespace Mtxfw.VipSite
logmodel.MemberId = umodel.Id;
logmodel.AddTime = dt;
logmodel.IP = Mtxfw.Utility.Common.GetIP;
logmodel.Body = "银花优选" + "微信小程序购买商品" + ZSubTotal + "元成功,支付方式:" + strzftitle;
logmodel.Body = "任E森命" + "微信小程序购买商品" + ZSubTotal + "元成功,支付方式:" + strzftitle;
logmodel.UType = 0;
logmodel.gtype = gtype;
new DAL.User_CZ_log().Add(logmodel);
}
else
{
//银花支付目前进的这里
strProductName = strProductName.Replace("%", "度").Replace(" ", "");
if (strProductName.Length > 120)
{
@@ -16430,19 +16464,25 @@ namespace Mtxfw.VipSite
strq += "}";
Mtxfw.Utility.Common.WriteHtml("/weixin/postData1.txt", strq);
string strResult = Mtxfw.Utility.Common.getPage2("https://api.huifu.com/v3/trade/payment/jspay", "", "utf-8", true, true, strq);
Mtxfw.Utility.Common.WriteHtml("/weixin/resData.txt", strResult);
huifuresult hr = (huifuresult)FromhuifuresultJson(strResult);
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart.txt", hr.ToString());
if (hr.data.resp_code == "00000100")
{
huifuresult2 hr0 = (huifuresult2)Fromhuifuresult2Json(strResult);
string pay_info = hr0.data.pay_info;
var zflx = "2";
hjpay_rc_Result hjrc_Result = (hjpay_rc_Result)Fromhjpay_rc_Result(pay_info);
data = "{\"status\":1,\"msg\":\"正在支付中...\",\"timeStamp\":\"" + hjrc_Result.timeStamp + "\",\"noncestr\":\"" + hjrc_Result.nonceStr + "\",\"package\":\"" + hjrc_Result.package + "\",\"paySign\":\"" + hjrc_Result.paySign + "\",\"signType\":\"" + hjrc_Result.signType + "\"}";
data = "{\"status\":1,\"msg\":\"正在支付中...\",\"timeStamp\":\"" + hjrc_Result.timeStamp + "\",\"noncestr\":\"" + hjrc_Result.nonceStr + "\",\"zftype\":\"" + zflx + "\",\"ResultId\":\"" + hjrc_Result.timeStamp + "\",\"package\":\"" + hjrc_Result.package + "\",\"paySign\":\"" + hjrc_Result.paySign + "\",\"signType\":\"" + hjrc_Result.signType + "\"}";
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart2.txt", data);
b = false;
}
else
{
b = false;
data = "{\"status\":0,\"msg\":\"" + hr.data.resp_desc + "\"}";
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart3.txt", data);
}
// 使用HuifuPaymentService
@@ -16509,26 +16549,32 @@ namespace Mtxfw.VipSite
logmodel.MemberId = umodel.Id;
logmodel.AddTime = dt;
logmodel.IP = (umodel.Id == 10154 ? "119.39.248.32" : Mtxfw.Utility.Common.GetIP);
logmodel.Body = "银花优选" + "微信小程序购买商品" + ZSubTotal + "元去付款,支付方式:" + strzftitle;
logmodel.Body = "任E森命" + "微信小程序购买商品" + ZSubTotal + "元去付款,支付方式:" + strzftitle;
logmodel.UType = 0;
logmodel.gtype = gtype;
new DAL.User_CZ_log().Add(logmodel);
Model.User_Errlog mo = new Model.User_Errlog();
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart4.txt", "4");
mo.DLID = 0;
mo.ErrType = "银花优选微信小程序购买商品";
mo.ErrType = "任E森命微信小程序购买商品";
mo.addtime = DateTime.Now;
mo.ErrBody = umodel.Id + "|" + umodel.UserName;
mo.ErrBody2 = openid + "|" + timestamp + "|" + nonceStr + "|" + package + "|" + paySign;
new DAL.User_Errlog().Add(mo);
//Mtxfw.Utility.Common.WriteHtml("/weixin/reResult.txt", );
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart5.txt", "5");
}
if (b)
{
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart.txt", "6");
string strdata = "";
umodel = daoUser.GetModel(userId);
strdata = returndata(umodel);
data = "{\"status\":1,\"msg\":\"" + (zftype == 2 ? "正在支付中" : "下单成功") + "\",\"PayID\":\"" + PayID + "\",\"IFSendSms\":\"" + IFSendSms + "\",\"SendSmsErr\":\"" + SendSmsErr + "\",\"bankphone\":\"" + bankphone + "\",\"ResultId\":\"" + ResultId + "\",\"timeStamp\":\"" + timestamp + "\",\"noncestr\":\"" + nonceStr + "\",\"package\":\"" + package + "\",\"paySign\":\"" + paySign + "\",\"signType\":\"" + signType + "\"," + strdata + "}";
Mtxfw.Utility.Common.WriteHtml("/weixin/xapiajaxstrstart.txt", "7");
}
}
}
@@ -16555,7 +16601,7 @@ namespace Mtxfw.VipSite
{
data = "{\"status\":0,\"msg\":\"参数为空\"}";
}
//Mtxfw.Utility.Common.WriteHtml("/weixin/data.txt", data);
Mtxfw.Utility.Common.WriteHtml("/weixin/data.txt", data);
return data;
}
#endregion
@@ -18573,7 +18619,7 @@ namespace Mtxfw.VipSite
{
if (config.webMoney59 != "")
{
string strconent = "您好!有会员提货,请及时处理!【银花优选】";
string strconent = "您好!有会员提货,请及时处理!【任E森命】";
try
{
Mtxfw.Utility.Common.sendsms(config.webMoney59, "1510662", null, config);