jin 4 ヶ月 前
コミット
be26c7c1cf

+ 11 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/recovery/domain/RecContent.java

@@ -37,6 +37,8 @@ public class RecContent extends BaseEntity
     @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date updateDate;
 
+    private String images;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -82,6 +84,14 @@ public class RecContent extends BaseEntity
         this.thumbs = thumbs;
     }
 
+    public String getImages() {
+        return images;
+    }
+
+    public void setImages(String images) {
+        this.images = images;
+    }
+
     @Override
     public String toString() {
         final StringBuffer sb = new StringBuffer("RecContent{");
@@ -90,6 +100,7 @@ public class RecContent extends BaseEntity
         sb.append(", thumbs=").append(thumbs);
         sb.append(", createDate=").append(createDate);
         sb.append(", updateDate=").append(updateDate);
+        sb.append(", images='").append(images).append('\'');
         sb.append('}');
         return sb.toString();
     }

+ 6 - 1
ruoyi-system/src/main/resources/mapper/system/RecContentMapper.xml

@@ -12,10 +12,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy"    column="update_by"    />
         <result property="updateDate"    column="update_date"    />
         <result property="thumbs"    column="thumbs"    />
+        <result property="images"    column="images"    />
     </resultMap>
 
     <sql id="selectRecContentVo">
-        select id, content, create_by, create_date, update_by, update_date, thumbs from rec_content
+        select id, content, create_by, create_date, update_by, update_date, thumbs, images from rec_content
     </sql>
 
     <select id="selectRecContentList" parameterType="RecContent" resultMap="RecContentResult">
@@ -25,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createDate != null "> and create_date = #{createDate}</if>
             <if test="updateDate != null "> and update_date = #{updateDate}</if>
             <if test="thumbs != null "> and thumbs = #{thumbs}</if>
+            <if test="images != null "> and images = #{images}</if>
         </where>
     </select>
 
@@ -43,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by,</if>
             <if test="updateDate != null">update_date,</if>
             <if test="thumbs != null">thumbs,</if>
+            <if test="images != null">images,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -52,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateDate != null">#{updateDate},</if>
             <if test="thumbs != null">#{thumbs},</if>
+            <if test="images != null">#{images},</if>
          </trim>
     </insert>
 
@@ -64,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateDate != null">update_date = #{updateDate},</if>
             <if test="thumbs != null">thumbs = #{thumbs},</if>
+            <if test="images != null">images = #{images},</if>
         </trim>
         where id = #{id}
     </update>

+ 8 - 0
ruoyi-wx/src/main/java/com/ruoyi/wx/web/mapper/WxHomeMapper.java

@@ -5,6 +5,7 @@ import com.ruoyi.wx.web.domain.vo.RecStoresVo;
 import com.ruoyi.wx.web.domain.vo.SaleInfoVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.security.core.parameters.P;
 
 import java.util.List;
 
@@ -26,4 +27,11 @@ public interface WxHomeMapper {
      * @return 模糊查询所有发售此商品的门店
      */
     List<RecStores> selectRecStoresByCommondityIds(@Param("ids") List<String> comIds);
+
+    /**
+     * 查询是否展示抽奖系统
+     *
+     * @return 结果集
+     */
+    String selectLotteryDisplay(@Param("key") String key);
 }

+ 2 - 0
ruoyi-wx/src/main/java/com/ruoyi/wx/web/service/impl/WxHomeServiceImpl.java

@@ -70,6 +70,7 @@ public class WxHomeServiceImpl implements IWxHomeService {
         executorService.submit(saleInfoTask);
         executorService.submit(contentTask);
         List<RecContent> contents = contentTask.get();
+        String display = wxHomeMapper.selectLotteryDisplay("is_lottery");
         for (RecContent content : contents) {
             Object value = redisCache.getCacheMapValue(Constants.THUMBS_UP, "like" + content.getId());
             if (value != null) {
@@ -79,6 +80,7 @@ public class WxHomeServiceImpl implements IWxHomeService {
         }
         result.put("saleInfo", saleInfoTask.get());
         result.put("content", contents);
+        result.put("is_lottery", display);
         return result;
     }
 

+ 3 - 0
ruoyi-wx/src/main/resources/mapper/web/WxHomeMapper.xml

@@ -25,4 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </foreach>
         </where>
     </select>
+    <select id="selectLotteryDisplay" resultType="java.lang.String">
+        select config_value from sys_config where config_key = #{key}
+    </select>
 </mapper>