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
QianQiXiang
haoban-manage3.0
Commits
f8dbe76d
Commit
f8dbe76d
authored
Apr 20, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
绑定的时候 新增小程序配置
parent
4e8f4663
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
153 additions
and
23 deletions
+153
-23
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+58
-23
EnterpriseDetailVO.java
...java/com/gic/haoban/manage/web/vo/EnterpriseDetailVO.java
+93
-0
dubbo-haoban-manage-web.xml
...3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
+2
-0
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
f8dbe76d
...
...
@@ -5,10 +5,9 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.enterprise.api.dto.
EnterpriseAndUserDTO
;
import
com.gic.enterprise.api.dto.
*
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StoreSearchDTO
;
import
com.gic.enterprise.api.service.AuthorizeService
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
...
...
@@ -16,6 +15,7 @@ import com.gic.haoban.base.api.common.ServiceResponse;
import
com.gic.haoban.common.utils.EntityUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.service.*
;
...
...
@@ -25,6 +25,7 @@ import com.gic.haoban.manage.web.config.Config;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.MiniprogramSettingQo
;
import
com.gic.haoban.manage.web.qo.WxEnterpriseBindQo
;
import
com.gic.haoban.manage.web.vo.EnterpriseDetailVO
;
import
com.gic.haoban.manage.web.vo.EnterpriseSearchVO
;
import
com.gic.haoban.manage.web.vo.SecretSettingVO
;
import
com.gic.haoban.manage.web.vo.StoreVo
;
...
...
@@ -76,31 +77,65 @@ public class WxEnterpriseController extends WebBaseController{
@Autowired
private
MaterialApiService
materialApiService
;
@Autowired
private
AuthorizeService
authorizeService
;
//授权企业列表
@IgnoreLogin
@RequestMapping
(
"wx-enterprise-list"
)
public
HaobanResponse
wxEnterpriseList
()
{
public
HaobanResponse
wxEnterpriseList
()
{
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
List
<
EnterpriseDetailVO
>
detailVOS
=
EntityUtil
.
changeEntityListByOrika
(
EnterpriseDetailVO
.
class
,
list
);
if
(
CollectionUtil
.
isNotEmpty
(
detailVOS
))
{
List
<
String
>
enterpriseIds
=
detailVOS
.
stream
().
map
(
s
->
s
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
EnterpriseDTO
>
enterpriseList
=
enterpriseService
.
listEnterpriseByIds
(
enterpriseIds
);
Map
<
String
,
EnterpriseDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
enterpriseList
,
"enterpriseId"
);
for
(
EnterpriseDetailVO
dto
:
detailVOS
)
{
List
<
EnterpriseWxaRelationDTO
>
relationDTOS
=
authorizeService
.
queryList
(
dto
.
getEnterpriseId
());
EnterpriseDTO
enterpriseDTO
=
map
.
get
(
dto
.
getEnterpriseId
());
EnterpriseWxaRelationDTO
wxaRelationDTO
=
relationDTOS
.
stream
().
filter
(
mid
->
mid
.
getWxaAppkey
().
equals
(
enterpriseDTO
.
getMallMiniprogramAppid
())).
findFirst
().
orElse
(
null
);
if
(
wxaRelationDTO
!=
null
)
{
dto
.
setEnterpriseName
(
enterpriseDTO
.
getEnterpriseName
());
dto
.
setImageUrl
(
wxaRelationDTO
.
getAuthImg
());
dto
.
setAppId
(
wxaRelationDTO
.
getWxaAppkey
());
dto
.
setMiniprogramName
(
wxaRelationDTO
.
getAuthName
());
dto
.
setTitle
(
wxaRelationDTO
.
getAuthName
());
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
detailVOS
);
}
//授权企业列表
@IgnoreLogin
@RequestMapping
(
"wxa-enterprise-list"
)
public
HaobanResponse
wxaEnterpriseList
()
{
// String wxEnterpriseId = "ca66a01b79474c40b3e7c7f93daf1a3b";
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtil
.
isNotEmpty
(
list
)){
List
<
String
>
enterpriseIds
=
list
.
stream
().
map
(
s
->
s
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
EnterpriseDTO
>
enterpriseList
=
enterpriseService
.
listEnterpriseByIds
(
enterpriseIds
);
Map
<
String
,
EnterpriseDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
enterpriseList
,
"enterpriseId"
);
for
(
EnterpriseDetailDTO
dto:
list
){
EnterpriseDTO
enterpriseDTO
=
map
.
get
(
dto
.
getEnterpriseId
());
if
(
enterpriseDTO
!=
null
){
dto
.
setEnterpriseName
(
enterpriseDTO
.
getEnterpriseName
());
dto
.
setEnterpriseLogo
(
enterpriseDTO
.
getQcloudImageUrl
());
dto
.
setBrandName
(
enterpriseDTO
.
getBrandName
());
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
LoginDTO
login
=
(
LoginDTO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
List
<
EnterpriseDetailDTO
>
list
=
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollectionUtil
.
isNotEmpty
(
list
)){
List
<
String
>
enterpriseIds
=
list
.
stream
().
map
(
s
->
s
.
getEnterpriseId
()).
collect
(
Collectors
.
toList
());
List
<
EnterpriseDTO
>
enterpriseList
=
enterpriseService
.
listEnterpriseByIds
(
enterpriseIds
);
Map
<
String
,
EnterpriseDTO
>
map
=
com
.
gic
.
commons
.
util
.
CollectionUtil
.
toMap
(
enterpriseList
,
"enterpriseId"
);
for
(
EnterpriseDetailDTO
dto:
list
){
EnterpriseDTO
enterpriseDTO
=
map
.
get
(
dto
.
getEnterpriseId
());
if
(
enterpriseDTO
!=
null
){
dto
.
setEnterpriseName
(
enterpriseDTO
.
getEnterpriseName
());
dto
.
setEnterpriseLogo
(
enterpriseDTO
.
getQcloudImageUrl
());
dto
.
setBrandName
(
enterpriseDTO
.
getBrandName
());
}
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
list
);
}
//企业信息
@IgnoreLogin
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/EnterpriseDetailVO.java
0 → 100644
View file @
f8dbe76d
package
com
.
gic
.
haoban
.
manage
.
web
.
vo
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* Created by tgs on 2020/2/9.
*/
public
class
EnterpriseDetailVO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
enterpriseName
;
private
String
wxEnterpriseId
;
private
String
enterpriseId
;
private
Integer
wxEnterpriseType
;
private
Integer
memberOpenCardFlag
;
private
String
appId
;
private
String
imageUrl
;
private
String
title
;
private
String
miniprogramName
;
public
String
getEnterpriseName
()
{
return
enterpriseName
;
}
public
void
setEnterpriseName
(
String
enterpriseName
)
{
this
.
enterpriseName
=
enterpriseName
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
Integer
getWxEnterpriseType
()
{
return
wxEnterpriseType
;
}
public
void
setWxEnterpriseType
(
Integer
wxEnterpriseType
)
{
this
.
wxEnterpriseType
=
wxEnterpriseType
;
}
public
Integer
getMemberOpenCardFlag
()
{
return
memberOpenCardFlag
;
}
public
void
setMemberOpenCardFlag
(
Integer
memberOpenCardFlag
)
{
this
.
memberOpenCardFlag
=
memberOpenCardFlag
;
}
public
String
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
String
appId
)
{
this
.
appId
=
appId
;
}
public
String
getImageUrl
()
{
return
imageUrl
;
}
public
void
setImageUrl
(
String
imageUrl
)
{
this
.
imageUrl
=
imageUrl
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getMiniprogramName
()
{
return
miniprogramName
;
}
public
void
setMiniprogramName
(
String
miniprogramName
)
{
this
.
miniprogramName
=
miniprogramName
;
}
}
haoban-manage3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
View file @
f8dbe76d
...
...
@@ -71,5 +71,7 @@
<dubbo:reference
id=
"maidianDataService"
interface=
"com.gic.cloud.data.api.service.MaidianDataService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"maidianLogApiService"
interface=
"com.gic.haoban.manage.api.service.MaidianLogApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"authorizeService"
interface=
"com.gic.enterprise.api.service.AuthorizeService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
</beans>
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