Browse Source

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

yuj 7 years ago
parent
commit
2509f25d9b

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

@@ -4067,7 +4067,7 @@ public class GoodsServiceImpl implements GoodsService {
     public com.uas.sso.support.Page<BrandCount> getBrandProductsCount(Pageable pageable, Date startTime, Date endTime) {
     public com.uas.sso.support.Page<BrandCount> getBrandProductsCount(Pageable pageable, Date startTime, Date endTime) {
         java.sql.Date startDate = assignStartDate(startTime);
         java.sql.Date startDate = assignStartDate(startTime);
         java.sql.Date endDate = assignEndDate(endTime);
         java.sql.Date endDate = assignEndDate(endTime);
-        StringBuffer sql = new StringBuffer("select br_name_en as brand, count(1) as count from trade$goods where br_name_en is not null and go_createddate between ? and ? group by br_name_en");
+        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 countSql = new StringBuffer("select count(1) from (").append(sql).append(") as a");
         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, startDate, endDate);
         // 分页参数
         // 分页参数
@@ -4126,7 +4126,7 @@ public class GoodsServiceImpl implements GoodsService {
     public com.uas.sso.support.Page<KindHierarchicalCount> getKindProductsCount(Pageable pageable, Date startTime, Date endTime) {
     public com.uas.sso.support.Page<KindHierarchicalCount> getKindProductsCount(Pageable pageable, Date startTime, Date endTime) {
         java.sql.Date startDate = assignStartDate(startTime);
         java.sql.Date startDate = assignStartDate(startTime);
         java.sql.Date endDate = assignEndDate(endTime);
         java.sql.Date endDate = assignEndDate(endTime);
-        StringBuffer sql = new StringBuffer("select ki_name as thirdKind, go_kind_uuid as kindId, count(1) as count from trade$goods where go_createddate between ? and ? group by ki_name, go_kind_uuid");
+        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 countSql = new StringBuffer("select count(1) from (").append(sql).append(") as a");
         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, startDate, endDate);
         // 分页参数
         // 分页参数

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

@@ -331,24 +331,31 @@ public class StoreApplyServiceImpl implements StoreApplyService {
 			return null;
 			return null;
 		}
 		}
 		StringBuilder sql = new StringBuilder("select a.apply_create_time applyTime, a.apply_store_name storeName, "
 		StringBuilder sql = new StringBuilder("select a.apply_create_time applyTime, a.apply_store_name storeName, "
-				+ "a.apply_store_enuu enuu,a.apply_auth_time agreeTime, a.apply_auth_person_name agreeName, " +
-				"ifnull(p.count, 0) count from `store$apply` a left join (select pr_enuu, count(1) count from products" +
-				" group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS' ");
+				+ "a.apply_store_enuu enuu,a.apply_auth_time agreeTime, a.apply_auth_person_name agreeName, "
+				+ "ifnull(p.count, 0) count from `store$apply` a left join (select pr_enuu, count(1) count from products");
 		if (!StringUtils.isEmpty(startTime)) {
 		if (!StringUtils.isEmpty(startTime)) {
-			sql.append(" and date(a.apply_create_time) >= '" + new java.sql.Date(startTime.getTime()) + "'");
+			sql.append(" where date(pr_create_time) >= '" + new java.sql.Date(startTime.getTime()) + "'");
 		}
 		}
-		if (!StringUtils.isEmpty(endTime)) {
-			sql.append(" and date(a.apply_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
+		if (!StringUtils.isEmpty(endTime) && !StringUtils.isEmpty(startTime)) {
+			sql.append(" and date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
 		}
-		sql.append(" order by a.apply_create_time limit " + (pageable.getPageNumber() - 1) * pageable.getPageSize() + ","
+		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' "
+				+ "order by a.apply_create_time limit " + (pageable.getPageNumber() - 1) * pageable.getPageSize() + ","
 				+ pageable.getPageSize());
 				+ pageable.getPageSize());
-		StringBuilder totalSql = new StringBuilder("select count(1) from `store$apply` a where a.apply_status='PASS' ");
+		StringBuilder totalSql = new StringBuilder("select count(1) from `store$apply` a left join (select pr_enuu, count(1) count from products ");
 		if (!StringUtils.isEmpty(startTime)) {
 		if (!StringUtils.isEmpty(startTime)) {
-			totalSql.append(" and date(a.apply_create_time) >= '" + new java.sql.Date(startTime.getTime()) + "'");
+			totalSql.append(" where date(pr_create_time) >= '" + new java.sql.Date(startTime.getTime()) + "'");
+		}
+		if (!StringUtils.isEmpty(endTime) && !StringUtils.isEmpty(startTime)) {
+			totalSql.append(" and date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
 		}
-		if (!StringUtils.isEmpty(endTime)) {
-			totalSql.append(" and date(a.apply_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
+		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' ");
 		Integer total = commonDao.queryForObject(totalSql.toString(), Integer.class);
 		Integer total = commonDao.queryForObject(totalSql.toString(), Integer.class);
 		List<StoreInfoAndProdExport> exports = commonDao.query(sql.toString(), StoreInfoAndProdExport.class);
 		List<StoreInfoAndProdExport> exports = commonDao.query(sql.toString(), StoreInfoAndProdExport.class);
 		return new com.uas.sso.support.Page<>(pageable.getPageNumber(), pageable.getPageSize(), exports, total);
 		return new com.uas.sso.support.Page<>(pageable.getPageNumber(), pageable.getPageSize(), exports, total);
@@ -357,16 +364,19 @@ public class StoreApplyServiceImpl implements StoreApplyService {
 	@Override
 	@Override
 	public List<StoreInfoAndProdExport> storeInfoAndProdCountExport(Date startTime, Date endTime) {
 	public List<StoreInfoAndProdExport> storeInfoAndProdCountExport(Date startTime, Date endTime) {
 		StringBuilder sql = new StringBuilder("select a.apply_create_time applyTime, a.apply_store_name storeName, "
 		StringBuilder sql = new StringBuilder("select a.apply_create_time applyTime, a.apply_store_name storeName, "
-				+ "a.apply_store_enuu enuu,a.apply_auth_time agreeTime, a.apply_auth_person_name agreeName, " +
-				"ifnull(p.count, 0) count from `store$apply` a left join (select pr_enuu, count(1) count from products" +
-				" group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS' ");
+				+ "a.apply_store_enuu enuu,a.apply_auth_time agreeTime, a.apply_auth_person_name agreeName, "
+				+ "ifnull(p.count, 0) count from `store$apply` a left join (select pr_enuu, count(1) count from products");
 		if (!StringUtils.isEmpty(startTime)) {
 		if (!StringUtils.isEmpty(startTime)) {
-			sql.append(" and date(a.apply_create_time) >= '" + new java.sql.Date(startTime.getTime()) + "'");
+			sql.append(" where date(pr_create_time) >= '" + new java.sql.Date(startTime.getTime()) + "'");
+		}
+		if (!StringUtils.isEmpty(endTime) && !StringUtils.isEmpty(startTime)) {
+			sql.append(" and date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
 		}
-		if (!StringUtils.isEmpty(endTime)) {
-			sql.append(" and date(a.apply_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
+		if (!StringUtils.isEmpty(endTime) && StringUtils.isEmpty(startTime)) {
+			sql.append(" where date(pr_create_time) <= '" + new java.sql.Date(endTime.getTime()) + "' ");
 		}
 		}
-		sql.append(" order by a.apply_create_time");
+		sql.append(" group by pr_enuu) p on p.pr_enuu = a.apply_store_enuu where a.apply_status='PASS' "
+				+ "order by a.apply_create_time  ");
 		return commonDao.query(sql.toString(), StoreInfoAndProdExport.class);
 		return commonDao.query(sql.toString(), StoreInfoAndProdExport.class);
 	}
 	}
 }
 }

+ 22 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/single_entry.js

@@ -680,9 +680,30 @@ define(['app/app', 'jquery-uploadify'], function(app) {
 
 
     // 新增物料
     // 新增物料
     $scope.initProduct = function() {
     $scope.initProduct = function() {
+        resetPageInfo()
+        $scope.showProductInfo = false
+    }
+
+    // 取消编辑
+    $scope.clearCheckBox = function() {
+      if ($rootScope.singleEntryInfo === true ) {
+        if (confirm('是否放弃本次编辑')) {
+            $rootScope.singleEntryInfo = false
+            resetPageInfo()
+        }
+      } else {
+          resetPageInfo()
+      }
+    }
+
+    // 重置页面数据
+    function resetPageInfo() {
         initInfo()
         initInfo()
         initError()
         initError()
-        $scope.showProductInfo = false
+        var selfSale = ($scope.storeInfo.uuid != 'undefind' && $scope.storeInfo.uuid !== '33069557578d44e69bd91ad12d28a8d4' && ($scope.storeInfo.storeName && $scope.storeInfo.storeName.indexOf('优软测试二') < 0 && $scope.storeInfo.storeName.indexOf('优软商城') < 0)) ? 1: 0
+        $scope.Regul.dateArea = selfSale === 1 ? 'formMe' : 'autoMonth' // 自营还是销售
+        // 销售方式
+        $scope.Regul.selfSale = selfSale
     }
     }
 
 
     // document.addEventListener('click', function() {
     // document.addEventListener('click', function() {

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/single_entry.html

@@ -479,7 +479,7 @@
                   <input ng-show="storeInfo.enType === 'HK'" type="text" autocomplete="off" validata-price ng-blur="changePrices(Regul.prices, price.uSDPrice, $index)" oninput="if(value.length>11)value=value.slice(0,11)" style="width: 100%;outline: 0;border: 0;text-align: center;height: 30px" ng-model="price.uSDPrice" />
                   <input ng-show="storeInfo.enType === 'HK'" type="text" autocomplete="off" validata-price ng-blur="changePrices(Regul.prices, price.uSDPrice, $index)" oninput="if(value.length>11)value=value.slice(0,11)" style="width: 100%;outline: 0;border: 0;text-align: center;height: 30px" ng-model="price.uSDPrice" />
                 </span>
                 </span>
                 <span class="fl w50" ng-show="showProductInfo" style="text-align: center">
                 <span class="fl w50" ng-show="showProductInfo" style="text-align: center">
-                  {{price.rMBPrice || price.uSDPrice}}
+                  {{price.rMBPrice || price.uSDPrice || '-'}}
                 </span>
                 </span>
                 <div style="clear:both"></div>
                 <div style="clear:both"></div>
                 <div class="input-list ng-scope" style="height: 24px;line-height: 24px;position: absolute;right: -38px;top: 3px" ng-show="!showProductInfo">
                 <div class="input-list ng-scope" style="height: 24px;line-height: 24px;position: absolute;right: -38px;top: 3px" ng-show="!showProductInfo">