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