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
ea7c429b
Commit
ea7c429b
authored
Mar 06, 2025
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
朋友圈
parent
8133a953
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
197 additions
and
26 deletions
+197
-26
QwMomentPlanDTO.java
...com/gic/haoban/manage/api/dto/moment/QwMomentPlanDTO.java
+2
-0
QwMomentPlanAttendMapper.java
...e/service/dao/mapper/moment/QwMomentPlanAttendMapper.java
+24
-2
QwMomentPlanAttendService.java
...age/service/service/moment/QwMomentPlanAttendService.java
+9
-0
QwMomentPlanAttendServiceImpl.java
...ce/service/moment/impl/QwMomentPlanAttendServiceImpl.java
+42
-0
QwMomentPlanServiceImpl.java
.../service/service/moment/impl/QwMomentPlanServiceImpl.java
+46
-1
qwMomentPlanAttendMapper.xml
...main/resources/mapper/moment/qwMomentPlanAttendMapper.xml
+54
-23
MomentTest.java
haoban-manage3-service/src/test/java/MomentTest.java
+5
-0
HaobanQwMomentPlanVO.java
...gic/haoban/manage/web/vo/moment/HaobanQwMomentPlanVO.java
+15
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/moment/QwMomentPlanDTO.java
View file @
ea7c429b
...
...
@@ -73,6 +73,8 @@ public class QwMomentPlanDTO implements Serializable{
/**完成率*/
private
Integer
execRate
;
public
Long
getPlanId
()
{
return
planId
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/moment/QwMomentPlanAttendMapper.java
View file @
ea7c429b
...
...
@@ -2,12 +2,34 @@ package com.gic.haoban.manage.service.dao.mapper.moment;
import
com.gic.haoban.manage.api.dto.moment.QwMomentPlanAttendDTO
;
import
com.gic.haoban.manage.api.dto.moment.QwMomentPlanDTO
;
import
com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
QwMomentPlanAttendMapper
{
void
insert
(
QwMomentPlanAttendDTO
dto
)
;
void
batchInsert
(
List
<
TabQwMomentPlanAttend
>
list
)
;
void
update
(
TabQwMomentPlanAttend
dto
)
;
/**
* 查询已经存在的导购
* @param planId
* @param clerkIdList
* @return
*/
List
<
String
>
listExistClerkIds
(
@Param
(
"planId"
)
Long
planId
,
@Param
(
"list"
)
List
<
String
>
clerkIdList
)
;
List
<
QwMomentPlanAttendDTO
>
listClerk
(
@Param
(
"planId"
)
Long
planId
,
@Param
(
"doneFlag"
)
int
doneFlag
);
void
update
(
QwMomentPlanAttendDTO
dto
)
;
/**
* 删除
* @param planId
* @param clerkIdList
*/
void
delClerks
(
@Param
(
"planId"
)
Long
planId
,
@Param
(
"list"
)
List
<
String
>
clerkIdList
)
;
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/moment/QwMomentPlanAttendService.java
View file @
ea7c429b
...
...
@@ -5,8 +5,17 @@ import com.gic.api.base.commons.ServiceResponse;
import
com.gic.haoban.manage.api.dto.moment.QwMomentPlanAttendDTO
;
import
com.gic.haoban.manage.api.qdto.moment.PlanClerkListQDTO
;
import
java.util.List
;
public
interface
QwMomentPlanAttendService
{
ServiceResponse
<
Page
<
QwMomentPlanAttendDTO
>>
attendList
(
PlanClerkListQDTO
qdto
)
;
/**
* 导购
* @param enterpriseId
* @param planId
*/
void
saveClerk
(
String
enterpriseId
,
List
<
String
>
clerkIdList
,
Long
planId
)
;
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/moment/impl/QwMomentPlanAttendServiceImpl.java
View file @
ea7c429b
...
...
@@ -2,18 +2,33 @@ package com.gic.haoban.manage.service.service.moment.impl;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.manage.api.dto.moment.QwMomentPlanAttendDTO
;
import
com.gic.haoban.manage.api.qdto.moment.PlanClerkListQDTO
;
import
com.gic.haoban.manage.service.dao.mapper.moment.QwMomentPlanAttendMapper
;
import
com.gic.haoban.manage.service.entity.moment.TabQwMomentPlanAttend
;
import
com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
(
"qwMomentPlanAttendService"
)
public
class
QwMomentPlanAttendServiceImpl
implements
QwMomentPlanAttendService
{
private
final
Logger
logger
=
LogManager
.
getLogger
(
this
.
getClass
());
@Autowired
private
QwMomentPlanAttendMapper
qwMomentPlanAttendMapper
;
@Autowired
private
ClerkService
clerkService
;
@Override
public
ServiceResponse
<
Page
<
QwMomentPlanAttendDTO
>>
attendList
(
PlanClerkListQDTO
qdto
)
{
...
...
@@ -21,4 +36,31 @@ public class QwMomentPlanAttendServiceImpl implements QwMomentPlanAttendService
}
public
void
saveClerk
(
String
enterpriseId
,
Long
planId
,
List
<
String
>
clerkIdList
)
{
List
<
String
>
existClerkIdList
=
this
.
qwMomentPlanAttendMapper
.
listExistClerkIds
(
planId
,
clerkIdList
)
;
if
(
CollectionUtils
.
isNotEmpty
(
existClerkIdList
))
{
clerkIdList
=
clerkIdList
.
stream
().
filter
(
o
->!
existClerkIdList
.
contains
(
o
)).
collect
(
Collectors
.
toList
());
}
if
(
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
logger
.
info
(
"所有导购都已添加过"
);
return
;
}
List
<
TabQwMomentPlanAttend
>
list
=
new
ArrayList
<>()
;
for
(
String
clerkId
:
clerkIdList
)
{
ClerkDTO
clerkDTO
=
this
.
clerkService
.
getclerkById
(
clerkId
)
;
if
(
null
!=
clerkDTO
)
{
TabQwMomentPlanAttend
attend
=
new
TabQwMomentPlanAttend
()
;
attend
.
setAttendId
(
UniqueIdUtils
.
uniqueLong
());
attend
.
setPlanId
(
planId
);
attend
.
setEnterpriseId
(
enterpriseId
);
attend
.
setClerkId
(
clerkId
);
attend
.
setClerkCode
(
clerkDTO
.
getClerkCode
());
attend
.
setClerkName
(
clerkDTO
.
getClerkName
());
list
.
add
(
attend
)
;
}
}
this
.
qwMomentPlanAttendMapper
.
batchInsert
(
list
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/moment/impl/QwMomentPlanServiceImpl.java
View file @
ea7c429b
...
...
@@ -7,16 +7,25 @@ import com.gic.commons.util.DateUtil;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.manage.api.dto.moment.QwMomentPlanDTO
;
import
com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum
;
import
com.gic.haoban.manage.api.qdto.moment.QwMomentPlanQDTO
;
import
com.gic.haoban.manage.api.util.notify.NoticeMessageUtil
;
import
com.gic.haoban.manage.service.dao.mapper.moment.QwMomentPlanAttendMapper
;
import
com.gic.haoban.manage.service.dao.mapper.moment.QwMomentPlanMapper
;
import
com.gic.haoban.manage.service.entity.moment.TabQwMomentPlan
;
import
com.gic.haoban.manage.service.service.moment.QwMomentPlanAttendService
;
import
com.gic.haoban.manage.service.service.moment.QwMomentPlanService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
(
"qwMomentPlanService"
)
public
class
QwMomentPlanServiceImpl
implements
QwMomentPlanService
{
...
...
@@ -24,10 +33,15 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
private
final
Logger
logger
=
LogManager
.
getLogger
(
this
.
getClass
());
@Autowired
private
QwMomentPlanMapper
qwMomentPlanMapper
;
@Autowired
private
QwMomentPlanAttendService
qwMomentPlanAttendService
;
@Autowired
private
QwMomentPlanAttendMapper
qwMomentPlanAttendMapper
;
@Override
public
ServiceResponse
<
QwMomentPlanDTO
>
save
(
QwMomentPlanDTO
dto
)
{
logger
.
info
(
"保存朋友圈活动={}"
,
JSONObject
.
toJSONString
(
dto
));
String
enterpriseId
=
dto
.
getEnterpriseId
()
;
Long
planId
=
dto
.
getPlanId
()
;
TabQwMomentPlan
plan
=
EntityUtil
.
changeEntity
(
TabQwMomentPlan
.
class
,
dto
)
;
Date
now
=
new
Date
()
;
...
...
@@ -49,10 +63,41 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
}
else
{
this
.
qwMomentPlanMapper
.
update
(
plan
);
}
// 参与导购
if
(
dto
.
getPlanClerkType
()==
1
)
{
if
(
createFlag
)
{
this
.
qwMomentPlanAttendService
.
saveClerk
(
enterpriseId
,
dto
.
getSelectClerkIdList
(),
planId
);
}
else
{
List
<
String
>
oldList
=
this
.
qwMomentPlanAttendMapper
.
listClerk
(
planId
,
0
).
stream
().
map
(
o
->
o
.
getClerkId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
newList
=
dto
.
getSelectClerkIdList
();
List
<
String
>
addList
=
newList
.
stream
().
filter
(
o
->
!
oldList
.
contains
(
o
)).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
delList
=
oldList
.
stream
().
filter
(
o
->
!
newList
.
contains
(
o
)).
distinct
().
collect
(
Collectors
.
toList
());
this
.
qwMomentPlanAttendService
.
saveClerk
(
enterpriseId
,
addList
,
planId
);
if
(
CollectionUtils
.
isNotEmpty
(
delList
))
{
this
.
qwMomentPlanAttendMapper
.
delClerks
(
planId
,
delList
);
}
if
(
CollectionUtils
.
isNotEmpty
(
addList
))
{
for
(
String
clerkId
:
addList
)
{
this
.
sendTaskToClerk
(
plan
.
getEnterpriseId
(),
clerkId
,
plan
.
getPlanId
());
}
}
}
}
return
ServiceResponse
.
success
(
dto
);
}
private
void
sendTaskToClerk
(
String
enterpriseId
,
String
clerkId
,
Long
planId
)
{
logger
.
info
(
"发送任务通知,clerkId={}"
,
clerkId
);
// 发送通知
Map
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
int
messageType
=
0
;
// NoticeMessageTypeEnum.CLERK_TASK_SEND_NOTICE.getType();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"planId"
,
planId
)
;
NoticeMessageUtil
.
sendNoticeMessage
(
enterpriseId
,
clerkId
,
messageType
,
null
,
map
,
jsonObject
);
}
@Override
public
ServiceResponse
<
Void
>
del
(
Long
planId
)
{
this
.
qwMomentPlanMapper
.
del
(
planId
);
...
...
haoban-manage3-service/src/main/resources/mapper/moment/qwMomentPlanAttendMapper.xml
View file @
ea7c429b
...
...
@@ -41,8 +41,39 @@
qw_data_time,
store_id
</sql>
<select
id=
"listExistClerkIds"
resultType=
"java.lang.String"
>
select clerk_id from tab_haoban_qw_moment_plan_attend where plan_id = #{planId} and clerk_id in (
<foreach
collection=
"list"
separator=
","
item=
"item"
>
#{item}
</foreach>
) and delete_flag = 0
</select>
<select
id=
"listClerk"
resultType=
"com.gic.marketing.pro.api.dto.clerktask.ClerkTaskPlanAttendDTO"
>
select clerk_id clerkId , clerk_code clerkCode , clerk_name clerkName
from tab_haoban_qw_moment_plan_attend where plan_id = #{planId}
<if
test=
"doneFlag==1"
>
and attend_flag = 1
</if>
and delete_flag = 0
</select>
<update
id=
"delClerks"
>
update tab_haoban_qw_moment_plan_attend set delete_flag = 1 , update_time=now() where plan_id = #{planId}
<if
test=
"null != list"
>
and clerk_id in (
<foreach
collection=
"list"
item=
"item"
separator=
","
>
#{item}
</foreach>
)
</if>
</update>
<!-- ===================== 新增 ======================== -->
<insert
id=
"
i
nsert"
>
<insert
id=
"
batchI
nsert"
>
<![CDATA[
INSERT INTO tab_haoban_qw_moment_plan_attend(
attend_id,
...
...
@@ -53,8 +84,6 @@
clerk_id,
clerk_code,
clerk_name,
create_time,
update_time,
delete_flag,
comment_count,
like_count,
...
...
@@ -63,30 +92,32 @@
moment_id,
qw_data_time,
store_id
)VALUES(
#{attendId,jdbcType=BIGINT},
#{planId,jdbcType=BIGINT},
#{wxEnterpriseId,jdbcType=CHAR},
#{enterpriseId,jdbcType=CHAR},
#{staffId,jdbcType=CHAR},
#{clerkId,jdbcType=CHAR},
#{clerkCode,jdbcType=VARCHAR},
#{clerkName,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},
#{deleteFlag,jdbcType=INTEGER},
#{commentCount,jdbcType=INTEGER},
#{likeCount,jdbcType=INTEGER},
#{taskStatus,jdbcType=INTEGER},
#{sendTime,jdbcType=TIMESTAMP},
#{momentId,jdbcType=VARCHAR},
#{qwDataTime,jdbcType=TIMESTAMP},
#{storeId,jdbcType=VARCHAR}
)VALUES
<foreach collection="list" item="item" separator="," index="index">
(
#{item.attendId,jdbcType=BIGINT},
#{item.planId,jdbcType=BIGINT},
#{item.wxEnterpriseId,jdbcType=CHAR},
#{item.enterpriseId,jdbcType=CHAR},
#{item.staffId,jdbcType=CHAR},
#{item.clerkId,jdbcType=CHAR},
#{item.clerkCode,jdbcType=VARCHAR},
#{item.clerkName,jdbcType=VARCHAR},
#{item.deleteFlag,jdbcType=INTEGER},
#{item.commentCount,jdbcType=INTEGER},
#{item.likeCount,jdbcType=INTEGER},
#{item.taskStatus,jdbcType=INTEGER},
#{item.sendTime,jdbcType=TIMESTAMP},
#{item.momentId,jdbcType=VARCHAR},
#{item.qwDataTime,jdbcType=TIMESTAMP},
#{item.storeId,jdbcType=VARCHAR}
</foreach>
)
]]>
</insert>
<update
id=
"update"
parameterType=
"com.gic.haoban.manage.
api.dto.moment.QwMomentPlanAttendDTO
"
>
<update
id=
"update"
parameterType=
"com.gic.haoban.manage.
service.entity.moment.TabQwMomentPlanAttend
"
>
<![CDATA[
UPDATE tab_haoban_qw_moment_plan_attend SET
<if test="null != attendId">
...
...
haoban-manage3-service/src/test/java/MomentTest.java
View file @
ea7c429b
...
...
@@ -32,6 +32,11 @@ public class MomentTest {
dto
.
setPublishType
(
2
);
dto
.
setPublishTime
(
new
Date
());
dto
.
setWxEnterpriseId
(
"123"
);
dto
.
setCreatorId
(
"11"
);
dto
.
setCreatorName
(
"222"
);
dto
.
setEnterpriseId
(
"123"
);
dto
.
setExecType
(
1
);
dto
.
setExpireDays
(
10
);
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/vo/moment/HaobanQwMomentPlanVO.java
View file @
ea7c429b
...
...
@@ -80,6 +80,12 @@ public class HaobanQwMomentPlanVO implements Serializable {
* 总任务数
*/
private
Integer
totalNum
;
/**
* 成功下发导购数据
*/
private
Integer
taskClerkNum
;
/**
* 执行任务数
*/
...
...
@@ -122,6 +128,15 @@ public class HaobanQwMomentPlanVO implements Serializable {
*/
private
Integer
totalCommentCount
;
public
Integer
getTaskClerkNum
()
{
return
taskClerkNum
;
}
public
void
setTaskClerkNum
(
Integer
taskClerkNum
)
{
this
.
taskClerkNum
=
taskClerkNum
;
}
public
Double
getExecRateFloat
()
{
return
execRateFloat
;
}
...
...
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