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
95de77ca
Commit
95de77ca
authored
Nov 26, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
6faa09b4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
131 additions
and
116 deletions
+131
-116
FriendMergeSyncOperation.java
.../haoban/manage/service/task/FriendMergeSyncOperation.java
+94
-2
FriendSyncOperation.java
...m/gic/haoban/manage/service/task/FriendSyncOperation.java
+4
-33
SelfFriendSyncOperation.java
...c/haoban/manage/service/task/SelfFriendSyncOperation.java
+5
-54
DealSyncTest.java
haoban-manage3-service/src/test/java/DealSyncTest.java
+9
-8
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+19
-19
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/FriendMergeSyncOperation.java
View file @
95de77ca
...
@@ -8,35 +8,127 @@ import org.springframework.stereotype.Service;
...
@@ -8,35 +8,127 @@ import org.springframework.stereotype.Service;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.PowerService
;
import
com.gic.haoban.manage.api.dto.ClerkMainStoreRelatedDTO
;
import
com.gic.haoban.manage.api.dto.DealParamMqDTO
;
import
com.gic.haoban.manage.api.dto.DealParamMqDTO
;
import
com.gic.haoban.manage.api.dto.ExternalUserDTO
;
import
com.gic.haoban.manage.api.dto.ExternalUserDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.enums.PreDealStatusEnum
;
import
com.gic.haoban.manage.api.enums.PreDealStatusEnum
;
import
com.gic.haoban.manage.api.enums.PreDealTypeEnum
;
import
com.gic.haoban.manage.api.enums.PreDealTypeEnum
;
import
com.gic.haoban.manage.api.enums.SyncTaskStatusEnum
;
import
com.gic.haoban.manage.api.enums.SyncTaskStatusEnum
;
import
com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService
;
import
com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService
;
import
com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.service.entity.TabHaobanPreDealLog
;
import
com.gic.haoban.manage.service.entity.TabHaobanPreDealLog
;
import
com.gic.haoban.manage.service.entity.TabHaobanSyncTask
;
import
com.gic.haoban.manage.service.entity.TabHaobanSyncTask
;
import
com.gic.haoban.manage.service.service.PreDealService
;
import
com.gic.haoban.manage.service.service.PreDealService
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.SyncTaskService
;
import
com.gic.haoban.manage.service.service.SyncTaskService
;
import
com.gic.member.api.dto.MemberDTO
;
import
com.gic.member.api.service.MemberOpenCardBusinessService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
@Service
@Service
public
class
FriendMergeSyncOperation
implements
BaseSyncOperation
{
public
class
FriendMergeSyncOperation
implements
BaseSyncOperation
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FriendMergeSyncOperation
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FriendMergeSyncOperation
.
class
);
@Autowired
@Autowired
private
MemberUnionidRelatedApiService
memberUnionidRelatedApiService
;
@Autowired
private
PreDealService
preDealService
;
private
PreDealService
preDealService
;
@Autowired
@Autowired
private
MemberUnionidRelatedApiService
memberUnionidRelatedApiService
;
@Autowired
private
SyncTaskService
syncTaskService
;
private
SyncTaskService
syncTaskService
;
@Autowired
private
ClerkMainStoreRelatedApiService
clerkMainStoreRelatedApiService
;
@Autowired
private
StaffApiService
staffApiService
;
@Autowired
private
StaffClerkRelationService
staffClerkRelationService
;
@Autowired
private
ClerkService
clerkService
;
@Autowired
private
PowerService
powerService
;
@Autowired
private
MemberOpenCardBusinessService
memberOpenCardBusinessService
;
@Override
@Override
public
void
dealSingleByMq
(
DealParamMqDTO
dealParamMqDTO
,
TabHaobanPreDealLog
dataPre
)
{
public
void
dealSingleByMq
(
DealParamMqDTO
dealParamMqDTO
,
TabHaobanPreDealLog
dataPre
)
{
String
reason
=
""
;
String
reason
=
""
;
boolean
dealFlag
=
true
;
boolean
dealFlag
=
true
;
String
wxUserId
=
dataPre
.
getpDataId
();
String
wxEnterpriseId
=
dataPre
.
getWxEnterpriseId
();
String
taskId
=
dealParamMqDTO
.
getTaskId
();
String
taskId
=
dealParamMqDTO
.
getTaskId
();
String
key
=
dataPre
.
getDataId
();
try
{
try
{
String
dataContent
=
dataPre
.
getDataContent
();
String
dataContent
=
dataPre
.
getDataContent
();
ExternalUserDTO
pojo
=
JSON
.
parseObject
(
dataContent
,
ExternalUserDTO
.
class
);
ExternalUserDTO
pojo
=
JSON
.
parseObject
(
dataContent
,
ExternalUserDTO
.
class
);
StaffDTO
staff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
wxUserId
,
wxEnterpriseId
);
if
(
staff
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
key
,
PreDealStatusEnum
.
exception
.
getVal
(),
"成员不存在"
);
checkDepartmentTask
(
taskId
);
return
;
}
ClerkMainStoreRelatedDTO
mainStore
=
clerkMainStoreRelatedApiService
.
getWxEnterpriseIdAndStaffId
(
wxEnterpriseId
,
staff
.
getStaffId
());
if
(
mainStore
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
key
,
PreDealStatusEnum
.
exception
.
getVal
(),
"主门店不存在"
);
checkDepartmentTask
(
taskId
);
return
;
}
StaffClerkRelationDTO
staffClerkRelationDTO
=
staffClerkRelationService
.
getOneBindByStoreId
(
staff
.
getStaffId
(),
mainStore
.
getStoreId
());
if
(
staffClerkRelationDTO
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
key
,
PreDealStatusEnum
.
exception
.
getVal
(),
"未绑定导购"
);
checkDepartmentTask
(
taskId
);
return
;
}
if
(
pojo
==
null
){
dealException
(
taskId
,
key
,
null
,
"好友不存在"
);
checkDepartmentTask
(
taskId
);
return
;
}
pojo
.
setWxEnterpriseId
(
wxEnterpriseId
);
pojo
.
setEnterpriseId
(
staffClerkRelationDTO
.
getEnterpriseId
());
pojo
.
setStoreId
(
mainStore
.
getStoreId
());
pojo
.
setClerkId
(
staffClerkRelationDTO
.
getClerkId
());
pojo
.
setWxUserId
(
wxUserId
);
pojo
.
setStaffId
(
staffClerkRelationDTO
.
getStaffId
());
String
externalUserId
=
pojo
.
getExternalUserId
();
ExternalUserDTO
p
=
memberUnionidRelatedApiService
.
getExternalUseridInfo
(
wxEnterpriseId
,
wxUserId
,
externalUserId
);
if
(
p
==
null
){
dealException
(
taskId
,
key
,
null
,
"好友不存在"
);
checkDepartmentTask
(
taskId
);
return
;
}
pojo
.
setAvatar
(
p
.
getAvatar
());
//新增导购和外部联系人关系
String
clerkCode
=
staffClerkRelationDTO
.
getClerkCode
();
ClerkDTO
clerk
=
clerkService
.
getClerkByClerkCode
(
staffClerkRelationDTO
.
getEnterpriseId
(),
clerkCode
);
if
(
clerk
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
key
,
PreDealStatusEnum
.
exception
.
getVal
(),
"导购不存在"
);
checkDepartmentTask
(
taskId
);
return
;
}
String
qrcodeParam
=
clerk
.
getQrcodeParam
();
if
(
StringUtils
.
isBlank
(
qrcodeParam
)){
powerService
.
saveClerkQrCode
(
clerk
.
getClerkId
());
clerk
=
clerkService
.
getClerkByClerkCode
(
staffClerkRelationDTO
.
getEnterpriseId
(),
clerkCode
);
qrcodeParam
=
clerk
.
getQrcodeParam
();
}
if
(
StringUtils
.
isBlank
(
qrcodeParam
)){
preDealService
.
updateStatusByDataId
(
taskId
,
key
,
PreDealStatusEnum
.
exception
.
getVal
(),
"导购码不存在"
);
checkDepartmentTask
(
taskId
);
return
;
}
MemberDTO
member
=
null
;
if
(
clerk
!=
null
&&
StringUtils
.
isNotBlank
(
qrcodeParam
)&&
StringUtils
.
isNotBlank
(
pojo
.
getUnionId
())){
member
=
memberOpenCardBusinessService
.
getMemberByQywxChannelParam
(
staffClerkRelationDTO
.
getEnterpriseId
(),
pojo
.
getUnionId
(),
""
,
pojo
.
getName
(),
pojo
.
getAvatar
(),
qrcodeParam
);
}
if
(
member
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
key
,
PreDealStatusEnum
.
exception
.
getVal
(),
"会员不存在"
);
checkDepartmentTask
(
taskId
);
return
;
}
pojo
.
setMemberId
(
member
.
getMemberId
());
String
res
=
memberUnionidRelatedApiService
.
addExternal
(
pojo
);
String
res
=
memberUnionidRelatedApiService
.
addExternal
(
pojo
);
if
(
StringUtils
.
isBlank
(
res
)){
if
(
StringUtils
.
isBlank
(
res
)){
dealSuccess
(
dealParamMqDTO
.
getTaskId
(),
dataPre
.
getDataId
(),
null
,
null
);
dealSuccess
(
dealParamMqDTO
.
getTaskId
(),
dataPre
.
getDataId
(),
null
,
null
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/FriendSyncOperation.java
View file @
95de77ca
...
@@ -59,38 +59,17 @@ public class FriendSyncOperation implements BaseSyncOperation {
...
@@ -59,38 +59,17 @@ public class FriendSyncOperation implements BaseSyncOperation {
String
wxUserId
=
dataPre
.
getpDataId
();
String
wxUserId
=
dataPre
.
getpDataId
();
String
taskId
=
dealParamMqDTO
.
getTaskId
();
String
taskId
=
dealParamMqDTO
.
getTaskId
();
String
externalUserId
=
dataPre
.
getDataId
();
String
externalUserId
=
dataPre
.
getDataId
();
StaffDTO
staff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
wxUserId
,
wxEnterpriseId
);
if
(
staff
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
externalUserId
,
PreDealStatusEnum
.
exception
.
getVal
(),
"成员不存在"
);
checkStaffTask
(
taskId
,
wxUserId
);
return
;
}
ClerkMainStoreRelatedDTO
mainStore
=
clerkMainStoreRelatedApiService
.
getWxEnterpriseIdAndStaffId
(
wxEnterpriseId
,
staff
.
getStaffId
());
if
(
mainStore
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
externalUserId
,
PreDealStatusEnum
.
exception
.
getVal
(),
"主门店不存在"
);
checkStaffTask
(
taskId
,
wxUserId
);
return
;
}
StaffClerkRelationDTO
staffClerkRelationDTO
=
staffClerkRelationService
.
getOneBindByStoreId
(
staff
.
getStaffId
(),
mainStore
.
getStoreId
());
if
(
staffClerkRelationDTO
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
externalUserId
,
PreDealStatusEnum
.
exception
.
getVal
(),
"未绑定导购"
);
checkStaffTask
(
taskId
,
wxUserId
);
return
;
}
ExternalUserDTO
pojo
=
memberUnionidRelatedApiService
.
getExternalUseridInfo
(
wxEnterpriseId
,
wxUserId
,
externalUserId
);
ExternalUserDTO
pojo
=
memberUnionidRelatedApiService
.
getExternalUseridInfo
(
wxEnterpriseId
,
wxUserId
,
externalUserId
);
if
(
pojo
==
null
){
if
(
pojo
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
externalUserId
,
PreDealStatusEnum
.
exception
.
getVal
(),
"好友不存在"
);
preDealService
.
updateStatusByDataId
(
taskId
,
externalUserId
,
PreDealStatusEnum
.
exception
.
getVal
(),
"好友不存在"
);
checkStaffTask
(
taskId
,
wxUserId
);
checkStaffTask
(
taskId
,
wxUserId
);
return
;
return
;
}
}
pojo
.
setEnterpriseId
(
staffClerkRelationDTO
.
getEnterpriseId
());
JSONObject
json
=
new
JSONObject
();
pojo
.
setStoreId
(
mainStore
.
getStoreId
());
json
.
put
(
"name"
,
pojo
.
getName
());
pojo
.
setClerkId
(
staffClerkRelationDTO
.
getClerkId
());
json
.
put
(
"externalUserId"
,
pojo
.
getExternalUserId
());
pojo
.
setWxUserId
(
wxUserId
);
json
.
put
(
"addCreateTime"
,
pojo
.
getAddCreateTime
());
pojo
.
setStaffId
(
staffClerkRelationDTO
.
getStaffId
());
if
(
pojo
!=
null
){
dealSuccess
(
taskId
,
externalUserId
,
JSON
.
toJSONString
(
pojo
),
wxEnterpriseId
);
dealSuccess
(
taskId
,
externalUserId
,
JSON
.
toJSONString
(
pojo
),
wxEnterpriseId
);
}
try
{
try
{
checkStaffTask
(
taskId
,
wxUserId
);
checkStaffTask
(
taskId
,
wxUserId
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -133,20 +112,12 @@ public class FriendSyncOperation implements BaseSyncOperation {
...
@@ -133,20 +112,12 @@ public class FriendSyncOperation implements BaseSyncOperation {
String
name
=
json
.
getName
();
String
name
=
json
.
getName
();
String
key
=
addCreateTime
+
name
;
String
key
=
addCreateTime
+
name
;
String
unionId
=
json
.
getUnionId
();
String
unionId
=
json
.
getUnionId
();
String
clerkId
=
json
.
getClerkId
();
String
enterpriseId
=
json
.
getEnterpriseId
();
String
memberId
=
json
.
getMemberId
();
String
storeId
=
json
.
getStoreId
();
String
wxEnterpriseId
=
json
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
json
.
getWxEnterpriseId
();
ExternalUserDTO
dto
=
map
.
get
(
key
);
ExternalUserDTO
dto
=
map
.
get
(
key
);
if
(
dto
!=
null
){
if
(
dto
!=
null
){
if
(
tabHaobanPreDealLog
.
getDataType
()
==
PreDealTypeEnum
.
self_friend
.
getVal
()){
if
(
tabHaobanPreDealLog
.
getDataType
()
==
PreDealTypeEnum
.
self_friend
.
getVal
()){
dto
.
setUnionId
(
unionId
);
dto
.
setUnionId
(
unionId
);
dto
.
setClerkId
(
clerkId
);
dto
.
setEnterpriseId
(
enterpriseId
);
dto
.
setMemberId
(
memberId
);
dto
.
setStoreId
(
storeId
);
}
else
if
(
tabHaobanPreDealLog
.
getDataType
()
==
PreDealTypeEnum
.
friend
.
getVal
()){
}
else
if
(
tabHaobanPreDealLog
.
getDataType
()
==
PreDealTypeEnum
.
friend
.
getVal
()){
dto
.
setExternalUserId
(
tabHaobanPreDealLog
.
getDataId
());
dto
.
setExternalUserId
(
tabHaobanPreDealLog
.
getDataId
());
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/SelfFriendSyncOperation.java
View file @
95de77ca
...
@@ -70,67 +70,18 @@ public class SelfFriendSyncOperation implements BaseSyncOperation{
...
@@ -70,67 +70,18 @@ public class SelfFriendSyncOperation implements BaseSyncOperation{
String
wxUserId
=
dataPre
.
getpDataId
();
String
wxUserId
=
dataPre
.
getpDataId
();
String
taskId
=
dealParamMqDTO
.
getTaskId
();
String
taskId
=
dealParamMqDTO
.
getTaskId
();
String
externalUserId
=
dataPre
.
getDataId
();
String
externalUserId
=
dataPre
.
getDataId
();
StaffDTO
staff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
wxUserId
,
wxEnterpriseId
);
if
(
staff
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
externalUserId
,
PreDealStatusEnum
.
exception
.
getVal
(),
"成员不存在"
);
checkStaffTask
(
taskId
,
wxUserId
);
return
;
}
ClerkMainStoreRelatedDTO
mainStore
=
clerkMainStoreRelatedApiService
.
getWxEnterpriseIdAndStaffId
(
wxEnterpriseId
,
staff
.
getStaffId
());
if
(
mainStore
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
externalUserId
,
PreDealStatusEnum
.
exception
.
getVal
(),
"主门店不存在"
);
checkStaffTask
(
taskId
,
wxUserId
);
return
;
}
StaffClerkRelationDTO
staffClerkRelationDTO
=
staffClerkRelationService
.
getOneBindByStoreId
(
staff
.
getStaffId
(),
mainStore
.
getStoreId
());
if
(
staffClerkRelationDTO
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
externalUserId
,
PreDealStatusEnum
.
exception
.
getVal
(),
"未绑定导购"
);
checkStaffTask
(
taskId
,
wxUserId
);
return
;
}
ExternalUserDTO
pojo
=
memberUnionidRelatedApiService
.
getCorpSelfExternalUseridInfo
(
wxEnterpriseId
,
wxUserId
,
externalUserId
);
ExternalUserDTO
pojo
=
memberUnionidRelatedApiService
.
getCorpSelfExternalUseridInfo
(
wxEnterpriseId
,
wxUserId
,
externalUserId
);
if
(
pojo
==
null
){
if
(
pojo
==
null
){
dealException
(
taskId
,
externalUserId
,
null
,
"好友不存在"
);
dealException
(
taskId
,
externalUserId
,
null
,
"好友不存在"
);
checkStaffTask
(
taskId
,
wxUserId
);
checkStaffTask
(
taskId
,
wxUserId
);
return
;
return
;
}
}
pojo
.
setEnterpriseId
(
staffClerkRelationDTO
.
getEnterpriseId
());
JSONObject
json
=
new
JSONObject
();
pojo
.
setStoreId
(
mainStore
.
getStoreId
());
json
.
put
(
"name"
,
pojo
.
getName
());
pojo
.
setClerkId
(
staffClerkRelationDTO
.
getClerkId
());
json
.
put
(
"unionId"
,
pojo
.
getUnionId
());
pojo
.
setWxUserId
(
wxUserId
);
json
.
put
(
"addCreateTime"
,
pojo
.
getAddCreateTime
());
pojo
.
setStaffId
(
staffClerkRelationDTO
.
getStaffId
());
//新增导购和外部联系人关系
String
clerkCode
=
staffClerkRelationDTO
.
getClerkCode
();
ClerkDTO
clerk
=
clerkService
.
getClerkByClerkCode
(
staffClerkRelationDTO
.
getEnterpriseId
(),
clerkCode
);
if
(
clerk
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
externalUserId
,
PreDealStatusEnum
.
exception
.
getVal
(),
"导购不存在"
);
checkStaffTask
(
taskId
,
wxUserId
);
return
;
}
String
qrcodeParam
=
clerk
.
getQrcodeParam
();
if
(
StringUtils
.
isBlank
(
qrcodeParam
)){
powerService
.
saveClerkQrCode
(
clerk
.
getClerkId
());
clerk
=
clerkService
.
getClerkByClerkCode
(
staffClerkRelationDTO
.
getEnterpriseId
(),
clerkCode
);
qrcodeParam
=
clerk
.
getQrcodeParam
();
}
if
(
StringUtils
.
isBlank
(
qrcodeParam
)){
preDealService
.
updateStatusByDataId
(
taskId
,
externalUserId
,
PreDealStatusEnum
.
exception
.
getVal
(),
"导购码不存在"
);
checkStaffTask
(
taskId
,
wxUserId
);
return
;
}
MemberDTO
member
=
null
;
if
(
clerk
!=
null
&&
StringUtils
.
isNotBlank
(
qrcodeParam
)&&
StringUtils
.
isNotBlank
(
pojo
.
getUnionId
())){
member
=
memberOpenCardBusinessService
.
getMemberByQywxChannelParam
(
staffClerkRelationDTO
.
getEnterpriseId
(),
pojo
.
getUnionId
(),
""
,
pojo
.
getName
(),
pojo
.
getAvatar
(),
qrcodeParam
);
}
if
(
member
==
null
){
preDealService
.
updateStatusByDataId
(
taskId
,
externalUserId
,
PreDealStatusEnum
.
exception
.
getVal
(),
"会员不存在"
);
checkStaffTask
(
taskId
,
wxUserId
);
return
;
}
try
{
try
{
pojo
.
setMemberId
(
member
.
getMemberId
());
dealSuccess
(
taskId
,
externalUserId
,
json
.
toJSONString
(),
wxEnterpriseId
);
dealSuccess
(
taskId
,
externalUserId
,
JSON
.
toJSONString
(
pojo
),
wxEnterpriseId
);
checkStaffTask
(
taskId
,
wxUserId
);
checkStaffTask
(
taskId
,
wxUserId
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
haoban-manage3-service/src/test/java/DealSyncTest.java
View file @
95de77ca
...
@@ -61,14 +61,15 @@ public class DealSyncTest {
...
@@ -61,14 +61,15 @@ public class DealSyncTest {
@Test
@Test
public
void
test
()
{
public
void
test
()
{
ConcurrencyTester
tester
=
ThreadUtil
.
concurrencyTest
(
10
,
()
->
{
dealSyncOperationApiService
.
test
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
,
"49da12164c584fe8aabbb1094b25cfa5"
);
List
<
String
>
res
=
memberUnionidRelatedApiService
.
listSelfExterialList
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
,
"QiuWenMin"
);
// ConcurrencyTester tester = ThreadUtil.concurrencyTest(10, () -> {
System
.
out
.
println
(
JSON
.
toJSONString
(
res
));
// List<String> res = memberUnionidRelatedApiService.listSelfExterialList("ca66a01b79474c40b3e7c7f93daf1a3b", "QiuWenMin");
});
// System.out.println(JSON.toJSONString(res));
// });
ExecutorService
pool
=
Executors
.
newCachedThreadPool
();
//
List
<
String
>
res
=
memberUnionidRelatedApiService
.
listSelfExterialList
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
,
"QiuWenMin"
);
// ExecutorService pool = Executors. newCachedThreadPool();
System
.
out
.
println
(
JSON
.
toJSONString
(
res
));
// List<String> res = memberUnionidRelatedApiService.listSelfExterialList("ca66a01b79474c40b3e7c7f93daf1a3b", "QiuWenMin");
// System.out.println(JSON.toJSONString(res));
// 初始化计数器为1
// 初始化计数器为1
// CountDownLatch countDownLatch = new CountDownLatch(1);
// CountDownLatch countDownLatch = new CountDownLatch(1);
// new Thread(new CountDownLatchTest(memberUnionidRelatedApiService,"12", countDownLatch)).start();
// new Thread(new CountDownLatchTest(memberUnionidRelatedApiService,"12", countDownLatch)).start();
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
95de77ca
...
@@ -536,25 +536,25 @@ public class WxEnterpriseController extends WebBaseController{
...
@@ -536,25 +536,25 @@ public class WxEnterpriseController extends WebBaseController{
if
(
StringUtils
.
isEmpty
(
taskId
)){
if
(
StringUtils
.
isEmpty
(
taskId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_100021
);
return
resultResponse
(
HaoBanErrCode
.
ERR_100021
);
}
}
//
QuartzTaskDTO taskDTO = buildQuartzTaskDTO("haoban-enterprise-fresh-wx-friend");
QuartzTaskDTO
taskDTO
=
buildQuartzTaskDTO
(
"haoban-enterprise-fresh-wx-friend"
);
//
JSONObject json = new JSONObject();
JSONObject
json
=
new
JSONObject
();
//
json.put("taskId", taskId);
json
.
put
(
"taskId"
,
taskId
);
//
json.put("wxEnterpriseId", wxEnterpriseId);
json
.
put
(
"wxEnterpriseId"
,
wxEnterpriseId
);
//
taskDTO.setTaskParam(json.toJSONString());
taskDTO
.
setTaskParam
(
json
.
toJSONString
());
//
taskDTO.setTaskStatus(1);
taskDTO
.
setTaskStatus
(
1
);
//
Date now = new Date();
Date
now
=
new
Date
();
//
Date exeDate = DateUtil.addDay(now, 1);
Date
exeDate
=
DateUtil
.
addDay
(
now
,
1
);
//
Calendar ca = Calendar.getInstance();
Calendar
ca
=
Calendar
.
getInstance
();
//
ca.setTime(now);
ca
.
setTime
(
now
);
//
int day = ca.get(Calendar.DAY_OF_MONTH);//第几天
int
day
=
ca
.
get
(
Calendar
.
DAY_OF_MONTH
);
//第几天
//
int month = ca.get(Calendar.MONTH);//第几个月
int
month
=
ca
.
get
(
Calendar
.
MONTH
);
//第几个月
//
int year = ca.get(Calendar.YEAR);//年份数值
int
year
=
ca
.
get
(
Calendar
.
YEAR
);
//年份数值
// int hour = ca.get(Calendar.HOUR)
;//
int
hour
=
4
;
//
//
int minute = ca.get(Calendar.MINUTE);//
int
minute
=
ca
.
get
(
Calendar
.
MINUTE
);
//
//
int second = ca.get(Calendar.SECOND);//
int
second
=
ca
.
get
(
Calendar
.
SECOND
);
//
//
String con = second + " " + minute + " " + hour + " " + day + " " + month +" " + year;
String
con
=
second
+
" "
+
minute
+
" "
+
hour
+
" "
+
day
+
" "
+
month
+
" "
+
year
;
//
taskDTO.setTaskTimeInfo(con);
taskDTO
.
setTaskTimeInfo
(
con
);
//
quartzService.addOrUpdateQuartzTask(taskDTO);
quartzService
.
addOrUpdateQuartzTask
(
taskDTO
);
dealSyncOperationApiService
.
dealWxFriendClerk
(
taskId
,
wxEnterpriseId
);
dealSyncOperationApiService
.
dealWxFriendClerk
(
taskId
,
wxEnterpriseId
);
RedisUtil
.
setCache
(
dayKey
,
dayCount
+
1
);
RedisUtil
.
setCache
(
dayKey
,
dayCount
+
1
);
RedisUtil
.
setCache
(
monthKey
,
monthCount
+
1
);
RedisUtil
.
setCache
(
monthKey
,
monthCount
+
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