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
3285625c
Commit
3285625c
authored
4 years ago
by
lzxry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CAS批量导入处理
parent
def3298a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
6 deletions
+41
-6
Contract.java
src/main/java/common/model/Contract.java
+9
-0
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+22
-1
ShareIncomeServiceImpl.java
...main/java/common/service/impl/ShareIncomeServiceImpl.java
+10
-5
No files found.
src/main/java/common/model/Contract.java
View file @
3285625c
...
@@ -106,6 +106,7 @@ public class Contract {
...
@@ -106,6 +106,7 @@ public class Contract {
private
String
validStartDate
;
//有效开始日
private
String
validStartDate
;
//有效开始日
private
String
validEndDate
;
//有效结束日
private
String
validEndDate
;
//有效结束日
private
Double
oneTimeRecognizedRevenue
;
//一次性确认收入
private
Double
oneTimeRecognizedRevenue
;
//一次性确认收入
private
Boolean
oneTime
;
//是否计算一次性收入,0不计算
@Id
@Id
@GeneratedValue
@GeneratedValue
...
@@ -690,6 +691,14 @@ public class Contract {
...
@@ -690,6 +691,14 @@ public class Contract {
this
.
oneTimeRecognizedRevenue
=
oneTimeRecognizedRevenue
;
this
.
oneTimeRecognizedRevenue
=
oneTimeRecognizedRevenue
;
}
}
public
Boolean
getOneTime
()
{
return
oneTime
;
}
public
void
setOneTime
(
Boolean
oneTime
)
{
this
.
oneTime
=
oneTime
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"Contract{"
+
return
"Contract{"
+
...
...
This diff is collapsed.
Click to expand it.
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
3285625c
...
@@ -98,6 +98,9 @@ public class ContractServiceImpl implements ContractService {
...
@@ -98,6 +98,9 @@ public class ContractServiceImpl implements ContractService {
put
(
"签约销售"
,
"sale"
);
put
(
"签约销售"
,
"sale"
);
put
(
"关联合同编号"
,
"relation_code"
);
put
(
"关联合同编号"
,
"relation_code"
);
put
(
"补充协议签订日期"
,
"signed_date"
);
put
(
"补充协议签订日期"
,
"signed_date"
);
put
(
"有效开始日"
,
"valid_start_date"
);
put
(
"有效结束日"
,
"valid_end_date"
);
put
(
"是否计算一次性收入"
,
"one_time"
);
}};
}};
private
static
final
Map
<
String
,
String
>
SHEET_TITLE_RESERVE
=
new
HashMap
()
{{
private
static
final
Map
<
String
,
String
>
SHEET_TITLE_RESERVE
=
new
HashMap
()
{{
...
@@ -119,6 +122,9 @@ public class ContractServiceImpl implements ContractService {
...
@@ -119,6 +122,9 @@ public class ContractServiceImpl implements ContractService {
put
(
"sale"
,
"签约销售"
);
put
(
"sale"
,
"签约销售"
);
put
(
"relation_code"
,
"关联合同编号"
);
put
(
"relation_code"
,
"关联合同编号"
);
put
(
"signed_date"
,
"补充协议签订日期"
);
put
(
"signed_date"
,
"补充协议签订日期"
);
put
(
"valid_start_date"
,
"有效开始日"
);
put
(
"valid_end_date"
,
"有效结束日"
);
put
(
"one_time"
,
"是否计算一次性收入"
);
}};
}};
public
static
final
String
UPLOAD_TITLE
=
"我方签约主体,客户签约主体,行业分类,合同开始日期,合同结束日期,"
+
public
static
final
String
UPLOAD_TITLE
=
"我方签约主体,客户签约主体,行业分类,合同开始日期,合同结束日期,"
+
...
@@ -131,6 +137,7 @@ public class ContractServiceImpl implements ContractService {
...
@@ -131,6 +137,7 @@ public class ContractServiceImpl implements ContractService {
put
(
"ADI"
,
"adi"
);
put
(
"ADI"
,
"adi"
);
put
(
"ADS"
,
"ads"
);
put
(
"ADS"
,
"ads"
);
put
(
"ABTEST"
,
"abtest"
);
put
(
"ABTEST"
,
"abtest"
);
put
(
"CAS"
,
"cas"
);
}};
}};
public
static
final
Map
<
String
,
String
>
SHEET_NAMES_RESERVE
=
new
HashMap
()
{{
public
static
final
Map
<
String
,
String
>
SHEET_NAMES_RESERVE
=
new
HashMap
()
{{
...
@@ -140,6 +147,7 @@ public class ContractServiceImpl implements ContractService {
...
@@ -140,6 +147,7 @@ public class ContractServiceImpl implements ContractService {
put
(
"adi"
,
"ADI"
);
put
(
"adi"
,
"ADI"
);
put
(
"ads"
,
"ADS"
);
put
(
"ads"
,
"ADS"
);
put
(
"abtest"
,
"ABTEST"
);
put
(
"abtest"
,
"ABTEST"
);
put
(
"cas"
,
"CAS"
);
}};
}};
Logger
logger
=
LoggerFactory
.
getLogger
(
ContractServiceImpl
.
class
);
Logger
logger
=
LoggerFactory
.
getLogger
(
ContractServiceImpl
.
class
);
...
@@ -505,7 +513,7 @@ public class ContractServiceImpl implements ContractService {
...
@@ -505,7 +513,7 @@ public class ContractServiceImpl implements ContractService {
if
(
resource
==
null
)
{
if
(
resource
==
null
)
{
return
null
;
return
null
;
}
}
resource
.
setOneTime
(
true
);
//补充协议
//补充协议
if
(
"2"
.
equals
(
resource
.
getContractType
())
&&
"tkio"
.
equals
(
resource
.
getPlatform
())){
if
(
"2"
.
equals
(
resource
.
getContractType
())
&&
"tkio"
.
equals
(
resource
.
getPlatform
())){
//关联合同不能为空
//关联合同不能为空
...
@@ -2434,6 +2442,8 @@ public class ContractServiceImpl implements ContractService {
...
@@ -2434,6 +2442,8 @@ public class ContractServiceImpl implements ContractService {
int
row_length
;
int
row_length
;
if
(
platform
.
equals
(
"tkio"
))
{
if
(
platform
.
equals
(
"tkio"
))
{
row_length
=
17
;
row_length
=
17
;
}
if
(
platform
.
equals
(
"cas"
))
{
row_length
=
16
;
}
else
{
}
else
{
row_length
=
13
;
row_length
=
13
;
}
}
...
@@ -2519,6 +2529,11 @@ public class ContractServiceImpl implements ContractService {
...
@@ -2519,6 +2529,11 @@ public class ContractServiceImpl implements ContractService {
titleKey
.
remove
(
"signed_date"
);
titleKey
.
remove
(
"signed_date"
);
titleKey
.
remove
(
"关联合同编号"
);
titleKey
.
remove
(
"关联合同编号"
);
titleKey
.
remove
(
"relation_code"
);
titleKey
.
remove
(
"relation_code"
);
}
else
if
(!
platform
.
equals
(
"cas"
)){
titleKey
.
remove
(
"有效开始日"
);
titleKey
.
remove
(
"valid_start_date"
);
titleKey
.
remove
(
"有效结束日"
);
titleKey
.
remove
(
"valid_end_date"
);
}
}
int
row_already
=
titleKey
.
size
();
int
row_already
=
titleKey
.
size
();
...
@@ -2683,6 +2698,12 @@ public class ContractServiceImpl implements ContractService {
...
@@ -2683,6 +2698,12 @@ public class ContractServiceImpl implements ContractService {
}
else
if
(
"relation_code"
.
equals
(
sheetTitle
)){
}
else
if
(
"relation_code"
.
equals
(
sheetTitle
)){
s_data
[
w
]
=
dataSTR
;
s_data
[
w
]
=
dataSTR
;
filter
.
put
(
"relation_code"
,
dataSTR
);
filter
.
put
(
"relation_code"
,
dataSTR
);
}
else
if
(
"one_time"
.
equals
(
sheetTitle
)){
if
(
dataSTR
.
equals
(
"否"
)){
s_data
[
w
]
=
false
;
}
else
{
s_data
[
w
]
=
true
;
}
}
else
{
}
else
{
//主账号不为空,按照之前逻辑不变
//主账号不为空,按照之前逻辑不变
s_data
[
w
]
=
dataSTR
;
s_data
[
w
]
=
dataSTR
;
...
...
This diff is collapsed.
Click to expand it.
src/main/java/common/service/impl/ShareIncomeServiceImpl.java
View file @
3285625c
...
@@ -220,7 +220,12 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
...
@@ -220,7 +220,12 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
Long
excludTax
=
bigDecimal
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
new
BigDecimal
(
100L
)).
longValue
();
//不含税收入*100
Long
excludTax
=
bigDecimal
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
multiply
(
new
BigDecimal
(
100L
)).
longValue
();
//不含税收入*100
contract
.
setIncomeExcludingTax
(
excludTax
);
contract
.
setIncomeExcludingTax
(
excludTax
);
BigDecimal
oneTimeRecognizedRevenue
=
bigDecimal
.
multiply
(
new
BigDecimal
(
"0.9"
));
BigDecimal
oneTimeRecognizedRevenue
=
null
;
if
(
contract
.
getOneTime
()!=
null
&&
contract
.
getOneTime
()==
false
){
//处理cas是否计算一次性收入标识
oneTimeRecognizedRevenue
=
new
BigDecimal
(
"0"
);
}
else
{
oneTimeRecognizedRevenue
=
bigDecimal
.
multiply
(
new
BigDecimal
(
"0.9"
));
}
BigDecimal
dailyRevenueRecognition
=
bigDecimal
.
multiply
(
new
BigDecimal
(
"0.1"
));
BigDecimal
dailyRevenueRecognition
=
bigDecimal
.
multiply
(
new
BigDecimal
(
"0.1"
));
contract
.
setOneTimeRecognizedRevenue
(
oneTimeRecognizedRevenue
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
contract
.
setOneTimeRecognizedRevenue
(
oneTimeRecognizedRevenue
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
());
int
contractAllDay
=
getDayRange
(
contractPart
[
0
],
contractPart
[
1
])
+
1
;
//合同总天数
int
contractAllDay
=
getDayRange
(
contractPart
[
0
],
contractPart
[
1
])
+
1
;
//合同总天数
...
@@ -272,9 +277,9 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
...
@@ -272,9 +277,9 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
boolean
isLateContract
=
false
;
// 是否为晚录合同(为了兼容历史数据 此处做冗余判断)
boolean
isLateContract
=
false
;
// 是否为晚录合同(为了兼容历史数据 此处做冗余判断)
if
(
ContractStatusEnum
.
LATE
.
getKey
().
equals
(
contract
.
getStatus
()))
{
if
(
ContractStatusEnum
.
LATE
.
getKey
().
equals
(
contract
.
getStatus
()))
{
isLateContract
=
true
;
isLateContract
=
true
;
}
else
if
(
checkLateContract
(
contractValidPart
[
0
],
creatPoints
[
0
]))
{
}
/*
else if (checkLateContract(contractValidPart[0], creatPoints[0])) {
isLateContract = true;
isLateContract = true;
}
}
*/
if
(
isLateContract
)
{
if
(
isLateContract
)
{
contract
.
setStatus
(
ContractStatusEnum
.
LATE
.
getKey
());
contract
.
setStatus
(
ContractStatusEnum
.
LATE
.
getKey
());
...
@@ -1034,10 +1039,10 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
...
@@ -1034,10 +1039,10 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
boolean
isLateContract
=
false
;
// 是否为晚录合同(为了兼容历史数据 此处做冗余判断)
boolean
isLateContract
=
false
;
// 是否为晚录合同(为了兼容历史数据 此处做冗余判断)
if
(
ContractStatusEnum
.
LATE
.
getKey
().
equals
(
contract
.
getStatus
()))
{
if
(
ContractStatusEnum
.
LATE
.
getKey
().
equals
(
contract
.
getStatus
()))
{
isLateContract
=
true
;
isLateContract
=
true
;
}
else
if
(
checkLateContract
(
contractPart
[
0
],
creatPoints
[
0
]))
{
}
/*
else if (checkLateContract(contractPart[0], creatPoints[0])) {
isLateContract = true;
isLateContract = true;
contract.setStatus(ContractStatusEnum.LATE.getKey());
contract.setStatus(ContractStatusEnum.LATE.getKey());
}
}
*/
boolean
isLater
=
true
;
boolean
isLater
=
true
;
if
(!
isLateContract
)
{
if
(!
isLateContract
)
{
...
...
This diff is collapsed.
Click to expand it.
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