Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
38fb886e
Commit
38fb886e
authored
Jul 26, 2024
by
guojx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-2024-07-cloud' into 'developer'
企微概率添加占比 See merge request
!2064
parents
6ae7da92
5dab8895
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
WechatWorkOverviewVO.java
...haoban/manage/web/vo/wechatwork/WechatWorkOverviewVO.java
+36
-0
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/wechatwork/WechatWorkOverviewVO.java
View file @
38fb886e
...
@@ -3,6 +3,8 @@ package com.gic.haoban.manage.web.vo.wechatwork;
...
@@ -3,6 +3,8 @@ package com.gic.haoban.manage.web.vo.wechatwork;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Objects
;
/**
/**
* @Author guojx
* @Author guojx
...
@@ -25,4 +27,38 @@ public class WechatWorkOverviewVO implements Serializable {
...
@@ -25,4 +27,38 @@ public class WechatWorkOverviewVO implements Serializable {
* 未注册微信好友数
* 未注册微信好友数
*/
*/
private
Long
entwchFdNumNonmbr
;
private
Long
entwchFdNumNonmbr
;
/**
* 已注册微信好友数占比
*/
private
Double
entwchFdNumMbrRate
;
/**
* 未注册微信好友数占比
*/
private
Double
entwchFdNumNonmbrRate
;
public
Double
getEntwchFdNumMbrRate
()
{
return
rate
(
getEntwchFdNumMbr
(),
getEntwchFdNumTotal
(),
2
);
}
public
Double
getEntwchFdNumNonmbrRate
()
{
return
rate
(
getEntwchFdNumNonmbr
(),
getEntwchFdNumTotal
(),
2
);
}
/**
* 百分比计算,保留两位小数
* @param divisor
* @param dividend
* @param degree
* @return
*/
public
static
Double
rate
(
Long
divisor
,
Long
dividend
,
int
degree
){
if
(
Objects
.
isNull
(
divisor
)
||
Objects
.
isNull
(
dividend
)
||
dividend
==
0
){
return
0.00
;
}
//数字会丢失精度,先转字符串,再转bigDecimal
BigDecimal
divisor1
=
new
BigDecimal
(
divisor
+
""
);
BigDecimal
dividend1
=
new
BigDecimal
(
dividend
+
""
);
return
divisor1
.
divide
(
dividend1
,
degree
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
}
}
}
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