Browse Source

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_scrm_java

caoliqin 1 month ago
parent
commit
4fd0355e29

+ 5 - 2
fs-admin/src/main/java/com/fs/course/controller/FsUserVideoController.java

@@ -30,6 +30,7 @@ import org.springframework.web.multipart.MultipartFile;
 import java.io.*;
 import java.util.Date;
 import java.util.List;
+import java.util.UUID;
 
 /**
  * 课堂视频Controller
@@ -208,7 +209,7 @@ public class FsUserVideoController extends BaseController
         }
 
         // 保存上传的视频文件
-        String videoFileName = System.currentTimeMillis() + "_" + file.getOriginalFilename();
+        String videoFileName = System.currentTimeMillis() + "_" + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 16);
         File videoFile = new File(VIDEO_UPLOAD_DIR, videoFileName);
         try {
             file.transferTo(videoFile);
@@ -252,7 +253,9 @@ public class FsUserVideoController extends BaseController
                 "ffmpeg",
                 "-i", videoPath,
 //                "-ss", "00:00:01.000", // 截取1秒处的帧
-                "-vframes", "1",
+                "-frames:v", "1",
+                "-f", "image2",
+                "-update", "1",
                 "-q:v", "10", // 质量,1为最好,31为最差
                 outputImagePath
         };

+ 2 - 0
fs-admin/src/main/java/com/fs/course/controller/FsVideoResourceController.java

@@ -37,6 +37,7 @@ public class FsVideoResourceController extends BaseController {
     public TableDataInfo list(@RequestParam(required = false) String resourceName,
                               @RequestParam(required = false) String fileName,
                               @RequestParam(required = false) Integer typeId,
+                              @RequestParam(required = false) Integer typeSubId,
                               @RequestParam(required = false, defaultValue = "1") Integer pageNum,
                               @RequestParam(required = false, defaultValue = "10") Integer pageSize)
     {
@@ -44,6 +45,7 @@ public class FsVideoResourceController extends BaseController {
         params.put("resourceName", resourceName);
         params.put("fileName", fileName);
         params.put("typeId", typeId);
+        params.put("typeSubId", typeSubId);
 
         PageHelper.startPage(pageNum, pageSize);
         List<FsVideoResourceVO> list = fsVideoResourceService.selectVideoResourceListByMap(params);

+ 1 - 0
fs-service-system/src/main/java/com/fs/course/domain/FsCourseQuestionBank.java

@@ -42,4 +42,5 @@ public class FsCourseQuestionBank extends BaseEntity
     @Excel(name = "答案")
     private String answer;
     private Long questionType;
+    private Long questionSubType;
 }

+ 5 - 0
fs-service-system/src/main/java/com/fs/course/domain/FsVideoResource.java

@@ -27,6 +27,11 @@ public class FsVideoResource {
      */
     private Long typeId;
 
+    /**
+     * 子分类ID
+     */
+    private Long typeSubId;
+
     /**
      * 文件名称
      */

+ 2 - 5
fs-service-system/src/main/java/com/fs/course/service/impl/FsUserCourseTrainingCampServiceImpl.java

@@ -15,6 +15,7 @@ import com.fs.course.mapper.FsUserCoursePeriodDaysMapper;
 import com.fs.course.mapper.FsUserCoursePeriodMapper;
 import com.fs.course.service.IFsUserCoursePeriodDaysService;
 import com.fs.course.vo.FsUserCourseTrainingCampVO;
+import com.fs.store.service.IFsUserService;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 import com.fs.course.mapper.FsUserCourseTrainingCampMapper;
@@ -47,11 +48,7 @@ public class FsUserCourseTrainingCampServiceImpl extends ServiceImpl<FsUserCours
      */
     @Override
     public List<FsUserCourseTrainingCampVO> selectFsUserCourseTrainingCampVOListByMap(Map<String, Object> params) {
-        List<FsUserCourseTrainingCampVO> voList = baseMapper.selectFsUserCourseTrainingCampVOListByMap(params);
-
-        // TODO: 会员数处理
-        voList.forEach(v -> v.setVipCount(0));
-        return voList;
+        return baseMapper.selectFsUserCourseTrainingCampVOListByMap(params);
     }
 
     /**

+ 2 - 2
fs-service-system/src/main/java/com/fs/course/vo/FsVideoResourceVO.java

@@ -23,9 +23,9 @@ public class FsVideoResourceVO {
     private Long typeId;
 
     /**
-     * 分类名称
+     * 子分类ID
      */
-    private String typeName;
+    private Long typeSubId;
 
     /**
      * 文件名称

+ 35 - 0
fs-service-system/src/main/java/com/fs/statis/dto/DealerAggregatedDTO.java

@@ -32,4 +32,39 @@ public class DealerAggregatedDTO implements Serializable {
      */
     private Long qwMemberNum;
 
+    /**
+     * 今日新增
+     */
+    private Long todayIncreaseUserNum;
+
+    /**
+     * 订单总数
+     */
+    private Long orderTotalNum;
+
+    /**
+     * 今日新增订单数
+     */
+    private Long todayOrderNum;
+
+    /**
+     * 收款总数
+     */
+    private Long recvTotalNum;
+
+    /**
+     * 今日收款总数
+     */
+    private Long recvTodayNum;
+
+    /**
+     * 商品总数
+     */
+    private Long goodsTotalNum;
+
+    /**
+     * 今日商品总数
+     */
+    private Long todayGoodsNum;
+
 }

+ 31 - 1
fs-service-system/src/main/java/com/fs/statis/service/impl/StatisticsServiceImpl.java

@@ -8,6 +8,10 @@ import com.fs.statis.dto.*;
 import com.fs.statis.mapper.ConsumptionBalanceMapper;
 import com.fs.statis.service.IStatisticsService;
 import com.fs.statis.service.utils.TrendDataFiller;
+import com.fs.store.service.IFsStoreOrderService;
+import com.fs.store.service.IFsStorePaymentService;
+import com.fs.store.service.IFsStoreProductService;
+import com.fs.store.service.IFsUserService;
 import com.fs.store.service.cache.IFsUserCourseCacheService;
 import com.hc.openapi.tool.util.ObjectUtils;
 import com.hc.openapi.tool.util.StringUtils;
@@ -41,7 +45,17 @@ public class StatisticsServiceImpl implements IStatisticsService {
 
     @Autowired
     private FsCourseTrafficLogMapper fsCourseTrafficLogMapper;
+    @Autowired
+    private IFsUserService userService;
+
+    @Autowired
+    private IFsStoreOrderService storeOrderService;
 
+    @Autowired
+    private IFsStorePaymentService paymentService;
+
+    @Autowired
+    private IFsStoreProductService productService;
 
     @Override
     public void dataOverviewTask() {
@@ -559,9 +573,25 @@ public class StatisticsServiceImpl implements IStatisticsService {
     }
 
 
+
     @Override
     public DealerAggregatedDTO dealerAggregated() {
-        return consumptionBalanceMapper.dealerAggregated();
+        Long dayUserCount=userService.selectFsUserCount(1,null);
+        Long storeOrderCount=storeOrderService.selectFsStoreOrderTotalCount(0,null);
+        Long dayStoreOrderCount=storeOrderService.selectFsStoreOrderTotalCount(1,null);
+        Long paymentCount=paymentService.selectFsStorePaymentCount(0,null);
+        Long dayPaymentCount=paymentService.selectFsStorePaymentCount(1,null);
+        Long productCount=productService.selectFsStoreProductCount(0);
+        Long dayProductCount=productService.selectFsStoreProductCount(1);
+        DealerAggregatedDTO dealerAggregatedDTO = consumptionBalanceMapper.dealerAggregated();
+        dealerAggregatedDTO.setTodayIncreaseUserNum(dayUserCount);
+        dealerAggregatedDTO.setOrderTotalNum(storeOrderCount);
+        dealerAggregatedDTO.setTodayOrderNum(dayStoreOrderCount);
+        dealerAggregatedDTO.setRecvTodayNum(paymentCount);
+        dealerAggregatedDTO.setRecvTodayNum(dayPaymentCount);
+        dealerAggregatedDTO.setGoodsTotalNum(productCount);
+        dealerAggregatedDTO.setTodayGoodsNum(dayProductCount);
+        return dealerAggregatedDTO;
     }
 
     @Override

+ 6 - 1
fs-service-system/src/main/resources/mapper/course/FsCourseQuestionBankMapper.xml

@@ -15,10 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="answer"    column="answer"    />
         <result property="createBy"    column="create_by"    />
         <result property="questionType"    column="question_type"    />
+        <result property="questionSubType"    column="question_sub_type"    />
     </resultMap>
 
     <sql id="selectFsCourseQuestionBankVo">
-        select id, title, sort, type, status,question_type, question, create_time, answer, create_by from fs_course_question_bank
+        select id, title, sort, type, status,question_type, question_sub_type, question, create_time, answer, create_by from fs_course_question_bank
     </sql>
 
     <select id="selectFsCourseQuestionBankList" parameterType="FsCourseQuestionBank" resultMap="FsCourseQuestionBankResult">
@@ -28,6 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="sort != null "> and sort = #{sort}</if>
             <if test="type != null "> and type = #{type}</if>
             <if test="questionType != null "> and question_type = #{questionType}</if>
+            <if test="questionSubType != null "> and question_sub_type = #{questionSubType}</if>
             <if test="status != null "> and status = #{status}</if>
             <if test="question != null  and question != ''"> and question = #{question}</if>
             <if test="answer != null  and answer != ''"> and answer = #{answer}</if>
@@ -52,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="answer != null">answer,</if>
             <if test="createBy != null">create_by,</if>
             <if test="questionType != null">question_type,</if>
+            <if test="questionSubType != null">question_sub_type,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="title != null">#{title},</if>
@@ -63,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="answer != null">#{answer},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="questionType != null">#{questionType},</if>
+            <if test="questionSubType != null">#{questionSubType},</if>
          </trim>
     </insert>
 
@@ -78,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="answer != null">answer = #{answer},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="questionType != null">question_type = #{questionType},</if>
+            <if test="questionSubType != null">question_sub_type = #{questionSubType},</if>
         </trim>
         where id = #{id}
     </update>

+ 3 - 1
fs-service-system/src/main/resources/mapper/course/FsUserCourseTrainingCampMapper.xml

@@ -11,9 +11,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             ctc.training_camp_name,
             ctc.order_number,
             min(if(ctp.period_starting_time > now(), ctp.period_starting_time, null)) as recent_date,
-            count(ctp.period_id) as period_count
+            count(distinct ctp.period_id) as period_count,
+            count(distinct cu.user_id)  as vip_count
         from fs_user_course_training_camp ctc
         left join fs_user_course_period ctp on ctc.training_camp_id = ctp.training_camp_id
+        left join fs_course_watch_log cu on cu.period_id = ctp.period_id
         <where>
             <if test="params.trainingCampName != null and params.trainingCampName != ''">
                 and ctc.training_camp_name like concat('%',#{params.trainingCampName},'%')

+ 4 - 3
fs-service-system/src/main/resources/mapper/course/FsVideoResourceMapper.xml

@@ -6,10 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectVideoResourceListByMap" resultType="com.fs.course.vo.FsVideoResourceVO">
         select
-            rr.*,
-            ucc.cate_name typeName
+            rr.*
         from fs_video_resource rr
-        left join fs_user_course_category ucc on ucc.cate_id = rr.type_id
         where rr.is_del = 0
         <if test="params.resourceName != null and params.resourceName != ''">
             and rr.resource_name like concat('%', #{params.resourceName}, '%')
@@ -20,6 +18,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="params.typeId != null">
             and rr.type_id = #{params.typeId}
         </if>
+        <if test="params.typeSubId != null">
+            and rr.type_sub_id = #{params.typeSubId}
+        </if>
         order by rr.create_time desc
     </select>
 </mapper>