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
cddbba99
Commit
cddbba99
authored
Apr 23, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
好友关系
parent
162995f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
5 deletions
+55
-5
WxEnterpriseRelatedApiService.java
...ban/manage/api/service/WxEnterpriseRelatedApiService.java
+7
-0
WxEnterpriseRelatedApiServiceImpl.java
...e/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
+37
-0
TestController.java
.../com/gic/haoban/manage/web/controller/TestController.java
+11
-5
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/WxEnterpriseRelatedApiService.java
View file @
cddbba99
...
...
@@ -98,4 +98,11 @@ public interface WxEnterpriseRelatedApiService {
*/
public
List
<
String
>
listStoreIdByEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
);
/**
* 初始化历史门店数据
*
* @return
*/
public
boolean
initHistoryEnterprise
(
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
View file @
cddbba99
...
...
@@ -216,6 +216,8 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
//保存企业关联关系
tab
=
EntityUtil
.
changeEntityNew
(
TabHaobanWxEnterpriseRelated
.
class
,
detailDTO
);
tab
.
setStatusFlag
(
1
);
tab
.
setRangeType
(
1
);
tab
.
setVersion
(
"3.0"
);
tab
.
setCreateTime
(
new
Date
());
tab
.
setUpdateTime
(
new
Date
());
tab
.
setWxEnterpriseRelatedId
(
UuidUtil
.
randomUUID
());
...
...
@@ -469,4 +471,39 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
List
<
String
>
list
=
storeRangeService
.
listStoreIdByWxEnterpriseId
(
wxEnterpriseId
,
enterpriseId
);
return
list
;
}
@Override
public
boolean
initHistoryEnterprise
(
String
wxEnterpriseId
)
{
List
<
TabHaobanWxEnterpriseRelated
>
needDealEnts
=
new
ArrayList
<>();
if
(
StringUtils
.
isBlank
(
wxEnterpriseId
))
{
List
<
TabHaobanWxEnterpriseRelated
>
allEnts
=
wxEnterpriseRelatedMapper
.
queryAllHasGicEnterpriseId
();
needDealEnts
=
allEnts
.
stream
().
filter
(
dto
->
dto
.
getRangeType
()
==
null
||
dto
.
getRangeType
()
==
0
).
collect
(
Collectors
.
toList
());
}
else
{
List
<
TabHaobanWxEnterpriseRelated
>
relatedList
=
wxEnterpriseRelatedMapper
.
listByWxenterpriseId
(
wxEnterpriseId
);
needDealEnts
=
relatedList
.
stream
().
filter
(
dto
->
dto
.
getRangeType
()
==
null
||
dto
.
getRangeType
()
==
0
).
collect
(
Collectors
.
toList
());
}
if
(
CollectionUtils
.
isEmpty
(
needDealEnts
))
{
logger
.
info
(
"没有需要处理的企业"
);
return
true
;
}
for
(
TabHaobanWxEnterpriseRelated
needDealEnt
:
needDealEnts
)
{
try
{
List
<
StoreGroupDTO
>
rootStoreGroupId
=
storeGroupService
.
getRootStoreGroupId
(
needDealEnt
.
getEnterpriseId
());
WxEnterpriseRelationDetailDTO
detailDTO
=
new
WxEnterpriseRelationDetailDTO
();
detailDTO
.
setMemberOpenCardFlag
(
0
);
detailDTO
.
setWxEnterpriseType
(
0
);
detailDTO
.
setEnterpriseId
(
needDealEnt
.
getEnterpriseId
());
detailDTO
.
setWxEnterpriseId
(
needDealEnt
.
getWxEnterpriseId
());
StoreOrGroupInfoDTO
groupInfoDTO
=
new
StoreOrGroupInfoDTO
();
groupInfoDTO
.
setRelationType
(
1
);
groupInfoDTO
.
setRelationId
(
rootStoreGroupId
.
get
(
0
).
getStoreGroupId
());
detailDTO
.
setRelations
(
new
ArrayList
<>());
detailDTO
.
getRelations
().
add
(
groupInfoDTO
);
this
.
wxEnterpriseBind
(
detailDTO
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
false
;
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/TestController.java
View file @
cddbba99
...
...
@@ -6,10 +6,7 @@ import com.gic.haoban.common.utils.EntityUtil;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.MaidianLogDTO
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.MaidianLogApiService
;
import
com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService
;
import
com.gic.haoban.manage.api.service.TestApiService
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.QywxXcxSendMessageQo
;
import
com.gic.redis.data.util.GicRateLimiter
;
...
...
@@ -62,6 +59,9 @@ public class TestController extends WebBaseController {
@Autowired
private
MaidianLogApiService
maidianLogApiService
;
@Autowired
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@RequestMapping
(
"/send-message-test"
)
public
HaobanResponse
testSendMessage
(
QywxXcxSendMessageQo
qo
)
{
QywxXcxSendMessageDTO
messageDTO
=
EntityUtil
.
changeEntityByOrika
(
QywxXcxSendMessageDTO
.
class
,
qo
);
...
...
@@ -156,7 +156,7 @@ public class TestController extends WebBaseController {
}
@RequestMapping
(
"/test-limiter"
)
public
HaobanResponse
testLimiter
(
String
key
,
String
eid
)
{
public
HaobanResponse
testLimiter
(
String
key
,
String
eid
)
{
if
(
StringUtils
.
isAnyBlank
(
key
,
eid
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_5
);
}
...
...
@@ -167,4 +167,10 @@ public class TestController extends WebBaseController {
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
@RequestMapping
(
"/init-history"
)
public
HaobanResponse
initHistory
(
String
wxEnterpriseId
)
{
wxEnterpriseRelatedApiService
.
initHistoryEnterprise
(
wxEnterpriseId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
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