Przeglądaj źródła

Merge remote-tracking branch 'origin/developer' into developerD

# Conflicts:
#	src/main/java/com/caimei365/user/controller/CmBrandLandingApi.java
#	src/main/resources/mapper/CmBrandBannerMapper.xml
#	src/main/resources/mapper/CmBrandFilesMapper.xml
#	src/main/resources/mapper/CmBrandLandingMapper.xml
huangzhiguo 2 lat temu
rodzic
commit
fef3b324b9

+ 19 - 6
src/main/java/com/caimei365/user/controller/CmBrandLandingApi.java

@@ -21,6 +21,7 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
+import org.apache.commons.lang.StringUtils;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
@@ -46,22 +47,34 @@ public class CmBrandLandingApi {
     /**
      * 查询供应商落地页资料
      *
+     * @return source 1PC端,2小程序
      * @return Map(userPo, clubPo)
      * @return banner > banner管理
      * @return landing.type 1成功案例,2视频列表,3文章列表
      */
     @ApiOperation("查询供应商落地页资料")
     @GetMapping("/info")
-    public ResponseJson<Map<String, Object>> getShopUserInfo() {
+    public ResponseJson<Map<String, Object>> getShopUserInfo(Integer source) {
+        if(source==null){
+            return ResponseJson.error("source异常", null);
+        }
+        CmBrandBanner cmBrandBanner = new CmBrandBanner().setType("2");
+        CmBrandLanding landing = new CmBrandLanding().setType("1,2,3");
+        if(source==1){
+            cmBrandBanner.setPcStatus("1");
+            landing.setPcStatus("1");
+        }
+        if(source==2){
+            cmBrandBanner.setAppStatus("1");
+            landing.setAppStatus("1");
+        }
         HashMap<String, Object> map = new HashMap(2);
-        List<CmBrandBanner> cmBrandBanners = cmBrandBannerService.selectCmBrandBannerList(new CmBrandBanner()
-                .setType("2")
-                .setDelFlag("0"));
-        List<CmBrandLanding> cmBrandLandings = cmBrandLandingService.selectCmBrandLandingList(new CmBrandLanding()
-                .setDelFlag("0"));
+        List<CmBrandBanner> cmBrandBanners = cmBrandBannerService.selectCmBrandBannerList(cmBrandBanner);
+        List<CmBrandLanding> cmBrandLandings = cmBrandLandingService.selectCmBrandLandingList(landing);
         cmBrandLandings.forEach(cmBrandLanding -> {
             CmBrandFiles cmBrandFiles = new CmBrandFiles();
             cmBrandFiles.setId(cmBrandLanding.getVideo());
+            cmBrandFiles.setType("1");
             cmBrandLanding.setCmBrandFiles(cmBrandLanding.getVideo() == null ? null :
                     cmBrandFilesService.selectCmBrandFilesList(cmBrandFiles));
         });

+ 0 - 4
src/main/java/com/caimei365/user/mapper/ClubMapper.java

@@ -262,10 +262,6 @@ public interface ClubMapper {
      */
     Integer getUserCouponCount(Integer userId);
 
-    List<AdvertiseVo> getUserAdvertiseList(AdvertiseVo advertiseVo);
-
-    List<InformationVo> getInformationList(InformationVo informationVo);
-
     void insertQuestionMan(VisitorRemarkVo visitor);
 
     List<VisitorRemarkVo> getVisitorList(Integer serviceProviderId);

+ 0 - 2
src/main/java/com/caimei365/user/mapper/MessageCenterMapper.java

@@ -79,8 +79,6 @@ public interface MessageCenterMapper {
 
     Integer userId(String openid);
 
-    Integer userIds(Integer shopID);
-
     String shopName(Integer shopID);
 
     Integer deleteMessage(String id);

+ 0 - 61
src/main/java/com/caimei365/user/service/impl/ClubServiceImpl.java

@@ -1649,67 +1649,6 @@ public class ClubServiceImpl implements ClubService {
         // 6.优惠券可用数量
         Integer couponNum = clubMapper.getUserCouponCount(userId);
         result.put("couponNum", couponNum);
-        // 7.今日推荐
-        int floorId = 6;
-        int index = 1;
-        String homeAdvertiseKey = "user_advertise_" + floorId;
-        if (!redisService.exists(homeAdvertiseKey)) {
-            AdvertiseVo homePageAdvertise = new AdvertiseVo();
-            homePageAdvertise.setAdvertiseTypeId(1001);
-            homePageAdvertise.setTypeId(floorId);
-            homePageAdvertise.setValidFlag("1");
-            List<AdvertiseVo> list = clubMapper.getUserAdvertiseList(homePageAdvertise);
-            for (AdvertiseVo advertise : list) {
-                advertise.setImage(ImageUtils.getImageURL("homePageImages", advertise.getImage(), 0, wwwDomain));
-            }
-            redisService.setList(homeAdvertiseKey, list);
-        }
-        int pageSize = 4;
-        int totalRecord = (int) redisService.listSize(homeAdvertiseKey);
-        int total = totalRecord % pageSize == 0 ? totalRecord / pageSize : totalRecord / pageSize + 1;
-        if (index > total) {
-            index = index % total;
-        }
-        int begin = (index - 1) * pageSize;
-        int end = index * pageSize - 1;
-        //避免unchecked cast warning
-        List<AdvertiseVo> list = new ArrayList<>();
-        Object advertiseObj = redisService.getList(homeAdvertiseKey, begin, end);
-        if (advertiseObj instanceof ArrayList<?>) {
-            for (Object o : (List<?>) advertiseObj) {
-                list.add((AdvertiseVo) o);
-            }
-        }
-        result.put("homePageAdvertiseList", list);
-        // 8.最新动态
-        String informationKey = "home_info_" + floorId;
-        redisService.remove(informationKey);
-        if (!redisService.exists(informationKey)) {
-            InformationVo info = new InformationVo();
-            info.setInfoTypeId(1);
-            info.setValidFlag("1");
-            List<InformationVo> infoList = clubMapper.getInformationList(info);
-            infoList.forEach(information -> information.setLink("/info/detail-" + information.getInformationId() + "-1.html"));
-            redisService.setList(informationKey, infoList);
-        }
-        int infoIndex = 1;
-        int infoPageSize = 5;
-        int totalInfoRecord = (int) redisService.listSize(informationKey);
-        int totalInfo = totalInfoRecord % infoPageSize == 0 ? totalInfoRecord / infoPageSize : totalInfoRecord / infoPageSize + 1;
-        if (infoIndex > totalInfo) {
-            infoIndex = infoIndex % totalInfo;
-        }
-        int infoBegin = (infoIndex - 1) * infoPageSize;
-        int infoEnd = infoIndex * infoPageSize - 1;
-        List<InformationVo> infoList = new ArrayList<>();
-        Object infoObj = redisService.getList(informationKey, infoBegin, infoEnd);
-        if (infoObj instanceof ArrayList<?>) {
-            for (Object o : (List<?>) infoObj) {
-                infoList.add((InformationVo) o);
-            }
-        }
-        result.put("homePageInfoList", infoList);
-
         return ResponseJson.success(result);
     }
 

+ 0 - 29
src/main/resources/mapper/ClubMapper.xml

@@ -512,35 +512,6 @@
                     , DATE_ADD(a.createDate
                              , INTERVAL cc.usePeriod DAY)))
     </select>
-    <select id="getUserAdvertiseList" resultType="com.caimei365.user.model.vo.AdvertiseVo">
-        SELECT image, link, title
-        FROM c_homepageadvertise
-        <where>
-            <if test="advertiseTypeId != null">
-                AND advertiseTypeID = #{advertiseTypeId}
-            </if>
-            <if test="typeId != null">
-                AND typeID = #{typeId}
-            </if>
-            <if test="validFlag != null">
-                AND validFlag = #{validFlag}
-            </if>
-        </where>
-        ORDER BY sortIndex DESC
-    </select>
-    <select id="getInformationList" resultType="com.caimei365.user.model.vo.InformationVo">
-        SELECT informationID AS informationId, title, link, addTime
-        FROM information
-        <where>
-            <if test="infoTypeId != null">
-                AND infoTypeID = #{infoTypeId}
-            </if>
-            <if test="validFlag != null">
-                AND validFlag = #{validFlag}
-            </if>
-        </where>
-        ORDER BY informationID DESC
-    </select>
     <select id="getVisitorList" resultType="com.caimei365.user.model.vo.VisitorRemarkVo">
         SELECT questionManId, serviceProviderId, addTime as addDate, questionMan, consultType as consult
         FROM cm_visitor_remarks

+ 2 - 1
src/main/resources/mapper/ClubReport.xml

@@ -17,10 +17,11 @@
         SELECT DISTINCT p.productID as productId,p.mainImage as image,p.name,
         (select price from cm_sku where productId=p.productId order by price asc limit 1)as price,s.name as shopName
         FROM product p
+        left join cm_organize_product_info copi on copi.productId = p.productID and copi.organizeId = 0
         LEFT JOIN shop s ON s.shopID = p.shopID
         LEFT JOIN cm_club_report cmc ON cmc.productID = p.productID
         <where>
-            (p.validFlag=9 or p.validFlag=2)
+            (copi.validFlag=9 or copi.validFlag=2)
             <if test="keyWord != null and keyWord !=''">
                 and p.name LIKE concat('%',#{keyWord},'%')
             </if>

+ 9 - 4
src/main/resources/mapper/CmBrandBannerMapper.xml

@@ -31,9 +31,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCmBrandBannerList" parameterType="com.caimei365.user.model.po.CmBrandBanner" resultMap="CmBrandBannerResult">
         <include refid="selectCmBrandBannerVo"/>
-        <where>
+        <where>delFlag=0
             <if test="authUserId != null "> and authUserId = #{authUserId}</if>
-            <if test="type != null "> and type = #{type}</if>
+            <if test="type != null and type != ''">
+                and type in
+                <foreach item="typeIn" collection="type.split(',')" open="(" separator="," close=")">
+                    #{typeIn}
+                </foreach>
+            </if>
             <if test="headPcBanner != null  and headPcBanner != ''"> and headPcBanner = #{headPcBanner}</if>
             <if test="headAppBanner != null  and headAppBanner != ''"> and headAppBanner = #{headAppBanner}</if>
             <if test="jumpStatus != null "> and jumpStatus = #{jumpStatus}</if>
@@ -54,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCmBrandBannerById" parameterType="String" resultMap="CmBrandBannerResult">
         <include refid="selectCmBrandBannerVo"/>
-        where id = #{id}
+        where id = #{id} and delFlag=0
     </select>
 
     <insert id="insertCmBrandBanner" parameterType="com.caimei365.user.model.po.CmBrandBanner" useGeneratedKeys="true" keyProperty="id">
@@ -133,4 +138,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
-</mapper>
+</mapper>

+ 8 - 3
src/main/resources/mapper/CmBrandFilesMapper.xml

@@ -24,9 +24,14 @@
 
     <select id="selectCmBrandFilesList" parameterType="com.caimei365.user.model.po.CmBrandFiles" resultMap="CmBrandFilesResult">
         <include refid="selectCmBrandFilesVo"/>
-        <where>
+        <where>delFlag=0
             <if test="id != null "> and id = #{id}</if>
-            <if test="type != null "> and type = #{type}</if>
+            <if test="type != null and type != ''">
+                and type in
+                <foreach item="typeIn" collection="type.split(',')" open="(" separator="," close=")">
+                    #{typeIn}
+                </foreach>
+            </if>
             <if test="superId != null  and superId != ''"> and superId = #{superId}</if>
             <if test="fileName != null  and fileName != ''"> and fileName like concat('%', #{fileName}, '%')</if>
             <if test="ossName != null  and ossName != ''"> and ossName like concat('%', #{ossName}, '%')</if>
@@ -99,4 +104,4 @@
             #{id}
         </foreach>
     </delete>
-</mapper>
+</mapper>

+ 12 - 7
src/main/resources/mapper/CmBrandLandingMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.caimei365.user.mapper.CmBrandLandingMapper">
-    
+
     <resultMap type="com.caimei365.user.model.po.CmBrandLanding" id="CmBrandLandingResult">
         <result property="id"    column="id"    />
         <result property="authUserId"    column="authUserId"    />
@@ -31,9 +31,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCmBrandLandingList" parameterType="com.caimei365.user.model.po.CmBrandLanding" resultMap="CmBrandLandingResult">
         <include refid="selectCmBrandLandingVo"/>
-        <where>  
+        <where>  delFlag=0
             <if test="authUserId != null "> and authUserId = #{authUserId}</if>
-            <if test="type != null "> and type = #{type}</if>
+            <if test="type != null and type != ''">
+                and type in
+                <foreach item="typeIn" collection="type.split(',')" open="(" separator="," close=")">
+                    #{typeIn}
+                </foreach>
+            </if>
             <if test="headPcBanner != null  and headPcBanner != ''"> and headPcBanner = #{headPcBanner}</if>
             <if test="headAppBanner != null  and headAppBanner != ''"> and headAppBanner = #{headAppBanner}</if>
             <if test="jumpStatus != null "> and jumpStatus = #{jumpStatus}</if>
@@ -51,12 +56,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="addTime != null "> and addTime = #{addTime}</if>
         </where>
     </select>
-    
+
     <select id="selectCmBrandLandingById" parameterType="String" resultMap="CmBrandLandingResult">
         <include refid="selectCmBrandLandingVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertCmBrandLanding" parameterType="com.caimei365.user.model.po.CmBrandLanding" useGeneratedKeys="true" keyProperty="id">
         insert into cm_brand_landing
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -128,9 +133,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteCmBrandLandingByIds" parameterType="String">
-        delete from cm_brand_landing where id in 
+        delete from cm_brand_landing where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-</mapper>
+</mapper>

+ 0 - 14
src/main/resources/mapper/MessageCenter.xml

@@ -30,7 +30,6 @@
     </resultMap>
 
 
-
     <insert id="addMessageCenter">
         INSERT INTO message_center (shopID, clubID, userType, messageType, content,time,accountType,couponType,couponFee,couponMessageType,ShopMessType)
         VALUES (#{shopId}, #{clubId}, #{userType}, #{messageType}, #{content},#{time},#{accountType},#{couponType},#{couponFee},#{couponMessageType},#{shopMessType})
@@ -44,10 +43,6 @@
         SELECT shopID FROM `shop` WHERE userId=#{userId}
     </select>
 
-<!--    <select id="shopID" resultType="java.lang.Integer">-->
-<!--        SELECT shopID FROM `shop` WHERE userId=#{userId}-->
-<!--    </select>-->
-
     <select id="clubList" resultType="com.caimei365.user.model.vo.UserVo">
         SELECT * FROM `user` WHERE userId=#{userId}
     </select>
@@ -256,15 +251,6 @@
             a.newReceiptType=1
     </select>
 
-    <select id="userIds" resultType="java.lang.Integer">
-        SELECT DISTINCT
-            a.userID
-        FROM shop a
-        WHERE
-            a.shopOD=#{shopID}
-    </select>
-
-
     <select id="shopName" resultType="java.lang.String">
         SELECT name FROM `shop` WHERE shopID=#{shopID}
     </select>

+ 5 - 2
src/main/resources/mapper/ShopMapper.xml

@@ -168,15 +168,18 @@
             2 as productType,
             (select price from cm_sku where productId=p.productId order by price asc limit 1)as originalPrice,
             (select unit from cm_sku where productId=p.productId order by price asc limit 1)as unit,
-            p.validFlag as validFlag,
+            copi.validFlag as validFlag,
             (select stock from cm_sku where productId=p.productId order by price asc limit 1)as stock
         from product p
+            left join cm_organize_product_info copi on copi.productId = p.productID and copi.organizeId = 0
         left join cm_promotions_gift cpg on cpg.productId = p.productID
         where cpg.promotionsId = #{promotionsId}
         order by cpg.addTime desc
     </select>
     <select id="getShopProductCount" resultType="java.lang.Integer">
-        SELECT COUNT(*) FROM product
+        SELECT COUNT(*)
+        FROM product p
+        left join cm_organize_product_info copi on p.productID = copi.productId
         WHERE shopID = #{shopId}
         <if test="validFlag != null">
             AND validFlag = #{validFlag}