zoujiajian 2 rokov pred
rodič
commit
aa0804b4d8

+ 3 - 1
netflix-dao/src/main/java/com/cyksj/model/entity/CorpFollowActiveCode.java

@@ -19,9 +19,11 @@ import java.util.List;
 @Setter
 public class CorpFollowActiveCode extends BaseEntity{
 
+	private String name;
+
 	@TableField(exist = false)
 	@DbIgnore
-	private List<CorpFollow> followList;
+	private List<String> followIds;
 
 	/**
 	 * 客服

+ 1 - 2
netflix-dao/src/main/java/com/cyksj/model/views/CorpFollowActiveCodeView.java

@@ -1,6 +1,5 @@
 package com.cyksj.model.views;
 
-import com.cyksj.model.entity.CorpFollow;
 import com.cyksj.model.request.corp.Attachments;
 import com.ejlchina.searcher.bean.DbField;
 import com.ejlchina.searcher.bean.DbIgnore;
@@ -33,7 +32,7 @@ public class CorpFollowActiveCodeView {
 	private String followStr;
 
 	@DbIgnore
-	private List<CorpFollow> followList;
+	private List<String> followIds;
 
 	/**
 	 * 欢迎语内容 文本、附件

+ 1 - 2
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpEventActionServiceImpl.java

@@ -449,8 +449,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
 					}
 				}
 				try {
-					List<CorpFollow> corpFollows = Jsons.parseList(corpFollowActiveCode.getFollowStr(), CorpFollow.class);
-					List<String> followIds = corpFollows.stream().map(CorpFollow::getUserid).collect(Collectors.toList());
+					List<String> followIds = Jsons.parseList(corpFollowActiveCode.getFollowStr(), String.class);
 					//对客户进行标记
 					markAddUserTag(corpFollowActiveCode.getMarkTag(), message.getToUserName(), corpUserInfo.getExternalUserId(), followIds, followedUsers);
 				} catch (Exception e) {

+ 1 - 4
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpFollowActiveCodeFrontServiceImpl.java

@@ -12,7 +12,6 @@ import com.cyksj.mapper.corp.CorpFollowActiveCodeClickRecordMapper;
 import com.cyksj.mapper.corp.CorpFollowActiveCodeMapper;
 import com.cyksj.mapper.corp.CorpFollowDutyRelateMapper;
 import com.cyksj.model.dto.CorpFollowActiveCodeDto;
-import com.cyksj.model.entity.CorpFollow;
 import com.cyksj.model.entity.CorpFollowActiveCode;
 import com.cyksj.model.entity.CorpFollowActiveCodeClickRecord;
 import com.cyksj.model.entity.CorpFollowDutyRelate;
@@ -23,7 +22,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  * 项目名: yhlxj
@@ -69,8 +67,7 @@ public class CorpFollowActiveCodeFrontServiceImpl implements CorpFollowActiveCod
 			type = 3;
 		}
 		String followStr = corpFollowActiveCode.getFollowStr();
-		List<CorpFollow> corpFollows = Jsons.parseList(followStr, CorpFollow.class);
-		List<String> followIds = corpFollows.stream().map(CorpFollow::getUserid).collect(Collectors.toList());
+		List<String> followIds = Jsons.parseList(followStr, String.class);
 		String codeStr = corpFollowActiveCode.getCodeStr();
 		List<CorpFollowActiveCodeDto> activeCodeDtos = Jsons.parseList(codeStr, CorpFollowActiveCodeDto.class);
 		if (CollUtil.isEmpty(activeCodeDtos)) {

+ 10 - 17
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpFollowServiceImpl.java

@@ -27,9 +27,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
-import java.util.Map;
 import java.util.Optional;
-import java.util.stream.Collectors;
 
 /**
  * 项目名: yhlxj
@@ -66,12 +64,11 @@ public class CorpFollowServiceImpl implements CorpFollowService {
 			activeCode.setOperator(cmsUser.getNickname());
 		}
 		Boolean isDuty = Optional.ofNullable(activeCode.getIsDuty()).orElse(false);
-		List<CorpFollow> followList = activeCode.getFollowList();
-		if (CollUtil.isEmpty(followList)) {
+		List<String> followIds = activeCode.getFollowIds();
+		if (CollUtil.isEmpty(followIds)) {
 			throw BusinessRuntimeException.getInstance("请选择对应客服");
 		}
-		activeCode.setFollowStr(Jsons.toJson(followList));
-		List<String> followIds = followList.stream().map(CorpFollow::getUserid).collect(Collectors.toList());
+		activeCode.setFollowStr(followIds.toString());
 		activeCode.setMarkTag(activeCode.getMarkTag().trim());
 		String text = activeCode.getText();
 		if (StrUtil.isNotBlank(text) && text.length() > 4000) {
@@ -110,27 +107,23 @@ public class CorpFollowServiceImpl implements CorpFollowService {
 			throw BusinessRuntimeException.getInstance("对应的数据已不存在");
 		}
 		String db_followStr = dbActiveCode.getFollowStr();
-		List<CorpFollow> up_corpFollows = activeCode.getFollowList();
+		List<String> up_corpFollows = activeCode.getFollowIds();
 		if (CollUtil.isEmpty(up_corpFollows)) {
 			throw BusinessRuntimeException.getInstance("请选择对应客服");
 		}
-		activeCode.setFollowStr(Jsons.toJson(up_corpFollows));
+		activeCode.setFollowStr(up_corpFollows.toString());
 		if (StrUtil.isEmpty(activeCode.getMarkTag())) {
 			throw BusinessRuntimeException.getInstance("请输入标签");
 		}
-		List<CorpFollow> db_corpFollows = Jsons.parseList(db_followStr, CorpFollow.class);
+		List<String> db_followIds = Jsons.parseList(db_followStr, String.class);
 		Boolean isReCreateAcCode = false;
 		Boolean isUpdateAcCode = false;
-		List<String> followIds = null;
-		if (db_corpFollows.size() != up_corpFollows.size()) {
+		if (db_followIds.size() != up_corpFollows.size()) {
 			isReCreateAcCode = true;
-			followIds = db_corpFollows.stream().map(CorpFollow::getUserid).collect(Collectors.toList());
 		}
 		if (!isReCreateAcCode) {
-			Map<String, List<CorpFollow>> db_follow_collect = db_corpFollows.stream().collect(Collectors.groupingBy(CorpFollow::getUserid));
-			for (CorpFollow upCorpFollow : up_corpFollows) {
-				List<CorpFollow> corpFollows = db_follow_collect.get(upCorpFollow.getUserid());
-				if (CollUtil.isEmpty(corpFollows)) {
+			for (String upFollowId : up_corpFollows) {
+				if (!db_followIds.contains(upFollowId)) {
 					isReCreateAcCode = true;
 					break;
 				}
@@ -152,7 +145,7 @@ public class CorpFollowServiceImpl implements CorpFollowService {
 
 		//重新构建活码配置
 		if (isReCreateAcCode) {
-			String code_str = corpFollowDynamicConfigService.createCorpFollowActiveCode(followIds, Constant.AC_CODE_KEY + activeCode.getId(), up_isDuty);
+			String code_str = corpFollowDynamicConfigService.createCorpFollowActiveCode(up_corpFollows, Constant.AC_CODE_KEY + activeCode.getId(), up_isDuty);
 			activeCode.setCodeStr(code_str);
 		} else if (isUpdateAcCode) {
 			corpFollowDynamicConfigService.updateCorpFollowActiveCode(dbActiveCode.getMarkTag(), activeCode.getMarkTag());

+ 1 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CmsCorpFollowActiveCodeController.java

@@ -9,7 +9,6 @@ import com.cyksj.enums.GatewayResponse;
 import com.cyksj.mapper.OrderDonMapper;
 import com.cyksj.mapper.corp.CorpUserMapper;
 import com.cyksj.mapper.manage.coupon.CouponMapper;
-import com.cyksj.model.entity.CorpFollow;
 import com.cyksj.model.entity.CorpFollowActiveCode;
 import com.cyksj.model.entity.CorpFollowServiceRelate;
 import com.cyksj.model.entity.CorpUser;
@@ -120,7 +119,7 @@ public class CmsCorpFollowActiveCodeController {
 			Integer orderNum = orderDonMapper.selectCountActiveCodeOrderByAcId(data.getId());
 			data.setOrderNum(orderNum);
 			try {
-				data.setFollowList(Jsons.parseList(data.getFollowStr(), CorpFollow.class));
+				data.setFollowIds(Jsons.parseList(data.getFollowStr(), String.class));
 				if (StrUtil.isNotBlank(data.getAttachmentsStr())) {
 					data.setAttachments(Jsons.parseList(data.getAttachmentsStr(), Attachments.class));
 				}