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
5ae66cca
Commit
5ae66cca
authored
Jul 01, 2020
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整金
parent
4b36d979
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
309 additions
and
22 deletions
+309
-22
ContractController.java
src/main/java/common/controller/ContractController.java
+5
-1
Contract.java
src/main/java/common/model/Contract.java
+23
-0
ContractChange.java
src/main/java/common/model/ContractChange.java
+9
-0
ContractChangeRepository.java
...main/java/common/repository/ContractChangeRepository.java
+2
-0
ContractRepository.java
src/main/java/common/repository/ContractRepository.java
+0
-0
ShareIncomeService.java
src/main/java/common/service/ShareIncomeService.java
+11
-0
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+37
-21
ShareIncomeServiceImpl.java
...main/java/common/service/impl/ShareIncomeServiceImpl.java
+221
-0
ContractStatusEnum.java
src/main/java/dic/ContractStatusEnum.java
+1
-0
No files found.
src/main/java/common/controller/ContractController.java
View file @
5ae66cca
...
...
@@ -2,6 +2,7 @@ package common.controller;
import
common.model.*
;
import
common.service.ContractService
;
import
common.service.ShareIncomeService
;
import
dic.AuthMenuEnmm
;
import
dic.ContractStatusEnum
;
import
dic.OperateObjectTypeEnum
;
...
...
@@ -67,6 +68,9 @@ public class ContractController {
@Autowired
private
ContractService
service
;
@Autowired
private
ShareIncomeService
shareIncomeService
;
@RequestMapping
(
value
=
"find"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@AuthKey
(
AuthMenuEnmm
.
CONTRACTMNG_V
)
...
...
@@ -435,7 +439,7 @@ public class ContractController {
@RequestParam
String
startDate
,
@RequestParam
String
endDate
,
String
bodyCode
,
String
serchName
)
{
return
ResultModel
.
OK
(
service
.
shareIncomeList
(
loginAccount
,
startDate
,
endDate
,
platform
,
bodyCode
,
serchName
));
return
ResultModel
.
OK
(
s
hareIncomeS
ervice
.
shareIncomeList
(
loginAccount
,
startDate
,
endDate
,
platform
,
bodyCode
,
serchName
));
}
...
...
src/main/java/common/model/Contract.java
View file @
5ae66cca
...
...
@@ -6,6 +6,7 @@ import javax.persistence.Id;
import
javax.persistence.Transient
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
/**
* Created by mxq on 2018/1/16.
...
...
@@ -63,6 +64,10 @@ public class Contract {
private
Long
intervaIncomeShare
;
//区间分摊收入(*100的结果)
private
Long
incomeShareAll
;
//分摊总收入(*100的结果)
private
String
searchName
;
private
List
<
String
>
customBodyNames
;
/**
* 新增字段 20190427
...
...
@@ -528,4 +533,22 @@ public class Contract {
public
void
setBackStatus
(
Integer
backStatus
)
{
this
.
backStatus
=
backStatus
;
}
@Transient
public
String
getSearchName
()
{
return
searchName
;
}
public
void
setSearchName
(
String
searchName
)
{
this
.
searchName
=
searchName
;
}
@Transient
public
List
<
String
>
getCustomBodyNames
()
{
return
customBodyNames
;
}
public
void
setCustomBodyNames
(
List
<
String
>
customBodyNames
)
{
this
.
customBodyNames
=
customBodyNames
;
}
}
src/main/java/common/model/ContractChange.java
View file @
5ae66cca
...
...
@@ -14,6 +14,7 @@ public class ContractChange {
private
String
company
;
private
String
ds
;
private
String
type
;
private
String
status
;
//合同状态
private
String
content
;
private
String
marke
;
//备注
private
Long
level
;
...
...
@@ -203,4 +204,12 @@ public class ContractChange {
public
void
setDiscountTimeLong
(
Long
discountTimeLong
)
{
this
.
discountTimeLong
=
discountTimeLong
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
}
src/main/java/common/repository/ContractChangeRepository.java
View file @
5ae66cca
...
...
@@ -19,4 +19,6 @@ public interface ContractChangeRepository extends JpaRepository<ContractChange,
@Query
(
value
=
"SELECT * from contract_change where platform = ?1 and email = ?2 and ds >= ?3 and ds <= ?4 order by ds desc"
,
nativeQuery
=
true
)
List
<
ContractChange
>
findByPlatformAndEmail
(
String
platform
,
String
email
,
String
startDate
,
String
endDate
);
@Query
(
value
=
"select * from contract_change where content=?1 and contract_code=?2 order by create_time desc limit 1"
,
nativeQuery
=
true
)
ContractChange
findByContentCode
(
String
type
,
String
contractCode
);
}
src/main/java/common/repository/ContractRepository.java
View file @
5ae66cca
This diff is collapsed.
Click to expand it.
src/main/java/common/service/ShareIncomeService.java
0 → 100644
View file @
5ae66cca
package
common
.
service
;
import
common.model.Contract
;
import
common.model.User
;
import
java.util.List
;
public
interface
ShareIncomeService
{
List
<
Contract
>
shareIncomeList
(
User
loginAccount
,
String
startDate
,
String
endDate
,
String
platform
,
String
bodyCode
,
String
serchName
);
}
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
5ae66cca
...
...
@@ -1583,12 +1583,8 @@ public class ContractServiceImpl implements ContractService {
@Override
public
Contract
change
(
User
loginUser
,
ContractChange
resource
,
FlowChange
flowChange
)
{
Map
<
Long
,
String
>
saleMap
=
getSaleMap
();
Contract
contract
=
contractRepository
.
findByCode
(
resource
.
getContractCode
());
Map
<
Long
,
String
>
packageMap
=
getPackageMap
(
contract
);
// ChangeDelInfo changeDelInfo = new ChangeDelInfo();
// changeDelInfo.setContractCode(contract.getContractCode());
// changeDelInfo.setEmail(contract.getEmail());
if
(
resource
.
getType
().
equals
(
"price"
))
{
...
...
@@ -1605,25 +1601,24 @@ public class ContractServiceImpl implements ContractService {
//变更优惠记录
this
.
saveFlowChange
(
contract
,
loginUser
,
"save"
,
resource
.
getDiscountTimeLong
(),
resource
.
getExtraFlow
());
// 累加 合同表中数据
if
(
resource
.
getExtraFlow
()
!=
null
)
{
contract
.
setExtraFlow
(
contract
.
getExtraFlow
()
+
resource
.
getExtraFlow
());
}
if
(
resource
.
getDiscountTimeLong
()
!=
null
)
{
contract
.
setDiscountTimeLong
(
contract
.
getDiscountTimeLong
()
+
resource
.
getDiscountTimeLong
());
}
}
else
{
// //同步修改trackingio的数据
// if (contract.getPlatform().equals("tkio") && contract.getType().equals("main")) {
// accountService.forbiden(contract);
// } else if (contract.getPlatform().equals("io") && contract.getType().equals("main")) {
// accountIOService.update(contract);
// }
//状态变更
resource
.
setContent
(
"作废"
);
contract
.
setStatus
(
"cancel"
);
if
(
ContractStatusEnum
.
CANCEL
.
getKey
().
equals
(
resource
.
getStatus
()))
{
//状态变更
resource
.
setContent
(
ContractStatusEnum
.
CANCEL
.
getValue
());
contract
.
setStatus
(
ContractStatusEnum
.
CANCEL
.
getKey
());
}
else
if
(
ContractStatusEnum
.
SUSPEND
.
getKey
().
equals
(
resource
.
getStatus
()))
{
resource
.
setContent
(
ContractStatusEnum
.
SUSPEND
.
getValue
());
contract
.
setStatus
(
ContractStatusEnum
.
SUSPEND
.
getKey
());
}
}
resource
.
setPlatform
(
contract
.
getPlatform
());
resource
.
setCreateAccount
(
loginUser
.
getId
());
...
...
@@ -1631,11 +1626,27 @@ public class ContractServiceImpl implements ContractService {
resource
.
setDs
(
DateUtil
.
getBeforeDays
(
0
));
resource
.
setUser
(
loginUser
.
getId
());
if
(
ContractStatusEnum
.
SUSPEND
.
getKey
().
equals
(
resource
.
getStatus
()))
{
resource
.
setCreateTime
(
new
DateTime
(
resource
.
getDs
()).
toDate
());
}
else
{
resource
.
setCreateTime
(
new
Date
());
resource
.
setDs
(
DateUtil
.
getBeforeDays
(
0
));
}
if
(!
"give"
.
equals
(
resource
.
getType
()))
{
contractChangeRepository
.
save
(
resource
);
}
return
contractRepository
.
save
(
contract
);
contractRepository
.
save
(
contract
);
if
(
ContractStatusEnum
.
SUSPEND
.
getKey
().
equals
(
contract
.
getStatus
()))
{
//获取相关执行合同名称
List
<
String
>
codes
=
contractRepository
.
findContractBodyNames
(
contract
.
getCustomerBody
());
contract
.
setCustomBodyNames
(
codes
);
}
return
contract
;
}
...
...
@@ -1709,7 +1720,8 @@ public class ContractServiceImpl implements ContractService {
@Override
public
List
<
ChangeDelInfo
>
getChangeDelData
(
User
loginAccount
,
String
contranctCode
,
String
startDate
,
String
endDate
)
{
public
List
<
ChangeDelInfo
>
getChangeDelData
(
User
loginAccount
,
String
contranctCode
,
String
startDate
,
String
endDate
)
{
List
<
ChangeDelInfo
>
datas
=
changeDelInfoRepository
.
findOnStartDate
(
startDate
,
endDate
);
return
datas
;
...
...
@@ -1895,7 +1907,8 @@ public class ContractServiceImpl implements ContractService {
@Override
public
List
<
ContractMoney
>
findPayAll
(
User
loginAccount
,
String
startDate
,
String
endDate
,
String
platfrom
,
String
moneyType
,
String
packageTypeSearch
,
String
money_ids
)
{
public
List
<
ContractMoney
>
findPayAll
(
User
loginAccount
,
String
startDate
,
String
endDate
,
String
platfrom
,
String
moneyType
,
String
packageTypeSearch
,
String
money_ids
)
{
Map
<
Long
,
PackageType
>
packageTypeMap
=
new
HashMap
<>();
Map
<
Long
,
String
>
saleMap
=
new
HashMap
<>();
...
...
@@ -1974,7 +1987,8 @@ public class ContractServiceImpl implements ContractService {
return
list
;
}
private
List
<
ContractMoney
>
filterContractMoney
(
List
<
String
>
codesList
,
Map
<
String
,
Object
>
authdata
,
List
<
ContractMoney
>
list
,
int
nextIndex
)
{
private
List
<
ContractMoney
>
filterContractMoney
(
List
<
String
>
codesList
,
Map
<
String
,
Object
>
authdata
,
List
<
ContractMoney
>
list
,
int
nextIndex
)
{
if
(
codesList
==
null
||
codesList
.
size
()
==
0
)
{
return
list
;
...
...
@@ -2114,7 +2128,8 @@ public class ContractServiceImpl implements ContractService {
}
public
static
Map
<
String
,
String
>
convertBean
(
Object
bean
)
throws
IntrospectionException
,
IllegalArgumentException
,
IllegalAccessException
,
InvocationTargetException
{
public
static
Map
<
String
,
String
>
convertBean
(
Object
bean
)
throws
IntrospectionException
,
IllegalArgumentException
,
IllegalAccessException
,
InvocationTargetException
{
Class
type
=
bean
.
getClass
();
Map
<
String
,
String
>
returnMap
=
new
HashMap
<
String
,
String
>();
BeanInfo
beanInfo
=
Introspector
.
getBeanInfo
(
type
);
...
...
@@ -2371,7 +2386,8 @@ public class ContractServiceImpl implements ContractService {
}
@Override
public
List
<
Contract
>
shareIncomeList
(
User
loginAccount
,
String
startDate
,
String
endDate
,
String
platform
,
String
bodyCode
,
String
serchName
)
{
public
List
<
Contract
>
shareIncomeList
(
User
loginAccount
,
String
startDate
,
String
endDate
,
String
platform
,
String
bodyCode
,
String
serchName
)
{
List
<
Contract
>
contracts
=
new
ArrayList
<>();
...
...
src/main/java/common/service/impl/ShareIncomeServiceImpl.java
0 → 100644
View file @
5ae66cca
This diff is collapsed.
Click to expand it.
src/main/java/dic/ContractStatusEnum.java
View file @
5ae66cca
...
...
@@ -20,6 +20,7 @@ public enum ContractStatusEnum {
MONEY_BACK_FIRST
(
"backfirst"
,
"先回款待录入"
),
CANCEL
(
"cancel"
,
"作废"
),
SUSPEND
(
"suspend"
,
"中止"
),
NFORMAL
(
"normal"
,
"常规"
),
DELETE
(
"del"
,
"已删除"
),
...
...
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