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
95cf3b49
Commit
95cf3b49
authored
Dec 14, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增群发
parent
5b631aa2
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
173 additions
and
89 deletions
+173
-89
GroupChatPlanDTO.java
.../com/gic/haoban/manage/api/dto/chat/GroupChatPlanDTO.java
+10
-1
GroupChatPlanOwnerLogMapper.java
.../service/dao/mapper/chat/GroupChatPlanOwnerLogMapper.java
+10
-3
TabGroupChatPlan.java
...c/haoban/manage/service/entity/chat/TabGroupChatPlan.java
+0
-9
GroupChatPlanOwnerLogService.java
...ge/service/service/chat/GroupChatPlanOwnerLogService.java
+6
-1
GroupChatPlanOwnerLogServiceImpl.java
...e/service/chat/impl/GroupChatPlanOwnerLogServiceImpl.java
+51
-26
GroupChatPlanServiceImpl.java
...e/service/service/chat/impl/GroupChatPlanServiceImpl.java
+26
-24
GroupChatPlanMapper.xml
...ce/src/main/resources/mapper/chat/GroupChatPlanMapper.xml
+1
-6
GroupChatPlanOwnerLogMapper.xml
...ain/resources/mapper/chat/GroupChatPlanOwnerLogMapper.xml
+69
-10
GroupChatController.java
...aoban/manage/web/controller/chat/GroupChatController.java
+0
-9
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/chat/GroupChatPlanDTO.java
View file @
95cf3b49
...
@@ -38,6 +38,7 @@ public class GroupChatPlanDTO implements Serializable{
...
@@ -38,6 +38,7 @@ public class GroupChatPlanDTO implements Serializable{
/**几天后失效*/
/**几天后失效*/
private
Integer
expireDays
;
private
Integer
expireDays
;
private
String
staffIdList
;
private
String
staffIdList
;
private
String
delStaffIdList
;
/**群主数量*/
/**群主数量*/
private
Integer
staffCount
;
private
Integer
staffCount
;
/**已完成任务的群主数量*/
/**已完成任务的群主数量*/
...
@@ -49,7 +50,15 @@ public class GroupChatPlanDTO implements Serializable{
...
@@ -49,7 +50,15 @@ public class GroupChatPlanDTO implements Serializable{
// 1代发送 2已发送
// 1代发送 2已发送
private
Integer
sendFlag
;
private
Integer
sendFlag
;
public
Integer
getSendFlag
()
{
public
String
getDelStaffIdList
()
{
return
delStaffIdList
;
}
public
void
setDelStaffIdList
(
String
delStaffIdList
)
{
this
.
delStaffIdList
=
delStaffIdList
;
}
public
Integer
getSendFlag
()
{
return
sendFlag
;
return
sendFlag
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/chat/GroupChatPlanOwnerLogMapper.java
View file @
95cf3b49
...
@@ -23,16 +23,22 @@ public interface GroupChatPlanOwnerLogMapper {
...
@@ -23,16 +23,22 @@ public interface GroupChatPlanOwnerLogMapper {
public
int
insert
(
TabGroupChatPlanOwnerLog
entity
);
public
int
insert
(
TabGroupChatPlanOwnerLog
entity
);
public
int
batchInsert
(
List
<
TabGroupChatPlanOwnerLog
>
entity
);
public
int
update
(
TabGroupChatPlanOwnerLog
entity
);
public
void
deleteByStaffIds
(
@Param
(
"planId"
)
Long
planId
,
@Param
(
"staffIdList"
)
List
<
String
>
staffIdList
);
public
TabGroupChatPlanOwnerLog
selectById
(
Long
ownerLogId
);
public
TabGroupChatPlanOwnerLog
selectById
(
Long
ownerLogId
);
public
void
updateSendCount
(
@Param
(
"id"
)
Long
id
,
@Param
(
"sendCount"
)
int
sendCount
,
@Param
(
"failCount"
)
int
failCount
,
public
void
updateSendCount
(
@Param
(
"id"
)
Long
id
,
@Param
(
"sendCount"
)
int
sendCount
,
@Param
(
"sendTime"
)
Date
sendTime
);
@Param
(
"
failCount"
)
int
failCount
,
@Param
(
"
sendTime"
)
Date
sendTime
);
public
List
<
GroupChatPlanOwnerLogDTO
>
listPage
(
GroupChatPlanSearchQDTO
qdto
);
public
List
<
GroupChatPlanOwnerLogDTO
>
listPage
(
GroupChatPlanSearchQDTO
qdto
);
public
List
<
TabGroupChatPlanOwnerLog
>
listForTimer
();
public
List
<
TabGroupChatPlanOwnerLog
>
listForTimer
();
public
List
<
ChatOwnerTotalDTO
>
listOwnerLogPageForWxaTotal
(
GroupChatPlanSearchQDTO
qdto
);
public
List
<
ChatOwnerTotalDTO
>
listOwnerLogPageForWxaTotal
(
GroupChatPlanSearchQDTO
qdto
);
public
List
<
GroupChatPlanOwnerLogDTO
>
listOwnerLogPageForWxa
(
GroupChatPlanSearchQDTO
qdto
);
public
List
<
GroupChatPlanOwnerLogDTO
>
listOwnerLogPageForWxa
(
GroupChatPlanSearchQDTO
qdto
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/chat/TabGroupChatPlan.java
View file @
95cf3b49
...
@@ -35,7 +35,6 @@ public class TabGroupChatPlan implements Serializable {
...
@@ -35,7 +35,6 @@ public class TabGroupChatPlan implements Serializable {
private
java
.
util
.
Date
endTime
;
private
java
.
util
.
Date
endTime
;
/**几天后失效*/
/**几天后失效*/
private
Integer
expireDays
;
private
Integer
expireDays
;
private
String
staffIdList
;
/**群主数量*/
/**群主数量*/
private
Integer
staffCount
;
private
Integer
staffCount
;
/**已完成任务的群主数量*/
/**已完成任务的群主数量*/
...
@@ -202,14 +201,6 @@ public class TabGroupChatPlan implements Serializable {
...
@@ -202,14 +201,6 @@ public class TabGroupChatPlan implements Serializable {
return
expireDays
;
return
expireDays
;
}
}
public
void
setStaffIdList
(
String
staffIdList
)
{
this
.
staffIdList
=
staffIdList
;
}
public
String
getStaffIdList
()
{
return
staffIdList
;
}
public
void
setStaffCount
(
Integer
staffCount
)
{
public
void
setStaffCount
(
Integer
staffCount
)
{
this
.
staffCount
=
staffCount
;
this
.
staffCount
=
staffCount
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/chat/GroupChatPlanOwnerLogService.java
View file @
95cf3b49
...
@@ -8,11 +8,16 @@ import com.gic.api.base.commons.Page;
...
@@ -8,11 +8,16 @@ import com.gic.api.base.commons.Page;
import
com.gic.haoban.manage.api.dto.chat.ChatOwnerTotalDTO
;
import
com.gic.haoban.manage.api.dto.chat.ChatOwnerTotalDTO
;
import
com.gic.haoban.manage.api.dto.chat.GroupChatPlanOwnerLogDTO
;
import
com.gic.haoban.manage.api.dto.chat.GroupChatPlanOwnerLogDTO
;
import
com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatPlan
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanOwnerLog
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanOwnerLog
;
public
interface
GroupChatPlanOwnerLogService
{
public
interface
GroupChatPlanOwnerLogService
{
public
GroupChatPlanOwnerLogDTO
save
(
GroupChatPlanOwnerLogDTO
dto
);
public
void
batchAdd
(
String
staffIdList
,
TabGroupChatPlan
entity
);
public
void
update
(
TabGroupChatPlanOwnerLog
entity
);
public
void
deleteByStaffIds
(
Long
planId
,
List
<
String
>
staffIdList
)
;
public
void
updateSendCount
(
Long
id
,
int
sendCount
,
Date
sendTime
,
int
failCount
);
public
void
updateSendCount
(
Long
id
,
int
sendCount
,
Date
sendTime
,
int
failCount
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/chat/impl/GroupChatPlanOwnerLogServiceImpl.java
View file @
95cf3b49
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
chat
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
chat
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -17,7 +18,7 @@ import com.gic.api.base.commons.BasePageInfo;
...
@@ -17,7 +18,7 @@ import com.gic.api.base.commons.BasePageInfo;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
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.commons.util.
Entity
Util
;
import
com.gic.commons.util.
Date
Util
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
...
@@ -26,8 +27,11 @@ import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
...
@@ -26,8 +27,11 @@ import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import
com.gic.haoban.manage.api.dto.chat.ChatOwnerTotalDTO
;
import
com.gic.haoban.manage.api.dto.chat.ChatOwnerTotalDTO
;
import
com.gic.haoban.manage.api.dto.chat.GroupChatPlanOwnerLogDTO
;
import
com.gic.haoban.manage.api.dto.chat.GroupChatPlanOwnerLogDTO
;
import
com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO
;
import
com.gic.haoban.manage.service.dao.mapper.chat.GroupChatOwnerMapper
;
import
com.gic.haoban.manage.service.dao.mapper.chat.GroupChatPlanOwnerLogMapper
;
import
com.gic.haoban.manage.service.dao.mapper.chat.GroupChatPlanOwnerLogMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatOwner
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatPlan
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanOwnerLog
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanOwnerLog
;
import
com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService
;
import
com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
...
@@ -49,6 +53,8 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
...
@@ -49,6 +53,8 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
private
ClerkService
clerkService
;
private
ClerkService
clerkService
;
@Autowired
@Autowired
private
StoreService
storeService
;
private
StoreService
storeService
;
@Autowired
private
GroupChatOwnerMapper
groupChatOwnerMapper
;
public
TabGroupChatPlanOwnerLog
getById
(
Long
ownerLogId
)
{
public
TabGroupChatPlanOwnerLog
getById
(
Long
ownerLogId
)
{
TabGroupChatPlanOwnerLog
log
=
this
.
groupChatPlanOwnerLogMapper
.
selectById
(
ownerLogId
);
TabGroupChatPlanOwnerLog
log
=
this
.
groupChatPlanOwnerLogMapper
.
selectById
(
ownerLogId
);
...
@@ -56,8 +62,8 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
...
@@ -56,8 +62,8 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
}
}
@Override
@Override
public
void
updateSendCount
(
Long
id
,
int
sendCount
,
Date
sendTime
,
int
failCount
)
{
public
void
updateSendCount
(
Long
id
,
int
sendCount
,
Date
sendTime
,
int
failCount
)
{
this
.
groupChatPlanOwnerLogMapper
.
updateSendCount
(
id
,
sendCount
,
failCount
,
sendTime
);
this
.
groupChatPlanOwnerLogMapper
.
updateSendCount
(
id
,
sendCount
,
failCount
,
sendTime
);
}
}
@Override
@Override
...
@@ -108,32 +114,46 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
...
@@ -108,32 +114,46 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
}
}
@Override
@Override
public
GroupChatPlanOwnerLogDTO
save
(
GroupChatPlanOwnerLogDTO
dto
)
{
public
void
batchAdd
(
String
staffIdList
,
TabGroupChatPlan
entity
)
{
TabGroupChatPlanOwnerLog
log
=
EntityUtil
.
changeEntityByJSON
(
TabGroupChatPlanOwnerLog
.
class
,
dto
);
String
[]
arr
=
staffIdList
.
split
(
","
);
log
.
setOwnerLogId
(
UniqueIdUtils
.
uniqueLong
());
List
<
TabGroupChatPlanOwnerLog
>
logList
=
new
ArrayList
<>();
log
.
setSendStatus
(
0
);
for
(
int
i
=
0
;
i
<
arr
.
length
;
i
++)
{
log
.
setCreateTime
(
new
Date
());
String
staffId
=
arr
[
i
];
log
.
setUpdateTime
(
new
Date
());
TabGroupChatPlanOwnerLog
log
=
new
TabGroupChatPlanOwnerLog
();
log
.
setSendCount
(
0
);
log
.
setOwnerLogId
(
UniqueIdUtils
.
uniqueLong
());
String
staffId
=
dto
.
getStaffId
();
log
.
setWxEnterpriseId
(
entity
.
getWxEnterpriseId
());
log
.
setEnterpriseId
(
entity
.
getEnterpriseId
());
TabHaobanClerkMainStoreRelated
mainStore
=
this
.
clerkMainStoreRelatedService
.
getMainStoreByStaffId
(
staffId
,
log
.
setPlanId
(
entity
.
getPlanId
());
dto
.
getWxEnterpriseId
());
log
.
setSendStatus
(
1
);
if
(
null
==
mainStore
)
{
log
.
setCreateTime
(
new
Date
());
log
.
setRemark
(
"区经/未配置主门店"
);
log
.
setUpdateTime
(
new
Date
());
}
else
{
log
.
setSendCount
(
0
);
StaffClerkRelationDTO
clerk
=
this
.
staffClerkRelationService
.
getOneBindByStoreId
(
staffId
,
log
.
setStaffId
(
staffId
);
mainStore
.
getStoreId
());
TabGroupChatOwner
owner
=
this
.
groupChatOwnerMapper
.
selectByStaffId
(
staffId
);
if
(
null
!=
clerk
)
{
log
.
setTotalCount
(
owner
.
getChatCount
());
log
.
setClerkId
(
clerk
.
getClerkId
());
TabHaobanClerkMainStoreRelated
mainStore
=
this
.
clerkMainStoreRelatedService
.
getMainStoreByStaffId
(
staffId
,
log
.
setStoreId
(
mainStore
.
getStoreId
());
entity
.
getWxEnterpriseId
());
if
(
null
==
mainStore
)
{
log
.
setRemark
(
"区经/未配置主门店"
);
}
else
{
}
else
{
log
.
setRemark
(
"关联导购数据查不到"
);
StaffClerkRelationDTO
clerk
=
this
.
staffClerkRelationService
.
getOneBindByStoreId
(
staffId
,
logger
.
info
(
"导购关联数据不存在,staffid={},storeid={}"
,
staffId
,
mainStore
.
getStoreId
());
mainStore
.
getStoreId
());
if
(
null
!=
clerk
)
{
log
.
setClerkId
(
clerk
.
getClerkId
());
log
.
setStoreId
(
mainStore
.
getStoreId
());
}
else
{
log
.
setRemark
(
"无关联导购"
);
logger
.
info
(
"导购关联数据不存在,staffid={},storeid={}"
,
staffId
,
mainStore
.
getStoreId
());
}
}
}
logList
.
add
(
log
);
}
}
this
.
groupChatPlanOwnerLogMapper
.
insert
(
log
);
this
.
groupChatPlanOwnerLogMapper
.
batchInsert
(
logList
);
return
EntityUtil
.
changeEntityByJSON
(
GroupChatPlanOwnerLogDTO
.
class
,
log
)
;
}
@Override
public
void
update
(
TabGroupChatPlanOwnerLog
entity
)
{
this
.
groupChatPlanOwnerLogMapper
.
update
(
entity
);
}
}
@Override
@Override
...
@@ -141,6 +161,11 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
...
@@ -141,6 +161,11 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
List
<
TabGroupChatPlanOwnerLog
>
list
=
this
.
groupChatPlanOwnerLogMapper
.
listForTimer
();
List
<
TabGroupChatPlanOwnerLog
>
list
=
this
.
groupChatPlanOwnerLogMapper
.
listForTimer
();
return
list
;
return
list
;
}
}
@Override
public
void
deleteByStaffIds
(
Long
planId
,
List
<
String
>
staffIdList
)
{
this
.
groupChatPlanOwnerLogMapper
.
deleteByStaffIds
(
planId
,
staffIdList
);
}
@Override
@Override
public
Page
<
ChatOwnerTotalDTO
>
listOwnerLogPageForWxaTotal
(
GroupChatPlanSearchQDTO
qdto
,
public
Page
<
ChatOwnerTotalDTO
>
listOwnerLogPageForWxaTotal
(
GroupChatPlanSearchQDTO
qdto
,
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/chat/impl/GroupChatPlanServiceImpl.java
View file @
95cf3b49
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
chat
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
chat
.
impl
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -37,11 +38,9 @@ import com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO;
...
@@ -37,11 +38,9 @@ import com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO;
import
com.gic.haoban.manage.api.enums.PendingTaskTypeEnum
;
import
com.gic.haoban.manage.api.enums.PendingTaskTypeEnum
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.dao.mapper.chat.GroupChatOwnerMapper
;
import
com.gic.haoban.manage.service.dao.mapper.chat.GroupChatPlanLogMapper
;
import
com.gic.haoban.manage.service.dao.mapper.chat.GroupChatPlanLogMapper
;
import
com.gic.haoban.manage.service.dao.mapper.chat.GroupChatPlanMapper
;
import
com.gic.haoban.manage.service.dao.mapper.chat.GroupChatPlanMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatOwner
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatPlan
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatPlan
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanLog
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanLog
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanOwnerLog
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanOwnerLog
;
...
@@ -91,8 +90,6 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
...
@@ -91,8 +90,6 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
@Autowired
@Autowired
private
QuartzService
quartzService
;
private
QuartzService
quartzService
;
@Autowired
@Autowired
private
GroupChatOwnerMapper
groupChatOwnerMapper
;
@Autowired
private
PendingTaskService
pendingTaskService
;
private
PendingTaskService
pendingTaskService
;
private
static
GicMQClient
mqClient
=
GICMQClientUtil
.
getClientInstance
();
private
static
GicMQClient
mqClient
=
GICMQClientUtil
.
getClientInstance
();
...
@@ -118,6 +115,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
...
@@ -118,6 +115,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
entity
.
setSendTime
(
new
Date
());
entity
.
setSendTime
(
new
Date
());
}
}
this
.
groupChatPlanMapper
.
insert
(
entity
);
this
.
groupChatPlanMapper
.
insert
(
entity
);
this
.
groupChatPlanOwnerLogService
.
batchAdd
(
dto
.
getStaffIdList
(),
entity
);
// 立即发送
// 立即发送
if
(
entity
.
getSendType
()
==
1
)
{
if
(
entity
.
getSendType
()
==
1
)
{
this
.
sendMQ
(
entity
.
getPlanId
());
this
.
sendMQ
(
entity
.
getPlanId
());
...
@@ -126,6 +124,15 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
...
@@ -126,6 +124,15 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
}
}
}
else
{
}
else
{
this
.
groupChatPlanMapper
.
updateById
(
entity
);
this
.
groupChatPlanMapper
.
updateById
(
entity
);
if
(
StringUtils
.
isNotBlank
(
dto
.
getDelStaffIdList
()))
{
String
arr
=
dto
.
getDelStaffIdList
();
List
<
String
>
delStaffIdList
=
Arrays
.
asList
(
arr
);
this
.
groupChatPlanOwnerLogService
.
deleteByStaffIds
(
planId
,
delStaffIdList
);
}
if
(
StringUtils
.
isNoneBlank
(
dto
.
getStaffIdList
()))
{
String
staffIdList
=
dto
.
getStaffIdList
();
this
.
groupChatPlanOwnerLogService
.
batchAdd
(
staffIdList
,
entity
);
}
// 立即发送
// 立即发送
if
(
entity
.
getSendType
()
==
1
)
{
if
(
entity
.
getSendType
()
==
1
)
{
this
.
sendMQ
(
entity
.
getPlanId
());
this
.
sendMQ
(
entity
.
getPlanId
());
...
@@ -164,40 +171,35 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
...
@@ -164,40 +171,35 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
}
}
// 控制重复发送
// 控制重复发送
this
.
groupChatPlanMapper
.
updateSendFlag
(
planId
);
this
.
groupChatPlanMapper
.
updateSendFlag
(
planId
);
String
[]
staffIdList
=
plan
.
getStaffIdList
().
split
(
","
);
String
wxEnterpriseId
=
plan
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
plan
.
getWxEnterpriseId
();
String
enterpriseId
=
plan
.
getEnterpriseId
();
String
chatContent
=
plan
.
getChatContent
();
String
chatContent
=
plan
.
getChatContent
();
JSONArray
jsonArr
=
JSONArray
.
parseArray
(
chatContent
);
JSONArray
jsonArr
=
JSONArray
.
parseArray
(
chatContent
);
List
<
String
>
madidList
=
new
ArrayList
<>();
List
<
String
>
madidList
=
new
ArrayList
<>();
GroupChatPlanSearchQDTO
qdto
=
new
GroupChatPlanSearchQDTO
();
BasePageInfo
basePageInfo
=
new
BasePageInfo
();
Page
<
GroupChatPlanOwnerLogDTO
>
page
=
this
.
groupChatPlanOwnerLogService
.
listPage
(
planId
,
qdto
,
basePageInfo
);
for
(
int
i
=
0
;
i
<
jsonArr
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
jsonArr
.
size
();
i
++)
{
JSONObject
json
=
jsonArr
.
getJSONObject
(
i
);
JSONObject
json
=
jsonArr
.
getJSONObject
(
i
);
madidList
.
add
(
json
.
getString
(
"relation_id"
));
madidList
.
add
(
json
.
getString
(
"relation_id"
));
}
}
for
(
int
i
=
0
;
i
<
staffIdList
.
length
;
i
++)
{
List
<
GroupChatPlanOwnerLogDTO
>
ownerList
=
page
.
getResult
();
String
staffId
=
staffIdList
[
i
];
for
(
GroupChatPlanOwnerLogDTO
dto
:
ownerList
)
{
String
staffId
=
dto
.
getStaffId
();
ServiceResponse
<
String
>
sendResp
=
qywxSendService
.
sendChatMessage
(
wxEnterpriseId
,
staffId
,
madidList
);
ServiceResponse
<
String
>
sendResp
=
qywxSendService
.
sendChatMessage
(
wxEnterpriseId
,
staffId
,
madidList
);
// 群主群数量
TabGroupChatPlanOwnerLog
ownerLog
=
EntityUtil
.
changeEntityByJSON
(
TabGroupChatPlanOwnerLog
.
class
,
dto
);
TabGroupChatOwner
owner
=
this
.
groupChatOwnerMapper
.
selectByStaffId
(
staffId
);
GroupChatPlanOwnerLogDTO
ownerDTO
=
new
GroupChatPlanOwnerLogDTO
();
if
(
sendResp
.
isSuccess
())
{
if
(
sendResp
.
isSuccess
())
{
String
msgid
=
sendResp
.
getResult
();
String
msgid
=
sendResp
.
getResult
();
owner
DTO
.
setMsgid
(
msgid
);
owner
Log
.
setMsgid
(
msgid
);
owner
DTO
.
setSendStatus
(
1
);
owner
Log
.
setSendStatus
(
2
);
}
else
{
}
else
{
owner
DTO
.
setRemark
(
sendResp
.
getMessage
());
owner
Log
.
setRemark
(
sendResp
.
getMessage
());
owner
DTO
.
setSendStatus
(
0
);
owner
Log
.
setSendStatus
(
0
);
}
}
ownerDTO
.
setExpireDate
(
DateUtil
.
addDay
(
new
Date
(),
plan
.
getExpireDays
()));
ownerLog
.
setExpireDate
(
DateUtil
.
addDay
(
new
Date
(),
plan
.
getExpireDays
()));
ownerDTO
.
setTotalCount
(
owner
.
getChatCount
());
this
.
groupChatPlanOwnerLogService
.
update
(
ownerLog
);
ownerDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
ownerDTO
.
setEnterpriseId
(
enterpriseId
);
ownerDTO
.
setStaffId
(
staffId
);
ownerDTO
.
setPlanId
(
planId
);
ownerDTO
=
this
.
groupChatPlanOwnerLogService
.
save
(
ownerDTO
);
// 代办
// 代办
if
(
StringUtils
.
isNotBlank
(
owner
DTO
.
getClerkId
()))
{
if
(
StringUtils
.
isNotBlank
(
owner
Log
.
getClerkId
()))
{
this
.
savePendTask
(
ownerDTO
,
plan
);
this
.
savePendTask
(
dto
,
plan
);
}
}
}
}
}
}
...
...
haoban-manage3-service/src/main/resources/mapper/chat/GroupChatPlanMapper.xml
View file @
95cf3b49
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
<result
column=
"start_time"
property=
"startTime"
/>
<result
column=
"start_time"
property=
"startTime"
/>
<result
column=
"end_time"
property=
"endTime"
/>
<result
column=
"end_time"
property=
"endTime"
/>
<result
column=
"expire_days"
property=
"expireDays"
/>
<result
column=
"expire_days"
property=
"expireDays"
/>
<result
column=
"staff_id_list"
property=
"staffIdList"
/>
<result
column=
"staff_count"
property=
"staffCount"
/>
<result
column=
"staff_count"
property=
"staffCount"
/>
<result
column=
"send_count"
property=
"sendCount"
/>
<result
column=
"send_count"
property=
"sendCount"
/>
<result
column=
"success_chat_count"
property=
"successChatCount"
/>
<result
column=
"success_chat_count"
property=
"successChatCount"
/>
...
@@ -46,7 +45,6 @@
...
@@ -46,7 +45,6 @@
start_time,
start_time,
end_time,
end_time,
expire_days,
expire_days,
staff_id_list,
staff_count,
staff_count,
send_count,
send_count,
success_chat_count,
success_chat_count,
...
@@ -74,7 +72,6 @@
...
@@ -74,7 +72,6 @@
start_time,
start_time,
end_time,
end_time,
expire_days,
expire_days,
staff_id_list,
staff_count,
staff_count,
send_count,
send_count,
success_chat_count,
success_chat_count,
...
@@ -96,7 +93,6 @@
...
@@ -96,7 +93,6 @@
#{startTime},
#{startTime},
#{endTime},
#{endTime},
#{expireDays},
#{expireDays},
#{staffIdList},
#{staffCount},
#{staffCount},
#{sendCount},
#{sendCount},
#{successChatCount},
#{successChatCount},
...
@@ -137,8 +133,7 @@
...
@@ -137,8 +133,7 @@
send_time=#{sendTime},
send_time=#{sendTime},
start_time=#{startTime},
start_time=#{startTime},
end_time=#{endTime},
end_time=#{endTime},
expire_days=#{expireDays},
expire_days=#{expireDays}
staff_id_list=#{staffIdList}
where plan_id = #{planId}
where plan_id = #{planId}
]]>
]]>
</update>
</update>
...
...
haoban-manage3-service/src/main/resources/mapper/chat/GroupChatPlanOwnerLogMapper.xml
View file @
95cf3b49
...
@@ -55,20 +55,79 @@
...
@@ -55,20 +55,79 @@
)VALUES(
)VALUES(
#{ownerLogId,jdbcType=BIGINT},
#{ownerLogId,jdbcType=BIGINT},
#{planId,jdbcType=BIGINT},
#{planId,jdbcType=BIGINT},
#{wxEnterpriseId
,jdbcType=CHAR
},
#{wxEnterpriseId},
#{enterpriseId
,jdbcType=CHAR
},
#{enterpriseId},
#{staffId
,jdbcType=CHAR
},
#{staffId},
#{storeId
,jdbcType=CHAR
},
#{storeId},
#{clerkId
,jdbcType=CHAR
},
#{clerkId},
#{sendStatus
,jdbcType=INTEGER
},
#{sendStatus},
#{totalCount
,jdbcType=INTEGER
},
#{totalCount},
#{sendCount
,jdbcType=INTEGER
},
#{sendCount},
#{createTime
,jdbcType=TIMESTAMP
},
#{createTime},
#{updateTime
,jdbcType=TIMESTAMP
} , #{remark} , #{msgid} , 0 , 0 , #{expireDate}
#{updateTime} , #{remark} , #{msgid} , 0 , 0 , #{expireDate}
)
)
]]>
]]>
</insert>
</insert>
<insert
id=
"batchInsert"
>
INSERT INTO tab_haoban_group_chat_plan_owner_log(
owner_log_id,
plan_id,
wx_enterprise_id,
enterprise_id,
staff_id,
store_id,
clerk_id,
send_status,
total_count,
send_count,
create_time,
update_time , remark , msgid , delete_flag , done_flag , expire_date
)VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
( #{item.ownerLogId,jdbcType=BIGINT},
#{item.planId,jdbcType=BIGINT},
#{item.wxEnterpriseId},
#{item.enterpriseId},
#{item.staffId},
#{item.storeId},
#{item.clerkId},
#{item.sendStatus},
#{item.totalCount},
#{item.sendCount},
#{item.createTime},
#{item.updateTime} , #{item.remark} , #{item.msgid} , 0 , 0 , #{item.expireDate}
)
</foreach>
</insert>
<update
id=
"update"
parameterType=
"com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanOwnerLog"
>
<![CDATA[
UPDATE tab_haoban_group_chat_plan_owner_log SET
store_id=#{storeId},
clerk_id=#{clerkId},
send_status=#{sendStatus},
total_count=#{totalCount},
fail_count=#{failCount},
send_count=#{sendCount},
update_time=now(),
remark=#{remark},
msgid=#{msgid},
done_flag=#{doneFlag},
send_time=#{sendTime},
expire_date=#{expireDate}
owner_log_id = #{ownerLogId}
]]>
</update>
<update
id=
"deleteByStaffIds"
>
update tab_haoban_group_chat_plan_owner_log set delete_flag = 1 , update_time =now() where plan_id=#{planId}
and staff_id in
<foreach
collection=
"staffIdList"
close=
")"
open=
"("
separator=
","
item=
"id"
>
#{id}
</foreach>
</update>
<!-- ==================更新 ========== -->
<!-- ==================更新 ========== -->
<update
id=
"updateSendCount"
>
<update
id=
"updateSendCount"
>
<![CDATA[
<![CDATA[
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/chat/GroupChatController.java
View file @
95cf3b49
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
chat
;
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
.
chat
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.BasePageInfo
;
import
com.gic.api.base.commons.BasePageInfo
;
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.commons.webapi.reponse.RestResponse
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.common.utils.AuthWebRequestUtil
;
import
com.gic.haoban.manage.api.dto.MaterialDTO
;
import
com.gic.haoban.manage.api.dto.chat.GroupChatDTO
;
import
com.gic.haoban.manage.api.dto.chat.GroupChatDTO
;
import
com.gic.haoban.manage.api.dto.chat.GroupChatOwnerDTO
;
import
com.gic.haoban.manage.api.dto.chat.GroupChatOwnerDTO
;
import
com.gic.haoban.manage.api.dto.chat.GroupChatOwnerHistoryDTO
;
import
com.gic.haoban.manage.api.dto.chat.GroupChatOwnerHistoryDTO
;
...
@@ -26,7 +20,6 @@ import com.gic.haoban.manage.api.dto.chat.GroupChatUserDTO;
...
@@ -26,7 +20,6 @@ import com.gic.haoban.manage.api.dto.chat.GroupChatUserDTO;
import
com.gic.haoban.manage.api.dto.qdto.chat.GroupChatSearchQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.chat.GroupChatSearchQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.chat.GroupChatUserSearchQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.chat.GroupChatUserSearchQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.chat.OwnerSearchQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.chat.OwnerSearchQDTO
;
import
com.gic.haoban.manage.api.service.MaterialApiService
;
import
com.gic.haoban.manage.api.service.chat.GroupChatApiService
;
import
com.gic.haoban.manage.api.service.chat.GroupChatApiService
;
/**
/**
...
@@ -43,8 +36,6 @@ public class GroupChatController {
...
@@ -43,8 +36,6 @@ public class GroupChatController {
@Autowired
@Autowired
private
GroupChatApiService
groupChatApiService
;
private
GroupChatApiService
groupChatApiService
;
@Autowired
private
MaterialApiService
materialApiService
;
@RequestMapping
(
"get-set-gic-flag"
)
@RequestMapping
(
"get-set-gic-flag"
)
public
RestResponse
<
Object
>
getFlag
()
{
public
RestResponse
<
Object
>
getFlag
()
{
...
...
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