zyy 2 недель назад
Родитель
Сommit
041c6cb132

+ 2 - 1
fs-service/src/main/java/com/fs/common/service/impl/SmsServiceImpl.java

@@ -15,6 +15,7 @@ import com.fs.common.vo.SmsSendItemVO;
 import com.fs.common.vo.SmsSendVO;
 import com.fs.company.domain.*;
 import com.fs.company.enums.BusinessTypeEnum;
+import com.fs.company.enums.TargetTypeEnum;
 import com.fs.company.param.CompanyVoiceRoboticCallBlacklistCheckParam;
 import com.fs.company.service.ICompanySmsLogsService;
 import com.fs.company.service.ICompanySmsService;
@@ -936,7 +937,7 @@ public class SmsServiceImpl implements ISmsService
         companyVoiceRoboticCallBlacklistCheckParam.setBusinessType(BusinessTypeEnum.SMS.getCode());
         companyVoiceRoboticCallBlacklistCheckParam.setTargetValue(companyUser.getPhonenumber());
         CompanyVoiceRoboticCallBlacklistCheckVO companyVoiceRoboticCallBlacklistCheckVO = companyVoiceRoboticCallBlacklistService.checkBlacklist(companyVoiceRoboticCallBlacklistCheckParam);
-        if (companyVoiceRoboticCallBlacklistCheckVO.getPass()){
+        if (!companyVoiceRoboticCallBlacklistCheckVO.getPass()){
             throw new RuntimeException("黑名单校验未通过");
         }
         for(Long id:param.getCustomerIds()){

+ 3 - 0
fs-service/src/main/java/com/fs/company/domain/CompanyVoiceRoboticCallBlacklist.java

@@ -1,6 +1,7 @@
 package com.fs.company.domain;
 
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.core.domain.BaseEntity;
 import lombok.AllArgsConstructor;
 import lombok.Data;
@@ -63,10 +64,12 @@ public class CompanyVoiceRoboticCallBlacklist extends BaseEntity
 
     private String createBy;
 
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
     private String updateBy;
 
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
 
     /**

+ 79 - 0
fs-service/src/main/java/com/fs/company/enums/TargetTypeEnum.java

@@ -0,0 +1,79 @@
+package com.fs.company.enums;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 对象类型枚举
+ *
+ * @author ZhuanZ
+ */
+public enum TargetTypeEnum {
+
+    /**
+     * 外呼
+     */
+    PHONE("1", "手机号码"),
+
+    /**
+     * 加微
+     */
+    CUSTOMER_ID("2", "用户id");
+
+
+    private final String code;
+    private final String desc;
+
+    TargetTypeEnum(String code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    /**
+     * 根据 code 获取枚举
+     */
+    public static TargetTypeEnum fromCode(String code) {
+        if (code == null) {
+            return null;
+        }
+        for (TargetTypeEnum item : values()) {
+            if (item.code.equalsIgnoreCase(code)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 校验是否为合法业务类型
+     */
+    public static boolean isValid(String code) {
+        return fromCode(code) != null;
+    }
+
+    /**
+     * 获取所有 code 列表
+     */
+    public static List<String> getCodes() {
+        return Arrays.stream(values())
+                .map(TargetTypeEnum::getCode)
+                .collect(Collectors.toList());
+    }
+
+    /**
+     * 判断是否相等(忽略大小写)
+     */
+    public boolean equalsCode(String code) {
+        return this.code.equalsIgnoreCase(code);
+    }
+
+}

+ 1 - 1
fs-service/src/main/java/com/fs/company/service/impl/call/node/AiCallTaskNode.java

@@ -284,7 +284,7 @@ public class AiCallTaskNode extends AbstractWorkflowNode {
         CrmCustomer crmCustomer = crmCustomerService.selectCrmCustomerById(callees.getUserId());
         CompanyVoiceRoboticCallBlacklistCheckParam companyVoiceRoboticCallBlacklistCheckParam = new CompanyVoiceRoboticCallBlacklistCheckParam();
         companyVoiceRoboticCallBlacklistCheckParam.setCompanyId(crmCustomer.getCompanyId());
-        companyVoiceRoboticCallBlacklistCheckParam.setBusinessType(BusinessTypeEnum.SMS.getCode());
+        companyVoiceRoboticCallBlacklistCheckParam.setBusinessType(BusinessTypeEnum.CALL.getCode());
         companyVoiceRoboticCallBlacklistCheckParam.setTargetValue(callees.getPhone());
         CompanyVoiceRoboticCallBlacklistCheckVO companyVoiceRoboticCallBlacklistCheckVO = companyVoiceRoboticCallBlacklistService.checkBlacklist(companyVoiceRoboticCallBlacklistCheckParam);
         if (!companyVoiceRoboticCallBlacklistCheckVO.getPass()){

+ 2 - 0
fs-service/src/main/resources/mapper/company/CompanyVoiceRoboticCallBlacklistMapper.xml

@@ -193,7 +193,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where deleted = 0
         and status = 1
         and company_id is null
+        <if test="targetType != null and targetType != ''">
         and target_type = #{targetType}
+        </if>
         <if test="businessType != null and businessType != ''">
             and business_type = #{businessType}
         </if>