Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
data-center-auto
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
data-center-auto
Commits
8e0c9d34
Commit
8e0c9d34
authored
Mar 24, 2021
by
泽锋 李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
6288b2b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
dc_base_mother_sku_dao.cs
AutoTurnOver.DB/dc_base_mother_sku_dao.cs
+16
-6
ResetOutofstockBackgrounService.cs
ResetOutofstock/ResetOutofstockBackgrounService.cs
+2
-2
No files found.
AutoTurnOver.DB/dc_base_mother_sku_dao.cs
View file @
8e0c9d34
...
@@ -870,12 +870,22 @@ where t2.hq_type in ('fba仓') and ifnull(t3.`status`,0)=0 GROUP BY t1.bailun_s
...
@@ -870,12 +870,22 @@ where t2.hq_type in ('fba仓') and ifnull(t3.`status`,0)=0 GROUP BY t1.bailun_s
foreach
(
var
item
in
group_list
)
foreach
(
var
item
in
group_list
)
{
{
var
mainData
=
item
.
warehouse_datas
.
OrderByDescending
(
s
=>
s
.
daily_weighted_sales
).
FirstOrDefault
();
try
var
mother_id
=
0
;
{
mother_id
=
Save
(
new
dc_base_mother_sku
{
sku
=
item
.
bailun_sku
,
warehouse_code
=
mainData
.
warehouse_code
},
new
UserData
()
{
UserName
=
"system"
});
var
mainData
=
item
.
warehouse_datas
.
OrderByDescending
(
s
=>
s
.
daily_weighted_sales
).
FirstOrDefault
();
// 销量最高的做主sku
var
mother_id
=
0
;
BatchSet
(
new
batch_set_input_dto
{
mother_id
=
mother_id
,
ids
=
item
.
warehouse_datas
.
Where
(
s
=>
s
.
id
!=
mainData
.
id
).
Select
(
s
=>
s
.
id
).
ToList
()
},
new
UserData
()
{
UserName
=
"system"
});
mother_id
=
Save
(
new
dc_base_mother_sku
{
sku
=
item
.
bailun_sku
,
warehouse_code
=
mainData
.
warehouse_code
},
new
UserData
()
{
UserName
=
"system"
});
BatchSet
(
new
batch_set_input_dto
{
mother_id
=
mother_id
,
ids
=
new
List
<
int
>
{
mainData
.
id
},
is_main
=
1
},
new
UserData
()
{
UserName
=
"system"
});
// 销量最高的做主sku
BatchSet
(
new
batch_set_input_dto
{
mother_id
=
mother_id
,
ids
=
item
.
warehouse_datas
.
Where
(
s
=>
s
.
id
!=
mainData
.
id
).
Select
(
s
=>
s
.
id
).
ToList
()
},
new
UserData
()
{
UserName
=
"system"
});
BatchSet
(
new
batch_set_input_dto
{
mother_id
=
mother_id
,
ids
=
new
List
<
int
>
{
mainData
.
id
},
is_main
=
1
},
new
UserData
()
{
UserName
=
"system"
});
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
$"子母sku刷新
{
item
.
bailun_sku
}
"
+
ex
.
Message
);
Console
.
WriteLine
(
$"子母sku刷新
{
item
.
bailun_sku
}
"
+
ex
.
StackTrace
);
//Console.WriteLine($"子母sku刷新 {item.bailun_sku} "+ item.ToJson());
}
}
}
}
}
...
...
ResetOutofstock/ResetOutofstockBackgrounService.cs
View file @
8e0c9d34
...
@@ -341,7 +341,7 @@ namespace ResetOutofstock
...
@@ -341,7 +341,7 @@ namespace ResetOutofstock
{
{
while
(
true
)
while
(
true
)
{
{
Thread
.
Sleep
(
10
*
60
*
1000
);
try
try
{
{
if
(
DateTime
.
Now
.
Hour
>
8
)
if
(
DateTime
.
Now
.
Hour
>
8
)
...
@@ -350,7 +350,7 @@ namespace ResetOutofstock
...
@@ -350,7 +350,7 @@ namespace ResetOutofstock
dc_base_mother_sku_dao
.
GenerateData
();
dc_base_mother_sku_dao
.
GenerateData
();
Console
.
WriteLine
(
$"结束刷新 子母sku数据,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
Console
.
WriteLine
(
$"结束刷新 子母sku数据,线程Id:
{
Thread
.
CurrentThread
.
ManagedThreadId
}
,
{
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)}
"
);
}
}
Thread
.
Sleep
(
10
*
60
*
1000
);
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment