Browse Source

Merge branch 'feature-201840-wangcz' into dev

wangcz 7 years ago
parent
commit
5a080c4d2c

+ 1 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java

@@ -1788,6 +1788,7 @@ public class Goods implements Serializable {
 		goods.setCode(product.getPcmpcode());
 		goods.setEncapsulation(product.getEncapsulation());
 		goods.setPackaging(product.getPackaging());
+		goods.setSpec(product.getSpec());
 		if (StringUtils.isEmpty(goods.getPackaging())) {
 			goods.setPackaging(ProductConstant.DEFAULT_PACKING);
 		}

+ 13 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -1,5 +1,6 @@
 package com.uas.platform.b2c.prod.commodity.service.impl;
 
+import com.uas.platform.b2c.common.account.service.EnterpriseService;
 import com.uas.platform.b2c.common.base.dao.CommonDao;
 import com.uas.platform.b2c.core.config.SysConf;
 import com.uas.platform.b2c.core.constant.IntegerConstant;
@@ -57,6 +58,7 @@ import com.uas.platform.b2c.prod.store.service.StoreInService;
 import com.uas.platform.b2c.trade.order.StringConstant.Currency;
 import com.uas.platform.b2c.trade.presale.model.TradeDeliveryDelayTime;
 import com.uas.platform.b2c.trade.presale.service.TradeDeliveryDelayTimeService;
+import com.uas.platform.b2c.trade.support.CodeType;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.b2c.trade.util.BoundedExecutor;
 import com.uas.platform.core.exception.IllegalOperatorException;
@@ -173,6 +175,9 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	@Autowired
 	private InOutboundDetailService inOutboundDetailService;
 
+	@Autowired
+	private EnterpriseService enterpriseService;
+
 	/**
 	 * 控制任务提交速度的线程池
 	 */
@@ -462,6 +467,13 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		if (rowNum > ModifyConstant.EXCEL_MAX_ROW) {
 			throw new IllegalOperatorException("您上传的信息超过2000条,请拆分成2000以再在上传");
 		}
+		ResultMap currencyResultMap = enterpriseService.getCurrencyByRegisterAddress();
+		String currency = "";
+		if (currencyResultMap.getCode() == CodeType.OK.code()) {
+			currency = (String) currencyResultMap.getData();
+		} else {
+			throw new IllegalOperatorException(currencyResultMap.getMessage());
+		}
 		List<ReleaseProductByBatch> batchList = new ArrayList<>(rowNum);
 		List<ReleaseProductByBatch> repeatBatchList = new ArrayList<>(rowNum);
 		String batch = createNumberService.getTimeNumber("product$goods", 8, rowNum);
@@ -471,6 +483,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		for (int r = 2; r <= rowNum; r++) {
 			Row row = sheet.getRow(r);
 			ReleaseProductByBatch aBatch = new ReleaseProductByBatch();
+			aBatch.setCurrency(currency);
 			Object skuObj = readWorkBookCell(row.getCell(ModifyConstant.SKU_CODE), Cell.CELL_TYPE_STRING,
 					r, ModifyConstant.SKU_CODE);
 			aBatch.setBatchCodeByExcel(skuObj);

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

@@ -18,11 +18,15 @@ import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.prod.commodity.model.GoodsHistory;
 import com.uas.platform.b2c.prod.commodity.model.ProductPrivate;
 import com.uas.platform.b2c.prod.commodity.model.ReleaseProductByBatch;
+import com.uas.platform.b2c.prod.commodity.service.GoodsService;
 import com.uas.platform.b2c.prod.commodity.service.ProductService;
 import com.uas.platform.b2c.prod.commodity.service.ReleaseProductByBatchService;
 import com.uas.platform.b2c.prod.commodity.type.ProductConstant;
 import com.uas.platform.b2c.prod.commodity.util.SheetUtil;
 import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
+import com.uas.platform.b2c.prod.store.model.StoreIn;
+import com.uas.platform.b2c.prod.store.model.StoreStatus;
+import com.uas.platform.b2c.prod.store.service.StoreInService;
 import com.uas.platform.b2c.trade.order.service.PurchaseProductService;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.exception.IllegalOperatorException;
@@ -78,6 +82,12 @@ public class PurchaseProductServiceImpl implements PurchaseProductService {
     @Autowired
     private GoodsHistoryDao goodsHistoryDao;
 
+    @Autowired
+    private GoodsService goodsService;
+
+    @Autowired
+    private StoreInService storeInService;
+
     /**
      * 物料服务访问路径
      */
@@ -384,6 +394,7 @@ public class PurchaseProductServiceImpl implements PurchaseProductService {
         // 新增到物料库
         productService.saveByJdbcTemplate(batchList);
         List<com.uas.platform.b2c.prod.commodity.model.Product> productList = productService.findProductIdAndProdnumsByProdNums(productCodeList);
+        final StoreIn storeIn = storeInService.findByEnUU(SystemSession.getUser().getEnterprise().getUu());
         List<ProductPrivate> privateList = new ArrayList<>();
         List<Goods> finalGoodsList = new ArrayList<>();
         productList.forEach(product -> {
@@ -391,6 +402,8 @@ public class PurchaseProductServiceImpl implements PurchaseProductService {
                     ProductConstant.DEFAULT_MAX_DELIVERY, ProductConstant.DEFAULT_MIN_DELIVERY, ProductConstant.DEFAULT_MIN_BUYQTY,
                     ProductConstant.DEFAULT_MIN_PACKQTY, Status.NO_SHELVE.value());
             goods = productService.bindProductToGoods(goods, product);
+            goods.setSelfSale((storeIn != null && storeIn.getStatus() == StoreStatus.OPENED) ? "1" : "0");
+            goodsService.setGoodsDefault(goods);
             finalGoodsList.add(goods);
             ProductPrivate productPrivate;
             List<ProductPrivate> privates = productPrivateDao.findByPrId(product.getId());

+ 1 - 1
src/main/resources/dev/jdbc.properties

@@ -1,5 +1,5 @@
 jdbc.driverClassName=com.mysql.jdbc.Driver
-jdbc.url=7e5ef205e2ff4ca4ac98c9f833880ec6e2fe1a4579ebe6946c98747cbe3897b66b5c4cb4985aa8f22aa1cbab4bc6bfe12e09403e6255e2fda2f113bc366bbfc5d9a2cf99c34ce47ba6bd752a9bf5f04c3faf83464996ab6930a84c7d3b9f62d759eb691bc8cd1fe3225f6e7efa5ab3a583896b06178e65c511ffe406e85aa99db1f65698dedb9d9d53a22d64f481f2ac6274833920865b35427c5007d815dd5b
+jdbc.url=7e5ef205e2ff4ca4ac98c9f833880ec6e2fe1a4579ebe694cfadee207b20b5e2117a91db885bc50d2e397066c57e9fc432b41fef4178ab4e8a646fd89b9851a0f7432a8bd9956b2418e78dee1c5e5d82567f1298126b0dca5e3fdf150d16d06c2f31b54827ae14e87ca646b5a71154c6a4c09b934eeadccaa91ce8de7659392f9da7fc12426aa4539e840f5fe9330ae0aa41f8a2acc3771cabe6d12a3e97a9d4
 jdbc.username=474e1aeadeeecac5
 jdbc.password=48981af937f010627b96e886a0d38aad
 jdbc.initialSize=1

+ 1 - 1
src/main/resources/test/jdbc.properties

@@ -1,5 +1,5 @@
 jdbc.driverClassName=com.mysql.jdbc.Driver
-jdbc.url=7e5ef205e2ff4ca4ac98c9f833880ec6e2fe1a4579ebe6946c98747cbe3897b66b5c4cb4985aa8f22aa1cbab4bc6bfe12e09403e6255e2fda2f113bc366bbfc5d9a2cf99c34ce47ba6bd752a9bf5f04c3faf83464996ab6930a84c7d3b9f62d759eb691bc8cd1fe3225f6e7efa5ab3a583896b06178e65c511ffe406e85aa99db1f65698dedb9d9d53a22d64f481f2ac6274833920865b35427c5007d815dd5b
+jdbc.url=7e5ef205e2ff4ca4ac98c9f833880ec6e2fe1a4579ebe694cfadee207b20b5e2117a91db885bc50d2e397066c57e9fc432b41fef4178ab4e8a646fd89b9851a0f7432a8bd9956b2418e78dee1c5e5d82567f1298126b0dca5e3fdf150d16d06c2f31b54827ae14e87ca646b5a71154c6a4c09b934eeadccaa91ce8de7659392f9da7fc12426aa4539e840f5fe9330ae0aa41f8a2acc3771cabe6d12a3e97a9d4
 jdbc.username=474e1aeadeeecac5
 jdbc.password=48981af937f010627b96e886a0d38aad
 jdbc.initialSize=1

+ 2 - 2
src/main/resources/test/sys.properties

@@ -57,8 +57,8 @@ inquiryServiceInnerUrl=http://218.17.158.219:24000
 messageServiceUrl=http://192.168.253.12:24000/message/
 
 #b2b
-b2b=http://218.17.158.219:9000/b2b_test
-b2bDomain=218.17.158.219:9000/b2b_test
+b2b=http://218.17.158.219:9000/b2b-test
+b2bDomain=218.17.158.219:9000/b2b-test
 
 #lottery
 lottery=http://192.168.253.3:26789/

+ 12 - 0
src/main/webapp/resources/js/admin/controllers/statsDataCtrl.js

@@ -331,6 +331,18 @@ define([ 'app/app' ], function(app) {
                     case '手机UU用户数':
                         $scope.start31 = value.count;
                         break;
+                    case '在售商品类目(标准)':
+                        $scope.start32 = value.count;
+                        break;
+                    case '在售商品类目(非标准)':
+                        $scope.start33 = value.count;
+                        break;
+                    case '在售商品品牌(标准)':
+                        $scope.start34 = value.count;
+                        break;
+                    case '在售商品品牌(非标准)':
+                        $scope.start35 = value.count;
+                        break;
                 }
             });
         }, function(res) {

+ 6 - 1
src/main/webapp/resources/js/common/query/material.js

@@ -122,11 +122,16 @@ define([ 'ngResource' ], function() {
                 method: 'GET',
                 isArray: true
             },
-            // 单个物料导入
+            // 单个物料导入(卖家)
             importOneMaterail: {
               url: 'trade/products/edit/one',
               method: 'POST'
             },
+            // 单个物料导入(买家)
+            importUserOneMaterail: {
+                url: 'trade/purchaseProduct/edit/one',
+                method: 'POST'
+            },
           // 根据型号联想词,获取品牌,规格,物料名称等字段
           getSimilarComponents: {
             url: 'trade/products/code/keyword',

+ 1 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/single_entry_ctrl.js

@@ -656,7 +656,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
         selfSale: $scope.Regul.selfSale, // 销售方式
       }
       $rootScope.singleEntryInfo = false
-      Material.importOneMaterail({}, jsonObject, function(data) {
+      Material.importUserOneMaterail({}, jsonObject, function(data) {
         if (data.code == 1) {
           toaster.pop('success', '保存成功');
           $scope.showProductInfo = true

+ 25 - 33
src/main/webapp/resources/js/vendor/controllers/b2b/sale/saleCustomerCtrl.js

@@ -54,10 +54,6 @@ define(['app/app'], function (app) {
 
         // 分配用户
         $scope.addUserInfo = function (customer) {
-            if (!$scope.enabled) {
-                toaster.pop('error', '您没有为当前客户分配用户的权限!');
-                return;
-            }
             // 获取当前用户在当前企业是否被转移权限
             AccountUser.getEnTransfer ({custUU: customer.myEnterprise.uu}, function(data) {
                 customer.enTransfer = data.result;
@@ -80,6 +76,7 @@ define(['app/app'], function (app) {
                             else
                                 loadUsers();
                         }
+                        $scope.customerParams.reload();
                     });
 
                 } else {
@@ -91,10 +88,6 @@ define(['app/app'], function (app) {
         // 转移权限
         $scope.transferUserInfo = function (customer) {
             customer.enDistribute = null;
-            if (!$scope.enabled) {
-                toaster.pop('error', '您没有转移当前客户权限的权限!');
-                return;
-            }
             // 获取当前用户在当前企业是否被转移权限
             AccountUser.getDistribute ({custUU: customer.myEnterprise.uu}, function(data) {
                 customer.enDistribute = data.result;
@@ -117,6 +110,7 @@ define(['app/app'], function (app) {
                             else
                                 loadUsers();
                         }
+                        $scope.customerParams.reload();
                     });
 
                 } else {
@@ -234,14 +228,8 @@ define(['app/app'], function (app) {
         var checkStatus = function (userinfos) {
             var transfer = [];
             angular.forEach(userinfos, function (user, index) {
-                if ($scope.thisUser.sys || $scope.thisUser.transfer) {
-                    if (user.transfer) {
-                        transfer.push({num: index});
-                    }
-                } else {
-                    if (user.transfer) {
-                        transfer.push({num: index});
-                    }
+                if (user.transfer) {
+                    transfer.push({num: index});
                 }
             });
             $scope.transfer = transfer;
@@ -342,24 +330,28 @@ define(['app/app'], function (app) {
         };
 
     }]);
-    app.register.controller('AddUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'B2bAccountUser', 'toaster', function ($scope, $modalInstance, customer, AccountUser, toaster) {
-        $scope.checkboxes = {
-            checked: false
-        };
-        $scope.loading = true;
-        $scope.distribute = [];
-        AccountUser.findUsers({uu: customer.myEnterprise.uu}, null, function (data) {
-            $scope.userinfos = data;
-            var distribute = [];
-            angular.forEach($scope.userinfos, function (user, index) {
-                if (user.distribute) {
-                    distribute.push({num: index});
-                }
+    app.register.controller('AddUserInfoCtrl', ['$scope', '$modalInstance', 'customer', 'B2bAccountUser', 'toaster', 'AuthenticationService',
+        function ($scope, $modalInstance, customer, AccountUser, toaster, AuthenticationService) {
+        AuthenticationService.getAuthentication().success(function (data) {
+            $scope.thisUser = data;
+            $scope.checkboxes = {
+                checked: false
+            };
+            $scope.loading = true;
+            $scope.distribute = [];
+            AccountUser.findUsers({uu: customer.myEnterprise.uu}, null, function (data) {
+                $scope.userinfos = data;
+                var distribute = [];
+                angular.forEach($scope.userinfos, function (user, index) {
+                    if (user.distribute) {
+                        distribute.push({num: index});
+                    }
+                });
+                $scope.distribute = distribute;
+                $scope.havedone = angular.copy($scope.distribute);
+                $scope.loading = false;
             });
-            $scope.distribute = distribute;
-            $scope.havedone = angular.copy($scope.distribute);
-            $scope.loading = false;
-        })
+        });
 
         var checkStatus = function (userinfos) {
             var distribute = [];

+ 0 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/purchase_offer_ctrl.js

@@ -53,7 +53,6 @@ define(['app/app'], function(app) {
 
       seekPurchase.getSeekUrl({}, function(data) {
         var seekUrl = data.url;
-        //   var seekUrl = 'http://10.1.51.82:24002';
         // 获取我的报价列表
         $scope.seekPurchaseTableParams = new ngTableParams({
           pageNumber: 1,

+ 0 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -51,7 +51,6 @@ define(['app/app'], function (app) {
 
           seekPurchase.getSeekUrl({}, function(data) {
             var seekUrl = data.url;
-            // var seekUrl = 'http://10.1.51.82:24002';
           var initInquiryItem = function () {
             $scope.validSayPrice = {
               leadtime: false,

+ 1 - 4
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js

@@ -1100,10 +1100,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
         return;
       }
       if ($scope.chooseAllPage) {
-        if ('standard' == $scope.standard_tab)
-          downloadByJs('trade/products/template/download/type', $scope.param.keyword, 'standard');
-        if ('unstandard' == $scope.standard_tab)
-          downloadByJs('trade/products/template/download/type', $scope.param.keyword, 'nStandard');
+          downloadByJs('trade/products/template/download/type', $scope.param.keyword, 'all');
       } else {
         $scope.getChoosedInfo();
         if (!$scope.choosedIds || $scope.choosedIds.length == 0) {

+ 17 - 20
src/main/webapp/resources/view/admin/stats_data.html

@@ -198,12 +198,6 @@
 							<span ng-bind="start16 | number"></span>
 						</span>
                     </div>
-                    <!--<div class="form-group row">
-                        <span class="col-sm-6 text-right">企业信息库总数:</span>
-                        <span class="col-sm-6">
-							<span ng-bind="statistics.sumPriceRMBNT | number"></span>
-						</span>
-                    </div>-->
                     <div class="form-group row">
                         <span class="col-sm-6 text-right">优软云个人用户数:</span>
                         <span class="col-sm-6">
@@ -253,12 +247,6 @@
 							<span ng-bind="start9 | number"></span>
 						</span>
                     </div>
-                    <!--<div class="form-group row">-->
-                    <!--<span class="col-sm-6 text-right">商城本月开店数:</span>-->
-                    <!--<span class="col-sm-5 text-num">-->
-                    <!--<span ng-bind="statistics.sumPriceRMB | number"></span>-->
-                    <!--</span>-->
-                    <!--</div>-->
                 </div>
                 <div class="col-sm-4 f14">
                     <div class="form-group row title">
@@ -269,13 +257,29 @@
                         <span class="col-sm-6" ng-bind="start13 | number"></span>
                     </div>
                     <div class="form-group row">
-                        <span class="col-sm-6 text-right">在售商品类目:</span>
+                        <span class="col-sm-6 text-right">在售商品类目总数:</span>
                         <span class="col-sm-6" ng-bind="start12 | number"></span>
                     </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售商品类目(标准):</span>
+                        <span class="col-sm-6" ng-bind="start32 | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售商品类目(非标):</span>
+                        <span class="col-sm-6" ng-bind="start33 | number"></span>
+                    </div>
                     <div class="form-group row">
                         <span class="col-sm-6 text-right">在售商品品牌总数:</span>
                         <span class="col-sm-6" ng-bind="start11 | number"></span>
                     </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售商品品牌(标准):</span>
+                        <span class="col-sm-6" ng-bind="start34 | number"></span>
+                    </div>
+                    <div class="form-group row">
+                        <span class="col-sm-6 text-right">在售商品品牌(非标):</span>
+                        <span class="col-sm-6" ng-bind="start35 | number"></span>
+                    </div>
                     <div class="form-group row">
                         <span class="col-sm-6 text-right">库存合计:</span>
                         <span class="col-sm-6" ng-bind="start10 | number"></span>
@@ -292,13 +296,6 @@
 							<span ng-bind="start15 | number"></span>
 						</span>
                     </div>
-
-                    <!--<div class="form-group row">-->
-                    <!--<span class="col-sm-6 text-right">商城本月开店数:</span>-->
-                    <!--<span class="col-sm-5 text-num">-->
-                    <!--<span ng-bind="statistics.sumPriceRMB | number"></span>-->
-                    <!--</span>-->
-                    <!--</div>-->
                 </div>
             </div>
         </div>

+ 1 - 1
src/main/webapp/resources/view/vendor/b2b/modal/add_userInfo.html

@@ -43,7 +43,7 @@
 			</thead>
 			<tbody>
 			<div style="overflow-y:scroll; width:100%;max-height:500px">
-				<tr ng-repeat="user in userinfos| filter: keyword track by $index">
+				<tr ng-repeat="user in userinfos| filter: keyword track by $index" ng-if = "thisUser.userUU != user.userUU">
 					<td width="80px;">{{user.userUU}}</td>
 					<td width="100px;">{{user.userName}}</td>
 					<td width="40px;" style="text-align: center">

+ 4 - 4
src/main/webapp/resources/view/vendor/b2b/modal/transfer_userInfo.html

@@ -37,7 +37,7 @@
 			</thead>
 			<tbody ng-if="thisUser.sys">
 			<!-- 当前用户是管理员时 -->
-			<tr ng-repeat="user in userinfos| filter: keyword track by $index" style="overflow-y:scroll; width:100%;max-height:500px" ng-if="!user.sys">
+			<tr ng-repeat="user in userinfos| filter: keyword track by $index" style="overflow-y:scroll; width:100%;max-height:500px" ng-if="!user.sys && thisUser.userUU != user.userUU">
 				<td width="80px;">{{user.userUU}}</td>
 				<td width="100px;">{{user.userName}}</td>
 				<td width="40px;" style="text-align: center">
@@ -50,7 +50,7 @@
 			</tbody>
 			<tbody ng-if="!thisUser.sys && thisUser.transfer">
 			<!-- 当前用户是被管理员转移权限时 -->
-			<tr ng-repeat="user in userinfos| filter: keyword track by $index" ng-if="!user.sys">
+			<tr ng-repeat="user in userinfos| filter: keyword track by $index" ng-if="!user.sys && thisUser.userUU != user.userUU">
 				<td width="80px;">{{user.userUU}}</td>
 				<td width="100px;">{{user.userName}}</td>
 				<td width="40px;" style="text-align: center">
@@ -63,12 +63,12 @@
 			</tbody>
 			<tbody ng-if="!thisUser.sys && !thisUser.transfer">
 			<!-- 当前用户是非管理员,但有查看权限时 -->
-			<tr ng-repeat="user in userinfos| filter: keyword track by $index" ng-if="!user.distribute && !user.sys">
+			<tr ng-repeat="user in userinfos| filter: keyword track by $index" ng-if="!user.distribute && !user.sys && thisUser.userUU != user.userUU">
 				<td width="80px;">{{user.userUU}}</td>
 				<td width="100px;">{{user.userName}}</td>
 				<td width="40px;" style="text-align: center">
 					<label class="com-check-box">
-						<input id="{{'user2' + $index}}" name="distribute" ng-click="checkOne(user)" ng-checked="user.checked" type="checkbox" title="选择">
+						<input id="{{'user2' + $index}}" name="distribute" ng-model="user.transfer" ng-click="checkOne(user)" ng-checked="user.checked" type="checkbox" title="选择">
 						<label for="{{'user2' + $index}}"></label>
 					</label>
 				</td>

+ 1 - 1
src/test/java/com/uas/platform/b2c/DesTest.java

@@ -14,7 +14,7 @@ public class DesTest {
     public void test(){
         // 测试
         System.out.println("text & dev: ");
-        prindHexString("jdbc:mysql://192.168.253.12:3306/mall_test_dev?characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&useUnicode=true");
+        prindHexString("jdbc:mysql://192.168.253.6:3306/mall_test_dev?characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&useUnicode=true");
         prindHexString("root");
         prindHexString("select111***");