记得上下班打卡 | 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
dd486332
Commit
dd486332
authored
Aug 10, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kylin返回前端 做效验。
parent
4553140b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
10 deletions
+83
-10
KylinRecommendActiveRelationVo.java
.../service/kylin/dto/vo/KylinRecommendActiveRelationVo.java
+2
-0
IKylinRecommendActiveService.java
...t/service/kylin/service/IKylinRecommendActiveService.java
+2
-1
KylinRecommendActiveController.java
...vice/kylin/controller/KylinRecommendActiveController.java
+9
-6
KylinRecommendActiveServiceImpl.java
...e/kylin/service/impl/KylinRecommendActiveServiceImpl.java
+70
-3
No files found.
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/vo/KylinRecommendActiveRelationVo.java
View file @
dd486332
...
...
@@ -83,6 +83,8 @@ public class KylinRecommendActiveRelationVo implements Serializable {
private
GoblinMixAppDetailsVo
goblinMixAppDetailsVo
;
private
boolean
isCount
;
private
static
final
KylinRecommendActiveRelationVo
obj
=
new
KylinRecommendActiveRelationVo
();
public
static
KylinRecommendActiveRelationVo
getNew
()
{
...
...
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/service/IKylinRecommendActiveService.java
View file @
dd486332
...
...
@@ -3,11 +3,12 @@ package com.liquidnet.service.kylin.service;
import
com.liquidnet.service.kylin.dto.vo.KylinRecommendActiveVo
;
import
com.liquidnet.service.kylin.entity.KylinRecommendActive
;
import
java.text.ParseException
;
import
java.util.List
;
/**
* 推荐活动接口
*/
public
interface
IKylinRecommendActiveService
{
KylinRecommendActiveVo
getRecommendById
(
List
<
KylinRecommendActive
>
list
);
KylinRecommendActiveVo
getRecommendById
(
List
<
KylinRecommendActive
>
list
)
throws
ParseException
;
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/controller/KylinRecommendActiveController.java
View file @
dd486332
...
...
@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -39,7 +40,7 @@ public class KylinRecommendActiveController {
@PostMapping
(
"getRecommendById"
)
@ApiOperation
(
"获取推荐活动详情"
)
public
ResponseDto
<
KylinRecommendActiveVo
>
getRecommendById
(
@RequestParam
(
value
=
"bindId"
)
String
bindId
)
{
public
ResponseDto
<
KylinRecommendActiveVo
>
getRecommendById
(
@RequestParam
(
value
=
"bindId"
)
String
bindId
)
throws
ParseException
{
List
<
KylinRecommendActive
>
list
=
dataUtils
.
getRecommendActive
(
bindId
);
if
(
null
==
list
){
return
ResponseDto
.
success
(
null
);
...
...
@@ -50,7 +51,7 @@ public class KylinRecommendActiveController {
}
@PostMapping
(
"getRecommendByIds"
)
@ApiOperation
(
"获取推荐活动详情,多id的"
)
public
ResponseDto
<
List
<
KylinRecommendActiveRelationVo
>>
getRecommendByIds
(
@RequestParam
(
value
=
"ids"
)
List
<
String
>
ids
)
{
public
ResponseDto
<
List
<
KylinRecommendActiveRelationVo
>>
getRecommendByIds
(
@RequestParam
(
value
=
"ids"
)
List
<
String
>
ids
)
throws
ParseException
{
ArrayList
<
KylinRecommendActiveRelationVo
>
resultList
=
ObjectUtil
.
getKylinRecommendActiveRelationVo
();
for
(
String
id:
ids
){
List
<
KylinRecommendActive
>
list
=
dataUtils
.
getRecommendActive
(
id
);
...
...
@@ -58,10 +59,12 @@ public class KylinRecommendActiveController {
KylinRecommendActiveVo
kylinRecommendActiveVo
=
kylinRecommendActiveService
.
getRecommendById
(
list
);
List
<
KylinRecommendActiveRelationVo
>
list1
=
kylinRecommendActiveVo
.
getList
();
for
(
KylinRecommendActiveRelationVo
ky:
list1
){
resultList
.
add
(
ky
);
//只搜索20个
if
(
resultList
.
size
()==
20
){
return
ResponseDto
.
success
(
resultList
)
;
if
(
ky
.
isCount
()){
resultList
.
add
(
ky
);
//只搜索20个
if
(
resultList
.
size
()==
20
){
return
ResponseDto
.
success
(
resultList
)
;
}
}
}
}
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/KylinRecommendActiveServiceImpl.java
View file @
dd486332
package
com
.
liquidnet
.
service
.
kylin
.
service
.
impl
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.goblin.dto.vo.*
;
import
com.liquidnet.service.kylin.dto.vo.KylinRecommendActiveRelationVo
;
import
com.liquidnet.service.kylin.dto.vo.KylinRecommendActiveVo
;
...
...
@@ -14,8 +16,11 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -30,7 +35,7 @@ public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveSer
private
KylinRedisUtils
kylinRedisUtils
;
@Override
public
KylinRecommendActiveVo
getRecommendById
(
List
<
KylinRecommendActive
>
list
)
{
public
KylinRecommendActiveVo
getRecommendById
(
List
<
KylinRecommendActive
>
list
)
throws
ParseException
{
for
(
KylinRecommendActive
kylinRecommendActive
:
list
)
{
//查看时间是否在当前范围内
if
(
LocalDateTime
.
now
().
isAfter
(
kylinRecommendActive
.
getStartTime
())
&&
LocalDateTime
.
now
().
isBefore
(
kylinRecommendActive
.
getEndTime
()))
{
...
...
@@ -82,6 +87,9 @@ public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveSer
aNew
.
setAuthor
(
goodsInfoVo
.
getAuthor
());
aNew
.
setPublisher
(
goodsInfoVo
.
getPublisher
());
kylinRecommendActiveRelationVo
.
setGoblinNftGoodsSkuInfoVo
(
aNew
);
kylinRecommendActiveRelationVo
.
setCount
(
true
);
}
else
{
kylinRecommendActiveRelationVo
.
setCount
(
false
);
}
}
else
if
(
kylinRecommendActiveRelationVo
.
getType
()
==
2
)
{
...
...
@@ -90,12 +98,28 @@ public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveSer
if
(
null
!=
goblinMixAppDetailsVo
)
{
com
.
liquidnet
.
service
.
kylin
.
dto
.
vo
.
GoblinMixAppDetailsVo
aNew
=
com
.
liquidnet
.
service
.
kylin
.
dto
.
vo
.
GoblinMixAppDetailsVo
.
getNew
();
BeanUtils
.
copyProperties
(
goblinMixAppDetailsVo
,
aNew
);
kylinRecommendActiveRelationVo
.
setGoblinMixAppDetailsVo
(
aNew
);
if
(
goblinMixAppDetailsVo
.
getStatus
()!=
7
&&
comparTime
(
aNew
.
getTimeStart
(),
aNew
.
getTimeEnd
())){
kylinRecommendActiveRelationVo
.
setGoblinMixAppDetailsVo
(
aNew
);
kylinRecommendActiveRelationVo
.
setCount
(
true
);
}
else
{
kylinRecommendActiveRelationVo
.
setCount
(
false
);
}
}
else
{
kylinRecommendActiveRelationVo
.
setCount
(
false
);
}
}
else
if
(
kylinRecommendActiveRelationVo
.
getType
()
==
3
)
{
//演出
KylinPerformanceVo
performancesInfo
=
dataUtils
.
getPerformanceVo
(
kylinRecommendActiveRelationVo
.
getRecommendBindId
());
kylinRecommendActiveRelationVo
.
setKylinPerformanceVo
(
performancesInfo
);
if
(
null
!=
performancesInfo
){
if
(
performancesInfo
.
getAppStatus
()!=
7
&&
performancesInfo
.
getAppStatus
()!=
10
){
kylinRecommendActiveRelationVo
.
setKylinPerformanceVo
(
performancesInfo
);
kylinRecommendActiveRelationVo
.
setCount
(
true
);
}
else
{
kylinRecommendActiveRelationVo
.
setCount
(
false
);
}
}
else
{
kylinRecommendActiveRelationVo
.
setCount
(
false
);
}
}
else
if
(
kylinRecommendActiveRelationVo
.
getType
()
==
4
)
{
//商品 //商品
GoblinGoodsInfoVo
goblinGoodsInfoVo
=
kylinRedisUtils
.
getGoodsInfoVo
(
kylinRecommendActiveRelationVo
.
getRecommendBindId
());
...
...
@@ -103,6 +127,9 @@ public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveSer
com
.
liquidnet
.
service
.
kylin
.
dto
.
vo
.
GoblinGoodsInfoVo
aNew
=
com
.
liquidnet
.
service
.
kylin
.
dto
.
vo
.
GoblinGoodsInfoVo
.
getNew
();
BeanUtils
.
copyProperties
(
goblinGoodsInfoVo
,
aNew
);
kylinRecommendActiveRelationVo
.
setGoblinGoodsInfoVo
(
aNew
);
kylinRecommendActiveRelationVo
.
setCount
(
true
);
}
else
{
kylinRecommendActiveRelationVo
.
setCount
(
false
);
}
}
}
...
...
@@ -111,6 +138,46 @@ public class KylinRecommendActiveServiceImpl implements IKylinRecommendActiveSer
}
return
null
;
}
public
boolean
comparTime
(
String
startTime
,
String
endTime
)
throws
ParseException
{
if
(
StringUtil
.
isNotBlank
(
startTime
)&&
StringUtil
.
isNotBlank
(
endTime
)){
SimpleDateFormat
sdf
=
DateUtil
.
SDF_YMD_HMS
;
Date
d
=
new
Date
();
if
(
d
.
compareTo
(
sdf
.
parse
(
startTime
))>
0
&&
d
.
compareTo
(
sdf
.
parse
(
endTime
))<
0
){
return
true
;
}
}
return
false
;
}
// 各种状态下判断藏品是否可以展示
public
boolean
getSkuAllStatusShow
(
GoblinGoodsSkuInfoVo
info
)
{
if
(
info
!=
null
&&
info
.
getSkuType
()
==
1
&&
info
.
getStatus
().
equals
(
"3"
)
&&
info
.
getShelvesStatus
().
equals
(
"3"
)
&&
(
info
.
getSkuAppear
()
==
null
||
info
.
getSkuAppear
().
equals
(
"0"
))
&&
info
.
getDelFlg
().
equals
(
"0"
)
&&
((
info
.
getUnbox
().
equals
(
"0"
)
&&
info
.
getUpchain
()
==
1
)
||
info
.
getUnbox
().
equals
(
"1"
))
// && (info.getUnbox().equals("1") || info.getUpchain() == 1)
)
{
return
true
;
}
else
{
return
false
;
}
}
public
static
void
main
(
String
[]
args
)
throws
ParseException
{
KylinRecommendActiveServiceImpl
a
=
new
KylinRecommendActiveServiceImpl
();
boolean
b
=
a
.
comparTime
(
"2020-12-01 00:00:00"
,
"2022-12-01 00:00:00"
);
System
.
out
.
println
(
b
);
/* //LocalDate a=new LocalDate("2009-12-31 12:00:00");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date1 = sdf.parse("2009-12-31 12:00:00");
Date date2 = sdf.parse("2023-01-31 12:00:00");
Date date = new Date();
System.out.println(date.compareTo(date1));
System.out.println(date.compareTo(date2));*/
}
/**
* NFT 获取详情
...
...
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