Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
ec7ac5e2
Commit
ec7ac5e2
authored
Sep 25, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
f49d992c
aff0dcc5
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
230 additions
and
61 deletions
+230
-61
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+7
-4
IUserService.java
.../com/github/wxiaoqi/security/auth/feign/IUserService.java
+5
-2
AuthService.java
...com/github/wxiaoqi/security/auth/service/AuthService.java
+2
-2
AppAuthServiceImpl.java
...xiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
+4
-4
AuthServiceImpl.java
...b/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
+4
-4
AppUserPositionTempVo.java
...thub/wxiaoqi/security/admin/vo/AppUserPositionTempVo.java
+2
-0
SellingWalletVo.java
...com/github/wxiaoqi/security/admin/vo/SellingWalletVo.java
+20
-0
AppUserPositionTempBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
+2
-1
AppUserSellingWaterBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
+115
-34
UserBusinessBiz.java
...om/github/wxiaoqi/security/admin/biz/UserBusinessBiz.java
+0
-1
AppUserSellingWaterMapper.java
...aoqi/security/admin/mapper/AppUserSellingWaterMapper.java
+3
-0
UserBussinessController.java
.../wxiaoqi/security/admin/rest/UserBussinessController.java
+0
-2
UserSellingWaterController.java
...iaoqi/security/admin/rest/UserSellingWaterController.java
+13
-0
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+4
-4
AppUserSellingWaterMapper.xml
...n/src/main/resources/mapper/AppUserSellingWaterMapper.xml
+45
-2
ActivityRuleBiz.java
.../java/com/xxfc/platform/activity/biz/ActivityRuleBiz.java
+4
-1
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
ec7ac5e2
...
@@ -135,9 +135,11 @@ public class AuthController {
...
@@ -135,9 +135,11 @@ public class AuthController {
return
appAuthService
.
checkBindWechat
(
username
);
return
appAuthService
.
checkBindWechat
(
username
);
}
}
@RequestMapping
(
value
=
"/wxlogin"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/wxlogin"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
,
defaultValue
=
""
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
)
throws
Exception
{
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
,
defaultValue
=
""
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
,
defaultValue
=
"0"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
)
throws
Exception
{
log
.
info
(
openid
+
"----require wxlogin..."
);
log
.
info
(
openid
+
"----require wxlogin..."
);
JSONObject
data
=
appAuthService
.
wxlogin
(
openid
,
isQQ
);
JSONObject
data
=
appAuthService
.
wxlogin
(
openid
,
isQQ
,
code
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
if
(
result
==
null
){
...
@@ -154,10 +156,11 @@ public class AuthController {
...
@@ -154,10 +156,11 @@ public class AuthController {
public
JSONObject
login
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
public
JSONObject
login
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecode
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"1"
)
Integer
type
)
throws
Exception
{
@RequestParam
(
value
=
"type"
,
defaultValue
=
"1"
)
Integer
type
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
)
throws
Exception
{
log
.
info
(
username
+
"----require login..."
);
log
.
info
(
username
+
"----require login..."
);
JSONObject
data
=
appAuthService
.
tlogin
(
username
,
password
,
mobilecode
,
type
);
JSONObject
data
=
appAuthService
.
tlogin
(
username
,
password
,
mobilecode
,
type
,
code
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
if
(
result
==
null
){
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java
View file @
ec7ac5e2
...
@@ -42,12 +42,15 @@ public interface IUserService {
...
@@ -42,12 +42,15 @@ public interface IUserService {
@RequestMapping
(
value
=
"/api/app/user/checkBindWechat"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/app/user/checkBindWechat"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
checkBindWechat
(
@RequestParam
(
value
=
"username"
)
String
username
);
public
JSONObject
checkBindWechat
(
@RequestParam
(
value
=
"username"
)
String
username
);
@RequestMapping
(
value
=
"/api/app/user/wxlogin"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/app/user/wxlogin"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
)
Integer
isQQ
);
public
JSONObject
wxlogin
(
@RequestParam
(
value
=
"openid"
)
String
openid
,
@RequestParam
(
value
=
"isQQ"
)
Integer
isQQ
,
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
);
@RequestMapping
(
value
=
"/api/app/user/login"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/app/user/login"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
login
(
@RequestParam
(
value
=
"username"
)
String
username
,
public
JSONObject
login
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"password"
)
String
password
,
@RequestParam
(
value
=
"password"
)
String
password
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
@RequestParam
(
value
=
"type"
)
Integer
type
);
@RequestParam
(
value
=
"type"
)
Integer
type
,
@RequestParam
(
value
=
""
)
String
code
);
@RequestMapping
(
value
=
"/api/app/user/reset"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/api/app/user/reset"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
reset
(
@RequestParam
(
value
=
"username"
)
String
username
,
public
JSONObject
reset
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
,
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthService.java
View file @
ec7ac5e2
...
@@ -15,8 +15,8 @@ public interface AuthService {
...
@@ -15,8 +15,8 @@ public interface AuthService {
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
)
throws
Exception
;
JSONObject
register
(
String
username
,
String
mobilecode
,
String
password
,
String
code
)
throws
Exception
;
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
)
throws
Exception
;
JSONObject
wxregister
(
String
username
,
String
mobilecode
,
String
password
,
String
nickname
,
String
headimgurl
,
String
openid
,
String
unionid
,
Integer
type
,
Integer
isQQ
,
String
code
)
throws
Exception
;
JSONObject
checkBindWechat
(
String
username
)
throws
Exception
;
JSONObject
checkBindWechat
(
String
username
)
throws
Exception
;
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
)
throws
Exception
;
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
,
String
code
)
throws
Exception
;
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
)
throws
Exception
;
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
,
String
code
)
throws
Exception
;
String
getToken
(
String
username
,
Integer
id
)
throws
Exception
;
String
getToken
(
String
username
,
Integer
id
)
throws
Exception
;
JSONObject
reset
(
String
username
,
String
mobilecode
,
String
password
)
throws
Exception
;
JSONObject
reset
(
String
username
,
String
mobilecode
,
String
password
)
throws
Exception
;
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
View file @
ec7ac5e2
...
@@ -84,13 +84,13 @@ public class AppAuthServiceImpl implements AuthService {
...
@@ -84,13 +84,13 @@ public class AppAuthServiceImpl implements AuthService {
}
}
@Override
@Override
public
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
)
throws
Exception
{
public
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
,
String
code
)
throws
Exception
{
return
userService
.
wxlogin
(
openid
,
isQQ
);
return
userService
.
wxlogin
(
openid
,
isQQ
,
code
);
}
}
@Override
@Override
public
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
)
throws
Exception
{
public
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
,
String
code
)
throws
Exception
{
return
userService
.
login
(
username
,
password
,
mobilecode
,
type
);
return
userService
.
login
(
username
,
password
,
mobilecode
,
type
,
code
);
}
}
@Override
@Override
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
View file @
ec7ac5e2
...
@@ -82,13 +82,13 @@ public class AuthServiceImpl implements AuthService {
...
@@ -82,13 +82,13 @@ public class AuthServiceImpl implements AuthService {
}
}
@Override
@Override
public
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
)
throws
Exception
{
public
JSONObject
wxlogin
(
String
openid
,
Integer
isQQ
,
String
code
)
throws
Exception
{
return
userService
.
wxlogin
(
openid
,
isQQ
);
return
userService
.
wxlogin
(
openid
,
isQQ
,
code
);
}
}
@Override
@Override
public
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
)
throws
Exception
{
public
JSONObject
tlogin
(
String
username
,
String
password
,
String
mobilecode
,
Integer
type
,
String
code
)
throws
Exception
{
return
userService
.
login
(
username
,
password
,
mobilecode
,
type
);
return
userService
.
login
(
username
,
password
,
mobilecode
,
type
,
code
);
}
}
@Override
@Override
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/AppUserPositionTempVo.java
View file @
ec7ac5e2
...
@@ -30,6 +30,8 @@ public class AppUserPositionTempVo {
...
@@ -30,6 +30,8 @@ public class AppUserPositionTempVo {
@ApiModelProperty
(
value
=
"职位名"
)
@ApiModelProperty
(
value
=
"职位名"
)
private
String
positionName
;
private
String
positionName
;
private
Integer
positionId
;
@ApiModelProperty
(
value
=
"数据状态 1:已核销 2:未核销"
)
@ApiModelProperty
(
value
=
"数据状态 1:已核销 2:未核销"
)
private
Integer
status
;
private
Integer
status
;
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/SellingWalletVo.java
View file @
ec7ac5e2
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -57,8 +58,27 @@ public class SellingWalletVo {
...
@@ -57,8 +58,27 @@ public class SellingWalletVo {
@ApiModelProperty
(
"'类别:0-正;1-负(退款时)"
)
@ApiModelProperty
(
"'类别:0-正;1-负(退款时)"
)
private
Integer
status
;
private
Integer
status
;
@JSONField
(
serialize
=
false
)
private
Integer
sourceId
;
@JSONField
(
serialize
=
false
)
private
BigDecimal
commissionnm
;
/**
/**
* 所获佣金
* 所获佣金
*/
*/
private
BigDecimal
commission
;
private
BigDecimal
commission
;
/**
* 订单状态
*/
private
Integer
sellerStatus
;
/**
* 订单文案
*/
private
String
statusText
;
/**
* 是否显示 默认false
*/
private
Boolean
isShow
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPositionTempBiz.java
View file @
ec7ac5e2
...
@@ -128,9 +128,10 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
...
@@ -128,9 +128,10 @@ public class AppUserPositionTempBiz extends BaseBiz<AppUserPositionTempMapper, A
for
(
AppUserPositionTemp
appUserPositionTemp
:
data
)
{
for
(
AppUserPositionTemp
appUserPositionTemp
:
data
)
{
appUserPositionTempVo
=
new
AppUserPositionTempVo
();
appUserPositionTempVo
=
new
AppUserPositionTempVo
();
BeanUtils
.
copyProperties
(
appUserPositionTemp
,
appUserPositionTempVo
);
BeanUtils
.
copyProperties
(
appUserPositionTemp
,
appUserPositionTempVo
);
String
postionName
=
postionMap
==
null
?
""
:
postionMap
.
get
(
appUserPositionTemp
.
getPositionId
()).
getName
();
String
postionName
=
postionMap
==
null
?
""
:
postionMap
.
get
(
appUserPositionTemp
.
getPositionId
())
==
null
?
""
:
postionMap
.
get
(
appUserPositionTemp
.
getPositionId
())
.
getName
();
appUserPositionTempVo
.
setPositionName
(
postionName
);
appUserPositionTempVo
.
setPositionName
(
postionName
);
appUserPositionTempVo
.
setStatus
(
appUserPositionTemp
.
getUserId
()
==
null
?
DataStatus
.
NO_USERED
.
code
:
DataStatus
.
USERED
.
code
);
appUserPositionTempVo
.
setStatus
(
appUserPositionTemp
.
getUserId
()
==
null
?
DataStatus
.
NO_USERED
.
code
:
DataStatus
.
USERED
.
code
);
appUserPositionTempVos
.
add
(
appUserPositionTempVo
);
}
}
dataVO
.
setData
(
appUserPositionTempVos
);
dataVO
.
setData
(
appUserPositionTempVos
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
View file @
ec7ac5e2
...
@@ -105,22 +105,22 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -105,22 +105,22 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---parentId==="
+
parentId
);
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---parentId==="
+
parentId
);
Integer
positionId
=
6
;
Integer
positionId
=
6
;
Integer
level
=
0
;
Integer
level
=
0
;
AppUserPosition
position
=
positionBiz
.
getExtract
(
parentId
);
AppUserPosition
position
=
positionBiz
.
getExtract
(
parentId
);
if
(
position
!=
null
)
{
if
(
position
!=
null
)
{
positionId
=
position
.
getId
();
positionId
=
position
.
getId
();
}
}
AppUserPosition
position1
=
positionBiz
.
getExtract
(
userId
);
AppUserPosition
position1
=
positionBiz
.
getExtract
(
userId
);
if
(
position
!=
null
)
{
if
(
position
!=
null
)
{
level
=
position1
.
getLevel
();
level
=
position1
.
getLevel
();
}
}
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---positionId==="
+
positionId
+
"---level==="
+
level
);
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"---positionId==="
+
positionId
+
"---level==="
+
level
);
if
(
level
!=
0
)
{
if
(
level
!=
0
)
{
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"----无法享受拥金"
);
log
.
info
(
"购买计算用户拥金----payOrderWater--------userId==="
+
userId
+
"----无法享受拥金"
);
return
;
return
;
}
}
BigDecimal
amount
=
new
BigDecimal
(
"0.00"
);
BigDecimal
amount
=
new
BigDecimal
(
"0.00"
);
//商品类型
//商品类型
Integer
orderType
=
0
;
Integer
orderType
=
0
;
for
(
OrderGoodsDTO
goodsDto
:
goodsDTOList
)
{
for
(
OrderGoodsDTO
goodsDto
:
goodsDTOList
)
{
//商品id
//商品id
Integer
goodId
=
goodsDto
.
getGoodId
();
Integer
goodId
=
goodsDto
.
getGoodId
();
...
@@ -164,11 +164,11 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -164,11 +164,11 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
amount
=
amount
.
add
(
commission
);
amount
=
amount
.
add
(
commission
);
}
}
}
}
log
.
info
(
"购买计算用户未入账----payOrderWater--------userId==="
+
parentId
+
"----amount===="
+
amount
+
"--orderType==="
+
orderType
);
log
.
info
(
"购买计算用户未入账----payOrderWater--------userId==="
+
parentId
+
"----amount===="
+
amount
+
"--orderType==="
+
orderType
);
if
(
orderType
==
3
)
{
if
(
orderType
==
3
)
{
finishOrderWater
(
orderWaterDTO
);
finishOrderWater
(
orderWaterDTO
);
}
else
if
(
orderType
==
1
||
orderType
==
2
)
{
}
else
if
(
orderType
==
1
||
orderType
==
2
)
{
myWaterBiz
.
updMyWalletUnbooked
(
parentId
,
amount
,
1
);
myWaterBiz
.
updMyWalletUnbooked
(
parentId
,
amount
,
1
);
}
}
}
}
...
@@ -183,16 +183,16 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -183,16 +183,16 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
List
<
AppUserSellingWater
>
list
=
getWaterList
(
orderId
);
List
<
AppUserSellingWater
>
list
=
getWaterList
(
orderId
);
BigDecimal
amount
=
new
BigDecimal
(
"0.00"
);
BigDecimal
amount
=
new
BigDecimal
(
"0.00"
);
Integer
userId
=
0
;
Integer
userId
=
0
;
Integer
orderType
=
0
;
Integer
orderType
=
0
;
if
(
list
.
size
()
>
0
)
{
if
(
list
.
size
()
>
0
)
{
for
(
AppUserSellingWater
sellingWater
:
list
)
{
for
(
AppUserSellingWater
sellingWater
:
list
)
{
Integer
id
=
sellingWater
.
getId
();
Integer
id
=
sellingWater
.
getId
();
orderType
=
sellingWater
.
getOrderType
();
orderType
=
sellingWater
.
getOrderType
();
userId
=
sellingWater
.
getUserId
();
userId
=
sellingWater
.
getUserId
();
sellingWater
.
setWaiting
(
1
);
sellingWater
.
setWaiting
(
1
);
updateById
(
sellingWater
);
updateById
(
sellingWater
);
BigDecimal
commission
=
sellingWater
.
getCommission
();
BigDecimal
commission
=
sellingWater
.
getCommission
();
log
.
info
(
"订单完成计算用户拥金----finishOrderWater----id===="
+
id
+
"---commission=="
+
commission
+
"----orderType==="
+
orderType
);
log
.
info
(
"订单完成计算用户拥金----finishOrderWater----id===="
+
id
+
"---commission=="
+
commission
+
"----orderType==="
+
orderType
);
amount
=
amount
.
add
(
commission
);
amount
=
amount
.
add
(
commission
);
}
}
...
@@ -200,14 +200,14 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -200,14 +200,14 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
//更新钱包
//更新钱包
if
(
r
==
1
&&
userId
>
0
)
{
if
(
r
==
1
&&
userId
>
0
)
{
MyWalletDetail
detail
=
new
MyWalletDetail
();
MyWalletDetail
detail
=
new
MyWalletDetail
();
detail
.
setUserId
(
userId
);
detail
.
setUserId
(
userId
);
detail
.
setAmount
(
amount
);
detail
.
setAmount
(
amount
);
detail
.
setCono
(
orderId
);
detail
.
setCono
(
orderId
);
detail
.
setSource
(
1
);
detail
.
setSource
(
1
);
myWaterBiz
.
updMyWater
(
detail
);
myWaterBiz
.
updMyWater
(
detail
);
if
(
orderType
==
1
||
orderType
==
2
)
{
if
(
orderType
==
1
||
orderType
==
2
)
{
myWaterBiz
.
updMyWalletUnbooked
(
userId
,
amount
,
2
);
myWaterBiz
.
updMyWalletUnbooked
(
userId
,
amount
,
2
);
}
}
}
}
...
@@ -228,11 +228,11 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -228,11 +228,11 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
BigDecimal
amount
=
new
BigDecimal
(
"0.00"
);
BigDecimal
amount
=
new
BigDecimal
(
"0.00"
);
BigDecimal
unbooked
=
new
BigDecimal
(
"0.00"
);
BigDecimal
unbooked
=
new
BigDecimal
(
"0.00"
);
Integer
userId
=
0
;
Integer
userId
=
0
;
Integer
orderType
=
0
;
Integer
orderType
=
0
;
if
(
list
.
size
()
>
0
)
{
if
(
list
.
size
()
>
0
)
{
for
(
AppUserSellingWater
sellingWater
:
list
)
{
for
(
AppUserSellingWater
sellingWater
:
list
)
{
Integer
id
=
sellingWater
.
getId
();
Integer
id
=
sellingWater
.
getId
();
orderType
=
sellingWater
.
getOrderType
();
orderType
=
sellingWater
.
getOrderType
();
userId
=
sellingWater
.
getUserId
();
userId
=
sellingWater
.
getUserId
();
sellingWater
.
setWaiting
(
1
);
sellingWater
.
setWaiting
(
1
);
updateById
(
sellingWater
);
updateById
(
sellingWater
);
...
@@ -240,22 +240,22 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -240,22 +240,22 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
sellingWater
.
setStatus
(
1
);
sellingWater
.
setStatus
(
1
);
insertSelective
(
sellingWater
);
insertSelective
(
sellingWater
);
BigDecimal
commission
=
sellingWater
.
getCommission
();
BigDecimal
commission
=
sellingWater
.
getCommission
();
log
.
info
(
"订单完成计算用户拥金----refundOrderWater----id===="
+
id
+
"---commission=="
+
commission
+
"---orderType===="
+
orderType
);
log
.
info
(
"订单完成计算用户拥金----refundOrderWater----id===="
+
id
+
"---commission=="
+
commission
+
"---orderType===="
+
orderType
);
unbooked
=
unbooked
.
add
(
commission
);
unbooked
=
unbooked
.
add
(
commission
);
}
}
log
.
info
(
"订单完成计算用户拥金----refundOrderWater----orderId===="
+
orderId
+
"---amount=="
+
amount
+
"---unbooked==="
+
unbooked
);
log
.
info
(
"订单完成计算用户拥金----refundOrderWater----orderId===="
+
orderId
+
"---amount=="
+
amount
+
"---unbooked==="
+
unbooked
);
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
int
r
=
amount
.
compareTo
(
BigDecimal
.
ZERO
);
//更新钱包
//更新钱包
if
(
r
==
1
&&
userId
>
0
)
{
if
(
r
==
1
&&
userId
>
0
)
{
MyWalletDetail
detail
=
new
MyWalletDetail
();
MyWalletDetail
detail
=
new
MyWalletDetail
();
detail
.
setUserId
(
userId
);
detail
.
setUserId
(
userId
);
detail
.
setAmount
(
amount
);
detail
.
setAmount
(
amount
);
detail
.
setCono
(
orderId
);
detail
.
setCono
(
orderId
);
detail
.
setSource
(
1
);
detail
.
setSource
(
1
);
myWaterBiz
.
updMyWater
(
detail
);
myWaterBiz
.
updMyWater
(
detail
);
}
}
if
(
orderType
==
1
||
orderType
==
2
)
{
if
(
orderType
==
1
||
orderType
==
2
)
{
myWaterBiz
.
updMyWalletUnbooked
(
userId
,
unbooked
,
2
);
myWaterBiz
.
updMyWalletUnbooked
(
userId
,
unbooked
,
2
);
}
}
}
}
...
@@ -271,8 +271,8 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -271,8 +271,8 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
}
}
public
PageDataVO
<
UserIncomeBo
>
findMemberIdAndIncomeMapByMemberIds
(
Integer
parentId
,
Integer
pageNo
,
Integer
pageSize
)
{
public
PageDataVO
<
UserIncomeBo
>
findMemberIdAndIncomeMapByMemberIds
(
Integer
parentId
,
Integer
pageNo
,
Integer
pageSize
)
{
return
PageDataVO
.
pageInfo
(
pageNo
,
pageSize
,()->
mapper
.
accquireIncomeByMemberIds
(
parentId
));
return
PageDataVO
.
pageInfo
(
pageNo
,
pageSize
,
()
->
mapper
.
accquireIncomeByMemberIds
(
parentId
));
}
}
public
SellingWalletPagVo
findSellingWaterPageByWaiting
(
Integer
waiting
,
Integer
userId
,
Integer
pageNo
,
Integer
pageSize
)
{
public
SellingWalletPagVo
findSellingWaterPageByWaiting
(
Integer
waiting
,
Integer
userId
,
Integer
pageNo
,
Integer
pageSize
)
{
...
@@ -297,7 +297,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -297,7 +297,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
return
sellingWalletPagVo
;
return
sellingWalletPagVo
;
}
}
List
<
Integer
>
memberIds
=
appUserSellingWaters
.
stream
().
map
(
AppUserSellingWater:
:
getSourceId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
memberIds
=
appUserSellingWaters
.
stream
().
map
(
AppUserSellingWater:
:
getSourceId
).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
Integer
,
AppUserLogin
>
userIdAndAppUserLoginMap
=
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
memberIds
);
Map
<
Integer
,
AppUserLogin
>
userIdAndAppUserLoginMap
=
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
memberIds
);
Map
<
Integer
,
AppUserDetail
>
userIdAndAppUserDetailMap
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
memberIds
);
Map
<
Integer
,
AppUserDetail
>
userIdAndAppUserDetailMap
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
memberIds
);
...
@@ -343,8 +343,89 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -343,8 +343,89 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
public
void
deleteByMemberIds
(
Collection
<
Integer
>
userIds
)
{
public
void
deleteByMemberIds
(
Collection
<
Integer
>
userIds
)
{
Example
example
=
new
Example
(
AppUserSellingWater
.
class
);
Example
example
=
new
Example
(
AppUserSellingWater
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
orIn
(
"sourceId"
,
userIds
);
criteria
.
orIn
(
"sourceId"
,
userIds
);
criteria
.
orIn
(
"userId"
,
userIds
);
criteria
.
orIn
(
"userId"
,
userIds
);
mapper
.
deleteByExample
(
example
);
mapper
.
deleteByExample
(
example
);
}
}
public
SellingWalletPagVo
findSellingWaterPageForAppByWaiting
(
Integer
wating
,
Integer
userId
,
Integer
pageNo
,
Integer
pageSize
)
{
SellingWalletPagVo
sellingWalletPagVo
=
new
SellingWalletPagVo
();
PageDataVO
<
SellingWalletVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
pageNo
,
pageSize
,
()
->
mapper
.
selectSellerWalterByUserIdAndWating
(
userId
,
wating
));
List
<
SellingWalletVo
>
data
=
pageDataVO
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
data
))
{
sellingWalletPagVo
.
setPageNum
(
pageNo
);
sellingWalletPagVo
.
setPageSize
(
pageSize
);
sellingWalletPagVo
.
setSellingWaters
(
Collections
.
EMPTY_LIST
);
sellingWalletPagVo
.
setTotalCount
(
0
);
sellingWalletPagVo
.
setTotalPage
(
0
);
return
sellingWalletPagVo
;
}
List
<
Integer
>
memberIds
=
data
.
stream
().
map
(
SellingWalletVo:
:
getSourceId
).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
Integer
,
AppUserLogin
>
userIdAndAppUserLoginMap
=
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
memberIds
);
Map
<
Integer
,
AppUserDetail
>
userIdAndAppUserDetailMap
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
memberIds
);
for
(
SellingWalletVo
sellingWalletVo
:
data
)
{
String
username
=
userIdAndAppUserLoginMap
.
get
(
sellingWalletVo
.
getSourceId
()).
getUsername
();
sellingWalletVo
.
setUsername
(
username
);
if
(
userIdAndAppUserDetailMap
!=
null
)
{
AppUserDetail
appUserDetail
=
userIdAndAppUserDetailMap
.
get
(
sellingWalletVo
.
getSourceId
());
sellingWalletVo
.
setNickName
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getNickname
());
sellingWalletVo
.
setHeadUrl
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getHeadimgurl
());
}
//取消单
if
(
sellingWalletVo
.
getSellerStatus
()==
1
)
{
sellingWalletVo
.
setSellerStatus
(
SellerWallterStatus
.
CANCEL
.
getCode
());
sellingWalletVo
.
setStatusText
(
SellerWallterStatus
.
CANCEL
.
getText
());
sellingWalletVo
.
setIsShow
(
true
);
}
else
{
if
(
sellingWalletVo
.
getWaiting
()==
SellerWallterStatus
.
POST
.
getCode
()){
sellingWalletVo
.
setSellerStatus
(
SellerWallterStatus
.
POST
.
getCode
());
sellingWalletVo
.
setStatusText
(
SellerWallterStatus
.
POST
.
getText
());
sellingWalletVo
.
setIsShow
(
false
);
}
if
(
sellingWalletVo
.
getWaiting
()==
SellerWallterStatus
.
NO_POST
.
getCode
()){
sellingWalletVo
.
setSellerStatus
(
SellerWallterStatus
.
NO_POST
.
getCode
());
sellingWalletVo
.
setStatusText
(
SellerWallterStatus
.
NO_POST
.
getText
());
sellingWalletVo
.
setIsShow
(
false
);
}
}
}
sellingWalletPagVo
.
setPageNum
(
pageNo
);
sellingWalletPagVo
.
setPageSize
(
pageSize
);
sellingWalletPagVo
.
setSellingWaters
(
data
);
sellingWalletPagVo
.
setTotalCount
(
pageDataVO
.
getTotalCount
().
intValue
());
sellingWalletPagVo
.
setTotalPage
(
pageDataVO
.
getTotalPage
());
return
sellingWalletPagVo
;
}
private
enum
SellerWallterStatus
{
CANCEL
(
2
,
"取消订单"
),
POST
(
1
,
"已入账"
),
NO_POST
(
0
,
"未入账"
);
private
int
code
;
private
String
text
;
SellerWallterStatus
(
int
code
,
String
text
)
{
this
.
code
=
code
;
this
.
text
=
text
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
String
getText
()
{
return
text
;
}
public
void
setText
(
String
text
)
{
this
.
text
=
text
;
}
}
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserBusinessBiz.java
View file @
ec7ac5e2
...
@@ -5,7 +5,6 @@ import com.github.wxiaoqi.security.admin.bo.UserIncomeBo;
...
@@ -5,7 +5,6 @@ import com.github.wxiaoqi.security.admin.bo.UserIncomeBo;
import
com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo
;
import
com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo
;
import
com.github.wxiaoqi.security.admin.entity.AppUserDetail
;
import
com.github.wxiaoqi.security.admin.entity.AppUserDetail
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelation
;
import
com.github.wxiaoqi.security.admin.vo.UserTeamMemberVo
;
import
com.github.wxiaoqi.security.admin.vo.UserTeamMemberVo
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserSellingWaterMapper.java
View file @
ec7ac5e2
...
@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.admin.mapper;
...
@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.admin.mapper;
import
com.github.wxiaoqi.security.admin.bo.UserIncomeBo
;
import
com.github.wxiaoqi.security.admin.bo.UserIncomeBo
;
import
com.github.wxiaoqi.security.admin.entity.AppUserSellingWater
;
import
com.github.wxiaoqi.security.admin.entity.AppUserSellingWater
;
import
com.github.wxiaoqi.security.admin.vo.SellingWalletVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
...
@@ -20,4 +21,6 @@ public interface AppUserSellingWaterMapper extends Mapper<AppUserSellingWater> {
...
@@ -20,4 +21,6 @@ public interface AppUserSellingWaterMapper extends Mapper<AppUserSellingWater> {
List
<
UserIncomeBo
>
accquireIncomeByMemberIds
(
@Param
(
"parentId"
)
Integer
parentId
);
List
<
UserIncomeBo
>
accquireIncomeByMemberIds
(
@Param
(
"parentId"
)
Integer
parentId
);
BigDecimal
selectTotalIncomeByUserId
(
@Param
(
"userId"
)
Integer
userId
);
BigDecimal
selectTotalIncomeByUserId
(
@Param
(
"userId"
)
Integer
userId
);
List
<
SellingWalletVo
>
selectSellerWalterByUserIdAndWating
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"wating"
)
Integer
wating
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/UserBussinessController.java
View file @
ec7ac5e2
...
@@ -2,14 +2,12 @@ package com.github.wxiaoqi.security.admin.rest;
...
@@ -2,14 +2,12 @@ package com.github.wxiaoqi.security.admin.rest;
import
com.github.wxiaoqi.security.admin.biz.UserBusinessBiz
;
import
com.github.wxiaoqi.security.admin.biz.UserBusinessBiz
;
import
com.github.wxiaoqi.security.admin.bo.PromoteBO
;
import
com.github.wxiaoqi.security.admin.bo.PromoteBO
;
import
com.github.wxiaoqi.security.admin.bo.UserTeamMemberBo
;
import
com.github.wxiaoqi.security.admin.vo.UserTeamMemberVo
;
import
com.github.wxiaoqi.security.admin.vo.UserTeamMemberVo
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/UserSellingWaterController.java
View file @
ec7ac5e2
...
@@ -48,4 +48,17 @@ public class UserSellingWaterController {
...
@@ -48,4 +48,17 @@ public class UserSellingWaterController {
}
}
}
}
@GetMapping
(
"/pagea"
)
public
ObjectRestResponse
<
SellingWalletPagVo
>
findSellingWaterPagea
(
@RequestParam
(
required
=
false
,
value
=
"type"
)
Integer
wating
,
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
HttpServletRequest
request
)
{
try
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
SellingWalletPagVo
sellingWalletPagVo
=
appUserSellingWaterBiz
.
findSellingWaterPageForAppByWaiting
(
wating
,
Integer
.
valueOf
(
infoFromToken
.
getId
()),
pageNo
,
pageSize
);
return
ObjectRestResponse
.
succ
(
sellingWalletPagVo
);
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
e
);
}
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
ec7ac5e2
...
@@ -316,8 +316,8 @@ public class AppPermissionService {
...
@@ -316,8 +316,8 @@ public class AppPermissionService {
}*/
}*/
//临时会员绑定
//临时会员绑定
insertUserMemberByUserIdAndPhone
(
userid
,
username
);
insertUserMemberByUserIdAndPhone
(
userid
,
username
);
/
*/
/参加新人活动
//参加新人活动
jionActivity(userid);
*/
jionActivity
(
userid
);
//创建钱包
//创建钱包
walletBiz
.
createWalletByUserId
(
appUserLogin
.
getId
());
walletBiz
.
createWalletByUserId
(
appUserLogin
.
getId
());
// 登录结果要做做统一处理
// 登录结果要做做统一处理
...
@@ -950,8 +950,8 @@ public class AppPermissionService {
...
@@ -950,8 +950,8 @@ public class AppPermissionService {
relationBiz
.
bindByUserId
(
userid
,
small_id
);
relationBiz
.
bindByUserId
(
userid
,
small_id
);
//发送短信通知用户
//发送短信通知用户
thirdFeign
.
sendCode
(
username
,
password
,
SystemConfig
.
TEMPLATECODE
);
thirdFeign
.
sendCode
(
username
,
password
,
SystemConfig
.
TEMPLATECODE
);
/
* /
/参加新人活动
//参加新人活动
jionActivity(userid);
*/
jionActivity
(
userid
);
// 登录结果要做做统一处理
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
null
,
null
,
2
);
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
,
null
,
null
,
2
);
// 到im注册,获取返回结果
// 到im注册,获取返回结果
...
...
ace-modules/ace-admin/src/main/resources/mapper/AppUserSellingWaterMapper.xml
View file @
ec7ac5e2
...
@@ -7,14 +7,14 @@
...
@@ -7,14 +7,14 @@
SELECT
SELECT
aur.user_id,
aur.user_id,
aur.bind_time as `leagueTime`,
aur.bind_time as `leagueTime`,
ausww.income
IFNULL(ausww.income,0) AS `income`
FROM
FROM
`app_user_relation` AS `aur`
`app_user_relation` AS `aur`
LEFT JOIN (SELECT DISTINCT
LEFT JOIN (SELECT DISTINCT
`source_id` AS userId,
`source_id` AS userId,
IFNULL(
IFNULL(
(
(
( SELECT
SUM( commission ) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 0 AND `waiting` = 1 ) - ( SELECT SUM( commission ) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 1 AND `waiting
` = 1 )
( SELECT
IFNULL(SUM( commission ),0) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 0 ) - ( SELECT IFNULL(SUM( commission ),0) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status
` = 1 )
),
),
0
0
) AS `income`
) AS `income`
...
@@ -31,4 +31,47 @@ FROM
...
@@ -31,4 +31,47 @@ FROM
( SELECT IFNULL(SUM( commission ),0) AS upIncome FROM `app_user_selling_water` WHERE STATUS = 0 AND `user_id` = #{userId} ) AS `auswu`,
( SELECT IFNULL(SUM( commission ),0) AS upIncome FROM `app_user_selling_water` WHERE STATUS = 0 AND `user_id` = #{userId} ) AS `auswu`,
( SELECT IFNULL(SUM( commission ),0) AS `dowIncome` FROM `app_user_selling_water` WHERE STATUS = 1 AND `user_id` = #{userId} ) AS `auswd`;
( SELECT IFNULL(SUM( commission ),0) AS `dowIncome` FROM `app_user_selling_water` WHERE STATUS = 1 AND `user_id` = #{userId} ) AS `auswd`;
</select>
</select>
<select
id=
"selectSellerWalterByUserIdAndWating"
resultType=
"com.github.wxiaoqi.security.admin.vo.SellingWalletVo"
>
<!-- SELECT
*
FROM
(
SELECT
ausw.*,
IFNULL( ausw.commission, 0 ) - IFNULL( auswt.commission, 0 ) AS `commissionnm`,
auswt.status AS sellerStatus,
IFNULL(auswt.status,0) AS `isShow`
FROM
( SELECT * FROM `app_user_selling_water` WHERE STATUS = 0 AND `user_id`=#{userId} <if test="wating!=null">
AND `waiting`=#{wating} <!–AND `status`=0–>
</if>) AS `ausw`
LEFT JOIN ( SELECT * FROM `app_user_selling_water` WHERE STATUS = 1 AND `user_id`=#{userId} <if
test="wating!=null">
AND `waiting`=#{wating} <!–AND `status`=0–>
</if>) AS `auswt` ON auswt.order_no = ausw.order_no
) AS `auswres`
ORDER BY crt_time DESC-->
SELECT w.*,o.commission as commission ,o.type AS `sellerStatus` FROM (
SELECT t.order_no,IFNULL(SUM(t.z),0)-IFNULL(SUM(t.f),0) as commission,IF(SUM(t.f)>0,'1',0)as type FROM (
SELECT order_no,commission as z,0 as f FROM app_user_selling_water WHERE user_id=#{userId}
AND `status`=0 and commission>0
UNION
SELECT order_no,0 as z,commission as f FROM app_user_selling_water WHERE user_id=#{userId}
AND `status`=1 and commission>0
) as t
GROUP BY t.order_no
) o LEFT JOIN ( SELECT DISTINCT order_no,user_id,source_id,order_type,img,price,title,waiting,`crt_time` FROM
app_user_selling_water ) w
ON o.order_no=w.order_no
where 1=1
<if
test=
"wating!=null"
>
and `waiting`= #{wating} and
<![CDATA[
o.`type`<>
1 ]]>
</if>
ORDER BY `crt_time`
</select>
</mapper>
</mapper>
\ No newline at end of file
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/ActivityRuleBiz.java
View file @
ec7ac5e2
...
@@ -64,9 +64,12 @@ public class ActivityRuleBiz extends BaseBiz<ActivityRuleMapper,ActivityRule> {
...
@@ -64,9 +64,12 @@ public class ActivityRuleBiz extends BaseBiz<ActivityRuleMapper,ActivityRule> {
if
(
array
.
size
()>
0
){
if
(
array
.
size
()>
0
){
for
(
int
i
=
0
;
i
<
array
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
array
.
size
();
i
++){
Integer
id
=
array
.
getJSONObject
(
i
).
getInteger
(
"id"
);
Integer
id
=
array
.
getJSONObject
(
i
).
getInteger
(
"id"
);
Coupon
coupon
=
couponBiz
.
selectById
(
id
);
if
(
coupon
!=
null
&&
coupon
.
getIsDel
()==
0
&&
coupon
.
getStatus
()==
1
){
coupons
.
add
(
couponBiz
.
selectById
(
id
));
coupons
.
add
(
couponBiz
.
selectById
(
id
));
}
}
}
}
}
ruleVo
.
setCoupons
(
coupons
);
ruleVo
.
setCoupons
(
coupons
);
}
}
}
}
...
...
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