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
1
Merge Requests
1
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
3d58fec0
Commit
3d58fec0
authored
Jul 07, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店查询
parent
c0b64154
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
170 additions
and
3 deletions
+170
-3
HmLinkApiServiceImpl.java
...age/service/service/out/impl/hm/HmLinkApiServiceImpl.java
+1
-1
HmLinkController.java
...gic/haoban/manage/web/controller/hm/HmLinkController.java
+29
-2
HmStoreController.java
...ic/haoban/manage/web/controller/hm/HmStoreController.java
+140
-0
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmLinkApiServiceImpl.java
View file @
3d58fec0
...
...
@@ -232,8 +232,8 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
}
}
if
(
null
!=
hm
)
{
String
key
=
this
.
keyDataService
.
saveHmData
(
enterpriseId
,
unionid
,
linkId
,
hm
.
getHmId
());
}
String
key
=
this
.
keyDataService
.
saveHmData
(
enterpriseId
,
unionid
,
linkId
,
100L
);
// 生成动态活码
log
.
info
(
JSON
.
toJSONString
(
retDTO
,
true
));
return
ServiceResponse
.
success
(
retDTO
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmLinkController.java
View file @
3d58fec0
...
...
@@ -34,7 +34,7 @@ import com.gic.haoban.manage.web.controller.WebBaseController;
*/
@RestController
@RequestMapping
(
"/hm/link"
)
public
class
HmLinkController
extends
WebBaseController
{
public
class
HmLinkController
{
@Autowired
private
HmLinkApiService
hmLinkApiService
;
...
...
@@ -52,19 +52,46 @@ public class HmLinkController extends WebBaseController {
dto
.
setModifierName
(
loginUser
.
getClerkName
());
dto
.
setWxEnterpriseId
(
loginUser
.
getWxEnterpriseId
());
dto
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
this
.
hmLinkApiService
.
save
(
dto
);
ServiceResponse
<
HmLinkDTO
>
resp
=
this
.
hmLinkApiService
.
save
(
dto
);
if
(
resp
.
isSuccess
())
{
String
logContent
=
"新增引流链接【"
+
resp
.
getResult
().
getLinkCode
()
+
"-"
+
dto
.
getName
()
+
"】"
;
}
return
RestResponse
.
successResult
();
}
@RequestMapping
(
"update"
)
public
RestResponse
update
(
@RequestBody
HmLinkDTO
dto
)
{
Long
linkId
=
dto
.
getLinkId
();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
ServiceResponse
<
HmLinkDTO
>
resp
=
this
.
hmLinkApiService
.
getByLinkId
(
loginUser
.
getWxEnterpriseId
(),
loginUser
.
getEnterpriseId
(),
linkId
);
HmLinkDTO
oldDTO
=
resp
.
getResult
();
dto
.
setModifierId
(
loginUser
.
getClerkId
());
dto
.
setModifierName
(
loginUser
.
getClerkName
());
this
.
hmLinkApiService
.
save
(
dto
);
String
logContent
=
this
.
getLog
(
oldDTO
,
dto
);
return
RestResponse
.
successResult
();
}
// 编辑引流活码【链接ID-链接名称】:链接名称「 链接名称」变更「 链接名称」,链接描述「 链接描述」变更「 链接描述」,链接标签「
// 标签名称-标签值名称」变更为「 标签名称-标签值名称」,分配规则「 层级x-子项名称」关闭,「 层级x-子项名称」开启,欢迎语「
// 欢迎语名称」变更为「 欢迎语名称」,欢迎语变更为「 不发送欢迎语」,欢迎语变更为「 活码欢迎语-欢迎语名称」
private
String
getLog
(
HmLinkDTO
oldDTO
,
HmLinkDTO
newDTO
)
{
StringBuilder
sb
=
new
StringBuilder
(
"编辑引流活码"
).
append
(
"【"
).
append
(
oldDTO
.
getLinkCode
()).
append
(
"-"
)
.
append
(
oldDTO
.
getName
()).
append
(
"】"
);
comp
(
"链接名称"
,
oldDTO
.
getName
(),
newDTO
.
getName
(),
sb
);
comp
(
"链接描述"
,
oldDTO
.
getRemark
(),
newDTO
.
getRemark
(),
sb
);
return
null
;
}
public
void
comp
(
String
title
,
String
oldValue
,
String
newValue
,
StringBuilder
sb
)
{
if
(!
oldValue
.
equals
(
newValue
))
{
sb
.
append
(
title
).
append
(
"「"
).
append
(
oldValue
).
append
(
"」变更「"
).
append
(
newValue
).
append
(
"」"
);
}
}
@RequestMapping
(
"page"
)
public
RestResponse
page
(
HmLinkSearchQDTO
qdto
,
BasePageInfo
basePageInfo
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmStoreController.java
0 → 100644
View file @
3d58fec0
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
hm
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
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.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.Page
;
import
com.gic.clerk.api.dto.ClerkStoreListDTO
;
import
com.gic.clerk.api.dto.PowerClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.PowerService
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.enterprise.api.dto.EnterpriseSettingDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StoreWidgetDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.StoreWidgetService
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
@RestController
public
class
HmStoreController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
HmStoreController
.
class
);
@Autowired
private
StoreWidgetService
storeWidgetService
;
@Autowired
private
EnterpriseService
enterpriseService
;
@Autowired
private
PowerService
powerService
;
@Autowired
private
ClerkService
clerkService
;
@RequestMapping
(
"store-clerk-list"
)
@ResponseBody
public
RestResponse
listStoreClerk
(
HttpServletRequest
request
,
BasePageInfo
basePageInfo
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
// 分组id
String
storeGroupId
=
request
.
getParameter
(
"storeGroupId"
);
String
storeSearchParams
=
request
.
getParameter
(
"storeSearchParams"
);
String
clerkSearchParams
=
request
.
getParameter
(
"clerkSearchParams"
);
Map
<
String
,
Object
>
params
=
new
HashMap
<
String
,
Object
>();
params
.
put
(
"enterpriseId"
,
loginUser
.
getEnterpriseId
());
// 2线上
params
.
put
(
"status"
,
2
);
params
.
put
(
"storeGroupId"
,
storeGroupId
);
// 是否显示子分组(1显示,其余不显示)
params
.
put
(
"showChildren"
,
0
);
if
(
StringUtils
.
isNotBlank
(
storeSearchParams
))
{
params
.
put
(
"storeSearchParams"
,
"%"
+
storeSearchParams
+
"%"
);
}
if
(
StringUtils
.
isNotBlank
(
clerkSearchParams
))
{
params
.
put
(
"clerkSearchParams"
,
"%"
+
clerkSearchParams
+
"%"
);
}
if
(
StringUtils
.
isBlank
(
storeGroupId
))
{
return
RestResponse
.
failure
(
"-1"
,
"门店分组ID不能为空"
);
}
// 如果有权限控制,进行管辖门店过滤
params
.
put
(
"storeIdList"
,
this
.
getStoreIdListBYKey
());
// 只获取导购和店长
params
.
put
(
"clerkTypeList"
,
Arrays
.
asList
(
1
,
0
));
Page
<
ClerkStoreListDTO
>
page
=
new
Page
<>();
page
.
setPageSize
(
basePageInfo
.
getPageSize
());
page
.
setCurrentPage
(
basePageInfo
.
getPageNum
());
page
.
setParams
(
params
);
logger
.
info
(
"params:{}"
,
JSON
.
toJSONString
(
params
));
page
=
this
.
clerkService
.
listStoreClerkByPage
(
page
);
return
RestResponse
.
successResult
(
page
);
}
public
List
<
String
>
getStoreIdListBYKey
()
{
List
<
String
>
storeIdList
=
new
ArrayList
<>();
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
String
enterpriseId
=
loginUser
.
getEnterpriseId
();
// 管辖门店key
String
storeWidgetId
=
this
.
getStoreWidgetId
(
loginUser
.
getClerkId
());
EnterpriseSettingDTO
enterpriseSettingDTO
=
this
.
enterpriseService
.
getEnterpriseSettingByEnterpriseId
(
enterpriseId
);
Integer
enableAccessControl
=
enterpriseSettingDTO
.
getEnableAccessControl
();
// 是否开启权限控制
boolean
isEnableAccessControl
=
enableAccessControl
!=
null
&&
enableAccessControl
.
intValue
()
==
1
;
if
(
isEnableAccessControl
)
{
// 用户是超级管理员或管辖门店为所有门店则不受管辖门店约束
boolean
isAdmin
=
loginUser
.
getSuperAdmin
()
!=
null
&&
loginUser
.
getSuperAdmin
().
intValue
()
==
1
;
// 是否是所有门店类型
boolean
isAllStore
=
false
;
if
(
StringUtils
.
isNotBlank
(
storeWidgetId
))
{
StoreWidgetDTO
storeWidgetDTO
=
this
.
storeWidgetService
.
getStoreWidgetBykey
(
storeWidgetId
);
isAllStore
=
storeWidgetDTO
!=
null
&&
storeWidgetDTO
.
getSelectType
().
intValue
()
==
0
;
}
// 不受管辖门店约束,查询所有
if
(
isAdmin
||
isAllStore
)
{
return
storeIdList
;
}
// 门店控件会控制过滤管辖门店,只要key有值,直接查询数据
if
(
StringUtils
.
isNotBlank
(
storeWidgetId
))
{
Page
pageParam
=
new
Page
();
pageParam
.
setCurrentPage
(
1
);
pageParam
.
setPageSize
(
Integer
.
MAX_VALUE
);
Page
page
=
this
.
storeWidgetService
.
getStoreWidgetStore
(
storeWidgetId
,
null
,
enterpriseId
,
pageParam
);
if
(
page
!=
null
)
{
List
<
StoreDTO
>
storeList
=
page
.
getResult
();
if
(
CollectionUtils
.
isNotEmpty
(
storeList
))
{
for
(
StoreDTO
storeDTO
:
storeList
)
{
storeIdList
.
add
(
storeDTO
.
getStoreId
());
}
}
else
{
storeIdList
.
add
(
"-1"
);
}
}
}
}
return
storeIdList
;
}
private
String
getStoreWidgetId
(
String
userId
)
{
PowerClerkDTO
clerkDetail
=
this
.
powerService
.
getClerkDetail
(
userId
);
return
clerkDetail
.
getStoreWidgetId
();
}
}
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