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
496a0a77
Commit
496a0a77
authored
May 18, 2020
by
zhiwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量转移
parent
45ef1d63
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
0 deletions
+71
-0
StoreApiService.java
.../src/main/java/com/gic/store/service/StoreApiService.java
+11
-0
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
+10
-0
StoreApiServiceImpl.java
...com/gic/store/service/outer/impl/StoreApiServiceImpl.java
+24
-0
TabStoreInfoMapper.xml
...-service/src/main/resources/mapper/TabStoreInfoMapper.xml
+3
-0
StoreController.java
...in/java/com/gic/store/web/controller/StoreController.java
+21
-0
No files found.
gic-store-api/src/main/java/com/gic/store/service/StoreApiService.java
View file @
496a0a77
...
...
@@ -339,4 +339,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/service/StoreService.java
View file @
496a0a77
...
...
@@ -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 @
496a0a77
...
...
@@ -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
);
...
...
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreApiServiceImpl.java
View file @
496a0a77
...
...
@@ -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"
);
}
/**
* 修改日志
*/
...
...
gic-store-service/src/main/resources/mapper/TabStoreInfoMapper.xml
View file @
496a0a77
...
...
@@ -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 @
496a0a77
...
...
@@ -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());
...
...
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