记得上下班打卡 | 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
84605c46
Commit
84605c46
authored
Aug 01, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
开发前端获取活动详情
parent
1b25182b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
1 deletion
+127
-1
pom.xml
...uidnet-service-kylin/liquidnet-service-kylin-impl/pom.xml
+5
-0
KylinRecommendActiveServiceImpl.java
...e/kylin/service/impl/KylinRecommendActiveServiceImpl.java
+59
-1
KylinRedisUtils.java
...va/com/liquidnet/service/kylin/utils/KylinRedisUtils.java
+63
-0
No files found.
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/pom.xml
View file @
84605c46
...
...
@@ -38,6 +38,11 @@
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.liquidnet
</groupId>
<artifactId>
liquidnet-service-goblin-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependencies>
<build>
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/KylinRecommendActiveServiceImpl.java
View file @
84605c46
...
...
@@ -6,6 +6,7 @@ import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo;
import
com.liquidnet.service.kylin.entity.KylinRecommendActive
;
import
com.liquidnet.service.kylin.service.IKylinRecommendActiveService
;
import
com.liquidnet.service.kylin.utils.DataUtils
;
import
com.liquidnet.service.kylin.utils.KylinRedisUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -22,6 +23,8 @@ import java.util.List;
public
class
KylinRecommendActiveServiceImpl
implements
IKylinRecommendActiveService
{
@Autowired
private
DataUtils
dataUtils
;
@Autowired
private
KylinRedisUtils
kylinRedisUtils
;
@Override
public
List
<
KylinRecommendActiveVo
>
getRecommendById
(
List
<
KylinRecommendActive
>
list
)
{
...
...
@@ -34,8 +37,12 @@ public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveSer
if
(
kylinRecommendActiveVo
.
getActiveType
()==
3
){
//演出
KylinPerformanceVo
performancesInfo
=
dataUtils
.
getPerformanceVo
(
kylinRecommendActiveVo
.
getActiveBindId
());
}
else
if
(
kylinRecommendActiveVo
.
getActiveType
()==
1
||
kylinRecommendActiveVo
.
getActiveType
()==
4
){
}
else
if
(
kylinRecommendActiveVo
.
getActiveType
()==
1
){
//NFT
}
else
if
(
kylinRecommendActiveVo
.
getActiveType
()==
4
){
//商品
kylinRedisUtils
.
getGoodsInfoVo
(
kylinRecommendActiveVo
.
getActiveBindId
());
}
else
if
(
kylinRecommendActiveVo
.
getActiveType
()==
2
){
}
...
...
@@ -45,4 +52,55 @@ public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveSer
}
return
null
;
}
/*public GoblinNftGoodsSkuInfoVo getNft(String skuId){
LocalDateTime now = LocalDateTime.now();
HashMap<String, Object> map = kylinRedisUtils.getGoodsSkuInfoVo(now, skuId);
if (null == map) {
return null;
}
GoblinGoodsSkuInfoVo skuInfoVo = (GoblinGoodsSkuInfoVo) map.get("vo");
Integer tagType = (Integer) map.get("tagType");
String listId = (String) map.get("listId");
LocalDateTime baseSaleStartTime = (LocalDateTime) map.get("baseSaleStartTime");
LocalDateTime nextSaleStartTime = (LocalDateTime) map.get("nextSaleStartTime");
if (goblinRedisUtils.getSkuAllStatusShow(skuInfoVo)) {
//获取预约相关
AnticipateValueVo anticipateValueVo = goblinGoodsAnticipateMgService.getAnticipateValueBySkuId(skuId, 1);
GoblinNftGoodsSkuInfoVo nftGoodsSkuInfoVo = GoblinNftGoodsSkuInfoVo.getNew().copy(skuInfoVo, anticipateValueVo);
// 限购数量
Integer buyCount = 0;
String userId = CurrentUtil.getCurrentUid();
if (StringUtils.isNotBlank(userId)) {
buyCount = goblinRedisUtils.getSkuCountByUid(userId, skuId);
}
if (null != skuInfoVo.getBuyLimit() && 0 != skuInfoVo.getBuyLimit()) {
nftGoodsSkuInfoVo.setCanBuyNum(skuInfoVo.getBuyLimit() - buyCount);
}
// spu信息
GoblinGoodsInfoVo goodsInfoVo = goblinRedisUtils.getGoodsInfoVo(skuInfoVo.getSpuId());
GoblinNftGoodsDetailSpuInfoVo nftGoodsDetailSpuInfoVo = GoblinNftGoodsDetailSpuInfoVo.getNew().copy(goodsInfoVo);
nftGoodsSkuInfoVo.setGoblinNftGoodsDetailSpuInfoVo(nftGoodsDetailSpuInfoVo);
// 库存
HashMap<String, Integer> stockHashMap = goblinOrderUtils.getIsStock(listId, skuId, skuInfoVo.getUnbox(), skuInfoVo.getSoldoutStatus(), goodsInfoVo.getSkuIdList());
nftGoodsSkuInfoVo.setIsStock(stockHashMap.get("isStock"));
// 总库存
if (skuInfoVo.getUnbox().equals("1")) {
nftGoodsSkuInfoVo.setSkuStock(stockHashMap.get("totalStock"));
}
// 系统时间
nftGoodsSkuInfoVo.setSystime(LocalDateTime.now());
nftGoodsSkuInfoVo.setTagType(tagType);
nftGoodsSkuInfoVo.setListId(listId);
nftGoodsSkuInfoVo.setBaseSaleStartTime(baseSaleStartTime);
nftGoodsSkuInfoVo.setNextSaleStartTime(nextSaleStartTime);
// 是否开启兑换
nftGoodsSkuInfoVo.setIsExchange(goblinRedisUtils.getIsExchange(skuId));
// 待支付订单数量
nftGoodsSkuInfoVo.setNotPayNum(goblinRedisUtils.getNotPayNum(skuId, listId));
return nftGoodsSkuInfoVo;
} else {
return null;
}
}*/
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/utils/KylinRedisUtils.java
0 → 100644
View file @
84605c46
package
com
.
liquidnet
.
service
.
kylin
.
utils
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.service.goblin.constant.GoblinRedisConst
;
import
com.liquidnet.service.goblin.constant.GoblinStatusConst
;
import
com.liquidnet.service.goblin.dto.vo.GoblinGoodsInfoVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Slf4j
@Component
public
class
KylinRedisUtils
{
@Autowired
RedisUtil
redisUtil
;
private
int
randomMax
=
10
;
public
void
del
(
String
...
keys
)
{
redisUtil
.
del
(
keys
);
}
/**
* 商品基础信息
*
* @param spuId 商品ID
* @return GoblinGoodsInfoVo
*/
public
GoblinGoodsInfoVo
getGoodsInfoVo
(
String
spuId
)
{
String
pre
=
GoblinStatusConst
.
MarketPreStatus
.
getPre
(
spuId
);
if
(
pre
!=
null
&&
pre
.
equals
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
()))
{
String
[]
spuSplitArr
=
spuId
.
split
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
());
String
rk
=
GoblinRedisConst
.
BASIC_GOODS
.
concat
(
spuSplitArr
[
0
]);
GoblinGoodsInfoVo
vo
=
(
GoblinGoodsInfoVo
)
redisUtil
.
get
(
rk
);
if
(
vo
==
null
)
{
return
vo
;
}
String
marketrk
=
GoblinRedisConst
.
BASIC_GOODS
.
concat
(
spuId
);
GoblinGoodsInfoVo
marketVo
=
(
GoblinGoodsInfoVo
)
redisUtil
.
get
(
marketrk
);
if
(
marketVo
==
null
)
{
return
marketVo
;
}
vo
.
setSpuId
(
marketVo
.
getSpuId
());
List
<
String
>
skuIdList
=
CollectionUtil
.
linkedListString
();
for
(
String
skuIds
:
vo
.
getSkuIdList
())
{
skuIdList
.
add
(
skuIds
.
concat
(
pre
).
concat
(
spuSplitArr
[
1
]));
}
vo
.
setSkuIdList
(
skuIdList
);
vo
.
setPriceGe
(
marketVo
.
getPriceGe
());
vo
.
setPriceLe
(
marketVo
.
getPriceLe
());
vo
.
setMarketId
(
marketVo
.
getMarketId
());
vo
.
setDelFlg
(
marketVo
.
getDelFlg
().
equals
(
"1"
)
?
marketVo
.
getDelFlg
()
:
vo
.
getDelFlg
());
return
vo
;
}
else
{
String
rk
=
GoblinRedisConst
.
BASIC_GOODS
.
concat
(
spuId
);
GoblinGoodsInfoVo
vo
=
(
GoblinGoodsInfoVo
)
redisUtil
.
get
(
rk
);
return
vo
;
}
}
}
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