suntg 8 лет назад
Родитель
Сommit
90c169936b
77 измененных файлов с 3513 добавлено и 2058 удалено
  1. 3 1
      .gitignore
  2. 29 0
      src/main/java/com/uas/platform/b2c/core/utils/RegexConstant.java
  3. 13 0
      src/main/java/com/uas/platform/b2c/core/utils/StringUtilB2C.java
  4. 4 4
      src/main/java/com/uas/platform/b2c/logistics/service/impl/InvoiceFPurchaseServiceImpl.java
  5. 29 0
      src/main/java/com/uas/platform/b2c/prod/commodity/constant/DoubleConstant.java
  6. 13 0
      src/main/java/com/uas/platform/b2c/prod/commodity/constant/IntegerConstant.java
  7. 14 0
      src/main/java/com/uas/platform/b2c/prod/commodity/constant/ShortConstant.java
  8. 0 20
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/GoodsController.java
  9. 34 8
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/ReleaseProductByBatchController.java
  10. 5 3
      src/main/java/com/uas/platform/b2c/prod/commodity/facade/impl/ProductFacadeImpl.java
  11. 167 1
      src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java
  12. 165 4
      src/main/java/com/uas/platform/b2c/prod/commodity/model/GoodsHistory.java
  13. 98 0
      src/main/java/com/uas/platform/b2c/prod/commodity/model/GoodsSimple.java
  14. 362 154
      src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java
  15. 16 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsHistoryService.java
  16. 11 12
      src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsService.java
  17. 23 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductService.java
  18. 21 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductStandardPutOnInfoService.java
  19. 2 1
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ReleaseProductByBatchService.java
  20. 68 8
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsHistoryServiceImpl.java
  21. 146 138
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java
  22. 52 2
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java
  23. 49 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductStandardPutOnInfoServiceImpl.java
  24. 349 346
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java
  25. 42 0
      src/main/java/com/uas/platform/b2c/prod/commodity/status/ReleaseBatchStatus.java
  26. 13 0
      src/main/java/com/uas/platform/b2c/prod/commodity/type/ReleaseConstant.java
  27. 59 23
      src/main/java/com/uas/platform/b2c/prod/product/component/modal/ComponentGoods.java
  28. 12 0
      src/main/java/com/uas/platform/b2c/trade/order/StringConstant/Currency.java
  29. 1 1
      src/main/java/com/uas/platform/b2c/trade/order/controller/OrderController.java
  30. 28 9
      src/main/java/com/uas/platform/b2c/trade/order/model/OrderDetail.java
  31. 12 11
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderDetailServiceImpl.java
  32. 11 4
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java
  33. 24 10
      src/main/java/com/uas/platform/b2c/trade/presale/model/Cart.java
  34. 8 3
      src/main/java/com/uas/platform/b2c/trade/presale/service/BrowsingHistoryService.java
  35. 2 2
      src/main/java/com/uas/platform/b2c/trade/presale/service/CartService.java
  36. 15 5
      src/main/java/com/uas/platform/b2c/trade/presale/service/impl/BrowsingHistoryServiceImpl.java
  37. 8 10
      src/main/java/com/uas/platform/b2c/trade/presale/service/impl/CartServiceImpl.java
  38. BIN
      src/main/resources/jxls-tpl/product/productStandarPutOn-error.xls
  39. BIN
      src/main/resources/jxls-tpl/trade/goodsImportHist-error.xls
  40. BIN
      src/main/resources/jxls-tpl/trade/releaseByBatch-rmb.xls
  41. BIN
      src/main/resources/jxls-tpl/trade/releaseByBatch.xls
  42. BIN
      src/main/resources/jxls-tpl/trade/releaseByBatchError-rmb.xls
  43. BIN
      src/main/resources/jxls-tpl/trade/releaseByBatchError-usd.xls
  44. BIN
      src/main/resources/jxls-tpl/trade/releaseByBatcherrdata.xls
  45. BIN
      src/main/resources/jxls-tpl/trade/releasebyBatch-usd.xls
  46. 4 4
      src/main/resources/spring/context.xml
  47. 1 1
      src/main/webapp/WEB-INF/web.xml
  48. BIN
      src/main/webapp/resources/img/icon/check-off.png
  49. BIN
      src/main/webapp/resources/img/icon/check-ok.png
  50. BIN
      src/main/webapp/resources/img/icon/open.png
  51. BIN
      src/main/webapp/resources/img/product/releaseByBatch-rmb.png
  52. BIN
      src/main/webapp/resources/img/product/releaseByBatch-usd.png
  53. BIN
      src/main/webapp/resources/img/user/images/select-disabled.png
  54. 2 2
      src/main/webapp/resources/js/admin/app.js
  55. 1 5
      src/main/webapp/resources/js/prod/controllers/ProductListByKindCtrl.js
  56. 57 47
      src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_cart_ctrl.js
  57. 2 2
      src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_order_ctrl.js
  58. 18 6
      src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js
  59. 199 162
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js
  60. 661 198
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_onSaleCtrl.js
  61. 1 1
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_undercarriageCtrl.js
  62. 58 13
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_upload_ctrl.js
  63. 24 5
      src/main/webapp/resources/view/usercenter/forstore/buyer_cart.html
  64. 15 5
      src/main/webapp/resources/view/usercenter/forstore/order_pay.html
  65. 63 35
      src/main/webapp/resources/view/vendor/forstore/vendor_material.html
  66. 267 386
      src/main/webapp/resources/view/vendor/forstore/vendor_onSale.html
  67. 4 3
      src/main/webapp/resources/view/vendor/forstore/vendor_undercarriage.html
  68. 141 108
      src/main/webapp/resources/view/vendor/forstore/vendor_upload.html
  69. 3 3
      src/main/webapp/resources/view/vendor/left_nav.html
  70. 84 36
      src/main/webapp/resources/view/vendor/modal/edit_goods_modal.html
  71. 0 13
      src/test/java/com/uas/platform/b2c/SpringBaseTest.java
  72. 0 22
      src/test/java/com/uas/platform/b2c/TestMailService.java
  73. 0 47
      src/test/java/com/uas/platform/b2c/api/cms/service/CarouselsServiceImplTest.java
  74. 0 56
      src/test/java/com/uas/platform/b2c/core/util/JsonUtilTest.java
  75. 0 60
      src/test/java/com/uas/platform/b2c/storecms/dao/StoreContentDaoTest.java
  76. 0 29
      src/test/java/com/uas/platform/b2c/storecms/service/StoreContentServiceTest.java
  77. 0 29
      src/test/java/com/uas/platform/b2c/trade/dao/PurchaseDaoTest.java

+ 3 - 1
.gitignore

@@ -3,6 +3,7 @@
 .settings/
 bin/
 tmp/
+test/
 *.tmp
 *.bak
 *.swp
@@ -55,4 +56,5 @@ pom.xml.versionsBackup
 pom.xml.next
 release.properties
 dependency-reduced-pom.xml
-buildNumber.properties
+buildNumber.properties
+/src/test/

+ 29 - 0
src/main/java/com/uas/platform/b2c/core/utils/RegexConstant.java

@@ -0,0 +1,29 @@
+package com.uas.platform.b2c.core.utils;
+
+/**
+ * 正则表达式的常量
+ *
+ * @author yuj 2017-09-05 11:08
+ */
+public class RegexConstant {
+
+    /**
+     * 匹配中文和英文的正则表达式
+     */
+    public static final String chineseAndEnglish = "^[\\u4e00-\\u9fa5a-zA-Z]+$";
+
+    /**
+     * 判断是否是数字
+     */
+    public static final String NumberData = "^[-+]?(([0-9]+)([.]([0-9]+))?|([.]([0-9]+))?)$";
+
+    /**
+     * 整数的正则表达式
+     */
+    public static final String Integer = "^[-\\+]?[\\d]*$";
+
+    /**
+     * 判断是否只包含数字,英文,特殊字符
+     */
+    public static final String EnglishAnDigitAndSpecialCharacter = "^[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】_\\-‘;:”“’。,、?A-Za-z0-9]+$";
+}

+ 13 - 0
src/main/java/com/uas/platform/b2c/core/utils/StringUtilB2C.java

@@ -9,6 +9,8 @@ import org.apache.commons.collections.CollectionUtils;
 import org.springframework.util.StringUtils;
 
 import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * B2C项目专用字符串工具方法
@@ -230,4 +232,15 @@ public class StringUtilB2C {
 		}
 		return str.trim();
 	}
+
+	public static String replaceLineBreak(String str) {
+		Pattern p = Pattern.compile("\\s*|\t|\r|\n");
+		Matcher m = p.matcher(str);
+		str = m.replaceAll("");
+		return str;
+	}
+
+	public static boolean isEmpty(Object str) {
+		return (str == null || "".equals(str) || "null".equals(str));
+	}
 }

+ 4 - 4
src/main/java/com/uas/platform/b2c/logistics/service/impl/InvoiceFPurchaseServiceImpl.java

@@ -340,10 +340,10 @@ public class InvoiceFPurchaseServiceImpl implements InvoiceFPurchaseService {
 		}
 
 		//从标准品中做出库动作
-		ResultMap resultMap = productService.deductRepositoryQty(purchase);
-		if(resultMap.getCode() != CodeType.OK.code()) {
-			return resultMap;
-		}
+//		ResultMap resultMap = productService.deductRepositoryQty(purchase);
+//		if(resultMap.getCode() != CodeType.OK.code()) {
+//			return resultMap;
+//		}
 
 		return ResultMap.success(inFpu);
 	}

+ 29 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/constant/DoubleConstant.java

@@ -0,0 +1,29 @@
+package com.uas.platform.b2c.prod.commodity.constant;
+
+/**
+ * 浮点数的常量
+ *
+ * @author yuj 2017-09-11 21:30
+ */
+public class DoubleConstant {
+
+    /**
+     * 最大库存
+     */
+    public static final Double maxReserve = 999999999d;
+
+    /**
+     * double 最小的正整数
+     */
+    public static final Double minReserve = 1d;
+
+    /**
+     * 0.0
+     */
+    public static final Double zero = 0.0d;
+
+    /**
+     * 最小包装量的最大值
+     */
+    public static final Double maxMinPackageQty = 999999d;
+}

+ 13 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/constant/IntegerConstant.java

@@ -0,0 +1,13 @@
+package com.uas.platform.b2c.prod.commodity.constant;
+
+/**
+ * integer 的常量
+ *
+ * @author yuj 2017-09-02 22:48
+ */
+public class IntegerConstant {
+
+    public static final Integer B2C_SALE = 2;
+
+    public static final Integer SELF_SALE = 1;
+}

+ 14 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/constant/ShortConstant.java

@@ -0,0 +1,14 @@
+package com.uas.platform.b2c.prod.commodity.constant;
+
+/**
+ * Short常量的调整
+ *
+ * @author yuj 2017-09-11 19:30
+ */
+public class ShortConstant {
+
+    /**
+     * 最长交期
+     */
+    public static final Short maxDelivery = 31;
+}

+ 0 - 20
src/main/java/com/uas/platform/b2c/prod/commodity/controller/GoodsController.java

@@ -246,26 +246,6 @@ public class GoodsController {
 		logger.log("商品批次", "下架对应的批次" + batchCodes + ",操作者是:" + SystemSession.getUser().getUserUU() + "-" + SystemSession.getUser().getUserName());
 	}
 
-    /**
-     * 获取批量发布商品的模板(大量)
-     *
-     * @param uuids the uuids 器件的uuid
-     * @return model and view
-     */
-    @RequestMapping(value = "/release/template", method = RequestMethod.GET)
-	public ModelAndView exportOrderses(String uuids) {
-		ModelAndView modelAndView = new ModelAndView();
-		// List<ReleaseProductByBatch> releaseProductByBatchs =
-		// releaseProductByBatchService.findByUuids(productuuids);
-		// modelAndView.addObject("releaseProductByBatchs",
-		// releaseProductByBatchs);
-		List<ComponentInfo> components = componentService.findInfoByUuids(uuids);
-		modelAndView.addObject("components", components);
-		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/trade/releaseByBatch", "优软商城"));
-		logger.log("商品批次", "下载批量上架商品的Excel模板");
-		return modelAndView;
-	}
-
     /**
      * 通过导入Excel批量发布商品
      *

+ 34 - 8
src/main/java/com/uas/platform/b2c/prod/commodity/controller/ReleaseProductByBatchController.java

@@ -1,17 +1,18 @@
 package com.uas.platform.b2c.prod.commodity.controller;
 
+import com.uas.platform.b2c.common.base.model.FileUpload;
+import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
+import com.uas.platform.b2c.core.support.view.JxlsExcelView;
+import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.prod.commodity.dao.ReleaseProductByBatchDao;
 import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
 import com.uas.platform.b2c.prod.commodity.model.ReleaseProductByBatch;
 import com.uas.platform.b2c.prod.commodity.service.ReleaseProductByBatchService;
-import com.uas.platform.b2c.common.base.model.FileUpload;
 import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
 import com.uas.platform.b2c.prod.product.brand.service.BrandService;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
 import com.uas.platform.b2c.prod.product.component.modal.Component;
-import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
-import com.uas.platform.b2c.core.utils.FastjsonUtils;
-import com.uas.platform.b2c.core.support.view.JxlsExcelView;
+import com.uas.platform.b2c.trade.order.StringConstant.Currency;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.model.PageInfo;
@@ -187,7 +188,7 @@ public class ReleaseProductByBatchController {
      * @return model map
      */
     @RequestMapping(value = "/release/excel", method = RequestMethod.POST)
-    public ModelMap releaseByExcel(FileUpload uploadItem, @RequestParam("selfSale") Boolean selfSale) {
+    public ModelMap releaseByExcel(FileUpload uploadItem, @RequestParam("selfSale") Boolean selfSale, String currency) {
         ModelMap map = new ModelMap();
         String fileName = uploadItem.getFile().getOriginalFilename();
         String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
@@ -202,7 +203,7 @@ public class ReleaseProductByBatchController {
             } else {
                 throw new IllegalOperatorException("文件格不正确,请上传.xls或.xlsx的文件");
             }
-            map = releaseProductByBatchService.releaseByWorkbook(workbook, selfSale);
+            map = releaseProductByBatchService.releaseByWorkbook(workbook, selfSale, currency);
         } catch (IOException e) {
             e.printStackTrace();
         }
@@ -233,7 +234,7 @@ public class ReleaseProductByBatchController {
      * @return model and view
      */
     @RequestMapping(value = "/release/failure/xls", method = RequestMethod.GET)
-    public ModelAndView exportOrderses(String batch, HttpServletRequest request, @RequestParam(defaultValue = "false") Boolean isAjax) {
+    public ModelAndView exportOrderses(String batch, HttpServletRequest request, @RequestParam(defaultValue = "false") Boolean isAjax, String currency) {
         ModelAndView modelAndView = new ModelAndView();
         HttpSession session = request.getSession();
         Object loading = session.getAttribute("load-error-ing");
@@ -253,9 +254,34 @@ public class ReleaseProductByBatchController {
             session.setAttribute("load-error-ing", true);
         }
         modelAndView.addObject("data", releaseProductByBatchService.findFailureReleaseProductByBatch(batch));
-        modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/trade/releaseByBatcherrdata", "优软商城批量发布匹配不正确的产品"));
+        String url ="";
+        if(Currency.USD.equals(currency)) {
+            url = "classpath:jxls-tpl/trade/releaseByBatchError-usd";
+        }else {
+            url = "classpath:jxls-tpl/trade/releaseByBatchError-rmb";
+        }
+        modelAndView.setView(new JxlsExcelView(url, "优软商城批量发布匹配不正确的产品"));
         logger.log("批量上架模块", "以Excel形式导出批量上架商品匹配不合格的数据");
         session.setAttribute("load-error-ing", false);
         return modelAndView;
     }
+
+    /**
+     * 获取批量发布商品的模板(大量)
+     *
+     * @param currency
+     * @return model and view
+     */
+    @RequestMapping(value = "/release/template", method = RequestMethod.GET)
+    public ModelAndView exportOrderses(String currency) {
+        ModelAndView modelAndView = new ModelAndView();
+        if(Currency.USD.equals(currency)) {
+            modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/trade/releasebyBatch-usd", "优软商城库存上传模板"));
+        }else {
+            modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/trade/releaseByBatch-rmb", "优软商城库存上传模板"));
+        }
+
+        logger.log("商品批次", "下载批量上架商品的Excel模板");
+        return modelAndView;
+    }
 }

+ 5 - 3
src/main/java/com/uas/platform/b2c/prod/commodity/facade/impl/ProductFacadeImpl.java

@@ -1,17 +1,18 @@
 package com.uas.platform.b2c.prod.commodity.facade.impl;
 
 import com.uas.platform.b2c.common.account.model.Enterprise;
+import com.uas.platform.b2c.core.config.SysConf;
+import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
 import com.uas.platform.b2c.prod.commodity.facade.ProductFacade;
 import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.prod.commodity.model.Product;
 import com.uas.platform.b2c.prod.commodity.service.GoodsService;
-import com.uas.platform.b2c.core.config.SysConf;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
 import com.uas.platform.b2c.prod.product.component.modal.Component;
 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.core.support.SystemSession;
 import com.uas.platform.b2c.trade.support.CodeType;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -68,7 +69,8 @@ public class ProductFacadeImpl implements ProductFacade {
 		if (isSelfSupport) {
 			Enterprise enterprise = SystemSession.getUser().getEnterprise();
 			assert enterprise != null;
-			store = storeInService.findByEnUU(enterprise.getUu());
+			StoreIn storeIn = storeInService.findByEnUU(enterprise.getUu());
+			store = storeIn.getStatus() == StoreStatus.OPENED ? storeIn : null;
 		} else {
 			store = storeInService.findByUuid(sysConf.getStoreid());
 		}

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

@@ -396,6 +396,55 @@ public class Goods implements Serializable {
 	@Column(name = "go_b2cmindelivery")
 	private Short b2cMinDelivery;
 
+	/**
+	 * 用户自己填写的大陆最大交期
+	 */
+	@Column(name = "go_selfdeliverydemaxtime")
+	private Short selfDeliveryDemMaxTime;
+
+	/**
+	 * 用户自己填写大陆的最小交期
+	 */
+	@Column(name = "go_selfdeliverydemintime")
+	private Short selfDeliveryDemMinTime;
+
+	/**
+	 * 用户自己香港填写的最大交期
+	 */
+	@Column(name = "go_selfdeliveryhkmaxtime")
+	private Short selfDeliveryHKMaxTime;
+
+	/**
+	 * 用户自己香港填写的最小交期
+	 */
+	@Column(name = "go_selfdeliveryhkmintime")
+	private Short selfDeliveryHKMinTime;
+
+	/**
+	 * 商城送货到大陆最长交期
+	 */
+	@Column(name = "go_deliverydemaxtime")
+	private Short b2cDeliveryDemMaxTime;
+
+	/**
+	 * 商城送货到大陆最短交期
+	 */
+	@Column(name = "go_deliverydemintime")
+	private Short b2cDeliveryDemMinTime;
+
+
+	/**
+	 * 商城送货到香港最长交期
+	 */
+	@Column(name = "go_deliveryhkmaxtime")
+	private Short b2cDeliveryHKMaxTime;
+
+	/**
+	 * 商城送货到香港最小交期
+	 */
+	@Column(name = "go_deliveryhkmintime")
+	private Short b2cDeliveryHKMinTime;
+
 	/**
 	 * 产品主键
 	 */
@@ -415,6 +464,18 @@ public class Goods implements Serializable {
 	@Column(name = "go_lastreserve")
 	private Double lastReserve;
 
+	/**
+	 * 是否拆卖
+	 */
+	@Column(name = "go_isbreakup")
+	private Boolean breakUp;
+
+	/**
+	 * 每次加减单位数量,可拆卖,等于1,不可拆卖 等于最小包数量
+	 */
+	@Column(name= "go_perqty")
+	private Double perQty;
+
 	@Transient
 	private String selfSale;
 
@@ -582,6 +643,16 @@ public class Goods implements Serializable {
 		this.reserve = reserve;
 	}
 
+	public void setReserve(Goods goods) {
+		if(NumberUtil.compare(this.reserve, goods.getReserve()) != 0) {
+			this.lastReserve = goods.getReserve();
+		}
+		if(this.lastReserve == null) {
+			this.lastReserve = goods.getReserve();
+		}
+		this.reserve = goods.getReserve();
+	}
+
 	public Double getOldReserve() {
 		return oldReserve;
 	}
@@ -797,7 +868,79 @@ public class Goods implements Serializable {
 		return this;
 	}
 
-	public Short getMaxDelivery() {
+    public Short getSelfDeliveryDemMaxTime() {
+        return selfDeliveryDemMaxTime;
+    }
+
+    public Goods setSelfDeliveryDemMaxTime(Short selfDeliveryDemMaxTime) {
+        this.selfDeliveryDemMaxTime = selfDeliveryDemMaxTime;
+        return this;
+    }
+
+    public Short getSelfDeliveryDemMinTime() {
+        return selfDeliveryDemMinTime;
+    }
+
+    public Goods setSelfDeliveryDemMinTime(Short selfDeliveryDemMinTime) {
+        this.selfDeliveryDemMinTime = selfDeliveryDemMinTime;
+        return this;
+    }
+
+    public Short getSelfDeliveryHKMaxTime() {
+        return selfDeliveryHKMaxTime;
+    }
+
+    public Goods setSelfDeliveryHKMaxTime(Short selfDeliveryHKMaxTime) {
+        this.selfDeliveryHKMaxTime = selfDeliveryHKMaxTime;
+        return this;
+    }
+
+    public Short getSelfDeliveryHKMinTime() {
+        return selfDeliveryHKMinTime;
+    }
+
+    public Goods setSelfDeliveryHKMinTime(Short selfDeliveryHKMinTime) {
+        this.selfDeliveryHKMinTime = selfDeliveryHKMinTime;
+        return this;
+    }
+
+    public Short getB2cDeliveryDemMaxTime() {
+        return b2cDeliveryDemMaxTime;
+    }
+
+    public Goods setB2cDeliveryDemMaxTime(Short b2cDeliveryDemMaxTime) {
+        this.b2cDeliveryDemMaxTime = b2cDeliveryDemMaxTime;
+        return this;
+    }
+
+    public Short getB2cDeliveryDemMinTime() {
+        return b2cDeliveryDemMinTime;
+    }
+
+    public Goods setB2cDeliveryDemMinTime(Short b2cDeliveryDemMinTime) {
+        this.b2cDeliveryDemMinTime = b2cDeliveryDemMinTime;
+        return this;
+    }
+
+    public Short getB2cDeliveryHKMaxTime() {
+        return b2cDeliveryHKMaxTime;
+    }
+
+    public Goods setB2cDeliveryHKMaxTime(Short b2cDeliveryHKMaxTime) {
+        this.b2cDeliveryHKMaxTime = b2cDeliveryHKMaxTime;
+        return this;
+    }
+
+    public Short getB2cDeliveryHKMinTime() {
+        return b2cDeliveryHKMinTime;
+    }
+
+    public Goods setB2cDeliveryHKMinTime(Short b2cDeliveryHKMinTime) {
+        this.b2cDeliveryHKMinTime = b2cDeliveryHKMinTime;
+        return this;
+    }
+
+    public Short getMaxDelivery() {
 		return maxDelivery;
 	}
 
@@ -833,6 +976,15 @@ public class Goods implements Serializable {
 		return this;
 	}
 
+	public Boolean getBreakUp() {
+		return breakUp;
+	}
+
+	public Goods setBreakUp(Boolean breakUp) {
+		this.breakUp = breakUp;
+		return this;
+	}
+
 	/**************************************************************************
 	 * Property Method
 	 **************************************************************************/
@@ -1252,4 +1404,18 @@ public class Goods implements Serializable {
 		}
 		return true;
 	}
+
+	public Double getPerQty() {
+		return perQty;
+	}
+
+	public Goods setPerQty(Double perQty) {
+		this.perQty = perQty;
+		return this;
+	}
+
+	public Goods setPerQty() {
+		this.perQty = (this.breakUp != null && this.breakUp) ? 1d : this.minPackQty;
+		return this;
+	}
 }

+ 165 - 4
src/main/java/com/uas/platform/b2c/prod/commodity/model/GoodsHistory.java

@@ -307,6 +307,54 @@ public class GoodsHistory {
 	@Column(name = "go_b2cmindelivery")
 	private Short b2cMinDelivery;
 
+	/**
+	 * 自己送货到大陆最短时间
+	 */
+	@Column(name = "go_selfdeliverydemintime")
+	private Short selfDeliveryDemMinTime;
+
+	/**
+	 * 自己送货到大陆最长时间
+	 */
+	@Column(name = "go_selfdeliverydemaxtime")
+	private Short selfDeliveryDemMaxTime;
+
+	/**
+	 * 自己送货到香港最长时间
+	 */
+	@Column(name = "go_selfdeliveryhkmaxtime")
+	private Short selfDeliveryHKMaxTime;
+
+	/**
+	 * 自己送货到香港最短时间
+	 */
+	@Column(name = "go_selfdeliveryhkmintime")
+	private Short selftDeliveryHKMinTime;
+
+	/**
+	 * 商城送货到大陆最长时间
+	 */
+	@Column(name = "go_b2cdeliverydemaxtime")
+	private Short b2cDeliveryDemMaxTime;
+
+	/**
+	 * 商城送货到大陆最短时间
+	 */
+	@Column(name = "go_b2cdeliverydemintime")
+	private Short b2cDeliveryDemMinTime;
+
+	/**
+	 * 商城送货到香港最长时间
+	 */
+	@Column(name = "go_b2cdeliveryhkmaxtime")
+	private Short b2cDeliveryHKMaxTime;
+
+	/**
+	 * 商城送货到香港最短时间
+	 */
+	@Column(name = "go_b2cdeliveryhkmintime")
+	private Short b2cDeliveryHKMinTime;
+
 	/**
 	 * 产品主键
 	 */
@@ -326,6 +374,18 @@ public class GoodsHistory {
 	@Column(name = "go_lastreserve")
 	private Double lastReserve;
 
+	/**
+	 * 每次加减单位数量,可拆卖,等于1,不可拆卖 等于最小包数量
+	 */
+	@Column(name = "go_perQty")
+	private Double perQty;
+
+	/**
+	 * 是否可拆卖
+	 */
+	@Column(name = "go_breakup")
+	private Boolean breakUp;
+
 	/**
 	 * 分段价格
 	 */
@@ -923,12 +983,113 @@ public class GoodsHistory {
         this.rmbTaxRate = goods.getRmbTaxRate();
         this.usdTaxRate = goods.getUsdTaxRate();
         this.shipArea = goods.getShipArea();
-        this.maxDelivery = goods.getMaxDelivery();
-        this.minDelivery = goods.getMinDelivery();
-		this.b2cMaxDelivery = goods.getB2cMaxDelivery();
-		this.b2cMinDelivery = goods.getB2cMinDelivery();
 		this.productid = goods.getProductid();
 		this.standprodid = goods.getStandprodid();
 		this.lastReserve = goods.getLastReserve();
+		this.b2cDeliveryDemMaxTime = goods.getB2cDeliveryDemMaxTime();
+		this.b2cDeliveryDemMinTime = goods.getB2cDeliveryDemMinTime();
+		this.b2cDeliveryHKMaxTime = goods.getB2cDeliveryHKMaxTime();
+		this.b2cDeliveryHKMinTime = goods.getB2cDeliveryHKMinTime();
+		this.selfDeliveryDemMaxTime = goods.getSelfDeliveryDemMaxTime();
+		this.selfDeliveryDemMinTime = goods.getSelfDeliveryDemMinTime();
+		this.selfDeliveryHKMaxTime = goods.getSelfDeliveryHKMaxTime();
+		this.selftDeliveryHKMinTime = goods.getSelfDeliveryHKMinTime();
+		this.maxDelivery = goods.getMaxDelivery();
+		this.minDelivery = goods.getMinDelivery();
+		this.b2cMaxDelivery = goods.getB2cMaxDelivery();
+		this.b2cMinDelivery = goods.getB2cMinDelivery();
+		this.updateDate = new Date();
+		this.perQty = goods.getPerQty();
+		this.breakUp = goods.getBreakUp();
     }
+
+	public Short getSelfDeliveryDemMinTime() {
+		return selfDeliveryDemMinTime;
+	}
+
+	public GoodsHistory setSelfDeliveryDemMinTime(Short selfDeliveryDemMinTime) {
+		this.selfDeliveryDemMinTime = selfDeliveryDemMinTime;
+		return this;
+	}
+
+	public Short getSelfDeliveryDemMaxTime() {
+		return selfDeliveryDemMaxTime;
+	}
+
+	public GoodsHistory setSelfDeliveryDemMaxTime(Short selfDeliveryDemMaxTime) {
+		this.selfDeliveryDemMaxTime = selfDeliveryDemMaxTime;
+		return this;
+	}
+
+	public Short getSelfDeliveryHKMaxTime() {
+		return selfDeliveryHKMaxTime;
+	}
+
+	public GoodsHistory setSelfDeliveryHKMaxTime(Short selfDeliveryHKMaxTime) {
+		this.selfDeliveryHKMaxTime = selfDeliveryHKMaxTime;
+		return this;
+	}
+
+	public Short getSelftDeliveryHKMinTime() {
+		return selftDeliveryHKMinTime;
+	}
+
+	public GoodsHistory setSelftDeliveryHKMinTime(Short selftDeliveryHKMinTime) {
+		this.selftDeliveryHKMinTime = selftDeliveryHKMinTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryDemMaxTime() {
+		return b2cDeliveryDemMaxTime;
+	}
+
+	public GoodsHistory setB2cDeliveryDemMaxTime(Short b2cDeliveryDemMaxTime) {
+		this.b2cDeliveryDemMaxTime = b2cDeliveryDemMaxTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryDemMinTime() {
+		return b2cDeliveryDemMinTime;
+	}
+
+	public GoodsHistory setB2cDeliveryDemMinTime(Short b2cDeliveryDemMinTime) {
+		this.b2cDeliveryDemMinTime = b2cDeliveryDemMinTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryHKMaxTime() {
+		return b2cDeliveryHKMaxTime;
+	}
+
+	public GoodsHistory setB2cDeliveryHKMaxTime(Short b2cDeliveryHKMaxTime) {
+		this.b2cDeliveryHKMaxTime = b2cDeliveryHKMaxTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryHKMinTime() {
+		return b2cDeliveryHKMinTime;
+	}
+
+	public GoodsHistory setB2cDeliveryHKMinTime(Short b2cDeliveryHKMinTime) {
+		this.b2cDeliveryHKMinTime = b2cDeliveryHKMinTime;
+		return this;
+	}
+
+	public Double getPerQty() {
+		return perQty;
+	}
+
+	public GoodsHistory setPerQty(Double perQty) {
+		this.perQty = perQty;
+		return this;
+	}
+
+	public Boolean getBreakUp() {
+		return breakUp;
+	}
+
+	public GoodsHistory setBreakUp(Boolean breakUp) {
+		this.breakUp = breakUp;
+		return this;
+	}
 }

+ 98 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/GoodsSimple.java

@@ -62,6 +62,31 @@ public class GoodsSimple {
 	 */
 	@Column(name = "go_b2cmindelivery")
 	private Short b2cMinDelivery;
+
+	/**
+	 * 商城送货到大陆最长交期
+	 */
+	@Column(name = "go_deliverydemaxtime")
+	private Short b2cDeliveryDemMaxTime;
+
+	/**
+	 * 商城送货到大陆最短交期
+	 */
+	@Column(name = "go_deliverydemintime")
+	private Short b2cDeliveryDemMinTime;
+
+
+	/**
+	 * 商城送货到香港最长交期
+	 */
+	@Column(name = "go_deliveryhkmaxtime")
+	private Short b2cDeliveryHKMaxTime;
+
+	/**
+	 * 商城送货到香港最小交期
+	 */
+	@Column(name = "go_deliveryhkmintime")
+	private Short b2cDeliveryHKMinTime;
 	
 	/**
 	 * 大陆交期[供应商送平台的时间]
@@ -184,6 +209,18 @@ public class GoodsSimple {
 	@Column(name = "go_lastreserve")
 	private Double lastReserve;
 
+	/**
+	 * 每次加减单位数量,可拆卖,等于1,不可拆卖 等于最小包数量
+	 */
+	@Column(name = "go_perqty")
+	private Double perQty;
+
+	/**
+	 * 是否拆卖
+	 */
+	@Column(name = "go_isbreakup")
+	private Boolean breakUp;
+
 	/**
 	 * 包装
 	 */
@@ -515,6 +552,10 @@ public class GoodsSimple {
 		this.qtyPrice = goods.getQtyPrice();
 		this.b2cMaxDelivery = goods.getB2cMaxDelivery();
 		this.b2cMinDelivery = goods.getB2cMinDelivery();
+		this.b2cDeliveryDemMaxTime = goods.getB2cDeliveryDemMaxTime();
+		this.b2cDeliveryDemMinTime = goods.getB2cDeliveryDemMinTime();
+		this.b2cDeliveryHKMaxTime = goods.getB2cDeliveryHKMaxTime();
+		this.b2cDeliveryHKMinTime = goods.getB2cDeliveryHKMinTime();
 		this.produceDate = goods.getProduceDate();
 		this.createdDate = goods.getCreatedDate();
 		this.reserve = goods.getReserve();
@@ -532,7 +573,64 @@ public class GoodsSimple {
 		this.img = goods.getImg();
 		this.lastReserve = goods.getLastReserve();
 		this.status = goods.getStatus();
+		this.perQty = goods.getPerQty();
+		this.breakUp = goods.getBreakUp();
+	}
+
+	public Short getB2cDeliveryDemMaxTime() {
+		return b2cDeliveryDemMaxTime;
+	}
+
+	public GoodsSimple setB2cDeliveryDemMaxTime(Short b2cDeliveryDemMaxTime) {
+		this.b2cDeliveryDemMaxTime = b2cDeliveryDemMaxTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryDemMinTime() {
+		return b2cDeliveryDemMinTime;
+	}
+
+	public GoodsSimple setB2cDeliveryDemMinTime(Short b2cDeliveryDemMinTime) {
+		this.b2cDeliveryDemMinTime = b2cDeliveryDemMinTime;
+		return this;
 	}
+
+	public Short getB2cDeliveryHKMaxTime() {
+		return b2cDeliveryHKMaxTime;
+	}
+
+	public GoodsSimple setB2cDeliveryHKMaxTime(Short b2cDeliveryHKMaxTime) {
+		this.b2cDeliveryHKMaxTime = b2cDeliveryHKMaxTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryHKMinTime() {
+		return b2cDeliveryHKMinTime;
+	}
+
+	public GoodsSimple setB2cDeliveryHKMinTime(Short b2cDeliveryHKMinTime) {
+		this.b2cDeliveryHKMinTime = b2cDeliveryHKMinTime;
+		return this;
+	}
+
+	public Double getPerQty() {
+		return perQty;
+	}
+
+	public GoodsSimple setPerQty(Double perQty) {
+		this.perQty = perQty;
+		return this;
+	}
+
+	public Boolean getBreakUp() {
+		return breakUp;
+	}
+
+	public GoodsSimple setBreakUp(Boolean breakUp) {
+		this.breakUp = breakUp;
+		return this;
+	}
+
 	/*
 	 * public GoodsSimpleUas converUas(){ GoodsSimpleUas uas = new
 	 * GoodsSimpleUas(); uas.setBatchCode(this.batchCode);

+ 362 - 154
src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java

@@ -2,19 +2,13 @@ package com.uas.platform.b2c.prod.commodity.model;
 
 import com.alibaba.fastjson.annotation.JSONField;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
-import com.uas.platform.core.exception.IllegalOperatorException;
+import com.uas.platform.b2c.core.utils.StringUtilB2C;
+import com.uas.platform.b2c.trade.order.StringConstant.Currency;
 import org.apache.commons.collections.CollectionUtils;
 import org.codehaus.jackson.annotate.JsonIgnore;
 import org.springframework.util.StringUtils;
 
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.SequenceGenerator;
-import javax.persistence.Table;
-import javax.persistence.Transient;
+import javax.persistence.*;
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.ArrayList;
@@ -103,12 +97,24 @@ public class ReleaseProductByBatch implements Serializable {
 	@Column(name = "rel_publishreserve")
 	private Double reserve;
 
+	/**
+	 * 发布库存量的字符串
+	 */
+	@Column(name = "rel_publishreservestr")
+	private String reserveStr;
+
 	/**
 	 * 最小起定量
 	 */
 	@Column(name = "rel_minbuyqty")
 	private Double minBuyQty;
 
+	/**
+	 * 最小起定量String 类型
+	 */
+	@Column(name = "rel_minbuyqtystr")
+	private String minBuyQtyStr;
+
 	/**
 	 * 分段报价(JSON串) eg:[{"start":0,"end":1000,"price":2.3,"taxPrice":2.5},...]
 	 */
@@ -139,6 +145,24 @@ public class ReleaseProductByBatch implements Serializable {
 	@Column(name = "rel_minpackage")
 	private Double minPackage;
 
+	/**
+	 * 产品最小包装量
+	 */
+	@Column(name = "rel_minpackagestr")
+	private String minPackageStr;
+
+	/**
+	 * 是否可拆卖
+	 */
+	@Column(name = "rel_breakup")
+	private Boolean breakUp;
+
+	/**
+	 * 是否
+	 */
+	@Column(name = "rel_breakupstr")
+	private String breakUpStr;
+
 	/**
 	 * 包装:托盘、管装、卷带
 	 */
@@ -152,16 +176,64 @@ public class ReleaseProductByBatch implements Serializable {
 	private String encapsulation;
 
 	/**
-	 * 商城最长交期
+	 * 自己填写最长交期
+	 */
+	@Column(name = "rel_selfmaxdelivery")
+	private Short selfMaxDelivery;
+
+	/**
+	 * 自己填写最短交期
 	 */
-	@Column(name = "go_b2cmaxdelivery")
-	private Short b2cMaxDelivery;
+	@Column(name = "rel_selfmindelivery")
+	private Short selfMinDelivery;
 
 	/**
-	 * 商城最短交期
+	 * 自己填写最长交期 String
 	 */
-	@Column(name = "go_b2cmindelivery")
-	private Short b2cMinDelivery;
+	@Column(name = "rel_selfmaxdeliverystr")
+	private String selfMaxDeliveryStr;
+
+	/**
+	 * 自己填写最短交期 String
+	 */
+	@Column(name = "rel_selfmindeliverystr")
+	private String selfMinDeliveryStr;
+
+//	/**
+//	 * 商城最长交期
+//	 */
+//	@Column(name = "go_b2cmaxdelivery")
+//	private Short b2cMaxDelivery;
+//
+//	/**
+//	 * 商城最短交期
+//	 */
+//	@Column(name = "go_b2cmindelivery")
+//	private Short b2cMinDelivery;
+//
+//	/**
+//	 * 用户填写的大陆最长交期
+//	 */
+//	@Column(name = "rel_maxdeliverydemtime")
+//	private Short deliveryDemMaxTime;
+//
+//	/**
+//	 * 用户填写的大陆最短交期
+//	 */
+//	@Column(name = "rel_mindeliverydemtime")
+//	private Short deliveryDemMinTime;
+//
+//	/**
+//	 * 用户填写的香港最短交期
+//	 */
+//	@Column(name = "rel_mindeliveryhktime")
+//	private Short deliveryHKMinTime;
+//
+//	/**
+//	 * 用户填写的香港最长交期
+//	 */
+//	@Column(name = "rel_maxdeliveryhktime")
+//	private Short deliveryHKMaxTime;
 
 	/**
 	 * 备注
@@ -219,7 +291,7 @@ public class ReleaseProductByBatch implements Serializable {
 
 	/**
 	 * 发布状态编号
-	 * 
+	 *  101 已发布 111 关键信息字段缺失 121 匹配时找不到对应的信息
 	 * @return
 	 */
 	@Column(name = "rel_releasecode")
@@ -251,6 +323,12 @@ public class ReleaseProductByBatch implements Serializable {
 	@Column(name = "rel_usdprice")
 	private Double usdMinPackPrice;
 
+	/**
+	 * 最小包价格String 类型
+	 */
+	@Column(name = "rel_minpackpricestr")
+	private String minPackPriceStr;
+
 	/**
 	 * 图片path,便于发布
 	 */
@@ -269,32 +347,41 @@ public class ReleaseProductByBatch implements Serializable {
 	@Column(name = "rel_kind_uuid")
 	private Long kindUuid;
 
-	@Transient
-	private Double seg1qty;
-
-	@Transient
-	private Double seg1RMBPrice;
-
-	@Transient
-	private Double seg1USDPrice;
-
-	@Transient
-	private Double seg2qty;
+	/**
+	 * 第一个分段数量
+	 */
+	@Column(name = "rel_qty1str")
+	private String qty1Str;
 
-	@Transient
-	private Double seg2RMBPrice;
+	/**
+	 * 第二个分段数量
+	 */
+	@Column(name = "rel_qty2str")
+	private String qty2Str;
 
-	@Transient
-	private Double seg2USDPrice;
+	/**
+	 * 第三个分段数量
+	 */
+	@Column(name = "rel_qty3str")
+	private String qty3Str;
 
-	@Transient
-	private Double seg3qty;
+	/**
+	 * 第一个分段的价格
+	 */
+	@Column(name = "rel_price1")
+	private String price1;
 
-	@Transient
-	private Double seg3RMBPrice;
+	/**
+	 * 第二个分段的价格
+	 */
+	@Column(name = "rel_price2")
+	private String price2;
 
-	@Transient
-	private Double seg3USDPrice;
+	/**
+	 * 第三个分段的价格
+	 */
+	@Column(name = "rel_price3")
+	private String price3;
 
 	/**
 	 * 错误的信息
@@ -426,76 +513,58 @@ public class ReleaseProductByBatch implements Serializable {
 		this.unit = unit;
 	}
 
-	public Double getSeg1qty() {
-		return seg1qty;
+	public String getQty1Str() {
+		return qty1Str;
 	}
 
-	public void setSeg1qty(Double seg1qty) {
-		this.seg1qty = seg1qty;
-	}
-
-	public Double getSeg1RMBPrice() {
-		return seg1RMBPrice;
-	}
-
-	public void setSeg1RMBPrice(Double seg1rmbPrice) {
-		seg1RMBPrice = seg1rmbPrice;
-	}
-
-	public Double getSeg1USDPrice() {
-		return seg1USDPrice;
-	}
-
-	public void setSeg1USDPrice(Double seg1usdPrice) {
-		seg1USDPrice = seg1usdPrice;
-	}
-
-	public Double getSeg2qty() {
-		return seg2qty;
-	}
-
-	public void setSeg2qty(Double seg2qty) {
-		this.seg2qty = seg2qty;
+	public ReleaseProductByBatch setQty1Str(String qty1Str) {
+		this.qty1Str = qty1Str;
+		return this;
 	}
 
-	public Double getSeg2RMBPrice() {
-		return seg2RMBPrice;
+	public String getQty2Str() {
+		return qty2Str;
 	}
 
-	public void setSeg2RMBPrice(Double seg2rmbPrice) {
-		seg2RMBPrice = seg2rmbPrice;
+	public ReleaseProductByBatch setQty2Str(String qty2Str) {
+		this.qty2Str = qty2Str;
+		return this;
 	}
 
-	public Double getSeg2USDPrice() {
-		return seg2USDPrice;
+	public String getQty3Str() {
+		return qty3Str;
 	}
 
-	public void setSeg2USDPrice(Double seg2usdPrice) {
-		seg2USDPrice = seg2usdPrice;
+	public ReleaseProductByBatch setQty3Str(String qty3Str) {
+		this.qty3Str = qty3Str;
+		return this;
 	}
 
-	public Double getSeg3qty() {
-		return seg3qty;
+	public String getPrice1() {
+		return price1;
 	}
 
-	public void setSeg3qty(Double seg3qty) {
-		this.seg3qty = seg3qty;
+	public ReleaseProductByBatch setPrice1(String price1) {
+		this.price1 = price1;
+		return this;
 	}
 
-	public Double getSeg3RMBPrice() {
-		return seg3RMBPrice;
+	public String getPrice2() {
+		return price2;
 	}
 
-	public void setSeg3RMBPrice(Double seg3rmbPrice) {
-		seg3RMBPrice = seg3rmbPrice;
+	public ReleaseProductByBatch setPrice2(String price2) {
+		this.price2 = price2;
+		return this;
 	}
 
-	public Double getSeg3USDPrice() {
-		return seg3USDPrice;
+	public String getPrice3() {
+		return price3;
 	}
 
-	public void setSeg3USDPrice(Double seg3usdPrice) {
-		seg3USDPrice = seg3usdPrice;
+	public ReleaseProductByBatch setPrice3(String price3) {
+		this.price3 = price3;
+		return this;
 	}
 
 	public String getRelbatchid() {
@@ -617,21 +686,21 @@ public class ReleaseProductByBatch implements Serializable {
 		this.publisherName = publisherName;
 	}
 
-	public Short getB2cMaxDelivery() {
-		return b2cMaxDelivery;
-	}
-
-	public void setB2cMaxDelivery(Short b2cMaxDelivery) {
-		this.b2cMaxDelivery = b2cMaxDelivery;
-	}
-
-	public Short getB2cMinDelivery() {
-		return b2cMinDelivery;
-	}
-
-	public void setB2cMinDelivery(Short b2cMinDelivery) {
-		this.b2cMinDelivery = b2cMinDelivery;
-	}
+//	public Short getB2cMaxDelivery() {
+//		return b2cMaxDelivery;
+//	}
+//
+//	public void setB2cMaxDelivery(Short b2cMaxDelivery) {
+//		this.b2cMaxDelivery = b2cMaxDelivery;
+//	}
+//
+//	public Short getB2cMinDelivery() {
+//		return b2cMinDelivery;
+//	}
+//
+//	public void setB2cMinDelivery(Short b2cMinDelivery) {
+//		this.b2cMinDelivery = b2cMinDelivery;
+//	}
 
 	public Long getPublisherUu() {
 		return publisherUu;
@@ -819,16 +888,16 @@ public class ReleaseProductByBatch implements Serializable {
 	@JsonIgnore
 	@JSONField(serialize = false)
 	public String getDeliveryHKTime() {
-		Short maxdeliveryHKTime = getB2cMaxDelivery();
-		Short mindeliveryHKTime = getB2cMinDelivery();
-		if(maxdeliveryHKTime == null || mindeliveryHKTime == null) {
-			return "";
-		}else {
-			if(maxdeliveryHKTime.shortValue() != mindeliveryHKTime.shortValue()) {
-				return maxdeliveryHKTime + "-" + mindeliveryHKTime;
+		if(Currency.USD.equals(this.currency)) {
+			Short selfMinDelivery = getSelfMinDelivery();
+			Short selfMaxDelivery = getSelfMaxDelivery();
+			if((selfMinDelivery == null) || (selfMaxDelivery == null)) {
+				return selfMinDelivery == null ? String.valueOf(selfMaxDelivery) : String.valueOf(selfMinDelivery);
 			}else {
-				return maxdeliveryHKTime.toString();
+				return selfMinDelivery + "~" + selfMaxDelivery;
 			}
+		}else {
+			return null;
 		}
 	}
 
@@ -840,49 +909,16 @@ public class ReleaseProductByBatch implements Serializable {
 	@JsonIgnore
 	@JSONField(serialize = false)
 	public String getDeliveryDemTime() {
-		Short maxdeliveryDemTime = getB2cMaxDelivery();
-		Short mindeliveryDemTime = getB2cMinDelivery();
-		if(maxdeliveryDemTime == null || mindeliveryDemTime == null) {
-			return "";
-		}else {
-			if(maxdeliveryDemTime.shortValue() != mindeliveryDemTime.shortValue()) {
-				return maxdeliveryDemTime + "-" + mindeliveryDemTime;
+		if(Currency.RMB.equals(this.currency)) {
+			Short selfMinDelivery = getSelfMinDelivery();
+			Short selfMaxDelivery = getSelfMaxDelivery();
+			if((selfMinDelivery == null) || (selfMaxDelivery == null)) {
+				return selfMinDelivery == null ? String.valueOf(selfMaxDelivery) : String.valueOf(selfMinDelivery);
 			}else {
-				return maxdeliveryDemTime.toString();
-			}
-		}
-	}
-
-	/**
-	 * 分段填充到字段中
-	 * 
-	 * @return
-	 */
-	public void fillSegData() {
-		List<GoodsQtyPrice> prices2 = getPrices();
-		if (!CollectionUtils.isEmpty(prices2)) {
-			for (int i = 0; i < prices2.size(); i++) {
-				switch (i) {
-				case 0:
-					this.seg1qty = prices2.get(0).getStart();
-					this.seg1RMBPrice = prices2.get(0).getRMBPrice();
-					this.seg1USDPrice = prices2.get(0).getUSDPrice();
-					break;
-				case 1:
-					this.seg1qty = prices2.get(1).getStart();
-					this.seg1RMBPrice = prices2.get(1).getRMBPrice();
-					this.seg1USDPrice = prices2.get(1).getUSDPrice();
-					break;
-				case 2:
-					this.seg1qty = prices2.get(2).getStart();
-					this.seg1RMBPrice = prices2.get(2).getRMBPrice();
-					this.seg1USDPrice = prices2.get(2).getUSDPrice();
-					break;
-				default:
-					throw new IllegalOperatorException("当前的分段超过了三个,请确定信息之后再上传。");
-				}
-
+				return selfMinDelivery + "~" + selfMaxDelivery;
 			}
+		}else {
+			return null;
 		}
 	}
 
@@ -974,11 +1010,12 @@ public class ReleaseProductByBatch implements Serializable {
 		goods.setCode(releaseProductByBatch.getCode());
 		goods.setCreatedDate(new Date());
 		goods.setUpdateDate(new Date());
-		// 交货周期 暂未做最长与最短
-//		goods.setB2cDeliveryDemMaxTime(releaseProductByBatch.getMaxdeliveryDemTime());
-//		goods.setB2cDeliveryDemMinTime(releaseProductByBatch.getMindeliveryDemTime());
-//		goods.setB2cDeliveryHKMaxTime(releaseProductByBatch.getMaxdeliveryHKTime());
-//		goods.setB2cDeliveryHKMinTime(releaseProductByBatch.getMindeliveryHKTime());
+		goods.setMinDelivery(releaseProductByBatch.getSelfMinDelivery());
+		goods.setMaxDelivery(releaseProductByBatch.getSelfMaxDelivery());
+//		goods.setSelfDeliveryDemMaxTime(releaseProductByBatch.getDeliveryDemMaxTime());
+//		goods.setSelfDeliveryDemMinTime(releaseProductByBatch.getDeliveryDemMinTime());
+//		goods.setSelfDeliveryHKMaxTime(releaseProductByBatch.getDeliveryHKMaxTime());
+//		goods.setSelfDeliveryHKMinTime(releaseProductByBatch.getDeliveryHKMinTime());
 		goods.setProduceDate(releaseProductByBatch.getProductDate());
 		goods.setPublisherUU(releaseProductByBatch.getPublisherUu());
 		goods.setPublisherName(releaseProductByBatch.getPublisherName());
@@ -1034,4 +1071,175 @@ public class ReleaseProductByBatch implements Serializable {
 		this.branduuid = branduuid;
 		return this;
 	}
+
+	public static long getSerialVersionUID() {
+		return serialVersionUID;
+	}
+
+//	public Short getDeliveryDemMaxTime() {
+//		return deliveryDemMaxTime;
+//	}
+//
+//	public ReleaseProductByBatch setDeliveryDemMaxTime(Short deliveryDemMaxTime) {
+//		this.deliveryDemMaxTime = deliveryDemMaxTime;
+//		return this;
+//	}
+//
+//	public Short getDeliveryDemMinTime() {
+//		return deliveryDemMinTime;
+//	}
+//
+//	public ReleaseProductByBatch setDeliveryDemMinTime(Short deliveryDemMinTime) {
+//		this.deliveryDemMinTime = deliveryDemMinTime;
+//		return this;
+//	}
+//
+//	public Short getDeliveryHKMinTime() {
+//		return deliveryHKMinTime;
+//	}
+//
+//	public ReleaseProductByBatch setDeliveryHKMinTime(Short deliveryHKMinTime) {
+//		this.deliveryHKMinTime = deliveryHKMinTime;
+//		return this;
+//	}
+//
+//	public Short getDeliveryHKMaxTime() {
+//		return deliveryHKMaxTime;
+//	}
+//
+//	public ReleaseProductByBatch setDeliveryHKMaxTime(Short deliveryHKMaxTime) {
+//		this.deliveryHKMaxTime = deliveryHKMaxTime;
+//		return this;
+//	}
+
+
+	public Short getSelfMaxDelivery() {
+		return selfMaxDelivery;
+	}
+
+	public ReleaseProductByBatch setSelfMaxDelivery(Short selfMaxDelivery) {
+		this.selfMaxDelivery = selfMaxDelivery;
+		return this;
+	}
+
+	public Short getSelfMinDelivery() {
+		return selfMinDelivery;
+	}
+
+	public ReleaseProductByBatch setSelfMinDelivery(Short selfMinDelivery) {
+		this.selfMinDelivery = selfMinDelivery;
+		return this;
+	}
+
+	public Boolean getBreakUp() {
+		return breakUp;
+	}
+
+	public ReleaseProductByBatch setBreakUp(Boolean breakUp) {
+		this.breakUp = breakUp;
+		return this;
+	}
+
+	public String getBreakUpStr() {
+		return breakUpStr;
+	}
+
+	public ReleaseProductByBatch setBreakUpStr(String breakUpStr) {
+		this.breakUpStr = breakUpStr;
+		return this;
+	}
+
+	public String getReserveStr() {
+		return reserveStr;
+	}
+
+	public ReleaseProductByBatch setReserveStr(String reserveStr) {
+		this.reserveStr = reserveStr;
+		return this;
+	}
+
+	public String getMinBuyQtyStr() {
+		return minBuyQtyStr;
+	}
+
+	public ReleaseProductByBatch setMinBuyQtyStr(String minBuyQtyStr) {
+		this.minBuyQtyStr = minBuyQtyStr;
+		return this;
+	}
+
+	public String getMinPackageStr() {
+		return minPackageStr;
+	}
+
+	public ReleaseProductByBatch setMinPackageStr(String minPackageStr) {
+		this.minPackageStr = minPackageStr;
+		return this;
+	}
+
+	public String getMinPackPriceStr() {
+		return minPackPriceStr;
+	}
+
+	public ReleaseProductByBatch setMinPackPriceStr(String minPackPriceStr) {
+		this.minPackPriceStr = minPackPriceStr;
+		return this;
+	}
+
+	public String getSelfMaxDeliveryStr() {
+		return selfMaxDeliveryStr;
+	}
+
+	public ReleaseProductByBatch setSelfMaxDeliveryStr(String selfMaxDeliveryStr) {
+		this.selfMaxDeliveryStr = selfMaxDeliveryStr;
+		return this;
+	}
+
+	public String getSelfMinDeliveryStr() {
+		return selfMinDeliveryStr;
+	}
+
+	public ReleaseProductByBatch setSelfMinDeliveryStr(String selfMinDeliveryStr) {
+		this.selfMinDeliveryStr = selfMinDeliveryStr;
+		return this;
+	}
+
+	/**
+	 * 设置结束量的String 值
+	 * @param qty 结束值
+	 * @param i 分段的数值
+	 */
+	public void setFragmentQty(String qty, int i) {
+		qty = StringUtilB2C.isEmpty(qty) ? "" : qty;
+		switch (i) {
+			case 0:
+				this.qty1Str = qty;
+				break;
+			case 1:
+				this.qty2Str = qty;
+				break;
+			case 2:
+				this.qty3Str = qty;
+				break;
+		}
+	}
+
+	/**
+	 * 设置分段价格String 供下载
+	 * @param price 分段价格
+	 * @param i 第几个分段
+	 */
+	public void setFragmentPrice(String price, int i) {
+		price = StringUtilB2C.isEmpty(price) ? "" : price;
+		switch (i) {
+			case 0:
+				this.price1 = price;
+				break;
+			case 1:
+				this.price2 = price;
+				break;
+			case 2:
+				this.price3 = price;
+				break;
+		}
+	}
 }

+ 16 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsHistoryService.java

@@ -84,4 +84,20 @@ public interface GoodsHistoryService {
      * @return result map
      */
     ResultMap modifyGoodsHitory();
+
+    /**
+     * 通过库存初始化历史库存
+     * @param goods
+     * @return
+     */
+    GoodsHistory initByGoods(Goods goods, GoodsHistory.OperateType type);
+
+
+    /**
+     * 对比批次变化并记录批次改动信息
+     *
+     * @param goodsHistory
+     * @return
+     */
+    String compareGoodsHistory(GoodsHistory goodsHistory);
 }

+ 11 - 12
src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsService.java

@@ -2,10 +2,10 @@ package com.uas.platform.b2c.prod.commodity.service;
 
 import com.uas.api.b2c_erp.seller.model.GoodsFUas;
 import com.uas.api.b2c_erp.seller.model.GoodsSimpleUas;
-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.GoodsInfo;
-import com.uas.platform.b2c.prod.commodity.model.GoodsSimple;
+import com.uas.platform.b2c.prod.commodity.model.*;
+import com.uas.platform.b2c.trade.order.model.Order;
+import com.uas.platform.b2c.trade.presale.model.Cart;
+import com.uas.platform.b2c.trade.presale.model.GoodsBrowsingHistory;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageParams;
@@ -243,14 +243,6 @@ public interface GoodsService {
      */
     void setB2CDelayTime(Goods goods);
 
-    /**
-     * 对比批次变化并记录批次改动信息
-     *
-     * @param goodsHistory the goods history
-     * @return string
-     */
-    String compareGoodsHistory(GoodsHistory goodsHistory);
-
     /**
      * 添加或修改商品价格信息
      *
@@ -539,4 +531,11 @@ public interface GoodsService {
      * @return
      */
     ResultMap validGoodsIsChange(String batchCode, String storeuuid);
+
+
+    /**
+     * 更新库存的相关信息
+     * @return
+     */
+    ResultMap updateGoodsRelateInfo(List<Order> orders, List<Cart> carts, List<GoodsBrowsingHistory> browsingHistoryList, Product product, ProductStandardPutOnInfo putOnInfo, GoodsHistory goodsHistory, Goods goods);
 }

+ 23 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductService.java

@@ -1,6 +1,7 @@
 package com.uas.platform.b2c.prod.commodity.service;
 
 import com.uas.platform.b2c.prod.commodity.model.Product;
+import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfo;
 import com.uas.platform.b2c.trade.order.model.Purchase;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.model.PageInfo;
@@ -79,6 +80,14 @@ public interface ProductService {
      */
     public String updateProduct(Product product);
 
+    /**
+     * 根据库存信息 保存对产品包装,包装数量,生产日期的修改
+     *
+     * @param putOnInfo the putOnInfo
+     * @return the string
+     */
+    Product updateProduct(ProductStandardPutOnInfo putOnInfo);
+
     /**
      * 扣减库存
      *
@@ -86,4 +95,18 @@ public interface ProductService {
      * @return result map
      */
     ResultMap deductRepositoryQty(Purchase purchase);
+
+    /**
+     * 保存产品库信息
+     * @param product
+     * @return
+     */
+    Product save(Product product);
+
+    /**
+     * 批量保存产品库信息
+     * @param products
+     * @return
+     */
+    List<Product> save(List<Product> products);
 }

+ 21 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductStandardPutOnInfoService.java

@@ -35,6 +35,13 @@ public interface ProductStandardPutOnInfoService {
      */
     ResultMap updateProductStandardPutOnInfoByBatch();
 
+    /**
+     * 根据库存信息更新标准上架信息
+     * @param goods 库存
+     * @return
+     */
+    ProductStandardPutOnInfo updateProductStandardPutOnInfoByGoods(Goods goods);
+
     /**
      * 一键更新标准上架信息,将可上架数变为在售数量
      *
@@ -91,4 +98,18 @@ public interface ProductStandardPutOnInfoService {
      * @return result map
      */
     public ResultMap updateAvailableQty(Long id, Double qty);
+
+    /**
+     * 单个保存标准上架信息
+     * @param putOnInfo 上架信息
+     * @return
+     */
+    ProductStandardPutOnInfo save(ProductStandardPutOnInfo putOnInfo);
+
+    /**
+     * 批量保存标准上架信息
+     * @param putOnInfos 标准上架信息
+     * @return
+     */
+    List<ProductStandardPutOnInfo> save(List<ProductStandardPutOnInfo> putOnInfos);
 }

+ 2 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/service/ReleaseProductByBatchService.java

@@ -29,9 +29,10 @@ public interface ReleaseProductByBatchService {
      *
      * @param workbook the workbook 上传的文件
      * @param selfSale 是否自售
+     * @param currency
      * @return model map
      */
-    public ModelMap releaseByWorkbook(Workbook workbook, Boolean selfSale);
+    public ModelMap releaseByWorkbook(Workbook workbook, Boolean selfSale, String currency);
 
     /**
      * 根据发布者UU获取一组产品的信息

+ 68 - 8
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsHistoryServiceImpl.java

@@ -3,15 +3,14 @@ package com.uas.platform.b2c.prod.commodity.service.impl;
 
 import com.uas.platform.b2c.common.account.dao.EnterpriseDao;
 import com.uas.platform.b2c.common.account.model.Enterprise;
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsHistoryDao;
 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.GoodsQtyPrice;
 import com.uas.platform.b2c.prod.commodity.service.GoodsHistoryService;
-import com.uas.platform.b2c.prod.commodity.service.GoodsService;
-import com.uas.platform.b2c.core.support.SystemSession;
-import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.PageInfo;
@@ -42,13 +41,10 @@ public class GoodsHistoryServiceImpl implements GoodsHistoryService {
 
 	@Autowired
 	private EnterpriseDao enterpriseDao;
-	
-	@Autowired
-	private GoodsService goodsService;
 
 	@Autowired
 	private GoodsDao goodsDao;
-	
+
 	@Override
 	public GoodsHistory save(GoodsHistory goodsHistory) {
 		return goodsHistoryDao.save(goodsHistory);
@@ -136,7 +132,7 @@ public class GoodsHistoryServiceImpl implements GoodsHistoryService {
 		goodsHistory.setOperateDate(new Date());
 		goodsHistory.setOperateUU(SystemSession.getUser().getUserUU());
 		goodsHistory.setOperateType(type);
-		goodsHistory.setMessage(goodsService.compareGoodsHistory(goodsHistory));
+		goodsHistory.setMessage(compareGoodsHistory(goodsHistory));
 		return goodsHistory;
 	}
 
@@ -236,4 +232,68 @@ public class GoodsHistoryServiceImpl implements GoodsHistoryService {
 		List<GoodsHistory> histories = goodsHistoryDao.save(goodsHistories);
 		return ResultMap.success(histories);
 	}
+
+
+	/**
+	 * 通过库存初始化历史库存
+	 *
+	 * @param goods
+	 * @param type
+	 * @return
+	 */
+	@Override
+	public GoodsHistory initByGoods(Goods goods, GoodsHistory.OperateType type) {
+		// 记录批此历史信息
+		GoodsHistory goodsHistory = new GoodsHistory(goods);
+		goodsHistory.setOperateUU(SystemSession.getUser().getUserUU());
+		goodsHistory.setOperateType(GoodsHistory.OperateType.Update.getPhrase());
+		goodsHistory.setOperateDate(new Date());
+		goodsHistory.setMessage(compareGoodsHistory(goodsHistory));
+		return goodsHistory;
+	}
+
+	/**
+	 * 对比批次变化并记录批次改动信息
+	 *
+	 * @param goodsHistory
+	 * @return
+	 */
+	@Override
+	public String compareGoodsHistory(GoodsHistory goodsHistory) {
+		String message = "";
+		GoodsHistory oldgoodGoodsHistory = goodsHistoryDao.findNewByBatchCode(goodsHistory.getBatchCode());
+		if (oldgoodGoodsHistory == null) {
+			return message;
+		}
+		if (oldgoodGoodsHistory.getReserve() > goodsHistory.getReserve()
+				|| oldgoodGoodsHistory.getReserve() < goodsHistory.getReserve()) {
+			message += "库存变化:" + oldgoodGoodsHistory.getReserve() + "-->" + goodsHistory.getReserve() + ";";
+		}
+		if (oldgoodGoodsHistory.getMinBuyQty() > goodsHistory.getMinBuyQty()
+				|| oldgoodGoodsHistory.getMinBuyQty() < goodsHistory.getMinBuyQty()) {
+			message += "最小起订量变化:" + oldgoodGoodsHistory.getMinBuyQty() + "-->" + goodsHistory.getMinBuyQty() + ";";
+		}
+		if (oldgoodGoodsHistory.getMinPackQty() > goodsHistory.getMinPackQty()
+				|| oldgoodGoodsHistory.getMinPackQty() < goodsHistory.getMinPackQty()) {
+			message += "最小包装量变化:" + oldgoodGoodsHistory.getMinPackQty() + "-->" + goodsHistory.getMinPackQty() + ";";
+		}
+		if (oldgoodGoodsHistory.getPackaging() != goodsHistory.getPackaging()) {
+			message += "包装变化:" + oldgoodGoodsHistory.getPackaging() + "-->" + goodsHistory.getPackaging() + ";";
+		}
+		if (oldgoodGoodsHistory.getProduceDate() != goodsHistory.getProduceDate()) {
+			message += "生产日期变化:" + oldgoodGoodsHistory.getProduceDate() + "-->" + goodsHistory.getProduceDate() + ";";
+		}
+		if (!oldgoodGoodsHistory.getQtyPrice().equals(goodsHistory.getQtyPrice())) {
+			message += "价格变化 ;";
+		}
+		// TODO huxz 交货周期
+		if (oldgoodGoodsHistory.getMaxDelivery() != goodsHistory.getMaxDelivery() || oldgoodGoodsHistory.getMinDelivery() != goodsHistory.getMinDelivery()) {
+			message += "交货周期变化:" + oldgoodGoodsHistory.getMaxDelivery() + "-->"+ goodsHistory.getMaxDelivery() + "," +
+					oldgoodGoodsHistory.getMinDelivery() + "->" + goodsHistory.getMinDelivery();
+		}
+		if (!Objects.equals(oldgoodGoodsHistory.getRemark(), goodsHistory.getRemark())) {
+			message += "备注变化:" + oldgoodGoodsHistory.getRemark() + "-->" + goodsHistory.getRemark() + ";";
+		}
+		return message;
+	}
 }

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

@@ -14,13 +14,11 @@ import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.DoubleArith;
 import com.uas.platform.b2c.core.utils.NumberUtil;
 import com.uas.platform.b2c.external.erp.commodity.util.ModelConverter;
+import com.uas.platform.b2c.prod.commodity.constant.IntegerConstant;
 import com.uas.platform.b2c.prod.commodity.dao.*;
 import com.uas.platform.b2c.prod.commodity.model.*;
 import com.uas.platform.b2c.prod.commodity.model.GoodsHistory.OperateType;
-import com.uas.platform.b2c.prod.commodity.service.GoodsHistoryService;
-import com.uas.platform.b2c.prod.commodity.service.GoodsPriceInfoService;
-import com.uas.platform.b2c.prod.commodity.service.GoodsService;
-import com.uas.platform.b2c.prod.commodity.service.ProductStandardPutOnInfoService;
+import com.uas.platform.b2c.prod.commodity.service.*;
 import com.uas.platform.b2c.prod.commodity.util.GoodsUtil;
 import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
@@ -29,6 +27,8 @@ import com.uas.platform.b2c.prod.product.kind.model.Kind;
 import com.uas.platform.b2c.prod.product.kind.service.KindService;
 import com.uas.platform.b2c.prod.store.dao.StoreInDao;
 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.dao.OrderDao;
 import com.uas.platform.b2c.trade.order.dao.OrderDetailDao;
 import com.uas.platform.b2c.trade.order.dao.ProofingDao;
@@ -39,6 +39,8 @@ import com.uas.platform.b2c.trade.order.service.OrderDetailService;
 import com.uas.platform.b2c.trade.order.service.OrderService;
 import com.uas.platform.b2c.trade.order.type.ResultMapType;
 import com.uas.platform.b2c.trade.presale.dao.TradeDeliveryDelayTimeDao;
+import com.uas.platform.b2c.trade.presale.model.Cart;
+import com.uas.platform.b2c.trade.presale.model.GoodsBrowsingHistory;
 import com.uas.platform.b2c.trade.presale.model.TradeDeliveryDelayTime;
 import com.uas.platform.b2c.trade.presale.service.BrowsingHistoryService;
 import com.uas.platform.b2c.trade.presale.service.CartService;
@@ -99,6 +101,8 @@ public class GoodsServiceImpl implements GoodsService {
 
     private final KindService kindService;
     private final StoreInDao storeInDao;
+
+	private final StoreInService storeInService;
     /**
      * 控制任务提交速度的线程池
      */
@@ -156,6 +160,9 @@ public class GoodsServiceImpl implements GoodsService {
 
 	private final ProductDao productDao;
 
+	@Autowired
+	private ProductService productService;
+
 	private final BrowsingHistoryService browsingHistoryService;
 
     @Autowired
@@ -173,9 +180,10 @@ public class GoodsServiceImpl implements GoodsService {
 	private OrderDetailService detailService;
 
 	@Autowired
-	public GoodsServiceImpl(KindService kindService, StoreInDao storeInDao, ProductStandardPutOnInfoDao productStandardPutOnInfoDao, ProductDao productDao, BrowsingHistoryService browsingHistoryService, RecommendProductService recommendProductService) {
+	public GoodsServiceImpl(KindService kindService, StoreInDao storeInDao, StoreInService storeInService, ProductStandardPutOnInfoDao productStandardPutOnInfoDao, ProductDao productDao, BrowsingHistoryService browsingHistoryService, RecommendProductService recommendProductService) {
 		this.kindService = kindService;
 		this.storeInDao = storeInDao;
+		this.storeInService = storeInService;
 		this.productStandardPutOnInfoDao = productStandardPutOnInfoDao;
 		this.productDao = productDao;
 		this.browsingHistoryService = browsingHistoryService;
@@ -206,15 +214,21 @@ public class GoodsServiceImpl implements GoodsService {
 		if (!"RMB".equals(goods.getCurrencyName())) {
 			goods.setTax((short) 0);
 		}
-		if (goods.getReserve() < 0 || goods.getReserve() > 99999999) {
+		if (goods.getReserve() < 0 || goods.getReserve() > 999999999) {
 			throw new IllegalOperatorException("库存数量必须在1~99999999之间");
 		}
-		if (goods.getMinPackQty() < 1 || goods.getMinPackQty() > 99999999) {
-			throw new IllegalOperatorException("最小包装量必须在1~99999999之间");
+		if (goods.getMinPackQty() < 1 || goods.getMinPackQty() > 999999) {
+			throw new IllegalOperatorException("最小包装量必须在1~999999之间");
 		}
-        if (goods.getMinBuyQty() % goods.getMinPackQty() != 0) {
-			throw new IllegalOperatorException("最小起订量必须为最小包装量的整数倍");
-        }
+		if (goods.getMinBuyQty() < 1 || (NumberUtil.compare(goods.getMinBuyQty(), goods.getReserve()) > 0)) {
+			throw new IllegalOperatorException("最小起订量必须在1~"+ goods.getReserve() +"之间");
+		}
+		if(!goods.getBreakUp()) {
+			if (goods.getMinBuyQty() % goods.getMinPackQty() != 0) {
+				throw new IllegalOperatorException("最小起订量必须为最小包装量的整数倍");
+			}
+		}
+
 		// 验证交货周期信息
         validDeliveryTime(goods);
 
@@ -248,21 +262,21 @@ public class GoodsServiceImpl implements GoodsService {
         if(StringUtils.isEmpty(currencyName)) {
 			throw new IllegalOperatorException("库存的币别信息缺失");
         }
-        Double end = -1d;
+        Double end = Double.MIN_VALUE;
         for (GoodsQtyPrice price : prices) {
-            if(price.getStart().longValue() >= price.getEnd().longValue()) {
+            if(NumberUtil.compare(price.getStart(), price.getEnd()) > 0) {
 				throw new IllegalOperatorException("分段价格中存在分段起始值大于分段结束值");
             }
-            if(end.longValue() >= price.getStart().longValue()) {
+            if(NumberUtil.compare(end, price.getStart()) > -1) {
 				throw new IllegalOperatorException("分段价格中存在前一个分段结束值大于等于分段起始值");
             }
             if(currencyName.contains("USD")) {
-                if(price.getUSDPrice() == null || price.getUSDPrice().longValue() < 0) {
+                if(price.getUSDPrice() == null || price.getUSDPrice() < 0) {
 					throw new IllegalOperatorException("库存的币别信息包含美金,而分段价格中的美金价格不存在或小于0");
                 }
             }
             if(currencyName.contains("RMB")) {
-                if(price.getRMBPrice() == null || price.getRMBPrice().longValue() < 0) {
+                if(price.getRMBPrice() == null || price.getRMBPrice() < 0) {
 					throw new IllegalOperatorException("库存的币别信息包含人民币,而分段价格中的人民币价格不存在或小于0");
                 }
             }
@@ -308,51 +322,6 @@ public class GoodsServiceImpl implements GoodsService {
 		return goods;
 	}
 
-	/**
-	 * 对比批次变化并记录批次改动信息
-	 * 
-	 * @param goodsHistory
-	 * @return
-	 */
-	@Override
-	public String compareGoodsHistory(GoodsHistory goodsHistory) {
-		String message = "";
-		GoodsHistory oldgoodGoodsHistory = goodsHistoryDao.findNewByBatchCode(goodsHistory.getBatchCode());
-		if (oldgoodGoodsHistory == null) {
-			return message;
-		}
-		if (oldgoodGoodsHistory.getReserve() > goodsHistory.getReserve()
-				|| oldgoodGoodsHistory.getReserve() < goodsHistory.getReserve()) {
-			message += "库存变化:" + oldgoodGoodsHistory.getReserve() + "-->" + goodsHistory.getReserve() + ";";
-		}
-		if (oldgoodGoodsHistory.getMinBuyQty() > goodsHistory.getMinBuyQty()
-				|| oldgoodGoodsHistory.getMinBuyQty() < goodsHistory.getMinBuyQty()) {
-			message += "最小起订量变化:" + oldgoodGoodsHistory.getMinBuyQty() + "-->" + goodsHistory.getMinBuyQty() + ";";
-		}
-		if (oldgoodGoodsHistory.getMinPackQty() > goodsHistory.getMinPackQty()
-				|| oldgoodGoodsHistory.getMinPackQty() < goodsHistory.getMinPackQty()) {
-			message += "最小包装量变化:" + oldgoodGoodsHistory.getMinPackQty() + "-->" + goodsHistory.getMinPackQty() + ";";
-		}
-		if (oldgoodGoodsHistory.getPackaging() != goodsHistory.getPackaging()) {
-			message += "包装变化:" + oldgoodGoodsHistory.getPackaging() + "-->" + goodsHistory.getPackaging() + ";";
-		}
-		if (oldgoodGoodsHistory.getProduceDate() != goodsHistory.getProduceDate()) {
-			message += "生产日期变化:" + oldgoodGoodsHistory.getProduceDate() + "-->" + goodsHistory.getProduceDate() + ";";
-		}
-		if (!oldgoodGoodsHistory.getQtyPrice().equals(goodsHistory.getQtyPrice())) {
-			message += "价格变化 ;";
-		}
-		// TODO huxz 交货周期
-		if (oldgoodGoodsHistory.getMaxDelivery() != goodsHistory.getMaxDelivery() || oldgoodGoodsHistory.getMinDelivery() != goodsHistory.getMinDelivery()) {
-			message += "交货周期变化:" + oldgoodGoodsHistory.getMaxDelivery() + "-->"+ goodsHistory.getMaxDelivery() + "," +
-					oldgoodGoodsHistory.getMinDelivery() + "->" + goodsHistory.getMinDelivery();
-		}
-		if (!Objects.equals(oldgoodGoodsHistory.getRemark(), goodsHistory.getRemark())) {
-			message += "备注变化:" + oldgoodGoodsHistory.getRemark() + "-->" + goodsHistory.getRemark() + ";";
-		}
-		return message;
-	}
-
 	@Override
 	public List<Goods> findGoodsByUuid(String uuid) {
 		return goodsDao.findByUuid(uuid);
@@ -450,12 +419,12 @@ public class GoodsServiceImpl implements GoodsService {
 		}
 		Double reserve = goods.getReserve() - number;
 		//更新相应标准上架和标准产品信息
-		if(goods.getSourceId() == null) {
-			ResultMap resultMap = productStandardPutOnInfoService.updateOnSaleQty(goods, reserve);
-			if(resultMap.getCode() != CodeType.OK.code()) {
-				return resultMap;
-			}
-		}
+//		if(goods.getSourceId() == null) {
+//			ResultMap resultMap = productStandardPutOnInfoService.updateOnSaleQty(goods, reserve);
+//			if(resultMap.getCode() != CodeType.OK.code()) {
+//				return resultMap;
+//			}
+//		}
 
 		goods.setReserve(reserve);
 		// 检查是否小于最小发货量
@@ -464,11 +433,7 @@ public class GoodsServiceImpl implements GoodsService {
 		}
 		goodsDao.modifyReserve(goods.getBatchCode(), goods.getUuid(), goods.getReserve(), goods.getStatus().intValue());
 		// 每次批次保存同时保存一遍历史信息
-		GoodsHistory goodsHistory = new GoodsHistory(goods);
-		goodsHistory.setOperateDate(new Date());
-		goodsHistory.setOperateType(GoodsHistory.OperateType.DeductReserve.getPhrase());
-		goodsHistory.setOperateUU(SystemSession.getUser().getUserUU());
-		goodsHistory.setMessage(compareGoodsHistory(goodsHistory));
+		GoodsHistory goodsHistory = goodsHistoryService.initByGoods(goods, GoodsHistory.OperateType.DeductReserve);
 		goodsHistoryService.save(goodsHistory);
 		// 更新器件属性的库存
 		updateComponentTradeInfos(goods.getUuid());
@@ -508,11 +473,7 @@ public class GoodsServiceImpl implements GoodsService {
 
 		goodsDao.modifyReserve(goods.getBatchCode(), goods.getUuid(), goods.getReserve(), goods.getStatus().intValue());
 		// 每次批次保存同时保存一遍历史信息
-		GoodsHistory goodsHistory = new GoodsHistory(goods);
-		goodsHistory.setOperateUU(SystemSession.getUser().getUserUU());
-		goodsHistory.setOperateDate(new Date());
-		goodsHistory.setOperateType(GoodsHistory.OperateType.ReleaseReserve.getPhrase());
-		goodsHistory.setMessage(compareGoodsHistory(goodsHistory));
+		GoodsHistory goodsHistory = goodsHistoryService.initByGoods(goods, GoodsHistory.OperateType.ReleaseReserve);
 		goodsHistoryService.save(goodsHistory);
 		// 更新器件属性的库存
 		updateComponentTradeInfos(goods.getUuid());
@@ -530,7 +491,8 @@ public class GoodsServiceImpl implements GoodsService {
 		goods.setBatchCode(batchCode);
 		goods.setCreatedDate(new Date());
 		goods.setUpdateDate(goods.getCreatedDate());
-		goods.setLastReserve(goods.getReserve());
+		goods.setReserve(goods);
+		goods.setPerQty();
 		goods.setEnUU(SystemSession.getUser().getEnterprise().getUu());
 		goods.setEnterpriseName(SystemSession.getUser().getEnterprise().getEnName());
 		if (StringUtils.isEmpty(goods.getPublisherName())) {
@@ -572,7 +534,12 @@ public class GoodsServiceImpl implements GoodsService {
 
 		if(!StringUtils.isEmpty(goods.getStoreid())) {
 			StoreIn storeIn = storeInDao.findByUuid(goods.getStoreid());
-			goods.setStoreName(storeIn.getStoreName());
+			if(storeIn.getStatus() == StoreStatus.OPENED) {
+				goods.setStoreName(storeIn.getStoreName());
+			}else {
+				throw new IllegalOperatorException("该公司还为开店铺,不能选择自营销售");
+			}
+
 		}
 	}
 
@@ -1100,12 +1067,15 @@ public class GoodsServiceImpl implements GoodsService {
 		if (nowGoods.getSourceId() != null) {
 			return new ResultMap(CodeType.NOT_PERMIT.code(), "该库存的信息属于UAS上架,平台不能修改。");
 		}
-		ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.findOne(goods.getProductid());
-		if(putOnInfo != null) {
-			if(nowGoods.validProductStandardPutOnInfoAndGoodsSameData(putOnInfo)) {
-				return new ResultMap(CodeType.INFO_UPDATE.code(), "数据已经被更新了请刷新之后重新操作");
-			}
+		if(nowGoods.getReserve().doubleValue() != goods.getOldReserve().doubleValue()) {
+			return new ResultMap(CodeType.INFO_UPDATE.code(), "该库存的信息已经被修改了,请刷新界面之后重新操作。");
 		}
+//		ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
+//		if(putOnInfo != null) {
+//			if(nowGoods.validProductStandardPutOnInfoAndGoodsSameData(putOnInfo)) {
+//				return new ResultMap(CodeType.INFO_UPDATE.code(), "数据已经被更新了请刷新之后重新操作");
+//			}
+//		}
 		resultGoods = updateGoods(nowGoods, goods);
 		updateComponentTradeInfos(nowGoods.getUuid());
 		return ResultMap.success(resultGoods);
@@ -1121,15 +1091,38 @@ public class GoodsServiceImpl implements GoodsService {
 	@Transactional
 	public Goods updateGoods(Goods nowGoods, Goods oldGoods) {
 		Goods resultGoods = null;
-		GoodsHistory goodsHistory = null;
 		nowGoods.setMaxDelivery(oldGoods.getMaxDelivery());
 		nowGoods.setMinDelivery(oldGoods.getMinDelivery());
+		nowGoods.setSelfDeliveryDemMaxTime(oldGoods.getSelfDeliveryDemMaxTime());
+		nowGoods.setSelfDeliveryDemMinTime(oldGoods.getSelfDeliveryDemMinTime());
+		nowGoods.setSelfDeliveryHKMaxTime(oldGoods.getSelfDeliveryHKMaxTime());
+		nowGoods.setSelfDeliveryHKMinTime(oldGoods.getSelfDeliveryHKMinTime());
+
+		if(Integer.valueOf(oldGoods.getSelfSale()).equals(IntegerConstant.B2C_SALE)) {
+			nowGoods.setStoreid(sysConf.getStoreid());
+			nowGoods.setStoreName(sysConf.getEnName());
+		}else if(Integer.valueOf(oldGoods.getSelfSale()).equals(IntegerConstant.SELF_SALE)){
+			StoreIn storeIn = storeInService.findByEnUU(nowGoods.getEnUU());
+			if(storeIn.getStatus() == StoreStatus.OPENED) {
+				nowGoods.setStoreid(storeIn.getUuid());
+				nowGoods.setStoreName(storeIn.getStoreName());
+			}else {
+				throw new IllegalOperatorException("您还未开店铺,不能选择自营");
+			}
+		}else {
+			throw new IllegalOperatorException("您选择的销售方式不存在");
+		}
 		// 设置货到香港,货到大陆的延长时间
 		setB2CDelayTime(nowGoods);
 
 		nowGoods.setUpdateDate(new Date());
 		nowGoods.setImg(oldGoods.getImg());
 		nowGoods.setMinBuyQty(oldGoods.getMinBuyQty());
+		nowGoods.setMinPackQty(oldGoods.getMinPackQty());
+		nowGoods.setBreakUp(oldGoods.getBreakUp());
+		nowGoods.setPerQty();
+		nowGoods.setReserve(oldGoods);
+		nowGoods.setPackaging(oldGoods.getPackaging());
 		// 用含税单价同步未含税单价
 		oldGoods.setWithOutTaxRMBPrice();
 		oldGoods.setWithOutTaxUSDPrice();
@@ -1150,37 +1143,17 @@ public class GoodsServiceImpl implements GoodsService {
 		if(resultMap.getCode() != CodeType.OK.code()) {
 			return null;
 		}
-		// 记录批此历史信息
-		goodsHistory = new GoodsHistory(nowGoods);
-		goodsHistory.setOperateDate(new Date());
-		goodsHistory.setOperateUU(SystemSession.getUser().getUserUU());
-		goodsHistory.setOperateType(GoodsHistory.OperateType.Update.getPhrase());
-		goodsHistory.setMessage(compareGoodsHistory(goodsHistory));
-		resultGoods = goodsDao.save(nowGoods);
-
-		List<Order> orders = detailService.updateOrderDetailsByGoods(resultGoods);
-		orderService.save(orders);
-
-		goodsHistoryService.save(goodsHistory);
 
+		GoodsHistory history = goodsHistoryService.initByGoods(nowGoods, OperateType.Update);
+		List<Order> orders = detailService.updateOrderDetailsByGoods(nowGoods);
 		//更新购物车信息
-		cartService.updateCartByGoods(resultGoods);
-
+		List<Cart> cartList = cartService.updateCartByGoods(nowGoods);
 		//更新浏览历史
-		browsingHistoryService.updateGoodsBrowsingHistoryByGoods(resultGoods);
-
-		ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.findOne(nowGoods.getStandprodid());
-		if(putOnInfo != null) {
-			putOnInfo.setMinBuyQty(nowGoods.getMinBuyQty());
-			putOnInfo.setMaxDelivery(nowGoods.getMaxDelivery());
-			putOnInfo.setMinDelivery(nowGoods.getMinDelivery());
-			putOnInfo.setQtyPrice(nowGoods.getQtyPrice());
-			putOnInfo.setImg(nowGoods.getImg());
-			productStandardPutOnInfoDao.save(putOnInfo);
-		}else {
-			throw new IllegalOperatorException("找不到对应的标准上架信息");
-		}
-		return resultGoods;
+		List<GoodsBrowsingHistory> browsingHistories = browsingHistoryService.updateGoodsBrowsingHistoryByGoods(nowGoods);
+//		ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoService.updateProductStandardPutOnInfoByGoods(nowGoods);
+//		Product product = productService.updateProduct(putOnInfo);
+		updateGoodsRelateInfo(orders, cartList, browsingHistories, null, null, history, nowGoods);
+		return nowGoods;
 	}
 
 	/**
@@ -1390,23 +1363,31 @@ public class GoodsServiceImpl implements GoodsService {
 	@Override
 	public void setB2CDelayTime(Goods goods) {
 		if(goods.getStoreid().equals(sysConf.getStoreid())) { //如果是库存寄售
-			TradeDeliveryDelayTime delivery = null;
-			if ("RMB".equalsIgnoreCase(goods.getCurrencyName())) {
+			if (goods.getCurrencyName().indexOf("RMB") > -1) {
 				List<TradeDeliveryDelayTime> delayTime3 = tradeDeliveryDelayTimeDao.getByType(3);
 				if (CollectionUtils.isEmpty(delayTime3)) {
 					throw new IllegalOperatorException("请联系商城,您供应商交货延长时间 国内发往国内没设置。");
 				}
-				delivery = delayTime3.get(0);
-			} else if ("USD".equalsIgnoreCase(goods.getCurrencyName())) {
+				goods.setB2cDeliveryDemMaxTime((short) (delayTime3.get(0).getMaxTime() + Short.valueOf(goods.getSelfDeliveryDemMaxTime() == null ? 0 : goods.getSelfDeliveryDemMaxTime())));
+				goods.setB2cDeliveryDemMinTime((short) (delayTime3.get(0).getMinTime() + Short.valueOf(goods.getSelfDeliveryDemMinTime() == null ? 0 : goods.getSelfDeliveryDemMinTime())));
+				goods.setB2cMaxDelivery((short) (delayTime3.get(0).getMinTime() + Short.valueOf(goods.getMaxDelivery() == null ? 0 : goods.getMaxDelivery())));
+				goods.setB2cMinDelivery((short) (delayTime3.get(0).getMinTime() + Short.valueOf(goods.getMinDelivery() == null ? 0 : goods.getMinDelivery())));
+			}
+			if (goods.getCurrencyName().indexOf("USD") > -1) {
 				List<TradeDeliveryDelayTime> delayTime1 = tradeDeliveryDelayTimeDao.getByType(2);
 				if (CollectionUtils.isEmpty(delayTime1)) {
 					throw new IllegalOperatorException("请联系商城,您供应商交货延长时间 国外发往国外没设置。");
 				}
-				delivery = delayTime1.get(0);
+				goods.setB2cDeliveryHKMaxTime((short) (delayTime1.get(0).getMaxTime() + goods.getSelfDeliveryHKMaxTime()));
+				goods.setB2cDeliveryHKMinTime((short) (delayTime1.get(0).getMinTime() + goods.getSelfDeliveryHKMinTime()));
+				goods.setB2cMaxDelivery((short) (delayTime1.get(0).getMinTime() + Short.valueOf(goods.getMaxDelivery() == null ? 0 : goods.getMaxDelivery())));
+				goods.setB2cMinDelivery((short) (delayTime1.get(0).getMinTime() + Short.valueOf(goods.getMinDelivery() == null ? 0 : goods.getMinDelivery())));
 			}
-			goods.setB2cMaxDelivery((short) (delivery.getMaxTime() + goods.getMaxDelivery()));
-			goods.setB2cMinDelivery((short) (delivery.getMinTime() + goods.getMinDelivery()));
 		}else { //如果是店铺自营
+			goods.setB2cDeliveryDemMaxTime(goods.getSelfDeliveryDemMaxTime());
+			goods.setB2cDeliveryDemMinTime(goods.getSelfDeliveryDemMinTime());
+			goods.setB2cDeliveryHKMaxTime(goods.getSelfDeliveryHKMaxTime());
+			goods.setB2cDeliveryHKMinTime(goods.getSelfDeliveryHKMinTime());
 			goods.setB2cMaxDelivery(goods.getMaxDelivery());
 			goods.setB2cMinDelivery(goods.getMinDelivery());
 		}
@@ -1921,18 +1902,18 @@ public class GoodsServiceImpl implements GoodsService {
 		goodsHist.setMessage(goodsHist.getMessage() + "该批次下架");
 		goodsHistoryService.save(goodsHist);
 
-		ProductStandardPutOnInfo standardPutOnInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
-		if(standardPutOnInfo != null) {
-			standardPutOnInfo.setStatus(Status.REMOVED.value());
-			standardPutOnInfo.setAvailableOnSale(NumberUtil.add(standardPutOnInfo.getAvailableOnSale(), standardPutOnInfo.getOnSaleQty()));
-			standardPutOnInfo.setOnSaleQty(0.0d);
-			productStandardPutOnInfoDao.save(standardPutOnInfo);
-
-			Product product = productDao.findOne(standardPutOnInfo.getProductid());
-			product.setAvailableOnSale(standardPutOnInfo.getAvailableOnSale());
-			product.setOnSaleQty(standardPutOnInfo.getOnSaleQty());
-			productDao.save(product);
-		}
+//		ProductStandardPutOnInfo standardPutOnInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
+//		if(standardPutOnInfo != null) {
+//			standardPutOnInfo.setStatus(Status.REMOVED.value());
+//			standardPutOnInfo.setAvailableOnSale(NumberUtil.add(standardPutOnInfo.getAvailableOnSale(), standardPutOnInfo.getOnSaleQty()));
+//			standardPutOnInfo.setOnSaleQty(0.0d);
+//			productStandardPutOnInfoDao.save(standardPutOnInfo);
+//
+//			Product product = productDao.findOne(standardPutOnInfo.getProductid());
+//			product.setAvailableOnSale(standardPutOnInfo.getAvailableOnSale());
+//			product.setOnSaleQty(standardPutOnInfo.getOnSaleQty());
+//			productDao.save(product);
+//		}
 
 		//下架对应的批次
 		goodsDao.deleteByBatchCode(goods.getBatchCode());
@@ -2023,12 +2004,15 @@ public class GoodsServiceImpl implements GoodsService {
 	}
 
 	public static void validDeliveryTime(Goods goods) {
-        if ((goods.getMaxDelivery() == null || goods.getMinDelivery() == null)) {
-            throw new IllegalOperatorException("交货周期为空");
-        }
-
-		if(goods.getMinDelivery().shortValue() > goods.getMaxDelivery().shortValue()) {
-			throw new IllegalOperatorException("最短交期大于最长交期");
+		if(goods.getCurrencyName().indexOf("RMB") > -1) {
+			if((goods.getB2cDeliveryDemMaxTime() == null || goods.getB2cDeliveryDemMinTime() == null)&&(goods.getMaxDelivery() == null || goods.getMinDelivery() == null)) {
+				throw new IllegalOperatorException("产品包含人民币,但是大陆交期为空");
+			}
+		}
+		if(goods.getCurrencyName().indexOf("USD") > -1) {
+			if((goods.getB2cDeliveryHKMaxTime() == null || goods.getB2cDeliveryHKMinTime() == null)&&(goods.getMaxDelivery() == null || goods.getMinDelivery() == null)) {
+				throw new IllegalOperatorException("产品包含美金,但是香港交期为空");
+			}
 		}
     }
 
@@ -2318,4 +2302,28 @@ public class GoodsServiceImpl implements GoodsService {
 		}
 		return ResultMap.success(null);
 	}
+
+	/**
+	 * 更新库存的相关信息
+	 *
+	 * @param orders 订单
+	 * @param carts 购物车信息
+	 * @param browsingHistoryList 浏览历史
+	 * @param product 产品
+	 * @param putOnInfo 标准信息
+	 * @return
+	 */
+	@Transactional
+	@Override
+	public ResultMap updateGoodsRelateInfo(List<Order> orders, List<Cart> carts, List<GoodsBrowsingHistory> browsingHistoryList, Product product, ProductStandardPutOnInfo putOnInfo, GoodsHistory goodsHistory, Goods goods) {
+		goodsDao.save(goods);
+		orderDao.save(orders);
+		orderService.save(orders);
+		cartService.saveCart(carts);
+		browsingHistoryService.saveGoodsBrowsingHistoryList(browsingHistoryList);
+//		productStandardPutOnInfoService.save(putOnInfo);
+//		productService.save(product);
+		goodsHistoryService.save(goodsHistory);
+		return ResultMap.success(null);
+	}
 }

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

@@ -119,7 +119,7 @@ public class ProductServiceImpl implements ProductService {
         }
         if(type.contains("standard")) {
             page.filter("standard", (short)1);
-            page.filter("b2cEnabled", (short) 1);
+//            page.filter("b2cEnabled", (short) 1);
         }else if(type.contains("nStandard")){
             page.filter("standard", (short)0);
         }else if(type.contains("all")) {
@@ -311,7 +311,7 @@ public class ProductServiceImpl implements ProductService {
         }
         Product persistProduct = productDao.findOne(product.getId());
         ProductModifyHistory productModifyHistory = new ProductModifyHistory();
-        if(product.getStandard() == 1){
+        if((persistProduct.getStandard() == 1)&&(persistProduct.getB2cEnabled() == 1)){
             ProductStandardPutOnInfo productStandardPutOnInfo= productStandardPutOnInfoDao.findByProductid(product.getId());
             if (product.getPackaging() != null){
                 productStandardPutOnInfo.setPackaging(product.getPackaging());
@@ -353,6 +353,11 @@ public class ProductServiceImpl implements ProductService {
                 if (product.getProduceDate() != null){
                     goods.setProduceDate(product.getProduceDate());
                 }
+                if(NumberUtil.compare(goods.getMinBuyQty(), goods.getReserve()) > 0) {
+                    goods.setStatus(Status.UNAVAILABLE.value());
+                }else {
+                    goods.setStatus(Status.AVAILABLE.value());
+                }
                 GoodsHistory goodsHistory = goodsHistoryService.converTGoodsHist(goods, GoodsHistory.OperateType.Modifying.getPhrase());
                 goodsHistoryDao.save(goodsHistory);
                 goodsDao.save(goods);
@@ -391,6 +396,29 @@ public class ProductServiceImpl implements ProductService {
         return "success";
     }
 
+    /**
+     * 根据标准上架信息 保存对产品包装,包装数量,生产日期的修改
+     *
+     * @param putOnInfo the Goods
+     * @return the string
+     */
+    @Override
+    public Product updateProduct(ProductStandardPutOnInfo putOnInfo) {
+        if(putOnInfo == null) {
+            throw new IllegalOperatorException("传入的信息信息为空");
+        }
+        if(StringUtils.isEmpty(putOnInfo.getProductid())) {
+            throw new IllegalOperatorException("标准上架信息关联的标准产品信息为空");
+        }
+        Product product = productDao.findOne(putOnInfo.getProductid());
+        if(product == null) {
+            throw new IllegalOperatorException("标准上架信息关联的标准产品信息为空");
+        }
+        product.setAvailableOnSale(putOnInfo.getAvailableOnSale());
+        product.setOnSaleQty(putOnInfo.getOnSaleQty());
+        return product;
+    }
+
     /**
      * 用户选择对应的品牌和类目,更新非标产品为标准产品
      * @param json
@@ -492,5 +520,27 @@ public class ProductServiceImpl implements ProductService {
         }
         return ResultMap.success(null);
     }
+
+    /**
+     * 保存产品库信息
+     *
+     * @param product
+     * @return
+     */
+    @Override
+    public Product save(Product product) {
+        return productDao.save(product);
+    }
+
+    /**
+     * 批量保存产品库信息
+     *
+     * @param products
+     * @return
+     */
+    @Override
+    public List<Product> save(List<Product> products) {
+        return productDao.save(products);
+    }
 }
 

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

@@ -159,6 +159,33 @@ public class ProductStandardPutOnInfoServiceImpl implements ProductStandardPutOn
         return ResultMap.success(putOnInfos.size());
     }
 
+
+    /**
+     * 根据库存信息更新标准上架信息
+     *
+     * @param goods 库存
+     * @return
+     */
+    @Override
+    public ProductStandardPutOnInfo updateProductStandardPutOnInfoByGoods(Goods goods) {
+        if(goods == null) {
+            throw new IllegalOperatorException("传入的信息丢失");
+        }
+        if(StringUtils.isEmpty(goods.getStandprodid())) {
+            throw new IllegalOperatorException("库存信息关联的标准上架信息为空");
+        }
+        ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
+        if(putOnInfo == null) {
+            throw new IllegalOperatorException("商品关联的标准上架信息不存在");
+        }
+        putOnInfo.setMinBuyQty(goods.getMinBuyQty());
+        putOnInfo.setMaxDelivery(goods.getMaxDelivery());
+        putOnInfo.setMinDelivery(goods.getMinDelivery());
+        putOnInfo.setQtyPrice(goods.getQtyPrice());
+        putOnInfo.setImg(goods.getImg());
+        return putOnInfo;
+    }
+
     /**
      * 一键更新标准上架信息,将可上架数变为在售数量
      *
@@ -339,4 +366,26 @@ public class ProductStandardPutOnInfoServiceImpl implements ProductStandardPutOn
 
         return ResultMap.success(product);
     }
+
+    /**
+     * 单个保存标准上架信息
+     *
+     * @param putOnInfo 上架信息
+     * @return
+     */
+    @Override
+    public ProductStandardPutOnInfo save(ProductStandardPutOnInfo putOnInfo) {
+        return productStandardPutOnInfoDao.save(putOnInfo);
+    }
+
+    /**
+     * 批量保存标准上架信息
+     *
+     * @param putOnInfos 标准上架信息
+     * @return
+     */
+    @Override
+    public List<ProductStandardPutOnInfo> save(List<ProductStandardPutOnInfo> putOnInfos) {
+        return productStandardPutOnInfoDao.save(putOnInfos);
+    }
 }

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

@@ -1,6 +1,15 @@
 package com.uas.platform.b2c.prod.commodity.service.impl;
 
 import com.uas.platform.b2c.common.account.model.Enterprise;
+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.support.SystemSession;
+import com.uas.platform.b2c.core.utils.NumberUtil;
+import com.uas.platform.b2c.core.utils.RegexConstant;
+import com.uas.platform.b2c.core.utils.StringUtilB2C;
+import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
+import com.uas.platform.b2c.prod.commodity.constant.ShortConstant;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
 import com.uas.platform.b2c.prod.commodity.dao.ReleaseProductByBatchDao;
 import com.uas.platform.b2c.prod.commodity.model.Goods;
@@ -8,16 +17,15 @@ import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
 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.ReleaseProductByBatchService;
-import com.uas.platform.b2c.common.base.dao.CommonDao;
-import com.uas.platform.b2c.core.config.SysConf;
+import com.uas.platform.b2c.prod.commodity.type.ReleaseConstant;
 import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
-import com.uas.platform.b2c.prod.store.dao.StoreInDao;
 import com.uas.platform.b2c.prod.store.model.StoreIn;
-import com.uas.platform.b2c.core.support.SystemSession;
+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.StringConstant.Currency;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.ReleaseStatus;
-import com.uas.platform.core.model.Type;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.poi.hssf.usermodel.HSSFDateUtil;
 import org.apache.poi.ss.usermodel.*;
@@ -60,11 +68,14 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	private CommonDao commonDao;
 
 	@Autowired
-	private StoreInDao storeInDao;
+	private StoreInService storeInService;
 
 	@Autowired
 	private SysConf SysConf;
 
+	@Autowired
+	private EnterpriseService enterpriseService;
+
 	@Override
 	public ReleaseProductByBatch save(ReleaseProductByBatch releaseProductByBatch) {
 		return releaseProductByBatch;
@@ -76,355 +87,288 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	 * @author hejq
 	 */
 	@Override
-	public ModelMap releaseByWorkbook(Workbook workbook, Boolean selfSale) {
+	public ModelMap releaseByWorkbook(Workbook workbook, Boolean selfSale, String currency) {
 		ModelMap modelMap = new ModelMap();
 		List<ReleaseProductByBatch> releaseProductByBatchs = new ArrayList<ReleaseProductByBatch>();
+		Pattern codePattern = Pattern.compile(RegexConstant.EnglishAnDigitAndSpecialCharacter);
+		Pattern chineseAndEnglishPattern = Pattern.compile(RegexConstant.chineseAndEnglish);
 		Sheet sheet = workbook.getSheetAt(0);
 		int colNum = sheet.getRow(0).getPhysicalNumberOfCells();
-		if(colNum != 25) {
+		if(colNum != 19 && colNum != 20) {
 			throw new IllegalOperatorException("您上传的信息列信息不正确,请与模板的列做比较");
 		}
 		int rowNum = sheet.getLastRowNum();
 		String batch = createNumberService.getTimeNumber("product$goods", 8, rowNum);
-		String storeid = null;
-		if(selfSale) {
-			List<StoreIn> storeIns = storeInDao.findByEnUU(SystemSession.getUser().getEnterprise().getUu());
-			if(CollectionUtils.isEmpty(storeIns)) {
-				throw new IllegalOperatorException("您还没有开店铺,不能选择店铺自营。");
-			}else {
-				storeid = storeIns.get(0).getUuid();
-			}
-		}else {
-			storeid = SysConf.getStoreid();
-		}
+		StoreIn storeIn = getStoreInfo(selfSale);
+		String storeid = storeIn.getUuid(), storeName = storeIn.getStoreName();
 		Row headerRow = sheet.getRow(0);
 		int total = 0;
 		if (headerRow != null) {
-			Cell cellHead = headerRow.getCell(0);
-			Object readWorkBookCell = readWorkBookCell(cellHead, Cell.CELL_TYPE_STRING, 0, 0);
-			Pattern p = Pattern.compile("\\s*|\t|\r|\n");
-            Matcher m = p.matcher(readWorkBookCell.toString());
-            String str = m.replaceAll("");
-			if(StringUtils.isEmpty(str) || !("中文产品品牌".equals(str))) {
-				throw new IllegalOperatorException("上传的文件信息第一列的表头为空,或第一列的表头名称不为中文产品品牌");
+			if(colNum == 20) {
+				Cell errorCell = headerRow.getCell(19);
+				Object errorCellObj = readWorkBookCell(errorCell, Cell.CELL_TYPE_STRING, 0, 0);
+				String errorHead = StringUtilB2C.replaceLineBreak(String.valueOf(errorCellObj));
+				if(StringUtils.isEmpty(errorHead) || !("错误提示".equals(errorHead))) {
+					throw new IllegalOperatorException("您上传的信息列信息不正确,请与模板的列做比较");
+				}
 			}
 			for (int r = 1; r <= rowNum; r++) {
 				Row row = sheet.getRow(r);
 				// 英文品牌名称
-				total++;
 				if (row != null && row.getCell(1) != null && row.getCell(1).getCellType() != Cell.CELL_TYPE_BLANK) {
+					total++;
 					ReleaseProductByBatch releaseProductByBatch = new ReleaseProductByBatch();
 					releaseProductByBatch.setReleaseCode(ReleaseStatus.success.value());
 					releaseProductByBatch.setReleaseStatus(ReleaseStatus.success.getPhrase());
 					releaseProductByBatch.setRelbatchid(batch);
+
 					Cell cell = row.getCell(1);
 					Object cellValue = readWorkBookCell(cell, Cell.CELL_TYPE_STRING, r, 1);
-					if(StringUtils.isEmpty(cellValue) || "UAS1".equals(cellValue) || "UAS2".equals(cellValue)) {
-						continue;
-					}else {
-						releaseProductByBatch.setBrandNameEn(String.valueOf(cellValue));
-					}
+					releaseProductByBatch.setBrandNameEn(String.valueOf(cellValue));
 
 					// 中文品牌名
 					Object brandNameCnCellValue = readWorkBookCell(row.getCell(0), Cell.CELL_TYPE_STRING, r, 0);
-					if("示例优软商城品牌1".equals(brandNameCnCellValue) || "示例优软商城品牌2".equals(brandNameCnCellValue)) {
-						continue;
-					}else {
-						releaseProductByBatch.setBrandNameCn(String.valueOf(brandNameCnCellValue));
-					}
+					releaseProductByBatch.setBrandNameCn(String.valueOf(brandNameCnCellValue));
 
 					// 产品型号
 					Object codeCellValue = readWorkBookCell(row.getCell(2), Cell.CELL_TYPE_STRING, r, 2);
-					if(StringUtils.isEmpty(codeCellValue) || "B2C1".equals(brandNameCnCellValue) || "B2C2".equals(brandNameCnCellValue)) {
-						continue;
+					releaseProductByBatch.setCode(String.valueOf(codeCellValue));
+					if(!StringUtils.isEmpty(codeCellValue)) {
+						String code = codeCellValue.toString();
+						Matcher matcher = codePattern.matcher(code);
+						if(!matcher.find()) {
+							releaseProductByBatch.addErrmsg("3:产品型号仅限英文、数字、特殊字符");
+						}
+					}
+
+					// 可拆卖
+					Object breakUpCellValue = readWorkBookCell(row.getCell(3), Cell.CELL_TYPE_STRING, r, 3);
+					releaseProductByBatch.setBreakUpStr(String.valueOf(breakUpCellValue));
+					if (!StringUtils.isEmpty(breakUpCellValue)&&(ReleaseConstant.YES.equals(breakUpCellValue.toString()))) {
+						releaseProductByBatch.setBreakUp(Boolean.TRUE);
 					}else {
-						releaseProductByBatch.setCode(codeCellValue.toString());
+						releaseProductByBatch.setBreakUp(Boolean.FALSE);
 					}
 
 					// 库存类型
-					Object originialCellValue = readWorkBookCell(row.getCell(3), Cell.CELL_TYPE_STRING, r, 3);
-					if (StringUtils.isEmpty(originialCellValue)
-							|| ((!"现货".equals(originialCellValue)) && (!"呆滞库存".equals(originialCellValue)))) {
-						releaseProductByBatch.addErrmsg("4:库存类型为空,或者没有选择现货或者呆滞库存");
-					} else {
-						if ("现货".equals(originialCellValue)) {
-							releaseProductByBatch.setOriginal(Type.Goods_Original_Code.value());
-						} else if ("呆滞库存".equals(originialCellValue)) {
-							releaseProductByBatch.setOriginal(Type.Goods_Inaction_Stock.value());
-						}
-					}
+//					Object originialCellValue = readWorkBookCell(row.getCell(4), Cell.CELL_TYPE_STRING, r, 4);
+//					if (StringUtils.isEmpty(originialCellValue)
+//							|| ((!"现货".equals(originialCellValue)) && (!"呆滞库存".equals(originialCellValue)))) {
+//						releaseProductByBatch.addErrmsg("5:库存类型为空,或者没有选择现货或者呆滞库存");
+//					} else {
+//						if ("现货".equals(originialCellValue)) {
+//							releaseProductByBatch.setOriginal(Type.Goods_Original_Code.value());
+//						} else if ("呆滞库存".equals(originialCellValue)) {
+//							releaseProductByBatch.setOriginal(Type.Goods_Inaction_Stock.value());
+//						}
+//					}
 
 					// 发布库存量
 					Double reserve = null;
-					Object reserveCellValue = readWorkBookCell(row.getCell(4), Cell.CELL_TYPE_NUMERIC, r, 4);
-					if (reserveCellValue == null || Double.valueOf(reserveCellValue.toString()).doubleValue() <= 0) {
-						releaseProductByBatch.addErrmsg("5:发布数量为空或者小于等于0");
+					Object reserveCellValue = readWorkBookCell(row.getCell(4), Cell.CELL_TYPE_STRING, r, 4);
+					releaseProductByBatch.setReserveStr(String.valueOf(reserveCellValue));
+					if (reserveCellValue == null || !isNumber(reserveCellValue.toString())) {
+						releaseProductByBatch.addErrmsg("5:发布数量为空或者不是数字");
 					} else {
 						reserve = Double.valueOf(reserveCellValue.toString());
-						int compareTo = reserve.compareTo(99999999d);
+						int compareTo = reserve.compareTo(DoubleConstant.maxReserve);
 						if(compareTo > 0) {
-							releaseProductByBatch.addErrmsg("5:发布数量大于了我们设置的最大值99999999");
+							releaseProductByBatch.addErrmsg("6:发布数量大于了我们设置的最大值99999999");
+						}else if(NumberUtil.compare(reserve, DoubleConstant.zero) < 1) {
+							releaseProductByBatch.addErrmsg("6:发布数量必须大于0");
 						}
 						releaseProductByBatch.setReserve(reserve);
 					}
 
+					// 生产日期
+					Object produceDateCellValue = readWorkBookCell(row.getCell(5), Cell.CELL_TYPE_STRING, r, 5);
+					releaseProductByBatch.setProductDate(String.valueOf(produceDateCellValue));
+					if (StringUtils.isEmpty(produceDateCellValue)) {
+						releaseProductByBatch.addErrmsg("6:产品生产日期不可以为空");
+					}
+
 					//包装方式
 					String packaging = null;
-					Object packagingCellValue = readWorkBookCell(row.getCell(5), Cell.CELL_TYPE_STRING, r, 5);
+					Object packagingCellValue = readWorkBookCell(row.getCell(6), Cell.CELL_TYPE_STRING, r, 6);
+					releaseProductByBatch.setPackaging(String.valueOf(packagingCellValue));
 					if (packagingCellValue == null || StringUtils.isEmpty(packagingCellValue.toString())) {
-						releaseProductByBatch.addErrmsg("6:包装方式不能为空");
+						releaseProductByBatch.addErrmsg("7:包装方式不能为空");
 					} else {
-						releaseProductByBatch.setPackaging(packagingCellValue.toString());
+						packaging = packagingCellValue.toString();
+						Matcher matcher = chineseAndEnglishPattern.matcher(packaging);
+						if(!matcher.find()) {
+							releaseProductByBatch.addErrmsg("7:包装方式仅限中文或英文");
+						}
 					}
 
+//					Double sample = null;
+//					Object sampleObj = readWorkBookCell(row.getCell(8), Cell.CELL_TYPE_STRING, r, 8);
+//					if ((sampleObj != null)&&(isNumber(sampleObj.toString()))) {
+//						sample = Double.valueOf(sampleObj.toString());
+//						if (sample <= 0) {
+//							// 这个是存在输入数据后再删除就会默认成0
+//							releaseProductByBatch.setSampleqty((double) 0);
+//						} else {
+//							releaseProductByBatch.setSampleqty(sample);
+//						}
+//					} else {
+//						// 这个是没有输入数据默认为null
+//						releaseProductByBatch.setMinPackage((double) 0);
+//					}
+
 					//封装方式
-					Object encapsulationCellValue = readWorkBookCell(row.getCell(6), Cell.CELL_TYPE_STRING, r, 6);
-					releaseProductByBatch.setEncapsulation(String.valueOf(encapsulationCellValue));
-					
-					Double sample = null;
-					Object sampleObj = readWorkBookCell(row.getCell(7), Cell.CELL_TYPE_NUMERIC, r, 7);
-					if (sampleObj != null) {
-						sample = Double.valueOf(sampleObj.toString());
-						if (sample <= 0) {
-							// 这个是存在输入数据后再删除就会默认成0
-							releaseProductByBatch.setSampleqty((double) 0);
-						} else {
-							releaseProductByBatch.setSampleqty(sample);
+//					Object encapsulationCellValue = readWorkBookCell(row.getCell(6), Cell.CELL_TYPE_STRING, r, 6);
+//					releaseProductByBatch.setEncapsulation(String.valueOf(encapsulationCellValue));
+
+					// 最小包装量
+					Object minPackQtyCellValue = readWorkBookCell(row.getCell(8), Cell.CELL_TYPE_STRING, r, 8);
+					releaseProductByBatch.setMinPackageStr(String.valueOf(minPackQtyCellValue));
+					if ((minPackQtyCellValue != null)&&(isNumber(minPackQtyCellValue.toString()))) {
+						Double minPackQty = Double.valueOf(minPackQtyCellValue.toString());
+						if (minPackQty <= 0) {
+							// 输入负数,默认为1
+							releaseProductByBatch.setMinPackage(DoubleConstant.minReserve);
+						}else if(NumberUtil.compare(minPackQty, DoubleConstant.maxMinPackageQty) > 0){
+							releaseProductByBatch.setMinPackage(DoubleConstant.maxMinPackageQty);
+						}else {
+							releaseProductByBatch.setMinPackage(minPackQty);
 						}
-					} else {
-						// 这个是没有输入数据默认为null
-						releaseProductByBatch.setMinPackage((double) 0);
+					}else {
+						releaseProductByBatch.setMinPackage(DoubleConstant.minReserve);
 					}
-					
+
 					// 最小起订量
-					Object minBuyCellValue = readWorkBookCell(row.getCell(8), Cell.CELL_TYPE_NUMERIC, r, 8);
-					if (minBuyCellValue != null) {
+					Object minBuyCellValue = readWorkBookCell(row.getCell(7), Cell.CELL_TYPE_STRING, r, 7);
+					releaseProductByBatch.setMinBuyQtyStr(String.valueOf(minBuyCellValue));
+					if ((minBuyCellValue != null)&&(isNumber(minBuyCellValue.toString()))) {
 						Double minBuy = Double.valueOf(minBuyCellValue.toString());
 						if (minBuy <= 0) {
 							// 输入负数
-							releaseProductByBatch.addErrmsg("9:最小起订量的数量不能是负数");
-						} else {
+							releaseProductByBatch.setMinBuyQty(releaseProductByBatch.getMinPackage());
+						}else {
 							Double rel_reserve = releaseProductByBatch.getReserve() == null ? 0 : releaseProductByBatch.getReserve();
 							int relVal = minBuy.compareTo(rel_reserve);
 							if(relVal > 0) {
-								releaseProductByBatch.addErrmsg("9:最小起订量的数量不能大于库存的数量");
+								releaseProductByBatch.setMinBuyQty(releaseProductByBatch.getReserve());
+							}else {
+								releaseProductByBatch.setMinBuyQty(minBuy);
+							}
+							if(!releaseProductByBatch.getBreakUp()) {
+								double v = releaseProductByBatch.getMinBuyQty() % releaseProductByBatch.getMinPackage();
+								if(NumberUtil.compare(v, 0.0) != 0) {
+									double sub = NumberUtil.sub(releaseProductByBatch.getMinBuyQty(), v);
+									double add = NumberUtil.add(sub, releaseProductByBatch.getMinPackage());
+									if(NumberUtil.compare(add, releaseProductByBatch.getReserve()) > 0) {
+										releaseProductByBatch.setMinBuyQty(sub);
+									}else {
+										releaseProductByBatch.setMinBuyQty(add);
+									}
+								}
 							}
-							releaseProductByBatch.setMinBuyQty(minBuy);
-						}
-					}else {
-						releaseProductByBatch.addErrmsg("9:最小起订量的数量不可以为空");
-					}
-					
-					// 最小包装量
-					Object minPackQtyCellValue = readWorkBookCell(row.getCell(9), Cell.CELL_TYPE_NUMERIC, r, 9);
-					if (minPackQtyCellValue != null) {
-						Double minPackQty = Double.valueOf(minPackQtyCellValue.toString());
-						if (minPackQty <= 0) {
-							// 输入负数
-							releaseProductByBatch.addErrmsg("10:最小包装量的数量不能是负数");
-						} else {
-							releaseProductByBatch.setMinPackage(minPackQty);
 						}
 					}else {
-						releaseProductByBatch.addErrmsg("10:最小包装量不可以为空");
-					}
-
-					// 最小包单价(人民币)
-					Object rmbPriceMinPackQtyCellValue = readWorkBookCell(row.getCell(10), Cell.CELL_TYPE_NUMERIC, r, 10);
-					if (rmbPriceMinPackQtyCellValue != null) {
-						Double rmbPrice = Double.valueOf(rmbPriceMinPackQtyCellValue.toString());
-						rmbPrice = fractionNumCeil(rmbPrice, 6);
-						releaseProductByBatch.setRmbMinPackPrice(rmbPrice);
-					}
-
-					// 最小包单价(美元)
-					Object usdPriceMinPackQtyCellValue = readWorkBookCell(row.getCell(11), Cell.CELL_TYPE_NUMERIC, r, 11);
-					if (usdPriceMinPackQtyCellValue != null) {
-						Double usdPrice = Double.valueOf(usdPriceMinPackQtyCellValue.toString());
-						usdPrice = fractionNumCeil(usdPrice, 6);
-						releaseProductByBatch.setUsdMinPackPrice(usdPrice);
+						releaseProductByBatch.setMinBuyQty(releaseProductByBatch.getMinPackage());
 					}
 
 					// 确认币别
-					Double rmbMinPackPrice = releaseProductByBatch.getRmbMinPackPrice();
-					Double usdMinPackPrice = releaseProductByBatch.getUsdMinPackPrice();
-					if (rmbMinPackPrice == null && usdMinPackPrice == null) {
-						releaseProductByBatch.addErrmsg("10-11:最小包单价至少填一种价格");
-					} else if (rmbMinPackPrice != null && usdMinPackPrice == null) {
-						releaseProductByBatch.setCurrency("RMB");
-						releaseProductByBatch.setRmbTaxRate(0.17d);
-					} else if (rmbMinPackPrice == null && usdMinPackPrice != null) {
+					if(Currency.USD.equals(currency)) {
 						releaseProductByBatch.setCurrency("USD");
 						releaseProductByBatch.setUsdTaxRate(0d);
-					} else {
-						releaseProductByBatch.setCurrency("RMB-USD");
+					}else {
+						releaseProductByBatch.setCurrency("RMB");
 						releaseProductByBatch.setRmbTaxRate(0.17d);
-						releaseProductByBatch.setUsdTaxRate(0d);
-					}
-					
-					// 生产日期
-					Object produceDateCellValue = readWorkBookCell(row.getCell(12), Cell.CELL_TYPE_STRING, r, 12);
-					if (produceDateCellValue == null) {
-						releaseProductByBatch.addErrmsg("13:产品生产日期不可以为空");
-					} else {
-						releaseProductByBatch.setProductDate(String.valueOf(produceDateCellValue));
 					}
 
-					//交期时间
-					if(releaseProductByBatch.getCurrency() != null) {
-						Object deliveryCellValue = readWorkBookCell(row.getCell(13), Cell.CELL_TYPE_STRING, r, 13);
-						if (!StringUtils.isEmpty(deliveryCellValue)) {
-							Short[] delivers = splitDeliveryString(deliveryCellValue.toString());
-							if (delivers != null) {
-								releaseProductByBatch.setB2cMinDelivery(delivers[0]);
-								releaseProductByBatch.setB2cMaxDelivery(delivers[1]);
-
-								Boolean aBoolean = deliveryTimeBetween(releaseProductByBatch.getB2cMaxDelivery(), (short) 0, (short) 9);
-								if(!aBoolean) {
-									releaseProductByBatch.addErrmsg("14:交期的不在(0,9]天");
-								}
-								Boolean bBoolean = deliveryTimeBetween(releaseProductByBatch.getB2cMinDelivery(), (short) 0, (short) 9);
-								if(!bBoolean) {
-									releaseProductByBatch.addErrmsg("14:交期的不在(0,9]天");
-								}
-							}
+					// 最小包单价
+					Object priceMinPackQtyCellValue = readWorkBookCell(row.getCell(9), Cell.CELL_TYPE_STRING, r, 9);
+					releaseProductByBatch.setMinPackPriceStr(String.valueOf(priceMinPackQtyCellValue));
+					if ((priceMinPackQtyCellValue != null)&&(isNumber(priceMinPackQtyCellValue.toString()))) {
+						Double price = Double.valueOf(priceMinPackQtyCellValue.toString());
+						price = fractionNumCeil(price, 6);
+						if(Currency.USD.equals(currency)) {
+							releaseProductByBatch.setUsdMinPackPrice(price);
+						}else {
+							releaseProductByBatch.setRmbMinPackPrice(price);
 						}
+					}else {
+						releaseProductByBatch.addErrmsg("10:最小包单价信息为空");
 					}
 
-//					// 大陆交期
-//					if(releaseProductByBatch.getCurrency() != null && releaseProductByBatch.getCurrency().contains("RMB")) {
-//						Object deliveryCellValue = readWorkBookCell(row.getCell(13), Cell.CELL_TYPE_STRING, r, 13);
-//						if (!StringUtils.isEmpty(deliveryCellValue)) {
-//							Short[] delivers = splitDeliveryString(deliveryCellValue.toString());
-//							if (delivers != null) {
-//								releaseProductByBatch.setMindeliveryDemTime(delivers[0]);
-//								releaseProductByBatch.setMaxdeliveryDemTime(delivers[1]);
-//
-//								Boolean aBoolean = deliveryTimeBetween(releaseProductByBatch.getMaxdeliveryDemTime(), (short) 0, (short) 9);
-//								if(!aBoolean) {
-//									releaseProductByBatch.addErrmsg("14:大陆交期的不在(0,9]天");
-//								}
-//								Boolean bBoolean = deliveryTimeBetween(releaseProductByBatch.getMindeliveryDemTime(), (short) 0, (short) 9);
-//								if(!bBoolean) {
-//									releaseProductByBatch.addErrmsg("14:大陆交期的不在(0,9]天");
-//								}
-//							}
-//						}
-//					}
-//
-//					// 香港交期
-//					if(releaseProductByBatch.getCurrency() != null && releaseProductByBatch.getCurrency().contains("USD")) {
-//						Object deliveryhkCellValue = readWorkBookCell(row.getCell(14), Cell.CELL_TYPE_STRING, r, 14);
-//						if (!StringUtils.isEmpty(deliveryhkCellValue)) {
-//							Short[] deliverys = splitDeliveryString(deliveryhkCellValue.toString());
-//							if (deliverys != null) {
-//								releaseProductByBatch.setMindeliveryHKTime(deliverys[0]);
-//								releaseProductByBatch.setMaxdeliveryHKTime(deliverys[1]);
-//
-//								Boolean aBoolean = deliveryTimeBetween(releaseProductByBatch.getMindeliveryHKTime(), (short) 0, (short) 9);
-//								if(!aBoolean) {
-//									releaseProductByBatch.addErrmsg("15:香港交期的不在(0,9]天");
-//								}
-//								Boolean bBoolean = deliveryTimeBetween(releaseProductByBatch.getMaxdeliveryHKTime(), (short) 0, (short) 9);
-//								if(!bBoolean) {
-//									releaseProductByBatch.addErrmsg("15:香港交期的不在(0,9]天");
-//								}
-//							}
-//						}
-//					}
-
-					if (releaseProductByBatch.getB2cMaxDelivery() == null) {
-						releaseProductByBatch.addErrmsg("14-15:您必须填写交期时间");
+					Object deliveryMinCellValue = readWorkBookCell(row.getCell(10), Cell.CELL_TYPE_STRING, r, 10);
+					Object deliveryMaxCellValue = readWorkBookCell(row.getCell(11), Cell.CELL_TYPE_STRING, r, 11);
+					releaseProductByBatch.setSelfMinDeliveryStr(String.valueOf(deliveryMinCellValue));
+					releaseProductByBatch.setSelfMaxDeliveryStr(String.valueOf(deliveryMaxCellValue));
+					if(StringUtils.isEmpty(deliveryMinCellValue) && StringUtils.isEmpty(deliveryMaxCellValue)) {
+						releaseProductByBatch.addErrmsg("11-12:存在交期的信息为空");
+					}else {
+						setDeliveryTime(releaseProductByBatch, deliveryMinCellValue, deliveryMaxCellValue);
 					}
 
-//					if("RMB-USD".equals(releaseProductByBatch.getCurrency())) {
-//						if(releaseProductByBatch.getMaxdeliveryDemTime() == null ||  releaseProductByBatch.getMaxdeliveryHKTime() == null) {
-//							releaseProductByBatch.addErrmsg("14-15:您上架的币别是人民币和美金,所以香港和大陆的交期都需要填写");
-//						}
-//					}else if("RMB".equals(releaseProductByBatch.getCurrency())) {
-//						if(releaseProductByBatch.getMaxdeliveryDemTime() == null) {
-//							releaseProductByBatch.addErrmsg("14-15:您上架的币别是人民币,所以大陆交期需要填写");
-//						}
-//					}else if("USD".equals(releaseProductByBatch.getCurrency())) {
-//						if(releaseProductByBatch.getMaxdeliveryHKTime() == null) {
-//							releaseProductByBatch.addErrmsg("14-15:您上架的币别是美金,所以香港交期需要填写");
-//						}
-//					}else {
-//						if(releaseProductByBatch.getMaxdeliveryHKTime() == null && releaseProductByBatch.getMaxdeliveryHKTime() == null) {
-//							releaseProductByBatch.addErrmsg("14-15:您必须要填写一个类型的交期");
-//						}
-//					}
-
 					// 分段数量
 					List<GoodsQtyPrice> prices = new ArrayList<GoodsQtyPrice>();
-					Double[] priceMaxMinPrice = {Double.MAX_VALUE, Double.MIN_VALUE, Double.MAX_VALUE, Double.MIN_VALUE}; //最小人民币价格,最大人民币价格,最小美金价格,最大美金价格
+					Double[] priceMaxMinPrice = {Double.MAX_VALUE, Double.MIN_VALUE}; //最小价格,最大价格
 					for (int i = 0; i < 3; i++) {
-						// 起始量必须等于最小起定量
-						readSectionPrice(row.getCell(15 + 3 * i), row.getCell(16 + 3 * i), row.getCell(17 + 3 * i),
-								prices, releaseProductByBatch, r, (15 + 3 * i), priceMaxMinPrice);
+						//起始量必须等于最小起定量
+						readSectionPrice(row.getCell(12 + 2 * i), row.getCell(13 + 2 * i),
+								prices, releaseProductByBatch, r, (12 + 2 * i), priceMaxMinPrice, i);
 					}
 					if (!CollectionUtils.isEmpty(prices)) {
-						double start = -1;
-						for (int j = 0; j < prices.size(); j++) {
-							GoodsQtyPrice price = prices.get(j);
-							if(j == 0) {
-								int val = price.getStart().compareTo(releaseProductByBatch.getMinBuyQty());
-								if(val != 0) {
-									releaseProductByBatch.addErrmsg("16:第一个分段数量的起始值与最小起订量不相等");
-								}
-							}
-
-							// 判断输入的后一个分段是否大于前一个分段
-							if (start < price.getStart()) {
-								start = price.getStart();
-							} else {
-								releaseProductByBatch.addErrmsg("16:分段数量起始值存在后一个分段的开始值小于前一个分段的开始值");
-							}
-
-							if (j < prices.size() - 1) {
-								price.setEnd(prices.get(j + 1).getStart() - 1);
-							}
-							if (j == prices.size() - 1) {
-								price.setEnd(reserve);
-							}
-						}
+						prices = setPricesQty(prices, releaseProductByBatch);
 					} else {
 						// 如果未填分段价格,默认为最小包装量价格
 						GoodsQtyPrice qtyPrice = new GoodsQtyPrice();
-						qtyPrice.setStart(releaseProductByBatch.getMinBuyQty());
-						if (rmbMinPackPrice != null) {
-							qtyPrice.setRMBPrice(rmbMinPackPrice);
-							BigDecimal priceNum = new BigDecimal(rmbMinPackPrice);
-							BigDecimal taxNum = new BigDecimal(releaseProductByBatch.getRmbTaxRate() + 1);
-							qtyPrice.setRMBNTPrice(priceNum.divide(taxNum, 6, BigDecimal.ROUND_HALF_UP).doubleValue());
-							priceMaxMinPrice[0] = rmbMinPackPrice;
-							priceMaxMinPrice[1] = rmbMinPackPrice;
-						}
-						if (usdMinPackPrice != null) {
-							qtyPrice.setUSDPrice(usdMinPackPrice);
-							qtyPrice.setUSDNTPrice(usdMinPackPrice);
-							priceMaxMinPrice[2] = usdMinPackPrice;
-							priceMaxMinPrice[3] = usdMinPackPrice;
+						qtyPrice.setStart(DoubleConstant.minReserve);
+						if(Currency.USD.equals(releaseProductByBatch.getCurrency())) {
+							Double usdMinPackPrice = releaseProductByBatch.getUsdMinPackPrice();
+							if(usdMinPackPrice != null) {
+								qtyPrice.setUSDPrice(usdMinPackPrice);
+								qtyPrice.setUSDNTPrice(usdMinPackPrice);
+								priceMaxMinPrice[0] = usdMinPackPrice;
+								priceMaxMinPrice[1] = usdMinPackPrice;
+							}
+
+						}else {
+							Double rmbMinPackPrice = releaseProductByBatch.getRmbMinPackPrice();
+							if(rmbMinPackPrice != null) {
+								qtyPrice.setRMBPrice(rmbMinPackPrice);
+								BigDecimal priceNum = new BigDecimal(rmbMinPackPrice);
+								BigDecimal taxNum = new BigDecimal(releaseProductByBatch.getRmbTaxRate() + 1);
+								qtyPrice.setRMBNTPrice(priceNum.divide(taxNum, 6, BigDecimal.ROUND_HALF_UP).doubleValue());
+								priceMaxMinPrice[0] = rmbMinPackPrice;
+								priceMaxMinPrice[1] = rmbMinPackPrice;
+							}
 						}
-						qtyPrice.setEnd(reserve);
+						qtyPrice.setEnd(DoubleConstant.maxReserve);
 						prices.add(qtyPrice);
 					}
 					releaseProductByBatch.setPrices(prices);
-					if(!priceMaxMinPrice[0].equals(Double.MAX_VALUE)) {
-						releaseProductByBatch.setMinPriceRMB(priceMaxMinPrice[0]);
-					}
-					if(!priceMaxMinPrice[1].equals(Double.MIN_VALUE)) {
-						releaseProductByBatch.setMaxPriceRMB(priceMaxMinPrice[1]);
-					}
-					if(!priceMaxMinPrice[2].equals(Double.MAX_VALUE)) {
-						releaseProductByBatch.setMinPriceUSD(priceMaxMinPrice[2]);
-					}
-					if(!priceMaxMinPrice[3].equals(Double.MIN_VALUE)) {
-						releaseProductByBatch.setMaxPriceUSD(priceMaxMinPrice[3]);
+					if(Currency.USD.equals(releaseProductByBatch.getCurrency())) {
+						if(NumberUtil.compare(priceMaxMinPrice[0], Double.MAX_VALUE) == 0) {
+							releaseProductByBatch.setMinPriceUSD(null);
+						}else {
+							releaseProductByBatch.setMinPriceUSD(priceMaxMinPrice[0]);
+						}
+						if(NumberUtil.compare(priceMaxMinPrice[1], Double.MIN_VALUE) == 0) {
+							releaseProductByBatch.setMaxPriceUSD(null);
+						}else {
+							releaseProductByBatch.setMaxPriceUSD(priceMaxMinPrice[1]);
+						}
+					}else {
+						if(NumberUtil.compare(priceMaxMinPrice[0], Double.MAX_VALUE) == 0) {
+							releaseProductByBatch.setMinPriceRMB(null);
+						}else {
+							releaseProductByBatch.setMinPriceRMB(priceMaxMinPrice[0]);
+						}
+						if(NumberUtil.compare(priceMaxMinPrice[1], Double.MIN_VALUE) == 0) {
+							releaseProductByBatch.setMaxPriceRMB(null);
+						}else {
+							releaseProductByBatch.setMaxPriceRMB(priceMaxMinPrice[1]);
+						}
 					}
 
+
 					// 备注
-					Object remarkCellValue = readWorkBookCell(row.getCell(23), Cell.CELL_TYPE_STRING, r, 23);
+					Object remarkCellValue = readWorkBookCell(row.getCell(20), Cell.CELL_TYPE_STRING, r, 20);
 					if (!StringUtils.isEmpty(remarkCellValue)) {
 						String remark = remarkCellValue.toString();
 						releaseProductByBatch.setRemark(remark);
@@ -435,13 +379,11 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 					releaseProductByBatch.setPublisherTel(SystemSession.getUser().getUserTel());
 					releaseProductByBatch.setPublisherUu(SystemSession.getUser().getUserUU());
 					releaseProductByBatch.setStoreid(storeid);
-					StoreIn storeIn = storeInDao.findByUuid(storeid);
-					if (storeIn == null) {
-						throw new IllegalOperatorException("店铺不存在");
-
+					releaseProductByBatch.setStoreName(storeName);
+					if(!StringUtils.isEmpty(releaseProductByBatch.getErrmsg())) {
+						releaseProductByBatch.setReleaseCode(ReleaseStatus.failure.value());
+						releaseProductByBatch.setReleaseStatus(ReleaseStatus.failure.getPhrase());
 					}
-					releaseProductByBatch.setStoreName(storeIn.getStoreName());
-
 					releaseProductByBatch.setUnit("PCS");
 					releaseProductByBatch.setCreateDate(new Date());
 					releaseProductByBatchs.add(releaseProductByBatch);
@@ -462,6 +404,112 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	}
 
 	/**
+	 * 分析分段的价格
+ 	 */
+	private List<GoodsQtyPrice> setPricesQty(List<GoodsQtyPrice> prices, ReleaseProductByBatch productByBatch) {
+		GoodsQtyPrice[] array = new GoodsQtyPrice[prices.size()];
+		prices.toArray(array);
+		Arrays.sort(array, new Comparator<GoodsQtyPrice>() {
+			@Override
+			public int compare(GoodsQtyPrice o1, GoodsQtyPrice o2) {
+				return NumberUtil.compare(o1.getEnd(), o2.getEnd());
+			}
+		});
+		List<GoodsQtyPrice> prices1 = Arrays.asList(array);
+		List<GoodsQtyPrice> prices2 = new ArrayList<>();
+		for (int j = 0; j < prices1.size(); j++) {
+			GoodsQtyPrice price = prices1.get(j);
+			if(j == 0) {
+				if(NumberUtil.compare(price.getEnd(), DoubleConstant.minReserve) > 0) {
+					price.setStart(DoubleConstant.minReserve);
+					prices2.add(price);
+				}
+			}else if (j < prices1.size() - 1) {
+				GoodsQtyPrice qtyPrice = prices1.get(j - 1);
+				if(NumberUtil.compare(qtyPrice.getEnd(), price.getEnd()) < 0 ) {
+					price.setStart(NumberUtil.add(qtyPrice.getEnd(), 1.0d));
+					prices2.add(price);
+				}
+			}else if (j == prices1.size() - 1) {
+				price.setEnd(DoubleConstant.maxReserve);
+				if(prices1.size() == 1) {
+					price.setStart(DoubleConstant.minReserve);
+				}else {
+					price.setStart(NumberUtil.add(prices1.get(j - 1).getEnd(), 1.0d));
+				}
+				prices2.add(price);
+			}
+		}
+		return prices2;
+	}
+
+	/**
+	 * 获取店铺的信息
+	 * @param selfSale
+	 * @return
+	 */
+	private StoreIn getStoreInfo(Boolean selfSale) {
+		StoreIn storeIn = null;
+		if(selfSale) {
+			storeIn = storeInService.findByEnUU(SystemSession.getUser().getEnterprise().getUu());
+			if((storeIn == null) || (storeIn.getStatus() != StoreStatus.OPENED)) {
+				throw new IllegalOperatorException("您的公司还为开店,不能选择自营");
+			}
+		}else {
+			storeIn = storeInService.findByUuid(SysConf.getStoreid());
+		}
+		return storeIn;
+	}
+
+	private Boolean isNumber(String str) {
+		Pattern numberPattern = Pattern.compile(RegexConstant.NumberData);
+		Matcher matcher = numberPattern.matcher(str);
+		if(matcher.find()) {
+			return true;
+		}else {
+			return false;
+		}
+	}
+
+	/**
+	 * 设置交期的信息
+	 */
+	private void setDeliveryTime(ReleaseProductByBatch releaseProductByBatch, Object minDelivery, Object maxDelivery) {
+		minDelivery = minDelivery == null ? maxDelivery : minDelivery;
+		maxDelivery = maxDelivery == null ? minDelivery : maxDelivery;
+		Pattern intMinP = Pattern.compile(RegexConstant.Integer);
+		Matcher intMinM = intMinP.matcher(minDelivery.toString());
+		Short min = null, max = null;
+		if(intMinM.find()) {
+			String g = intMinM.group();
+			min = Short.valueOf(g);
+		}
+		Pattern intMaxP = Pattern.compile(RegexConstant.Integer);
+		Matcher intMaxM = intMaxP.matcher(maxDelivery.toString());
+		if(intMaxM.find()) {
+			String g = intMaxM.group();
+			max = Short.valueOf(g);
+		}
+		if((min != null) || (max != null)) {
+			min  = min == null ? max : min;
+			max  = max == null ? min : max;
+			if(min.shortValue() > ShortConstant.maxDelivery || min.shortValue() < 0 || max.shortValue() > Short.MAX_VALUE || max.shortValue() < 0){
+				releaseProductByBatch.addErrmsg("11-12:交期的信息必须为正整数并且小于" + ShortConstant.maxDelivery);
+			}else {
+				if(min.shortValue() > max.shortValue()) {
+					Short delivery = max;
+					max  = min;
+					min = delivery;
+				}
+				releaseProductByBatch.setSelfMinDelivery(min);
+				releaseProductByBatch.setSelfMaxDelivery(max);
+			}
+		}else {
+			releaseProductByBatch.addErrmsg("11-12:交期的信息必须为正整数并且小于" + ShortConstant.maxDelivery);
+		}
+	}
+
+ 	/**
 	 * 创建时间 :2016年12月11日 下午2:02:16
 	 * 
 	 * @author yujia
@@ -574,8 +622,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	 * 
 	 * @author yujia
 	 * @param cellQty
-	 * @param cellPriceRMB
-	 * @param cellPriceUSD
+	 * @param cellPrice
 	 * @param prices
 	 * @param releaseProductByBatch
 	 * @param r
@@ -585,85 +632,41 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	 *             获取每一个分段的的数量
 	 * 
 	 */
-	private void readSectionPrice(Cell cellQty, Cell cellPriceRMB, Cell cellPriceUSD, List<GoodsQtyPrice> prices,
-			ReleaseProductByBatch releaseProductByBatch, int r, int num, Double[] priceMaxMinPrice) {
+	private void readSectionPrice(Cell cellQty, Cell cellPrice, List<GoodsQtyPrice> prices,
+			ReleaseProductByBatch releaseProductByBatch, int r, int num, Double[] priceMaxMinPrice, int i) {
 		// 先跟据币别判断对应的价格是否有空值
-		Object startQtyCellValue = readWorkBookCell(cellQty, Cell.CELL_TYPE_NUMERIC, r, num);
-		if (startQtyCellValue != null) {
-			Double start = Double.valueOf(startQtyCellValue.toString());
+		Object endQtyCellValue = readWorkBookCell(cellQty, Cell.CELL_TYPE_STRING, r, num);
+		releaseProductByBatch.setFragmentQty(String.valueOf(endQtyCellValue), i);
+
+		Object priceCellValue = readWorkBookCell(cellPrice, Cell.CELL_TYPE_STRING, r, num + 1);
+		releaseProductByBatch.setFragmentPrice(String.valueOf(priceCellValue), i);
+		if ((endQtyCellValue != null)&&(isNumber(endQtyCellValue.toString()))) {
+			Double end = Double.valueOf(endQtyCellValue.toString());
 			GoodsQtyPrice qtyPrice = new GoodsQtyPrice();
-			// 分段数量start不得大于库存量
-			if (start > releaseProductByBatch.getReserve() || start <= 0) {
-				releaseProductByBatch.addErrmsg("11: 分段数量存在起始值大于库存量或者开始数量小于0");
-			}
-			qtyPrice.setStart(start);
-			
-			String currency = releaseProductByBatch.getCurrency();
-
-			// 人民币价格
-			if(currency != null && currency.contains("RMB")) {
-				Double pricermb = null;
-				Object pricermbReadWorkBookCellValue = readWorkBookCell(cellPriceRMB, Cell.CELL_TYPE_NUMERIC, r, num+1);
-				if (pricermbReadWorkBookCellValue != null) {
-					pricermb = Double.valueOf(pricermbReadWorkBookCellValue.toString());
-				}
-				if (pricermb != null && pricermb > 0.0) {
-					pricermb = fractionNumCeil(pricermb, 6);
-					qtyPrice.setRMBPrice(pricermb);
-					BigDecimal taxNum = new BigDecimal(releaseProductByBatch.getRmbTaxRate() + 1);
-					qtyPrice.setRMBNTPrice(new BigDecimal(pricermb).divide(taxNum, 6, BigDecimal.ROUND_HALF_UP).doubleValue());
-					if(priceMaxMinPrice[0] > pricermb) {
-						priceMaxMinPrice[0] = pricermb;
-					}
-					if(priceMaxMinPrice[1] < pricermb) {
-						priceMaxMinPrice[1] = pricermb;
-					}
-				}
+			// 分段结束值 与最小库存比较
+			if (NumberUtil.compare(end, DoubleConstant.minReserve) < 1) {
+				return ;
 			}
+			qtyPrice.setEnd(end);
 
-			if(currency != null && currency.contains("USD")) {
-				// 美金价格
-				Double priceusd = null;
-				Object priceusdReadWorkBookCellValue = readWorkBookCell(cellPriceUSD, Cell.CELL_TYPE_NUMERIC, r, num+2);
-				if (priceusdReadWorkBookCellValue != null) {
-					priceusd = Double.valueOf(priceusdReadWorkBookCellValue.toString());
-				}
-				if (priceusd != null && priceusd > 0) {
-					priceusd = fractionNumCeil(priceusd, 6);
-					qtyPrice.setUSDPrice(priceusd);
-					qtyPrice.setUSDNTPrice(priceusd);
-					if(priceMaxMinPrice[2] > priceusd) {
-						priceMaxMinPrice[2] = priceusd;
-					}
-					if(priceMaxMinPrice[3] < priceusd) {
-						priceMaxMinPrice[3] = priceusd;
-					}
-				}
+			Double price = null;
+			if((priceCellValue != null)&&(isNumber(priceCellValue.toString()))) {
+				price = Double.valueOf(priceCellValue.toString());
 			}
-
-			// 验证信息的一致性
-			Double rmbPrice = qtyPrice.getRMBPrice();
-			Double usdPrice = qtyPrice.getUSDPrice();
-			
-			boolean isUnit = true;
-			if ("RMB".equalsIgnoreCase(currency)) {
-				if (rmbPrice == null) {
-					isUnit = false;
-				}
-			} else if ("RMB-USD".equalsIgnoreCase(currency)) {
-				if (rmbPrice == null || usdPrice == null) {
-					isUnit = false;
-				}
-			} else if ("USD".equalsIgnoreCase(currency)) {
-				if (usdPrice == null) {
-					isUnit = false;
+			if ((price != null) && (NumberUtil.compare(price, DoubleConstant.zero) > 0)) {
+				price = fractionNumCeil(price, 6);
+				if(Currency.USD.equals(releaseProductByBatch.getCurrency())) {
+					qtyPrice.setUSDPrice(price);
+					qtyPrice.setUSDNTPrice(price);
+				}else {
+					qtyPrice.setRMBPrice(price);
+					BigDecimal taxNum = new BigDecimal(releaseProductByBatch.getRmbTaxRate() + 1);
+					qtyPrice.setRMBNTPrice(new BigDecimal(price).divide(taxNum, 6, BigDecimal.ROUND_HALF_UP).doubleValue());
 				}
+				priceMaxMinPrice[0] = NumberUtil.compare(priceMaxMinPrice[0], price) > 0 ? price : priceMaxMinPrice[0];
+				priceMaxMinPrice[1] = NumberUtil.compare(priceMaxMinPrice[1], price) < 0 ? price : priceMaxMinPrice[1];
+				prices.add(qtyPrice);
 			}
-			if (!isUnit) {
-				releaseProductByBatch.addErrmsg("11: 前后的价格信息不一致,例如最小包单价填了人民币和美金,后面的分段只填了人民币");
-			}
-
-			prices.add(qtyPrice);
 		}
 	}
 

+ 42 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/status/ReleaseBatchStatus.java

@@ -0,0 +1,42 @@
+package com.uas.platform.b2c.prod.commodity.status;
+
+/**
+ * description
+ *
+ * @author yuj 2017-09-05 20:48
+ */
+public enum  ReleaseBatchStatus {
+
+    INFO_DEFICIENCY(111, "关键信息缺失,或格式不正确"),
+
+    PUBLISH(101, "已发布"),
+
+    MATCH_FAILURE(121, "匹配失败");
+
+    private Integer code;
+
+    private String message;
+
+    ReleaseBatchStatus(Integer code, String message) {
+        this.code = code;
+        this.message = message;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public ReleaseBatchStatus setCode(Integer code) {
+        this.code = code;
+        return this;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public ReleaseBatchStatus setMessage(String message) {
+        this.message = message;
+        return this;
+    }
+}

+ 13 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/type/ReleaseConstant.java

@@ -0,0 +1,13 @@
+package com.uas.platform.b2c.prod.commodity.type;
+
+/**
+ * 批量上架可拆卖的常量
+ *
+ * @author yuj 2017-09-07 15:59
+ */
+public class ReleaseConstant {
+
+    public static final String YES= "是";
+
+    public static final String NO = "否";
+}

+ 59 - 23
src/main/java/com/uas/platform/b2c/prod/product/component/modal/ComponentGoods.java

@@ -223,29 +223,29 @@ public class ComponentGoods implements Serializable {
 	@Column(name = "go_update_date")
 	private Date updateDate;
 	
-//	/**
-//	 * 货到香港交期最短
-//	 */
-//	@Column(name = "go_b2cdeliveryhkmintime")
-//	private Short b2cDeliveryHKMinTime;
-//
-//	/**
-//	 * 货到香港交期最长
-//	 */
-//	@Column(name = "go_b2cdeliveryhkmaxtime")
-//	private Short b2cDeliveryHKMaxTime;
-//
-//	/**
-//	 * 货到大陆交期最短
-//	 */
-//	@Column(name = "go_b2cdeliverydemintime")
-//	private Short b2cDeliveryDemMinTime;
-//
-//	/**
-//	 * 货到大陆交期最长
-//	 */
-//	@Column(name = "go_b2cdeliverydemaxtime")
-//	private Short b2cDeliveryDemMaxTime;
+	/**
+	 * 货到香港交期最短
+	 */
+	@Column(name = "go_b2cdeliveryhkmintime")
+	private Short b2cDeliveryHKMinTime;
+
+	/**
+	 * 货到香港交期最长
+	 */
+	@Column(name = "go_b2cdeliveryhkmaxtime")
+	private Short b2cDeliveryHKMaxTime;
+
+	/**
+	 * 货到大陆交期最短
+	 */
+	@Column(name = "go_b2cdeliverydemintime")
+	private Short b2cDeliveryDemMinTime;
+
+	/**
+	 * 货到大陆交期最长
+	 */
+	@Column(name = "go_b2cdeliverydemaxtime")
+	private Short b2cDeliveryDemMaxTime;
 
 	/**
 	 * 商城最长交期
@@ -618,4 +618,40 @@ public class ComponentGoods implements Serializable {
 	public void setStoreName(String storeName) {
 		this.storeName = storeName;
 	}
+
+	public Short getB2cDeliveryHKMinTime() {
+		return b2cDeliveryHKMinTime;
+	}
+
+	public ComponentGoods setB2cDeliveryHKMinTime(Short b2cDeliveryHKMinTime) {
+		this.b2cDeliveryHKMinTime = b2cDeliveryHKMinTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryHKMaxTime() {
+		return b2cDeliveryHKMaxTime;
+	}
+
+	public ComponentGoods setB2cDeliveryHKMaxTime(Short b2cDeliveryHKMaxTime) {
+		this.b2cDeliveryHKMaxTime = b2cDeliveryHKMaxTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryDemMinTime() {
+		return b2cDeliveryDemMinTime;
+	}
+
+	public ComponentGoods setB2cDeliveryDemMinTime(Short b2cDeliveryDemMinTime) {
+		this.b2cDeliveryDemMinTime = b2cDeliveryDemMinTime;
+		return this;
+	}
+
+	public Short getB2cDeliveryDemMaxTime() {
+		return b2cDeliveryDemMaxTime;
+	}
+
+	public ComponentGoods setB2cDeliveryDemMaxTime(Short b2cDeliveryDemMaxTime) {
+		this.b2cDeliveryDemMaxTime = b2cDeliveryDemMaxTime;
+		return this;
+	}
 }

+ 12 - 0
src/main/java/com/uas/platform/b2c/trade/order/StringConstant/Currency.java

@@ -0,0 +1,12 @@
+package com.uas.platform.b2c.trade.order.StringConstant;
+
+/**
+ * 币别常量
+ *
+ * @author yuj 2017-09-07 9:57
+ */
+public class Currency {
+    public static final String RMB = "RMB";
+
+    public static final String USD = "USD";
+}

+ 1 - 1
src/main/java/com/uas/platform/b2c/trade/order/controller/OrderController.java

@@ -883,7 +883,7 @@ public class OrderController {
 	/**
 	 * 根据订单号获取Order对象
 	 *
-	 * @param enOrderid 加密的订单id
+	 * @param enOrderid 加密的订单idp
 	 * @return
 	 */
 	@RequestMapping(value = "/findStatus")

+ 28 - 9
src/main/java/com/uas/platform/b2c/trade/order/model/OrderDetail.java

@@ -849,20 +849,39 @@ public class OrderDetail extends Document implements Serializable{
 			this.number = goods.getMinBuyQty();
 			return ;
 		}
-		double times = NumberUtil.div(this.number, this.minPackQty);
-		double qty1 = NumberUtil.mul(times, goods.getMinPackQty());
-		if(NumberUtil.compare(qty1, goods.getMinBuyQty()) <= 0) {
-			this.number = goods.getMinBuyQty();
-		}else if(NumberUtil.compare(qty1, goods.getReserve()) <= 0) {
-			this.number = qty1;
+		if(this.minPackQty == null) {
+			this.minPackQty = goods.getMinPackQty();
+		}
+		if(goods.getBreakUp()) {
+			if(NumberUtil.compare(this.number, goods.getMinBuyQty()) < 0) {
+				this.number = goods.getMinBuyQty();
+			}
 		}else {
-			while (NumberUtil.compare(qty1, goods.getReserve()) > 0) {
-				qty1 -= goods.getMinPackQty();
+			Double remind = this.number % goods.getMinPackQty();
+			if(NumberUtil.compare(remind, 0.0) != 0) {
+				this.number = goods.getMinBuyQty();
 			}
-			this.number = qty1;
+//			double times = NumberUtil.div(this.number, this.minPackQty)
+//			double qty1 = NumberUtil.mul(times, goods.getMinPackQty());
+//			if(NumberUtil.compare(qty1, goods.getMinBuyQty()) <= 0) {
+//				this.number = goods.getMinBuyQty();
+//			}else if(NumberUtil.compare(qty1, goods.getReserve()) <= 0) {
+//				this.number = qty1;
+//			}else {
+//				this.number = NumberUtil.sub(goods.getReserve(), goods.getReserve() % goods.getMinPackQty());
+//			}
 		}
 	}
 
+	public void setDeliveryTime(Goods goods) {
+		if(goods.getB2cMaxDelivery() != null) {
+			this.b2cMaxDelivery = goods.getB2cMaxDelivery();
+			this.b2cMinDelivery = goods.getB2cMinDelivery();
+		}else {
+			this.b2cMaxDelivery = goods.getCurrencyName().indexOf("USD") > -1 ? goods.getB2cDeliveryHKMaxTime() : goods.getB2cDeliveryDemMaxTime();
+			this.b2cMinDelivery = goods.getCurrencyName().indexOf("USD") > -1 ? goods.getB2cDeliveryHKMinTime() : goods.getB2cDeliveryDemMinTime();
+		}
+	}
 	/**
 	 * Gets taxes.
 	 *

+ 12 - 11
src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderDetailServiceImpl.java

@@ -12,6 +12,7 @@ import com.uas.platform.b2c.prod.commodity.service.GoodsService;
 import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
 import com.uas.platform.b2c.prod.product.component.modal.Component;
+import com.uas.platform.b2c.trade.order.StringConstant.Currency;
 import com.uas.platform.b2c.trade.order.dao.OrderDao;
 import com.uas.platform.b2c.trade.order.dao.OrderDetailDao;
 import com.uas.platform.b2c.trade.order.dao.PurchaseDetailDao;
@@ -199,12 +200,7 @@ public class OrderDetailServiceImpl implements OrderDetailService {
 		orderDetail.setImg(goods.getImg());
 		orderDetail.setStoreid(goods.getStoreid());
 		orderDetail.setStoreName(goods.getStoreName());
-		if (goods.getB2cMaxDelivery() != null){
-			orderDetail.setB2cMaxDelivery(goods.getB2cMaxDelivery());
-		}
-		if (goods.getB2cMinDelivery() != null){
-			orderDetail.setB2cMinDelivery(goods.getB2cMinDelivery());
-		}
+		orderDetail.setDeliveryTime(goods);
 		String detailid = EncodingRulesConstant.ORDER_DETAIL.replace("_TIMESTAP_NUMBER", createNumberService.getTimeNumber("trade$order_detail", 9));
 		orderDetail.setDetailid(detailid);
 		return orderDetail;
@@ -550,11 +546,16 @@ public class OrderDetailServiceImpl implements OrderDetailService {
 		detail.setImg(goods.getImg());
 		detail.setStoreid(goods.getStoreid());
 		detail.setStoreName(goods.getStoreName());
-		if (goods.getB2cMaxDelivery() != null){
-			detail.setB2cMaxDelivery(goods.getB2cMaxDelivery());
-		}
-		if (goods.getB2cMinDelivery() != null){
-			detail.setB2cMinDelivery(goods.getB2cMinDelivery());
+		if(Currency.RMB.equals(detail.getCurrencyName())) {
+			Short maxDelivery = goods.getB2cMaxDelivery() == null ? goods.getB2cDeliveryDemMaxTime() : goods.getB2cMaxDelivery();
+			detail.setB2cMaxDelivery(maxDelivery);
+			Short minDelivery = goods.getB2cMinDelivery() == null ? goods.getB2cDeliveryHKMinTime()  : goods.getB2cMinDelivery();
+			detail.setB2cMinDelivery(minDelivery);
+		}else {
+			Short maxDelivery = goods.getB2cMaxDelivery() == null ? goods.getB2cDeliveryHKMaxTime() : goods.getB2cMaxDelivery();
+			detail.setB2cMaxDelivery(maxDelivery);
+			Short minDelivery = goods.getB2cMinDelivery() == null ? goods.getB2cDeliveryHKMinTime()  : goods.getB2cMinDelivery();
+			detail.setB2cMinDelivery(minDelivery);
 		}
 		Order order = detail.getOrder();
 		orderService.updateByDetail(order);

+ 11 - 4
src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java

@@ -45,6 +45,7 @@ import com.uas.platform.b2c.prod.product.component.modal.Component;
 import com.uas.platform.b2c.prod.product.component.service.ComponentService;
 import com.uas.platform.b2c.prod.store.dao.StoreInDao;
 import com.uas.platform.b2c.prod.store.model.StoreIn;
+import com.uas.platform.b2c.prod.store.model.StoreStatus;
 import com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus;
 import com.uas.platform.b2c.trade.deprecated.model.OrderRelationInfo;
 import com.uas.platform.b2c.trade.deprecated.model.UserInfoForOrder;
@@ -760,8 +761,8 @@ public class OrderServiceImpl implements OrderService {
             or.setOrderRemark(orRemark);
 
             StoreIn storeIn = storeInDao.findByUuid(storeid);
-            if (storeIn == null) {
-                throw new IllegalOperatorException("对应的店铺的信息不存在");
+            if (storeIn == null && storeIn.getStatus() != StoreStatus.OPENED) {
+                throw new IllegalOperatorException("该公司还未开店,产品不能自营销售");
             }
             or.setStoreid(storeid);
             or.setStoreName(storeIn.getStoreName());
@@ -834,10 +835,16 @@ public class OrderServiceImpl implements OrderService {
                 detailInfo = (JSONObject) object;
                 if (id.equals(detailInfo.getLong("id"))) {
                     detail.setNumber(detailInfo.getDouble("number"));
-                    detail.setTaxUnitprice(detailInfo.getDouble("taxUnitprice"));
+                    Goods goods = goodsDao.findByBatchCode(detail.getBatchCode());
+                    if(goods == null) {
+                        unvailable++;
+                        continue;
+                    }
+                    detail.setNumber(goods);
+                    detail.setDeliveryTime(goods);
+                    detail.setPircesByNumber(goods.getPrices(), detail.getNumber());
                     detail.setRemark(detailInfo.getString("remark"));
                     String storeid = detailInfo.getString("storeid");
-                    Goods goods = goodsDao.findByBatchCode(detail.getBatchCode());
                     if(!goods.getStoreid().equals(storeid)) {
                         detail.setStoreid(goods.getStoreid());
                         detail.setStoreName(goods.getStoreName());

+ 24 - 10
src/main/java/com/uas/platform/b2c/trade/presale/model/Cart.java

@@ -303,17 +303,30 @@ public class Cart {
 			this.number = goods.getMinBuyQty();
 			return ;
 		}
-		double times = NumberUtil.div(this.number, this.minPackQty);
-		double qty1 = NumberUtil.mul(times, goods.getMinPackQty());
-		if(NumberUtil.compare(qty1, goods.getMinBuyQty()) <= 0) {
-			this.number = goods.getMinBuyQty();
-		}else if(NumberUtil.compare(qty1, goods.getReserve()) <= 0) {
-			this.number = qty1;
+		if(this.minPackQty == null) {
+			this.minPackQty = goods.getMinPackQty();
+		}
+		if(goods.getBreakUp()) {
+			if(NumberUtil.compare(this.number, goods.getMinBuyQty()) < 0) {
+				this.number = goods.getMinBuyQty();
+			}
 		}else {
-			while (NumberUtil.compare(qty1, goods.getReserve()) > 0) {
-				qty1 -= goods.getMinPackQty();
+			Double remaind = this.number % goods.getMinPackQty();
+			if(NumberUtil.compare(remaind, 0.0) != 0) {
+				this.number = goods.getMinBuyQty();
 			}
-			this.number = qty1;
+//			double times = NumberUtil.div(this.number, this.minPackQty);
+//			double qty1 = NumberUtil.mul(times, goods.getMinPackQty());
+//			if(NumberUtil.compare(qty1, goods.getMinBuyQty()) <= 0) {
+//				this.number = goods.getMinBuyQty();
+//			}else if(NumberUtil.compare(qty1, goods.getReserve()) <= 0) {
+//				this.number = qty1;
+//			}else {
+//				while (NumberUtil.compare(qty1, goods.getReserve()) > 0) {
+//					qty1 -= goods.getMinPackQty();
+//				}
+//				this.number = qty1;
+//			}
 		}
 	}
 
@@ -501,8 +514,9 @@ public class Cart {
 	 * 只针对最新的历史库存
 	 */
 	public boolean estimateTightStock() {
+		Double lastReserve = goods.getLastReserve() == null ? goods.getReserve() : goods.getLastReserve();
 		if((NumberUtil.compare(goods.getReserve(), NumberUtil.mul(goods.getMinBuyQty(), (double) 5)) < 0) ||
-				(NumberUtil.compare(goods.getReserve(), NumberUtil.mul(goods.getLastReserve(), 0.1)) < 0)) {
+				(NumberUtil.compare(goods.getReserve(), NumberUtil.mul(lastReserve, 0.1)) < 0)) {
 			return true;
 		}else {
 			return false;

+ 8 - 3
src/main/java/com/uas/platform/b2c/trade/presale/service/BrowsingHistoryService.java

@@ -2,7 +2,6 @@ package com.uas.platform.b2c.trade.presale.service;
 
 import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.trade.presale.model.GoodsBrowsingHistory;
-import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.model.PageInfo;
 import org.springframework.data.domain.Page;
 
@@ -26,6 +25,12 @@ public interface BrowsingHistoryService {
      */
     List<GoodsBrowsingHistory> getGoodsBrowsingHistoryList();
 
+    /**
+     * 批量保存浏览历史
+     * @return  List<GoodsBrowsingHistory> 返回浏览历史
+     */
+    List<GoodsBrowsingHistory> saveGoodsBrowsingHistoryList(List<GoodsBrowsingHistory> browsingHistories);
+
     /**
      * 分页获取当前用户的产品浏览记录
      *
@@ -51,7 +56,7 @@ public interface BrowsingHistoryService {
     /**
      * 更新浏览的历史记录
      * @param goods 对应的goods
-     * @return ResultMap 返回结果ResultMap
+     * @return List<GoodsBrowsingHistory> 返回结果ResultMap
      */
-    ResultMap updateGoodsBrowsingHistoryByGoods(Goods goods);
+    List<GoodsBrowsingHistory> updateGoodsBrowsingHistoryByGoods(Goods goods);
 }

+ 2 - 2
src/main/java/com/uas/platform/b2c/trade/presale/service/CartService.java

@@ -131,7 +131,7 @@ public interface CartService {
 	/**
 	 * 更新购物车信息,因为Goods信息修改。
 	 * @param goods 更新的goods信息
-	 * @return ResultMap 返回ResultMap对象
+	 * @return List<Cart>
 	 */
-	ResultMap updateCartByGoods(Goods goods);
+	List<Cart> updateCartByGoods(Goods goods);
 }

+ 15 - 5
src/main/java/com/uas/platform/b2c/trade/presale/service/impl/BrowsingHistoryServiceImpl.java

@@ -6,8 +6,7 @@ import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.trade.presale.dao.GoodsBrowsingHistoryDao;
 import com.uas.platform.b2c.trade.presale.model.GoodsBrowsingHistory;
 import com.uas.platform.b2c.trade.presale.service.BrowsingHistoryService;
-import com.uas.platform.b2c.trade.support.CodeType;
-import com.uas.platform.b2c.trade.support.ResultMap;
+import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.Type;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -95,6 +94,17 @@ public class BrowsingHistoryServiceImpl implements BrowsingHistoryService {
         return list;
     }
 
+    /**
+     * 批量保存浏览历史
+     *
+     * @param browsingHistories
+     * @return List<GoodsBrowsingHistory> 返回浏览历史
+     */
+    @Override
+    public List<GoodsBrowsingHistory> saveGoodsBrowsingHistoryList(List<GoodsBrowsingHistory> browsingHistories) {
+        return goodsBrowsingHistoryDao.save(browsingHistories);
+    }
+
     @Override
     public Page<GoodsBrowsingHistory> getGoodsBrowsingHistoryPage(final PageInfo info) {
         if (SystemSession.getUser().getEnterprise() != null) {
@@ -150,15 +160,15 @@ public class BrowsingHistoryServiceImpl implements BrowsingHistoryService {
      * @return
      */
     @Override
-    public ResultMap updateGoodsBrowsingHistoryByGoods(Goods goods) {
+    public List<GoodsBrowsingHistory> updateGoodsBrowsingHistoryByGoods(Goods goods) {
         if(goods == null) {
-            return new ResultMap(CodeType.NO_INFO, "没有对应的数据");
+            throw new IllegalOperatorException("库存信息丢失,请重新操作");
         }
         List<GoodsBrowsingHistory> historyByBatch = goodsBrowsingHistoryDao.findGoodsBrowsingHistoryByBatch(goods.getBatchCode());
         for (GoodsBrowsingHistory browsingHistory : historyByBatch) {
             browsingHistory.updateGoodsBrowsingHistoryByGoods(goods);
         }
         List<GoodsBrowsingHistory> browsingHistories = goodsBrowsingHistoryDao.save(historyByBatch);
-        return ResultMap.success(browsingHistories);
+        return browsingHistories;
     }
 }

+ 8 - 10
src/main/java/com/uas/platform/b2c/trade/presale/service/impl/CartServiceImpl.java

@@ -103,7 +103,7 @@ public class CartServiceImpl implements CartService {
 	 */
 	@Override
 	public List<Cart> saveCart(List<Cart> carts) {
-		List<Cart> cartsReserveShortage = new ArrayList<Cart>();
+//		List<Cart> cartsReserveShortage = new ArrayList<Cart>();
 		// 检查库存如果不足,则将采购数量设为0,并置入
 		/*
 		 * for (Cart cart : carts) { Double price =
@@ -116,8 +116,8 @@ public class CartServiceImpl implements CartService {
 		 * IllegalOperatorException("以下批次数量不满足最小起订量,请您重新选择:" +
 		 * cart.getBatchCode()); } else { cartsReserveShortage.add(cart); } }
 		 */
-		cartDao.save(cartsReserveShortage);
-		return cartsReserveShortage;
+		cartDao.save(carts);
+		return carts;
 	}
 
 	@Deprecated
@@ -441,7 +441,7 @@ public class CartServiceImpl implements CartService {
 		}else {
 			cart.setNumber(commodity);
 		}
-		cart.setCurrencyName(commodity.getCurrencyName());
+		cart.setCurrencyName(commodity.getCurrencyName() == "USD" ? "USD" : "RMB");
 		cart.setReturnInWeek(commodity.getReturnInWeek());
 		cart.setSupply(commodity.getOriginal());
 		cart.setPack(commodity.getPackaging());
@@ -478,11 +478,10 @@ public class CartServiceImpl implements CartService {
 	 * @return
 	 */
 	@Override
-	public ResultMap updateCartByGoods(Goods goods) {
+	public List<Cart> updateCartByGoods(Goods goods) {
 		if(goods == null) {
-			return new ResultMap(CodeType.NO_INFO.code(), "信息缺失");
+			throw  new IllegalOperatorException("库存信息缺失");
 		}
-		List<Cart> carts = new ArrayList<>();
 		List<Cart> cartList = cartDao.findCartByBatch(goods.getBatchCode());
 		StoreIn storeIn = storeInDao.findByUuid(goods.getStoreid());
 		Enterprise enterprise = enterpriseDao.findByUu(storeIn.getEnUU());
@@ -490,14 +489,13 @@ public class CartServiceImpl implements CartService {
 			cart.updateCartByGoods(goods);
 			cart.setNumber(goods);
 			cart.setMinPackQty(goods.getMinPackQty());
-			cart.setStoreName(storeIn.getStoreName());
+			cart.setStoreName(goods.getStoreName());
 			cart.setStoreType(storeIn.getType());
 			cart.setSellPhone(enterprise.getEnTel());
 			cart.setSellEmail(enterprise.getEnEmail());
 			cart.setSellCompanyArea(enterprise.getEnArea());
 			cart.setSellCompanyAddress(enterprise.getEnAddress());
 		}
-		cartDao.save(cartList);
-		return ResultMap.success(carts);
+		return cartList;
 	}
 }

BIN
src/main/resources/jxls-tpl/product/productStandarPutOn-error.xls


BIN
src/main/resources/jxls-tpl/trade/goodsImportHist-error.xls


BIN
src/main/resources/jxls-tpl/trade/releaseByBatch-rmb.xls


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


BIN
src/main/resources/jxls-tpl/trade/releaseByBatchError-rmb.xls


BIN
src/main/resources/jxls-tpl/trade/releaseByBatchError-usd.xls


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


BIN
src/main/resources/jxls-tpl/trade/releasebyBatch-usd.xls


+ 4 - 4
src/main/resources/spring/context.xml

@@ -11,13 +11,13 @@
 	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
 	http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd">
 
-	<context:property-placeholder location="classpath*:${profile}/*.properties" />
+	<context:property-placeholder location="classpath*:dev/*.properties" />
 	<!-- 系统运行参数注入 -->
 	<util:properties id="sys"
-		location="classpath:${profile}/sys.properties" />
+		location="classpath:dev/sys.properties" />
 	<!-- 消息参数 -->
 	<util:properties id="message"
-		location="classpath:${profile}/message.properties" />
+		location="classpath:dev/message.properties" />
 	<!-- 注册spring上下文对象 -->
 	<bean class="com.uas.platform.b2c.core.support.ApplicationContextRegister" />
 	<!-- 容器启动完成之后执行 -->
@@ -185,7 +185,7 @@
 	<!-- 账户中心配置 -->
 	<bean id="accountConfigurer" class="com.uas.account.web.AccountConfigurer"
 		init-method="init">
-		<property name="configPath" value="classpath:${profile}/account.properties" />
+		<property name="configPath" value="classpath:dev/account.properties" />
 	</bean>
 	
 	<import resource="classpath:spring/dubbo-consumer.xml"/>

+ 1 - 1
src/main/webapp/WEB-INF/web.xml

@@ -8,7 +8,7 @@
 	<description>usoftchina platform b2c</description>
 	<context-param>
 		<param-name>webAppRootKey</param-name>
-		<param-value>spring.webapp.b2c</param-value>
+		<param-value>spring.webapp.b2c.prod</param-value>
 	</context-param>
 	<context-param>
 		<param-name>spring.profiles.active</param-name>

BIN
src/main/webapp/resources/img/icon/check-off.png


BIN
src/main/webapp/resources/img/icon/check-ok.png


BIN
src/main/webapp/resources/img/icon/open.png


BIN
src/main/webapp/resources/img/product/releaseByBatch-rmb.png


BIN
src/main/webapp/resources/img/product/releaseByBatch-usd.png


BIN
src/main/webapp/resources/img/user/images/select-disabled.png


+ 2 - 2
src/main/webapp/resources/js/admin/app.js

@@ -834,9 +834,9 @@
                  moneyParam = 0;
              }
              if(currency == 'RMB') {
-                 return "¥ " + moneyParam + " " + (typeof(add) == "undefined" ? '' : add);
+                 return "¥" + moneyParam + (typeof(add) == "undefined" ? '' : add);
              }else if(currency == "USD"){
-                 return "$ " + moneyParam;
+                 return "" + moneyParam;
              }else {
                  return moneyParam;
              }

+ 1 - 5
src/main/webapp/resources/js/prod/controllers/ProductListByKindCtrl.js

@@ -263,14 +263,10 @@ define([ 'app/app' ], function(app) {
 					var newWidow = window.open('product#/cart');
 					// 1、生成订单
 					Order.buyNow({}, goodsList, function(data){
-						var orderids = [];
-						angular.forEach(data, function(order) {
-							orderids.push(order.orderid );
-						});
 						// 控制订单确认页,直接购买不显示进度条
 						SessionService.set("buyNow", true);
 						// 2、跳转到订单确认页面,进行付款操作
-						newWidow.location.href ='user#/order/pay/'+ enIdFilter(data.orderid);
+						newWidow.location.href ='user#/order/pay/'+ enIdFilter(data.data.orderid);
 					}, function(res){
 						newWidow.close();
 						toaster.pop('error', '警告', res.data);

+ 57 - 47
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_cart_ctrl.js

@@ -43,47 +43,47 @@ define(["app/app", 'jquery-summernote'], function(app) {
 		$scope.isChooseAll = false;
 
 		$scope.loadData = function (){
-			Cart.getPageInfo($scope.pageInfo, function(data) {
-				$scope.isDataLoading = false;
-				$scope.total = data.totalElements;
-				$scope.pageNum = data.totalPages;
+				Cart.getPageInfo($scope.pageInfo, function(data) {
+					$scope.isDataLoading = false;
+					$scope.total = data.totalElements;
+					$scope.pageNum = data.totalPages;
 
-				angular.forEach(data.content, function (cart) {
-					cart.buyCurrency = cart.currencyName.indexOf("RMB") > -1 ? "RMB" : "USD";
-					cart.isSelect = false;
-					//计算分段和统计一下价格
-					$scope.getPrice(cart);
-
-					//便于后期循环
-					$scope.carts.push(cart);
-					$scope.disabledAddAndSub(cart);
-					$scope.countByPage += 1;
-					var isContain = false;
-					for (var i = 0; i < $scope.cartMap.length; i++) {
-						if(angular.equals($scope.cartMap[i].name, cart.storeName)) {
-							$scope.cartMap[i].arr.push(cart);
-							isContain = true;
+					angular.forEach(data.content, function (cart) {
+						cart.buyCurrency = cart.currencyName.indexOf("RMB") > -1 ? "RMB" : "USD";
+						cart.isSelect = false;
+						//计算分段和统计一下价格
+						$scope.getPrice(cart);
+
+						//便于后期循环
+						$scope.carts.push(cart);
+						$scope.disabledAddAndSub(cart);
+						$scope.countByPage += 1;
+						var isContain = false;
+						for (var i = 0; i < $scope.cartMap.length; i++) {
+							if(angular.equals($scope.cartMap[i].name, cart.storeName)) {
+								$scope.cartMap[i].arr.push(cart);
+								isContain = true;
+							}
 						}
-					}
-					if(!isContain) {
-						var obj = {};
-						obj.name = cart.storeName;
-						obj.arr = [];
-						obj.arr.push(cart);
-						$scope.cartMap.push(obj);
-					}
-				});
-				$scope.cartIsEmpty = !$scope.carts.length ? true : false;
-				//设置全选的复选框
-				$scope.isChooseAll = $scope.isAllSelect($scope.carts);
+						if(!isContain) {
+							var obj = {};
+							obj.name = cart.storeName;
+							obj.arr = [];
+							obj.arr.push(cart);
+							$scope.cartMap.push(obj);
+						}
+					});
+					$scope.cartIsEmpty = !$scope.carts.length ? true : false;
+					//设置全选的复选框
+					$scope.isChooseAll = $scope.isAllSelect($scope.carts);
 
-				//设置店铺复选框的状态
-				angular.forEach($scope.cartMap, function (store) {
-					$scope.selectedStore[store.name] = $scope.isAllSelect(store.arr);
+					//设置店铺复选框的状态
+					angular.forEach($scope.cartMap, function (store) {
+						$scope.selectedStore[store.name] = $scope.isAllSelect(store.arr);
+					});
+				},function() {
+					toaster.pop('error', "提示", "获取购物车信息失败,请刷新页面");
 				});
-			},function() {
-				toaster.pop('error', "提示", "获取购物车信息失败,请刷新页面");
-			});
 		};
 
 		$scope.loadData();
@@ -107,7 +107,7 @@ define(["app/app", 'jquery-summernote'], function(app) {
 				toaster.pop('info', '提示', '该商品已经失效,请选择其他商品');
 				return ;
 			}
-			var num = Number(NumberService.add(cart.number, cart.goods.minPackQty));
+			var num = Number(NumberService.add(cart.number, cart.goods.perQty));
 			if(num > cart.goods.reserve) {
 				// cart.number = cart.number - cart.goods.minPackQty;
 				toaster.pop('info','提示','库存不足');
@@ -127,7 +127,7 @@ define(["app/app", 'jquery-summernote'], function(app) {
 				toaster.pop('info', '提示', '该商品已经失效,请选择其他商品');
 				return ;
 			}
-			var num = NumberService.sub(cart.number, cart.goods.minPackQty);
+			var num = NumberService.sub(cart.number, cart.goods.perQty);
 			if(Number(num) < cart.goods.minBuyQty) {
 				toaster.pop('info','提示','该商品最少购买' + cart.goods.minBuyQty + "件");
 				cart.number = cart.goods.minBuyQty;
@@ -228,13 +228,23 @@ define(["app/app", 'jquery-summernote'], function(app) {
 			if (c.number < c.goods.minBuyQty || !c.number) {
 				toaster.pop("info", "提示", "该商品最少购买" + c.goods.minBuyQty + "件");
 				c.number = c.goods.minBuyQty;
-			}else if(c.number <= c.goods.reserve){
-				c.number = Number(NumberService.sub(Number(c.number), c.number % c.goods.minPackQty));
-			}else{
+			}else if(c.number > c.goods.reserve){
 				toaster.pop("info", "提示", "库存不足");
-				if(c.number > c.goods.reserve) {
+				if(c.goods.breakUp) {
+					c.number = c.goods.reserve;
+				}else {
 					c.number = Number(NumberService.sub(c.goods.reserve, c.goods.reserve % c.goods.minPackQty));
 				}
+				if(Number(c.number) < Number(c.goods.minBuyQty)) {
+					c.number = c.goods.minBuyQty;
+				}
+			}else {
+				if(!c.goods.breakUp) {
+					c.number = NumberService.sub(c.number, c.number % c.goods.minPackQty);
+				}
+				if(Number(c.number) < Number(c.goods.minBuyQty)) {
+					c.number = c.goods.minBuyQty;
+				}
 			}
 
 			$scope.disabledAddAndSub(c);
@@ -247,12 +257,12 @@ define(["app/app", 'jquery-summernote'], function(app) {
 		 * 是否失效- +
 		 */
 		$scope.disabledAddAndSub = function(c) {
-			if((Number(c.number) - Number(c.goods.minPackQty)) < Number(c.goods.minBuyQty)) {
+			if((Number(c.number) - Number(c.goods.perQty)) < Number(c.goods.minBuyQty)) {
 				c.minusDisabled = true;
 			}else {
 				c.minusDisabled = false;
 			}
-			if(Number(c.number) + Number(c.goods.minPackQty) > Number(c.goods.reserve)) {
+			if(Number(c.number) + Number(c.goods.perQty) > Number(c.goods.reserve)) {
 				c.addDisabled = true;
 			}else {
 				c.addDisabled = false;
@@ -350,9 +360,9 @@ define(["app/app", 'jquery-summernote'], function(app) {
 					}
 					//添加相应的数据。
 					if(c.buyCurrency.indexOf("RMB") > -1 ) {
-						c.price = "¥"+ $filter('number')(c.rMBPrice, 6);
+						c.price = "¥"+ $filter('formateNumber')(c.rMBPrice, 6);
 					}else {
-						c.price = "$" + $filter('number')(c.uSDPrice, 6);
+						c.price = "$" + $filter('formateNumber')(c.uSDPrice, 6);
 					}
 					return;
 				}

+ 2 - 2
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_order_ctrl.js

@@ -215,14 +215,14 @@ define(['app/app'], function (app) {
 		 * @returns hours 多少个小时
 		 */
 		var getHoursFromNow = function(time) {
-			if(!time) {
+			if (!time) {
 				return 0;
 			}
 			var newTime = new Date();
 			var msec = newTime.getTime() - time;
 			var hours = parseInt(parseInt(msec) / (1000 * 60 * 60));
 			return hours;
-		}
+		};
 
 		loadData();
 

+ 18 - 6
src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js

@@ -175,9 +175,13 @@ define(['app/app'], function(app) {
 
 		// 添加按钮,每次加1
 		$scope.add = function(detail){
-			var num = NumberService.add(detail.number, detail.goodsHistory.minPackQty);
+			var num = NumberService.add(detail.number, detail.goodsHistory.perQty);
 			if(Number(num) > detail.goodsHistory.reserve) {
-				detail.number = Number(NumberService.sub(detail.goodsHistory.reserve, detail.goodsHistory.reserve %detail.goodsHistory.minPackQty));
+				if(detail.goodsHistory.breakUp) {
+					detail.number = detail.goodsHistory.reserve;
+				}else {
+					detail.number = Number(NumberService.sub(detail.goodsHistory.reserve, detail.goodsHistory.reserve %detail.goodsHistory.minPackQty));
+				}
 				toaster.pop('info','提示','库存不足');
 			}else {
 				detail.number = num;
@@ -190,7 +194,7 @@ define(['app/app'], function(app) {
 
 		// 减少按钮,每次减minPackQty
 		$scope.reduce = function(detail){
-			var num = NumberService.sub(detail.number, detail.goodsHistory.minPackQty);
+			var num = NumberService.sub(detail.number, detail.goodsHistory.perQty);
 			if(Number(num) < detail.goodsHistory.minBuyQty) {
 				toaster.pop('info', '提示','该商品最少购买' + detail.goodsHistory.minBuyQty + "件");
 				detail.number = detail.goodsHistory.minBuyQty;
@@ -210,8 +214,16 @@ define(['app/app'], function(app) {
 				toaster.pop("info", "提示", "该商品最少购买" + detail.goodsHistory.minBuyQty + "件");
 				detail.number = detail.goodsHistory.minBuyQty;
 			}else if(detail.number > detail.goodsHistory.reserve){
-				detail.number = Number(NumberService.sub(detail.goodsHistory.reserve, detail.goodsHistory.reserve %detail.goodsHistory.minPackQty));
+				if(detail.goodsHistory.breakUp) {
+					detail.number = detail.goodsHistory.reserve;
+				}else{
+					detail.number = Number(NumberService.sub(detail.goodsHistory.reserve, detail.goodsHistory.reserve %detail.goodsHistory.minPackQty));
+				}
 				toaster.pop('info', '提示','库存不足');
+			}else {
+				if(!detail.goodsHistory.breakUp) {
+					detail.number = Number(NumberService.sub(detail.number, detail.number%detail.goodsHistory.minPackQty));
+				}
 			}
 			$scope.disabledAddAndSub(detail);
 			$scope.calculatePrice(detail.number, detail, detail.currencyName);
@@ -223,12 +235,12 @@ define(['app/app'], function(app) {
 		 * 是否失效- +
 		 */
 		$scope.disabledAddAndSub = function(detail) {
-			if((Number(detail.number) - Number(detail.goodsHistory.minPackQty)) < Number(detail.goodsHistory.minBuyQty)) {
+			if((Number(detail.number) - Number(detail.goodsHistory.perQty)) < Number(detail.goodsHistory.minBuyQty)) {
 				detail.minusDisabled = true;
 			}else {
 				detail.minusDisabled = false;
 			}
-			if(Number(detail.number) + Number(detail.goodsHistory.minPackQty) > Number(detail.goodsHistory.reserve)) {
+			if(Number(detail.number) + Number(detail.goodsHistory.perQty) > Number(detail.goodsHistory.reserve)) {
 				detail.addDisabled = true;
 			}else {
 				detail.addDisabled = false;

+ 199 - 162
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js

@@ -1,23 +1,34 @@
 define([ 'app/app' ], function(app) {
 	'use strict';
-	app.register.controller('vendor_materialCtrl', ['$scope', '$rootScope', 'Material', 'toaster', 'ComponentActive', function ($scope, $rootScope, Material, toaster, ComponentActive) {
-		$rootScope.active = 'vendor_goods';
+	app.register.controller('vendor_materialCtrl', ['$scope', '$rootScope', 'Material', 'toaster', 'ComponentActive', 'Enterprise', '$q', 'NumberService', function ($scope, $rootScope, Material, toaster, ComponentActive, Enterprise, $q, NumberService) {
+		$rootScope.active = 'vendor_material';
 
 		$scope.tab = 'material';
 		$scope.standard_tab = 'standard';
 		$scope.choosedIds = [];
 		$scope.deleteDiv = false;
+		/**
+		 * 最大
+		 * @type {number}
+		 */
+		$scope.maxReserve = 999999999;
+		/**
+		 * 最小包装量的最大值
+		 */
+		$scope.maxPackQty = 999999;
+		$scope.minReserve = 1;
 
 		$scope.param = {
 			page : 1,
 			count : 10,
 			sorting : {
-				code : 'ASC'
+				id : 'DESC'
 			},
-			isStandard : true
+			isStandard : true,
+			type : "standard"
 		};
 
-		$scope.goods = { isBreakUp: 1, isSelfSupport: 1, prices: [{}] };
+		$scope.goods = { breakUp: 1, isSelfSupport: 1, prices: [{}] };
 		$scope.isSelfSupport = true;
 		$scope.showShelfArea = showShelfArea;
 		$scope.closeShelArea = closeShelArea;
@@ -25,6 +36,7 @@ define([ 'app/app' ], function(app) {
 
 		$scope.setPriceMinAmount = setPriceMinAmount;
 		$scope.setPriceMaxAmount = setPriceMaxAmount;
+		$scope.setPriceMinPackAmount = setPriceMinPackAmount;
 
 		$scope.addPrice = addPrice;
 		$scope.deletePrice = deletePrice;
@@ -36,6 +48,49 @@ define([ 'app/app' ], function(app) {
 
 		$scope.error = {};
 
+		//获取币别信息
+		var deferred = $q.defer();
+		Enterprise.getCurrencyByRegisterAddress(null, function (data) {
+			deferred.resolve(data);
+		}, function (response) {
+			deferred.reject(response);
+		});
+
+		var currencyPromise = deferred.promise;
+
+		$q.all([currencyPromise, $rootScope.storePromise]).then(function (result) {
+			console.log(result);
+			var curData = result[0];
+			if(!$scope.store) {
+				$scope.store = {};
+			}
+			if((curData != null) && (curData.code == 1)) {
+				if(curData.data == 'USD') {
+					$scope.store.enType = 'HK'
+				}else {
+					$scope.store.enType = 'MAINLAND'
+				}
+			}else {
+				$scope.store.enType = 'MAINLAND';
+				toaster.pop('info', '提示', '您公司的注册地址为空,无法确定币别,系统默认为人民币');
+				// $scope.onsale.currency = 'RMB';
+			}
+		})['catch'](function (error) {
+			if(!$scope.store) {
+				$scope.store = {};
+			}
+			var curData = error[0];
+			if((curData != null) && (curData.code == 1)) {
+				if(curData.data == 'USD') {
+					$scope.store.enType = 'HK';
+				}else {
+					$scope.store.enType = 'MAINLAND';
+				}
+			}else {
+				$scope.store.enType = 'MAINLAND';
+			}
+		});
+
 		/**
 		 * 切换标准/非标准
 		 * @param isStandard
@@ -43,10 +98,10 @@ define([ 'app/app' ], function(app) {
 		$scope.toggleStandard = function (isStandard) {
 			$scope.standard_tab = isStandard;
 			if (isStandard == 'standard')
-				$scope.param.isStandard = true;
+				$scope.param.type = "standard";
 			// $scope.param.sorting = {matchingTime : 'DESC'};
 			if (isStandard == 'unstandard')
-				$scope.param.isStandard = false;
+				$scope.param.type = "nStandard";
 			// $scope.param.sorting = {code : 'ASC'};
 			$scope.isBatch = false;
 			loadDataReload();
@@ -406,11 +461,9 @@ define([ 'app/app' ], function(app) {
 		function publishGoods(product) {
 			if (!validateGoods($scope.goods)) return ;
 
-			$scope.goods.minPackQty = $scope.goods.minBuyQty;
-
 			console.log('product', product);
 			console.log($scope.goods);
-			$scope.goods.isBreakUp = 1 === $scope.goods.isBreakUp;
+			$scope.goods.breakUp = 1 === $scope.goods.breakUp;
 			$scope.isSelfSupport = 1 === $scope.goods.isSelfSupport;
 			Material.newStockByStandardProduct({ id: product.id, isSelfSupport: $scope.isSelfSupport}, $scope.goods, function (result) {
 				if (result.success) {
@@ -420,7 +473,7 @@ define([ 'app/app' ], function(app) {
 					toaster.pop('error', result.message);
 				}
 			}, function (error) {
-				console.log(error);
+				toaster.pop('error', error.data);
 			});
 		}
 
@@ -430,6 +483,10 @@ define([ 'app/app' ], function(app) {
 		 * @param goods		商品信息
 		 */
 		function validateGoods(goods) {
+			if(!goods.packaging || goods.packaging === '') {
+				toaster.pop('error', '商品包装方式不能为空');
+				return false;
+			}
 			if (!goods.produceDate || goods.produceDate === '') {
 				toaster.pop('error', '商品生产日期不能为空');
 				return false;
@@ -442,6 +499,12 @@ define([ 'app/app' ], function(app) {
 				toaster.pop('error', '商品的起拍数量不能为空');
 				return false;
 			}
+			if(!goods.minPackQty || goods.minPackQty === '') {
+				goods.minPackQty = 1;
+			}
+			if(!goods.breakUp) {
+				$scope.isNotBreakUp(goods);
+			}
 
 			//console.log($scope.store.enType);
 			// 根据价格生成币别
@@ -516,18 +579,14 @@ define([ 'app/app' ], function(app) {
 				}
 			}
 
-			// 验证交期
-			if (goods.currencyName.indexOf('RMB') > -1) {
-				if ((!goods.selfDeliveryDemMinTime || goods.selfDeliveryDemMinTime === '') && (!goods.selfDeliveryDemMaxTime || goods.selfDeliveryDemMaxTime === '')) {
-					toaster.pop('error', '国内最长和最短交期不能为空');
-					return false;
-				}
-			}
-			if (goods.currencyName.indexOf('USD') > -1) {
-				if ((!goods.selfDeliveryHKMinTime || goods.selfDeliveryHKMinTime === '') && (!goods.selfDeliveryHKMaxTime || goods.selfDeliveryHKMaxTime === '')) {
-					toaster.pop('error', '香港最长和最短交期不能为空');
-					return false;
+			if ((!goods.minDelivery || goods.minDelivery === '') || (!goods.maxDelivery || goods.maxDelivery === '') ||
+				(goods.minDelivery < 1 || goods.minDelivery > 31) || (goods.maxDelivery < 0 || goods.maxDelivery > 31)) {
+				if(goods.currencyName.indexOf('RMB') > -1) {
+					toaster.pop('error', '国内最长和最短交期必须填写且必须在1-31区间之间');
+				}else {
+					toaster.pop('error', '香港最长和最短交期必须填写且必须在1-31区间之间');
 				}
+				return false;
 			}
 			return true;
 		}
@@ -545,6 +604,9 @@ define([ 'app/app' ], function(app) {
 						delete product.selected;
 					});
 					$scope.goods = { isBreakUp: 1, isSelfSupport: 1, prices: [{}] };
+					$scope.goods.prices = [];
+					$scope.goods.prices.push({start : $scope.minReserve, end : $scope.maxReserve});
+					$scope.goods.isSelfSupport = $scope.store.status == 'OPENED' ? 1 : 0;
 					product.img = component.img || null;
 					product.selected = true;
 				} else {
@@ -573,39 +635,41 @@ define([ 'app/app' ], function(app) {
 		 * @param goods		商品信息
 		 */
 		function setPriceMinAmount(goods) {
-			if (goods.minBuyQty === undefined || goods.minBuyQty === null ) {
-				if (goods.prices && goods.prices.length > 0) {
-					goods.prices[0].start = goods.minBuyQty;
-				}
-				return ;
-			}
 			if (goods.minBuyQty <= 0) {
 				toaster.pop('error', '商品起拍数量必须大于0');
 				delete goods.minBuyQty;
-				if (goods.prices && goods.prices.length > 0) {
-					goods.prices[0].start = goods.minBuyQty;
-				}
 				return ;
 			}
 			if (goods.reserve !== undefined && goods.reserve != null) {
 				if (goods.minBuyQty > goods.reserve) {
 					toaster.pop('error', '商品起拍数量不能大于库存数量');
 					delete goods.minBuyQty;
-					if (goods.prices && goods.prices.length > 0) {
-						goods.prices[0].start = goods.minBuyQty;
-					}
 					return ;
 				}
 			}
-			if (goods.prices && goods.prices.length > 0) {
-				if (goods.prices[0].end != null) {
-					if (goods.minBuyQty > goods.prices[0].end) {
-						toaster.pop('error', '商品起拍数量不能大于第一价格梯度的终止数量');
-						goods.minBuyQty = goods.prices[0].start;
-						return ;
-					}
-				}
-				goods.prices[0].start = goods.minBuyQty;
+			if(!goods.breakUp) {
+				$scope.isNotBreakUp(goods);
+			}
+		}
+
+		/**
+		 * 设置最小包数量
+		 *
+		 * @param goods		商品信息
+		 */
+		function setPriceMinPackAmount(goods) {
+			if (goods.minPackQty <= 0) {
+				toaster.pop('error', '商品起拍数量必须大于0');
+				delete goods.minPackQty;
+				return ;
+			}
+			if(goods.minPackQty > $scope.maxPackQty) {
+				toaster.pop('error', '商品起拍数量必须小于' + $scope.maxPackQty);
+				delete goods.minPackQty;
+				return ;
+			}
+			if(!goods.breakUp) {
+				$scope.isNotBreakUp(goods);
 			}
 		}
 
@@ -616,38 +680,25 @@ define([ 'app/app' ], function(app) {
 		 */
 		function setPriceMaxAmount(goods) {
 			if (goods.reserve === undefined || goods.reserve === null ) {
-				if (goods.prices && goods.prices.length > 0) {
-					goods.prices[goods.prices.length - 1].end = goods.reserve;
-				}
 				return ;
 			}
 			if (goods.reserve <= 0) {
 				toaster.pop('error', '商品库存数量必须大于0');
 				delete goods.reserve;
-				if (goods.prices && goods.prices.length > 0) {
-					goods.prices[goods.prices.length - 1].end = goods.reserve;
-				}
 				return ;
+			}else if(goods.reserve > $scope.maxReserve) {
+				toaster.pop('error', '商品库存数量必须小于' + $scope.maxReserve);
+				delete goods.reserve;
 			}
 			if (goods.minBuyQty !== undefined && goods.minBuyQty != null) {
 				if (goods.minBuyQty > goods.reserve) {
 					toaster.pop('error', '商品库存数量不能小于起拍数量');
 					delete goods.reserve;
-					if (goods.prices && goods.prices.length > 0) {
-						goods.prices[goods.prices.length - 1].end = goods.reserve;
-					}
 					return ;
 				}
 			}
-			if (goods.prices && goods.prices.length > 0) {
-				if (goods.prices[goods.prices.length - 1].start != null) {
-					if (goods.reserve < goods.prices[goods.prices.length - 1].start) {
-						toaster.pop('error', '商品库存数量不能小于最后一个价格梯度的起始数量');
-						goods.reserve = goods.prices[goods.prices.length - 1].end;
-						return ;
-					}
-				}
-				goods.prices[goods.prices.length - 1].end = goods.reserve;
+			if(!goods.breakUp) {
+				$scope.isNotBreakUp(goods);
 			}
 		}
 
@@ -658,19 +709,14 @@ define([ 'app/app' ], function(app) {
 		 * @param index		价格区间索引
 		 */
 		function addPrice(goods, index) {
-			if (goods.prices.length === 5) {
-				toaster.pop('warning', '价格梯度最多只能5个');
+			if (goods.prices.length === 3) {
+				toaster.pop('warning', '价格梯度最多只能3个');
 				return ;
 			}
 			var price = {};
 			var lastPrice = goods.prices[index];
-			if (index < goods.prices.length - 1) {
-				price.end = lastPrice.end;
-				delete lastPrice.end;
-			} else {
-				price.start = lastPrice.end;
-			}
-
+			price.end = lastPrice.end;
+			delete lastPrice.end;
 			var newPrices = [];
 			for (var i = 0; i < goods.prices.length; i++) {
 				newPrices.push(angular.copy(goods.prices[i]));
@@ -679,6 +725,7 @@ define([ 'app/app' ], function(app) {
 				}
 			}
 			goods.prices = newPrices;
+			console.log(goods.prices);
 		}
 
 		/**
@@ -692,26 +739,14 @@ define([ 'app/app' ], function(app) {
 				toaster.pop('error', '价格区间至少包含一个');
 				return ;
 			}
-			if (index > 0) {
-				var lastPrice = goods.prices[index - 1];
-				var price = goods.prices[index];
-				if (price.end && price.end !== '') {
-					lastPrice.end = price.end;
-				}
-			} else {
-				var nextPrice = goods.prices[index + 1];
-				if (goods.minBuyQty && goods.minBuyQty !== '') {
-					nextPrice.start = goods.minBuyQty;
-				}
-			}
-
-			var newPrices = [];
-			for (var i = 0; i < goods.prices.length; i++) {
-				if (i !== index) {
-					newPrices.push(angular.copy(goods.prices[i]));
-				}
+			if(index == goods.prices.length -1) {
+				goods.prices[index - 1].end = goods.prices[index].end;
+				goods.prices.pop();
+			}else {
+				goods.prices[index + 1].start = goods.prices[index].start;
+				goods.prices.splice(index, 1);
 			}
-			goods.prices= newPrices;
+			console.log(goods.prices);
 		}
 
 		/**
@@ -728,8 +763,8 @@ define([ 'app/app' ], function(app) {
 						toaster.pop('error', '当前价格区间的起始数量必须大于0');
 						delete price.start;
 					} else {
-						if (price.end != null && price.start >= price.end) {
-							toaster.pop('error', '当前价格区间的起始数量必须小于终止数量');
+						if (price.end != null && price.start > price.end) {
+							toaster.pop('error', '当前价格区间的起始数量必须小于等于终止数量');
 							delete price.start;
 						} else {
 							if (goods.reserve != null && price.start > goods.reserve) {
@@ -751,7 +786,7 @@ define([ 'app/app' ], function(app) {
 				if (Number(price.start) >= Number(price.end)) {
 					toaster.pop('error', '当前价格区间的起始数量必须小于终止数量');
 					if (prePrice.end && prePrice.end !== '') {
-						price.start = prePrice.end;
+						price.start = prePrice.end + 1;
 					} else {
 						delete price.start
 					}
@@ -762,14 +797,14 @@ define([ 'app/app' ], function(app) {
 				if (Number(prePrice.start) >= Number(price.start)) {
 					toaster.pop('error', '当前价格区间的起始数量必须大于上一区间的起始数量');
 					if (prePrice.end && prePrice.end !== '') {
-						price.start = prePrice.end;
+						price.start = prePrice.end + 1;
 					} else {
 						delete price.start
 					}
 					return ;
 				}
 			}
-			prePrice.end = price.start;
+			prePrice.end = price.start - 1;
 		}
 
 		/**
@@ -786,34 +821,28 @@ define([ 'app/app' ], function(app) {
 						toaster.pop('error', '当前价格区间的终止数量必须大于0');
 						delete price.end;
 					} else {
-						if (price.start != null && price.start >= price.end) {
-							toaster.pop('error', '当前价格区间的终止数量必须大于起始数量');
+						if (price.start != null && price.start > price.end) {
+							toaster.pop('error', '当前价格区间的终止数量必须大于等于起始数量');
 							delete price.end;
-						} else {
-							if (goods.minBuyQty != null && price.end < goods.minBuyQty) {
-								toaster.pop('error', '最后一价格区间的终止数量不能小于起拍数量');
-								delete price.end;
-							}
 						}
 					}
 				}
-				goods.reserve = price.end;
 				return ;
 			}
 			var nextPrice = goods.prices[index + 1];
 			if (!price.end || price.end === '') {
 				if (nextPrice.start && nextPrice.start !== '') {
-					price.end = nextPrice.start;
+					price.end = nextPrice.start - 1;
 				} else {
 					delete price.end
 				}
 				return ;
 			}
 			if (price.start && price.start !== '') {
-				if (Number(price.start) >= Number(price.end)) {
-					toaster.pop('error', '当前价格区间的终止数量必须大于起始数量');
+				if (Number(price.start) > Number(price.end)) {
+					toaster.pop('error', '当前价格区间的终止数量必须大于等于起始数量');
 					if (nextPrice.start && nextPrice.start !== '') {
-						price.end = nextPrice.start;
+						price.end = nextPrice.start - 1;
 					} else {
 						delete price.end
 					}
@@ -824,14 +853,14 @@ define([ 'app/app' ], function(app) {
 				if (Number(price.end) >= Number(nextPrice.end)) {
 					toaster.pop('error', '当前价格区间的终止数量必须小于下一区间的终止数量');
 					if (nextPrice.start && nextPrice.start !== '') {
-						price.end = nextPrice.start;
+						price.end = nextPrice.start - 1;
 					} else {
 						delete price.end
 					}
 					return ;
 				}
 			}
-			nextPrice.start = price.end;
+			nextPrice.start = price.end + 1;
 		}
 
 		/**
@@ -841,37 +870,27 @@ define([ 'app/app' ], function(app) {
 		 * @param type			交期类型
 		 */
 		function checkMinDelivery(goods, type) {
-			if (type === 'DEM') {
-				if (goods.selfDeliveryDemMinTime == null) {
-					delete goods.selfDeliveryDemMinTime;
-					return ;
-				}
-				if (goods.selfDeliveryDemMinTime < 0 || goods.selfDeliveryDemMinTime > 30) {
-					delete goods.selfDeliveryDemMinTime;
-					toaster.pop('error', '国内最短交期必须在0~30天之间');
-					return ;
-				}
-				if (goods.selfDeliveryDemMaxTime && goods.selfDeliveryDemMinTime > goods.selfDeliveryDemMaxTime) {
-					delete goods.selfDeliveryDemMinTime;
-					toaster.pop('error', '国内最短交期必须小于国内最长交期');
-					return ;
-				}
+			if (goods.minDelivery == null) {
+				delete goods.minDelivery;
+				return ;
 			}
-			if (type === 'HK') {
-				if (goods.selfDeliveryHKMinTime == null) {
-					delete goods.selfDeliveryHKMinTime;
-					return ;
+			if (goods.minDelivery < 0 || goods.minDelivery > 31) {
+				delete goods.minDelivery;
+				if (type === 'DEM') {
+					toaster.pop('error', '国内最短交期必须在0~31天之间');
+				}else {
+					toaster.pop('error', '香港最短交期必须在0~31天之间');
 				}
-				if (goods.selfDeliveryHKMinTime < 0 || goods.selfDeliveryHKMinTime > 30) {
-					delete goods.selfDeliveryHKMinTime;
-					toaster.pop('error', '香港最短交期必须在0~30天之间');
-					return ;
-				}
-				if (goods.selfDeliveryHKMaxTime && goods.selfDeliveryHKMinTime > goods.selfDeliveryHKMaxTime) {
-					delete goods.selfDeliveryHKMinTime;
+				return ;
+			}
+			if (goods.minDelivery && goods.minDelivery > goods.maxDelivery) {
+				delete goods.minDelivery;
+				if (type === 'DEM') {
+					toaster.pop('error', '国内最短交期必须小于国内最长交期');
+				}else {
 					toaster.pop('error', '香港最短交期必须小于香港最长交期');
-					return ;
 				}
+				return ;
 			}
 			return true;
 		}
@@ -883,40 +902,58 @@ define([ 'app/app' ], function(app) {
 		 * @param type			交期类型
 		 */
 		function checkMaxDelivery(goods, type) {
-			if (type === 'DEM') {
-				if (goods.selfDeliveryDemMaxTime == null) {
-					delete goods.selfDeliveryDemMaxTime;
-					return ;
-				}
-				if (goods.selfDeliveryDemMaxTime < 0 || goods.selfDeliveryDemMaxTime > 30) {
-					delete goods.selfDeliveryDemMaxTime;
-					toaster.pop('error', '国内最长交期必须在0~30天之间');
-					return ;
-				}
-				if (goods.selfDeliveryDemMinTime && goods.selfDeliveryDemMinTime > goods.selfDeliveryDemMaxTime) {
-					delete goods.selfDeliveryDemMaxTime;
-					toaster.pop('error', '国内最长交期必须大于国内最短交期');
-					return ;
-				}
+			if (goods.maxDelivery == null) {
+				delete goods.maxDelivery;
+				return ;
 			}
-			if (type === 'HK') {
-				if (goods.selfDeliveryHKMaxTime == null) {
-					delete goods.selfDeliveryHKMaxTime;
-					return ;
-				}
-				if (goods.selfDeliveryHKMaxTime < 0 || goods.selfDeliveryHKMaxTime > 30) {
-					delete goods.selfDeliveryHKMaxTime;
-					toaster.pop('error', '香港最长交期必须在0~30天之间');
-					return ;
+			if (goods.maxDelivery < 0 || goods.maxDelivery > 31) {
+				delete goods.maxDelivery;
+				if (type === 'HK') {
+					toaster.pop('error', '香港最长交期必须在0~31天之间');
+				}else {
+					toaster.pop('error', '国内最长交期必须在0~31天之间');
 				}
-				if (goods.selfDeliveryHKMinTime && goods.selfDeliveryHKMinTime > goods.selfDeliveryHKMaxTime) {
-					delete goods.selfDeliveryHKMaxTime;
+				return ;
+			}
+			if (goods.maxDelivery && goods.minDelivery > goods.maxDelivery) {
+				delete goods.maxDelivery;
+				if(type === 'HK') {
 					toaster.pop('error', '香港最长交期必须大于香港最短交期');
-					return ;
+				}else {
+					toaster.pop('error', '国内最长交期必须大于国内最短交期');
 				}
+				return ;
 			}
 			return true;
 		}
+		/**
+		 * 是否可拆卖
+		 * @param commodity
+		 */
+		$scope.toggleIsBreadUp = function (goods) {
+			goods.breakUp = !goods.breakUp;
+			if(!goods.breakUp) {
+				$scope.isNotBreakUp(goods);
+			}
+		};
+
+		/**
+		 * 如果不拆分需要重新计算最小起订量的信息
+		 * @param goods
+		 */
+		$scope.isNotBreakUp = function (goods) {
+			if(goods.minPackQty&&goods.minBuyQty) {
+				var remainder = goods.minBuyQty % goods.minPackQty;
+				if(remainder != 0) {
+					goods.minBuyQty = Number(NumberService.add((NumberService.sub(goods.minBuyQty, (goods.minBuyQty % goods.minPackQty))), goods.minPackQty));
+				}
+				if(goods.reserve) {
+					if(goods.minBuyQty > goods.reserve) {
+						goods.minBuyQty = Number(NumberService.sub(goods.reserve, (goods.reserve % goods.minPackQty)));
+					}
+				}
+			}
+		}
 	}]);
 
 });

Разница между файлами не показана из-за своего большого размера
+ 661 - 198
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_onSaleCtrl.js


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

@@ -1,7 +1,7 @@
 define([ 'app/app' ], function(app) {
     'use strict';
     app.register.controller('vendor_undercarriageCtrl', ['$scope', '$rootScope', '$q', 'Goods', 'Enterprise', 'toaster', 'Loading', 'StoreInfo', 'AuthenticationService', function ($scope, $rootScope, $q, Goods, Enterprise, toaster, Loading, StoreInfo, AuthenticationService) {
-        $rootScope.active = 'vendor_goods';
+        $rootScope.active = 'vendor_material';
 
         $scope.tab = 'undercarriage';
         $scope.keyword = '';

+ 58 - 13
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_upload_ctrl.js

@@ -7,7 +7,19 @@ define([ 'app/app' ], function(app) {
 	}]);
 
 	//批量上架的Ctrl
-	app.register.controller('batchPutOnCtrl', ['$scope', '$rootScope', 'ngTableParams', '$upload', '$q', 'AuthenticationService', 'BaseService', 'StoreInfo', 'SessionService', '$modal', 'toaster', 'ReleaseProductByBatch', 'Loading', function ($scope, $rootScope, ngTableParams, $upload, $q, AuthenticationService, BaseService, StoreInfo, SessionService, $modal, toaster, ReleaseProductByBatch, Loading) {
+	app.register.controller('batchPutOnCtrl', ['$scope', '$rootScope', 'ngTableParams', '$upload', '$q', 'AuthenticationService', 'BaseService', 'StoreInfo', 'SessionService', '$modal', 'toaster', 'ReleaseProductByBatch', 'Loading', 'Enterprise', function ($scope, $rootScope, ngTableParams, $upload, $q, AuthenticationService, BaseService, StoreInfo, SessionService, $modal, toaster, ReleaseProductByBatch, Loading, Enterprise) {
+
+		//获取币别信息
+		Enterprise.getCurrencyByRegisterAddress(null, function (data) {
+			if(data.code == 1) {
+				$scope.batch.currency = data.data;
+			}else {
+				toaster.pop('info', '提示', '您公司的注册地址为空,无法确定币别,系统默认为人民币');
+				$scope.batch.currency = 'RMB';
+			}
+		}, function (response) {
+			toaster.pop('info', '提示', '获取不到公司的币别信息');
+		});
 
 		//切换展示的信息
 		$scope.toggleActive = function(active) {
@@ -51,6 +63,11 @@ define([ 'app/app' ], function(app) {
 						$scope.pageParams.content = page.content;
 						$scope.pageParams.totalElements = page.totalElements;
 						$scope.pageParams.totalPages = page.totalPages;
+						$scope.pageParams.start = ((page.number - 1) * page.size) + 1;
+						$scope.pageParams.end =  page.number * page.size;
+						if($scope.pageParams.end > $scope.pageParams.totalElements) {
+							$scope.pageParams.end = $scope.pageParams.totalElements
+						}
 					}, function(data) {
 						toaster.pop();
 					});
@@ -74,8 +91,13 @@ define([ 'app/app' ], function(app) {
 
 		// 查看范例
 		$scope.showImg = function() {
-			var src = $rootScope.rootPath + "/static/img/product/excel_releaseByBatch_eg.png", box = $('#image-box');
-			box.show();
+			var src = '';
+			if($scope.batch.currency === 'RMB') {
+				src = $rootScope.rootPath + "/static/img/product/releaseByBatch-rmb.png";
+			}else {
+				src = $rootScope.rootPath + "/static/img/product/releaseByBatch-usd.png";
+			}
+			var box = $('#image-box');
 			box.find('img').attr('src', src);
 			box.find('a').click(function(){
 				box.hide();
@@ -83,6 +105,7 @@ define([ 'app/app' ], function(app) {
 			box.dblclick(function(){
 				box.hide();
 			});
+			box.show();
 		};
 
 		//获取登录的信息
@@ -137,6 +160,9 @@ define([ 'app/app' ], function(app) {
 
 		// 上传Excel批量发布(大量)
 		$scope.upload = function() {
+			if(($scope.batch.myFiles == null) || ($scope.batch.myFiles.length == 0)) {
+				return ;
+			}
 			var file = $scope.batch.myFiles[0];
 			if(!file) {
 				toaster.pop('info', '请选择需要上传的文件');
@@ -152,7 +178,28 @@ define([ 'app/app' ], function(app) {
 				$scope.batch.myFiles = [];
 				$scope.proInfo = data.info;
 				$scope.result = data;
-				toaster.pop('info', "验证通过"+($scope.result.success || 0) + '条,验证失败' + ($scope.result.failure || 0) +  '条,过滤' + ($scope.result.filter || 0) + '条');
+				var message = "";
+				if($scope.result.success) {
+					message = '验证通过' + $scope.result.success + '条';
+				}
+				if($scope.result.failure) {
+					if(message) {
+						message = message + ',验证失败' + $scope.result.failure +  '条';
+					}else {
+						message = '验证失败' + $scope.result.failure +  '条';
+					}
+				}
+				if($scope.result.filter) {
+					if(message) {
+						message = message + ',过滤' + $scope.result.filter +  '条';
+					}else {
+						message = '过滤' + $scope.result.filter +  '条';
+					}
+				}
+				if(!message) {
+					message = '没有提交任何信息'
+				}
+				toaster.pop('info', '提示', message);
 				$scope.relTableParams.page(1);
 				$scope.relTableParams.reload();
 			}).error(function(response) {
@@ -174,21 +221,19 @@ define([ 'app/app' ], function(app) {
 					templateUrl : $rootScope.rootPath + '/static/view/vendor/modal/releaseProductByBatchTip.html',
 					controller : 'releaseProductByBatchTipCtrl',
 				});
-
 				modalInstance.result.then(function(response) {
 				}, function(res) {
-					window.location.href = $rootScope.rootPath + '/trade/goods/release/template';
+					window.location.href = $rootScope.rootPath + '/release/product/release/template?currency' + '=' + $scope.batch.currency;
 				});
 			}else {
-				window.location.href = $rootScope.rootPath + '/trade/goods/release/template';
+				window.location.href = $rootScope.rootPath + '/release/product/release/template?currency' + '=' + $scope.batch.currency;
 			}
 		};
 
 		//批量发布
 		$scope.publish = function(event) {
-			if ($scope.result && $scope.result.success > 0) {
+			if ($scope.pageParams.totalElements > 0) {
 				ReleaseProductByBatch.batchRelease({batch : $scope.result.batch}, null, function(data) {
-					console.log(data);
 					toaster.pop("success", "提示", "发布成功 :" + data.data + "条");
 					$scope.relTableParams.page(1);
 					$scope.relTableParams.reload();
@@ -196,10 +241,10 @@ define([ 'app/app' ], function(app) {
 				}, function(res) {
 					toaster.pop("error", "发布失败", res.data);
 				});
-			} else {
+			}else {
 				event.stopPropagation();//阻止冒泡事件
 				event.preventDefault();//阻止默认的事件。
-				toaster.pop("info", "提示", "验证通过的数量为零,没有信息发布");
+				toaster.pop("info", "提示", "没有信息发布");
 			}
 		};
 
@@ -236,10 +281,10 @@ define([ 'app/app' ], function(app) {
 					getDownLoadStatus();
 				}, 500);
 			}else {
-				if(!$scope.result.batch) {
+				if(!$scope.result || !$scope.result.batch) {
 					toaster.pop('info', '提示', '您没有上传信息');
 				}else if(!$scope.result.failure) {
-					toaster.pop('info', '提示', '您上传的信息为空');
+					toaster.pop('info', '提示', '您没有匹配不成功的数据');
 				}
 			}
 		};

+ 24 - 5
src/main/webapp/resources/view/usercenter/forstore/buyer_cart.html

@@ -159,6 +159,9 @@
 		height: 130px;
 		line-height: 130px;
 	}
+	.shopCar .oder_list dl .line02 span.sure_oder{
+		background: none;
+	}
 	.shopCar .oder_list dl .pro_xq img{
 		margin-top: 33px;
 	}
@@ -483,6 +486,14 @@
 	.shopCar .oder_list dl .deal_btn.top{
 		top: 20%;
 	}
+	.sure_oder select:disabled.select{
+		background: url(static/img/user/images/select-disabled.png) no-repeat right;
+		border: #ccc 1px solid;
+		color: #ccc;
+	}
+	.sure_oder select:disabled.select:hover{
+		cursor: not-allowed;
+	}
 </style>
 <div class="user_right fr" id="buyer_cart">
 	<!--订单中心-->
@@ -568,16 +579,24 @@
 								</div>
                         	</span>
 							<span class="wd02">
-								<p class="f14" ng-if="cart.goods.b2cMinDelivery">
+								<p class="f14">
 									交期&nbsp;:&nbsp;
-									<i ng-if="cart.goods.b2cMinDelivery == cart.goods.b2cMaxDelivery" ng-bind="cart.goods.b2cMinDelivery"></i>
-									<i ng-if="cart.goods.b2cMinDelivery != cart.goods.b2cMaxDelivery" ng-bind="cart.goods.b2cMinDelivery + '-' + cart.goods.b2cMaxDelivery"></i>
+									<i ng-if="cart.goods.b2cMinDelivery&&(cart.goods.b2cMinDelivery == cart.goods.b2cMaxDelivery)" ng-bind="cart.goods.b2cMinDelivery"></i>
+									<i ng-if="cart.goods.b2cMinDelivery&&(cart.goods.b2cMinDelivery != cart.goods.b2cMaxDelivery)" ng-bind="cart.goods.b2cMinDelivery + '-' + cart.goods.b2cMaxDelivery"></i>
+									<i ng-if="!cart.goods.b2cMinDelivery&&(cart.buyCurrency == 'RMB')&&(cart.goods.b2cDeliveryDemMinTime == cart.goods.b2cDeliveryDemMaxTime)" ng-bind="cart.goods.b2cDeliveryDemMaxTime"></i>
+									<i ng-if="!cart.goods.b2cMinDelivery&&(cart.buyCurrency == 'RMB')&&(cart.goods.b2cDeliveryDemMinTime != cart.goods.b2cDeliveryDemMaxTime)" ng-bind="cart.goods.b2cDeliveryDemMinTime + '-' + cart.goods.b2cDeliveryDemMaxTime"></i>
+									<i ng-if="!cart.goods.b2cMinDelivery&&(cart.buyCurrency == 'USD')&&(cart.goods.b2cDeliveryHKMinTime == cart.goods.b2cDeliveryHKMaxTime)" ng-bind="cart.goods.b2cDeliveryHKMaxTime"></i>
+									<i ng-if="!cart.goods.b2cMinDelivery&&(cart.buyCurrency == 'USD')&&(cart.goods.b2cDeliveryHKMinTime != cart.goods.b2cDeliveryHKMaxTime)" ng-bind="cart.goods.b2cDeliveryHKMinTime + '-' + cart.goods.b2cDeliveryHKMaxTime"></i>
 								</p>
 								<!--<p class="f14" ng-if="cart.buyCurrency == 'RMB'">大陆{{cart.goods.b2cMinDelivery}}-{{cart.goods.b2cMaxDelivery}}</p>-->
 								<!--<p class="f14" ng-if="cart.buyCurrency == 'USD'">香港{{cart.goods.b2cMinDelivery}}-{{cart.goods.b2cMaxDelivery}}</p>-->
 							</span>
-							<span>
-									<p ng-bind="cart.price" class="f14"></p>
+							<span class="sure_oder">
+								<p ng-if="cart.goods.currencyName.indexOf('RMB-USD') == -1" ng-bind="cart.price" class="f14"></p>
+								<select ng-disabled="cart.isSelect || cart.status == 1" ng-if="cart.goods.currencyName.indexOf('RMB-USD') > -1" class="select" style="opacity: 1;padding-left: 10px;" ng-model="cart.buyCurrency" ng-change="selectCurr(cart, cart.buyCurrency)">
+									<option value="RMB" selected="selected" ng-bind="cart.rMBPrice | formateNumber : 6 | currencySysmbol : 'RMB'"></option>
+									<option value="USD" ng-bind="cart.uSDPrice | formateNumber : 6 | currencySysmbol : 'USD'"></option>
+								</select>
 							</span>
 							<span>
 								<div class="btn-wrap">

+ 15 - 5
src/main/webapp/resources/view/usercenter/forstore/order_pay.html

@@ -465,8 +465,12 @@
                         </span>
 						<span class="wd01" ng-if="order.status == 501">
 							交期 :
-							<i ng-if="detail.goodsHistory.b2cMinDelivery == detail.goodsHistory.b2cMaxDelivery" ng-bind="detail.goodsHistory.b2cMinDelivery"></i>
-							<i ng-if="detail.goodsHistory.b2cMinDelivery != detail.goodsHistory.b2cMaxDelivery" ng-bind="detail.goodsHistory.b2cMinDelivery + '-' + detail.goodsHistory.b2cMaxDelivery"></i>
+							<i ng-if="(!detail.goodsHistory.b2cMinDelivery)&&(detail.currencyName == 'RMB')&&(detail.goodsHistory.b2cDeliveryDemMinTime==detail.goodsHistory.b2cDeliveryDemMaxTime)" ng-bind="detail.goodsHistory.b2cDeliveryDemMinTime"></i>
+							<i ng-if="(!detail.goodsHistory.b2cMinDelivery)&&(detail.currencyName == 'RMB')&&(detail.goodsHistory.b2cDeliveryDemMinTime!=detail.goodsHistory.b2cDeliveryDemMaxTime)" ng-bind="detail.goodsHistory.b2cDeliveryDemMinTime + '-' + detail.goodsHistory.b2cDeliveryDemMaxTime"></i>
+							<i ng-if="(!detail.goodsHistory.b2cMinDelivery)&&(detail.currencyName == 'USD')&&(detail.goodsHistory.b2cDeliveryHKMinTime==detail.goodsHistory.b2cDeliveryHKMaxTime)" ng-bind="detail.goodsHistory.b2cDeliveryHKMinTime"></i>
+							<i ng-if="(!detail.goodsHistory.b2cMinDelivery)&&(detail.currencyName == 'USD')&&(detail.goodsHistory.b2cDeliveryHKMinTime!=detail.goodsHistory.b2cDeliveryHKMaxTime)" ng-bind="detail.goodsHistory.b2cDeliveryHKMinTime + '-' + detail.goodsHistory.b2cDeliveryHKMaxTime"></i>
+							<i ng-if="detail.goodsHistory.b2cMinDelivery&&(detail.goodsHistory.b2cMinDelivery == detail.goodsHistory.b2cMaxDelivery)" ng-bind="detail.goodsHistory.b2cMinDelivery"></i>
+							<i ng-if="detail.goodsHistory.b2cMinDelivery&&(detail.goodsHistory.b2cMinDelivery != detail.goodsHistory.b2cMaxDelivery)" ng-bind="detail.goodsHistory.b2cMinDelivery + '-' + detail.goodsHistory.b2cMaxDelivery"></i>
 							<!--{{detail.goodsHistory.b2cMinDelivery}}-{{detail.goodsHistory.b2cMaxDelivery}}-->
 						</span>
 						<span class="wd01" ng-if="order.status != 501">
@@ -474,8 +478,14 @@
 						<i ng-if="detail.b2cMinDelivery == detail.b2cMaxDelivery" ng-bind="detail.b2cMinDelivery"></i>
 						<i ng-if="detail.b2cMinDelivery != detail.b2cMaxDelivery" ng-bind="detail.b2cMinDelivery + '-' + detail.b2cMaxDelivery"></i>
 						</span>
-						<span class="wd01" ng-bind="detail.rmbUnitPrice | formateNumber : 6 | currencySysmbol : 'RMB'" ng-if="detail.goodsHistory.currencyName.indexOf('RMB') > -1 && order.status == 501"></span>
-						<span class="wd01" ng-bind="detail.usdUnitPrice | formateNumber : 6 | currencySysmbol : 'USD'" ng-if="detail.goodsHistory.currencyName.indexOf('USD') > -1 && order.status == 501"></span>
+						<span>
+							<select class="select" ng-model="detail.currencyName" ng-if="order.buyNow&&(order.status == 501)&&(detail.goodsHistory.currencyName=='RMB-USD')" ng-change="changeCurrency(detail)">
+								<option value="RMB" selected="selected" ng-bind="detail.rmbUnitPrice | formateNumber : 6 | currencySysmbol : 'RMB'"></option>
+								<option value="USD" ng-bind="detail.usdUnitPrice | formateNumber : 6 | currencySysmbol : 'USD'"></option>
+							</select>
+						</span>
+						<span class="wd01" ng-if="(order.status == 501)&&(detail.goodsHistory.currencyName == 'RMB')" ng-bind="detail.rmbUnitPrice | formateNumber : 6 | currencySysmbol : 'RMB'"></span>
+						<span class="wd01" ng-if="(order.status == 501)&&(detail.goodsHistory.currencyName == 'USD')" ng-bind="detail.usdUnitPrice | formateNumber : 6 | currencySysmbol : 'USD'"></span>
 						<span class="wd01" ng-bind="detail.taxUnitprice | formateNumber : 6 | currencySysmbol : 'RMB'" ng-if="detail.currencyName.indexOf('RMB') > -1 && order.status != 501"></span>
 						<span class="wd01" ng-bind="detail.taxUnitprice | formateNumber : 6 | currencySysmbol : 'USD'" ng-if="detail.currencyName.indexOf('USD') > -1 && order.status != 501"></span>
 						<span class="wd01">
@@ -513,7 +523,7 @@
 						</dd>
 						<dd class="oder-remark">
 							<span style="width: 100%">
-								<em>订单备注:</em>
+								<em style="font-size: 14px">订单备注:</em>
 								<input ng-if="order.status==501" type="text"  class="form-control" placeholder="请填写订单备注" ng-model="remarkList[details[0].storeid]" maxlength="200"/>
 								<em ng-if="order.status!=501" ng-bind="remarkList[order.storeid] || '无'" style="margin-left: 0;"></em>
 							</span>

+ 63 - 35
src/main/webapp/resources/view/vendor/forstore/vendor_material.html

@@ -210,7 +210,7 @@
 		padding-bottom: 20px;
 	}
 	.wanted_list01 .pagination{
-		margin: 15px 0;
+		margin: 0;
 	}
 	.ng-table-pager{
 		padding-bottom: 20px;
@@ -406,15 +406,32 @@
 	.col-xs-4 .f16{
 		font-size: 14px;
 	}
+	.pro_management .table tr td div span.switch{
+		width:39px;
+		height: 14px;
+		display: inline-block;
+	}
+	.pro_management .table tr td div span.switch button{
+		border: none;
+		position: relative;
+		top: 2px;
+		left: 5px;
+		width: 39px;
+		height: 14px;
+		background: url(static/img/icon/check-off.png) no-repeat center;
+	}
+	.pro_management .table tr td div span.switch button.active{
+		background: url("static/img/icon/check-ok.png") no-repeat center;
+	}
 </style>
 <div class="user_right fr">
 	<!--货品管理-->
 	<div class="pro_management device">
 		<div class="com_tab">
 			<ul class="fl" style="width: 100%">
-				<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">标准上架管理</a></li>
-				<li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品维护</a></li>
-				<li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架产品</a></li>
+				<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">产品库</a></li>
+				<li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品</a></li>
+				<li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>
 			</ul>
 		</div>
 		<div class="com_tab">
@@ -469,21 +486,19 @@
 							<span ng-show="isBatch"><input type="checkbox" ng-checked="material.isChoosed"  ng-click="chooseOne(material)"  id="{{$index+1}}"/><label for="{{$index+1}}"></label><br/></span>
 							<span ng-show="!isBatch" ng-bind="(param.currentPage - 1) * 10 + $index + 1"></span>
 						</td>
-						<td ng-bind="material.code" title="{{material.code}}"></td>
+						<td ng-bind="material.prodNum" title="{{material.prodNum}}"></td>
 						<td>
-							<span ng-if="!material.cmpUuId" ng-bind="material.title" title="{{material.title}}"></span>
-							<span ng-if="material.cmpUuId" ng-bind="material.kindCn" title="{{material.kindCn}}"></span>
-							<span ng-if="material.cmpUuId && !material.kindCn" ng-bind="material.kindEn" title="{{material.kindEn}}"></span>
+							<span ng-if="material.kind" ng-bind="material.kind" title="{{material.kind}}"></span>
+							<span ng-if="!material.kind" ng-bind="material.kinden" title="{{material.kinden}}"></span>
 						</td>
 						<td>
-							<div ng-if="!material.cmpUuId" ng-bind="material.brand" title="{{material.brand}}"></div>
-							<div class="ellipsis-div" ng-if="material.cmpUuId && material.b2cBrandEn" ng-bind="material.b2cBrandEn" title="{{material.b2cBrandEn}}"></div>
-							<div class="ellipsis-div" ng-if="material.cmpUuId && material.b2cBrandCn && material.b2cBrandCn != material.b2cBrandEn" ng-bind="material.b2cBrandCn" title="{{material.b2cBrandCn}}"></div>
+							<div class="ellipsis-div" ng-if="material.pbranden" ng-bind="material.pbranden" title="{{material.pbranden}}"></div>
+							<div class="ellipsis-div" ng-if="!material.pbranden" ng-bind="material.pbrand" title="{{material.pbrand}}"></div>
 						</td>
-						<td ng-bind="material.unit" title="{{material.unit}}"></td>
+						<td ng-bind="material.unit || 'PCS'" title="{{material.unit  || 'PCS'}}"></td>
 						<td>
-							<a ng-if="material.cmpUuId" ng-href="product/component/{{material.cmpUuId}}/" ng-bind="material.b2cCode" title="{{material.b2cCode}}" style="color: #333;"></a>
-							<span ng-if="!material.cmpUuId" ng-bind="material.cmpCode" title="{{material.cmpCode}}"></span>
+							<a ng-if="material.cmpUuId" ng-href="product/component/{{material.cmpUuId}}/" ng-bind="material.pcmpcode" title="{{material.pcmpcode}}" style="color: #333;"></a>
+							<span ng-if="!material.cmpUuId" ng-bind="material.pcmpcode" title="{{material.pcmpcode}}"></span>
 						</td>
 						<td>
 							<a ng-show="!isBatch && standard_tab == 'standard'" ng-click="showShelfArea(material)"><span ng-show="!isBatch">编辑</span></a>
@@ -496,28 +511,41 @@
 						<td colspan="7">
 							<div class="img">
 								<p class="title">&nbsp;</p>
-								<img ng-src="{{material.img || 'static/img/vendor/images/pro02.jpg'}}" alt="img"/>
+								<img ng-src="{{material.img || 'static/img/store/common/default.png'}}" alt="img"/>
 							</div>
 							<div class="content">
 								<p class="title">包装/生产日期</p>
 								<div class="input-list">
-									<input type="text" class="form-control" name="produceDate" title="produceDate" placeholder="2016.01.23" style="width: 108px;" ng-model="goods.produceDate"/>
-									<select name="isBreakUp" title="isBreakUp" class="select-adder form-control" style="width: 108px;display: none;" ng-model="goods.isBreakUp">
-										<option value="1">可拆卖</option>
-										<option value="0">不可拆卖</option>
-									</select>
+									<input type="text" class="form-control" name="packaging" title="包装" placeholder="包装方式" style="width: 108px;" ng-model="goods.packaging"/>
+								</div>
+								<div class="input-list">
+									<input type="text" class="form-control" name="produceDate" title="生产日期" placeholder="生产日期" style="width: 108px;" ng-model="goods.produceDate"/>
+									<!--<select name="breakUp" title="breakUp" class="select-adder form-control" style="width: 108px;" ng-model="goods.breakUp">-->
+										<!--<option value="1">可拆卖</option>-->
+										<!--<option value="0">不可拆卖</option>-->
+									<!--</select>-->
+								</div>
+								<div>
+									<span>可拆卖:</span>
+									<span class="switch"><button ng-class="{'active' : goods.breakUp}" ng-click="toggleIsBreadUp(goods)"></button></span>
 								</div>
 							</div>
 							<div class="content">
 								<p class="title">库存</p>
 								<div class="input-list">
-									<input type="number" class="wid48 form-control" name="reserve" title="reserve" placeholder="数量" ng-model="goods.reserve" ng-pattern="/^(-|)[0-9]*$/" ng-blur="setPriceMaxAmount(goods)"/>
+									<input type="number" class="wid48 form-control" name="reserve" title="库存" placeholder="数量" ng-model="goods.reserve" ng-pattern="/^(-|)[0-9]*$/" ng-blur="setPriceMaxAmount(goods)"/>
+								</div>
+							</div>
+							<div class="content">
+								<p class="title">最小包装量</p>
+								<div class="input-list">
+									<input type="number" class="form-control" name="minPackQty" title="最小包装量"  placeholder="数量" ng-model="goods.minPackQty" ng-pattern="/^(-|)[0-9]*$/" ng-blur="setPriceMinPackAmount(goods)" style="width: 70px;"/>
 								</div>
 							</div>
 							<div class="content">
 								<p class="title">起拍</p>
 								<div class="input-list">
-									<input type="number" class="wid48 form-control" name="minBuyQty" title="minBuyQty"  placeholder="数量" ng-model="goods.minBuyQty" ng-pattern="/^(-|)[0-9]*$/" ng-blur="setPriceMinAmount(goods)"/>
+									<input type="number" class="wid48 form-control" name="minBuyQty" title="起拍"  placeholder="数量" ng-model="goods.minBuyQty" ng-pattern="/^(-|)[0-9]*$/" ng-blur="setPriceMinAmount(goods)"/>
 								</div>
 							</div>
 							<div class="content">
@@ -525,15 +553,15 @@
 								<div class="input-list">
 									<p ng-if="!store.enType || store.enType === 'HK'">
 										<span>香港:</span>
-										<span><input type="number" class="wid36 form-control" name="selfDeliveryHKMinTime" title="selfDeliveryHKMinTime" placeholder="天数" ng-model="goods.selfDeliveryHKMinTime" ng-blur="checkMinDelivery(goods, 'HK')"/></span>
+										<span><input type="number" class="wid36 form-control" name="minDelivery" title="最小交期" placeholder="天数" ng-model="goods.minDelivery" ng-blur="checkMinDelivery(goods, 'HK')"/></span>
 										<span style="margin-left: 4px;">–</span>
-										<span><input type="number" class="wid36 form-control" name="selfDeliveryHKMaxTime" title="selfDeliveryHKMaxTime" placeholder="天数" ng-model="goods.selfDeliveryHKMaxTime" ng-blur="checkMaxDelivery(goods, 'HK')"/></span>
+										<span><input type="number" class="wid36 form-control" name="maxDelivery" title="最大交期" placeholder="天数" ng-model="goods.maxDelivery" ng-blur="checkMaxDelivery(goods, 'HK')"/></span>
 									</p>
 									<p ng-if="!store.enType || store.enType === 'MAINLAND'">
 										<span>国内:</span>
-										<span><input type="number" class="wid36 form-control" name="selfDeliveryDemMinTime" title="selfDeliveryDemMinTime" placeholder="天数" ng-model="goods.selfDeliveryDemMinTime" ng-blur="checkMinDelivery(goods, 'DEM')"/></span>
+										<span><input type="number" class="wid36 form-control" name="minDelivery" title="最小交期" placeholder="天数" ng-model="goods.minDelivery" ng-blur="checkMinDelivery(goods, 'DEM')"/></span>
 										<span style="margin-left: 4px;">–</span>
-										<span><input type="number" class="wid36 form-control" name="selfDeliveryDemMaxTime" title="selfDeliveryDemMaxTime" placeholder="天数" ng-model="goods.selfDeliveryDemMaxTime" ng-blur="checkMaxDelivery(goods, 'DEM')"/></span>
+										<span><input type="number" class="wid36 form-control" name="maxDelivery" title="最大交期" placeholder="天数" ng-model="goods.maxDelivery" ng-blur="checkMaxDelivery(goods, 'DEM')"/></span>
 									</p>
 								</div>
 							</div>
@@ -541,35 +569,35 @@
 								<p class="title">价格梯度</p>
 								<div class="input-list" ng-repeat="price in goods.prices">
 									<p>
-										<span><input type="number" class="wid42 form-control"  placeholder="数量" ng-model="price.start" ng-blur="changePriceStart(goods, $index)" ng-pattern="/^[0-9]*$/"/></span>
+										<span><input ng-disabled="$index == 0" type="number" class="wid42 form-control"  placeholder="数量" ng-model="price.start" ng-blur="changePriceStart(goods, $index)" ng-pattern="/^[0-9]*$/"/></span>
 										<span style="margin-left: 4px;">–</span>
-										<span><input type="number" class="wid42 form-control"  placeholder="数量" ng-model="price.end" ng-blur="changePriceEnd(goods, $index)" ng-pattern="/^[0-9]*$/"/></span>
+										<span><input ng-disabled="$index == (goods.prices.length -1)" type="number" class="wid42 form-control"  placeholder="数量" ng-model="price.end" ng-blur="changePriceEnd(goods, $index)" ng-pattern="/^[0-9]*$/"/></span>
 									</p>
 								</div>
 							</div>
 							<div class="content" ng-if="!store.enType || store.enType === 'HK'">
-								<p class="title">香港交货($)</p>
+								<p class="title">单价($)</p>
 								<div class="input-list" ng-repeat="price in goods.prices">
-									<input type="number" class="wid92 form-control"  placeholder="香港交货($) " ng-model="price.uSDPrice"/>
+									<input type="number" class="wid92 form-control"  placeholder="单价($) " ng-model="price.uSDPrice"/>
 								</div>
 							</div>
 							<div class="content" ng-if="!store.enType || store.enType === 'MAINLAND'">
-								<p class="title">大陆交货(¥)</p>
+								<p class="title">单价(¥)</p>
 								<div class="input-list" ng-repeat="price in goods.prices">
-									<input type="number" class="wid92 form-control"  placeholder="大陆交货(¥)" ng-model="price.rMBPrice"/>
+									<input type="number" class="wid92 form-control"  placeholder="单价(¥)" ng-model="price.rMBPrice"/>
 								</div>
 							</div>
 							<div class="content">
 								<p class="title">&nbsp;</p>
 								<div class="input-list" ng-repeat="price in goods.prices" style="height: 24px;line-height: 24px;margin-bottom: 5px;">
 									<a class="reduce" ng-click="deletePrice(goods, $index)"><i class="fa fa-minus-circle" ng-class="{ 'restrict-color': goods.prices.length === 1 }"></i></a>
-									<a class="add" ng-click="addPrice(goods, $index)"><i class="fa fa-plus-circle" ng-class="{ 'restrict-color': $index === 4 }"></i></a>
+									<a class="add" ng-click="addPrice(goods, $index)"><i class="fa fa-plus-circle" ng-class="{ 'restrict-color': $index === 2 }"></i></a>
 								</div>
 							</div>
 							<div class="content">
 								<p class="title">自营 / 寄售</p>
 								<div class="input-list">
-									<select name="isSelfSupport" title="isSelfSupport" class="wid92 select-adder form-control" ng-model="goods.isSelfSupport">
+									<select name="isSelfSupport" title="isSelfSupport" class="wid92 select-adder form-control" ng-model="goods.isSelfSupport" ng-disabled="store.status != 'OPENED'">
 										<option value="1">自营</option>
 										<option value="0">寄售</option>
 									</select>
@@ -603,7 +631,7 @@
 						<strong class="text-inverse">*</strong>商城暂未收录的 品牌/器件,”原厂型号“将会显示为空且不可上架售卖,<br/>
 						如需上架可先点击 【匹配】按钮,若匹配不成功,可前往<a ui-sref="vendor_brand_apply" target="_blank"> 品牌申请/</a><a ui-sref="vendor_component_apply" target="_blank">器件申请</a>,提出申请
 					</div>
-					<div ng-if="currenctMaterial.length != 0">显示{{(param.currentPage - 1) * 10 + 1}}-<!--<span ng-bind="materialAll.size"></span>-->{{ param.currentPage * 10 }},共:<span ng-bind="materialAll.totalElements" cl style="color: #5078cb;"></span>个</div>
+					<div ng-if="currenctMaterial.length != 0">显示 {{(param.currentPage - 1) * 10 + 1}}-<!--<span ng-bind="materialAll.size"></span>-->{{ param.currentPage * 10 }}, 共: <span ng-bind="materialAll.totalElements" cl style="color: #5078cb;"></span> 个</div>
 				</div>
 				<div class="ng-cloak ng-table-pager" style="text-align: right;margin-right: 60px;" ng-if="materialAll.totalPages>1">
 					<ul class="pagination ng-table-pagination">

+ 267 - 386
src/main/webapp/resources/view/vendor/forstore/vendor_onSale.html

@@ -259,7 +259,7 @@
         text-align: left !important;
     }
     .vendor-tab.table td .wid135{
-        width: 115px;
+        width: 143px;
         margin-left: 7px;
         position: relative;
         top: -10px;
@@ -273,14 +273,13 @@
         white-space: nowrap;
         overflow: hidden;
         text-overflow: ellipsis;
-        line-height: 28px;
     }
     .vendor-tab.table td p{
         font-size: 14px;
         text-align: left;
     }
     /*.vendor-tab.table>tbody>tr{*/
-        /*height: 252px;*/
+    /*height: 252px;*/
     /*}*/
     .public-tab.table>tbody>tr>td{
         /*border-bottom: #cfcfcf 1px dashed;*/
@@ -339,7 +338,7 @@
         float: left;
     }
     .edit-form td div span:first-child{
-        /*margin-right: 2px;*/
+        margin-right: 2px;
     }
     .filter{
         position: relative;
@@ -459,7 +458,6 @@
     .public-tab.table tr td.middle .img,.vendor-tab.table td .wid135{
         margin-top: 15px;
     }
-
     .edit-form .error{
         border: #f00 1px solid !important;
     }
@@ -470,171 +468,36 @@
     .public-tab.table>tbody>tr>td div:last-child a.add[disabled], .public-tab.table>tbody>tr>td div:last-child a.reduce[disabled]{
         color: #c7c7c7 !important;
     }
-    .text-left{
-        text-align: left !important;
-    }
-    .width82{
-        width: 82px !important;
-    }
-    .public-tab.table>tbody>tr>td a.delete{
-        margin: 0;
-        width: 16px;
-        height: 16px;
-        border-radius:100%;
-        background: #fff;
-        display: inline-block;
-        line-height: 14px;
-        text-align: center;
-        margin-left: 3px;
-    }
-    .public-tab.table>tbody>tr>td a.delete i{
-        font-size: 10px;
-        line-height: 16px;
-    }
-    .public-tab.table>tbody>tr>td a.delete:hover i{
-        color: #5078cb;
-    }
-    .public-tab.table>tbody>tr>td button.add{
-        width: 83px;
-        height: 24px;
-        background: #dff3fd;
-        text-align: center;
-        border-radius: 3px;
-        font-size: 12px;
-        color: #333 !important;
-    }
-    .public-tab.table>tbody>tr>td button.add i{
-        color: #fc5901;
-        margin-right: 3px;
-    }
-    .public-tab.table>tbody>tr>td div.step span{
-        display: inline-block;
-        background: #b5b3b3;
-        font-size: 12px;
+     .pro_management .table>tbody>tr>td div.img a.delete-img {
+         position: absolute;
+         top: 2px;
+         right: 0;
+         z-index: 20;
+         width: 20px;
+         height: 20px;
+         line-height: 16px;
+         border: none;
+     }
+    .pro_management .table>tbody>tr>td div.img a.delete-img i {
         color: #fff;
-        text-align: center;
-    }
-    .public-tab.table>tbody>tr>td div.step span i{
         font-size: 12px;
-        line-height: 24px;
-    }
-    .public-tab.table>tbody>tr>td div.step span.dot{
-        margin: 0 1px;
     }
-    .public-tab.table>tbody>tr>td div.step .first,.public-tab.table>tbody>tr>td div.step .last{
-        width: 42px;
-        height: 24px;
-        overflow: hidden;
-        text-overflow: ellipsis;
-        white-space: nowrap;
-    }
-    .public-tab.table>tbody>tr>td div.step .first{
-        border-top-left-radius: 2px;
-        border-bottom-left-radius: 2px;
-        margin-left: 10px;
-    }
-    .public-tab.table>tbody>tr>td div.step .last{
-        border-top-right-radius: 2px;
-        border-bottom-right-radius: 2px;
-    }
-    .public-tab.table>tbody>tr>td div.step span.dot{
-        width: 18px;
-        height: 24px;
-    }
-    .public-tab.table>tbody>tr>td div.dot01,.public-tab.table>tbody>tr>td div.dot01 span{
-        margin-top: 0;
-        height: 10px;
-        text-align: center;
-        position: relative;
-    }
-    .public-tab.table>tbody>tr>td div.dot01 i{
-        position: absolute;
-       left: 55px;
-        color: #b5b3b3;
-        top:-3px;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1{
-        line-height: 85px;
-        margin: 0;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a{
-        margin: 0;
-        width: 16px;
-        height: 16px;
-        border-radius:100%;
-        background: #fff;
+    .public-tab.table tr td div span.switch{
+        width:39px;
+        height: 14px;
         display: inline-block;
-        line-height: 14px;
-        text-align: center;
-        font-size: 12px;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.edit ,.public-tab.table>tbody>tr>td div.icon-1 a.ok i{
-        color: #36ba02;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.load ,.public-tab.table>tbody>tr>td div.icon-1 a.off{
-        margin-left: 5px;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.load ,.public-tab.table>tbody>tr>td div.icon-1 a.off i{
-        color: #fc5901;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.edit:hover,.public-tab.table>tbody>tr>td div.icon-1 a.ok:hover{
-        background: #36ba02;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.edit:hover i,.public-tab.table>tbody>tr>td div.icon-1 a.ok:hover i{
-        color: #fff;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.load:hover,.public-tab.table>tbody>tr>td div.icon-1 a.off:hover{
-        background: #fc5901;
-    }
-    .public-tab.table>tbody>tr>td div.icon-1 a.load:hover i,.public-tab.table>tbody>tr>td div.icon-1 a.off:hover i{
-        color: #fff;
-    }
-    .public-tab.table>tbody tr.tr-bg:hover{
-      background: #c7ebfd;
-    }
-    .public-tab.table>tbody tr.tr-bg td div.icon-1{
-        display: none;
-    }
-    .public-tab.table>tbody tr.tr-bg:hover td div.icon-1{
-        display: block;
     }
-    .span100{
-        width: 100% !important;
-        text-align: center !important;
-        overflow: hidden;
-        text-overflow: ellipsis;
-        white-space: nowrap;
-    }
-    div.ng-table-pager div.page-go-block{
-        margin-top: 15px !important;
-    }
-    .public-tab.table>tbody>tr>td button.add.disabled{
-        background: #cdcccc;
-        color: #999 !important;
-    }
-    .public-tab.table>tbody>tr>td button.add.disabled i{
-        color: #999;
-    }
-    .edit-form td div.price:nth-child(1){
-        margin-bottom: 5px;
-    }
-    .edit-form td div.price:nth-child(2){
-        margin-bottom: 5px;
-    }
-    .edit-form td div.step:nth-child(2){
-        margin-top: 10px;
-    }
-    .edit-form td div.step:nth-child(3){
-        margin-top: 10px;
-    }
-    .text-more-80{
-        float: left;
-    }
-    .text-more-80 span:first-child{
-        float: left;
+    .public-tab.table tr td div span.switch button{
+        border: none;
+        position: relative;
+        top: 6px;
+        left: 5px;
+        width: 39px;
+        height: 14px;
+        background: url(static/img/icon/check-off.png) no-repeat center;
     }
-    .text-more-80 span.text-more{
-        width: 50px;
+    .public-tab.table tr td div span.switch button.active{
+        background: url("static/img/icon/check-ok.png") no-repeat center;
     }
 </style>
 <div class="user_right fr">
@@ -642,8 +505,8 @@
     <div class="pro_management device">
         <div class="com_tab">
             <ul class="fl" style="width: 100%">
-                <li ng-class="{'active': tab == 'vendor_standardPutOn'}"><a ui-sref="vendor_standardPutOn">标库上架管理</a></li>
-                <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品维护</a></li>
+                <li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material">产品库</a></li>
+                <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品</a></li>
                 <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>
                 <li class="down-goods">
                     <!--<span ng-click="downGoods()">
@@ -657,7 +520,7 @@
         </div>
         <div class="search-check">
             <div class="search fl">
-                <input type="text" class="form-control" ng-model="keyword" ng-search="onSearch()" placeholder="类目/品牌/型号"/>
+                <input type="text" class="form-control" ng-model="keyword" ng-search="onSearch()" placeholder="产品型号/品牌/批次"/>
                 <button ng-click="onSearch()">搜索</button>
                 <a ng-click="downGoods()" class="down-goods-btn">批量导出</a>
                 <form style="display: none;" id="down-load-goods" method="get">
@@ -665,17 +528,17 @@
                 </form>
             </div>
             <!--<div class="check fr">-->
-                <!--<a  ng-click="">批量操作</a>-->
-                <!--<span class="check-btn">-->
-                    <!--<label class="check-active">-->
-                        <!--<input type="checkbox" id="AllChoose"/>-->
-                        <!--<label for="AllChoose"></label>-->
-                        <!--<span>全选</span>-->
-                    <!--</label>-->
-                    <!--<a href="#">下架</a>-->
-                    <!--<a href="#">取消</a>-->
-                    <!--<a href="#">确定</a>-->
-                <!--</span>-->
+            <!--<a  ng-click="">批量操作</a>-->
+            <!--<span class="check-btn">-->
+            <!--<label class="check-active">-->
+            <!--<input type="checkbox" id="AllChoose"/>-->
+            <!--<label for="AllChoose"></label>-->
+            <!--<span>全选</span>-->
+            <!--</label>-->
+            <!--<a href="#">下架</a>-->
+            <!--<a href="#">取消</a>-->
+            <!--<a href="#">确定</a>-->
+            <!--</span>-->
             <!--</div>-->
         </div>
         <!--搜索 批量操作-->
@@ -704,219 +567,238 @@
             <div class="tab">
                 <table class="vendor-tab public-tab table">
                     <thead>
-                        <tr>
-                            <th width="45" style="padding:8px 0;">序号</th>
-                            <th>产品信息</th>
-                            <th width="85" style="padding:8px 0;">&nbsp;</th>
-                            <th width="110" class="text-left">生产日期</th>
-                            <th width="80">起订量</th>
-                            <th width="140">梯度</th>
-                            <th width="110">单价</th>
-                            <th width="115">交期(天)</th>
-                            <th width="90">在售数量</th>
-                            <th width="60" class="padding0">操作</th>
-                        </tr>
+                    <tr>
+                        <th width="50" style="padding:8px 0;">序号</th>
+                        <th width="220">产品信息</th>
+                        <th width="115">包装/生产日期</th>
+                        <th width="140">库存</th>
+                        <th width="105">数量</th>
+                        <th ng-if="onsale.currency == 'USD'" width="116">单价<b style="font-size: 12px;font-weight: 600">($)</b></th>
+                        <th ng-if="onsale.currency == 'RMB'" width="116">单价<b style="font-size: 12px;font-weight: 600">(¥)</b></th>
+                        <th width="120">交期</th>
+                        <th class="filter" width="90">
+                            <a>{{selfSupport}}<i class="fa fa-angle-double-down angle-hover-up" aria-hidden="true"></i></a>
+                            <div class="hover-show">
+                                <a ng-click="changeSupportType(selfSupportType.ALL)" title="自营/寄售">自营/寄售</a>
+                                <a ng-click="changeSupportType(selfSupportType.SELF_SUPPORT)" title="自营">自营</a>
+                                <a ng-click="changeSupportType(selfSupportType.CONSIGNMENT)" title="寄售">寄售</a>
+                            </div>
+                        </th>
+                        <th width="60" class="padding0">操作</th>
+                    </tr>
                     </thead>
                     <tbody class="bottom-no">
-                        <tr style="height: 14px;">
-                            <td colspan="10" class="hei16"></td>
-                        </tr>
+                    <tr style="height: 14px;">
+                        <td colspan="10" class="hei16"></td>
+                    </tr>
                     </tbody>
                     <tbody ng-repeat="commodity in currenctGoods">
-                        <tr class="edit-form tr-bg" ng-if="!commodity.edit">
-                            <td class="middle padding0 check-input">
-                               <!-- <span><input type="checkbox" id="{{$index+1}}"/><label for="{{$index+1}}"></label><br/></span>-->
-                                <div>{{$index + 1}}</div>
-                            </td>
-                            <td class="middle"  style="vertical-align: top !important;">
-                                <div class="fl img">
-                                    <a><img ng-src="{{commodity.img ? commodity.img : 'static/img/store/common/default.png'}}"/></a>
-                                    <div class="hover-show">
-                                        <a ng-click="showImg(commodity.img || 'static/img/store/common/default.png')" title="查看大图"><i class="fa fa-search"></i>查看</a>
-                                    </div>
-                                </div>
-                                <div class="fr wid135">
-                                    <p>类目: <em ng-bind="commodity.kindNameCn" title="{{commodity.kindNameCn}}">CPU</em></p>
-                                    <p>型号: <em ng-bind="commodity.code" title="{{commodity.code}}">LPC1112</em></p>
-                                    <p>品牌: <em ng-bind="commodity.brandNameEn" title="{{commodity.brandNameEn}}">NXP</em></p>
-                                </div>
-                            </td>
-                            <td style="padding: 8px 0;">
-                                <div class="text-more-80">
-                                    <span>包装: </span>
-                                    <span ng-bind="commodity.packaging || '-'" title="{{commodity.packaging}}" class="text-more"></span>
-                                </div>
-                                <div class="text-more-80">
-                                    <span>单位: </span>
-                                    <span ng-bind="commodity.unit || 'PCS'" title="{{commodity.unit || 'PCS'}}" class="text-more">PCS</span>
-                                </div>
-                                <div class="text-more-80">
-                                    <span>封装: </span>
-                                    <span ng-bind="commodity.encapsulation || '-'" title="{{commodity.encapsulation || '-'}}" class="textmore" style="width:50px;">BGA</span>
-                                </div>
-                                <!--<div>-->
-                                <!--<span>可拆卖</span>-->
-                                <!--</div>-->
-                            </td>
-                            <td style="white-space: inherit; padding-right: 0;">
-                                <div>
-                                    <span ng-bind="commodity.produceDate" class="text-more" style="width: 100px;" title="{{commodity.produceDate}}">2017-07-10</span>
-                                </div>
-                                <div class="text-more-80">
-                                    <span>包装数量: </span>
-                                    <span ng-bind="commodity.minPackQty" title="{{commodity.minPackQty}}" class="text-more" style="width: 40px;"></span>
-                                </div>
-                                <div>
-                                    <span ng-bind="((storeInfo.uuid != 'undefind')&&(commodity.storeid == storeInfo.uuid)&&(storeInfo.storeName.indexOf('优软测试二') < 0)&&(storeInfo.storeName.indexOf('优软商城') < 0)) ? '自营' : '寄售'">自营</span>
-                                </div>
-                            </td>
-                            <td>
-                                <div>
-                                    <span class="span100" ng-bind="commodity.minBuyQty" title="{{commodity.minBuyQty}}">5000</span>
+                    <tr class="edit-form" ng-if="!commodity.edit">
+                        <td class="middle padding0 check-input">
+                            <!-- <span><input type="checkbox" id="{{$index+1}}"/><label for="{{$index+1}}"></label><br/></span>-->
+                            <div>{{$index + 1}}</div>
+                        </td>
+                        <td class="middle"  style="vertical-align: top !important;">
+                            <div class="fl img">
+                                <a><img ng-src="{{commodity.img ? commodity.img : 'static/img/store/common/default.png'}}"/></a>
+                                <div class="hover-show">
+                                    <a ng-click="showImg(commodity.img || 'static/img/store/common/default.png')" title="查看大图"><i class="fa fa-search"></i>查看</a>
                                 </div>
-                            </td>
-                            <td>
-                                <div ng-repeat="price in commodity.prices">
-                                    <span style="margin-left: 40px;" ng-bind="price.start + '+'">11+</span>
+                            </div>
+                            <div class="fr wid135">
+                                <p>类目: <em ng-bind="commodity.kindNameCn" title="{{commodity.kindNameCn}}"></em></p>
+                                <p>型号: <em ng-bind="commodity.code" title="{{commodity.code}}">LPC1112</em></p>
+                                <p>品牌: <em ng-bind="commodity.brandNameEn" title="{{commodity.brandNameEn}}">NXP</em></p>
+                            </div>
+                        </td>
+                        <td style="white-space: inherit;">
+                            <div>
+                                <span ng-bind="commodity.packaging || '无包装信息'"></span><br/>
+                            </div>
+                            <div>
+                                <span ng-bind="commodity.produceDate || '-'"></span>
+                            </div>
+                            <div>
+                                <span ng-bind="commodity.breakUp ? '可拆卖' : '不可拆卖'">可拆卖</span>
+                            </div>
+                        </td>
+                        <td style="padding: 8px 0;">
+                            <div>
+                                <span>库存: </span>
+                                <span ng-bind="commodity.reserve" title="{{commodity.reserve}}"></span>
+                            </div>
+                            <div>
+                                <span>起拍: </span>
+                                <span ng-bind="commodity.minBuyQty" title="{{commodity.minBuyQty}}"></span>
+                            </div>
+                            <div>
+                                <span>最小包数量: </span>
+                                <span ng-bind="commodity.minPackQty" title="{{commodity.minPackQty}}"></span>
+                            </div>
+                        </td>
+                        <td>
+                            <div ng-repeat="price in commodity.prices" >
+                                <span ng-bind="price.start + '+'" style="margin-left: 20px;"></span>
+                            </div>
+                        </td>
+                        <td ng-if="onsale.currency == 'USD'">
+                            <div  ng-repeat="price in commodity.prices" ng-if="price.uSDPrice" >
+                                <span ng-bind="price.uSDPrice | formateNumber : 6 | currencySysmbol : commodity.currencyName"></span>
+                            </div>
+                        </td>
+                        <td ng-if="onsale.currency == 'RMB'">
+                            <div ng-repeat="price in commodity.prices" ng-if="price.rMBPrice">
+                                <span ng-bind="price.rMBPrice | formateNumber : 6 | currencySysmbol : commodity.currencyName" style="margin-left: 10px;"></span>
+                            </div>
+                        </td>
+                        <td>
+                            <div ng-if="onsale.currency == 'RMB'">
+                                <span ng-if="commodity.b2cMaxDelivery && (commodity.b2cMaxDelivery != commodity.b2cMinDelivery)" ng-bind="'大陆:' + commodity.b2cMinDelivery + '-'+ commodity.b2cMaxDelivery"></span>
+                                <span ng-if="commodity.b2cMaxDelivery && (commodity.b2cMaxDelivery == commodity.b2cMinDelivery)" ng-bind="'大陆:' + commodity.b2cMinDelivery"></span>
+                            </div>
+                            <div ng-if="onsale.currency == 'USD'">
+                                <span ng-if="commodity.b2cMaxDelivery && (commodity.b2cMinDelivery != commodity.b2cMaxDelivery)" ng-bind="'香港:' + commodity.b2cMinDelivery + '-'+ commodity.b2cMaxDelivery"></span>
+                                <span ng-if="commodity.b2cMaxDelivery && (commodity.b2cMinDelivery == commodity.b2cMaxDelivery)" ng-bind="'香港:' + commodity.b2cMinDelivery"></span>
+                            </div>
+                        </td>
+                        <td>
+                            <div>
+                                <span ng-bind="(storeInfo.uuid != 'undefind' && commodity.storeid == storeInfo.uuid && storeInfo.storeName.indexOf('优软测试二') < 0 && storeInfo.storeName.indexOf('优软商城') < 0) ? '自营' : '寄售'"  style="text-align: center; width: 100%;"></span>
+                            </div>
+                        </td>
+                        <td class="padding0">
+                            <div ng-if="!commodity.sourceId"><a class="edit" ng-click="editCommodity(commodity)">修改</a></div><!--updateCommodityInfo(commodity, false)-->
+                            <div ng-if="commodity.sourceId"><a style="margin: 0;">来源UAS</a></div>
+                            <div ng-if="!commodity.sourceId"><a ng-click="soldOut(commodity)">下架</a></div>
+                        </td>
+                    </tr>
+                    <tr class="edit-form" ng-if="commodity.edit">
+                        <td class="middle padding0 check-input">
+                            <div>{{$index + 1}}</div>
+                        </td>
+                        <td class="middle"  style="vertical-align: top !important;">
+                            <div class="fl img">
+                                <a><img ng-src="{{commodity.editPic ? commodity.editPic : 'static/img/store/common/default.png'}}"/></a>
+                                <div class="edit-img">
+                                    <a ng-click="commodity.editPic = null" class="delete-img" title="删除" ng-if="commodity.editPic"><i class="fa fa-trash"></i></a>
+                                    <a ng-click="editGoodsPicture(commodity.editPic || 'static/img/store/common/default.png', commodity)" title="修改图片"><img src="static/img/icon/update-img.png" /></a>
                                 </div>
-                            </td>
-                            <td>
-                                <div ng-repeat="price in commodity.prices">
-                                    <span ng-if="$$onSale.currency == 'RMB'" style="margin-left: 20px;" ng-bind="price.rMBPrice | formateNumber : 6 | currencySysmbol : $$onSale.currency">0.52</span>
-                                    <span ng-if="$$onSale.currency == 'USD'" style="margin-left: 20px;" ng-bind="price.uSDPrice | formateNumber : 6 | currencySysmbol : $$onSale.currency">0.52</span>
-                                </div>
-                            </td>
-                            <td>
-                                <div>
-                                    <span  ng-if = "commodity.b2cMinDelivery!= commodity.b2cMaxDelivery" ng-bind="commodity.b2cMinDelivery + '-' + commodity.b2cMaxDelivery" style="margin-left: 35px;"></span>
-                                    <span  ng-if = "commodity.b2cMinDelivery == commodity.b2cMaxDelivery" ng-bind="commodity.b2cMinDelivery" style="margin-left: 35px;"></span>
-                                </div>
-                            </td>
-                            <td>
-                                <div>
-                                   <span class="span100" ng-bind="commodity.reserve" title="{{commodity.reserve}}">121313</span>
-                                   <span class="span100 f12"  style="color: #999" ng-if="commodity.status == 602"><i class="fa fa-exclamation-circle" style="font-size: 12px; color: #5078cb; margin-right: 3px;"></i>已失效</span>
-                                </div>
-                            </td>
-                            <td class="padding0">
-                                <div ng-if="!commodity.sourceId" class="icon-1">
-                                    <a ng-click="editCommodity(commodity)" class="edit" title="编辑"><i class="fa fa-pencil"></i></a>
-                                    <a ng-click="soldOut(commodity)" class="load" title="下架"><i class="fa fa-download"></i></a>
-                                </div>
-                                <div ng-if="commodity.sourceId"><a style="margin: 0;">来源UAS</a></div>
-                            </td>
-                        </tr>
-                        <tr class="edit-form" ng-if="commodity.edit" style="background: #c7ebfd;">
-                            <td class="middle padding0 check-input">
-                                <div>{{$index + 1}}</div>
-                            </td>
-                            <td class="middle"  style="vertical-align: top !important; padding: 8px 0;">
-                                <div class="fl img">
-                                    <a><img ng-src="{{commodity.editPic ? commodity.editPic : 'static/img/store/common/default.png'}}"/></a>
-                                    <div class="edit-img">
-                                        <a ng-click="editGoodsPicture(commodity.editPic || 'static/img/store/common/default.png', commodity)" title="修改图片"><img src="static/img/icon/update-img.png" /></a>
-                                    </div>
-                                </div>
-                                <div class="fr wid135">
-                                    <p>类目: <em ng-bind="commodity.kindNameCn" title="commodity.kindNameCn" >CPU</em></p>
-                                    <p>型号: <em ng-bind="commodity.code" title="{{commodity.code}}">LPC1112</em></p>
-                                    <p>品牌: <em ng-bind="commodity.brandNameEn" title="{{commodity.brandNameEn}}">NXP</em></p>
-                                </div>
-                            </td>
-                            <td style="padding: 8px 0;">
-                                <div  class="text-more-80">
-                                    <span>包装: </span>
-                                    <span ng-bind="commodity.packaging || '-'" title="{{commodity.packaging}}" class="text-more"></span>
-                                </div>
-                                <div  class="text-more-80">
-                                    <span>单位: </span>
-                                    <span title="{{commodity.unit || 'PCS'}}" ng-bind="commodity.unit || 'PCS'" class="text-more">PCS</span>
-                                </div>
-                                <div  class="text-more-80">
-                                    <span>封装: </span>
-                                    <span title="{{commodity.encapsulation || '-'}}" ng-bind="commodity.encapsulation || '-'" class="text-more">BGA</span>
-                                </div>
-                            </td>
-                            <td style="white-space: inherit; padding-right: 0;">
-                                <div>
-                                    <span ng-bind="commodity.produceDate" title="{{commodity.produceDate}}" style="width: 100px;"></span>
-                                </div>
-                                <div class="text-more-80">
-                                    <span>包装数量: </span>
-                                    <span ng-bind="commodity.minPackQty" title="{{commodity.minPackQty}}" class="text-more" style="width: 40px;"></span>
-                                </div>
-                                <div>
-                                    <span ng-bind="((storeInfo.uuid != 'undefind')&&(commodity.storeid == storeInfo.uuid)&&(storeInfo.storeName.indexOf('优软测试二') < 0)&&(storeInfo.storeName.indexOf('优软商城') < 0)) ? '自营' : '寄售'">自营</span>
-                                </div>
-                            </td>
-                            <td>
-                                <div>
-                                    <span style="margin-right: 0;"><input type="text" ng-blur="changeMinBuyQty(commodity)" placeholder="起订量"  ng-model="commodity.editMinBuyQty" class="wid68 form-control"/></span>
-                                </div>
-                            </td>
-                            <td>
-                                <div class="step" ng-repeat="price in commodity.editPrices">
-                                    <span class="first" ng-bind="price.start" title="{{price.start}}">100</span>
-                                    <span class="dot"><i class="fa fa-long-arrow-right"></i></span>
-                                    <span class="last" ng-bind="price.end" title="{{price.end}}">300</span>
-                                </div>
-                                <div class="dot01" ng-if="commodity.editPrices.length < 3">
-                                    <span><i class="fa fa-chevron-up"></i></span>
-                                </div>
-                                <div style="margin-top: 0;" ng-if="commodity.editPrices.length < 3">
-                                    <span style="margin-left: 10px;"><input type="text" placeholder="分段数量"  ng-model="$$onSale.qty" class="form-control" style="width: 104px;"/></span>
-                                </div>
-                            </td>
-                            <td>
-                                <div ng-repeat="price in commodity.editPrices" class="price">
+                            </div>
+                            <div class="fr wid135">
+                                <p>类目: <em ng-bind="commodity.kindNameCn" title="{{commodity.kindNameCn}}"></em></p>
+                                <p>型号: <em ng-bind="commodity.code" title="{{commodity.code}}">LPC1112</em></p>
+                                <p>品牌: <em ng-bind="commodity.brandNameEn" title="{{commodity.brandNameEn}}">NXP</em></p>
+                            </div>
+                        </td>
+                        <td>
+                            <div>
+                                <span><input type="text" ng-blur="editPackaging(commodity)" placeholder="包装方式" maxlength="10" ng-model="commodity.editPackaging" ng-class="{'error' : commodity.editPackagingInvalid}" class="wid88 form-control"/></span>
+                            </div>
+                            <div>
+                                <span><input type="text" ng-blur="editProduceDateFa(commodity)" placeholder="生产日期" maxlength="11" ng-model="commodity.editProduceDate" ng-class="{'error' : commodity.editProduceDateInvalid}" class="wid88 form-control"/></span>
+                            </div>
+                            <div>
+                                <span>可拆卖:</span>
+                                <span class="switch"><button ng-class="{'active' : commodity.editBreakUp}" ng-click="toggleIsBreadUp(commodity)"></button></span>
+                            </div>
+                        </td>
+                        <td>
+                            <div>
+                                <span>库存: </span>
+                                <span><input type="text" ng-blur="changeReserve(commodity)" ng-class="{'error' : commodity.editReserveInvalid}" placeholder="库存" ng-model="commodity.editReserve" class="wid48 form-control"/></span>
+                            </div>
+                            <div>
+                                <span>起拍: </span>
+                                <span><input type="text" ng-blur="changeMinBuyQty(commodity)" ng-class="{'error' : commodity.editMinBuyQtyInValid}" placeholder="起拍" ng-model="commodity.editMinBuyQty" class="wid48 form-control"/></span>
+                            </div>
+                            <div>
+                                <span>最小包装数: </span>
+                                <span><input type="text" ng-blur="changeMinPackQty(commodity)" ng-class="{'error' : commodity.editMinPackQtyInValid}" placeholder="倍数" ng-model="commodity.editMinPackQty" class="wid48 form-control"/></span>
+                            </div>
+                            <!--<div>-->
+                            <!--<span>-->
+                            <!--<select class="wid85 select-adder form-control" style="width: 81px;">-->
+                            <!--<option value="1">可拆卖</option>-->
+                            <!--<option value="2">不可拆卖</option>-->
+                            <!--</select>-->
+                            <!--</span>-->
+                            <!--</div>-->
+                        </td>
+                        <td>
+                            <div ng-repeat="price in commodity.editPrices">
+                                <span style="margin-right: 0;"><input type="text" ng-disabled="$index == 0" ng-blur="editQty(commodity, $index, false, price.start)" ng-class="{'error' : price.startInValid}" placeholder="数量"  ng-model="price.start" class="wid40 form-control"/></span>
+                                <span>-</span>
+                                <span><input type="text" ng-disabled="$index == commodity.editPrices.length - 1" ng-blur="editQty(commodity, $index, true, price.end)" ng-class="{'error' : price.endInValid}" placeholder="数量" ng-model="price.end" class="wid40 form-control"/></span>
+                            </div>
+                        </td>
+                        <td ng-if="onsale.currency == 'USD'">
+                            <div style="width: 99px;" ng-repeat="price in commodity.editPrices">
+                                    <span ng-if="commodity.currencyName.indexOf('USD') > -1">
+                                        <form name="usdForm">
+                                            <input type="text" name="usd" ng-blur="priceBlur(price, true)" ng-keyup="priceValid(price, true)" ng-class="{'error' : price.usdPriceInvalid}" placeholder="香港交货($)" autocomplete="off" ng-model="price.uSDPrice" ng-model-options="{debounce : 100}" class="wid85 form-control"/>
+                                        </form>
+                                    </span>
+                            </div>
+                        </td>
+                        <td ng-if="onsale.currency == 'RMB'">
+                            <div style="width: 99px;" ng-repeat="price in commodity.editPrices">
+                                    <span ng-if="commodity.currencyName.indexOf('RMB') > -1">
+                                        <form name="rmbForm">
+                                            <input type="text" name="rmb" ng-blur="priceBlur(price, false)" ng-keyup="priceValid(price, false)" ng-class="{'error' : price.rmbPriceInvalid}" placeholder="大陆交货(¥)" autocomplete="off" ng-model="price.rMBPrice" ng-model-options="{debounce : 100}" class="wid85 form-control"/>
+                                        </form>
+                                    </span>
+                                <a class="reduce" ng-disabled="commodity.editPrices.length < 2" ng-click="deleteFragment(commodity, $index)"><i class="fa fa-minus-circle"></i></a>
+                                <a class="add" ng-disabled="commodity.editPrices.length >= 3" ng-click="addFragment(commodity)"><i class="fa fa-plus-circle"></i></a>
+                            </div>
+                        </td>
+                        <td>
+                            <div ng-if="onsale.currency == 'RMB'">
+                                <span>大陆:</span>
+                                <span><input type="text" ng-class="{'error' : commodity.editMinDeliveryinValid}" ng-blur="changeDelivery(commodity.editMinDelivery, commodity.editMaxDelivery, true, false, commodity)" placeholder="大陆最短交期" ng-model="commodity.editMinDelivery" class="wid25 form-control"/></span>
+                                <span>-</span>
+                                <span><input type="text" ng-class="{'error' : commodity.editMaxDeliveryinValid}" ng-blur="changeDelivery(commodity.editMinDelivery, commodity.editMaxDelivery, false, false, commodity)" placeholder="大陆最长交期" ng-model="commodity.editMaxDelivery" class="wid25 form-control"/></span>
+                            </div>
+                            <div ng-if="onsale.currency == 'USD'">
+                                <span>香港:</span>
+                                <span><input type="text" placeholder="香港最短交期" ng-class="{'error' : commodity.editMinDeliveryinValid}" ng-blur="changeDelivery(commodity.editMinDelivery, commodity.editMaxDelivery, true, true, commodity)" ng-model="commodity.editMinDelivery" class="wid25 form-control"/></span>
+                                <span>-</span>
+                                <span><input type="text" placeholder="香港最长交期" ng-class="{'error' : commodity.editMaxDeliveryinValid}" ng-blur="changeDelivery(commodity.editMinDelivery, commodity.editMaxDelivery, false, true, commodity)" ng-model="commodity.editMaxDelivery" class="wid25 form-control"/></span>
+                            </div>
+
+                        </td>
+                        <td>
+                            <div>
                                     <span>
-                                        <input ng-if="$$onSale.currency == 'RMB'" type="text" placeholder="单价(含税)¥)" ng-blur="validPrice(price, price.rMBPrice, true)" ng-model="price.rMBPrice" class="width82 form-control"/>
-                                        <input ng-if="$$onSale.currency == 'USD'" type="text" placeholder="单价($)" ng-blur="validPrice(price, price.uSDPrice, false)" ng-model="price.uSDPrice" class="width82 form-control"/>
+                                        <select ng-change="changeSaleMode(commodity)" class="wid68 select-adder form-control" ng-model="commodity.editSelfSale">
+                                            <option value="1">自营</option>
+                                            <option value="2">寄售</option>
+                                        </select>
                                     </span>
-                                    <a class="delete" title="删除" ng-click="deleteFragment(commodity, $index)" ng-if="commodity.editPrices.length != 1"><i class="fa fa-trash"></i></a>
-                                </div>
-                                <div ng-if="commodity.editPrices.length < 3">
-                                    <span><button class="add" ng-class="{'disabled':!$$onSale.qty || commodity.editPrices.length == 3}" ng-disabled="!$$onSale.qty || commodity.editPrices.length == 3" ng-click="addFragment(commodity)"><i class="fa fa-plus"></i>插入分段</button></span>
-                                </div>
-                            </td>
-                            <td>
-                                <div style="margin-left: 25px;">
-                                    <span><input type="text" ng-blur="blurDelivery(commodity.editMinDelivery, commodity.editMaxDelivery, true, commodity)" placeholder="最小交期" ng-model="commodity.editMinDelivery" class="wid25 form-control"/></span>
-                                    <span>-</span>
-                                    <span><input type="text" ng-blur="blurDelivery(commodity.editMinDelivery, commodity.editMaxDelivery, false, commodity)" placeholder="最大交期" ng-model="commodity.editMaxDelivery" class="wid25 form-control"/></span>
-                                </div>
-                            </td>
-                            <td>
-                                <div>
-                                    <span ng-bind="commodity.reserve" class="span100" title="{{commodity.reserve}}">1313</span>
+                            </div>
+                        </td>
+                        <td class="padding0">
+                            <div>
+                                <span><button class="off" ng-click="commodity.edit = false;">取消</button></span>
+                            </div>
+                            <div>
+                                <span><button class="ok" ng-click="updateGoods(commodity, $index)">保存</button></span>
+                            </div>
+                        </td>
+                    </tr>
+                    </tbody>
+                    <tbody ng-if="!currenctGoods || currenctGoods.length <= 0">
+                    <tr style="height: 252px;">
+                        <td colspan="10" style="padding: 74px 0;">
+                            <div style="line-height: 106px;">
+                                <div class="col-xs-2" style="margin-left: 35%;">
+                                    <img src="static/img/all/empty-cart.png">
                                 </div>
-                            </td>
-                            <td class="padding0">
-                                <div ng-if="!commodity.sourceId" class="icon-1">
-                                    <a ng-click="updateGoods(commodity, $index)" class="ok" title="保存" ><i class="fa fa-check"></i></a>
-                                    <a ng-click="commodity.edit = false;" class="off" title="取消" ><i class="fa fa-remove"></i></a>
+                                <div class="col-xs-4" style="line-height: 124px;">
+                                    <p class="grey f16">暂无在售产品信息</p>
                                 </div>
-                            </td>
-                        </tr>
-                    </tbody>
-                    <!--<tbody ng-if="!currenctGoods || currenctGoods.length <= 0">
-                         <tr style="height: 252px;">
-                             <td colspan="10" style="padding: 74px 0;">
-                                 <div style="line-height: 106px;">
-                                     <div class="col-xs-2" style="margin-left: 35%;">
-                                         <img src="static/img/all/empty-cart.png">
-                                     </div>
-                                     <div class="col-xs-4" style="line-height: 124px;">
-                                         <p class="grey f16">暂无在售产品信息</p>
-                                     </div>
-                                 </div>
-                             </td>
-                        </tr>
-                    </tbody>-->
-                    <tbody class="no-record-list" ng-if="!currenctGoods || currenctGoods.length <= 0">
-                        <tr class="height200">
-                            <td colspan="10"><img src="static/img/all/empty-cart.png"><span>暂无在售产品信息!</span></td>
-                        </tr>
+                            </div>
+                        </td>
+                    </tr>
                     </tbody>
                 </table>
                 <div class="record-line text-right" ng-if="currenctGoods.length != 0">显示1-<span ng-bind="goodsAll.size"></span>个,共:<span ng-bind="goodsAll.totalElements" cl style="color: #5078cb;"></span>个</div>
@@ -936,18 +818,17 @@
                         <a class="page-a" ng-click="setPage('page', param.currentPage)" href="">GO</a>
                     </div>
                 </div>
+            </div>
         </div>
     </div>
 </div>
-</div>
 <!--下架操作-->
 <div class="com-out-box" ng-if="isSoldOut">
     <div class="title">
         <a ng-click="cancleSoldOut()"><i class="fa fa-close fa-lg"></i></a>
     </div>
     <div class="content">
-        <p><i class="fa fa-exclamation-circle"></i>是否要下架此产品?</p>
-        <b ng-if="soldOutCommodity.isRecommond">*此产品已被推荐到店铺首页</b>
+        <p><i class="fa fa-exclamation-circle"></i>确认下架?</p>
         <div><a ng-click="cancleSoldOut()">取消</a><a ng-click="updateCommodityInfo(soldOutCommodity, true)">确认</a></div>
     </div>
 </div>
@@ -957,8 +838,8 @@
     <div class="x-floating-wrap"></div>
     <div class="x-floating">
         <div id="item-content">
-            <div class="x-close-wrap"><a href="javascript:void(0);">&times;</a></div>
+            <div class="x-close-wrap"><a href="javascript:void(0);">×</a></div>
             <div class="img"><img/></div>
         </div>
     </div>
-</div>
+</div>

+ 4 - 3
src/main/webapp/resources/view/vendor/forstore/vendor_undercarriage.html

@@ -539,8 +539,8 @@
     <div class="pro_management device">
         <div class="com_tab">
             <ul class="fl" style="width: 100%">
-                <li ng-class="{'active': tab == 'vendor_standardPutOn'}"><a ui-sref="vendor_standardPutOn">标库上架管理</a></li>
-                <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品维护</a></li>
+                <li ng-class="{'active': tab == 'vendor_material'}"><a ui-sref="vendor_material">产品库</a></li>
+                <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale">在售产品</a></li>
                 <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage">上下架历史</a></li>
             </ul>
         </div>
@@ -643,7 +643,7 @@
                                 <span class="text-more" ng-bind="commodity.unit || 'PCS'">PCS</span>
                             </div>
                             <div class="text-more-80">
-                                <span>封装:<em ng-bind="commodity.encapsulation" class="text-more fr" style="width: 60px;" title="{{commodity.encapsulation}}"></em></span>
+                                <span>封装:<em ng-bind="commodity.encapsulation || '-'" class="text-more fr" style="width: 60px;" title="{{commodity.encapsulation}}"></em></span>
                             </div>
                         </td>
                         <td>
@@ -669,6 +669,7 @@
                                 <em ng-if="commodity.b2cMinDelivery != commodity.b2cMaxDelivery" ng-bind="commodity.b2cMinDelivery + '-' + commodity.b2cMaxDelivery"></em>
                                 <!--<em ng-bind="commodity.b2cMinDelivery+ '-' + commodity.b2cMaxDelivery"></em>-->
                             </div>
+                            <div ng-bind="commodity.breakUp ? '可拆卖' : '不可拆卖'"></div>
                         </td>
                         <td>
                             <div ng-repeat="price in commodity.prices">

+ 141 - 108
src/main/webapp/resources/view/vendor/forstore/vendor_upload.html

@@ -138,59 +138,6 @@
     .add_category .sale-label input[type="radio"] {
         display: none;
     }
-
-    #image-box .x-close-wrap {
-        position: fixed;
-        top: 0;
-        right: 0;
-        z-index: 100000;
-        width: 120px;
-        height: 120px;
-        margin: -60px -60px 0 0;
-        border-radius: 100%;
-        background: #000;
-        opacity: .3;
-    }
-
-    #image-box .x-floating-wrap {
-        position: fixed;
-        z-index: 99998;
-        background: #000;
-        top: 0;
-        left: 0;
-        width: 100%;
-        height: 100%;
-        opacity: 0.5;
-    }
-
-    #image-box .x-floating {
-        position: fixed;
-        z-index: 99999;
-        top: 60px;
-        left: 0;
-        width: 100%;
-        height: 100%;
-        text-align: center;
-        vertical-align: middle;
-    }
-
-    #image-box .x-floating img {
-        margin: auto auto;
-        max-width: 100%;
-        max-height: 80%;
-        -webkit-user-select: none;
-        -moz-user-select: none;
-        -ms-user-select: none;
-        user-select: none;
-    }
-
-    #image-box .x-close-wrap a {
-        position: absolute;
-        left: 25px;
-        bottom: 25px;
-        font-size: 42px;
-        color: #fff;
-    }
     .user_right a.blue-bg{
         color: #fff !important;
     }
@@ -204,19 +151,27 @@
         background: #dff3fd;
     }
     .public-tab.table>tbody>tr>td{
-        border-bottom: #cfcfcf 1px dashed;
+        /*border-bottom: #cfcfcf 1px dashed;*/
         white-space: normal;
         background: #f0fafe;
     }
+    .public-tab.table>tbody>tr td{
+        border-top: #cfcfcf 1px dashed;
+        border-bottom: none;
+    }
+    .public-tab.table>tbody>tr:first-child td{
+        border-top: none;
+    }
     .public-tab.table>thead>tr>th:first-child,.public-tab.table>thead>tr>th:last-child,.public-tab.table>tbody>tr>td:first-child,.public-tab.table>tbody>tr>td:last-child{
         text-align: center;
     }
     .public-tab.table>tbody>tr>td div{
         min-height: inherit;
         line-height: 25px;
+        margin-bottom: 1px;
     }
     .public-tab.table{
-        margin-top: 10px;
+        margin-top: 15px;
     }
     .load_next .add_category .upload i{
         top: 6px;
@@ -225,7 +180,7 @@
         color: #333 !important;
     }
     .upload-content{
-        width: 535px !important;
+        width: 570px !important;
         float: left;
     }
     .user_right .upload .check{
@@ -278,6 +233,66 @@
     .load_next .add_category .upload01{
         top: 6px;
     }
+
+    label.sellType:hover {
+        cursor: pointer;
+    }
+    .open-icon{
+        display: inline-block;
+        width: 22px;
+        height: 12px;
+        background: url("static/img/icon/open.png") no-repeat center;
+        margin-top: 37px;
+        transform: rotate(-180deg);
+        float: right;
+        vertical-align: middle;
+        cursor: pointer;
+    }
+    .open-icon.active{
+        transform: rotate(0);
+    }
+    .device .load_next.border-none,.device .load_next p.border-none{
+        border-bottom: none;
+    }
+    .public-tab.table tr td div span.switch{
+        width:39px;
+        height: 14px;
+        display: inline-block;
+    }
+    .public-tab.table tr td div span.switch button{
+        border: none;
+        position: relative;
+        top: 2px;
+        left: 5px;
+        width: 39px;
+        height: 14px;
+        background: url(static/img/icon/check-off.png) no-repeat center;
+    }
+    .public-tab.table tr td div span.switch button.active{
+        background: url("static/img/icon/check-ok.png") no-repeat center;
+    }
+    .public-tab.table tr td div.text-more em{
+        margin: 0 !important;
+    }
+    .public-tab.table>tbody>tr.record-number{
+        height: 30px;
+    }
+    .public-tab.table>tbody>tr.record-number td{
+        border: none;
+        background: none;
+        padding: 0;
+        border-bottom: #cfcfcf 1px dashed;
+        border-top: #cfcfcf 1px solid;
+    }
+    .public-tab.table>tbody>tr.record-number td div{
+        text-align: right;
+        padding-right: 25px;
+        font-size: 12px;
+    }
+    .public-tab.table>tbody>tr>td{
+        padding-top: 15px;
+        padding-bottom: 15px;
+    }
 </style>
 <div class="user_right fr">
     <!--货品管理-->
@@ -289,36 +304,31 @@
         </div>
         <div class="wanted_list01">
             <div class="tab" ng-if="$$productOn.leadIn == 'bathOn'" ng-class="{'active': leadIn == 'bathOn'}" ng-controller="batchPutOnCtrl">
-                <div class="load_next">
-                    <p>第一步,下载Excle模板<i class="icon-angle-up"></i></p>
-                    <div class="add_category">
-                        <div>下载库存Excle模板,在模板上编辑商品信息,<a ng-click="showImg()" style="color: #e64040">查看表格示例</a></div>
-                        <div id="image-box" style="display: none;">
-                            <div class="x-close-wrap" title="关闭">
-                                <a href="javascript:void(0);">×</a>
-                            </div>
-                            <div class="x-floating-wrap"></div>
-                            <div class="x-floating">
-                                <img src="http://static.ubtoc.com/img/product/excel_releaseByBatch_eg.png">
-                            </div>
-                        </div>
+                <div class="load_next" ng-class="{'border-none':open01}">
+                    <p>第一步,下载Excel模板
+                        <em class="open-icon" ng-click="open01=!open01" ng-class="{'active': !open01}"></em>
+                    </p>
+                    <div class="add_category" ng-if="!open01">
+                        <div>下载库存Excel模板,在模板上编辑商品信息,<a ng-click="showImg()" style="color: #e64040">查看表格示例</a></div>
                         <div class="load_tab"><a href="javascript:void(0)" ng-click="download()" class="blue-bg">下载库存模板</a></div>
                     </div>
                 </div>
-                <div class="load_next">
-                    <p>第二步,上传库存表格、及发布<i class="icon-angle-up"></i></p>
-                    <div class="add_category">
+                <div class="load_next" ng-class="{'border-none':open02}">
+                    <p>第二步,上传库存表格、及发布
+                        <em class="open-icon" ng-click="open02=!open02" ng-class="{'active': !open02}"></em>
+                    </p>
+                    <div class="add_category" ng-if="!open02">
                         <div>1、请选择是店铺自营还是优软代售</div>
                         <div class="sale-label">
-                            <label>
-                                 <input type="radio" name="487" id="sellbyUAS" ng-checked="batch.sellType == 'UAS'">
-                                <label for="sellbyUAS" ng-click="sellType('UAS')"></label>
+                            <label class="sellType">
+                                <input ng-click="sellType('UAS')" type="radio" name="487" id="sellbyUAS" ng-model="batch.sellType" ng-checked="batch.sellType == 'UAS'">
+                                <label for="sellbyUAS"></label>
                                 <span>优软代售</span>
                             </label>
-                            <label ng-disabled="!batch.selfSellEabled">
-                                <input type="radio" name="487" id="sellbyself" ng-checked="batch.sellType == 'self'" ng-disabled="!batch.selfSellEabled">
-                                <label for="sellbyself" ng-click="sellType('self')" ng-disabled="!batch.selfSellEabled"></label>
-                                <span ng-disabled="!batch.selfSellEabled">店铺自营</span>
+                            <label class="sellType" ng-disabled="!batch.selfSellEabled">
+                                <input ng-click="sellType('self')" type="radio" name="487" id="sellbyself" ng-model="batch.sellType" ng-checked="batch.sellType == 'self'">
+                                <label for="sellbyself"></label>
+                                <span>店铺自营</span>
                             </label>
                         </div>
                         <div>2、请上传已经编辑好的库存表格,选择好上传的文件之后,点击确认上传</div>
@@ -327,7 +337,7 @@
                                 <input type="text" name="txt" id="upload_text" />
                                 <i>选择文件</i>
                                 <input type="file" id="uploadCommodity" ng-file-select="" ng-change="selectFile()" accept="*.xls,*.xlsx" ng-model="batch.myFiles" ng-multiple="false" class="upload01" />
-                                <a href="javascript:void(0)" ng-click="upload()" ng-disabled="!batch.myFiles[0]" class="blue-bg">确认上传</a>
+                                <a href="javascript:void(0)" ng-click="upload()" ng-disabled="!batch.myFiles[0]" class="blue-bg" style="margin-left: 18px;">确认上传</a>
                             </div>
                             <!--批量删除操作-->
                            <!-- <div class="check fr">
@@ -351,12 +361,13 @@
                                     <th width="150" style="padding-left: 10px;">器件属性</th>
                                     <th width="150">产品固有属性</th>
                                     <th width="200">产品自定义属性</th>
-                                    <th width="100">价格梯度</th>
-                                    <th width="100">操作</th>
+                                    <th width="100">数量</th>
+                                    <th width="100">单价(<em ng-bind="batch.currency == 'RMB' ? '¥' : '$'"></em>)</th>
+                                    <th width="70">操作</th>
                                 </tr>
                             </thead>
                             <tbody>
-                                <tr ng-repeat="batchCommodity in pageParams.content" class="batch-commodity">
+                                <tr ng-repeat="batchCommodity in pageParams.content">
                                     <td class="check-input">
                                         <!--<span><input type="checkbox" id="{{$index+1}}"/><label for="{{$index+1}}"></label><br/></span>-->
                                         <span ng-bind="$index+1"></span>
@@ -367,61 +378,74 @@
                                         <div class="text-more">型号:&nbsp;<em title="{{batchCommodity.code || '空'}}" ng-bind="batchCommodity.code || '空'"></em></div>
                                     </td>
                                     <td>
-                                        <div>类型:&nbsp;<span ng-bind="batchCommodity.original == 1311 ? '现货' : '呆滞库存' "></span></div>
+                                        <!--<div>类型:&nbsp;<span ng-bind="batchCommodity.original == 1311 ? '现货' : '呆滞库存' "></span></div>-->
                                         <div>生产日期:&nbsp;<span ng-bind="batchCommodity.productDate"></span></div>
-                                        <div>封装:&nbsp;<span ng-bind="batchCommodity.encapsulation || '无封装信息'"></span></div>
+                                        <!--<div>封装:&nbsp;<span ng-bind="batchCommodity.encapsulation || '无封装信息'"></span></div>-->
                                         <div>包装:&nbsp;<span ng-bind="batchCommodity.packaging || '无包装信息'"></span></div>
                                         <div>
                                             <span class="label-commodity">交期:</span>
                                             <span>
-                                                    <span ng-if="batchCommodity.mindeliveryDemTime" ng-bind="'大陆:' + batchCommodity.mindeliveryDemTime + '-' + batchCommodity.maxdeliveryDemTime"></span><br/>
-                                                    <span ng-if="batchCommodity.mindeliveryHKTime" ng-bind="'香港:' + batchCommodity.mindeliveryHKTime + '-' + batchCommodity.maxdeliveryHKTime"></span>
-                                                </span>
+                                                 <span ng-if="batchCommodity.selfMinDelivery == batchCommodity.selfMaxDelivery" ng-bind="batchCommodity.selfMaxDelivery"></span>
+                                                 <span ng-if="batchCommodity.selfMinDelivery != batchCommodity.selfMaxDelivery" ng-bind="batchCommodity.selfMinDelivery + '-' + batchCommodity.selfMaxDelivery"></span>
+                                            </span>
                                         </div>
                                     </td>
                                     <td>
                                         <div>库存:&nbsp;<span ng-bind="batchCommodity.reserve | number"></span></div>
                                         <div>起拍:&nbsp;<span ng-bind="batchCommodity.minBuyQty | number"></span></div>
-                                        <div>倍数/价格:&nbsp;
-                                            <span ng-bind="batchCommodity.minBuyQty | number"></span>
-                                            <span ng-if="batchCommodity.usdMinPackPrice">
-                                                    /<span ng-bind="batchCommodity.usdMinPackPrice | formateNumber : 6 | currencySysmbol : 'USD'"></span>
-                                                </span>
-                                            <span ng-if="batchCommodity.rmbMinPackPrice">
-                                                    /<span ng-bind="batchCommodity.rmbMinPackPrice | formateNumber : 6 | currencySysmbol : 'RMB'"></span>
-                                                </span>
+                                        <!--<div>倍数/价格:&nbsp;-->
+                                            <!--<span ng-bind="batchCommodity.minBuyQty | number"></span>-->
+                                            <!--<span ng-if="batchCommodity.usdMinPackPrice">-->
+                                                    <!--/<span ng-bind="batchCommodity.usdMinPackPrice | formateNumber : 6 | currencySysmbol : 'USD'"></span>-->
+                                                <!--</span>-->
+                                            <!--<span ng-if="batchCommodity.rmbMinPackPrice">-->
+                                                    <!--/<span ng-bind="batchCommodity.rmbMinPackPrice | formateNumber : 6 | currencySysmbol : 'RMB'"></span>-->
+                                                <!--</span>-->
+                                        <!--</div>-->
+                                        <!--<div>样品:&nbsp;<span ng-bind="batchCommodity.sampleqty | number"></span></div>-->
+                                        <div>
+                                            <span ng-bind="batchCommodity.breakUp ? '可拆卖' : '不可拆卖'"></span>
+                                            <!--<span class="switch"><button ng-class="{'active' : commodity.editBreakUp}" ng-click="toggleIsBreadUp(commodity)"></button></span>-->
                                         </div>
-                                        <div>样品:&nbsp;<span ng-bind="batchCommodity.sampleqty | number"></span></div>
                                     </td>
-                                    <td>
-                                        <div class="fragment-price" ng-repeat="price in batchCommodity.prices">
-                                            <span ng-bind="price.start+'+'"></span>
-                                            <span ng-if="price.rMBPrice" ng-bind="price.rMBPrice | formateNumber : 6 | currencySysmbol : 'RMB'"></span>
-                                            <span ng-if="price.uSDPrice" ng-bind="price.uSDPrice | formateNumber : 6 | currencySysmbol : 'USD'"></span>
-                                        </div>
+                                    <td style="vertical-align: top !important;">
+                                        <div ng-repeat="price in batchCommodity.prices">{{price.start + '+'}}</div>
+                                    </td>
+                                    <td style="vertical-align: top !important;">
+                                        <div ng-repeat="price in batchCommodity.prices">{{batchCommodity.currency=='RMB' ? price.rMBPrice : price.uSDPrice}}</div>
                                     </td>
                                     <td>
                                         <!--<a ng-click="editBatch(batchCommodity)">编辑</a><br/>-->
                                         <a ng-click="deleteBatch(batchCommodity.id)" title="删除">删除</a>
                                     </td>
                                 </tr>
-                                <tr class="text-center batch-commodity" ng-if="!pageParams || !pageParams.content || pageParams.content.length == 0">
-                                    <td colspan="6" style="text-align: center; line-height: 80px;"><i class="fa fa-smile-o fa-lg"></i> 请上传需要发布的库存</td>
+                                <tr class="record-number" ng-if="pageParams.content.length > 0">
+                                    <td colspan="7">
+                                        <div>显示 <i ng-bind="pageParams.start"></i>- <i ng-bind="pageParams.end">10</i> 个,共:<i style="color: #5078cb;" ng-bind="pageParams.totalElements"></i> 个</div>
+                                    </td>
+                                </tr>
+                            </tbody>
+                            <tbody class="no-record-list" ng-if="!pageParams || !pageParams.content || pageParams.content.length == 0">
+                                <tr class="height200">
+                                    <td colspan="7" style="background: #fff;"><img src="static/img/all/empty-cart.png"><span>请上传需要发布的库存!</span></td>
                                 </tr>
                             </tbody>
                         </table>
                         <div>3、如核对信息无误之后,点击确认发布</div>
-                        <a class="blue-bg publish" href="javascript:void(0)" ng-click="publish()" ng-disabled="!result.success" >确认上架</a>
+                        <a class="blue-bg publish" href="javascript:void(0)" ng-click="publish($event)" ng-disabled="!pageParams.totalElements">确认上架</a>
                     </div>
                 </div>
                 <div class="load_next">
-                    <p>第三步,批量化匹配不成功产品信息下载<i class="icon-angle-up"></i></p>
-                    <div class="add_category">
+                    <p ng-class="{'border-none':open03}">第三步,批量化匹配不成功产品信息下载
+                        <em class="open-icon" ng-click="open03=!open03" ng-class="{'active': !open03}"></em>
+                    </p>
+                    <div class="add_category" ng-if="!open03">
                         <div>文件包含验证不通过的内容信息,请修改其错误信息再重新上传</div>
                         <div class="load_tab">
                             <a href="javascript:void(0)" style="width: 206px;" ng-disabled="!result.failure" ng-click="downloadExcel()" class="blue-bg">下载匹配不成功产品信息</a>
                             <form id="load-error" style="display: none;" method="get">
                                 <input type="hidden" name="batch" ng-value="result.batch">
+                                <input type="hidden" name="currency" ng-value="batch.currency">
                             </form>
                         </div>
                     </div>
@@ -430,3 +454,12 @@
         </div>
     </div>
 </div>
+<div id="image-box" style="display: none">
+    <div class="x-floating-wrap"></div>
+    <div class="x-floating">
+        <div id="item-content">
+            <div class="x-close-wrap"><a href="javascript:void(0);">×</a></div>
+            <div class="img"><img src="http://static.ubtoc.com/img/product/excel_releaseByBatch_eg.png"></div>
+        </div>
+    </div>
+</div>

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

@@ -27,9 +27,9 @@
 		<li ng-class="{'active' : active == 'pay_center'}"><a href="javascript:void(0)" ui-sref="pay_center">结算中心</a></li>
 		<li ng-class="{'active' : active == 'vendor_brand_apply'}"><a href="javascript:void(0)" ui-sref="vendor_brand_apply">品牌申请</a></li>
 		<li ng-class="{'active' : active == 'vendor_component_apply'}"><a href="javascript:void(0)" ui-sref="vendor_component_apply">器件申请</a></li>
-		<li ng-class="{'active' : active == 'vendor_productOn'}"><a href="javascript:void(0)" ui-sref="vendor_productOn">产品导入</a></li>
-		<li ng-class="{'active' : active == 'vendor_repository'}"><a href="javascript:void(0)" ui-sref="vendor_repository">仓库管理</a></li>
-		<li ng-class="{'active' : active == 'vendor_goods'}"><a href="javascript:void(0)" ui-sref="vendor_standardPutOn">产品管理</a></li>
+		<li ng-class="{'active' : active == 'vendor_upload'}"><a href="javascript:void(0)" ui-sref="vendor_upload">产品导入</a></li>
+		<!--<li ng-class="{'active' : active == 'vendor_repository'}"><a href="javascript:void(0)" ui-sref="vendor_repository">仓库管理</a></li>-->
+		<li ng-class="{'active' : active == 'vendor_material'}"><a href="javascript:void(0)" ui-sref="vendor_material">产品管理</a></li>
 		<!--<li ng-class="{'active' : active == 'vendor_after_sale'}" class="undo">-->
 		<!--&lt;!&ndash;<a href="javascript:void(0)" ui-sref="vendor_after_sale">售后处理</a>&ndash;&gt;-->
 		<!--售后处理-->

+ 84 - 36
src/main/webapp/resources/view/vendor/modal/edit_goods_modal.html

@@ -1,17 +1,17 @@
 <!--修改图片-->
 <style>
-    .view-box {
-
+    .modal-dialog{
+        width: 535px;
+        height: 345px;
     }
     .update-img{
         width: 520px;
-        height: 330px;
+        height: 324px;
     }
     .update-img .update-big-img{
-        width: 280px;
+        width: 265px;
         float: left;
-        margin-left: 48px;
-        margin-top: 10px;
+        margin-top: 5px;
     }
     .update-img .update-big-img p{
         line-height: 30px;
@@ -30,20 +30,19 @@
         height: 256px;
     }
     .update-img .update-file-btn{
-        width: 155px;
+        width: 244px;
         float: left;
-        margin-left: 10px;
-        margin-top: 200px;
+        margin-left: 3px;
     }
     .update-img .update-file-btn p{
         line-height: 30px;
         position: relative;
         text-align: center;
-        margin-bottom: 10px;
+        margin-top: 8px;
         height: 30px;
     }
     .update-img .update-file-btn p input{
-        width: 100%;
+        width: 80px;
         height: 30px;
         z-index: 10;
         position: absolute;
@@ -55,7 +54,7 @@
         position: absolute;
         left: 0;
         top: 0;
-        width: 100%;
+        width: 80px;
         display: inline-block;
         height: 30px;
         text-align: center;
@@ -80,6 +79,7 @@
         background: #5078cb;
         color: #fff;
         float: right;
+        margin-right: 44px;
     }
     .update-img .update-file-btn p a:hover,.update-img .update-file-btn p span:hover{
         background: #3f7ae3;
@@ -95,35 +95,83 @@
         top: 0;
         opacity: 0;
     }
-.update-file-btn .previewImage{
-    width: 100%;
-    height: 30px;
-}
-.update-file-btn .previewImage:hover{
-    cursor: pointer;
-}
+    .update-file-btn .previewImage{
+        width: 100%;
+        height: 30px;
+    }
+    .update-file-btn .previewImage:hover{
+        cursor: pointer;
+    }
+    .close{
+        position: absolute;
+        top: 0;
+        right: 5px;
+    }
+    .modal-body{
+        padding: 10px;
+    }
+    .file-text{
+        width: 100%;
+        margin: 0 auto;
+        margin-top: 35px;
+    }
+    .file-text h3{
+        line-height: 26px;
+        background: #e3e3e6;
+        font-size: 12px;
+        text-align: center;
+        font-weight: bold;
+    }
+    .file-text div{
+        width: 100%;
+        height: 215px;
+        background: #f6f6f7;
+        line-height: 20px;
+        font-size: 12px;
+        padding: 5px 10px;
+    }
+    .prompt{
+        font-size: 12px;
+        width: 270px;
+        display: inline-block;
+        margin-top: 5px;
+    }
 </style>
 <div class="modal-head"></div>
 <div class="modal-body">
-        <div class="view-box">
-            <div class="update-img">
-                <div class="update-big-img">
-                    <p>大图预览</p>
-                    <div class="previewImage">
-                        <img src="{{pic}}" alt="商品图片">
-                    </div>
-                    <span class="prompt"><em>*</em>  建议使用不小于 256X256px图片,大小不超过3M</span>
+    <div class="view-box">
+        <div class="update-img">
+            <a ng-click="cancel()" class="close">&times;</a>
+            <div class="update-big-img">
+                <p>大图预览</p>
+                <div class="previewImage">
+                    <img src="{{pic}}" alt="商品图片">
                 </div>
-                <div class="update-file-btn">
-                    <p>
-                        <input type="file" image-upload class="uploadImage" accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png,.pdf" on-success="onUploadSuccess($data, $file)" non-preview="true">
-                        <span>重新上传</span>
-                    </p>
-                    <p>
-                        <a ng-click="cancel()" class="off">取消</a>
-                        <a ng-click="confirm()" class="ok">确定</a>
-                    </p>
+                <span class="prompt"><em style="color: #f00;">*</em>  建议使用不小于256*256px图片,大小不超过3M</span>
+            </div>
+            <div class="update-file-btn">
+                <div class="file-text">
+                    <h3>图片上传须知</h3>
+                    <div>上传的商品图片若存在以下任一情形,
+                        平台将会对产品进行下架,若情节影响
+                        严重,平台将保留追究权:<br/>
+                        1、图片与产品不相符合;<br/>
+                        2、图片存在低俗信息;<br/>
+                        3、图片拼接、不清晰或拉伸变形等;<br/>
+                        4、带有文字、色块、图形或logo等影响<br/>
+                        &nbsp;&nbsp;&nbsp;主图美观和正常查看的内容(平台会<br/>
+                        &nbsp;&nbsp;&nbsp;自动生成店铺logo,无需再使用有logo<br/>
+                        &nbsp;&nbsp;&nbsp;的图片).
+                    </div>
                 </div>
+                <p>
+                        <span style="left:40px;">
+                            <input type="file" image-upload class="uploadImage" accept="image/jpeg,image/jpg,image/gif,image/bmp,image/png,.pdf" on-success="onUploadSuccess($data, $file)" non-preview="true">
+                            <span>选择文件</span>
+                        </span>
+                    <a ng-click="confirm()" class="ok">确定</a>
+                </p>
             </div>
         </div>
+    </div>
 </div>

+ 0 - 13
src/test/java/com/uas/platform/b2c/SpringBaseTest.java

@@ -1,13 +0,0 @@
-package com.uas.platform.b2c;
-
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ActiveProfiles;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = "classpath*:spring/*.xml")
-@ActiveProfiles("dev")
-public class SpringBaseTest {
-
-}

+ 0 - 22
src/test/java/com/uas/platform/b2c/TestMailService.java

@@ -1,22 +0,0 @@
-package com.uas.platform.b2c;
-
-import java.io.IOException;
-
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-import com.uas.message.mail.service.MailService;
-
-public class TestMailService {
-
-	// @Test
-	public void testSend() throws IOException {
-		String config = TestMailService.class.getPackage().getName().replace('.', '/') + "/dubbo-consumer.xml";
-		@SuppressWarnings("resource")
-		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config);
-		context.start();
-		MailService service = (MailService) context.getBean("mailService");
-		service.findLogs(1, 20);
-		System.in.read();
-	}
-
-}

+ 0 - 47
src/test/java/com/uas/platform/b2c/api/cms/service/CarouselsServiceImplTest.java

@@ -1,47 +0,0 @@
-package com.uas.platform.b2c.api.cms.service;
-
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.util.JSONPObject;
-import net.sf.json.JSONArray;
-import net.sf.json.JSONObject;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.web.client.RestTemplate;
-
-import java.io.IOException;
-import java.util.List;
-
-/**
- * Created by chaokunyang on 2017/4/17.
- */
-public class CarouselsServiceImplTest {
-
-    private RestTemplate restTemplate;
-    private ObjectMapper mapper;
-
-    @Before
-    public void before() {
-        restTemplate = new RestTemplate();
-        mapper = new ObjectMapper();
-    }
-
-    @Test
-    public void testGetCarousels() throws IOException {
-        String result = restTemplate.getForEntity("http://10.10.100.23:20030/carousels?usedFor=home", String.class).getBody();
-        System.out.println(result);
-
-        JSONArray foo = mapper.readValue(result, JSONArray.class);
-        System.out.println(mapper.writeValueAsString(foo));
-    }
-
-    @Test
-    public void testGetCarousels2() throws IOException {
-        String result = restTemplate.getForEntity("http://10.10.100.23:20030/carousels?usedFor=home", String.class).getBody();
-        System.out.println(result);
-
-        List<JSONPObject> foo = mapper.readValue(result, new TypeReference<List<JSONObject>>(){});
-        System.out.println(mapper.writeValueAsString(foo));
-    }
-
-}

+ 0 - 56
src/test/java/com/uas/platform/b2c/core/util/JsonUtilTest.java

@@ -1,56 +0,0 @@
-package com.uas.platform.b2c.core.util;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.uas.platform.b2c.core.utils.JsonUtil;
-import net.sf.json.JSONObject;
-import org.junit.Test;
-import org.springframework.web.client.RestTemplate;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Created by yangck on 2016/11/18.
- */
-public class JsonUtilTest {
-
-    @Test
-    public void parseJsonToMap() throws IOException {
-        String json = "{\"phonetype\":\"N95\",\"cat\":\"WP\"}";
-        Map<String, String> map = JsonUtil.parseJsonToMap(json);
-        System.out.println(map);
-
-        String json2 = "{\"PAP2016111100000002\":\"SUP_TO_MALL\",\"PAP2016111100000003\":\"FINISHED\"}";
-
-        Map<String, String> map2 = JsonUtil.parseJsonToMap(json2);
-        System.out.println(map2);
-
-    }
-
-    @Test
-    public void writeValueAsString() throws IOException {
-        String json = "{\"phonetype\":\"N95\",\"cat\":\"WP\"}";
-        Map<String, String> map = JsonUtil.parseJsonToMap(json);
-        System.out.println(map);
-
-        System.out.println(JsonUtil.writeValueAsString(map));
-        System.out.println(JsonUtil.writeValueAsPrettyString(map));
-
-    }
-
-    @Test
-    public void parseJsonToObject() throws JsonProcessingException {
-        RestTemplate restTemplate = new RestTemplate();
-        String result = restTemplate.getForEntity("http://10.10.100.23:20030/carousels?usedFor=home", String.class).getBody();
-        System.out.println(result);
-
-        List<JSONObject> foo = JsonUtil.parseJsonToObject(result);
-        System.out.println(foo);
-
-        ObjectMapper mapper = new ObjectMapper();
-        System.out.println(mapper.writeValueAsString(foo));
-    }
-
-}

+ 0 - 60
src/test/java/com/uas/platform/b2c/storecms/dao/StoreContentDaoTest.java

@@ -1,60 +0,0 @@
-package com.uas.platform.b2c.storecms.dao;
-
-import com.uas.platform.b2c.SpringBaseTest;
-
-import com.uas.platform.b2c.advertise.ad.dao.StoreContentDao;
-import com.uas.platform.b2c.advertise.ad.model.ContentType;
-import com.uas.platform.b2c.advertise.ad.model.StoreContent;
-import com.uas.platform.b2c.core.utils.JacksonUtils;
-import com.uas.platform.b2c.prod.store.dao.StoreInDao;
-import com.uas.platform.b2c.prod.store.model.StoreIn;
-import com.uas.platform.b2c.advertise.ad.dao.StoreContentDao;
-import com.uas.platform.b2c.prod.store.dao.StoreInDao;
-import com.uas.platform.b2c.prod.store.model.StoreIn;
-import com.uas.platform.b2c.core.utils.JacksonUtils;
-import com.uas.platform.b2c.advertise.ad.model.ContentType;
-import com.uas.platform.b2c.advertise.ad.model.StoreContent;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-
-public class StoreContentDaoTest extends SpringBaseTest {
-
-	@Autowired
-	private StoreContentDao storeContentDao;
-
-	@Autowired
-	private StoreInDao storeInDao;
-
-	@Test
-	public void count() throws Exception {
-		long count = storeContentDao.count();
-		System.out.println(count);
-	}
-
-	@Test
-	public void addContent() throws Exception {
-		StoreIn storeIn = storeInDao.findByEnUU(10041559L).get(0);
-		assert storeIn != null;
-
-		StoreContent content = new StoreContent();
-		content.setUuid(storeIn.getUuid());
-		content.setType(ContentType.ORIGINAL_RECOMMEND);
-
-		content = storeContentDao.save(content);
-		System.out.println(content.toString());
-	}
-
-	@Test
-	public void addContent1() throws Exception {
-		StoreIn storeIn = storeInDao.findByEnUU(10041559L).get(0);
-		assert storeIn != null;
-		System.out.println(JacksonUtils.toJson(storeIn));
-
-		StoreContent content = new StoreContent();
-		content.setStore(storeIn);
-		content.setType(ContentType.ORIGINAL_RECOMMEND);
-
-		content = storeContentDao.save(content);
-		System.out.println(content.toString());
-	}
-}

+ 0 - 29
src/test/java/com/uas/platform/b2c/storecms/service/StoreContentServiceTest.java

@@ -1,29 +0,0 @@
-package com.uas.platform.b2c.storecms.service;
-
-import com.uas.platform.b2c.SpringBaseTest;
-import com.uas.platform.b2c.advertise.ad.model.ContentType;
-import com.uas.platform.b2c.advertise.ad.model.StoreContent;
-import com.uas.platform.b2c.advertise.ad.service.StoreContentService;
-import com.uas.platform.core.model.PageInfo;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-
-public class StoreContentServiceTest extends SpringBaseTest {
-
-	@Autowired
-	private StoreContentService storeContentService;
-
-	@Test
-	public void getContentByType() throws Exception {
-		PageInfo pageInfo = new PageInfo();
-		pageInfo.setPageNumber(1);
-		pageInfo.setPageSize(5);
-		Page<StoreContent> contentByType = storeContentService.getContentByType(pageInfo, ContentType.ORIGINAL_RECOMMEND);
-		assert contentByType.getContent() != null;
-		for (StoreContent content : contentByType.getContent()) {
-			System.out.println(content);
-		}
-	}
-
-}

+ 0 - 29
src/test/java/com/uas/platform/b2c/trade/dao/PurchaseDaoTest.java

@@ -1,29 +0,0 @@
-package com.uas.platform.b2c.trade.dao;
-
-import com.uas.platform.b2c.SpringBaseTest;
-import com.uas.platform.b2c.trade.order.dao.PurchaseDao;
-import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.domain.Pageable;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class PurchaseDaoTest extends SpringBaseTest {
-
-	@Autowired
-	private PurchaseDao purchaseDao;
-
-	@Test
-	public void getStoreIdByTop() throws Exception {
-		Pageable pageable = new PageRequest(0, 5);
-		List<String> uuids = new ArrayList<>();
-		uuids.add("33069557578d44e69bd91ad12d28a8d4");
-		// TODO 需要调整调用方式
-		List<String> storeUuids = purchaseDao.getStoreIdByTop(uuids, null, pageable);
-		System.out.println(storeUuids.size());
-		System.out.println(storeUuids);
-	}
-
-}

Некоторые файлы не были показаны из-за большого количества измененных файлов