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
c9b6d65e
Commit
c9b6d65e
authored
Feb 14, 2023
by
lizefeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
9a0fffe8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
31 deletions
+34
-31
dc_ana_deviation_dao.cs
AutoTurnOver.DB/dc_ana_deviation_dao.cs
+22
-19
deviation_search_dto.cs
AutoTurnOver.Models/deviation_search_dto.cs
+12
-12
No files found.
AutoTurnOver.DB/dc_ana_deviation_dao.cs
View file @
c9b6d65e
...
...
@@ -375,18 +375,18 @@ namespace AutoTurnOver.DB
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"
)
month1
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-01"
,
item
.
Key
.
field
),
month2
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-02"
,
item
.
Key
.
field
),
month3
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-03"
,
item
.
Key
.
field
),
month4
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-04"
,
item
.
Key
.
field
),
month5
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-05"
,
item
.
Key
.
field
),
month6
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-06"
,
item
.
Key
.
field
),
month7
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-07"
,
item
.
Key
.
field
),
month8
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-08"
,
item
.
Key
.
field
),
month9
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-09"
,
item
.
Key
.
field
),
month10
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-10"
,
item
.
Key
.
field
),
month11
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-11"
,
item
.
Key
.
field
),
month12
=
GetVal
(
item
.
AsQueryable
(),
$"
{
year
}
-12"
,
item
.
Key
.
field
)
};
viewDatas
.
Add
(
itemData
);
...
...
@@ -399,17 +399,20 @@ namespace AutoTurnOver.DB
return
viewDatas
;
}
public
static
decimal
?
GetVal
(
IQueryable
<
dc_ana_deviation
>
list
,
string
date_str
)
public
static
string
GetVal
(
IQueryable
<
dc_ana_deviation
>
list
,
string
date_str
,
string
field
)
{
string
val
=
""
;
var
data
=
list
.
FirstOrDefault
(
s
=>
date_str
==
s
.
date_str
);
if
(
data
=
=
null
)
if
(
data
!
=
null
)
{
return
0
;
}
else
{
return
data
.
val
;
val
=
Math
.
Round
(
data
.
val
,
1
).
ToString
()
;
if
(
field
.
Contains
(
"比例"
))
{
return
data
.
val
.
ToString
(
"p"
);
}
}
return
val
;
}
...
...
AutoTurnOver.Models/deviation_search_dto.cs
View file @
c9b6d65e
...
...
@@ -16,17 +16,17 @@ namespace AutoTurnOver.Models
public
string
project
{
get
;
set
;
}
public
string
field
{
get
;
set
;
}
public
string
field_type
{
get
;
set
;
}
public
decimal
?
month1
{
get
;
set
;
}
public
decimal
?
month2
{
get
;
set
;
}
public
decimal
?
month3
{
get
;
set
;
}
public
decimal
?
month4
{
get
;
set
;
}
public
decimal
?
month5
{
get
;
set
;
}
public
decimal
?
month6
{
get
;
set
;
}
public
decimal
?
month7
{
get
;
set
;
}
public
decimal
?
month8
{
get
;
set
;
}
public
decimal
?
month9
{
get
;
set
;
}
public
decimal
?
month10
{
get
;
set
;
}
public
decimal
?
month11
{
get
;
set
;
}
public
decimal
?
month12
{
get
;
set
;
}
public
string
month1
{
get
;
set
;
}
public
string
month2
{
get
;
set
;
}
public
string
month3
{
get
;
set
;
}
public
string
month4
{
get
;
set
;
}
public
string
month5
{
get
;
set
;
}
public
string
month6
{
get
;
set
;
}
public
string
month7
{
get
;
set
;
}
public
string
month8
{
get
;
set
;
}
public
string
month9
{
get
;
set
;
}
public
string
month10
{
get
;
set
;
}
public
string
month11
{
get
;
set
;
}
public
string
month12
{
get
;
set
;
}
}
}
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