Ver Fonte

Merge remote-tracking branch 'origin/master'

ct há 5 dias atrás
pai
commit
67197eab23
19 ficheiros alterados com 358 adições e 140 exclusões
  1. 30 39
      fs-admin/src/main/java/com/fs/web/controller/system/SysConfigController.java
  2. 5 0
      fs-company/src/main/java/com/fs/company/controller/qw/SopUserLogsController.java
  3. 19 0
      fs-service/src/main/java/com/fs/course/config/RandomRedPacketConfig.java
  4. 28 0
      fs-service/src/main/java/com/fs/course/config/RandomRedPacketRule.java
  5. 6 0
      fs-service/src/main/java/com/fs/course/domain/FsUserCourseVideo.java
  6. 1 1
      fs-service/src/main/java/com/fs/course/mapper/FsUserCourseVideoMapper.java
  7. 0 5
      fs-service/src/main/java/com/fs/course/service/impl/FsCourseLinkServiceImpl.java
  8. 84 0
      fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java
  9. 6 0
      fs-service/src/main/java/com/fs/course/vo/FsUserCourseVideoQVO.java
  10. 5 0
      fs-service/src/main/java/com/fs/qw/param/FsUserCourseRedPageParam.java
  11. 2 0
      fs-service/src/main/java/com/fs/sop/service/IQwSopTempRulesService.java
  12. 2 0
      fs-service/src/main/java/com/fs/sop/service/ISopUserLogsService.java
  13. 6 0
      fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempRulesServiceImpl.java
  14. 2 2
      fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsInfoServiceImpl.java
  15. 147 91
      fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsServiceImpl.java
  16. 7 0
      fs-service/src/main/resources/application-config-dev-jnlzjk.yml
  17. 3 0
      fs-service/src/main/resources/mapper/course/FsUserCourseVideoMapper.xml
  18. 3 2
      fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml
  19. 2 0
      fs-service/src/main/resources/mapper/sop/SopUserLogsMapper.xml

+ 30 - 39
fs-admin/src/main/java/com/fs/web/controller/system/SysConfigController.java

@@ -30,13 +30,10 @@ import com.fs.system.service.ISysConfigService;
 
 /**
  * 参数配置 信息操作处理
- *
-
  */
 @RestController
 @RequestMapping("/system/config")
-public class SysConfigController extends BaseController
-{
+public class SysConfigController extends BaseController {
     @Autowired
     private ISysConfigService configService;
     @Autowired
@@ -47,8 +44,7 @@ public class SysConfigController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:config:list')")
     @GetMapping("/list")
-    public TableDataInfo list(SysConfig config)
-    {
+    public TableDataInfo list(SysConfig config) {
         startPage();
         List<SysConfig> list = configService.selectConfigList(config);
         return getDataTable(list);
@@ -57,8 +53,7 @@ public class SysConfigController extends BaseController
     @Log(title = "参数管理", businessType = BusinessType.EXPORT)
     @PreAuthorize("@ss.hasPermi('system:config:export')")
     @GetMapping("/export")
-    public AjaxResult export(SysConfig config)
-    {
+    public AjaxResult export(SysConfig config) {
         List<SysConfig> list = configService.selectConfigList(config);
         ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
         return util.exportExcel(list, "参数数据");
@@ -69,8 +64,7 @@ public class SysConfigController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:config:query')")
     @GetMapping(value = "/{configId}")
-    public AjaxResult getInfo(@PathVariable Long configId)
-    {
+    public AjaxResult getInfo(@PathVariable Long configId) {
         return AjaxResult.success(configService.selectConfigById(configId));
     }
 
@@ -78,8 +72,7 @@ public class SysConfigController extends BaseController
      * 根据参数键名查询参数值
      */
     @GetMapping(value = "/configKey/{configKey}")
-    public AjaxResult getConfigKey(@PathVariable String configKey)
-    {
+    public AjaxResult getConfigKey(@PathVariable String configKey) {
         return AjaxResult.success(configService.selectConfigByKey(configKey));
     }
 
@@ -90,10 +83,8 @@ public class SysConfigController extends BaseController
     @Log(title = "参数管理", businessType = BusinessType.INSERT)
     @PostMapping
     @RepeatSubmit
-    public AjaxResult add(@Validated @RequestBody SysConfig config)
-    {
-        if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
-        {
+    public AjaxResult add(@Validated @RequestBody SysConfig config) {
+        if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
             return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
         }
         config.setCreateBy(getUsername());
@@ -106,10 +97,8 @@ public class SysConfigController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:config:edit')")
     @Log(title = "参数管理", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@Validated @RequestBody SysConfig config)
-    {
-        if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config)))
-        {
+    public AjaxResult edit(@Validated @RequestBody SysConfig config) {
+        if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) {
             return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
         }
         config.setUpdateBy(getUsername());
@@ -122,8 +111,7 @@ public class SysConfigController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:config:remove')")
     @Log(title = "参数管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{configIds}")
-    public AjaxResult remove(@PathVariable Long[] configIds)
-    {
+    public AjaxResult remove(@PathVariable Long[] configIds) {
         configService.deleteConfigByIds(configIds);
         return success();
     }
@@ -134,50 +122,53 @@ public class SysConfigController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:config:remove')")
     @Log(title = "参数管理", businessType = BusinessType.CLEAN)
     @DeleteMapping("/refreshCache")
-    public AjaxResult refreshCache()
-    {
+    public AjaxResult refreshCache() {
         configService.resetConfigCache();
         return AjaxResult.success();
     }
 
     @GetMapping(value = "/getConfigByKey/{configKey}")
-    public AjaxResult getConfigByKey(@PathVariable String configKey)
-    {
-        SysConfig config=configService.selectConfigByConfigKey(configKey);
+    public AjaxResult getConfigByKey(@PathVariable String configKey) {
+        SysConfig config = configService.selectConfigByConfigKey(configKey);
         return AjaxResult.success(config);
     }
 
     @PostMapping(value = "/updateConfigByKey")
     @Log(title = "更改参数", businessType = BusinessType.UPDATE)
     @RepeatSubmit
-    public AjaxResult updateConfigByKey(@Validated @RequestBody SysConfig config)
-    {
+    public AjaxResult updateConfigByKey(@Validated @RequestBody SysConfig config) {
         config.setCreateBy(SecurityUtils.getUsername());
-        return toAjax(configService.updateConfig(config));
+        //修复只能更新的BUG
+        if (null != config.getConfigId()) {
+            return toAjax(configService.updateConfig(config));
+        } else {
+            return toAjax(configService.insertConfig(config));
+        }
+
     }
 
 
     /**
      * 启用-关闭小程序销售管理
+     *
      * @param bock
      * @return
      */
     @GetMapping("/updateIsTownOn")
-    public R queryIsTownOn(String bock, String appId)
-    {
-        String key = appId+"start_status_001";
+    public R queryIsTownOn(String bock, String appId) {
+        String key = appId + "start_status_001";
         String start = redisCache.getCacheObject(key);
-        if (ObjectUtil.isNotEmpty(bock)){
-            if (bock.equals("001")){
-                redisCache.setCacheObject(key,bock);
+        if (ObjectUtil.isNotEmpty(bock)) {
+            if (bock.equals("001")) {
+                redisCache.setCacheObject(key, bock);
                 return R.ok("调整成功");
-            }else if (bock.equals("002")){
-                redisCache.setCacheObject(key,bock);
+            } else if (bock.equals("002")) {
+                redisCache.setCacheObject(key, bock);
                 return R.ok("调整成功");
             }
 
         }
-        return R.ok().put("date",start);
+        return R.ok().put("date", start);
     }
 
 }

+ 5 - 0
fs-company/src/main/java/com/fs/company/controller/qw/SopUserLogsController.java

@@ -195,4 +195,9 @@ public class SopUserLogsController extends BaseController
         sopUserLogsService.replaceUser(vo);
         return R.ok();
     }
+
+    @GetMapping("/getShortLink")
+    public R getShortLink(String id, String sopId, String appId){
+        return sopUserLogsService.getShortLink(id, sopId, appId);
+    }
 }

+ 19 - 0
fs-service/src/main/java/com/fs/course/config/RandomRedPacketConfig.java

@@ -0,0 +1,19 @@
+package com.fs.course.config;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author MixLiu
+ * @date 2025/11/27 下午2:07)
+ */
+@Data
+public class RandomRedPacketConfig {
+    /**
+     * 是否开启随机红包
+     */
+    private Boolean enableRandomRedpacket;
+
+    private List<RandomRedPacketRule> rules;
+}

+ 28 - 0
fs-service/src/main/java/com/fs/course/config/RandomRedPacketRule.java

@@ -0,0 +1,28 @@
+package com.fs.course.config;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author MixLiu
+ * @date 2025/11/27 下午2:08)
+ */
+
+@Data
+public class RandomRedPacketRule {
+    /**
+     * 最小金额
+     */
+    private BigDecimal minAmount;
+
+    /**
+     * 最大金额
+     */
+    private BigDecimal maxAmount;
+
+    /**
+     * 权重
+     */
+    private Integer weight;
+}

+ 6 - 0
fs-service/src/main/java/com/fs/course/domain/FsUserCourseVideo.java

@@ -78,6 +78,12 @@ public class FsUserCourseVideo extends BaseEntity
     private Integer uploadType;
 
     private BigDecimal redPacketMoney;
+
+    /**
+     * 随机红包配置
+     */
+    private String randomRedPacketRules;
+
     private Long fileSize;//文件大小  字节
     private String fileKey;//文件key 对用存储桶
     private String round;//轮次

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

@@ -62,7 +62,7 @@ public interface FsUserCourseVideoMapper
     public int updateFsUserCourseVideo(FsUserCourseVideo fsUserCourseVideo);
 
     @Update("<script> " +
-            "update fs_user_course_video set red_packet_money=#{data.redPacketMoney} where course_id=#{data.courseId} " +
+            "update fs_user_course_video set red_packet_money=#{data.redPacketMoney}, random_red_packet_rules = #{data.randomRedPacketRules} where course_id=#{data.courseId} " +
             "</script>")
     public int updateFsUserCourseRedPage(@Param("data") FsUserCourseRedPageParam courseRedPageParam);
 

+ 0 - 5
fs-service/src/main/java/com/fs/course/service/impl/FsCourseLinkServiceImpl.java

@@ -898,14 +898,9 @@ public class FsCourseLinkServiceImpl implements IFsCourseLinkService
                             }else {
                                 return R.error("获取失败:"+jsonObject.getString("errmsg"));
                             }
-                        }else {
-                            return R.error("未配置小程序id");
                         }
                     }
                 }
-
-
-
             } else {
                 return R.error("页面链接错误,获取失败");
             }

+ 84 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -2,6 +2,7 @@ package com.fs.course.service.impl;
 
 import cn.hutool.json.JSONUtil;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -33,6 +34,8 @@ import com.fs.company.mapper.CompanyUserMapper;
 import com.fs.company.service.ICompanyService;
 import com.fs.config.cloud.CloudHostProper;
 import com.fs.course.config.CourseConfig;
+import com.fs.course.config.RandomRedPacketConfig;
+import com.fs.course.config.RandomRedPacketRule;
 import com.fs.course.domain.*;
 import com.fs.course.dto.CoursePackageDTO;
 import com.fs.course.mapper.*;
@@ -1444,6 +1447,33 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
             amount = redPackage.getRedPacketMoney();
         } else if (video != null) {
             amount = video.getRedPacketMoney();
+            //是否开启了随机红包
+            String json = configService.selectConfigByKey("randomRedpacket:config");
+            if(StringUtils.isNotBlank(json)){
+                RandomRedPacketConfig randomRedPacket = JSONUtil.toBean(json, RandomRedPacketConfig.class);
+                //是否开启拼手气红包
+                if(null != randomRedPacket && randomRedPacket.getEnableRandomRedpacket()){
+                    BigDecimal randomMoney = BigDecimal.ZERO;
+                    //优先读取课程配置随机红包规则
+                    String randomRedPacketRules = video.getRandomRedPacketRules();
+                    if(StringUtils.isNotBlank(randomRedPacketRules) ){
+                        JSONArray array = JSONObject.parseArray(randomRedPacketRules);
+                        List<RandomRedPacketRule> rules = new ArrayList<>();
+                        for (Object o : array) {
+                            rules.add(JSONObject.toJavaObject((JSONObject) o, RandomRedPacketRule.class));
+                        }
+                        randomMoney = getRandomMoneyByRules(rules);
+                    }
+                    //如果课程没有配置 读取后台默认随机规则
+                    else{
+                        randomMoney = getRandomMoneyByRules(randomRedPacket.getRules());
+                    }
+                    //兼容拼手气红包报错情况的发放红包情况
+                    if(BigDecimal.ZERO.compareTo(randomMoney) < 0){
+                        amount = randomMoney;
+                    }
+                }
+            }
         }
 
         // 准备发送红包参数
@@ -3613,6 +3643,60 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         return R.ok();
     }
 
+    /**
+     * 根据匹配规则返回随机红包值(需求是概率独立计算)
+     * @param rules
+     * @return
+     */
+    private BigDecimal getRandomMoneyByRules(List<RandomRedPacketRule> rules) {
+        try {
+
+            if (CollectionUtils.isEmpty(rules)) {
+                logger.error("随机红包规则列表为空,不予处理");
+//            throw new ServiceException("随机红包规则列表为空");
+            }
+            // 计算总权重
+            int totalWeight = rules.stream()
+                    .mapToInt(RandomRedPacketRule::getWeight)
+                    .sum();
+            // 根据权重随机选择规则
+            Random random = new Random();
+            int randomPoint = random.nextInt(totalWeight);
+
+            RandomRedPacketRule selectedRule = null;
+            int currentWeight = 0;
+
+            for (RandomRedPacketRule rule : rules) {
+                currentWeight += rule.getWeight();
+                if (randomPoint < currentWeight) {
+                    selectedRule = rule;
+                    break;
+                }
+            }
+
+            // 如果因为计算精度问题没有选中规则,默认选第一个
+            if (selectedRule == null) {
+                selectedRule = rules.get(0);
+            }
+            // 在选中规则的范围内生成随机金额
+            BigDecimal maxAmount = selectedRule.getMaxAmount();
+            BigDecimal minAmount = selectedRule.getMinAmount();
+            // 如果最大最小金额相等,直接返回该金额
+            if (maxAmount.compareTo(minAmount) == 0) {
+                return maxAmount;
+            }
+            // 生成随机金额
+            BigDecimal range = maxAmount.subtract(minAmount);
+            BigDecimal randomValue = range.multiply(BigDecimal.valueOf(random.nextDouble()));
+            BigDecimal result = minAmount.add(randomValue);
+            // 保留两位小数,四舍五入
+            return result.setScale(2, RoundingMode.HALF_UP);
+        } catch (Exception e) {
+            logger.error("获取拼手气红包金额异常:{}",rules, e);
+        }
+
+        return BigDecimal.ZERO;
+    }
 
 
 }

+ 6 - 0
fs-service/src/main/java/com/fs/course/vo/FsUserCourseVideoQVO.java

@@ -68,6 +68,12 @@ public class FsUserCourseVideoQVO extends BaseEntity {
     private String lineThree; //线路三 华为云obs
     private Integer uploadType;
     private String redPacketMoney;
+
+    /**
+     * 随机红包配置
+     */
+    private String randomRedPacketRules;
+
     private Long fileSize;//文件大小  字节
     private String fileKey;//文件key 对用存储桶
     private String round;//轮次

+ 5 - 0
fs-service/src/main/java/com/fs/qw/param/FsUserCourseRedPageParam.java

@@ -11,5 +11,10 @@ public class FsUserCourseRedPageParam {
     private Long courseId;
     //红包
     private BigDecimal redPacketMoney;
+
+    /**
+     * 新增配置 随机红包配置
+     */
+    private String randomRedPacketRules;
 }
 

+ 2 - 0
fs-service/src/main/java/com/fs/sop/service/IQwSopTempRulesService.java

@@ -97,4 +97,6 @@ public interface IQwSopTempRulesService extends IService<QwSopTempRules>{
     void removeByTempIds(Collection<String> tempIds);
 
     void removeByWrapper(LambdaQueryWrapper<QwSopTempRules> wrapper);
+
+    List<QwSopTempRules> selectListByDayId(Long id);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/sop/service/ISopUserLogsService.java

@@ -66,4 +66,6 @@ public interface ISopUserLogsService {
     public List<SopUserLogs> meetsTherestoreByIsDaysNotStudy(int offset,int pageSize,Integer notStudyDays);
 
     void replaceUser(ReplaceUserDto vo);
+
+    R getShortLink(String id, String sopId, String appId);
 }

+ 6 - 0
fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempRulesServiceImpl.java

@@ -254,6 +254,12 @@ public class QwSopTempRulesServiceImpl extends ServiceImpl<QwSopTempRulesMapper,
         this.remove(new QueryWrapper<QwSopTempRules>().in("temp_id", tempIds));
     }
 
+    @Override
+    @DataSource(DataSourceType.SOP)
+    public List<QwSopTempRules> selectListByDayId(Long id) {
+        return list(new QueryWrapper<QwSopTempRules>().eq("day_id", id));
+    }
+
     @Override
     @DataSource(DataSourceType.SOP)
     public void removeByWrapper(LambdaQueryWrapper<QwSopTempRules> wrapper) {

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

@@ -1547,7 +1547,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
     }
 
     //插入观看记录
-    private void addWatchLogIfNeeded(String sopId, Integer videoId, Integer courseId,
+    public void addWatchLogIfNeeded(String sopId, Integer videoId, Integer courseId,
                                      Long fsUserId, String qwUserId, String companyUserId,
                                      String companyId, Long externalId, String startTime,Date createTime) {
 
@@ -1603,7 +1603,7 @@ public class SopUserLogsInfoServiceImpl implements ISopUserLogsInfoService {
         return sortLink.replaceAll("^[\\s\\u2005]+", "");
     }
 
-    private String createLinkByMiniApp(QwSopCourseFinishTempSetting.Setting setting, String corpId, Date sendTime,
+    public String createLinkByMiniApp(QwSopCourseFinishTempSetting.Setting setting, String corpId, Date sendTime,
                                      Integer courseId, Integer videoId, Long qwUserId,
                                      String companyUserId, String companyId, Long externalId,CourseConfig config, String chatId) {
 

+ 147 - 91
fs-service/src/main/java/com/fs/sop/service/impl/SopUserLogsServiceImpl.java

@@ -8,6 +8,7 @@ import com.fs.common.exception.base.BaseException;
 import com.fs.common.utils.PubFun;
 import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.date.DateUtil;
+import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.FsCourseWatchLog;
 import com.fs.course.mapper.FsCourseWatchLogMapper;
 import com.fs.course.param.FsCourseLinkCreateParam;
@@ -16,18 +17,17 @@ import com.fs.crm.domain.CrmMsg;
 import com.fs.crm.mapper.CrmMsgMapper;
 import com.fs.qw.domain.QwExternalContact;
 import com.fs.qw.domain.QwGroupChat;
+import com.fs.qw.domain.QwGroupChatUser;
 import com.fs.qw.domain.QwUser;
 import com.fs.qw.mapper.QwExternalContactMapper;
+import com.fs.qw.mapper.QwGroupChatMapper;
+import com.fs.qw.mapper.QwGroupChatUserMapper;
 import com.fs.qw.mapper.QwUserMapper;
 import com.fs.qw.param.SopUserLogsVO;
 import com.fs.qw.service.IQwGroupChatService;
 import com.fs.qw.service.IQwUserService;
 import com.fs.qw.vo.*;
-import com.fs.qwApi.service.QwApiService;
-import com.fs.sop.domain.QwSop;
-import com.fs.sop.domain.QwSopLogs;
-import com.fs.sop.domain.SopUserLogs;
-import com.fs.sop.domain.SopUserLogsInfo;
+import com.fs.sop.domain.*;
 import com.fs.sop.mapper.QwSopMapper;
 import com.fs.sop.mapper.SopUserLogsInfoMapper;
 import com.fs.sop.mapper.SopUserLogsMapper;
@@ -35,9 +35,7 @@ import com.fs.sop.params.QwRatingConfig;
 import com.fs.sop.params.SopUserLogsList;
 import com.fs.sop.params.SopUserLogsParam;
 import com.fs.sop.params.SopUserLogsParamByDate;
-import com.fs.sop.service.IQwSopLogsService;
-import com.fs.sop.service.IQwSopTempDayService;
-import com.fs.sop.service.ISopUserLogsService;
+import com.fs.sop.service.*;
 import com.fs.sop.vo.QwRatingVO;
 import com.fs.sop.vo.ReplaceUserDto;
 import com.fs.sop.vo.SopUserLogsInfoVo;
@@ -69,7 +67,7 @@ import java.util.stream.Collectors;
 
 @Slf4j
 @Service
-public class SopUserLogsServiceImpl  implements ISopUserLogsService {
+public class SopUserLogsServiceImpl implements ISopUserLogsService {
 
     private static final Logger logger = LoggerFactory.getLogger(SopUserLogsServiceImpl.class);
 
@@ -85,7 +83,7 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
     @Autowired
     private QwSopMapper sopMapper;
     @Autowired
-    private QwApiService qwApiService;
+    private IFsCourseLinkService linkService;
 
     @Autowired
     private RedisCache redisCache;
@@ -99,6 +97,17 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
     @Autowired
     private IQwSopTempDayService qwSopTempDayService;
 
+    @Autowired
+    private SopUserLogsInfoServiceImpl sopUserLogsInfoService;
+    @Autowired
+    private IQwSopTempService sopTempService;
+    @Autowired
+    private IQwSopTempRulesService qwSopTempRulesService;
+    @Autowired
+    private QwGroupChatUserMapper qwGroupChatUserMapper;
+    @Autowired
+    private QwGroupChatMapper qwGroupChatMapper;
+
 
     @Autowired
     private ISysConfigService configService;
@@ -143,7 +152,7 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
 //        return sopUserLogsMapper.updateSopUserLogsDistinctByList(userLogsList);
 //    }
 
-//    @Override
+    //    @Override
 //    public int updateSopUserLogsDistinctByList(SopUserLogsArray userLogsArray) {
 //        return sopUserLogsMapper.updateSopUserLogsDistinctByList(userLogsArray);
 //    }
@@ -152,6 +161,57 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
         sopUserLogsMapper.replaceUser(vo);
     }
 
+    @Override
+    public R getShortLink(String id, String sopId, String appId) {
+        QwSop qwSop = sopMapper.selectQwSopById(sopId);
+        QwSopTemp qwSopTemp = sopTempService.selectQwSopTempById(qwSop.getTempId());
+        SopUserLogs sopUserLogs = sopUserLogsMapper.selectSopUserLogsById(id);
+        String[] userKey = sopUserLogs.getUserId().split("\\|");
+        String qwUserId = userKey[0].trim();
+        QwUser qwUser = qwUserMapper.selectById(qwUserId);
+        Optional<QwSopTempDay> dayOptional = qwSopTemp.getList().stream().filter(e -> Objects.equals(e.getDayNum(), sopUserLogs.getCountDays())).findFirst();
+        if (dayOptional.isPresent()) {
+            List<QwSopTempRules> rulesList = qwSopTempRulesService.selectListByDayId(dayOptional.get().getId());
+            Optional<QwSopTempRules> rulesOptional = rulesList.stream().filter(r -> r.getCourseId() != null).findFirst();
+            if (rulesOptional.isPresent()) {
+                QwSopTempRules rules = rulesOptional.get();
+                QwGroupChat groupChat = qwGroupChatMapper.selectQwGroupChatByChatId(sopUserLogs.getChatId());
+                List<QwGroupChatUser> groupUserList = qwGroupChatUserMapper.selectQwGroupChatUserByChatIds(new String[]{sopUserLogs.getChatId()});
+                List<String> groupChatUserIds = PubFun.listToNewList(groupUserList, QwGroupChatUser::getUserId);
+                if (!groupChatUserIds.isEmpty()) {
+                    List<GroupUserExternalVo> userList = qwExternalContactMapper.selectByGroupUser(groupChatUserIds);
+                    Map<String, List<GroupUserExternalVo>> userMap = PubFun.listToMapByGroupList(userList, GroupUserExternalVo::getExternalUserId);
+                    groupUserList.forEach(e -> {
+                        e.setUserList(userMap.getOrDefault(e.getUserId(), Collections.emptyList()));
+                    });
+                }
+                try {
+                    groupUserList.stream().filter(e -> e.getUserList() != null && !e.getUserList().isEmpty()).forEach(e -> {
+                        Map<String, GroupUserExternalVo> userMap = PubFun.listToMapByGroupObject(e.getUserList(), GroupUserExternalVo::getUserId);
+                        GroupUserExternalVo vo = userMap.get(groupChat.getOwner());
+                        if (vo != null && vo.getId() != null) {
+                            sopUserLogsInfoService.addWatchLogIfNeeded(sopId, rules.getVideoId().intValue(), rules.getCourseId().intValue(), vo.getFsUserId(), qwUser.getId().toString(), qwUser.getCompanyUserId().toString(), qwUser.getCompanyId().toString(), vo.getId(), sopUserLogs.getStartTime(), new Date());
+                        }
+                    });
+                } catch (Exception e) {
+                    log.error("群聊创建看课记录失败!", e);
+                }
+                QwSopCourseFinishTempSetting.Setting st = new QwSopCourseFinishTempSetting.Setting();
+                st.setExpiresDays(1);
+                String json = configService.selectConfigByKey("course.config");
+                CourseConfig config = JSON.parseObject(json, CourseConfig.class);
+                String linkByMiniApp = sopUserLogsInfoService.createLinkByMiniApp(st, sopUserLogs.getCorpId(), new Date(), rules.getCourseId().intValue(), rules.getVideoId().intValue(),
+                        qwUser.getId(), qwUser.getCompanyUserId().toString(), qwUser.getCompanyId().toString(), null, config, sopUserLogs.getChatId());
+                if(StringUtils.isNotEmpty(linkByMiniApp)){
+                    linkByMiniApp = linkByMiniApp.replaceAll(".html", "");
+                }
+                String link = linkService.getGotoWxAppLink(linkByMiniApp, appId);
+                return R.ok().put("urlLink", link);
+            }
+        }
+        return R.error("系统错误❌");
+    }
+
     @Override
     public int deleteSopUserLogsBySopId(String sopId) {
         return sopUserLogsMapper.deleteSopUserLogsBySopId(sopId);
@@ -181,20 +241,20 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
             //如果为空,则任务删除了 ,则全部营期删除
             if (ruleTimeVO == null) {
                 sopUserLogsMapper.deleteSopUserLogsBySopId(key);
-            }else if (ruleTimeVO.getStatus()==0){
+            } else if (ruleTimeVO.getStatus() == 0) {
                 SopUserLogs sopUserLogs = new SopUserLogs();
                 sopUserLogs.setSopId(key);
                 sopUserLogs.setStatus(2);
                 sopUserLogsMapper.updateSopUserLogsByStatus(sopUserLogs);
-            }else {
+            } else {
 
                 //如果模板停用了,也改这个营期记录
-                if (ruleTimeVO.getTempStatus().equals("0")){
+                if (ruleTimeVO.getTempStatus().equals("0")) {
                     SopUserLogs sopUserLogs = new SopUserLogs();
                     sopUserLogs.setSopId(key);
                     sopUserLogs.setStatus(2);
                     sopUserLogsMapper.updateSopUserLogsByStatus(sopUserLogs);
-                }else {
+                } else {
 
                     // 分组的 key
                     List<SopUserLogsVo> userLogsVos = entry.getValue(); // 分组对应的日志列表
@@ -202,24 +262,24 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
                     // 处理日志数据
                     userLogsVos.forEach(log -> {
 
-                            // 获取开始时间和间隔天数
-                            Date startTime = null; // 假设 startTime 是 java.util.Date 类型
-                            try {
-                                startTime = formatter.parse(log.getStartTime());
-                            } catch (ParseException e) {
-                                logger.error("selectSopUserLogsListByTime解析开始时间失败: {}", e.getMessage());
-                            }
+                        // 获取开始时间和间隔天数
+                        Date startTime = null; // 假设 startTime 是 java.util.Date 类型
+                        try {
+                            startTime = formatter.parse(log.getStartTime());
+                        } catch (ParseException e) {
+                            logger.error("selectSopUserLogsListByTime解析开始时间失败: {}", e.getMessage());
+                        }
 
-                            Integer tempGap = ruleTimeVO.getTempGap();
+                        Integer tempGap = ruleTimeVO.getTempGap();
 
-                            // 将 startTime 转换为 LocalDate
-                            LocalDate startLocalDate = startTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
+                        // 将 startTime 转换为 LocalDate
+                        LocalDate startLocalDate = startTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
 
-                            // 计算当前时间距离开始时间的天数差
-                            long daysBetween = ChronoUnit.DAYS.between(startLocalDate, currentDate);
+                        // 计算当前时间距离开始时间的天数差
+                        long daysBetween = ChronoUnit.DAYS.between(startLocalDate, currentDate);
 
-                            // TODO 修改
-                            // 获取 QwSopTempSetting 内容
+                        // TODO 修改
+                        // 获取 QwSopTempSetting 内容
 //                            List<QwSopTempSetting> qwSopTempSettings = JSON.parseArray(ruleTimeVO.getTempSetting(), QwSopTempSetting.class);
 //
 //                            // 计算当前天数属于第几天,第一天就是 startLocalDate,后续递增
@@ -293,9 +353,6 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
             }
 
 
-
-
-
         }
 
         // 遍历分组数据
@@ -454,7 +511,8 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
 //        }
     }
 
-    private void insertSopUserLogs(List<SopUserLogsInfo> list,SopUserLogsVo log,Date sendTime,QwSopRuleTimeVO ruleTimeVO,QwSopTempSetting.Content element) {
+    private void insertSopUserLogs(List<SopUserLogsInfo> list, SopUserLogsVo log, Date sendTime, QwSopRuleTimeVO
+            ruleTimeVO, QwSopTempSetting.Content element) {
 
         QwSopLogs sopLogs = new QwSopLogs();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -574,7 +632,7 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
 
 
                             //如果要推短链-则必须要绑定了小程序-才会有观看记录
-                            if (sopLogs.getFsUserId() != null && sopLogs.getFsUserId()!= 0 ) {
+                            if (sopLogs.getFsUserId() != null && sopLogs.getFsUserId() != 0) {
 
                                 FsCourseWatchLog watchLog = new FsCourseWatchLog();
                                 watchLog.setUserId(sopLogs.getFsUserId());
@@ -643,9 +701,9 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
         return resultSopUserLogsList(list);
     }
 
-    private List<SopUserLogsVO> resultSopUserLogsList( List<SopUserLogsVO> list){
+    private List<SopUserLogsVO> resultSopUserLogsList(List<SopUserLogsVO> list) {
         List<String> chatIdList = PubFun.listToNewList(list, SopUserLogsVO::getChatId);
-        if(!chatIdList.isEmpty()){
+        if (!chatIdList.isEmpty()) {
             List<QwGroupChat> qwGroupChatList = qwGroupChatService.selectQwGroupChatByChatIds(chatIdList.toArray(new String[0]));
             Map<String, QwGroupChat> groupChatMap = PubFun.listToMapByGroupObject(qwGroupChatList, QwGroupChat::getChatId);
             list.stream().filter(e -> groupChatMap.containsKey(e.getChatId())).forEach(e -> {
@@ -703,9 +761,9 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
                 // 获取名称
                 String names = voList.stream().peek(v -> {
                     // 标识那些是发送了,发送了到时候要更新状态不会查出数据进入此方法
-                    if(type == 0){
+                    if (type == 0) {
                         v.setMinIsSend(true);
-                    }else{
+                    } else {
                         v.setMaxIsSend(true);
                     }
                 }).map(SopUserLogsInfoVo::getExternalUserName).collect(Collectors.joining(","));
@@ -726,11 +784,11 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
         // 打转换消息
         List<CrmMsg> maxList = toFun.apply(list, 1);
         // 不为空添加
-        if(!minList.isEmpty()){
+        if (!minList.isEmpty()) {
             msgList.addAll(minList);
         }
         // 不为空添加
-        if(!maxList.isEmpty()){
+        if (!maxList.isEmpty()) {
             msgList.addAll(maxList);
         }
         msgList.forEach(crmMsgMapper::insertCrmMsg);
@@ -756,8 +814,7 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
      * @return sopUserLogs
      */
     @Override
-    public SopUserLogs selectSopUserLogsById(String id)
-    {
+    public SopUserLogs selectSopUserLogsById(String id) {
         return sopUserLogsMapper.selectSopUserLogsById(id);
     }
 
@@ -768,14 +825,14 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
         if (qwUser != null) {
             Long companyUserId = qwUser.getCompanyUserId();
             Long companyId = qwUser.getCompanyId();
-            if (companyUserId==null) {
+            if (companyUserId == null) {
                 return R.error("用户未绑定销售,请先绑定");
             }
-            if (companyId==null) {
+            if (companyId == null) {
                 return R.error("用户未绑定销售公司,请先绑定");
             }
 
-            param.setUserId(qwUser.getId()+"|"+companyUserId+"|"+companyId);
+            param.setUserId(qwUser.getId() + "|" + companyUserId + "|" + companyId);
             sopUserLogsMapper.updateSopUserLogsByCompanyInfo(param);
         }
 
@@ -789,26 +846,26 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
 
             Map<String, QwUser> qwUserMap = sopUserLogs.stream()
                     .collect(Collectors.toMap(
-                            item -> item.getCorpId() + "|" + item.getQwUserId()+"|"+item.getId(),
+                            item -> item.getCorpId() + "|" + item.getQwUserId() + "|" + item.getId(),
                             item -> Optional.ofNullable(qwUserMapper.selectQwUserByCorpIdAndUserId(item.getCorpId(), item.getQwUserId()))
                                     .orElse(new QwUser())
                     ));
             List<String> errorMessages = new ArrayList<>();
 
             sopUserLogs.forEach(item -> {
-                String key = item.getCorpId() + "|" + item.getQwUserId()+"|"+item.getId();
+                String key = item.getCorpId() + "|" + item.getQwUserId() + "|" + item.getId();
                 QwUser qwUser = qwUserMap.get(key);
 
-                if (qwUser != null && qwUser.getId()!=null) {
+                if (qwUser != null && qwUser.getId() != null) {
                     Long companyUserId = qwUser.getCompanyUserId();
                     Long companyId = qwUser.getCompanyId();
 
                     if (companyUserId == null) {
-                        errorMessages.add("用户 " + item.getQwUserId() +"|"+item.getCorpId()+ " 未绑定销售,请先绑定");
+                        errorMessages.add("用户 " + item.getQwUserId() + "|" + item.getCorpId() + " 未绑定销售,请先绑定");
                         return;
                     }
                     if (companyId == null) {
-                        errorMessages.add("用户 " + item.getQwUserId()+"|" +item.getCorpId()+ " 未绑定销售公司,请先绑定");
+                        errorMessages.add("用户 " + item.getQwUserId() + "|" + item.getCorpId() + " 未绑定销售公司,请先绑定");
                         return;
                     }
 
@@ -826,10 +883,10 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
             });
 
             if (!errorMessages.isEmpty()) {
-                logger.error("定时处理 营期异常的数据 出错:"+String.join(";", errorMessages));
+                logger.error("定时处理 营期异常的数据 出错:" + String.join(";", errorMessages));
             }
-        }catch (Exception e){
-            logger.error("定时处理 营期异常的数据 出错2:"+e.getMessage());
+        } catch (Exception e) {
+            logger.error("定时处理 营期异常的数据 出错2:" + e.getMessage());
         }
 
 
@@ -842,21 +899,21 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
         QwRatingConfig config = JSON.parseObject(json, QwRatingConfig.class);
 
         List<SopUserLogs> sopUserLogs = sopUserLogsMapper.meetsTheRatingByUserInfoBySopId(sopId);
-        sopUserLogs.stream().forEach(item->{
+        sopUserLogs.stream().forEach(item -> {
 
             Integer countDays = item.getCountDays();
 
-           Integer sopTemIdNum=redisCache.getCacheObject("sop-tempId:"+item.getSopTempId());
+            Integer sopTemIdNum = redisCache.getCacheObject("sop-tempId:" + item.getSopTempId());
 
-           if (sopTemIdNum==null){
-               sopTemIdNum= qwSopTempDayService.getDayNumByIdLimitOne(item.getSopTempId());
-               redisCache.setCacheObject("sop-tempId:"+item.getSopTempId(),sopTemIdNum,3, TimeUnit.HOURS);
-           }
+            if (sopTemIdNum == null) {
+                sopTemIdNum = qwSopTempDayService.getDayNumByIdLimitOne(item.getSopTempId());
+                redisCache.setCacheObject("sop-tempId:" + item.getSopTempId(), sopTemIdNum, 3, TimeUnit.HOURS);
+            }
 
 
             //如果当前营期的伦次中,模板天数不足。则不评级
-            if (sopTemIdNum< countDays){
-                logger.info("当前营期的伦次中,模板天数不足。不评级:"+item.getSopTempId()+"|sopId:"+item.getSopId());
+            if (sopTemIdNum < countDays) {
+                logger.info("当前营期的伦次中,模板天数不足。不评级:" + item.getSopTempId() + "|sopId:" + item.getSopId());
                 return;
             }
 
@@ -864,7 +921,7 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
             List<SopUserLogsInfo> sopUserLogsInfosList = sopUserLogsInfoMapper.selectSopUserLogsInfoListBySopId(item.getSopId(), item.getId());
             if (sopUserLogsInfosList != null && !sopUserLogsInfosList.isEmpty()) {
 
-                List<QwExternalContact> batchQwExternalContact=new ArrayList<>();
+                List<QwExternalContact> batchQwExternalContact = new ArrayList<>();
 
                 sopUserLogsInfosList.forEach(logsInfo -> {
                     try {
@@ -875,8 +932,8 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
                                     .selectFsCourseWatchLogByExtIdRating(externalId, config.getLevelDay());
 
                             if (ratingVOS.isEmpty()) {
-                                log.error("没有看课记录不评级。则不评级:"+externalId);
-                                return ;
+                                log.error("没有看课记录不评级。则不评级:" + externalId);
+                                return;
                             }
 
                             int scoreLevel = getScoreLevel(ratingVOS, config);
@@ -894,17 +951,15 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
                             batchQwExternalContact.add(externalContact);
 
 
-
-
                         }
-                    }catch (Exception e){
+                    } catch (Exception e) {
                         logger.error("计算用户积分异常,用户id:{}", logsInfo, e);
                     }
                 });
 
                 batchUpdateQwExternalContact(batchQwExternalContact);
 
-            }else {
+            } else {
                 logger.error("当前营期没有客户-sopId:{},营期id:{}", item.getSopId(), item.getId());
             }
         });
@@ -915,10 +970,10 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
 
     @Override
     public R updateLogDate(UpdateSopUserLogDateVo vo) {
-        if(vo.getDate() == null){
+        if (vo.getDate() == null) {
             throw new BaseException("修改时间不能为空");
         }
-        if(vo.getIds() == null || vo.getIds().isEmpty()){
+        if (vo.getIds() == null || vo.getIds().isEmpty()) {
             throw new BaseException("营期ID不能为空");
         }
 //        sopUserLogsMapper.updateSopuserLogsDateById(vo);
@@ -948,16 +1003,17 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
 
         // 记录剔除的重复ID
         if (!duplicateIds.isEmpty()) {
-            log.error("根据sopId、qwUserId、corpId、startTime组合检查,剔除重复ID: {},时间:{}", duplicateIds,targetDateStr);
+            log.error("根据sopId、qwUserId、corpId、startTime组合检查,剔除重复ID: {},时间:{}", duplicateIds, targetDateStr);
         }
 
-        return  R.ok().put("data",duplicateIds);
+        return R.ok().put("data", duplicateIds);
     }
 
     /**
      * 检查是否存在相同组合的数据
      */
-    private boolean checkDuplicateCombination(SopUserLogs currentLog, List<SopUserLogs> allLogs, String targetDate) {
+    private boolean checkDuplicateCombination(SopUserLogs currentLog, List<SopUserLogs> allLogs, String
+            targetDate) {
         for (SopUserLogs log : allLogs) {
             // 跳过自身比较
             if (log.getId().equals(currentLog.getId())) {
@@ -1003,7 +1059,7 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
             sopUserLogs.setStartTime(qwSop.getStartTime());
             sopUserLogs.setStatus(1);
             QwUserVO qwUserVO = qwUserMap.get(groupChat.getOwner());
-            if(qwUserVO != null){
+            if (qwUserVO != null) {
                 sopUserLogs.setUserId(qwUserVO.getId() + "|" + qwUserVO.getCompanyUserId() + "|" + qwUserVO.getCompanyId());
             }
             return sopUserLogs;
@@ -1013,7 +1069,7 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
 
     @Override
     public List<SopUserLogs> meetsTherestoreByIsDaysNotStudy(int offset, int pageSize, Integer notStudyDays) {
-        return sopUserLogsMapper.meetsTherestoreByIsDaysNotStudy(offset,pageSize,notStudyDays);
+        return sopUserLogsMapper.meetsTherestoreByIsDaysNotStudy(offset, pageSize, notStudyDays);
     }
 
     //批量更新
@@ -1030,7 +1086,7 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
             // 直接使用批次数据进行批量更新,不需要额外的 List
             try {
                 qwExternalContactMapper.batchUpdateQwExternalContact(batchList);
-                logger.info("成功更新了评级批次数据,起始索引为:{},数量:{} ", i,batchList.size());
+                logger.info("成功更新了评级批次数据,起始索引为:{},数量:{} ", i, batchList.size());
             } catch (Exception e) {
                 // 记录异常日志,方便后续排查问题
                 logger.error("批量更新数据时发生异常,处理的批次起始索引为: " + i, e);
@@ -1041,7 +1097,7 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
     //评级
     public int getScoreLevel(List<QwRatingVO> qwRatingVOS, QwRatingConfig config) {
 
-        AtomicDouble watchCount= new AtomicDouble();
+        AtomicDouble watchCount = new AtomicDouble();
 
         qwRatingVOS.forEach(vo -> {
             // 计算 watchDuration 除以 allDuration,并保留2位小数,四舍五入
@@ -1080,20 +1136,21 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
             throw new IllegalArgumentException("分数不在任何等级范围内: " + score);
         }
     }
+
     //升降等级
-    public int getLevelUpFall(int scoreLevel,int levelUpFall){
+    public int getLevelUpFall(int scoreLevel, int levelUpFall) {
 
         if (scoreLevel > levelUpFall) {
-            return  1;//升级
-        }else if (scoreLevel < levelUpFall) {
-            return  2;//降级
-        }else {
-            return  3;//不变
+            return 1;//升级
+        } else if (scoreLevel < levelUpFall) {
+            return 2;//降级
+        } else {
+            return 3;//不变
         }
     }
 
     //计算最晚看课时间
-    public int getLatestTime(List<QwRatingVO> qwRatingVOS){
+    public int getLatestTime(List<QwRatingVO> qwRatingVOS) {
 
         // 定义日期时间格式
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@@ -1102,21 +1159,21 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
         // 用于存储提取出的时分
         List<String> timeOnlyList = new ArrayList<>();
 
-        qwRatingVOS.forEach(vos->{
+        qwRatingVOS.forEach(vos -> {
 
             String finishTime = vos.getFinishTime();
 
-            if (!StringUtil.strIsNullOrEmpty(finishTime)){
+            if (!StringUtil.strIsNullOrEmpty(finishTime)) {
                 LocalTime localTime = LocalTime.parse(finishTime, formatter);
                 String formattedTime = localTime.format(outputFormatter);
                 timeOnlyList.add(formattedTime);
             }
 
         });
-        String latestTime=null;
-        if (!timeOnlyList.isEmpty()){
-            latestTime  = Collections.max(timeOnlyList);
-        }else {
+        String latestTime = null;
+        if (!timeOnlyList.isEmpty()) {
+            latestTime = Collections.max(timeOnlyList);
+        } else {
             latestTime = "0";
         }
 
@@ -1125,5 +1182,4 @@ public class SopUserLogsServiceImpl  implements ISopUserLogsService {
     }
 
 
-
 }

+ 7 - 0
fs-service/src/main/resources/application-config-dev-jnlzjk.yml

@@ -57,6 +57,13 @@ watch:
 fs :
   commonApi: http://127.0.0.1:7771
   h5CommonApi: http://127.0.0.1:7771
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9eb5
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
+
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

+ 3 - 0
fs-service/src/main/resources/mapper/course/FsUserCourseVideoMapper.xml

@@ -92,6 +92,7 @@
             <if test="lineThree != null">line_three,</if>
             <if test="uploadType != null">upload_type,</if>
             <if test="redPacketMoney != null">red_packet_money,</if>
+            <if test="randomRedPacketRules != null">random_red_packet_rules,</if>
             <if test="fileSize != null">file_size,</if>
             <if test="fileKey != null">file_key,</if>
             <if test="round != null">round,</if>
@@ -130,6 +131,7 @@
             <if test="lineThree != null">#{lineThree},</if>
             <if test="uploadType != null">#{uploadType},</if>
             <if test="redPacketMoney != null">#{redPacketMoney},</if>
+            <if test="randomRedPacketRules != null">#{randomRedPacketRules},</if>
             <if test="fileSize != null">#{fileSize},</if>
             <if test="fileKey != null">#{fileKey},</if>
             <if test="round != null">#{round},</if>
@@ -218,6 +220,7 @@
             <if test="lineThree != null">line_three = #{lineThree},</if>
             <if test="uploadType != null">upload_type = #{uploadType},</if>
             <if test="redPacketMoney != null">red_packet_money = #{redPacketMoney},</if>
+            <if test="randomRedPacketRules != null">random_red_packet_rules = #{randomRedPacketRules},</if>
             <if test="fileSize != null">file_size = #{fileSize},</if>
             <if test="fileKey != null">file_key = #{fileKey},</if>
             <if test="round != null">round = #{round},</if>

+ 3 - 2
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

@@ -1574,8 +1574,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 <!--    商城订单查询接口-->
     <select id="selectFsStoreOrderListVO" resultType="com.fs.hisStore.vo.FsStoreOrderVO">
-        select o.*,u.phone,u.register_code,u.register_date,u.source, c.company_name ,cu.nick_name as company_user_nick_name ,cu.phonenumber as company_usere_phonenumber
-        , csc.name miniProgramName,fsp.cost as cost, fspc.cate_name,spavs.bar_code
+        select o.id,o.order_code,o.extend_order_id,o.pay_order_id,o.bank_order_id,o.user_id,o.real_name,o.user_phone,o.user_address,o.cart_id,o.freight_price,o.total_num,o.total_price,o.total_postage,o.pay_price,o.pay_postage,o.pay_delivery,o.pay_money,o.deduction_price,o.coupon_id,o.coupon_price,o.paid,o.pay_time,o.pay_type,o.create_time,o.update_time,o.status,o.refund_status,o.refund_reason_wap_img,o.refund_reason_wap_explain,o.refund_reason_time,o.refund_reason_wap,o.refund_reason,o.refund_price,o.delivery_sn,o.delivery_name,o.delivery_type,o.delivery_id,o.gain_integral,o.use_integral,o.pay_integral,o.back_integral,o.mark,o.is_del,o.remark,o.verify_code,o.store_id,o.shipping_type,o.is_channel,o.is_remind,o.is_sys_del,o.is_prescribe,o.prescribe_id,o.company_id,o.company_user_id,o.is_package,o.package_json,o.order_type,o.package_id,o.finish_time,o.delivery_status,o.delivery_pay_status,o.delivery_time,o.delivery_pay_time,o.delivery_pay_money,o.tui_money,o.tui_money_status,o.delivery_import_time,o.tui_user_id,o.tui_user_money_status,o.order_create_type,o.store_house_code,o.dept_id,o.is_edit_money,o.customer_id,o.is_pay_remain,o.delivery_send_time,o.certificates,o.upload_time,o.item_json,o.schedule_id,o.delivery_pay_type,o.order_visit,o.service_fee,o.cycle,o.prescribe_price,o.follow_doctor_id,o.follow_time,o.user_coupon_id,o.order_medium,o.erp_phone
+        ,u.phone,u.register_code,u.register_date,u.source, c.company_name ,cu.nick_name as company_user_nick_name ,cu.phonenumber as company_usere_phonenumber
+        , csc.name miniProgramName,fsp.cost, fspc.cate_name,spavs.bar_code
         from fs_store_order_scrm o
         left join fs_user u on o.user_id=u.user_id
         left join company c on c.company_id=o.company_id

+ 2 - 0
fs-service/src/main/resources/mapper/sop/SopUserLogsMapper.xml

@@ -14,6 +14,7 @@
         <result property="startTime"    column="start_time"  jdbcType="TIMESTAMP"   />
         <result property="status"    column="status"    />
         <result property="userId"    column="user_id"    />
+        <result property="chatId"    column="chat_id"    />
         <result property="countDays" column="count_days" />
     </resultMap>
 
@@ -25,6 +26,7 @@
             qw_user_id,
             corp_id,
             start_time,
+            chat_id,
             status,
             user_id,
             DATEDIFF(CURRENT_DATE, start_time) + 1 AS count_days