Browse Source

新增物料与批量导入物料增加字段

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

+ 25 - 3
src/main/java/com/uas/platform/b2b/service/impl/BaseInfoServiceImpl.java

@@ -155,14 +155,35 @@ public class BaseInfoServiceImpl implements BaseInfoService {
 						row.getCell(5).setCellType(Cell.CELL_TYPE_STRING);
 						product.setCmpCode(row.getCell(5).getStringCellValue().trim());
 					}
-					// UUID
+					// UUID 标准料号
 					if (row.getCell(6) != null) {
 						row.getCell(6).setCellType(Cell.CELL_TYPE_STRING);
 						product.setCmpUuId(row.getCell(6).getStringCellValue().trim());
 					}
+					// 最小包装量
+					if (row.getCell(7) != null) {
+						row.getCell(7).setCellType(Cell.CELL_TYPE_STRING);
+						product.setMinPack(Float.valueOf(row.getCell(7).getStringCellValue()));
+					}
+					// 最小订购量
+					if (row.getCell(8) != null) {
+						row.getCell(8).setCellType(Cell.CELL_TYPE_STRING);
+						product.setMinOrder(Float.valueOf(row.getCell(8).getStringCellValue()));
+					}
+					// 交货周期
+					if (row.getCell(9) != null) {
+						row.getCell(9).setCellType(Cell.CELL_TYPE_STRING);
+						product.setLeadtime(Float.valueOf(row.getCell(9).getStringCellValue()));
+					}
+					// 交货提前期
+					if (row.getCell(10) != null) {
+						row.getCell(10).setCellType(Cell.CELL_TYPE_STRING);
+						product.setLtinstock(Float.valueOf(row.getCell(10).getStringCellValue()));
+					}
 					product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
 					product.setUserUU(SystemSession.getUser().getUserUU());
 					product.setSourceApp("B2B");
+					product.setIsSale((short) 1);
 					if (alters.size() > 0) {
 						modelMap.put("alters", alters);
 					}
@@ -228,14 +249,15 @@ public class BaseInfoServiceImpl implements BaseInfoService {
 			map.put("error", "物料已存在");
 			map.put("id", products.get(0).getId());
 		}
-		if (product.getId() != null) {
+		if (product != null && product.getId() != null) {
 			map.put("error", "该器件物料已存在,正在跳转详情页面.....");
 			map.put("id", product.getId());
 		}
-		if (CollectionUtils.isEmpty(products) && product.getId() == null) {
+		if (CollectionUtils.isEmpty(products) && product == null) {
 			prodInfo.setUserUU(SystemSession.getUser().getUserUU());
 			prodInfo.setEnUU(SystemSession.getUser().getEnterprise().getUu());
 			prodInfo.setSourceApp("B2B");
+			prodInfo.setIsSale((short) 1);
 			List<Component> comp = componentDao.findByCode(prodInfo.getCode());
 			if (!CollectionUtils.isEmpty(comp)) {
 				prodInfo.setCmpUuId(comp.get(0).getUuid());