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
45a65f1c
Commit
45a65f1c
authored
Jun 05, 2018
by
manxiaoqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpu
parent
c5c1e13d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
104 additions
and
11 deletions
+104
-11
workspace.xml
.idea/workspace.xml
+0
-0
ContractController.java
src/main/java/common/controller/ContractController.java
+2
-2
BPUContract.java
src/main/java/common/model/BPUContract.java
+59
-0
BPUContractRepository.java
src/main/java/common/repository/BPUContractRepository.java
+15
-0
ContractService.java
src/main/java/common/service/ContractService.java
+1
-1
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+23
-8
TkioAccountServiceImpl.java
src/main/java/tkio/service/impl/TkioAccountServiceImpl.java
+4
-0
No files found.
.idea/workspace.xml
View file @
45a65f1c
This diff is collapsed.
Click to expand it.
src/main/java/common/controller/ContractController.java
View file @
45a65f1c
...
...
@@ -167,8 +167,8 @@ public class ContractController {
@RequestMapping
(
value
=
"find/pricelevel"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
ResultModel
findPricelevel
(
@CurrentAccount
User
loginAccount
)
{
return
ResultModel
.
OK
(
service
.
findSetmeal
());
public
ResultModel
findPricelevel
(
@CurrentAccount
User
loginAccount
,
@PathVariable
String
platform
)
{
return
ResultModel
.
OK
(
service
.
findSetmeal
(
platform
));
}
@RequestMapping
(
value
=
"find/increment"
,
method
=
RequestMethod
.
GET
)
...
...
src/main/java/common/model/BPUContract.java
0 → 100644
View file @
45a65f1c
package
common
.
model
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
/**
* Created by mxq on 2018/1/17.
*/
@Entity
public
class
BPUContract
{
private
Long
id
;
private
String
packageName
;
private
String
code
;
private
String
type
;
private
String
product
;
public
String
getProduct
()
{
return
product
;
}
public
void
setProduct
(
String
product
)
{
this
.
product
=
product
;
}
@Id
@GeneratedValue
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getPackageName
()
{
return
packageName
;
}
public
void
setPackageName
(
String
packageName
)
{
this
.
packageName
=
packageName
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
}
src/main/java/common/repository/BPUContractRepository.java
0 → 100644
View file @
45a65f1c
package
common
.
repository
;
import
common.model.BPUContract
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
@Transactional
public
interface
BPUContractRepository
extends
JpaRepository
<
BPUContract
,
Long
>
{
@Query
(
value
=
"SELECT * from bpucontract where product = ?1"
,
nativeQuery
=
true
)
List
<
BPUContract
>
findByProduct
(
String
code
);
}
src/main/java/common/service/ContractService.java
View file @
45a65f1c
...
...
@@ -19,7 +19,7 @@ public interface ContractService {
String
getContractCode
(
String
code
);
List
findSetmeal
();
List
findSetmeal
(
String
platform
);
//增值服务
List
<
ContractIncrement
>
findIncrement
();
...
...
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
45a65f1c
...
...
@@ -70,6 +70,8 @@ public class ContractServiceImpl implements ContractService{
UserService
userService
;
@Autowired
IncrementFlowRepository
incrementFlowRepository
;
@Autowired
BPUContractRepository
bpuContractRepository
;
@Override
public
Map
<
String
,
Object
>
checkAccount
(
String
email
,
String
platfrom
)
{
...
...
@@ -147,16 +149,20 @@ public class ContractServiceImpl implements ContractService{
}
@Override
public
List
findSetmeal
()
{
public
List
findSetmeal
(
String
platform
)
{
List
list
=
new
ArrayList
();
List
<
PackageType
>
packageTypeList
=
packageTypeRepository
.
findAll
();
for
(
PackageType
p
:
packageTypeList
){
p
.
setType
(
"main"
);
list
.
add
(
p
);
if
(
"tkio"
.
equals
(
platform
)
||
"io"
.
equals
(
platform
)){
List
<
PackageType
>
packageTypeList
=
packageTypeRepository
.
findAll
();
for
(
PackageType
p
:
packageTypeList
){
p
.
setType
(
"main"
);
list
.
add
(
p
);
}
List
<
ContractIncrement
>
increments
=
contractIncrementRepository
.
findAll
();
list
.
addAll
(
increments
);
}
else
if
(
"userdesk"
.
equals
(
platform
)
||
"dmp"
.
equals
(
platform
)
||
"fake"
.
equals
(
platform
))
{
list
=
bpuContractRepository
.
findByProduct
(
platform
);
}
List
<
ContractIncrement
>
increments
=
contractIncrementRepository
.
findAll
();
list
.
addAll
(
increments
);
return
list
;
}
...
...
@@ -397,6 +403,13 @@ public class ContractServiceImpl implements ContractService{
incremenMap
.
put
(
s
.
getId
(),
s
.
getPackageName
());
}
}
List
<
BPUContract
>
bpuContractList
=
bpuContractRepository
.
findAll
();
Map
<
Long
,
String
>
bpuMap
=
new
HashMap
<>();
if
(
ValidateUtil
.
isValid
(
bpuContractList
)){
for
(
BPUContract
s:
bpuContractList
){
bpuMap
.
put
(
s
.
getId
(),
s
.
getPackageName
());
}
}
List
<
Contract
>
contractList
=
null
;
if
(
loginAccount
.
getRole
().
equals
(
RoleEnum
.
SOUTH_BUSSINUSS
.
getKey
())
||
loginAccount
.
getRole
().
equals
(
RoleEnum
.
NORTH_BUSSINUSS
.
getKey
())){
...
...
@@ -415,8 +428,10 @@ public class ContractServiceImpl implements ContractService{
if
(
ValidateUtil
.
isValid
(
contractList
)){
for
(
Contract
c
:
contractList
){
c
.
setSaleName
(
saleMap
.
containsKey
(
c
.
getSale
())
?
saleMap
.
get
(
c
.
getSale
())
:
""
);
if
(
c
.
getType
().
equals
(
ContractTypeEnum
.
MAIN
.
getKey
())){
if
(
c
.
getType
().
equals
(
ContractTypeEnum
.
MAIN
.
getKey
())
&&
platfrom
.
contains
(
"io"
)
){
c
.
setPriceLevelName
(
typeMap
.
containsKey
(
c
.
getPriceLevel
())
?
typeMap
.
get
(
c
.
getPriceLevel
())
:
""
);
}
else
if
(
c
.
getType
().
equals
(
ContractTypeEnum
.
MAIN
.
getKey
())){
c
.
setPriceLevelName
(
bpuMap
.
containsKey
(
c
.
getPriceLevel
())
?
bpuMap
.
get
(
c
.
getPriceLevel
())
:
""
);
}
else
{
c
.
setPriceLevelName
(
incremenMap
.
containsKey
(
c
.
getPriceLevel
())
?
incremenMap
.
get
(
c
.
getPriceLevel
())
:
""
);
}
...
...
src/main/java/tkio/service/impl/TkioAccountServiceImpl.java
View file @
45a65f1c
...
...
@@ -599,6 +599,10 @@ public class TkioAccountServiceImpl implements TkioAccountService {
Contract
contract
=
contractRepository
.
findByCode
(
resource
.
getContractCode
());
//增值服务
if
(
contract
.
getType
().
equals
(
ContractTypeEnum
.
INCREMENT
.
getKey
())){
//回本分析不作操作
if
(
contract
.
getPriceLevel
().
longValue
()
==
3L
){
return
;
}
Crowd
crowd
=
crowdRepository
.
findOne
(
resource
.
getContractCode
());
if
(
null
!=
crowd
){
crowd
.
setPayment
(
1
);
...
...
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