Przeglądaj źródła

Merge branch 'master' into 康年堂

# Conflicts:
#	fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderScrmService.java
yh 1 tydzień temu
rodzic
commit
dc96bbac29

+ 1 - 4
fs-admin/src/main/java/com/fs/hisStore/task/MallStoreTask.java

@@ -222,12 +222,9 @@ public class MallStoreTask
     {
         List<FsStoreOrderScrm> list = fsStoreOrderMapper.selectUpdateExpress();
         Date nowDate = DateUtils.getNowDate();
-        for (FsStoreOrderScrm order : list) {
-            order.setUpdateTime(nowDate);
-        }
         for (FsStoreOrderScrm order : list){
             order.setUpdateTime(new Date());
-            orderService.updateFsStoreOrder(order);
+            orderService.updateFsStoreOrderDb(order);
             ErpOrderQueryRequert request = new ErpOrderQueryRequert();
             request.setCode(order.getExtendOrderId());
             IErpOrderService erpOrderService = getErpOrderService();

+ 2 - 2
fs-company/src/main/java/com/fs/company/controller/store/FsUserController.java

@@ -84,8 +84,8 @@ public class FsUserController extends BaseController
         List<FsUser> list=fsUserService.selectFsUserList(fsUser);
         if(list.isEmpty()){
             //如果是加密的电话,需要加密后查询
-            if(StringUtils.isFullNumber(fsUser.getKeywords()) && fsUser.getKeywords().length() == 11){
-                fsUser.setKeywords(encryptPhone(fsUser.getKeywords()));
+            if(StringUtils.isFullNumber(fsUser.getPhone()) && fsUser.getPhone().length() == 11){
+                fsUser.setPhone(encryptPhone(fsUser.getPhone()));
             }
             list = fsUserService.selectFsUserList(fsUser);
         }

+ 1 - 30
fs-live-app/src/main/java/com/fs/live/task/LiveCompletionPointsTask.java

@@ -39,7 +39,7 @@ public class LiveCompletionPointsTask {
     private ILiveService liveService;
 
     /**
-     * 定时检查观看时长并创建完课记录
+     * 定时检查观看时长并创建完课记录(兜底机制)
      * 每分钟执行一次
      * 优化:防重复推送 + 只查询开启了完课积分的直播间
      */
@@ -81,9 +81,6 @@ public class LiveCompletionPointsTask {
                             
                             completionPointsRecordService.checkAndCreateCompletionRecord(liveId, userId, duration);
 
-                            // 5. 检查是否有新的完课记录待领取,推送弹窗消息(防重复)
-                            sendCompletionNotificationOnce(liveId, userId);
-
                         } catch (Exception e) {
                             log.error("处理用户完课状态失败, liveId={}, userId={}", liveId, entry.getKey(), e);
                         }
@@ -98,30 +95,4 @@ public class LiveCompletionPointsTask {
             log.error("检查完课状态定时任务执行失败", e);
         }
     }
-
-   private void sendCompletionNotificationOnce(Long liveId, Long userId) {
-    try {
-        // 查询未领取的完课记录
-        List<LiveCompletionPointsRecord> unreceivedRecords = 
-            completionPointsRecordService.getUserUnreceivedRecords(liveId, userId);
-        
-        if (unreceivedRecords == null || unreceivedRecords.isEmpty()) {
-            return;
-        }
-
-        SendMsgVo sendMsgVo = new SendMsgVo();
-        sendMsgVo.setLiveId(liveId);
-        sendMsgVo.setUserId(userId);
-        sendMsgVo.setCmd("completionPoints");
-        sendMsgVo.setMsg("完成任务!");
-        sendMsgVo.setData(JSONObject.toJSONString(unreceivedRecords.get(0)));
-        
-        webSocketServer.sendCompletionPointsMessage(liveId, userId, sendMsgVo);
-        
-        log.info("发送完课积分弹窗通知, liveId={}, userId={}, points={}", 
-                liveId, userId, unreceivedRecords.get(0).getPointsAwarded());
-        } catch (Exception e) {
-        log.error("发送完课通知失败", e);
-        }
-    }
 }

+ 78 - 5
fs-live-app/src/main/java/com/fs/live/websocket/service/WebSocketServer.java

@@ -36,6 +36,7 @@ import javax.websocket.*;
 import javax.websocket.server.ServerEndpoint;
 import java.io.EOFException;
 import java.io.IOException;
+import java.time.LocalDateTime;
 import java.util.*;
 import java.util.concurrent.*;
 import java.util.concurrent.locks.Lock;
@@ -80,6 +81,7 @@ public class WebSocketServer {
     private final LiveCouponMapper liveCouponMapper = SpringUtils.getBean(LiveCouponMapper.class);
     private final ILiveWatchLogService liveWatchLogService = SpringUtils.getBean(ILiveWatchLogService.class);
     private final ILiveVideoService liveVideoService = SpringUtils.getBean(ILiveVideoService.class);
+    private final ILiveCompletionPointsRecordService completionPointsRecordService = SpringUtils.getBean(ILiveCompletionPointsRecordService.class);
     private static Random random = new Random();
     
     // Redis key 前缀:用户进入直播间时间
@@ -187,14 +189,14 @@ public class WebSocketServer {
             LiveUserFirstEntry liveUserFirstEntry = liveUserFirstEntryService.selectEntityByLiveIdUserId(liveId, userId);
             // 如果用户连上了 socket,并且公司ID和销售ID大于0,更新 LiveWatchLog 的 logType
 
-            if ((companyId > 0 && companyUserId > 0) || (liveUserFirstEntry != null && liveUserFirstEntry.getCompanyId() > 0 && liveUserFirstEntry.getCompanyUserId() > 0 )) {
+            if ((qwUserId > 0 && externalContactId > 0) || (liveUserFirstEntry != null && liveUserFirstEntry.getCompanyId() > 0 && liveUserFirstEntry.getCompanyUserId() > 0 )) {
                 // 获取当前直播/回放状态
                 Map<String, Integer> flagMap = liveWatchUserService.getLiveFlagWithCache(liveId);
                 Integer currentLiveFlag = flagMap.get("liveFlag");
 
                 // 如果当前是直播状态(liveFlag = 1),更新 logType
                 if (currentLiveFlag != null && currentLiveFlag == 1) {
-                    updateLiveWatchLogTypeOnConnect(liveId, userId, companyId, companyUserId);
+                    updateLiveWatchLogTypeOnConnect(liveId, userId, qwUserId, externalContactId);
                 }
             }
 
@@ -349,6 +351,32 @@ public class WebSocketServer {
                     if (msg.getData() != null && !msg.getData().isEmpty()) {
                         try {
                             Long currentDuration = Long.parseLong(msg.getData());
+
+                            Live currentLive = liveService.selectLiveByLiveId(liveId);
+                            if (currentLive == null) {
+                                break;
+                            }
+                            
+                            // 判断直播是否已开始:status=2(直播中) 或 当前时间 >= 开播时间
+                            boolean isLiveStarted = false;
+                            if (currentLive.getStatus() != null && currentLive.getStatus() == 2) {
+                                // status=2 表示直播中
+                                isLiveStarted = true;
+                            } else if (currentLive.getStartTime() != null) {
+                                // 判断当前时间是否已超过开播时间
+                                LocalDateTime now = java.time.LocalDateTime.now();
+                                isLiveStarted = now.isAfter(currentLive.getStartTime()) || now.isEqual(currentLive.getStartTime());
+                            }
+                            
+                            if (!isLiveStarted) {
+                                log.debug("[心跳-观看时长] 直播未开始(开播倒计时中),不统计观看时长, liveId={}, status={}, startTime={}", 
+                                        liveId, currentLive.getStatus(), currentLive.getStartTime());
+                                break;
+                            }
+                            
+                            log.debug("[心跳-观看时长] 直播已开始,统计观看时长, liveId={}, userId={}, duration={}秒", 
+                                    liveId, watchUserId, currentDuration);
+                            
                             // 使用Hash结构存储:一个直播间一个Hash,包含所有用户的时长
                             String hashKey = "live:watch:duration:hash:" + liveId;
                             String userIdField = String.valueOf(watchUserId);
@@ -361,6 +389,8 @@ public class WebSocketServer {
                                 // 设置过期时间(2小时)
                                 redisCache.expire(hashKey, 2, TimeUnit.HOURS);
 
+                                checkAndSendCompletionPointsInRealTime(liveId, watchUserId, currentDuration);
+
                             }
                         } catch (Exception e) {
                             log.error("[心跳-观看时长] 更新失败, liveId={}, userId={}, data={}", 
@@ -1144,13 +1174,13 @@ public class WebSocketServer {
      * 在连接时更新 LiveWatchLog 的 logType
      * 如果 logType 类型不是 2,修改 logType 类型为 1(看课中)
      */
-    private void updateLiveWatchLogTypeOnConnect(Long liveId, Long userId, Long companyId, Long companyUserId) {
+    private void updateLiveWatchLogTypeOnConnect(Long liveId, Long userId, Long qwUserId, Long externalContactId) {
         try {
             LiveWatchLog queryLog = new LiveWatchLog();
             queryLog.setLiveId(liveId);
             queryLog.setUserId(userId);
-            queryLog.setCompanyId(companyId);
-            queryLog.setCompanyUserId(companyUserId);
+            queryLog.setQwUserId(String.valueOf(qwUserId));
+            queryLog.setExternalContactId(externalContactId);
             
             List<LiveWatchLog> logs = liveWatchLogService.selectLiveWatchLogList(queryLog);
             if (logs != null && !logs.isEmpty()) {
@@ -1315,5 +1345,48 @@ public class WebSocketServer {
         }
     }
 
+    /**
+     * 实时检查并推送完课积分
+     * 在用户观看时长更新时立即检查是否达到完课条件,达到则立即推送
+     * @param liveId 直播间ID
+     * @param userId 用户ID
+     * @param duration 当前观看时长(秒)
+     */
+    private void checkAndSendCompletionPointsInRealTime(long liveId, long userId, Long duration) {
+        try {
+            log.debug("[实时完课检查] liveId={}, userId={}, duration={}秒", liveId, userId, duration);
+
+            // 1. 调用完课记录服务检查并创建完课记录
+            completionPointsRecordService.checkAndCreateCompletionRecord(liveId, userId, duration);
+
+            // 2. 查询是否有新的未领取完课记录
+            List<LiveCompletionPointsRecord> unreceivedRecords =
+                completionPointsRecordService.getUserUnreceivedRecords(liveId, userId);
+
+            if (unreceivedRecords == null || unreceivedRecords.isEmpty()) {
+                // 没有待领取的完课记录
+                return;
+            }
+
+            // 3. 构建推送消息
+            SendMsgVo sendMsgVo = new SendMsgVo();
+            sendMsgVo.setLiveId(liveId);
+            sendMsgVo.setUserId(userId);
+            sendMsgVo.setCmd("completionPoints");
+            sendMsgVo.setMsg("完成任务!");
+            sendMsgVo.setData(JSONObject.toJSONString(unreceivedRecords.get(0)));
+
+            // 4. 实时推送完课积分弹窗
+            sendCompletionPointsMessage(liveId, userId, sendMsgVo);
+
+            log.info("[实时完课推送] 发送完课积分弹窗通知, liveId={}, userId={}, points={}, duration={}秒",
+                    liveId, userId, unreceivedRecords.get(0).getPointsAwarded(), duration);
+
+        } catch (Exception e) {
+            log.error("[实时完课推送] 实时检查完课积分失败, liveId={}, userId={}, duration={}",
+                    liveId, userId, duration, e);
+        }
+    }
+
 }
 

+ 1 - 1
fs-service/src/main/java/com/fs/course/mapper/FsUserCourseVideoMapper.java

@@ -273,7 +273,7 @@ public interface FsUserCourseVideoMapper extends BaseMapper<FsUserCourseVideo> {
     @MapKey("videoId")
     Map<Long, FsUserCourseVideo> selectAllMap();
 
-    @Select("select * from fs_video_resource where line2 is not null and job_id is null")
+    @Select("select * from fs_video_resource where line2 is not null and (job_id is null or job_id='')")
     List<FsVideoResource> selectVideoByHuaWei();
 
     @Select("select * from fs_video_resource where job_id is not null and  (hsy_vid is null or hsy_vid='')")

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

@@ -232,11 +232,11 @@ public class FsUser extends BaseEntity
     @TableField(exist = false)
     private String nicknameExact;
 
-    /**
-     * 搜索关键词-电话号码/会员id/会员昵称
-     * **/
-    @TableField(exist = false)
-    private String keywords;
+//    /**
+//     * 搜索关键词-电话号码/会员id/会员昵称
+//     * **/
+//    @TableField(exist = false)
+//    private String keywords;
 
     public String getNickname() {
         return nickname;

+ 7 - 0
fs-service/src/main/java/com/fs/his/mapper/FsIntegralCartMapper.java

@@ -28,4 +28,11 @@ public interface FsIntegralCartMapper extends BaseMapper<FsIntegralCart> {
      * @return  list
      */
     List<FsIntegralCartVO> getCartsByMap(@Param("params") Map<String, Object> params);
+
+    /**
+     * 根据商品ID删除购物车记录
+     * @param goodsId   商品ID
+     * @return  删除数量
+     */
+    int deleteCartByGoodsId(@Param("goodsId") Long goodsId);
 }

+ 7 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsCouponServiceImpl.java

@@ -141,6 +141,13 @@ public class FsCouponServiceImpl implements IFsCouponService
         if(fsUserCouponMapper.checkReceive(param.getUserId(),coupon.getCouponId())>0){
             return R.error("您已领取此券");
         }
+        //判断是否是私域优惠券
+        Integer couponType = coupon.getCouponType();
+        if(couponType!=null && couponType==5){
+            if (param.getCompanyId() == null || param.getCompanyUserId() == null) {
+                return R.error("您无法领取该优惠券");
+            }
+        }
         FsUserCoupon userCoupon=new FsUserCoupon();
         userCoupon.setUserId(param.getUserId());
         userCoupon.setStatus(0);

+ 11 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsIntegralGoodsServiceImpl.java

@@ -9,6 +9,7 @@ import com.fs.course.domain.FsCourseAnswerReward;
 import com.fs.his.domain.FsChineseMedicine;
 import com.fs.his.domain.FsIntegralGoods;
 import com.fs.his.domain.FsUser;
+import com.fs.his.mapper.FsIntegralCartMapper;
 import com.fs.his.mapper.FsIntegralGoodsMapper;
 import com.fs.his.mapper.FsUserMapper;
 import com.fs.his.param.FsIntegralGoodsListUParam;
@@ -37,6 +38,8 @@ public class FsIntegralGoodsServiceImpl implements IFsIntegralGoodsService
     private FsIntegralGoodsMapper fsIntegralGoodsMapper;
     @Autowired
     private FsUserMapper fsUserMapper;
+    @Autowired
+    private FsIntegralCartMapper fsIntegralCartMapper;
 
     @Autowired
     private ISysConfigService configService;
@@ -99,6 +102,11 @@ public class FsIntegralGoodsServiceImpl implements IFsIntegralGoodsService
     @Override
     public int deleteFsIntegralGoodsByGoodsIds(Long[] goodsIds)
     {
+        // 先删除购物车中的相关记录
+        for (Long goodsId : goodsIds) {
+            fsIntegralCartMapper.deleteCartByGoodsId(goodsId);
+        }
+        // 再删除商品
         return fsIntegralGoodsMapper.deleteFsIntegralGoodsByGoodsIds(goodsIds);
     }
 
@@ -111,6 +119,9 @@ public class FsIntegralGoodsServiceImpl implements IFsIntegralGoodsService
     @Override
     public int deleteFsIntegralGoodsByGoodsId(Long goodsId)
     {
+        // 先删除购物车中的相关记录
+        fsIntegralCartMapper.deleteCartByGoodsId(goodsId);
+        // 再删除商品
         return fsIntegralGoodsMapper.deleteFsIntegralGoodsByGoodsId(goodsId);
     }
 

+ 51 - 19
fs-service/src/main/java/com/fs/his/service/impl/FsIntegralOrderServiceImpl.java

@@ -43,6 +43,7 @@ import com.fs.his.param.*;
 import com.fs.his.service.*;
 import com.fs.his.utils.ConfigUtil;
 import com.fs.his.utils.PhoneUtil;
+import com.fs.his.utils.RedisCacheUtil;
 import com.fs.his.vo.*;
 import com.fs.qw.domain.QwUser;
 import com.fs.qw.mapper.QwUserMapper;
@@ -161,6 +162,9 @@ public class FsIntegralOrderServiceImpl implements IFsIntegralOrderService
 
     @Autowired
     private IFsUserAddressService fsUserAddressService;
+
+    @Autowired
+    private RedisCacheUtil redisCacheUtil;
     /**
      * 查询积分商品订单
      *
@@ -312,6 +316,10 @@ public class FsIntegralOrderServiceImpl implements IFsIntegralOrderService
             throw new CustomException("库存不足");
         }
 
+        // 清除商品缓存
+        redisCacheUtil.delSpringCacheKey("getIntegralGoodsById", integralGoods.getGoodsId());
+        redisCacheUtil.delRedisKey("getIntegralGoodsList");
+
         integralGoods.setNum(1);
         List<FsIntegralGoods> goodsItem = new ArrayList<>();
         goodsItem.add(integralGoods);
@@ -467,6 +475,9 @@ public class FsIntegralOrderServiceImpl implements IFsIntegralOrderService
                 throw new CustomException("库存不足");
             }
 
+            // 清除商品缓存
+            redisCacheUtil.delSpringCacheKey("getIntegralGoodsById", integralGoods.getGoodsId());
+
             totalIntegral += integralGoods.getIntegral() * cart.getCartNum();
             totalCash = totalCash.add(integralGoods.getCash().multiply(BigDecimal.valueOf(cart.getCartNum())));
 
@@ -474,7 +485,17 @@ public class FsIntegralOrderServiceImpl implements IFsIntegralOrderService
             goodsItem.add(integralGoods);
         }
 
-        return createOrder(user, address, totalIntegral, totalCash, goodsItem, null);
+        // 清除商品列表缓存
+        redisCacheUtil.delRedisKey("getIntegralGoodsList");
+
+        // 创建订单
+        R result = createOrder(user, address, totalIntegral, totalCash, goodsItem, null);
+
+        // 订单创建成功后,删除购物车中已下单的商品
+        if (result.get("code").equals(200)) {
+            cartService.delCartByIds(user.getUserId(), param.getIds());
+        }
+        return result;
     }
 
     @Override
@@ -566,8 +587,9 @@ public class FsIntegralOrderServiceImpl implements IFsIntegralOrderService
     public R cannelOrder(Long orderId) {
         // 取消订单
         FsIntegralOrder order = fsIntegralOrderMapper.selectFsIntegralOrderByOrderId(orderId);
-        if (!order.getStatus().equals(4)){
-            return R.error("非法操作");
+        // 允许取消待支付(4)和待发货(1)的订单
+        if (!order.getStatus().equals(4) && !order.getStatus().equals(1)){
+            return R.error("非法操作,只能取消待支付或待发货的订单");
         }
 
         order.setStatus(5);
@@ -576,26 +598,36 @@ public class FsIntegralOrderServiceImpl implements IFsIntegralOrderService
         // 还原库存
         if (order.getItemJson().startsWith("[") && order.getItemJson().endsWith("]")){
             List<FsIntegralGoods> goodsItem = JSONUtil.toBean(order.getItemJson(), new TypeReference<List<FsIntegralGoods>>(){}, true);
-            goodsItem.forEach(goods -> fsIntegralGoodsMapper.addStock(goods.getGoodsId(), Objects.isNull(goods.getNum()) ? 1 : goods.getNum()));
+            goodsItem.forEach(goods -> {
+                fsIntegralGoodsMapper.addStock(goods.getGoodsId(), Objects.isNull(goods.getNum()) ? 1 : goods.getNum());
+                // 清除商品缓存
+                redisCacheUtil.delSpringCacheKey("getIntegralGoodsById", goods.getGoodsId());
+            });
         } else {
             FsIntegralGoods integralGoods = JSONUtil.toBean(order.getItemJson(), FsIntegralGoods.class);
             fsIntegralGoodsMapper.addStock(integralGoods.getGoodsId(), Objects.isNull(integralGoods.getNum()) ? 1 : integralGoods.getNum());
+            // 清除商品缓存
+            redisCacheUtil.delSpringCacheKey("getIntegralGoodsById", integralGoods.getGoodsId());
+        }
+        // 清除商品列表缓存
+        redisCacheUtil.delRedisKey("getIntegralGoodsList");
+
+        // 还原积分(只有当订单消耗了积分时才退还)
+        if (StringUtils.isNotEmpty(order.getIntegral()) && Long.parseLong(order.getIntegral()) > 0) {
+            FsUser user=fsUserMapper.selectFsUserByUserId(order.getUserId());
+            FsUser userMap=new FsUser();
+            userMap.setUserId(user.getUserId());
+            userMap.setIntegral(user.getIntegral() + Long.parseLong(order.getIntegral()));
+            fsUserMapper.updateFsUser(userMap);
+            FsUserIntegralLogs logs = new FsUserIntegralLogs();
+            logs.setIntegral(Long.parseLong(order.getIntegral()));
+            logs.setUserId(order.getUserId());
+            logs.setBalance(userMap.getIntegral());
+            logs.setLogType(5);
+            logs.setBusinessId(order.getOrderId().toString());
+            logs.setCreateTime(new Date());
+            fsUserIntegralLogsMapper.insertFsUserIntegralLogs(logs);
         }
-
-        // 还原积分
-        FsUser user=fsUserMapper.selectFsUserByUserId(order.getUserId());
-        FsUser userMap=new FsUser();
-        userMap.setUserId(user.getUserId());
-        userMap.setIntegral(user.getIntegral() + Long.parseLong(order.getIntegral()));
-        fsUserMapper.updateFsUser(userMap);
-        FsUserIntegralLogs logs = new FsUserIntegralLogs();
-        logs.setIntegral(Long.parseLong(order.getIntegral()));
-        logs.setUserId(order.getUserId());
-        logs.setBalance(userMap.getIntegral());
-        logs.setLogType(5);
-        logs.setBusinessId(order.getOrderId().toString());
-        logs.setCreateTime(new Date());
-        fsUserIntegralLogsMapper.insertFsUserIntegralLogs(logs);
 
         return R.ok();
     }

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderScrmService.java

@@ -349,5 +349,7 @@ public interface IFsStoreOrderScrmService
 
     void cancelOrderByCode(String outerPayId);
 
+    void updateFsStoreOrderDb(FsStoreOrderScrm order);
+
     ExpressInfoDTO getDfExpressInfoDTO(FsStoreOrderScrm order);
 }

+ 6 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -1413,6 +1413,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             fsWxExpressTask.setUserId(order.getUserId());
             fsWxExpressTask.setStatus(0);
             fsWxExpressTask.setRetryCount(0);
+            fsWxExpressTask.setType(0);
             fsWxExpressTask.setCreateTime(LocalDateTime.now());
             fsWxExpressTask.setUpdateTime(LocalDateTime.now());
             fsWxExpressTask.setOrderCode(order.getOrderCode());
@@ -5408,6 +5409,11 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         fsStoreOrderMapper.cancelOrderByCode(outerPayId);
     }
 
+    @Override
+    public void updateFsStoreOrderDb(FsStoreOrderScrm order) {
+        fsStoreOrderMapper.updateFsStoreOrder(order);
+    }
+
     private static final DateTimeFormatter CST_FORMATTER = DateTimeFormatter
             .ofPattern("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US)
             .withZone(ZoneId.of("Asia/Shanghai"));

+ 10 - 1
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -940,9 +940,18 @@ public class LiveServiceImpl implements ILiveService
         }
 
         SysConfig sysConfig = sysConfigService.selectConfigByConfigKey("living.config");
+        if (sysConfig == null || StringUtils.isEmpty(sysConfig.getConfigValue())) {
+            log.error("直播配置不存在或为空, liveId: {}", live.getLiveId());
+            return R.error("直播配置不存在,请联系管理员配置");
+        }
         Map<String, String> livingConfigMap = JSON.parseObject(sysConfig.getConfigValue(), Map.class);
         if (livingConfigMap == null || livingConfigMap.isEmpty()) {
-            return R.error("缺失直播配置");
+            log.error("直播配置解析失败, liveId: {}, configValue: {}", live.getLiveId(), sysConfig.getConfigValue());
+            return R.error("直播配置解析失败");
+        }
+        if (StringUtils.isEmpty(livingConfigMap.get("domain")) || StringUtils.isEmpty(livingConfigMap.get("app"))) {
+            log.error("直播配置缺少必要参数, liveId: {}, configMap: {}", live.getLiveId(), livingConfigMap);
+            return R.error("直播配置缺少必要参数(domain/app)");
         }
         String rtmpPushUrl = generateRtmpPushUrl(livingConfigMap.get("domain"), livingConfigMap.get("app"), exist.getLiveId().toString());
         String hlvPlayUrl = generateHlvPlayUrl(livingConfigMap.get("http"), livingConfigMap.get("app"), exist.getLiveId().toString());

+ 5 - 0
fs-service/src/main/resources/mapper/his/FsIntegralCartMapper.xml

@@ -41,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select
             ifnull(sum(ic.cart_num), 0)
         from fs_integral_cart ic
+        inner join fs_integral_goods ig on ig.goods_id = ic.goods_id
         <where>
             <if test="params.userId != null">
                 ic.user_id = #{params.userId}
@@ -79,4 +80,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
         </where>
     </select>
+
+    <delete id="deleteCartByGoodsId">
+        delete from fs_integral_cart where goods_id = #{goodsId}
+    </delete>
 </mapper>

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

@@ -92,12 +92,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="registerCode != null   and registerCode != '' ">and register_code = #{registerCode}</if>
             <if test="source != null  and source != '' ">and source = #{source}</if>
             <if test="isShow != null  ">and is_show = #{isShow}</if>
-            <if test="keywords != null  and keywords != ''">
-                AND (fs_user.nick_name LIKE concat( #{keywords},'%')
-                or  fs_user.phone = #{keywords}
-                or fs_user.user_id = #{keywords}
-                )
-            </if>
             <!--<if test="qwRepeat != null  ">and qw_repeat = #{qwRepeat}</if>
             <if test="userRepeat != null  ">and user_repeat = #{userRepeat}</if>-->
 <!--            <if test="payOrder != null  ">and pay_order = #{payOrder}</if>-->

+ 2 - 32
fs-user-app/src/main/java/com/fs/app/controller/live/LiveOrderController.java

@@ -35,6 +35,7 @@ import com.fs.hisStore.dto.FsStoreOrderComputeDTO;
 import com.fs.hisStore.enums.OrderInfoEnum;
 import com.fs.hisStore.mapper.FsStorePaymentScrmMapper;
 import com.fs.hisStore.param.*;
+import com.fs.hisStore.service.IFsStoreOrderScrmService;
 import com.fs.hisStore.service.IFsUserScrmService;
 import com.fs.hisStore.vo.FsStoreOrderItemVO;
 import com.fs.huifuPay.domain.HuiFuCreateOrder;
@@ -130,38 +131,7 @@ public class LiveOrderController extends AppBaseController
     @Autowired
     private HuiFuService huiFuService;
 
-    //    @Login
-    @ApiOperation("物流查询")
-    @GetMapping("/test")
-    public void test(){
-        // 查询出来最近15分钟的订单 待支付 未退款
-        List<LiveOrder> list = orderService.selectBankOrder();
-        list = new ArrayList<>();
-        list.add(orderService.selectLiveOrderByOrderId("36623"));
-        for (LiveOrder liveOrder : list) {
-            List<LiveOrderPayment> liveOrderPayments = liveOrderPaymentMapper.selectLiveOrderPaymentByOrderId(liveOrder.getOrderId());
-            if(liveOrderPayments == null || liveOrderPayments.isEmpty()) continue;
-            for (LiveOrderPayment payment : liveOrderPayments) {
-                V2TradePaymentScanpayQueryRequest request = new V2TradePaymentScanpayQueryRequest();
-                request.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(payment.getCreateTime()));
-                request.setOrgHfSeqId(payment.getTradeNo());
-                HuiFuQueryOrderResult o = null;
-                try {
-                    o = huiFuService.queryOrder(request);
-                } catch (Exception e) {
-                    log.error("查询失败:"+e.getMessage());
-                    continue;
-                }
-                log.info("汇付返回"+o);
-                if ("00000000".equals(o.getResp_code()) && "S".equals(o.getTrans_stat())) {
-                    String[] order=o.getOrg_req_seq_id().split("-");
-                    if ("live".equals(order[0])) {
-                        orderService.payConfirm(1, null, order[1], o.getOrg_hf_seq_id(), o.getOut_trans_id(), o.getParty_order_id());
-                    }
-                }
-            }
-        }
-    }
+
 
 
     /**