Explorar el Código

Merge remote-tracking branch 'origin/developerE' into developerF

# Conflicts:
#	src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java
#	src/main/resources/mapper/PageMapper.xml
#	src/main/resources/mapper/SellerMapper.xml
#	src/main/resources/mapper/ShopMapper.xml
chao hace 3 años
padre
commit
38d492ea03

+ 20 - 0
src/main/java/com/caimei365/commodity/controller/ProductPageApi.java

@@ -2,6 +2,7 @@ package com.caimei365.commodity.controller;
 
 import com.caimei365.commodity.annotation.Statistics;
 import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.po.AnnouncementPo;
 import com.caimei365.commodity.model.po.ProductParameterPo;
 import com.caimei365.commodity.model.search.ProductListVo;
 import com.caimei365.commodity.model.vo.*;
@@ -94,6 +95,25 @@ public class ProductPageApi {
     public ResponseJson<Map<String, Object>> getHomeInit(Integer source) {
         return pageService.getHomeInit(source);
     }
+    @ApiOperation("公告展示列表")
+    @ApiImplicitParam(required = false, name = "source", value = "来源:1网站,2小程序")
+    @GetMapping("/home/title")
+    ResponseJson<PaginationVo<AnnouncementPo>> getannlist(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
+                                                          @RequestParam(value = "pageSize", defaultValue = "20") int pageSize) {
+        return pageService.getannlist(pageNum, pageSize);
+    }
+
+    @ApiOperation("公告展示内容页面")
+    @GetMapping("/home/capacity")
+    public ResponseJson<AnnouncementPo> getcapacity(Integer id) {
+        if (id == null || id==0) {
+            return ResponseJson.error("参数异常", null);
+        }
+        return pageService.getcapacity(id);
+    }
+
+
+
 
     /**
      * 首页侧边栏数据(小程序)

+ 32 - 0
src/main/java/com/caimei365/commodity/mapper/AnnouncementMapper.java

@@ -0,0 +1,32 @@
+package com.caimei365.commodity.mapper;
+
+
+import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.po.AnnouncementPo;
+import org.apache.ibatis.annotations.Mapper;
+
+
+import java.util.List;
+
+@Mapper
+public interface AnnouncementMapper {
+
+    /**
+     * 查找公告列表头两个
+     * @return
+     */
+   List<AnnouncementPo> gteannhade();
+
+    /**
+     * 查找公告列表
+     * @return
+     */
+    List<AnnouncementPo> getannlist();
+
+    /**
+     * 根据id查找公告内容
+     * @return
+     */
+   AnnouncementPo getcapacity(Integer id);
+
+}

+ 29 - 0
src/main/java/com/caimei365/commodity/model/po/AnnouncementPo.java

@@ -0,0 +1,29 @@
+package com.caimei365.commodity.model.po;
+
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class AnnouncementPo {
+
+    private int id;
+    //标题
+    private String title;
+    //内容
+    private String capacity;
+    //状态1为上线2为下线
+    private String state;
+    //创建时间
+    @JsonFormat(pattern = "yyyy年MM月dd日")
+    private Date creationtime;
+    //上线时间
+    @JsonFormat(pattern = "yyyy年MM月dd日")
+    private Date livetime;
+    //下线时间
+    @JsonFormat(pattern = "yyyy年MM月dd日")
+    private Date  offlinetime;
+
+}

+ 11 - 0
src/main/java/com/caimei365/commodity/service/PageService.java

@@ -1,6 +1,7 @@
 package com.caimei365.commodity.service;
 
 import com.caimei365.commodity.model.ResponseJson;
+import com.caimei365.commodity.model.po.AnnouncementPo;
 import com.caimei365.commodity.model.po.ProductParameterPo;
 import com.caimei365.commodity.model.search.ProductListVo;
 import com.caimei365.commodity.model.vo.*;
@@ -138,6 +139,16 @@ public interface PageService {
      * @param userId        用户Id
      */
     ResponseJson<List<ProductListVo>> getProductDetailRecommends(Integer productId, Integer recommendType, Integer userId);
+    //公告展示
+    ResponseJson<PaginationVo<AnnouncementPo>> getannlist(int pageNum, int pageSize);
+
+    /**
+     * 公告展示-公告详细内容
+     *
+     * @param  id 公告列表Id
+     */
+    ResponseJson<AnnouncementPo> getcapacity(Integer id);
+
 
     /**
      * 商品维修(链接分享数据)

+ 27 - 0
src/main/resources/mapper/AnnouncementMapper.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.caimei365.commodity.mapper.AnnouncementMapper">
+
+
+    <select id="gteannhade" resultType="com.caimei365.commodity.model.po.AnnouncementPo">
+        SELECT id,title
+        FROM `announcement_management`
+        WHERE state=1
+        ORDER BY Creationtime DESC
+        LIMIT 10
+    </select>
+
+<select id="getannlist" resultType="com.caimei365.commodity.model.po.AnnouncementPo">
+    SELECT id,title,Creationtime
+    FROM `announcement_management`
+    WHERE state=1
+    ORDER BY Creationtime DESC
+</select>
+
+    <select id="getcapacity" resultType="com.caimei365.commodity.model.po.AnnouncementPo">
+        SELECT title,capacity,Creationtime
+        FROM `announcement_management`
+        WHERE id = #{id} AND state=1
+    </select>
+
+</mapper>

+ 6 - 6
src/main/resources/mapper/PageMapper.xml

@@ -45,7 +45,7 @@
 		order by -sort desc,createDate desc
     </select>
     <select id="getFloorByPageId" resultType="com.caimei365.commodity.model.vo.PageFloorVo">
-        select id, pageId as type, title ,description as detail
+        select id, title ,description as detail
         from cm_page_centre
         where pageId = #{pageId}
         <if test="source == 1">
@@ -58,8 +58,8 @@
     </select>
     <select id="getFloorContentById" resultType="com.caimei365.commodity.model.vo.FloorContentVo">
         select
-         id, floorId, centreId, templateType, pcAdsImage1, pcAdsImage2, pcAdsImage3,pcAdsImage4,pcAdsImage5,
-         appletsAdsImage1, appletsAdsImage2, appletsAdsImage3, appletsAdsImage4, appletsAdsImage5, adsLink1, adsLink2, adsLink3
+         id, floorId, centreId, templateType, pcAdsImage1, pcAdsImage2, pcAdsImage3,
+         appletsAdsImage1, appletsAdsImage2, appletsAdsImage3, adsLink1, adsLink2, adsLink3,productType
          from new_page_floor_content where floorId = #{id}
     </select>
     <select id="getFloorImageById" resultType="com.caimei365.commodity.model.vo.FloorImageVo">
@@ -103,7 +103,7 @@
     </select>
     <select id="getFloorImageByCentreId" resultType="com.caimei365.commodity.model.vo.FloorImageVo">
         select
-            id, floorId, centreId, productId, name, link, image, appletsImage,adsImage, label,content, pcStatus, appletsStatus, sort,displaySort, createDate
+            id, floorId, centreId, productId, name, link, image, appletsImage, label, pcStatus, appletsStatus, sort, createDate
         from new_page_floor_image
         where centreId = #{id}
         <if test="source == 1">
@@ -150,14 +150,14 @@
         where p.productID = #{productId} and p.validFlag = 2
     </select>
     <select id="getSupplierFloorImage" resultType="com.caimei365.commodity.model.vo.ShopFloorVo">
-        select id, crmImage, wwwImage, wwwLink
+        select id, crmImage, wwwImage, wwwLink,productType
         from new_page_quality_supplier_image
         limit 1
     </select>
     <select id="getSupplierImage" resultType="com.caimei365.commodity.model.vo.ShopImageVo">
         select
             id, supplierName, image, link, sort, wwwEnabledStatus, crmEnabledStatus,
-            createBy, createDate, updateBy, updateDate, delFlag
+            createBy, createDate, updateBy, updateDate, delFlag,productType
         from
           new_page_quality_supplier
         where

+ 33 - 29
src/main/resources/mapper/SellerMapper.xml

@@ -30,8 +30,9 @@
                p.smallTypeID     as smallTypeId,
                p.tinyTypeID      as tinyTypeId
         from product p
-        where (name LIKE CONCAT('%', #{searchWord}, '%') or productCode LIKE CONCAT('%', #{searchWord}, '%'))
-          and validFlag in (2, 3, 9)
+        where
+        (name LIKE CONCAT('%',#{searchWord},'%') or productCode LIKE CONCAT('%',#{searchWord},'%'))
+        and validFlag in (2,3,9)
     </select>
     <select id="getCombinationList" resultType="com.caimei365.commodity.model.vo.CombinationVo">
         select c.id, c.name, c.addTime, c.updateTime
@@ -46,33 +47,36 @@
         order by c.addTime desc
     </select>
     <select id="getCombinationProductList" resultType="com.caimei365.commodity.model.vo.ProductItemVo">
-        select p.productID       as productId,
-               p.actStatus,
-               p.name,
-               p.aliasName,
-               p.mainImage       as image,
-               p.unit,
-               p.productCode     as code,
-               p.priceFlag,
-               p.price,
-               p.shopID          as shopId,
-               p.searchKey       as keyword,
-               p.minBuyNumber    as minBuyNumber,
-               p.maxBuyNumber    as maxBuyNumber,
-               p.ladderPriceFlag,
-               p.normalPrice,
-               p.step,
-               p.shopID          as shopId,
-               p.taxPoint        as taxRate,
-               p.includedTax,
-               p.invoiceType,
-               p.productCategory as productCategory,
-               p.validFlag,
-               p.featuredFlag,
-               p.commodityType,
-               p.bigTypeID       as bigTypeId,
-               p.smallTypeID     as smallTypeId,
-               p.tinyTypeID      as tinyTypeId
+        select
+            p.productID as productId,
+            p.actStatus,
+            p.name,
+            p.aliasName,
+            p.mainImage as image,
+            p.unit,
+            p.productCode as code,
+            p.price1TextFlag as priceFlag,
+            p.price1 as price,
+            p.shopID as shopId,
+            p.searchKey as keyword,
+            p.price8Text as beautyActFlag,
+            p.minBuyNumber as minBuyNumber,
+            p.maxBuyNumber as maxBuyNumber,
+            p.ladderPriceFlag,
+            p.normalPrice,
+            p.step,
+            p.shopID as shopId,
+            p.taxPoint as taxRate,
+            p.includedTax,
+            p.invoiceType,
+            p.productCategory as productCategory,
+            p.validFlag,
+            p.featuredFlag,
+            p.commodityType,
+            p.bigTypeID as bigTypeId,
+            p.smallTypeID as smallTypeId,
+            p.tinyTypeID as tinyTypeId,
+            p.productType
         from product p
         where p.validFlag = 2
           and p.combinationID = #{id}

+ 10 - 35
src/main/resources/mapper/ShopMapper.xml

@@ -4,7 +4,7 @@
     <insert id="insertProduct" keyColumn="productID" keyProperty="productId"  parameterType="com.caimei365.commodity.model.po.ProductPo" useGeneratedKeys="true">
         insert into product (
             shopID, name, aliasName, commodityType, bigTypeID, smallTypeID, tinyTypeID, mainImage,
-            brandID, productType, tags, unit, normalPrice, price, includedTax, minBuyNumber, stock,
+            brandID, productType, tags, unit, normalPrice, price, price1, includedTax, minBuyNumber, stock,
             <if test="productCategory != null and  productCategory != ''">
                 productCategory,
             </if>
@@ -36,7 +36,7 @@
                 recommendType,
             </if>
             <if test="priceFlag != null and  priceFlag != ''">
-                priceFlag,
+                price1TextFlag,
             </if>
             <if test="actFlag != null and  actFlag != ''">
                 actFlag,
@@ -74,19 +74,10 @@
             <if test="invoiceType != null and  invoiceType != ''">
                 invoiceType,
             </if>
-            <if test="trainingMethod != null">
-                trainingMethod,
-            </if>
-            <if test="trainingType != null">
-                trainingType,
-            </if>
-            <if test="trainingFee != null">
-                trainingFee,
-            </if>
             updateTime, validFlag
         ) values (
             #{shopId}, #{name}, #{aliasName}, #{commodityType}, #{bigTypeId}, #{smallTypeId}, #{tinyTypeId}, #{mainImage},
-            #{brandId}, #{productType}, #{tags}, #{unit}, #{normalPrice}, #{price}, #{includedTax}, #{minBuyNumber}, #{stock},
+            #{brandId}, #{productType}, #{tags}, #{unit}, #{normalPrice}, #{price}, #{price}, #{includedTax}, #{minBuyNumber}, #{stock},
             <if test="productCategory != null and  productCategory != ''">
                 #{productCategory},
             </if>
@@ -155,15 +146,6 @@
             </if>
             <if test="invoiceType != null and  invoiceType != ''">
                 #{invoiceType},
-            </if>
-            <if test="trainingMethod != null">
-                #{trainingMethod},
-            </if>
-            <if test="trainingType != null">
-                #{trainingType},
-            </if>
-            <if test="trainingFee != null">
-                #{trainingFee},
             </if>
              #{updateTime}, #{validFlag}
         )
@@ -173,7 +155,7 @@
             shopID = #{shopId}, name = #{name}, aliasName = #{aliasName}, commodityType = #{commodityType},
             bigTypeId = #{bigTypeId}, smallTypeId = #{smallTypeId}, tinyTypeId = #{tinyTypeId}, mainImage = #{mainImage},
             brandId = #{brandId}, productType = #{productType}, tags = #{tags}, unit = #{unit}, normalPrice = #{normalPrice},
-            price = #{price}, includedTax = #{includedTax}, minBuyNumber = #{minBuyNumber}, stock = #{stock},
+            price = #{price}, price1 = #{price}, includedTax = #{includedTax}, minBuyNumber = #{minBuyNumber}, stock = #{stock},
             <if test="productCategory != null and  productCategory != ''">
                 productCategory = #{productCategory},
             </if>
@@ -205,7 +187,7 @@
                 recommendType = #{recommendType},
             </if>
             <if test="priceFlag != null and  priceFlag != ''">
-                priceFlag = #{priceFlag},
+                price1TextFlag = #{priceFlag},
             </if>
             <if test="actFlag != null and  actFlag != ''">
                 actFlag = #{actFlag},
@@ -243,15 +225,6 @@
             <if test="invoiceType != null and  invoiceType != ''">
                 invoiceType = #{invoiceType},
             </if>
-            <if test="trainingMethod != null">
-                trainingMethod = #{trainingMethod},
-            </if>
-            <if test="trainingType != null">
-                trainingType = #{trainingType},
-            </if>
-            <if test="trainingFee != null">
-                trainingFee = #{trainingFee},
-            </if>
             updateTime = #{updateTime}, validFlag = #{validFlag}
         where productID = #{productId}
     </update>
@@ -351,10 +324,12 @@
 			p.shopID as shopId,
 			p.`name` as `name`,
 			p.mainImage as image,
-			p.price,
+			p.price1 as price,
 			p.unit as unit,
-			p.priceFlag,
-            IFNULL(p.visibility,3) as visibility
+			p.price1TextFlag as priceFlag,
+            IFNULL(p.visibility,3) as visibility,
+		    p.price8Text as beautyActFlag,
+            p.productType
 		from product p
         where p.shopID = #{shopId}
         and p.visibility in