Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_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
赵啸非
smart_gov_platform
Commits
0a00901d
Commit
0a00901d
authored
Sep 07, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小数格式化bug修改
parent
c4d7cd11
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
portal-manager/src/main/java/com/mortals/xhx/module/page/service/impl/PageAccessServiceImpl.java
...s/xhx/module/page/service/impl/PageAccessServiceImpl.java
+7
-8
portal-manager/src/main/java/com/mortals/xhx/module/page/service/impl/PageEventServiceImpl.java
...ls/xhx/module/page/service/impl/PageEventServiceImpl.java
+4
-4
No files found.
portal-manager/src/main/java/com/mortals/xhx/module/page/service/impl/PageAccessServiceImpl.java
View file @
0a00901d
package
com.mortals.xhx.module.page.service.impl
;
package
com.mortals.xhx.module.page.service.impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.util.DateUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.module.page.model.pdu.BuryPointPdu
;
import
com.mortals.xhx.module.page.model.pdu.PageCensusPdu
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.module.page.dao.PageAccessDao
;
import
com.mortals.xhx.module.page.dao.PageAccessDao
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
com.mortals.xhx.module.page.model.PageAccessEntity
;
import
com.mortals.xhx.module.page.model.pdu.BuryPointPdu
;
import
com.mortals.xhx.module.page.model.pdu.PageCensusPdu
;
import
com.mortals.xhx.module.page.service.PageAccessService
;
import
com.mortals.xhx.module.page.service.PageAccessService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
java.text.DecimalFormat
;
import
java.text.DecimalFormat
;
import
java.text.ParseException
;
import
java.text.ParseException
;
...
@@ -122,7 +121,7 @@ public class PageAccessServiceImpl extends AbstractCRUDServiceImpl<PageAccessDao
...
@@ -122,7 +121,7 @@ public class PageAccessServiceImpl extends AbstractCRUDServiceImpl<PageAccessDao
if
(
CollectionUtils
.
isNotEmpty
(
todayList
)){
if
(
CollectionUtils
.
isNotEmpty
(
todayList
)){
for
(
PageAccessEntity
item:
todayList
){
for
(
PageAccessEntity
item:
todayList
){
if
(
item
!=
null
)
{
if
(
item
!=
null
)
{
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
".00"
);
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"
#0
.00"
);
String
key
=
item
.
getTimeStr
()
+
"_"
+
item
.
getFirstCode
()
+
"_"
+
item
.
getSecondCode
()
+
"_"
+
item
.
getThirdCode
()
+
"_"
+
item
.
getFourthCode
();
String
key
=
item
.
getTimeStr
()
+
"_"
+
item
.
getFirstCode
()
+
"_"
+
item
.
getSecondCode
()
+
"_"
+
item
.
getThirdCode
()
+
"_"
+
item
.
getFourthCode
();
if
(
mp
.
containsKey
(
key
))
{
if
(
mp
.
containsKey
(
key
))
{
PageAccessEntity
last
=
mp
.
get
(
key
);
PageAccessEntity
last
=
mp
.
get
(
key
);
...
...
portal-manager/src/main/java/com/mortals/xhx/module/page/service/impl/PageEventServiceImpl.java
View file @
0a00901d
...
@@ -127,7 +127,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
...
@@ -127,7 +127,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
float
a
=
(
float
)
vo
.
getValue
();
float
a
=
(
float
)
vo
.
getValue
();
float
b
=
(
float
)
clickSum
;
float
b
=
(
float
)
clickSum
;
float
p
=
a
/
b
;
float
p
=
a
/
b
;
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
".00%"
);
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"
#0
.00%"
);
String
s
=
decimalFormat
.
format
(
p
);
String
s
=
decimalFormat
.
format
(
p
);
vo
.
setProportion
(
s
);
vo
.
setProportion
(
s
);
}
}
...
@@ -173,7 +173,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
...
@@ -173,7 +173,7 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
float
a
=
(
float
)
clickSum
;
float
a
=
(
float
)
clickSum
;
float
b
=
(
float
)
trendCensusVos
.
size
();
float
b
=
(
float
)
trendCensusVos
.
size
();
float
p
=
a
/
b
;
float
p
=
a
/
b
;
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
".00"
);
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"
#0
.00"
);
String
s
=
decimalFormat
.
format
(
p
);
String
s
=
decimalFormat
.
format
(
p
);
dayAccessAvg
=
Float
.
valueOf
(
s
);
dayAccessAvg
=
Float
.
valueOf
(
s
);
}
}
...
@@ -232,8 +232,8 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
...
@@ -232,8 +232,8 @@ public class PageEventServiceImpl extends AbstractCRUDServiceImpl<PageEventDao,
float
a
=
(
float
)
clickSum
;
float
a
=
(
float
)
clickSum
;
float
b
=
(
float
)
item
.
getAccessCount
();
float
b
=
(
float
)
item
.
getAccessCount
();
float
p
=
b
/
a
;
float
p
=
b
/
a
;
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
".00%"
);
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"
#0
.00%"
);
DecimalFormat
df
=
new
DecimalFormat
(
".00"
);
DecimalFormat
df
=
new
DecimalFormat
(
"
#0
.00"
);
String
s
=
decimalFormat
.
format
(
p
);
String
s
=
decimalFormat
.
format
(
p
);
String
s1
=
df
.
format
(
p
);
String
s1
=
df
.
format
(
p
);
item
.
setProportion
(
s
);
item
.
setProportion
(
s
);
...
...
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