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
76c0fc0c
Commit
76c0fc0c
authored
Jul 14, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://git.gicdev.com/haoban3.0/haoban-manage3.0.git
into developer
parents
ffd4fa91
5675fffb
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
108 additions
and
475 deletions
+108
-475
HmQrcodeListQDTO.java
...m/gic/haoban/manage/api/dto/qdto/hm/HmQrcodeListQDTO.java
+47
-67
WxUserAddLogSearchQDTO.java
...haoban/manage/api/dto/qdto/hm/WxUserAddLogSearchQDTO.java
+3
-1
HmQrcodeApiService.java
.../gic/haoban/manage/api/service/hm/HmQrcodeApiService.java
+0
-14
HmQrcodeServiceImpl.java
...n/manage/service/service/hm/impl/HmQrcodeServiceImpl.java
+5
-0
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+4
-10
HmLinkTest.java
haoban-manage3-service/src/test/java/HmLinkTest.java
+9
-15
ServiceTest.java
haoban-manage3-service/src/test/java/ServiceTest.java
+16
-363
HmQrcodeController.java
...c/haoban/manage/web/controller/hm/HmQrcodeController.java
+24
-5
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/qdto/hm/HmQrcodeListQDTO.java
View file @
76c0fc0c
...
...
@@ -21,38 +21,34 @@ public class HmQrcodeListQDTO extends BasePageInfo implements Serializable {
/**
* 1单人 2多人
*/
private
Integer
hmType
;
private
Integer
hmType
Int
;
private
String
wxEnterpriseId
;
private
String
enterpriseId
;
private
String
keyword
;
private
String
hmSelect
;
private
String
storeSe
arch
;
private
String
storeSe
lect
;
private
Date
createTimeStart
;
private
String
clerkSelect
;
private
Date
startTime
;
private
Date
createTimeEnd
;
private
Date
endTime
;
/**
* 0删除 1正常 2作废 3待生效
*/
private
Integer
statusFlag
;
private
String
storeId
;
private
String
clerkId
;
private
String
clerkName
;
private
String
clerkCode
;
private
Integer
statusFlagInt
;
private
String
orderByField
;
/**
* 活码分组
*/
private
Long
hmGroupId
;
private
List
<
String
>
storeId
List
;
private
List
<
String
>
storeId
;
public
Long
getHmId
()
{
return
hmId
;
...
...
@@ -62,12 +58,12 @@ public class HmQrcodeListQDTO extends BasePageInfo implements Serializable {
this
.
hmId
=
hmId
;
}
public
Integer
getHmType
()
{
return
hmType
;
public
Integer
getHmType
Int
()
{
return
hmType
Int
;
}
public
void
setHmType
(
Integer
hmType
)
{
this
.
hmType
=
hmType
;
public
void
setHmType
Int
(
Integer
hmTypeInt
)
{
this
.
hmType
Int
=
hmTypeInt
;
}
public
String
getWxEnterpriseId
()
{
...
...
@@ -86,76 +82,60 @@ public class HmQrcodeListQDTO extends BasePageInfo implements Serializable {
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getKeyword
()
{
return
keyword
;
}
public
void
setKeyword
(
String
keyword
)
{
this
.
keyword
=
keyword
;
}
public
Date
getCreateTimeStart
()
{
return
createTimeStart
;
public
String
getHmSelect
()
{
return
hmSelect
;
}
public
void
set
CreateTimeStart
(
Date
createTimeStar
t
)
{
this
.
createTimeStart
=
createTimeStar
t
;
public
void
set
HmSelect
(
String
hmSelec
t
)
{
this
.
hmSelect
=
hmSelec
t
;
}
public
Date
getCreateTimeEnd
()
{
return
createTimeEnd
;
public
String
getStoreSelect
()
{
return
storeSelect
;
}
public
void
set
CreateTimeEnd
(
Date
createTimeEnd
)
{
this
.
createTimeEnd
=
createTimeEnd
;
public
void
set
StoreSelect
(
String
storeSelect
)
{
this
.
storeSelect
=
storeSelect
;
}
public
Integer
getStatusFlag
()
{
return
statusFlag
;
public
String
getClerkSelect
()
{
return
clerkSelect
;
}
public
void
set
StatusFlag
(
Integer
statusFlag
)
{
this
.
statusFlag
=
statusFlag
;
public
void
set
ClerkSelect
(
String
clerkSelect
)
{
this
.
clerkSelect
=
clerkSelect
;
}
public
String
getStoreId
()
{
return
storeId
;
}
public
void
setStoreId
(
String
storeId
)
{
this
.
storeId
=
storeId
;
public
Date
getStartTime
()
{
return
startTime
;
}
public
String
getStoreSearch
(
)
{
return
storeSearch
;
public
void
setStartTime
(
Date
startTime
)
{
this
.
startTime
=
startTime
;
}
public
void
setStoreSearch
(
String
storeSearch
)
{
this
.
storeSearch
=
storeSearch
;
public
Date
getEndTime
(
)
{
return
endTime
;
}
public
String
getClerkId
(
)
{
return
clerkId
;
public
void
setEndTime
(
Date
endTime
)
{
this
.
endTime
=
endTime
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
public
Integer
getStatusFlagInt
(
)
{
return
statusFlagInt
;
}
public
String
getClerkName
(
)
{
return
clerkName
;
public
void
setStatusFlagInt
(
Integer
statusFlagInt
)
{
this
.
statusFlagInt
=
statusFlagInt
;
}
public
void
setClerkName
(
String
clerkName
)
{
this
.
clerkName
=
clerkName
;
public
String
getOrderByField
(
)
{
return
orderByField
;
}
public
String
getClerkCode
()
{
return
clerkCode
;
}
public
void
setClerkCode
(
String
clerkCode
)
{
this
.
clerkCode
=
clerkCode
;
public
void
setOrderByField
(
String
orderByField
)
{
this
.
orderByField
=
orderByField
;
}
public
Long
getHmGroupId
()
{
...
...
@@ -166,12 +146,12 @@ public class HmQrcodeListQDTO extends BasePageInfo implements Serializable {
this
.
hmGroupId
=
hmGroupId
;
}
public
List
<
String
>
getStoreId
List
()
{
return
storeId
List
;
public
List
<
String
>
getStoreId
()
{
return
storeId
;
}
public
void
setStoreId
List
(
List
<
String
>
storeIdList
)
{
this
.
storeId
List
=
storeIdList
;
public
void
setStoreId
(
List
<
String
>
storeId
)
{
this
.
storeId
=
storeId
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/qdto/hm/WxUserAddLogSearchQDTO.java
View file @
76c0fc0c
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
.
qdto
.
hm
;
import
com.gic.api.base.commons.BasePageInfo
;
import
java.io.Serializable
;
import
java.util.Date
;
public
class
WxUserAddLogSearchQDTO
implements
Serializable
{
public
class
WxUserAddLogSearchQDTO
extends
BasePageInfo
implements
Serializable
{
/**
* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/hm/HmQrcodeApiService.java
View file @
76c0fc0c
package
com
.
gic
.
haoban
.
manage
.
api
.
service
.
hm
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.haoban.base.api.common.PageResult2
;
import
com.gic.haoban.manage.api.dto.hm.HmClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmQrcodeListDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO
;
import
java.util.List
;
...
...
@@ -39,16 +35,6 @@ public interface HmQrcodeApiService {
int
update
(
HmQrcodeQDTO
hmQrcodeQDTO
);
/**
* 查询列表页面
*
* @param hmQrcodeListQDTO hm qrcode qdto列表
* @return {@link PageResult2 }<{@link HmQrcodeDTO }>
* @author mozhu
* @date 2022-07-05 10:59:01
*/
Page
<
HmQrcodeListDTO
>
queryListByPage
(
HmQrcodeListQDTO
hmQrcodeListQDTO
);
/**
* 查询详情
*
* @param hmId hb id
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/hm/impl/HmQrcodeServiceImpl.java
View file @
76c0fc0c
...
...
@@ -46,6 +46,10 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
public
int
insert
(
HmQrcodeQDTO
hmQrcodeQDTO
)
{
hmQrcodeQDTO
.
setCreateTime
(
new
Date
());
hmQrcodeQDTO
.
setUpdateTime
(
new
Date
());
hmQrcodeQDTO
.
setPassFlag
(
1
);
hmQrcodeQDTO
.
setOverFlag
(
0
);
hmQrcodeQDTO
.
setAddNum
(
0
);
hmQrcodeQDTO
.
setStatusFlag
(
1
);
return
this
.
tabHaobanHmQrcodeMapper
.
insert
(
EntityUtil
.
changeEntity
(
TabHaobanHmQrcode
.
class
,
hmQrcodeQDTO
));
}
...
...
@@ -116,6 +120,7 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
return
tabHaobanHmQrcodeMapper
.
getTotalByEnterpriseId
(
enterpriseId
);
}
@Override
public
int
batchUpdateQrcodeGroup
(
List
<
Long
>
hmIds
,
Long
groupId
){
return
tabHaobanHmQrcodeMapper
.
batchUpdateQrCodeGroup
(
hmIds
,
groupId
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
76c0fc0c
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
.
hm
;
import
com.
gic.api.base.commons.Page
;
import
com.
alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
...
...
@@ -9,15 +9,12 @@ import com.gic.commons.util.UniqueIdUtils;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.errCode.HaoBanErrCodeCommon
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmQrcodeListDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmClerkRelationQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO
;
import
com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType
;
import
com.gic.haoban.manage.api.service.hm.HmQrcodeApiService
;
...
...
@@ -114,7 +111,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
==
null
)
{
logger
.
error
(
"未查询到微信企业"
);
return
0
;
return
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()
;
}
hmQrcodeQDTO
.
setHmId
(
UniqueIdUtils
.
uniqueLong
());
...
...
@@ -137,6 +134,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
qywxExternalcontactDTO
.
setState
(
"HM"
+
hmId
);
List
<
String
>
userIds
=
staffClerkRelationService
.
listWxUserIdByClerkIds
(
clerkIdList
,
wxEnterpriseId
);
qywxExternalcontactDTO
.
setUser
(
userIds
);
logger
.
info
(
"新增活码参数:{}"
,
JSON
.
toJSONString
(
qywxExternalcontactDTO
));
QywxExternalcontactResultDTO
qywxExternalcontactResultDTO
=
qywxUserApiService
.
addContactWay
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
(),
qywxExternalcontactDTO
);
if
(
qywxExternalcontactResultDTO
!=
null
&&
"0"
.
equals
(
qywxExternalcontactResultDTO
.
getErrcode
()))
{
hmQrcodeQDTO
.
setWxQrcode
(
qywxExternalcontactResultDTO
.
getQr_code
());
...
...
@@ -357,6 +355,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
TabHaobanStaff
tabHaobanStaff
=
staffService
.
selectById
(
staffClerkRelationDTO
.
getStaffId
());
if
(
tabHaobanStaff
!=
null
)
{
hmQrcodeQDTO
.
setStaffName
(
tabHaobanStaff
.
getStaffName
());
hmQrcodeQDTO
.
setWxUserId
(
tabHaobanStaff
.
getWxUserId
());
}
}
}
...
...
@@ -404,11 +403,6 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
hmClerkRelationService
.
insertBatch
(
clerkRelationQDTOS
);
}
@Override
public
Page
<
HmQrcodeListDTO
>
queryListByPage
(
HmQrcodeListQDTO
hmQrcodeListQDTO
)
{
Page
<
HmQrcodeBO
>
hmQrcodeBOPage
=
hmQrcodeService
.
queryByPage
(
hmQrcodeListQDTO
);
return
PageUtil
.
changePageToCurrentPage
(
hmQrcodeBOPage
,
HmQrcodeListDTO
.
class
);
}
@Override
public
HmQrcodeDTO
queryById
(
Long
hmId
)
{
...
...
haoban-manage3-service/src/test/java/HmLinkTest.java
View file @
76c0fc0c
import
java.util.ArrayList
;
import
java.util.List
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.haoban.manage.api.dto.hm.HmLinkDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmLinkStoreDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmLinkSearchQDTO
;
import
com.gic.haoban.manage.api.enums.KeyDataEnum
;
import
com.gic.haoban.manage.api.service.KeyDataApiService
;
import
com.gic.haoban.manage.api.service.hm.HmLinkApiService
;
import
com.gic.haoban.manage.api.service.hm.HmLinkVisitLogApiService
;
import
com.gic.haoban.manage.service.service.hm.HmLinkStoreService
;
import
com.gic.haoban.manage.service.util.QwFriendLimitCountUtil
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.ArrayList
;
import
java.util.List
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@ContextConfiguration
(
locations
=
{
"classpath:applicationContext-conf.xml"
})
...
...
@@ -34,11 +32,7 @@ public class HmLinkTest {
@Autowired
private
HmLinkStoreService
hmLinkStoreService
;
@Test
public
void
getLinkHmFromWxa
(){
this
.
hmLinkApiService
.
getLinkHmFromWxa
(
"ff8080815dacd3a2015dacd3ef5c0000"
,
null
,
null
,
null
,
"417109414906961921"
,
"ubkCBFK"
,
null
)
;
}
@Test
public
void
saveLinkStore
()
{
HmLinkStoreDTO
dto
=
new
HmLinkStoreDTO
();
...
...
haoban-manage3-service/src/test/java/ServiceTest.java
View file @
76c0fc0c
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.FlushStoreMqDTO
;
import
com.gic.haoban.manage.api.dto.MaterialDTO
;
import
com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO
;
import
com.gic.haoban.manage.api.dto.notify.qdto.PendingTaskQDTO
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.enums.PendingTaskTypeEnum
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.service.notify.PendingTaskApiService
;
import
com.gic.haoban.manage.service.service.MemberUnionRelatedService
;
import
com.gic.haoban.task.api.enums.TaskTypeEnum
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService
;
import
com.gic.haoban.manage.api.service.hm.HmQrcodeApiService
;
import
com.gic.wechat.api.service.qywx.QywxDepartmentApiService
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
...
...
@@ -23,11 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.Collections
;
//import com.github.binarywang.java.emoji.EmojiConverter;
...
...
@@ -50,352 +34,21 @@ public class ServiceTest {
private
StaffApiService
staffApiService
;
@Autowired
private
TestApiService
test
ApiService
;
private
HmQrcodeApiService
hmQrcode
ApiService
;
@Autowired
private
DepartmentApiService
departmentApiService
;
@Autowired
private
MemberUnionRelatedService
memberUnionRelatedService
;
@Autowired
private
MaterialApiService
materialApiService
;
@Autowired
private
CheckQywxSettingApiService
checkQywxSettingApiService
;
@Autowired
private
HandoverOperationApiService
handoverOperationApiService
;
@Autowired
private
PendingTaskApiService
pendingTaskApiService
;
private
final
ExecutorService
pools
=
Executors
.
newFixedThreadPool
(
50
);
@Test
public
void
test11
()
{
List
<
PendingTaskQDTO
>
list
=
new
ArrayList
<>();
int
i
=
310
;
while
(
i
-->
0
)
{
PendingTaskQDTO
pendingTaskDTO
=
new
PendingTaskQDTO
();
pendingTaskDTO
.
setRelationId
(
"relatrionId"
+
i
);
pendingTaskDTO
.
setTaskType
(
1
==
TaskTypeEnum
.
TEL
.
getValue
()
?
PendingTaskTypeEnum
.
TEL_TASK
.
getType
()
:
PendingTaskTypeEnum
.
PERFORMANCE
.
getType
());
pendingTaskDTO
.
setTitle
(
"标题"
);
pendingTaskDTO
.
setDescription
(
"内容"
);
pendingTaskDTO
.
setStoreId
(
"storeId"
);
pendingTaskDTO
.
setClerkId
(
"clerkId"
);
pendingTaskDTO
.
setEnterpriseId
(
"eid"
);
pendingTaskDTO
.
setOverdueTime
(
new
Date
());
pendingTaskDTO
.
setInvalidTime
(
new
Date
());
list
.
add
(
pendingTaskDTO
);
}
pendingTaskApiService
.
addPendingTaskBatch
(
list
);
}
@Test
public
void
sendMessage
()
{
List
<
String
>
staffIds
=
new
ArrayList
<>();
staffIds
.
add
(
"0006ae5de6484cf9b55072d2d967c481"
);
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
clientInstance
.
sendMessage
(
"haoban3OrderBackForFaceMq"
,
"11111"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
// memberUnionRelatedService.cleanStaffRelated("ca66a01b79474c40b3e7c7f93daf1a3b", staffIds);
// int i=2000;
// while (i-->0) {
// departmentApiService.listAllDepartment(i+"");
// }
//
// try {
// Thread.sleep(1000000L);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
}
@Test
public
void
test
()
{
BasePageInfo
basePageInfo
=
new
BasePageInfo
();
Page
<
MaterialDTO
>
ret
=
materialApiService
.
listMaterial
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
,
null
,
"-1"
,
1
,
basePageInfo
);
System
.
out
.
println
(
ret
);
public
void
test
()
{
HmQrcodeQDTO
hmQrcodeQDTO
=
new
HmQrcodeQDTO
();
hmQrcodeQDTO
.
setHmType
(
1
);
hmQrcodeQDTO
.
setWxEnterpriseId
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
);
hmQrcodeQDTO
.
setEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
);
hmQrcodeQDTO
.
setName
(
"徐高华"
);
hmQrcodeQDTO
.
setPassFlag
(
1
);
hmQrcodeQDTO
.
setStoreId
(
"ff1307040a7748699cf3109615fb24d7"
);
hmQrcodeQDTO
.
setClerkIdList
(
Collections
.
singletonList
(
"ff1307040a7748699cf3109615fb24d7"
));
hmQrcodeApiService
.
add
(
hmQrcodeQDTO
);
}
//// @Test
//// public void test1() {
//// String res = qywxUserApiService.leaveClerkExternal("ww9ede832a84b7ae5f"
//// , "01YQ-pcdYzF3K0So8uCFfkB5i8D5EBW7KcVB4qA8Ktk", 0, 1000);
//// JSONArray jsonArray = JSONArray.parseArray(res);
//// jsonArray.forEach(o -> {
//// JSONObject mid = (JSONObject) o;
//// qywxUserApiService.leaveClerkReTransfer("ww9ede832a84b7ae5f"
//// , "01YQ-pcdYzF3K0So8uCFfkB5i8D5EBW7KcVB4qA8Ktk", mid.getString("handover_userid")
//// , mid.getString("handover_userid"), mid.getString("external_userid"));
//// });
//// System.out.println(res);
//// }
////
//// @Test
//// public void test2() {
//// UserDTO userDTO = new UserDTO();
//// userDTO.setUserid("niweizhong");
//// userDTO.setName("空闻大师");
//// userDTO.setDepartment(new Integer[]{4});
//// userDTO.setMobile("17605628855");
//// userDTO.setCorpid("ww9ede832a84b7ae5f");
//// JSONResponse workWxUser = qywxUserApiService.createWorkWxUser(userDTO, "ww9ede832a84b7ae5f", "ww7d6566614055cf27");
//// System.out.println(JSONObject.toJSONString(workWxUser));
//// }
////
//// @Test
//// public void list() {
////
//// List<DepartmentDTO> list = qywxDepartmentApiService.listSelfDepartment("ww9ede832a84b7ae5f"
//// , "3aOw7jbcHlHkDmOi5TuG42Ta8NqskOhZxy5urrmaGl8", 1);
//// Iterator<DepartmentDTO> iterator = list.iterator();
////// while (iterator.hasNext()) {
////// DepartmentDTO next = iterator.next();
////// if(!next.getParentid().equals("1")) {
////// iterator.remove();
////// }
////// }
//// System.out.println(JSONObject.toJSONString(list));
//// }
////
// @Test
// public void addDepart() {
// DepartmentDTO dto = new DepartmentDTO();
// dto.setName("测试order");
// dto.setOrder(2147484447L);
// dto.setParentid(1);
//
// JSONResponse department = qywxDepartmentApiService.createSelfDepartment("ww9ede832a84b7ae5f"
// , "3aOw7jbcHlHkDmOi5TuG42Ta8NqskOhZxy5urrmaGl8", dto);
//// List<DepartmentDTO> list = (List<DepartmentDTO>) department;
// System.out.println(JSONObject.toJSONString(department));
// }
////
//// @Test
//// public void getUser() {
//// DepartmentDTO dto = new DepartmentDTO();
////// dto.set
//// UserDTO phonenumber = qywxUserApiService.getWxUserByPhonenumber("ww9ede832a84b7ae5f"
//// , "ww7d6566614055cf27", "13735457631");
////// String phonenumber = phonenumber;
////// UserDTO phonenumber = (UserDTO) useridBymobile;
//// System.out.println(JSONObject.toJSONString(phonenumber));
//// }
////
//@Test
//public void createSelfUser() {
// UserDTO userDTO = new UserDTO();
// userDTO.setUserid("niweizhong2");
// userDTO.setName("空闻大师2");
// userDTO.setDepartment(new Integer[]{5072});
// userDTO.setMobile("17605628851");
// userDTO.setCorpid("ww9ede832a84b7ae5f");
// JSONResponse workWxUser = qywxUserApiService.createSelfWorkWxUser(userDTO, "n",
// "3aOw7jbcHlHkDmOi5TuG42Ta8NqskOhZxy5urrmaGl8");
// System.out.println(JSONObject.toJSONString(workWxUser));
//}
//
//
//@Test
//public void sendMessage() {
// QywxXcxSendMessageDTO messageDTO = new QywxXcxSendMessageDTO();
// messageDTO.setAppid("wx6054e7be35015afc");
// ArrayList<String> userIDs = new ArrayList<>();
// userIDs.add("9ae4c4f1277340a186b16a17d937c72c");
// messageDTO.setUserIds(userIDs);
// messageDTO.setTitle("我的测试test");
// messageDTO.setDescription("我的测试test11111");
// HashMap<String, String> map = new HashMap<>();
// map.put("名称", "hua");
//// messageDTO.setItems(map);
// boolean ret = qywxSuiteApiService.sendMessage("ww9ede832a84b7ae5f",
// "ww2c34dc56739bb105", messageDTO);
// System.out.println(JSONObject.toJSONString(ret));
//}
//
//
// @Test
// public void listExternalUserid() {
// UserDTO userDTO = new UserDTO();
// userDTO.setUserid("niweizhong2");
// userDTO.setName("空闻大师2");
// userDTO.setDepartment(new Integer[]{5072});
// userDTO.setMobile("17605628851");
// userDTO.setCorpid("ww9ede832a84b7ae5f");
// String s = qywxUserApiService.listExternalUserid("ww9ede832a84b7ae5f",
// "ww2c34dc56739bb105", "qiuwenmin");
// System.out.println(s);
// }
//
// @Test
// public void getQrcode() {
//
// UserDTO workWxUser = qywxUserApiService.getSelfWorkWxUser("ww9ede832a84b7ae5f", "3aOw7jbcHlHkDmOi5TuG42Ta8NqskOhZxy5urrmaGl8", "lining");
// ServiceResponse<String> qrcode = staffApiService.getStaffQrcode("167442", "ff8080817181d322017182737b16021f");
// System.out.println(JSONObject.toJSONString(qrcode));
// }
//
//
@Test
public
void
extensionList
()
{
{
String
s
=
qywxUserApiService
.
listSelfExternalUserid
(
"ww9ede832a84b7ae5f"
,
"01YQ-pcdYzF3K0So8uCFfkB5i8D5EBW7KcVB4qA8Ktk"
,
"9ae4c4f1277340a186b16a17d937c72c"
);
System
.
out
.
println
(
"============客户联系========"
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
s
));
}
{
String
s
=
qywxUserApiService
.
listSelfExternalUserid
(
"ww9ede832a84b7ae5f"
,
"65zze159pYb4ofbFsIREZ5X7d7iaZ-bWsVIQk2y5kTU"
,
"9ae4c4f1277340a186b16a17d937c72c"
);
System
.
out
.
println
(
"============好办助手========"
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
s
));
}
{
String
s
=
qywxUserApiService
.
listSelfExternalUserid
(
"ww9ede832a84b7ae5f"
,
"IOJJKhQYu7SDjb9T8W8fBOUjpszI0b73XDQ-9eqlHmE"
,
"9ae4c4f1277340a186b16a17d937c72c"
);
System
.
out
.
println
(
"============会员小程序========"
);
System
.
out
.
println
(
JSONObject
.
toJSONString
(
s
));
}
}
// @Test
// public void extensionList1() {
// UserDTO selfWorkWxUser = qywxUserApiService.getSelfWorkWxUser("ww9ede832a84b7ae5f", "65zze159pYb4ofbFsIREZ5X7d7iaZ-bWsVIQk2y5kTU", "de2c33f2e8924ff884e0073ca2f2f711");
//// String s = qywxUserApiService.listSelfExternalUserid("ww9ede832a84b7ae5f", "01YQ-pcdYzF3K0So8uCFfkB5i8D5EBW7KcVB4qA8Ktk", "de2c33f2e8924ff884e0073ca2f2f711");
// System.out.println(JSONObject.toJSONString(selfWorkWxUser));
// }
//
//
//
// @Test
// public void extensionList2() {
// String img="d:/test2.jpg";
// byte[] aByte = getFileByteArray(new File(img));
// JSONResponse response = qywxSuiteApiService.uploadMedia("ww9ede832a84b7ae5f", "ww2c34dc56739bb105", aByte,"测试文件", QywxMediaTypeEnum.IMAGE.getCode());
// System.out.println(JSONObject.toJSONString(response));
// }
//
// @Test
// public void extensionList3() {
//// msg59NLDQAAKvRi-fguFcKRVOjeoJKRJw
//// String img="https://pic01-10001430.image.myqcloud.com/53205d69-01f1-4706-a258-014d59d8d106";
//// byte[] aByte = getByte(img);
//// JSONResponse response = qywxSuiteApiService.uploadMedia("ww9ede832a84b7ae5f", "ww2c34dc56739bb105", aByte, QywxMediaTypeEnum.IMAGE.getCode());
//// System.out.println(JSONObject.toJSONString(response));
// QywxImageExternalMessageDTO messageDTO=new QywxImageExternalMessageDTO();
// messageDTO.setMediaId("msg59NLDQAANPwzc9aMWNCBky8EElovyg");
// messageDTO.setSenderUserId("9ae4c4f1277340a186b16a17d937c72c");
// List<String> list=new ArrayList<>();
// list.add("wm59NLDQAAL0fHb-QEbx-U9pdtRFA1bg");
// messageDTO.setExternalUserid(list);
// JSONResponse response1 = qywxSuiteApiService.sendExternalMessage("ww9ede832a84b7ae5f", "ww2c34dc56739bb105", messageDTO);
// System.out.println(JSONObject.toJSONString(response1));
// }
//
// @Test
// public void extensionList4() {
//// msg59NLDQAAKvRi-fguFcKRVOjeoJKRJw
// String img="https://pic01-10001430.image.myqcloud.com/53205d69-01f1-4706-a258-014d59d8d106";
// byte[] aByte = getByte(img);
//// JSONResponse response = qywxSuiteApiService.uploadMedia("ww9ede832a84b7ae5f", "ww2c34dc56739bb105", aByte, QywxMediaTypeEnum.IMAGE.getCode());
//// System.out.println(JSONObject.toJSONString(response));
// JSONResponse response1 = qywxSuiteApiService.uploadImage("ww9ede832a84b7ae5f", "ww2c34dc56739bb105", aByte);
// System.out.println(JSONObject.toJSONString(response1));
// }
//
//
// @Test
// public void redis() {
// long key=111;
// RedisUtil.setCache("test-key-11",key);
// Long key2=111L;
// RedisUtil.setCache("test-key-112",key2);
//
// RedisUtil.setCache("test-key-113",1);
// int ke22y=22;
// RedisUtil.setCache("test-key-115",ke22y);
//
// RedisUtil.setCache("test-key-114","1");
//
//
// }
//
//
// @Test
// public void staff() {
// EmojiConverter emojiConverter = EmojiConverter.getInstance();
//// List<UserDTO> userDTOList = qywxUserApiService.listSelfDepartmentUser("wwd5b0d17fd7952df8", "cFhOS1fkb8-qJNHDr5S8QI1JbpsTLCSTOsxQQUUmYz4", "1", 0);
// UserDTO wxUser = qywxUserApiService.getSelfWorkWxUser("wwd5b0d17fd7952df8", "cFhOS1fkb8-qJNHDr5S8QI1JbpsTLCSTOsxQQUUmYz4", "QingSu");
// String s = EmojiFilterUtil.removeAllEmoji(wxUser.getName());
//// String name = (String) b;
//// ServiceResponse res = staffApiService.getWxSaveNew("a.XiaoPangZhi", "ca66a01b79474c40b3e7c7f93daf1a3b");
// System.out.println(JSONObject.toJSONString(wxUser));
//
//
// }
//
// private byte[] getByte(String strUrl){
// ByteArrayOutputStream baos = null;
// try
// {
// URL u = new URL(strUrl);
// BufferedImage image = ImageIO.read(u);
//
// //convert BufferedImage to byte array
// baos = new ByteArrayOutputStream();
// ImageIO.write( image, "jpg", baos);
// baos.flush();
//
// return baos.toByteArray();
// }
// catch (Exception e)
// {
// }
// finally
// {
// if(baos != null)
// {
// try {
// baos.close();
// } catch (IOException e) {
// }
// return baos.toByteArray();
// }
// return null;
// }
// }
//
// public static byte[] getFileByteArray(File file) {
// long fileSize = file.length();
// if (fileSize > Integer.MAX_VALUE) {
// System.out.println("file too big...");
// return null;
// }
// byte[] buffer = null;
// try (FileInputStream fi = new FileInputStream(file)) {
// buffer = new byte[(int) fileSize];
// int offset = 0;
// int numRead = 0;
// while (offset < buffer.length
// && (numRead = fi.read(buffer, offset, buffer.length - offset)) >= 0) {
// offset += numRead;
// }
// // 确保所有数据均被读取
// if (offset != buffer.length) {
// throw new IOException("Could not completely read file "
// + file.getName());
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// return buffer;
// }
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/hm/HmQrcodeController.java
View file @
76c0fc0c
...
...
@@ -2,6 +2,7 @@ package com.gic.haoban.manage.web.controller.hm;
import
cn.hutool.core.convert.Convert
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
...
...
@@ -11,12 +12,14 @@ import com.gic.haoban.common.utils.AuthWebRequestUtil;
import
com.gic.haoban.manage.api.constants.StatisticsApolloKeyConstant
;
import
com.gic.haoban.manage.api.dto.hm.HmClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO
;
import
com.gic.haoban.manage.api.dto.hm.
HmQrcodeList
DTO
;
import
com.gic.haoban.manage.api.dto.hm.
WxUserAddLog
DTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogSearchQDTO
;
import
com.gic.haoban.manage.api.dto.statistics.StatisticsDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.hm.HmQrcodeApiService
;
import
com.gic.haoban.manage.api.service.hm.WxUserAddLogApiService
;
import
com.gic.haoban.manage.api.util.DataHttpUtil
;
import
com.gic.haoban.manage.web.dto.HmOverviewDTO
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
...
...
@@ -49,6 +52,8 @@ public class HmQrcodeController {
private
HmQrcodeApiService
hmQrcodeApiService
;
@Autowired
private
StaffApiService
staffApiService
;
@Autowired
private
WxUserAddLogApiService
wxUserAddLogApiService
;
/**
* 新增
...
...
@@ -92,16 +97,18 @@ public class HmQrcodeController {
* @return
*/
@RequestMapping
(
value
=
"list"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
<
Page
<
HmQrcodeListDTO
>
>
list
(
@RequestBody
HmQrcodeListQDTO
hmQrcodeListQDTO
)
{
public
RestResponse
<
StatisticsDTO
>
list
(
@RequestBody
HmQrcodeListQDTO
hmQrcodeListQDTO
)
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
hmQrcodeListQDTO
.
setEnterpriseId
(
loginUser
.
getEnterpriseId
());
List
<
String
>
storeList
=
staffApiService
.
getHaoBanStoreIdsRolesByClerkId
(
loginUser
.
getClerkId
(),
loginUser
.
getWxEnterpriseId
());
if
(
CollectionUtils
.
isEmpty
(
storeList
))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_100007
.
getCode
()),
HaoBanErrCode
.
ERR_100007
.
getMsg
());
}
if
(!
storeList
.
contains
(
"-1"
))
{
hmQrcodeListQDTO
.
setStoreId
List
(
storeList
);
hmQrcodeListQDTO
.
setStoreId
(
storeList
);
}
return
RestResponse
.
successResult
(
this
.
hmQrcodeApiService
.
queryListByPage
(
hmQrcodeListQDTO
));
StatisticsDTO
statisticsDTO
=
DataHttpUtil
.
post
(
StatisticsApolloKeyConstant
.
data_haoban_hm_list
,
hmQrcodeListQDTO
);
return
RestResponse
.
successResult
(
statisticsDTO
);
}
/**
...
...
@@ -212,6 +219,18 @@ public class HmQrcodeController {
return
RestResponse
.
successResult
(
serviceResponse
.
getResult
());
}
/**
* 详情-查看记录
* @param qdto
* @return
*/
@RequestMapping
(
path
=
"/wxUserAddLog/list"
)
public
RestResponse
<?>
wxUserAddLogList
(
@RequestBody
WxUserAddLogSearchQDTO
qdto
){
BasePageInfo
pageInfo
=
new
BasePageInfo
();
pageInfo
.
setPageNum
(
qdto
.
getPageNum
());
pageInfo
.
setPageSize
(
qdto
.
getPageSize
());
ServiceResponse
<
Page
<
WxUserAddLogDTO
>>
page
=
wxUserAddLogApiService
.
page
(
qdto
,
pageInfo
);
return
RestResponse
.
successResult
(
page
.
getResult
());
}
}
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