Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-smart
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
platform
hp-smart
Commits
b0cd033b
Commit
b0cd033b
authored
Oct 18, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-10-1生产驾驶舱接口调整
parent
f21a06cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
12 deletions
+47
-12
ServiceHPBI003.java
.../java/com/baosight/hpjx/hp/bi/service/ServiceHPBI003.java
+36
-2
HPBI003.xml
src/main/java/com/baosight/hpjx/hp/bi/sql/HPBI003.xml
+11
-10
No files found.
src/main/java/com/baosight/hpjx/hp/bi/service/ServiceHPBI003.java
View file @
b0cd033b
...
...
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.baosight.eplat.be.dz.constants.BEDZConstants
;
import
com.baosight.hpjx.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hpjx.common.InventTypeEnum
;
import
com.baosight.hpjx.core.dao.DaoBase
;
import
com.baosight.hpjx.core.security.UserSessionUtils
;
import
com.baosight.hpjx.util.DateUtils
;
import
com.baosight.hpjx.util.EiInfoUtils
;
...
...
@@ -17,6 +18,7 @@ import com.baosight.iplat4j.core.service.impl.ServiceBase;
import
com.baosight.iplat4j.core.service.soa.XServiceManager
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
static
com
.
baosight
.
eplat
.
be
.
dz
.
service
.
ServiceBEDZ04
.
PARAMS_KEY_STR
;
...
...
@@ -259,7 +261,23 @@ public class ServiceHPBI003 extends ServiceBase {
if
(
params
.
containsKey
(
"date"
)){
params
.
put
(
"date"
,
DateUtils
.
formatShort
(
params
.
get
(
"date"
)));
}
return
super
.
query
(
inInfo
,
"HPBI003.queryGX"
);
List
<
Map
>
listMap
=
DaoBase
.
getInstance
().
query
(
"HPBI003.queryGX"
,
params
,
0
,
100
);
Map
<
Object
,
List
<
Map
>>
mapList
=
listMap
.
stream
().
collect
(
Collectors
.
groupingBy
(
map
->
map
.
get
(
"groupName"
)));
List
<
Map
>
result
=
new
ArrayList
<>();
for
(
Object
key:
mapList
.
keySet
())
{
Map
<
Object
,
Object
>
map
=
new
HashMap
<>();
List
<
Map
>
list1
=
new
ArrayList
<>();
for
(
Map
map1:
mapList
.
get
(
key
))
{
Map
<
String
,
Object
>
map2
=
new
HashMap
<>();
map2
.
put
(
"series"
,
map1
.
get
(
"series"
));
map2
.
put
(
"wt"
,
map1
.
get
(
"wt"
));
list1
.
add
(
map2
);
}
map
.
put
(
key
,
list1
);
result
.
add
(
map
);
}
inInfo
.
set
(
"result"
,
result
);
return
inInfo
;
}
/**
...
...
@@ -298,7 +316,23 @@ public class ServiceHPBI003 extends ServiceBase {
if
(
params
.
containsKey
(
"date"
)){
params
.
put
(
"date"
,
DateUtils
.
formatShort
(
params
.
get
(
"date"
)));
}
return
super
.
query
(
inInfo
,
"HPBI003.queryDayWts"
);
List
<
Map
>
result
=
new
ArrayList
<>();
List
<
Map
>
listMap
=
DaoBase
.
getInstance
().
query
(
"HPBI003.queryDayWts"
,
params
,
0
,
100
);
Map
<
Object
,
Map
<
Object
,
List
<
Map
>>>
mapList
=
listMap
.
stream
().
collect
(
Collectors
.
groupingBy
(
map
->
map
.
get
(
"date"
),
Collectors
.
groupingBy
(
map
->
map
.
get
(
"series"
))));
for
(
Object
key:
mapList
.
keySet
())
{
Map
<
Object
,
Object
>
map
=
new
HashMap
<>();
List
<
Map
>
list1
=
new
ArrayList
<>();
Map
<
Object
,
List
<
Map
>>
listMap1
=
mapList
.
get
(
key
);
for
(
Object
key1:
listMap1
.
keySet
())
{
Map
<
Object
,
Object
>
map2
=
new
HashMap
<>();
map2
.
put
(
key1
,
listMap1
.
get
(
key1
).
stream
().
map
(
m
->
m
.
get
(
"wt"
)).
collect
(
Collectors
.
toList
()));
list1
.
add
(
map2
);
}
map
.
put
(
key
,
list1
);
result
.
add
(
map
);
}
inInfo
.
set
(
"result"
,
result
);
return
inInfo
;
}
}
src/main/java/com/baosight/hpjx/hp/bi/sql/HPBI003.xml
View file @
b0cd033b
...
...
@@ -243,7 +243,7 @@
select
SERIES as "series",
X as "groupName",
VALUE
as "wt"
ROUND(VALUE, 2)
as "wt"
from
(
select
...
...
@@ -483,12 +483,12 @@
select
SERIES as "series",
X as "date",
VALUE
as "wt"
ROUND(VALUE, 2)
as "wt"
from
(
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 6 day), '-', ''), 5, 2), '
/
', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 6 day), '-', ''), 7, 2)) as X,
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 6 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 6 day), '-', ''), 7, 2)) as X,
sum(ifnull(WEIGHT, 0)+ ifnull(WEIGHT_JH, 0))/ 2 as VALUE,
replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 6 day), '-', '') as date,
case
...
...
@@ -528,7 +528,7 @@
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 5 day), '-', ''), 5, 2), '
/
', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 5 day), '-', ''), 7, 2)) as X,
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 5 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 5 day), '-', ''), 7, 2)) as X,
sum(ifnull(WEIGHT, 0)+ ifnull(WEIGHT_JH, 0))/ 2 as VALUE ,
replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 5 day), '-', '') as date,
case
...
...
@@ -568,7 +568,7 @@
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 4 day), '-', ''), 5, 2), '
/
', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 4 day), '-', ''), 7, 2)) as X,
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 4 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 4 day), '-', ''), 7, 2)) as X,
sum(ifnull(WEIGHT, 0)+ ifnull(WEIGHT_JH, 0))/ 2 as VALUE ,
replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 4 day), '-', '') as date,
case
...
...
@@ -608,7 +608,7 @@
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 3 day), '-', ''), 5, 2), '
/
', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 3 day), '-', ''), 7, 2)) as X,
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 3 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 3 day), '-', ''), 7, 2)) as X,
sum(ifnull(WEIGHT, 0)+ ifnull(WEIGHT_JH, 0))/ 2 as VALUE ,
replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 3 day), '-', '') as date,
case
...
...
@@ -648,7 +648,7 @@
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 2 day), '-', ''), 5, 2), '
/
', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 2 day), '-', ''), 7, 2)) as X,
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 2 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 2 day), '-', ''), 7, 2)) as X,
sum(ifnull(WEIGHT, 0)+ ifnull(WEIGHT_JH, 0))/ 2 as VALUE ,
replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 2 day), '-', '') as date,
case
...
...
@@ -688,7 +688,7 @@
union all
select
a.GROUP_NAME as SERIES,
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 1 day), '-', ''), 5, 2), '
/
', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 1 day), '-', ''), 7, 2)) as X,
concat(substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 1 day), '-', ''), 5, 2), '', substring(replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 1 day), '-', ''), 7, 2)) as X,
sum(ifnull(WEIGHT, 0)+ ifnull(WEIGHT_JH, 0))/ 2 as VALUE ,
replace(date_sub(str_to_date(#date#, '%Y%m%d'), interval 1 day), '-', '') as date,
case
...
...
@@ -728,7 +728,7 @@
union all
select
a.GROUP_NAME as SERIES,
concat(substring(#date#, 5, 2), '
/
', substring(#date#, 7, 2)) as X,
concat(substring(#date#, 5, 2), '', substring(#date#, 7, 2)) as X,
sum(ifnull(WEIGHT, 0)+ ifnull(WEIGHT_JH, 0))/ 2 as VALUE ,
#date# as date,
case
...
...
@@ -767,6 +767,6 @@
a.GROUP_NAME
) a
order by
date, SORT asc
date
asc
, SORT asc
</select>
</sqlMap>
\ No newline at end of file
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