|
|
@@ -806,12 +806,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
//仓库编号
|
|
|
if (!string.IsNullOrEmpty(StoreIdStoreNo))
|
|
|
{
|
|
|
- condition += " and StoreId in (select StoreId from StoreHouseForStoreNo where StoreNo='" + StoreIdStoreNo + "')";
|
|
|
+ condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreIdStoreNo + "')";
|
|
|
}
|
|
|
//仓库名称
|
|
|
if (!string.IsNullOrEmpty(StoreIdStoreName))
|
|
|
{
|
|
|
- condition += " and StoreId in (select StoreId from StoreHouseForStoreName where StoreName='" + StoreIdStoreName + "')";
|
|
|
+ condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreIdStoreName + "')";
|
|
|
}
|
|
|
//退款状态
|
|
|
if (!string.IsNullOrEmpty(RefundStatusSelect))
|
|
|
@@ -1075,12 +1075,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
//仓库编号
|
|
|
if (!string.IsNullOrEmpty(StoreIdStoreNo))
|
|
|
{
|
|
|
- condition += " and StoreId in (select StoreId from StoreHouseForStoreNo where StoreNo='" + StoreIdStoreNo + "')";
|
|
|
+ condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreIdStoreNo + "')";
|
|
|
}
|
|
|
//仓库名称
|
|
|
if (!string.IsNullOrEmpty(StoreIdStoreName))
|
|
|
{
|
|
|
- condition += " and StoreId in (select StoreId from StoreHouseForStoreName where StoreName='" + StoreIdStoreName + "')";
|
|
|
+ condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreIdStoreName + "')";
|
|
|
}
|
|
|
//退款状态
|
|
|
if (!string.IsNullOrEmpty(RefundStatusSelect))
|
|
|
@@ -1283,7 +1283,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
public string QuickExportExcelDo(string UserIdMakerCode, string UserIdRealName, string PayModeSelect, string StoreIdStoreNo, string StoreIdStoreName, string RefundStatusSelect, string DeliveryTypeSelect, string SendStatusSelect, string ProductIdSelect, string StoreTypeSelect, string StoreUserIdMakerCode, string StoreUserIdRealName, string PayStatusSelect, string CreateDateData, string SendDateData, string PayDateData)
|
|
|
{
|
|
|
|
|
|
- string SqlString = "where 1=1 and a.Status>=-1";
|
|
|
+ string SqlString = " where 1=1 and a.Status>=-1";
|
|
|
//创客编号
|
|
|
if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
{
|
|
|
@@ -1302,12 +1302,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
//仓库编号
|
|
|
if (!string.IsNullOrEmpty(StoreIdStoreNo))
|
|
|
{
|
|
|
- SqlString += " and a.StoreId in (select StoreId from StoreHouseForStoreNo where StoreNo='" + StoreIdStoreNo + "')";
|
|
|
+ SqlString += " and a.StoreId in (select StoreId from StoreForCode where StoreNo='" + StoreIdStoreNo + "')";
|
|
|
}
|
|
|
//仓库名称
|
|
|
if (!string.IsNullOrEmpty(StoreIdStoreName))
|
|
|
{
|
|
|
- SqlString += " and a.StoreId in (select StoreId from StoreHouseForStoreName where StoreName='" + StoreIdStoreName + "')";
|
|
|
+ SqlString += " and a.StoreId in (select Id from StoreHouse where StoreName='" + StoreIdStoreName + "')";
|
|
|
}
|
|
|
//退款状态
|
|
|
if (!string.IsNullOrEmpty(RefundStatusSelect))
|
|
|
@@ -1373,7 +1373,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
string end = datelist[1];
|
|
|
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 '运单号',a.SendDate '发货时间',(CASE WHEN a.PayMode=1 THEN '支付宝' WHEN a.PayMode=2 THEN '微信' WHEN a.PayMode=3 THEN '账户余额' ELSE '' end) '支付方式',a.PayDate '支付时间',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 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 sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
|
|
|
var FileName = "商城订单记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
|