记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
0017cfd4
Commit
0017cfd4
authored
Oct 26, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码。
parent
6d913325
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
22 deletions
+59
-22
IStoneScoreLogsService.java
...quidnet/service/stone/service/IStoneScoreLogsService.java
+1
-1
application-dev.yml
liquidnet-bus-config/liquidnet-config/application-dev.yml
+2
-0
application-test.yml
liquidnet-bus-config/liquidnet-config/application-test.yml
+2
-0
liquidnet-service-stone.yml
...t-bus-config/liquidnet-config/liquidnet-service-stone.yml
+1
-0
OrderUtils.java
...in/java/com/liquidnet/service/order/utils/OrderUtils.java
+22
-9
StoneUserController.java
...quidnet/service/stone/controller/StoneUserController.java
+18
-1
StoneScoreLogsServiceImpl.java
...service/stone/service/impl/StoneScoreLogsServiceImpl.java
+13
-11
No files found.
liquidnet-bus-api/liquidnet-service-stone-api/src/main/java/com/liquidnet/service/stone/service/IStoneScoreLogsService.java
View file @
0017cfd4
...
...
@@ -57,7 +57,7 @@ public interface IStoneScoreLogsService {
* ]
* @return
*/
ResponseDto
<
HashMap
<
String
,
Object
>>
doTask
(
Integer
taskId
);
ResponseDto
<
HashMap
<
String
,
Object
>>
doTask
(
Integer
taskId
,
String
uid
);
ResponseDto
<
StoneUserVo
>
taskDetail
();
...
...
liquidnet-bus-config/liquidnet-config/application-dev.yml
View file @
0017cfd4
...
...
@@ -74,6 +74,8 @@ liquidnet:
localUrl
:
http://devorder.zhengzai.tv/order/order/syncOrder
candy
:
url
:
http://devcandy.zhengzai.tv/candy
stone
:
url
:
http://devstone.zhengzai.tv/stone
dragon
:
notifyUrl
:
https://devdragon.zhengzai.tv/dragon
platform
:
...
...
liquidnet-bus-config/liquidnet-config/application-test.yml
View file @
0017cfd4
...
...
@@ -69,6 +69,8 @@ liquidnet:
url
:
http://testkylin.zhengzai.tv/kylin
candy
:
url
:
http://testcandy.zhengzai.tv/candy
stone
:
url
:
http://teststone.zhengzai.tv/stone
order
:
adam
:
url
:
http://testadam.zhengzai.tv/adam
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-stone.yml
View file @
0017cfd4
...
...
@@ -123,6 +123,7 @@ global-auth:
-
${liquidnet.info.context}/v2/api-docs*
# -
-
${liquidnet.info.context}/item/**
-
${liquidnet.info.context}/user/inner/**
...
...
liquidnet-bus-service/liquidnet-service-order/liquidnet-service-order-impl/src/main/java/com/liquidnet/service/order/utils/OrderUtils.java
View file @
0017cfd4
...
...
@@ -11,7 +11,9 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import
com.liquidnet.service.adam.constant.AdamRedisConst
;
import
com.liquidnet.service.adam.dto.vo.AdamAddressesVo
;
import
com.liquidnet.service.adam.dto.vo.AdamEntersVo
;
import
com.liquidnet.service.adam.dto.vo.AdamUserInfoSimpleVo
;
import
com.liquidnet.service.adam.dto.vo.AdamUserMemberVo
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.candy.param.BackCouponParam
;
import
com.liquidnet.service.candy.vo.CandyUseResultVo
;
import
com.liquidnet.service.kylin.dto.param.SysDamaiParam
;
...
...
@@ -39,10 +41,12 @@ public class OrderUtils {
@Autowired
private
DataUtils
dataUtils
;
//
@Value("${liquidnet.adam.url}")
//
private String adamUrl;
@Value
(
"${liquidnet.adam.url}"
)
private
String
adamUrl
;
@Value
(
"${liquidnet.candy.url}"
)
private
String
candyUrl
;
@Value
(
"${liquidnet.service.stone.url}"
)
private
String
stoneUrl
;
@Autowired
private
RedisUtil
redisUtil
;
...
...
@@ -146,15 +150,24 @@ public class OrderUtils {
return
surplusGeneral
;
}
public
void
doTask
(
String
uid
)
{
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
header
.
add
(
"Accept"
,
"application/json;charset=UTF-8"
);
MultiValueMap
<
String
,
String
>
params
=
CollectionUtil
.
linkedMultiValueMapStringString
();
params
.
add
(
"taskId"
,
"1"
);
params
.
add
(
"uid"
,
uid
);
String
resultData
=
HttpUtil
.
post
(
"http://devstone.zhengzai.tv"
+
"/user/inner/doTask"
,
params
,
header
);
}
public
AdamUserMemberVo
isMember
(
String
uid
)
{
// String resultData = HttpUtil.get("/adam/member/check/depth?uid=" + uid, null);
// AdamUserMemberVo vo = JsonUtils.fromJson(resultData, AdamUserMemberVo.class);
String
rk
=
AdamRedisConst
.
INFO_USER_MEMBER
.
concat
(
uid
);
AdamUserMemberVo
vo
=
(
AdamUserMemberVo
)
redisUtil
.
get
(
rk
);
if
(
null
!=
vo
&&
vo
.
isActive
())
{
if
(
null
!=
vo
&&
vo
.
isActive
())
{
return
vo
;
}
else
{
}
else
{
return
null
;
}
}
...
...
@@ -199,12 +212,12 @@ public class OrderUtils {
MultiValueMap
<
String
,
String
>
header
=
CollectionUtil
.
linkedMultiValueMapStringString
();
header
.
add
(
"Authorization"
,
"Bearer "
+
CurrentUtil
.
getToken
());
log
.
info
(
"url="
+
candyUrl
+
"/candy-coupon/use"
);
log
.
info
(
"params="
+
JSON
.
toJSONString
(
params
));
log
.
info
(
"url="
+
candyUrl
+
"/candy-coupon/use"
);
log
.
info
(
"params="
+
JSON
.
toJSONString
(
params
));
String
returnData
=
HttpUtil
.
post
(
candyUrl
+
"/candy-coupon/use"
,
params
,
header
);
InnerReturnVo
<
CandyUseResultVo
>
innerReturnVo
=
JsonUtils
.
fromJson
(
returnData
,
new
TypeReference
<
InnerReturnVo
<
CandyUseResultVo
>>()
{
});
log
.
info
(
"returnData="
+
returnData
);
log
.
info
(
"returnData="
+
returnData
);
CandyUseResultVo
candyUseResultVo
=
innerReturnVo
.
getData
();
Integer
type
=
candyUseResultVo
.
getCouType
();
BigDecimal
value
=
candyUseResultVo
.
getValue
();
...
...
@@ -231,11 +244,11 @@ public class OrderUtils {
}
HashMap
<
String
,
Object
>
hashMap
=
CollectionUtil
.
mapStringObject
();
hashMap
.
put
(
"type"
,
type
);
hashMap
.
put
(
"voucher"
,
voucher
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
hashMap
.
put
(
"voucher"
,
voucher
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
return
hashMap
;
}
public
void
backAdvanceCoupon
(
String
advanceCode
,
String
uid
)
{
public
void
backAdvanceCoupon
(
String
advanceCode
,
String
uid
)
{
if
(
advanceCode
!=
null
)
{
backCoupon
(
advanceCode
.
toString
(),
uid
);
}
...
...
liquidnet-bus-service/liquidnet-service-stone/liquidnet-service-stone-impl/src/main/java/com/liquidnet/service/stone/controller/StoneUserController.java
View file @
0017cfd4
...
...
@@ -41,8 +41,25 @@ public class StoneUserController {
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integer"
,
name
=
"taskId"
,
value
=
"任务ID[0-每日任务:签到|1-每日任务:购买演出|2-每日任务:购买商品|3-每日任务:划卡|4-一次性任务:关注公众号|5-一次性任务:完善信息|6-一次性任务:完善头像|7-一次性任务:打开消息推送|8-一次性任务:体验在场]"
,
example
=
""
),
})
public
ResponseDto
<
HashMap
<
String
,
Object
>>
doTask
(
@RequestParam
(
value
=
"taskId"
,
required
=
true
)
Integer
taskId
)
{
return
stoneScoreLogsService
.
doTask
(
taskId
);
if
(
taskId
!=
0
){
return
ResponseDto
.
failure
(
"只能签到"
);
}
return
stoneScoreLogsService
.
doTask
(
taskId
,
null
);
}
@PostMapping
(
"inner/doTask"
)
@ApiOperation
(
"内部做任务接口"
)
@ApiResponse
(
code
=
200
,
message
=
"接口返回对象参数"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integer"
,
name
=
"taskId"
,
value
=
"任务ID[0-每日任务:签到|1-每日任务:购买演出|2-每日任务:购买商品|3-每日任务:划卡|4-一次性任务:关注公众号|5-一次性任务:完善信息|6-一次性任务:完善头像|7-一次性任务:打开消息推送|8-一次性任务:体验在场]"
,
example
=
""
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"uid"
,
value
=
"用户id"
,
example
=
""
),
})
public
ResponseDto
<
HashMap
<
String
,
Object
>>
doTaskInner
(
@RequestParam
(
value
=
"taskId"
,
required
=
true
)
Integer
taskId
,
@RequestParam
(
value
=
"uid"
,
required
=
true
)
String
uid
)
{
return
stoneScoreLogsService
.
doTask
(
taskId
,
uid
);
}
@GetMapping
(
"logs/list"
)
@ApiOperation
(
"积分详情列表"
)
...
...
liquidnet-bus-service/liquidnet-service-stone/liquidnet-service-stone-impl/src/main/java/com/liquidnet/service/stone/service/impl/StoneScoreLogsServiceImpl.java
View file @
0017cfd4
...
...
@@ -76,8 +76,10 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
}
@Override
public
ResponseDto
<
HashMap
<
String
,
Object
>>
doTask
(
Integer
taskId
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
public
ResponseDto
<
HashMap
<
String
,
Object
>>
doTask
(
Integer
taskId
,
String
uid
)
{
if
(
uid
==
null
)
{
uid
=
CurrentUtil
.
getCurrentUid
();
}
StoneUserVo
vo
=
stoneRedisUtils
.
getUserData
(
uid
);
List
<
StoneTaskVo
>
taskList
=
vo
.
getTask
();
boolean
isIn
=
false
;
//标示是否操作
...
...
@@ -120,7 +122,7 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
//mongo
stoneMongoUtils
.
userUpdateByUid
(
vo
);
//redis
stoneRedisUtils
.
setUserData
(
uid
,
vo
);
stoneRedisUtils
.
setUserData
(
uid
,
vo
);
//添加积分
inScore
(
uid
,
score
,
taskId
,
item
.
getTaskName
());
isIn
=
true
;
...
...
@@ -128,12 +130,12 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
}
}
}
if
(
isIn
)
{
HashMap
<
String
,
Object
>
map
=
CollectionUtil
.
mapStringObject
();
map
.
put
(
"score"
,
score
);
map
.
put
(
"count"
,
count
);
if
(
isIn
)
{
HashMap
<
String
,
Object
>
map
=
CollectionUtil
.
mapStringObject
();
map
.
put
(
"score"
,
score
);
map
.
put
(
"count"
,
count
);
return
ResponseDto
.
success
(
map
);
}
else
{
}
else
{
return
ResponseDto
.
failure
(
"任务不存在"
);
}
}
...
...
@@ -172,7 +174,7 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
voList
=
stoneRedisUtils
.
getLogsList
(
uid
);
count
=
voList
.
size
();
}
else
{
HashMap
<
String
,
Object
>
info
=
stoneMongoUtils
.
logList
(
uid
,
page
,
size
);
HashMap
<
String
,
Object
>
info
=
stoneMongoUtils
.
logList
(
uid
,
page
,
size
);
try
{
voList
=
(
List
<
StoneScoreLogs
>)
info
.
get
(
"data"
);
count
=
(
long
)
info
.
get
(
"total"
);
...
...
@@ -207,7 +209,7 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
stoneMongoUtils
.
logCreate
(
logs
);
//mysql 入库 积分日志
queueUtils
.
sendMsgByRedis
(
MQConst
.
StoneQueue
.
STONE_INSERT_LOGS
.
getKey
(),
SqlMapping
.
get
(
"stone_score_logs.insert"
,
logs
.
getLogsId
(),
logs
.
getUid
(),
logs
.
getScore
(),
logs
.
getContent
(),
logs
.
getReason
(),
LocalDateTime
.
now
())
SqlMapping
.
get
(
"stone_score_logs.insert"
,
logs
.
getLogsId
(),
logs
.
getUid
(),
logs
.
getScore
(),
logs
.
getContent
(),
logs
.
getReason
(),
LocalDateTime
.
now
())
);
}
...
...
@@ -226,7 +228,7 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
stoneMongoUtils
.
logCreate
(
logs
);
//mysql 入库 积分日志
queueUtils
.
sendMsgByRedis
(
MQConst
.
StoneQueue
.
STONE_INSERT_LOGS
.
getKey
(),
SqlMapping
.
get
(
"stone_score_logs.insert"
,
logs
.
getLogsId
(),
logs
.
getUid
(),
logs
.
getScore
().
negate
(),
logs
.
getContent
(),
logs
.
getReason
(),
LocalDateTime
.
now
())
SqlMapping
.
get
(
"stone_score_logs.insert"
,
logs
.
getLogsId
(),
logs
.
getUid
(),
logs
.
getScore
().
negate
(),
logs
.
getContent
(),
logs
.
getReason
(),
LocalDateTime
.
now
())
);
}
}
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