Browse Source

个人产品库 初步搭建4 -还差删除产品的逻辑

wangdy 8 years ago
parent
commit
2deed9da8f

+ 15 - 3
src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductController.java

@@ -9,9 +9,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.uas.platform.b2c.core.constant.SplitChar;
 import com.uas.platform.b2c.core.constant.SplitChar;
 import com.uas.platform.b2c.core.support.view.JxlsExcelView;
 import com.uas.platform.b2c.core.support.view.JxlsExcelView;
 import com.uas.platform.b2c.prod.commodity.facade.ProductFacade;
 import com.uas.platform.b2c.prod.commodity.facade.ProductFacade;
-import com.uas.platform.b2c.prod.commodity.model.Goods;
-import com.uas.platform.b2c.prod.commodity.model.Product;
-import com.uas.platform.b2c.prod.commodity.model.ProductDetail;
+import com.uas.platform.b2c.prod.commodity.model.*;
 import com.uas.platform.b2c.prod.commodity.service.GoodsService;
 import com.uas.platform.b2c.prod.commodity.service.GoodsService;
 import com.uas.platform.b2c.prod.commodity.model.ProductDetail;
 import com.uas.platform.b2c.prod.commodity.model.ProductDetail;
 import com.uas.platform.b2c.prod.commodity.service.ProductService;
 import com.uas.platform.b2c.prod.commodity.service.ProductService;
@@ -83,6 +81,20 @@ public class ProductController {
 		return productService.getAllProducts(info, keyword, type);
 		return productService.getAllProducts(info, keyword, type);
 	}
 	}
 
 
+	/**
+	 * 查看个人产品库
+	 *
+	 * @param page    the page 一页数据
+	 * @param keyword the keyword 搜索关键字
+	 * @param type    the type 类型
+	 * @return all products
+	 */
+	@RequestMapping(value = "/person", method = RequestMethod.GET, params = "_status=all")
+	Page<V_ProductPerson> getAllProductsByPerson(PageParams page, String keyword, String type) {
+		PageInfo info = new PageInfo(page);
+		return productService.getAllProductsByPerson(info, keyword, type);
+	}
+
     /**
     /**
      * 批量导出产品表
      * 批量导出产品表
      *
      *

+ 11 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/dao/V_ProductPersonDao.java

@@ -0,0 +1,11 @@
+package com.uas.platform.b2c.prod.commodity.dao;
+
+import com.uas.platform.b2c.prod.commodity.model.V_ProductPerson;
+import com.uas.platform.b2c.prod.commodity.model.V_ProductPersonId;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface V_ProductPersonDao extends JpaRepository<V_ProductPerson, V_ProductPersonId>, JpaSpecificationExecutor<V_ProductPerson> {
+}

+ 714 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/V_ProductPerson.java

@@ -0,0 +1,714 @@
+package com.uas.platform.b2c.prod.commodity.model;
+
+
+import com.uas.platform.core.persistence.EnterpriseUU;
+import com.uas.platform.core.persistence.UserUU;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+@Entity
+@Table(name = "v$person$product")
+@IdClass(V_ProductPersonId.class)
+public class V_ProductPerson implements Serializable{
+
+
+    /**
+     * product$person的主键
+     */
+    @Id
+    @Column(name = "pp_id")
+    private Long ppId;
+
+    /**
+     * products的主键
+     */
+    @Id
+    @Column(name = "pr_id")
+    private Long id;
+
+    /**
+     * 产品编号
+     * (b2b)code -> (b2c)prodNum
+     */
+    @Column(name = "pr_code")
+    private String prodNum;
+
+    /**
+     * 产品规格
+     */
+    @Column(name = "pr_spec", length = 500)
+    private String spec;
+
+    /**
+     * 单位
+     */
+    @Column(name = "pr_unit")
+    private String unit;
+
+    /**
+     * 所属企业UU
+     */
+    @Column(name = "pr_enuu")
+    @EnterpriseUU
+    private Long enUU;
+
+    /**
+     * 个人UU 上传人的UU
+     */
+    @Column(name = "pr_useruu")
+    @UserUU
+    private Long userUU;
+
+    /**
+     * 最小包装量
+     * (b2b)minPack -> (b2c)minPackQty
+     */
+    @Column(name = "pr_minpack")
+    private Double minPackQty;
+
+    /**
+     * 库存数 erp的库存数
+     */
+    @Column(name = "pr_stock")
+    private Double stock;
+
+    /**
+     * ERP空闲库存
+     */
+    @Column(name = "pr_reserve")
+    private Double erpReserve;
+
+    /**
+     * 价格
+     */
+    @Column(name = "pr_price")
+    private Double price;
+
+    /**
+     * 品牌(ERP) 上传时的品牌
+     */
+    @Column(name = "pr_brand")
+    private String brand;
+
+    /**
+     * 原厂型号(erp) 用户上传的型号
+     * @return
+     */
+    @Column(name = "pr_cmpcode", length = 1000)
+    private String cmpCode;
+
+    /**
+     * 产品名称
+     * (b2b)title -> (b2c)prodName
+     */
+    @Column(name = "pr_title")
+    private String prodName;
+
+    /**
+     * 买方ERP物料ID
+     */
+    @Column(name = "pr_sourceid")
+    private Long sourceId;
+
+    /**
+     * 保存erp传入数据的时间
+     *
+     * @return
+     */
+    @Column(name = "pr_erpdate")
+    private Date erpDate;
+
+    /**
+     * UUID 标准料号
+     * @return
+     */
+    @Column(name = "pr_cmpuuid")
+    private String cmpUuId;
+
+    /**
+     * 应用来源<br>
+     * 平台上传的为可以销售的
+     * @return
+     */
+    @Column(name = "pr_sourceapp")
+    private String sourceApp;
+
+
+    /**
+     * 类目(平台)(中文)
+     */
+    @Column(name = "pr_kind")
+    private String kind;
+
+    /**
+     * 类目(平台)(英文)
+     */
+    @Column(name = "pr_kinden")
+    private String kinden;
+
+    /**
+     * 类目的id
+     */
+    @Column(name = "pr_kindid")
+    private Long kindid;
+
+    /**
+     * 品牌(平台)(中文)
+     */
+    @Column(name = "pr_pbrand")
+    private String pbrand;
+
+    /**
+     * 品牌(平台)(英文)
+     */
+    @Column(name = "pr_pbranden")
+    private String pbranden;
+
+    /**
+     * 品牌(平台)id
+     */
+    @Column(name = "pr_pbrandid")
+    private Long pbrandid;
+
+    /**
+     * 品牌(平台)(uuid)
+     */
+    @Column(name = "pr_pbranduuid")
+    private String pbranduuid;
+
+    /**
+     * 型号(平台)
+     */
+    @Column(name = "pr_pcmpcode")
+    private String pcmpcode;
+    /**
+     * 是否是标准物料<br>
+     * 1.YES<br>
+     * 0.NO
+     */
+    @Column(name = "pr_standard")
+    private Integer standard;
+
+    /**
+     * 对应Goods是否已在售
+     * 1.YES<br>
+     * 0.NO
+     */
+    @Column(name = "pr_sold")
+    private Integer sold;
+
+    /**
+     * 是否可上架,是否有对应的Good信息
+     * 1.YES<br>
+     * 0.NO
+     */
+    @Column(name = "pr_can_sell")
+    private Integer canSell;
+
+    /**
+     * 匹配状态(记录匹配状态,方便下次查看)
+     * 111 匹配成功 ->变为标准
+     * 101 匹配之后没有更新,会存在多条数据
+     */
+    @Column(name = "pr_matchstatus")
+    private Integer matchstatus;
+
+    /**
+     * 匹配数量(用作排序)
+     */
+    @Column(name = "pr_matchsize")
+    private Integer matchsize;
+
+    /**
+     * 匹配结果
+     */
+    @OneToMany(mappedBy = "product", cascade = { CascadeType.REFRESH }, fetch = FetchType.EAGER)
+    private Set<ProductMatchResult> matchresults;
+
+    /**
+     * 封装
+     */
+    @Column(name = "pr_encapsulation")
+    private String encapsulation;
+
+    /**
+     * 包装:托盘、管装、卷带
+     */
+    @Column(name = "pr_packaging")
+    private String packaging;
+
+    /**
+     * 产品生产日期
+     */
+    @Column(name = "pr_manufacturedate")
+    private String produceDate;
+
+    /**
+     * 企业的币别信息
+     */
+    @Column(name = "pr_currency")
+    private String currency;
+
+    /**
+     * 在售数量
+     */
+    @Column(name = "pro_onsale")
+    private Double onSaleQty;
+
+    /**
+     * 锁库数
+     */
+    @Column(name = "pr_lockqty")
+    private Double lockQty;
+
+    /**
+     * 可上架数量
+     */
+    @Column(name = "pr_availableonsale")
+    private Double availableOnSale;
+
+    /**
+     * 仓库数量
+     */
+    @Column(name = "pr_repositoryqty")
+    private Double repositoryQty;
+
+    /**
+     * 器件的图片
+     */
+    @Column(name = "pr_comimg")
+    private String cmpImg;
+
+    /**
+     * b2c是否启用
+     * 1 启用,
+     * 0 未启用
+     */
+    @Column(name = "pr_b2cenabled")
+    private Integer b2cEnabled;
+
+    /**
+     * 产品建立时间
+     */
+    @Column(name = "pr_create_time")
+    private Date createTime;
+
+    /**
+     * 转成标准的时间
+     */
+    @Column(name = "pr_tostandard")
+    private Date tostandard;
+
+    /**
+     * b2c更新后下载状态
+     * DOWNLOADED(203, "已下载")
+     * NOT_UPLOAD(202, "待下载")
+     */
+    @Column(name = "pr_b2cdownstatus")
+    private Integer b2cDownStatus;
+
+    /**
+     * 针对erp的物料交易信息
+     */
+    @Transient
+    private ProductDetail productDetail;
+
+    /**
+     * goods表信息中存在多少条数据
+     */
+    @Column(name = "pr_batchcount")
+    private Integer batchCount;
+
+    /**
+     * 关联表的uu
+     */
+    @Column(name = "user_uu")
+    private Long ppUserUU;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getProdNum() {
+        return prodNum;
+    }
+
+    public void setProdNum(String prodNum) {
+        this.prodNum = prodNum;
+    }
+
+    public String getSpec() {
+        return spec;
+    }
+
+    public void setSpec(String spec) {
+        this.spec = spec;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public Long getEnUU() {
+        return enUU;
+    }
+
+    public void setEnUU(Long enUU) {
+        this.enUU = enUU;
+    }
+
+    public Long getUserUU() {
+        return userUU;
+    }
+
+    public void setUserUU(Long userUU) {
+        this.userUU = userUU;
+    }
+
+    public Double getMinPackQty() {
+        return minPackQty;
+    }
+
+    public void setMinPackQty(Double minPackQty) {
+        this.minPackQty = minPackQty;
+    }
+
+    public Double getStock() {
+        return stock;
+    }
+
+    public void setStock(Double stock) {
+        this.stock = stock;
+    }
+
+    public Double getErpReserve() {
+        return erpReserve;
+    }
+
+    public void setErpReserve(Double erpReserve) {
+        this.erpReserve = erpReserve;
+    }
+
+    public Double getPrice() {
+        return price;
+    }
+
+    public void setPrice(Double price) {
+        this.price = price;
+    }
+
+    public String getBrand() {
+        return brand;
+    }
+
+    public void setBrand(String brand) {
+        this.brand = brand;
+    }
+
+    public String getCmpCode() {
+        return cmpCode;
+    }
+
+    public void setCmpCode(String cmpCode) {
+        this.cmpCode = cmpCode;
+    }
+
+    public String getProdName() {
+        return prodName;
+    }
+
+    public void setProdName(String prodName) {
+        this.prodName = prodName;
+    }
+
+    public Long getSourceId() {
+        return sourceId;
+    }
+
+    public void setSourceId(Long sourceId) {
+        this.sourceId = sourceId;
+    }
+
+    public Date getErpDate() {
+        return erpDate;
+    }
+
+    public void setErpDate(Date erpDate) {
+        this.erpDate = erpDate;
+    }
+
+    public String getCmpUuId() {
+        return cmpUuId;
+    }
+
+    public void setCmpUuId(String cmpUuId) {
+        this.cmpUuId = cmpUuId;
+    }
+
+    public String getSourceApp() {
+        return sourceApp;
+    }
+
+    public void setSourceApp(String sourceApp) {
+        this.sourceApp = sourceApp;
+    }
+
+    public String getKind() {
+        return kind;
+    }
+
+    public void setKind(String kind) {
+        this.kind = kind;
+    }
+
+    public String getKinden() {
+        return kinden;
+    }
+
+    public void setKinden(String kinden) {
+        this.kinden = kinden;
+    }
+
+    public Long getKindid() {
+        return kindid;
+    }
+
+    public void setKindid(Long kindid) {
+        this.kindid = kindid;
+    }
+
+    public String getPbrand() {
+        return pbrand;
+    }
+
+    public void setPbrand(String pbrand) {
+        this.pbrand = pbrand;
+    }
+
+    public String getPbranden() {
+        return pbranden;
+    }
+
+    public void setPbranden(String pbranden) {
+        this.pbranden = pbranden;
+    }
+
+    public Long getPbrandid() {
+        return pbrandid;
+    }
+
+    public void setPbrandid(Long pbrandid) {
+        this.pbrandid = pbrandid;
+    }
+
+    public String getPbranduuid() {
+        return pbranduuid;
+    }
+
+    public void setPbranduuid(String pbranduuid) {
+        this.pbranduuid = pbranduuid;
+    }
+
+    public String getPcmpcode() {
+        return pcmpcode;
+    }
+
+    public void setPcmpcode(String pcmpcode) {
+        this.pcmpcode = pcmpcode;
+    }
+
+    public Integer getStandard() {
+        return standard;
+    }
+
+    public void setStandard(Integer standard) {
+        this.standard = standard;
+    }
+
+    public Integer getSold() {
+        return sold;
+    }
+
+    public void setSold(Integer sold) {
+        this.sold = sold;
+    }
+
+    public Integer getCanSell() {
+        return canSell;
+    }
+
+    public void setCanSell(Integer canSell) {
+        this.canSell = canSell;
+    }
+
+    public Integer getMatchstatus() {
+        return matchstatus;
+    }
+
+    public void setMatchstatus(Integer matchstatus) {
+        this.matchstatus = matchstatus;
+    }
+
+    public Integer getMatchsize() {
+        return matchsize;
+    }
+
+    public void setMatchsize(Integer matchsize) {
+        this.matchsize = matchsize;
+    }
+
+    public Set<ProductMatchResult> getMatchresults() {
+        return matchresults;
+    }
+
+    public void setMatchresults(Set<ProductMatchResult> matchresults) {
+        this.matchresults = matchresults;
+    }
+
+    public String getEncapsulation() {
+        return encapsulation;
+    }
+
+    public void setEncapsulation(String encapsulation) {
+        this.encapsulation = encapsulation;
+    }
+
+    public String getPackaging() {
+        return packaging;
+    }
+
+    public void setPackaging(String packaging) {
+        this.packaging = packaging;
+    }
+
+    public String getProduceDate() {
+        return produceDate;
+    }
+
+    public void setProduceDate(String produceDate) {
+        this.produceDate = produceDate;
+    }
+
+    public String getCurrency() {
+        return currency;
+    }
+
+    public void setCurrency(String currency) {
+        this.currency = currency;
+    }
+
+    public Double getOnSaleQty() {
+        return onSaleQty;
+    }
+
+    public void setOnSaleQty(Double onSaleQty) {
+        this.onSaleQty = onSaleQty;
+    }
+
+    public Double getLockQty() {
+        return lockQty;
+    }
+
+    public void setLockQty(Double lockQty) {
+        this.lockQty = lockQty;
+    }
+
+    public Double getAvailableOnSale() {
+        return availableOnSale;
+    }
+
+    public void setAvailableOnSale(Double availableOnSale) {
+        this.availableOnSale = availableOnSale;
+    }
+
+    public Double getRepositoryQty() {
+        return repositoryQty;
+    }
+
+    public void setRepositoryQty(Double repositoryQty) {
+        this.repositoryQty = repositoryQty;
+    }
+
+    public String getCmpImg() {
+        return cmpImg;
+    }
+
+    public void setCmpImg(String cmpImg) {
+        this.cmpImg = cmpImg;
+    }
+
+    public Integer getB2cEnabled() {
+        return b2cEnabled;
+    }
+
+    public void setB2cEnabled(Integer b2cEnabled) {
+        this.b2cEnabled = b2cEnabled;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getTostandard() {
+        return tostandard;
+    }
+
+    public void setTostandard(Date tostandard) {
+        this.tostandard = tostandard;
+    }
+
+    public Integer getB2cDownStatus() {
+        return b2cDownStatus;
+    }
+
+    public void setB2cDownStatus(Integer b2cDownStatus) {
+        this.b2cDownStatus = b2cDownStatus;
+    }
+
+    public ProductDetail getProductDetail() {
+        return productDetail;
+    }
+
+    public void setProductDetail(ProductDetail productDetail) {
+        this.productDetail = productDetail;
+    }
+
+    public Integer getBatchCount() {
+        return batchCount;
+    }
+
+    public void setBatchCount(Integer batchCount) {
+        this.batchCount = batchCount;
+    }
+
+    public Long getPpUserUU() {
+        return ppUserUU;
+    }
+
+    public void setPpUserUU(Long ppUserUU) {
+        this.ppUserUU = ppUserUU;
+    }
+
+    public Long getPpId() {
+        return ppId;
+    }
+
+    public void setPpId(Long ppId) {
+        this.ppId = ppId;
+    }
+}

+ 47 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/V_ProductPersonId.java

@@ -0,0 +1,47 @@
+package com.uas.platform.b2c.prod.commodity.model;
+
+
+import java.io.Serializable;
+
+public class V_ProductPersonId implements Serializable {
+
+    private Long ppId;
+    private Long id;
+
+    public Long getppId() {
+        return ppId;
+    }
+
+    public void setppId(Long ppId) {
+        this.ppId = ppId;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public V_ProductPersonId() {
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        com.uas.platform.b2c.prod.commodity.model.V_ProductPersonId that = (com.uas.platform.b2c.prod.commodity.model.V_ProductPersonId) o;
+
+        if (ppId != null ? !ppId.equals(that.ppId) : that.ppId != null) return false;
+        return id != null ? id.equals(that.id) : that.id == null;
+    }
+
+    @Override
+    public int hashCode() {
+        int result = ppId != null ? ppId.hashCode() : 0;
+        result = 31 * result + (id != null ? id.hashCode() : 0);
+        return result;
+    }
+}

+ 11 - 4
src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductService.java

@@ -1,10 +1,7 @@
 package com.uas.platform.b2c.prod.commodity.service;
 package com.uas.platform.b2c.prod.commodity.service;
 
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
-import com.uas.platform.b2c.prod.commodity.model.Goods;
-import com.uas.platform.b2c.prod.commodity.model.Product;
-import com.uas.platform.b2c.prod.commodity.model.ProductDetail;
-import com.uas.platform.b2c.prod.commodity.model.ProductStandardPutOnInfo;
+import com.uas.platform.b2c.prod.commodity.model.*;
 import com.uas.platform.b2c.trade.order.model.Purchase;
 import com.uas.platform.b2c.trade.order.model.Purchase;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageInfo;
@@ -29,6 +26,16 @@ public interface ProductService {
      */
      */
     Page<Product> getAllProducts(PageInfo page, String keyword, String type);
     Page<Product> getAllProducts(PageInfo page, String keyword, String type);
 
 
+    /**
+     * 分页获取个人物料资料
+     *
+     * @param page    the page 一页数据
+     * @param keyword the keyword
+     * @param type    the type 标准or非标准
+     * @return all products
+     */
+    Page<V_ProductPerson> getAllProductsByPerson(PageInfo page, String keyword, String type);
+
     /**
     /**
      * 下载产品资料
      * 下载产品资料
      *
      *

+ 66 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java

@@ -137,6 +137,9 @@ public class ProductServiceImpl implements ProductService {
     @Autowired
     @Autowired
     private ProductDetailDao productDetailDao;
     private ProductDetailDao productDetailDao;
 
 
+    @Autowired
+    private V_ProductPersonDao v_productPersonDao;
+
     @Autowired
     @Autowired
     private OrderDetailDao orderDetailDao;
     private OrderDetailDao orderDetailDao;
 
 
@@ -210,6 +213,69 @@ public class ProductServiceImpl implements ProductService {
         return new PageImpl<Product>(productList, page, productPage.getTotalElements());
         return new PageImpl<Product>(productList, page, productPage.getTotalElements());
     }
     }
 
 
+    @Override
+    public Page<V_ProductPerson> getAllProductsByPerson(final PageInfo page, String keyword, String type) {
+        page.expression(PredicateUtils.eq("enUU", SystemSession.getUser().getEnterprise().getUu(), true));
+        page.expression(PredicateUtils.eq("ppUserUU", SystemSession.getUser().getUserUU(), true));
+        if (StringUtils.isEmpty(type)) {
+            type = "nStandard";
+        }
+        if (type.contains("standard")) {
+            page.filter("standard", (short)1);
+            page.filter("b2cEnabled", (short) 1);
+        } else if (type.contains("nStandard")) {
+            page.filter("standard", (short)0);
+            page.filter("b2cEnabled", (short) 1);
+        } else if (type.contains("all")) {
+            SimpleExpression[] arr = new SimpleExpression[2];
+            arr[0] = PredicateUtils.eq("b2cEnabled", (short) 1, false);
+            arr[1] = PredicateUtils.eq("standard", (short) 1, false);
+            LogicalExpression logicalExpression = PredicateUtils.and(arr);
+            SimpleExpression standard = PredicateUtils.eq("standard", (short) 0, false);
+            page.orExpression(standard);
+            page.orExpression(logicalExpression);
+            page.sorting("standard", Sort.Direction.DESC);
+        }
+
+        if (StringUtils.hasText(keyword)) {
+            SimpleExpression code = PredicateUtils.like("prodNum", keyword, true);
+            SimpleExpression kind = PredicateUtils.like("kind", keyword, true);
+            SimpleExpression brandEn = PredicateUtils.like("pbranden", keyword, true);
+            SimpleExpression cmpCode = PredicateUtils.like("pcmpcode", keyword, true);
+            SimpleExpression[] expressions4 = new SimpleExpression[]{code, kind, brandEn, cmpCode};
+            LogicalExpression logicalExpression4 = PredicateUtils.or(expressions4);
+            page.expression(logicalExpression4);
+        }
+
+        Page<V_ProductPerson> productPage = v_productPersonDao.findAll(new Specification<V_ProductPerson>() {
+            @Override
+            public Predicate toPredicate(Root<V_ProductPerson> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
+                query.where(page.getPredicates(root, query, cb));
+                return null;
+            }
+        }, page);
+
+        /*Page<Product> productPage = productDao.findAll(new Specification<Product>() {
+            @Override
+            public Predicate toPredicate(Root<Product> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
+                query.where(page.getPredicates(root, query, cb));
+                return null;
+            }
+        }, page);*/
+
+        List<V_ProductPerson> productList = productPage.getContent();
+        for (V_ProductPerson product : productList) {
+            if ("ERP".equals(product.getSourceApp())) {
+                ProductDetail productDetail = productDetailDao.findByProductId(product.getId());
+                if (productDetail != null) {
+                    product.setProductDetail(productDetail);
+                }
+            }
+        }
+
+        return new PageImpl<V_ProductPerson>(productList, page, productPage.getTotalElements());
+    }
+
     @Override
     @Override
     public List<Goods> getProductsGoods(String type, String keyword) {
     public List<Goods> getProductsGoods(String type, String keyword) {
         final PageInfo page = new PageInfo();
         final PageInfo page = new PageInfo();

+ 8 - 0
src/main/webapp/resources/js/common/query/material.js

@@ -9,6 +9,14 @@ define([ 'ngResource' ], function() {
                     _status : 'all'
                     _status : 'all'
                 }
                 }
             },
             },
+            // 获取全部个人物料信息
+            getAllByPerson: {
+                url: 'trade/products/person',
+                method: 'GET',
+                params: {
+                    _status : 'all'
+                }
+            },
             // 删除
             // 删除
             deleteBatch: {
             deleteBatch: {
                 url: 'trade/products/:ids',
                 url: 'trade/products/:ids',

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialPersonCtrl.js

@@ -1003,7 +1003,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		};
 		};
 
 
 		var loadData = function () {
 		var loadData = function () {
-			Material.getAll($scope.param, function (data) {
+			Material.getAllByPerson($scope.param, function (data) {
 				$scope.materialAll = data;
 				$scope.materialAll = data;
 				$scope.currenctMaterial = data.content;
 				$scope.currenctMaterial = data.content;
 				updateTagCount();
 				updateTagCount();