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
768a3cc2
Commit
768a3cc2
authored
Jul 29, 2019
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v1.3
parent
b10cb188
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
18 deletions
+34
-18
ContractRepository.java
src/main/java/common/repository/ContractRepository.java
+1
-1
AccountCommonServiceImpl.java
...in/java/common/service/impl/AccountCommonServiceImpl.java
+5
-1
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+28
-16
No files found.
src/main/java/common/repository/ContractRepository.java
View file @
768a3cc2
...
...
@@ -78,7 +78,7 @@ public interface ContractRepository extends JpaRepository<Contract, Long> {
List
<
Contract
>
findByTwoIds
(
Long
relationContract
,
Long
relationContract1
);
@Query
(
value
=
"SELECT * from contract where platform =?1 and email = ?2 and (status <> 'end' or status <> 'cancel')"
,
nativeQuery
=
true
)
List
<
Contract
>
findByPlatformAndEmailStatus
(
String
platgorm
,
String
email
,
int
status
);
List
<
Contract
>
findByPlatformAndEmailStatus
(
String
platgorm
,
String
email
);
@Query
(
value
=
"select * from contract where contract_code =?2 and platform = ?1 "
,
nativeQuery
=
true
)
Contract
findOneByCode
(
String
platform
,
String
contractId
);
...
...
src/main/java/common/service/impl/AccountCommonServiceImpl.java
View file @
768a3cc2
...
...
@@ -30,10 +30,14 @@ public class AccountCommonServiceImpl implements AccountCommonService {
@Override
public
Account4Web
findOne
(
String
platgorm
,
String
email
)
{
List
<
Contract
>
contract
=
contractRepository
.
findByPlatformAndEmailStatus
(
platgorm
,
email
,
1
);
List
<
Contract
>
contract
=
contractRepository
.
findByPlatformAndEmailStatus
(
platgorm
,
email
);
Account4Web
account4Web
=
new
Account4Web
();
Contract
thecontract
=
contract
.
get
(
0
);
account4Web
.
setEmail
(
thecontract
.
getEmail
());
account4Web
.
setAccountId
(
0L
);
account4Web
.
setId
(
0L
);
PackageBase
packageBase
=
packageBaseRepository
.
findOne
(
thecontract
.
getPriceLevel
());
account4Web
.
setPackageType
(
packageBase
.
getPackageName
());
...
...
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
768a3cc2
...
...
@@ -1339,10 +1339,10 @@ public class ContractServiceImpl implements ContractService {
@Override
public
Contract
change
(
User
loginUser
,
ContractChange
resource
,
FlowChange
flowChange
)
{
Map
<
Long
,
String
>
packageMap
=
getPackageMap
();
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());
...
...
@@ -1636,14 +1636,8 @@ public class ContractServiceImpl implements ContractService {
saleMap
.
put
(
s
.
getId
(),
s
.
getName
());
}
}
List
<
PackageType
>
typeList
=
packageTypeRepository
.
findAll
();
Map
<
Long
,
String
>
typeMap
=
new
HashMap
<>();
if
(
ValidateUtil
.
isValid
(
typeList
))
{
for
(
PackageType
s
:
typeList
)
{
typeMap
.
put
(
s
.
getId
(),
s
.
getPackageName
());
}
}
Map
<
Long
,
String
>
typeMap
=
this
.
getPackageMap
(
contract
);
save
.
setSaleName
(
saleMap
.
containsKey
(
save
.
getSale
())
?
saleMap
.
get
(
save
.
getSale
())
:
""
);
save
.
setPriceLevelName
(
typeMap
.
containsKey
(
save
.
getPriceLevel
())
?
typeMap
.
get
(
save
.
getPriceLevel
())
:
""
);
save
.
setCreateName
(
saleMap
.
containsKey
(
save
.
getSale
())
?
saleMap
.
get
(
save
.
getSale
())
:
""
);
...
...
@@ -1744,16 +1738,34 @@ public class ContractServiceImpl implements ContractService {
return
data
;
}
public
Map
<
Long
,
String
>
getPackageMap
()
{
public
Map
<
Long
,
String
>
getPackageMap
(
Contract
contract
)
{
// List<PackageType> typeList = packageTypeRepository.findAll();
List
<
PackageType
>
typeList
=
packageTypeRepository
.
findIsNewAll
();
Map
<
Long
,
String
>
typeMap
=
new
HashMap
<>();
if
(
ValidateUtil
.
isValid
(
typeList
))
{
for
(
PackageType
s
:
typeList
)
{
typeMap
.
put
(
s
.
getId
(),
s
.
getPackageName
());
String
platform
=
contract
.
getPlatform
();
if
(
"trackio"
.
equals
(
platform
)){
List
<
PackageType
>
typeList
=
packageTypeRepository
.
findIsNewAll
();
Map
<
Long
,
String
>
typeMap
=
new
HashMap
<>();
if
(
ValidateUtil
.
isValid
(
typeList
))
{
for
(
PackageType
s
:
typeList
)
{
typeMap
.
put
(
s
.
getId
(),
s
.
getPackageName
());
}
}
return
typeMap
;
}
else
{
List
<
PackageBase
>
packageBases
=
packageBaseRepository
.
findByPlatAndStatus
(
platform
,
1
);
Map
<
Long
,
String
>
typeMap
=
new
HashMap
<>();
for
(
PackageBase
packageBase
:
packageBases
)
{
typeMap
.
put
(
packageBase
.
getId
(),
packageBase
.
getPackageName
());
}
return
typeMap
;
}
return
typeMap
;
}
public
Map
<
Long
,
String
>
getSaleMap
()
{
...
...
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