记得上下班打卡 | 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
44e2769a
Commit
44e2769a
authored
Jan 24, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
正在下单 增加 从mongo读取 根据商铺id的订单列表
parent
a953f0be
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
1 deletion
+65
-1
IGoblinStoreZhengzaiService.java
...t/service/goblin/service/IGoblinStoreZhengzaiService.java
+2
-0
GoblinStoreZhengzaiController.java
...vice/goblin/controller/GoblinStoreZhengzaiController.java
+9
-0
GoblinStoreZhengzaiServiceImpl.java
...e/goblin/service/impl/GoblinStoreZhengzaiServiceImpl.java
+43
-1
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+11
-0
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/IGoblinStoreZhengzaiService.java
View file @
44e2769a
package
com
.
liquidnet
.
service
.
goblin
.
service
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinAppOrderListVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinSelfMarketingVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinZhengzaiGoodVo
;
...
...
@@ -22,4 +23,5 @@ public interface IGoblinStoreZhengzaiService {
*/
ResponseDto
<
List
<
GoblinZhengzaiGoodVo
>>
getSpuList
(
String
marketId
);
ResponseDto
<
List
<
GoblinAppOrderListVo
>>
orderList
(
int
page
);
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinStoreZhengzaiController.java
View file @
44e2769a
...
...
@@ -53,6 +53,15 @@ public class GoblinStoreZhengzaiController {
return
goblinOrderService
.
checkOrder
(
param
,
param
.
getUid
());
}
@PostMapping
(
"list"
)
@ApiOperation
(
"订单列表[商铺]"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"Integer"
,
name
=
"page"
,
value
=
"页数"
,
example
=
"1"
),
})
public
ResponseDto
<
List
<
GoblinAppOrderListVo
>>
orderList
(
@RequestParam
(
"page"
)
@Valid
int
page
)
{
return
goblinOrderAppService
.
orderList
(
page
);
}
@PostMapping
(
"listByCode"
)
@ApiOperation
(
"列表[根据masterCode]"
)
@ApiImplicitParams
({
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinStoreZhengzaiServiceImpl.java
View file @
44e2769a
...
...
@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -45,7 +46,7 @@ public class GoblinStoreZhengzaiServiceImpl implements IGoblinStoreZhengzaiServi
LocalDateTime
now
=
LocalDateTime
.
now
();
for
(
GoblinSelfMarketingVo
item
:
list
)
{
GoblinMarketingZhengzaiRelationVo
zhengzaiRelationVo
=
redisUtils
.
getZhengzaiRelation
(
item
.
getSelfMarketId
(),
storeId
);
if
(
LocalDateTime
.
parse
(
item
.
getEndTime
(),
DTF_YMD_HMS
).
isAfter
(
now
)
&&
zhengzaiRelationVo
!=
null
)
{
if
(
LocalDateTime
.
parse
(
item
.
getEndTime
(),
DTF_YMD_HMS
).
isAfter
(
now
)
&&
zhengzaiRelationVo
!=
null
)
{
if
(
marketIds
.
contains
(
item
.
getSelfMarketId
()))
{
List
<
GoblinMarketRelationVo
>
relationVo
=
redisUtils
.
getMarketRelation
(
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
(),
item
.
getSelfMarketId
());
List
<
String
>
storeIdList
=
relationVo
.
stream
().
map
(
GoblinMarketRelationVo:
:
getStoreId
).
distinct
().
collect
(
Collectors
.
toList
());
//配置了商铺的店铺
...
...
@@ -79,4 +80,45 @@ public class GoblinStoreZhengzaiServiceImpl implements IGoblinStoreZhengzaiServi
}
return
ResponseDto
.
success
(
voList
);
}
@Override
public
ResponseDto
<
List
<
GoblinAppOrderListVo
>>
orderList
(
int
page
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
List
<
GoblinAppOrderListVo
>
orderVoList
=
ObjectUtil
.
goblinAppOrderListVoArrayList
();
GoblinStoreInfoVo
storeInfoVo
=
redisUtils
.
getStoreInfoVoByUid
(
uid
);
List
<
GoblinStoreOrderVo
>
mongoVoList
=
mongoUtils
.
storeZhengzaiOrderList
(
page
,
storeInfoVo
.
getStoreId
());
for
(
GoblinStoreOrderVo
orderVo
:
mongoVoList
)
{
GoblinAppOrderListVo
vo
=
GoblinAppOrderListVo
.
getNew
();
BeanUtils
.
copyProperties
(
orderVo
,
vo
);
vo
.
setRestTime
(
getRestTime
(
orderVo
));
List
<
GoblinOrderSkuVo
>
skuVos
=
ObjectUtil
.
getGoblinOrderSkuVoArrayList
();
for
(
String
orderSkuId
:
orderVo
.
getOrderSkuVoIds
())
{
GoblinOrderSkuVo
orderSkuVo
=
redisUtils
.
getGoblinOrderSkuVo
(
orderSkuId
);
skuVos
.
add
(
orderSkuVo
);
}
vo
.
setOrderSkuVos
(
skuVos
);
orderVoList
.
add
(
vo
);
}
return
ResponseDto
.
success
(
orderVoList
);
}
//获取 订单剩余可支付时间[S]
private
long
getRestTime
(
GoblinStoreOrderVo
orderVo
)
{
long
restTime
=
0L
;
if
(
orderVo
.
getStatus
()
==
GoblinStatusConst
.
Status
.
ORDER_STATUS_0
.
getValue
())
{
try
{
Date
OverdueAt
=
DateUtil
.
addMin
(
DateUtil
.
parse
(
orderVo
.
getCreatedAt
(),
"yyyy-MM-dd HH:mm:ss"
),
orderVo
.
getPayCountdownMinute
());
restTime
=
DateUtil
.
intervalSeconds
(
OverdueAt
,
DateUtil
.
parse
(
DateUtil
.
getNowTime
(),
"yyyy-MM-dd HH:mm:ss"
)
);
if
(
restTime
<=
0L
)
{
restTime
=
0L
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
restTime
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
44e2769a
...
...
@@ -865,4 +865,15 @@ public class GoblinMongoUtils {
map
.
put
(
"total"
,
total
);
return
map
;
}
//商户 正在下单列表
public
List
<
GoblinStoreOrderVo
>
storeZhengzaiOrderList
(
int
page
,
String
storeId
)
{
//查询销量
int
size
=
40
;
int
skipCount
=
((
page
-
1
)
*
size
);
Criteria
criteria
=
Criteria
.
where
(
"storeId"
).
is
(
storeId
);
Query
query
=
Query
.
query
(
criteria
);
query
.
skip
(
skipCount
).
limit
(
size
).
with
(
Sort
.
by
(
Sort
.
Order
.
desc
(
"createdAt"
)));
return
mongoTemplate
.
find
(
query
,
GoblinStoreOrderVo
.
class
,
GoblinStoreOrderVo
.
class
.
getSimpleName
());
}
}
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