|
|
@@ -9,11 +9,13 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.uas.platform.b2b.dao.ProductDao;
|
|
|
import com.uas.platform.b2b.dao.SaleQuotationDao;
|
|
|
+import com.uas.platform.b2b.dao.VendorDao;
|
|
|
import com.uas.platform.b2b.erp.model.Quotation;
|
|
|
import com.uas.platform.b2b.erp.service.QuotationService;
|
|
|
import com.uas.platform.b2b.model.Product;
|
|
|
import com.uas.platform.b2b.model.SaleQuotation;
|
|
|
import com.uas.platform.b2b.model.SaleQuotationItem;
|
|
|
+import com.uas.platform.b2b.model.Vendor;
|
|
|
import com.uas.platform.b2b.support.SystemSession;
|
|
|
|
|
|
@Service
|
|
|
@@ -21,6 +23,9 @@ public class QuotationServiceImpl implements QuotationService {
|
|
|
|
|
|
@Autowired
|
|
|
private ProductDao productDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private VendorDao vendorDao;
|
|
|
|
|
|
@Autowired
|
|
|
private SaleQuotationDao saleQuotationDao;
|
|
|
@@ -34,6 +39,13 @@ public class QuotationServiceImpl implements QuotationService {
|
|
|
List<SaleQuotation> quotations2 = saleQuotationDao.findByEnUUAndCode(enUU, quotation.getQu_code());
|
|
|
if (quotations2.size() == 0) {
|
|
|
SaleQuotation saleQuotation = quotation.convert();
|
|
|
+ List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(saleQuotation.getCustUU(), saleQuotation.getEnUU());
|
|
|
+ if(vendors.size() > 0) {//存在对应的供应商资料
|
|
|
+ //如果主动报价单中的客户联系人uu号为空,则设为供应商资料中的客户联系人
|
|
|
+ if(saleQuotation.getCustUserUU() == null) saleQuotation.setCustUserUU(vendors.get(0).getMyUserUU());
|
|
|
+ //如果主动报价单中的供应商联系人uu号为空,则设为供应商资料中的供应商联系人
|
|
|
+ if(saleQuotation.getUserUU() == null) saleQuotation.setUserUU(vendors.get(0).getVendUserUU());
|
|
|
+ }
|
|
|
if (!CollectionUtils.isEmpty(saleQuotation.getQuotationItems())) {
|
|
|
for (SaleQuotationItem item : saleQuotation.getQuotationItems()) {
|
|
|
item.setQuotation(saleQuotation);
|