Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/Payment-Configuration' into Payment-Configuration

xgb 2 settimane fa
parent
commit
3b29ebeb48

+ 2 - 2
fs-company/src/main/java/com/fs/company/controller/course/FsCourseRedPacketLogController.java

@@ -98,13 +98,13 @@ public class FsCourseRedPacketLogController extends BaseController
         }
 
         List<FsCourseRedPacketLogListPVO> list = fsCourseRedPacketLogService.selectFsCourseRedPacketLogListVO(fsCourseRedPacketLog);
-        for (FsCourseRedPacketLogListPVO fsCourseRedPacketLogListPVO : list) {
+  /*      for (FsCourseRedPacketLogListPVO fsCourseRedPacketLogListPVO : list) {
             if (ObjectUtil.isNotEmpty(fsCourseRedPacketLogListPVO.getPeriodId())){
                 FsUserCoursePeriod fsUserCoursePeriod = fsUserCoursePeriodService.selectFsUserCoursePeriodById(fsCourseRedPacketLogListPVO.getPeriodId().longValue());
                 fsCourseRedPacketLogListPVO.setPeriodName(fsUserCoursePeriod.getPeriodName());
             }
             fsCourseRedPacketLogListPVO.setPhone(PhoneUtil.decryptAutoPhoneMk(fsCourseRedPacketLogListPVO.getPhone()));
-        }
+        }*/
         return getDataTable(list);
     }
 

+ 33 - 5
fs-quartz/src/main/java/com/fs/quartz/config/ScheduleConfig.java

@@ -1,21 +1,28 @@
 package com.fs.quartz.config;
 
+import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.quartz.SchedulerFactoryBean;
+
 import javax.sql.DataSource;
 import java.util.Properties;
 
 /**
  * 定时任务配置
  *
-
  */
 @Configuration
 public class ScheduleConfig
 {
     @Bean
-    public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource)
+    public QuartzProperties quartzProperties()
+    {
+        return new QuartzProperties();
+    }
+
+    @Bean
+    public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource, QuartzProperties quartzProperties)
     {
         SchedulerFactoryBean factory = new SchedulerFactoryBean();
         factory.setDataSource(dataSource);
@@ -49,10 +56,31 @@ public class ScheduleConfig
         // 可选,QuartzScheduler
         // 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
         factory.setOverwriteExistingJobs(true);
-        // 设置自动启动,默认为true 切记调整为true1
-        factory.setAutoStartup(true);
-//        factory.setAutoStartup(false);
+        // 设置自动启动,默认true,配置文件中可覆盖
+        factory.setAutoStartup(quartzProperties.getAutoStartup());
 
         return factory;
     }
+
+    /**
+     * Quartz配置属性
+     */
+    @ConfigurationProperties(prefix = "quartz")
+    public static class QuartzProperties
+    {
+        /**
+         * 是否自动启动定时任务,默认true
+         */
+        private boolean autoStartup = true;
+
+        public boolean getAutoStartup()
+        {
+            return autoStartup;
+        }
+
+        public void setAutoStartup(boolean autoStartup)
+        {
+            this.autoStartup = autoStartup;
+        }
+    }
 }

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

@@ -113,38 +113,7 @@ public interface FsCourseRedPacketLogMapper
             " order by o.order_id desc  "+
             "</script>"})
     List<FsCourseRedPacketLogListPVO> selectRedPacketLogListVO(@Param("maps") FsCourseRedPacketLogParam param);
-    @Select({"<script> " +
-            "select l.*,v.title,u.nick_name as fsNickName,u.avatar as fsAvatar,u.phone,cu.nick_name company_user_name,c.company_name,qu.qw_user_name,fuc.course_name,u.phone as phoneNumber,cu.dept_id   from fs_course_red_packet_log l  \n" +
-            "left join fs_user_course_video v on v.video_id = l.video_id \n" +
-            "left join fs_user u on u.user_id = l.user_id \n" +
-            "left join fs_user_course fuc on fuc.course_id = l.course_id \n" +
-            "left join company_user cu on cu.user_id=l.company_user_id \n" +
-            "left join company c on c.company_id=cu.company_id \n" +
-            "LEFT JOIN qw_user qu on qu.id= l.qw_user_id  \n" +
-            "where 1=1   " +
-            "<if test = ' maps.userId !=null '> and l.user_id = #{maps.userId} </if>" +
-            "<if test = ' maps.logId !=null '> and l.log_id = #{maps.logId} </if>" +
-            "<if test = ' maps.watchLogId !=null '> and l.watch_log_id = #{maps.watchLogId} </if>" +
-            "<if test = ' maps.companyId !=null '> and l.company_id = #{maps.companyId} </if>" +
-            "<if test = ' maps.companyUserId !=null '> and l.company_user_id = #{maps.companyUserId} </if>" +
-            "<if test = ' maps.companyUserName !=null '> and cu.nick_name  like concat('%', #{maps.companyUserName}, '%') </if>" +
-            "<if test = ' maps.nickName !=null '> and u.nick_name  like concat('%', #{maps.nickName}, '%') </if>" +
-            "<if test = ' maps.courseId !=null '> and l.course_id = #{maps.courseId} </if>" +
-            "<if test = ' maps.videoId !=null '> and l.video_id = #{maps.videoId} </if>" +
-            "<if test = ' maps.periodId !=null '> and l.period_id = #{maps.periodId} </if>" +
-            "<if test = ' maps.status !=null '> and l.status = #{maps.status} </if>" +
-            "<if test = \"maps.phone !=null and maps.phone != '' \"> and u.phone = #{maps.phone} </if>" +
-            "<if test = ' maps.qwUserId !=null '> and l.qw_user_id = #{maps.qwUserId} </if>" +
-            "<if test=\"maps.sTime != null \">  and DATE(l.create_time) &gt;= DATE(#{maps.sTime})</if>\n" +
-            "<if test=\"maps.eTime != null \">  and DATE(l.create_time) &lt;= DATE(#{maps.eTime})</if>\n" +
-            "<if test=\"maps.userIds != null and maps.userIds.size() > 0\">\n" +
-            "                AND l.company_user_id IN\n" +
-            "                <foreach collection=\"maps.userIds\" open=\"(\" close=\")\" separator=\",\" item=\"item\">\n" +
-            "                    ${item}\n" +
-            "                </foreach>\n" +
-            "            </if>" +
-            " order by l.log_id desc  "+
-            "</script>"})
+
     List<FsCourseRedPacketLogListPVO> selectFsCourseRedPacketLogListVO(@Param("maps") FsCourseRedPacketLogParam fsCourseRedPacketLog);
 
     List<FsCourseRedPacketLogListPVO> selectFsCourseRedPacketLogListVOPage(@Param("maps") FsCourseRedPacketLogParam fsCourseRedPacketLog);

+ 3 - 0
fs-service/src/main/java/com/fs/course/mapper/FsUserVideoMapper.java

@@ -162,6 +162,9 @@ public interface FsUserVideoMapper
             "<if test='maps.keyword != null and maps.keyword != \"\"'>",
             "    AND v.title LIKE CONCAT('%', #{maps.keyword}, '%')",
             "</if>",
+            "<if test='maps.source != null and maps.source != \"\"'>",
+            "    AND v.source = #{maps.source}",
+            "</if>",
             "<choose>",
             "    <when test='maps.sortType == \"hot\"'>",
             "        ORDER BY v.likes DESC, v.create_time DESC",

+ 10 - 0
fs-service/src/main/java/com/fs/course/param/FsUserVideoListUParam.java

@@ -12,9 +12,19 @@ public class FsUserVideoListUParam extends BaseParam implements Serializable {
 
     Long videoId;
 
+    /**
+     * 是否为ios发版
+     */
+    Boolean isIos;
+
     /**
      * 类型
      */
     String sortType;
 
+    /**
+     * 来源
+     */
+    Integer source;
+
 }

+ 13 - 13
fs-service/src/main/java/com/fs/course/service/impl/FsCourseAnswerLogsServiceImpl.java

@@ -372,31 +372,31 @@ public class FsCourseAnswerLogsServiceImpl implements IFsCourseAnswerLogsService
     }
 
     /**
-     * 获取去年12月1日之前的时间字符串
-     * 注意:这个是时间上限,查询条件是小于这个时间的数据
+     * 获取两个月之前的
      */
     private String getLastYearDecemberFirstTimeString() {
         try {
             Calendar calendar = Calendar.getInstance();
-            int currentYear = calendar.get(Calendar.YEAR);
-
-            // 🔴 关键修改:去年12月1日,不是今年
-            int lastYear = currentYear - 1;
-
-            // 设置去年12月1日 00:00:00
-            calendar.set(lastYear, Calendar.DECEMBER, 1, 0, 0, 0);
+            calendar.add(Calendar.MONTH, -2); // 两个月前
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            calendar.set(Calendar.HOUR_OF_DAY, 0);
+            calendar.set(Calendar.MINUTE, 0);
+            calendar.set(Calendar.SECOND, 0);
             calendar.set(Calendar.MILLISECOND, 0);
 
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             String result = sdf.format(calendar.getTime());
 
-            log.info("📅 设置查询结束时间:去年12月1日 = {}", result);
+            log.info("📅 设置查询结束时间:两个月前 = {}", result);
             return result;
 
         } catch (Exception e) {
-            log.error("获取去年12月1日时间失败", e);
-            // 兜底:返回前年12月1日,确保能查到历史数据
-            return (Calendar.getInstance().get(Calendar.YEAR) - 2) + "-12-01 00:00:00";
+            log.error("获取两个月前时间失败", e);
+            // 兜底:返回当前时间前推2个月
+            Calendar fallbackCalendar = Calendar.getInstance();
+            fallbackCalendar.add(Calendar.MONTH, -2);
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            return sdf.format(fallbackCalendar.getTime());
         }
     }
 

+ 13 - 13
fs-service/src/main/java/com/fs/course/service/impl/FsCourseRedPacketLogServiceImpl.java

@@ -759,31 +759,31 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
     }
 
     /**
-     * 获取去年12月1日之前的时间字符串
-     * 注意:这个是时间上限,查询条件是小于这个时间的数据
+     * 获取两个月之前的
      */
     private String getLastYearDecemberFirstTimeString() {
         try {
             Calendar calendar = Calendar.getInstance();
-            int currentYear = calendar.get(Calendar.YEAR);
-
-            // 🔴 关键修改:去年12月1日,不是今年
-            int lastYear = currentYear - 1;
-
-            // 设置去年12月1日 00:00:00
-            calendar.set(lastYear, Calendar.DECEMBER, 1, 0, 0, 0);
+            calendar.add(Calendar.MONTH, -2); // 两个月前
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            calendar.set(Calendar.HOUR_OF_DAY, 0);
+            calendar.set(Calendar.MINUTE, 0);
+            calendar.set(Calendar.SECOND, 0);
             calendar.set(Calendar.MILLISECOND, 0);
 
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             String result = sdf.format(calendar.getTime());
 
-            log.info("📅 设置查询结束时间:去年12月1日 = {}", result);
+            log.info("📅 设置查询结束时间:两个月前 = {}", result);
             return result;
 
         } catch (Exception e) {
-            log.error("获取去年12月1日时间失败", e);
-            // 兜底:返回前年12月1日,确保能查到历史数据
-            return (Calendar.getInstance().get(Calendar.YEAR) - 2) + "-12-01 00:00:00";
+            log.error("获取两个月前时间失败", e);
+            // 兜底:返回当前时间前推2个月
+            Calendar fallbackCalendar = Calendar.getInstance();
+            fallbackCalendar.add(Calendar.MONTH, -2);
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            return sdf.format(fallbackCalendar.getTime());
         }
     }
 

+ 13 - 13
fs-service/src/main/java/com/fs/course/service/impl/FsCourseWatchLogServiceImpl.java

@@ -1656,31 +1656,31 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
     }
 
     /**
-     * 获取去年12月1日之前的时间字符串
-     * 注意:这个是时间上限,查询条件是小于这个时间的数据
+     * 获取两个月之前的
      */
     private String getLastYearDecemberFirstTimeString() {
         try {
             Calendar calendar = Calendar.getInstance();
-            int currentYear = calendar.get(Calendar.YEAR);
-
-            // 🔴 关键修改:去年12月1日,不是今年
-            int lastYear = currentYear - 1;
-
-            // 设置去年12月1日 00:00:00
-            calendar.set(lastYear, Calendar.DECEMBER, 1, 0, 0, 0);
+            calendar.add(Calendar.MONTH, -2); // 两个月前
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
+            calendar.set(Calendar.HOUR_OF_DAY, 0);
+            calendar.set(Calendar.MINUTE, 0);
+            calendar.set(Calendar.SECOND, 0);
             calendar.set(Calendar.MILLISECOND, 0);
 
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             String result = sdf.format(calendar.getTime());
 
-            log.info("📅 设置查询结束时间:去年12月1日 = {}", result);
+            log.info("📅 设置查询结束时间:两个月前 = {}", result);
             return result;
 
         } catch (Exception e) {
-            log.error("获取去年12月1日时间失败", e);
-            // 兜底:返回前年12月1日,确保能查到历史数据
-            return (Calendar.getInstance().get(Calendar.YEAR) - 2) + "-12-01 00:00:00";
+            log.error("获取两个月前时间失败", e);
+            // 兜底:返回当前时间前推2个月
+            Calendar fallbackCalendar = Calendar.getInstance();
+            fallbackCalendar.add(Calendar.MONTH, -2);
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            return sdf.format(fallbackCalendar.getTime());
         }
     }
 

+ 4 - 0
fs-service/src/main/resources/application-druid-zkzh-test.yml

@@ -150,3 +150,7 @@ im:
 #是否为新商户,新商户不走mpOpenId
 isNewWxMerchant: false
 
+# Quartz 定时任务配置
+# 如果不配置,默认 auto-startup 为 true
+quartz:
+    auto-startup: false

+ 2 - 1
fs-service/src/main/resources/application-druid-zkzh.yml

@@ -150,5 +150,6 @@ im:
     type: OPENIM
 #是否为新商户,新商户不走mpOpenId
 isNewWxMerchant: true
-
+quartz:
+    auto-startup: true
 

+ 54 - 0
fs-service/src/main/resources/mapper/course/FsCourseRedPacketLogMapper.xml

@@ -435,6 +435,60 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ORDER BY l.log_id DESC
     </select>
 
+
+    <select id="selectFsCourseRedPacketLogListVO" resultType="com.fs.course.vo.FsCourseRedPacketLogListPVO">
+        SELECT
+            l.log_id, l.course_id, l.user_id, l.video_id, l.company_user_id, l.company_id,
+            l.amount, l.create_time, l.qw_user_id, l.out_batch_no, l.status, l.update_time,
+            l.watch_log_id, l.remark, l.period_id, l.batch_id, l.app_id,
+            u.nick_name AS fsNickName, u.avatar AS fsAvatar, u.phone,
+            cu.nick_name AS company_user_name, cu.dept_id,
+            c.company_name AS company_name,
+            qu.qw_user_name AS qw_user_name,
+            v.title AS video_name,
+            p.period_name AS period_name,
+            cd.dept_name AS dept_name,
+            uc.course_name AS course_name
+        FROM fs_course_red_packet_log l
+        INNER JOIN (
+            SELECT log_id FROM fs_course_red_packet_log
+            <where>
+                <if test="maps.userId != null"> AND user_id = #{maps.userId} </if>
+                <if test="maps.logId != null"> AND log_id = #{maps.logId} </if>
+                <if test="maps.watchLogId != null"> AND watch_log_id = #{maps.watchLogId} </if>
+                <if test="maps.companyId != null"> AND company_id = #{maps.companyId} </if>
+                <if test="maps.companyUserId != null"> AND company_user_id = #{maps.companyUserId} </if>
+                <if test="maps.courseId != null"> AND course_id = #{maps.courseId} </if>
+                <if test="maps.videoId != null"> AND video_id = #{maps.videoId} </if>
+                <if test="maps.periodId != null"> AND period_id = #{maps.periodId} </if>
+                <if test="maps.status != null"> AND status = #{maps.status} </if>
+                <if test="maps.qwUserId != null"> AND qw_user_id = #{maps.qwUserId} </if>
+                <if test="maps.sTime != null"> AND create_time &gt;= #{maps.sTime} </if>
+                <if test="maps.eTime != null"> AND create_time &lt;= #{maps.eTime} </if>
+                <if test="maps.userIdsConverted != null and maps.userIdsConverted.size() > 0">
+                    AND company_user_id IN
+                    <foreach collection="maps.userIdsConverted" open="(" close=")" separator="," item="item">#{item}</foreach>
+                </if>
+            </where>
+            ORDER BY log_id DESC
+        ) AS t ON t.log_id = l.log_id
+        LEFT JOIN fs_user u ON u.user_id = l.user_id
+        LEFT JOIN company_user cu ON cu.user_id = l.company_user_id
+        LEFT JOIN company c ON c.company_id = l.company_id
+        LEFT JOIN qw_user qu ON qu.id = l.qw_user_id
+        LEFT JOIN fs_user_course_video v ON v.video_id = l.video_id
+        LEFT JOIN fs_user_course_period p ON p.period_id = l.period_id
+        LEFT JOIN company_dept cd ON cd.dept_id = cu.dept_id
+        LEFT JOIN fs_user_course uc ON uc.course_id = l.course_id
+        <where>
+            <if test="maps.companyUserName != null"> AND cu.nick_name LIKE concat('%', #{maps.companyUserName}, '%') </if>
+            <if test="maps.nickName != null"> AND u.nick_name LIKE concat('%', #{maps.nickName}, '%') </if>
+            <if test="maps.phone != null and maps.phone != ''"> AND u.phone = #{maps.phone} </if>
+        </where>
+        ORDER BY l.log_id DESC
+    </select>
+
+
     <!-- 快速COUNT:仅查主表,不JOIN,走索引 -->
     <select id="selectFsCourseRedPacketLogListVOCount" resultType="long">
         SELECT COUNT(1) FROM fs_course_red_packet_log

+ 24 - 0
fs-user-app/src/main/java/com/fs/app/controller/VideoController.java

@@ -1,8 +1,11 @@
 package com.fs.app.controller;
 
+import cn.hutool.core.collection.CollectionUtil;
+import cn.hutool.core.util.ObjectUtil;
 import com.fs.app.annotation.Login;
 import com.fs.common.annotation.RepeatSubmit;
 import com.fs.common.core.domain.R;
+import com.fs.common.core.domain.entity.SysDictData;
 import com.fs.common.utils.StringUtils;
 import com.fs.course.domain.*;
 import com.fs.course.param.*;
@@ -11,6 +14,7 @@ import com.fs.course.vo.FsUserVideoCommentListUVO;
 import com.fs.course.vo.FsUserVideoListUVO;
 import com.fs.course.vo.FsUserVideoTagsVo;
 import com.fs.his.utils.TalentTreeUtil;
+import com.fs.system.service.ISysDictTypeService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.google.common.collect.Lists;
@@ -45,6 +49,21 @@ public class VideoController extends  AppBaseController{
     @Autowired
     private IFsUserVideoTagsService fsUserVideoTagsService;
 
+    @Autowired
+    private ISysDictTypeService iSysDictTypeService;
+    /**
+     * 后台配置
+     *
+     * @return
+     */
+    private boolean isInit() {
+        List<SysDictData> sysDictData = iSysDictTypeService.selectDictDataByType("is_init");
+        if (CollectionUtil.isNotEmpty(sysDictData)){
+            return sysDictData.get(0).getDictValue().equals("1");
+        }
+        return false;
+    }
+
     @ApiOperation("视频列表")
     @GetMapping("/getVideoList")
     public R getVideoList(FsUserVideoListUParam param)
@@ -52,6 +71,11 @@ public class VideoController extends  AppBaseController{
         if (StringUtils.isNotEmpty(getUserId())) {
             param.setUserId(Long.parseLong(getUserId()));
         }
+
+        if (ObjectUtil.isNotEmpty(param.getIsIos())&&param.getIsIos() && isInit()){
+            param.setSource(3);
+        }
+
         PageHelper.startPage(param.getPageNum(), param.getPageSize());
         List<FsUserVideoListUVO> list= videoService.selectFsUserVideoListUVO(param);
         //添加假数据

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

@@ -29,7 +29,7 @@ public class CompanyOrderNewScrmController extends AppBaseController {
 
     @Login
     @ApiOperation("查询制单收货地址")
-    @GetMapping("/createAddress")
+    @GetMapping("/getAddress")
     public R getAddress(String orderKey){
         return orderService.getAddress(orderKey);
     }