|
|
@@ -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);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|