Browse Source

Merge remote-tracking branch 'origin/saas-api' into saas-api

yys 1 month ago
parent
commit
2286d715fe
17 changed files with 455 additions and 61 deletions
  1. 79 0
      fs-admin-saas/src/main/java/com/fs/communication/controller/CallLogController.java
  2. 72 0
      fs-admin-saas/src/main/java/com/fs/communication/controller/SmsLogController.java
  3. 17 0
      fs-service/src/main/java/com/fs/communication/mapper/CompanyCallGatewayLogMapper.java
  4. 17 0
      fs-service/src/main/java/com/fs/communication/mapper/CompanySmsGatewayLogMapper.java
  5. 16 0
      fs-service/src/main/java/com/fs/communication/service/ICompanyCallGatewayLogService.java
  6. 16 0
      fs-service/src/main/java/com/fs/communication/service/ICompanySmsGatewayLogService.java
  7. 27 0
      fs-service/src/main/java/com/fs/communication/service/impl/CompanyCallGatewayLogServiceImpl.java
  8. 27 0
      fs-service/src/main/java/com/fs/communication/service/impl/CompanySmsGatewayLogServiceImpl.java
  9. 3 3
      fs-service/src/main/java/com/fs/company/mapper/CompanyMapper.java
  10. 0 2
      fs-service/src/main/java/com/fs/company/mapper/LobsterTestScenarioMapper.java
  11. 2 0
      fs-service/src/main/java/com/fs/company/param/CompanyVoiceLogsParam.java
  12. 17 12
      fs-service/src/main/resources/db/tenant-initTable.sql
  13. 78 0
      fs-service/src/main/resources/mapper/communication/CompanyCallGatewayLogMapper.xml
  14. 81 0
      fs-service/src/main/resources/mapper/communication/CompanySmsGatewayLogMapper.xml
  15. 0 26
      fs-service/src/main/resources/mapper/company/LobsterComplianceRuleMapper.xml
  16. 3 9
      fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml
  17. 0 9
      fs-service/src/main/resources/mapper/lobster/LobsterTestScenarioMapper.xml

+ 79 - 0
fs-admin-saas/src/main/java/com/fs/communication/controller/CallLogController.java

@@ -0,0 +1,79 @@
+package com.fs.communication.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ParseUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.communication.service.ICompanyCallGatewayLogService;
+import com.fs.company.param.CompanyVoiceLogsParam;
+import com.fs.company.vo.CompanyVoiceLogsVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * Gateway call log controller (company_comm_gateway_log, api_type=call).
+ */
+@RestController
+@Validated
+@RequestMapping("/admin/companyVoiceLogs")
+public class CallLogController extends BaseController {
+
+    @Autowired
+    private ICompanyCallGatewayLogService companyCallGatewayLogService;
+
+    @PreAuthorize("@ss.hasPermi('company:companyVoiceLogs:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanyVoiceLogsParam param) {
+        startPage();
+        List<CompanyVoiceLogsVO> list = companyCallGatewayLogService.selectCallGatewayLogList(param);
+        maskSensitiveFields(list);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('company:companyVoiceLogs:export')")
+    @Log(title = "通话记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanyVoiceLogsParam param) {
+        List<CompanyVoiceLogsVO> list = companyCallGatewayLogService.selectCallGatewayLogList(param);
+        maskSensitiveFields(list);
+        ExcelUtil<CompanyVoiceLogsVO> util = new ExcelUtil<>(CompanyVoiceLogsVO.class);
+        return util.exportExcel(list, "companyVoiceLogs");
+    }
+
+    @PreAuthorize("@ss.hasPermi('company:companyVoiceLogs:query')")
+    @GetMapping("/{voiceId}")
+    public AjaxResult getInfo(@PathVariable("voiceId") Long voiceId) {
+        CompanyVoiceLogsVO vo = companyCallGatewayLogService.selectCallGatewayLogById(voiceId);
+        if (vo != null) {
+            maskSensitiveFields(java.util.Collections.singletonList(vo));
+        }
+        return AjaxResult.success(vo);
+    }
+
+    private void maskSensitiveFields(List<CompanyVoiceLogsVO> list) {
+        if (list == null) {
+            return;
+        }
+        for (CompanyVoiceLogsVO vo : list) {
+            vo.setCalleePhone(ParseUtils.parsePhone(vo.getCalleePhone()));
+            vo.setCallerPhone(ParseUtils.parsePhone(vo.getCallerPhone()));
+            vo.setDisplayCalleeNumber(ParseUtils.parsePhone(vo.getDisplayCalleeNumber()));
+            vo.setDisplayCallerNumber(ParseUtils.parsePhone(vo.getDisplayCallerNumber()));
+            if (vo.getRemark() != null && vo.getRemark().length() > 11) {
+                vo.setRemark(new StringBuilder(vo.getRemark())
+                        .replace(vo.getRemark().length() - 8, vo.getRemark().length() - 4, "*****")
+                        .toString());
+            }
+        }
+    }
+}

+ 72 - 0
fs-admin-saas/src/main/java/com/fs/communication/controller/SmsLogController.java

@@ -0,0 +1,72 @@
+package com.fs.communication.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.communication.service.ICompanySmsGatewayLogService;
+import com.fs.company.param.CompanySmsLogsListQueryParam;
+import com.fs.company.vo.CompanySmsLogsListQueryVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * Gateway SMS log controller (company_comm_gateway_log, api_type=sms).
+ */
+@RestController
+@Validated
+@RequestMapping("/admin/companySmsLogs")
+public class SmsLogController extends BaseController {
+
+    @Autowired
+    private ICompanySmsGatewayLogService companySmsGatewayLogService;
+
+    @PreAuthorize("@ss.hasPermi('company:companySmsLogs:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanySmsLogsListQueryParam param) {
+        startPage();
+        List<CompanySmsLogsListQueryVO> list = companySmsGatewayLogService.selectSmsGatewayLogList(param);
+        maskPhone(list);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('company:companySmsLogs:export')")
+    @Log(title = "短信发送记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CompanySmsLogsListQueryParam param) {
+        List<CompanySmsLogsListQueryVO> list = companySmsGatewayLogService.selectSmsGatewayLogList(param);
+        maskPhone(list);
+        ExcelUtil<CompanySmsLogsListQueryVO> util = new ExcelUtil<>(CompanySmsLogsListQueryVO.class);
+        return util.exportExcel(list, "companySmsLogs");
+    }
+
+    @PreAuthorize("@ss.hasPermi('company:companySmsLogs:query')")
+    @GetMapping("/{logsId}")
+    public AjaxResult getInfo(@PathVariable("logsId") Long logsId) {
+        CompanySmsLogsListQueryVO vo = companySmsGatewayLogService.selectSmsGatewayLogById(logsId);
+        if (vo != null && vo.getPhone() != null) {
+            vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+        }
+        return AjaxResult.success(vo);
+    }
+
+    private void maskPhone(List<CompanySmsLogsListQueryVO> list) {
+        if (list == null) {
+            return;
+        }
+        for (CompanySmsLogsListQueryVO vo : list) {
+            if (vo.getPhone() != null) {
+                vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
+            }
+        }
+    }
+}

+ 17 - 0
fs-service/src/main/java/com/fs/communication/mapper/CompanyCallGatewayLogMapper.java

@@ -0,0 +1,17 @@
+package com.fs.communication.mapper;
+
+import com.fs.company.param.CompanyVoiceLogsParam;
+import com.fs.company.vo.CompanyVoiceLogsVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * Gateway call log query (company_comm_gateway_log, api_type=call).
+ */
+public interface CompanyCallGatewayLogMapper {
+
+    List<CompanyVoiceLogsVO> selectCallGatewayLogList(@Param("maps") CompanyVoiceLogsParam param);
+
+    CompanyVoiceLogsVO selectCallGatewayLogById(@Param("logId") Long logId);
+}

+ 17 - 0
fs-service/src/main/java/com/fs/communication/mapper/CompanySmsGatewayLogMapper.java

@@ -0,0 +1,17 @@
+package com.fs.communication.mapper;
+
+import com.fs.company.param.CompanySmsLogsListQueryParam;
+import com.fs.company.vo.CompanySmsLogsListQueryVO;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 短信网关调用记录(company_comm_gateway_log,api_type=sms)
+ */
+public interface CompanySmsGatewayLogMapper {
+
+    List<CompanySmsLogsListQueryVO> selectSmsGatewayLogList(@Param("maps") CompanySmsLogsListQueryParam param);
+
+    CompanySmsLogsListQueryVO selectSmsGatewayLogById(@Param("logId") Long logId);
+}

+ 16 - 0
fs-service/src/main/java/com/fs/communication/service/ICompanyCallGatewayLogService.java

@@ -0,0 +1,16 @@
+package com.fs.communication.service;
+
+import com.fs.company.param.CompanyVoiceLogsParam;
+import com.fs.company.vo.CompanyVoiceLogsVO;
+
+import java.util.List;
+
+/**
+ * Gateway call log query service (company_comm_gateway_log).
+ */
+public interface ICompanyCallGatewayLogService {
+
+    List<CompanyVoiceLogsVO> selectCallGatewayLogList(CompanyVoiceLogsParam param);
+
+    CompanyVoiceLogsVO selectCallGatewayLogById(Long logId);
+}

+ 16 - 0
fs-service/src/main/java/com/fs/communication/service/ICompanySmsGatewayLogService.java

@@ -0,0 +1,16 @@
+package com.fs.communication.service;
+
+import com.fs.company.param.CompanySmsLogsListQueryParam;
+import com.fs.company.vo.CompanySmsLogsListQueryVO;
+
+import java.util.List;
+
+/**
+ * 短信网关调用记录查询(company_comm_gateway_log)
+ */
+public interface ICompanySmsGatewayLogService {
+
+    List<CompanySmsLogsListQueryVO> selectSmsGatewayLogList(CompanySmsLogsListQueryParam param);
+
+    CompanySmsLogsListQueryVO selectSmsGatewayLogById(Long logId);
+}

+ 27 - 0
fs-service/src/main/java/com/fs/communication/service/impl/CompanyCallGatewayLogServiceImpl.java

@@ -0,0 +1,27 @@
+package com.fs.communication.service.impl;
+
+import com.fs.communication.mapper.CompanyCallGatewayLogMapper;
+import com.fs.communication.service.ICompanyCallGatewayLogService;
+import com.fs.company.param.CompanyVoiceLogsParam;
+import com.fs.company.vo.CompanyVoiceLogsVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CompanyCallGatewayLogServiceImpl implements ICompanyCallGatewayLogService {
+
+    @Autowired
+    private CompanyCallGatewayLogMapper companyCallGatewayLogMapper;
+
+    @Override
+    public List<CompanyVoiceLogsVO> selectCallGatewayLogList(CompanyVoiceLogsParam param) {
+        return companyCallGatewayLogMapper.selectCallGatewayLogList(param);
+    }
+
+    @Override
+    public CompanyVoiceLogsVO selectCallGatewayLogById(Long logId) {
+        return companyCallGatewayLogMapper.selectCallGatewayLogById(logId);
+    }
+}

+ 27 - 0
fs-service/src/main/java/com/fs/communication/service/impl/CompanySmsGatewayLogServiceImpl.java

@@ -0,0 +1,27 @@
+package com.fs.communication.service.impl;
+
+import com.fs.communication.mapper.CompanySmsGatewayLogMapper;
+import com.fs.communication.service.ICompanySmsGatewayLogService;
+import com.fs.company.param.CompanySmsLogsListQueryParam;
+import com.fs.company.vo.CompanySmsLogsListQueryVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CompanySmsGatewayLogServiceImpl implements ICompanySmsGatewayLogService {
+
+    @Autowired
+    private CompanySmsGatewayLogMapper companySmsGatewayLogMapper;
+
+    @Override
+    public List<CompanySmsLogsListQueryVO> selectSmsGatewayLogList(CompanySmsLogsListQueryParam param) {
+        return companySmsGatewayLogMapper.selectSmsGatewayLogList(param);
+    }
+
+    @Override
+    public CompanySmsLogsListQueryVO selectSmsGatewayLogById(Long logId) {
+        return companySmsGatewayLogMapper.selectSmsGatewayLogById(logId);
+    }
+}

+ 3 - 3
fs-service/src/main/java/com/fs/company/mapper/CompanyMapper.java

@@ -82,7 +82,7 @@ public interface CompanyMapper
     @Select({"<script> " +
             "select c.*,a.api_name as voice_api_name,u.user_name " +
             "from company c left join company_voice_api a on a.api_id=c.voice_api_id left join company_user u on u.user_id=c.user_id " +
-            "where is_del=0 " +
+            "where c.is_del=0 " +
             "<if test = 'maps.companyId != null  '> " +
             "and c.company_id = #{maps.companyId}" +
             "</if>" +
@@ -122,7 +122,7 @@ public interface CompanyMapper
             "select c.*,a.api_name as voice_api_name,u.user_name " +
             " ,(select count(1) from crm_customer cc where c.company_id= cc.company_id and date_format(cc.update_time,'%y%m%d') = date_format(now(),'%y%m%d') ) as now_day_customer_count " +
             "from company c left join company_voice_api a on a.api_id=c.voice_api_id left join company_user u on u.user_id=c.user_id " +
-            "where is_del=0 " +
+            "where c.is_del=0 " +
             "<if test = 'maps.companyId != null  '> " +
             "and c.company_id = #{maps.companyId}" +
             "</if>" +
@@ -227,7 +227,7 @@ public interface CompanyMapper
     @Select({"<script> " +
             "select c.*,a.api_name as voice_api_name,u.user_name " +
             "from company c left join company_voice_api a on a.api_id=c.voice_api_id left join company_user u on u.user_id=c.user_id " +
-            "where is_del=0 " +
+            "where c.is_del=0 " +
             "<if test = 'maps.liveShow != null  '> " +
             "and c.live_show = #{maps.liveShow}" +
             "</if>" +

+ 0 - 2
fs-service/src/main/java/com/fs/company/mapper/LobsterTestScenarioMapper.java

@@ -13,8 +13,6 @@ public interface LobsterTestScenarioMapper extends BaseMapper<LobsterTestScenari
 
     int insertScenario(LobsterTestScenario scenario);
 
-    LobsterTestScenario selectById(@Param("id") Long id);
-
     List<LobsterTestScenario> selectEnabledByCompanyId(@Param("companyId") Long companyId);
 
     int updateLastRun(@Param("id") Long id,

+ 2 - 0
fs-service/src/main/java/com/fs/company/param/CompanyVoiceLogsParam.java

@@ -43,6 +43,8 @@ public class CompanyVoiceLogsParam extends BaseEntity
 
     private Integer source;
 
+    /** Outbound voice API (company_voice_api.api_id, maps to gateway log gateway_id) */
+    private Long gatewayId;
 
     private String[] createTimeList;
 

+ 17 - 12
fs-service/src/main/resources/db/tenant-initTable.sql

@@ -2420,21 +2420,26 @@ DROP TABLE IF EXISTS `company_voice_api`;
 CREATE TABLE `company_voice_api`
 (
     `api_id`      int NOT NULL AUTO_INCREMENT COMMENT 'ID',
-    `api_name`    varchar(100)   NULL DEFAULT NULL COMMENT 'API接口名',
-    `api_type`    varchar(50)   NULL DEFAULT NULL COMMENT 'KEY',
-    `api_json`    varchar(2000)   NULL DEFAULT NULL COMMENT '接口配置JSON',
+    `api_name`    varchar(100) NULL DEFAULT NULL COMMENT 'API接口名',
+    `api_type`    varchar(50) NULL DEFAULT NULL COMMENT 'KEY',
+    `api_json`    varchar(2000) NULL DEFAULT NULL COMMENT '接口地址',
     `status`      tinyint(1) NULL DEFAULT NULL COMMENT '状态',
-    `remark`      varchar(2000)   NULL DEFAULT NULL,
-    `priority`    int NULL DEFAULT 1 COMMENT '优先级(数字越小越靠前)',
-    `selectable`  tinyint NULL DEFAULT 0 COMMENT '允许手动选择(0否1是)',
-    `sale_price`  decimal(10, 4) NULL DEFAULT NULL COMMENT '租户售价(元/分钟)',
-    `is_primary`  tinyint NULL DEFAULT 0 COMMENT '是否主线路(0否1是)',
-    `api_url`     varchar(500)   NULL DEFAULT NULL COMMENT '接口地址',
-    `dialog_url`  varchar(500)   NULL DEFAULT NULL COMMENT '话术跳转地址',
-    `is_del`      tinyint(1) NULL DEFAULT 0 COMMENT '是否删除(0否1是)',
+    `remark`      varchar(2000)  NULL DEFAULT NULL,
+    `priority`    tinyint NULL DEFAULT NULL COMMENT '优先级',
+    `selectable`  tinyint NULL DEFAULT NULL COMMENT '是否可选:0:不可以;1:可以',
+    `sale_price`  decimal(10, 2) NULL DEFAULT NULL COMMENT '售价',
+    `is_primary`  tinyint NULL DEFAULT NULL COMMENT '是否主线路',
     `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+    `is_del`      tinyint NULL DEFAULT 0 COMMENT '是否删除,0否 1是',
+    `provider`    varchar(255)  NULL DEFAULT NULL COMMENT '服务商',
+    `cost_price`  decimal(10, 2) NULL DEFAULT NULL COMMENT '成本价',
+    `account`     varchar(100) NULL DEFAULT NULL COMMENT '账户',
+    `password`    varchar(100) NULL DEFAULT NULL COMMENT '密码',
+    `api_url`     varchar(500) NULL DEFAULT NULL COMMENT 'api地址',
+    `dialog_url`  varchar(500) NULL DEFAULT NULL COMMENT '话术跳转地址',
+    `update_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
     PRIMARY KEY (`api_id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '呼叫接口' ROW_FORMAT = DYNAMIC;
+) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '呼叫接口' ROW_FORMAT = DYNAMIC;
 
 -- ----------------------------
 -- Table structure for company_voice_api_tiantian

+ 78 - 0
fs-service/src/main/resources/mapper/communication/CompanyCallGatewayLogMapper.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.communication.mapper.CompanyCallGatewayLogMapper">
+
+    <sql id="callGatewayLogSelect">
+        select g.log_id as voice_id,
+               g.company_id,
+               g.company_user_id,
+               cast(json_unquote(json_extract(g.request_body, '$.calleeId')) as unsigned) as customer_id,
+               u.nick_name as user_nick_name,
+               crm.customer_name,
+               null as voice_url,
+               g.create_time as start_time,
+               null as finish_time,
+               g.caller_phone,
+               g.callee_phone,
+               coalesce(floor(g.duration_ms / 1000), 0) as times,
+               coalesce(g.billing_quantity, 0) as billing_time,
+               g.caller_phone as display_caller_number,
+               g.callee_phone as display_callee_number,
+               g.result_msg as remark,
+               crm.source,
+               g.create_time as create_time,
+               case when g.success = 1 then 1 else -1 end as status
+        from company_comm_gateway_log g
+                 left join company_user u on u.user_id = g.company_user_id
+                 left join crm_customer crm
+                           on crm.customer_id = cast(json_unquote(json_extract(g.request_body, '$.calleeId')) as unsigned)
+        where g.api_type = 'call'
+    </sql>
+
+    <select id="selectCallGatewayLogList" resultType="com.fs.company.vo.CompanyVoiceLogsVO">
+        <include refid="callGatewayLogSelect"/>
+        <if test="maps.companyId != null">
+            and g.company_id = #{maps.companyId}
+        </if>
+        <if test="maps.customerId != null">
+            and cast(json_unquote(json_extract(g.request_body, '$.calleeId')) as unsigned) = #{maps.customerId}
+        </if>
+        <if test="maps.userNickName != null and maps.userNickName != ''">
+            and u.nick_name like concat('%', #{maps.userNickName}, '%')
+        </if>
+        <if test="maps.calleePhone != null and maps.calleePhone != ''">
+            and g.callee_phone like concat('%', #{maps.calleePhone}, '%')
+        </if>
+        <if test="maps.gatewayId != null">
+            and (g.gateway_id = #{maps.gatewayId}
+                or cast(json_unquote(json_extract(g.request_body, '$.gatewayId')) as unsigned) = #{maps.gatewayId})
+        </if>
+        <if test="maps.status != null">
+            <choose>
+                <when test="maps.status == 1">
+                    and g.success = 1
+                </when>
+                <when test="maps.status == 0">
+                    and 1 = 0
+                </when>
+                <otherwise>
+                    and g.success = 0
+                </otherwise>
+            </choose>
+        </if>
+        <if test="maps.params != null and maps.params.beginTime != null and maps.params.beginTime != ''">
+            and date_format(g.create_time, '%y%m%d') &gt;= date_format(#{maps.params.beginTime}, '%y%m%d')
+            and date_format(g.create_time, '%y%m%d') &lt;= date_format(#{maps.params.endTime}, '%y%m%d')
+        </if>
+        <if test="maps.params != null and maps.params.dataScope != null and maps.params.dataScope != ''">
+            ${maps.params.dataScope}
+        </if>
+        order by g.log_id desc
+    </select>
+
+    <select id="selectCallGatewayLogById" resultType="com.fs.company.vo.CompanyVoiceLogsVO">
+        <include refid="callGatewayLogSelect"/>
+        and g.log_id = #{logId}
+    </select>
+
+</mapper>

+ 81 - 0
fs-service/src/main/resources/mapper/communication/CompanySmsGatewayLogMapper.xml

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.communication.mapper.CompanySmsGatewayLogMapper">
+
+    <sql id="smsGatewayLogSelect">
+        select g.log_id as logs_id,
+               g.company_id,
+               g.company_user_id,
+               cast(json_unquote(json_extract(g.request_body, '$.customerId')) as unsigned) as customer_id,
+               c.customer_code,
+               c.customer_name,
+               g.callee_phone as phone,
+               coalesce(nullif(g.result_msg, ''), g.api_path) as content,
+               u.nick_name as company_user_nick_name,
+               g.create_time,
+               case when g.success = 1 then g.create_time else null end as send_time,
+               case when g.success = 1 then 1 else 2 end as status,
+               g.result_msg as stat,
+               null as reply_content
+        from company_comm_gateway_log g
+                 left join crm_customer c on c.customer_id = cast(json_unquote(json_extract(g.request_body, '$.customerId')) as unsigned)
+                 left join company_user u on u.user_id = g.company_user_id
+        where g.api_type = 'sms'
+    </sql>
+
+    <select id="selectSmsGatewayLogList" resultType="com.fs.company.vo.CompanySmsLogsListQueryVO">
+        <include refid="smsGatewayLogSelect"/>
+        <if test="maps.companyId != null">
+            and g.company_id = #{maps.companyId}
+        </if>
+        <if test="maps.customerId != null">
+            and cast(json_unquote(json_extract(g.request_body, '$.customerId')) as unsigned) = #{maps.customerId}
+        </if>
+        <if test="maps.status != null">
+            <choose>
+                <when test="maps.status == 1">
+                    and g.success = 1
+                </when>
+                <when test="maps.status == 0">
+                    and 1 = 0
+                </when>
+                <otherwise>
+                    and g.success = 0
+                </otherwise>
+            </choose>
+        </if>
+        <if test="maps.isReply != null and maps.isReply == 1">
+            and 1 = 0
+        </if>
+        <if test="maps.customerCode != null and maps.customerCode != ''">
+            and c.customer_code = #{maps.customerCode}
+        </if>
+        <if test="maps.customerName != null and maps.customerName != ''">
+            and c.customer_name = #{maps.customerName}
+        </if>
+        <if test="maps.companyUserNickName != null and maps.companyUserNickName != ''">
+            and u.nick_name = #{maps.companyUserNickName}
+        </if>
+        <if test="maps.phone != null and maps.phone != ''">
+            and g.callee_phone = #{maps.phone}
+        </if>
+        <if test="maps.params != null and maps.params.beginTime != null and maps.params.beginTime != ''">
+            and date_format(g.create_time, '%y%m%d') &gt;= date_format(#{maps.params.beginTime}, '%y%m%d')
+            and date_format(g.create_time, '%y%m%d') &lt;= date_format(#{maps.params.endTime}, '%y%m%d')
+        </if>
+        <if test="maps.deptId != null">
+            and (u.dept_id = #{maps.deptId}
+                or u.dept_id in (select t.dept_id from company_dept t where find_in_set(#{maps.deptId}, ancestors)))
+        </if>
+        <if test="maps.params != null and maps.params.dataScope != null and maps.params.dataScope != ''">
+            ${maps.params.dataScope}
+        </if>
+        order by g.log_id desc
+    </select>
+
+    <select id="selectSmsGatewayLogById" resultType="com.fs.company.vo.CompanySmsLogsListQueryVO">
+        <include refid="smsGatewayLogSelect"/>
+        and g.log_id = #{logId}
+    </select>
+
+</mapper>

+ 0 - 26
fs-service/src/main/resources/mapper/company/LobsterComplianceRuleMapper.xml

@@ -42,32 +42,6 @@
         where id = #{id} and company_id = #{companyId} and del_flag = 0
     </select>
 
-    <insert id="insert" useGeneratedKeys="true" keyProperty="id">
-        insert into lobster_compliance_rule (
-            company_id, rule_name, rule_type, pattern, description, action,
-            severity, enabled, del_flag, create_by, create_time, update_by, update_time
-        ) values (
-            #{companyId}, #{ruleName}, #{ruleType}, #{pattern}, #{description}, #{action},
-            #{severity}, #{enabled}, #{delFlag}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}
-        )
-    </insert>
-
-    <update id="updateById">
-        update lobster_compliance_rule
-        <set>
-            <if test="ruleName != null">rule_name = #{ruleName},</if>
-            <if test="ruleType != null">rule_type = #{ruleType},</if>
-            <if test="pattern != null">pattern = #{pattern},</if>
-            <if test="description != null">description = #{description},</if>
-            <if test="action != null">action = #{action},</if>
-            <if test="severity != null">severity = #{severity},</if>
-            <if test="enabled != null">enabled = #{enabled},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            update_time = #{updateTime}
-        </set>
-        where id = #{id} and company_id = #{companyId}
-    </update>
-
     <update id="logicalDeleteById">
         update lobster_compliance_rule set del_flag = 1 where id = #{id} and company_id = #{companyId}
     </update>

+ 3 - 9
fs-service/src/main/resources/mapper/hisStore/FsStoreProductScrmMapper.xml

@@ -483,17 +483,14 @@
         <if test='config.isStores == "1" '>
             inner join fs_store_scrm fs on fs.store_id = fsp.store_id
         </if>
-        <if test='config.isAudit == "1" '>
-            and fs.is_audit = '1'
-        </if>
         where fsp.is_del=0 and fsp.is_show=1
         <if test='config.isAudit == "1" '>
-            and fsp.is_audit = '1'
+
         </if>
         <if test = 'param.appId != null and param.appId != ""'>
             and ((FIND_IN_SET(#{param.appId}, fsp.app_ids) > 0))
         </if>
-        and fsp.is_best=1 and fsp.is_display=1 order by fsp.sort desc,fsp.product_id desc
+        and fsp.is_best=1 and fsp.is_display=1  and fsp.is_audit = '1' order by fsp.sort desc,fsp.product_id desc
     </select>
     <select id="bulkCopyFsStoreProductByIds" resultMap="FsStoreProductResult">
         <include refid="selectFsStoreProductVo"/>
@@ -542,13 +539,10 @@
             inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1
         </if>
         where p.is_del=0 and p.is_show=1
-        <if test='config.isAudit == "1" '>
-            and p.is_audit = '1'
-        </if>
         <if test = 'param.appId != null and param.appId != ""'>
             and ((FIND_IN_SET(#{param.appId}, p.app_ids) > 0))
         </if>
-        and  p.is_good=1 and p.is_display=1 order by p.sort desc
+        and  p.is_good=1 and p.is_display=1 and p.is_audit = '1' order by p.sort desc
     </select>
 
     <select id="getStoreProductInProductIds" resultType="com.fs.hisStore.domain.FsStoreProductScrm">

+ 0 - 9
fs-service/src/main/resources/mapper/lobster/LobsterTestScenarioMapper.xml

@@ -33,15 +33,6 @@
         )
     </insert>
 
-    <select id="selectById" resultMap="TestScenarioResult">
-        select id, company_id, scenario_name, business_desc, template_id,
-               user_inputs_json, expected_nodes, min_score, enabled, cron,
-               last_run_id, last_run_status, last_run_time,
-               create_by, create_time, update_time
-        from lobster_test_scenario
-        where id = #{id}
-    </select>
-
     <select id="selectEnabledByCompanyId" resultMap="TestScenarioResult">
         select id, company_id, scenario_name, business_desc, template_id,
                user_inputs_json, expected_nodes, min_score, enabled, cron,