|
@@ -38,14 +38,14 @@ public class StoreApplyHelper
|
|
{
|
|
{
|
|
function.WritePage("/StoreApply/", DateTime.Now.ToString("yyyyMM") + ".txt", DateTime.Now.ToString());
|
|
function.WritePage("/StoreApply/", DateTime.Now.ToString("yyyyMM") + ".txt", DateTime.Now.ToString());
|
|
Dictionary<int, decimal> dataDic = new Dictionary<int, decimal>();
|
|
Dictionary<int, decimal> dataDic = new Dictionary<int, decimal>();
|
|
- string pre = DateTime.Now.AddDays(-2).ToString("yyyy-MM") + "-01 00:00:00";
|
|
|
|
- string start = DateTime.Now.AddDays(-1).ToString("yyyy-MM") + "-01 00:00:00";
|
|
|
|
- string end = DateTime.Parse(start).ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
+ string pre = DateTime.Now.AddMonths(-2).ToString("yyyy-MM") + "-01 00:00:00";
|
|
|
|
+ string start = DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01 00:00:00";
|
|
|
|
+ string end = DateTime.Parse(start).AddMonths(1).ToString("yyyy-MM-dd HH:mm:ss");
|
|
DataTable dts = OtherMySqlConn.dtable("select UserId from StoreHouse where CreateDate>='" + pre + "' and CreateDate<'" + end + "' and UserId in (select UserId from (select UserId,count(Id) from StoreHouse group by UserId HAVING count(Id)=1) tb)");
|
|
DataTable dts = OtherMySqlConn.dtable("select UserId from StoreHouse where CreateDate>='" + pre + "' and CreateDate<'" + end + "' and UserId in (select UserId from (select UserId,count(Id) from StoreHouse group by UserId HAVING count(Id)=1) tb)");
|
|
foreach(DataRow dr in dts.Rows)
|
|
foreach(DataRow dr in dts.Rows)
|
|
{
|
|
{
|
|
int UserId = int.Parse(function.CheckInt(dr["UserId"].ToString()));
|
|
int UserId = int.Parse(function.CheckInt(dr["UserId"].ToString()));
|
|
- if(dataDic.ContainsKey(UserId))
|
|
|
|
|
|
+ if(!dataDic.ContainsKey(UserId))
|
|
{
|
|
{
|
|
dataDic.Add(UserId, 20000);
|
|
dataDic.Add(UserId, 20000);
|
|
}
|
|
}
|
|
@@ -54,13 +54,13 @@ public class StoreApplyHelper
|
|
dataDic[UserId] += 20000;
|
|
dataDic[UserId] += 20000;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- DataTable dt = OtherMySqlConn.dtable("select StoreId,count(Id) from PosMachinesTwo where TransferTime>='" + start + "' and TransferTime<'" + end + "' and BrandId in (1,2,4,6,7,8) and Status>-1 group by StoreId");
|
|
|
|
|
|
+ DataTable dt = OtherMySqlConn.dtable("select StoreId,count(Id) from StoreStockChange where CreateDate>='" + start + "' and CreateDate<'" + end + "' and BrandId in (1,2,4,6,7,8) and TransType in (10,11,2) and StoreId>0 group by StoreId");
|
|
foreach(DataRow dr in dt.Rows)
|
|
foreach(DataRow dr in dt.Rows)
|
|
{
|
|
{
|
|
int StoreId = int.Parse(function.CheckInt(dr["StoreId"].ToString()));
|
|
int StoreId = int.Parse(function.CheckInt(dr["StoreId"].ToString()));
|
|
int Count = int.Parse(function.CheckInt(dr[1].ToString()));
|
|
int Count = int.Parse(function.CheckInt(dr[1].ToString()));
|
|
StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
|
|
StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
|
|
- if(dataDic.ContainsKey(store.UserId))
|
|
|
|
|
|
+ if(!dataDic.ContainsKey(store.UserId))
|
|
{
|
|
{
|
|
dataDic.Add(store.UserId, Count * 200);
|
|
dataDic.Add(store.UserId, Count * 200);
|
|
}
|
|
}
|
|
@@ -69,13 +69,13 @@ public class StoreApplyHelper
|
|
dataDic[store.UserId] += Count * 200;
|
|
dataDic[store.UserId] += Count * 200;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- dt = OtherMySqlConn.dtable("select StoreId,count(Id) from PosMachinesTwo where TransferTime>='" + start + "' and TransferTime<'" + end + "' and BrandId in (3,5,9) and Status>-1 group by StoreId");
|
|
|
|
|
|
+ dt = OtherMySqlConn.dtable("select StoreId,count(Id) from StoreStockChange where CreateDate>='" + start + "' and CreateDate<'" + end + "' and BrandId in (3,5,9) and TransType in (10,11,2) and StoreId>0 group by StoreId");
|
|
foreach(DataRow dr in dt.Rows)
|
|
foreach(DataRow dr in dt.Rows)
|
|
{
|
|
{
|
|
int StoreId = int.Parse(function.CheckInt(dr["StoreId"].ToString()));
|
|
int StoreId = int.Parse(function.CheckInt(dr["StoreId"].ToString()));
|
|
int Count = int.Parse(function.CheckInt(dr[1].ToString()));
|
|
int Count = int.Parse(function.CheckInt(dr[1].ToString()));
|
|
StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
|
|
StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
|
|
- if(dataDic.ContainsKey(store.UserId))
|
|
|
|
|
|
+ if(!dataDic.ContainsKey(store.UserId))
|
|
{
|
|
{
|
|
dataDic.Add(store.UserId, Count * 300);
|
|
dataDic.Add(store.UserId, Count * 300);
|
|
}
|
|
}
|