Commit 1997c3c2 by 徐高华

parent 73b6d9e4
......@@ -66,7 +66,7 @@ public class GroupChatDTO implements Serializable {
// 群主所有群能加到活码标识1可以0不可以
private int ownerAddFlag = 1;
// 活码加人状态1正常 2已满不可以加人>200
private int hmAddStatus ;
private int hmAddStatus = 1 ;
private String chatRemark ;
private int initFlag ;
......
......@@ -632,6 +632,7 @@ public class GroupChatServiceImpl implements GroupChatService {
List<GroupChatDetailMemberDTO> qwUserList = detail.getMember_list();
// 当前群列表
List<TabGroupChatUser> nowUserList = this.groupChatUserMapper.listAllChatUser(wxEnterpriseId, groupChatId);
int nowTotalCount = nowUserList.size();
Map<String, TabGroupChatUser> nowUserMap = nowUserList.stream()
.collect(Collectors.toMap(TabGroupChatUser::getUserId, o -> o, ((k1, k2) -> k1)));
List<TabGroupChatUser> needAddUserList = new ArrayList<>();
......@@ -660,7 +661,7 @@ public class GroupChatServiceImpl implements GroupChatService {
for (TabGroupChatUser user : nowUserList) {
if (!nowQwUserIdList.contains(user.getUserId())) {
deleteIdList.add(user.getChatUserId());
deleteUserIdList.add(user.getUserId()) ;
deleteUserIdList.add(user.getUserId());
}
}
// 总成员数
......@@ -681,7 +682,8 @@ public class GroupChatServiceImpl implements GroupChatService {
}
}
}
if (totalCount >= offNum && null == chat.getOffTime()) {
logger.info("群成员数,当前={},更新后={}", nowTotalCount, totalCount);
if (totalCount >= offNum && nowTotalCount < offNum) {
logger.info("群满下线处理,chatid={}", chat.getWxChatId());
this.chatOff(chat);
}
......
......@@ -27,7 +27,6 @@
<result column="wx_chat_id_dk" property="wxChatIdDk" />
<result column="off_time" property="offTime"/>
<result column="original_staff_id" property="originalStaffId"/>
<result column="hm_add_status" property="hmAddStatus"/>
<result column="chat_remark" property="chatRemark"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -50,7 +49,7 @@
quit_count,
quit_member_count,
enterprise_id,
gic_flag , init_flag , wx_chat_id_dk , off_time, original_staff_id , hm_add_status , chat_remark
gic_flag , init_flag , wx_chat_id_dk , off_time, original_staff_id , chat_remark
</sql>
<!-- ===================== 新增 ======================== -->
<insert id="insert"
......@@ -76,7 +75,7 @@
quit_count,
quit_member_count,
enterprise_id,
gic_flag , init_flag , original_staff_id , hm_add_status
gic_flag , init_flag , original_staff_id
)VALUES(
#{groupChatId},
#{wxEnterpriseId},
......@@ -97,7 +96,7 @@
#{quitCount},
#{quitMemberCount},
#{enterpriseId},
#{gicFlag} , #{initFlag} , #{originalStaffId} , 1
#{gicFlag} , #{initFlag} , #{originalStaffId}
)
]]>
</insert>
......@@ -160,7 +159,7 @@
</update>
<update id="chatOff">
update tab_haoban_group_chat set hm_add_status = 2 , off_time = now() , update_time =now() where group_chat_id = #{groupChatId} and total_count >= 200
update tab_haoban_group_chat set off_time = now() , update_time =now() where group_chat_id = #{groupChatId}
</update>
<!-- ============ 查询============= -->
......@@ -258,7 +257,7 @@
a.quit_member_count quitMemberCount ,
a.enterprise_id enterpriseId ,
a.gic_flag gicFlag , a.init_flag initFlag , a.wx_chat_id_dk wxChatIdDk , a.off_time offTime ,
a.original_staff_id originalStaffId , a.hm_add_status hmAddStatus
a.original_staff_id originalStaffId
from tab_haoban_group_chat a left join tab_haoban_staff b on a.staff_id = b.staff_id
<if test="departmentIdList != null and departmentIdList.size() > 0">
left join tab_haoban_staff_department_related depart on a.staff_id = depart.staff_id and depart.status_flag = 1
......
package com.gic.haoban.manage.web.controller.chat;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
......@@ -56,8 +55,6 @@ import com.gic.log.record.anno.GicLogRecord;
import com.gic.log.record.util.GicLogRecordCategoryEnum;
import com.gic.log.record.util.GicLogRecordEvaluationContext;
import com.gic.log.record.util.GicLogRecordOptTypeEnum;
import com.gic.qcloud.BucketNameEnum;
import com.gic.qcloud.FileUploadUtil;
import com.gic.thirdparty.cloudfile.CloudFileUtil;
import com.gic.thirdparty.cloudfile.enums.CloudFileBusinessOptEnum;
import com.gic.thirdparty.cloudfile.enums.CloudFileTypeEnum;
......@@ -387,8 +384,15 @@ public class GroupChatHmController {
qdto.setEnterpriseId(loginUser.getEnterpriseId());
qdto.setChatHmId(chatHmId);
qdto.setIncludeOff(includeOff);
ServiceResponse<Page<GroupChatDTO>> page = this.groupChatApiService.listPage(qdto, basePageInfo);
return RestResponse.successResult(page.getResult());
ServiceResponse<Page<GroupChatDTO>> pageResp = this.groupChatApiService.listPage(qdto, basePageInfo);
Page<GroupChatDTO> page = pageResp.getResult();
List<GroupChatDTO> list = page.getResult();
list.stream().forEach(dto->{
if(dto.getTotalCount()>=200) {
dto.setHmAddStatus(2);
}
});
return RestResponse.successResult(page);
}
@SuppressWarnings("deprecation")
......@@ -464,7 +468,9 @@ public class GroupChatHmController {
} catch (IOException e) {
}
CloudFileTypeEnum cloudFileTypeEnum = CloudFileTypeEnum.OTHER;
CloudFileInfo cloudFileInfo = CloudFileUtil.uploadFile(new FileInputStream(tempFile), "zip", cloudFileTypeEnum,au.getEnterpriseDTO().getFactoryCode(), CloudFileBusinessOptEnum.HAOBAN_COMMON);
CloudFileInfo cloudFileInfo = CloudFileUtil.uploadFile(new FileInputStream(tempFile), "zip",
cloudFileTypeEnum, au.getEnterpriseDTO().getFactoryCode(),
CloudFileBusinessOptEnum.HAOBAN_COMMON);
DownloadReportDTO downloadReportDTO = new DownloadReportDTO();
downloadReportDTO.setDownloadUrl(cloudFileInfo.getOrgFileUrl());
downloadReportService.updateDownloadReport(reportId, downloadReportDTO);
......
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