瀏覽代碼

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

shenjj 7 年之前
父節點
當前提交
232cec450d

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

@@ -2418,6 +2418,8 @@ public class ProductServiceImpl implements ProductService {
         product.setPcmpcode(product.getCmpCode());
         product.setKind(product.getProdName());
         product.setSourceApp("B2C");
+        product.setEnUU(enUU);
+        product.setUserUU(userUU);
         product.setCreateTime(new Date(System.currentTimeMillis()));
         // PCB产品做标准判断处理
         if (null != isPcb && Objects.equals(IntegerConstant.YES_SHORT, isPcb)) {
@@ -2440,6 +2442,13 @@ public class ProductServiceImpl implements ProductService {
             // 物料不存在,新增操作
             productInfo = product;
         }
+        if (null == productInfo.getStandard()) {
+            productInfo.setStandard(IntegerConstant.NO_SHORT);
+        }
+        if (StringUtilB2C.isEmpty(productInfo.getProdNum())) {
+            String code = "PNUM" + StringUtilB2C.getRandomNumber(6);
+            productInfo.setProdNum(code);
+        }
         // 最小包装数默认为1
         Double minPackQty = productInfo.getMinPackQty() == null ? DoubleConstant.minReserve : productInfo.getMinPackQty();
         productInfo.setMinPackQty(minPackQty);
@@ -2447,9 +2456,9 @@ public class ProductServiceImpl implements ProductService {
         // 最小起订量默认为最小包装数
         Double minBuyQty = productInfo.getMinOrder() == null ? productInfo.getMinPackQty() : productInfo.getMinOrder();
         productInfo.setMinOrder(minBuyQty);
+        productInfo = productDao.save(productInfo);
         // 设置库存信息
         assignmentGoods(goods, productInfo);
-        productInfo = productDao.save(productInfo);
         // 保存到商城私有库
         ProductPrivate productPrivate = new ProductPrivate(productInfo.getId());
         productPrivate.setAttach(product.getAttachment());
@@ -2675,19 +2684,6 @@ public class ProductServiceImpl implements ProductService {
         goodsService.setGoodsDefault(goods);
         boolean autoPublish = goods.getAutoPublish() == null ? true : goods.getAutoPublish();
         goods.setAutoPublish(autoPublish);
-        final Double minBuyQty = goods.getMinBuyQty();
-        if (CollectionUtils.isNotEmpty(goods.getPrices())) {
-            goods.getPrices().forEach(subPrice -> {
-                // 分段数量不能超过最大数量
-                Double endQty = NumberUtil.compare(subPrice.getEnd(), DoubleConstant.maxReserve) == 1 ? DoubleConstant.maxReserve : subPrice.getEnd();
-                subPrice.setEnd(endQty);
-
-                // 起始数量不能大于最小订购数
-                Double startQty = NumberUtil.compare(minBuyQty, subPrice.getStart()) == 1 ? subPrice.getStart() : minBuyQty;
-                subPrice.setStart(startQty);
-            });
-        }
-        goods.setQtyPrice(JSON.toJSONString(goods.getPrices()));
         StoreIn storeIn = storeInService.findByEnUU(SystemSession.getUser().getEnterprise().getUu());
         if (storeIn != null && storeIn.getStatus() == StoreStatus.OPENED) {
             goods.setStoreid(storeIn.getUuid());

+ 3 - 24
src/main/webapp/resources/js/common/b2bServices.js

@@ -650,8 +650,7 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
                     method: 'POST'
                 }
             });
-        }])
-        .factory('B2bCurrentRole', ['$resource', 'BaseService', function($resource, BaseService) {
+        }]).factory('B2bCurrentRole', ['$resource', 'BaseService', function($resource, BaseService) {
             var b2bPath = BaseService.getB2bUrl();
             return $resource(b2bPath + '/account/role', {}, {
                 //当前企业对应的角色是否是销售经理或管理员
@@ -668,12 +667,10 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
                     method: 'GET'
                 }
             })
-        }])
-        .factory('B2bCustomer', ['$resource', 'BaseService', function($resource, BaseService){
+        }]).factory('B2bCustomer', ['$resource', 'BaseService', function($resource, BaseService){
             var b2bPath = BaseService.getB2bUrl();
             return $resource(b2bPath + '/vendor/customer/info/search', {}, {});
-        }])
-        .factory('B2bAuthenticationService', ['$http', 'SessionService', 'BaseService', 'SerializerUtil', function($http, SessionService, BaseService, SerializerUtil) {
+        }]).factory('B2bAuthenticationService', ['$http', 'SessionService', 'BaseService', 'SerializerUtil', function($http, SessionService, BaseService, SerializerUtil) {
             var cacheSession = function() {
                 SessionService.set('authenticated', true);
             };
@@ -1083,24 +1080,6 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
                     }
                 }
             });
-            // 数据库直接获取
-        }]).factory('B2bCurrentRole', ['$resource', 'BaseService', function($resource, BaseService) {
-            var b2bPath = BaseService.getB2bUrl();
-            return $resource(b2bPath + '/account/role', {}, {
-                //当前企业对应的角色是否是销售经理或管理员
-                roles: {
-                    url: b2bPath + '/account/role/currentRole',
-                    method: 'GET'
-                },
-                isManager: {
-                    url: b2bPath + '/account/role/isManager',
-                    method: 'GET'
-                },
-                isUser: {
-                    url: b2bPath + '/account/role/isUser',
-                    method: 'GET'
-                }
-            })
         }]).factory('B2bPurcInquiryMould', ['$resource', 'BaseService', function($resource, BaseService) {
             var b2bPath = BaseService.getB2bUrl();
             return $resource(b2bPath + '/sale/mould/info/search', {}, {

+ 7 - 7
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_materialCtrl.js

@@ -3,7 +3,7 @@ define(['app/app', 'jquery-uploadify'], function(app) {
   app.register.controller('buyer_materialCtrl', ['$scope', 'Loading', '$rootScope', 'Material', 'toaster', 'ComponentActive', 'Enterprise', '$q', 'NumberService', '$location', '$stateParams', 'Search', '$modal', 'ComponentActiveAPI', 'BrandSubmit', 'BrandActiveAPI', 'DistributionRule', 'prodRepositoryService', 'AuthenticationService', 'StoreInfo', 'ProductServiceQuery', 'StoreCms', 'ByteCountService', 'Goods', 'UASBatchPutOnPropertyServices', '$filter', '$upload', '$http', 'Authority', 'seekPurchase',
       function($scope, Loading, $rootScope, Material, toaster, ComponentActive, Enterprise, $q, NumberService, $location, $stateParams, Search, $modal, ComponentActiveAPI, BrandSubmit, BrandActiveAPI, DistributionRule, prodRepositoryService, AuthenticationService, StoreInfo, ProductServiceQuery, StoreCms, ByteCountService, Goods, UASBatchPutOnPropertyServices, $filter, $upload, $http, Authority, seekPurchase) {
     $rootScope.active = 'buyer_material';
-    document.title = '家产品库-优软商城';
+    document.title = '家产品库-优软商城';
     $scope.tab = 'material';
     $scope.standard_tab = $stateParams.standardParam ? $stateParams.standardParam : 'unstandard';
     $scope.choosedIds = [];
@@ -4243,12 +4243,12 @@ define(['app/app', 'jquery-uploadify'], function(app) {
                   $scope.seekUrl = data.url;
                   commodity.seekPurchaseShow = true;
                   var ChooseItem = _deepCopy(commodity)
-                  $scope.applyObj.brand = ChooseItem.pbranden || ChooseItem.pbrand // 品牌
-                  $scope.applyObj.prodTitle = ChooseItem.kind || ChooseItem.kinden // 物料名称
-                  $scope.applyObj.spec = ChooseItem.spec || '-' // 规格
-                  $scope.applyObj.code = ChooseItem.pcmpcode // 型号
-                  $scope.applyObj.amount = null
-                  $scope.applyObj.deadline = null
+                  $scope.applyObj.brand = ChooseItem.pbranden || ChooseItem.pbrand; // 品牌
+                  $scope.applyObj.prodTitle = ChooseItem.kind || ChooseItem.kinden; // 物料名称
+                  $scope.applyObj.spec = ChooseItem.spec || '-'; // 规格
+                  $scope.applyObj.code = ChooseItem.pcmpcode; // 型号
+                  $scope.applyObj.amount = '';
+                  $scope.applyObj.deadline = null;
               })
           }
   }]);

+ 2 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/change/sale_inquiry_mould_detail.js

@@ -1,6 +1,7 @@
 // 客户模具询价单
 define(['app/app'], function (app) {
-  app.register.controller('saleInquiryMouldDetailCtrl', ['$rootScope','BaseService', '$scope', '$stateParams', 'B2bPurcInquiryMould', '$filter', 'toaster', '$upload', 'B2bCurrentRole', function (BaseService, $scope, $stateParams, PurcInquiryMould, $filter, toaster, $upload, CurrentRole) {
+  app.register.controller('saleInquiryMouldDetailCtrl', ['$rootScope','BaseService', '$scope', '$stateParams', 'B2bPurcInquiryMould', '$filter', 'toaster', '$upload', 'B2bCurrentRole',
+      function ($rootScope, BaseService, $scope, $stateParams, PurcInquiryMould, $filter, toaster, $upload, CurrentRole) {
       // 获取当前用户是否为普通用户
       CurrentRole.isUser({}, {}, function (data) {
           $scope.isUser = data.isUser;

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

@@ -618,7 +618,8 @@ define(['app/app', 'jquery-uploadify'], function(app) {
         prodName: $scope.Regul.kind, // 名称
         price: $scope.Regul.OnePrice, // 成本单价
         attachment: $scope.Regul.Ischange ? $scope.Regul.Regulpic : '', // 规格书
-        cmpImg: $scope.Regul.RegulImg !== $scope.Regul.iniUrlImg ? $scope.Regul.RegulImg : ''// 图片
+        cmpImg: $scope.Regul.RegulImg !== $scope.Regul.iniUrlImg ? $scope.Regul.RegulImg : '',// 图片
+        packaging: $scope.Regul.packaging // 包装方式
       }
       jsonObject.goods =  {
         minBuyQty: $scope.Regul.minBuyQty, // 最小起订量

+ 2 - 2
src/main/webapp/resources/view/usercenter/b2b/Purc/inquiryInfo_detail.html

@@ -20,8 +20,8 @@
   .purc-bid .row {
     margin-left: 0px;
     margin-right: 0px;
-    padding-left: 15px;
-    padding-right: 15px;
+    padding-left: 5px;
+    padding-right: 5px;
   }
 
   .bid-content {

+ 1 - 0
src/main/webapp/resources/view/usercenter/forstore/buyer_material.html

@@ -1977,6 +1977,7 @@
 			height: 28px;
 			border-radius: 2px;
 			color: #333;
+			padding:6px;
 		}
 		.wanted_list01 .dropdown-menu table tr{
 			height:auto;

+ 1 - 1
src/main/webapp/resources/view/vendor/b2b/change/sale_inquiry_details.html

@@ -261,7 +261,7 @@
         </div>
         <div class="title" ng-bind="::file.name"></div>
         <div class="download">
-          <a href="file/{{file.id}}">下载</a>
+          <a href="{{b2bUrl}}/file/{{file.id}}">下载</a>
         </div>
       </div>
     </div>

+ 3 - 2
src/main/webapp/resources/view/vendor/b2b/change/sale_inquiry_mould_detail.html

@@ -19,7 +19,8 @@
 
   tbody td .text-waiting {
     position: absolute;
-    top: 5px;
+    top: 15px;
+    left:25px;
     background-color: #fff;
     border: 1px solid;
     padding: 3px 14px;
@@ -459,7 +460,7 @@
             <div ng-if="!inquiryMould.$editing">
               <div ng-repeat="file in inquiryMould.sellAttachs track by $index">
                 <p class="text-left">
-                  <a style="color: #0000cc" target="_blank" href="file/{{file.id}}">{{file.name}}</a>&nbsp;&nbsp;&nbsp;
+                  <a style="color: #0000cc" target="_blank" href="{{b2bUrl}}/file/{{file.id}}">{{file.name}}</a>&nbsp;&nbsp;&nbsp;
                 </p>
               </div>
             </div>

+ 1 - 1
src/main/webapp/resources/view/vendor/b2b/change/sale_order_details.html

@@ -336,7 +336,7 @@
             <div class="text-bold text-inverse text-flow f14" ng-if="item.factory" title="{{item.factory}}"><b>送货工厂:</b><span ng-bind="::item.factory"></span></div>
             <div class="text-bold text-inverse text-flow f14" ng-if="item.remark" title="{{item.remark}}"><b>备注:</b><span ng-bind="::item.remark"></span></div>
             <div ng-repeat="att in item.attachs" class="text-bold text-bold text-overflow f14">
-              <a href="file/{{att.id}}">{{att.name}}</a>
+              <a href="{{b2bUrl}}/file/{{att.id}}">{{att.name}}</a>
             </div>
           </td>
           <td width="95" class="text-center">

+ 1 - 1
src/main/webapp/resources/view/vendor/b2b/change/sale_send_detail.html

@@ -380,7 +380,7 @@
             </div>
           </td>
           <td style="width: 165px;padding: 0 5px;" class="text-muted">
-            <div>单据编号:<a href="#/sale/order/{{::item.orderItem.order.id}}" ng-bind="::item.orderItem.order.code"></a></div>
+            <div>单据编号:<a href="vendor#/order/{{::item.orderItem.order.id}}" ng-bind="::item.orderItem.order.code"></a></div>
             <div>
               第 <span ng-bind="::item.orderItem.number"></span> 行
               &nbsp;&nbsp;&nbsp;&nbsp;数量:<span ng-bind="::item.orderItem.qty"></span>