Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bill-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
bill-platform
Commits
a9ccd7d4
Commit
a9ccd7d4
authored
Jun 27, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改统计报表
parent
53b56682
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
0 deletions
+84
-0
bill-manager/src/main/java/com/mortals/xhx/common/code/GroupListEnum.java
.../main/java/com/mortals/xhx/common/code/GroupListEnum.java
+61
-0
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
...m/mortals/xhx/module/pj/web/PjEvaluateStatController.java
+23
-0
No files found.
bill-manager/src/main/java/com/mortals/xhx/common/code/GroupListEnum.java
0 → 100644
View file @
a9ccd7d4
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
public
enum
GroupListEnum
{
年
(
"year"
,
"年"
),
月
(
"month"
,
"月"
),
日
(
"day"
,
"日"
);
private
String
value
;
private
String
desc
;
GroupListEnum
(
String
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
String
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
GroupListEnum
getByValue
(
String
value
)
{
for
(
GroupListEnum
pjOptionEnum
:
GroupListEnum
.
values
())
{
if
(
pjOptionEnum
.
getValue
()
==
value
)
{
return
pjOptionEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
String
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
GroupListEnum
item
:
GroupListEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
String
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
bill-manager/src/main/java/com/mortals/xhx/module/pj/web/PjEvaluateStatController.java
View file @
a9ccd7d4
...
...
@@ -11,6 +11,7 @@ import com.mortals.xhx.common.pdu.RespData;
import
com.mortals.xhx.common.pdu.site.SitePdu
;
import
com.mortals.xhx.feign.site.ISiteFeign
;
import
com.mortals.xhx.module.pj.model.PjEvaluateQuery
;
import
com.mortals.xhx.module.pj.model.PjEvaluateStatQuery
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
...
...
@@ -26,6 +27,7 @@ import com.mortals.xhx.module.pj.service.PjEvaluateStatService;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.mortals.xhx.common.code.*
;
...
...
@@ -50,6 +52,24 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"pjOption"
,
PjOptionEnum
.
getEnumMap
());
this
.
addDict
(
model
,
"pjOptionList"
,
PjOptionEnum
.
getEnumMap
());
//通过站点 查询存在的部门 大厅等
Object
siteId
=
model
.
get
(
"siteId"
);
if
(!
ObjectUtils
.
isEmpty
(
siteId
)){
PjEvaluateStatQuery
pjEvaluateStatQuery
=
new
PjEvaluateStatQuery
();
pjEvaluateStatQuery
.
setSiteId
((
Long
)
siteId
);
List
<
PjEvaluateStatEntity
>
pjEvaluateStatEntities
=
this
.
service
.
find
(
pjEvaluateStatQuery
,
context
);
Map
<
String
,
String
>
sectionNameMap
=
pjEvaluateStatEntities
.
stream
().
collect
(
Collectors
.
toMap
(
PjEvaluateStatEntity:
:
getSectionName
,
PjEvaluateStatEntity:
:
getSectionName
,
(
k1
,
k2
)
->
k2
));
Map
<
String
,
String
>
hallNameMap
=
pjEvaluateStatEntities
.
stream
().
collect
(
Collectors
.
toMap
(
PjEvaluateStatEntity:
:
getHallName
,
PjEvaluateStatEntity:
:
getHallName
,
(
k1
,
k2
)
->
k2
));
Map
<
String
,
String
>
windowFromnumMap
=
pjEvaluateStatEntities
.
stream
().
collect
(
Collectors
.
toMap
(
PjEvaluateStatEntity:
:
getWindowFromnum
,
PjEvaluateStatEntity:
:
getWindowFromnum
,
(
k1
,
k2
)
->
k2
));
this
.
addDict
(
model
,
"sectionNameList"
,
sectionNameMap
);
this
.
addDict
(
model
,
"hallNameList"
,
hallNameMap
);
this
.
addDict
(
model
,
"windowFromnumList"
,
windowFromnumMap
);
this
.
addDict
(
model
,
"groupList"
,
GroupListEnum
.
getEnumMap
());
}
super
.
init
(
model
,
context
);
}
...
...
@@ -60,6 +80,9 @@ public class PjEvaluateStatController extends BaseCRUDJsonBodyMappingController<
if
(
ObjectUtils
.
isEmpty
(
query
.
getSectionName
()))
query
.
setSectionName
(
""
);
if
(
ObjectUtils
.
isEmpty
(
query
.
getPjOption
()))
query
.
setPjOption
(
""
);
if
(
ObjectUtils
.
isEmpty
(
query
.
getWindowFromnum
()))
query
.
setWindowFromnum
(
""
);
model
.
put
(
"siteId"
,
query
.
getSiteId
());
}
@PostMapping
(
value
=
"/stat"
)
...
...
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