Browse Source

Merge branch 'dev-mysql' into feature-background-hulh-1212

hulh 8 years ago
parent
commit
ecc59ae144
20 changed files with 217 additions and 133 deletions
  1. 1 0
      src/main/java/com/uas/platform/b2c/prod/commodity/constant/ErrorInfoConstant.java
  2. 10 0
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductDao.java
  3. 1 1
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/ReleaseProductByBatchDao.java
  4. 3 1
      src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java
  5. 23 28
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java
  6. 33 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java
  7. 42 0
      src/main/java/com/uas/platform/b2c/prod/commodity/util/GoodsUtil.java
  8. 23 0
      src/main/java/com/uas/platform/b2c/prod/store/service/impl/StoreInServiceImpl.java
  9. 13 37
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java
  10. 6 1
      src/main/webapp/resources/css/common.css
  11. 2 2
      src/main/webapp/resources/css/home/common.css
  12. 16 10
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js
  13. 2 1
      src/main/webapp/resources/view/common/site-nav.html
  14. 2 1
      src/main/webapp/resources/view/usercenter/forstore/store_focus.html
  15. 4 4
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_erp.html
  16. 4 4
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_unstandard_erp.html
  17. 2 2
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_onSale_erp.html
  18. 2 2
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_undercarriage_erp.html
  19. 4 4
      src/main/webapp/resources/view/vendor/modal/recommend_product_modal.html
  20. 24 35
      src/test/java/com/uas/platform/b2c/DesTest.java

+ 1 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/constant/ErrorInfoConstant.java

@@ -6,6 +6,7 @@ package com.uas.platform.b2c.prod.commodity.constant;
  * @author hulh
  */
 public enum  ErrorInfoConstant {
+    REPEAT_INFO("产品库已存在该产品"),
     CODE_PATTERN_INFO("A列:请勿输入中文或中文特殊字符"),
     CODE_LENGTH_INFO("A列:产品型号不能超过100字符"),
     CODE_EMPTY_INFO("A列:产品型号不能为空"),

+ 10 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductDao.java

@@ -67,6 +67,16 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
      */
     List<Product> findProductByPcmpcodeAndPbrandenAndEnUU(String pcmpcode, String pbranden, Long enUU);
 
+    /**
+     *
+     * @param enUU 企业enuu
+     * @param pcmpcode 型号
+     * @param pbranden 品牌
+     * @param b2cEnabled 启用
+     * @return
+     */
+    List<Product> findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(Long enUU, String pcmpcode, String pbranden, Integer b2cEnabled);
+
 
     /**
      * 根据器件型号,品牌 、enuu

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/dao/ReleaseProductByBatchDao.java

@@ -71,7 +71,7 @@ public interface ReleaseProductByBatchDao
      * @param publisherUu the publisher uu 发布人
      * @param batchid     the batchid 批次号
      */
-    @Procedure(procedureName = "PRODUCT_RELEASE_VALID_V1")
+    @Procedure(procedureName = "PRODUCT_RELEASE_VALID_V2")
 	public void callValidProcedure(Long publisherUu, String batchid);
 
     /**

+ 3 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java

@@ -8,6 +8,7 @@ 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.ErrorInfoConstant;
 import com.uas.platform.b2c.prod.commodity.type.ReleaseConstant;
+import com.uas.platform.b2c.prod.commodity.util.GoodsUtil;
 import com.uas.platform.b2c.trade.order.StringConstant.Currency;
 import org.apache.commons.collections.CollectionUtils;
 import org.codehaus.jackson.annotate.JsonIgnore;
@@ -486,7 +487,8 @@ public class ReleaseProductByBatch implements Serializable {
 		if (!minPackageStr.equals(that.minPackageStr)) return false;
 		if (!packaging.equals(that.packaging)) return false;
 		if (!selfMaxDeliveryStr.equals(that.selfMaxDeliveryStr)) return false;
-		return selfMinDeliveryStr.equals(that.selfMinDeliveryStr);
+		if (!selfMinDeliveryStr.equals(that.selfMinDeliveryStr)) return false;
+		return GoodsUtil.compareWithQtyPrice(prices, that.getPrices(), that.getCurrency());
 
 	}
 

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

@@ -571,7 +571,8 @@ public class GoodsServiceImpl implements GoodsService {
         goods.setTaxRate();
 
         if (goods.getReturnInWeek() == null) {
-            goods.setReturnInWeek((short) 0);// 若无设置,默认不支持7天无理由退货
+            // 若无设置,默认不支持7天无理由退货
+            goods.setReturnInWeek((short) 0);
         }
         // 若B2C上架的商品必须有发布人姓名和发布人联系电话
         if (goods.getSourceId() == null) {
@@ -593,16 +594,12 @@ public class GoodsServiceImpl implements GoodsService {
         if (StringUtils.isEmpty(goods.getImg())) {
             Long goodsProductid = goods.getProductid();
             if (goodsProductid != null) {
-                Product product = productDao.findOne
-                        (goodsProductid);
+                Product product = productDao.findOne(goodsProductid);
                 if (product != null) {
                     if (StringUtils.isEmpty(product.getCmpImg())) {
                         String cmpUuId = product.getCmpUuId();
-                        if (!StringUtils.isEmpty
-                                (cmpUuId)) {
-                            Component component = componentDao
-                                    .findByUuid
-                                            (cmpUuId);
+                        if (!StringUtils.isEmpty(cmpUuId)) {
+                            Component component = componentDao.findByUuid(cmpUuId);
                             if (component != null) {
                                 goods.setImg(component.getImg());
                             }
@@ -629,8 +626,13 @@ public class GoodsServiceImpl implements GoodsService {
                 throw new IllegalOperatorException("器件" + goods.getCode() + "品牌" + goods.getBrandNameEn() + "关联的物料库信息丢失");
             }
             List<Goods> goodses = goodsDao.findRepeatGoodsInProductId(goods.getProductid(), goods.getProduceDate(), goods.getPackaging(), goods.getMinPackQty(), goods.getMinBuyQty(), goods.getMaxDelivery(), goods.getMinDelivery(), goods.getUnit());
-            if ((goods.getId() == null && goodses.size() > 0) || (goodses.size() > 1)) {
-                throw new IllegalOperatorException("该物料已存在(包装、日期、最小包装量、最小起订量、交期、单位)相同的信息");
+            if (!CollectionUtils.isEmpty(goodses)) {
+                for (Goods goods1 : goodses) {
+                    if (!goods1.getId().equals(goods.getId())
+                            && GoodsUtil.compareWithQtyPrice(goods1.getPrices(), goods.getPrices(), goods.getCurrencyName())) {
+                        throw new IllegalOperatorException("该物料已存在(包装、日期、最小包装量、最小起订量、交期、单位、价格)相同的信息");
+                    }
+                }
             }
             //判断自定义标签是否重复
             if (StringUtils.isEmpty(goods.getTag())) {
@@ -640,13 +642,12 @@ public class GoodsServiceImpl implements GoodsService {
                 throw new IllegalOperatorException("传入的产品信息缺失,请重新操作");
             }
             List<Goods> goodsList = goodsDao.findGoodsByProductidAndTag(goods.getProductid(), goods.getTag());
-            if ((goods.getId() == null) &&
-                    (goodsList.size() > 0)) {
+            if ((goods.getId() == null) && (goodsList.size() > 0)) {
                 throw new IllegalOperatorException("该产品下已存在相同的自定义标签");
             } else {
                 for (Goods goods1 : goodsList) {
-                    if (goods.getTag().equals(goods1.getTag()) &&
-                            (goods1.getId().longValue() != goods.getId().longValue())) {
+                    if (goods.getTag().equals(goods1.getTag())
+                            && (goods1.getId().longValue() != goods.getId().longValue())) {
                         throw new IllegalOperatorException("该产品下已存在相同的自定义标签");
                     }
                 }
@@ -1254,26 +1255,20 @@ public class GoodsServiceImpl implements GoodsService {
         if (nowGoods.getReserve().doubleValue() != goods.getOldReserve().doubleValue()) {
             return new ResultMap(CodeType.INFO_UPDATE.code(), "该库存的信息已经被修改了,请刷新界面之后重新操作。");
         }
-        if(StringUtils.isEmpty(goods.getTag())) {
+        if (StringUtils.isEmpty(goods.getTag())) {
             return new ResultMap(CodeType.NOT_PERMIT.code(), "产品自定义标签必须填写");
         }
         List<Goods> tagInTheProdNums = goodsDao.findSameTagInTheProdNum(goods.getProdNum(), goods.getTag());
         for (Goods tagInTheProdNum : tagInTheProdNums) {
-            if(goods.getTag().equals(tagInTheProdNum.getTag())&&(goods.getId().longValue() != tagInTheProdNum.getId().longValue())) {
+            if (goods.getTag().equals(tagInTheProdNum.getTag()) && (goods.getId().longValue() != tagInTheProdNum.getId().longValue())) {
                 return new ResultMap(CodeType.NOT_PERMIT.code(), "标签不能与该器件现有产品的标签重复");
             }
         }
-//		ProductStandardPutOnInfo putOnInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
-//		if(putOnInfo != null) {
-//			if(nowGoods.validProductStandardPutOnInfoAndGoodsSameData(putOnInfo)) {
-//				return new ResultMap(CodeType.INFO_UPDATE.code(), "数据已经被更新了请刷新之后重新操作");
-//			}
-//		}
         List<Goods> repeatGoodsInProductId = goodsDao.findRepeatGoodsInProductId(goods.getProductid(), goods.getProduceDate(), goods.getPackaging(), goods.getMinPackQty(), goods.getMinBuyQty(), goods.getMaxDelivery(), goods.getMinDelivery(), goods.getUnit());
         for (Goods goods1 : repeatGoodsInProductId) {
-            if(goods1.getId().longValue() !=
-                    goods.getId().longValue()) {
-                throw new IllegalOperatorException("该物料已存在(包装、日期、最小包装量、最小起订量、交期、单位)相同的信息");
+            if (!goods1.getId().equals(goods.getId())
+                    && GoodsUtil.compareWithQtyPrice(goods1.getPrices(), goods.getPrices(), goods.getCurrencyName())) {
+                throw new IllegalOperatorException("该物料已存在(包装、日期、最小包装量、最小起订量、交期、单位、价格)相同的信息");
             }
         }
         // 比较两个goods编辑信息
@@ -1419,7 +1414,7 @@ public class GoodsServiceImpl implements GoodsService {
     @Override
     public ResultMap putOn(Long id) {
         Goods goods = goodsDao.findOne(id);
-        if(goods != null) {
+        if (goods != null) {
             setGoodsDefault(goods);
             ResultMap resultMap = checkGoods(goods);
             if (resultMap.getCode() != CodeType.OK.code()) {
@@ -1431,7 +1426,7 @@ public class GoodsServiceImpl implements GoodsService {
             goodsHistoryDao.save(goodsHistory);
             // TODO huxz 添加或修改商品价格信息
             if (goods.getUuid() != null) {
-                saveOrUpdatePriceInfos(goods, "NOMAL");
+//                saveOrUpdatePriceInfos(goods, "NOMAL");
                 updateComponentTradeInfos(goods.getUuid());
             }
             return ResultMap.success(persistGoods);
@@ -1448,7 +1443,7 @@ public class GoodsServiceImpl implements GoodsService {
     @Transactional
     @Override
     public ResultMap addGoods(Goods goods) {
-        if(goods == null) {
+        if (goods == null) {
             throw new IllegalOperatorException("传入的需要添加的产品信息为空");
         }
         if (Integer.valueOf(goods.getSelfSale()).equals(IntegerConstant.B2C_SALE)) {

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

@@ -176,6 +176,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		}
 		List<ReleaseProductByBatch> addList = new ArrayList<>(releaseProductByBatchs.size());
 		addList.addAll(releaseProductByBatchs);
+		resetRepeatData(addList);
 		commonDao.save(addList, ReleaseProductByBatch.class);
 		Long userUU = SystemSession.getUser().getUserUU();
 		Long enUU = SystemSession.getUser().getEnterprise().getUu();
@@ -191,6 +192,38 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		return modelMap;
 	}
 
+	/**
+	 * 判断是否重复,重复则重设状态
+	 * @param data
+	 */
+	private void resetRepeatData(List<ReleaseProductByBatch> data) {
+		Long enuu = SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null;
+		if (enuu == null) {
+			throw new IllegalOperatorException("企业enuu丢失");
+		}
+		for (ReleaseProductByBatch each : data) {
+			List<Product> standardList = productDao.findMatchStandard(enuu, each.getBrandNameEn(), each.getCode(), IntegerConstant.YES_SHORT);
+			if (!CollectionUtils.isEmpty(standardList)) {
+				each.setB2cBranden(standardList.get(0).getPbranden());
+				each.setB2cCode(standardList.get(0).getPcmpcode());
+			}
+			List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(enuu, each.getB2cCode(), each.getB2cBranden(), IntegerConstant.YES_SHORT);
+			if (!CollectionUtils.isEmpty(productList)) {
+				List<Goods> goodsList = goodsDao.findRepeatGoodsInProductId(productList.get(0).getId(), each.getProductDate(), each.getPackaging(), each.getMinPackage(), each.getMinBuyQty(), each.getSelfMaxDelivery(), each.getSelfMinDelivery(), each.getUnit());
+				if (!CollectionUtils.isEmpty(goodsList)) {
+					for (Goods goods1 : goodsList) {
+						if (GoodsUtil.compareWithQtyPrice(each.getPrices(), goods1.getPrices(), each.getCurrency())) {
+							each.setErrmsg(ErrorInfoConstant.REPEAT_INFO.getInfo());
+							each.setReleaseCode(ReleaseStatus.had_exists.value());
+							each.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
+							break;
+						}
+					}
+				}
+			}
+		}
+	}
+
 	/**
 	 * 验证该产品自定义标签是否重复
 	 * @param aProduct 单个产品

+ 42 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/util/GoodsUtil.java

@@ -1,6 +1,7 @@
 package com.uas.platform.b2c.prod.commodity.util;
 
 import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
+import com.uas.platform.b2c.trade.order.StringConstant.Currency;
 import org.apache.commons.collections.CollectionUtils;
 
 import java.util.List;
@@ -95,4 +96,45 @@ public class GoodsUtil {
 		return maxPrice;
 	}
 
+	/**
+	 比较分段价格是否一致
+	 * @param qtyPriceList 分段价格列表
+	 * @param targetList  比较价格列表
+	 * @param currency 币别
+	 * @return
+	 */
+	public static Boolean compareWithQtyPrice(List<GoodsQtyPrice> qtyPriceList, List<GoodsQtyPrice> targetList, String currency) {
+		if (qtyPriceList.size() != targetList.size()) {
+			return false;
+		}
+		for (int i = 0; i < qtyPriceList.size(); i++) {
+			if (!compareWithPrice(qtyPriceList.get(i), targetList.get(i), currency)) {
+				return false;
+			}
+		}
+		return true;
+	}
+
+	/**
+	 * 判断分段价格是否相等
+	 * @param first	分段价格1
+	 * @param second 分段价格2
+	 * @param currency 币别
+	 * @return
+	 */
+	public static Boolean compareWithPrice(GoodsQtyPrice first, GoodsQtyPrice second, String currency) {
+		if (!first.getStart().equals(second.getStart()) || !first.getEnd().equals(second.getEnd())) {
+			return false;
+		}
+		if (Currency.RMB.equals(currency)) {
+			if (!first.getRMBPrice().equals(second.getRMBPrice())) {
+				return false;
+			}
+		} else if (Currency.USD.equals(currency)) {
+			if (!first.getRMBPrice().equals(second.getRMBPrice())) {
+				return false;
+			}
+		}
+		return true;
+	}
 }

+ 23 - 0
src/main/java/com/uas/platform/b2c/prod/store/service/impl/StoreInServiceImpl.java

@@ -184,6 +184,29 @@ public class StoreInServiceImpl implements StoreInService {
 		}
 		logger.info("Start to execute find.");
 		StoreIn store = storeDao.findByUuid(uuid);
+		// 为了给前端返回一致的顺序
+		Set<Qualification> qualifications = new TreeSet<Qualification>(new Comparator()
+		{
+			public int compare(Object o1, Object o2) {
+				Qualification time1 = (Qualification)o1;
+				Qualification time2 = (Qualification)o2;
+				if (time1.getId().intValue() > time2.getId().intValue())
+				{
+					return 1;
+				}
+				else if (time1.getId().intValue() == time2.getId().intValue())
+				{
+					return 0;
+				}
+				else
+				{
+					return -1;
+				}
+			}
+
+		});
+		qualifications.addAll(store.getQualifications());
+		store.setQualifications(qualifications);
 		logger.info(String.format("Start to execute find %s", store != null ? store.toString() : null));
 		return store;
 	}

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

@@ -1,10 +1,5 @@
 package com.uas.platform.b2c.trade.order.service.impl;
 
-import static com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus.BUYER_TO_MALL;
-import static com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus.MALL_TO_SUP;
-import static com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus.SUP_TO_MALL;
-import static com.uas.platform.b2c.trade.util.Preconditions.checkNotNull;
-
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.uas.api.b2c_erp.buyer.model.B2cOrder;
@@ -39,12 +34,7 @@ import com.uas.platform.b2c.logistics.dao.AddressDao;
 import com.uas.platform.b2c.logistics.dao.InvoiceFOrderDao;
 import com.uas.platform.b2c.logistics.dao.InvoiceFPurchaseDao;
 import com.uas.platform.b2c.logistics.dao.PickUpAddressDao;
-import com.uas.platform.b2c.logistics.model.Address;
-import com.uas.platform.b2c.logistics.model.InvoiceFOrder;
-import com.uas.platform.b2c.logistics.model.InvoiceFOrderDetail;
-import com.uas.platform.b2c.logistics.model.InvoiceFPurchase;
-import com.uas.platform.b2c.logistics.model.InvoiceFPurchaseDetail;
-import com.uas.platform.b2c.logistics.model.PickUpAddress;
+import com.uas.platform.b2c.logistics.model.*;
 import com.uas.platform.b2c.logistics.service.InvoiceFPurchaseService;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsHistoryDao;
@@ -69,14 +59,7 @@ 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.OrderIndexDetailDao;
 import com.uas.platform.b2c.trade.order.dao.PurchaseDao;
-import com.uas.platform.b2c.trade.order.model.Order;
-import com.uas.platform.b2c.trade.order.model.OrderDetail;
-import com.uas.platform.b2c.trade.order.model.OrderIndex;
-import com.uas.platform.b2c.trade.order.model.OrderIndexDetail;
-import com.uas.platform.b2c.trade.order.model.OrderSimpleInfo;
-import com.uas.platform.b2c.trade.order.model.Purchase;
-import com.uas.platform.b2c.trade.order.model.PurchaseDetail;
-import com.uas.platform.b2c.trade.order.model.TradeProofing;
+import com.uas.platform.b2c.trade.order.model.*;
 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.service.PurchaseService;
@@ -105,22 +88,6 @@ import com.uas.platform.core.util.serializer.FlexJsonUtils;
 import com.uas.search.model.BaseOrder;
 import com.uas.search.model.PageParams;
 import com.uas.search.model.SPage;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
 import org.apache.commons.collections.map.HashedMap;
 import org.apache.commons.lang.time.DateUtils;
 import org.springframework.beans.BeanUtils;
@@ -134,6 +101,15 @@ import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import java.util.*;
+
+import static com.uas.platform.b2c.trade.aftersale.model.AfterSaleStatus.*;
+import static com.uas.platform.b2c.trade.util.Preconditions.checkNotNull;
+
 /**
  * 订单业务实现类
  *
@@ -811,8 +787,8 @@ public class OrderServiceImpl implements OrderService {
 
             or.setDeliverytype(Integer.parseInt(rule.getString("method")));
             or.setFare(Double.parseDouble(rule.getString("fare")));
-            ensurePrices += or.getFare();
-            transationPrice += or.getFare();
+            ensurePrices = NumberUtil.add(ensurePrices, or.getFare());
+            transationPrice = NumberUtil.add(transationPrice, or.getFare());
 
             or.setBatchQty(newOrderDetails.size());
             or.setEnsurePrice(NumberUtil.fractionNumCeil(ensurePrices, 2));

+ 6 - 1
src/main/webapp/resources/css/common.css

@@ -949,4 +949,9 @@ input::-webkit-input-safebox-button{
 	display: none;
 }
 /*去除textarea默认右下角可自由放大样式*/
-textarea{resize:none}
+textarea{resize:none}
+
+.modal-content {
+	overflow-y: auto;
+	max-height: 500px;
+}

+ 2 - 2
src/main/webapp/resources/css/home/common.css

@@ -72,12 +72,12 @@ img {
 .ghost-center {
     position: relative;
 }
-.ghost-center::before {
+/*.ghost-center::before {
     content: " ";
     display: inline-block;
     height: 100%;
     vertical-align: middle;
-}
+}*/
 .ghost-center > * {
     display: inline-block;
     vertical-align: middle;

+ 16 - 10
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js

@@ -61,14 +61,19 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 			// $scope.sortByERP = type == $scope.sortByERP ? 'none' : type;
 			loadData();
 		}
-
-		if ($location.$$path.endsWith('vendor_material_unstandard_erp')) {
-			$scope.tab = 'unstandard_material';
-			// $scope.standard_tab = 'unstandard';
-            $scope.param.type = "nStandard";
-            // $scope.param.sorting = {code : 'ASC'};
-            $scope.isBatch = false;
-		}
+        //
+		// var startWith = function (str, s) {
+		// 	var reg = new RegExp(str + '$');
+		// 	return reg.test(str);
+		// };
+        //
+		// if (startWith($location.$$path, 'vendor_material_unstandard_erp')) {
+		// 	$scope.tab = 'unstandard_material';
+		// 	// $scope.standard_tab = 'unstandard';
+         //    $scope.param.type = "nStandard";
+         //    // $scope.param.sorting = {code : 'ASC'};
+         //    $scope.isBatch = false;
+		// }
 
 		$scope.goods = { breakUp: 1, isSelfSupport: 1, prices: [{}] };
 		$scope.isSelfSupport = true;
@@ -131,9 +136,9 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
             //获取店铺的信息
             StoreInfo.getStoreInfoByEnuu({enUU : $rootScope.userInfo.enterprise.uu}, function(data) {
                 $scope.storeInfo = data;
-				if(!$scope.storeInfo || $scope.storeInfo.status != 'OPEN' || $scope.storeInfo.storeName.indexOf('优软测试二') > 0 || $scope.storeInfo.storeName.indexOf('优软商城') > 0) {
+				if (!$scope.storeInfo || $scope.storeInfo.status != 'OPENED' || $scope.storeInfo.storeName.indexOf('优软测试二') > 0 || $scope.storeInfo.storeName.indexOf('优软商城') > 0) {
 					$scope.$$nonProduct.canSelfSale = false;
-				}else {
+				} else {
 					$scope.$$nonProduct.canSelfSale = true;
 				}
             }, function(response) {
@@ -1739,6 +1744,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 				$scope.goods.productid = material.id;
 				$scope.goods.prodNum = material.prodNum;
 				$scope.goods.editPrices = [];
+				$scope.goods.editSelfSale = $scope.$$nonProduct.canSelfSale ? 1 : 2;
 				$scope.goods.editPrices.push({start : $scope.minReserve, end : $scope.maxReserve});
 				// $scope.goods.isSelfSupport = $scope.store.status == 'OPENED' ? 1 : 0;
 				material.selected = true;

+ 2 - 1
src/main/webapp/resources/view/common/site-nav.html

@@ -75,6 +75,7 @@
     #site-nav .dropdown .dropdown-menu >ul{
         max-height: 300px;
         overflow-y: auto;
+        padding: 0;
     }
     #site-nav .dropdown .dropdown-menu >ul >li {
         padding: 0 12px;
@@ -150,7 +151,7 @@
     #site-nav * {
         box-sizing: border-box;
         list-style: none;
-        white-space: nowrap;
+        /*white-space: nowrap;*/
     }
     .unstyled a:hover,.dropdown-menu a:hover{
         color: #d32526;

+ 2 - 1
src/main/webapp/resources/view/usercenter/forstore/store_focus.html

@@ -387,7 +387,8 @@
 						<i class="fa fa-trash fa-2x item-delete" ng-click="deleteById(item.id)" ng-hide="isBatch" title="取消关注" style="cursor: pointer"></i>
 						<div class="item-seller" style="position: relative;">
 							<img src="static/img/common/songguo.png">
-							<a class="item-contact" ng-click="contactSeller(item)">联系卖家</a>
+							<a href="javascript:void(0)" class="item-contact" title="联系卖家" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(item.storeInfo.enterprise.enTel, item.storeInfo.enterprise.uu, chat.UserType.STORE)">联系卖家</a>
+							<!--<a class="item-contact" ng-click="contactSeller(item)">联系卖家</a>-->
 							<div class="contact-box" ng-if="item.contactBNox">
 								<div class="title"><i class="fa fa-close fa-lg" ng-click="item.contactBNox = false"></i></div>
 								<div class="content">

+ 4 - 4
src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_erp.html

@@ -1503,10 +1503,10 @@
 	<div class="pro_management device">
 		<div class="com_tab">
 			<ul class="fl" style="width: 100%">
-				<li ng-class="{'active': tab == 'unstandard_material'}"><a ui-sref="vendor_material_unstandard_erp({standardParam:'unstandard'})">非标产品</a></li>
-				<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material_erp({standardParam:'standard'})">标准产品</a></li>
-				<li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale_erp">在售产品</a></li>
-				<li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage_erp">上下架历史</a></li>
+				<li><a ui-sref="vendor_material_unstandard_erp({standardParam:'unstandard'})">非标产品</a></li>
+				<li class="active"><a ui-sref="vendor_material_erp({standardParam:'standard'})">标准产品</a></li>
+				<li><a ui-sref="vendor_onSale_erp">在售产品</a></li>
+				<li><a ui-sref="vendor_undercarriage_erp">上下架历史</a></li>
 			</ul>
 		</div>
 		<!--非标和标准产品列表页-->

+ 4 - 4
src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_unstandard_erp.html

@@ -1503,10 +1503,10 @@
 	<div class="pro_management device">
 		<div class="com_tab">
 			<ul class="fl" style="width: 100%">
-				<li ng-class="{'active': tab == 'unstandard_material'}"><a ui-sref="vendor_material_unstandard_erp({standardParam:'unstandard'})">非标产品</a></li>
-				<li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material_erp({standardParam:'standard'})">标准产品</a></li>
-				<li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale_erp">在售产品</a></li>
-				<li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage_erp">上下架历史</a></li>
+				<li class="active"><a ui-sref="vendor_material_unstandard_erp({standardParam:'unstandard'})">非标产品</a></li>
+				<li><a ui-sref="vendor_material_erp({standardParam:'standard'})">标准产品</a></li>
+				<li><a ui-sref="vendor_onSale_erp">在售产品</a></li>
+				<li><a ui-sref="vendor_undercarriage_erp">上下架历史</a></li>
 			</ul>
 		</div>
 		<!--非标和标准产品列表页-->

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

@@ -512,8 +512,8 @@
     <div class="pro_management device">
         <div class="com_tab">
             <ul class="fl" style="width: 100%">
-                <li ng-class="{'active': tab == 'unstandard_material'}"><a ui-sref="vendor_material_unstandard_erp">非标产品</a></li>
-                <li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material_erp">标准产品</a></li>
+                <li ng-class="{'active': tab == 'unstandard_material'}"><a ui-sref="vendor_material_unstandard_erp({standardParam:'unstandard'})">非标产品</a></li>
+                <li ng-class="{'active': tab == 'material'}"><a ui-sref="vendor_material_erp({standardParam:'standard'})">标准产品</a></li>
                 <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale_erp">在售产品</a></li>
                 <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage_erp">上下架历史</a></li>
                 <li class="down-goods">

+ 2 - 2
src/main/webapp/resources/view/vendor/forstore/erp/vendor_undercarriage_erp.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 == 'unstandard_material'}"><a ui-sref="vendor_material_unstandard_erp">非标产品</a></li>
-                <li ng-class="{'active': tab == 'vendor_material'}"><a ui-sref="vendor_material_erp">标准产品</a></li>
+                <li ng-class="{'active': tab == 'unstandard_material'}"><a ui-sref="vendor_material_unstandard_erp({standardParam:'unstandard'})">非标产品</a></li>
+                <li ng-class="{'active': tab == 'vendor_material'}"><a ui-sref="vendor_material_erp({standardParam:'standard'})">标准产品</a></li>
                 <li ng-class="{'active': tab == 'onSale'}"><a ui-sref="vendor_onSale_erp">在售产品</a></li>
                 <li ng-class="{'active': tab == 'undercarriage'}"><a ui-sref="vendor_undercarriage_erp">上下架历史</a></li>
             </ul>

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

@@ -386,14 +386,14 @@ input[type="number"] {
                             <span>{{commodity.selfDeliveryDemMinTime + '-' + commodity.selfDeliveryDemMaxTime}}</span>
                         </div>
                         <div ng-if="commodity.minPriceRMB && (!commodity.selfDeliveryDemMinTime || !commodity.selfDeliveryDemMaxTime)">
-                            <span>暂无数据</span>
+                            <span>{{commodity.selfDeliveryDemMinTime + '-' + commodity.selfDeliveryDemMaxTime}}</span>
                         </div>
                         <div ng-if="!commodity.minPriceRMB && (commodity.selfDeliveryHKMinTime && commodity.selfDeliveryHKMaxTime)">
                             <span>香港:</span>
                             <span>{{commodity.selfDeliveryHKMinTime + '-' + commodity.selfDeliveryHKMaxTime}}</span>
                         </div>
                         <div ng-if="!commodity.minPriceRMB && (!commodity.selfDeliveryHKMinTime || !commodity.selfDeliveryHKMaxTime)">
-                            <span>暂无数据</span>
+                            <span>{{commodity.selfDeliveryHKMinTime + '-' + commodity.selfDeliveryHKMaxTime}}</span>
                         </div>
                     </td>
                     <td class="check-act">
@@ -457,14 +457,14 @@ input[type="number"] {
                             <span>{{goods.selfDeliveryDemMinTime + '-' + goods.selfDeliveryDemMaxTime}}</span>
                         </div>
                         <div ng-if="goods.minPriceRMB && (!goods.selfDeliveryDemMinTime || !goods.selfDeliveryDemMaxTime)">
-                            <span>暂无数据</span>
+                            <span>{{goods.b2cMinDelivery + '-' + goods.b2cMaxDelivery}}</span>
                         </div>
                         <div ng-if="!goods.minPriceRMB && (goods.selfDeliveryHKMinTime && goods.selfDeliveryHKMaxTime)">
                             <span>香港:</span>
                             <span>{{goods.selfDeliveryHKMinTime + '-' + goods.selfDeliveryHKMaxTime}}</span>
                         </div>
                         <div ng-if="!goods.minPriceRMB && (!goods.selfDeliveryHKMinTime || !goods.selfDeliveryHKMaxTime)">
-                            <span>暂无数据</span>
+                            <span>{{goods.b2cMinDelivery + '-' + goods.b2cMaxDelivery}}</span>
                         </div>
                     </td>
                     <td class="check-act">

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

@@ -6,46 +6,35 @@ import org.junit.Test;
 public class DesTest {
     @Test
     public void test(){
+        // 测试
+        prindHexString("jdbc:mysql://192.168.253.12:3306/mall_test_dev?characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements=true");
+        prindHexString("root");
+        prindHexString("select111***");
+
+        // 正式
+        prindHexString("jdbc:mysql://10.10.0.208:8066/mall_prod?characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements=true");
+        prindHexString("sa");
+        prindHexString("Select123!#%*(");
+
+        // 正式旧版
+        prindHexString("jdbc:mysql://10.10.100.18:3306/mall_prod?characterEncoding=UTF-8");
+        prindHexString("root");
+        prindHexString("select");
+    }
+
+    /**
+     * 打印加密后的字符串
+     * @param s 明文
+     */
+    public void prindHexString(String s) {
         try {
             Des des = new Des();
-            byte b[] = des.encrypt("root", "10101010");
-            System.out.println(des.toHexString(b));
-
-            b = des.encrypt("jdbc:mysql://192.168.253.12:3306/mall_test_dev?characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements=true", "10101010");
-            System.out.println(des.toHexString(b));
-            //System.out.println(des.decrypt(des.toHexString(b), "10101010"));
-
-            b = des.encrypt("select111***", "10101010");
-            System.out.println(des.toHexString(b));
-
-            //正式
-            b = des.encrypt("sa", "10101010");
-            System.out.println(des.toHexString(b));
-
-            b = des.encrypt("jdbc:mysql://10.10.0.208:8066/mall_prod?characterEncoding=UTF-8&allowMultiQueries=true&rewriteBatchedStatements=true", "10101010");
-            System.out.println(des.toHexString(b));
-            //System.out.println(des.decrypt(des.toHexString(b), "10101010"));
-
-            b = des.encrypt("Select123!#%*(", "10101010");
-            System.out.println(des.toHexString(b));
-
-            //旧版正式
-            b = des.encrypt("root", "10101010");
+            String key = "10101010";
+            byte b[] = des.encrypt(s, key);
             System.out.println(des.toHexString(b));
-
-            b = des.encrypt("jdbc:mysql://10.10.100.18:3306/mall_prod?characterEncoding=UTF-8", "10101010");
-            System.out.println(des.toHexString(b));
-            //System.out.println(des.decrypt(des.toHexString(b), "10101010"));
-
-            b = des.encrypt("select", "10101010");
-            System.out.println(des.toHexString(b));
-
-
-
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
         }
-
     }
 }