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
62534272
Commit
62534272
authored
Feb 14, 2023
by
lizefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
240c46b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
24 deletions
+28
-24
dc_ana_deviation_dao.cs
AutoTurnOver.DB/dc_ana_deviation_dao.cs
+28
-24
No files found.
AutoTurnOver.DB/dc_ana_deviation_dao.cs
View file @
62534272
...
...
@@ -365,30 +365,34 @@ namespace AutoTurnOver.DB
var
viewDatas
=
new
List
<
deviation_view_dto
>()
{
};
var
year
=
DateTime
.
Now
.
Year
;
var
allDatas
=
datas
.
GroupBy
(
s
=>
new
{
s
.
sku
,
s
.
project
,
s
.
field
,
s
.
field_type
}).
OrderBy
(
s
=>
s
.
Key
.
field_type
);
var
allDatas
=
datas
.
GroupBy
(
s
=>
new
{
s
.
sku
,
s
.
project
,
s
.
field_type
,
s
.
field
}).
OrderBy
(
s
=>
s
.
Key
.
field_type
);
foreach
(
var
item
in
allDatas
.
Take
(
limit
).
Skip
(
offset
))
{
deviation_view_dto
itemData
=
new
deviation_view_dto
(
)
foreach
(
var
itemField
in
enumList
)
{
field
=
item
.
Key
.
field
,
field_type
=
item
.
Key
.
field_type
,
group_key
=
item
.
Key
.
sku
,
project
=
item
.
Key
.
project
,
month1
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-01"
),
month2
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-02"
),
month3
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-03"
),
month4
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-04"
),
month5
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-05"
),
month6
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-06"
),
month7
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-07"
),
month8
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-08"
),
month9
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-09"
),
month10
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-10"
),
month11
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-11"
),
month12
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-12"
)
};
viewDatas
.
Add
(
itemData
);
deviation_view_dto
itemData
=
new
deviation_view_dto
()
{
field
=
item
.
Key
.
field
,
field_type
=
item
.
Key
.
field_type
,
group_key
=
item
.
Key
.
sku
,
project
=
item
.
Key
.
project
,
month1
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-01"
),
month2
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-02"
),
month3
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-03"
),
month4
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-04"
),
month5
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-05"
),
month6
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-06"
),
month7
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-07"
),
month8
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-08"
),
month9
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-09"
),
month10
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-10"
),
month11
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-11"
),
month12
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-12"
)
};
viewDatas
.
Add
(
itemData
);
}
}
total
=
allDatas
.
Count
();
...
...
@@ -402,7 +406,7 @@ namespace AutoTurnOver.DB
var
data
=
list
.
FirstOrDefault
(
s
=>
date_str
==
s
.
date_str
);
if
(
data
==
null
)
{
return
null
;
return
0
;
}
else
{
...
...
@@ -415,7 +419,7 @@ namespace AutoTurnOver.DB
{
var
yearBdate
=
DateTime
.
Parse
(
DateTime
.
Now
.
ToString
(
"yyyy-01-01 00:00:00"
));
var
yearEdate
=
DateTime
.
Parse
(
DateTime
.
Now
.
ToString
(
"yyyy-12-31 23:59:59"
));
var
sql
=
" select * from dc_ana_deviation as t1 where t1.bdate<=@yearEdate and t1.edate>=@yearBdate "
;
var
sql
=
" select * from dc_ana_deviation as t1 where
t1.bdate<=@yearEdate and t1.edate>=@yearBdate "
;
DynamicParameters
parameters
=
new
DynamicParameters
();
parameters
.
Add
(
"yearBdate"
,
yearBdate
);
parameters
.
Add
(
"yearEdate"
,
yearEdate
);
...
...
@@ -429,7 +433,7 @@ namespace AutoTurnOver.DB
sql
+=
" and t1.sku=@sku "
;
parameters
.
Add
(
"sku"
,
search_data
.
sku
);
}
return
_connection
.
Query
<
dc_ana_deviation
>(
sql
,
parameters
,
commandTimeout
:
0
).
ToList
();
return
MyMySqlConnection
.
_connection_read_only
.
Query
<
dc_ana_deviation
>(
sql
,
parameters
,
commandTimeout
:
0
).
ToList
();
}
public
async
static
Task
<
decimal
>
GetOmsSale
(
DateTime
btime
,
DateTime
etime
,
List
<
dc_ana_deviation_sku
>
anaSkus
)
...
...
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