|
@@ -218,7 +218,32 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
//创客
|
|
//创客
|
|
|
int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
|
|
int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
|
|
|
Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
- dic["UserInfo"] = userid_Users.MakerCode + "<br />" + userid_Users.RealName;
|
|
|
|
|
|
|
+ dic["UserInfo"] = userid_Users.MakerCode + "<br />" + userid_Users.RealName + "<br />" + userid_Users.Id;
|
|
|
|
|
+
|
|
|
|
|
+ //顶级创客信息
|
|
|
|
|
+ if (!string.IsNullOrEmpty(userid_Users.ParentNav))
|
|
|
|
|
+ {
|
|
|
|
|
+ string[] ParentNavList = userid_Users.ParentNav.Trim(',').Replace(",,", ",").Split(',');
|
|
|
|
|
+ var topUserInfo = new Users();
|
|
|
|
|
+ if (ParentNavList.Length > 1)
|
|
|
|
|
+ {
|
|
|
|
|
+ topUserInfo = PublicFunction.GetTopUserInfo(userid_Users.ParentNav, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ topUserInfo = PublicFunction.GetTopUserInfo(userid_Users.ParentNav, 0);
|
|
|
|
|
+ }
|
|
|
|
|
+ //顶级创客信息
|
|
|
|
|
+ dic["TopUserInfo"] = topUserInfo.MakerCode + "<br />" + topUserInfo.RealName;
|
|
|
|
|
+
|
|
|
|
|
+ //分离顶级创客信息
|
|
|
|
|
+ dic["TopUserInfoMakerCode"] = topUserInfo.MakerCode;
|
|
|
|
|
+ dic["TopUserInfoRealName"] = topUserInfo.RealName;
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ dic["TopUserInfo"] = "";
|
|
|
|
|
+ }
|
|
|
dic.Remove("UserId");
|
|
dic.Remove("UserId");
|
|
|
|
|
|
|
|
//订单状态
|
|
//订单状态
|
|
@@ -300,11 +325,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["StoreFrom"] = storeuserid_Users.MakerCode + "<br />" + storeid_StoreHouse.StoreName;
|
|
dic["StoreFrom"] = storeuserid_Users.MakerCode + "<br />" + storeid_StoreHouse.StoreName;
|
|
|
dic.Remove("StoreUserId");
|
|
dic.Remove("StoreUserId");
|
|
|
|
|
|
|
|
- //顶级创客
|
|
|
|
|
- int TopUserId = int.Parse(function.CheckInt(dic["TopUserId"].ToString()));
|
|
|
|
|
- Users topuserid_Users = db.Users.FirstOrDefault(m => m.Id == TopUserId) ?? new Users();
|
|
|
|
|
- dic["TopUserInfo"] = topuserid_Users.MakerCode + "<br />" + topuserid_Users.RealName;
|
|
|
|
|
- dic.Remove("TopUserId");
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// //支付状态
|
|
// //支付状态
|
|
|
// int PayStatus = int.Parse(dic["PayStatus"].ToString());
|
|
// int PayStatus = int.Parse(dic["PayStatus"].ToString());
|
|
@@ -617,12 +638,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
bool op = true;
|
|
bool op = true;
|
|
|
decimal TotalPrice = order.TotalPrice;
|
|
decimal TotalPrice = order.TotalPrice;
|
|
|
decimal Amount = data.RefundActAmount;
|
|
decimal Amount = data.RefundActAmount;
|
|
|
- if(order.PayMode == 1)
|
|
|
|
|
|
|
+ if (order.PayMode == 1)
|
|
|
{
|
|
{
|
|
|
PublicAccountSet set = db.PublicAccountSet.FirstOrDefault() ?? new PublicAccountSet();
|
|
PublicAccountSet set = db.PublicAccountSet.FirstOrDefault() ?? new PublicAccountSet();
|
|
|
string result = new Alipay.AlipayPublicClass(_accessor.HttpContext).Refund(set.AlipayAppId, set.AlipayPrivateKey, set.AlipayPublicKey, order.OrderNo, Amount);
|
|
string result = new Alipay.AlipayPublicClass(_accessor.HttpContext).Refund(set.AlipayAppId, set.AlipayPrivateKey, set.AlipayPublicKey, order.OrderNo, Amount);
|
|
|
}
|
|
}
|
|
|
- else if(order.PayMode == 3)
|
|
|
|
|
|
|
+ else if (order.PayMode == 3)
|
|
|
{
|
|
{
|
|
|
UserAccount user = db.UserAccount.FirstOrDefault(m => m.Id == order.UserId);
|
|
UserAccount user = db.UserAccount.FirstOrDefault(m => m.Id == order.UserId);
|
|
|
if (user == null)
|
|
if (user == null)
|
|
@@ -658,7 +679,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Remark = Remark,
|
|
Remark = Remark,
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- if(op)
|
|
|
|
|
|
|
+ if (op)
|
|
|
{
|
|
{
|
|
|
order.RefundStatus = 1;
|
|
order.RefundStatus = 1;
|
|
|
order.RefundActAmount = Amount;
|
|
order.RefundActAmount = Amount;
|
|
@@ -1498,7 +1519,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
string end = datelist[1];
|
|
string end = datelist[1];
|
|
|
SqlString += " and a.SendDate>='" + start + " 00:00:00' and a.SendDate<='" + end + " 23:59:59'";
|
|
SqlString += " and a.SendDate>='" + start + " 00:00:00' and a.SendDate<='" + end + " 23:59:59'";
|
|
|
}
|
|
}
|
|
|
- var Sql = "SELECT b.MakerCode '创客编号',b.RealName '创客真实姓名',a.OrderNo '订单号',a.Mobile '手机号',a.RealName '姓名',a.TotalPrice '总价',a.Areas '所在地区',a.Address '详细地址',a.ErpName '物流名称',a.ErpCode '运单号',DATE_FORMAT(a.SendDate,'%Y-%m-%d %H:%i:%s') '发货时间',(CASE WHEN a.PayMode=1 THEN '支付宝' WHEN a.PayMode=2 THEN '微信' WHEN a.PayMode=3 THEN '账户余额' ELSE '' end) '支付方式',DATE_FORMAT(a.PayDate,'%Y-%m-%d %H:%i:%s') '支付时间',a.TradeNo '支付交易号',c.StoreNo '仓库编号',c.StoreName '仓库名称',(CASE WHEN a.RefundStatus=0 THEN '未退款' WHEN a.RefundStatus=1 THEN '已退款' end) '退款状态',(CASE WHEN a.DeliveryType=1 THEN '邮寄到付' WHEN a.DeliveryType=2 THEN '上门自提' ELSE '' end) '提货类型',(CASE WHEN a.SendStatus=0 THEN '未发货' WHEN a.SendStatus=1 THEN '已发货' WHEN a.SendStatus=2 THEN '已退货' ELSE '' end) '发货状态',d.ProductName '商品名称',a.BuyCount '下单数量',d.TotalPrice '商品单价',d.NormDetail '商品规格',a.StoreContact '仓库联系人',(CASE WHEN a.StoreType=0 THEN '总仓' WHEN a.StoreType=1 THEN '分仓' ELSE '' end) '仓库类型',e.MakerCode '仓库归属创客编号',e.RealName '仓库归属创客姓名',(CASE WHEN a.PayStatus=0 THEN '未支付' WHEN a.PayStatus=1 THEN '支付成功' WHEN a.PayStatus=2 THEN '支付失败' WHEN a.PayStatus=3 THEN '支付锁定中' WHEN a.PayStatus=4 THEN '支付处理中' ELSE '' end) '支付状态',a.Remark '订单备注' FROM Orders a LEFT JOIN Users b ON a.UserId=b.Id LEFT JOIN StoreHouse c ON a.StoreId=c.Id LEFT JOIN OrderProduct d ON a.Id=d.OrderId LEFT JOIN Users e ON a.StoreUserId=e.Id" + SqlString + "";
|
|
|
|
|
|
|
+ var Sql = "SELECT aa.*,bb.RealName FROM(SELECT b.MakerCode '创客编号',b.RealName '创客真实姓名',a.OrderNo '订单号',SUBSTRING_INDEX(SUBSTRING_INDEX(b.ParentNav,',',4),',',-1) TopId,a.Mobile '手机号',a.RealName '姓名',a.TotalPrice '总价',a.Areas '所在地区',a.Address '详细地址',a.ErpName '物流名称',a.ErpCode '运单号',DATE_FORMAT(a.SendDate,'%Y-%m-%d %H:%i:%s') '发货时间',(CASE WHEN a.PayMode=1 THEN '支付宝' WHEN a.PayMode=2 THEN '微信' WHEN a.PayMode=3 THEN '账户余额' ELSE '' end) '支付方式',DATE_FORMAT(a.PayDate,'%Y-%m-%d %H:%i:%s') '支付时间',a.TradeNo '支付交易号',c.StoreNo '仓库编号',c.StoreName '仓库名称',(CASE WHEN a.RefundStatus=0 THEN '未退款' WHEN a.RefundStatus=1 THEN '已退款' end) '退款状态',(CASE WHEN a.DeliveryType=1 THEN '邮寄到付' WHEN a.DeliveryType=2 THEN '上门自提' ELSE '' end) '提货类型',(CASE WHEN a.SendStatus=0 THEN '未发货' WHEN a.SendStatus=1 THEN '已发货' WHEN a.SendStatus=2 THEN '已退货' ELSE '' end) '发货状态',d.ProductName '商品名称',a.BuyCount '下单数量',d.TotalPrice '商品单价',d.NormDetail '商品规格',a.StoreContact '仓库联系人',(CASE WHEN a.StoreType=0 THEN '总仓' WHEN a.StoreType=1 THEN '分仓' ELSE '' end) '仓库类型',e.MakerCode '仓库归属创客编号',e.RealName '仓库归属创客姓名',(CASE WHEN a.PayStatus=0 THEN '未支付' WHEN a.PayStatus=1 THEN '支付成功' WHEN a.PayStatus=2 THEN '支付失败' WHEN a.PayStatus=3 THEN '支付锁定中' WHEN a.PayStatus=4 THEN '支付处理中' ELSE '' end) '支付状态',a.Remark '订单备注' FROM Orders a LEFT JOIN Users b ON a.UserId=b.Id LEFT JOIN StoreHouse c ON a.StoreId=c.Id LEFT JOIN OrderProduct d ON a.Id=d.OrderId LEFT JOIN Users e ON a.StoreUserId=e.Id" + SqlString + ")aa LEFT JOIN Users bb ON aa.TopId = bb.Id";
|
|
|
var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
|
|
var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
|
|
|
var FileName = "商城订单记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
var FileName = "商城订单记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
|
|
string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
|