|
|
@@ -157,12 +157,14 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
if (purcitem.getProductId() != null) {// 点击选择出来的,一般带有id
|
|
|
product = productDao.findOne(purcitem.getProductId());
|
|
|
item.setProduct(product);
|
|
|
+ item.setProductId(product.getId());
|
|
|
} else {// 导入或手动输入的一般不带有id
|
|
|
product = productDao.findByEnUUAndCodeAndBrand(
|
|
|
SystemSession.getUser().getEnterprise().getUu(), purcitem.getProdCode(),
|
|
|
purcitem.getInbrand());
|
|
|
if (product != null) {// 存在直接选择
|
|
|
item.setProduct(product);
|
|
|
+ item.setProductId(product.getId());
|
|
|
} else { // 不存在,插入物料
|
|
|
product = new Product();
|
|
|
product.setBrand(purcitem.getInbrand());
|
|
|
@@ -178,6 +180,7 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
product.setSpec(purcitem.getProdTitle());
|
|
|
product = productDao.save(product);
|
|
|
item.setProduct(product);
|
|
|
+ item.setProductId(product.getId());
|
|
|
}
|
|
|
}
|
|
|
item.setInquiry(inquiry);
|
|
|
@@ -187,7 +190,6 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
item.setToDate(purcitem.getToDate());
|
|
|
item.setTaxrate(purcitem.getTaxrate());
|
|
|
item.setRemark(purcitem.getRemark());
|
|
|
- item.setProductId(purcitem.getProductId());
|
|
|
item.setVendUU(contact.getEnuu());
|
|
|
item.setStatus((short) Status.NOT_REPLY.value());
|
|
|
item.setVendUserUU(vendorEn.getEnAdminuu());
|
|
|
@@ -235,7 +237,8 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
// 先进行保存
|
|
|
Object inquiryId = save(inquiryInfo, contacts, uploadItem).get("id");// 取出id进行更新状态
|
|
|
// 再进行提交
|
|
|
- return sumbit(Long.valueOf(inquiryId.toString()));
|
|
|
+ ModelMap map = sumbit(Long.valueOf(inquiryId.toString()));
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -276,7 +279,7 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
for (PurcInquiryItem item : inquiry.getInquiryItems()) {
|
|
|
PurchaseInquiryItem saleItem = new PurchaseInquiryItem();
|
|
|
saleItem.setFromDate(item.getFromDate());
|
|
|
- Product product = productDao.findOne(Long.valueOf(id));
|
|
|
+ Product product = productDao.findOne(item.getProductId());
|
|
|
saleItem.setInquiry(saleInquiry);
|
|
|
saleItem.setNumber(item.getNumber());
|
|
|
saleItem.setVendUU(item.getVendUU());
|
|
|
@@ -444,11 +447,13 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
if (purcitem.getProductId() != null) {// 点击选择出来的,一般带有id
|
|
|
product = productDao.findOne(purcitem.getProductId());
|
|
|
item.setProduct(product);
|
|
|
+ item.setProductId(product.getId());
|
|
|
} else {// 导入或手动输入的一般不带有id
|
|
|
product = productDao.findByEnUUAndCodeAndBrand(SystemSession.getUser().getEnterprise().getUu(),
|
|
|
purcitem.getProdCode(), purcitem.getInbrand());
|
|
|
if (product != null) {// 存在直接选择
|
|
|
item.setProduct(product);
|
|
|
+ item.setProductId(product.getId());
|
|
|
} else { // 不存在,插入物料
|
|
|
product = new Product();
|
|
|
product.setBrand(purcitem.getInbrand());
|
|
|
@@ -464,17 +469,16 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
product.setSpec(purcitem.getProdTitle());
|
|
|
product = productDao.save(product);
|
|
|
item.setProduct(product);
|
|
|
+ item.setProductId(product.getId());
|
|
|
}
|
|
|
}
|
|
|
item.setInquiry(inquiry);
|
|
|
- item.setProduct(product);
|
|
|
item.setNumber(i);
|
|
|
item.setCurrency(inquiry.getCurrency());
|
|
|
item.setFromDate(new Date());
|
|
|
item.setToDate(purcitem.getToDate());
|
|
|
item.setTaxrate(purcitem.getTaxrate());
|
|
|
item.setRemark(purcitem.getRemark());
|
|
|
- item.setProductId(purcitem.getProductId());
|
|
|
item.setStatus((short) Status.NOT_REPLY.value());
|
|
|
item.setIsOpen(inquiryInfo.getIsOpen());
|
|
|
items.add(item);
|