Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
Overview
Overview
Details
Activity
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
base_platform_enterprise
gic-store
Commits
a37687ca
Commit
a37687ca
authored
May 19, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店导出优化
parent
03415dfa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
1 deletions
+78
-1
StoreDTO.java
gic-store-api/src/main/java/com/gic/store/dto/StoreDTO.java
+37
-0
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+41
-1
No files found.
gic-store-api/src/main/java/com/gic/store/dto/StoreDTO.java
View file @
a37687ca
...
...
@@ -53,6 +53,10 @@ public class StoreDTO extends StoreInfoDTO implements Serializable {
* 小程序默认图片
*/
private
StorePhotoDTO
defaultPhoto
;
private
String
completeStatusName
;
private
String
statusName
;
private
String
erpStatusName
;
private
String
storeTypeName
;
public
Integer
getStoreId
()
{
return
storeId
;
...
...
@@ -197,4 +201,36 @@ public class StoreDTO extends StoreInfoDTO implements Serializable {
public
void
setLicense
(
Integer
license
)
{
this
.
license
=
license
;
}
public
void
setCompleteStatusName
(
String
completeStatusName
)
{
this
.
completeStatusName
=
completeStatusName
;
}
public
String
getCompleteStatusName
()
{
return
completeStatusName
;
}
public
void
setStatusName
(
String
statusName
)
{
this
.
statusName
=
statusName
;
}
public
String
getStatusName
()
{
return
statusName
;
}
public
void
setErpStatusName
(
String
erpStatusName
)
{
this
.
erpStatusName
=
erpStatusName
;
}
public
String
getErpStatusName
()
{
return
erpStatusName
;
}
public
void
setStoreTypeName
(
String
storeTypeName
)
{
this
.
storeTypeName
=
storeTypeName
;
}
public
String
getStoreTypeName
()
{
return
storeTypeName
;
}
}
\ No newline at end of file
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
a37687ca
...
...
@@ -397,6 +397,8 @@ public class StoreController extends DownloadUtils {
nameList
.
add
(
vo
.
getKey
());
}
}
List
<
String
>
fieldCodeList
=
storeExportQO
.
getFieldCodeList
();
ExecutorPoolSingleton
.
getInstance
().
executeTask
(
new
Runnable
()
{
@Override
public
void
run
()
{
...
...
@@ -406,11 +408,49 @@ public class StoreController extends DownloadUtils {
ServiceResponse
<
Page
<
StoreDTO
>>
pageServiceResponse
=
storeApiService
.
listStore
(
storeExportQO
,
pageNum
,
1000
);
List
<
StoreDTO
>
list
=
pageServiceResponse
.
getResult
().
getResult
();
convertCustomField
(
list
);
convertStatusName
(
fieldCodeList
,
list
);
return
list
;
}
private
void
convertStatusName
(
List
<
String
>
fieldCodeList
,
List
<
StoreDTO
>
list
)
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
int
completeStatusIndex
=
fieldCodeList
.
indexOf
(
"completeStatus"
);
if
(
completeStatusIndex
!=
-
1
)
{
fieldCodeList
.
set
(
completeStatusIndex
,
"completeStatusName"
);
for
(
StoreDTO
e
:
list
)
{
e
.
setCompleteStatusName
(
e
.
getCompleteStatus
()
==
null
?
"未知"
:
(
e
.
getCompleteStatus
()
==
1
?
"已完善"
:
"未完善"
));
}
}
int
statusIndex
=
fieldCodeList
.
indexOf
(
"status"
);
if
(
statusIndex
!=
-
1
)
{
fieldCodeList
.
set
(
statusIndex
,
"statusName"
);
for
(
StoreDTO
e
:
list
)
{
e
.
setStatusName
(
e
.
getStatus
()
==
null
?
"未知"
:
(
e
.
getStatus
()
==
1
?
"已启用"
:
"未启用"
));
}
}
int
erpStatusIndex
=
fieldCodeList
.
indexOf
(
"erpStatus"
);
if
(
erpStatusIndex
!=
-
1
)
{
fieldCodeList
.
set
(
erpStatusIndex
,
"erpStatusName"
);
Map
<
Integer
,
String
>
erpStatusMap
=
storeDictApiService
.
listAllStoreStatus
(
list
.
get
(
0
).
getEnterpriseId
())
.
getResult
().
stream
().
collect
(
Collectors
.
toMap
(
e
->
Integer
.
valueOf
(
e
.
getValue
()),
StoreDictDTO:
:
getKey
));
for
(
StoreDTO
e
:
list
)
{
e
.
setErpStatusName
(
erpStatusMap
.
get
(
e
.
getErpStatus
()));
}
}
int
storeTypeIndex
=
fieldCodeList
.
indexOf
(
"storeType"
);
if
(
storeTypeIndex
!=
-
1
)
{
fieldCodeList
.
set
(
storeTypeIndex
,
"storeTypeName"
);
Map
<
Integer
,
String
>
storeTypeMap
=
storeDictApiService
.
listAllStoreType
(
list
.
get
(
0
).
getEnterpriseId
())
.
getResult
().
stream
().
collect
(
Collectors
.
toMap
(
e
->
Integer
.
valueOf
(
e
.
getValue
()),
StoreDictDTO:
:
getKey
));
for
(
StoreDTO
e
:
list
)
{
e
.
setStoreTypeName
(
storeTypeMap
.
get
(
e
.
getStoreType
()));
}
}
}
}
};
try
{
download
(
path
,
downloadReport
,
storeExportQO
.
getFileName
(),
storeExportQO
.
getExcelExtension
(),
nameList
,
storeExportQO
.
getFieldCodeList
(),
loader
,
null
,
null
);
download
(
path
,
downloadReport
,
storeExportQO
.
getFileName
(),
storeExportQO
.
getExcelExtension
(),
nameList
,
fieldCodeList
,
loader
,
null
,
null
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"异常"
,
e
);
}
...
...
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