|
|
@@ -16,6 +16,7 @@ import com.uas.ps.product.repository.ProductMatchResultDao;
|
|
|
import com.uas.ps.product.repository.ProductStoreStatusDao;
|
|
|
import com.uas.ps.product.repository.ProductUsersDao;
|
|
|
import com.uas.ps.product.service.ProductService;
|
|
|
+import com.uas.ps.properties.UrlProperties;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
@@ -51,6 +52,8 @@ public class ProductServiceImpl implements ProductService {
|
|
|
@Autowired
|
|
|
private RestTemplate restTemplate;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UrlProperties urlProperties;
|
|
|
/**
|
|
|
* 保存物料
|
|
|
*
|
|
|
@@ -151,10 +154,10 @@ public class ProductServiceImpl implements ProductService {
|
|
|
*/
|
|
|
private int matchOne(Product product, Long enUU) {
|
|
|
// 获取品牌
|
|
|
- String brandUrl = "http://192.168.253.129:8080/platform-b2c/api/product/brand/byName/brand?name=" + product.getBrand();
|
|
|
+ String brandUrl = urlProperties.getB2cUrl() + "/api/product/brand/byName/brand?name=" + product.getBrand();
|
|
|
BrandInfo brand = restTemplate.getForEntity(brandUrl, BrandInfo.class).getBody();
|
|
|
if (brand.getUuid() != null) {
|
|
|
- String componentUrl = "http://192.168.253.129:8080/platform-b2c/api/product/component/codeAndBrand/info?brandId="
|
|
|
+ String componentUrl = urlProperties.getB2cUrl() + "/api/product/component/codeAndBrand/info?brandId="
|
|
|
+ brand.getId() + "&cmpCode=" + product.getCmpCode();
|
|
|
ComponentInfo component = restTemplate.getForEntity(componentUrl, ComponentInfo.class).getBody();
|
|
|
if (component != null) {
|
|
|
@@ -169,7 +172,7 @@ public class ProductServiceImpl implements ProductService {
|
|
|
}
|
|
|
}
|
|
|
// 根据型号匹配
|
|
|
- String codeUrl = "http://192.168.253.129:8080/platform-b2c/api/product/component/byCode?code=" + product.getpCmpCode();
|
|
|
+ String codeUrl = urlProperties.getB2cUrl() + "/api/product/component/byCode?code=" + product.getpCmpCode();
|
|
|
String componentJson = restTemplate.getForEntity(codeUrl, String.class).getBody();
|
|
|
List<ComponentInfo> componentInfoList = JSON.parseArray(componentJson, ComponentInfo.class);
|
|
|
Set<ProductMatchResult> productMatchResults = convertComponentToResult(product.getId(), componentInfoList, enUU);
|