Jelajahi Sumber

Merge branch 'dev-mysql-1227' of ssh://10.10.100.21/source/platform-b2c into dev-mysql-1227

yujia 8 tahun lalu
induk
melakukan
2713210f18

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

@@ -116,6 +116,15 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
     List<Product> findProductByEnuuAndStandard(@Param("enuu") Long enuu, @Param("standard") Integer standard);
 
 
-//    List<Porduct>
+    /**
+     * 查找是否有匹配成标准的非标信息
+     * @param enuu
+     * @param brand
+     * @param code
+     * @param standard
+     * @return
+     */
+    @Query(value = "select p from Product p where p.enUU = :enuu and p.brand = :brand and p.cmpCode = :code and p.standard = :standard")
+    List<Product> findMatchStandard(@Param("enuu") Long enuu, @Param("brand") String brand, @Param("code") String code, @Param("standard") Integer standard);
 
 }

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

@@ -4,6 +4,7 @@ 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.constant.IntegerConstant;
 import com.uas.platform.b2c.core.constant.ReleaseStatus;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.NumberUtil;
@@ -18,6 +19,7 @@ import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
 import com.uas.platform.b2c.prod.commodity.dao.ReleaseProductByBatchDao;
 import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
+import com.uas.platform.b2c.prod.commodity.model.Product;
 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;
@@ -488,18 +490,30 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		aProduct.setTagByExcel(tagValue);
 		// 自定义标签不为null,则检查是否重复
 		if (aProduct.getCode() != null && aProduct.getBrandNameEn() != null && aProduct.getTag() != null) {
-			int count = goodsDao.findCountByTagInGoods(SystemSession.getUser().getEnterprise().getUu(), aProduct.getBrandNameEn(),
-					aProduct.getCode(), aProduct.getTag());
-			// 如果在该型号品牌已有重复,则忽略该自定义标签
-			if (count != 0) {
-				aProduct.setTag(null);
-			}
+			resetTag(aProduct);
 		}
 		return result;
 	}
 
+	/**
+	 * 重新设置tag标签
+	 * @param aProduct
+	 */
 	private void resetTag(ReleaseProductByBatch aProduct) {
-//		Product product = productDao
+		Long enuu = SystemSession.getUser().getEnterprise().getUu();
+		int count = 0;
+		List<Product> productList = productDao.findMatchStandard(enuu, aProduct.getBrandNameEn(), aProduct.getCode(), IntegerConstant.YES_SHORT);
+		if (!CollectionUtils.isEmpty(productList)) {
+			count = goodsDao.findCountByTagInGoods(enuu, productList.get(0).getPbranden(),
+					productList.get(0).getCmpCode(), aProduct.getTag());
+		} else {
+			count = goodsDao.findCountByTagInGoods(SystemSession.getUser().getEnterprise().getUu(), aProduct.getBrandNameEn(),
+					aProduct.getCode(), aProduct.getTag());
+		}
+		// 如果在该型号品牌已有重复,则忽略该自定义标签
+		if (count != 0) {
+			aProduct.setTag(null);
+		}
 	}
 
 	/**

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

@@ -352,7 +352,7 @@
 	}
 	.edit-content div.floatLeft {
 		overflow: hidden;
-		margin-top: 22px;
+		padding-top: 22px;
 	}
 	.edit-content div.floatLeft .title.height29{
 		float: left;
@@ -363,7 +363,7 @@
 		float: left;
 	}
 	.edit-content div.margin10{
-		margin-top: 24px;
+		padding-top: 24px;
 	}
 	.edit-content .wid36{
 		width: 36px;
@@ -1615,6 +1615,7 @@
                                         <tr class="edit-content edits" >
                                             <td colspan="10" style="background:#f0f7fd;">
                                                 <div class="blue-bg">
+													<div></div>
                                                     <div class="img">
                                                         <a><img ng-src="{{goods.editPic || 'static/img/store/common/default.png'}}" alt="img"/></a>
                                                         <div class="edit-img">
@@ -1738,6 +1739,7 @@
 										<tr class="edit-content edit-contents" ng-if="!goods.edit">
 											<td colspan="10">
 												<div class="bg">
+													<div></div>
 													<div class="img">
 														<img ng-src="{{goods.img || 'static/img/store/common/default.png'}}" alt="img"/>
 													</div>
@@ -1797,6 +1799,7 @@
 										<tr class="edit-content edits" ng-if="goods.edit">
 											<td colspan="10" style="background:#f0f7fd;">
                                                 <div class="blue-bg">
+													<div></div>
 													<div class="img">
 														<a><img ng-src="{{goods.editPic || 'static/img/store/common/default.png'}}" alt="img"/></a>
 														<div class="edit-img">