Forráskód Böngészése

Merge commit '9fd8a0bdb6454acd3e555dfbb7b9806f174ae552'

lihao16 4 hónapja
szülő
commit
616979819e
15 módosított fájl, 1159 hozzáadás és 33 törlés
  1. 2 0
      smsb-admin/src/main/resources/application.yml
  2. 105 0
      smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/controller/SmsbDeviceChatScProductController.java
  3. 69 0
      smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/domain/SmsbDeviceChatScProduct.java
  4. 2 4
      smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/domain/bo/SmsbAppointmentInfoBo.java
  5. 66 0
      smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/domain/bo/SmsbDeviceChatScProductBo.java
  6. 80 0
      smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/domain/vo/SmsbDeviceChatScProductVo.java
  7. 15 0
      smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/mapper/SmsbDeviceChatScProductMapper.java
  8. 68 0
      smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/service/ISmsbDeviceChatScProductService.java
  9. 50 28
      smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/service/impl/Main.java
  10. 125 1
      smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/service/impl/SmsbAppointmentInfoServiceImpl.java
  11. 134 0
      smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/service/impl/SmsbDeviceChatScProductServiceImpl.java
  12. 7 0
      smsb-modules/smsb-digital-promotion/src/main/resources/mapper/digital/SmsbDeviceChatScProductMapper.xml
  13. 63 0
      smsb-plus-ui/src/api/smsb/digital/deviceChatScProduct/index.ts
  14. 131 0
      smsb-plus-ui/src/api/smsb/digital/deviceChatScProduct/types.ts
  15. 242 0
      smsb-plus-ui/src/views/smsb/deviceChatScProduct/index.vue

+ 2 - 0
smsb-admin/src/main/resources/application.yml

@@ -133,6 +133,8 @@ dify:
     report: e9c7f861-d891-4bff-87d0-3c5bb5fe7a1d
     # 有样学样知识库ID
     case: 46003fb2-7d6a-45ca-ad73-65bfc751d90e
+    # 套餐推荐知识库ID
+    product: 6f24c44e-357f-4a4b-9301-435605b2a4df
 
 # Sa-Token配置
 sa-token:

+ 105 - 0
smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/controller/SmsbDeviceChatScProductController.java

@@ -0,0 +1,105 @@
+package com.inspur.digital.controller;
+
+import java.util.List;
+
+import lombok.RequiredArgsConstructor;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.constraints.*;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.validation.annotation.Validated;
+import org.dromara.common.idempotent.annotation.RepeatSubmit;
+import org.dromara.common.log.annotation.Log;
+import org.dromara.common.web.core.BaseController;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.core.domain.R;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import org.dromara.common.log.enums.BusinessType;
+import org.dromara.common.excel.utils.ExcelUtil;
+import com.inspur.digital.domain.vo.SmsbDeviceChatScProductVo;
+import com.inspur.digital.domain.bo.SmsbDeviceChatScProductBo;
+import com.inspur.digital.service.ISmsbDeviceChatScProductService;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+
+/**
+ * 数促-套餐推荐
+ *
+ * @author ZhiCheng Fan
+ * @date 2025-07-02
+ */
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/digital/deviceChatScProduct")
+public class SmsbDeviceChatScProductController extends BaseController {
+
+    private final ISmsbDeviceChatScProductService smsbDeviceChatScProductService;
+
+    /**
+     * 查询数促-套餐推荐列表
+     */
+    @SaCheckPermission("digital:deviceChatScProduct:list")
+    @GetMapping("/list")
+    public TableDataInfo<SmsbDeviceChatScProductVo> list(SmsbDeviceChatScProductBo bo, PageQuery pageQuery) {
+        return smsbDeviceChatScProductService.queryPageList(bo, pageQuery);
+    }
+
+    /**
+     * 导出数促-套餐推荐列表
+     */
+    @SaCheckPermission("digital:deviceChatScProduct:export")
+    @Log(title = "数促-套餐推荐", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(SmsbDeviceChatScProductBo bo, HttpServletResponse response) {
+        List<SmsbDeviceChatScProductVo> list = smsbDeviceChatScProductService.queryList(bo);
+        ExcelUtil.exportExcel(list, "数促-套餐推荐", SmsbDeviceChatScProductVo.class, response);
+    }
+
+    /**
+     * 获取数促-套餐推荐详细信息
+     *
+     * @param id 主键
+     */
+    @SaCheckPermission("digital:deviceChatScProduct:query")
+    @GetMapping("/{id}")
+    public R<SmsbDeviceChatScProductVo> getInfo(@NotNull(message = "主键不能为空")
+                                     @PathVariable Long id) {
+        return R.ok(smsbDeviceChatScProductService.queryById(id));
+    }
+
+    /**
+     * 新增数促-套餐推荐
+     */
+    @SaCheckPermission("digital:deviceChatScProduct:add")
+    @Log(title = "数促-套餐推荐", businessType = BusinessType.INSERT)
+    @RepeatSubmit()
+    @PostMapping()
+    public R<Void> add(@Validated(AddGroup.class) @RequestBody SmsbDeviceChatScProductBo bo) {
+        return toAjax(smsbDeviceChatScProductService.insertByBo(bo));
+    }
+
+    /**
+     * 修改数促-套餐推荐
+     */
+    @SaCheckPermission("digital:deviceChatScProduct:edit")
+    @Log(title = "数促-套餐推荐", businessType = BusinessType.UPDATE)
+    @RepeatSubmit()
+    @PutMapping()
+    public R<Void> edit(@Validated(EditGroup.class) @RequestBody SmsbDeviceChatScProductBo bo) {
+        return toAjax(smsbDeviceChatScProductService.updateByBo(bo));
+    }
+
+    /**
+     * 删除数促-套餐推荐
+     *
+     * @param ids 主键串
+     */
+    @SaCheckPermission("digital:deviceChatScProduct:remove")
+    @Log(title = "数促-套餐推荐", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public R<Void> remove(@NotEmpty(message = "主键不能为空")
+                          @PathVariable Long[] ids) {
+        return toAjax(smsbDeviceChatScProductService.deleteWithValidByIds(List.of(ids), true));
+    }
+}

+ 69 - 0
smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/domain/SmsbDeviceChatScProduct.java

@@ -0,0 +1,69 @@
+package com.inspur.digital.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+
+import java.io.Serial;
+import java.util.Date;
+
+/**
+ * 数促-套餐推荐对象 smsb_device_chat_sc_product
+ *
+ * @author ZhiCheng Fan
+ * @date 2025-07-02
+ */
+@Data
+@TableName("smsb_device_chat_sc_product")
+public class SmsbDeviceChatScProduct {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id")
+    private Long id;
+
+    /**
+     * 类型 1-欢迎语 2-条目
+     */
+    private Long type;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 图片
+     */
+    private String photo;
+
+    /**
+     * 简介
+     */
+    private String introduction;
+
+    /**
+     * 预约ID
+     */
+    private Long appointmentId;
+
+    /**
+     * 预约企业
+     */
+    private String enterprise;
+
+    /**
+     * 租户编号
+     */
+    private String tenantId;
+
+    /**
+     * 更新时间
+     */
+    @TableField(fill = FieldFill.INSERT)
+    private Date createTime;
+
+}

+ 2 - 4
smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/domain/bo/SmsbAppointmentInfoBo.java

@@ -2,14 +2,12 @@ package com.inspur.digital.domain.bo;
 
 import com.inspur.digital.domain.SmsbAppointmentInfo;
 import org.dromara.common.mybatis.core.domain.BaseEntity;
-import org.dromara.common.core.validate.AddGroup;
-import org.dromara.common.core.validate.EditGroup;
 import io.github.linpeilie.annotations.AutoMapper;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import jakarta.validation.constraints.*;
+
 import java.util.Date;
-import com.fasterxml.jackson.annotation.JsonFormat;
+
 
 /**
  * 预约信息业务对象 smsb_appointment_info

+ 66 - 0
smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/domain/bo/SmsbDeviceChatScProductBo.java

@@ -0,0 +1,66 @@
+package com.inspur.digital.domain.bo;
+
+import com.inspur.digital.domain.SmsbDeviceChatScProduct;
+import org.dromara.common.mybatis.core.domain.BaseEntity;
+import org.dromara.common.core.validate.AddGroup;
+import org.dromara.common.core.validate.EditGroup;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import jakarta.validation.constraints.*;
+
+/**
+ * 数促-套餐推荐业务对象 smsb_device_chat_sc_product
+ *
+ * @author ZhiCheng Fan
+ * @date 2025-07-02
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = SmsbDeviceChatScProduct.class, reverseConvertGenerate = false)
+public class SmsbDeviceChatScProductBo extends BaseEntity {
+
+    /**
+     * 主键ID
+     */
+    @NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
+    private Long id;
+
+    /**
+     * 类型 1-欢迎语 2-条目
+     */
+    @NotNull(message = "类型 1-欢迎语 2-条目不能为空", groups = { AddGroup.class, EditGroup.class })
+    private Long type;
+
+    /**
+     * 名称
+     */
+    @NotBlank(message = "名称不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String name;
+
+    /**
+     * 图片
+     */
+    @NotBlank(message = "图片不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String photo;
+
+    /**
+     * 简介
+     */
+    @NotBlank(message = "简介不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String introduction;
+
+    /**
+     * 预约ID
+     */
+    @NotNull(message = "预约ID不能为空", groups = { AddGroup.class, EditGroup.class })
+    private Long appointmentId;
+
+    /**
+     * 预约企业
+     */
+    @NotBlank(message = "预约企业不能为空", groups = { AddGroup.class, EditGroup.class })
+    private String enterprise;
+
+
+}

+ 80 - 0
smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/domain/vo/SmsbDeviceChatScProductVo.java

@@ -0,0 +1,80 @@
+package com.inspur.digital.domain.vo;
+
+import com.inspur.digital.domain.SmsbDeviceChatScProduct;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import org.dromara.common.excel.annotation.ExcelDictFormat;
+import org.dromara.common.excel.convert.ExcelDictConvert;
+import io.github.linpeilie.annotations.AutoMapper;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+
+
+/**
+ * 数促-套餐推荐视图对象 smsb_device_chat_sc_product
+ *
+ * @author ZhiCheng Fan
+ * @date 2025-07-02
+ */
+@Data
+@ExcelIgnoreUnannotated
+@AutoMapper(target = SmsbDeviceChatScProduct.class)
+public class SmsbDeviceChatScProductVo implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    @ExcelProperty(value = "主键ID")
+    private Long id;
+
+    /**
+     * 类型 1-欢迎语 2-条目
+     */
+    @ExcelProperty(value = "类型 1-欢迎语 2-条目")
+    private Long type;
+
+    /**
+     * 名称
+     */
+    @ExcelProperty(value = "名称")
+    private String name;
+
+    /**
+     * 图片
+     */
+    @ExcelProperty(value = "图片")
+    private String photo;
+
+    /**
+     * 简介
+     */
+    @ExcelProperty(value = "简介")
+    private String introduction;
+
+    /**
+     * 预约ID
+     */
+    @ExcelProperty(value = "预约ID")
+    private Long appointmentId;
+
+    /**
+     * 预约企业
+     */
+    @ExcelProperty(value = "预约企业")
+    private String enterprise;
+
+    /**
+     * 创建时间
+     */
+    @ExcelProperty(value = "创建时间")
+    private Date createTime;
+
+
+}

+ 15 - 0
smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/mapper/SmsbDeviceChatScProductMapper.java

@@ -0,0 +1,15 @@
+package com.inspur.digital.mapper;
+
+import com.inspur.digital.domain.SmsbDeviceChatScProduct;
+import com.inspur.digital.domain.vo.SmsbDeviceChatScProductVo;
+import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
+
+/**
+ * 数促-套餐推荐Mapper接口
+ *
+ * @author ZhiCheng Fan
+ * @date 2025-07-02
+ */
+public interface SmsbDeviceChatScProductMapper extends BaseMapperPlus<SmsbDeviceChatScProduct, SmsbDeviceChatScProductVo> {
+
+}

+ 68 - 0
smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/service/ISmsbDeviceChatScProductService.java

@@ -0,0 +1,68 @@
+package com.inspur.digital.service;
+
+import com.inspur.digital.domain.vo.SmsbDeviceChatScProductVo;
+import com.inspur.digital.domain.bo.SmsbDeviceChatScProductBo;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 数促-套餐推荐Service接口
+ *
+ * @author ZhiCheng Fan
+ * @date 2025-07-02
+ */
+public interface ISmsbDeviceChatScProductService {
+
+    /**
+     * 查询数促-套餐推荐
+     *
+     * @param id 主键
+     * @return 数促-套餐推荐
+     */
+    SmsbDeviceChatScProductVo queryById(Long id);
+
+    /**
+     * 分页查询数促-套餐推荐列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 数促-套餐推荐分页列表
+     */
+    TableDataInfo<SmsbDeviceChatScProductVo> queryPageList(SmsbDeviceChatScProductBo bo, PageQuery pageQuery);
+
+    /**
+     * 查询符合条件的数促-套餐推荐列表
+     *
+     * @param bo 查询条件
+     * @return 数促-套餐推荐列表
+     */
+    List<SmsbDeviceChatScProductVo> queryList(SmsbDeviceChatScProductBo bo);
+
+    /**
+     * 新增数促-套餐推荐
+     *
+     * @param bo 数促-套餐推荐
+     * @return 是否新增成功
+     */
+    Boolean insertByBo(SmsbDeviceChatScProductBo bo);
+
+    /**
+     * 修改数促-套餐推荐
+     *
+     * @param bo 数促-套餐推荐
+     * @return 是否修改成功
+     */
+    Boolean updateByBo(SmsbDeviceChatScProductBo bo);
+
+    /**
+     * 校验并批量删除数促-套餐推荐信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+}

+ 50 - 28
smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/service/impl/Main.java

@@ -2,43 +2,65 @@ package com.inspur.digital.service.impl;
 
 import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpResponse;
+import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
+import com.github.therapi.runtimejavadoc.repack.com.eclipsesource.json.JsonObject;
+import com.inspur.digital.util.EncryptUtil;
 
-import java.util.Scanner;
+import java.util.*;
 
 public class Main {
     public static void main(String[] args) {
-        String assessmentReport = parse(s);
-        System.out.println(assessmentReport);
-        // 搞个公共智慧体ai这里喂给他报告,让他生成100字左右简单建议
-//        http://dify01.snctv.net/v1
-        JSONObject agentBody = new JSONObject();
-        agentBody.put("query", "请根据下列诊断报告\n" + assessmentReport);
-        agentBody.put("response_mode", "blocking");
-        agentBody.put("user", "public_intelligent_agent");
-        agentBody.put("inputs", "");
-        String agentUrl = "http://dify01.snctv.net:83/v1/chat-messages";
-//        String agentUrl = "http://dify01.snctv.net/v1";
-        HttpRequest agentRequest = HttpRequest.post(agentUrl)
-//            .contentType("application/json")
+        JsonObject requestBody = new JsonObject();
+        requestBody.add("interfaceId", "ZT49DigitalHuman");
+        requestBody.add("appId", "ZT");
+        String secret = EncryptUtil.encryptOuter("0430e45e154b4e73278b0e05d81c530377d4fbade470aefdba484542bb49a04b15aae372084fd7f0792df40d3b6caabccac585027091321b034e1ab0dee258341b", "ExperienceCenterKey01");
+//        log.info("requestApiGetScData,secret:" + secret);
+        requestBody.add("secret", secret);
+        JsonObject body = new JsonObject();
+        body.add("phoneNumber", "15098812889");
+        requestBody.add("body", body.toString());
+//        System.out.println(requestBody.toString());
+        HttpRequest request = HttpRequest.post("https://ndtpc.com/gateway/third/call")
             .header("Content-Type", "application/json")
-            .header("Authorization", "Bearer " + "app-zyDMoN9vjjvfgHompclx3FkW")
-            .body(agentBody.toString());
-//                .body("inputs", inputs.toString())
-//            .body("query", "请根据下列诊断报告\n" + assessmentReport)
-//            .body("response_mode", "blocking")
-//                .body("conversation_id", "")
-//            .body("user", "public_intelligent_agent");
-
-        HttpResponse agentResponse = agentRequest.execute();
-        if (!agentResponse.isOk()) {
+            .body(requestBody.toString());
+        HttpResponse response = request.execute();
+        if (!response.isOk()) {
             System.out.println("请求失败");
         }
-        String agentResponseBody = agentResponse.body();
-        System.out.println(agentResponseBody);
-        String answer = JSONUtil.parseObj(agentResponseBody).getJSONObject("data").getStr("outputs");
-        System.out.println( answer);
+        String responseBody = response.body();
+        JSONObject responseJson = JSONUtil.parseObj(responseBody);
+        String reportMapStr = responseJson.getJSONObject("data").getStr("reportMap");
+        System.out.println(reportMapStr);
+        // 获取solutionList数组
+        JSONArray solutionList = JSONUtil.parseObj(reportMapStr).getJSONObject("reportContent").getJSONObject("recommend").getJSONArray("solutionList");
+        if (solutionList == null || solutionList.isEmpty()) {
+            return;
+        }
+        System.out.println(solutionList);
+        // 创建结果List
+        List<String> resultList = new ArrayList<>();
+        // 遍历每个解决方案对象
+        for (int i = 0; i < solutionList.size(); i++) {
+            JSONObject solution = solutionList.getJSONObject(i);
+            // 提取并处理每个字段
+            resultList.add("套餐ID:" + solution.getStr("expertId"));
+            // 转换domain为List<String>
+            resultList.add("套餐领域:" + solution.getJSONArray("domain").toList(String.class));
+            StringBuilder builder = new StringBuilder("套餐领域:");
+            if (!solution.getJSONArray("domain").isEmpty()) {
+                solution.getJSONArray("domain").toList(String.class).forEach(
+                    domain -> builder.append(domain).append("、")
+                );
+                builder.deleteCharAt(builder.length() - 1);
+            }
+            resultList.add(builder.toString());
+            resultList.add("套餐名称:" + solution.getStr("name"));
+            resultList.add("套餐图片:" + solution.getStr("photo"));
+        }
+        // 输出结果验证
+        System.out.println(resultList);
     }
 
     public static String parse(String json) {

+ 125 - 1
smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/service/impl/SmsbAppointmentInfoServiceImpl.java

@@ -16,12 +16,14 @@ import com.inspur.device.domain.vo.SmsbDeviceGroupRelVo;
 import com.inspur.device.mapper.SmsbDeviceGroupRelMapper;
 import com.inspur.digital.domain.SmsbAppointmentInfo;
 import com.inspur.digital.domain.SmsbDeviceChatScCase;
+import com.inspur.digital.domain.SmsbDeviceChatScProduct;
 import com.inspur.digital.domain.SmsbDeviceChatScReport;
 import com.inspur.digital.domain.SmsbDeviceScScanCode;
 import com.inspur.digital.domain.bo.SmsbAppointmentInfoBo;
 import com.inspur.digital.domain.bo.SmsbStartInfoBo;
 import com.inspur.digital.domain.vo.*;
 import com.inspur.digital.mapper.SmsbAppointmentInfoMapper;
+import com.inspur.digital.mapper.SmsbDeviceChatScProductMapper;
 import com.inspur.digital.mapper.SmsbDeviceChatScCaseMapper;
 import com.inspur.digital.mapper.SmsbDeviceChatScReportMapper;
 import com.inspur.digital.mapper.SmsbDeviceScScanCodeMapper;
@@ -64,6 +66,7 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
     private final SmsbAppointmentInfoMapper baseMapper;
     private final SmsbDeviceGroupRelMapper smsbDeviceGroupRelMapper;
     private final SmsbDeviceChatScReportMapper smsbDeviceChatScReportMapper;
+    private final SmsbDeviceChatScProductMapper smsbDeviceChatScProductMapper;
     private final SmsbDeviceChatScCaseMapper smsbDeviceChatScCaseMapper;
     private final SmsbDeviceScScanCodeMapper smsbDeviceScScanCodeMapper;
     @Autowired
@@ -86,6 +89,8 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
     private String difyScDatasetReportId;
     @Value("${dify.sc_dataset.case}")
     private String difyScDatasetCaseId;
+    @Value("${dify.sc_dataset.product}")
+    private String difyScDatasetProductId;
     @Value("${server.tempDir}")
     private String tempDir;
     @Value("${dify.datasets.apiKey}")
@@ -187,6 +192,14 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
             // 4 启动线程,保存至数据库,生成总结
             createReport(reportList, add, smsbDeviceChatScReportMapper);
         }
+
+        // 解析报告内容拿到套餐推荐
+        List<Map<String, String>> productList = parseProductList(reportMap);
+        System.out.println("productList" + productList);
+        if (productList != null && !productList.isEmpty()) {
+            // 套餐推荐:服务产品列表
+            createProduct(productList, add, smsbDeviceChatScProductMapper);
+        }
         // 5、看样学样:应用案例列表
         List<SmsbDeviceChatScCase> caseList = getCaseList(reportMap,add);
         if (!CollectionUtils.isEmpty(reportList)) {
@@ -254,6 +267,68 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
         }
     }
 
+    private List<Map<String, String>> parseProductList(String reportMapStr) {
+        JSONObject reportMap = JSONUtil.parseObj(reportMapStr);
+        if ("false".equalsIgnoreCase(reportMap.getStr("result"))) {
+            return null;
+        }
+        // 获取solutionList数组
+        JSONArray productList = reportMap.getJSONObject("reportContent")
+            .getJSONObject("recommend").getJSONArray("productList");
+        if (productList == null || productList.isEmpty()) {
+            return null;
+        }
+        // 创建结果List
+        List<Map<String, String>> resultList = new ArrayList<>();
+        // 遍历每个解决方案对象
+        for (int i = 0; i < productList.size(); i++) {
+            HashMap<String, String> map = new HashMap<>();
+            JSONObject product = productList.getJSONObject(i);
+            // 提取并处理每个字段
+            map.put("name", product.getStr("name"));
+            map.put("photo", product.getStr("photo"));
+            resultList.add(map);
+        }
+        return resultList;
+    }
+
+    private void createProduct(List<Map<String, String>> reportContentList, SmsbAppointmentInfo add, SmsbDeviceChatScProductMapper smsbDeviceChatScProductMapper) {
+        Runnable transTask = () -> {
+            log.info("createReport thread begin reportContentList.size(): " + reportContentList.size());
+            // 数据库保存条目
+            List<SmsbDeviceChatScProduct> scReportList = new ArrayList<>();
+            StringBuilder reportContentStr = new StringBuilder();
+            reportContentStr.append("帮我对一下内容进行汇总总结,返回100字的纯文本内容:").append("\n");
+            for (Map<String, String> reportContent : reportContentList) {
+                reportContentStr.append("套餐名称:").append(reportContent.get("name")).append("\n")
+                    .append("套餐图片:").append(reportContent.get("photo")).append("\n");
+                SmsbDeviceChatScProduct scProduct = new SmsbDeviceChatScProduct();
+                scProduct.setType(2L);
+                scProduct.setName(reportContent.get("name"));
+                scProduct.setPhoto(reportContent.get("photo"));
+                scProduct.setAppointmentId(add.getId());
+                scProduct.setEnterprise(add.getEnterprise());
+                scProduct.setTenantId(add.getTenantId());
+                scReportList.add(scProduct);
+            }
+            smsbDeviceChatScProductMapper.insertBatch(scReportList);
+            // 调用公共Dify接口 进行内容总结 并保存
+            String reportSummary = DifyStreamUtil.callDifyStreamApi(difyBaseUrl + "/v1/chat-messages", difyScAgentApiKey, reportContentStr.toString());
+            SmsbDeviceChatScProduct scReport = new SmsbDeviceChatScProduct();
+            scReport.setType(1L);
+            String content = "你好," + add.getEnterprise() + "企业,我是小数智能分析助手。您企业转型的套餐为:" + reportSummary + "您可以继续向我提问。";
+            scReport.setName("欢迎词");
+            scReport.setIntroduction(content);
+            scReport.setAppointmentId(add.getId());
+            scReport.setEnterprise(add.getEnterprise());
+            scReport.setTenantId(add.getTenantId());
+            smsbDeviceChatScProductMapper.insert(scReport);
+            log.info("createReport thread end !");
+        };
+        // 提交Runnable任务到线程池
+        threadPoolTaskExecutor.submit(transTask);
+    }
+
     private void createReport(List<String> reportContentList, SmsbAppointmentInfo add, SmsbDeviceChatScReportMapper smsbDeviceChatScReportMapper) {
         Runnable transTask = () -> {
             log.info("createReport thread begin reportContentList.size(): " + reportContentList.size());
@@ -286,6 +361,7 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
         };
         // 提交Runnable任务到线程池
         threadPoolTaskExecutor.submit(transTask);
+
     }
 
     private List<String> getAssessmentReportV2(String reportMap) {
@@ -497,6 +573,9 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
         List<String> reportContentList = new ArrayList<>();
         // 针对有样学样的内容集合
         List<String> caseContentList = new ArrayList<>();
+        // 针对套餐推荐的内容集合
+        List<String> productContentList = new ArrayList<>();
+
         for (SmsbDeviceGroupRelVo deviceGroupRel : deviceGroupRelList) {
             SmsbScDeviceStartInfoVo deviceStartInfo = new SmsbScDeviceStartInfoVo();
             deviceStartInfo.setIdentifier(deviceGroupRel.getDeviceIdentifier());
@@ -529,7 +608,17 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
             } else if (deviceGroupRel.getSceneSort().equals(DEFAULT_SCENE_SORT_3)) {
 
             } else if (deviceGroupRel.getSceneSort().equals(DEFAULT_SCENE_SORT_4)) {
-
+                SmsbDeviceChatScProductVo productVo = smsbDeviceChatScProductMapper.selectVoOne(new LambdaQueryWrapper<SmsbDeviceChatScProduct>()
+                    .eq(SmsbDeviceChatScProduct::getAppointmentId, appointmentInfo.getId())
+                    .eq(SmsbDeviceChatScProduct::getType, 1)
+                    .orderByDesc(SmsbDeviceChatScProduct::getAppointmentId).last("limit 1"));
+                deviceStartInfo.setHelloWorld(productVo.getIntroduction());
+                List<SmsbDeviceChatScProductVo> productVoList = smsbDeviceChatScProductMapper.selectVoList(new LambdaQueryWrapper<SmsbDeviceChatScProduct>()
+                    .eq(SmsbDeviceChatScProduct::getAppointmentId, appointmentInfo.getId())
+                    .eq(SmsbDeviceChatScProduct::getType, 2));
+                if (CollectionUtils.isNotEmpty(productVoList)) {
+                    productContentList = createProductContentList(productVoList);
+                }
             }
             deviceStartInfoList.add(deviceStartInfo);
         }
@@ -539,6 +628,8 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
         syncDatasetsReport(reportContentList, difyScDatasetReportId);
         // 线程2 更新有样学样的知识库
         syncDatasetsCase(caseContentList, difyScDatasetCaseId);
+        // 线程3 更新套餐推荐的知识库
+        syncDatasetsProduct(productContentList, difyScDatasetProductId);
         return R.ok(result);
     }
 
@@ -565,6 +656,17 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
         return contentList;
     }
 
+    private List<String> createProductContentList(List<SmsbDeviceChatScProductVo> productVoList) {
+        List<String> contentList = new ArrayList<>();
+        for (SmsbDeviceChatScProductVo productVo : productVoList) {
+            StringBuilder allContentStr = new StringBuilder();
+            allContentStr.append("套餐名称:").append(productVo.getName()).append("\n");
+            allContentStr.append("套餐简介:").append(productVo.getIntroduction()).append("\n");
+            contentList.add(allContentStr.toString());
+        }
+        return contentList;
+    }
+
     private synchronized void syncDatasetsReport(List<String> contentList, String datasetsId) {
         Runnable transTask = () -> {
             try {
@@ -609,6 +711,28 @@ public class SmsbAppointmentInfoServiceImpl implements ISmsbAppointmentInfoServi
         threadPoolTaskExecutor.submit(transTask);
     }
 
+    private synchronized void syncDatasetsProduct(List<String> contentList, String datasetsId) {
+        Runnable transTask = () -> {
+            try {
+                log.info("syncDatasetsProduct thread begin contentList.size(): " + contentList.size() + ",datasetsId : " + datasetsId);
+                // 组装条目
+                StringBuilder allContentStr = new StringBuilder();
+                for (String content : contentList) {
+                    allContentStr.append("###").append("\n");
+                    allContentStr.append(content).append("\n");
+                }
+                String filePath = createTempFile(allContentStr.toString(), "product_");
+                log.info("syncDatasetsProduct thread createTempFile success tempFilePath = " + filePath);
+                boolean uploadResult = uploadDatasetsToDify(datasetsId,filePath);
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+            log.info("syncDatasetsProduct thread end !");
+        };
+        // 提交Runnable任务到线程池
+        threadPoolTaskExecutor.submit(transTask);
+    }
+
     private boolean uploadDatasetsToDify(String datasetsId, String filePath) {
         // 1、 根据知识库ID 获取文件列表
         List<DifyDatasetsFileRspData> datasetsFiles = getDatasetsFiles(datasetsId);

+ 134 - 0
smsb-modules/smsb-digital-promotion/src/main/java/com/inspur/digital/service/impl/SmsbDeviceChatScProductServiceImpl.java

@@ -0,0 +1,134 @@
+package com.inspur.digital.service.impl;
+
+import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.common.core.utils.StringUtils;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import com.inspur.digital.domain.bo.SmsbDeviceChatScProductBo;
+import com.inspur.digital.domain.vo.SmsbDeviceChatScProductVo;
+import com.inspur.digital.domain.SmsbDeviceChatScProduct;
+import com.inspur.digital.mapper.SmsbDeviceChatScProductMapper;
+import com.inspur.digital.service.ISmsbDeviceChatScProductService;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Collection;
+
+/**
+ * 数促-套餐推荐Service业务层处理
+ *
+ * @author ZhiCheng Fan
+ * @date 2025-07-02
+ */
+@RequiredArgsConstructor
+@Service
+public class SmsbDeviceChatScProductServiceImpl implements ISmsbDeviceChatScProductService {
+
+    private final SmsbDeviceChatScProductMapper baseMapper;
+
+    /**
+     * 查询数促-套餐推荐
+     *
+     * @param id 主键
+     * @return 数促-套餐推荐
+     */
+    @Override
+    public SmsbDeviceChatScProductVo queryById(Long id){
+        return baseMapper.selectVoById(id);
+    }
+
+    /**
+     * 分页查询数促-套餐推荐列表
+     *
+     * @param bo        查询条件
+     * @param pageQuery 分页参数
+     * @return 数促-套餐推荐分页列表
+     */
+    @Override
+    public TableDataInfo<SmsbDeviceChatScProductVo> queryPageList(SmsbDeviceChatScProductBo bo, PageQuery pageQuery) {
+        LambdaQueryWrapper<SmsbDeviceChatScProduct> lqw = buildQueryWrapper(bo);
+        Page<SmsbDeviceChatScProductVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
+        return TableDataInfo.build(result);
+    }
+
+    /**
+     * 查询符合条件的数促-套餐推荐列表
+     *
+     * @param bo 查询条件
+     * @return 数促-套餐推荐列表
+     */
+    @Override
+    public List<SmsbDeviceChatScProductVo> queryList(SmsbDeviceChatScProductBo bo) {
+        LambdaQueryWrapper<SmsbDeviceChatScProduct> lqw = buildQueryWrapper(bo);
+        return baseMapper.selectVoList(lqw);
+    }
+
+    private LambdaQueryWrapper<SmsbDeviceChatScProduct> buildQueryWrapper(SmsbDeviceChatScProductBo bo) {
+        Map<String, Object> params = bo.getParams();
+        LambdaQueryWrapper<SmsbDeviceChatScProduct> lqw = Wrappers.lambdaQuery();
+        lqw.eq(bo.getType() != null, SmsbDeviceChatScProduct::getType, bo.getType());
+        lqw.like(StringUtils.isNotBlank(bo.getName()), SmsbDeviceChatScProduct::getName, bo.getName());
+        lqw.eq(StringUtils.isNotBlank(bo.getPhoto()), SmsbDeviceChatScProduct::getPhoto, bo.getPhoto());
+        lqw.eq(StringUtils.isNotBlank(bo.getIntroduction()), SmsbDeviceChatScProduct::getIntroduction, bo.getIntroduction());
+        lqw.eq(bo.getAppointmentId() != null, SmsbDeviceChatScProduct::getAppointmentId, bo.getAppointmentId());
+        lqw.eq(StringUtils.isNotBlank(bo.getEnterprise()), SmsbDeviceChatScProduct::getEnterprise, bo.getEnterprise());
+        return lqw;
+    }
+
+    /**
+     * 新增数促-套餐推荐
+     *
+     * @param bo 数促-套餐推荐
+     * @return 是否新增成功
+     */
+    @Override
+    public Boolean insertByBo(SmsbDeviceChatScProductBo bo) {
+        SmsbDeviceChatScProduct add = MapstructUtils.convert(bo, SmsbDeviceChatScProduct.class);
+        validEntityBeforeSave(add);
+        boolean flag = baseMapper.insert(add) > 0;
+        if (flag) {
+            bo.setId(add.getId());
+        }
+        return flag;
+    }
+
+    /**
+     * 修改数促-套餐推荐
+     *
+     * @param bo 数促-套餐推荐
+     * @return 是否修改成功
+     */
+    @Override
+    public Boolean updateByBo(SmsbDeviceChatScProductBo bo) {
+        SmsbDeviceChatScProduct update = MapstructUtils.convert(bo, SmsbDeviceChatScProduct.class);
+        validEntityBeforeSave(update);
+        return baseMapper.updateById(update) > 0;
+    }
+
+    /**
+     * 保存前的数据校验
+     */
+    private void validEntityBeforeSave(SmsbDeviceChatScProduct entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    /**
+     * 校验并批量删除数促-套餐推荐信息
+     *
+     * @param ids     待删除的主键集合
+     * @param isValid 是否进行有效性校验
+     * @return 是否删除成功
+     */
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return baseMapper.deleteByIds(ids) > 0;
+    }
+}

+ 7 - 0
smsb-modules/smsb-digital-promotion/src/main/resources/mapper/digital/SmsbDeviceChatScProductMapper.xml

@@ -0,0 +1,7 @@
+<?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.inspur.digital.mapper.SmsbDeviceChatScProductMapper">
+
+</mapper>

+ 63 - 0
smsb-plus-ui/src/api/smsb/digital/deviceChatScProduct/index.ts

@@ -0,0 +1,63 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { DeviceChatScProductVO, DeviceChatScProductForm, DeviceChatScProductQuery } from '@/api/digital/deviceChatScProduct/types';
+
+/**
+ * 查询数促-套餐推荐列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listDeviceChatScProduct = (query?: DeviceChatScProductQuery): AxiosPromise<DeviceChatScProductVO[]> => {
+  return request({
+    url: '/digital/deviceChatScProduct/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询数促-套餐推荐详细
+ * @param id
+ */
+export const getDeviceChatScProduct = (id: string | number): AxiosPromise<DeviceChatScProductVO> => {
+  return request({
+    url: '/digital/deviceChatScProduct/' + id,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增数促-套餐推荐
+ * @param data
+ */
+export const addDeviceChatScProduct = (data: DeviceChatScProductForm) => {
+  return request({
+    url: '/digital/deviceChatScProduct',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改数促-套餐推荐
+ * @param data
+ */
+export const updateDeviceChatScProduct = (data: DeviceChatScProductForm) => {
+  return request({
+    url: '/digital/deviceChatScProduct',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除数促-套餐推荐
+ * @param id
+ */
+export const delDeviceChatScProduct = (id: string | number | Array<string | number>) => {
+  return request({
+    url: '/digital/deviceChatScProduct/' + id,
+    method: 'delete'
+  });
+};

+ 131 - 0
smsb-plus-ui/src/api/smsb/digital/deviceChatScProduct/types.ts

@@ -0,0 +1,131 @@
+export interface DeviceChatScProductVO {
+  /**
+   * 主键ID
+   */
+  id: string | number;
+
+  /**
+   * 类型 1-欢迎语 2-条目
+   */
+  type: number;
+
+  /**
+   * 名称
+   */
+  name: string;
+
+  /**
+   * 图片
+   */
+  photo: string;
+
+  /**
+   * 简介
+   */
+  introduction: string;
+
+  /**
+   * 预约ID
+   */
+  appointmentId: string | number;
+
+  /**
+   * 预约企业
+   */
+  enterprise: string;
+
+  /**
+   * 创建时间
+   */
+  createTime: string;
+
+}
+
+export interface DeviceChatScProductForm extends BaseEntity {
+  /**
+   * 主键ID
+   */
+  id?: string | number;
+
+  /**
+   * 类型 1-欢迎语 2-条目
+   */
+  type?: number;
+
+  /**
+   * 名称
+   */
+  name?: string;
+
+  /**
+   * 图片
+   */
+  photo?: string;
+
+  /**
+   * 简介
+   */
+  introduction?: string;
+
+  /**
+   * 预约ID
+   */
+  appointmentId?: string | number;
+
+  /**
+   * 预约企业
+   */
+  enterprise?: string;
+
+  /**
+   * 创建时间
+   */
+  createTime?: string;
+
+  /**
+   * 租户标识
+   */
+  tenantId?: string | number;
+
+}
+
+export interface DeviceChatScProductQuery extends PageQuery {
+
+  /**
+   * 类型 1-欢迎语 2-条目
+   */
+  type?: number;
+
+  /**
+   * 名称
+   */
+  name?: string;
+
+  /**
+   * 图片
+   */
+  photo?: string;
+
+  /**
+   * 简介
+   */
+  introduction?: string;
+
+  /**
+   * 预约ID
+   */
+  appointmentId?: string | number;
+
+  /**
+   * 预约企业
+   */
+  enterprise?: string;
+
+    /**
+     * 日期范围参数
+     */
+    params?: any;
+}
+
+
+

+ 242 - 0
smsb-plus-ui/src/views/smsb/deviceChatScProduct/index.vue

@@ -0,0 +1,242 @@
+<template>
+  <div class="p-2">
+    <transition :enter-active-class="proxy?.animate.searchAnimate.enter"
+                :leave-active-class="proxy?.animate.searchAnimate.leave">
+      <div v-show="showSearch" class="mb-[10px]">
+        <el-card shadow="hover" :style="{ marginTop: '10px', height: '60px' }">
+          <el-form ref="queryFormRef" :model="queryParams" :inline="true">
+            <el-form-item label="套餐名称" prop="name">
+              <el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter="handleQuery"/>
+            </el-form-item>
+            <el-form-item label="预约企业" prop="enterprise">
+              <el-input v-model="queryParams.enterprise" placeholder="请输入预约企业" clearable
+                        @keyup.enter="handleQuery"/>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+            </el-form-item>
+          </el-form>
+        </el-card>
+      </div>
+    </transition>
+
+    <el-card shadow="never">
+      <!--      <template #header>-->
+      <!--        <el-row :gutter="10" class="mb8">-->
+      <!--          <el-col :span="1.5">-->
+      <!--            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['digital:deviceChatScProduct:add']">新增</el-button>-->
+      <!--          </el-col>-->
+      <!--          <el-col :span="1.5">-->
+      <!--            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['digital:deviceChatScProduct:edit']">修改</el-button>-->
+      <!--          </el-col>-->
+      <!--          <el-col :span="1.5">-->
+      <!--            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['digital:deviceChatScProduct:remove']">删除</el-button>-->
+      <!--          </el-col>-->
+      <!--          <el-col :span="1.5">-->
+      <!--            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['digital:deviceChatScProduct:export']">导出</el-button>-->
+      <!--          </el-col>-->
+      <!--          <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
+      <!--        </el-row>-->
+      <!--      </template>-->
+
+      <div class="table-content">
+        <el-table v-loading="loading" :data="deviceChatScProductList" @selection-change="handleSelectionChange">
+          <el-table-column label="" align="left" prop=""  width="10"/>
+          <el-table-column label="ID" align="left" prop="id" v-if="true" width="175"/>
+          <el-table-column label="套餐名称" align="left" prop="name" width="280" :show-overflow-tooltip="true"/>
+          <el-table-column label="套餐图片" align="center" prop="photo" width="100">
+            <template #default="scope">
+              <image-preview :src="scope.row.photo" style="width: 40px; height: 40px; cursor: pointer"/>
+            </template>
+          </el-table-column>
+          <el-table-column label="预约企业" align="left" prop="enterprise" width="250" :show-overflow-tooltip="true"/>
+          <el-table-column label="简介" align="left" prop="introduction" :show-overflow-tooltip="true"/>
+          <el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
+          <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
+            <template #default="scope">
+              <el-tooltip content="修改" placement="top">
+                <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
+                           v-hasPermi="['digital:deviceChatScProduct:edit']"></el-button>
+              </el-tooltip>
+              <el-tooltip content="删除" placement="top">
+                <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
+                           v-hasPermi="['digital:deviceChatScProduct:remove']"></el-button>
+              </el-tooltip>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
+                  v-model:limit="queryParams.pageSize" @pagination="getList"/>
+    </el-card>
+    <!-- 添加或修改数促-套餐推荐对话框 -->
+    <el-dialog :title="dialog.title" v-model="dialog.visible" width="1000px" append-to-body>
+      <el-form ref="deviceChatScProductFormRef" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="套餐名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入名称"/>
+        </el-form-item>
+        <el-form-item label="简介" prop="introduction">
+          <el-input v-model="form.introduction" type="textarea" :rows="5" placeholder="请输入内容"/>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup name="DeviceChatScProduct" lang="ts">
+import {
+  listDeviceChatScProduct,
+  getDeviceChatScProduct,
+  delDeviceChatScProduct,
+  addDeviceChatScProduct,
+  updateDeviceChatScProduct
+} from '@/api/smsb/digital/deviceChatScProduct';
+import {
+  DeviceChatScProductVO,
+  DeviceChatScProductQuery,
+  DeviceChatScProductForm
+} from '@/api/smsb/digital/deviceChatScProduct/types';
+
+const {proxy} = getCurrentInstance() as ComponentInternalInstance;
+
+const deviceChatScProductList = ref<DeviceChatScProductVO[]>([]);
+const buttonLoading = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref<Array<string | number>>([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+
+const queryFormRef = ref<ElFormInstance>();
+const deviceChatScProductFormRef = ref<ElFormInstance>();
+
+const dialog = reactive<DialogOption>({
+  visible: false,
+  title: ''
+});
+
+const initFormData: DeviceChatScProductForm = {
+  id: undefined,
+  type: undefined,
+  name: undefined,
+  photo: undefined,
+  introduction: undefined,
+  appointmentId: undefined,
+  enterprise: undefined,
+  createTime: undefined,
+  tenantId: undefined
+}
+const data = reactive<PageData<DeviceChatScProductForm, DeviceChatScProductQuery>>({
+  form: {...initFormData},
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    type: 2,
+    name: undefined,
+    photo: undefined,
+    introduction: undefined,
+    appointmentId: undefined,
+    enterprise: undefined,
+    params: {}
+  },
+  rules: {}
+});
+
+const {queryParams, form, rules} = toRefs(data);
+
+/** 查询数促-套餐推荐列表 */
+const getList = async () => {
+  loading.value = true;
+  const res = await listDeviceChatScProduct(queryParams.value);
+  deviceChatScProductList.value = res.rows;
+  total.value = res.total;
+  loading.value = false;
+}
+
+/** 取消按钮 */
+const cancel = () => {
+  reset();
+  dialog.visible = false;
+}
+
+/** 表单重置 */
+const reset = () => {
+  form.value = {...initFormData};
+  deviceChatScProductFormRef.value?.resetFields();
+}
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.value.pageNum = 1;
+  getList();
+}
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields();
+  handleQuery();
+}
+
+/** 多选框选中数据 */
+const handleSelectionChange = (selection: DeviceChatScProductVO[]) => {
+  ids.value = selection.map(item => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+}
+
+/** 修改按钮操作 */
+const handleUpdate = async (row?: DeviceChatScProductVO) => {
+  reset();
+  const _id = row?.id || ids.value[0]
+  const res = await getDeviceChatScProduct(_id);
+  Object.assign(form.value, res.data);
+  dialog.visible = true;
+  dialog.title = "套餐推荐";
+}
+
+/** 提交按钮 */
+const submitForm = () => {
+  deviceChatScProductFormRef.value?.validate(async (valid: boolean) => {
+    if (valid) {
+      buttonLoading.value = true;
+      if (form.value.id) {
+        await updateDeviceChatScProduct(form.value).finally(() => buttonLoading.value = false);
+      } else {
+        await addDeviceChatScProduct(form.value).finally(() => buttonLoading.value = false);
+      }
+      proxy?.$modal.msgSuccess("操作成功");
+      dialog.visible = false;
+      await getList();
+    }
+  });
+}
+
+/** 删除按钮操作 */
+const handleDelete = async (row?: DeviceChatScProductVO) => {
+  const _ids = row?.id || ids.value;
+  await proxy?.$modal.confirm('是否确认删除数促-套餐推荐编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
+  await delDeviceChatScProduct(_ids);
+  proxy?.$modal.msgSuccess("删除成功");
+  await getList();
+}
+
+/** 导出按钮操作 */
+const handleExport = () => {
+  proxy?.download('digital/deviceChatScProduct/export', {
+    ...queryParams.value
+  }, `deviceChatScProduct_${new Date().getTime()}.xlsx`)
+}
+
+onMounted(() => {
+  getList();
+});
+</script>