Browse Source

ERP物料传入增加标准料号查询赋值方法。如果原厂型号不存在,将规格型号赋值给原厂型号

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@8959 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 years ago
parent
commit
c332252562

+ 6 - 1
src/main/java/com/uas/platform/b2b/erp/service/impl/ProdServiceImpl.java

@@ -35,10 +35,11 @@ public class ProdServiceImpl implements ProdService {
 			if (prod.getPr_uuid() == null) {
 				if (prod.getPr_code() != null) {
 					List<Component> components = componentDao.findByCode(prod.getPr_code());
-					if (components.size() == 1) {
+					if (components.size() == 1) {// 如果查询是标准数据,给个标准赋值
 						prod.setPr_uuid(components.get(0).getUuid());
 						prod.setPr_brand(components.get(0).getBrand().getNameEn());
 						prod.setPbrand(components.get(0).getBrand().getNameEn());
+						prod.setKind(components.get(0).getKind().getNameEn());
 					}
 				}
 			} else {
@@ -46,6 +47,10 @@ public class ProdServiceImpl implements ProdService {
 				prod.setPr_uuid(component.getUuid());
 				prod.setPr_brand(component.getBrand().getNameEn());
 				prod.setPbrand(component.getBrand().getNameEn());
+				prod.setKind(component.getKind().getNameEn());
+			}
+			if (prod.getPr_orispeccode() == null) {// 如果原厂型号不存在,将型号赋值给原厂型号
+				prod.setPr_orispeccode(prod.getPr_spec());
 			}
 			List<Product> prodResult = productDao.findByEnUUAndCode(enUU, prod.getPr_code());
 			if (CollectionUtils.isEmpty(prodResult)) {// 平台上不存在的新上传上来的物料,新增