Browse Source

Merge remote-tracking branch 'origin/release-201834-wangcz' into release-201834-wangcz

yuj 7 years ago
parent
commit
92b73a0361

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/constant/UploadConstant.java

@@ -134,7 +134,7 @@ public final class UploadConstant {
     /**
      * 铜厚(pcb)
      */
-    public static final int THICK_COPPER = 29;
+    public static final int THICK_COPPER = 19;
 
     /**
      * 厚度(pcb)

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

@@ -99,7 +99,6 @@ import com.uas.platform.b2c.trade.presale.model.GoodsBrowsingHistory;
 import com.uas.platform.b2c.trade.presale.model.TradeDeliveryDelayTime;
 import com.uas.platform.b2c.trade.presale.service.BrowsingHistoryService;
 import com.uas.platform.b2c.trade.presale.service.CartService;
-import com.uas.platform.b2c.trade.seek.utils.DateUtils;
 import com.uas.platform.b2c.trade.support.CodeType;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.b2c.trade.util.BoundedExecutor;
@@ -4067,13 +4066,20 @@ public class GoodsServiceImpl implements GoodsService {
     public com.uas.sso.support.Page<BrandCount> getBrandProductsCount(Pageable pageable, Date startTime, Date endTime) {
         java.sql.Date startDate = assignStartDate(startTime);
         java.sql.Date endDate = assignEndDate(endTime);
-        StringBuffer sql = new StringBuffer("select pr_brand as brand, count(1) as count from products where pr_brand is not null and pr_create_time between ? and ? group by pr_brand");
+        StringBuffer sql = new StringBuffer("select pr_brand as brand, count(1) as count from products where pr_brand is not null ");
+        if (null != startDate) {
+            sql.append(" and pr_create_time >= '").append(startDate).append("' ");
+        }
+        if (null != endDate) {
+            sql.append(" and pr_create_time < '").append(endDate).append("' ");
+        }
+        sql.append("group by pr_brand");
         StringBuffer countSql = new StringBuffer("select count(1) from (").append(sql).append(") as a");
-        Integer count = commonDao.queryForObject(countSql.toString(), Integer.class, startDate, endDate);
+        Integer count = commonDao.queryForObject(countSql.toString(), Integer.class);
         // 分页参数
         Integer offset = (pageable.getPageNumber() - 1) * pageable.getPageSize();
         sql.append(" limit ? offset ?");
-        List<BrandCount> brandCountList = commonDao.query(sql.toString(), BrandCount.class, startDate, endDate, pageable.getPageSize(), offset);
+        List<BrandCount> brandCountList = commonDao.query(sql.toString(), BrandCount.class, pageable.getPageSize(), offset);
         return new com.uas.sso.support.Page<>(pageable.getPageNumber(), pageable.getPageSize(), brandCountList, count);
     }
 
@@ -4086,7 +4092,7 @@ public class GoodsServiceImpl implements GoodsService {
     private java.sql.Date assignStartDate(Date startTime) {
         java.sql.Date startDate;
         if (null == startTime) {
-            startDate = new java.sql.Date(DateUtils.addTime(new Date(), -30, 0, 0, 0).getTime());
+            startDate = null;
         } else {
             startDate = new java.sql.Date(startTime.getTime());
         }
@@ -4105,12 +4111,12 @@ public class GoodsServiceImpl implements GoodsService {
         java.sql.Date endDate;
         // 截止时间+1天
         if (null == endTime) {
-            endDate = new java.sql.Date(System.currentTimeMillis());
+            endDate = null;
         } else {
             endDate = new java.sql.Date(endTime.getTime());
+            Integer addend = 60 * 60 * 24 * 1000;
+            endDate = new java.sql.Date(endDate.getTime() + addend);
         }
-        Integer addend = 60 * 60 * 24 * 1000;
-        endDate = new java.sql.Date(endDate.getTime() + addend);
         return endDate;
     }
 
@@ -4126,13 +4132,20 @@ public class GoodsServiceImpl implements GoodsService {
     public com.uas.sso.support.Page<KindHierarchicalCount> getKindProductsCount(Pageable pageable, Date startTime, Date endTime) {
         java.sql.Date startDate = assignStartDate(startTime);
         java.sql.Date endDate = assignEndDate(endTime);
-        StringBuffer sql = new StringBuffer("select pr_kind as thirdKind, pr_kindid as kindId, count(1) as count from products where pr_create_time between ? and ? group by pr_kind, pr_kindid");
+        StringBuffer sql = new StringBuffer("select pr_kind as thirdKind, pr_kindid as kindId, count(1) as count from products where pr_kind is not null ");
+        if (null != startDate) {
+            sql.append(" and pr_create_time >= '").append(startDate).append("' ");
+        }
+        if (null != endDate) {
+            sql.append(" and pr_create_time < '").append(endDate).append("' ");
+        }
+        sql.append("group by pr_kind, pr_kindid");
         StringBuffer countSql = new StringBuffer("select count(1) from (").append(sql).append(") as a");
-        Integer count = commonDao.queryForObject(countSql.toString(), Integer.class, startDate, endDate);
+        Integer count = commonDao.queryForObject(countSql.toString(), Integer.class);
         // 分页参数
         Integer offset = (pageable.getPageNumber() - 1) * pageable.getPageSize();
         sql.append(" limit ? offset ?");
-        List<KindHierarchicalCount> kindList = commonDao.query(sql.toString(), KindHierarchicalCount.class, startDate, endDate, pageable.getPageSize(), offset);
+        List<KindHierarchicalCount> kindList = commonDao.query(sql.toString(), KindHierarchicalCount.class, pageable.getPageSize(), offset);
         if (CollectionUtils.isNotEmpty(kindList)) {
             kindList.forEach(kind -> {
                 if (null != kind.getKindId()) {

+ 3 - 3
src/main/java/com/uas/platform/b2c/prod/store/service/impl/StoreApplyServiceImpl.java

@@ -342,7 +342,7 @@ public class StoreApplyServiceImpl implements StoreApplyService {
 		if (!StringUtils.isEmpty(endTime) && StringUtils.isEmpty(startTime)) {
 			sql.append(" where date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
-		sql.append(" group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS' "
+		sql.append(" group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS'  and count > 0 "
 				+ "order by a.apply_create_time limit " + (pageable.getPageNumber() - 1) * pageable.getPageSize() + ","
 				+ pageable.getPageSize());
 		StringBuilder totalSql = new StringBuilder("select count(1) from `store$apply` a left join (select pr_enuu, count(1) count from products ");
@@ -355,7 +355,7 @@ public class StoreApplyServiceImpl implements StoreApplyService {
 		if (!StringUtils.isEmpty(endTime) && StringUtils.isEmpty(startTime)) {
 			totalSql.append(" where date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
-		totalSql.append(" group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS' ");
+		totalSql.append(" group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS' and count > 0 ");
 		Integer total = commonDao.queryForObject(totalSql.toString(), Integer.class);
 		List<StoreInfoAndProdExport> exports = commonDao.query(sql.toString(), StoreInfoAndProdExport.class);
 		return new com.uas.sso.support.Page<>(pageable.getPageNumber(), pageable.getPageSize(), exports, total);
@@ -375,7 +375,7 @@ public class StoreApplyServiceImpl implements StoreApplyService {
 		if (!StringUtils.isEmpty(endTime) && StringUtils.isEmpty(startTime)) {
 			sql.append(" where date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
-		sql.append(" group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS' "
+		sql.append(" group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS' and count > 0 "
 				+ "order by a.apply_create_time  ");
 		return commonDao.query(sql.toString(), StoreInfoAndProdExport.class);
 	}

+ 12 - 2
src/main/java/com/uas/platform/b2c/trade/order/service/impl/PurchaseProductServiceImpl.java

@@ -1,5 +1,6 @@
 package com.uas.platform.b2c.trade.order.service.impl;
 
+import com.uas.platform.b2c.core.constant.IntegerConstant;
 import com.uas.platform.b2c.core.constant.ReleaseStatus;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.StringUtilB2C;
@@ -336,8 +337,17 @@ public class PurchaseProductServiceImpl implements PurchaseProductService {
         List<com.uas.platform.b2c.prod.commodity.model.Product> productList = productService.findProductIdAndProdnumsByProdNums(productCodeList);
         List<ProductPrivate> privateList = new ArrayList<>();
         productList.forEach(product -> {
-            ProductPrivate productPrivate = new ProductPrivate(product.getId());
-            productPrivate.setAttach(product.getAttachment());
+            ProductPrivate productPrivate;
+            List<ProductPrivate> privates = productPrivateDao.findByPrId(product.getId());
+            if (CollectionUtils.isNotEmpty(privates)) {
+                productPrivate = privates.get(0);
+                productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
+                productPrivate.setPrId(product.getId());
+                productPrivate.setBatchCount(IntegerConstant.NO_SHORT);
+            } else {
+                productPrivate = new ProductPrivate(product.getId());
+                productPrivate.setAttach(product.getAttachment());
+            }
             privateList.add(productPrivate);
             idSet.add(product.getId());
         });

+ 11 - 1
src/main/webapp/resources/js/admin/controllers/product/brandProductsCountCtrl.js

@@ -24,7 +24,17 @@ define(['app/app'], function(app) {
 
             // 导出
             $scope.exportXls = function () {
-                window.location.href = '/trade/goods/brandProductsCount/export?startTime='+ $scope.startFormatDate + '&endTime=' + $scope.endFormatDate;
+                var url = "/trade/goods/brandProductsCount/export";
+                if (angular.isDefined($scope.startFormatDate)) {
+                    url = url + '?startTime=' + $scope.startFormatDate;
+                }
+                if (angular.isDefined($scope.startFormatDate) && angular.isDefined($scope.endFormatDate)) {
+                    url = url + "&endTime=" + $scope.endFormatDate;
+                }
+                if (!angular.isDefined($scope.startFormatDate) && angular.isDefined($scope.endFormatDate)) {
+                    url = url + "?endTime=" + $scope.endFormatDate;
+                }
+                window.open(url);
             }
         }])
 })

+ 11 - 1
src/main/webapp/resources/js/admin/controllers/product/categoryNumberCtrl.js

@@ -24,7 +24,17 @@ define(['app/app'], function(app) {
 
             // 导出
             $scope.exportXls = function () {
-                window.location.href = '/trade/goods/kindProductsCount/export?startTime='+ $scope.startFormatDate + '&endTime=' + $scope.endFormatDate;
+                var url = "/trade/goods/kindProductsCount/export";
+                if (angular.isDefined($scope.startFormatDate)) {
+                    url = url + '?startTime=' + $scope.startFormatDate;
+                }
+                if (angular.isDefined($scope.startFormatDate) && angular.isDefined($scope.endFormatDate)) {
+                    url = url + "&endTime=" + $scope.endFormatDate;
+                }
+                if (!angular.isDefined($scope.startFormatDate) && angular.isDefined($scope.endFormatDate)) {
+                    url = url + "?endTime=" + $scope.endFormatDate;
+                }
+                window.open(url);
             }
         }])
 })

+ 7 - 2
src/main/webapp/resources/js/admin/controllers/product/productManageCtrl.js

@@ -318,8 +318,13 @@ define(['app/app'], function(app) {
         // 产品导出事件
         $scope.exportClick = function () {
             // 拼装链接
-            var url = '/trade/goods/background/download?startTime=' + $scope.startDate.getTime() + "&endTime=" + $scope.endDate.getTime()
-                + "&page=" + $scope.pageParams.page + "&count=" + $scope.pageParams.count + "&sorting=" + encodeURIComponent(angular.toJson($scope.pageParams.sorting));
+            var url = "/trade/goods/background/download?page=" + $scope.pageParams.page + "&count=" + $scope.pageParams.count + "&sorting=" + encodeURIComponent(angular.toJson($scope.pageParams.sorting));
+            if (angular.isDefined($scope.startDate) && null != $scope.startDate) {
+                url = url + "&startTime=" + $scope.startDate.getTime();
+            }
+            if (angular.isDefined($scope.endDate) && null != $scope.endDate) {
+                url = url + "&endTime=" + $scope.endDate.getTime();
+            }
             if (angular.isDefined($scope.goodsFilter.kindUuid)) {
                 url = url + "&kindUuid=" + $scope.goodsFilter.kindUuid;
             }