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
301c3a64
Commit
301c3a64
authored
May 19, 2020
by
陶光胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into 'master'
Developer See merge request
!11
parents
475b32e6
9dbc336e
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
257 additions
and
40 deletions
+257
-40
StoreDTO.java
gic-store-api/src/main/java/com/gic/store/dto/StoreDTO.java
+37
-0
ClerkApiService.java
.../src/main/java/com/gic/store/service/ClerkApiService.java
+11
-0
StoreApiService.java
.../src/main/java/com/gic/store/service/StoreApiService.java
+23
-0
TabStoreBusinessTimeMapper.java
.../com/gic/store/dao/mapper/TabStoreBusinessTimeMapper.java
+1
-1
StoreService.java
...ice/src/main/java/com/gic/store/service/StoreService.java
+2
-0
StoreServiceImpl.java
...ain/java/com/gic/store/service/impl/StoreServiceImpl.java
+17
-7
ClerkApiServiceImpl.java
...com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
+14
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+48
-0
StoreBusinessTimeStrategyImpl.java
...ic/store/strategy/impl/StoreBusinessTimeStrategyImpl.java
+10
-10
StorePhoneStategyImpl.java
...va/com/gic/store/strategy/impl/StorePhoneStategyImpl.java
+4
-4
StoreStatusStrategyImpl.java
.../com/gic/store/strategy/impl/StoreStatusStrategyImpl.java
+9
-9
TabStoreBrandMapper.xml
...service/src/main/resources/mapper/TabStoreBrandMapper.xml
+1
-0
TabStoreBusinessTimeMapper.xml
.../src/main/resources/mapper/TabStoreBusinessTimeMapper.xml
+2
-2
TabStoreInfoMapper.xml
...-service/src/main/resources/mapper/TabStoreInfoMapper.xml
+3
-0
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+72
-7
dubbo-gic-store-web.xml
gic-store-web/src/main/resources/dubbo-gic-store-web.xml
+3
-0
No files found.
gic-store-api/src/main/java/com/gic/store/dto/StoreDTO.java
View file @
301c3a64
...
...
@@ -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-api/src/main/java/com/gic/store/service/ClerkApiService.java
View file @
301c3a64
...
...
@@ -121,6 +121,17 @@ public interface ClerkApiService {
ServiceResponse
<
List
<
ClerkDTO
>>
listClerkByStoreId
(
Integer
enterpriseId
,
Integer
storeId
,
String
search
);
/**
* 店长
* @Title: getHeadClerk
* @Description:
* @author guojuxing
* @param enterpriseId
* @param storeId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.store.dto.ClerkDTO>
*/
ServiceResponse
<
ClerkDTO
>
getHeadClerk
(
Integer
enterpriseId
,
Integer
storeId
);
ServiceResponse
<
ClerkDTO
>
getClerkById
(
Integer
enterpriseId
,
Integer
clerkId
);
ServiceResponse
<
List
<
ClerkDTO
>>
listClerk
(
Integer
enterpriseId
,
String
search
);
...
...
gic-store-api/src/main/java/com/gic/store/service/StoreApiService.java
View file @
301c3a64
...
...
@@ -83,6 +83,18 @@ public interface StoreApiService {
ServiceResponse
<
Map
<
Integer
,
List
<
String
>>>
listStorePhotoByStoreIds
(
Integer
enterpriseId
,
List
<
Integer
>
storeIdList
);
/**
* 按id查询门店图片 key:storeInfoIdList value:门店图片列表
* @Title: listStorePhotoByIds
* @Description:
* @author zhiwj
* @param enterpriseId
* @param storeInfoIdList
* @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
>>>
listStorePhotoByStoreInfoIds
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIdList
);
/**
* @Title: getStoreById
* @Description: 查询门店详情
* @author zhiwj
...
...
@@ -339,4 +351,15 @@ public interface StoreApiService {
* @return
*/
void
refreshCache
(
Integer
enterpriseId
,
Integer
storeId
);
/**
* @Title: tranOverFlow
* @Description: 批量转移至门店列表
* @author zhiwj
* @param enterpriseId
* @param storeIds
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse
<
Void
>
tranOverFlow
(
Integer
enterpriseId
,
String
storeIds
);
}
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabStoreBusinessTimeMapper.java
View file @
301c3a64
...
...
@@ -60,7 +60,7 @@ public interface TabStoreBusinessTimeMapper {
int
updateAllBuinessTime
(
@Param
(
"weekday"
)
String
weekday
,
@Param
(
"openTime"
)
Date
openTime
,
@Param
(
"closeTime"
)
Date
closeTime
,
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
int
updateBuinessTimeBystoreInfoIds
(
@Param
(
"weekday"
)
String
weekday
,
@Param
(
"openTime"
)
Date
openTime
,
@Param
(
"closeTime"
)
Date
closeTime
,
@Param
(
"storeIdList"
)
List
<
Integer
>
storeIdList
);
int
updateBuinessTimeBystoreInfoIds
(
@Param
(
"weekday"
)
String
weekday
,
@Param
(
"openTime"
)
Date
openTime
,
@Param
(
"closeTime"
)
Date
closeTime
,
@Param
(
"storeI
nfoI
dList"
)
List
<
Integer
>
storeIdList
);
int
deleteAllByEnterpriseId
(
@Param
(
"enterpriseId"
)
Integer
enterpriseId
);
...
...
gic-store-service/src/main/java/com/gic/store/service/StoreService.java
View file @
301c3a64
...
...
@@ -54,6 +54,8 @@ public interface StoreService {
*/
Integer
countByStoreCode
(
Integer
enterpriseId
,
String
storeCode
,
Integer
storeId
);
Integer
countByOverflowStatus
(
Integer
enterpriseId
,
Integer
overflowStatus
);
Page
<
StoreDTO
>
listStore
(
StoreSearchDBDTO
storeDTO
,
Integer
pageNum
,
Integer
pageSize
);
/**
...
...
gic-store-service/src/main/java/com/gic/store/service/impl/StoreServiceImpl.java
View file @
301c3a64
...
...
@@ -110,6 +110,8 @@ public class StoreServiceImpl implements StoreService {
tabStoreInfo
.
setStoreType
(
copy
.
getStoreType
());
tabStoreInfo
.
setCompleteStatus
(
copy
.
getCompleteStatus
());
tabStoreInfo
.
setIndexId
(
copy
.
getIndexId
());
tabStoreInfo
.
setOverflowStatus
(
copy
.
getOverflowStatus
());
TabStore
store
=
new
TabStore
();
store
.
setEnterpriseId
(
copy
.
getEnterpriseId
());
store
.
setOwnType
(
StoreOwnTypeEnum
.
OWNER
.
getCode
());
...
...
@@ -167,6 +169,14 @@ public class StoreServiceImpl implements StoreService {
}
@Override
public
Integer
countByOverflowStatus
(
Integer
enterpriseId
,
Integer
overflowStatus
)
{
StoreDTO
store
=
new
StoreDTO
();
store
.
setEnterpriseId
(
enterpriseId
);
store
.
setOverflowStatus
(
overflowStatus
);
return
tabStoreInfoMapper
.
countBySelective
(
store
);
}
@Override
public
Page
<
StoreDTO
>
listStore
(
StoreSearchDBDTO
storeDTO
,
Integer
pageNum
,
Integer
pageSize
)
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
return
tabStoreInfoMapper
.
listStore
(
storeDTO
);
...
...
@@ -228,25 +238,25 @@ public class StoreServiceImpl implements StoreService {
if
(
"all"
.
equals
(
storeIds
))
{
return
this
.
tabStoreInfoMapper
.
updateAllStoreConactsPhone
(
enterpriseId
,
value
);
}
String
[]
storeIdArr
=
storeIds
.
split
(
","
);
String
[]
storeI
nfoI
dArr
=
storeIds
.
split
(
","
);
List
<
Integer
>
list
=
new
ArrayList
<>();
for
(
String
s
:
storeIdArr
)
{
for
(
String
s
:
storeI
nfoI
dArr
)
{
list
.
add
(
Integer
.
valueOf
(
s
));
}
return
this
.
tabStoreInfoMapper
.
updateStoreConactsPhoneBystoreInfoIds
(
value
,
list
);
}
@Override
public
int
bulkUpdateStoreBusinessTime
(
String
storeIds
,
Integer
enterpriseId
,
String
value
)
{
public
int
bulkUpdateStoreBusinessTime
(
String
storeI
nfoI
ds
,
Integer
enterpriseId
,
String
value
)
{
try
{
JSONArray
array
=
JSON
.
parseArray
(
value
);
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"HH:mm"
);
List
<
Integer
>
list
=
new
ArrayList
<>();
if
(
"all"
.
equals
(
storeIds
))
{
if
(
"all"
.
equals
(
storeI
nfoI
ds
))
{
this
.
tabStoreBusinessTimeMapper
.
deleteAllByEnterpriseId
(
enterpriseId
);
}
else
{
String
[]
storeI
dArr
=
store
Ids
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
String
[]
storeI
nfoIdArr
=
storeInfo
Ids
.
split
(
","
);
for
(
String
s
:
storeI
nfoI
dArr
)
{
list
.
add
(
Integer
.
valueOf
(
s
));
}
this
.
tabStoreBusinessTimeMapper
.
deleteBystoreInfoIds
(
enterpriseId
,
list
);
...
...
@@ -258,7 +268,7 @@ public class StoreServiceImpl implements StoreService {
String
closeTimeStr
=
json
.
getString
(
"closeTime"
);
Date
openTime
=
simpleDateFormat
.
parse
(
openTimeStr
);
Date
closeTime
=
simpleDateFormat
.
parse
(
closeTimeStr
);
if
(
"all"
.
equals
(
storeIds
))
{
if
(
"all"
.
equals
(
storeI
nfoI
ds
))
{
this
.
tabStoreBusinessTimeMapper
.
updateAllBuinessTime
(
weekday
,
openTime
,
closeTime
,
enterpriseId
);
}
else
{
this
.
tabStoreBusinessTimeMapper
.
updateBuinessTimeBystoreInfoIds
(
weekday
,
openTime
,
closeTime
,
list
);
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/ClerkApiServiceImpl.java
View file @
301c3a64
...
...
@@ -445,6 +445,20 @@ public class ClerkApiServiceImpl implements ClerkApiService {
}
@Override
public
ServiceResponse
<
ClerkDTO
>
getHeadClerk
(
Integer
enterpriseId
,
Integer
storeId
)
{
ServiceResponse
<
StoreDTO
>
response
=
storeApiService
.
getStoreById
(
enterpriseId
,
storeId
);
if
(
response
.
isSuccess
()
&&
response
.
getResult
()
!=
null
)
{
List
<
Integer
>
storeInfoIds
=
new
ArrayList
<>();
storeInfoIds
.
add
(
response
.
getResult
().
getStoreInfoId
());
List
<
TabClerk
>
clerkList
=
clerkService
.
listClerkByStoreInfoId
(
enterpriseId
,
storeInfoIds
,
null
,
1
);
if
(
CollectionUtils
.
isNotEmpty
(
clerkList
))
{
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityNew
(
ClerkDTO
.
class
,
clerkList
.
get
(
0
)));
}
}
return
ServiceResponse
.
success
();
}
@Override
public
ServiceResponse
<
ClerkDTO
>
getClerkById
(
Integer
enterpriseId
,
Integer
clerkId
)
{
TabClerk
tabClerk
=
this
.
clerkService
.
getById
(
clerkId
);
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityByJSON
(
ClerkDTO
.
class
,
tabClerk
));
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
301c3a64
...
...
@@ -234,6 +234,30 @@ public class StoreApiServiceImpl implements StoreApiService {
RedisUtil
.
delCache
(
key
);
}
@Override
public
ServiceResponse
<
Void
>
tranOverFlow
(
Integer
enterpriseId
,
String
storeIds
)
{
ServiceResponse
<
List
<
EnterpriseLicenseDTO
>>
listEnterpriseLicense
=
this
.
enterpriseApiService
.
listEnterpriseLicense
(
enterpriseId
);
if
(
listEnterpriseLicense
.
isSuccess
()
&&
CollectionUtils
.
isNotEmpty
(
listEnterpriseLicense
.
getResult
()))
{
if
(
listEnterpriseLicense
.
getResult
().
size
()
==
4
)
{
Integer
currCount
=
this
.
storeService
.
countByOverflowStatus
(
enterpriseId
,
1
);
Integer
upperLimit
=
listEnterpriseLicense
.
getResult
().
get
(
3
).
getUpperLimit
();
if
(
currCount
+
storeIds
.
split
(
","
).
length
>
upperLimit
)
{
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
UNKNOWN_ERROR
.
getCode
(),
String
.
format
(
"本商户剩余门店数量为%s家, 请重新勾选正确的数量!"
,
upperLimit
));
}
String
[]
storeIdArr
=
storeIds
.
split
(
","
);
for
(
String
storeIdStr
:
storeIdArr
)
{
Integer
storeId
=
Integer
.
valueOf
(
storeIdStr
);
StoreDTO
store
=
this
.
getStoreById
(
enterpriseId
,
storeId
).
getResult
();
if
(
store
!=
null
)
{
store
.
setOverflowStatus
(
1
);
saveOrUpdate
(
store
);
}
}
}
}
return
EnterpriseServiceResponse
.
failure
(
ErrorCode
.
UNKNOWN_ERROR
.
getCode
(),
"商户没有门店license"
);
}
/**
* 修改日志
*/
...
...
@@ -505,6 +529,30 @@ public class StoreApiServiceImpl implements StoreApiService {
}
@Override
public
ServiceResponse
<
Map
<
Integer
,
List
<
String
>>>
listStorePhotoByStoreInfoIds
(
Integer
enterpriseId
,
List
<
Integer
>
storeInfoIdList
)
{
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setStoreInfoIds
(
Joiner
.
on
(
" "
).
join
(
storeInfoIdList
));
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
());
// 给一个门店图片默认值测试
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
list
=
Arrays
.
asList
(
Constants
.
DEFAULT_PHOTO
);
}
resultMap
.
put
(
storeDTO
.
getStoreInfoId
(),
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
();
...
...
gic-store-service/src/main/java/com/gic/store/strategy/impl/StoreBusinessTimeStrategyImpl.java
View file @
301c3a64
...
...
@@ -23,17 +23,17 @@ public class StoreBusinessTimeStrategyImpl implements BulkUpdateStoreStrtegy {
private
StoreLogService
storeLogService
;
@Override
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreBusinessTime
(
storeIds
,
enterpriseId
,
value
);
public
int
bulkUpdateStore
(
String
storeI
nfoI
ds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreBusinessTime
(
storeI
nfoI
ds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeIdList
;
if
(
"all"
.
equals
(
storeIds
))
{
storeIdList
=
storeService
.
listAllStoreId
(
enterpriseId
);
List
<
Integer
>
storeI
nfoI
dList
;
if
(
"all"
.
equals
(
storeI
nfoI
ds
))
{
storeI
nfoI
dList
=
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeIdList
=
new
ArrayList
<>();
String
[]
storeI
dArr
=
store
Ids
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
storeIdList
.
add
(
Integer
.
valueOf
(
s
));
storeI
nfoI
dList
=
new
ArrayList
<>();
String
[]
storeI
nfoIdArr
=
storeInfo
Ids
.
split
(
","
);
for
(
String
s
:
storeI
nfoI
dArr
)
{
storeI
nfoI
dList
.
add
(
Integer
.
valueOf
(
s
));
}
}
// [{"weekday":"1,2","openTime":"09:42","closeTime":"09:42"}]
...
...
@@ -59,7 +59,7 @@ public class StoreBusinessTimeStrategyImpl implements BulkUpdateStoreStrtegy {
}
btSb
.
deleteCharAt
(
btSb
.
length
()
-
1
);
btSb
.
append
(
"】"
);
storeLogService
.
saveBulkStoreInfoLog
(
storeIdList
,
enterpriseId
,
operatorId
,
operatorName
,
btSb
.
toString
());
storeLogService
.
saveBulkStoreInfoLog
(
storeI
nfoI
dList
,
enterpriseId
,
operatorId
,
operatorName
,
btSb
.
toString
());
}
return
i
;
}
...
...
gic-store-service/src/main/java/com/gic/store/strategy/impl/StorePhoneStategyImpl.java
View file @
301c3a64
...
...
@@ -16,15 +16,15 @@ public class StorePhoneStategyImpl implements BulkUpdateStoreStrtegy {
private
StoreLogService
storeLogService
;
@Override
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreConactsPhone
(
storeIds
,
enterpriseId
,
value
);
public
int
bulkUpdateStore
(
String
storeI
nfoI
ds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreConactsPhone
(
storeI
nfoI
ds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeIdList
;
if
(
"all"
.
equals
(
storeIds
))
{
if
(
"all"
.
equals
(
storeI
nfoI
ds
))
{
storeIdList
=
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeIdList
=
new
ArrayList
<>();
String
[]
storeIdArr
=
storeIds
.
split
(
","
);
String
[]
storeIdArr
=
storeI
nfoI
ds
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
storeIdList
.
add
(
Integer
.
valueOf
(
s
));
}
...
...
gic-store-service/src/main/java/com/gic/store/strategy/impl/StoreStatusStrategyImpl.java
View file @
301c3a64
...
...
@@ -17,20 +17,20 @@ public class StoreStatusStrategyImpl implements BulkUpdateStoreStrtegy {
private
StoreLogService
storeLogService
;
@Override
public
int
bulkUpdateStore
(
String
storeIds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreStatus
(
storeIds
,
enterpriseId
,
value
);
public
int
bulkUpdateStore
(
String
storeI
nfoI
ds
,
Integer
enterpriseId
,
String
value
,
StoreService
storeService
,
Integer
operatorId
,
String
operatorName
)
{
int
i
=
storeService
.
bulkUpdateStoreStatus
(
storeI
nfoI
ds
,
enterpriseId
,
value
);
if
(
i
>
0
)
{
List
<
Integer
>
storeIdList
;
if
(
"all"
.
equals
(
storeIds
))
{
storeIdList
=
storeService
.
listAllStoreId
(
enterpriseId
);
List
<
Integer
>
storeI
nfoI
dList
;
if
(
"all"
.
equals
(
storeI
nfoI
ds
))
{
storeI
nfoI
dList
=
storeService
.
listAllStoreId
(
enterpriseId
);
}
else
{
storeIdList
=
new
ArrayList
<>();
String
[]
storeIdArr
=
storeIds
.
split
(
","
);
storeI
nfoI
dList
=
new
ArrayList
<>();
String
[]
storeIdArr
=
storeI
nfoI
ds
.
split
(
","
);
for
(
String
s
:
storeIdArr
)
{
storeIdList
.
add
(
Integer
.
valueOf
(
s
));
storeI
nfoI
dList
.
add
(
Integer
.
valueOf
(
s
));
}
}
storeLogService
.
saveBulkStoreInfoLog
(
storeIdList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店状态变更为【"
+
StoreStatusEnum
.
parseCode
(
Integer
.
parseInt
(
value
))
+
"】"
);
storeLogService
.
saveBulkStoreInfoLog
(
storeI
nfoI
dList
,
enterpriseId
,
operatorId
,
operatorName
,
"门店状态变更为【"
+
StoreStatusEnum
.
parseCode
(
Integer
.
parseInt
(
value
))
+
"】"
);
}
return
i
;
}
...
...
gic-store-service/src/main/resources/mapper/TabStoreBrandMapper.xml
View file @
301c3a64
...
...
@@ -227,6 +227,7 @@
<include
refid=
"Base_Column_List"
/>
from tab_store_brand
where status = 1
and enterprise_id = #{enterpriseId}
and store_brand_id
<>
#{storeBrandId}
order by sort
limit #{start}, #{size}
...
...
gic-store-service/src/main/resources/mapper/TabStoreBusinessTimeMapper.xml
View file @
301c3a64
...
...
@@ -151,9 +151,9 @@
<insert
id=
"updateBuinessTimeBystoreInfoIds"
>
insert into tab_store_business_time(
weekday,open_time,close_time,store_info_id,create_time,update_time,enterprise_id
weekday,open_time,close_time,store_info_id,create_time,update_time,enterprise_id
, status
)
select #{weekday},#{openTime},#{closeTime},store_info_id,now(),now(),enterprise_id from tab_store_info where overflow_status=0
select #{weekday},#{openTime},#{closeTime},store_info_id,now(),now(),enterprise_id
, 1
from tab_store_info where overflow_status=0
and store_info_id in
<foreach
collection=
"storeInfoIdList"
index=
"index"
item=
"storeInfoId"
open=
"("
separator=
","
close=
")"
>
#{storeInfoId}
...
...
gic-store-service/src/main/resources/mapper/TabStoreInfoMapper.xml
View file @
301c3a64
...
...
@@ -320,6 +320,9 @@
<if
test=
"storeDTO.storeCode != null and storeDTO.storeCode != '' "
>
and t1.store_code = #{storeDTO.storeCode}
</if>
<if
test=
"storeDTO.overflowStatus != null "
>
and t1.overflow_status = #{storeDTO.overflowStatus}
</if>
<if
test=
"storeDTO.storeName != null and storeDTO.storeName != '' "
>
and t1.store_name = #{storeDTO.storeName}
</if>
...
...
gic-store-web/src/main/java/com/gic/store/web/controller/StoreController.java
View file @
301c3a64
...
...
@@ -11,9 +11,11 @@ import com.gic.download.qo.QrcodeContent;
import
com.gic.download.utils.*
;
import
com.gic.download.utils.log.LogUtils
;
import
com.gic.enterprise.context.RequestContext
;
import
com.gic.enterprise.dto.EnterpriseLicenseDTO
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.response.EnterpriseRestResponse
;
import
com.gic.enterprise.service.DownloadReportApiService
;
import
com.gic.enterprise.service.EnterpriseApiService
;
import
com.gic.enterprise.service.QrCodeApiService
;
import
com.gic.enterprise.utils.ResultControllerUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
...
...
@@ -89,6 +91,8 @@ public class StoreController extends DownloadUtils {
private
StoreWidgetApiService
storeWidgetApiService
;
@Autowired
private
StoreUpdateApiService
storeUpdateApiService
;
@Autowired
private
EnterpriseApiService
enterpriseApiService
;
private
Map
<
Integer
,
SimpleDateFormat
>
map
=
new
ConcurrentHashMap
<>();
private
Map
<
Integer
,
SimpleDateFormat
>
map1
=
new
ConcurrentHashMap
<>();
...
...
@@ -272,6 +276,23 @@ public class StoreController extends DownloadUtils {
return
EnterpriseRestResponse
.
failure
(
response
);
}
@RequestMapping
(
"store-license-limit"
)
public
RestResponse
storeLicenseLimit
()
{
ServiceResponse
<
List
<
EnterpriseLicenseDTO
>>
listEnterpriseLicense
=
this
.
enterpriseApiService
.
listEnterpriseLicense
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
if
(
listEnterpriseLicense
.
isSuccess
()
&&
CollectionUtils
.
isNotEmpty
(
listEnterpriseLicense
.
getResult
()))
{
if
(
listEnterpriseLicense
.
getResult
().
size
()
==
4
)
{
return
RestResponse
.
success
(
listEnterpriseLicense
.
getResult
().
get
(
3
).
getUpperLimit
());
}
}
return
RestResponse
.
success
();
}
@RequestMapping
(
"/tran-overflow"
)
public
RestResponse
tranOverFlow
(
String
storeIds
)
{
ServiceResponse
<
Void
>
serviceResponse
=
this
.
storeApiService
.
tranOverFlow
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
storeIds
);
return
ResultControllerUtils
.
commonResult
(
serviceResponse
);
}
// @RequestMapping("list-store-log")
// public RestResponse listStoreLog(Integer storeId, PageQO pageQO) {
// Page page = new Page(pageQO.getCurrentPage(), pageQO.getPageSize());
...
...
@@ -306,9 +327,13 @@ public class StoreController extends DownloadUtils {
if
(
type
==
1
&&
toStoreId
!=
null
)
{
// 如果是批量修改状态 要转移门店
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
storeSearchDTO
.
setStoreIds
(
storeIds
.
replace
(
','
,
' '
));
List
<
String
>
list
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
1000
,
"storeInfoId"
).
getResult
().
getResult
()
.
stream
().
map
(
e
->
e
.
getStoreInfoId
().
toString
()).
collect
(
Collectors
.
toList
());
Page
<
StoreDTO
>
page
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
1000
,
"storeInfoId"
).
getResult
();
if
(
page
==
null
||
page
.
getResult
()
==
null
)
{
return
EnterpriseRestResponse
.
failure
(
ErrorCode
.
NOTEXISTS
);
}
List
<
String
>
list
=
page
.
getResult
().
stream
().
map
(
e
->
e
.
getStoreInfoId
().
toString
()).
collect
(
Collectors
.
toList
());
Integer
storeInfoId
=
storeApiService
.
getStoreById
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
toStoreId
).
getResult
().
getStoreInfoId
();
StoreBatchUpdateDTO
storeBatchUpdateDTO
=
new
StoreBatchUpdateDTO
();
storeBatchUpdateDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
...
...
@@ -371,11 +396,12 @@ public class StoreController extends DownloadUtils {
String
path
=
RequestContext
.
getContext
().
getRequest
().
getSession
().
getServletContext
().
getRealPath
(
"/excel/csv/collaborator/file/"
);
List
<
String
>
nameList
=
new
ArrayList
<>();
List
<
StoreListSourceVO
>
listSource
=
this
.
getStoreAllListSource
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
for
(
StoreListSourceVO
vo
:
listSource
){
if
(
storeExportQO
.
getFieldCodeList
().
contains
(
vo
.
getValue
())){
nameList
.
add
(
vo
.
getKey
());
}
Map
<
String
,
String
>
map
=
listSource
.
stream
().
collect
(
Collectors
.
toMap
(
e
->
e
.
getValue
(),
e
->
e
.
getKey
()));
for
(
String
fieldCode:
storeExportQO
.
getFieldCodeList
())
{
nameList
.
add
(
map
.
get
(
fieldCode
));
}
List
<
String
>
fieldCodeList
=
storeExportQO
.
getFieldCodeList
();
ExecutorPoolSingleton
.
getInstance
().
executeTask
(
new
Runnable
()
{
@Override
public
void
run
()
{
...
...
@@ -385,11 +411,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
);
}
...
...
@@ -487,6 +551,7 @@ public class StoreController extends DownloadUtils {
public
RestResponse
transferStoreMember
(
String
storeId
,
Integer
toStoreId
){
// 把参数改成storeInfoId
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
List
<
StoreDTO
>
storeInfoList
;
if
(
StringUtils
.
equals
(
storeId
,
"all"
))
{
storeInfoList
=
this
.
storeApiService
.
listStore
(
storeSearchDTO
,
1
,
10000
,
"storeInfoId"
).
getResult
().
getResult
();
...
...
gic-store-web/src/main/resources/dubbo-gic-store-web.xml
View file @
301c3a64
...
...
@@ -59,5 +59,7 @@
<dubbo:reference
interface=
"com.gic.member.api.service.StoreUpdateApiService"
id=
"storeUpdateApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.enterprise.service.AuditLogApiService"
id=
"auditLogApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.enterprise.service.EnterpriseApiService"
id=
"enterpriseApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.store.service.DictApiService"
id=
"dictApiService"
timeout=
"6000"
/>
</beans>
\ No newline at end of file
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