Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
7810d426
Commit
7810d426
authored
May 30, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:门店查询修改
parent
9257d464
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
115 additions
and
69 deletions
+115
-69
TabHaobanStoreRelationMapper.java
...nage/service/dao/mapper/TabHaobanStoreRelationMapper.java
+17
-0
StoreRangeService.java
.../gic/haoban/manage/service/service/StoreRangeService.java
+13
-0
StoreRangeServiceImpl.java
...an/manage/service/service/impl/StoreRangeServiceImpl.java
+6
-1
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+3
-7
TabHaobanStoreRelationMapper.xml
...rc/main/resources/mapper/TabHaobanStoreRelationMapper.xml
+49
-43
StoreController.java
...com/gic/haoban/manage/web/controller/StoreController.java
+27
-18
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStoreRelationMapper.java
View file @
7810d426
...
...
@@ -88,4 +88,20 @@ public interface TabHaobanStoreRelationMapper {
* @return
*/
public
int
updateStoreName
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"storeId"
)
String
storeId
,
@Param
(
"storeName"
)
String
storeName
);
/**
* 门店查询列表
*
* @param storeId 存储id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return {@link List }<{@link String }>
* @author mozhu
* @date 2022-05-30 16:00:47
*/
List
<
String
>
listStoreIdByStoreIdWxEnterpriseId
(
@Param
(
"storeId"
)
String
storeId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StoreRangeService.java
View file @
7810d426
...
...
@@ -105,4 +105,17 @@ public interface StoreRangeService {
*/
public
void
updatwStoreName
(
String
enterpriseId
,
String
storeId
,
String
storeName
);
/**
* 该门店是否存在
*
* @param storeId 存储id
* @param wxEnterpriseId wx企业标识
* @param enterpriseId 企业标识
* @return boolean
* @author mozhu
* @date 2022-05-30 15:58:50
*/
boolean
isFlagByStoreId
(
String
storeId
,
String
wxEnterpriseId
,
String
enterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StoreRangeServiceImpl.java
View file @
7810d426
...
...
@@ -7,7 +7,6 @@ import com.gic.haoban.base.api.common.BasePageInfo;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StoreOrGroupInfoDTO
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStoreRangeMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStoreRelationMapper
;
import
com.gic.haoban.manage.service.entity.TabStoreRange
;
...
...
@@ -267,4 +266,10 @@ public class StoreRangeServiceImpl implements StoreRangeService {
public
void
updatwStoreName
(
String
enterpriseId
,
String
storeId
,
String
storeName
)
{
tabHaobanStoreRelationMapper
.
updateStoreName
(
enterpriseId
,
storeId
,
storeName
);
}
@Override
public
boolean
isFlagByStoreId
(
String
storeId
,
String
wxEnterpriseId
,
String
enterpriseId
)
{
List
<
String
>
storeIds
=
tabHaobanStoreRelationMapper
.
listStoreIdByStoreIdWxEnterpriseId
(
storeId
,
wxEnterpriseId
,
enterpriseId
);
return
CollectionUtils
.
isNotEmpty
(
storeIds
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
7810d426
...
...
@@ -1346,11 +1346,7 @@ public class StaffApiServiceImpl implements StaffApiService {
@Override
public
boolean
isFlagByStoreIdAndEnterpriseId
(
String
storeId
,
String
enterpriseId
,
String
wxEnterpriseId
)
{
List
<
String
>
enterpriseIdStoreIds
=
storeRangeService
.
listStoreIdByWxEnterpriseId
(
wxEnterpriseId
,
enterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseIdStoreIds
))
{
return
false
;
}
return
enterpriseIdStoreIds
.
contains
(
storeId
);
return
storeRangeService
.
isFlagByStoreId
(
storeId
,
wxEnterpriseId
,
enterpriseId
);
}
@Override
...
...
@@ -1384,7 +1380,7 @@ public class StaffApiServiceImpl implements StaffApiService {
}
Integer
superAdmin
=
clerkDTO
.
getSuperAdmin
();
if
(
superAdmin
!=
null
&&
superAdmin
==
1
)
{
logger
.
info
(
"gic超管,clerkId:{}"
,
clerkId
);
logger
.
info
(
"gic超管,clerkId:{}"
,
clerkId
);
//gic超管
return
Collections
.
singletonList
(
"-1"
);
}
...
...
@@ -1405,7 +1401,7 @@ public class StaffApiServiceImpl implements StaffApiService {
Integer
selectType
=
storeWidgetDTO
.
getSelectType
();
if
(
selectType
!=
null
&&
selectType
==
0
)
{
//gic超管
logger
.
info
(
"gic超管,clerkId:{}"
,
clerkId
);
logger
.
info
(
"gic超管,clerkId:{}"
,
clerkId
);
return
Collections
.
singletonList
(
"-1"
);
}
return
getStoreWidgetIdStoreIds
(
storeWidgetId
,
enterpriseId
);
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanStoreRelationMapper.xml
View file @
7810d426
...
...
@@ -13,9 +13,9 @@
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
store_relation_id, wx_enterprise_id, store_id, store_group_id, enterprise_id, status_flag, store_name,
store_relation_id, wx_enterprise_id, store_id, store_group_id, enterprise_id, status_flag, store_name,
create_time, update_time
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
...
...
@@ -23,19 +23,18 @@
where store_relation_id = #{storeRelationId,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from tab_haoban_store_relation
where store_relation_id = #{storeRelationId,jdbcType=VARCHAR}
</delete>
delete
from tab_haoban_store_relation
where store_relation_id = #{storeRelationId,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabStoreRelation"
>
insert into tab_haoban_store_relation (store_relation_id, wx_enterprise_id,
store_id, store_group_id, enterprise_id,
status_flag, create_time, update_time
)
values (#{storeRelationId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR},
#{storeId,jdbcType=VARCHAR}, #{storeGroupId,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=VARCHAR},
#{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
insert into tab_haoban_store_relation (store_relation_id, wx_enterprise_id,
store_id, store_group_id, enterprise_id,
status_flag, create_time, update_time)
values (#{storeRelationId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR},
#{storeId,jdbcType=VARCHAR}, #{storeGroupId,jdbcType=VARCHAR}, #{enterpriseId,jdbcType=VARCHAR},
#{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabStoreRelation"
>
insert into tab_haoban_store_relation
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -134,26 +133,25 @@
where store_relation_id = #{storeRelationId,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.gic.haoban.manage.service.entity.TabStoreRelation"
>
update tab_haoban_store_relation
set wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
store_id
= #{storeId,jdbcType=VARCHAR},
store_group_id
= #{storeGroupId,jdbcType=VARCHAR},
enterprise_id
= #{enterpriseId,jdbcType=VARCHAR},
status_flag
= #{statusFlag,jdbcType=INTEGER},
create_time
= #{createTime,jdbcType=TIMESTAMP},
update_time
= #{updateTime,jdbcType=TIMESTAMP}
where store_relation_id = #{storeRelationId,jdbcType=VARCHAR}
</update>
update tab_haoban_store_relation
set wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
store_id
= #{storeId,jdbcType=VARCHAR},
store_group_id
= #{storeGroupId,jdbcType=VARCHAR},
enterprise_id
= #{enterpriseId,jdbcType=VARCHAR},
status_flag
= #{statusFlag,jdbcType=INTEGER},
create_time
= #{createTime,jdbcType=TIMESTAMP},
update_time
= #{updateTime,jdbcType=TIMESTAMP}
where store_relation_id = #{storeRelationId,jdbcType=VARCHAR}
</update>
<update
id=
"deleteStoreRalation"
>
update tab_haoban_store_relation
set
status_flag = 0,
update_time = now()
where store_id = #{storeId,jdbcType=VARCHAR}
and enterprise_id=#{enterpriseId}
and status_flag=1
</update>
update tab_haoban_store_relation
set status_flag = 0,
update_time = now()
where store_id = #{storeId,jdbcType=VARCHAR}
and enterprise_id = #{enterpriseId}
and status_flag = 1
</update>
<select
id=
"searchStoreRange"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -189,11 +187,10 @@
<update
id=
"deleteAllStoreRalation"
>
update tab_haoban_store_relation
set
status_flag = 0,
update_time = now()
where enterprise_id=#{enterpriseId}
and status_flag=1
set status_flag = 0,
update_time = now()
where enterprise_id = #{enterpriseId}
and status_flag = 1
</update>
<update
id=
"deleteStoreRalationByStoreIds"
>
...
...
@@ -211,11 +208,19 @@
<update
id=
"updateStoreName"
>
update tab_haoban_store_relation
set
store_name = #{storeName},
update_time = now()
where enterprise_id=#{enterpriseId}
and store_id=#{storeId}
and status_flag=1
set store_name = #{storeName},
update_time = now()
where enterprise_id = #{enterpriseId}
and store_id = #{storeId}
and status_flag = 1
</update>
<select
id=
"listStoreIdByStoreIdWxEnterpriseId"
resultType=
"String"
>
select store_id
from tab_haoban_store_relation
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and store_id = #{storeId}
and status_flag = 1
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
View file @
7810d426
...
...
@@ -6,10 +6,14 @@ import com.gic.enterprise.api.dto.StoreSearchDTO;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.PageResult
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -19,37 +23,42 @@ import java.util.List;
@RestController
@RequestMapping
(
"/store"
)
public
class
StoreController
extends
WebBaseController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
StoreController
.
class
);
@Autowired
private
StoreService
storeService
;
@Autowired
private
StaffApiService
staffApiService
;
//门店列表
@RequestMapping
(
"/find-simple-page"
)
public
HaobanResponse
storeList
(
Integer
storeType
,
String
enterpriseId
,
BasePageInfo
basePageInfo
)
{
boolean
superAdmin
=
staffApiService
.
isSuperAdmin
(
AuthWebRequestUtil
.
getLoginUser
().
getClerkId
());
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
clerkId
=
loginUser
.
getClerkId
();
Page
page
=
new
Page
<>();
page
.
setCurrentPage
(
basePageInfo
.
getPageNum
());
page
.
setPageSize
(
basePageInfo
.
getPageSize
());
int
pageNum
=
basePageInfo
.
getPageNum
();
int
pageSize
=
basePageInfo
.
getPageSize
();
page
.
setCurrentPage
(
pageNum
);
page
.
setPageSize
(
pageSize
);
StoreSearchDTO
storeSearchDTO
=
new
StoreSearchDTO
();
storeSearchDTO
.
setEnterpriseId
(
enterpriseId
);
storeSearchDTO
.
setStatus
(
"2"
);
if
(!
superAdmin
)
{
storeSearchDTO
.
setUserId
(
AuthWebRequestUtil
.
getLoginUser
().
getClerkId
());
}
storeSearchDTO
.
setStoreType
(
storeType
);
Page
<
StoreDTO
>
resultPage
=
storeService
.
storeListPage
(
page
,
storeSearchDTO
);
List
<
St
oreDTO
>
storeDTOList
=
resultPage
.
getResult
(
);
List
<
St
ring
>
storeRolesByClerkId
=
staffApiService
.
getHaoBanStoreRolesByClerkId
(
clerkId
,
loginUser
.
getWxEnterpriseId
()
);
PageResult
<
StoreDTO
>
pageVo
=
new
PageResult
<>();
pageVo
.
setList
(
storeDTOList
);
pageVo
.
setPageNum
(
page
.
getCurrentPage
());
pageVo
.
setPages
(
resultPage
.
getPages
());
pageVo
.
setPageSize
(
page
.
getPageSize
());
pageVo
.
setTotal
(
page
.
getTotalCount
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
pageVo
);
pageVo
.
setPageNum
(
pageNum
);
pageVo
.
setPageSize
(
pageSize
);
if
(
CollectionUtils
.
isEmpty
(
storeRolesByClerkId
))
{
logger
.
info
(
"导购无门店权限"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
pageVo
);
}
storeSearchDTO
.
setStoreIdList
(
storeRolesByClerkId
);
Page
<
StoreDTO
>
pageResult
=
storeService
.
storeListPage
(
page
,
storeSearchDTO
);
pageVo
.
setList
(
pageResult
.
getResult
());
pageVo
.
setTotal
(
pageResult
.
getTotalCount
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
pageVo
);
}
}
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