瀏覽代碼

内容库V1.0.0

kaick 1 年之前
父節點
當前提交
078d89a44a

+ 5 - 6
src/main/java/com/caimei365/commodity/service/impl/PageServiceImpl.java

@@ -1268,7 +1268,7 @@ public class PageServiceImpl implements PageService {
             imageArchive.setImageNum(imageList.size());
             if (0 == finalPermission) {
                 imageArchive.setImageList(imageList);
-            } else if (2 == productClassify && imageArchive.getImageNum() >= 5) {
+            } else if (3 == finalPermission && imageArchive.getImageNum() >= 5) {
                 imageArchive.setImageList(imageList.subList(0, 2));
             }
         }
@@ -1277,7 +1277,7 @@ public class PageServiceImpl implements PageService {
             if (0 == finalPermission && null != archiveFile) {
                 String fileUrl = generateFileUrl(archiveFile);
                 videoArchive.setFileUrl(fileUrl);
-            } else if (2 == productClassify && null != archiveFile) {
+            } else if (3 == finalPermission  && null != archiveFile) {
                 String fileUrl = generateFileUrl(archiveFile);
                 videoArchive.setFileUrl(fileUrl);
             }
@@ -1288,7 +1288,7 @@ public class PageServiceImpl implements PageService {
             if (0 == finalPermission && null != archiveFile) {
                 String fileUrl = generateFileUrl(archiveFile);
                 fileArchive.setFileUrl(fileUrl);
-            } else if (2 == productClassify && null != archiveFile) {
+            } else if (3 == finalPermission && null != archiveFile) {
                 String fileUrl = generateFileUrl(archiveFile);
                 fileArchive.setFileUrl(fileUrl);
             }
@@ -1377,10 +1377,9 @@ public class PageServiceImpl implements PageService {
         } catch (ParseException e) {
             log.info("格式化时间错误", e);
         }
-//        String url = ossClient.generatePresignedUrl(bucketName, active + "/archiveFile/" + ossName, expiration).toString();
-        String url = AesEncryptUtil.encrypt( ossClient.generatePresignedUrl(bucketName, ossName, expiration).toString());
+        String url = ossClient.generatePresignedUrl(bucketName,  ossName, expiration).toString();
         ossClient.shutdown();
-        return url;
+        return AesEncryptUtil.encrypt(url);
     }
 
     @Override

+ 7 - 13
src/main/resources/mapper/CmProductArchiveContentMapper.xml

@@ -207,26 +207,20 @@
 		SELECT cusf.id as k, cusf.keyword as v
 		FROM cm_user_search_frequency cusf
 		WHERE cusf.delStatus = 1
+		and FIND_IN_SET(cusf.id ,(SELECT GROUP_CONCAT(cpac.labelIds) from cm_product_archive_content cpac))
 		<if test="v != null  and v != ''">and cusf.keyword like concat('%', #{v}, '%')</if>
 		ORDER BY cusf.frequency DESC, cusf.searchTime DESC
 	</select>
 
 	<select id="findProductList" resultType="CmProductArchiveVO">
-		SELECT b.name as shopName,
-		a.name as productName,
+		SELECT a.shopName as shopName,
+		a.productName as productName,
 		a.`productID` as productId,
-		a.mainImage as image
-		FROM product a
-		LEFT JOIN shop b ON b.shopID = a.shopID
-		left join cm_organize_product_info copi on copi.productId = a.productID
-		WHERE copi.organizeId = 0
-		AND copi.validFlag = 2
-		AND a.productCategory = 1
-		AND a.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type = 'heheShopID')
-		AND a.productID NOT IN (6060, 6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068, 6069)
+		a.productImage as image
+		FROM cm_product_archive a
 		<if test="productId != null ">and a.productId = #{productId}</if>
-		<if test="productName != null  and productName != ''">and a.name like concat('%', #{productName}, '%')</if>
-		<if test="shopName != null  and shopName != ''">and b.name like concat('%', #{shopName}, '%')</if>
+		<if test="productName != null  and productName != ''">and a.productName like concat('%', #{productName}, '%')</if>
+		<if test="shopName != null  and shopName != ''">and a.shopName like concat('%', #{shopName}, '%')</if>
 		group by a.productID
 		order by a.productID desc
 	</select>

+ 0 - 4
src/main/resources/mapper/PageMapper.xml

@@ -650,7 +650,6 @@
         from cm_product_archive_content
         where productArchiveId = #{archiveId}
           and type = 1
-          and stageStatus=1
         order by addTime desc
     </select>
 
@@ -659,7 +658,6 @@
         from cm_product_archive_content
         where productArchiveId = #{archiveId}
           and type = 2
-          and stageStatus=1
 
         order by addTime desc
     </select>
@@ -669,8 +667,6 @@
         from cm_product_archive_content
         where productArchiveId = #{archiveId}
           and type = 3
-          and stageStatus=1
-
         order by addTime desc
     </select>