Browse Source

联合丽格V1.0.2

kaick 1 năm trước cách đây
mục cha
commit
ee3f065f85

+ 6 - 6
src/main/resources/config/dev/caimei.properties

@@ -12,14 +12,14 @@
 #mysql database setting
 #mysql database setting
 jdbc.type=mysql
 jdbc.type=mysql
 jdbc.driver=com.mysql.cj.jdbc.Driver
 jdbc.driver=com.mysql.cj.jdbc.Driver
-#jdbc.url=jdbc:mysql://120.79.25.27:3306/caimei?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
-#jdbc.username=developer
-#jdbc.password=J5p3tgOVazNl4ydf
+jdbc.url=jdbc:mysql://120.79.25.27:3306/caimei?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
+jdbc.username=developer
+jdbc.password=J5p3tgOVazNl4ydf
 
 
 
 
-jdbc.url=jdbc:mysql://192.168.2.100:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai
-jdbc.username=developer
-jdbc.password=05bZ/OxTB:X+yd%1
+#jdbc.url=jdbc:mysql://192.168.2.100:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai
+#jdbc.username=developer
+#jdbc.password=05bZ/OxTB:X+yd%1
 
 
 #jdbc.url=jdbc:mysql://119.29.0.46:3306/caimei?useUnicode=true&characterEncoding=utf-8
 #jdbc.url=jdbc:mysql://119.29.0.46:3306/caimei?useUnicode=true&characterEncoding=utf-8
 #jdbc.username=root
 #jdbc.username=root

+ 45 - 27
src/main/resources/mappings/modules/product/ProductMapper.xml

@@ -31,7 +31,7 @@
 		a.updateTime AS "updateTime",
 		a.updateTime AS "updateTime",
 		a.sellNumber AS "sellNumber",
 		a.sellNumber AS "sellNumber",
 -- 		a.weekSellNumber AS "weekSellNumber",
 -- 		a.weekSellNumber AS "weekSellNumber",
--- 		a.beforeValidFlag AS "beforeValidFlag",
+		a.beforeValidFlag AS "beforeValidFlag",
 		copi.validFlag AS "validFlag",
 		copi.validFlag AS "validFlag",
 		a.favoriteTimes AS "favoriteTimes",
 		a.favoriteTimes AS "favoriteTimes",
 		a.commentScore AS "commentScore",
 		a.commentScore AS "commentScore",
@@ -126,7 +126,7 @@
         FROM product a
         FROM product a
         <include refid="productJoins"/>
         <include refid="productJoins"/>
         WHERE a.productID = #{id}
         WHERE a.productID = #{id}
-        and a.groundMall like CONCAT('%', copi.organizeId, '%')
+        group by a.productID
     </select>
     </select>
 
 
 
 
@@ -144,7 +144,7 @@
         FROM product a
         FROM product a
         <include refid="productJoins"/>
         <include refid="productJoins"/>
         <where>
         <where>
-            a.groundMall like CONCAT('%', copi.organizeId, '%')
+
             <if test="productID !=null and productID !=''">
             <if test="productID !=null and productID !=''">
                 AND a.productID=#{productID}
                 AND a.productID=#{productID}
             </if>
             </if>
@@ -199,6 +199,7 @@
             AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
             AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
             and a.productCategory = 1
             and a.productCategory = 1
         </where>
         </where>
+        group by a.productID
         <choose>
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
                 ORDER BY ${page.orderBy}
@@ -216,7 +217,7 @@
         FROM product a
         FROM product a
         <include refid="productJoins"/>
         <include refid="productJoins"/>
         <where>
         <where>
-            a.groundMall like CONCAT('%', copi.organizeId, '%')
+
             <if test="productID !=null and productID !=''">
             <if test="productID !=null and productID !=''">
                 AND a.productID=#{productID}
                 AND a.productID=#{productID}
             </if>
             </if>
@@ -255,7 +256,7 @@
         FROM product a
         FROM product a
         <include refid="productJoins"/>
         <include refid="productJoins"/>
         <where>
         <where>
-            a.groundMall like CONCAT('%', copi.organizeId, '%')
+
             <if test="id !=null and id !=''">
             <if test="id !=null and id !=''">
                 AND a.productID=#{id}
                 AND a.productID=#{id}
             </if>
             </if>
@@ -334,7 +335,7 @@
         <include refid="productJoins"/>
         <include refid="productJoins"/>
         <where>
         <where>
             a.productCategory = 1
             a.productCategory = 1
-            and a.groundMall like CONCAT('%', copi.organizeId, '%')
+
         </where>
         </where>
         group by a.productID
         group by a.productID
         <choose>
         <choose>
@@ -366,7 +367,7 @@
         addTime,
         addTime,
         updateTime,
         updateTime,
 --         weekSellNumber,
 --         weekSellNumber,
---         beforeValidFlag,
+        beforeValidFlag,
         validFlag,
         validFlag,
         favoriteTimes,
         favoriteTimes,
         commentScore,
         commentScore,
@@ -446,7 +447,7 @@
         #{addTime},
         #{addTime},
         #{updateTime},
         #{updateTime},
 --         #{weekSellNumber},
 --         #{weekSellNumber},
---         #{beforeValidFlag},
+        #{beforeValidFlag},
         #{validFlag},
         #{validFlag},
         #{favoriteTimes},
         #{favoriteTimes},
         #{commentScore},
         #{commentScore},
@@ -528,7 +529,7 @@
             updateTime           = #{updateTime},
             updateTime           = #{updateTime},
             sellNumber           = #{sellNumber},
             sellNumber           = #{sellNumber},
 --             weekSellNumber       = #{weekSellNumber},
 --             weekSellNumber       = #{weekSellNumber},
---             beforeValidFlag      = #{beforeValidFlag},
+            beforeValidFlag      = #{beforeValidFlag},
             validFlag            = #{validFlag},
             validFlag            = #{validFlag},
             favoriteTimes        = #{favoriteTimes},
             favoriteTimes        = #{favoriteTimes},
             commentScore         = #{commentScore},
             commentScore         = #{commentScore},
@@ -571,6 +572,7 @@
                 and a.productID=#{productID}
                 and a.productID=#{productID}
             </if>
             </if>
         </where>
         </where>
+        group by a.productID
     </select>
     </select>
     <select id="newfindProductImage" resultType="com.caimei.modules.product.entity.Product">
     <select id="newfindProductImage" resultType="com.caimei.modules.product.entity.Product">
         SELECT
         SELECT
@@ -578,7 +580,7 @@
         FROM product a
         FROM product a
         <include refid="productJoins"/>
         <include refid="productJoins"/>
         <where>
         <where>
-            a.groundMall like CONCAT('%', copi.organizeId, '%')
+
             <if test="productID !=null">
             <if test="productID !=null">
                 AND a.productID=#{productID}
                 AND a.productID=#{productID}
             </if>
             </if>
@@ -603,6 +605,7 @@
             # AND p.showFlag!=2
             # AND p.showFlag!=2
 
 
         </where>
         </where>
+        group by a.productID
         # 在设置重点关注时给排序值1000为了让重点关注始终在列表前端
         # 在设置重点关注时给排序值1000为了让重点关注始终在列表前端
         order by a.sortIndex desc,a.newshowTime DESC
         order by a.sortIndex desc,a.newshowTime DESC
     </select>
     </select>
@@ -900,7 +903,7 @@
         `addTime`,
         `addTime`,
         `updateTime`,
         `updateTime`,
 --         `weekSellNumber`,
 --         `weekSellNumber`,
---         `beforeValidFlag`,
+        `beforeValidFlag`,
         `validFlag`,
         `validFlag`,
         `favoriteTimes`,
         `favoriteTimes`,
         `commentScore`,
         `commentScore`,
@@ -965,7 +968,7 @@
         #{addTime},
         #{addTime},
         #{updateTime},
         #{updateTime},
 --         #{weekSellNumber},
 --         #{weekSellNumber},
---         #{beforeValidFlag},
+        #{beforeValidFlag},
         #{validFlag},
         #{validFlag},
         #{favoriteTimes},
         #{favoriteTimes},
         #{commentScore},
         #{commentScore},
@@ -1118,7 +1121,7 @@
         left join cm_brand b on b.id = a.brandID
         left join cm_brand b on b.id = a.brandID
         WHERE
         WHERE
         csrp.tinyTypeId = #{tinyTypeID}
         csrp.tinyTypeId = #{tinyTypeID}
-        and a.groundMall like CONCAT('%', copi.organizeId, '%')
+
         <if test="name != null and name != ''">
         <if test="name != null and name != ''">
             AND a.name like concat('%', #{name} ,'%')
             AND a.name like concat('%', #{name} ,'%')
         </if>
         </if>
@@ -1134,6 +1137,7 @@
         and a.productCategory = 1
         and a.productCategory = 1
         AND copi.validFlag != 0
         AND copi.validFlag != 0
         AND csrp.delFlag =0
         AND csrp.delFlag =0
+        group by a.productID
         ORDER BY csrp.sort DESC
         ORDER BY csrp.sort DESC
     </select>
     </select>
 
 
@@ -1184,8 +1188,9 @@
 
 
     <select id="findProductIdBySku" resultType="java.lang.String">
     <select id="findProductIdBySku" resultType="java.lang.String">
         select productId
         select productId
-        from cm_sku
+        from cm_sku cs
         where skuId = #{productId}
         where skuId = #{productId}
+        and  cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=#{productId})
     </select>
     </select>
 
 
     <select id="toAddProductList" resultType="product">
     <select id="toAddProductList" resultType="product">
@@ -1200,7 +1205,7 @@
         WHERE
         WHERE
         NOT EXISTS (select * from cm_search_recommend_product csrp where csrp.productID = a.productID and
         NOT EXISTS (select * from cm_search_recommend_product csrp where csrp.productID = a.productID and
         csrp.tinyTypeID = #{tinyTypeID} AND csrp.delFlag = 0)
         csrp.tinyTypeID = #{tinyTypeID} AND csrp.delFlag = 0)
-        and copi.validFlag = '2' and p.groundMall like CONCAT('%', copi.organizeId, '%')
+        and copi.validFlag = '2'
         <if test="name != null and name != ''">
         <if test="name != null and name != ''">
             and a.name like concat('%', #{name} ,'%')
             and a.name like concat('%', #{name} ,'%')
         </if>
         </if>
@@ -1211,6 +1216,7 @@
             AND b.name like concat('%', #{brandName} ,'%')
             AND b.name like concat('%', #{brandName} ,'%')
         </if>
         </if>
         and a.productCategory = 1
         and a.productCategory = 1
+        group by a.productID
     </select>
     </select>
 
 
     <select id="findGroupActivityListPage" resultType="Product">
     <select id="findGroupActivityListPage" resultType="Product">
@@ -1220,7 +1226,7 @@
         left join cm_organize_product_info copi on copi.productId = a.productID
         left join cm_organize_product_info copi on copi.productId = a.productID
         <include refid="ActivityJoins"/>
         <include refid="ActivityJoins"/>
         <where>
         <where>
-            a.groundMall like CONCAT('%', copi.organizeId, '%')
+
             <if test="id !=null and id !=''">
             <if test="id !=null and id !=''">
                 AND a.productID=#{id}
                 AND a.productID=#{id}
             </if>
             </if>
@@ -1266,6 +1272,7 @@
             AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
             AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
             and a.productCategory = 1
             and a.productCategory = 1
         </where>
         </where>
+        group by a.productID
         <choose>
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
                 ORDER BY ${page.orderBy}
@@ -1383,6 +1390,7 @@
             </if>
             </if>
             and a.productCategory = 1
             and a.productCategory = 1
         </where>
         </where>
+        group by a.productID
         <!--		limit 0, 10-->
         <!--		limit 0, 10-->
     </select>
     </select>
 
 
@@ -1478,9 +1486,9 @@
 <!--            <if test="weekSellNumber != null and weekSellNumber !=''">-->
 <!--            <if test="weekSellNumber != null and weekSellNumber !=''">-->
 <!--                weekSellNumber = #{weekSellNumber},-->
 <!--                weekSellNumber = #{weekSellNumber},-->
 <!--            </if>-->
 <!--            </if>-->
-<!--            <if test="beforeValidFlag != null and beforeValidFlag !=''">-->
-<!--                beforeValidFlag = #{beforeValidFlag},-->
-<!--            </if>-->
+            <if test="beforeValidFlag != null and beforeValidFlag !=''">
+                beforeValidFlag = #{beforeValidFlag},
+            </if>
 <!--            <if test="validFlag != null and validFlag !=''">-->
 <!--            <if test="validFlag != null and validFlag !=''">-->
 <!--                validFlag = #{validFlag},-->
 <!--                validFlag = #{validFlag},-->
 <!--            </if>-->
 <!--            </if>-->
@@ -1767,7 +1775,7 @@
                  left join shop s on s.shopID = p.shopID
                  left join shop s on s.shopID = p.shopID
                  left join cm_organize_product_info copi on copi.productId = p.productID
                  left join cm_organize_product_info copi on copi.productId = p.productID
         where p.productID = #{productID}
         where p.productID = #{productID}
-          AND copi.validFlag = '2' and  p.groundMall like CONCAT('%', copi.organizeId, '%')
+          AND copi.validFlag = '2'
     </select>
     </select>
 
 
     <select id="querySecondHandRecommend" resultType="CmSecondHandRecommendVo">
     <select id="querySecondHandRecommend" resultType="CmSecondHandRecommendVo">
@@ -1782,7 +1790,7 @@
         left join cm_organize_product_info copi on copi.productId = p.productID
         left join cm_organize_product_info copi on copi.productId = p.productID
         left join shop s on s.shopID = p.shopID
         left join shop s on s.shopID = p.shopID
         <where>
         <where>
-            p.groundMall like CONCAT('%', copi.organizeId, '%')
+
             <if test="productID != null and productID != ''">
             <if test="productID != null and productID != ''">
                 p.productID = #{productID}
                 p.productID = #{productID}
             </if>
             </if>
@@ -1809,6 +1817,7 @@
         WHERE csl.delFlag = 0
         WHERE csl.delFlag = 0
           AND csr.delFlag = 0
           AND csr.delFlag = 0
           AND p.productID = #{productID}
           AND p.productID = #{productID}
+        group by p.productID
     </select>
     </select>
     <select id="qualification" resultType="com.caimei.modules.product.entity.Product">
     <select id="qualification" resultType="com.caimei.modules.product.entity.Product">
         SELECT qualificationNo, productName, qualificationTime, qualificationLink
         SELECT qualificationNo, productName, qualificationTime, qualificationLink
@@ -1831,7 +1840,7 @@
         FROM product a
         FROM product a
         <include refid="productJoins"/>
         <include refid="productJoins"/>
         <where>
         <where>
-            a.groundMall like CONCAT('%', copi.organizeId, '%')
+
             <if test="id !=null and id !=''">
             <if test="id !=null and id !=''">
                 AND a.productID=#{id}
                 AND a.productID=#{id}
             </if>
             </if>
@@ -1862,6 +1871,7 @@
             AND a.actStatus = 1
             AND a.actStatus = 1
             and a.productCategory = 1
             and a.productCategory = 1
         </where>
         </where>
+        group by a.productID
         <choose>
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
                 ORDER BY ${page.orderBy}
@@ -1878,7 +1888,7 @@
         left join cm_organize_product_info copi on copi.productId = p.productID
         left join cm_organize_product_info copi on copi.productId = p.productID
         left join shop s on p.shopID = s.shopID
         left join shop s on p.shopID = s.shopID
         <where>
         <where>
-            (p.actFlag=0 or p.actType is null) and copi.validFlag = 2 and p.productCategory = 1 and p.groundMall like CONCAT('%', copi.organizeId, '%')
+            (p.actFlag=0 or p.actType is null) and copi.validFlag = 2 and p.productCategory = 1
             <if test="productIds != null and productIds != '' ">
             <if test="productIds != null and productIds != '' ">
                 and p.productID != #{productIds}
                 and p.productID != #{productIds}
             </if>
             </if>
@@ -1901,7 +1911,7 @@
         FROM product a
         FROM product a
         <include refid="productJoins"/>
         <include refid="productJoins"/>
         <where>
         <where>
-            a.groundMall like CONCAT('%', copi.organizeId, '%')
+
             <if test="productID !=null">
             <if test="productID !=null">
                 AND a.productID=#{productID}
                 AND a.productID=#{productID}
             </if>
             </if>
@@ -1927,6 +1937,7 @@
                 </foreach>
                 </foreach>
             </if>
             </if>
         </where>
         </where>
+        group by a.productID
         <choose>
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
                 ORDER BY ${page.orderBy}
                 ORDER BY ${page.orderBy}
@@ -1982,6 +1993,7 @@
                  left join cm_promotion_sku cps on cs.skuId = cps.skuId
                  left join cm_promotion_sku cps on cs.skuId = cps.skuId
                  left join cm_svip_product_sku csps on cs.skuId = csps.skuId
                  left join cm_svip_product_sku csps on cs.skuId = csps.skuId
         where cs.productId = #{productID}
         where cs.productId = #{productID}
+          and  cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=#{productID})
     </select>
     </select>
     <select id="findSkuListProduct" resultType="com.caimei.modules.product.entity.CmSku">
     <select id="findSkuListProduct" resultType="com.caimei.modules.product.entity.CmSku">
         select cs.skuId,
         select cs.skuId,
@@ -2052,7 +2064,7 @@
         FROM product a
         FROM product a
         <include refid="productJoins"/>
         <include refid="productJoins"/>
         left join cm_sku cs on cs.productId=a.productID and copi.organizeId= cs.organizeId
         left join cm_sku cs on cs.productId=a.productID and copi.organizeId= cs.organizeId
-        WHERE cs.skuId = #{skuId} and a.groundMall like CONCAT('%', copi.organizeId, '%')
+        WHERE cs.skuId = #{skuId} and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </select>
     </select>
     <select id="findHeHeSku" resultType="com.caimei.modules.product.entity.CmSku">
     <select id="findHeHeSku" resultType="com.caimei.modules.product.entity.CmSku">
         select cs.skuId,
         select cs.skuId,
@@ -2067,6 +2079,7 @@
         from cm_sku cs
         from cm_sku cs
                  left join cm_hehe_sku chs on cs.skuId = chs.skuId
                  left join cm_hehe_sku chs on cs.skuId = chs.skuId
         where cs.productId = #{productID}
         where cs.productId = #{productID}
+          and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </select>
     </select>
     <select id="findSkuId" resultType="java.lang.Integer">
     <select id="findSkuId" resultType="java.lang.Integer">
         select skuId
         select skuId
@@ -2075,8 +2088,9 @@
     </select>
     </select>
     <select id="findSku" resultType="com.caimei.modules.product.entity.CmSku">
     <select id="findSku" resultType="com.caimei.modules.product.entity.CmSku">
         select price, ifnull(costPrice, 0) as costPrice, costCheckFlag, shopPercent, normalPrice
         select price, ifnull(costPrice, 0) as costPrice, costCheckFlag, shopPercent, normalPrice
-        from cm_sku
+        from cm_sku cs
         where productId = #{productId}
         where productId = #{productId}
+          and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
         order by price asc
         order by price asc
         limit 1
         limit 1
     </select>
     </select>
@@ -2084,8 +2098,9 @@
         SELECT price, ifnull(costPrice, 0),"1" AS costCheckFlag, shopPercent AS shopPercent
         SELECT price, ifnull(costPrice, 0),"1" AS costCheckFlag, shopPercent AS shopPercent
                     , normalPrice
                     , normalPrice
                     , organizeId
                     , organizeId
-        FROM cm_sku
+        FROM cm_sku cs
         WHERE productId = #{productId}
         WHERE productId = #{productId}
+          and cs.organizeId=4
         ORDER BY price ASC
         ORDER BY price ASC
         LIMIT 1
         LIMIT 1
     </select>
     </select>
@@ -2095,6 +2110,7 @@
                     , organizeId
                     , organizeId
         from cm_sku
         from cm_sku
         where skuId = #{skuId}
         where skuId = #{skuId}
+          and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </select>
     </select>
     <select id="findSkuIdByPromotionsId" resultType="java.lang.Integer">
     <select id="findSkuIdByPromotionsId" resultType="java.lang.Integer">
         select skuId
         select skuId
@@ -2113,11 +2129,13 @@
         FROM cm_promotion_sku cps
         FROM cm_promotion_sku cps
                  LEFT JOIN cm_sku cs ON cps.skuId = cs.skuId
                  LEFT JOIN cm_sku cs ON cps.skuId = cs.skuId
         WHERE promotionId = #{id}
         WHERE promotionId = #{id}
+          and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </select>
     </select>
     <select id="getSkuByPromotionId" resultType="com.caimei.modules.product.entity.CmSku">
     <select id="getSkuByPromotionId" resultType="com.caimei.modules.product.entity.CmSku">
         SELECT cs.price, cpp.productId, cs.skuId, cs.unit
         SELECT cs.price, cpp.productId, cs.skuId, cs.unit
         FROM cm_promotions_product cpp
         FROM cm_promotions_product cpp
                  LEFT JOIN cm_sku cs ON cpp.productId = cs.productId
                  LEFT JOIN cm_sku cs ON cpp.productId = cs.productId
         WHERE promotionsId = #{id}
         WHERE promotionsId = #{id}
+          and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
     </select>
     </select>
 </mapper>
 </mapper>

+ 13 - 10
src/main/resources/mappings/modules/product/ProductNewMapper.xml

@@ -32,7 +32,7 @@
         a.addTime AS "addTime",
         a.addTime AS "addTime",
         a.updateTime AS "updateTime",
         a.updateTime AS "updateTime",
         a.sellNumber AS "sellNumber",
         a.sellNumber AS "sellNumber",
---         a.beforeValidFlag AS "beforeValidFlag",
+        a.beforeValidFlag AS "beforeValidFlag",
         copi.validFlag AS "validFlag",
         copi.validFlag AS "validFlag",
         a.favoriteTimes AS "favoriteTimes",
         a.favoriteTimes AS "favoriteTimes",
         a.commentScore AS "commentScore",
         a.commentScore AS "commentScore",
@@ -124,7 +124,8 @@
         <include refid="productColumns"/>
         <include refid="productColumns"/>
         FROM product a
         FROM product a
         <include refid="productJoins"/>
         <include refid="productJoins"/>
-        WHERE a.productID = #{id} and  copi.organizeId=(SELECT SUBSTRING_INDEX(groundMall, ',', 1)FROM product WHERE productID=#{id})
+        WHERE a.productID = #{id} and  copi.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=#{id})
+        group by a.productID
     </select>
     </select>
 
 
     <select id="getProductParams" resultType="com.caimei.modules.product.entity.ProductParameters">
     <select id="getProductParams" resultType="com.caimei.modules.product.entity.ProductParameters">
@@ -141,7 +142,8 @@
         FROM product a
         FROM product a
         <include refid="productJoins"/>
         <include refid="productJoins"/>
         <where>
         <where>
-            a.groundMall like CONCAT('%', copi.organizeId, '%')
+
+              copi.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=a.productID)
             <if test="id !=null and id !=''">
             <if test="id !=null and id !=''">
                 AND a.productID=#{id}
                 AND a.productID=#{id}
             </if>
             </if>
@@ -285,7 +287,7 @@
         FROM product a
         FROM product a
         <include refid="productJoins"/>
         <include refid="productJoins"/>
         <where>
         <where>
-            a.productCategory = 1 and a.groundMall like CONCAT('%', copi.organizeId, '%')
+            a.productCategory = 1
             <if test="productCategory != null and productCategory != ''">
             <if test="productCategory != null and productCategory != ''">
                 AND a.productCategory = #{productCategory}
                 AND a.productCategory = #{productCategory}
             </if>
             </if>
@@ -340,7 +342,7 @@
                             updateTime,
                             updateTime,
                             sellNumber,
                             sellNumber,
 --                             weekSellNumber,
 --                             weekSellNumber,
---                             beforeValidFlag,
+                            beforeValidFlag,
                             validFlag,
                             validFlag,
                             favoriteTimes,
                             favoriteTimes,
                             commentScore,
                             commentScore,
@@ -386,7 +388,7 @@
                 #{updateTime},
                 #{updateTime},
                 #{sellNumber},
                 #{sellNumber},
 --                 #{weekSellNumber},
 --                 #{weekSellNumber},
---                 #{beforeValidFlag},
+                #{beforeValidFlag},
                 #{validFlag},
                 #{validFlag},
                 #{favoriteTimes},
                 #{favoriteTimes},
                 #{commentScore},
                 #{commentScore},
@@ -435,7 +437,7 @@
             updateTime           = #{updateTime},
             updateTime           = #{updateTime},
             sellNumber           = #{sellNumber},
             sellNumber           = #{sellNumber},
 --             weekSellNumber       = #{weekSellNumber},
 --             weekSellNumber       = #{weekSellNumber},
---             beforeValidFlag      = #{beforeValidFlag},
+            beforeValidFlag      = #{beforeValidFlag},
             validFlag            = #{validFlag},
             validFlag            = #{validFlag},
             favoriteTimes        = #{favoriteTimes},
             favoriteTimes        = #{favoriteTimes},
             commentScore         = #{commentScore},
             commentScore         = #{commentScore},
@@ -566,9 +568,9 @@
 <!--            <if test="weekSellNumber != null and weekSellNumber !=''">-->
 <!--            <if test="weekSellNumber != null and weekSellNumber !=''">-->
 <!--                weekSellNumber = #{weekSellNumber},-->
 <!--                weekSellNumber = #{weekSellNumber},-->
 <!--            </if>-->
 <!--            </if>-->
-<!--            <if test="beforeValidFlag != null and beforeValidFlag !=''">-->
-<!--                beforeValidFlag = #{beforeValidFlag},-->
-<!--            </if>-->
+            <if test="beforeValidFlag != null and beforeValidFlag !=''">
+                beforeValidFlag = #{beforeValidFlag},
+            </if>
 
 
             <if test="favoriteTimes != null and favoriteTimes !=''">
             <if test="favoriteTimes != null and favoriteTimes !=''">
                 favoriteTimes = #{favoriteTimes},
                 favoriteTimes = #{favoriteTimes},
@@ -823,6 +825,7 @@
         from cm_shop_splitcode css
         from cm_shop_splitcode css
                  left join product p on p.shopID = css.shopId
                  left join product p on p.shopID = css.shopId
         where p.productID = #{id}
         where p.productID = #{id}
+        group by p.productID
     </select>
     </select>
 
 
     <select id="validIList" resultType="com.caimei.modules.product.entity.Product">
     <select id="validIList" resultType="com.caimei.modules.product.entity.Product">

+ 11 - 11
src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp

@@ -293,9 +293,9 @@
     <c:if test="${not empty product.id}">
     <c:if test="${not empty product.id}">
         <li class="active"><a href="${ctx}/product/new/productEdit?id=${product.id}">商品信息编辑</a></li>
         <li class="active"><a href="${ctx}/product/new/productEdit?id=${product.id}">商品信息编辑</a></li>
     </c:if>
     </c:if>
-    <c:if test="${empty product.id}">
-        <li class="active"><a href="${ctx}/product/new/productEdit?id=${product.id}">发布特殊供应商商品</a></li>
-    </c:if>
+<%--    <c:if test="${empty product.id}">--%>
+<%--        <li class="active"><a href="${ctx}/product/new/productEdit?id=${product.id}">发布特殊供应商商品</a></li>--%>
+<%--    </c:if>--%>
 </ul>
 </ul>
 <form:form id="inputForm" modelAttribute="product"
 <form:form id="inputForm" modelAttribute="product"
            action="${ctx}/product/new/productSave?searchShopID=${product.searchShopID}&searchShopName=${product.searchShopName}&searchBigTypeID=${product.searchBigTypeID}&searchSmallTypeID=${product.searchSmallTypeID}&searchTinyTypeID=${product.searchTinyTypeID}&searchValidFlag=${product.searchValidFlag}&searchActStatus=${product.searchActStatus}&searchProductType=${product.searchProductType}&searchBrandID=${product.searchBrandID}&searchPreferredFlag=${product.searchPreferredFlag}&searchProductCategory=${product.searchProductCategory}&editFlag=${product.editFlag}&shopType=${product.shopType}&ladderPriceFlag=${product.ladderPriceFlag}"
            action="${ctx}/product/new/productSave?searchShopID=${product.searchShopID}&searchShopName=${product.searchShopName}&searchBigTypeID=${product.searchBigTypeID}&searchSmallTypeID=${product.searchSmallTypeID}&searchTinyTypeID=${product.searchTinyTypeID}&searchValidFlag=${product.searchValidFlag}&searchActStatus=${product.searchActStatus}&searchProductType=${product.searchProductType}&searchBrandID=${product.searchBrandID}&searchPreferredFlag=${product.searchPreferredFlag}&searchProductCategory=${product.searchProductCategory}&editFlag=${product.editFlag}&shopType=${product.shopType}&ladderPriceFlag=${product.ladderPriceFlag}"
@@ -809,8 +809,8 @@
         <tr>
         <tr>
             <th><span class="red">*</span>资质机构商品详情:</th>
             <th><span class="red">*</span>资质机构商品详情:</th>
             <td><span style="color: red">(适用于资质机构)</span></td>
             <td><span style="color: red">(适用于资质机构)</span></td>
-            <th><span class="red">*</span>普通机构商品详情:</th>
-            <td><span style="color: red">(适用于游客和个人机构,可选择是否和资质机构商品详情相同,不相同的话需要编辑内容)</span>
+            <th  style="position: relative ;right: 200px"><span class="red">*</span>普通机构商品详情:</th>
+            <td style="position: relative ;right: 200px"><span style="color: red">(适用于游客和个人机构,可选择是否和资质机构商品详情相同,不相同的话需要编辑内容)</span>
                 <label>
                 <label>
                     <input type="radio"
                     <input type="radio"
                            name="productDetail"
                            name="productDetail"
@@ -833,7 +833,7 @@
                 </div>
                 </div>
             </td>
             </td>
             <td colspan="3" style="vertical-align: top;">
             <td colspan="3" style="vertical-align: top;">
-                <div class="detailInfoEditor" style="width: 620px;">
+                <div class="detailInfoEditor" style="width: 620px;position: relative ;right: 200px">
                     <form:textarea path="commonDetailInfo" htmlEscape="false" class="input-xlarge required hide"/>
                     <form:textarea path="commonDetailInfo" htmlEscape="false" class="input-xlarge required hide"/>
                     <!-- 富文本编辑器 -->
                     <!-- 富文本编辑器 -->
                     <div id="detailInfoEditor2">${product.commonDetailInfo==""||product.commonDetailInfo==null?"若要查看更多产品信息,请注册机构会员,如有疑问请联系客服。":product.commonDetailInfo}</div>
                     <div id="detailInfoEditor2">${product.commonDetailInfo==""||product.commonDetailInfo==null?"若要查看更多产品信息,请注册机构会员,如有疑问请联系客服。":product.commonDetailInfo}</div>
@@ -868,7 +868,7 @@
         </div>
         </div>
         <div class="sku-item sku-stock">
         <div class="sku-item sku-stock">
             <span>库存:</span>
             <span>库存:</span>
-            <input name="stock" style="width: 50px" type="number" maxlength="11" class="short"/>
+            <input name="stock" style="width: 50px" type="number" maxlength="11" class="short required"/>
         </div>
         </div>
         <div class="sku-item sku-costCheckFlag">
         <div class="sku-item sku-costCheckFlag">
             <span class="red">*</span>成本:
             <span class="red">*</span>成本:
@@ -902,7 +902,7 @@
         </div>
         </div>
         <div class="sku-item sku-minBuyNumber">
         <div class="sku-item sku-minBuyNumber">
             <span class="red">*</span>起订量:
             <span class="red">*</span>起订量:
-            <input style="width: 40px" type="number" name="minBuyNumber" maxlength="11" class="short"/>
+            <input style="width: 40px" type="number" name="minBuyNumber" maxlength="11" class="short  required"/>
         </div>
         </div>
         <div><span><button class="deleteSku" onclick="deleteDiv(this)">删除SKU</button></span></div>
         <div><span><button class="deleteSku" onclick="deleteDiv(this)">删除SKU</button></span></div>
         <div class="ladderPriceBox" style="display: none;">
         <div class="ladderPriceBox" style="display: none;">
@@ -2166,9 +2166,9 @@
             ladderPriceBox.show();
             ladderPriceBox.show();
             minBuyNumber.parent('.sku-minBuyNumber').hide();
             minBuyNumber.parent('.sku-minBuyNumber').hide();
         }
         }
-        if (organize != 0) {
-            ladderPriceFlag.parent().parent().hide();
-        }
+        // if (organize != 0) {
+        //     ladderPriceFlag.parent().parent().hide();
+        // }
         costCheckFlag.parent().parent().hide();
         costCheckFlag.parent().parent().hide();
 
 
         ladderPriceBox.find('.ladderPrice').each(function (index, item) {
         ladderPriceBox.find('.ladderPrice').each(function (index, item) {

+ 72 - 32
src/main/webapp/WEB-INF/views/modules/product-new/productList.jsp

@@ -1,6 +1,7 @@
 <%@ page import="com.thinkgem.jeesite.common.config.Global" %>
 <%@ page import="com.thinkgem.jeesite.common.config.Global" %>
 <%@ page contentType="text/html;charset=UTF-8" %>
 <%@ page contentType="text/html;charset=UTF-8" %>
 <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
 <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
 <html>
 <html>
 <head>
 <head>
     <title>商品列表</title>
     <title>商品列表</title>
@@ -315,6 +316,10 @@
             background-color: #eee;
             background-color: #eee;
             margin-right: 15px;
             margin-right: 15px;
         }
         }
+
+        .font font {
+            white-space: nowrap;
+        }
     </style>
     </style>
 </head>
 </head>
 <body>
 <body>
@@ -465,12 +470,12 @@
                               value="0">已删除</label>
                               value="0">已删除</label>
                 <label><input type="checkbox" name="searchValidFlag" id="validCheck" onchange="checkValid()">所有</label>
                 <label><input type="checkbox" name="searchValidFlag" id="validCheck" onchange="checkValid()">所有</label>
             </div>
             </div>
-<%--            <div class="item">--%>
-<%--                <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" style="margin-left:20px;"/>--%>
+            <div class="item">
+                <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" style="margin-left:20px;"/>
 <%--                &nbsp;&nbsp;&nbsp;&nbsp;<input class="btn btn-primary"--%>
 <%--                &nbsp;&nbsp;&nbsp;&nbsp;<input class="btn btn-primary"--%>
 <%--                                               onclick="window.location='${ctx}/product/new/productEdit?shopType=2'"--%>
 <%--                                               onclick="window.location='${ctx}/product/new/productEdit?shopType=2'"--%>
 <%--                                               value="发布特殊供应商商品"/>--%>
 <%--                                               value="发布特殊供应商商品"/>--%>
-<%--            </div>--%>
+            </div>
                 <%--<div class="item">
                 <%--<div class="item">
                     <input type="button" class="btn btn-primary" value="更新所有商品索引" onclick="updateAllIndex()"  style="margin-left:20px;"/>
                     <input type="button" class="btn btn-primary" value="更新所有商品索引" onclick="updateAllIndex()"  style="margin-left:20px;"/>
                 </div>--%>
                 </div>--%>
@@ -595,30 +600,53 @@
             <td>
             <td>
                     ${product.splitCode}
                     ${product.splitCode}
             </td>
             </td>
-            <td>
-                    <%--				${fns:getDictLabel(product.validFlag,"product_status","" )}--%>
+            <td class="font">
+                <c:forEach items="${product.cmOrganizeProductInfos}" var="cmOrganizeProductInfo">
                     <%--商品状态(0逻辑删除 1待审核 2已上架 3已下架 8审核未通过 9已隐身 10已冻结)--%>
                     <%--商品状态(0逻辑删除 1待审核 2已上架 3已下架 8审核未通过 9已隐身 10已冻结)--%>
-                <c:if test="${product.validFlag eq 0}">
-                    <font color="#a9a9a9">已删除</font>
-                </c:if>
-                <c:if test="${product.validFlag eq 1}">
-                    <font color="red">待审核</font>
-                </c:if>
-                <c:if test="${product.validFlag eq 2}">
-                    <font color="green">已上架</font>
-                </c:if>
-                <c:if test="${product.validFlag eq 3}">
-                    <font color="darkorange">已下架</font>
-                </c:if>
-                <c:if test="${product.validFlag eq 8}">
-                    <font color="red">审核未通过</font>
-                </c:if>
-                <c:if test="${product.validFlag eq 9}">
-                    <font color="darkorange">已隐身</font>
-                </c:if>
-                <c:if test="${product.validFlag eq 10}">
-                    <font color="darkorange">已冻结</font>
-                </c:if>
+                    <c:if test="${cmOrganizeProductInfo.validFlag eq 0}">
+                        <font color="#a9a9a9">
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 0}">【采美】</c:if>
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 4}">【丽格集采联盟】</c:if>
+                            已删除
+                        </font>
+                    </c:if>
+                    <c:if test="${cmOrganizeProductInfo.validFlag eq 1}">
+                        <font color="red">
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 0}">【采美】</c:if>
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 4}">【丽格集采联盟】</c:if>
+                            待审核</font>
+                    </c:if>
+                    <c:if test="${cmOrganizeProductInfo.validFlag eq 2}">
+                        <font color="green">
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 0}">【采美】</c:if>
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 4}">【丽格集采联盟】</c:if>
+                            已上架</font>
+                    </c:if>
+                    <c:if test="${cmOrganizeProductInfo.validFlag eq 3}">
+                        <font color="darkorange">
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 0}">【采美】</c:if>
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 4}">【丽格集采联盟】</c:if>
+                            已下架</font>
+                    </c:if>
+                    <c:if test="${cmOrganizeProductInfo.validFlag eq 8}">
+                        <font color="red">
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 0}">【采美】</c:if>
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 4}">【丽格集采联盟】</c:if>
+                            审核未通过</font>
+                    </c:if>
+                    <c:if test="${cmOrganizeProductInfo.validFlag eq 9}">
+                        <font color="darkorange">
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 0}">【采美】</c:if>
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 4}">【丽格集采联盟】</c:if>
+                            已隐身</font>
+                    </c:if>
+                    <c:if test="${cmOrganizeProductInfo.validFlag eq 10}">
+                        <font color="darkorange">
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 0}">【采美】</c:if>
+                            <c:if test="${cmOrganizeProductInfo.organizeId eq 4}">【丽格集采联盟】</c:if>
+                            已冻结</font>
+                    </c:if>
+                </c:forEach>
             </td>
             </td>
             <td>
             <td>
 
 
@@ -654,9 +682,9 @@
                     未关联
                     未关联
                 </c:if>
                 </c:if>
             </td>
             </td>
-            <td>
+            <td class="font">
                 <c:forEach items="${product.organizeNames}" var="organize">
                 <c:forEach items="${product.organizeNames}" var="organize">
-                    <p>${organize}</p>
+                    <font>${organize}</font>
                 </c:forEach>
                 </c:forEach>
             </td>
             </td>
             <td>
             <td>
@@ -711,10 +739,22 @@
                                 <%--                            <a href="javascript:;"--%>
                                 <%--                            <a href="javascript:;"--%>
                                 <%--                               onclick="jumpHref('${ctx}/product/hehe/edit?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}')">参与呵呵商城</a>--%>
                                 <%--                               onclick="jumpHref('${ctx}/product/hehe/edit?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}')">参与呵呵商城</a>--%>
                             <br>
                             <br>
-                            <c:if test="${product.validFlag eq 1 or product.validFlag eq 8}">
-                                <a class="red" href="javascript:void(0);"
-                                   onclick="auditThis(${product.id},'${product.brand.name}','${product.brand.status}','${product.costCheckFlag}','${product.costPrice}','${product.sqlShopPercent}','${product.newvalidFlag}','${product.showTime}','${product.addTime}','${product.newProductType}')">上架审核</a>
-                            </c:if>
+                                    <c:if test="${product.validFlag eq 1 or product.validFlag eq 8 or product.organizeNameValidFlag !=null}">
+
+                                        <a class="red" href="javascript:void(0);"
+                                           onclick="auditThis(${product.id},'${product.brand.name}','${product.brand.status}','${product.costCheckFlag}','${product.costPrice}','${product.sqlShopPercent}','${product.newvalidFlag}','${product.showTime}','${product.addTime}','${product.newProductType}')">
+                                            <c:if test="${ product.organizeNameValidFlag==1}">
+                                                <c:forEach items="${product.cmOrganizeProductInfos}"
+                                                           var="cmOrganizeProductInfo">
+                                                    <c:if test="${cmOrganizeProductInfo.validFlag eq 1||cmOrganizeProductInfo.validFlag eq 8}">
+                                                        <c:if test="${cmOrganizeProductInfo.organizeId eq 0}">【采美】</c:if>
+                                                        <c:if test="${cmOrganizeProductInfo.organizeId eq 4}">【丽格集采联盟】</c:if>
+                                                    </c:if>
+                                                </c:forEach>
+                                            </c:if>
+                                            上架审核
+                                        </a>
+                                    </c:if>
                             <c:if test="${product.newProductType eq 1 &&  product.newvalidFlag != 1 && product.validFlag == 2}"><a
                             <c:if test="${product.newProductType eq 1 &&  product.newvalidFlag != 1 && product.validFlag == 2}"><a
                                     href="javascript:void(0);"
                                     href="javascript:void(0);"
                                     onclick="auditThis(${product.id},'${product.brand.name}','${product.brand.status}','${product.costCheckFlag}','${product.costPrice}','${product.sqlShopPercent}','${product.newvalidFlag}','${product.showTime}','${product.addTime}','${product.newProductType}','${product.validFlag}')">新品展示审核</a></c:if>
                                     onclick="auditThis(${product.id},'${product.brand.name}','${product.brand.status}','${product.costCheckFlag}','${product.costPrice}','${product.sqlShopPercent}','${product.newvalidFlag}','${product.showTime}','${product.addTime}','${product.newProductType}','${product.validFlag}')">新品展示审核</a></c:if>