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
1ec97747
Commit
1ec97747
authored
Sep 29, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
e941e673
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
154 additions
and
170 deletions
+154
-170
HmPageServiceTest.java
haoban-manage3-service/src/test/java/HmPageServiceTest.java
+154
-170
No files found.
haoban-manage3-service/src/test/java/HmPageServiceTest.java
View file @
1ec97747
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.dto.EnterpriseDetailDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmGroupDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmGroupDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmGroupQueryDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmGroupQueryDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmPageDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmPageDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmPageRelationDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmPageRelationDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmWelcomeRelationDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmWelcomeRelationDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmPageRelationQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmPageRelationQDTO
;
import
com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeRelationQDTO
;
import
com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeRelationQDTO
;
import
com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType
;
import
com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType
;
import
com.gic.haoban.manage.api.service.QwFriendApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.service.hm.HmGroupApiService
;
import
com.gic.haoban.manage.api.service.hm.HmGroupApiService
;
import
com.gic.haoban.manage.api.service.hm.HmPageApiService
;
import
com.gic.haoban.manage.api.service.hm.HmPageApiService
;
import
com.gic.haoban.manage.api.service.hm.HmQrcodeApiService
;
import
com.gic.haoban.manage.api.service.hm.HmQrcodeApiService
;
import
com.gic.haoban.manage.api.service.hm.HmWelcomeRelationApiService
;
import
com.gic.haoban.manage.api.service.hm.HmWelcomeRelationApiService
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO
;
import
com.gic.haoban.manage.service.pojo.bo.hm.HmWelcomeRelationBO
;
import
com.gic.haoban.manage.service.service.ExternalClerkRelatedService
;
import
com.gic.haoban.manage.service.service.ExternalClerkRelatedService
;
import
com.gic.haoban.manage.service.service.hm.WelcomeRelationService
;
import
com.gic.haoban.manage.service.service.hm.WelcomeRelationService
;
import
com.gic.redis.data.util.RedisUtil
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@ContextConfiguration
(
locations
=
{
"classpath:applicationContext-conf.xml"
})
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
public
class
HmPageServiceTest
{
@ContextConfiguration
(
locations
=
{
"classpath:applicationContext-conf.xml"
})
public
class
HmPageServiceTest
{
@Autowired
private
HmPageApiService
pageService
;
@Autowired
private
HmPageApiService
pageService
;
@Autowired
private
WxEnterpriseRelatedApiService
enterpriseRelatedApiService
;
@Autowired
private
WxEnterpriseRelatedApiService
enterpriseRelatedApiService
;
@Autowired
private
HmGroupApiService
groupService
;
@Autowired
private
HmGroupApiService
groupService
;
@Autowired
private
HmWelcomeRelationApiService
welcomeRelationApiService
;
@Autowired
@Autowired
private
HmWelcomeRelationApiService
welcomeRelationApiService
;
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
private
ExternalClerkRelatedService
externalClerkRelatedService
;
@Autowired
private
ExternalClerkRelatedService
externalClerkRelatedService
;
@Test
@Autowired
public
void
test
(){
private
QwFriendApiService
qwFriendApiService
;
this
.
externalClerkRelatedService
.
repairExternalUserId
(
"218a8a6c2ca14e28a1053f541be0e49d,ca66a01b79474c40b3e7c7f93daf1a3b"
);
// this.wxEnterpriseApiService.stopHaoban("ff80808182c3a46b0182c3a4ea7d0000");
/* HmPageQDTO pageQDTO = new HmPageQDTO();
@Test
pageQDTO.setPageSearchText("MB01419872763172380673");
public
void
test
(){
ServiceResponse<Page<HmPageDTO>> pageServiceResponse = pageService.queryPageList(pageQDTO);*/
}
System
.
out
.
println
(
this
.
qwFriendApiService
.
getPendingIdByUnionid
(
"ff8080815dacd3a2015dacd3ef5c0000"
,
"orXl9t9gIRbvfIoDPfrPf7jHYHmU"
,
"o0Yvd006OXKv71RIu8SbXA5mT7Zk"
));
@Test
this
.
externalClerkRelatedService
.
repairExternalUserId
(
"218a8a6c2ca14e28a1053f541be0e49d,ca66a01b79474c40b3e7c7f93daf1a3b"
);
public
void
entriprise
(){
// this.wxEnterpriseApiService.stopHaoban("ff80808182c3a46b0182c3a4ea7d0000");
ServiceResponse
<
EnterpriseDetailDTO
>
enterpriseDetailDTOServiceResponse
=
enterpriseRelatedApiService
.
queryEnterpriseDetail
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
,
"ff8080815dacd3a2015dacd3ef5c0000"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
enterpriseDetailDTOServiceResponse
));
/* HmPageQDTO pageQDTO = new HmPageQDTO();
}
pageQDTO.setPageSearchText("MB01419872763172380673");
ServiceResponse<Page<HmPageDTO>> pageServiceResponse = pageService.queryPageList(pageQDTO);*/
@Test
}
public
void
queryPageList
(){
HmPageRelationQDTO
pageRelationQDTO
=
new
HmPageRelationQDTO
();
@Test
pageRelationQDTO
.
setPageId
(
418460224953786370L
);
public
void
setcache
(){
pageRelationQDTO
.
setEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
);
System
.
out
.
println
(
RedisUtil
.
getCache
(
"bgrjswxEnterpriseId"
));
ServiceResponse
<
Page
<
HmPageRelationDTO
>>
pageServiceResponse
=
pageService
.
queryPageRelation
(
pageRelationQDTO
);
RedisUtil
.
setCache
(
"bgrjswxEnterpriseId"
,
"936299d1b1274fed988f3f7bb7652126,267c13c9a6f049bfacfc05b9419462a1"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
pageServiceResponse
));
System
.
out
.
println
(
RedisUtil
.
getCache
(
"bgrjswxEnterpriseId"
));
}
}
@Test
@Test
public
void
deletePage
(){
public
void
entriprise
(){
HmPageDTO
pageDTO
=
new
HmPageDTO
();
ServiceResponse
<
EnterpriseDetailDTO
>
enterpriseDetailDTOServiceResponse
=
enterpriseRelatedApiService
.
queryEnterpriseDetail
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
,
"ff8080815dacd3a2015dacd3ef5c0000"
);
pageDTO
.
setPageId
(
418460224953786370L
);
System
.
out
.
println
(
JSON
.
toJSONString
(
enterpriseDetailDTOServiceResponse
));
ServiceResponse
<
Boolean
>
booleanServiceResponse
=
pageService
.
deleteHmPage
(
pageDTO
);
}
System
.
out
.
println
(
JSON
.
toJSONString
(
booleanServiceResponse
));
}
@Test
public
void
queryPageList
(){
@Test
HmPageRelationQDTO
pageRelationQDTO
=
new
HmPageRelationQDTO
();
public
void
groupList
(){
pageRelationQDTO
.
setPageId
(
418460224953786370L
);
HmGroupQueryDTO
groupQueryDTO
=
new
HmGroupQueryDTO
();
pageRelationQDTO
.
setEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
);
//groupQueryDTO.setGroupName("默认");
ServiceResponse
<
Page
<
HmPageRelationDTO
>>
pageServiceResponse
=
pageService
.
queryPageRelation
(
pageRelationQDTO
);
groupQueryDTO
.
setEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
pageServiceResponse
));
groupQueryDTO
.
setClerkId
(
"b7279937120a433b9d96ae3c9abedb04"
);
}
ServiceResponse
<
Page
<
HmGroupDTO
>>
pageServiceResponse
=
groupService
.
queryHmGroupSettingList
(
groupQueryDTO
);
System
.
out
.
println
(
JSON
.
toJSONString
(
pageServiceResponse
));
@Test
}
public
void
deletePage
(){
HmPageDTO
pageDTO
=
new
HmPageDTO
();
pageDTO
.
setPageId
(
418460224953786370L
);
@Autowired
ServiceResponse
<
Boolean
>
booleanServiceResponse
=
pageService
.
deleteHmPage
(
pageDTO
);
private
WelcomeRelationService
welcomeRelationService
;
System
.
out
.
println
(
JSON
.
toJSONString
(
booleanServiceResponse
));
}
@Test
public
void
saveWelcomeRelation
(){
@Test
HmWelcomeRelationBO
welcomeRelationBo
=
new
HmWelcomeRelationBO
();
public
void
groupList
(){
welcomeRelationBo
.
setEnterpriseId
(
"1231321312312"
);
HmGroupQueryDTO
groupQueryDTO
=
new
HmGroupQueryDTO
();
welcomeRelationBo
.
setWxEnterpriseId
(
"31312312312"
);
//groupQueryDTO.setGroupName("默认");
welcomeRelationBo
.
setReferId
(
"313131"
);
groupQueryDTO
.
setEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
);
welcomeRelationBo
.
setReferCode
(
"HM1312312312"
);
groupQueryDTO
.
setClerkId
(
"b7279937120a433b9d96ae3c9abedb04"
);
welcomeRelationBo
.
setReferName
(
"活码名称"
);
ServiceResponse
<
Page
<
HmGroupDTO
>>
pageServiceResponse
=
groupService
.
queryHmGroupSettingList
(
groupQueryDTO
);
welcomeRelationBo
.
setType
(
HmWelcomeReferType
.
HM
.
getCode
());
System
.
out
.
println
(
JSON
.
toJSONString
(
pageServiceResponse
));
welcomeRelationService
.
saveHmWelcomeRelation
(
welcomeRelationBo
);
}
}
@Autowired
@Test
private
WelcomeRelationService
welcomeRelationService
;
public
void
updateWelcomeRelationTest
(){
HmWelcomeRelationBO
welcomeRelationBo
=
new
HmWelcomeRelationBO
();
@Test
welcomeRelationBo
.
setEnterpriseId
(
"1231321312312"
);
public
void
saveWelcomeRelation
(){
welcomeRelationBo
.
setWxEnterpriseId
(
"31312312312"
);
HmWelcomeRelationBO
welcomeRelationBo
=
new
HmWelcomeRelationBO
();
welcomeRelationBo
.
setReferId
(
"313131"
);
welcomeRelationBo
.
setEnterpriseId
(
"1231321312312"
);
welcomeRelationBo
.
setReferCode
(
"HM1312312dada"
);
welcomeRelationBo
.
setWxEnterpriseId
(
"31312312312"
);
welcomeRelationBo
.
setReferName
(
"活码名称"
);
welcomeRelationBo
.
setReferId
(
"313131"
);
welcomeRelationBo
.
setType
(
HmWelcomeReferType
.
HM
.
getCode
());
welcomeRelationBo
.
setReferCode
(
"HM1312312312"
);
welcomeRelationService
.
updateWelcomeRelation
(
welcomeRelationBo
);
welcomeRelationBo
.
setReferName
(
"活码名称"
);
}
welcomeRelationBo
.
setType
(
HmWelcomeReferType
.
HM
.
getCode
());
welcomeRelationService
.
saveHmWelcomeRelation
(
welcomeRelationBo
);
}
@Autowired
private
HmQrcodeApiService
qrcodeApiService
;
@Test
public
void
updateWelcomeRelationTest
(){
@Test
HmWelcomeRelationBO
welcomeRelationBo
=
new
HmWelcomeRelationBO
();
public
void
batchUpdateQrcode
(){
welcomeRelationBo
.
setEnterpriseId
(
"1231321312312"
);
List
<
Long
>
ids
=
Arrays
.
asList
(
418494104339988481L
,
418494104339988482L
);
welcomeRelationBo
.
setWxEnterpriseId
(
"31312312312"
);
long
grouoId
=
420219621589671937L
;
welcomeRelationBo
.
setReferId
(
"313131"
);
ServiceResponse
<
Boolean
>
booleanServiceResponse
=
qrcodeApiService
.
batchUpdateHmQrcodeGroup
(
ids
,
grouoId
);
welcomeRelationBo
.
setReferCode
(
"HM1312312dada"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
booleanServiceResponse
));
welcomeRelationBo
.
setReferName
(
"活码名称"
);
}
welcomeRelationBo
.
setType
(
HmWelcomeReferType
.
HM
.
getCode
());
welcomeRelationService
.
updateWelcomeRelation
(
welcomeRelationBo
);
@Test
}
public
void
welcomeTest
(){
QueryWelcomeRelationQDTO
qdto
=
new
QueryWelcomeRelationQDTO
();
qdto
.
setWelcomeId
(
"7f12bdab4fb543e8977f96e30fc8eddb"
);
@Autowired
//qdto.setSearchContent("测试");
private
HmQrcodeApiService
qrcodeApiService
;
ServiceResponse
<
Page
<
HmWelcomeRelationDTO
>>
serviceResponse
=
welcomeRelationApiService
.
queryWelcomeRelation
(
qdto
);
System
.
out
.
println
(
JSON
.
toJSONString
(
serviceResponse
));
}
@Test
public
void
batchUpdateQrcode
(){
@Test
List
<
Long
>
ids
=
Arrays
.
asList
(
418494104339988481L
,
418494104339988482L
);
public
void
groupNameCheckTest
(){
long
grouoId
=
420219621589671937L
;
ServiceResponse
<
List
<
HmGroupDTO
>>
ms
=
groupService
.
queryGroupListByName
(
""
,
"ff8080815dacd3a2015dacd3ef5c0000"
,
"测试006"
);
ServiceResponse
<
Boolean
>
booleanServiceResponse
=
qrcodeApiService
.
batchUpdateHmQrcodeGroup
(
ids
,
grouoId
);
System
.
out
.
println
(
JSON
.
toJSONString
(
ms
));
System
.
out
.
println
(
JSON
.
toJSONString
(
booleanServiceResponse
));
}
}
}
@Test
public
void
welcomeTest
(){
QueryWelcomeRelationQDTO
qdto
=
new
QueryWelcomeRelationQDTO
();
qdto
.
setWelcomeId
(
"7f12bdab4fb543e8977f96e30fc8eddb"
);
//qdto.setSearchContent("测试");
ServiceResponse
<
Page
<
HmWelcomeRelationDTO
>>
serviceResponse
=
welcomeRelationApiService
.
queryWelcomeRelation
(
qdto
);
System
.
out
.
println
(
JSON
.
toJSONString
(
serviceResponse
));
}
@Test
public
void
groupNameCheckTest
(){
ServiceResponse
<
List
<
HmGroupDTO
>>
ms
=
groupService
.
queryGroupListByName
(
""
,
"ff8080815dacd3a2015dacd3ef5c0000"
,
"测试006"
);
System
.
out
.
println
(
JSON
.
toJSONString
(
ms
));
}
}
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