hulh 8 лет назад
Родитель
Сommit
3956d33e12

+ 11 - 0
src/main/java/com/uas/platform/b2c/prod/product/component/api/ComponentController.java

@@ -320,4 +320,15 @@ public class ComponentController {
 	public List<Component> getMostSearchBrands() {
 		return componentService.getMostSearchComponent();
 	}
+
+	/**
+	 * 根据以下字段获取器件信息
+	 * @param brandId
+	 * @param cmpCode
+	 * @return
+	 */
+	@RequestMapping(value = "/codeAndBrand/info", method = RequestMethod.GET)
+	public Component getComponentBySome(Long brandId, String cmpCode) {
+		return componentService.getComponentBySome(brandId, cmpCode);
+	}
 }

+ 9 - 0
src/main/java/com/uas/platform/b2c/prod/product/component/service/ComponentService.java

@@ -244,4 +244,13 @@ public interface ComponentService {
 	 */
 	public List<Component> getMostSearchComponent();
 
+	/**
+	 * 根据以下获取器件信息
+	 *
+	 * @param brandId
+	 * @param cmpCode
+	 * @return
+	 */
+	Component getComponentBySome(Long brandId, String cmpCode);
+
 }

+ 9 - 0
src/main/java/com/uas/platform/b2c/prod/product/component/service/impl/ComponentServiceImpl.java

@@ -570,4 +570,13 @@ public class ComponentServiceImpl implements ComponentService {
 	public List<Component> getMostSearchComponent() {
 		return componentDao.findMostSearchComponent();
 	}
+
+	@Override
+	public Component getComponentBySome(Long brandId, String cmpCode) {
+		List<Component> componentList = componentDao.findByCodeAndBrandid(cmpCode, brandId);
+		if (CollectionUtils.isNotEmpty(componentList)) {
+			return componentList.get(0);
+		}
+		return null;
+	}
 }