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
7e98e6cd
Commit
7e98e6cd
authored
Feb 14, 2023
by
lizefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
68bd9651
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
4 deletions
+34
-4
dc_ana_deviation_dao.cs
AutoTurnOver.DB/dc_ana_deviation_dao.cs
+19
-4
TaskDownloadServices.cs
AutoTurnOver.Services/TaskDownloadServices.cs
+15
-0
Program.cs
ResetOutofstock/Program.cs
+0
-0
No files found.
AutoTurnOver.DB/dc_ana_deviation_dao.cs
View file @
7e98e6cd
...
@@ -409,9 +409,15 @@ namespace AutoTurnOver.DB
...
@@ -409,9 +409,15 @@ namespace AutoTurnOver.DB
var
pageDatas
=
allDatas
.
Skip
(
offset
).
Take
(
limit
).
ToList
();
var
pageDatas
=
allDatas
.
Skip
(
offset
).
Take
(
limit
).
ToList
();
foreach
(
var
item
in
pageDatas
)
foreach
(
var
item
in
pageDatas
)
{
{
var
field
=
item
.
Key
.
field
;
if
(
field
==
"是否断货"
)
{
field
=
"断货sku数"
;
}
deviation_view_dto
itemData
=
new
deviation_view_dto
()
deviation_view_dto
itemData
=
new
deviation_view_dto
()
{
{
field
=
item
.
Key
.
field
,
field
=
field
,
field_type
=
item
.
Key
.
field_type
,
field_type
=
item
.
Key
.
field_type
,
group_key
=
item
.
Key
.
project
,
group_key
=
item
.
Key
.
project
,
project
=
item
.
Key
.
project
,
project
=
item
.
Key
.
project
,
...
@@ -452,7 +458,7 @@ namespace AutoTurnOver.DB
...
@@ -452,7 +458,7 @@ namespace AutoTurnOver.DB
switch
(
field
)
switch
(
field
)
{
{
case
"销售数量预计偏差比例"
:
case
"销售数量预计偏差比例"
:
val
=
all
.
Where
(
s
=>
s
.
field
==
"销售数量预计偏差值"
&&
s
.
field_type
==
"偏差分析"
&&
s
.
project
==
project
).
Sum
(
s
=>
s
.
val
).
Division
(
val
=
all
.
Where
(
s
=>
s
.
field
==
"销售数量预计偏差值"
&&
s
.
field_type
==
"偏差分析"
&&
s
.
project
==
project
).
Sum
(
s
=>
s
.
val
).
Division
(
all
.
Where
(
s
=>
s
.
field
==
"销售产品数量"
&&
s
.
field_type
==
"预测值"
&&
s
.
project
==
project
).
Sum
(
s
=>
s
.
val
)
all
.
Where
(
s
=>
s
.
field
==
"销售产品数量"
&&
s
.
field_type
==
"预测值"
&&
s
.
project
==
project
).
Sum
(
s
=>
s
.
val
)
).
ToString
(
"p"
);
).
ToString
(
"p"
);
break
;
break
;
...
@@ -476,9 +482,14 @@ namespace AutoTurnOver.DB
...
@@ -476,9 +482,14 @@ namespace AutoTurnOver.DB
break
;
break
;
}
}
}
}
else
if
(
field
==
"是否断货"
)
{
val
=
list
.
Count
(
s
=>
s
.
val
<=
0
).
ToString
();
}
else
else
{
{
val
=
Math
.
Round
(
data
.
Sum
(
s
=>
s
.
val
),
1
).
ToString
();
val
=
Math
.
Round
(
data
.
Sum
(
s
=>
s
.
val
),
field
.
Contains
(
"金额"
)
?
1
:
0
).
ToString
();
}
}
...
@@ -495,11 +506,15 @@ namespace AutoTurnOver.DB
...
@@ -495,11 +506,15 @@ namespace AutoTurnOver.DB
var
data
=
list
.
FirstOrDefault
(
s
=>
date_str
==
s
.
date_str
);
var
data
=
list
.
FirstOrDefault
(
s
=>
date_str
==
s
.
date_str
);
if
(
data
!=
null
)
if
(
data
!=
null
)
{
{
val
=
Math
.
Round
(
data
.
val
,
1
).
ToString
();
val
=
Math
.
Round
(
data
.
val
,
field
.
Contains
(
"金额"
)
?
1
:
0
).
ToString
();
if
(
field
.
Contains
(
"比例"
))
if
(
field
.
Contains
(
"比例"
))
{
{
return
data
.
val
.
ToString
(
"p"
);
return
data
.
val
.
ToString
(
"p"
);
}
}
if
(
field
==
"是否断货"
)
{
return
data
.
val
>
0
?
"是"
:
"否"
;
}
}
}
return
val
;
return
val
;
...
...
AutoTurnOver.Services/TaskDownloadServices.cs
View file @
7e98e6cd
...
@@ -89,6 +89,9 @@ namespace AutoTurnOver.Services
...
@@ -89,6 +89,9 @@ namespace AutoTurnOver.Services
case
"新现金流报表(sku)"
:
case
"新现金流报表(sku)"
:
item
.
result_file_url
=
await
DownloadDeviationSkuExport
(
item
.
parameter
,
item
);
item
.
result_file_url
=
await
DownloadDeviationSkuExport
(
item
.
parameter
,
item
);
break
;
break
;
case
"新现金流报表(项目)"
:
item
.
result_file_url
=
await
DownloadDeviationProjectExport
(
item
.
parameter
,
item
);
break
;
default
:
throw
new
Exception
(
"无法识别的任务"
);
default
:
throw
new
Exception
(
"无法识别的任务"
);
}
}
item
.
end_date
=
DateTime
.
Now
;
item
.
end_date
=
DateTime
.
Now
;
...
@@ -423,6 +426,18 @@ namespace AutoTurnOver.Services
...
@@ -423,6 +426,18 @@ namespace AutoTurnOver.Services
Console
.
WriteLine
(
"DownloadStock - 上传完毕"
);
Console
.
WriteLine
(
"DownloadStock - 上传完毕"
);
return
fileData
;
return
fileData
;
}
}
public
async
Task
<
string
>
DownloadDeviationProjectExport
(
string
par_json
,
dc_task_download
download_data
)
{
var
rows
=
0
;
deviation_search_dto
search_data
=
par_json
.
ToObject
<
deviation_search_dto
>();
Console
.
WriteLine
(
"DownloadStock - 开始生成文件"
);
var
memory
=
new
DeviationServices
().
ProjectExport
(
search_data
,
out
rows
);
download_data
.
rows
=
rows
;
Console
.
WriteLine
(
"DownloadStock - 开始生成上传文件"
);
var
fileData
=
await
AutoTurnOver
.
Utility
.
QiNiuCloudHelper
.
UploadSectioningAsync
(
memory
);
Console
.
WriteLine
(
"DownloadStock - 上传完毕"
);
return
fileData
;
}
}
}
}
}
ResetOutofstock/Program.cs
View file @
7e98e6cd
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