Commit aa9d1a27 by 王祖波

规则入群结构调整

parent 45e39718
......@@ -75,7 +75,7 @@ public class GroupChatActivityBaseDTO implements Serializable {
*/
private Integer joinType;
/**
* 入群规则 1邀请人所在企微群2服务门店3协管门店4LBS定位 逗号分隔
* 入群规则 1邀请人所在企微群2服务门店3协管门店4LBS定位 [{"openFlag":0,"val":1},{"openFlag":0,"val":2},{"openFlag":0,"val":3},{"openFlag":0,"val":4}]
*/
private String joinRule;
/**
......
......@@ -68,7 +68,7 @@ public class GroupChatActivityQDTO implements Serializable {
*/
private Integer joinType;
/**
* 入群规则 1邀请人所在企微群2服务门店3协管门店4LBS定位 逗号分隔
* 入群规则 1邀请人所在企微群2服务门店3协管门店4LBS定位 [{"openFlag":0,"val":1},{"openFlag":0,"val":2},{"openFlag":0,"val":3},{"openFlag":0,"val":4}]
*/
private String joinRule;
/**
......
......@@ -2,9 +2,11 @@ package com.gic.haoban.manage.service.context.chat;
import cn.hutool.core.map.MapUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.BusinessException;
import com.gic.api.base.commons.Constant;
import com.gic.api.base.commons.Page;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
......@@ -102,9 +104,15 @@ public class JoinRuleManager {
Integer joinType = chatActivity.getJoinType();
if (Objects.equals(ChatActivityJoinEnum.RULE.value, joinType)) {
String joinRule = chatActivity.getJoinRule();
for (String ruleStr : joinRule.split(",")) {
Integer rule = Integer.parseInt(ruleStr);
ChatActivityJoinRuleEnum ruleEnum = ChatActivityJoinRuleEnum.getByValue(rule);
List<JSONObject> joinRuleList = JSONArray.parseArray(joinRule, JSONObject.class);
for (JSONObject jsonObject : joinRuleList) {
//是否开启
Integer openFlag = jsonObject.getInteger("openFlag");
Integer val = jsonObject.getInteger("val");
if (!Objects.equals(openFlag, Constant.FLAG_TRUE)) {
continue;
}
ChatActivityJoinRuleEnum ruleEnum = ChatActivityJoinRuleEnum.getByValue(val);
List<GroupChatHmBO> hmBOList = applyJoinRule(ruleEnum, activityHmQDTO);
if (CollectionUtils.isNotEmpty(hmBOList)) {
return hmBOList;
......
......@@ -68,7 +68,7 @@ public class TabGroupChatActivity implements Serializable {
*/
private Integer joinType;
/**
* 入群规则 1邀请人所在企微群2服务门店3协管门店4LBS定位 逗号分隔
* 入群规则 1邀请人所在企微群2服务门店3协管门店4LBS定位 [{"openFlag":0,"val":1},{"openFlag":0,"val":2},{"openFlag":0,"val":3},{"openFlag":0,"val":4}]
*/
private String joinRule;
/**
......
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