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
a84613ac
Commit
a84613ac
authored
Sep 24, 2020
by
lzxry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
行政区域/隶属集团
parent
08972830
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
207 additions
and
30 deletions
+207
-30
ContractController.java
src/main/java/common/controller/ContractController.java
+13
-0
BarrioCity.java
src/main/java/common/model/BarrioCity.java
+43
-0
BarrioCityVO.java
src/main/java/common/model/BarrioCityVO.java
+29
-0
Contract.java
src/main/java/common/model/Contract.java
+90
-25
ContractService.java
src/main/java/common/service/ContractService.java
+2
-0
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+20
-1
ShareIncomeServiceImpl.java
...main/java/common/service/impl/ShareIncomeServiceImpl.java
+10
-4
No files found.
src/main/java/common/controller/ContractController.java
View file @
a84613ac
...
...
@@ -603,4 +603,17 @@ public class ContractController {
}
}
/**
* 功能描述:新建合同回显、获取行政区域列表
* @author liyin
* @date 2020/9/23
*/
@GetMapping
(
"/getBarrioCities"
)
@ResponseBody
public
ResultModel
getBarrioCities
(){
return
ResultModel
.
OK
(
service
.
getBarrioCities
());
}
}
src/main/java/common/model/BarrioCity.java
0 → 100644
View file @
a84613ac
package
common
.
model
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
/**
* @author liyin
* @description
* @date
*/
@Entity
public
class
BarrioCity
{
private
Long
id
;
private
String
name
;
private
Long
parentId
;
@Id
@GeneratedValue
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Long
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Long
parentId
)
{
this
.
parentId
=
parentId
;
}
}
src/main/java/common/model/BarrioCityVO.java
0 → 100644
View file @
a84613ac
package
common
.
model
;
import
java.util.List
;
/**
* @author liyin
* @description
* @date
*/
public
class
BarrioCityVO
{
private
BarrioCity
parentCity
;
private
List
<
BarrioCity
>
cities
;
public
BarrioCity
getParentCity
()
{
return
parentCity
;
}
public
void
setParentCity
(
BarrioCity
parentCity
)
{
this
.
parentCity
=
parentCity
;
}
public
List
<
BarrioCity
>
getCities
()
{
return
cities
;
}
public
void
setCitys
(
List
<
BarrioCity
>
cities
)
{
this
.
cities
=
cities
;
}
}
src/main/java/common/model/Contract.java
View file @
a84613ac
...
...
@@ -66,6 +66,9 @@ public class Contract {
private
Integer
shareSign
;
//标记是否计算分摊收入 1 计算 0 不计算
private
String
searchName
;
private
List
<
String
>
customBodyNames
;
...
...
@@ -86,6 +89,9 @@ public class Contract {
private
String
erroMessage
;
private
String
tradeName
;
private
Long
barrioId
;
//行政区域id
private
String
barrioName
;
//行政区域名称
private
String
belongGroup
;
//隶属集团
@Id
@GeneratedValue
...
...
@@ -501,32 +507,20 @@ public class Contract {
this
.
adjustmentFundForm
=
adjustmentFundForm
;
}
public
Long
getBarrioId
()
{
return
barrioId
;
}
@Override
public
String
toString
()
{
return
"Contract{"
+
"id="
+
id
+
", product='"
+
product
+
'\''
+
", myBodyName='"
+
myBodyName
+
'\''
+
", myBodyCode='"
+
myBodyCode
+
'\''
+
", customerBody='"
+
customerBody
+
'\''
+
", email='"
+
email
+
'\''
+
", contractCode='"
+
contractCode
+
'\''
+
", contractType='"
+
contractType
+
'\''
+
", startDate='"
+
startDate
+
'\''
+
", endDate='"
+
endDate
+
'\''
+
", priceLevel="
+
priceLevel
+
", money="
+
money
+
", rebate="
+
rebate
+
", sale="
+
sale
+
", platform='"
+
platform
+
'\''
+
", status='"
+
status
+
'\''
+
", modifyAccount="
+
modifyAccount
+
", createAccount="
+
createAccount
+
", modifyTime="
+
modifyTime
+
", createTime="
+
createTime
+
", ds='"
+
ds
+
'\''
+
'}'
;
public
void
setBarrioId
(
Long
barrioId
)
{
this
.
barrioId
=
barrioId
;
}
public
String
getBelongGroup
()
{
return
belongGroup
;
}
public
void
setBelongGroup
(
String
belongGroup
)
{
this
.
belongGroup
=
belongGroup
;
}
public
Integer
getBackStatus
()
{
...
...
@@ -563,4 +557,75 @@ public class Contract {
public
void
setShareSign
(
Integer
shareSign
)
{
this
.
shareSign
=
shareSign
;
}
@Transient
public
String
getBarrioName
()
{
return
barrioName
;
}
public
void
setBarrioName
(
String
barrioName
)
{
this
.
barrioName
=
barrioName
;
}
@Override
public
String
toString
()
{
return
"Contract{"
+
"id="
+
id
+
", product='"
+
product
+
'\''
+
", myBodyName='"
+
myBodyName
+
'\''
+
", myBodyCode='"
+
myBodyCode
+
'\''
+
", customerBody='"
+
customerBody
+
'\''
+
", email='"
+
email
+
'\''
+
", contractCode='"
+
contractCode
+
'\''
+
", codeNum="
+
codeNum
+
", contractType='"
+
contractType
+
'\''
+
", startDate='"
+
startDate
+
'\''
+
", endDate='"
+
endDate
+
'\''
+
", priceLevel="
+
priceLevel
+
", priceLevelName='"
+
priceLevelName
+
'\''
+
", money="
+
money
+
", rebate="
+
rebate
+
", sale="
+
sale
+
", platform='"
+
platform
+
'\''
+
", status='"
+
status
+
'\''
+
", saleName='"
+
saleName
+
'\''
+
", payMoney="
+
payMoney
+
", backStatus="
+
backStatus
+
", invoice="
+
invoice
+
", invoiceMoney="
+
invoiceMoney
+
", createName='"
+
createName
+
'\''
+
", type='"
+
type
+
'\''
+
", priceName="
+
priceName
+
", old="
+
old
+
", extraFlow="
+
extraFlow
+
", modifyAccount="
+
modifyAccount
+
", createAccount="
+
createAccount
+
", modifyTime="
+
modifyTime
+
", createTime="
+
createTime
+
", ds='"
+
ds
+
'\''
+
", virtual="
+
virtual
+
", firstBackId="
+
firstBackId
+
", adjustmentFund="
+
adjustmentFund
+
", adjustmentFundForm='"
+
adjustmentFundForm
+
'\''
+
", intervalUseDays="
+
intervalUseDays
+
", incomeExcludingTax="
+
incomeExcludingTax
+
", intervaIncomeShare="
+
intervaIncomeShare
+
", incomeShareAll="
+
incomeShareAll
+
", shareSign="
+
shareSign
+
", searchName='"
+
searchName
+
'\''
+
", customBodyNames="
+
customBodyNames
+
", discountTimeLong="
+
discountTimeLong
+
", customerShort='"
+
customerShort
+
'\''
+
", customerThird='"
+
customerThird
+
'\''
+
", tradeType="
+
tradeType
+
", relationContract="
+
relationContract
+
", relationCode='"
+
relationCode
+
'\''
+
", hasDiscount='"
+
hasDiscount
+
'\''
+
", typeId='"
+
typeId
+
'\''
+
", erroMessage='"
+
erroMessage
+
'\''
+
", tradeName='"
+
tradeName
+
'\''
+
", barrioId="
+
barrioId
+
", belongGroup='"
+
belongGroup
+
'\''
+
'}'
;
}
}
src/main/java/common/service/ContractService.java
View file @
a84613ac
...
...
@@ -77,4 +77,5 @@ public interface ContractService {
ResultModel
uploadBatchInfo
(
MultipartFile
file
,
String
platform
);
Object
getBarrioCities
();
}
\ No newline at end of file
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
a84613ac
...
...
@@ -50,6 +50,7 @@ import java.text.DateFormat;
import
java.text.DecimalFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
...
...
@@ -210,6 +211,9 @@ public class ContractServiceImpl implements ContractService {
@Autowired
QcloudAccountRepository
qcloudAccountRepository
;
@Autowired
private
BarrioCityRepository
barrioCityRepository
;
@Override
public
Map
<
String
,
Object
>
checkAccount
(
String
email
,
String
platfrom
)
{
...
...
@@ -1349,11 +1353,13 @@ public class ContractServiceImpl implements ContractService {
Map
<
String
,
String
>
tradeTypeMap
=
tradeTypeRepsitory
.
findAll
().
stream
().
collect
(
Collectors
.
toMap
(
v
->
v
.
getId
().
toString
(),
v
->
v
.
getName
()));
if
(
ValidateUtil
.
isValid
(
contractList
))
{
List
<
BarrioCity
>
barrioCities
=
barrioCityRepository
.
findAll
();
Map
<
Long
,
BarrioCity
>
barrioCitiesNameMap
=
barrioCities
.
stream
().
collect
(
Collectors
.
toMap
(
BarrioCity:
:
getId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
for
(
Contract
c
:
contractList
)
{
c
.
setMyBodyName
(
bodyMap
.
get
(
c
.
getMyBodyCode
()));
c
.
setTradeName
(
tradeTypeMap
.
get
(
c
.
getTradeType
()
+
""
));
c
.
setDs
(
new
DateTime
(
c
.
getCreateTime
()).
toString
(
"yyyy-MM-dd"
));
c
.
setBarrioName
(
barrioCitiesNameMap
.
get
(
barrioCitiesNameMap
.
get
(
c
.
getBarrioId
()).
getParentId
()).
getName
());
if
((
c
.
getExtraFlow
()
!=
null
&&
c
.
getExtraFlow
()
>
0
)
||
(
c
.
getDiscountTimeLong
()
!=
null
&&
c
.
getDiscountTimeLong
()
>
0
))
{
...
...
@@ -2226,6 +2232,19 @@ public class ContractServiceImpl implements ContractService {
}
}
@Override
public
Object
getBarrioCities
()
{
List
<
BarrioCity
>
barrioCities
=
barrioCityRepository
.
findByParentId
(
0L
);
ArrayList
<
BarrioCityVO
>
objects
=
new
ArrayList
<>();
for
(
BarrioCity
barrioCity
:
barrioCities
)
{
BarrioCityVO
barrioCityVO
=
new
BarrioCityVO
();
barrioCityVO
.
setParentCity
(
barrioCity
);
barrioCityVO
.
setCitys
(
barrioCityRepository
.
findByParentId
(
barrioCity
.
getId
()));
objects
.
add
(
barrioCityVO
);
}
return
objects
;
}
public
ResultModel
saveDataBySheet
(
Sheet
sheet
,
int
row_length
,
String
platformexcl
)
{
String
sheetName
=
sheet
.
getSheetName
();
...
...
src/main/java/common/service/impl/ShareIncomeServiceImpl.java
View file @
a84613ac
...
...
@@ -3,10 +3,7 @@ package common.service.impl;
import
com.amazonaws.services.dynamodbv2.xspec.B
;
import
com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer
;
import
common.model.*
;
import
common.repository.AuthRepository
;
import
common.repository.ContractBodyRepository
;
import
common.repository.ContractChangeRepository
;
import
common.repository.ContractRepository
;
import
common.repository.*
;
import
common.service.ShareIncomeService
;
import
dic.ContractStatusEnum
;
import
dic.RoleEnum
;
...
...
@@ -24,6 +21,7 @@ import java.math.BigDecimal;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
...
...
@@ -40,6 +38,8 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
private
ContractBodyRepository
contractBodyRepository
;
@Autowired
private
ContractChangeRepository
contractChangeRepository
;
@Autowired
private
BarrioCityRepository
barrioCityRepository
;
@Override
public
List
<
Contract
>
shareIncomeList
(
User
loginAccount
,
String
startDate
,
String
endDate
,
String
platform
,
String
bodyCode
,
String
serchName
)
{
...
...
@@ -93,6 +93,10 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
Map
<
String
,
String
>
bodiesNameMap
=
bodies
.
stream
().
collect
(
Collectors
.
toMap
(
ContractBody:
:
getCode
,
ContractBody:
:
getName
,
(
v1
,
v2
)
->
v1
));
List
<
BarrioCity
>
barrioCities
=
barrioCityRepository
.
findAll
();
Map
<
Long
,
BarrioCity
>
barrioCitiesNameMap
=
barrioCities
.
stream
().
collect
(
Collectors
.
toMap
(
BarrioCity:
:
getId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
DateTime
start
=
new
DateTime
(
startDate
);
DateTime
end
=
new
DateTime
(
endDate
);
...
...
@@ -106,6 +110,8 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
streamContract
.
forEachOrdered
(
v
->
{
this
.
shareIncome4Contract
(
v
,
start
,
end
);
v
.
setMyBodyName
(
bodiesNameMap
.
get
(
v
.
getMyBodyCode
()));
if
(
v
.
getBarrioId
()!=
null
)
v
.
setBarrioName
(
barrioCitiesNameMap
.
get
(
barrioCitiesNameMap
.
get
(
v
.
getBarrioId
()).
getParentId
()).
getName
());
});
}
logger
.
info
(
"计算分摊收入耗时:{}"
,
(
System
.
currentTimeMillis
()
-
start_
));
...
...
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