Browse Source

提交公告管理

Duan_xu 3 years ago
parent
commit
68065a80db

+ 2 - 2
src/main/java/com/caimei365/commodity/components/SearchOpenService.java

@@ -224,7 +224,7 @@ public class SearchOpenService {
         config.setStart(num - 1);
         config.setHits(size);
         // 设置搜索结果返回应用中哪些字段
-        config.setFetchFields(Lists.newArrayList("id", "p_id", "p_name", "p_image", "p_brand_name", "p_unit", "p_code", "p_price_flag", "p_price_grade", "p_supplier_id", "p_keyword", "p_act_flag", "p_brand_id"));
+        config.setFetchFields(Lists.newArrayList("id", "p_id", "p_name", "p_image", "p_brand_name", "p_unit", "p_code", "p_price_flag", "p_price_grade", "p_supplier_id", "p_keyword", "p_act_flag", "p_brand_id","p_product_type"));
         // 注意:config子句中的rerank_size参数,在Rank类对象中设置
         // 设置返回格式为json格式
         config.setSearchFormat(SearchFormat.JSON);
@@ -336,7 +336,7 @@ public class SearchOpenService {
         // config.setStart(0) scroll该参数不起作用,默认为0
         config.setHits(size);
         // 设置搜索结果返回应用中哪些字段
-        config.setFetchFields(Lists.newArrayList("id", "p_id", "p_name", "p_image", "p_brand_name", "p_unit", "p_code", "p_price_flag", "p_price_grade", "p_supplier_id", "p_keyword", "p_act_flag", "p_brand_id"));
+        config.setFetchFields(Lists.newArrayList("id", "p_id", "p_name", "p_image", "p_brand_name", "p_unit", "p_code", "p_price_flag", "p_price_grade", "p_supplier_id", "p_keyword", "p_act_flag", "p_brand_id","p_product_type"));
         // 设置返回格式为json格式
         config.setSearchFormat(SearchFormat.JSON);
         // 创建参数对象

+ 4 - 0
src/main/java/com/caimei365/commodity/model/search/ProductListVo.java

@@ -76,6 +76,10 @@ public class ProductListVo implements Serializable {
      * 活动状态:1有效,0失效
      */
     private Integer actStatus;
+    /**
+     * 商品类型:1妆字号,2械字号
+     */
+    private Integer productType;
 
     private static final long serialVersionUID = 1L;
 

+ 2 - 0
src/main/java/com/caimei365/commodity/model/vo/CombinationVo.java

@@ -46,4 +46,6 @@ public class CombinationVo implements Serializable {
 	 * 组合里面选中的商品总金额
 	 */
 	private BigDecimal productTotalAmount;
+
+	private Integer productType;
 }

+ 1 - 0
src/main/java/com/caimei365/commodity/model/vo/ProductItemVo.java

@@ -79,6 +79,7 @@ public class ProductItemVo implements Serializable {
      * 成本价选中标志:1固定成本 2比例成
      */
     private Integer costCheckFlag;
+
     /**
      * 固定成本价
      */

+ 23 - 1
src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java

@@ -37,7 +37,8 @@ import java.util.stream.Collectors;
 public class PageServiceImpl implements PageService {
     @Value("${caimei.wwwDomain}")
     private String domain;
-
+    @Resource
+    private AnnouncementMapper announcementMapper;
     @Resource
     private UserLikeMapper likeMapper;
     @Resource
@@ -245,6 +246,8 @@ public class PageServiceImpl implements PageService {
         } else {
             map.put("couponEntry", 2);
         }
+       List<AnnouncementPo>annlist= announcementMapper.gteannhade();
+        map.put("annlist",annlist);
         return ResponseJson.success(map);
     }
 
@@ -832,6 +835,25 @@ public class PageServiceImpl implements PageService {
         return ResponseJson.success(list);
     }
 
+    @Override
+    public ResponseJson<PaginationVo<AnnouncementPo>> getannlist(int pageNum, int pageSize) {
+        PageHelper.startPage(pageNum, pageSize);
+        List<AnnouncementPo>list= announcementMapper.getannlist();
+        PaginationVo<AnnouncementPo> pageData = new PaginationVo(list);
+        return ResponseJson.success(pageData);
+    }
+
+    /**
+     * 公告展示-公告详细内容
+     *
+     * @param id 公告列表Id
+     */
+    @Override
+    public ResponseJson<AnnouncementPo> getcapacity(Integer id) {
+        AnnouncementPo announcementPo= announcementMapper.getcapacity(id);
+        return ResponseJson.success(announcementPo);
+    }
+
     /**
      * 商品维修(链接分享数据)
      *

+ 5 - 3
src/main/resources/mapper/CouponMapper.xml

@@ -49,7 +49,8 @@
         SELECT id AS "couponId",
                NAME,
                pcBanner,
-               appletsBanner
+               appletsBanner,
+               productType
         FROM cm_coupon
         WHERE productType = 2
           AND delFlag = 0
@@ -90,7 +91,8 @@
         p.commodityType,
         p.bigTypeID AS bigTypeId,
         p.smallTypeID AS smallTypeId,
-        p.tinyTypeID AS tinyTypeId
+        p.tinyTypeID AS tinyTypeId,
+        p.productType
         FROM
         cm_coupon_product a
         LEFT JOIN product p ON a.productId = p.productID
@@ -313,4 +315,4 @@
     <select id="findUserPermission" resultType="java.lang.Integer">
         select userIdentity from user where userID = #{userId}
     </select>
-</mapper>
+</mapper>

+ 14 - 9
src/main/resources/mapper/PageMapper.xml

@@ -59,7 +59,7 @@
     <select id="getFloorContentById" resultType="com.caimei365.commodity.model.vo.FloorContentVo">
         select
          id, floorId, centreId, templateType, pcAdsImage1, pcAdsImage2, pcAdsImage3,
-         appletsAdsImage1, appletsAdsImage2, appletsAdsImage3, adsLink1, adsLink2, adsLink3,productType
+         appletsAdsImage1, appletsAdsImage2, appletsAdsImage3, adsLink1, adsLink2, adsLink3
          from new_page_floor_content where floorId = #{id}
     </select>
     <select id="getFloorImageById" resultType="com.caimei365.commodity.model.vo.FloorImageVo">
@@ -144,20 +144,21 @@
             p.smallTypeID as smallTypeId,
             p.tinyTypeID as tinyTypeId,
             p.visibility as visibility,
-            cshd.detailTalkFlag as detailTalkFlag
+            cshd.detailTalkFlag as detailTalkFlag,
+            p.productType
         from product p
         left join cm_second_hand_detail cshd on p.productID = cshd.productID
         where p.productID = #{productId} and p.validFlag = 2
     </select>
     <select id="getSupplierFloorImage" resultType="com.caimei365.commodity.model.vo.ShopFloorVo">
-        select id, crmImage, wwwImage, wwwLink,productType
+        select id, crmImage, wwwImage, wwwLink
         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,productType
+            createBy, createDate, updateBy, updateDate, delFlag
         from
           new_page_quality_supplier
         where
@@ -177,7 +178,7 @@
             productCategory, serviceNumber, taxPoint, supplierTaxPoint, priceFlag, actFlag, ladderPriceFlag,
             addTime, hasSkuFlag, sellNumber, sortIndex, featuredFlag, costCheckFlag, recommendType, machineType,
             productCode, updateTime, validFlag, searchKey, allAreaFlag, step, costPrice, provinceIds, qualificationImg,
-            trainingMethod, trainingType ,trainingFee, productRemarks,productDetail as productDetailChose
+            trainingMethod, trainingType ,trainingFee, productRemarks,productDetail as productDetailChose,productType
         from product
         where productID = #{productId}
     </select>
@@ -211,7 +212,8 @@
             p.bigTypeID as bigTypeId,
             p.smallTypeID as smallTypeId,
             p.tinyTypeID as tinyTypeId,
-            rpp.currentPrice as discountPrice
+            rpp.currentPrice as discountPrice,
+            p.productType
         from
           repeat_purchase_price rpp
           left join product p on rpp.productId = p.productID
@@ -245,7 +247,8 @@
             p.actStatus,
 			p.`name` as `name`,
 			p.mainImage as image,
-            IFNULL(p.visibility,3) as visibility
+            IFNULL(p.visibility,3) as visibility,
+               p.productType
         from product as p
         left join cm_product_recommend as pr on pr.recommendProductID = p.productID
         where
@@ -258,7 +261,8 @@
             p.actStatus,
 			p.`name` as `name`,
 			p.mainImage as image,
-            IFNULL(p.visibility,3) as visibility
+            IFNULL(p.visibility,3) as visibility,
+               p.productType
         from product as p
         where p.validFlag  = 2
         and p.commodityType = (select commodityType from product as p1 where p1.productID = #{productId})
@@ -277,7 +281,8 @@
                headText,
                redPacketBeginTime,
                redPacketEndTime,
-               infoBarStatus
+               infoBarStatus,
+                productType
         from cm_page
         where id = #{pageId}
           and enabledStatus = '1'

+ 9 - 5
src/main/resources/mapper/PriceMapper.xml

@@ -25,7 +25,8 @@
             if(csp.id is not null,1,0) as svipProductFlag,
             csp.priceType as svipPriceType,
             csp.discount as svipDiscount,
-            csp.discountPrice as svipDiscountPrice
+            csp.discountPrice as svipDiscountPrice,
+            p.productType
         from product p
         left join cm_svip_product csp on p.productID = csp.productId
         where p.productID = #{productId}
@@ -51,7 +52,8 @@
             if(csp.id is not null,1,0) as svipProductFlag,
             csp.priceType as svipPriceType,
             csp.discount as svipDiscount,
-            csp.discountPrice as svipDiscountPrice
+            csp.discountPrice as svipDiscountPrice,
+            p.productType
         from product p
         left join cm_svip_product csp on p.productID = csp.productId
         where p.productID in
@@ -84,7 +86,7 @@
     </select>
     <select id="getRepurchasePrice" resultType="java.lang.Double">
         select
-          r.currentPrice
+          r.currentPrice,p.productType
         from repeat_purchase_price r
         left join product p on p.productID = r.productId
         where r.productId = #{productId} and userId = #{userId}
@@ -96,7 +98,8 @@
         select
         p.includedTax as includedTax,
         p.invoiceType as invoiceType,
-        p.taxPoint as taxPoint
+        p.taxPoint as taxPoint,
+        p.productType
         from product p
         where productID = #{productId}
     </select>
@@ -120,7 +123,8 @@
                s.productId AS id,
                s.shop AS shopName,
                s.productCount AS productCount,
-               s.property AS property
+               s.property AS property,
+               p.productType
         FROM product p
         LEFT JOIN cm_product_sales s ON p.productID = s.productId
         where p.productId=#{productId}

+ 5 - 3
src/main/resources/mapper/PromotionsMapper.xml

@@ -34,7 +34,7 @@
         from cm_promotions pr
                  left join cm_promotions_product prp on pr.id = prp.promotionsId
         where (prp.productId = #{productId} or
-               prp.supplierId = (select p.shopID from product p where p.productID = #{productId})
+               prp.supplierId = (select p.shopID,p.productType from product p where p.productID = #{productId})
             )
         and (pr.status = 1 or (pr.status = 2 and (NOW() between pr.beginTime and pr.endTime)))
         and pr.delFlag not in (1, 2)
@@ -81,7 +81,8 @@
                p.price    as originalPrice,
                p.unit      as unit,
                p.validFlag as validFlag,
-               p.stock     as stock
+               p.stock     as stock,
+               p.productType
         from product p
                  left join cm_promotions_gift cpg on cpg.productId = p.productID
         where cpg.promotionsId = #{promotionsId}
@@ -126,7 +127,8 @@
         p.price,
         p.unit as unit,
         p.priceFlag,
-        IFNULL(p.visibility,3) as visibility
+        IFNULL(p.visibility,3) as visibility,
+        p.productType
         from product p
         left join cm_promotions_product cpp on cpp.productId = p.productID
         where cpp.promotionsId = #{promotionsId}

+ 1 - 0
src/main/resources/mapper/SearchMapper.xml

@@ -292,6 +292,7 @@
         p.priceFlag,
         p.price,
         p.shopID as shopId,
+        p.productType,
         p.searchKey as keyword
         from product p
         left join cm_brand as br on p.brandID = br.id

+ 9 - 11
src/main/resources/mapper/SellerMapper.xml

@@ -28,14 +28,15 @@
                p.commodityType,
                p.bigTypeID       as bigTypeId,
                p.smallTypeID     as smallTypeId,
-               p.tinyTypeID      as tinyTypeId
+               p.tinyTypeID      as tinyTypeId,
+               p.productType
         from product p
         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
+        select c.id, c.name, c.addTime, c.updateTime,p.productType
         from cm_product_combination c
         left join product p on p.combinationID = c.id
         where c.delFlag = 0 and p.validFlag = 2
@@ -52,21 +53,17 @@
             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.priceFlag as priceFlag,
+            p.price 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,
@@ -84,13 +81,13 @@
     </select>
 
     <select id="findCombination" resultType="java.lang.Integer">
-        select c.id
+        select c.id,p.productType
         from cm_product_combination c
                  left join product p on p.combinationID = c.id
         where p.productID = #{productId}
     </select>
     <select id="findProductList" resultType="java.lang.Integer">
-        select productID
+        select productID,productType
         from product
         where combinationID = #{combinationId}
     </select>
@@ -122,7 +119,8 @@
         p.commodityType,
         p.bigTypeID as bigTypeId,
         p.smallTypeID as smallTypeId,
-        p.tinyTypeID as tinyTypeId
+        p.tinyTypeID as tinyTypeId,
+        p.productType
         from product p
         where
         p.productID in

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

@@ -324,11 +324,10 @@
 			p.shopID as shopId,
 			p.`name` as `name`,
 			p.mainImage as image,
-			p.price1 as price,
+			p.price as price,
 			p.unit as unit,
-			p.price1TextFlag as priceFlag,
+			p.priceFlag as priceFlag,
             IFNULL(p.visibility,3) as visibility,
-		    p.price8Text as beautyActFlag,
             p.productType
 		from product p
         where p.shopID = #{shopId}

+ 3 - 2
src/main/resources/mapper/UserLikeMapper.xml

@@ -59,7 +59,8 @@
                p.bigTypeID       AS bigTypeId,
                p.smallTypeID     AS smallTypeId,
                p.tinyTypeID      AS tinyTypeId,
-               p.visibility      AS visibility
+               p.visibility      AS visibility,
+               p.productType
         FROM product p
                  LEFT JOIN cm_product_userlike cpu ON p.productID = cpu.productID
         WHERE p.validFlag = '2'
@@ -67,4 +68,4 @@
           AND cpu.userID = #{userId}
         ORDER BY cpu.likeTime DESC
     </select>
-</mapper>
+</mapper>