Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
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
reyun
manager
Commits
2a73b1e5
Commit
2a73b1e5
authored
Jul 21, 2020
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
金额改double
parent
281bd949
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
29 additions
and
353 deletions
+29
-353
ADIAccountServiceImpl.java
src/main/java/adi/service/impl/ADIAccountServiceImpl.java
+1
-1
ContractController.java
src/main/java/common/controller/ContractController.java
+2
-2
Contract.java
src/main/java/common/model/Contract.java
+7
-7
ContractChange.java
src/main/java/common/model/ContractChange.java
+3
-3
ContractMoney.java
src/main/java/common/model/ContractMoney.java
+3
-3
ContractService.java
src/main/java/common/service/ContractService.java
+1
-3
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+6
-123
ShareIncomeServiceImpl.java
...main/java/common/service/impl/ShareIncomeServiceImpl.java
+0
-205
TkioAccountServiceImpl.java
src/main/java/tkio/service/impl/TkioAccountServiceImpl.java
+2
-2
TrackAccountServiceImpl.java
...main/java/track/service/impl/TrackAccountServiceImpl.java
+2
-2
IOAccountServiceImpl.java
src/main/java/userio/service/impl/IOAccountServiceImpl.java
+2
-2
No files found.
src/main/java/adi/service/impl/ADIAccountServiceImpl.java
View file @
2a73b1e5
...
...
@@ -263,7 +263,7 @@ public class ADIAccountServiceImpl implements ADIAccountService {
}
if
(
payMap
.
containsKey
(
aw
.
getEmail
()))
{
List
<
Contract
>
contractList
=
payMap
.
get
(
aw
.
getEmail
());
aw
.
setMoney
(
contractList
.
get
(
contractList
.
size
()
-
1
).
getPayMoney
());
//
aw.setMoney(contractList.get(contractList.size() - 1).getPayMoney());
aw
.
setContractStatus
(
contractRepository
.
findByPlatformAndEmailLimit1
(
"adi"
,
aw
.
getEmail
(),
ContractTypeEnum
.
MAIN
.
getKey
()).
getStatus
());
aw
.
setContractTime
(
contractList
.
size
());
}
else
{
...
...
src/main/java/common/controller/ContractController.java
View file @
2a73b1e5
...
...
@@ -189,7 +189,7 @@ public class ContractController {
byte
[]
content
=
new
byte
[
0
];
StringBuilder
sb
=
new
StringBuilder
();
Long
parseSum
=
0L
;
Double
parseSum
=
0
d
;
if
(
ValidateUtil
.
isValid
(
moneyList
))
{
for
(
ContractMoney
c
:
moneyList
)
{
sb
.
append
(
c
.
getDs
()).
append
(
","
)
...
...
@@ -279,7 +279,7 @@ public class ContractController {
@RequestMapping
(
value
=
"find/rebat"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ResultModel
rebat
(
@CurrentAccount
User
loginAccount
,
@RequestParam
String
product
,
@RequestParam
Integer
level
,
@RequestParam
Long
money
)
{
public
ResultModel
rebat
(
@CurrentAccount
User
loginAccount
,
@RequestParam
String
product
,
@RequestParam
Integer
level
,
@RequestParam
Double
money
)
{
return
ResultModel
.
OK
(
service
.
getRebat
(
product
,
level
,
money
));
}
...
...
src/main/java/common/model/Contract.java
View file @
2a73b1e5
...
...
@@ -28,7 +28,7 @@ public class Contract {
//套餐
private
Long
priceLevel
;
private
String
priceLevelName
;
private
Long
money
;
//合同金额
private
Double
money
;
//合同金额
private
Double
rebate
;
//
private
Long
sale
;
...
...
@@ -37,7 +37,7 @@ public class Contract {
private
String
status
;
// 作废 先回款待录入
private
String
saleName
;
private
Long
payMoney
;
// 回款金额
private
Double
payMoney
;
// 回款金额
private
Integer
backStatus
;
// 1 未回款 2 部分回款 3 已回款
private
Long
invoice
;
// 开票次数
private
BigDecimal
invoiceMoney
;
// 发票金额
...
...
@@ -193,11 +193,11 @@ public class Contract {
this
.
priceLevel
=
priceLevel
;
}
public
Long
getMoney
()
{
public
Double
getMoney
()
{
return
money
;
}
public
void
setMoney
(
Long
money
)
{
public
void
setMoney
(
Double
money
)
{
this
.
money
=
money
;
}
...
...
@@ -273,11 +273,11 @@ public class Contract {
this
.
status
=
status
;
}
public
Long
getPayMoney
()
{
public
Double
getPayMoney
()
{
return
payMoney
;
}
public
void
setPayMoney
(
Long
payMoney
)
{
public
void
setPayMoney
(
Double
payMoney
)
{
this
.
payMoney
=
payMoney
;
}
...
...
@@ -346,6 +346,7 @@ public class Contract {
public
void
setSaleName
(
String
saleName
)
{
this
.
saleName
=
saleName
;
}
@Transient
public
String
getPriceLevelName
()
{
return
priceLevelName
;
...
...
@@ -555,7 +556,6 @@ public class Contract {
}
public
Integer
getShareSign
()
{
return
shareSign
;
}
...
...
src/main/java/common/model/ContractChange.java
View file @
2a73b1e5
...
...
@@ -18,7 +18,7 @@ public class ContractChange {
private
String
content
;
private
String
marke
;
//备注
private
Long
level
;
private
Long
money
;
private
Double
money
;
private
Long
user
;
private
String
createName
;
private
String
platform
;
...
...
@@ -139,11 +139,11 @@ public class ContractChange {
this
.
level
=
level
;
}
public
Long
getMoney
()
{
public
Double
getMoney
()
{
return
money
;
}
public
void
setMoney
(
Long
money
)
{
public
void
setMoney
(
Double
money
)
{
this
.
money
=
money
;
}
...
...
src/main/java/common/model/ContractMoney.java
View file @
2a73b1e5
...
...
@@ -17,7 +17,7 @@ public class ContractMoney {
private
String
company
;
private
String
ds
;
private
String
type
;
private
Long
money
;
private
Double
money
;
private
Long
user
;
private
String
createName
;
private
String
platform
;
...
...
@@ -66,11 +66,11 @@ public class ContractMoney {
this
.
type
=
type
;
}
public
Long
getMoney
()
{
public
Double
getMoney
()
{
return
money
;
}
public
void
setMoney
(
Long
money
)
{
public
void
setMoney
(
Double
money
)
{
this
.
money
=
money
;
}
...
...
src/main/java/common/service/ContractService.java
View file @
2a73b1e5
...
...
@@ -24,7 +24,7 @@ public interface ContractService {
//增值服务
List
<
ContractIncrement
>
findIncrement
();
Double
getRebat
(
String
product
,
Integer
level
,
Long
money
);
Double
getRebat
(
String
product
,
Integer
level
,
Double
money
);
List
<
Sales
>
getSales
();
...
...
@@ -77,5 +77,4 @@ public interface ContractService {
ResultModel
uploadBatchInfo
(
MultipartFile
file
,
String
platform
);
List
<
Contract
>
shareIncomeList
(
User
loginAccount
,
String
startDate
,
String
endDate
,
String
platform
,
String
bodyCode
,
String
serchName
);
}
\ No newline at end of file
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
2a73b1e5
...
...
@@ -419,7 +419,7 @@ public class ContractServiceImpl implements ContractService {
}
@Override
public
Double
getRebat
(
String
product
,
Integer
level
,
Long
money
)
{
public
Double
getRebat
(
String
product
,
Integer
level
,
Double
money
)
{
Double
rebat
=
1
d
;
try
{
PriceLevelMoney
levelMoney
=
priceLevelMoneyRepository
.
getOne
(
product
,
level
);
...
...
@@ -479,7 +479,7 @@ public class ContractServiceImpl implements ContractService {
extraFlow
=
0L
;
}
if
(
resource
.
getPayMoney
()
==
null
)
{
resource
.
setPayMoney
(
0
L
);
resource
.
setPayMoney
(
0
d
);
}
resource
.
setDs
(
DateUtil
.
getBeforeDays
(
0
));
...
...
@@ -642,7 +642,7 @@ public class ContractServiceImpl implements ContractService {
resource
.
setContractCode
(
contractCode
);
}
resource
.
setPayMoney
(
0
L
);
resource
.
setPayMoney
(
0
d
);
resource
.
setInvoice
(
0L
);
Long
extraFlow
=
resource
.
getExtraFlow
();
resource
.
setDs
(
DateUtil
.
getBeforeDays
(
0
));
...
...
@@ -1057,7 +1057,7 @@ public class ContractServiceImpl implements ContractService {
if
(
resource
.
getPayMoney
()
!=
null
)
{
if
(
resource
.
getMoney
()
==
null
)
{
resource
.
setMoney
(
0
L
);
resource
.
setMoney
(
0
d
);
}
if
(
ContractStatusEnum
.
MONEY_BACK_FIRST
.
getKey
().
equals
(
resource
.
getStatus
()))
{
...
...
@@ -1105,7 +1105,7 @@ public class ContractServiceImpl implements ContractService {
}
if
(
resource
.
getPayMoney
()
==
null
)
{
resource
.
setPayMoney
(
0
L
);
resource
.
setPayMoney
(
0
d
);
}
if
(
resource
.
getInvoiceMoney
()
==
null
)
{
...
...
@@ -1150,7 +1150,7 @@ public class ContractServiceImpl implements ContractService {
}
else
if
(
money
.
getType
().
equals
(
"pay"
))
{
money
.
setMoney
(
contract
.
getMoney
());
}
else
{
money
.
setMoney
(
contract
.
getInvoiceMoney
().
long
Value
());
money
.
setMoney
(
contract
.
getInvoiceMoney
().
double
Value
());
}
...
...
@@ -2430,124 +2430,7 @@ public class ContractServiceImpl implements ContractService {
return
true
;
}
@Deprecated
@Override
public
List
<
Contract
>
shareIncomeList
(
User
loginAccount
,
String
startDate
,
String
endDate
,
String
platform
,
String
bodyCode
,
String
serchName
)
{
List
<
Contract
>
contracts
=
new
ArrayList
<>();
if
(
"all"
.
equals
(
bodyCode
))
{
bodyCode
=
null
;
}
List
<
String
>
financeBodies
=
null
;
if
(
RoleEnum
.
FINANCE
.
getKey
().
equals
(
loginAccount
.
getRole
()))
{
Auth
auth
=
authRepository
.
findByUser
(
loginAccount
.
getId
());
financeBodies
=
JSONArray
.
fromObject
(
auth
.
getAuthExtend
());
}
String
endCreate
=
new
DateTime
(
endDate
).
plusDays
(
1
).
toString
(
"yyyy-MM-dd"
);
if
(!
StringUtils
.
isEmpty
(
bodyCode
)
&&
!
StringUtils
.
isEmpty
(
serchName
))
{
if
(
financeBodies
!=
null
&&
!
financeBodies
.
contains
(
bodyCode
))
{
//沒有权限查看
return
contracts
;
}
else
{
contracts
=
contractRepository
.
findShareContranctByDate1
(
startDate
,
endDate
,
platform
,
bodyCode
,
serchName
);
}
}
else
if
(!
StringUtils
.
isEmpty
(
bodyCode
))
{
if
(
financeBodies
!=
null
&&
!
financeBodies
.
contains
(
bodyCode
))
{
//沒有权限查看
return
contracts
;
}
else
{
contracts
=
contractRepository
.
findShareContranctByDate2
(
startDate
,
endDate
,
platform
,
bodyCode
);
}
}
else
if
(!
StringUtils
.
isEmpty
(
serchName
))
{
if
(
financeBodies
!=
null
)
{
contracts
=
contractRepository
.
findShareContranctByDateSercheFinace
(
startDate
,
endDate
,
platform
,
serchName
,
financeBodies
);
}
else
{
contracts
=
contractRepository
.
findShareContranctByDateSerche
(
startDate
,
endDate
,
platform
,
serchName
);
}
}
else
{
if
(
financeBodies
!=
null
)
{
contracts
=
contractRepository
.
findShareContranctByDateFinace
(
startDate
,
endDate
,
platform
,
financeBodies
);
}
else
{
contracts
=
contractRepository
.
findShareContranctByDate3
(
startDate
,
endDate
,
platform
);
}
}
List
<
ContractBody
>
bodies
=
contractBodyRepository
.
findAll
();
Map
<
String
,
String
>
bodiesNameMap
=
bodies
.
stream
().
collect
(
Collectors
.
toMap
(
ContractBody:
:
getCode
,
ContractBody:
:
getName
,
(
v1
,
v2
)
->
v1
));
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"###,###.00"
);
contracts
.
forEach
(
v
->
{
v
.
setMyBodyName
(
bodiesNameMap
.
get
(
v
.
getMyBodyCode
()));
//不含稅收入
//以下结果统一 *100
// Long excludTax = v.getMoney() * 6 / 100;
Long
excludTax
=
v
.
getMoney
()
*
100
-
(
long
)
(
v
.
getMoney
()
*
100
*
0.06
);
v
.
setIncomeExcludingTax
(
excludTax
);
DateTime
formStart
=
new
DateTime
(
startDate
);
DateTime
formEnd
=
new
DateTime
(
endDate
);
DateTime
contractStart
=
new
DateTime
(
v
.
getStartDate
());
DateTime
contractEnd
=
new
DateTime
(
v
.
getEndDate
());
// 时间范围是否包含合同结束日期
boolean
containEnd
=
formEnd
.
compareTo
(
contractEnd
)
>=
0
;
// 时间范围是否包含合同结束开始日期
boolean
containStart
=
formStart
.
compareTo
(
contractStart
)
<=
0
;
//所选结束时间包含合同结束时间 取合同结束时间 反之 取所选结束时间
DateTime
usedEnd
=
containEnd
?
contractEnd
:
formEnd
;
//所选开始时间包含合同开始时间 则取合同开始时间 反之 取所选开始时间
DateTime
usedStart
=
containStart
?
contractStart
:
formStart
;
v
.
setIntervalUseDays
(
Days
.
daysBetween
(
contractStart
,
usedEnd
).
getDays
()
+
1
);
//区间使用天数
//合同总天数
int
contracAllDays
=
Days
.
daysBetween
(
contractStart
,
contractEnd
).
getDays
()
+
1
;
// 处理后的选择范围天数
int
contractFormRange
=
Days
.
daysBetween
(
usedStart
,
usedEnd
).
getDays
()
+
1
;
//区间分摊收入
//以下结果统一 *100
Long
intervalIncome
=
0L
;
if
(
containEnd
)
{
//时间范围合同结束时间时 分两部分计算
//第一部分
double
valuePart1
=
v
.
getIncomeExcludingTax
()
*
1.0
/
100
/
contracAllDays
*
(
contractFormRange
-
1
);
//此处 除100 计算完成再扩大100倍
double
valuePart2
=
v
.
getIncomeExcludingTax
()
*
1.0
/
100
-
((
v
.
getIncomeExcludingTax
()
*
1.0
/
100
/
contracAllDays
*
(
contracAllDays
-
1
)));
intervalIncome
=
new
BigDecimal
(
valuePart1
+
valuePart2
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
.
multiply
(
new
BigDecimal
(
100L
)).
longValue
();
v
.
setIntervaIncomeShare
(
intervalIncome
);
}
else
{
intervalIncome
=
(
new
BigDecimal
(
v
.
getIncomeExcludingTax
()
*
1.0
/
100
/
contracAllDays
*
contractFormRange
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
)
.
multiply
(
new
BigDecimal
(
100L
))).
longValue
();
v
.
setIntervaIncomeShare
(
intervalIncome
);
}
if
(
v
.
getAdjustmentFund
()
==
null
)
{
v
.
setAdjustmentFund
(
0L
);
}
//分摊总收入
v
.
setIncomeShareAll
(
intervalIncome
+
v
.
getAdjustmentFund
());
});
return
contracts
;
}
public
static
void
main
(
String
[]
args
)
{
// String dateStr1 = "2019-04-30";
...
...
src/main/java/common/service/impl/ShareIncomeServiceImpl.java
View file @
2a73b1e5
This diff is collapsed.
Click to expand it.
src/main/java/tkio/service/impl/TkioAccountServiceImpl.java
View file @
2a73b1e5
...
...
@@ -209,7 +209,7 @@ public class TkioAccountServiceImpl implements TkioAccountService {
}
if
(
payMap
.
containsKey
(
aw
.
getEmail
())){
List
<
Contract
>
contractList
=
payMap
.
get
(
aw
.
getEmail
());
aw
.
setMoney
(
contractList
.
get
(
contractList
.
size
()
-
1
).
getPayMoney
());
//
aw.setMoney(contractList.get(contractList.size() - 1 ).getPayMoney());
aw
.
setContractStatus
(
contractRepository
.
findByPlatformAndEmailLimit1
(
"tkio"
,
aw
.
getEmail
(),
ContractTypeEnum
.
MAIN
.
getKey
()).
getStatus
());
aw
.
setContractTime
(
contractList
.
size
());
}
else
{
...
...
@@ -274,7 +274,7 @@ public class TkioAccountServiceImpl implements TkioAccountService {
}
List
<
Contract
>
contractList
=
contractRepository
.
findByPlatformAndEmail
(
"tkio"
,
email
,
ContractTypeEnum
.
MAIN
.
getKey
());
if
(
ValidateUtil
.
isValid
(
contractList
)){
aw
.
setMoney
(
contractList
.
get
(
contractList
.
size
()
-
1
).
getPayMoney
());
//
aw.setMoney(contractList.get(contractList.size() - 1 ).getPayMoney());
aw
.
setContractStatus
(
contractList
.
get
(
contractList
.
size
()
-
1
).
getStatus
());
aw
.
setContractTime
(
contractList
.
size
());
}
else
{
...
...
src/main/java/track/service/impl/TrackAccountServiceImpl.java
View file @
2a73b1e5
...
...
@@ -89,7 +89,7 @@ public class TrackAccountServiceImpl implements TrackAccountService{
}
if
(
payMap
.
containsKey
(
aw
.
getEmail
())){
List
<
Contract
>
contractList
=
payMap
.
get
(
aw
.
getEmail
());
aw
.
setMoney
(
contractList
.
get
(
contractList
.
size
()
-
1
).
getPayMoney
());
//
aw.setMoney(contractList.get(contractList.size() - 1 ).getPayMoney());
aw
.
setContractStatus
(
contractList
.
get
(
contractList
.
size
()
-
1
).
getStatus
());
aw
.
setContractTime
(
contractList
.
size
());
}
else
{
...
...
@@ -143,7 +143,7 @@ public class TrackAccountServiceImpl implements TrackAccountService{
}
List
<
Contract
>
contractList
=
contractRepository
.
findByPlatformAndEmail
(
"track"
,
email
,
ContractTypeEnum
.
MAIN
.
getKey
());
if
(
ValidateUtil
.
isValid
(
contractList
)){
aw
.
setMoney
(
contractList
.
get
(
contractList
.
size
()
-
1
).
getPayMoney
());
//
aw.setMoney(contractList.get(contractList.size() - 1 ).getPayMoney());
aw
.
setContractStatus
(
contractList
.
get
(
contractList
.
size
()
-
1
).
getStatus
());
aw
.
setContractTime
(
contractList
.
size
());
}
else
{
...
...
src/main/java/userio/service/impl/IOAccountServiceImpl.java
View file @
2a73b1e5
...
...
@@ -203,7 +203,7 @@ public class IOAccountServiceImpl implements IOAccountService {
}
if
(
payMap
.
containsKey
(
aw
.
getEmail
())){
List
<
Contract
>
contractList
=
payMap
.
get
(
aw
.
getEmail
());
aw
.
setMoney
(
contractList
.
get
(
contractList
.
size
()
-
1
).
getPayMoney
());
//
aw.setMoney(contractList.get(contractList.size() - 1 ).getPayMoney());
aw
.
setContractStatus
(
contractRepository
.
findByPlatformAndEmailLimit1
(
"io"
,
aw
.
getEmail
(),
ContractTypeEnum
.
MAIN
.
getKey
()).
getStatus
());
aw
.
setContractTime
(
contractList
.
size
());
}
else
{
...
...
@@ -245,7 +245,7 @@ public class IOAccountServiceImpl implements IOAccountService {
}
List
<
Contract
>
contractList
=
contractRepository
.
findByPlatformAndEmail
(
"io"
,
email
,
ContractTypeEnum
.
MAIN
.
getKey
());
if
(
ValidateUtil
.
isValid
(
contractList
)){
aw
.
setMoney
(
contractList
.
get
(
contractList
.
size
()
-
1
).
getPayMoney
());
//
aw.setMoney(contractList.get(contractList.size() - 1 ).getPayMoney());
aw
.
setContractStatus
(
contractList
.
get
(
contractList
.
size
()
-
1
).
getStatus
());
aw
.
setContractTime
(
contractList
.
size
());
}
else
{
...
...
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