Browse Source

Merge branch 'dev'

yangdamao 3 days ago
parent
commit
9c5f63e214

+ 12 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsController.java

@@ -414,6 +414,18 @@ public class GoodsController extends BaseController {
         return toAjax(iGoodsService.updateRecordUrl(boList,goodsId) ? 1 : 0);
         return toAjax(iGoodsService.updateRecordUrl(boList,goodsId) ? 1 : 0);
     }
     }
 
 
+    /**
+     * 七大员商品填充腾讯
+     */
+    @ApiOperation("七大员商品填充腾讯")
+    @PostMapping("/update/qdy/url")
+    public AjaxResult<Void> updateQdyUrl(MultipartFile file,String goodsId) {
+        List<SectionImportBo> boList = EasyPoiUtil.importExcel(file,0,1,SectionImportBo.class);
+        if (CollectionUtils.isEmpty(boList)){
+            throw new CustomException("导入文件格式不正确或文件为空,请检查文件!");
+        }
+        return toAjax(iGoodsService.updateQdyUrl(boList,goodsId) ? 1 : 0);
+    }
 
 
     /**
     /**
      * 视频节导入
      * 视频节导入

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsMapper.java

@@ -137,5 +137,7 @@ public interface GoodsMapper extends BaseMapper<Goods> {
 
 
     List<CourseSection> getGoodsSectionInfo(Long goodsId);
     List<CourseSection> getGoodsSectionInfo(Long goodsId);
 
 
+    List<CourseSection> getGoodsDaySectionInfo(Long goodsId);
+
     List<Question> getQuestionAnswer(Long goodsId);
     List<Question> getQuestionAnswer(Long goodsId);
 }
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java

@@ -191,4 +191,6 @@ public interface IGoodsService extends IService<Goods> {
 	boolean createKaoQianNew();
 	boolean createKaoQianNew();
 
 
 	SubjectMarketingVo getSubject(SubjectQueryBo bo);
 	SubjectMarketingVo getSubject(SubjectQueryBo bo);
+
+	boolean updateQdyUrl(List<SectionImportBo> boList, String goodsId);
 }
 }

+ 24 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -6231,6 +6231,30 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return ObjectUtils.isNotNull(courseSubject)?BeanUtil.toBean(courseSubject,SubjectMarketingVo.class):null;
         return ObjectUtils.isNotNull(courseSubject)?BeanUtil.toBean(courseSubject,SubjectMarketingVo.class):null;
     }
     }
 
 
+    @Override
+    public boolean updateQdyUrl(List<SectionImportBo> boList, String goodsId) {
+        //获取商品节信息
+        List<CourseSection> sections = baseMapper.getGoodsDaySectionInfo(Long.valueOf(goodsId));
+        if (CollectionUtils.isEmpty(sections)){
+            return false;
+        }
+        sections.forEach(x -> {
+            if (ObjectUtils.isNull(x.getName())){
+                return;
+            }
+            SectionImportBo bo = boList.stream().filter(k -> k.getSectionName().equals(x.getName())).findFirst().orElse(null);
+            if (ObjectUtils.isNull(bo)){
+                return;
+            }
+            x.setPaolivayVideoUrl(x.getRecordingUrl());
+            x.setPaolivayVideoTime(x.getDurationTime());
+            x.setTencentVideoUrl(bo.getSectionUrl());
+            x.setTencentVideoTime(Long.valueOf(bo.getSectionTime()));
+        });
+
+        return iCourseSectionService.updateBatchById(sections);
+    }
+
     private Long businessCheck(String name,Long projectId){
     private Long businessCheck(String name,Long projectId){
         CourseProjectType projectType = iCourseProjectTypeService.getById(projectId);
         CourseProjectType projectType = iCourseProjectTypeService.getById(projectId);
         CourseBusiness business = iCourseBusinessService
         CourseBusiness business = iCourseBusinessService

+ 0 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserMapper.java

@@ -105,6 +105,5 @@ public interface UserMapper extends BaseMapper<User> {
 
 
     Integer getBusinessPhotoSign(@Param("orderGoodsId")Long orderGoodsId);
     Integer getBusinessPhotoSign(@Param("orderGoodsId")Long orderGoodsId);
 
 
-    @InterceptorIgnore(tenantLine = "true")
     User queryByOpenId(String openId);
     User queryByOpenId(String openId);
 }
 }

+ 14 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -1260,4 +1260,18 @@
             g.goods_id = #{goodsId}
             g.goods_id = #{goodsId}
     </select>
     </select>
 
 
+    <select id="getGoodsDaySectionInfo" parameterType="java.lang.Long"  resultType="com.zhongzheng.modules.course.domain.CourseSection">
+        SELECT
+            cs.*
+        FROM
+            goods_course gc
+                LEFT JOIN course_menu cm ON gc.course_id = cm.course_id
+                LEFT JOIN course_chapter_section ccs ON cm.menu_id = ccs.chapter_id
+                LEFT JOIN course_section cs ON ccs.section_id = cs.section_id
+        WHERE
+            gc.goods_id = #{goodsId}
+          AND cm.`status` = 1
+          AND cs.`status` = 1
+    </select>
+
 </mapper>
 </mapper>