zoujiajian 2 gadi atpakaļ
vecāks
revīzija
78d5fd7ea3

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/corp/CorpFollowDynamicConfigService.java

@@ -13,7 +13,7 @@ import java.util.List;
 public interface CorpFollowDynamicConfigService {
 	String corpFollowContactConfig(CorpFollowContact corpFollowContact) throws Exception;
 
-	String createCorpFollowActiveCode(List<String> followIds, String state, Boolean isOne) throws Exception;
+	String createCorpFollowActiveCode(List<String> followIds, String state, Boolean isDuty) throws Exception;
 
 	void updateCorpFollowActiveCode(String oldMarkTag, String markTag) throws Exception;
 }

+ 8 - 6
netflix-service/src/main/java/com/cyksj/service/corp/impl/CorpFollowDynamicConfigServiceImpl.java

@@ -60,12 +60,14 @@ public class CorpFollowDynamicConfigServiceImpl implements CorpFollowDynamicConf
 	}
 
 	@Override
-	public String createCorpFollowActiveCode(List<String> followIds, String state, Boolean isOne) throws Exception {
+	public String createCorpFollowActiveCode(List<String> followIds, String state, Boolean isDuty) throws Exception {
 		List<CorpFollowActiveCodeDto> codeList = new ArrayList<>();
-		if (isOne) {
-			Integer type = 2;
-			if (followIds.size() == 1) {
-				type = 1;
+		Integer type = 1;
+		if (!isDuty) {
+			//不是值班 多人生成一个二维码
+			//联系方式类型 2-多人
+			if (followIds.size() > 1) {
+				type = 2;
 			}
 			String serviceNames = corpFollowDutyRelateMapper.selectList(Wrappers.lambdaQuery(CorpFollowDutyRelate.class)
 					.in(CorpFollowDutyRelate::getFollowId, followIds)).stream().map(CorpFollowDutyRelate::getServiceName).collect(Collectors.joining(","));
@@ -81,7 +83,7 @@ public class CorpFollowDynamicConfigServiceImpl implements CorpFollowDynamicConf
 				throw BusinessRuntimeException.getInstance("存在被删除的客服,请刷新页面重试");
 			}
 			for (String followId : followIds) {
-				CorpFollowActiveCodeDto corpFollowActiveCodeDto = createCorpFollowActiveCode(List.of(followId), state, 1, collect.get(followId).get(0).getServiceName());
+				CorpFollowActiveCodeDto corpFollowActiveCodeDto = createCorpFollowActiveCode(List.of(followId), state, type, collect.get(followId).get(0).getServiceName());
 				codeList.add(corpFollowActiveCodeDto);
 			}
 		}

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

@@ -91,9 +91,9 @@ public class CorpFollowServiceImpl implements CorpFollowService {
 		}
 		if (!isDuty) {
 			//生成一个活码 一个客服或多个客服
-			codeStr = corpFollowDynamicConfigService.createCorpFollowActiveCode(followIds, Constant.AC_CODE_KEY + activeCode.getId(), true);
+			codeStr = corpFollowDynamicConfigService.createCorpFollowActiveCode(followIds, Constant.AC_CODE_KEY + activeCode.getId(), isDuty);
 		} else {
-			codeStr = corpFollowDynamicConfigService.createCorpFollowActiveCode(followIds, Constant.AC_CODE_KEY + activeCode.getId(), false);
+			codeStr = corpFollowDynamicConfigService.createCorpFollowActiveCode(followIds, Constant.AC_CODE_KEY + activeCode.getId(), isDuty);
 		}
 		activeCode.setCodeStr(codeStr);
 		corpFollowActiveCodeMapper.updateById(activeCode);