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
64a7628c
Commit
64a7628c
authored
Feb 07, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/base_platform_enterprise/gic-store
into developer
parents
c9c841e2
16120f64
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
8 deletions
+60
-8
StoreLogReasonEnum.java
.../main/java/com/gic/store/constant/StoreLogReasonEnum.java
+1
-0
ProcessBatchClerkDTO.java
...in/java/com/gic/store/dto/clerk/ProcessBatchClerkDTO.java
+2
-1
StoreApiService.java
.../src/main/java/com/gic/store/service/StoreApiService.java
+14
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+43
-7
No files found.
gic-store-api/src/main/java/com/gic/store/constant/StoreLogReasonEnum.java
View file @
64a7628c
...
...
@@ -12,6 +12,7 @@ public enum StoreLogReasonEnum {
ORDER
(
3
,
"订单同步"
),
MEMBER
(
4
,
"会员同步"
),
SYSTEM
(
5
,
"系统配置触发"
),
ETL
(
6
,
"ETL同步"
)
;
private
int
code
;
private
String
message
;
...
...
gic-store-api/src/main/java/com/gic/store/dto/clerk/ProcessBatchClerkDTO.java
View file @
64a7628c
...
...
@@ -64,7 +64,8 @@ public class ProcessBatchClerkDTO implements Serializable{
/********************操作日志**********************/
/**
* 事由 1:web后台操作 2:外部触发 3:订单同步 4:会员同步 5:系统配置触发
* 事由 1:web后台操作 2:外部触发 3:订单同步 4:会员同步 5:系统配置触发 6 etl同步
* StoreLogReasonEnum枚举
*/
private
Integer
reason
;
/**
...
...
gic-store-api/src/main/java/com/gic/store/service/StoreApiService.java
View file @
64a7628c
...
...
@@ -6,6 +6,7 @@ import com.gic.api.base.commons.ServiceResponse;
import
com.gic.store.dto.*
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author zhiwj
...
...
@@ -54,6 +55,19 @@ public interface StoreApiService {
* @throws
*/
ServiceResponse
<
Page
<
StoreDTO
>>
listStore
(
StoreSearchDTO
storeSearchDTO
,
Integer
pageNum
,
Integer
pageSize
);
/**
* 按id查询门店图片 key:storeId value:门店图片列表
* @Title: listStorePhotoByIds
* @Description:
* @author zhiwj
* @param enterpriseId
* @param storeIdList
* @return com.gic.api.base.commons.ServiceResponse<java.util.Map<java.lang.Integer,java.util.List<java.lang.String>>>
* @throws
*/
ServiceResponse
<
Map
<
Integer
,
List
<
String
>>>
listStorePhotoByStoreIds
(
Integer
enterpriseId
,
List
<
Integer
>
storeIdList
);
/**
* @Title: getStoreById
* @Description: 查询门店详情
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
64a7628c
...
...
@@ -26,6 +26,7 @@ import com.gic.store.entity.*;
import
com.gic.store.service.*
;
import
com.gic.store.strategy.BulkUpdateStoreStrtegy
;
import
com.gic.store.utils.field.*
;
import
com.google.common.base.Joiner
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
...
...
@@ -439,6 +440,31 @@ public class StoreApiServiceImpl implements StoreApiService {
}
@Override
public
ServiceResponse
<
Map
<
Integer
,
List
<
String
>>>
listStorePhotoByStoreIds
(
Integer
enterpriseId
,
List
<
Integer
>
storeIdList
)
{
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setStoreIds
(
Joiner
.
on
(
" "
).
join
(
storeIdList
));
ServiceResponse
<
Page
<
StoreDTO
>>
serviceResponse
=
this
.
listStore
(
storeSearchDTO
,
1
,
20
);
if
(!
serviceResponse
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
Map
<
Integer
,
List
<
String
>>
resultMap
=
new
HashMap
<>(
16
);
List
<
StoreDTO
>
storeDTOList
=
serviceResponse
.
getResult
().
getResult
();
for
(
StoreDTO
storeDTO
:
storeDTOList
)
{
List
<
StorePhotoDTO
>
photoList
=
storeDTO
.
getPhotoList
();
List
<
String
>
list
=
Optional
.
ofNullable
(
photoList
).
orElse
(
Collections
.
emptyList
()).
stream
().
map
(
StorePhotoDTO:
:
getImageUrl
).
collect
(
Collectors
.
toList
());
// todo 给一个门店图片默认值测试
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
list
=
Arrays
.
asList
(
"http://gicdev.demogic.com/gic-web/static/img/side-img.dc95242.png"
);
}
resultMap
.
put
(
storeDTO
.
getStoreId
(),
list
);
}
return
EnterpriseServiceResponse
.
success
(
resultMap
);
}
@Override
public
ServiceResponse
queryStoreFromES
(
JSONObject
jsonObject
,
Integer
pageNum
,
Integer
pageSize
,
JSONObject
sortJson
,
String
returnFileds
)
{
if
(
StringUtils
.
isBlank
(
returnFileds
))
{
returnFileds
=
StoreESFieldsEnum
.
STOREID
.
getField
();
...
...
@@ -658,13 +684,19 @@ public class StoreApiServiceImpl implements StoreApiService {
List
<
CountyDTO
>
countyDTOList
=
countyResponse
.
getResult
();
String
finalCounty
=
processBatchStoreDTO
.
getCounty
();
CountyDTO
countyDTO
=
countyDTOList
.
stream
().
filter
(
e
->
StringUtils
.
equals
(
e
.
getCountyName
(),
finalCounty
)).
findFirst
().
orElse
(
null
);
if
(
countyDTO
==
null
||
cityDTO
==
null
||
provinceDTO
==
null
)
{
return
responseErrorElement
(
ImportStoreBatchResultEnum
.
B4
);
if
(
provinceDTO
!=
null
&&
cityDTO
!=
null
&&
countyDTO
!=
null
)
{
storeDTO
.
setProvinceId
(
countyDTO
.
getProvinceId
());
storeDTO
.
setCityId
(
countyDTO
.
getCityId
());
storeDTO
.
setAreaId
(
countyDTO
.
getCountyId
());
storeDTO
.
setProvinces
(
provinceDTO
.
getProvinceName
()
+
"/"
+
countyDTO
.
getCountyName
()
+
"/"
+
cityDTO
.
getCityName
());
}
storeDTO
.
setProvinceId
(
countyDTO
.
getProvinceId
());
storeDTO
.
setCityId
(
countyDTO
.
getCityId
());
storeDTO
.
setAreaId
(
countyDTO
.
getCountyId
());
storeDTO
.
setProvinces
(
provinceDTO
.
getProvinceName
()
+
"/"
+
countyDTO
.
getCountyName
()
+
"/"
+
cityDTO
.
getCityName
());
}
storeDTO
.
setStoreGroupName
(
processBatchStoreDTO
.
getStoreGroupName
());
TabStoreGroup
group
=
storeGroupService
.
getStoreGroupByName
(
processBatchStoreDTO
.
getStoreGroupName
(),
processBatchStoreDTO
.
getEnterpriseId
());
if
(
group
!=
null
)
{
storeDTO
.
setStoreGroupId
(
group
.
getStoreGroupId
());
}
List
<
StoreFieldDTO
>
fieldList
=
storeFieldService
.
listStoreFieldByRegionId
(
processBatchStoreDTO
.
getRegionId
());
...
...
@@ -706,7 +738,11 @@ public class StoreApiServiceImpl implements StoreApiService {
storeDTO
.
setReason
(
StoreLogReasonEnum
.
EXTERNAL
.
getCode
());
// 保存门店
// this.storeService.save(storeDTO);
this
.
saveOrUpdate
(
storeDTO
);
ServiceResponse
<
Integer
>
serviceResponse
=
this
.
saveOrUpdate
(
storeDTO
);
if
(!
serviceResponse
.
isSuccess
())
{
return
EnterpriseServiceResponse
.
failure
(
serviceResponse
.
getCode
(),
serviceResponse
.
getMessage
());
}
if
((
StringUtils
.
isBlank
(
processBatchStoreDTO
.
getProvince
())
&&
StringUtils
.
isBlank
(
processBatchStoreDTO
.
getCity
())
&&
StringUtils
.
isBlank
(
processBatchStoreDTO
.
getCounty
())))
{
return
responseErrorElement
(
ImportStoreBatchResultEnum
.
B3
);
...
...
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