记得上下班打卡 | 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
65b4df16
Commit
65b4df16
authored
Jun 15, 2026
by
wangyifan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单列表导出接口
parent
e0f96e35
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
251 additions
and
42 deletions
+251
-42
IGoblinStoreOrderService.java
...rvice/goblin/service/manage/IGoblinStoreOrderService.java
+11
-6
GoblinStoreOrderController.java
.../goblin/controller/manage/GoblinStoreOrderController.java
+30
-7
GoblinStoreOrderServiceImpl.java
...blin/service/impl/manage/GoblinStoreOrderServiceImpl.java
+178
-15
GoblinMongoUtils.java
...a/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
+32
-14
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/service/manage/IGoblinStoreOrderService.java
View file @
65b4df16
...
...
@@ -2,12 +2,9 @@ package com.liquidnet.service.goblin.service.manage;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinOrderLogVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreOrderListVo
;
import
com.liquidnet.service.goblin.param.RefundCallbackParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
javax.
validation.Valid
;
import
javax.
servlet.http.HttpServletResponse
;
import
java.math.BigDecimal
;
public
interface
IGoblinStoreOrderService
{
...
...
@@ -20,6 +17,14 @@ public interface IGoblinStoreOrderService {
String
phone
,
Integer
status
);
void
exportOrderList
(
HttpServletResponse
response
,
String
orderCode
,
String
cst
,
String
cet
,
String
expressContacts
,
String
phone
,
Integer
status
);
ResponseDto
<
GoblinStoreOrderListVo
>
orderDetails
(
String
orderId
);
ResponseDto
<
Boolean
>
orderCancel
(
String
orderId
);
...
...
@@ -32,8 +37,8 @@ public interface IGoblinStoreOrderService {
ResponseDto
<
Boolean
>
refundOrderSku
(
String
orderId
,
String
orderSkuId
,
BigDecimal
price
);
ResponseDto
<
Boolean
>
express
(
String
orderId
,
String
orderSkuIds
,
String
mailNo
,
String
uid
,
String
orderCode
);
ResponseDto
<
Boolean
>
express
(
String
orderId
,
String
orderSkuIds
,
String
mailNo
,
String
uid
,
String
orderCode
);
ResponseDto
<
Boolean
>
changeExpressMailNo
(
String
orderId
,
String
mailId
,
String
mailNo
);
ResponseDto
<
Boolean
>
changeExpressMailNo
(
String
orderId
,
String
mailId
,
String
mailNo
);
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/manage/GoblinStoreOrderController.java
View file @
65b4df16
...
...
@@ -4,20 +4,23 @@ import com.github.pagehelper.PageInfo;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinMailVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinStoreOrderListVo
;
import
com.liquidnet.service.goblin.param.RefundCallbackParam
;
import
com.liquidnet.service.goblin.service.IGoblinOrderService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStoreOrderService
;
import
io.swagger.annotations.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.Valid
;
import
java.math.BigDecimal
;
import
java.util.List
;
@ApiSupport
(
order
=
149101
)
@Api
(
tags
=
"店铺-订单"
)
...
...
@@ -55,6 +58,26 @@ public class GoblinStoreOrderController {
return
goblinStoreOrderService
.
orderList
(
page
,
orderCode
,
type
,
cst
,
cet
,
expressContacts
,
phone
,
status
);
}
@ApiOperation
(
value
=
"订单列表导出"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"orderCode"
,
value
=
"订单编号"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"cst"
,
value
=
"下单起始时间"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"cet"
,
value
=
"下单终止时间"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"expressContacts"
,
value
=
"收货人姓名"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"phone"
,
value
=
"手机号"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"Integer"
,
name
=
"status"
,
value
=
"订单状态[0-代付款|2-待发货|3-已发货|4-已完成]"
),
})
@GetMapping
(
value
=
"list/export"
)
public
void
exportOrderList
(
HttpServletResponse
response
,
@RequestParam
(
value
=
"orderCode"
,
required
=
false
)
String
orderCode
,
@RequestParam
(
value
=
"cst"
,
required
=
false
)
String
cst
,
@RequestParam
(
value
=
"cet"
,
required
=
false
)
String
cet
,
@RequestParam
(
value
=
"expressContacts"
,
required
=
false
)
String
expressContacts
,
@RequestParam
(
value
=
"phone"
,
required
=
false
)
String
phone
,
@RequestParam
(
value
=
"status"
,
required
=
false
)
Integer
status
)
{
goblinStoreOrderService
.
exportOrderList
(
response
,
orderCode
,
cst
,
cet
,
expressContacts
,
phone
,
status
);
}
@ApiOperation
(
value
=
"订单详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"orderId"
,
value
=
"订单id"
),
...
...
@@ -135,7 +158,7 @@ public class GoblinStoreOrderController {
public
ResponseDto
<
Boolean
>
express
(
@RequestParam
(
value
=
"orderId"
,
required
=
true
)
@Valid
String
orderId
,
@RequestParam
(
value
=
"orderSkuIds"
,
required
=
false
)
@Valid
String
orderSkuIds
,
@RequestParam
(
value
=
"mailNo"
,
required
=
true
)
@Valid
String
mailNo
)
{
return
goblinStoreOrderService
.
express
(
orderId
,
orderSkuIds
,
mailNo
,
CurrentUtil
.
getCurrentUid
(),
""
);
return
goblinStoreOrderService
.
express
(
orderId
,
orderSkuIds
,
mailNo
,
CurrentUtil
.
getCurrentUid
(),
""
);
}
@ApiOperation
(
value
=
"修改快递单号"
)
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/manage/GoblinStoreOrderServiceImpl.java
View file @
65b4df16
package
com
.
liquidnet
.
service
.
goblin
.
service
.
impl
.
manage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.commons.lang.util.*
;
import
com.liquidnet.service.base.ResponseDto
;
...
...
@@ -14,29 +15,25 @@ import com.liquidnet.service.goblin.entity.GoblinBackOrder;
import
com.liquidnet.service.goblin.entity.GoblinBackOrderLog
;
import
com.liquidnet.service.goblin.entity.GoblinOrderOperationLog
;
import
com.liquidnet.service.goblin.param.BackCouponParam
;
import
com.liquidnet.service.goblin.param.RefundCallbackParam
;
import
com.liquidnet.service.goblin.service.GoblinCouponService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStoreMoneyService
;
import
com.liquidnet.service.goblin.service.manage.IGoblinStoreOrderService
;
import
com.liquidnet.service.goblin.util.*
;
import
com.mongodb.BasicDBObject
;
import
com.mongodb.client.result.UpdateResult
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.
data.mongodb.core.query.Criteria
;
import
org.springframework.
data.mongodb.core.query.Query
;
import
org.springframework.
http.HttpHeaders
;
import
org.springframework.
http.MediaType
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.
text.DateFormat
;
import
java.
nio.charset.StandardCharsets
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
@Service
...
...
@@ -65,7 +62,6 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
@Override
public
ResponseDto
<
PageInfo
<
GoblinStoreOrderListVo
>>
orderList
(
Integer
page
,
String
orderCode
,
Integer
type
,
String
cst
,
String
cet
,
String
expressContacts
,
String
phone
,
Integer
status
)
{
List
<
GoblinStoreOrderListVo
>
listVos
=
ObjectUtil
.
getGoblinStoreOrderListVoArrayList
();
String
uid
=
CurrentUtil
.
getCurrentUid
();
GoblinStoreInfoVo
storeInfoVo
=
redisUtils
.
getStoreInfoVoByUid
(
uid
);
if
(
storeInfoVo
==
null
)
{
...
...
@@ -74,9 +70,61 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
HashMap
<
String
,
Object
>
map
=
mongoUtils
.
storeOrderList
(
storeInfoVo
.
getStoreId
(),
page
,
orderCode
,
cst
,
cet
,
expressContacts
,
phone
,
status
);
long
total
=
(
long
)
map
.
get
(
"total"
);
List
<
GoblinStoreOrderVo
>
voList
=
(
List
<
GoblinStoreOrderVo
>)
map
.
get
(
"data"
);
List
<
GoblinStoreOrderListVo
>
listVos
=
buildStoreOrderListVos
(
voList
,
false
);
PageInfo
<
GoblinStoreOrderListVo
>
pageInfo
=
new
PageInfo
(
listVos
);
pageInfo
.
setTotal
(
total
);
return
ResponseDto
.
success
(
pageInfo
);
}
@Override
public
void
exportOrderList
(
HttpServletResponse
response
,
String
orderCode
,
String
cst
,
String
cet
,
String
expressContacts
,
String
phone
,
Integer
status
)
{
String
uid
=
CurrentUtil
.
getCurrentUid
();
GoblinStoreInfoVo
storeInfoVo
=
redisUtils
.
getStoreInfoVoByUid
(
uid
);
if
(
storeInfoVo
==
null
)
{
log
.
warn
(
"店铺-订单:订单列表导出:无法查看[uid:{}]"
,
uid
);
return
;
}
List
<
GoblinStoreOrderVo
>
voList
=
mongoUtils
.
storeOrderExportList
(
storeInfoVo
.
getStoreId
(),
orderCode
,
cst
,
cet
,
expressContacts
,
phone
,
status
);
List
<
GoblinStoreOrderListVo
>
listVos
=
buildStoreOrderListVos
(
voList
,
true
);
if
(
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
listVos
))
{
log
.
warn
(
"店铺-订单:订单列表导出:无数据[uid:{},storeId:{},orderCode:{},cst:{},cet:{},expressContacts:{},phone:{},status:{}]"
,
uid
,
storeInfoVo
.
getStoreId
(),
orderCode
,
cst
,
cet
,
expressContacts
,
phone
,
status
);
return
;
}
ServletOutputStream
servletOutputStream
=
null
;
try
{
String
fileName
=
DateUtil
.
Formatter
.
yyyyMMddHHmmssTrim
.
format
(
LocalDateTime
.
now
())
.
concat
(
new
String
((
"商城订单信息"
).
getBytes
(
"gb2312"
),
StandardCharsets
.
ISO_8859_1
));
response
.
setHeader
(
HttpHeaders
.
CONTENT_DISPOSITION
,
"attachment;filename="
.
concat
(
fileName
).
concat
(
ExcelTypeEnum
.
XLSX
.
getValue
()));
response
.
setContentType
(
MediaType
.
MULTIPART_FORM_DATA_VALUE
);
response
.
setCharacterEncoding
(
StandardCharsets
.
UTF_8
.
name
());
servletOutputStream
=
response
.
getOutputStream
();
EasyExcel
.
write
(
servletOutputStream
).
head
(
exportOrderListHead
(
listVos
)).
sheet
(
"商城订单信息"
).
doWrite
(
exportOrderListRows
(
listVos
));
}
catch
(
IOException
e
)
{
log
.
error
(
"店铺-订单:订单列表导出:异常[uid:{},orderCode:{},cst:{},cet:{},expressContacts:{},phone:{},status:{},ex.msg={}]"
,
uid
,
orderCode
,
cst
,
cet
,
expressContacts
,
phone
,
status
,
e
.
getLocalizedMessage
());
}
finally
{
if
(
null
!=
servletOutputStream
)
{
try
{
servletOutputStream
.
close
();
}
catch
(
Exception
ignored
)
{
}
}
}
}
private
List
<
GoblinStoreOrderListVo
>
buildStoreOrderListVos
(
List
<
GoblinStoreOrderVo
>
voList
,
boolean
includeExportFields
)
{
List
<
GoblinStoreOrderListVo
>
listVos
=
ObjectUtil
.
getGoblinStoreOrderListVoArrayList
();
if
(
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
voList
))
{
return
listVos
;
}
for
(
GoblinStoreOrderVo
item
:
voList
)
{
GoblinStoreOrderListVo
vo
=
GoblinStoreOrderListVo
.
getNew
();
vo
.
setCreatedAt
(
item
.
getCreatedAt
());
if
(
includeExportFields
)
{
vo
.
setUserMobile
(
item
.
getUserMobile
());
vo
.
setPayTime
(
item
.
getPayTime
());
}
GoblinOrderAttrVo
orderAttrVo
=
item
.
getOrderAttrVo
();
if
(
orderAttrVo
!=
null
)
{
vo
.
setExpressAddressDetail
(
orderAttrVo
.
getExpressAddressDetail
());
...
...
@@ -96,6 +144,10 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
vo
.
setStatus
(
item
.
getStatus
());
vo
.
setMarketType
(
item
.
getMarketType
());
vo
.
setPriceExpress
(
item
.
getPriceExpress
());
if
(
includeExportFields
)
{
vo
.
setPlatformUcouponPrice
(
item
.
getPriceCoupon
());
vo
.
setStoreUcouponPrice
(
item
.
getStorePriceCoupon
());
}
if
(
item
.
getMarketId
()
==
null
||
item
.
getMarketId
().
equals
(
""
))
{
vo
.
setMarketName
(
""
);
}
else
{
...
...
@@ -131,9 +183,120 @@ public class GoblinStoreOrderServiceImpl implements IGoblinStoreOrderService {
vo
.
setGoblinMailVoList
(
redisUtils
.
getGoblinMail
(
item
.
getOrderId
()));
listVos
.
add
(
vo
);
}
PageInfo
<
GoblinStoreOrderListVo
>
pageInfo
=
new
PageInfo
(
listVos
);
pageInfo
.
setTotal
(
total
);
return
ResponseDto
.
success
(
pageInfo
);
return
listVos
;
}
private
List
<
List
<
String
>>
exportOrderListHead
(
List
<
GoblinStoreOrderListVo
>
listVos
)
{
List
<
String
>
heads
=
new
ArrayList
<>();
heads
.
add
(
"订单id"
);
heads
.
add
(
"订单编号"
);
heads
.
add
(
"购买人手机号"
);
heads
.
add
(
"快递费"
);
heads
.
add
(
"平台券优惠券金额"
);
heads
.
add
(
"店铺券优惠金额"
);
heads
.
add
(
"收货人"
);
heads
.
add
(
"收货人电话"
);
heads
.
add
(
"快递地址"
);
heads
.
add
(
"支付方式"
);
heads
.
add
(
"支付时间"
);
heads
.
add
(
"下单时间"
);
heads
.
add
(
"订单状态"
);
heads
.
add
(
"活动名称"
);
heads
.
add
(
"快递公司"
);
heads
.
add
(
"物流单号"
);
int
maxSkuCount
=
maxSkuCount
(
listVos
);
for
(
int
i
=
1
;
i
<=
maxSkuCount
;
i
++)
{
heads
.
add
(
"商品id"
+
i
);
heads
.
add
(
"商品名"
+
i
);
heads
.
add
(
"款式"
+
i
);
heads
.
add
(
"数量"
+
i
);
heads
.
add
(
"单价"
+
i
);
heads
.
add
(
"价格"
+
i
);
heads
.
add
(
"订单skuId"
+
i
);
}
List
<
List
<
String
>>
headList
=
new
ArrayList
<>();
for
(
String
head
:
heads
)
{
headList
.
add
(
Collections
.
singletonList
(
head
));
}
return
headList
;
}
private
List
<
List
<
String
>>
exportOrderListRows
(
List
<
GoblinStoreOrderListVo
>
listVos
)
{
List
<
List
<
String
>>
rows
=
new
ArrayList
<>();
for
(
GoblinStoreOrderListVo
order
:
listVos
)
{
rows
.
add
(
exportOrderListRow
(
order
));
}
return
rows
;
}
private
List
<
String
>
exportOrderListRow
(
GoblinStoreOrderListVo
order
)
{
List
<
String
>
row
=
new
ArrayList
<>();
row
.
add
(
toExportString
(
order
.
getOrderId
()));
row
.
add
(
toExportString
(
order
.
getOrderCode
()));
row
.
add
(
toExportString
(
order
.
getUserMobile
()));
row
.
add
(
toExportString
(
order
.
getPriceExpress
()));
row
.
add
(
toExportString
(
order
.
getPlatformUcouponPrice
()));
row
.
add
(
toExportString
(
order
.
getStoreUcouponPrice
()));
row
.
add
(
toExportString
(
order
.
getExpressContacts
()));
row
.
add
(
toExportString
(
order
.
getExpressPhone
()));
row
.
add
(
toExportString
(
order
.
getExpressAddress
())
+
" "
+
toExportString
(
order
.
getExpressAddressDetail
()));
row
.
add
(
toExportString
(
order
.
getPayType
()));
row
.
add
(
toExportString
(
order
.
getPayTime
()));
row
.
add
(
toExportString
(
order
.
getCreatedAt
()));
row
.
add
(
toExportString
(
order
.
getStatus
()));
row
.
add
(
toExportString
(
order
.
getMarketName
()));
row
.
add
(
exportLogisticsCompany
(
order
.
getGoblinMailVoList
()));
row
.
add
(
exportMailNo
(
order
.
getGoblinMailVoList
()));
List
<
GoblinStoreOrderListSkuVo
>
skuVos
=
order
.
getStoreOrderListSkuVoList
();
if
(!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
skuVos
))
{
for
(
GoblinStoreOrderListSkuVo
skuVo
:
skuVos
)
{
row
.
add
(
toExportString
(
skuVo
.
getSkuId
()));
row
.
add
(
toExportString
(
skuVo
.
getSpuName
()));
row
.
add
(
toExportString
(
skuVo
.
getSkuName
()));
row
.
add
(
toExportString
(
skuVo
.
getNum
()));
row
.
add
(
toExportString
(
skuVo
.
getPrice
()));
row
.
add
(
toExportString
(
skuVo
.
getSkuPriceActual
()));
row
.
add
(
toExportString
(
skuVo
.
getOrderSkuId
()));
}
}
return
row
;
}
private
int
maxSkuCount
(
List
<
GoblinStoreOrderListVo
>
listVos
)
{
int
max
=
0
;
for
(
GoblinStoreOrderListVo
order
:
listVos
)
{
List
<
GoblinStoreOrderListSkuVo
>
skuVos
=
order
.
getStoreOrderListSkuVoList
();
if
(!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
skuVos
))
{
max
=
Math
.
max
(
max
,
skuVos
.
size
());
}
}
return
max
;
}
private
String
exportLogisticsCompany
(
List
<
GoblinMailVo
>
mailVos
)
{
if
(
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
mailVos
))
{
return
""
;
}
List
<
String
>
values
=
new
ArrayList
<>();
for
(
GoblinMailVo
mailVo
:
mailVos
)
{
values
.
add
(
toExportString
(
mailVo
.
getLogisticsCompany
()));
}
return
String
.
join
(
","
,
values
);
}
private
String
exportMailNo
(
List
<
GoblinMailVo
>
mailVos
)
{
if
(
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
mailVos
))
{
return
""
;
}
List
<
String
>
values
=
new
ArrayList
<>();
for
(
GoblinMailVo
mailVo
:
mailVos
)
{
values
.
add
(
toExportString
(
mailVo
.
getMailNo
()));
}
return
String
.
join
(
","
,
values
);
}
private
String
toExportString
(
Object
value
)
{
return
null
==
value
?
""
:
String
.
valueOf
(
value
);
}
@Override
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/util/GoblinMongoUtils.java
View file @
65b4df16
...
...
@@ -1423,6 +1423,32 @@ public class GoblinMongoUtils {
//查询销量
int
size
=
20
;
int
skipCount
=
((
page
-
1
)
*
size
);
Criteria
criteria
=
storeOrderListCriteria
(
storeId
,
orderCode
,
cst
,
cet
,
expressContacts
,
phone
,
status
);
Query
query
=
Query
.
query
(
criteria
);
query
.
with
(
Sort
.
by
(
Sort
.
Order
.
desc
(
"createdAt"
)));
query
.
skip
(
skipCount
).
limit
(
size
);
storeOrderListFields
(
query
);
List
<
GoblinStoreOrderVo
>
dataList
=
mongoTemplate
.
find
(
query
,
GoblinStoreOrderVo
.
class
,
GoblinStoreOrderVo
.
class
.
getSimpleName
());
//查询总数量
Query
countQuery
=
Query
.
query
(
criteria
);
countQuery
.
fields
().
include
(
"orderCode"
);
List
<
GoblinStoreOrderVo
>
countList
=
mongoTemplate
.
find
(
countQuery
,
GoblinStoreOrderVo
.
class
,
GoblinStoreOrderVo
.
class
.
getSimpleName
());
long
total
=
countList
.
size
();
HashMap
<
String
,
Object
>
map
=
CollectionUtil
.
mapStringObject
();
map
.
put
(
"data"
,
dataList
);
map
.
put
(
"total"
,
total
);
return
map
;
}
//商品订单导出列表
public
List
<
GoblinStoreOrderVo
>
storeOrderExportList
(
String
storeId
,
String
orderCode
,
String
cst
,
String
cet
,
String
expressContacts
,
String
phone
,
Integer
status
)
{
Query
query
=
Query
.
query
(
storeOrderListCriteria
(
storeId
,
orderCode
,
cst
,
cet
,
expressContacts
,
phone
,
status
));
query
.
with
(
Sort
.
by
(
Sort
.
Order
.
desc
(
"createdAt"
)));
storeOrderListFields
(
query
);
return
mongoTemplate
.
find
(
query
,
GoblinStoreOrderVo
.
class
,
GoblinStoreOrderVo
.
class
.
getSimpleName
());
}
private
Criteria
storeOrderListCriteria
(
String
storeId
,
String
orderCode
,
String
cst
,
String
cet
,
String
expressContacts
,
String
phone
,
Integer
status
)
{
Criteria
criteria
=
Criteria
.
where
(
"storeId"
).
is
(
storeId
);
if
(
cst
!=
null
&&
cet
!=
null
)
{
criteria
=
criteria
.
and
(
"createdAt"
).
gte
(
cst
).
lt
(
cet
);
...
...
@@ -1439,21 +1465,13 @@ public class GoblinMongoUtils {
if
(
expressContacts
!=
null
)
{
criteria
=
criteria
.
and
(
"orderAttrVo.expressContacts"
).
is
(
expressContacts
);
}
Query
query
=
Query
.
query
(
criteria
);
query
.
with
(
Sort
.
by
(
Sort
.
Order
.
desc
(
"createdAt"
)));
query
.
skip
(
skipCount
).
limit
(
size
);
query
.
fields
().
include
(
"orderCode"
).
include
(
"createdAt"
).
include
(
"payType"
).
include
(
"status"
).
include
(
"orderSkuVoIds"
).
include
(
"orderId"
).
include
(
"priceActual"
).
include
(
"priceExpress"
).
include
(
"marketId"
)
return
criteria
;
}
private
void
storeOrderListFields
(
Query
query
)
{
query
.
fields
().
include
(
"orderCode"
).
include
(
"createdAt"
).
include
(
"payType"
).
include
(
"payTime"
).
include
(
"status"
).
include
(
"orderSkuVoIds"
)
.
include
(
"orderId"
).
include
(
"userMobile"
).
include
(
"priceActual"
).
include
(
"priceExpress"
).
include
(
"priceCoupon"
).
include
(
"storePriceCoupon"
).
include
(
"marketId"
).
include
(
"marketType"
)
.
include
(
"orderAttrVo.expressContacts"
).
include
(
"orderAttrVo.expressAddressDetail"
).
include
(
"orderAttrVo.expressAddress"
).
include
(
"orderAttrVo.expressPhone"
);
List
<
GoblinStoreOrderVo
>
dataList
=
mongoTemplate
.
find
(
query
,
GoblinStoreOrderVo
.
class
,
GoblinStoreOrderVo
.
class
.
getSimpleName
());
//查询总数量
Query
countQuery
=
Query
.
query
(
criteria
);
countQuery
.
fields
().
include
(
"orderCode"
);
List
<
GoblinStoreOrderVo
>
countList
=
mongoTemplate
.
find
(
countQuery
,
GoblinStoreOrderVo
.
class
,
GoblinStoreOrderVo
.
class
.
getSimpleName
());
long
total
=
countList
.
size
();
HashMap
<
String
,
Object
>
map
=
CollectionUtil
.
mapStringObject
();
map
.
put
(
"data"
,
dataList
);
map
.
put
(
"total"
,
total
);
return
map
;
}
//商品退款订单列表
...
...
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