|
|
@@ -14,7 +14,6 @@ import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.b2b.support.UsageBufferedLogger;
|
|
|
import com.uas.platform.b2b.temporary.model.*;
|
|
|
import com.uas.platform.b2b.temporary.model.PurcInquiryInfo;
|
|
|
-import com.uas.platform.core.exception.IllegalOperatorException;
|
|
|
import com.uas.platform.core.logging.BufferedLoggerManager;
|
|
|
import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
@@ -150,8 +149,8 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
item.setProduct(product);
|
|
|
item.setProductId(product.getId());
|
|
|
} else {// 导入或手动输入的一般不带有id
|
|
|
- List<Product> products = productDao.findByEnUUAndCode(
|
|
|
- SystemSession.getUser().getEnterprise().getUu(), purcitem.getProdCode());
|
|
|
+ List<Product> products = productDao.findByEnUUAndPcmpcodeAndPbrand(
|
|
|
+ SystemSession.getUser().getEnterprise().getUu(), purcitem.getCmpCode(), purcitem.getBrand());
|
|
|
if (products.size() > 0) {
|
|
|
product = products.get(0);
|
|
|
}
|
|
|
@@ -169,12 +168,10 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
product.setCmpUuId(purcitem.getProdCode());
|
|
|
product.setUnit(purcitem.getUnit());
|
|
|
product.setUserUU(SystemSession.getUser().getUserUU());
|
|
|
-// product.setShipAddr(SystemSession.getUser().getEnterprise().getEnAddress());
|
|
|
// 导入的物料这里没有填写规格
|
|
|
product.setSpec(purcitem.getProdTitle());
|
|
|
product.setCreateTime(new Date());
|
|
|
Long proId = ProductUtils.updateOne(product);
|
|
|
-// item.setProduct(product);
|
|
|
item.setProductId(proId);
|
|
|
}
|
|
|
}
|
|
|
@@ -491,9 +488,10 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
item.setProduct(product);
|
|
|
item.setProductId(product.getId());
|
|
|
} else {// 导入或手动输入的一般不带有id
|
|
|
- product = productDao.findByEnUUAndCodeAndBrand(
|
|
|
- SystemSession.getUser().getEnterprise().getUu(), purcitem.getProdCode(),
|
|
|
+ List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrand(
|
|
|
+ SystemSession.getUser().getEnterprise().getUu(), purcitem.getCmpCode(),
|
|
|
purcitem.getInbrand());
|
|
|
+ product = CollectionUtils.isEmpty(productList) ? null : productList.get(0);
|
|
|
if (product != null) {// 存在直接选择
|
|
|
item.setProduct(product);
|
|
|
item.setProductId(product.getId());
|
|
|
@@ -515,10 +513,9 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
item.setProdTitle(purcitem.getProdTitle());
|
|
|
item.setSpec(purcitem.getSpec());
|
|
|
item.setCmpCode(purcitem.getCmpCode());
|
|
|
+ item.setInbrand(purcitem.getInbrand());
|
|
|
if (null != product) {
|
|
|
item.setProductId(proId);
|
|
|
- } else {
|
|
|
- throw new IllegalOperatorException("物料保存失败:" + product.getTitle());
|
|
|
}
|
|
|
}
|
|
|
}
|