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
95fd187a
Commit
95fd187a
authored
Jul 27, 2021
by
lzxry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
81170a96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+3
-2
ShareIncomeServiceImpl.java
...main/java/common/service/impl/ShareIncomeServiceImpl.java
+15
-16
No files found.
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
95fd187a
...
...
@@ -641,11 +641,12 @@ public class ContractServiceImpl implements ContractService {
Contract
contract
=
contractRepository
.
findByCodePlatform
(
relationCode
,
platform
);
if
(
StringUtils
.
isEmpty
(
contract
.
getNextSignedDate
()))
{
if
(
ContractStatusEnum
.
LATE
.
getKey
().
equals
(
resource
.
getStatus
()))
{
//如果晚录则设置绑定下一份合同的日期为签订月的最后一天
/*
if (ContractStatusEnum.LATE.getKey().equals(resource.getStatus())) {//如果晚录则设置绑定下一份合同的日期为签订月的最后一天
contract.setNextSignedDate(dateTime.dayOfMonth().withMaximumValue().toString("yyyy-MM-dd"));
} else {
contract.setNextSignedDate(dateTime.plusDays(-1).toString("yyyy-MM-dd"));//签订日的前一天
}
}*/
contract
.
setNextSignedDate
(
dateTime
.
plusDays
(-
1
).
toString
(
"yyyy-MM-dd"
));
//签订日的前一天
contract
.
setNextSignedContractCode
(
resource
.
getContractCode
());
contractRepository
.
save
(
contract
);
break
;
...
...
src/main/java/common/service/impl/ShareIncomeServiceImpl.java
View file @
95fd187a
...
...
@@ -540,7 +540,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}
}
groupContracts
=
map
.
values
();
//只要不加入传进来的那个list里面就不会影响查询的列表
break
;
//
break;
}
else
if
((
groupContracts
.
size
()==
1
&&!
StringUtils
.
isEmpty
(
groupContract
.
getNextSignedDate
()))||(!
"2"
.
equals
(
groupContract
.
getContractType
())
&&
map
.
get
(
groupContract
.
getNextSignedContractCode
())==
null
)){
List
<
Contract
>
contractList
=
contractRepository
.
findByRelationCode
(
groupContract
.
getContractCode
());
for
(
Contract
contract1
:
contractList
)
{
...
...
@@ -549,7 +549,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}
}
groupContracts
=
map
.
values
();
break
;
//
break;
}
}
...
...
@@ -732,7 +732,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
contract
.
setIntervaIncomeShare
(
unitPriceAccurate
.
multiply
(
clickTenThousand
).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
//调整金,正常情况下可能存在之前合同超出的流量所产生的调整金(记录在签订日)
BigDecimal
beforSigndFlow
=
null
;
if
(
checkTwoTime
(
selected
[
0
],
contractPart
[
0
])
&&
checkTwoTime
(
contractPart
[
1
],
selected
[
0
]))
{
if
(
checkTwoTime
(
selected
[
0
],
contractPart
[
0
])
&&
checkTwoTime
(
contractPart
[
0
],
selected
[
1
]))
{
DateTime
startDate
=
new
DateTime
(
contract
.
getStartDate
());
DateTime
endDate
=
contractPart
[
0
].
plusDays
(-
1
);
//签约日前一天
beforSigndFlow
=
tkioFlowRepository
.
sumFlowByContractCodeAndDs
(
contract
.
getContractCode
(),
startDate
.
toString
(
"yyyy-MM-dd"
),
endDate
.
toString
(
"yyyy-MM-dd"
));
...
...
@@ -795,19 +795,17 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000.0
*
100
);
}
contract
.
setAdjustmentFund
(
unitPriceAccurate
.
multiply
(
clickTenThousand
).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
//超出流量调整金
if
(
checkTwoTime
(
selected
[
0
],
contractPart
[
0
])
&&
checkTwoTime
(
contractPart
[
1
],
selected
[
0
]))
{
//超出流量也作为调整金,流量超出了说明单价就是按照补充协议一个合同来计算,不超出也没关系,下面这段代码查不到流量,流量同步决定了某天流量应该归档到某合同上
DateTime
startDate
=
new
DateTime
(
contract
.
getStartDate
());
DateTime
endDate
=
creatPoints
[
1
].
plusDays
(-
1
);
//签约录入
日前一天
DateTime
endDate
=
new
DateTime
(
contract
.
getSignedDate
()).
plusDays
(-
1
);
//签定
日前一天
beforSigndFlow
=
tkioFlowRepository
.
sumFlowByContractCodeAndDs
(
contract
.
getContractCode
(),
startDate
.
toString
(
"yyyy-MM-dd"
),
endDate
.
toString
(
"yyyy-MM-dd"
));
beforSigndFlow
=
beforSigndFlow
==
null
?
new
BigDecimal
(
0
)
:
beforSigndFlow
;
BigDecimal
beforSigndAdjustmentFund
=
beforSigndFlow
.
divide
(
new
BigDecimal
(
10000.0
/
100
)).
multiply
(
unitPriceAccurate
);
contract
.
setAdjustmentFund
(
contract
.
getAdjustmentFund
()
+
beforSigndAdjustmentFund
.
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
}
//处理上一个合同的调整金
/*//处理上一个合同的调整金
if (i > 0) {
contractsArray[i - 1].setAdjustmentFund(contractsArray[i - 1].getAdjustmentFund() - contractsArray[i - 1].getUnitPriceAccurate().multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
}
}
*/
}
else
{
contract
.
setAdjustmentFund
(
0L
);
...
...
@@ -817,7 +815,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
clickNum
=
tkioFlowRepository
.
sumFlowByDsAndContractCodes
(
contractPart
[
0
].
toString
(
"yyyy-MM-dd"
),
usePart
[
1
].
toString
(
"yyyy-MM-dd"
),
codes
);
clickFlow
=
clickNum
==
null
?
0L
:
clickNum
.
longValue
();
if
(
beforSigndFlow
!=
null
)
{
clickFlow
+=
beforSigndFlow
.
intValue
();
//
clickFlow += beforSigndFlow.intValue();
}
contract
.
setIncomeGross
(
unitPriceAccurate
.
multiply
(
new
BigDecimal
(
clickFlow
/
10000.0
*
100
)).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
());
}
...
...
@@ -828,10 +826,12 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
Long
lastDay
;
DateTime
lastDate
[];
if
(
isLater
)
{
lastDate
=
new
DateTime
[]{
creatPoints
[
1
],
contractPart
[
1
].
plusDays
(-
1
)};
//补充协议的直接按照开始时间算就行
lastDate
=
new
DateTime
[]{
new
DateTime
(
contract
.
getStartDate
()),
contractPart
[
1
].
plusDays
(-
1
)};
}
else
{
lastDate
=
new
DateTime
[]{
contractPart
[
0
],
contractPart
[
1
].
plusDays
(-
1
)};
}
//流量同步规则决定了某日流量应该是哪个合同的,所以开始日期不重要,补充协议只需要查开始日期即可
//合同除去最后一天的流量
ArrayList
<
String
>
codes
=
new
ArrayList
<>();
for
(
int
k
=
0
;
k
<=
i
;
k
++)
{
...
...
@@ -844,7 +844,6 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
clickTenThousand
=
new
BigDecimal
(
clickFlow
/
10000.0
*
100
);
}
long
beforeTheMoney
=
unitPriceAccurate
.
multiply
(
clickTenThousand
).
setScale
(
0
,
BigDecimal
.
ROUND_HALF_UP
).
longValue
();
//最后一天的流量
clickNum
=
tkioFlowRepository
.
sumFlowByDsAndContractCodes
(
contractPart
[
1
].
toString
(
"yyyy-MM-dd"
),
contractPart
[
1
].
toString
(
"yyyy-MM-dd"
),
codes
);
clickFlow
=
clickNum
==
null
?
0L
:
clickNum
.
longValue
();
...
...
@@ -855,8 +854,8 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
//合同的税后总金额减去最后合同一日之前的钱和调整金
long
excludTax
=
new
BigDecimal
(
totalprice
)
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
new
BigDecimal
(
100L
)).
longValue
();
//TODO 超出的流量算在了调整金了
这里好像减去了
lastDay
=
excludTax
-
contract
.
getAdjustmentFund
()
-
beforeTheMoney
;
//TODO 超出的流量算在了调整金了
lastDay
=
excludTax
-
beforeTheMoney
;
//最后一日 或 包含最后一日 时
contract
.
setIntervaIncomeShare
(
contract
.
getIntervaIncomeShare
()
-
lastDayTheMoney
+
lastDay
);
contract
.
setIncomeGross
(
contract
.
getIncomeGross
()
-
lastDayTheMoney
+
lastDay
);
...
...
@@ -924,7 +923,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
contract
.
setAdjustmentFund
(
0L
);
}
/*
//处理上一份合同
BigDecimal clickNum = tkioFlowRepository.sumFlowByDsAndContractCodes(contractPart[0].toString("yyyy-MM-dd"), creatPoints[1].plusDays(-1).toString("yyyy-MM-dd"), codes);
long clickFlow = clickNum == null ? 0L : clickNum.longValue();
...
...
@@ -934,7 +933,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}
if (i > 0) {
contractsArray[i - 1].setAdjustmentFund(contractsArray[i - 1].getAdjustmentFund() - contractsArray[i - 1].getUnitPriceAccurate().multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
}
}
*/
}
if
(
checkTwoTime
(
selected
[
0
],
contractPart
[
1
])
&&
checkTwoTime
(
contractPart
[
1
],
selected
[
1
]))
{
...
...
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