|
|
@@ -10,37 +10,24 @@ import org.springframework.stereotype.Repository;
|
|
|
import javax.persistence.QueryHint;
|
|
|
import java.util.List;
|
|
|
|
|
|
+/**
|
|
|
+ * 物料
|
|
|
+ *
|
|
|
+ * @author hejq
|
|
|
+ * @date 2018-07-24 17:05
|
|
|
+ */
|
|
|
@Repository
|
|
|
public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaRepository<Product, Long> {
|
|
|
|
|
|
/**
|
|
|
* 按所属企业的ID和产品的编号查找产品
|
|
|
*
|
|
|
- * @param enUU
|
|
|
- * @param code
|
|
|
+ * @param enUU 企业UU
|
|
|
+ * @param code 物料编号
|
|
|
* @return
|
|
|
*/
|
|
|
@QueryHints({ @QueryHint(name = "org.hibernate.cacheable", value = "true") })
|
|
|
- public List<Product> findByEnUUAndCode(long enUU, String code);
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过uu和器件型号判断是否存在
|
|
|
- *
|
|
|
- * @param enuu
|
|
|
- * @param cmpUuId
|
|
|
- * @return
|
|
|
- */
|
|
|
- public Product findByEnUUAndCmpUuId(Long enUU, String cmpUuId);
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过uu,code,brand查询物料是否存在
|
|
|
- *
|
|
|
- * @param enUU
|
|
|
- * @param code
|
|
|
- * @param brand
|
|
|
- * @return
|
|
|
- */
|
|
|
- public Product findByEnUUAndCodeAndBrand(Long enUU, String code, String brand);
|
|
|
+ List<Product> findByEnUUAndCode(long enUU, String code);
|
|
|
|
|
|
/**
|
|
|
* 通过uu和名称判断物料是否存在(新增采购导入时需用到)
|
|
|
@@ -49,25 +36,7 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
|
|
|
* @param title
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<Product> findByEnUUAndTitle(Long enUU, String title);
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过销售状态查询物料
|
|
|
- *
|
|
|
- * @param enUU
|
|
|
- * @param issale
|
|
|
- * @return
|
|
|
- */
|
|
|
- public List<Product> findByEnUUAndIsSale(Long enUU, Short issale);
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过采购状态查询物料
|
|
|
- *
|
|
|
- * @param enUU
|
|
|
- * @param isPurc
|
|
|
- * @return
|
|
|
- */
|
|
|
- public List<Product> findByEnUUAndIsPurchase(Long enUU, Short isPurc);
|
|
|
+ List<Product> findByEnUUAndTitle(Long enUU, String title);
|
|
|
|
|
|
/**
|
|
|
* 查询企业的所有物料
|
|
|
@@ -75,16 +44,17 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
|
|
|
* @param enuu
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<Product> findByEnUU(Long enuu);
|
|
|
+ List<Product> findByEnUU(Long enuu);
|
|
|
|
|
|
- /**
|
|
|
- * 通过品牌和enuu查询所有信息
|
|
|
- *
|
|
|
- * @param enuu
|
|
|
- * @param brand
|
|
|
- * @return
|
|
|
- */
|
|
|
- public List<Product> findByEnUUAndBrandAndIsSale(Long enuu, String brand, Short isSale);
|
|
|
+ /**
|
|
|
+ * 通过品牌和enuu查询所有信息
|
|
|
+ *
|
|
|
+ * @param enUU 企业UU
|
|
|
+ * @param brand 品牌
|
|
|
+ * @param isSale 是否销售
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ List<Product> findByEnUUAndBrandAndIsSale(Long enUU, String brand, Short isSale);
|
|
|
|
|
|
/**
|
|
|
* 通过品牌和enuu查询所有信息
|
|
|
@@ -93,7 +63,8 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
|
|
|
* @param brand
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<Product> findByEnUUAndBrand(Long enuu, String brand);
|
|
|
+ List<Product> findByEnUUAndBrand(Long enuu, String brand);
|
|
|
+
|
|
|
/**
|
|
|
* 通过品牌和enuu查询所有信息
|
|
|
*
|
|
|
@@ -102,7 +73,7 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
|
|
|
* @param isPurc
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<Product> findByEnUUAndBrandAndIsPurchase(Long enuu, String brand, Short isPurc);
|
|
|
+ List<Product> findByEnUUAndBrandAndIsPurchase(Long enuu, String brand, Short isPurc);
|
|
|
|
|
|
/**
|
|
|
* 通过名称查询物料信息
|
|
|
@@ -112,7 +83,7 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
|
|
|
* @param isSale
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<Product> findByEnUUAndTitleAndIsSale(Long enUU, String title, Short isSale);
|
|
|
+ List<Product> findByEnUUAndTitleAndIsSale(Long enUU, String title, Short isSale);
|
|
|
|
|
|
/**
|
|
|
* 通过名称查询物料信息
|
|
|
@@ -122,25 +93,7 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
|
|
|
* @param isPurc
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<Product> findByEnUUAndTitleAndIsPurchase(Long enUU, String title, Short isPurc);
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过uu和标准状态判断是否存在物料
|
|
|
- *
|
|
|
- * @param enuu
|
|
|
- * @param standard
|
|
|
- * @return
|
|
|
- */
|
|
|
- public List<Product> findByEnUUAndStandard(Long enuu, Short standard);
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据状态更新数据
|
|
|
- *
|
|
|
- * @param uu
|
|
|
- * @param status
|
|
|
- * @return
|
|
|
- */
|
|
|
- public List<Product> findByEnUUAndMatchstatus(Long uu, Integer status);
|
|
|
+ List<Product> findByEnUUAndTitleAndIsPurchase(Long enUU, String title, Short isPurc);
|
|
|
|
|
|
/**
|
|
|
* 通过应用来源和下载状态查询物料信息
|
|
|
@@ -150,30 +103,18 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
|
|
|
* @param status
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<Product> findByEnUUAndSourceAppAndDownloadstatus(Long enuu, String app, Integer status);
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过企业UU,物料名称、规格、品牌(非标准)
|
|
|
- *
|
|
|
- * @param enUU
|
|
|
- * @param titile
|
|
|
- * @param spec
|
|
|
- * @param brand
|
|
|
- * @return
|
|
|
- */
|
|
|
- public List<Product> findByTitleAndCmpCodeAndBrandAndEnUU(String title, String cmpcode, String brand, Long enUU);
|
|
|
+ List<Product> findByEnUUAndSourceAppAndDownloadstatus(Long enuu, String app, Integer status);
|
|
|
|
|
|
/**
|
|
|
- * 通过企业UU,物料名称、规格、品牌(非标准)、型号
|
|
|
+ * 通过企业UU,物料名称、规格、品牌(非标准)查询物料信息
|
|
|
*
|
|
|
- * @param enUU 企业uu
|
|
|
- * @param title 名称
|
|
|
- * @param spec 规格
|
|
|
- * @param cmpcode 型号
|
|
|
+ * @param title 物料名称
|
|
|
+ * @param cmpCode 型号
|
|
|
* @param brand 品牌
|
|
|
+ * @param enUU 企业UU
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<Product> findByTitleAndSpecAndCmpCodeAndBrandAndEnUU(String title, String spec, String cmpcode, String brand, Long enUU);
|
|
|
+ List<Product> findByTitleAndCmpCodeAndBrandAndEnUU(String title, String cmpCode, String brand, Long enUU);
|
|
|
|
|
|
/**
|
|
|
* 通过企业UU,物料名称、规格、品牌(标准)
|
|
|
@@ -184,36 +125,17 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
|
|
|
* @param enUU
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<Product> findByTitleAndPcmpcodeAndPbrandAndEnUU(String title, String cmpcode, String brand, Long enUU);
|
|
|
+ List<Product> findByTitleAndPcmpcodeAndPbrandAndEnUU(String title, String cmpcode, String brand, Long enUU);
|
|
|
|
|
|
- /**
|
|
|
- * 通过uu查询非标准器件进行存储 -- B2B不在使用一键匹配,所以更新方法也弃用
|
|
|
- *
|
|
|
- * @param enuu
|
|
|
- * @return
|
|
|
- */
|
|
|
+ /**
|
|
|
+ * 通过uu查询非标准器件进行存储 -- B2B不在使用一键匹配,所以更新方法也弃用
|
|
|
+ *
|
|
|
+ * @param enuu
|
|
|
+ * @param updatetype
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Procedure(procedureName = "PRODUCT$UPDATE")
|
|
|
- public String upateProductByEnuuAndType(Long enuu, String updatetype);
|
|
|
-
|
|
|
- /**
|
|
|
- * 一键开启(关闭)销售(采购) --公共服务调试ok之后会弃用
|
|
|
- *
|
|
|
- * @param enuu
|
|
|
- * @param switchtype
|
|
|
- * @param status
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Procedure(procedureName = "PRODUCT$SWITCH")
|
|
|
- public void switchProductByEnuuAndTypeAndStatus(Long enuu, String switchtype, Integer switchstatus);
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过id判断是否有业务关系
|
|
|
- *
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @Procedure(procedureName = "PRODUCT$BUSINESSSTATUS")
|
|
|
- public Integer findProductBusinessStatusById(Long id);
|
|
|
+ String upateProductByEnuuAndType(Long enuu, String updatetype);
|
|
|
|
|
|
/**
|
|
|
* 通过型号和品牌查询物料是否存在
|
|
|
@@ -232,12 +154,4 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
|
|
|
* @return
|
|
|
*/
|
|
|
Long countByEnUU(Long enUU);
|
|
|
-
|
|
|
- /**
|
|
|
- * 通过
|
|
|
- * @param enUU
|
|
|
- * @param cmpCode
|
|
|
- * @return
|
|
|
- */
|
|
|
- List<Product> findByEnUUAndCmpCode(Long enUU, String cmpCode);
|
|
|
}
|