Explorar o código

调整获取店铺在售产品的逻辑,如果是pcb只获取601状态的数据。否则获取601,602,613状态。

yuj %!s(int64=7) %!d(string=hai) anos
pai
achega
e1dfc33a89

+ 14 - 3
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

@@ -194,6 +194,13 @@ public class GoodsServiceImpl implements GoodsService {
      */
     private final BoundedExecutor executor;
 
+    private static List<String> pcbStore = new ArrayList<String>();
+
+    static {
+        pcbStore.add("shengfang");
+        pcbStore.add("9612c0a894894c1aabbfe9192749bbfa");
+    }
+
     @Autowired
     private PCBDao pcbDao;
 
@@ -2221,7 +2228,12 @@ public class GoodsServiceImpl implements GoodsService {
             return null;
         }
         // pageInfo.expression(PredicateUtils.or(new SimpleExpression[]{PredicateUtils.eq("status", 601, true), PredicateUtils.eq("status", 602, true)}));
-        pageInfo.expression(PredicateUtils.in("status", new Integer[]{601, 602, 613}, true));
+        if (pcbStore.contains(storeid)) {
+            pageInfo.expression(PredicateUtils.eq("status", 601, true));
+        } else {
+            pageInfo.expression(PredicateUtils.in("status", new Integer[]{601, 602, 613}, true));
+        }
+
         pageInfo.sorting(Sort.Direction.DESC, "updateDate");
         pageInfo.expression(PredicateUtils.eq("storeid", storeid, false));
         if (StringUtils.hasText(kindUuid)) {
@@ -4200,8 +4212,6 @@ public class GoodsServiceImpl implements GoodsService {
     @Override
     public void exportKindProductsCount(Date startTime, Date endTime, HttpServletResponse response) throws Exception {
         logger.info("批量导出类目", System.currentTimeMillis() + "开始时间");
-        jdbcTemplate.execute("drop temporary table temp_kind");
-
         StringBuffer where = new StringBuffer(" from products where pr_kind is not null");
         if (null != startTime) {
             where.append(" and pr_create_time >= '").append(new java.sql.Date(startTime.getTime())).append("' ");
@@ -4248,6 +4258,7 @@ public class GoodsServiceImpl implements GoodsService {
                 }
             }
         });
+        jdbcTemplate.execute("drop temporary table temp_kind");
 
         logger.info("批量导出类目", System.currentTimeMillis() + "结束时间");
     }