|
|
@@ -24,6 +24,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.uas.platform.b2b.core.util.ContextUtils;
|
|
|
import com.uas.platform.b2b.core.util.ThreadTask;
|
|
|
import com.uas.platform.b2b.dao.CommonDao;
|
|
|
@@ -194,10 +195,10 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
List<Product> products = productDao.findByEnUUAndCode(
|
|
|
SystemSession.getUser().getEnterprise().getUu(),
|
|
|
purcitem.getProdCode());
|
|
|
- if (!CollectionUtils.isEmpty(products)) {
|
|
|
+ if (products.size() > 0) {
|
|
|
product = products.get(0);
|
|
|
}
|
|
|
- if (product != null) {// 存在直接选择
|
|
|
+ if (product.getId() != null) {// 存在直接选择
|
|
|
item.setProduct(product);
|
|
|
item.setProductId(product.getId());
|
|
|
} else { // 不存在,插入物料
|
|
|
@@ -245,6 +246,7 @@ public class PurcInquiryServiceImpl implements PurcInquiryService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ System.out.println(JSON.toJSON(items));
|
|
|
List<PurcInquiryItem> purcitems = purcInquiryItemDao.save(items);
|
|
|
if (purcitems.get(0).getId() != null) {
|
|
|
map.put("success", "询价单保存成功");
|