浏览代码

批量 新增物料2

wangdy 7 年之前
父节点
当前提交
179a7f0b7e

+ 8 - 0
src/main/java/com/uas/ps/product/repository/ProductDao.java

@@ -47,6 +47,14 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
     @Query("update Product p set p.enabled = :enabled where p.enUU = :enUU and p.code = :code")
     int updateEnabled(@Param("enUU") Long enUU, @Param("code") String code, @Param("enabled") Short enabled);
 
+    /**
+     * 根据物料所属enUU、原产型号品牌查询物料
+     * @param enUU
+     * @param cmpCode
+     * @param brand
+     * @return
+     */
+    List<Product> findByEnUUAndCmpCodeAndBrand(Long enUU, String cmpCode, String brand);
     /**
      * 通过企业UU,物料名称、规格、品牌(非标准)
      *

+ 5 - 0
src/main/java/com/uas/ps/product/service/impl/ProductServiceImpl.java

@@ -146,6 +146,11 @@ public class ProductServiceImpl implements ProductService {
         return productDao.findByEnUUAndSourceAppAndDownloadStatus(enUU, app, status);
     }
 
+    @Override
+    public List<Product> findByEnUUAndCmpCodeAndBrand(Long enUU, String cmpCode, String brand) {
+        return productDao.findByEnUUAndCmpCodeAndBrand(enUU,cmpCode,brand);
+    }
+
     /**
      * 物料下载成功,更新下载状态
      *