记得上下班打卡 | 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
c1b3a024
Commit
c1b3a024
authored
Jan 03, 2023
by
胡佳晨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除重复代码 GoblinExportDataController.java
parent
29a25bf6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
124 deletions
+0
-124
GoblinExportDataController.java
...latform/controller/goblin/GoblinExportDataController.java
+0
-114
GoblinExportServiceImpl.java
...platform/service/impl/goblin/GoblinExportServiceImpl.java
+0
-10
No files found.
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/controller/goblin/GoblinExportDataController.java
View file @
c1b3a024
...
@@ -243,118 +243,4 @@ public class GoblinExportDataController {
...
@@ -243,118 +243,4 @@ public class GoblinExportDataController {
}
}
}
}
/**
* excel正在下单根据日期导出
*
* @return
*/
@GetMapping
(
"/exportMarketGoods"
)
@ApiOperation
(
value
=
"正在下单-商品根据日期"
)
@ResponseBody
@ApiImplicitParams
({
@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
=
"bDate"
,
value
=
"开始时间[yyyy-MM-dd]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"eDate"
,
value
=
"结束时间[yyyy-MM-dd]"
),
})
public
void
exportMarketGoods
(
@RequestParam
(
required
=
true
,
name
=
"bDate"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_YMD
,
message
=
"开始日期格式有误"
)
String
beginDate
,
@RequestParam
(
required
=
true
,
name
=
"eDate"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_YMD
,
message
=
"结束日期格式有误"
)
String
endDate
,
@RequestParam
String
marketId
,
@RequestParam
String
storeId
,
HttpServletResponse
response
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
ServletOutputStream
servletOutputStream
=
null
;
try
{
log
.
debug
(
"数据导出:正在下单-商品根据日期导出:[uid:{},storeId:{},marketId:{},date:{}~{}]"
,
currentUid
,
storeId
,
marketId
,
beginDate
,
endDate
);
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
();
HashMap
<
String
,
Object
>
paramMap
=
CollectionUtil
.
mapStringObject
();
paramMap
.
put
(
"storeId"
,
storeId
);
paramMap
.
put
(
"marketId"
,
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
()
+
marketId
);
LocalDate
beginLocalDate
=
DateUtil
.
Formatter
.
yyyy_MM_dd
.
parse2LocalDate
(
beginDate
);
LocalDate
endLocalDate
=
DateUtil
.
Formatter
.
yyyy_MM_dd
.
parse2LocalDate
(
endDate
);
paramMap
.
put
(
"beginTime"
,
null
==
beginLocalDate
?
beginLocalDate
:
LocalDateTime
.
of
(
beginLocalDate
,
LocalTime
.
MIN
));
paramMap
.
put
(
"endTime"
,
null
==
endLocalDate
?
endLocalDate
:
LocalDateTime
.
of
(
endLocalDate
,
LocalTime
.
MAX
));
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"数据导出:正在下单-商品根据日期导出:[uid:{},paramMap:{}]"
,
currentUid
,
JsonUtils
.
toJson
(
paramMap
));
}
List
<
GoblinMarketGoodsExcelDto
>
excelDtos
=
iGoblinExportService
.
exportMarketGoods
(
paramMap
);
if
(
CollectionUtils
.
isEmpty
(
excelDtos
))
{
log
.
warn
(
"数据导出:正在下单-商品根据日期导出:无数据,请核实:[uid:{},paramMap:{}]"
,
currentUid
,
JsonUtils
.
toJson
(
paramMap
));
return
;
}
EasyExcel
.
write
(
servletOutputStream
,
GoblinMarketGoodsExcelDto
.
class
).
sheet
(
"销售数据"
).
doWrite
(
excelDtos
);
}
catch
(
IOException
e
)
{
log
.
error
(
"数据导出:正在下单-商品根据日期导出:异常[uid:{},storeId:{},marketId:{},date:{}~{},ex.msg={}]"
,
currentUid
,
storeId
,
marketId
,
beginDate
,
endDate
,
e
.
getLocalizedMessage
());
throw
new
LiquidnetServiceException
(
"-1"
,
"导出失败,请联系网站管理员"
);
}
finally
{
if
(
null
!=
servletOutputStream
)
{
try
{
servletOutputStream
.
close
();
}
catch
(
Exception
ignored
)
{
}
}
}
}
/**
* excel正在下单根据导出
*/
@GetMapping
(
"/exportMarketGoodsUnDate"
)
@ApiOperation
(
value
=
"正在下单-商品导出"
)
@ResponseBody
@ApiImplicitParams
({
@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
=
"bDate"
,
value
=
"开始时间[yyyy-MM-dd HH:mm:ss]"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"eDate"
,
value
=
"结束时间[yyyy-MM-dd HH:mm:ss]"
),
})
public
void
exportMarketGoodsUnDate
(
@RequestParam
(
required
=
true
,
name
=
"bDate"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_FULL
,
message
=
"开始日期格式有误"
)
String
beginDate
,
@RequestParam
(
required
=
true
,
name
=
"eDate"
)
@Pattern
(
regexp
=
LnsRegex
.
Valid
.
DATETIME_FULL
,
message
=
"结束日期格式有误"
)
String
endDate
,
@RequestParam
String
marketId
,
@RequestParam
String
storeId
,
HttpServletResponse
response
)
{
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
ServletOutputStream
servletOutputStream
=
null
;
try
{
log
.
debug
(
"数据导出:正在下单-商品导出:[uid:{},storeId:{},marketId:{},date:{}~{}]"
,
currentUid
,
storeId
,
marketId
,
beginDate
,
endDate
);
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
();
HashMap
<
String
,
Object
>
paramMap
=
CollectionUtil
.
mapStringObject
();
paramMap
.
put
(
"storeId"
,
storeId
);
paramMap
.
put
(
"marketId"
,
GoblinStatusConst
.
MarketPreStatus
.
MARKET_PRE_ZHENGZAI
.
getValue
()
+
marketId
);
paramMap
.
put
(
"beginTime"
,
beginDate
);
paramMap
.
put
(
"endTime"
,
endDate
);
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"数据导出:正在下单-商品导出:[uid:{},paramMap:{}]"
,
currentUid
,
JsonUtils
.
toJson
(
paramMap
));
}
List
<
GoblinMarketGoodsUnDateExcelDto
>
excelDtos
=
iGoblinExportService
.
exportMarketGoodsUnDate
(
paramMap
);
if
(
CollectionUtils
.
isEmpty
(
excelDtos
))
{
log
.
warn
(
"数据导出:正在下单-商品导出:无数据,请核实:[uid:{},paramMap:{}]"
,
currentUid
,
JsonUtils
.
toJson
(
paramMap
));
return
;
}
EasyExcel
.
write
(
servletOutputStream
,
GoblinMarketGoodsUnDateExcelDto
.
class
).
sheet
(
"销售数据"
).
doWrite
(
excelDtos
);
}
catch
(
IOException
e
)
{
log
.
error
(
"数据导出:正在下单-商品导出:异常[uid:{},storeId:{},marketId:{},date:{}~{},ex.msg={}]"
,
currentUid
,
storeId
,
marketId
,
beginDate
,
endDate
,
e
.
getLocalizedMessage
());
throw
new
LiquidnetServiceException
(
"-1"
,
"导出失败,请联系网站管理员"
);
}
finally
{
if
(
null
!=
servletOutputStream
)
{
try
{
servletOutputStream
.
close
();
}
catch
(
Exception
ignored
)
{
}
}
}
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/goblin/GoblinExportServiceImpl.java
View file @
c1b3a024
...
@@ -48,16 +48,6 @@ public class GoblinExportServiceImpl implements IGoblinExportService {
...
@@ -48,16 +48,6 @@ public class GoblinExportServiceImpl implements IGoblinExportService {
return
goblinStoreOrderMapper
.
exportZhengzaiMarketOrder
(
paramMap
);
return
goblinStoreOrderMapper
.
exportZhengzaiMarketOrder
(
paramMap
);
}
}
@Override
public
List
<
GoblinMarketGoodsExcelDto
>
exportMarketGoods
(
Map
<
String
,
Object
>
paramMap
)
{
return
goblinStoreOrderMapper
.
exportMarketGoods
(
paramMap
);
}
@Override
public
List
<
GoblinMarketGoodsUnDateExcelDto
>
exportMarketGoodsUnDate
(
Map
<
String
,
Object
>
paramMap
)
{
return
goblinStoreOrderMapper
.
exportMarketGoodsUnDate
(
paramMap
);
}
@Override
@Override
public
ResponseDto
<
String
>
exportMallOrder
(
HttpServletResponse
response
,
String
beginTime
,
String
endTime
,
String
state
,
Integer
mailType
,
String
storeId
)
{
public
ResponseDto
<
String
>
exportMallOrder
(
HttpServletResponse
response
,
String
beginTime
,
String
endTime
,
String
state
,
Integer
mailType
,
String
storeId
)
{
if
(!
timeIsNotNull
(
beginTime
,
endTime
))
{
if
(!
timeIsNotNull
(
beginTime
,
endTime
))
{
...
...
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