فهرست منبع

Merge remote-tracking branch 'origin/master'

yfh 6 روز پیش
والد
کامیت
5ddaf48196

+ 3 - 1
fs-company-app/src/main/java/com/fs/app/controller/FsUserCourseVideoController.java

@@ -225,8 +225,10 @@ public class FsUserCourseVideoController extends AppBaseController {
     public ResponseResult<PageInfo<FsUserCourseVideoPageListVO>> todayCourseList(@RequestParam(defaultValue = "1") Integer pageNum,
                                                                                  @RequestParam(defaultValue = "10") Integer pageSize, String keyword) {
         Long companyId = getCompanyId();
+        log.info("销售小程序-今日课程,获取公司id:{}", companyId);
         if (Objects.isNull(companyId)) {
-            ResponseResult.fail(400, "未获取到公司ID,请重新登录后再试");
+            log.error("未获取到公司id,进入提示逻辑。。。。。。。。");
+            return ResponseResult.fail(400, "未获取到公司ID,请重新登录后再试");
         }
 
         Map<String, Object> params = new HashMap<>();

+ 10 - 10
fs-ipad-task/src/main/java/com/fs/app/task/SendMsg.java

@@ -264,16 +264,16 @@ public class SendMsg {
                 }
             }
             // 推送 APP
-//            if (!setting.getSetting().isEmpty()) {
-//                new Thread(() -> {
-//                    try {
-//                        List<QwSopTempSetting.Content.Setting> settings = JSON.parseArray(JSON.toJSONString(setting.getSetting()), QwSopTempSetting.Content.Setting.class).stream().filter(e -> "9".equals(e.getContentType())).collect(Collectors.toList());
-//                        asyncSopTestService.asyncSendMsgBySopAppLinkNormalIM(settings, qwSopLogs.getCorpId(), user.getCompanyUserId(), qwSopLogs.getFsUserId());
-//                    } catch (Exception e) {
-//                        log.error("推送APP失败", e);
-//                    }
-//                }).start();
-//            }
+            if (!setting.getSetting().isEmpty()) {
+                new Thread(() -> {
+                    try {
+                        List<QwSopTempSetting.Content.Setting> settings = JSON.parseArray(JSON.toJSONString(setting.getSetting()), QwSopTempSetting.Content.Setting.class).stream().filter(e -> "9".equals(e.getContentType())).collect(Collectors.toList());
+                        asyncSopTestService.asyncSendMsgBySopAppLinkNormalIM(settings, qwSopLogs.getCorpId(), user.getCompanyUserId(), qwSopLogs.getFsUserId());
+                    } catch (Exception e) {
+                        log.error("推送APP失败", e);
+                    }
+                }).start();
+            }
             qwSopLogs.setSend(true);
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             QwSopLogs updateQwSop = new QwSopLogs();

+ 1 - 0
fs-service/src/main/java/com/fs/course/config/CourseConfig.java

@@ -16,6 +16,7 @@ public class CourseConfig implements Serializable {
     private Integer maxBufferLength;//最大缓冲时长
     private Integer videoIntegral;//每十分钟获取多少积分
     private Integer answerIntegral;//答题获得积分
+    private Integer appAnswerIntegral; //app答题积分
     private Integer defaultLine;//默认看课线路
     private String realLinkDomainName;//真链域名
     private String authDomainName;//网页授权域名

+ 4 - 2
fs-service/src/main/java/com/fs/course/mapper/FsCourseWatchLogMapper.java

@@ -246,12 +246,14 @@ public interface FsCourseWatchLogMapper extends BaseMapper<FsCourseWatchLog> {
             " ,count(o.log_id) send_number" +
             " ,sum(if((o.user_id is not null or o.user_id>0) and o.log_type=3,1,0)) is_user_wait_number" +
             " ,sum(if((o.user_id is null or o.user_id=0) and o.log_type=3,1,0)) no_user_wait_number" +
-            " ,sum(ifnull(fcr.amount,0)) red_amount" +
+//            " ,sum(ifnull(fcr.amount,0)) red_amount" +
+            ",(SELECT SUM(amount) FROM fs_course_red_packet_log \n" +
+            "     WHERE user_id = o.user_id AND video_id = o.video_id) as red_amount " +
             "</if> " +
             "FROM fs_course_watch_log o " +
             "<if test= 'sendType != 1 '> " +
             " LEFT JOIN qw_user qu on qu.id=o.qw_user_id " +
-            " LEFT JOIN fs_course_red_packet_log fcr on o.user_id = fcr.user_id and fcr.video_id = o.video_id" +
+//            " LEFT JOIN fs_course_red_packet_log fcr on o.user_id = fcr.user_id and fcr.video_id = o.video_id" + //会有笛卡尔积问题
             "</if>\n" +
             "LEFT JOIN fs_user_course_video v on v.video_id=o.video_id \n" +
             "LEFT JOIN fs_user_course uc on uc.course_id=v.course_id\n" +

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

@@ -120,6 +120,6 @@ public interface FsUserCoursePeriodDaysMapper extends BaseMapper<FsUserCoursePer
 
     Long selectFsUserCoursePeriodDaysCount(FsUserCoursePeriodDays fsUserCoursePeriodDays);
 
-    @Select("SELECT distinct period_id from fs_user_course_period_days  where start_date_time >=#{periodSTime} and end_date_time <=#{periodETime} ")
+    @Select("SELECT distinct period_id from fs_user_course_period_days  where day_date >=#{periodSTime} and day_date <=#{periodETime} ")
     List<Long> selectFsUserCoursePeriodDaysByTime(@Param("periodSTime") String periodSTime,@Param("periodETime") String periodETime);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/course/service/IFsUserCourseVideoService.java

@@ -208,4 +208,6 @@ public interface IFsUserCourseVideoService
      * 查询选择使用的视频列表
      */
     List<FsUserCourseVideoChooseVO> getChooseCourseVideoListByMap(Map<String, Object> params);
+
+    R sendAppReward(FsCourseSendRewardUParam param);
 }

+ 78 - 42
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -48,6 +48,7 @@ import com.fs.his.mapper.FsUserIntegralLogsMapper;
 import com.fs.his.mapper.FsUserMapper;
 import com.fs.his.param.WxSendRedPacketParam;
 import com.fs.his.service.IFsStorePaymentService;
+import com.fs.his.service.IFsUserIntegralLogsService;
 import com.fs.his.service.IFsUserService;
 import com.fs.his.service.IFsUserWxService;
 import com.fs.his.utils.ConfigUtil;
@@ -253,6 +254,9 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
     @Autowired
     private BalanceRollbackErrorMapper balanceRollbackErrorMapper;
 
+    @Autowired
+    private IFsUserIntegralLogsService iFsUserIntegralLogsService;
+
 
 
 
@@ -1253,7 +1257,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
 
         try {
             // 尝试获取锁,等待时间5秒,锁过期时间30秒
-            boolean isLocked = lock.tryLock(5, 60, TimeUnit.SECONDS);
+            boolean isLocked = lock.tryLock(5, 300, TimeUnit.SECONDS);
             if (!isLocked) {
                 logger.warn("获取锁失败,用户ID:{},视频ID:{}", param.getUserId(), param.getVideoId());
                 return R.error("操作频繁,请稍后再试!");
@@ -1378,45 +1382,19 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         // 准备发送红包参数
         WxSendRedPacketParam packetParam = new WxSendRedPacketParam();
 
+        //判断是否走服务号openId发红包
         if (user.getMpOpenId()!=null&&!isNewWxMerchant){
             packetParam.setOpenId(user.getMpOpenId());
         }else {
-            //修复数据
+            //查询是否绑定小程序
             FsUserWx fsUserWx = fsUserWxService.selectByAppIdAndUserId(param.getAppId(),user.getUserId(),1);
             if (fsUserWx ==null){
-                if (user.getCourseMaOpenId()==null){
-                    logger.error(" 【转账openId参数错误】:{}", user.getUserId());
-                    return R.error("openId参数错误,请清理缓存后重新授权!");
-                }
-                packetParam.setOpenId(user.getCourseMaOpenId());
-                try {
-                    handleFsUserWx(user,param.getAppId());
-                }catch (Exception e){
-                    logger.error(" 【更新或插入用户与小程序的绑定关系失败】:{}", user.getUserId(),e);
-                }
-
+                return R.error("openId参数错误,请清理缓存重新授权");
             }else {
                 packetParam.setOpenId(fsUserWx.getOpenId());
             }
         }
 
-//        packetParam.setOpenId(user.getMpOpenId());
-//        // 来源是小程序切换openId
-//        if (param.getSource() == 2) {
-//            //处理多小程序问题
-//            FsUserWx fsUserWx = fsUserWxService.selectByAppIdAndUserId(param.getAppId(),user.getUserId(),1);
-//            if (fsUserWx ==null){
-//                try {
-//                    handleFsUserWx(user,param.getAppId());
-//                }catch (Exception e){
-//                    logger.error("【更新或插入用户与小程序的绑定关系失败】:{}", user.getUserId());
-//                }
-//            }else {
-//                packetParam.setOpenId(fsUserWx.getOpenId());
-//            }
-//            //查出公司绑定openid并赋值
-//        }
-
         //判断服务号配置是否存在
         if (StringUtils.isNotEmpty(config.getMpAppId())){
             packetParam.setMpAppId(config.getMpAppId());
@@ -1564,20 +1542,10 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
             if (user.getMpOpenId()!=null&&!isNewWxMerchant){
                 packetParam.setOpenId(user.getMpOpenId());
             }else {
-                //修复数据
+                //查询是否绑定小程序
                 FsUserWx fsUserWx = fsUserWxService.selectByAppIdAndUserId(param.getAppId(),user.getUserId(),1);
                 if (fsUserWx ==null){
-                    if (user.getCourseMaOpenId()==null){
-                        logger.error(" 【转账openId参数错误】:{}", user.getUserId());
-                        return R.error("openId参数错误,请清理缓存后重新授权!");
-                    }
-                    packetParam.setOpenId(user.getCourseMaOpenId());
-                    try {
-                        handleFsUserWx(user,param.getAppId());
-                    }catch (Exception e){
-                        logger.error(" 【更新或插入用户与小程序的绑定关系失败】:{}", user.getUserId(),e);
-                    }
-
+                    return R.error("openId参数错误,请清理缓存重新授权");
                 }else {
                     packetParam.setOpenId(fsUserWx.getOpenId());
                 }
@@ -3244,5 +3212,73 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         return fsUserCourseVideoMapper.getChooseCourseVideoListByMap(params);
     }
 
+    @Override
+    public R sendAppReward(FsCourseSendRewardUParam param) {
+        // 获取用户信息
+        FsUser user = fsUserMapper.selectFsUserByUserId(param.getUserId());
+        if (user==null){
+            return R.error("会员被停用,无权限,请联系客服!");
+        }
+        FsCourseWatchLog log = courseWatchLogMapper.getWatchCourseVideo(param.getUserId(), param.getVideoId(), param.getQwUserId(), param.getQwExternalId());
+        if (log == null) {
+            return R.error("无记录");
+        }
+        if (log.getRewardType() != null) {
+            return R.error("奖励已发放");
+        }
+
+        // 获取配置信息
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+
+        // 更新用户积分
+        FsUser userMap=new FsUser();
+        userMap.setUserId(user.getUserId());
+        Integer appAnswerIntegral = config.getAppAnswerIntegral();
+        if (appAnswerIntegral == null ){
+            appAnswerIntegral = config.getAnswerIntegral();
+        }
+        userMap.setIntegral(user.getIntegral()+(appAnswerIntegral==null?0:appAnswerIntegral));
+        fsUserMapper.updateFsUser(userMap);
+        CompletableFuture.runAsync(() -> {
+            FsUserIntegralLogs integralLogs = new FsUserIntegralLogs();
+            integralLogs.setIntegral(config.getAppAnswerIntegral().longValue());
+            integralLogs.setUserId(user.getUserId());
+            integralLogs.setBalance(userMap.getIntegral());
+            integralLogs.setLogType(17);
+            integralLogs.setBusinessId(StringUtils.isNotEmpty(log.getLogId().toString()) ? log.getLogId().toString() : null);
+            integralLogs.setCreateTime(new Date());
+//            integralLogs.setNickName(user.getNickName());
+//            integralLogs.setPhone(user.getPhone());
+            //integralLogs.setId(integralLogsService.getFsUserIntegralLogsInsertId());
+//        fsUserIntegralLogsMapper.insertFsUserIntegralLogs(integralLogs);
+//            iFsUserIntegralLogsService.insertFsUserIntegralLogsMySql(integralLogs);
+            iFsUserIntegralLogsService.insertFsUserIntegralLogs(integralLogs);
+            //asyncAddIntegralLogs.saveLogAsync(integralLogs);
+
+            // 更新观看记录的奖励类型
+            log.setRewardType(2);
+            courseWatchLogMapper.updateFsCourseWatchLog(log);
+
+
+            //转换红包
+            FsCourseRedPacketLog redPacketLog = new FsCourseRedPacketLog();
+            redPacketLog.setCourseId(param.getCourseId());
+            redPacketLog.setOutBatchNo(integralLogs.getId().toString());
+            redPacketLog.setCompanyId(param.getCompanyId());
+            redPacketLog.setUserId(param.getUserId());
+            redPacketLog.setVideoId(param.getVideoId());
+            redPacketLog.setStatus(1);
+            redPacketLog.setQwUserId(param.getQwUserId() != null ? param.getQwUserId() : null);
+            redPacketLog.setCompanyUserId(param.getCompanyUserId());
+            redPacketLog.setCreateTime(new Date());
+            redPacketLog.setAmount(BigDecimal.valueOf(config.getAppAnswerIntegral()).divide(BigDecimal.valueOf(1000)));
+            redPacketLog.setRemark("点播答题领取积分转");
+            redPacketLog.setWatchLogId(log.getLogId() != null ? log.getLogId() : null);
+            redPacketLogMapper.insertFsCourseRedPacketLog(redPacketLog);
+        });
+        return R.ok("奖励发放成功");
+    }
+
 }
 

+ 12 - 8
fs-service/src/main/java/com/fs/his/mapper/FsStorePaymentMapper.java

@@ -183,14 +183,18 @@ public interface FsStorePaymentMapper
     @Select({"<script> " +
             " SELECT " +
             " CASE " +
-            "   WHEN sp.business_type = 1 THEN CONCAT('inquiry-', sp.pay_code) " +
-            "   WHEN sp.business_type = 2 THEN CONCAT('store-', sp.pay_code) " +
-            "   WHEN sp.business_type = 3 THEN CONCAT('package-', sp.pay_code) " +
-            "   WHEN sp.business_type = 4 THEN CONCAT('course-', sp.pay_code) " +
-            "   WHEN sp.business_type = 5 THEN CONCAT('appvip-', sp.pay_code) " +
-            "   WHEN sp.business_type = 6 THEN CONCAT('integral-', sp.pay_code) " +
-            "   WHEN sp.business_type = 7 THEN CONCAT('payment-', sp.pay_code) " +
-            "   ELSE sp.pay_code " +
+            "   WHEN sp.status = -1 THEN CONCAT('refund-', sp.pay_code) " +
+            "   ELSE " +
+            "     CASE " +
+            "       WHEN sp.business_type = 1 THEN CONCAT('inquiry-', sp.pay_code) " +
+            "       WHEN sp.business_type = 2 THEN CONCAT('store-', sp.pay_code) " +
+            "       WHEN sp.business_type = 3 THEN CONCAT('package-', sp.pay_code) " +
+            "       WHEN sp.business_type = 4 THEN CONCAT('course-', sp.pay_code) " +
+            "       WHEN sp.business_type = 5 THEN CONCAT('appvip-', sp.pay_code) " +
+            "       WHEN sp.business_type = 6 THEN CONCAT('integral-', sp.pay_code) " +
+            "       WHEN sp.business_type = 7 THEN CONCAT('payment-', sp.pay_code) " +
+            "       ELSE sp.pay_code " +
+            "     END " +
             " END AS pay_code, " +
             "sp.*,u.nick_name,u.phone,s.store_name,c.company_name,cu.nick_name as companyUserName,fso.delivery_name,fso.package_name,fso.package_second_name ,csc.name miniProgramName " +
             " FROM fs_store_payment sp " +

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

@@ -743,7 +743,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             //绑定销售
             FsUserScrm fsuser = userService.selectFsUserById(userId);
             if (param.getCompanyUserId() != null) {
-                if (ObjectUtil.isNotEmpty(fsuser.getCompanyUserId()) && !Objects.equals(fsuser.getCompanyUserId(), param.getCompanyUserId())) {
+                if (!CloudHostUtils.hasCloudHostName("鸿森堂") && ObjectUtil.isNotEmpty(fsuser.getCompanyUserId()) && !Objects.equals(fsuser.getCompanyUserId(), param.getCompanyUserId())) {
                     CompanyUser companyUser = companyUserService.selectCompanyUserById(fsuser.getCompanyUserId());
                     return R.error(String.format("请联系%s销售进行购买商品!", companyUser.getNickName()));
                 } else {

+ 1 - 1
fs-service/src/main/java/com/fs/qw/mapper/QwTagMapper.java

@@ -86,7 +86,7 @@ public interface QwTagMapper
     QwTagVO selectQwTagByName(@Param("trimTag") String trimTag, @Param("corpId")String corpId );
 
     @Select("<script>" +
-            "SELECT name FROM qw_tag WHERE tag_id IN " +
+            "SELECT distinct name FROM qw_tag WHERE tag_id IN " +
             "<foreach collection='date.tagIds' item='tagId' open='(' separator=',' close=')'>" +
             "#{tagId}" +
             "</foreach>" +

+ 11 - 2
fs-service/src/main/java/com/fs/qw/service/impl/QwExternalContactServiceImpl.java

@@ -3929,9 +3929,10 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                         qw.setDescription(followUser.getDescription()); // 设置描述信息
                         List<Tag> tags = followUser.getTags();
 
+                        List<String> tagArr = new ArrayList<>();
+
                         if (tags != null && tags.size() > 0) {
 
-                            List<String> tagArr = new ArrayList<>();
                             for (Tag tag : tags) {
                                 if (tag != null && tag.getTag_id() != null) {
                                     tagArr.add(tag.getTag_id());
@@ -3944,10 +3945,18 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
 
                             //新客对话
 //                            processTagsAllByAiChat(qwExternalContact1,corpId,tagArr);
+                        }else {
 
-                            qw.setTagIds(JSON.toJSONString(tagArr)); // 设置标签ID
+                            //客户自带标签空干净了
+                            logger.info("客户自带标签空干净了:"+qwExternalContact1.getName()+"|公司"+qwExternalContact1.getCorpId()+"|员工"+qwExternalContact1.getUserId()+"|总标签"+tagArr+"|原标签"+qwExternalContact1.getTagIds());
+
+                            //销售删除客户-找这个销售的sop任务中所有的营期里有没有这个客户,删了
+                            sopUserLogsInfoMapper.deleteByQwUserIdAndCorpIdToContactId(userID,corpId, externalUserID);
+                            sopUserLogsInfoMapper.deleteByQwUserIdAndCorpIdToContactIdByChat(userID,corpId, externalUserID);
 
                         }
+
+                        qw.setTagIds(JSON.toJSONString(tagArr)); // 设置标签ID
                         if (followUser.getRemark_mobiles() != null && followUser.getRemark_mobiles().size() > 0) {
                             List<String> remarkMobiles = followUser.getRemark_mobiles();
                             qw.setRemarkMobiles(JSON.toJSONString(remarkMobiles));

+ 5 - 2
fs-service/src/main/java/com/fs/sop/mapper/SopUserLogsMapper.java

@@ -389,6 +389,9 @@ List<SopUserLogsVO> selectSopUserLogsGroupListByParam(@Param("maps") SopUserLogs
     void replaceUser(@Param("vo") ReplaceUserDto vo);
 
     @DataSource(DataSourceType.SOP)
-    @Select("SELECT * FROM sop_user_logs WHERE sop_id = #{sopId} AND qw_user_id = #{qwUserId}")
-    SopUserLogs queryUserBySopId(@Param("qwUserId")String qwUserId,@Param("sopId") String sopId);
+    @Select("<script>" +"SELECT * FROM sop_user_logs WHERE sop_id = #{sopId} AND qw_user_id = #{qwUserId} " +
+            "<if test=\"chatId != null and chatId != ''\"> and chat_id = #{chatId} </if>" +
+            " limit 1 " +
+            "</script>")
+    SopUserLogs queryUserBySopId(@Param("qwUserId")String qwUserId,@Param("sopId") String sopId,@Param("chatId") String chatId);
 }

+ 2 - 2
fs-service/src/main/java/com/fs/sop/service/impl/QwSopLogsServiceImpl.java

@@ -1099,8 +1099,8 @@ public class QwSopLogsServiceImpl extends ServiceImpl<QwSopLogsMapper, QwSopLogs
 
                                 //有app的异步推送消息
                                 if (!setting.isEmpty()) {
-                                    asyncSopTestService.asyncSendMsgBySopAppLinkNormal(setting, param.getExternalId());
-                                    //asyncSopTestService.asyncSendMsgBySopAppLinkNormalIM(setting, param.getCorpId(),qwUser.getCompanyUserId(),log.getFsUserId());
+//                                    asyncSopTestService.asyncSendMsgBySopAppLinkNormal(setting, param.getExternalId());
+                                    asyncSopTestService.asyncSendMsgBySopAppLinkNormalIM(setting, param.getCorpId(),qwUser.getCompanyUserId(),log.getFsUserId());
                                 }
 
                                 if (log.getExpiryTime() == null) {

+ 5 - 5
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java

@@ -558,7 +558,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                     sopLogs.setQwUserKey(qwUser.getId());
 
                     // 设置实际发送人
-                    updateQwUserKey(sopLogs,qwUser.getQwUserId(),param.getSopId());
+                    updateQwUserKey(sopLogs,qwUser.getQwUserId(),param.getSopId(),groupUser.getChatId());
                     //域名
                     String companyUserId = qwUser.getCompanyUserId().toString();
                     String domainName = companyUserMapper.selectDomainByUserId(Long.parseLong(companyUserId));
@@ -696,7 +696,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                     sopLogs.setExternalUserName(groupChat.getName());
                     sopLogs.setQwUserKey(qwUser.getId());
                     // 设置实际发送人
-                    updateQwUserKey(sopLogs,qwUser.getQwUserId(),param.getSopId());
+                    updateQwUserKey(sopLogs,qwUser.getQwUserId(),param.getSopId(),groupChat.getChatId());
 
                     QwSopCourseFinishTempSetting setting = new QwSopCourseFinishTempSetting();
 
@@ -1009,7 +1009,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
                 }
                 sopLogs.setContentJson(JSON.toJSONString(setting));
                 // 设置实际发送人
-                updateQwUserKey(sopLogs,qwUser.getQwUserId(),param.getSopId());
+                updateQwUserKey(sopLogs,qwUser.getQwUserId(),param.getSopId(),null);
 
                 sopLogsList.add(sopLogs);
             });
@@ -1023,9 +1023,9 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
         return R.ok();
     }
 
-    private void updateQwUserKey(QwSopLogs sopLogs, String qwUserId, String sopId) {
+    private void updateQwUserKey(QwSopLogs sopLogs, String qwUserId, String sopId,String chatId) {
         // 设置实际发送人
-        SopUserLogs qwSopLogs = sopUserLogsMapper.queryUserBySopId(qwUserId,sopId);
+        SopUserLogs qwSopLogs = sopUserLogsMapper.queryUserBySopId(qwUserId,sopId,chatId);
         if (qwSopLogs != null && ObjectUtil.isNotEmpty(qwSopLogs.getActualQwId())){
             // sopLogs.setQwUserid(qwUser.getQwUserId());
             sopLogs.setQwUserKey(qwSopLogs.getActualQwId());

+ 14 - 0
fs-user-app/src/main/java/com/fs/app/controller/CourseController.java

@@ -2,6 +2,7 @@ package com.fs.app.controller;
 
 
 import com.fs.app.annotation.Login;
+import com.fs.common.annotation.RepeatSubmit;
 import com.fs.common.core.domain.R;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.ServletUtils;
@@ -17,6 +18,7 @@ import io.jsonwebtoken.Claims;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.Synchronized;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.transaction.annotation.Transactional;
@@ -26,6 +28,7 @@ import javax.servlet.http.HttpServletRequest;
 import java.util.*;
 
 @Api("课堂接口")
+@Slf4j
 @RestController
 @RequestMapping(value="/app/course")
 public class CourseController extends  AppBaseController{
@@ -341,4 +344,15 @@ public class CourseController extends  AppBaseController{
     public void updateUrl(){
         tencentCloudCosService.updateUrl();
     }
+
+    @Login
+    @ApiOperation("发放奖励App")
+    @PostMapping("/sendAppReward")
+    @RepeatSubmit
+    public R sendAppReward(@RequestBody FsCourseSendRewardUParam param)
+    {
+        param.setUserId(Long.parseLong(getUserId()));
+        log.info("zyp \n【发放APP奖励】:{}",param);
+        return courseVideoService.sendAppReward(param);
+    }
 }