Commit a92f25bc by 徐高华

Merge branch 'feature/社群' into 'developer'

Feature/社群

See merge request !740
parents fc0e95fc d88d2cb1
...@@ -56,25 +56,26 @@ public interface GroupChatApiService { ...@@ -56,25 +56,26 @@ public interface GroupChatApiService {
/** /**
* *
* @Title: refreshChatInfo * @Title: refreshChatInfo
* @Description: 刷新群信息 * @Description: 刷新群
* @author xugh * @author xugh
* @param groupChatId * @param groupChatId
* @return * @return
* @throws * @throws
*/ */
public ServiceResponse<Void> refreshChatInfo(Long groupChatId); public ServiceResponse<Void> refreshChatInfoFromMQ(String params);
/** /**
* *
* @Title: refreshChatInfo * @Title: refreshChatStatus
* @Description: 刷新群信息,从队列获取 * @Description: 刷新群的状态
* @author xugh * @author xugh
* @param groupChatId * @param params
* @return * @return
* @throws * @throws
*/ */
public ServiceResponse<Void> refreshChatInfoFromMQ(String params); public ServiceResponse<Void> refreshChatStatusFromMQ(String params) ;
/** /**
* *
* @Title: updateChatEnterpriseId * @Title: updateChatEnterpriseId
......
...@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.dao.mapper.chat; ...@@ -2,6 +2,8 @@ package com.gic.haoban.manage.service.dao.mapper.chat;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.api.dto.chat.GroupChatPlanLogDTO; import com.gic.haoban.manage.api.dto.chat.GroupChatPlanLogDTO;
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.TabGroupChatPlanLog; import com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanLog;
...@@ -17,7 +19,7 @@ import com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanLog; ...@@ -17,7 +19,7 @@ import com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanLog;
*/ */
public interface GroupChatPlanLogMapper { public interface GroupChatPlanLogMapper {
public int insert(TabGroupChatPlanLog entity); public int batchInsert(@Param("list") List<TabGroupChatPlanLog> list);
public List<GroupChatPlanLogDTO> listPlanLog(GroupChatPlanSearchQDTO qdto); public List<GroupChatPlanLogDTO> listPlanLog(GroupChatPlanSearchQDTO qdto);
} }
\ No newline at end of file
...@@ -21,6 +21,8 @@ public interface GroupChatUserMapper { ...@@ -21,6 +21,8 @@ public interface GroupChatUserMapper {
public int insert(TabGroupChatUser tabHaobanGroupChatUser); public int insert(TabGroupChatUser tabHaobanGroupChatUser);
public int batchInsert(@Param("list")List<TabGroupChatUser> userList);
public int dismiss(@Param("idList") List<Long> chatUserIdList, @Param("ownerId") String ownerId); public int dismiss(@Param("idList") List<Long> chatUserIdList, @Param("ownerId") String ownerId);
public int update(TabGroupChatUser tabHaobanGroupChatUser); public int update(TabGroupChatUser tabHaobanGroupChatUser);
......
...@@ -23,7 +23,7 @@ public class TabGroupChatPlanOwnerLog implements Serializable { ...@@ -23,7 +23,7 @@ public class TabGroupChatPlanOwnerLog implements Serializable {
private String staffId; private String staffId;
private String storeId; private String storeId;
private String clerkId; private String clerkId;
/**1已发送 0待发送*/ /**0任务创建失败 1待发送 2已发送*/
private Integer sendStatus; private Integer sendStatus;
private Integer failCount; private Integer failCount;
private Integer sendCount; private Integer sendCount;
......
...@@ -39,7 +39,17 @@ public interface GroupChatService { ...@@ -39,7 +39,17 @@ public interface GroupChatService {
* @param chatHmId * @param chatHmId
* @throws * @throws
*/ */
public void refreshChatInfo(Long chatHmId); public void refreshChatInfo(Long groupChatId);
/**
*
* @Title: refreshChatStatus
* @Description: 刷新群的状态
* @author xugh
* @param groupChatId
* @throws
*/
public void refreshChatStatus(Long groupChatId);
/** /**
* *
......
...@@ -111,6 +111,9 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe ...@@ -111,6 +111,9 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
@Override @Override
public void batchAdd(String staffIdList, TabGroupChatPlan entity) { public void batchAdd(String staffIdList, TabGroupChatPlan entity) {
if (StringUtils.isBlank(staffIdList)) {
return;
}
String[] arr = staffIdList.split(","); String[] arr = staffIdList.split(",");
List<TabGroupChatPlanOwnerLog> logList = new ArrayList<>(); List<TabGroupChatPlanOwnerLog> logList = new ArrayList<>();
for (int i = 0; i < arr.length; i++) { for (int i = 0; i < arr.length; i++) {
...@@ -132,7 +135,7 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe ...@@ -132,7 +135,7 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
@Override @Override
public void update(TabGroupChatPlanOwnerLog entity) { public void update(TabGroupChatPlanOwnerLog entity) {
String staffId = entity.getStaffId() ; String staffId = entity.getStaffId();
TabHaobanClerkMainStoreRelated mainStore = this.clerkMainStoreRelatedService.getMainStoreByStaffId(staffId, TabHaobanClerkMainStoreRelated mainStore = this.clerkMainStoreRelatedService.getMainStoreByStaffId(staffId,
entity.getWxEnterpriseId()); entity.getWxEnterpriseId());
if (null == mainStore) { if (null == mainStore) {
...@@ -159,8 +162,14 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe ...@@ -159,8 +162,14 @@ public class GroupChatPlanOwnerLogServiceImpl implements GroupChatPlanOwnerLogSe
@Override @Override
public void deleteByStaffIds(Long planId, String delStaffIds) { public void deleteByStaffIds(Long planId, String delStaffIds) {
if (StringUtils.isBlank(delStaffIds)) {
return;
}
String[] arr = delStaffIds.split(","); String[] arr = delStaffIds.split(",");
List<String> delStaffIdList = Arrays.asList(arr); List<String> delStaffIdList = Arrays.asList(arr);
if (CollectionUtils.isEmpty(delStaffIdList)) {
return;
}
this.groupChatPlanOwnerLogMapper.deleteByStaffIds(planId, delStaffIdList); this.groupChatPlanOwnerLogMapper.deleteByStaffIds(planId, delStaffIdList);
} }
......
...@@ -165,12 +165,6 @@ public class GroupChatApiServiceImpl implements GroupChatApiService { ...@@ -165,12 +165,6 @@ public class GroupChatApiServiceImpl implements GroupChatApiService {
} }
@Override @Override
public ServiceResponse<Void> refreshChatInfo(Long chatHmId) {
this.groupChatService.refreshChatInfo(chatHmId);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> updateChatEnterpriseId(String wxEnterpriseId, String enterpriseId, public ServiceResponse<Void> updateChatEnterpriseId(String wxEnterpriseId, String enterpriseId,
List<Long> groupChatIdList) { List<Long> groupChatIdList) {
this.groupChatService.updateChatEnterpriseId(wxEnterpriseId, enterpriseId, groupChatIdList); this.groupChatService.updateChatEnterpriseId(wxEnterpriseId, enterpriseId, groupChatIdList);
...@@ -232,7 +226,17 @@ public class GroupChatApiServiceImpl implements GroupChatApiService { ...@@ -232,7 +226,17 @@ public class GroupChatApiServiceImpl implements GroupChatApiService {
JSONObject json = JSONObject.parseObject(params); JSONObject json = JSONObject.parseObject(params);
List<Long> arr = JSONObject.parseArray(json.getString("groupChatIdList"), Long.class); List<Long> arr = JSONObject.parseArray(json.getString("groupChatIdList"), Long.class);
for (Long id : arr) { for (Long id : arr) {
this.refreshChatInfo(id); this.groupChatService.refreshChatInfo(id);
}
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> refreshChatStatusFromMQ(String params) {
JSONObject json = JSONObject.parseObject(params);
List<Long> arr = JSONObject.parseArray(json.getString("groupChatIdList"), Long.class);
for (Long id : arr) {
this.groupChatService.refreshChatStatus(id);
} }
return ServiceResponse.success(); return ServiceResponse.success();
} }
......
...@@ -756,10 +756,6 @@ ...@@ -756,10 +756,6 @@
</update> </update>
<select id="getMemberForExternalId" resultMap="BaseResultMap"> <select id="getMemberForExternalId" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from tab_haoban_external_clerk_related where wx_enterprise_id = #{wxEnterpriseId}
and self_external_userid = #{externalUserId} and status_flag in (1,3,4) and member_id <![CDATA[ <> '']]>
union
select <include refid="Base_Column_List"/> select <include refid="Base_Column_List"/>
from tab_haoban_external_clerk_related where wx_enterprise_id = #{wxEnterpriseId} from tab_haoban_external_clerk_related where wx_enterprise_id = #{wxEnterpriseId}
and external_user_id = #{externalUserId} and status_flag in (1,3,4) and member_id <![CDATA[ <> '' ]]> and external_user_id = #{externalUserId} and status_flag in (1,3,4) and member_id <![CDATA[ <> '' ]]>
......
...@@ -32,38 +32,43 @@ ...@@ -32,38 +32,43 @@
</sql> </sql>
<!-- ===================== 新增 ======================== --> <!-- ===================== 新增 ======================== -->
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.chat.TabGroupChatPlanLog"> <insert id="batchInsert">
<![CDATA[ INSERT INTO tab_haoban_group_chat_plan_log(
INSERT INTO tab_haoban_group_chat_plan_log( log_id,
log_id, plan_id,
plan_id, wx_enterprise_id,
wx_enterprise_id, enterprise_id,
enterprise_id, group_chat_id,
group_chat_id, send_status,
send_status, own_log_id,
own_log_id, remark,
remark, send_time,
send_time, delete_flag,
delete_flag, create_time,
create_time, update_time , staff_id
update_time , staff_id )VALUES
)VALUES( <foreach collection="list" item="item" separator="," >
#{logId}, (
#{planId}, #{item.logId},
#{wxEnterpriseId}, #{item.planId},
#{enterpriseId} , #{item.wxEnterpriseId},
#{groupChatId}, #{item.enterpriseId} ,
#{sendStatus}, #{item.groupChatId},
#{ownLogId}, #{item.sendStatus},
#{remark}, #{item.ownLogId},
#{sendTime}, #{item.remark},
0, #{item.sendTime},
now(), 0,
now() ,#{staffId} now(),
) now() ,
]]> #{item.staffId}
)
</foreach>
</insert> </insert>
<select id="listPlanLog" parameterType="com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO" resultType="com.gic.haoban.manage.api.dto.chat.GroupChatPlanLogDTO"> <select id="listPlanLog" parameterType="com.gic.haoban.manage.api.dto.qdto.chat.GroupChatPlanSearchQDTO" resultType="com.gic.haoban.manage.api.dto.chat.GroupChatPlanLogDTO">
SELECT b.clerk_id clerkId , SELECT b.clerk_id clerkId ,
b.store_id storeId , b.store_id storeId ,
......
...@@ -103,8 +103,60 @@ ...@@ -103,8 +103,60 @@
) )
]]> ]]>
</insert> </insert>
<insert id="batchInsert">
INSERT INTO tab_haoban_group_chat_user(
chat_user_id,
wx_enterprise_id,
enterprise_id,
user_type,
join_time,
user_name,
nick_name,
user_id,
unionid,
member_id,
invitor_user_id,
create_time,
update_time,
delete_flag,
group_chat_id,
status_flag,
user_quit_time,
quit_scene,
join_scene,
join_remark,
join_state , invitor_user_name , admin_flag
)VALUES
<foreach collection="list" item="item" separator="," >
( #{item.chatUserId},
#{item.wxEnterpriseId},
#{item.enterpriseId},
#{item.userType},
#{item.joinTime},
#{item.userName},
#{item.nickName},
#{item.userId},
#{item.unionid},
#{item.memberId},
#{item.invitorUserId},
#{item.createTime},
#{item.updateTime},
#{item.deleteFlag},
#{item.groupChatId},
#{item.statusFlag},
#{item.userQuitTime},
#{item.quitScene},
#{item.joinScene},
#{item.joinRemark},
#{item.joinState} , #{item.invitorUserName} , #{item.adminFlag}
)
</foreach>
</insert>
<!-- =====================删除==================== --> <!-- =====================废弃群==================== -->
<update id="dismiss"> <update id="dismiss">
UPDATE tab_haoban_group_chat_user SET status_flag = 2 , update_time=now() , user_quit_time = now() , quit_scene = 0 , quit_staff_id = #{ownerId} WHERE chat_user_id in UPDATE tab_haoban_group_chat_user SET status_flag = 2 , update_time=now() , user_quit_time = now() , quit_scene = 0 , quit_staff_id = #{ownerId} WHERE chat_user_id in
<foreach collection="idList" close=")" open="(" index="index" item="id" separator=","> <foreach collection="idList" close=")" open="(" index="index" item="id" separator=",">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment