浏览代码

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

yujia 7 年之前
父节点
当前提交
c03ab18b64

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

@@ -13,7 +13,6 @@ import com.uas.platform.b2c.prod.product.component.modal.Component;
 import com.uas.platform.b2c.trade.seek.dao.*;
 import com.uas.platform.b2c.trade.seek.model.*;
 import com.uas.platform.b2c.trade.seek.service.SeekPurchaseBomService;
-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.core.exception.IllegalOperatorException;
@@ -104,7 +103,7 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
     /**
      * 模板列
      */
-    private final int SEEK_TEMPLATE_COLNUM = 6;
+    private final int SEEK_TEMPLATE_COLNUM = 5;
     /**
      * 上限行数
      */
@@ -117,10 +116,10 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
     public final int CODENUM = 2;
     // 品牌
     public final int BRANDNUM = 0;
-    // 截止日期
-    public final int DEADLINENUM = 4;
+//    // 截止日期
+//    public final int DEADLINENUM = 4;
     // 采购数量
-    public final int AMOUNTNUM = 5;
+    public final int AMOUNTNUM = 4;
 //    public static final int CURRENCYNUM = 6;
 //    public static final int UNITPRICENUM = 7;
 //    public static final int ENCAPSULATIONNUM = 8;
@@ -171,6 +170,7 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
             if (sheet.getRow(startRow) != null && vaidSample(sheet.getRow(startRow))) {
                 startRow = 3;
             }
+            Date releaseDate = new Date(System.currentTimeMillis());
             for (int r = startRow; r <= rowNum; r++) {
                 Row row = sheet.getRow(r);
                 if (row != null) {
@@ -180,7 +180,7 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
                         continue;
                     }
                     seekPurchaseByBatch.setBomId(seekPurchaseBom.getId());
-                    seekPurchaseByBatch.setReleaseDate(new Date(System.currentTimeMillis()));
+                    seekPurchaseByBatch.setReleaseDate(releaseDate);
                     seekPurchaseByBatchList.add(seekPurchaseByBatch);
                 }
             }
@@ -230,9 +230,9 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
         if (!"品牌名称".equals(StringUtilB2C.getStr(brandCellObj))) {
             return false;
         }
-        Object deadlineCellObj = readWorkBookCell(headerRow.getCell(DEADLINENUM), Cell.CELL_TYPE_STRING,
-                0, DEADLINENUM);
-        if (!"截止时间".equals(StringUtilB2C.getStr(deadlineCellObj))) {
+        Object prodTitleCellObj = readWorkBookCell(headerRow.getCell(KINDNUM), Cell.CELL_TYPE_STRING,
+                0, KINDNUM);
+        if (!"物料名称".equals(StringUtilB2C.getStr(prodTitleCellObj))) {
             return false;
         }
         return true;
@@ -279,34 +279,34 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
             seekPurchaseByBatch.setBrand(convert(brandValue, 50));
         }
 
-        // 截止日期
-        Object deadlineValue = readWorkBookCell(row.getCell(DEADLINENUM), Cell.CELL_TYPE_STRING,
-                rowNum, DEADLINENUM);
-        if (StringUtils.isEmpty(deadlineValue)) {
-            result += 1;
-        } else {
-            String deadline = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(deadlineValue));
-            if (deadline.contains(".")) {
-                deadline = deadline.replace(".", "-");
-            }
-            if (deadline.contains("/")) {
-                deadline = deadline.replace("/", "-");
-            }
-            try {
-                deadline = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutString(deadline, 10);
-                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-                Date deadlineDate = sdf.parse(deadline);
-                Date now = sdf.parse(sdf.format(new Date()));
-                if (deadlineDate.getTime() < now.getTime()) {
-                    seekPurchaseByBatch.setDeadline(null);
-                } else {
-                    seekPurchaseByBatch.setDeadline(DateUtils.addTime(deadlineDate, 0, 23, 59, 59));
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-                seekPurchaseByBatch.setDeadline(null);
-            }
-        }
+//        // 截止日期
+//        Object deadlineValue = readWorkBookCell(row.getCell(DEADLINENUM), Cell.CELL_TYPE_STRING,
+//                rowNum, DEADLINENUM);
+//        if (StringUtils.isEmpty(deadlineValue)) {
+//            result += 1;
+//        } else {
+//            String deadline = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(deadlineValue));
+//            if (deadline.contains(".")) {
+//                deadline = deadline.replace(".", "-");
+//            }
+//            if (deadline.contains("/")) {
+//                deadline = deadline.replace("/", "-");
+//            }
+//            try {
+//                deadline = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutString(deadline, 10);
+//                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+//                Date deadlineDate = sdf.parse(deadline);
+//                Date now = sdf.parse(sdf.format(new Date()));
+//                if (deadlineDate.getTime() < now.getTime()) {
+//                    seekPurchaseByBatch.setDeadline(null);
+//                } else {
+//                    seekPurchaseByBatch.setDeadline(DateUtils.addTime(deadlineDate, 0, 23, 59, 59));
+//                }
+//            } catch (Exception e) {
+//                e.printStackTrace();
+//                seekPurchaseByBatch.setDeadline(null);
+//            }
+//        }
 
         // 类目
         Object kindValue = readWorkBookCell(row.getCell(KINDNUM), Cell.CELL_TYPE_STRING,
@@ -324,7 +324,7 @@ public class SeekPurchaseBomServiceImpl implements SeekPurchaseBomService {
             try {
                 Double amount = Double.valueOf(StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(amountValue)));
                 int amountInt = amount.intValue();
-                if (amount <= 0 || amount >= 1000000000 || amountInt != amount) {
+                if (amount <= 0 || amount >= 10000 || amountInt != amount) {
                     amount = null;
                 }
                 seekPurchaseByBatch.setAmount(amount);

二进制
src/main/resources/jxls-tpl/trade/seekPurchaseByBatch.xls


+ 7 - 5
src/main/webapp/resources/js/admin/controllers/checkMoney/exchangeRate.js

@@ -3,17 +3,19 @@ define(['app/app'], function(app) {
 	app.register.controller('exchangeRateCtrl', ['$scope', 'exchangeRateService', 'toaster', function($scope, exchangeRateService, toaster) {
 		$scope.edit = false;
 		exchangeRateService.getUSD(null, function(date) {
-			$scope.usdExchangeRate = date;
+			$scope.usdExchangeRate = date.data;
 		}, function(response) {
 			toaster.pop('error', '获取信息失败:' + response.data);
 		});
 		
 		$scope.save = function() {
-			$scope.usdExchangeRate.fromCurrency = 'USD';
-			$scope.usdExchangeRate.toCurrency = 'CNY';
-			$scope.usdExchangeRate.type = 'USD';
+			if ($scope.usdExchangeRate.fromCurrency == null || $scope.usdExchangeRate.fromCurrency == '') {
+                $scope.usdExchangeRate.fromCurrency = 'USD';
+                $scope.usdExchangeRate.toCurrency = 'CNY';
+                $scope.usdExchangeRate.type = 'USD';
+			}
 			exchangeRateService.save(null, $scope.usdExchangeRate, function(data) {
-				$scope.usdExchangeRate = data;
+				$scope.usdExchangeRate = data.data;
 				$scope.edit = false;
 				toaster.pop('success', '保存成功');
 			}, function(response) {

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

@@ -69,8 +69,8 @@
 			<li ng-class="{'active' : active == 'vendor_productOn'}" ng-if="!isPcbStore"><span  ui-sref="vendor_upload">产品导入</span></li>
 
 	<!--	<li ng-class="{'active' : active == 'vendor_logistics'}"><span  ui-sref="vendor_logistics">物流管理</span></li>-->
-		<li ng-class="{'active' : active == 'vendor_brand_apply'}" ng-if="!isPcbStore"><span  ui-sref="vendor_brand_apply">品牌申请</span></li>
-		<li ng-class="{'active' : active == 'vendor_component_apply'}" ng-if="!isPcbStore"><span  ui-sref="vendor_component_apply">器件申请</span></li>
+		<!--<li ng-class="{'active' : active == 'vendor_brand_apply'}" ng-if="!isPcbStore"><span  ui-sref="vendor_brand_apply">品牌申请</span></li>-->
+		<!--<li ng-class="{'active' : active == 'vendor_component_apply'}" ng-if="!isPcbStore"><span  ui-sref="vendor_component_apply">器件申请</span></li>-->
 
 		<!--<li ng-class="{'active' : active == 'vendor_repository'}"><span  ui-sref="vendor_repository">仓库管理</span></li>-->
 		<!--<li ng-class="{'active' : active == 'vendor_after_sale'}" class="undo">-->