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
bccc81cf
Commit
bccc81cf
authored
Jul 04, 2019
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量导入
parent
025e050a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
30 deletions
+52
-30
Constants.java
...e-api/src/main/java/com/gic/store/constant/Constants.java
+11
-0
StoreImportApiService.java
...ain/java/com/gic/store/service/StoreImportApiService.java
+2
-0
StoreTaskServiceImpl.java
...java/com/gic/store/service/impl/StoreTaskServiceImpl.java
+4
-4
StoreImportApiServiceImpl.java
...om/gic/store/service/outer/StoreImportApiServiceImpl.java
+10
-9
StoreImportController.java
...a/com/gic/store/web/controller/StoreImportController.java
+25
-17
No files found.
gic-store-api/src/main/java/com/gic/store/constant/Constants.java
0 → 100644
View file @
bccc81cf
package
com
.
gic
.
store
.
constant
;
/**
* @author zhiwj
* @date 2019/7/4
*/
public
interface
Constants
{
String
STORE_BATCH_IMPORT_MQ_KEY
=
"tmpStoreBatchImportTaskMq"
;
// String STORE_BATCH_IMPORT_MQ_KEY = "tmpStoreBatchImportTaskMq4.0";
Integer
STORE_BATCH_IMPORT_TASK_TYPE
=
5
;
}
gic-store-api/src/main/java/com/gic/store/service/StoreImportApiService.java
View file @
bccc81cf
...
...
@@ -32,4 +32,6 @@ public interface StoreImportApiService {
ServiceResponse
<
String
>
isExistStoreGroup
(
Integer
enterpriseId
,
String
storeGroupName
);
ServiceResponse
<
List
<
String
>>
listBrandByNotExist
(
Integer
enterpriseId
,
String
brands
);
// List<StoreTmpDTO> listStoreTmp(Integer enterpriseId, Boolean isSuccess, Boolean isWait);
}
gic-store-service/src/main/java/com/gic/store/service/impl/StoreTaskServiceImpl.java
View file @
bccc81cf
...
...
@@ -133,8 +133,8 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
if
(
erpStatusResponse
.
isSuccess
())
{
List
<
StoreDictDTO
>
erpList
=
erpStatusResponse
.
getResult
();
final
String
erpStatusTmp
=
t
.
getErpStatus
().
replace
(
"\\s+"
,
""
);
Optional
<
StoreDictDTO
>
erpStatusDTO
=
erpList
.
stream
().
filter
(
e
->
e
.
get
Value
().
equals
(
erpStatusTmp
)).
findFirst
();
storeDTO
.
setErpStatus
(
Integer
.
parseInt
(
erpStatusDTO
.
get
().
get
Key
()));
Optional
<
StoreDictDTO
>
erpStatusDTO
=
erpList
.
stream
().
filter
(
e
->
e
.
get
Key
().
equals
(
erpStatusTmp
)).
findFirst
();
storeDTO
.
setErpStatus
(
Integer
.
parseInt
(
erpStatusDTO
.
get
().
get
Value
()));
}
else
{
logger
.
warn
(
"字典模块调用失败"
);
}
...
...
@@ -143,8 +143,8 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
if
(
storeTypeResponse
.
isSuccess
())
{
List
<
StoreDictDTO
>
typeList
=
storeTypeResponse
.
getResult
();
final
String
typeTmp
=
t
.
getStoreType
().
replace
(
"\\s+"
,
""
);
Optional
<
StoreDictDTO
>
typeTmpDTO
=
typeList
.
stream
().
filter
(
e
->
e
.
get
Value
().
equals
(
typeTmp
)).
findFirst
();
storeDTO
.
setStoreType
(
Integer
.
parseInt
(
typeTmpDTO
.
get
().
get
Key
()));
Optional
<
StoreDictDTO
>
typeTmpDTO
=
typeList
.
stream
().
filter
(
e
->
e
.
get
Key
().
equals
(
typeTmp
)).
findFirst
();
storeDTO
.
setStoreType
(
Integer
.
parseInt
(
typeTmpDTO
.
get
().
get
Value
()));
}
else
{
logger
.
warn
(
"字典模块调用失败"
);
}
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/StoreImportApiServiceImpl.java
View file @
bccc81cf
...
...
@@ -34,9 +34,6 @@ public class StoreImportApiServiceImpl implements StoreImportApiService {
private
StoreBrandService
storeBrandService
;
@Autowired
private
StoreApiService
storeApiService
;
@Autowired
private
StoreService
storeService
;
@Autowired
...
...
@@ -46,12 +43,6 @@ public class StoreImportApiServiceImpl implements StoreImportApiService {
private
StoreGroupService
storeGroupService
;
@Autowired
private
ProvincesApiService
provincesApiService
;
@Autowired
private
StoreDictApiService
storeDictApiService
;
@Autowired
private
StoreTaskService
storeTaskService
;
@Override
...
...
@@ -118,4 +109,14 @@ public class StoreImportApiServiceImpl implements StoreImportApiService {
}
return
ServiceResponse
.
failure
(
ErrorCode
.
ERR_3
.
getCode
(),
"队列错误"
);
}
// @Autowired
// TabStoreTmpMapper tabStoreTmpMapper;
//
// @Override
// public List<StoreTmpDTO> listStoreTmp(Integer enterpriseId, Boolean isSuccess, Boolean isWait) {
// return EntityUtil.changeEntityListByOrika(StoreTmpDTO.class, tabStoreTmpMapper.listStoreTmp(enterpriseId, isSuccess, isWait));
// }
}
gic-store-web/src/main/java/com/gic/store/web/controller/StoreImportController.java
View file @
bccc81cf
...
...
@@ -95,7 +95,7 @@ public class StoreImportController {
@RequestMapping
(
"/store-tmp-file-upload"
)
public
RestResponse
fileUpload
(
HttpServletRequest
request
,
MultipartFile
file
,
PageQO
pageQO
)
throws
IOException
{
Integer
enterpriseId
=
1
0000
;
Integer
enterpriseId
=
1
111
;
if
(
file
==
null
||
file
.
isEmpty
())
{
return
RestResponse
.
failure
(
ErrorCode
.
ERR_5
.
getCode
(),
"文件不存在"
);
}
...
...
@@ -223,12 +223,13 @@ public class StoreImportController {
validate
=
false
;
}
}
if
(
validate
)
{
if
(
this
.
storeTypeValidate
(
enterpriseId
,
storeType
)
==
-
1
)
{
bean
.
setErrorMessage
(
"门店类型不存在"
);
validate
=
false
;
}
}
// todo
// if (validate) {
// if (this.storeTypeValidate(enterpriseId, storeType) == -1) {
// bean.setErrorMessage("门店类型不存在");
// validate = false;
// }
// }
// 验证门店状态
String
erpStatus
=
row
.
get
(
4
);
bean
.
setErpStatus
(
erpStatus
);
...
...
@@ -238,12 +239,13 @@ public class StoreImportController {
validate
=
false
;
}
}
if
(
validate
)
{
if
(
this
.
erpStatusValidate
(
enterpriseId
,
erpStatus
)
==
-
1
)
{
bean
.
setErrorMessage
(
"门店状态不存在"
);
validate
=
false
;
}
}
//todo
// if (validate) {
// if (this.erpStatusValidate(enterpriseId, erpStatus) == -1) {
// bean.setErrorMessage("门店状态不存在");
// validate = false;
// }
// }
// 验证门店电话
String
conactsPhone
=
row
.
get
(
5
);
bean
.
setConactsPhone
(
conactsPhone
);
...
...
@@ -364,7 +366,7 @@ public class StoreImportController {
if
(
serviceResponse
.
isSuccess
())
{
List
<
StoreDictDTO
>
list
=
serviceResponse
.
getResult
();
final
String
erpStatusTmp
=
erpStatus
.
replace
(
"\\s+"
,
""
);
long
count
=
list
.
stream
().
filter
(
e
->
e
.
get
Value
().
equals
(
erpStatusTmp
)).
count
();
long
count
=
list
.
stream
().
filter
(
e
->
e
.
get
Key
().
equals
(
erpStatusTmp
)).
count
();
if
(
count
>
0
)
{
return
(
int
)
count
;
}
...
...
@@ -377,7 +379,7 @@ public class StoreImportController {
if
(
serviceResponse
.
isSuccess
())
{
List
<
StoreDictDTO
>
list
=
serviceResponse
.
getResult
();
final
String
storeTypeTmp
=
storeType
.
replace
(
"\\s+"
,
""
);
long
count
=
list
.
stream
().
filter
(
e
->
e
.
get
Value
().
equals
(
storeTypeTmp
)).
count
();
long
count
=
list
.
stream
().
filter
(
e
->
e
.
get
Key
().
equals
(
storeTypeTmp
)).
count
();
if
(
count
>
0
)
{
return
(
int
)
count
;
}
...
...
@@ -394,10 +396,16 @@ public class StoreImportController {
XSSFSheet
sheet
=
workbook
.
getSheetAt
(
0
);
XSSFRow
row
=
sheet
.
getRow
(
0
);
XSSFCell
cell
=
row
.
getCell
(
0
);
String
regionId
=
cell
.
getStringCellValue
();
ServiceResponse
<
StoreRegionDTO
>
serviceResponse
=
storeRegionApiService
.
getStoreRegionByRegion
(
enterpriseId
,
Integer
.
parseInt
(
regionId
));
ServiceResponse
<
StoreRegionDTO
>
serviceResponse
=
storeRegionApiService
.
getStoreRegionByRegion
(
enterpriseId
,
(
int
)
cell
.
getNumericCellValue
());
return
serviceResponse
.
isSuccess
()
?
serviceResponse
.
getResult
()
:
null
;
}
// @RequestMapping("/test")
// public Object re() {
// List<StoreTmpDTO> storeTmpDTOS = storeImportApiService.listStoreTmp(1111, null, true);
// System.out.println(storeTmpDTOS);
// return null;
// }
}
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