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
7ecc1eb7
Commit
7ecc1eb7
authored
Nov 04, 2020
by
lzxry
1
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.minrow.com/reyun/manager
parents
a1559e22
7498d5be
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
17 deletions
+52
-17
pom.xml
pom.xml
+2
-2
ContractRepository.java
src/main/java/common/repository/ContractRepository.java
+4
-0
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+22
-10
ShareIncomeServiceImpl.java
...main/java/common/service/impl/ShareIncomeServiceImpl.java
+21
-2
DateUtil.java
src/main/java/util/DateUtil.java
+3
-3
No files found.
pom.xml
View file @
7ecc1eb7
...
...
@@ -156,10 +156,10 @@
<redis.ip.requesttimes>
5
</redis.ip.requesttimes>
<redis.ip.unknown.requesttimes>
5
</redis.ip.unknown.requesttimes>
<redis.surl.host>
10.3.20.33
</redis.surl.host>
<redis.surl.host>
localhost
</redis.surl.host>
<redis.surl.port>
6379
</redis.surl.port>
<redis.event.host>
10.3.20.33
</redis.event.host>
<redis.event.host>
localhost
</redis.event.host>
<redis.event.port>
6379
</redis.event.port>
<redis.event.database>
13
</redis.event.database>
<!--Redis setting//end-->
...
...
src/main/java/common/repository/ContractRepository.java
View file @
7ecc1eb7
...
...
@@ -128,4 +128,8 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
@Query
(
value
=
"SELECT * from contract where platform = ?1 and email = ?2"
,
nativeQuery
=
true
)
List
<
Contract
>
findByPlatformAndEmail
(
String
platform
,
String
email
);
@Query
(
value
=
"select id from contract where (email is null or email='') and ( end_date >= ?1 and end_date <= ?2 )"
,
nativeQuery
=
true
)
List
<
Long
>
findAllEmailIsNull
(
String
startDate
,
String
endDate
);
}
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
7ecc1eb7
...
...
@@ -1466,6 +1466,7 @@ public class ContractServiceImpl implements ContractService {
result
.
add
(
c
);
}
}
return
result
;
}
...
...
@@ -2427,8 +2428,16 @@ public class ContractServiceImpl implements ContractService {
Cell
cell
=
row_data
.
getCell
(
w
);
int
line_num
=
j
+
1
;
if
(
null
==
cell
||
cell
.
getCellTypeEnum
().
equals
(
CellType
.
BLANK
))
{
return
ResultModel
.
ERROR
(
"第"
+
line_num
+
"行【"
+
SHEET_TITLE_RESERVE
.
get
(
sheetTitle
)
+
"】不能为空,请重新上传"
);
//主账号为空,额外处理
if
(
"email"
.
equals
(
sheetTitle
)
&&
"tkio"
.
equals
(
platformexcl
))
{
String
dataSTR
=
formatter
.
formatCellValue
(
cell
).
trim
();
s_data
[
w
]
=
dataSTR
;
moreEmail
.
add
(
dataSTR
.
trim
());
accountsEmail
.
add
(
dataSTR
.
trim
());
}
else
{
//非主账号 按照之前逻辑不变
return
ResultModel
.
ERROR
(
"第"
+
line_num
+
"行【"
+
SHEET_TITLE_RESERVE
.
get
(
sheetTitle
)
+
"】不能为空,请重新上传"
);
}
}
else
{
String
dataSTR
=
formatter
.
formatCellValue
(
cell
).
trim
();
//校验合同编号
...
...
@@ -2436,14 +2445,12 @@ public class ContractServiceImpl implements ContractService {
if
(!
codeUniqueDic
.
containsKey
(
dataSTR
))
{
codeUniqueDic
.
put
(
dataSTR
,
"1"
);
}
else
{
return
ResultModel
.
ERROR
(
ResultStatus
.
CCODE_EXITS
.
getCode
(),
"合同编号【"
+
dataSTR
+
"】已存在,请重新上传"
);
return
ResultModel
.
ERROR
(
ResultStatus
.
CCODE_EXITS
.
getCode
(),
"合同编号【"
+
dataSTR
+
"】已存在,请重新上传"
);
}
Contract
contractExist
=
contractRepository
.
checkByCode
(
dataSTR
);
if
(
contractExist
!=
null
)
{
return
ResultModel
.
ERROR
(
ResultStatus
.
CCODE_EXITS
.
getCode
(),
"合同编号【"
+
dataSTR
+
"】已存在,请重新上传"
);
return
ResultModel
.
ERROR
(
ResultStatus
.
CCODE_EXITS
.
getCode
(),
"合同编号【"
+
dataSTR
+
"】已存在,请重新上传"
);
}
}
...
...
@@ -2523,8 +2530,8 @@ public class ContractServiceImpl implements ContractService {
return
ResultModel
.
ERROR
(
"第"
+
line_num
+
"行【行政区域】code错误"
);
}
}
else
{
//主账号不为空,按照之前逻辑不变
s_data
[
w
]
=
dataSTR
;
if
(
"email"
.
equals
(
sheetTitle
)
&&
!
StringUtils
.
isEmpty
(
dataSTR
)
&&
"tkio"
.
equals
(
platformexcl
))
{
if
(!
accountsEmail
.
contains
(
dataSTR
.
trim
()))
{
moreEmail
.
add
(
dataSTR
.
trim
());
...
...
@@ -2557,8 +2564,13 @@ public class ContractServiceImpl implements ContractService {
for
(
int
i
=
0
;
i
<
accountsEmail
.
size
();
i
++)
{
String
e
=
accountsEmail
.
get
(
i
);
if
(!
emailDic
.
containsKey
(
e
))
{
return
ResultModel
.
ERROR
(
"第"
+
(
i
+
1
)
+
"行 客户主账号【"
+
e
+
"】在Office运营后台未找到,请重新上传"
);
if
(
"tkio"
.
equals
(
platformexcl
)
&&
""
.
equals
(
e
))
{
// tiko允许主账号email是空
}
else
{
//按照之前逻辑
if
(!
emailDic
.
containsKey
(
e
))
{
return
ResultModel
.
ERROR
(
"第"
+
(
i
+
1
)
+
"行 客户主账号【"
+
e
+
"】在Office运营后台未找到,请重新上传"
);
}
}
}
}
...
...
@@ -2567,7 +2579,7 @@ public class ContractServiceImpl implements ContractService {
s_data
[
row_already
]
=
platform
;
s_data
[
row_already
+
1
]
=
"tkio"
.
equals
(
platform
)
?
"trackingio"
:
platform
;
s_data
[
row_already
+
2
]
=
bodyCode
;
s_data
[
row_already
+
3
]
=
createTime
;
s_data
[
row_already
+
3
]
=
DateUtil
.
getCurrentDateStr
()
;
s_data
[
row_already
+
4
]
=
0
;
s_data
[
row_already
+
5
]
=
"main"
;
s_data
[
row_already
+
6
]
=
ContractStatusEnum
.
NFORMAL
.
getKey
();
//常规合同
...
...
src/main/java/common/service/impl/ShareIncomeServiceImpl.java
View file @
7ecc1eb7
...
...
@@ -22,6 +22,7 @@ import tkio.repository.AppRepository;
import
tkio.service.AccountFlowRestrictService
;
import
util.ContractBranchUtil
;
import
util.DateUtil
;
import
util.StringUtil
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
...
...
@@ -152,6 +153,25 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}
logger
.
info
(
"计算分摊收入耗时:{}"
,
(
System
.
currentTimeMillis
()
-
start_
));
//结果集result二次加工
if
(
"tkio"
.
equals
(
platform
))
{
//查询主账号为空的 并且 结束日期在查询范围内的
List
<
Long
>
allEmailIsNullIds
=
contractRepository
.
findAllEmailIsNull
(
startDate
,
endDate
);
for
(
Contract
contract
:
contracts
){
if
(
StringUtil
.
isEmpty
(
contract
.
getEmail
())){
//不在查询范围内的数据,全部置空
if
(
allEmailIsNullIds
==
null
||
!
allEmailIsNullIds
.
contains
(
BigInteger
.
valueOf
(
contract
.
getId
())))
{
contract
.
setClickFlow
(
0
D
);
//区间点击数(万次)
contract
.
setIntervaIncomeShare
(
0L
);
//区间分摊收入
contract
.
setAdjustmentFund
(
0L
);
//区间调整金额
contract
.
setIncomeShareAll
(
0L
);
//区间总收入
contract
.
setIncomeGross
(
0L
);
//累计总收入(元)
}
}
}
}
return
contracts
;
}
...
...
@@ -173,8 +193,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
contract
.
setIncomeExcludingTax
(
excludTax
);
//计算单价,精准保留16位数
BigDecimal
unitPriceAccurate
=
new
BigDecimal
(
contract
.
getMoney
()/
1.06
/
contract
.
getTrackFlow
())
.
setScale
(
16
,
BigDecimal
.
ROUND_HALF_UP
);
BigDecimal
unitPriceAccurate
=
new
BigDecimal
(
contract
.
getMoney
()/
1.06
/
contract
.
getTrackFlow
()).
setScale
(
16
,
BigDecimal
.
ROUND_HALF_UP
);
//四舍五入单价
double
unitPrice
=
unitPriceAccurate
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
//不限量套餐会在方法里面重新赋值单价
...
...
src/main/java/util/DateUtil.java
View file @
7ecc1eb7
...
...
@@ -63,7 +63,7 @@ public class DateUtil {
Calendar
cal
=
Calendar
.
getInstance
();
Date
currDate
=
cal
.
getTime
();
return
format
(
currDate
);
return
format
(
currDate
,
C_TIME_PATTON_DEFAULT
);
}
/**
...
...
@@ -1518,8 +1518,8 @@ public class DateUtil {
//
// String newdate = DateUtil.format(date,DateUtil.C_TIME_PATTON_DEFAULT);
// System.out.println(newdate);
System
.
out
.
print
(
DateUtil
.
getBeforeDays
(
"2017-03-31"
,-
70
));
//
System.out.print(DateUtil.getBeforeDays("2017-03-31",-70));
System
.
out
.
println
(
DateUtil
.
getCurrentDateStr
());
}
}
李引
@liyin
mentioned in commit
cba9c447
Nov 04, 2020
mentioned in commit
cba9c447
mentioned in commit cba9c4477aadb115732e1a983876ee4c0d9d4537
Toggle commit list
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