Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
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
Administrator
browser-backend
Commits
013beeb8
Commit
013beeb8
authored
Apr 27, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.查询单个店铺
2.admin查找用户接口增加返回推广码和上线
parent
1a948058
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
9 deletions
+72
-9
AccountPromotionDto.java
...edgec/browserbackend/account/dto/AccountPromotionDto.java
+2
-0
BillQueryResultDto.java
.../edgec/browserbackend/account/dto/BillQueryResultDto.java
+20
-0
AdministratorServiceImpl.java
...ackend/account/service/impl/AdministratorServiceImpl.java
+9
-1
ShopController.java
...gec/browserbackend/browser/controller/ShopController.java
+18
-4
ShopServiceImpl.java
.../browserbackend/browser/service/Impl/ShopServiceImpl.java
+20
-0
ShopService.java
...com/edgec/browserbackend/browser/service/ShopService.java
+3
-4
No files found.
src/main/java/com/edgec/browserbackend/account/dto/AccountPromotionDto.java
View file @
013beeb8
...
...
@@ -2,9 +2,11 @@ package com.edgec.browserbackend.account.dto;
import
com.edgec.browserbackend.account.domain.Account
;
import
com.edgec.browserbackend.account.domain.Promotion
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
java.util.Date
;
@JsonIgnoreProperties
(
ignoreUnknown
=
true
)
public
class
AccountPromotionDto
{
private
String
username
;
private
Date
signupDate
;
...
...
src/main/java/com/edgec/browserbackend/account/dto/BillQueryResultDto.java
View file @
013beeb8
package
com
.
edgec
.
browserbackend
.
account
.
dto
;
import
com.edgec.browserbackend.account.domain.Promotion
;
import
com.edgec.browserbackend.account.domain.UserPrePaidBilling
;
import
org.springframework.data.domain.Page
;
...
...
@@ -18,6 +19,9 @@ public class BillQueryResultDto {
double
childBankTransfer
;
double
childBalanceUsed
;
String
promoter
;
Promotion
promotion
;
public
double
getParentExpense
()
{
return
parentExpense
;
}
...
...
@@ -97,4 +101,20 @@ public class BillQueryResultDto {
public
void
setParentBalanceUsed
(
double
parentBalanceUsed
)
{
this
.
parentBalanceUsed
=
parentBalanceUsed
;
}
public
Promotion
getPromotion
()
{
return
promotion
;
}
public
void
setPromoter
(
String
promoter
)
{
this
.
promoter
=
promoter
;
}
public
String
getPromoter
()
{
return
promoter
;
}
public
void
setPromotion
(
Promotion
promotion
)
{
this
.
promotion
=
promotion
;
}
}
src/main/java/com/edgec/browserbackend/account/service/impl/AdministratorServiceImpl.java
View file @
013beeb8
...
...
@@ -172,6 +172,14 @@ public class AdministratorServiceImpl implements AdministratorService {
billQueryResultDto
.
setParentWithdrawn
(
parentwithdrawn
);
billQueryResultDto
.
setParentBalanceUsed
(
parentbalanceused
);
Account
promoter
=
null
;
if
(
account
.
getPromotionCode
()
!=
null
)
promoter
=
accountRepository
.
findByPromotion
(
account
.
getPromotionCode
());
if
(
promoter
!=
null
)
billQueryResultDto
.
setPromoter
(
promoter
.
getName
());
billQueryResultDto
.
setPromotion
(
account
.
getPromotion
());
return
billQueryResultDto
;
}
...
...
@@ -427,7 +435,7 @@ public class AdministratorServiceImpl implements AdministratorService {
}
}
}
if
(
x
.
getPromotion
().
isSale
())
if
(
finalAccount
.
getPromotion
().
isSale
())
promotion
.
setAllGift
(
promotion
.
getAllGift
()
+
totalCommission
*
0.1
+
secondCommission
*
0.02
);
else
promotion
.
setAllGift
(
promotion
.
getAllGift
()
+
totalCommission
*
0.08
);
...
...
src/main/java/com/edgec/browserbackend/browser/controller/ShopController.java
View file @
013beeb8
...
...
@@ -3,10 +3,7 @@ package com.edgec.browserbackend.browser.controller;
import
com.edgec.browserbackend.account.dto.ResultDto
;
import
com.edgec.browserbackend.browser.ErrorCode.BrowserErrorCode
;
import
com.edgec.browserbackend.browser.domain.Shop
;
import
com.edgec.browserbackend.browser.dto.ShopPageResultDto
;
import
com.edgec.browserbackend.browser.dto.ShopResultDto
;
import
com.edgec.browserbackend.browser.dto.ShopRequestDto
;
import
com.edgec.browserbackend.browser.dto.ShopStringResultDto
;
import
com.edgec.browserbackend.browser.dto.*
;
import
com.edgec.browserbackend.browser.service.IpAndShopService
;
import
com.edgec.browserbackend.browser.service.ShopService
;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
...
...
@@ -230,4 +227,21 @@ public class ShopController {
}
return
resultDto
;
}
@RequestMapping
(
value
=
"/query"
,
method
=
RequestMethod
.
POST
)
public
ResultDto
queryShop
(
Principal
principal
,
@RequestBody
ShopRequestDto
shopRequestDto
)
{
ResultDto
resultDto
=
new
ResultDto
();
try
{
ShopDto
shopDto
=
shopService
.
queryShop
(
principal
.
getName
(),
shopRequestDto
.
getShopId
());
resultDto
.
setData
(
shopDto
);
resultDto
.
setStatus
(
0
);
}
catch
(
ClientRequestException
e
)
{
resultDto
.
setStatus
(-
1
);
Map
<
String
,
Object
>
statusInfo
=
new
HashMap
<>();
statusInfo
.
put
(
"code"
,
e
.
getErrorCode
());
statusInfo
.
put
(
"message"
,
e
.
getMessage
());
resultDto
.
setStatusInfo
(
statusInfo
);
}
return
resultDto
;
}
}
src/main/java/com/edgec/browserbackend/browser/service/Impl/ShopServiceImpl.java
View file @
013beeb8
...
...
@@ -301,6 +301,26 @@ public class ShopServiceImpl implements ShopService {
}
}
@Override
public
ShopDto
queryShop
(
String
username
,
String
shopId
)
{
Account
account
=
accountRepository
.
findByName
(
username
);
if
(
account
==
null
)
{
throw
new
ClientRequestException
(
AccountErrorCode
.
NAMENOTEXIST
);
}
UserShop
userShop
=
userShopRepository
.
findByUsernameAndShopId
(
username
,
shopId
);
if
(
account
.
getPermission
()
<
8
||
userShop
==
null
)
{
throw
new
ClientRequestException
(
AccountErrorCode
.
NOPERMISSION
);
}
Shop
shop
=
shopRepository
.
findById
(
shopId
).
orElse
(
null
);
if
(
shop
==
null
)
{
throw
new
ClientRequestException
(
BrowserErrorCode
.
SHOPNOTEXIST
);
}
IpResource
ipResource
=
ipResourceRepository
.
findByShopIdAndIsDeleted
(
shopId
,
false
);
if
(
ipResource
==
null
)
throw
new
ClientRequestException
(
BrowserErrorCode
.
IPNOTEXIST
);
return
new
ShopDto
(
shop
);
}
@Override
public
ShopPageResultDto
getShopList
(
String
username
,
String
groupId
,
int
page
,
int
amount
,
ShopFilterDto
shopFilterDto
)
{
if
(
amount
>
100
)
...
...
src/main/java/com/edgec/browserbackend/browser/service/ShopService.java
View file @
013beeb8
...
...
@@ -2,10 +2,7 @@ package com.edgec.browserbackend.browser.service;
import
com.edgec.browserbackend.browser.domain.Shop
;
import
com.edgec.browserbackend.browser.domain.ShopSummary
;
import
com.edgec.browserbackend.browser.dto.ShopFilterDto
;
import
com.edgec.browserbackend.browser.dto.ShopPageResultDto
;
import
com.edgec.browserbackend.browser.dto.ShopRequestDto
;
import
com.edgec.browserbackend.browser.dto.ShopResultDto
;
import
com.edgec.browserbackend.browser.dto.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
...
...
@@ -25,6 +22,8 @@ public interface ShopService {
void
assignShops
(
String
username
,
List
<
String
>
shopIds
,
List
<
String
>
users
);
ShopDto
queryShop
(
String
username
,
String
shopId
);
ShopPageResultDto
getShopList
(
String
username
,
String
groupId
,
int
page
,
int
amount
,
ShopFilterDto
shopFilterDto
);
ShopSummary
getShopSummary
(
String
username
);
...
...
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