Просмотр исходного кода

Merge branch 'master' into 康年堂

ct 4 дней назад
Родитель
Сommit
b584937e2a
45 измененных файлов с 629 добавлено и 116 удалено
  1. 139 0
      deploy - test.sh
  2. 1 1
      fs-ad-new-api/src/main/java/com/fs/app/controller/CallbackController.java
  3. 47 27
      fs-ad-new-api/src/main/java/com/fs/app/controller/WeChatController.java
  4. 1 0
      fs-ad-new-api/src/main/java/com/fs/app/facade/CallbackProcessingFacadeServiceImpl.java
  5. 1 0
      fs-ad-new-api/src/main/resources/application.yml
  6. 25 4
      fs-admin/src/main/java/com/fs/his/controller/FsStorePaymentController.java
  7. 15 1
      fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java
  8. 2 1
      fs-admin/src/main/java/com/fs/live/controller/OrderController.java
  9. 12 3
      fs-company/src/main/java/com/fs/company/controller/live/LiveDataController.java
  10. 1 0
      fs-company/src/main/java/com/fs/company/controller/live/OrderController.java
  11. 5 3
      fs-live-app/src/main/java/com/fs/live/task/Task.java
  12. 2 2
      fs-live-app/src/main/java/com/fs/live/websocket/auth/WebSocketConfigurator.java
  13. 7 3
      fs-live-app/src/main/java/com/fs/live/websocket/service/WebSocketServer.java
  14. 1 1
      fs-service/src/main/java/com/fs/fastGpt/service/impl/AiHookServiceImpl.java
  15. 5 0
      fs-service/src/main/java/com/fs/his/domain/FsStorePaymentError.java
  16. 9 0
      fs-service/src/main/java/com/fs/his/service/IFsStorePaymentErrorService.java
  17. 21 0
      fs-service/src/main/java/com/fs/his/service/impl/FsStorePaymentErrorServiceImpl.java
  18. 44 5
      fs-service/src/main/java/com/fs/his/service/impl/FsStorePaymentServiceImpl.java
  19. 1 1
      fs-service/src/main/java/com/fs/live/domain/LiveOrder.java
  20. 11 7
      fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java
  21. 14 12
      fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java
  22. 1 1
      fs-service/src/main/java/com/fs/live/vo/LiveUserDetailExportVO.java
  23. 16 11
      fs-service/src/main/java/com/fs/live/vo/MergedOrderExportVO.java
  24. 2 0
      fs-service/src/main/java/com/fs/live/vo/MergedOrderVO.java
  25. 18 0
      fs-service/src/main/java/com/fs/newAdv/controller/AdvMiniConfigController.java
  26. 58 0
      fs-service/src/main/java/com/fs/newAdv/domain/AdvMiniConfig.java
  27. 2 2
      fs-service/src/main/java/com/fs/newAdv/domain/PromotionAccount.java
  28. 2 2
      fs-service/src/main/java/com/fs/newAdv/integration/client/advertiser/BaiduApiClient.java
  29. 44 6
      fs-service/src/main/java/com/fs/newAdv/integration/client/advertiser/TencentApiClient.java
  30. 18 0
      fs-service/src/main/java/com/fs/newAdv/mapper/AdvMiniConfigMapper.java
  31. 16 0
      fs-service/src/main/java/com/fs/newAdv/service/IAdvMiniConfigService.java
  32. 1 1
      fs-service/src/main/java/com/fs/newAdv/service/ILeadService.java
  33. 20 0
      fs-service/src/main/java/com/fs/newAdv/service/impl/AdvMiniConfigServiceImpl.java
  34. 6 4
      fs-service/src/main/java/com/fs/newAdv/service/impl/LeadServiceImpl.java
  35. 1 1
      fs-service/src/main/java/com/fs/newAdv/vo/AccessTokenByAuthCodeVo.java
  36. 11 0
      fs-service/src/main/java/com/fs/qw/domain/QwCompany.java
  37. 4 0
      fs-service/src/main/java/com/fs/qw/service/impl/QwUserServiceImpl.java
  38. 1 1
      fs-service/src/main/resources/application-config-druid-cfryt.yml
  39. 11 1
      fs-service/src/main/resources/mapper/his/FsStorePaymentErrorMapper.xml
  40. 1 1
      fs-service/src/main/resources/mapper/his/FsUserMapper.xml
  41. 7 4
      fs-service/src/main/resources/mapper/hisStore/MergedOrderMapper.xml
  42. 1 1
      fs-service/src/main/resources/mapper/live/LiveCompletionPointsRecordMapper.xml
  43. 7 7
      fs-service/src/main/resources/mapper/live/LiveDataMapper.xml
  44. 16 1
      fs-service/src/main/resources/mapper/qw/QwCompanyMapper.xml
  45. 1 1
      fs-user-app/src/main/java/com/fs/app/controller/store/WxUserScrmController.java

+ 139 - 0
deploy - test.sh

@@ -0,0 +1,139 @@
+#!/bin/bash
+
+# 各服务对应的远程服务器配置 公司本地
+declare -A SERVER_CONFIG=(
+    # 服务名:IP地址
+    ["fs-live-app"]="129.28.193.135"
+)
+
+# 通用配置(所有服务器相同)
+REMOTE_USER="root"
+REMOTE_BASE_DIR="/home/software"
+
+# 本地 JAR 包路径
+LOCAL_FS_LIVE_SOCKET_JAR="./fs-live-app/target/fs-live-app.jar"
+
+# 函数:检查本地文件是否存在
+check_local_file() {
+    if [ ! -f "$1" ]; then
+        echo "错误: 本地文件 $1 不存在。"
+        exit 1
+    fi
+}
+
+# 停止远程服务器上可能正在运行的旧版本
+stop_remote_app() {
+    local remote_user=$1
+    local remote_host=$2
+    local app_name=$3
+
+    echo "正在停止 $remote_host 上的 $app_name 服务..."
+    ssh "$remote_user@$remote_host" "pkill -f $app_name || echo '没有找到运行中的进程'"
+}
+
+# 检查服务器连通性
+check_server_connectivity() {
+    local remote_user=$1
+    local remote_host=$2
+
+    if ! ssh -o ConnectTimeout=5 "$remote_user@$remote_host" "echo '连接成功'" &>/dev/null; then
+        echo "错误: 无法连接到服务器 $remote_host"
+        return 1
+    fi
+    return 0
+}
+
+# 部署单个 JAR 包到指定服务器
+deploy_jar() {
+    local local_jar=$1
+    local service_name=$2  # 服务名,用于确定目标服务器
+    local remote_dir=$3     # 远程目录名
+
+    # 获取服务对应的服务器IP
+    local remote_host="${SERVER_CONFIG[$service_name]}"
+    if [ -z "$remote_host" ]; then
+        echo "错误: 未找到服务 $service_name 的服务器配置"
+        return 1
+    fi
+
+    local app_name=$(basename "$local_jar" .jar)
+
+    echo "========================================"
+    echo "开始部署 $service_name 到服务器 $remote_host"
+    echo "本地文件: $local_jar"
+    echo "远程目录: $REMOTE_BASE_DIR/$remote_dir"
+    echo "========================================"
+
+    # 检查本地文件
+    check_local_file "$local_jar"
+
+    # 检查服务器连通性
+    if ! check_server_connectivity "$REMOTE_USER" "$remote_host"; then
+        return 1
+    fi
+
+    # 创建远程目录(如果不存在)
+    echo "创建远程目录..."
+    ssh "$REMOTE_USER@$remote_host" "mkdir -p $REMOTE_BASE_DIR/$remote_dir"
+
+    # 停止旧版本
+    stop_remote_app "$REMOTE_USER" "$remote_host" "$app_name"
+
+    # 上传 JAR 包
+    echo "上传 JAR 包..."
+    scp "$local_jar" "$REMOTE_USER@$remote_host:$REMOTE_BASE_DIR/$remote_dir/"
+
+    # 在后台启动 JAR 包
+    echo "启动服务..."
+    ssh -f "$REMOTE_USER@$remote_host" \
+    "cd $REMOTE_BASE_DIR/$remote_dir && \
+     nohup java -jar -Xms1g -Xmx2g -XX:+UseG1GC -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8 $app_name.jar --spring.profiles.active=druid-ylrz --server.port=7114  \
+     >> $app_name.log 2>&1 &"
+
+    # 检查进程是否启动成功
+    if ssh "$REMOTE_USER@$remote_host" "pgrep -f $app_name" &>/dev/null; then
+        echo "✓ $service_name 部署成功到 $remote_host"
+    else
+        echo "✗ $service_name 启动失败,请检查日志: $REMOTE_BASE_DIR/$remote_dir/$app_name.log"
+        return 1
+    fi
+
+    echo ""
+}
+
+# 主要部署流程
+echo "开始多服务器分布式部署..."
+echo "部署配置:"
+for service in "${!SERVER_CONFIG[@]}"; do
+    echo "  $service -> ${SERVER_CONFIG[$service]}"
+done
+echo ""
+
+# 部署 fs-live-app
+deploy_jar "$LOCAL_FS_LIVE_SOCKET_JAR" "fs-live-app" "fs-live-app"
+
+# 部署 fs-sync (注意:这里使用了不同的JAR命名方式)
+#deploy_jar "$LOCAL_FS_SYNC_APP_JAR" "fs-sync" "fs-sync"
+
+echo "========================================"
+echo "分布式部署完成!"
+echo "各服务部署状态:"
+for service in "${!SERVER_CONFIG[@]}"; do
+    remote_host="${SERVER_CONFIG[$service]}"
+    echo "  $service -> $remote_host"
+done
+echo "========================================"
+
+# 可选:显示各服务进程状态
+#echo "服务进程状态检查:"
+#for service in "${!SERVER_CONFIG[@]}"; do
+#    remote_host="${SERVER_CONFIG[$service]}"
+#    app_name="$service"  # 简化处理,实际可能需要根据JAR文件名调整
+#    if ssh "$REMOTE_USER@$remote_host" "pgrep -f $app_name" &>/dev/null; then
+#        echo "  ✓ $service 在 $remote_host 上运行正常"
+#    else
+#        echo "  ✗ $service 在 $remote_host 上未运行"
+#    fi
+#done
+
+# 251105 0953

+ 1 - 1
fs-ad-new-api/src/main/java/com/fs/app/controller/CallbackController.java

@@ -111,7 +111,7 @@ public class CallbackController {
         IAccessTokenClient tokenClient = (IAccessTokenClient) apiClient;
         AccessTokenVo accessToken = tokenClient.getAccessTokenByAuthCode(AccessTokenByAuthCodeVo
                 .builder()
-                .userId(byId.getAdAccountId())
+                .adAccountId(byId.getAdAccountId())
                 .appId(byId.getAppId())
                 .authCode(authCode)
                 .appSecret(byId.getAppSecret())

+ 47 - 27
fs-ad-new-api/src/main/java/com/fs/app/controller/WeChatController.java

@@ -4,9 +4,12 @@ import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpResponse;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fs.app.facade.CallbackProcessingFacadeService;
 import com.fs.common.constant.SystemConstant;
 import com.fs.common.result.Result;
+import com.fs.newAdv.domain.AdvMiniConfig;
+import com.fs.newAdv.service.IAdvMiniConfigService;
 import com.fs.wx.miniapp.config.WxMaProperties;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -15,7 +18,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.time.LocalDateTime;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -34,34 +39,49 @@ public class WeChatController {
     @Autowired
     private WxMaProperties properties;
 
+    @Autowired
+    private IAdvMiniConfigService advMiniConfigService;
+
     @GetMapping("/getSchemeUrl")
     public Result<String> getSchemeUrl(@RequestParam(value = "traceId") String traceId) {
-        String appId = "wx0447a16ef6199f03";
-        String secret = "f063fcd818e31d4c89013a67f5123990";
-        HttpResponse execute2 = HttpRequest.get("https://api.weixin.qq.com/cgi-bin/token")
-                .form("grant_type", "client_credential")
-                .form("appid", appId)
-                .form("secret", secret)
-                .timeout(SystemConstant.API_TIMEOUT)
-                .execute();
-        JSONObject obj = JSONObject.parseObject(execute2.body());
-        String access_token = obj.getString("access_token");
-
-        Map<String, Object> map = new HashMap<>();
-        Map<String, Object> map2 = new HashMap<>();
-        map2.put("path", "/pages/shopping/productDetails");
-        map2.put("query", "traceId=" + traceId);
-        //map2.put("env_version", "trial");
-        map.put("jump_wxa", map2);
-        map.put("is_expire", false);
-        HttpResponse execute = HttpRequest.post("https://api.weixin.qq.com/wxa/generatescheme?access_token=" + access_token)
-                .header("Content-Type", "application/json")
-                .body(JSONUtil.toJsonStr(map))
-                .timeout(SystemConstant.API_TIMEOUT)
-                .execute();
-        log.info("getSchemeUrl:{}", execute.body());
-        obj = JSONObject.parseObject(execute.body());
-        //response.addHeader("Access-Control-Allow-Origin", "*");
-        return Result.success(obj.getString("openlink"));
+        List<AdvMiniConfig> list = advMiniConfigService.list(new LambdaQueryWrapper<AdvMiniConfig>()
+                .eq(AdvMiniConfig::getStatus, 1));
+        for (AdvMiniConfig advMiniConfig : list) {
+            try {
+                String access_token = advMiniConfig.getAccessToken();
+                // 判断token是否过期
+                if (advMiniConfig.getExpiresIn().isBefore(LocalDateTime.now().plusMinutes(10))) {
+                    HttpResponse execute2 = HttpRequest.get("https://api.weixin.qq.com/cgi-bin/token")
+                            .form("grant_type", "client_credential")
+                            .form("appid", advMiniConfig.getAppId())
+                            .form("secret", advMiniConfig.getAppSecret())
+                            .timeout(SystemConstant.API_TIMEOUT)
+                            .execute();
+                    JSONObject obj = JSONObject.parseObject(execute2.body());
+                    access_token = obj.getString("access_token");
+                    advMiniConfig.setAccessToken(access_token);
+                    advMiniConfigService.updateById(advMiniConfig);
+                }
+                Map<String, Object> map = new HashMap<>();
+                Map<String, Object> map2 = new HashMap<>();
+                map2.put("path", "pages/home/productList");
+                map2.put("query", "traceId=" + traceId);
+                map2.put("env_version", "trial");
+                map.put("jump_wxa", map2);
+                map.put("is_expire", false);
+                HttpResponse execute = HttpRequest.post("https://api.weixin.qq.com/wxa/generatescheme?access_token=" + access_token)
+                        .header("Content-Type", "application/json")
+                        .body(JSONUtil.toJsonStr(map))
+                        .timeout(SystemConstant.API_TIMEOUT)
+                        .execute();
+                log.info("getSchemeUrl:{}", execute.body());
+                JSONObject jsonObject = JSONObject.parseObject(execute.body());
+                //response.addHeader("Access-Control-Allow-Origin", "*");
+                return Result.success(jsonObject.getString("openlink"));
+            }catch (Exception e){
+                log.error("getSchemeUrl error:{}",advMiniConfig.getAppId(), e);
+            }
+        }
+        return Result.success("");
     }
 }

+ 1 - 0
fs-ad-new-api/src/main/java/com/fs/app/facade/CallbackProcessingFacadeServiceImpl.java

@@ -221,6 +221,7 @@ public class CallbackProcessingFacadeServiceImpl implements CallbackProcessingFa
                                                Integer allocationRule,
                                                Long allocationRuleId,
                                                Lead byTraceId) {
+
         // 二维码
         String qrCode = "";
         if (allocationRule == 1) {

+ 1 - 0
fs-ad-new-api/src/main/resources/application.yml

@@ -7,3 +7,4 @@ spring:
     active: dev
 #    active: druid-ylrz
 
+#

+ 25 - 4
fs-admin/src/main/java/com/fs/his/controller/FsStorePaymentController.java

@@ -5,10 +5,10 @@ import java.util.List;
 
 import com.fs.common.core.domain.R;
 import com.fs.common.utils.SecurityUtils;
-import com.fs.his.domain.FsExportTask;
+import com.fs.his.domain.*;
 import com.fs.his.mapper.FsPrescribeMapper;
 import com.fs.his.param.FsStorePaymentParam;
-import com.fs.his.service.IFsExportTaskService;
+import com.fs.his.service.*;
 import com.fs.his.vo.FsStorePaymentExcelVO;
 import com.fs.his.vo.FsStorePaymentVO;
 import lombok.extern.slf4j.Slf4j;
@@ -26,8 +26,6 @@ import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.enums.BusinessType;
-import com.fs.his.domain.FsStorePayment;
-import com.fs.his.service.IFsStorePaymentService;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.common.core.page.TableDataInfo;
 
@@ -44,11 +42,17 @@ public class FsStorePaymentController extends BaseController
 {
     @Autowired
     private IFsStorePaymentService fsStorePaymentService;
+
+    @Autowired
+    private IFsStorePaymentErrorService fsStorePaymentErrorService;
     @Autowired
     FsPrescribeMapper fsPrescribeMapper;
 
     @Autowired
     private IFsExportTaskService exportTaskService;
+    @Autowired
+    private IFsPackageOrderService fsPackageOrderService;
+
     /**
      * 查询支付明细列表
      */
@@ -169,4 +173,21 @@ public class FsStorePaymentController extends BaseController
     {
         return toAjax(fsStorePaymentService.deleteFsStorePaymentByPaymentIds(paymentIds));
     }
+
+    /**
+     * 查询支付错误明细
+     */
+    @GetMapping("/error/list")
+    public TableDataInfo list(FsStorePaymentError fsStorePaymentError)
+    {
+        startPage();
+        List<FsStorePaymentError> list = fsStorePaymentErrorService.selectFsStorePaymentErrorList(fsStorePaymentError);
+        for (FsStorePaymentError vo : list){
+            if (vo.getBusinessType() != null && vo.getBusinessType()==3 &&  vo.getOrderId() != null) {
+                FsPackageOrder fsPackageOrder = fsPackageOrderService.selectFsPackageOrderByOrderId(vo.getOrderId());
+                vo.setOrderNo(fsPackageOrder.getOrderSn());
+            }
+        }
+        return getDataTable(list);
+    }
 }

+ 15 - 1
fs-admin/src/main/java/com/fs/live/controller/LiveDataController.java

@@ -8,6 +8,8 @@ import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.SecurityUtils;
 import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.CompanyUser;
+import com.fs.framework.web.service.TokenService;
 import com.fs.live.domain.LiveData;
 import com.fs.live.param.LiveDataParam;
 import com.fs.live.service.ILiveDataService;
@@ -29,6 +31,8 @@ public class LiveDataController extends BaseController {
 
     @Autowired
     private ILiveDataService liveDataService;
+    @Autowired
+    private TokenService tokenService;
 
     /**
      * 直播数据页面卡片数据
@@ -128,11 +132,21 @@ public class LiveDataController extends BaseController {
     /**
      * 查询直播间用户详情列表(SQL方式)
      * @param liveId 直播间ID
+     * @param pageNum 页码
+     * @param pageSize 每页大小
      * @return 用户详情列表
      */
     @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
     @GetMapping("/getLiveUserDetailListBySql")
-    public R getLiveUserDetailListBySql(@RequestParam Long liveId) {
+    public R getLiveUserDetailListBySql(@RequestParam Long liveId,
+                                        @RequestParam(defaultValue = "1") Integer pageNum,
+                                        @RequestParam(defaultValue = "100") Integer pageSize) {
+        // 限制最大每页查询条数为1000
+        if (pageSize > 1000) {
+            pageSize = 1000;
+        }
+
+        PageHelper.startPage(pageNum, pageSize);
         return liveDataService.getLiveUserDetailListBySql(liveId,null,null);
     }
 

+ 2 - 1
fs-admin/src/main/java/com/fs/live/controller/OrderController.java

@@ -262,7 +262,8 @@ public class OrderController extends BaseController
             // 时间信息
             exportVO.setCreateTime(vo.getCreateTime());
             exportVO.setPayTime(vo.getPayTime());
-            
+            exportVO.setHfshh(vo.getHfshh());
+
             // 物流信息
             exportVO.setDeliverySn(vo.getDeliveryCode()); // 快递公司编号,合并订单暂无此字段
             exportVO.setDeliveryName(vo.getDeliveryName()); // 快递公司,合并订单暂无此字段

+ 12 - 3
fs-company/src/main/java/com/fs/company/controller/live/LiveDataController.java

@@ -55,17 +55,26 @@ public class LiveDataController extends BaseController
     /**
      * 查询直播间用户详情列表(SQL方式)
      * @param liveId 直播间ID
+     * @param pageNum 页码
+     * @param pageSize 每页大小
      * @return 用户详情列表
      */
     @PreAuthorize("@ss.hasPermi('liveData:liveData:query')")
     @GetMapping("/getLiveUserDetailListBySql")
-    public R getLiveUserDetailListBySql(@RequestParam Long liveId, HttpServletRequest request) {
+    public R getLiveUserDetailListBySql(@RequestParam Long liveId, 
+                                        @RequestParam(defaultValue = "1") Integer pageNum,
+                                        @RequestParam(defaultValue = "100") Integer pageSize,
+                                        HttpServletRequest request) {
+        // 限制最大每页查询条数为1000
+        if (pageSize > 1000) {
+            pageSize = 1000;
+        }
+        PageHelper.startPage(pageNum, pageSize);
         CompanyUser user = tokenService.getLoginUser(request).getUser();
         if ("00".equals(user.getUserType())) {
             return liveDataService.getLiveUserDetailListBySql(liveId,user.getCompanyId(),null);
         }
-        return liveDataService.getLiveUserDetailListBySql(liveId,user.getCompanyId(),user.getUserId());
-    }
+        return liveDataService.getLiveUserDetailListBySql(liveId,user.getCompanyId(),user.getUserId());    }
 
     /**
      * 查询直播间详情数据(查询数据服务器处理方式)

+ 1 - 0
fs-company/src/main/java/com/fs/company/controller/live/OrderController.java

@@ -270,6 +270,7 @@ public class OrderController extends BaseController
             // 公司和销售信息
             exportVO.setCompanyName(vo.getCompanyName());
             exportVO.setCompanyUserNickName(vo.getCompanyUserNickName());
+            exportVO.setHfshh(vo.getHfshh());
 
             // 套餐信息
             exportVO.setPackageName(null); // 套餐名称,合并订单暂无此字段

+ 5 - 3
fs-live-app/src/main/java/com/fs/live/task/Task.java

@@ -415,7 +415,7 @@ public class Task {
         for (Live openRewardLive : openRewardLives) {
             String configJson = openRewardLive.getConfigJson();
             LiveWatchConfig config = JSON.parseObject(configJson, LiveWatchConfig.class);
-            if (config.getEnabled()) {
+            if (config.getEnabled() && 1 == config.getParticipateCondition()) {
                 List<LiveWatchUser> liveWatchUsers = liveWatchUserService.checkOnlineNoRewardUser(openRewardLive.getLiveId(), now);
                 if (liveWatchUsers == null || liveWatchUsers.isEmpty()) {
                     continue;
@@ -633,7 +633,7 @@ public class Task {
     }
 
     /**
-     * 定时扫描开启的直播间,检查是否到了打标签的时间
+     * 定时扫描开启的直播间,检查是否到了打标签的时间,然后把正在看直播的用户拆分为 直播用户和回放用户
      * 每10秒执行一次
      */
     @Scheduled(cron = "0/10 * * * * ?")
@@ -896,6 +896,9 @@ public class Task {
                             List<LiveWatchLog> batch = updateLog.subList(i, end);
                             liveWatchLogService.batchUpdateLiveWatchLog(batch);
                         }
+                        for (LiveWatchLog liveWatchLog : updateLog) {
+                            redisCache.setCacheObject("live:watch:log:cache:" + liveWatchLog.getLogId(), liveWatchLog, 1, TimeUnit.HOURS);
+                        }
                     }
                     
                 } catch (Exception e) {
@@ -923,7 +926,6 @@ public class Task {
             // 查询 LiveWatchLog
             LiveWatchLog queryLog = new LiveWatchLog();
             queryLog.setLiveId(liveId);
-            queryLog.setUserId(userId);
             queryLog.setQwUserId(String.valueOf(qwUserId));
             queryLog.setExternalContactId(exId);
 

+ 2 - 2
fs-live-app/src/main/java/com/fs/live/websocket/auth/WebSocketConfigurator.java

@@ -56,10 +56,10 @@ public class WebSocketConfigurator extends ServerEndpointConfig.Configurator {
             userProperties.put(AttrConstant.LOCATION, parameterMap.get(AttrConstant.LOCATION).get(0));
         }
         if (parameterMap.containsKey(AttrConstant.QW_USER_ID)) {
-            userProperties.put(AttrConstant.QW_USER_ID, parameterMap.get(AttrConstant.QW_USER_ID).get(0));
+            userProperties.put(AttrConstant.QW_USER_ID, Long.valueOf(parameterMap.get(AttrConstant.QW_USER_ID).get(0)));
         }
         if (parameterMap.containsKey(AttrConstant.EXTERNAL_CONTACT_ID)) {
-            userProperties.put(AttrConstant.EXTERNAL_CONTACT_ID, parameterMap.get(AttrConstant.EXTERNAL_CONTACT_ID).get(0));
+            userProperties.put(AttrConstant.EXTERNAL_CONTACT_ID, Long.valueOf(parameterMap.get(AttrConstant.EXTERNAL_CONTACT_ID).get(0)));
         }
 
         // 验证token

+ 7 - 3
fs-live-app/src/main/java/com/fs/live/websocket/service/WebSocketServer.java

@@ -137,8 +137,14 @@ public class WebSocketServer {
             room.put(userId, session);
             
             // 存储用户进入直播间的时间到 Redis(用于计算在线时长)
+            // 如果已经存在进入时间,说明是重连,不应该覆盖,保持原来的进入时间
             String entryTimeKey = String.format(USER_ENTRY_TIME_KEY, liveId, userId);
-            redisCache.setCacheObject(entryTimeKey, System.currentTimeMillis(), 24, TimeUnit.HOURS);
+            Long existingEntryTime = redisCache.getCacheObject(entryTimeKey);
+            if (existingEntryTime == null) {
+                // 首次连接,记录进入时间
+                redisCache.setCacheObject(entryTimeKey, System.currentTimeMillis(), 24, TimeUnit.HOURS);
+            }
+            // 如果是重连,不覆盖进入时间,保持原来的进入时间以便正确计算总时长
             
             // 直播间浏览量 +1
             redisCache.incr(PAGE_VIEWS_KEY + liveId, 1);
@@ -1178,7 +1184,6 @@ public class WebSocketServer {
         try {
             LiveWatchLog queryLog = new LiveWatchLog();
             queryLog.setLiveId(liveId);
-            queryLog.setUserId(userId);
             queryLog.setQwUserId(String.valueOf(qwUserId));
             queryLog.setExternalContactId(externalContactId);
             
@@ -1302,7 +1307,6 @@ public class WebSocketServer {
             // 查询 LiveWatchLog
             LiveWatchLog queryLog = new LiveWatchLog();
             queryLog.setLiveId(liveId);
-            queryLog.setUserId(userId);
             queryLog.setCompanyId(companyId);
             queryLog.setCompanyUserId(companyUserId);
             

+ 1 - 1
fs-service/src/main/java/com/fs/fastGpt/service/impl/AiHookServiceImpl.java

@@ -819,7 +819,7 @@ public class AiHookServiceImpl implements AiHookService {
                                         .append("\uD83C\uDF39\uD83C\uDF39\uD83C\uDF39");
                             case 3:
                                 ExpressInfoDTO expressInfo = getExpress(fsStoreOrder.getOrderId());
-                                sBuilder.append("您购买的有一个包裹 ");
+                                sBuilder.append("您有一个包裹 ");
                                 sBuilder.append(" 已经查询到了,正在配送中了。\n");
                                 if(expressInfo != null && expressInfo.getTraces() != null && !expressInfo.getTraces().isEmpty()){
                                     List<TracesDTO> traces = expressInfo.getTraces();

+ 5 - 0
fs-service/src/main/java/com/fs/his/domain/FsStorePaymentError.java

@@ -35,4 +35,9 @@ public class FsStorePaymentError extends BaseEntity
     @Excel(name = "0未处理 1已处理")
     private Integer status;
 
+
+    private Long orderId;
+
+    private Integer businessType;
+
 }

+ 9 - 0
fs-service/src/main/java/com/fs/his/service/IFsStorePaymentErrorService.java

@@ -0,0 +1,9 @@
+package com.fs.his.service;
+
+import com.fs.his.domain.FsStorePaymentError;
+
+import java.util.List;
+
+public interface IFsStorePaymentErrorService {
+    List<FsStorePaymentError> selectFsStorePaymentErrorList(FsStorePaymentError fsStorePaymentError);
+}

+ 21 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsStorePaymentErrorServiceImpl.java

@@ -0,0 +1,21 @@
+package com.fs.his.service.impl;
+
+import com.fs.his.domain.FsStorePaymentError;
+import com.fs.his.mapper.FsStorePaymentErrorMapper;
+import com.fs.his.service.IFsStorePaymentErrorService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class FsStorePaymentErrorServiceImpl implements IFsStorePaymentErrorService {
+    @Autowired
+    private FsStorePaymentErrorMapper fsStorePaymentErrorMapper;
+
+    public List<FsStorePaymentError> selectFsStorePaymentErrorList(FsStorePaymentError fsStorePaymentError){
+        return fsStorePaymentErrorMapper.selectFsStorePaymentErrorList(fsStorePaymentError);
+    }
+
+
+}

+ 44 - 5
fs-service/src/main/java/com/fs/his/service/impl/FsStorePaymentServiceImpl.java

@@ -48,9 +48,7 @@ import com.fs.his.domain.*;
 import com.fs.his.dto.PayConfigDTO;
 import com.fs.his.enums.PaymentMethodEnum;
 import com.fs.his.mapper.*;
-import com.fs.his.param.FsStorePaymentParam;
-import com.fs.his.param.PayOrderParam;
-import com.fs.his.param.WxSendRedPacketParam;
+import com.fs.his.param.*;
 import com.fs.his.service.IFsInquiryOrderService;
 
 import com.fs.his.param.WxSendRedPacketParam;
@@ -217,6 +215,9 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
     @Value("${cloud_host.company_name}")
     private String signProjectName;
 
+    @Autowired
+    private FsStorePaymentErrorMapper fsStorePaymentErrorMapper;
+
     /**
      * 红包账户锁
      */
@@ -1648,18 +1649,56 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
         return "SUCCESS";
     }
 
+    long TWENTY_DAYS_IN_MILLIS = 1728000000L;// 使用毫秒判断,20天 = 20 * 24 * 60 * 60 * 1000 毫秒
     @Override
     public void synchronizePayStatus() {
         FsStorePayment queryParam = new FsStorePayment();
         queryParam.setStatus(0);//未支付
-        queryParam.setBeginTime(DateUtils.addDateDays(-1));
+//        queryParam.setBeginTime(DateUtils.addDateDays(-1));
         queryParam.setEndTime(DateUtils.getDate());
         List<FsStorePayment> list = selectFsStorePaymentList(queryParam);
         if (list != null && !list.isEmpty()) {
             List<CompletableFuture<Void>> futures = new ArrayList<>();
             for (FsStorePayment fsStorePayment : list) {
                 CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
-                    updateFsStorePaymentByDecryptForm(fsStorePayment.getPaymentId());
+                    try {
+                        updateFsStorePaymentByDecryptForm(fsStorePayment.getPaymentId());
+                        //查询是否改为已支付
+                        FsStorePayment finalPayment = fsStorePaymentMapper.selectFsStorePaymentByPaymentId(fsStorePayment.getPaymentId());
+                        try {
+                            Date createTime = finalPayment.getCreateTime();
+                            Date now = new Date();
+                            long value = now.getTime() - createTime.getTime();
+                            if(finalPayment.getStatus() == 0
+                                    && finalPayment.getBusinessType() == 3
+                                    && (value > TWENTY_DAYS_IN_MILLIS)
+                                    && finalPayment.getBusinessId() != null){
+                                //套餐包超过20天取消订单
+                                FsPackageOrderCancelParam param = new FsPackageOrderCancelParam();
+                                param.setOrderId(Long.valueOf(finalPayment.getBusinessId()));
+                                packageOrderService.cancel(param);
+                            }
+                        } catch (NumberFormatException e) {
+                            logger.info("定时任务:同步支付状态超时取消订单失败,payment_id:{}",fsStorePayment.getPaymentId());
+                        }
+                    } catch (Exception e) {
+                        //添加失败记录
+                        FsStorePaymentError fsStorePaymentError = new FsStorePaymentError();
+                        fsStorePaymentError.setOrderFlowNo(fsStorePayment.getTradeNo());
+                        String businessId = fsStorePayment.getBusinessId();
+                        fsStorePaymentError.setBusinessType(fsStorePayment.getBusinessType());
+                        fsStorePaymentError.setMsg(e.getMessage());
+                        fsStorePaymentError.setStatus(0);
+                        fsStorePaymentError.setCreateTime(new Date());
+                        if (businessId != null && fsStorePayment.getBusinessType() == 3) {
+                            fsStorePaymentError.setOrderId(Long.valueOf(businessId));
+                            FsPackageOrder fsPackageOrder = packageOrderService.selectFsPackageOrderByOrderId(Long.valueOf(businessId));
+                            if (fsPackageOrder != null) {
+                                fsStorePaymentError.setOrderNo(fsPackageOrder.getOrderSn());
+                            }
+                        }
+                        fsStorePaymentErrorMapper.insertFsStorePaymentError(fsStorePaymentError);
+                    }
                     logger.info("定时任务:同步支付状态,payment_id:{}",fsStorePayment.getPaymentId());
                 });
                 futures.add(future);

+ 1 - 1
fs-service/src/main/java/com/fs/live/domain/LiveOrder.java

@@ -96,7 +96,7 @@ public class LiveOrder extends BaseEntity {
     private String payType;
 
     /** 订单状态(-1 : 申请退款 -2 : 退货成功 0:已取消 1:待支付 2:待发货;3:待收货;4:待评价;5:已完成) */
-    @Excel(name = "订单状态", readConverterExp = "-=1,:=,申=请退款,-=2,:=,退=货成功,1=:待支付,2=:待发货;3:待收货;4:待评价;5:已完成")
+    @Excel(name = "订单状态", readConverterExp = "-=1,:=,申=请退款,-=2,:=,退=货成功,1=:待支付,2=:待发货;3:待收货;4:待评价;5:已完成;6:被拆分")
     private Integer status;
 
     /** 0 未退款 1 申请中 2 已退款 */

+ 11 - 7
fs-service/src/main/java/com/fs/live/service/impl/LiveDataServiceImpl.java

@@ -26,6 +26,8 @@ import com.fs.his.mapper.FsUserMapper;
 import com.fs.hisStore.domain.FsStoreProductScrm;
 import com.fs.hisStore.mapper.FsStoreProductScrmMapper;
 import java.util.stream.Collectors;
+
+import com.github.pagehelper.PageInfo;
 import io.swagger.models.auth.In;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -697,7 +699,13 @@ public class LiveDataServiceImpl implements ILiveDataService {
     @Override
     public R getLiveUserDetailListBySql(Long liveId, Long companyId, Long companyUserId ) {
         List<LiveUserDetailVo> userDetailList = liveDataMapper.selectLiveUserDetailListBySql(liveId, companyId, companyUserId);
-        return R.ok().put("data", userDetailList);
+        // 使用 PageInfo 获取分页信息
+        PageInfo<LiveUserDetailVo> pageInfo = new PageInfo<>(userDetailList);
+        R data = R.ok().put("data", userDetailList);
+        if (pageInfo != null) {
+            data.put("total", pageInfo.getTotal());
+        }
+        return data;
     }
 
     @Override
@@ -1088,6 +1096,8 @@ public class LiveDataServiceImpl implements ILiveDataService {
             return new ArrayList<>();
         }
 
+
+
         // 转换为导出VO列表
         List<LiveUserDetailExportVO> exportList = new ArrayList<>();
         for (LiveUserDetailVo userDetail : userDetailList) {
@@ -1114,12 +1124,6 @@ public class LiveDataServiceImpl implements ILiveDataService {
             exportVO.setCompanyName(userDetail.getCompanyName());
             exportVO.setSalesName(userDetail.getSalesName());
 
-            // 是否完课(根据观看时长判断,假设30分钟以上为完课)
-            if (totalSeconds >= 1800) {
-                exportVO.setIsCompleted("是");
-            } else {
-                exportVO.setIsCompleted("否");
-            }
 
             exportList.add(exportVO);
         }

+ 14 - 12
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -783,21 +783,23 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
             Map<String, Integer> liveFlagWithCache = liveWatchUserService.getLiveFlagWithCache(order.getLiveId());
             if (liveFlagWithCache != null && liveFlagWithCache.containsKey("liveFlag") && 1 == liveFlagWithCache.get("liveFlag")) {
                 try {
-                    LiveWatchLog queryLog = new LiveWatchLog();
-                    queryLog.setLiveId(order.getLiveId());
-                    queryLog.setUserId(Long.valueOf(order.getUserId()));
-                    queryLog.setCompanyId(order.getCompanyId());
-                    queryLog.setCompanyUserId(order.getCompanyUserId());
-
-                    List<LiveWatchLog> logs = liveWatchLogService.selectLiveWatchLogList(queryLog);
-                    if (logs != null && !logs.isEmpty()) {
-                        for (LiveWatchLog log : logs) {
-                            if (log.getLogType() == null || log.getLogType() != 2) {
-                                log.setLiveBuy(1);
-                                liveWatchLogService.updateLiveWatchLog(log);
+                    LiveUserFirstEntry liveUserFirstEntry = liveUserFirstEntryService.selectEntityByLiveIdUserId(order.getLiveId(), Long.parseLong(order.getUserId()));
+                    if (liveUserFirstEntry != null && liveUserFirstEntry.getExternalContactId()!=null && liveUserFirstEntry.getExternalContactId() > 0 &&  liveUserFirstEntry.getQwUserId()!=null && liveUserFirstEntry.getQwUserId() > 0) {
+                        LiveWatchLog queryLog = new LiveWatchLog();
+                        queryLog.setLiveId(order.getLiveId());
+                        queryLog.setQwUserId(String.valueOf(liveUserFirstEntry.getQwUserId()));
+                        queryLog.setExternalContactId(liveUserFirstEntry.getExternalContactId());
+                        List<LiveWatchLog> logs = liveWatchLogService.selectLiveWatchLogList(queryLog);
+                        if (logs != null && !logs.isEmpty()) {
+                            for (LiveWatchLog log : logs) {
+                                if (log.getLogType() == null || log.getLogType() != 2) {
+                                    log.setLiveBuy(1);
+                                    liveWatchLogService.updateLiveWatchLog(log);
+                                }
                             }
                         }
                     }
+
                 } catch (Exception e) {
                     log.error("更新 updateLiveWatchLog LiveWatchLog logType 异常(连接时):liveId={}, userId={}, error={}",
                             order.getLiveId(), order.getUserId(), e.getMessage(), e);

+ 1 - 1
fs-service/src/main/java/com/fs/live/vo/LiveUserDetailExportVO.java

@@ -49,7 +49,7 @@ public class LiveUserDetailExportVO {
     private String salesName;
 
     /** 是否完课 */
-    @Excel(name = "是否完课")
+//    @Excel(name = "是否完课")
     private String isCompleted;
 
 }

+ 16 - 11
fs-service/src/main/java/com/fs/live/vo/MergedOrderExportVO.java

@@ -48,13 +48,25 @@ public class MergedOrderExportVO implements Serializable
     private Integer totalNum;
 
     /** 产品价格 */
-    @Excel(name = "产品价格")
+//    @Excel(name = "产品价格")
     private BigDecimal price;
 
     /** 成本价 */
     @Excel(name = "成本价")
     private BigDecimal cost;
 
+    /** 商品金额 */
+    @Excel(name = "商品金额")
+    private BigDecimal totalPrice;
+
+    /** 应付金额 */
+    @Excel(name = "应付金额")
+    private BigDecimal payPrice;
+
+    /** 实付金额 */
+    @Excel(name = "实付金额")
+    private BigDecimal payMoney;
+
     /** 结算价 */
     @Excel(name = "结算价")
     private BigDecimal FPrice;
@@ -137,18 +149,11 @@ public class MergedOrderExportVO implements Serializable
     /** 银行交易流水号 */
     @Excel(name = "银行交易流水号")
     private String bankTransactionId;
+    /** 汇付商户订单号 */
+    @Excel(name = "汇付商户订单号")
+    private String hfshh;
 
-    /** 商品金额 */
-    @Excel(name = "商品金额")
-    private BigDecimal totalPrice;
 
-    /** 应付金额 */
-    @Excel(name = "应付金额")
-    private BigDecimal payPrice;
-
-    /** 实付金额 */
-    @Excel(name = "实付金额")
-    private BigDecimal payMoney;
 
 
 }

+ 2 - 0
fs-service/src/main/java/com/fs/live/vo/MergedOrderVO.java

@@ -109,6 +109,8 @@ public class MergedOrderVO implements Serializable
 
     /** 订单类型:1-销售订单,2-商城订单,3-直播订单 */
     private Integer orderType;
+//    汇付商户订单号
+    private String hfshh;
 
     /** 订单类型名称 */
     private String orderTypeName;

+ 18 - 0
fs-service/src/main/java/com/fs/newAdv/controller/AdvMiniConfigController.java

@@ -0,0 +1,18 @@
+package com.fs.newAdv.controller;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 广告微信小程序配置 前端控制器
+ * </p>
+ *
+ * @author zhangqin
+ * @since 2025-12-19
+ */
+@RestController
+@RequestMapping("/advMiniConfig")
+public class AdvMiniConfigController {
+
+}

+ 58 - 0
fs-service/src/main/java/com/fs/newAdv/domain/AdvMiniConfig.java

@@ -0,0 +1,58 @@
+package com.fs.newAdv.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * <p>
+ * 广告微信小程序配置
+ * </p>
+ *
+ * @author zhangqin
+ * @since 2025-12-19
+ */
+@Getter
+@Setter
+@TableName("adv_mini_config")
+@ApiModel(value = "AdvMiniConfig对象", description = "广告微信小程序配置")
+public class AdvMiniConfig extends Model<AdvMiniConfig> {
+
+    private static final long serialVersionUID = 1L;
+
+    @TableId("id")
+    private Integer id;
+
+    @TableField("app_id")
+    private String appId;
+
+    @TableField("app_secret")
+    private String appSecret;
+
+    @TableField("access_token")
+    private String accessToken;
+
+    @ApiModelProperty("小程序状态1启用 0停用")
+    @TableField("status")
+    private Integer status;
+
+    @ApiModelProperty("过期时间")
+    @TableField("expires_in")
+    private LocalDateTime expiresIn;
+
+    @TableField("create_time")
+    private LocalDateTime createTime;
+
+    @Override
+    public Serializable pkVal() {
+        return this.id;
+    }
+}

+ 2 - 2
fs-service/src/main/java/com/fs/newAdv/domain/PromotionAccount.java

@@ -71,9 +71,9 @@ public class PromotionAccount implements Serializable {
     private Integer apiSwitch;
 
     /**
-     * 推广账户密码(加密存储)
+     * 推拓展字段
      */
-    private String accountPassword;
+    private String extendedField;
     /**
      * 1线上 2线下
      */

+ 2 - 2
fs-service/src/main/java/com/fs/newAdv/integration/client/advertiser/BaiduApiClient.java

@@ -123,7 +123,7 @@ public class BaiduApiClient extends AbstractApiClient implements IAccessTokenCli
         Map<String, Object> map = new HashMap<>();
         Map<String, Object> header = new HashMap<>();
         header.put("accessToken", account.getAccessToken());
-        header.put("userName", account.getAccountShortName());
+        header.put("userName", account.getExtendedField());
         map.put("header", header);
         Map<String, Object> body = new HashMap<>();
         // 基础信息
@@ -197,7 +197,7 @@ public class BaiduApiClient extends AbstractApiClient implements IAccessTokenCli
             requestMap.put("secretKey", codeVo.getAppSecret());
             requestMap.put("authCode", codeVo.getAuthCode());
             requestMap.put("grantType", "access_token");
-            requestMap.put("userId", codeVo.getUserId());
+            requestMap.put("userId", codeVo.getAdAccountId());
             // 发送HTTP请求
             return HttpRequest.post(ACCESS_TOKEN_URL)
                     .header("Content-Type", "application/json")

+ 44 - 6
fs-service/src/main/java/com/fs/newAdv/integration/client/advertiser/TencentApiClient.java

@@ -1,6 +1,8 @@
 package com.fs.newAdv.integration.client.advertiser;
 
 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.fs.common.constant.SystemConstant;
@@ -15,11 +17,9 @@ import com.fs.newAdv.vo.AccessTokenVo;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * 腾讯广点通API客户端
@@ -34,6 +34,7 @@ public class TencentApiClient extends AbstractApiClient implements IAccessTokenC
 
     private static final String CONVERSION_API_URL = "https://api.e.qq.com/user_actions/add";
     private static final String TOKEN_API_URL = "https://api.e.qq.com/oauth/token";
+    private static final String REPORTS_API_URL = "https://api.e.qq.com/v3.0/daily_reports/get?access_token=%s&timestamp=%s&nonce=%s";
 
     /**
      * 回传转化数据
@@ -84,7 +85,44 @@ public class TencentApiClient extends AbstractApiClient implements IAccessTokenC
 
     @Override
     public SiteStatistics getDataReport(PromotionAccount account, String ideaId, String startDate, String endDate) {
-        return null;
+        // 构建请求参数
+        Map<String, Object> body = new HashMap<>();
+        // 基础信息
+        //报告名称: 信息流整体账户报告
+        //reportType: 2172649
+        //支持的时间单位: HOUR DAY WEEK MONTH SUMMARY
+        //支持的最大时间区间: 824天
+        body.put("account_id", account.getAdAccountId());
+        body.put("level", "REPORT_LEVEL_ADGROUP");
+        Map<String, Object> date_range = new HashMap<>();
+        date_range.put("start_date", startDate);
+        date_range.put("end_date", endDate);
+        body.put("date_range", date_range);
+
+        Map<String, Object> filtering = new HashMap<>();
+        filtering.put("field", "dynamic_creative_id");
+        filtering.put("operator", "IN");
+        filtering.put("values", Arrays.asList(ideaId));
+        body.put("filtering", date_range);
+
+        log.info("腾讯数据请求参数:{}", JSONUtil.toJsonStr(body));
+        HttpResponse execute = HttpRequest.get(String.format(REPORTS_API_URL, account.getAccessToken(), new Date().getTime(), SnowflakeUtil.randomUUID()))
+                .form(body)
+                .timeout(SystemConstant.API_TIMEOUT)
+                .execute();
+        JSONObject jsonObject = JSONUtil.parseObj(execute.body());
+        log.info("腾讯数据返回结果:{}", execute.body());
+        JSONObject data = jsonObject.getJSONObject("body").getJSONObject("data");
+        JSONArray rows = data.getJSONArray("list");
+        JSONObject jsonObject1 = rows.getJSONObject(0);
+        SiteStatistics siteStatistics = new SiteStatistics();
+        siteStatistics.setImpressionCount(Integer.valueOf(jsonObject1.getStr("view_count")));
+        siteStatistics.setClickCount(Integer.valueOf(jsonObject1.getStr("valid_click_count")));
+        siteStatistics.setActualCost(new BigDecimal(jsonObject1.getStr("cost")));
+        siteStatistics.setAccountCost(new BigDecimal(jsonObject1.getStr("cost")));
+        siteStatistics.setClickRate(new BigDecimal(jsonObject1.getStr("ctr")));
+        siteStatistics.setAvgClickPrice(new BigDecimal(jsonObject1.getStr("cpc")));
+        return siteStatistics;
     }
 
 
@@ -110,7 +148,7 @@ public class TencentApiClient extends AbstractApiClient implements IAccessTokenC
                     .form("client_secret", codeVo.getAppSecret())
                     .form("grant_type", "authorization_code")
                     .form("authorization_code", codeVo.getAuthCode())
-                    .form("redirect_uri", "authorization_code")
+                    // .form("redirect_uri", "authorization_code")
                     .timeout(SystemConstant.API_TIMEOUT)
                     .execute();
         });

+ 18 - 0
fs-service/src/main/java/com/fs/newAdv/mapper/AdvMiniConfigMapper.java

@@ -0,0 +1,18 @@
+package com.fs.newAdv.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.newAdv.domain.AdvMiniConfig;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * <p>
+ * 广告微信小程序配置 Mapper 接口
+ * </p>
+ *
+ * @author zhangqin
+ * @since 2025-12-19
+ */
+@Mapper
+public interface AdvMiniConfigMapper extends BaseMapper<AdvMiniConfig> {
+
+}

+ 16 - 0
fs-service/src/main/java/com/fs/newAdv/service/IAdvMiniConfigService.java

@@ -0,0 +1,16 @@
+package com.fs.newAdv.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.newAdv.domain.AdvMiniConfig;
+
+/**
+ * <p>
+ * 广告微信小程序配置 服务类
+ * </p>
+ *
+ * @author zhangqin
+ * @since 2025-12-19
+ */
+public interface IAdvMiniConfigService extends IService<AdvMiniConfig> {
+
+}

+ 1 - 1
fs-service/src/main/java/com/fs/newAdv/service/ILeadService.java

@@ -41,7 +41,7 @@ public interface ILeadService extends IService<Lead> {
      * @param mpOpenId
      * @param phone
      */
-    void weChatAuthorizationLead(String traceId, String unionId, String mpOpenId, String phone);
+    void weChatAuthorizationLead(String traceId, String unionId, String maOpenId, String phone);
 
     /**
      * 小程序授权落地页访问线索处理

+ 20 - 0
fs-service/src/main/java/com/fs/newAdv/service/impl/AdvMiniConfigServiceImpl.java

@@ -0,0 +1,20 @@
+package com.fs.newAdv.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.newAdv.domain.AdvMiniConfig;
+import com.fs.newAdv.mapper.AdvMiniConfigMapper;
+import com.fs.newAdv.service.IAdvMiniConfigService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 广告微信小程序配置 服务实现类
+ * </p>
+ *
+ * @author zhangqin
+ * @since 2025-12-19
+ */
+@Service
+public class AdvMiniConfigServiceImpl extends ServiceImpl<AdvMiniConfigMapper, AdvMiniConfig> implements IAdvMiniConfigService {
+
+}

+ 6 - 4
fs-service/src/main/java/com/fs/newAdv/service/impl/LeadServiceImpl.java

@@ -118,20 +118,22 @@ public class LeadServiceImpl extends ServiceImpl<LeadMapper, Lead> implements IL
 
     @Override
     @Async
-    public void weChatAuthorizationLead(String traceId, String unionId, String mpOpenId, String phone) {
+    public void weChatAuthorizationLead(String traceId, String unionId, String maOpenId, String phone) {
        try{
+           log.info("用户微信授权线索信息:{}", traceId);
            Lead byTraceId = this.getByTraceId(traceId);
            if (byTraceId == null) {
                return;
            }
            this.update(new LambdaUpdateWrapper<Lead>()
                    .eq(Lead::getTraceId, traceId)
-                   .set(Lead::getUnionid, unionId)
-                   .set(Lead::getPhone, phone)
-                   .set(Lead::getOpenid, mpOpenId)
+                   .set(ObjectUtil.isNotEmpty(unionId),Lead::getUnionid, unionId)
+                   .set(ObjectUtil.isNotEmpty(phone),Lead::getPhone, phone)
+                   .set(ObjectUtil.isNotEmpty(maOpenId),Lead::getOpenid, maOpenId)
                    .set(Lead::getMiniAuth, 1));
            if (ObjectUtil.isNotEmpty(byTraceId.getLandingPageTs()) && byTraceId.getLandingPageTs().toLocalDate().isEqual(LocalDate.now())) {
                // 微信授权且当日创建事件
+               log.info("用户微信授权线索事件回传:{}", traceId);
                conversionEventPublisher.publishConversionEvent(traceId, SystemEventTypeEnum.AUTH_TODAY_CREATE);
            }
        }catch (Exception e){

+ 1 - 1
fs-service/src/main/java/com/fs/newAdv/vo/AccessTokenByAuthCodeVo.java

@@ -11,7 +11,7 @@ public class AccessTokenByAuthCodeVo implements Serializable {
     private String appId;
     private String appSecret;
     private String authCode;
-    private String userId;
+    private String adAccountId;
 
 
 

+ 11 - 0
fs-service/src/main/java/com/fs/qw/domain/QwCompany.java

@@ -85,4 +85,15 @@ public class QwCompany extends BaseEntity
     private Long createUserId;
     // 创建部门
     private Long createDeptId;
+
+    /**
+     * 御君方云医小程序原始id
+     */
+    private String yjfyyAppId;
+    /**
+     * 御君方云医应用id
+     */
+    private String yjfyyAgentId;
+
+    private String yjfyySchema;
 }

+ 4 - 0
fs-service/src/main/java/com/fs/qw/service/impl/QwUserServiceImpl.java

@@ -1309,6 +1309,10 @@ public class QwUserServiceImpl implements IQwUserService
         WxWorkGetQrCodeDTO wxWorkGetQrCodeDTO = new WxWorkGetQrCodeDTO();
         wxWorkGetQrCodeDTO.setUuid(qwUser.getUid());
         try {
+            redisCache.deleteObject("qrCode:uuid:"+qwUser.getUid());
+            redisCache.deleteObject("qrCodeUid:"+qwUser.getUid());
+            redisCache.deleteObject("qrCode:qwUserId:"+qwUser.getId());
+            redisCache.deleteObject("qrCodeUid:qwUserId:"+qwUser.getId());
             wxWorkService.LoginOut(wxWorkGetQrCodeDTO,qwUser.getServerId());
         }catch (Exception e){
 

+ 1 - 1
fs-service/src/main/resources/application-config-druid-cfryt.yml

@@ -89,7 +89,7 @@ headerImg:
   imgUrl: https://ysy-1329817240.cos.ap-guangzhou.myqcloud.com/ysy/20250820/2c47e4f105b641b4a49df50a77338e32.png
 ipad:
   ipadUrl: http://ipad.cfrytjkzx.cn
-  aiApi:
+  aiApi: http://49.232.181.28:3000/api
   voiceApi:
   commonApi:
 wx_miniapp_temp:

+ 11 - 1
fs-service/src/main/resources/mapper/his/FsStorePaymentErrorMapper.xml

@@ -11,10 +11,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="msg"    column="msg"    />
         <result property="status"    column="status"    />
         <result property="createTime"    column="create_time"    />
+        <result property="orderId"    column="order_id"    />
+        <result property="businessType"    column="business_type"    />
     </resultMap>
 
     <sql id="selectFsStorePaymentErrorVo">
-        select id, order_flow_no, order_no, msg, status, create_time from fs_store_payment_error
+        select id, order_flow_no, order_no, msg, status, create_time,order_id,business_type from fs_store_payment_error
     </sql>
 
     <select id="selectFsStorePaymentErrorList" parameterType="FsStorePaymentError" resultMap="FsStorePaymentErrorResult">
@@ -23,6 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="orderFlowNo != null  and orderFlowNo != ''"> and order_flow_no = #{orderFlowNo}</if>
             <if test="orderNo != null  and orderNo != ''"> and order_no = #{orderNo}</if>
             <if test="msg != null  and msg != ''"> and msg = #{msg}</if>
+            <if test="orderId != null "> and order_id = #{orderId}</if>
+            <if test="businessType != null "> and business_type = #{businessType}</if>
             <if test="status != null "> and status = #{status}</if>
         </where>
     </select>
@@ -41,6 +45,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="msg != null">msg,</if>
             <if test="status != null">status,</if>
             <if test="createTime != null">create_time,</if>
+            <if test="orderId != null">order_id,</if>
+            <if test="businessType != null">business_type,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -49,6 +55,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="msg != null">#{msg},</if>
             <if test="status != null">#{status},</if>
             <if test="createTime != null">#{createTime},</if>
+            <if test="orderId != null">#{orderId},</if>
+            <if test="businessType != null">#{businessType},</if>
          </trim>
     </insert>
 
@@ -60,6 +68,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="msg != null">msg = #{msg},</if>
             <if test="status != null">status = #{status},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="orderId != null">order_id = #{orderId},</if>
+            <if test="businessType != null">business_type = #{businessType},</if>
         </trim>
         where id = #{id}
     </update>

+ 1 - 1
fs-service/src/main/resources/mapper/his/FsUserMapper.xml

@@ -1991,7 +1991,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectFsUserVOListByProjectNew" resultType="com.fs.his.vo.FsUserVO">
         SELECT
             u.user_id, u.nick_name, u.avatar, u.phone, u.integral, u.now_money,
-            ucu.project_id,ucu.company_user_id as companyUserId,ucu.create_time as bindTime,ucu.status,
+            ucu.project_id,ucu.id as companyUserId,ucu.create_time as bindTime,ucu.status,
             company.company_name,
             cu.nick_name   companyUserNickName
         FROM

+ 7 - 4
fs-service/src/main/resources/mapper/hisStore/MergedOrderMapper.xml

@@ -61,7 +61,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
       o.delivery_pay_status,
       o.total_price,
       csc.NAME AS mini_program_name,
-      sp_latest.bank_transaction_id
+      sp_latest.bank_transaction_id,
+        CONCAT('store-',sp_latest.pay_code) as hfshh
       FROM
       fs_store_order_scrm o
       left join ( SELECT fsois.*, ROW_NUMBER() OVER ( PARTITION BY fsois.order_id ORDER BY fsois.item_id ) AS rn FROM fs_store_order_item_scrm fsois ) item_latest ON item_latest.order_id = o.id and item_latest.rn = 1
@@ -202,8 +203,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
       o.delivery_pay_status,
       o.total_price,
       csc.NAME AS mini_program_name,
-      sp_latest.bank_transaction_id
-      FROM
+      sp_latest.bank_transaction_id,
+        CONCAT('store-',sp_latest.pay_code) as hfshh
+        FROM
       fs_store_order_scrm o
         left join ( SELECT fsois.*, ROW_NUMBER() OVER ( PARTITION BY fsois.order_id ORDER BY fsois.item_id ) AS rn FROM fs_store_order_item_scrm fsois ) item_latest ON item_latest.order_id = o.id and item_latest.rn = 1
       LEFT JOIN fs_user u ON o.user_id = u.user_id
@@ -343,7 +345,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
       o.delivery_pay_status,
       o.total_price,
       csc.NAME AS mini_program_name,
-      sp_latest.bank_transaction_id
+      sp_latest.bank_transaction_id,
+        CONCAT('live-',sp_latest.pay_code) as hfshh
       FROM
       live_order o
       left join live_order_item loi on loi.order_id = o.order_id

+ 1 - 1
fs-service/src/main/resources/mapper/live/LiveCompletionPointsRecordMapper.xml

@@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <!-- 查询用户的完课积分领取记录列表 -->
     <select id="selectRecordsByUser" resultMap="LiveCompletionPointsRecordResult">
         SELECT * FROM live_completion_points_record
-        WHERE user_id = #{userId}
+        WHERE user_id = #{userId} and receive_status = 1
         ORDER BY current_completion_date DESC
     </select>
 

+ 7 - 7
fs-service/src/main/resources/mapper/live/LiveDataMapper.xml

@@ -414,7 +414,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             COALESCE(video_duration.total_duration, 0) AS videoDuration,
             COUNT(DISTINCT lwu.user_id) AS totalViewers,
             COUNT(DISTINCT CASE
-                WHEN COALESCE(user_duration.total_duration, 0) >= 1800
+                WHEN COALESCE(user_duration.total_duration, 0) >= 1200
                 THEN lwu.user_id
             END) AS totalCompletedCourses,
             CASE
@@ -425,30 +425,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     END) * 100.0 / COUNT(DISTINCT lwu.user_id), 2)
                 ELSE 0
             END AS totalCompletionRate,
-            COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 THEN lwu.user_id END) AS liveViewers,
+            COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 and lwu.online_seconds > 0 THEN lwu.user_id END) AS liveViewers,
             COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 AND lwu.online_seconds >= 1200 THEN lwu.user_id END) AS liveOver20Minutes,
             COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 AND lwu.online_seconds >= 1800 THEN lwu.user_id END) AS liveOver30Minutes,
             CASE
                 WHEN COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 THEN lwu.user_id END) > 0 THEN
-                    ROUND(COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 AND lwu.online_seconds >= 1200 THEN lwu.user_id END) * 100.0 / COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 THEN lwu.user_id END), 2)
+                    ROUND(COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 AND lwu.online_seconds >= 1200 THEN lwu.user_id END) * 100.0 / COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 and lwu.online_seconds > 0  THEN lwu.user_id END), 2)
                 ELSE 0
             END AS liveCompletionRate20,
             CASE
                 WHEN COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 THEN lwu.user_id END) > 0 THEN
-                    ROUND(COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 AND lwu.online_seconds >= 1800 THEN lwu.user_id END) * 100.0 / COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 THEN lwu.user_id END), 2)
+                    ROUND(COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 AND lwu.online_seconds >= 1800 THEN lwu.user_id END) * 100.0 / COUNT(DISTINCT CASE WHEN lwu.live_flag = 1 AND lwu.replay_flag = 0 and lwu.online_seconds > 0  THEN lwu.user_id END), 2)
                 ELSE 0
             END AS liveCompletionRate30,
-            COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 THEN lwu.user_id END) AS playbackViewers,
+            COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 and lwu.online_seconds > 0 THEN lwu.user_id END) AS playbackViewers,
             COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 AND lwu.online_seconds >= 1200 THEN lwu.user_id END) AS playbackOver20Minutes,
             COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 AND lwu.online_seconds >= 1800 THEN lwu.user_id END) AS playbackOver30Minutes,
             CASE
                 WHEN COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 THEN lwu.user_id END) > 0 THEN
-                    ROUND(COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 AND lwu.online_seconds >= 1200 THEN lwu.user_id END) * 100.0 / COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 THEN lwu.user_id END), 2)
+                    ROUND(COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 AND lwu.online_seconds >= 1200 THEN lwu.user_id END) * 100.0 / COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 and lwu.online_seconds > 0  THEN lwu.user_id END), 2)
                 ELSE 0
             END AS playbackCompletionRate20,
             CASE
                 WHEN COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 THEN lwu.user_id END) > 0 THEN
-                    ROUND(COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 AND lwu.online_seconds >= 1800 THEN lwu.user_id END) * 100.0 / COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 THEN lwu.user_id END), 2)
+                    ROUND(COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 AND lwu.online_seconds >= 1800 THEN lwu.user_id END) * 100.0 / COUNT(DISTINCT CASE WHEN lwu.live_flag = 0 AND lwu.replay_flag = 1 and lwu.online_seconds > 0  THEN lwu.user_id END), 2)
                 ELSE 0
             END AS playbackCompletionRate30,
             COALESCE(ld.peak_concurrent_viewers, 0) AS livePeak,

+ 16 - 1
fs-service/src/main/resources/mapper/qw/QwCompanyMapper.xml

@@ -30,10 +30,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="msgPrivateKey"    column="msg_private_key"    />
         <result property="miniAppId"    column="mini_app_id"    />
         <result property="companyServerNum"    column="company_server_num"    />
+        <result property="yjfyyAppId"    column="yjfyy_app_id"    />
+        <result property="yjfyyAgentId"    column="yjfyy_agent_id"    />
+        <result property="yjfyySchema"    column="yjfyy_schema"    />
     </resultMap>
 
     <sql id="selectQwCompanyVo">
-        select id, corp_id, corp_name, open_secret, open_corp_id, server_agent_id, server_book_corp_id, server_book_secret, token, encoding_aes_key, provider_secret, realm_name_url, notify_url, chat_toolbar, chat_toolbar_oauth, company_ids, status, create_time, update_time, create_by,is_buy,mini_app_id,company_server_num from qw_company
+        select id, corp_id, corp_name, open_secret, open_corp_id, server_agent_id, server_book_corp_id, server_book_secret, token, encoding_aes_key, provider_secret, realm_name_url, notify_url, chat_toolbar, chat_toolbar_oauth, company_ids, status, create_time, update_time, create_by,is_buy,mini_app_id,company_server_num,yjfyy_app_id,yjfyy_agent_id,yjfyy_schema from qw_company
     </sql>
 
     <select id="selectQwCompanyList" parameterType="QwCompany" resultMap="QwCompanyResult">
@@ -58,6 +61,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isBuy != null "> and isBuy = #{isBuy}</if>
             <if test="createDeptId != null "> and create_dept_id = #{createDeptId}</if>
             <if test="createUserId != null "> and create_user_id = #{createUserId}</if>
+            <if test="yjfyyAppId != null  and yjfyyAppId != ''"> and yjfyy_app_id = #{yjfyyAppId}</if>
+            <if test="yjfyyAgentId != null  and yjfyyAgentId != ''"> and yjfyy_agent_id = #{yjfyyAgentId}</if>
+            <if test="yjfyySchema != null  and yjfyySchema != ''"> and yjfyy_schema = #{yjfyySchema}</if>
         </where>
     </select>
 
@@ -99,6 +105,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="companyServerNum != null">company_server_num,</if>
             <if test="createUserId != null != null">create_user_id,</if>
             <if test="createDeptId != null">create_dept_id,</if>
+            <if test="yjfyyAppId != null">yjfyy_app_id,</if>
+            <if test="yjfyyAgentId != null">yjfyy_agent_id,</if>
+            <if test="yjfyySchema != null">yjfyy_schema,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="corpId != null">#{corpId},</if>
@@ -125,6 +134,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="companyServerNum != null">#{companyServerNum},</if>
             <if test="createUserId != null">#{createUserId},</if>
             <if test="createDeptId != null">#{createDeptId},</if>
+            <if test="yjfyyAppId != null">#{yjfyyAppId},</if>
+            <if test="yjfyyAgentId != null">#{yjfyyAgentId},</if>
+            <if test="yjfyySchema != null">#{yjfyySchema},</if>
          </trim>
     </insert>
 
@@ -153,6 +165,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isBuy != null">is_buy = #{isBuy},</if>
             <if test="miniAppId != null">mini_app_id = #{miniAppId},</if>
             <if test="companyServerNum != null">company_server_num = #{companyServerNum},</if>
+            <if test="yjfyyAppId != null">yjfyy_app_id = #{yjfyyAppId},</if>
+            <if test="yjfyyAgentId != null">yjfyy_agent_id = #{yjfyyAgentId},</if>
+            <if test="yjfyySchema != null">yjfyy_schema = #{yjfyySchema},</if>
         </trim>
         where id = #{id}
     </update>

+ 1 - 1
fs-user-app/src/main/java/com/fs/app/controller/store/WxUserScrmController.java

@@ -371,7 +371,7 @@ public class WxUserScrmController extends AppBaseController {
             userService.handleFsUserWx(user,loginMaWxParam,session);
             String token = jwtUtils.generateToken(user.getUserId());
             // 广告线索
-            leadService.weChatAuthorizationLead(param.getTraceId(), user.getUnionId(),user.getMpOpenId(),user.getPhone());
+            leadService.weChatAuthorizationLead(param.getTraceId(), user.getUnionId(),user.getMaOpenId(),user.getPhone());
             return R.ok("登录成功").put("token",token).put("user", user);
         } catch (WxErrorException e) {
             //this.logger.error(e.getMessage(), e);