ソースを参照

直播代码提交

yuhongqi 4 日 前
コミット
d0cca53e68

+ 6 - 6
fs-admin/src/main/java/com/fs/live/controller/LiveLotteryConfController.java

@@ -97,12 +97,12 @@ public class LiveLotteryConfController extends BaseController
      * 删除直播抽奖配置
      */
 //    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:remove')")
-    @Log(title = "直播抽奖配置", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{lotteryIds}")
-    public AjaxResult remove(@PathVariable Long[] lotteryIds)
-    {
-        return toAjax(liveLotteryConfService.deleteLiveLotteryConfByLotteryIds(lotteryIds));
-    }
+//    @Log(title = "直播抽奖配置", businessType = BusinessType.DELETE)
+//	@DeleteMapping("/{lotteryIds}")
+//    public AjaxResult remove(@PathVariable Long[] lotteryIds)
+//    {
+//        return toAjax(liveLotteryConfService.deleteLiveLotteryConfByLotteryIds(lotteryIds));
+//    }
 
 //    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:query')")
     @GetMapping("/live/{liveId}")

+ 6 - 6
fs-company/src/main/java/com/fs/company/controller/live/LiveLotteryConfController.java

@@ -98,12 +98,12 @@ public class LiveLotteryConfController extends BaseController
      * 删除直播抽奖配置
      */
 //    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:remove')")
-    @Log(title = "直播抽奖配置", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{lotteryIds}")
-    public AjaxResult remove(@PathVariable Long[] lotteryIds)
-    {
-        return toAjax(liveLotteryConfService.deleteLiveLotteryConfByLotteryIds(lotteryIds));
-    }
+//    @Log(title = "直播抽奖配置", businessType = BusinessType.DELETE)
+//	@DeleteMapping("/{lotteryIds}")
+//    public AjaxResult remove(@PathVariable Long[] lotteryIds)
+//    {
+//        return toAjax(liveLotteryConfService.deleteLiveLotteryConfByLotteryIds(lotteryIds));
+//    }
 
 //    @PreAuthorize("@ss.hasPermi('live:liveLotteryConf:query')")
     @GetMapping("/live/{liveId}")

+ 0 - 27
fs-live-app/src/main/java/com/fs/live/config/WebMvcConfig.java

@@ -1,27 +0,0 @@
-package com.fs.live.config;
-
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-/**
- * MVC配置
- */
-@Configuration
-public class WebMvcConfig implements WebMvcConfigurer {
-
-//    @Autowired
-//    private LoginUserHandlerMethodArgumentResolver loginUserHandlerMethodArgumentResolver;
-
-    @Override
-    public void addInterceptors(InterceptorRegistry registry) {
-
-    }
-//
-//    @Override
-//    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
-//        argumentResolvers.add(loginUserHandlerMethodArgumentResolver);
-//    }
-}

+ 1 - 1
fs-service/src/main/java/com/fs/live/mapper/LiveCouponMapper.java

@@ -69,7 +69,7 @@ public interface LiveCouponMapper
     @Select("select * from live_coupon where find_in_set(coupon_id,#{ids})")
     List<LiveCoupon> selectLiveCouponByIds(String ids);
 
-    @Select("select lc.*,lci.id,lcir.is_show,lcir.goods_id,fsp.product_name,fsp.image " +
+    @Select("select lc.*,lci.id,lcir.is_show,lcir.goods_id,fsp.product_name,fsp.images " +
             "from live_coupon_issue_relation lcir left join live_coupon_issue lci " +
             "left join live_coupon lc on lc.coupon_id=lci.coupon_id on lci.id = lcir.coupon_issue_id  " +
             "left join live_goods lg on lg.goods_id = lcir.goods_id " +

+ 1 - 1
fs-service/src/main/java/com/fs/live/mapper/LiveOrderItemMapper.java

@@ -69,7 +69,7 @@ public interface LiveOrderItemMapper {
     @MapKey("orderId")
     @Select("<script>" +
             "select a.item_id, a.order_id as orderId, a.order_code, a.cart_id, a.goods_id, a.product_id, a.product_attr_value_id, a.json_info, a.num, a.is_after_sales, a.is_prescribe, a.store_id, a.is_gift\n" +
-            ", b.product_name, b.image as img_url, b.price, b.ot_price, b.sales, b.product_info as product_introduce\n" +
+            ", b.product_name, b.images as img_url, b.price, b.ot_price, b.sales, b.product_info as product_introduce\n" +
             "from live_order_item a\n" +
             "left join fs_store_product b on a.product_id = b.product_id\n" +
             "where order_id in\n" +

+ 5 - 0
fs-service/src/main/java/com/fs/live/mapper/LiveSensitiveWordsMapper.java

@@ -2,6 +2,8 @@ package com.fs.live.mapper;
 
 
 import com.fs.live.domain.LiveSensitiveWords;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
 
@@ -65,4 +67,7 @@ public interface LiveSensitiveWordsMapper {
      * @return
      */
     List<String> selectAllWords();
+
+    @Select("select count(1) from live_sensitive_words where word=#{word}")
+    int selectWordsByName(@Param("word") String word);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/live/service/impl/LiveSensitiveWordsServiceImpl.java

@@ -55,6 +55,8 @@ public class LiveSensitiveWordsServiceImpl implements ILiveSensitiveWordsService
     @Override
     public int insertLiveSensitiveWords(LiveSensitiveWords liveSensitiveWords)
     {
+        int count = baseMapper.selectWordsByName(liveSensitiveWords.getWord());
+        if(count > 0) return -1;
         liveSensitiveWords.setCreateTime(new Date());
         return baseMapper.insertLiveSensitiveWords(liveSensitiveWords);
     }

+ 20 - 13
fs-service/src/main/java/com/fs/live/service/impl/LiveServiceImpl.java

@@ -718,7 +718,12 @@ public class LiveServiceImpl implements ILiveService
         // 运营自动化
         List<LiveAutoTask> liveAutoTasksList = liveAutoTaskService.selectLiveAutoTaskByLiveId(existLiveId);
         List<LiveAutoTask> barrageTask = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 3L).collect(Collectors.toList());
-        List<LiveAutoTask> goodsTask = liveAutoTasksList.stream().filter(liveAutoTask -> liveAutoTask.getTaskType() == 1L).collect(Collectors.toList());
+        Map<Long, LiveAutoTask> goodsMap = liveAutoTasksList.stream()
+                .filter(liveAutoTask -> liveAutoTask.getTaskType() == 1L)
+                .collect(Collectors.toMap(liveAutoTask -> {
+                            return parseIdFromContent(liveAutoTask.getContent(),"goodsId");
+                        }, liveAutoTask -> liveAutoTask, (existing, replacement) -> replacement
+                ));
         Map<Long, LiveAutoTask> redMap = liveAutoTasksList.stream()
                 .filter(liveAutoTask -> liveAutoTask.getTaskType() == 2L)
                 .collect(Collectors.toMap(liveAutoTask -> {
@@ -731,18 +736,7 @@ public class LiveServiceImpl implements ILiveService
                     return parseIdFromContent(liveAutoTask.getContent(),"lotteryId");
                         }, liveAutoTask -> liveAutoTask, (existing, replacement) -> replacement
                 ));
-        if (!goodsTask.isEmpty()) {
-            LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
-            for (LiveAutoTask liveAutoTask : goodsTask) {
-                BeanUtils.copyBeanProp(liveAutoTaskEntity, liveAutoTask);
-                liveAutoTaskEntity.setId(null);
-                liveAutoTaskEntity.setLiveId(newLiveId);
-                liveAutoTaskEntity.setCreateTime(now);
-                liveAutoTaskEntity.setUpdateTime(now);
-                liveAutoTaskEntity.setFinishStatus(0L);
-                liveAutoTaskService.copyInsertLiveAutoTask(liveAutoTaskEntity,liveEntity);
-            }
-        }
+
         if (!barrageTask.isEmpty()) {
             LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
             for (LiveAutoTask liveAutoTask : barrageTask) {
@@ -829,6 +823,19 @@ public class LiveServiceImpl implements ILiveService
                 if (collect.containsKey(liveGoods.getGoodsId())) {
                     liveCouponIssueRelations.stream().filter(relation -> relation.getGoodsId().equals(liveGoods.getGoodsId())).findFirst().ifPresent(liveCouponIssueRelation -> liveCouponIssueRelation.setGoodsId(liveGoodsEntity.getGoodsId()));
                 }
+                // 直播商品task
+                if (goodsMap.containsKey(liveGoods.getGoodsId())) {
+                    LiveAutoTask liveAutoTaskEntity = new LiveAutoTask();
+                    LiveAutoTask liveAutoTask = goodsMap.get(liveGoods.getGoodsId());
+                    BeanUtils.copyBeanProp(liveAutoTaskEntity, liveAutoTask);
+                    liveAutoTaskEntity.setId(null);
+                    liveAutoTaskEntity.setLiveId(newLiveId);
+                    liveAutoTaskEntity.setCreateTime(now);
+                    liveAutoTaskEntity.setUpdateTime(now);
+                    liveAutoTaskEntity.setFinishStatus(0L);
+                    liveAutoTaskEntity.setContent(JSON.toJSONString(liveGoodsEntity));
+                    liveAutoTaskService.copyInsertLiveAutoTask(liveAutoTaskEntity,liveEntity);
+                }
             }
         }
         for (LiveCouponIssueRelation liveCouponIssueRelation : liveCouponIssueRelations) {

+ 6 - 6
fs-service/src/main/resources/mapper/live/LiveGoodsMapper.xml

@@ -170,7 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectProductListByLiveId" parameterType="LiveGoods" resultType="com.fs.live.vo.LiveGoodsVo">
 
-        select lg.goods_id,sp.image as img_url,sp.product_name,sp.price,sp.stock,lg.sales,lg.status,sp.product_id,sp.ot_price,case when lg.is_show = 1 then true else false end as is_show
+        select lg.goods_id,sp.images as img_url,sp.product_name,sp.price,sp.stock,lg.sales,lg.status,sp.product_id,sp.ot_price,case when lg.is_show = 1 then true else false end as is_show
         <if test="companyUserId != null "> ,if(uf.favorite_id is not null, true, false) is_favorite </if>
 
         from live_goods lg
@@ -197,7 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectProductListByLiveIdAll" parameterType="LiveGoods" resultType="com.fs.live.vo.LiveGoodsVo">
 
-        select lg.goods_id,sp.image as img_url,sp.product_name,sp.price,lg.stock,lg.sales,lg.status,sp.product_id,sp.ot_price,case when lg.is_show = 1 then true else false end as is_show,sp.is_show as fs_status
+        select lg.goods_id,sp.images as img_url,sp.product_name,sp.price,lg.stock,lg.sales,lg.status,sp.product_id,sp.ot_price,case when lg.is_show = 1 then true else false end as is_show,sp.is_show as fs_status
         from live_goods lg
         left join fs_store_product sp
         ON  lg.product_id = sp.product_id
@@ -217,7 +217,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectLiveGoodsVoByGoodsId"  resultType="com.fs.live.vo.LiveGoodsVo">
 
-        select lg.goods_id,sp.image as img_url,sp.product_name,sp.price,lg.stock,lg.sales,lg.status,sp.product_id,sp.ot_price, case when lg.is_show = 1 then true else false end as is_show,sp.is_show as fs_status
+        select lg.goods_id,sp.images as img_url,sp.product_name,sp.price,lg.stock,lg.sales,lg.status,sp.product_id,sp.ot_price, case when lg.is_show = 1 then true else false end as is_show,sp.is_show as fs_status
         from live_goods lg
         left join fs_store_product sp
         ON  lg.product_id = sp.product_id
@@ -229,7 +229,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="showGoods"  resultType="com.fs.live.vo.LiveGoodsVo">
 
-        select lg.goods_id,sp.image as img_url,sp.product_name,sp.price,lg.stock,lg.sales,lg.status,sp.product_id,sp.ot_price, case when lg.is_show = 1 then true else false end as is_show,sp.is_show as fs_status
+        select lg.goods_id,sp.images as img_url,sp.product_name,sp.price,lg.stock,lg.sales,lg.status,sp.product_id,sp.ot_price, case when lg.is_show = 1 then true else false end as is_show,sp.is_show as fs_status
         from live_goods lg
         left join fs_store_product sp
         ON  lg.product_id = sp.product_id
@@ -256,7 +256,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectProductListByOrder" parameterType="com.fs.live.domain.LiveOrder" resultType="com.fs.live.vo.LiveGoodsVo">
 
-        select sp.image as img_url,sp.product_name,sp.price,sp.stock,sp.sales,sp.product_id,sp.ot_price, sp.is_show as fs_status,sp.bar_code
+        select sp.images as img_url,sp.product_name,sp.price,sp.stock,sp.sales,sp.product_id,sp.ot_price, sp.is_show as fs_status,sp.bar_code
         from fs_store_product sp
         <where>
             sp.product_id = #{productId}
@@ -267,7 +267,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select
             g.*,
             if(uf.favorite_id is not null, true, false) isFavorite,
-            p.image as img_url, p.product_name, p.price, g.sales, p.ot_price,p.is_show as fs_status
+            p.images as img_url, p.product_name, p.price, g.sales, p.ot_price,p.is_show as fs_status
         from live_goods g
         left join fs_store_product p on p.product_id = g.product_id and p.is_show = 1
         left join live_user_favorite uf on uf.product_id = g.goods_id and uf.user_id = #{params.userId}

+ 1 - 1
fs-service/src/main/resources/mapper/live/LiveLotteryProductConfMapper.xml

@@ -130,7 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectLiveLotteryProductConfByLotteryIds"  resultType="com.fs.live.vo.LiveLotteryProductListVo">
         select llpc.lottery_id,llpc.live_id,llpc.product_id,llpc.prize_level,llpc.per_lottery_num,llpc.total_lots,
-               fs.image as img_url,fs.product_name,fs.price,fs.ot_price,fs.sales,fs.stock
+               fs.images as img_url,fs.product_name,fs.price,fs.ot_price,fs.sales,fs.stock
                from live_lottery_product_conf llpc
             left join live_goods lg on lg.goods_id = llpc.product_id
             left join fs_store_product fs on fs.product_id = lg.product_id

+ 1 - 1
fs-service/src/main/resources/mapper/live/LiveOrderItemMapper.xml

@@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCheckedByUserId" parameterType="java.util.List" resultType="com.fs.live.vo.LiveOrderItemVo">
         select a.item_id, a.order_id, a.order_code, a.cart_id, a.goods_id, a.product_id,a. product_attr_value_id, a.json_info, a.num, a.is_after_sales, a.is_prescribe, a.store_id, a.is_gift
-        , b.product_name, b.image as img_url, b.price, b.ot_price, b.sales, b.product_info as product_introduce
+        , b.product_name, b.images as img_url, b.price, b.ot_price, b.sales, b.product_info as product_introduce
         from live_order_item a
         left join fs_store_product b on a.product_id = b.product_id
         where a.user_id=#{userId}

+ 1 - 1
fs-service/src/main/resources/mapper/live/LiveOrderMapper.xml

@@ -91,7 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             a.pay_remain,	a.delivery_status,	a.delivery_pay_status,	a.delivery_pay_time,	a.delivery_type,
             a.delivery_pay_money,	a.delivery_import_time,	a.delivery_send_time,	a.is_after_sales,	a.dept_id,
             a.channel,	a.source,	a.bill_price,	a.total_postage,	a.pay_postage,	a.gain_integral,
-            a.use_integral,	a.pay_integral,	a.back_integral,	a.is_edit_money,	b.product_info as product_introduce,a.customer_id
+            a.use_integral,	a.pay_integral,	a.back_integral,	a.is_edit_money,	b.product_introduce as product_introduce,a.customer_id
         FROM
             live_order a LEFT JOIN fs_store_product b ON a.product_id = b.product_id
     </sql>