记得上下班打卡 | 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
4c3030d9
Commit
4c3030d9
authored
Nov 30, 2022
by
zhanggb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
~api:正在下单:活动订单数据导出-周焕;
parent
67484de3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
22 deletions
+35
-22
DateUtil.java
...c/main/java/com/liquidnet/commons/lang/util/DateUtil.java
+7
-0
GoblinZhengzaiMarketOrderExcelDto.java
...service/goblin/dto/GoblinZhengzaiMarketOrderExcelDto.java
+8
-6
GoblinStoreOrderMapper.xml
...iquidnet.service.goblin.mapper/GoblinStoreOrderMapper.xml
+1
-1
GoblinExportDataController.java
...latform/controller/goblin/GoblinExportDataController.java
+19
-15
No files found.
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/DateUtil.java
View file @
4c3030d9
...
@@ -76,6 +76,13 @@ public abstract class DateUtil {
...
@@ -76,6 +76,13 @@ public abstract class DateUtil {
return
LocalDateTime
.
parse
(
str
,
formatter
);
return
LocalDateTime
.
parse
(
str
,
formatter
);
}
}
public
LocalDate
parse2LocalDate
(
String
str
)
{
if
(
null
==
str
||
str
.
trim
().
length
()
<=
0
)
{
return
null
;
}
return
LocalDate
.
parse
(
str
,
formatter
);
}
}
}
/**
/**
...
...
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/java/com/liquidnet/service/goblin/dto/GoblinZhengzaiMarketOrderExcelDto.java
View file @
4c3030d9
...
@@ -5,6 +5,8 @@ import lombok.Getter;
...
@@ -5,6 +5,8 @@ import lombok.Getter;
import
lombok.Setter
;
import
lombok.Setter
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
/**
/**
* select gso.order_id '订单ID',
* select gso.order_id '订单ID',
...
@@ -57,19 +59,19 @@ public class GoblinZhengzaiMarketOrderExcelDto implements Serializable, Cloneabl
...
@@ -57,19 +59,19 @@ public class GoblinZhengzaiMarketOrderExcelDto implements Serializable, Cloneabl
@ExcelProperty
(
"订单状态"
)
@ExcelProperty
(
"订单状态"
)
private
String
orderStatus
;
private
String
orderStatus
;
@ExcelProperty
(
"订单创建时间"
)
@ExcelProperty
(
"订单创建时间"
)
private
Integer
createdAt
;
private
LocalDateTime
createdAt
;
@ExcelProperty
(
"核销时间"
)
@ExcelProperty
(
"核销时间"
)
private
String
pushTime
;
private
LocalDateTime
pushTime
;
@ExcelProperty
(
"支付来源"
)
@ExcelProperty
(
"支付来源"
)
private
String
deviceFrom
;
private
String
deviceFrom
;
@ExcelProperty
(
"支付类型"
)
@ExcelProperty
(
"支付类型"
)
private
String
payType
;
private
String
payType
;
@ExcelProperty
(
"购买数量"
)
@ExcelProperty
(
"购买数量"
)
private
String
nums
;
private
Integer
nums
;
@ExcelProperty
(
"商品单价"
)
@ExcelProperty
(
"商品单价"
)
private
String
skuPrice
;
private
BigDecimal
skuPrice
;
@ExcelProperty
(
"实际支付价格"
)
@ExcelProperty
(
"实际支付价格"
)
private
String
priceActual
;
private
BigDecimal
priceActual
;
@ExcelProperty
(
"优惠金额"
)
@ExcelProperty
(
"优惠金额"
)
private
Integer
priceVoucher
;
private
BigDecimal
priceVoucher
;
}
}
liquidnet-bus-do/liquidnet-service-goblin-do/src/main/resources/com.liquidnet.service.goblin.mapper/GoblinStoreOrderMapper.xml
View file @
4c3030d9
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
inner join goblin_store_info gsi on gsi.store_id = gso.store_id
inner join goblin_store_info gsi on gsi.store_id = gso.store_id
inner join goblin_self_marketing gsm on gsm.self_market_id = SUBSTRING_INDEX(gso.market_id, 'ZZ', -1)
inner join goblin_self_marketing gsm on gsm.self_market_id = SUBSTRING_INDEX(gso.market_id, 'ZZ', -1)
<where>
<where>
gso.status not in (0, 5) and gso.store_id = #{
orderNo,jdbcType=VARCHAR} and gso.market_id = #{orderNo
,jdbcType=VARCHAR}
gso.status not in (0, 5) and gso.store_id = #{
storeId,jdbcType=VARCHAR} and gso.market_id = #{marketId
,jdbcType=VARCHAR}
<if
test=
"beginTime != null"
>
<if
test=
"beginTime != null"
>
and gso.created_at
<![CDATA[>=]]>
#{beginTime,jdbcType=TIMESTAMP}
and gso.created_at
<![CDATA[>=]]>
#{beginTime,jdbcType=TIMESTAMP}
</if>
</if>
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/controller/goblin/GoblinExportDataController.java
View file @
4c3030d9
...
@@ -2,6 +2,7 @@ package com.liquidnet.service.platform.controller.goblin;
...
@@ -2,6 +2,7 @@ package com.liquidnet.service.platform.controller.goblin;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.commons.lang.constant.LnsRegex
;
import
com.liquidnet.commons.lang.constant.LnsRegex
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CollectionUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
...
@@ -31,7 +32,9 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -31,7 +32,9 @@ import javax.servlet.http.HttpServletResponse;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Pattern
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -73,18 +76,19 @@ public class GoblinExportDataController {
...
@@ -73,18 +76,19 @@ public class GoblinExportDataController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"店铺ID"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"storeId"
,
value
=
"店铺ID"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"marketId"
,
value
=
"活动ID"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"marketId"
,
value
=
"活动ID"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"b
Tim
e"
,
value
=
"开始时间[yyyy-MM-dd]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"b
Dat
e"
,
value
=
"开始时间[yyyy-MM-dd]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"e
Tim
e"
,
value
=
"结束时间[yyyy-MM-dd]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
false
,
dataType
=
"String"
,
name
=
"e
Dat
e"
,
value
=
"结束时间[yyyy-MM-dd]"
),
})
})
public
ResponseDto
<
String
>
exportZhengzaiMarketOrder
(
@RequestParam
(
required
=
false
,
name
=
"bTime"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_YMD
,
message
=
"开始时间格式有误"
)
String
beginTim
e
,
public
void
exportZhengzaiMarketOrder
(
@RequestParam
(
required
=
false
,
name
=
"bDate"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_YMD
,
message
=
"开始日期格式有误"
)
String
beginDat
e
,
@RequestParam
(
required
=
false
,
name
=
"e
Time"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_YMD
,
message
=
"结束时间格式有误"
)
String
endTim
e
,
@RequestParam
(
required
=
false
,
name
=
"e
Date"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_YMD
,
message
=
"结束日期格式有误"
)
String
endDat
e
,
@RequestParam
String
marketId
,
@RequestParam
String
storeId
,
HttpServletResponse
response
)
{
@RequestParam
String
marketId
,
@RequestParam
String
storeId
,
HttpServletResponse
response
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
ServletOutputStream
servletOutputStream
=
null
;
ServletOutputStream
servletOutputStream
=
null
;
try
{
try
{
log
.
debug
(
"数据导出:正在下单-销售数据:[uid:{},storeId:{},marketId:{},time:{}~{}]"
,
currentUid
,
storeId
,
marketId
,
beginTime
,
endTime
);
log
.
debug
(
"数据导出:正在下单-销售数据:[uid:{},storeId:{},marketId:{},date:{}~{}]"
,
currentUid
,
storeId
,
marketId
,
beginDate
,
endDate
);
response
.
setHeader
(
HttpHeaders
.
CONTENT_DISPOSITION
,
"attachment;filename="
.
concat
(
DateUtil
.
Formatter
.
ddHHmmssTrim
.
format
(
LocalDateTime
.
now
()))
String
fileName
=
DateUtil
.
Formatter
.
ddHHmmssTrim
.
format
(
LocalDateTime
.
now
())
.
concat
(
new
String
((
"正在下单-销售数据"
).
getBytes
(
"gb2312"
),
StandardCharsets
.
ISO_8859_1
)).
concat
(
ExcelTypeEnum
.
XLSX
.
getValue
()));
.
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
.
setContentType
(
MediaType
.
MULTIPART_FORM_DATA_VALUE
);
response
.
setCharacterEncoding
(
StandardCharsets
.
UTF_8
.
name
());
response
.
setCharacterEncoding
(
StandardCharsets
.
UTF_8
.
name
());
servletOutputStream
=
response
.
getOutputStream
();
servletOutputStream
=
response
.
getOutputStream
();
...
@@ -92,22 +96,23 @@ public class GoblinExportDataController {
...
@@ -92,22 +96,23 @@ public class GoblinExportDataController {
HashMap
<
String
,
Object
>
paramMap
=
CollectionUtil
.
mapStringObject
();
HashMap
<
String
,
Object
>
paramMap
=
CollectionUtil
.
mapStringObject
();
paramMap
.
put
(
"storeId"
,
storeId
);
paramMap
.
put
(
"storeId"
,
storeId
);
paramMap
.
put
(
"marketId"
,
marketId
);
paramMap
.
put
(
"marketId"
,
marketId
);
LocalDate
Time
beginDateTime
=
DateUtil
.
Formatter
.
yyyy_MM_dd
.
parse
(
beginTim
e
);
LocalDate
beginLocalDate
=
DateUtil
.
Formatter
.
yyyy_MM_dd
.
parse2LocalDate
(
beginDat
e
);
LocalDate
Time
endDateTime
=
DateUtil
.
Formatter
.
yyyy_MM_dd
.
parse
(
endTim
e
);
LocalDate
endLocalDate
=
DateUtil
.
Formatter
.
yyyy_MM_dd
.
parse2LocalDate
(
endDat
e
);
paramMap
.
put
(
"beginTime"
,
beginDateTime
);
paramMap
.
put
(
"beginTime"
,
null
==
beginLocalDate
?
beginLocalDate
:
LocalDateTime
.
of
(
beginLocalDate
,
LocalTime
.
MIN
)
);
paramMap
.
put
(
"endTime"
,
null
==
end
DateTime
?
endDateTime
:
endDateTime
.
withHour
(
23
).
withMinute
(
59
).
withSecond
(
59
));
paramMap
.
put
(
"endTime"
,
null
==
end
LocalDate
?
endLocalDate
:
LocalDateTime
.
of
(
endLocalDate
,
LocalTime
.
MAX
));
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"数据导出:正在下单-销售数据:[uid:{},paramMap:{}]"
,
currentUid
,
JsonUtils
.
toJson
(
paramMap
));
log
.
debug
(
"数据导出:正在下单-销售数据:[uid:{},paramMap:{}]"
,
currentUid
,
JsonUtils
.
toJson
(
paramMap
));
}
}
List
<
GoblinZhengzaiMarketOrderExcelDto
>
excelDtos
=
iGoblinExportService
.
exportZhengzaiMarketOrder
(
paramMap
);
List
<
GoblinZhengzaiMarketOrderExcelDto
>
excelDtos
=
iGoblinExportService
.
exportZhengzaiMarketOrder
(
paramMap
);
if
(
CollectionUtils
.
isEmpty
(
excelDtos
))
{
if
(
CollectionUtils
.
isEmpty
(
excelDtos
))
{
return
ResponseDto
.
failure
(
"无数据,请核实"
);
throw
new
LiquidnetServiceException
(
"-1"
,
"无数据,请核实"
);
}
}
EasyExcel
.
write
(
servletOutputStream
,
GoblinZhengzaiMarketOrderExcelDto
.
class
).
sheet
(
"销售数据"
).
doWrite
(
excelDtos
);
EasyExcel
.
write
(
servletOutputStream
,
GoblinZhengzaiMarketOrderExcelDto
.
class
).
sheet
(
"销售数据"
).
doWrite
(
excelDtos
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"数据导出:正在下单-销售数据:异常[UID={},ex.msg={}]"
,
currentUid
,
e
.
getLocalizedMessage
());
log
.
error
(
"数据导出:正在下单-销售数据:异常[uid:{},storeId:{},marketId:{},date:{}~{},ex.msg={}]"
,
return
ResponseDto
.
failure
(
"导出失败,请联系网站管理员"
);
currentUid
,
storeId
,
marketId
,
beginDate
,
endDate
,
e
.
getLocalizedMessage
());
throw
new
LiquidnetServiceException
(
"-1"
,
"导出失败,请联系网站管理员"
);
}
finally
{
}
finally
{
if
(
null
!=
servletOutputStream
)
{
if
(
null
!=
servletOutputStream
)
{
try
{
try
{
...
@@ -116,6 +121,5 @@ public class GoblinExportDataController {
...
@@ -116,6 +121,5 @@ public class GoblinExportDataController {
}
}
}
}
}
}
return
ResponseDto
.
success
();
}
}
}
}
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