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
858e5dfc
Commit
858e5dfc
authored
Mar 07, 2025
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
朋友圈
parent
f132e617
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
26 deletions
+28
-26
QwMomentApiService.java
.../haoban/manage/api/service/moment/QwMomentApiService.java
+1
-1
QwMomentPlanServiceImpl.java
.../service/service/moment/impl/QwMomentPlanServiceImpl.java
+27
-25
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/moment/QwMomentApiService.java
View file @
858e5dfc
...
@@ -26,7 +26,7 @@ public interface QwMomentApiService {
...
@@ -26,7 +26,7 @@ public interface QwMomentApiService {
ServiceResponse
<
Page
<
QwMomentPlanDataDTO
>>
dataList
(
PlanDataListQDTO
qdto
)
;
ServiceResponse
<
Page
<
QwMomentPlanDataDTO
>>
dataList
(
PlanDataListQDTO
qdto
)
;
/**
/**
*
全部导购处理
*
立即发送朋友圈
* @param params
* @param params
*/
*/
void
initTaskClerk
(
String
params
)
;
void
initTaskClerk
(
String
params
)
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/moment/impl/QwMomentPlanServiceImpl.java
View file @
858e5dfc
...
@@ -6,10 +6,7 @@ import com.gic.api.base.commons.ServiceResponse;
...
@@ -6,10 +6,7 @@ import com.gic.api.base.commons.ServiceResponse;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.PowerService
;
import
com.gic.clerk.api.service.PowerService
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.*
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.enterprise.api.dto.EnterpriseSettingDTO
;
import
com.gic.enterprise.api.dto.EnterpriseSettingDTO
;
import
com.gic.enterprise.api.dto.StoreSearchDTO
;
import
com.gic.enterprise.api.dto.StoreSearchDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.EnterpriseService
;
...
@@ -29,6 +26,7 @@ import com.gic.haoban.manage.service.service.QywxSendService;
...
@@ -29,6 +26,7 @@ import com.gic.haoban.manage.service.service.QywxSendService;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService
;
import
com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService
;
import
com.gic.haoban.manage.service.service.moment.QwMomentPlanService
;
import
com.gic.haoban.manage.service.service.moment.QwMomentPlanService
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.quartz.api.dto.QuartzTaskDTO
;
import
com.gic.quartz.api.dto.QuartzTaskDTO
;
import
com.gic.quartz.api.service.QuartzService
;
import
com.gic.quartz.api.service.QuartzService
;
import
com.gic.wechat.api.service.qywx.QywxExternalUserService
;
import
com.gic.wechat.api.service.qywx.QywxExternalUserService
;
...
@@ -74,6 +72,8 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
...
@@ -74,6 +72,8 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
@Autowired
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
private
WxEnterpriseService
wxEnterpriseService
;
private
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
@Override
@Override
public
ServiceResponse
<
Page
<
QwMomentPlanDTO
>>
planList
(
QwMomentPlanQDTO
qdto
)
{
public
ServiceResponse
<
Page
<
QwMomentPlanDTO
>>
planList
(
QwMomentPlanQDTO
qdto
)
{
PageHelper
.
startPage
(
qdto
);
PageHelper
.
startPage
(
qdto
);
...
@@ -96,11 +96,12 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
...
@@ -96,11 +96,12 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
logger
.
info
(
"保存朋友圈活动={}"
,
JSONObject
.
toJSONString
(
dto
));
logger
.
info
(
"保存朋友圈活动={}"
,
JSONObject
.
toJSONString
(
dto
));
String
enterpriseId
=
dto
.
getEnterpriseId
()
;
String
enterpriseId
=
dto
.
getEnterpriseId
()
;
Long
planId
=
dto
.
getPlanId
()
;
Long
planId
=
dto
.
getPlanId
()
;
boolean
publishNow
=
dto
.
getPublishType
()==
1
;
TabQwMomentPlan
plan
=
EntityUtil
.
changeEntity
(
TabQwMomentPlan
.
class
,
dto
)
;
TabQwMomentPlan
plan
=
EntityUtil
.
changeEntity
(
TabQwMomentPlan
.
class
,
dto
)
;
Date
now
=
new
Date
()
;
Date
now
=
new
Date
()
;
plan
.
setUpdateTime
(
now
);
plan
.
setUpdateTime
(
now
);
// 1立即发布2定时发布
// 1立即发布2定时发布
if
(
p
lan
.
getPublishType
()==
1
)
{
if
(
p
ublishNow
)
{
plan
.
setPublishTime
(
now
);
plan
.
setPublishTime
(
now
);
}
}
boolean
createFlag
=
false
;
boolean
createFlag
=
false
;
...
@@ -119,7 +120,7 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
...
@@ -119,7 +120,7 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
}
else
{
}
else
{
TabQwMomentPlan
oldPlan
=
this
.
qwMomentPlanMapper
.
getById
(
planId
)
;
TabQwMomentPlan
oldPlan
=
this
.
qwMomentPlanMapper
.
getById
(
planId
)
;
// 更新为立即发布
// 更新为立即发布
if
(
oldPlan
.
getPublishType
()==
2
&&
p
lan
.
getPublishType
()==
1
)
{
if
(
oldPlan
.
getPublishType
()==
2
&&
p
ublishNow
)
{
publishFlag
=
true
;
publishFlag
=
true
;
}
}
this
.
qwMomentPlanMapper
.
update
(
plan
);
this
.
qwMomentPlanMapper
.
update
(
plan
);
...
@@ -139,17 +140,17 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
...
@@ -139,17 +140,17 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
}
}
}
}
}
}
if
(!
publishNow
)
{
if
(
plan
.
getPublishType
()==
2
)
{
this
.
addOrDelTimer
(
planId
,
plan
.
getPublishTime
(),
1
);
this
.
addOrDelTimer
(
planId
,
plan
.
getPublishTime
(),
1
);
}
else
{
}
else
{
this
.
addOrDelTimer
(
planId
,
new
Date
(),
0
);
this
.
addOrDelTimer
(
planId
,
new
Date
(),
0
);
if
(
createFlag
||
publishFlag
)
{
if
(
createFlag
||
publishFlag
)
{
JSONObject
jsonObject
=
new
JSONObject
()
;
JSONObject
jsonObject
=
new
JSONObject
()
;
jsonObject
.
put
(
"planId"
,
planId
)
;
jsonObject
.
put
(
"planId"
,
planId
)
;
this
.
initTaskClerk
(
jsonObject
.
toJSONString
());
try
{
try
{
// clientInstance.sendMessage("clerkTaskInitClerkMQ", jsonObject.toJSONString(),10);
// initTaskClerk
logger
.
info
(
"立即开始执行"
);
clientInstance
.
sendMessage
(
"qwMomentInitClerkMQ"
,
jsonObject
.
toJSONString
(),
10
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
...
@@ -219,8 +220,8 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
...
@@ -219,8 +220,8 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
}
}
private
void
saveAttendClerkForTask
(
Long
planId
)
{
private
void
saveAttendClerkForTask
(
TabQwMomentPlan
plan
)
{
TabQwMomentPlan
plan
=
this
.
qwMomentPlanMapper
.
getById
(
planId
)
;
Long
planId
=
plan
.
getPlanId
(
)
;
String
creatorId
=
plan
.
getCreatorId
()
;
String
creatorId
=
plan
.
getCreatorId
()
;
String
enterpriseId
=
plan
.
getEnterpriseId
()
;
String
enterpriseId
=
plan
.
getEnterpriseId
()
;
ClerkDTO
clerkDTO
=
this
.
clerkService
.
getclerkById
(
creatorId
)
;
ClerkDTO
clerkDTO
=
this
.
clerkService
.
getclerkById
(
creatorId
)
;
...
@@ -261,12 +262,25 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
...
@@ -261,12 +262,25 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
@Override
@Override
public
void
initTaskClerk
(
String
params
)
{
public
void
initTaskClerk
(
String
params
)
{
logger
.
info
(
"创建立即执行朋友圈={}"
,
params
);
JSONObject
json
=
JSONObject
.
parseObject
(
params
)
;
JSONObject
json
=
JSONObject
.
parseObject
(
params
)
;
Long
planId
=
json
.
getLong
(
"planId"
)
;
Long
planId
=
json
.
getLong
(
"planId"
)
;
TabQwMomentPlan
plan
=
this
.
qwMomentPlanMapper
.
getById
(
planId
)
;
TabQwMomentPlan
plan
=
this
.
qwMomentPlanMapper
.
getById
(
planId
)
;
this
.
send
(
plan
);
}
@Override
public
void
sendPlanNoticeTimer
(
String
params
)
{
logger
.
info
(
"定时发布任务发送通知={}"
,
params
);
Long
planId
=
Long
.
valueOf
(
params
)
;
TabQwMomentPlan
plan
=
this
.
qwMomentPlanMapper
.
getById
(
planId
)
;
this
.
send
(
plan
);
}
private
void
send
(
TabQwMomentPlan
plan
)
{
// 0全部导购 1部分导购
// 0全部导购 1部分导购
if
(
plan
.
getPlanClerkType
()==
0
)
{
if
(
plan
.
getPlanClerkType
()==
0
)
{
this
.
saveAttendClerkForTask
(
plan
Id
)
;
this
.
saveAttendClerkForTask
(
plan
)
;
}
}
this
.
sendPlanNotice
(
plan
);
this
.
sendPlanNotice
(
plan
);
}
}
...
@@ -306,16 +320,4 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
...
@@ -306,16 +320,4 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
String
moment_id
=
resp2
.
getResult
().
toString
()
;
String
moment_id
=
resp2
.
getResult
().
toString
()
;
}
}
@Override
public
void
sendPlanNoticeTimer
(
String
params
)
{
logger
.
info
(
"定时发布任务发送通知={}"
,
params
);
Long
planId
=
Long
.
valueOf
(
params
)
;
TabQwMomentPlan
plan
=
this
.
qwMomentPlanMapper
.
getById
(
planId
)
;
// 0全部导购 1部分导购
if
(
plan
.
getPlanClerkType
()==
0
)
{
this
.
saveAttendClerkForTask
(
planId
)
;
}
this
.
sendPlanNotice
(
plan
);
}
}
}
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