|
@@ -4210,8 +4210,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
return View();
|
|
return View();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public string TransferPosCouponDo(string PosCouponCodes, string FromMakerCode, string ToMakerCode, string LeaderMakerCode = "")
|
|
|
|
|
|
|
+ public string TransferPosCouponDo(string Kind, string PosCouponCodes, string FromMakerCode, string ToMakerCode, string LeaderMakerCode = "")
|
|
|
{
|
|
{
|
|
|
|
|
+ if (string.IsNullOrEmpty(PosCouponCodes))
|
|
|
|
|
+ {
|
|
|
|
|
+ return "请输入机具券码";
|
|
|
|
|
+ }
|
|
|
if (string.IsNullOrEmpty(PosCouponCodes))
|
|
if (string.IsNullOrEmpty(PosCouponCodes))
|
|
|
{
|
|
{
|
|
|
return "请输入机具券码";
|
|
return "请输入机具券码";
|
|
@@ -4285,9 +4289,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int CouponCount = PosCouponList.Length;
|
|
int CouponCount = PosCouponList.Length;
|
|
|
PosCouponOrders stat = db.PosCouponOrders.Add(new PosCouponOrders()
|
|
PosCouponOrders stat = db.PosCouponOrders.Add(new PosCouponOrders()
|
|
|
{
|
|
{
|
|
|
- QueryCount = 3,
|
|
|
|
|
|
|
+ QueryCount = 2,
|
|
|
CreateDate = DateTime.Now,
|
|
CreateDate = DateTime.Now,
|
|
|
- ChangeKind = 1,//类型(0购买,1划拨,2使⽤,3申请机具循环驳回)
|
|
|
|
|
|
|
+ ChangeKind = 2,
|
|
|
ChangeCount = CouponCount,
|
|
ChangeCount = CouponCount,
|
|
|
// AfterOut = AfterOut,
|
|
// AfterOut = AfterOut,
|
|
|
// AfterTotal = AfterTotal,
|
|
// AfterTotal = AfterTotal,
|
|
@@ -4299,6 +4303,22 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
ToUserId = tUserId.Id,
|
|
ToUserId = tUserId.Id,
|
|
|
FromUserId = fUserId.Id,
|
|
FromUserId = fUserId.Id,
|
|
|
}).Entity;
|
|
}).Entity;
|
|
|
|
|
+ PosCouponOrders tostat = db.PosCouponOrders.Add(new PosCouponOrders()
|
|
|
|
|
+ {
|
|
|
|
|
+ QueryCount = 1,
|
|
|
|
|
+ CreateDate = DateTime.Now,
|
|
|
|
|
+ ChangeKind = 1,
|
|
|
|
|
+ ChangeCount = CouponCount,
|
|
|
|
|
+ // AfterOut = AfterOut,
|
|
|
|
|
+ // AfterTotal = AfterTotal,
|
|
|
|
|
+ // AfterStock = AfterStock,
|
|
|
|
|
+ // BeforeOut = BeforeOut,
|
|
|
|
|
+ // BeforeTotal = BeforeTotal,
|
|
|
|
|
+ // BeforeStock = BeforeStock,
|
|
|
|
|
+ OrderNo = ChangeRecordNo,
|
|
|
|
|
+ FromUserId = tUserId.Id,
|
|
|
|
|
+ ToUserId = fUserId.Id,
|
|
|
|
|
+ }).Entity;
|
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
|
db.Dispose();
|
|
db.Dispose();
|
|
|
|
|
|
|
@@ -4898,21 +4918,28 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
}
|
|
|
if (!string.IsNullOrEmpty(PosFeeSelect))
|
|
if (!string.IsNullOrEmpty(PosFeeSelect))
|
|
|
{
|
|
{
|
|
|
- condition += " and tb.SeoKeyword=" + PosFeeSelect;
|
|
|
|
|
|
|
+ if (PosFeeSelect == "0")
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and tb.SeoKeyword is null";
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and tb.SeoKeyword=" + PosFeeSelect;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (!string.IsNullOrEmpty(BrandId))
|
|
if (!string.IsNullOrEmpty(BrandId))
|
|
|
{
|
|
{
|
|
|
condition += " and tb.BrandId=" + BrandId;
|
|
condition += " and tb.BrandId=" + BrandId;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- DataTable dt = CustomerSqlConn.dtable("select wname,k.`Name`,PosSnType,PosSn,tb.SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from (select (select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN BrandId not in(2,7,10,11) THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition, conn);
|
|
|
|
|
|
|
+ DataTable dt = CustomerSqlConn.dtable("select wname,k.`Name`,PosSnType,PosSn,(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from (select (select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN BrandId not in(2,7,10,11) THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition, conn);
|
|
|
foreach (DataRow item in dt.Rows)
|
|
foreach (DataRow item in dt.Rows)
|
|
|
{
|
|
{
|
|
|
Dictionary<string, object> curData = new Dictionary<string, object>();
|
|
Dictionary<string, object> curData = new Dictionary<string, object>();
|
|
|
curData.Add("wname", item["wname"].ToString()); //伙伴名称
|
|
curData.Add("wname", item["wname"].ToString()); //伙伴名称
|
|
|
curData.Add("Name", item["Name"].ToString()); //机具品牌
|
|
curData.Add("Name", item["Name"].ToString()); //机具品牌
|
|
|
curData.Add("PosSn", item["PosSn"].ToString()); //机具Sn
|
|
curData.Add("PosSn", item["PosSn"].ToString()); //机具Sn
|
|
|
- curData.Add("SeoKeyword", item["SeoKeyword"].ToString()); //押金
|
|
|
|
|
|
|
+ curData.Add("SeoKeyword", item["SeoKeyword"].ToString()); //服务费
|
|
|
curData.Add("BindingTime", string.IsNullOrEmpty(item["BindingTime"].ToString()) ? "" : Convert.ToDateTime(item["BindingTime"]).ToString("yyyy-MM-dd HH:mm:ss")); //绑定时间
|
|
curData.Add("BindingTime", string.IsNullOrEmpty(item["BindingTime"].ToString()) ? "" : Convert.ToDateTime(item["BindingTime"]).ToString("yyyy-MM-dd HH:mm:ss")); //绑定时间
|
|
|
curData.Add("ActivationTime", string.IsNullOrEmpty(item["ActivationTime"].ToString()) ? "" : Convert.ToDateTime(item["ActivationTime"]).ToString("yyyy-MM-dd HH:mm:ss")); //激活时间
|
|
curData.Add("ActivationTime", string.IsNullOrEmpty(item["ActivationTime"].ToString()) ? "" : Convert.ToDateTime(item["ActivationTime"]).ToString("yyyy-MM-dd HH:mm:ss")); //激活时间
|
|
|
dataList.Add(curData);
|
|
dataList.Add(curData);
|
|
@@ -4969,13 +4996,20 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
}
|
|
|
if (!string.IsNullOrEmpty(PosFeeSelect))
|
|
if (!string.IsNullOrEmpty(PosFeeSelect))
|
|
|
{
|
|
{
|
|
|
- condition += " and tb.SeoKeyword=" + PosFeeSelect;
|
|
|
|
|
|
|
+ if (PosFeeSelect == "0")
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and tb.SeoKeyword is null";
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ condition += " and tb.SeoKeyword=" + PosFeeSelect;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (!string.IsNullOrEmpty(BrandId))
|
|
if (!string.IsNullOrEmpty(BrandId))
|
|
|
{
|
|
{
|
|
|
condition += " and tb.BrandId=" + BrandId;
|
|
condition += " and tb.BrandId=" + BrandId;
|
|
|
}
|
|
}
|
|
|
- var Sql = "select wname '伙伴名称',k.`Name` '机具品牌',PosSn '机具Sn',tb.SeoKeyword '押金',DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') '绑定时间',DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') '激活时间' from (select (select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN BrandId not in(2,7,10,11) THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition;
|
|
|
|
|
|
|
+ var Sql = "select wname '伙伴名称',k.`Name` '机具品牌',PosSn '机具Sn',(CASE WHEN tb.SeoKeyword IS NULL AND tb.PrizeParams=0 THEN 0 ELSE tb.SeoKeyword END) '服务费',DATE_FORMAT(BindingTime,'%Y-%m-%d %H:%i:%s') '绑定时间',DATE_FORMAT(ActivationTime,'%Y-%m-%d %H:%i:%s') '激活时间' from (select (select Name from BusinessPartner where Id=(select PartnerId from BusinessPartnerPos where PosId=pos.Id and `Status`>-1 limit 1)) wname,BrandId,PosSnType,PosSn,(CASE WHEN BrandId not in(2,7,10,11) THEN ROUND(CAST(SeoKeyword AS DECIMAL)/100, 2) ELSE SeoKeyword end) SeoKeyword,TransferTime,BindingTime,ActivationTime,PrizeParams from PosMachinesTwo pos where BindingState=1 and `Status`>=-1 and BuyUserId=" + UserId + " and Id in (select PosId from BusinessPartnerPos)) tb left join KqProducts k on tb.BrandId=k.Id" + condition;
|
|
|
|
|
|
|
|
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");
|