Browse Source

Merge remote-tracking branch 'origin/feature/201812-wangcz' into feature/201812-wangcz

hubert 7 years ago
parent
commit
c9e7617d93

BIN
jpg


+ 28 - 30
src/main/java/com/uas/platform/b2c/trade/seek/service/impl/SeekPurchaseBomServiceImpl.java

@@ -102,25 +102,31 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
     /**
      * 模板列
      */
-    private int mallColNum = 6;
+    private final int SEEK_TEMPLATE_COLNUM = 6;
     /**
      * 上限行数
      */
-    private int mallRowNum = 500;
+    private final int MAX_SEEK_NUM = 500;
 
     /**
      * excel列名
      */
-    public static final int CODENUM = 0;
-    public static final int BRANDNUM = 1;
-    public static final int DEADLINENUM = 2;
-    public static final int AMOUNTNUM = 3;
+    // 型号
+    public final int CODENUM = 2;
+    // 品牌
+    public final int BRANDNUM = 0;
+    // 截止日期
+    public final int DEADLINENUM = 4;
+    // 采购数量
+    public final int AMOUNTNUM = 5;
 //    public static final int CURRENCYNUM = 6;
 //    public static final int UNITPRICENUM = 7;
 //    public static final int ENCAPSULATIONNUM = 8;
 //    public static final int PRODUCEDATENUM = 9;
-    public static final int KINDNUM = 4;
-    public static final int SPECNUM = 5;
+    // 类目
+    public final int KINDNUM = 1;
+    // 规格
+    public final int SPECNUM = 3;
 
 
     /**
@@ -136,12 +142,12 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
         Sheet sheet = workbook.getSheetAt(0);
         int colNum = sheet.getRow(0).getPhysicalNumberOfCells();
 
-        if (colNum != mallColNum) {
+        if (colNum != SEEK_TEMPLATE_COLNUM) {
             return new ResultMap(CodeType.PARAMETER_ERROR, "表格模板不正确!请重新下载最新模板");
         }
         int rowNum = sheet.getLastRowNum();
-        if (rowNum > mallRowNum) {
-            return new ResultMap(CodeType.PARAMETER_ERROR, "您上传的信息超过500条,请拆分成2000以再在上传");
+        if (rowNum > MAX_SEEK_NUM) {
+            return new ResultMap(CodeType.PARAMETER_ERROR, "您上传的信息超过500条,请拆分成500以下再在上传");
         }
         // 插入Bom求购中
         SeekPurchaseBom seekPurchaseBom = new SeekPurchaseBom();
@@ -151,7 +157,6 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
         seekPurchaseBom = seekPurchaseBomDao.save(seekPurchaseBom);
         // 获取第一行的信息
         Row headerRow = sheet.getRow(0);
-        int blankNum = 0;
         if (headerRow != null) {
             // 验证是否为商城模板
             if (!vaildTemplete(headerRow)) {
@@ -165,10 +170,9 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
             for (int r = startRow; r <= rowNum; r++) {
                 Row row = sheet.getRow(r);
                 if (row != null) {
-
                     SeekPurchaseByBatch seekPurchaseByBatch = new SeekPurchaseByBatch();
-                    blankNum = convertValueToSeekPurchaseByBatch(row, seekPurchaseByBatch, r);
-                    if (blankNum >= 3) {
+                    int blankNum = convertValueToSeekPurchaseByBatch(row, seekPurchaseByBatch, r);
+                    if (blankNum >= 4) {
                         continue;
                     }
                     seekPurchaseByBatch.setBomId(seekPurchaseBom.getId());
@@ -198,9 +202,6 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
         Object brandCellObj = readWorkBookCell(row.getCell(BRANDNUM), Cell.CELL_TYPE_STRING,
                 0, BRANDNUM);
         String brandString = StringUtilB2C.getStr(brandCellObj);
-//        Object produceDateCellObj = readWorkBookCell(row.getCell(PRODUCEDATENUM), Cell.CELL_TYPE_STRING,
-//                0, PRODUCEDATENUM);
-//        String produceDateString = StringUtilB2C.getStr(produceDateCellObj);
         if ("只能填数字、英文、英文特殊符号".equals(codeString) || "请勿用中文特殊符号".equals(brandString)) {
             return true;
         }
@@ -228,11 +229,6 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
         if (!"截止时间".equals(StringUtilB2C.getStr(deadlineCellObj))) {
             return false;
         }
-//        Object produceDateCellObj = readWorkBookCell(headerRow.getCell(PRODUCEDATENUM), Cell.CELL_TYPE_STRING,
-//                0, PRODUCEDATENUM);
-//        if (!"生产日期".equals(StringUtilB2C.getStr(produceDateCellObj))) {
-//            return false;
-//        }
         return true;
     }
 
@@ -306,6 +302,15 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
             }
         }
 
+        // 类目
+        Object kindValue = readWorkBookCell(row.getCell(KINDNUM), Cell.CELL_TYPE_STRING,
+                rowNum, KINDNUM);
+        if (!StringUtils.isEmpty(kindValue)) {
+            seekPurchaseByBatch.setKind(convert(kindValue, 50));
+        } else {
+            result += 1;
+        }
+
         // 求购数量
         Object amountValue = readWorkBookCell(row.getCell(AMOUNTNUM), Cell.CELL_TYPE_STRING,
                 rowNum, AMOUNTNUM);
@@ -386,13 +391,6 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
         if (!StringUtils.isEmpty(specValue)) {
             seekPurchaseByBatch.setSpec(convert(specValue, 50));
         }
-
-        // 类目
-        Object kindValue = readWorkBookCell(row.getCell(KINDNUM), Cell.CELL_TYPE_STRING,
-                rowNum, KINDNUM);
-        if (!StringUtils.isEmpty(kindValue)) {
-            seekPurchaseByBatch.setKind(convert(kindValue, 50));
-        }
         return result;
     }
 

BIN
src/main/resources/jxls-tpl/trade/seekPurchaseByBatch.xls


+ 2 - 2
src/main/webapp/resources/js/common/query/seekPurchase.js

@@ -15,7 +15,7 @@ define([ 'ngResource' ], function() {
         method: 'GET',
       },
       saveOneSeekPurchase: {
-        url: 'http://218.17.158.219:24000/inquiry/buyer/save',
+        url: 'http://10.1.51.82:24002/inquiry/buyer/save',
         method: 'POST'
       },
       saveOneSeekPurchaseProd: {
@@ -23,7 +23,7 @@ define([ 'ngResource' ], function() {
         method: 'POST'
       },
      saveOffer: {
-        url: 'http://218.17.158.219:24000/inquiry/sale/item/save',
+        url: 'http://10.1.51.82:24002/inquiry/sale/item/save',
         method: 'POST'
       },
       saveOfferProd: {

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

@@ -462,7 +462,7 @@ define(['app/app'], function(app) {
 					$scope.installmentBox = false
 				}
 				$scope.purchase.purchaseHistory = angular.fromJson($scope.purchase.statushistory);
-				$scope.purchase.currentTotal = $scope.purchase.price;
+				$scope.purchase.currentTotal = $scope.purchase.price + $scope.purchase.fare;
 				if ($scope.purchase.jsonRule){
 					$scope.rule = angular.fromJson($scope.purchase.jsonRule);
 				}

+ 16 - 12
src/main/webapp/resources/js/vendor/controllers/forstore/seek_purchase_ctrl.js

@@ -9,6 +9,7 @@ define(['app/app'], function (app) {
           $scope.seekPurchaseRate = {};
           seekPurchase.getSeekUrl({}, function(data) {
             var seekUrl = data.url;
+            seekUrl = 'http://10.1.51.77:7070';
           $scope.initInquiryItem = function () {
             $scope.validSayPrice = {
               leadtime: false,
@@ -19,7 +20,7 @@ define(['app/app'], function (app) {
           $scope.initInquiryItem();
 
             //卖家待报价推送信息,self为与我相关,all为全部
-            $scope.vendorType = 'self';
+            $scope.vendorType = 'all';
 
           // 获取当前卖家求购推送列表
           $scope.seekPurchaseTableParams = new ngTableParams({
@@ -44,14 +45,16 @@ define(['app/app'], function (app) {
                 $scope.isSearch = false;
               }
               var isSelf = $scope.vendorType == 'self';
-              if (!isSelf) {
-                param.enUU = $scope.userInfo.enterprise.uu;
-                param.userUU = $scope.userInfo.userUU;
-              } else {
-                param.enuu = $scope.userInfo.enterprise.uu;
-                param.useruu = $scope.userInfo.userUU;
-              }
-              var target = isSelf ? '/inquiry/sale/remind' : '/inquiry/public';
+              // if (!isSelf) {
+              //   param.enUU = $scope.userInfo.enterprise.uu;
+              //   param.userUU = $scope.userInfo.userUU;
+              // } else {
+              //   param.enuu = $scope.userInfo.enterprise.uu;
+              //   param.useruu = $scope.userInfo.userUU;
+              // }
+              param.enuu = $scope.userInfo.enterprise.uu;
+              param.useruu = $scope.userInfo.userUU;
+              var target = isSelf ? '/inquiry/sale/remind' : '/inquiry/sale/enremind';
               $http({
                 method: 'get',
                 dataType: 'json',
@@ -196,9 +199,10 @@ define(['app/app'], function (app) {
               if (!$scope.inquiryItem.currency) {
                 $scope.inquiryItem.currency = $scope.seekCurrency[0];
               }
-              if ($scope.vendorType == 'self') {
-                  $scope.inquiryItem.id = $scope.inquiryItem.itemId;
-              }
+              // if ($scope.vendorType == 'self') {
+              //     $scope.inquiryItem.id = $scope.inquiryItem.itemId;
+              // }
+              $scope.inquiryItem.id = $scope.inquiryItem.itemId;
               if (seekUrl == 'https://api-inquiry.usoftmall.com') {
                 seekPurchase.saveOfferProd($scope.inquiryItem, function (data) {
                   toaster.pop('success', '报价成功');

+ 7 - 4
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_store_maintain_ctrl.js

@@ -75,6 +75,7 @@ define(['app/app'], function (app) {
 			$scope.sampleStore.storeShortName = $scope.storeInfo.storeShortName;
             $scope.sampleStore.storeName = $scope.storeInfo.storeName;
 			$scope.sampleStore.description = $scope.storeInfo.description;
+			$scope.sampleStore.storeApplication = $scope.storeInfo.storeApplication;
 
             $scope.sampleStore.enPhone = '';
             $scope.sampleStore.enWeixin = '';
@@ -170,6 +171,7 @@ define(['app/app'], function (app) {
 				$scope.sampleStore.description = $scope.storeInfo.description;
 				$scope.sampleStore.enterprise = angular.copy($scope.storeInfo.enterprise);
 				$scope.sampleStore.enterprise.address = $scope.sampleStore.enterprise.address;
+				$scope.sampleStore.storeApplication = $scope.storeInfo.storeApplication;
 				return $scope.closeEdit(module);
 			}
 			if (module == 'QUALIFICATIONS') {
@@ -273,10 +275,10 @@ define(['app/app'], function (app) {
 				toaster.pop('error', '企业官网地址不能为空');
 				return false;
 			}*/
-			if (!$scope.sampleStore.enterprise.address || $scope.sampleStore.enterprise.address == '') {
-				toaster.pop('error', '店铺地址不能为空');
-				return false;
-			}
+			// if (!$scope.sampleStore.enterprise.address || $scope.sampleStore.enterprise.address == '') {
+			// 	toaster.pop('error', '店铺地址不能为空');
+			// 	return false;
+			// }
 			if (!$scope.sampleStore.enterprise.enTel || $scope.sampleStore.enterprise.enTel == '') {
 				toaster.pop('error', '请输入正确的电话号码');
 				return false;
@@ -305,6 +307,7 @@ define(['app/app'], function (app) {
             store.storeName = $scope.sampleStore.storeName;
 			store.description = $scope.sampleStore.description;
 			store.enterprise = angular.copy($scope.sampleStore.enterprise);
+			store.storeApplication = $scope.sampleStore.storeApplication;
 			saveChanges(store, 'BASIC_INFO');
 		};
 

+ 2 - 2
src/main/webapp/resources/view/vendor/forstore/seekPurchase.html

@@ -659,8 +659,8 @@
             <div class="sreach fr">
                 <span>求购筛选</span>
                 <select class="form-control select-adder vendor-type" ng-model="vendorType" ng-change="onVendorTypeChange(vendorType)">
-                    <option value="self">推荐询价</option>
-                    <option value="all">全部</option>
+                    <option value="self">我的商机</option>
+                    <option value="all">公司商机</option>
                 </select>
                 <span>发布时间&nbsp;</span>
                 <div class="date fl">

+ 2 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_account_management.html

@@ -1055,14 +1055,14 @@
                   </div>
                 </div>
               </li>
-                <li>
+               <!-- <li>
                     <div class="fl">企业简介</div>
                     <div class="col-sm-10" ng-if="updateState">
                         <textarea class="form-control" style="border-radius: inherit;resize: none;height: 200px;" title="description" ng-model="enterpriseInfo.description" maxlength="500" required></textarea>
                     </div>
                     <div class="fr" ng-if="!updateState"><span
                             ng-bind="enterpriseInfo.description || '暂无信息'"></span></div>
-                </li>
+                </li>-->
             </ul>
             <!--<div class="deal-btn" ng-if="userInfo.sys">-->
             <!--<button type="button" class="edit btn btn-primary" ng-if=" !updateState"  ng-click="changeToUpdate(true)">修改</button>-->

+ 38 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_store_maintain.html

@@ -594,7 +594,7 @@
 				</div>
 			</div>
 			<!-- 企业信息展示 start -->
-			<div class="row com_row title_row">
+		<!--	<div class="row com_row title_row">
 				<div class="col-md-12 custom_col">
 					<h2>企业信息</h2>
 				</div>
@@ -630,7 +630,7 @@
 				<div class="col-md-10 custom_col">
 					<span ng-if="enterprise">{{sampleStore.enterprise.enUrl || '暂无信息'}}</span>
 				</div>
-			</div>
+			</div>-->
 			<div class="row com_row" ng-if="enterprise.enType.length > 0">
 				<div class="col-md-2 custom_col">
 					<span>企业类型</span>
@@ -705,6 +705,22 @@
 					<textarea class="form-control" style="border-radius: inherit;resize: none;height: 200px;" title="description" ng-model="sampleStore.description" maxlength="500"></textarea>
 				</div>
 			</div>
+			<div class="row com_row">
+				<div class="col-md-2 custom_col">
+					<span>应用领域</span>
+				</div>
+				<div class="col-md-10 custom_col">
+					<textarea class="form-control" style="border-radius: inherit;resize: none;height: 200px;" title="application" ng-model="sampleStore.storeApplication" maxlength="100"></textarea>
+				</div>
+			</div>
+			<div class="row com_row">
+				<div class="col-md-2 custom_col">
+					<span>店铺简介</span>
+				</div>
+				<div class="col-md-10 custom_col">
+					<textarea class="form-control" style="border-radius: inherit;resize: none;height: 200px;" title="description" ng-model="sampleStore.enterprise.description" maxlength="500"></textarea>
+				</div>
+			</div>
 			<!--<div class="row com_row" style="margin-top: 10px;">
 				<div class="col-md-2 custom_col">
 					<span>官网地址<strong class="text-inverse">*</strong></span>
@@ -806,6 +822,26 @@
 					</div>
 				</div>
 			</div>
+			<div class="row com_row">
+				<div class="col-md-2 custom_col">
+					<span>应用领域</span>
+				</div>
+				<div class="col-md-10 custom_col show_info">
+					<div style="word-break: break-all;">
+						{{sampleStore.storeApplication || '暂无信息'}}
+					</div>
+				</div>
+			</div>
+			<div class="row com_row">
+				<div class="col-md-2 custom_col">
+					<span>企业介绍</span>
+				</div>
+				<div class="col-md-10 custom_col show_info">
+					<div style="word-break: break-all;">
+						{{sampleStore.enterprise.description || '暂无信息'}}
+					</div>
+				</div>
+			</div>
 			<!--<div class="row com_row" style="margin-top: 10px;">
 				<div class="col-md-2 custom_col">
 					<span>官网地址</span>

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

@@ -60,7 +60,7 @@
 				<!-- 我的店铺申述 store -->
 				<span  ui-sref="vendor_store_maintain" ng-if="store && store.status && store.status !== 'OPENED'">我的店铺</span>
 			</li>
-			<li ng-class="{'active' : active == 'vendor_seek_purchase'}"><span ui-sref="vendorSeekPurchase">我的商机</span></li>
+			<li ng-class="{'active' : active == 'vendor_seek_purchase'}"><span ui-sref="vendorSeekPurchase">商机管理</span></li>
 		<li ng-class="{'active' : active == 'vendor_logistics'}">
 			<span  ui-sref="vendor_logistics" ng-hide="store && (!store.status || store.status === 'OPENED')">物流管理</span>
 			<span  ui-sref="vendor_deliveryRule" ng-if="store && (!store.status || store.status === 'OPENED')">物流管理</span>