Browse Source

Merge branch 'dev-mysql' into feature/hb-brandMaintenceSuperBackground-1127

wangyc 8 years ago
parent
commit
dd1dea5a4e
21 changed files with 856 additions and 264 deletions
  1. 3 2
      src/main/java/com/uas/platform/b2c/prod/commodity/constant/ErrorInfoConstant.java
  2. 39 0
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductController.java
  3. 2 2
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/ReleaseProductByBatchController.java
  4. 27 0
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/MatchModelDao.java
  5. 9 1
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductDao.java
  6. 8 0
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/V_ProductPrivateDao.java
  7. 1 0
      src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java
  8. 102 0
      src/main/java/com/uas/platform/b2c/prod/commodity/model/MatchModel.java
  9. 5 3
      src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java
  10. 22 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductService.java
  11. 1 1
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ReleaseProductByBatchService.java
  12. 18 37
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java
  13. 157 46
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java
  14. 55 9
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java
  15. 23 5
      src/main/java/com/uas/platform/b2c/prod/store/api/CommodityController.java
  16. BIN
      src/main/resources/jxls-tpl/trade/products.xls
  17. 16 0
      src/main/webapp/resources/js/common/query/material.js
  18. 138 51
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js
  19. 56 50
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_upload_ctrl.js
  20. 160 56
      src/main/webapp/resources/view/vendor/forstore/vendor_material.html
  21. 14 1
      src/main/webapp/resources/view/vendor/forstore/vendor_upload.html

+ 3 - 2
src/main/java/com/uas/platform/b2c/prod/commodity/constant/ErrorInfoConstant.java

@@ -6,7 +6,7 @@ package com.uas.platform.b2c.prod.commodity.constant;
  * @author hulh
  */
 public enum  ErrorInfoConstant {
-    REPEAT_INFO("产品库已存在产品"),
+    REPEAT_INFO("产品库已存在相同的产品"),
     CODE_PATTERN_INFO("A列:请勿输入中文或中文特殊字符"),
     CODE_LENGTH_INFO("A列:产品型号不能超过100字符"),
     CODE_EMPTY_INFO("A列:产品型号不能为空"),
@@ -22,7 +22,8 @@ public enum  ErrorInfoConstant {
     DELIVERY_EMPTY_INFO("G-H列:存在交期的信息为空"),
     DELIVERY_VALUE_INFO("G-H列:交期只能填写1-31之间的整数值"),
     PRICE_INFO("K列:单价必须是小于1万的正数"),
-    MIN_PACKAGE_INFO("I列:最小包数量包含非数字字符");
+    MIN_PACKAGE_INFO("I列:最小包数量包含非数字字符"),
+    REPEAT_IN_EXCEL("表格中已存在相同的产品");
 
     /**
      * 错误提示

+ 39 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductController.java

@@ -2,6 +2,7 @@ package com.uas.platform.b2c.prod.commodity.controller;
 
 import com.alibaba.fastjson.JSONObject;
 import com.uas.platform.b2c.core.constant.SplitChar;
+import com.uas.platform.b2c.core.support.SystemSession;
 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.model.*;
@@ -127,6 +128,21 @@ public class ProductController {
 		return modelAndView;
 	}
 
+	/**
+	 * 根据选中的id列表导出数据
+	 *
+	 * @param idList	id列表
+	 * @return
+	 */
+	@RequestMapping(value = "/template/selected/data", method = RequestMethod.GET)
+	public ModelAndView exportSelectedProduct(String idList) {
+		ModelAndView modelAndView = new ModelAndView();
+		List<Goods> productsGoods = productService.getSelectedProducts(idList);
+		modelAndView.addObject("data", productsGoods);
+		modelAndView.addObject("goodsService", goodsService);
+		modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/trade/products", "优软商城--产品库列表"));
+		return modelAndView;
+	}
 
     /**
      * 批量删除产品
@@ -253,6 +269,29 @@ public class ProductController {
 		return productService.matchNonStandardProduct();
 	}
 
+	/**
+	 * 匹配选中的列表
+	 * @param idList
+	 * @return
+	 */
+	@RequestMapping(value = "/match/selected", method = RequestMethod.POST)
+	public ResultMap matchSelected(@RequestBody List<Long> idList) {
+		Long enuu = SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null;
+		logger.info("选中的产品进行匹配,enuu " + enuu);
+		return productService.matchSelected(idList);
+	}
+
+	/**
+	 * 根据批次号获取未匹配成功的非标数据
+	 * @param batch
+	 * @return
+	 */
+	@RequestMapping(value = "/match/batch", method = RequestMethod.GET)
+	public List<Product> getDataByBatch(String batch) {
+		logger.info("获取指定批次的非标数据,批次 " + batch);
+		return productService.getDataByBatch(batch);
+	}
+
 	/**
 	 * 保存匹配的信息,非标上架版本
 	 * @param json

+ 2 - 2
src/main/java/com/uas/platform/b2c/prod/commodity/controller/ReleaseProductByBatchController.java

@@ -203,7 +203,7 @@ public class ReleaseProductByBatchController {
      * @return model map
      */
     @RequestMapping(value = "/release/excel", method = RequestMethod.POST)
-    public ModelMap releaseByExcel(FileUpload uploadItem, @RequestParam("selfSale") Boolean selfSale, String currency, Integer isPerson) {
+    public ModelMap releaseByExcel(FileUpload uploadItem, @RequestParam("selfSale") Boolean selfSale, String currency, Integer isPerson, Integer repeatImport) {
         ModelMap map = new ModelMap();
         String fileName = uploadItem.getFile().getOriginalFilename();
         String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
@@ -218,7 +218,7 @@ public class ReleaseProductByBatchController {
             } else {
                 throw new IllegalOperatorException("文件格式不正确!请上传.xls或.xlsx格式的文件");
             }
-            map = releaseProductByBatchService.releaseByWorkbook(workbook, selfSale, currency, isPerson);
+            map = releaseProductByBatchService.releaseByWorkbook(workbook, selfSale, currency, isPerson, repeatImport);
         } catch (IOException e) {
             e.printStackTrace();
         }

+ 27 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/dao/MatchModelDao.java

@@ -0,0 +1,27 @@
+package com.uas.platform.b2c.prod.commodity.dao;
+
+import com.uas.platform.b2c.prod.commodity.model.MatchModel;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * 匹配结果类操作层
+ * @author hulh
+ */
+@Repository
+public interface MatchModelDao extends JpaRepository<MatchModel, Long>, JpaSpecificationExecutor<MatchModel> {
+
+    /**
+     * 根据以下信息获取产品id列表
+     * @param batch
+     * @param standard
+     * @return
+     */
+    @Query(value = "select productId from MatchModel where batch = :batch and standard = :standard")
+    List<Long> findNonProductByBatch(@Param("batch") String batch, @Param("standard") Short standard);
+}

+ 9 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductDao.java

@@ -55,7 +55,7 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
      * @return count by enuu and status
      */
     @Query(value = "select count(1) from products p left join product$private pp on pp.pr_id = p.pr_id where " +
-            "p.pr_enuu=:enuu and p.pr_standard = :standard and pp.pr_b2cenabled = :enabled", nativeQuery = true)
+            "p.pr_enuu=:enuu and p.pr_pcmpcode is not null and p.pr_pbranden is not null and p.pr_standard = :standard and pp.pr_b2cenabled = :enabled", nativeQuery = true)
     Integer getCountByEnuuAndStatusAndEnabled(@Param("enuu") Long enuu, @Param("standard") Short standard, @Param("enabled") Integer enabled);
 
     /**
@@ -160,4 +160,12 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
     @Query(value = "select p from Product p where p.id in (:ids) order by p.id desc")
     List<Product> findProductInIds(@Param("ids") List<Long> ids);
 
+    /**
+     * 获取指定id列表的产品
+     * @param idList
+     * @return
+     */
+    @Query(value = "select p from Product p where id in :idList")
+    List<Product> findProductInId(@Param("idList") List<Long> idList);
+
 }

+ 8 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/dao/V_ProductPrivateDao.java

@@ -24,4 +24,12 @@ public interface V_ProductPrivateDao extends JpaRepository<V_ProductPrivate, Lon
     @Query(value = "select p from V_ProductPrivate p where p.pcmpcode=:pcmpcode and p.pbranden=:pbranden and p.enUU=:enUU and p.standard=:standard and p.b2cEnabled=:enabled")
     List<V_ProductPrivate> findProductByPcmpcodeAndPbrandenAndEnUUAndStandard(@Param("pcmpcode") String pcmpcode, @Param("pbranden") String pbranden,
                                                                               @Param("enUU") Long enUU, @Param("standard") Integer standard, @Param("enabled") Integer enabled);
+
+    /**
+     * 获取指定id列表的产品
+     * @param idList
+     * @return
+     */
+    @Query(value = "select p from V_ProductPrivate p where id in :idList")
+    List<V_ProductPrivate> findProductInId(@Param("idList") List<Long> idList);
 }

+ 1 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java

@@ -1572,6 +1572,7 @@ public class Goods implements Serializable {
 		g.setCode(product.getPcmpcode());
 		g.setEncapsulation(product.getEncapsulation());
 		g.setPackaging(product.getPackaging());
+		g.setProduceDate(product.getProduceDate());
 		g.setUuid(product.getCmpUuId());
 		return g;
 	}

+ 102 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/MatchModel.java

@@ -0,0 +1,102 @@
+package com.uas.platform.b2c.prod.commodity.model;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ * 记录勾选匹配的id
+ * @author hulh
+ */
+@Entity
+@Table(name = "product$match")
+public class MatchModel {
+
+    /**
+     * 主键
+     */
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    private Long id;
+
+    /**
+     * 批次号,唯一标识
+     */
+    @Column(name = "ma_batch")
+    private String batch;
+
+    /**
+     * uu
+     */
+    @Column(name = "ma_useruu")
+    private Long useruu;
+
+    /**
+     * 企业enuu
+     */
+    @Column(name = "ma_enuu")
+    private Long enuu;
+
+    /**
+     * 对应的产品id
+     */
+    @Column(name = "ma_product_id")
+    private Long productId;
+
+    /**
+     * 匹配后结果
+     */
+    @Column(name = "ma_standard")
+    private Short standard;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getBatch() {
+        return batch;
+    }
+
+    public void setBatch(String batch) {
+        this.batch = batch;
+    }
+
+    public Long getUseruu() {
+        return useruu;
+    }
+
+    public void setUseruu(Long useruu) {
+        this.useruu = useruu;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public Long getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Long productId) {
+        this.productId = productId;
+    }
+
+    public Short getStandard() {
+        return standard;
+    }
+
+    public void setStandard(Short standard) {
+        this.standard = standard;
+    }
+}

+ 5 - 3
src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java

@@ -473,6 +473,8 @@ public class ReleaseProductByBatch implements Serializable {
 	@Column(name = "rel_storename")
 	private String storeName;
 
+//	private Short repeat;
+
 	@Override
 	public boolean equals(Object o) {
 		if (this == o) return true;
@@ -487,9 +489,9 @@ public class ReleaseProductByBatch implements Serializable {
 		if (!minPackageStr.equals(that.minPackageStr)) return false;
 		if (!packaging.equals(that.packaging)) return false;
 		if (!selfMaxDeliveryStr.equals(that.selfMaxDeliveryStr)) return false;
-		if (!selfMinDeliveryStr.equals(that.selfMinDeliveryStr)) return false;
-		return GoodsUtil.compareWithQtyPrice(prices, that.getPrices(), that.getCurrency());
-
+//		if (!selfMinDeliveryStr.equals(that.selfMinDeliveryStr)) return false;
+//		return GoodsUtil.compareWithQtyPrice(prices, that.getPrices(), that.getCurrency());
+		return selfMinDeliveryStr.equals(that.selfMinDeliveryStr);
 	}
 
 	public void setBrandEnByExcel(Object value) {

+ 22 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductService.java

@@ -45,6 +45,14 @@ public interface ProductService {
      */
     List<Goods> getProductsGoods(String type, String keyword);
 
+    /**
+     * 根据id字符串获取对应的产品列表
+     *
+     * @param idList
+     * @return  List<Goods>
+     */
+    List<Goods> getSelectedProducts(String idList);
+
     /**
      * 批量删除产品
      *
@@ -140,6 +148,20 @@ public interface ProductService {
      */
     ResultMap matchNonStandardProduct();
 
+    /**
+     * 匹配选中的列表
+     * @param idList
+     * @return
+     */
+    ResultMap matchSelected(List<Long> idList);
+
+    /**
+     * 获取该批次的非标数据
+     * @param batch 批次号
+     * @return
+     */
+    List<Product> getDataByBatch(String batch);
+
     /**
      * 保存匹配信息
      * @param json

+ 1 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/service/ReleaseProductByBatchService.java

@@ -33,7 +33,7 @@ public interface ReleaseProductByBatchService {
      * @param currency
      * @return model map
      */
-    public ModelMap releaseByWorkbook(Workbook workbook, Boolean selfSale, String currency, Integer isPerson);
+    public ModelMap releaseByWorkbook(Workbook workbook, Boolean selfSale, String currency, Integer isPerson, Integer repeatImport);
 
     /**
      * 根据发布者UU获取一组产品的信息

+ 18 - 37
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java

@@ -724,7 +724,7 @@ public class GoodsServiceImpl implements GoodsService {
         goodsHistoryDao.save(goodsHistory);
         // TODO huxz 添加或修改商品价格信息
         if (goods.getUuid() != null) {
-            saveOrUpdatePriceInfos(goods, deviceInfo);
+//            saveOrUpdatePriceInfos(goods, deviceInfo);
             updateComponentTradeInfos(goods.getUuid());
         }
         return backGoods;
@@ -3159,35 +3159,24 @@ public class GoodsServiceImpl implements GoodsService {
      */
     @Override
     public ResultMap getDeleteProductMessage(Long productid) {
-        if(productid == null) {
-            throw new IllegalOperatorException
-                    ("传入的信息为空");
+        if (productid == null) {
+            throw new IllegalOperatorException("传入的信息为空");
         }
-        Integer homeCount = 0, recommentCount =
-                0, onSaleCount = 0;
+        Integer homeCount = 0, recommentCount = 0, onSaleCount = 0;
         List<Goods> goodsList = goodsDao.findByProductId(productid);
         for (Goods goods : goodsList) {
             List<OrderDetail> orderDetails = orderDetailDao.findByBatchCode
                     (goods.getBatchCode());
             for (OrderDetail orderDetail : orderDetails) {
                 Order order = orderDetail.getOrder();
-                if((order.getStatus().intValue()
-                 != Status.TOBECONFIRMED.value
-                        ()) && (
-                        OrderStatus.UNAVAILABLE
-                                .getCodes()
-                                .indexOf(order.getStatus
-                                        ()
-                                        .intValue())) > -1) {
-                    return new ResultMap
-                            (CodeType
-                                    .NOT_PERMIT, "已存在订单信息,不能删除");
+                if((order.getStatus() != Status.TOBECONFIRMED.value())
+                        && (OrderStatus.UNAVAILABLE.getCodes().indexOf(order.getStatus())) > -1) {
+                    return new ResultMap(CodeType.NOT_PERMIT, "已存在订单信息,不能删除");
                 }
             }
 
-            JSONObject jsonObject = floorsService.isInHome(goods
-                    .getBatchCode());
-            if(jsonObject != null) {
+            JSONObject jsonObject = floorsService.isInHome(goods.getBatchCode());
+            if (jsonObject != null) {
                 homeCount ++;
             }
 
@@ -3200,29 +3189,21 @@ public class GoodsServiceImpl implements GoodsService {
                     recommentCount++;
                 }
             }
-            int status = goods.getStatus()
-                    .intValue();
-            if( status ==
-                    Status.AVAILABLE.value() ||
-                    status == Status
-                            .UNAVAILABLE.value()) {
+            int status = goods.getStatus();
+            if ( status == Status.AVAILABLE.value() ||
+                    status == Status.UNAVAILABLE.value()) {
                 onSaleCount ++;
             }
 
         }
-        if(homeCount != 0) {
-            return new ResultMap(CodeType
-                    .OK, "存在被推荐到商城首页的信息");
+        if (homeCount != 0) {
+            return new ResultMap(CodeType.OK, "存在被推荐到商城首页的信息");
         }
-        if(recommentCount != 0) {
-            return new ResultMap
-                    (CodeType.OK,
-                            "存在已被推荐到店铺首页的信息");
+        if (recommentCount != 0) {
+            return new ResultMap(CodeType.OK, "存在已被推荐到店铺首页的信息");
         }
-        if(onSaleCount != 0) {
-            return new ResultMap
-                    (CodeType.OK,
-                            "存在已上架信息");
+        if (onSaleCount != 0) {
+            return new ResultMap(CodeType.OK, "存在已上架信息");
         }
 
         return ResultMap.success(null);

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

@@ -3,12 +3,14 @@ package com.uas.platform.b2c.prod.commodity.service.impl;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.uas.platform.b2c.advertise.ad.service.RecommendProductService;
+import com.uas.platform.b2c.common.account.model.Enterprise;
 import com.uas.platform.b2c.common.account.service.EnterpriseService;
 import com.uas.platform.b2c.core.config.SysConf;
 import com.uas.platform.b2c.core.constant.IntegerConstant;
 import com.uas.platform.b2c.core.constant.ShortConstant;
 import com.uas.platform.b2c.core.constant.SplitChar;
 import com.uas.platform.b2c.core.constant.Status;
+import com.uas.platform.b2c.core.constant.SplitChar;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.core.utils.NumberUtil;
@@ -21,6 +23,7 @@ import com.uas.platform.b2c.prod.commodity.type.ProductConstant;
 import com.uas.platform.b2c.prod.commodity.util.GoodsUtil;
 import com.uas.platform.b2c.prod.product.brand.dao.BrandDao;
 import com.uas.platform.b2c.prod.product.brand.modal.Brand;
+import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentDao;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentSubmitDao;
 import com.uas.platform.b2c.prod.product.component.modal.Component;
@@ -187,6 +190,12 @@ public class ProductServiceImpl implements ProductService {
     @Autowired
     private UASBatchPutOnPropertyService uasBatchPutOnPropertyService;
 
+    @Autowired
+    private CreateNumberService createNumberService;
+
+    @Autowired
+    private MatchModelDao matchModelDao;
+
     @Value("#{sys.productServiceIp}")
     private String productServiceIp;
 
@@ -326,23 +335,19 @@ public class ProductServiceImpl implements ProductService {
         page.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
         page.filter("b2cEnabled", com.uas.platform.b2c.prod.commodity.constant.IntegerConstant.YES_INT);
         page.sorting(Sort.Direction.DESC, "standard", "id");
-        //产品部要求导出是非标和标准全部导出,先注释这条代码
-//        if(StringUtils.isEmpty(type)) {
-//            type = "all";
-//        }
-//        if(type.contains("standard")) {
-//            page.filter("standard", (short)1);
-//        }else if(type.contains("nStandard")){
-//            page.filter("standard", (short)0);
-//        }
-//        if(StringUtils.hasText(keyword)) {
-//            SimpleExpression code = PredicateUtils.like("kind", keyword, true);
-//            SimpleExpression brandEn = PredicateUtils.like("pbranden", keyword, true);
-//            SimpleExpression cmpCode = PredicateUtils.like("pcmpcode", keyword, true);
-//            SimpleExpression[] expressions2 = new SimpleExpression[] {code, brandEn, cmpCode};
-//            LogicalExpression logicalExpression2 = PredicateUtils.or(expressions2);
-//            page.expression(logicalExpression2);
-//        }
+        if (type.contains("standard")) {
+            page.filter("standard", IntegerConstant.YES_SHORT);
+        } else if (type.contains("nStandard")) {
+            page.filter("standard", IntegerConstant.NO_SHORT);
+        }
+        if (StringUtils.hasText(keyword)) {
+            SimpleExpression code = PredicateUtils.like("kind", keyword, true);
+            SimpleExpression brandEn = PredicateUtils.like("pbranden", keyword, true);
+            SimpleExpression cmpCode = PredicateUtils.like("pcmpcode", keyword, true);
+            SimpleExpression[] expressions2 = new SimpleExpression[] {code, brandEn, cmpCode};
+            LogicalExpression logicalExpression2 = PredicateUtils.or(expressions2);
+            page.expression(logicalExpression2);
+        }
         products = v_productPrivateDao.findAll(new Specification<V_ProductPrivate>() {
             @Override
             public Predicate toPredicate(Root<V_ProductPrivate> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
@@ -350,17 +355,38 @@ public class ProductServiceImpl implements ProductService {
             return null;
             }
         }, page.getSort());
-        List<Goods> goodses = new ArrayList<>();
-        for (V_ProductPrivate product : products) {
-            List<Goods> goodses1 = goodsDao.findByProductIdOrderByGoodsId(product.getId());
-            if (goodses1.size() > 0) {
-                goodses.addAll(goodses1);
+
+        return exportGoodsByProduct(products);
+    }
+
+    /**
+     * 将获取的product转化为goods信息导出
+     * @param   productList 产品列表
+     * @return  List<Goods>
+     */
+    private List<Goods> exportGoodsByProduct(List<V_ProductPrivate> productList) {
+        List<Goods> resultList = new ArrayList<>();
+        for (V_ProductPrivate product : productList) {
+            List<Goods> goodsList = goodsDao.findByProductIdOrderByGoodsId(product.getId());
+            if (!CollectionUtils.isEmpty(goodsList)) {
+                resultList.addAll(goodsList);
             } else {
                 Goods g = Goods.productConvertGoods(product);
-                goodses.add(g);
+                resultList.add(g);
             }
         }
-        return goodses;
+        return resultList;
+    }
+
+    @Override
+    public List<Goods> getSelectedProducts(String idList) {
+        String[] idArray = idList.split(SplitChar.COMMA);
+        List<Long> longList = new ArrayList<>();
+        for (String id : idArray) {
+            longList.add(Long.valueOf(id));
+        }
+        List<V_ProductPrivate> productList = v_productPrivateDao.findProductInId(longList);
+        return exportGoodsByProduct(productList);
     }
 
     @Override
@@ -443,9 +469,9 @@ public class ProductServiceImpl implements ProductService {
         Integer success = 0;
         Integer isHave = 0;
         Long uu = SystemSession.getUser().getEnterprise().getUu();
-        if(ProductConstant.STANDARD.equals(type)) {
+        if (ProductConstant.STANDARD.equals(type)) {
             standard = IntegerConstant.YES_SHORT;
-        }else {
+        } else {
             standard = IntegerConstant.NO_SHORT;
         }
         List<Product> products = productDao.findProductByEnuuAndStandard(uu, standard);
@@ -474,7 +500,7 @@ public class ProductServiceImpl implements ProductService {
                     for (OrderDetail detail : orderList) {
                         Order order = detail.getOrder();
                         Integer status = order.getStatus() == null ? detail.getStatus() : order.getStatus();
-                        if(codes.indexOf(String.valueOf(status)) < 0) {
+                        if (!codes.contains(String.valueOf(status))) {
                             //防止虚拟单据
                             if (StringUtils.isEmpty(order.getOrderids())) {
                                 isExistOrder = true;
@@ -483,12 +509,12 @@ public class ProductServiceImpl implements ProductService {
 
                         }
                     }
-                    if(isExistOrder) {
+                    if (isExistOrder) {
                         break;
                     }
                 }
-                if(!isExistOrder) {
-                    //删除外键关联的匹配结果列表,不然删除product失败
+                if (!isExistOrder) {
+                    // 删除外键关联的匹配结果列表,不然删除product失败
                     Set<ProductMatchResult> productMatchResultSet =  product.getMatchresults();
                     productMatchResultDao.delete(productMatchResultSet);
                     goodsService.deleteGoods(goodses);
@@ -505,7 +531,7 @@ public class ProductServiceImpl implements ProductService {
                     if (!StringUtils.isEmpty(product.getCmpUuId())) {
                         uuids.add(product.getCmpUuId());
                     }
-                }else {
+                } else {
                     fail++;
                 }
             } catch (Exception e) {
@@ -515,17 +541,17 @@ public class ProductServiceImpl implements ProductService {
 
         Integer status = CodeType.OK.code();
         String message = "";
-        if(success != 0) {
+        if (success != 0) {
             message += "成功删除" + success + "条";
         }
-        if(fail != 0) {
+        if (fail != 0) {
             if(success != 0) {
                 message += ",";
             }
             message += "删除失败" + (fail-isHave) + "条,原因:该产品可能已经被其他单据或个人物料库引用,无法删除";
         }
-        //如果是全部都不能删除,才能设置失败的状态码
-        if((products.size() != 0) && (products.size() ==  fail.intValue())) {
+        // 如果是全部都不能删除,才能设置失败的状态码
+        if ((products.size() != 0) && (products.size() ==  fail)) {
             status = CodeType.ERROR_STATE.code();
         }
         for (String uuid : uuids) {
@@ -740,15 +766,7 @@ public class ProductServiceImpl implements ProductService {
         return "success";
     }
 
-    /**
-     * 一键匹配非标产品,并带出该型号匹配的器件信息
-     * @return
-     */
-    @Override
-    public ResultMap matchNonStandardProduct() {
-        Map<String, Object> map = new HashMap<>();
-        final Long uu = SystemSession.getUser().getUserUU();
-        final Long enUU = SystemSession.getUser().getEnterprise().getUu();
+    private ResultMap validateProductStatus(Long enUU) {
         ProductStoreStatus status = productStoreStatusDao.findByEnuu(enUU);
         if (status != null) {
             // 有人正在操作这张单据,不能进行操作
@@ -772,6 +790,23 @@ public class ProductServiceImpl implements ProductService {
             storeStatus.setStatus(Status.RUNNING.value());
             status = productStoreStatusDao.save(storeStatus);
         }
+        return ResultMap.success(status);
+    }
+
+    /**
+     * 一键匹配非标产品,并带出该型号匹配的器件信息
+     * @return
+     */
+    @Override
+    public ResultMap matchNonStandardProduct() {
+        Map<String, Object> map = new HashMap<>();
+        final Long uu = SystemSession.getUser().getUserUU();
+        final Long enUU = SystemSession.getUser().getEnterprise().getUu();
+        ResultMap statusResult = validateProductStatus(enUU);
+        if (statusResult.getCode() != CodeType.OK.code()) {
+            return statusResult;
+        }
+        ProductStoreStatus status = (ProductStoreStatus) statusResult.getData();
 
         int total = productDao.getCountByEnuuAndStatusAndEnabled(enUU, ShortConstant.NO_SHORT, IntegerConstant.YES_SHORT);
         int success = 0;
@@ -802,6 +837,82 @@ public class ProductServiceImpl implements ProductService {
         return ResultMap.success(map);
     }
 
+    @Override
+    public ResultMap matchSelected(List<Long> idList) {
+        Map<String, Object> map = new HashMap<>();
+        Enterprise enterprise = SystemSession.getUser().getEnterprise();
+        Long enUU = enterprise != null ? enterprise.getUu() : null;
+        Long uu = SystemSession.getUser().getUserUU();
+        if (enUU == null) {
+            return new ResultMap(CodeType.NO_INFO, "企业或EnUU信息丢失");
+        }
+        ResultMap statusResult = validateProductStatus(enUU);
+        if (statusResult.getCode() != CodeType.OK.code()) {
+            return statusResult;
+        }
+        ProductStoreStatus status = (ProductStoreStatus) statusResult.getData();
+        String batch = createNumberService.getTimeNumber("product$match", 8);
+        // 保存要匹配的id数据
+        createMatchModel(idList, batch);
+        int success = 0;
+        int fail = 0;
+
+        String sql = "/*#mycat:db_type=master*/ call PRODUCT_MATCHES_SELECT_V1(%s, %s, %s, @out); select @out";
+        final String formatSql = String.format(sql, batch, enUU, uu);
+        success = jdbcTemplate.execute(new StatementCallback<Integer>() {
+            @Override
+            public Integer doInStatement(Statement statement) throws SQLException, DataAccessException {
+                statement.execute(formatSql);
+                ResultSet rs = statement.getResultSet();
+                if (null != rs) {
+                    rs.next();
+                    return rs.getInt(1);
+                }
+                return 0;
+            }
+        });
+        fail = idList.size() - success;
+
+        status.setStatus(Status.FINISH.value());
+        productStoreStatusDao.save(status);
+        map.put("total", idList.size());
+        map.put("fail", fail);
+        map.put("success", success);
+        map.put("batch", batch);
+
+        return ResultMap.success(map);
+    }
+
+    /**
+     * 根据id列表生成匹配信息
+     * @param idList 产品id列表
+     * @param batch 批次号标识
+     */
+    private void createMatchModel(List<Long> idList, String batch) {
+        Long uu = SystemSession.getUser().getUserUU();
+        Long enUU = SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null;
+        List<MatchModel> resultList = new ArrayList<>(idList.size());
+        for (Long id : idList) {
+            MatchModel matchModel = new MatchModel();
+            matchModel.setBatch(batch);
+            matchModel.setProductId(id);
+            matchModel.setUseruu(uu);
+            matchModel.setEnuu(enUU);
+            matchModel.setStandard(ShortConstant.NO_SHORT);
+            resultList.add(matchModel);
+        }
+        matchModelDao.save(resultList);
+    }
+
+    @Override
+    public List<Product> getDataByBatch(String batch) {
+        List<Long> idList = matchModelDao.findNonProductByBatch(batch, ShortConstant.NO_SHORT);
+        if (!CollectionUtils.isEmpty(idList)) {
+            return productDao.findProductInId(idList);
+        }
+        return Collections.emptyList();
+    }
+
     /**
      * 根据标准上架信息 保存对产品包装,包装数量,生产日期的修改
      *
@@ -1142,9 +1253,9 @@ public class ProductServiceImpl implements ProductService {
                         if (productPrivate == null) {
                             productPrivate = new ProductPrivate();
                         }
-                        if(CollectionUtils.isEmpty(products)) {
+                        if (CollectionUtils.isEmpty(products)) {
                             productPrivate.setB2cEnabled(1);
-                        }else {
+                        } else {
                             productPrivate.setB2cEnabled(0);
                             i++;
                         }

+ 55 - 9
src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java

@@ -2,7 +2,6 @@ package com.uas.platform.b2c.prod.commodity.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.uas.platform.b2c.common.account.model.Enterprise;
-import com.uas.platform.b2c.common.account.model.User;
 import com.uas.platform.b2c.common.account.service.EnterpriseService;
 import com.uas.platform.b2c.common.base.dao.CommonDao;
 import com.uas.platform.b2c.core.config.SysConf;
@@ -16,7 +15,11 @@ import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
 import com.uas.platform.b2c.prod.commodity.constant.ErrorInfoConstant;
 import com.uas.platform.b2c.prod.commodity.constant.ShortConstant;
 import com.uas.platform.b2c.prod.commodity.constant.UploadConstant;
-import com.uas.platform.b2c.prod.commodity.dao.*;
+import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
+import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
+import com.uas.platform.b2c.prod.commodity.dao.ProductPersonDao;
+import com.uas.platform.b2c.prod.commodity.dao.ProductPrivateDao;
+import com.uas.platform.b2c.prod.commodity.dao.ReleaseProductByBatchDao;
 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.ReleaseProductByBatchService;
@@ -26,7 +29,6 @@ import com.uas.platform.b2c.prod.store.model.StoreIn;
 import com.uas.platform.b2c.prod.store.model.StoreStatus;
 import com.uas.platform.b2c.prod.store.service.StoreInService;
 import com.uas.platform.b2c.trade.order.StringConstant.Currency;
-import com.uas.platform.b2c.trade.presale.model.Collection;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.persistence.criteria.CriterionExpression;
@@ -123,15 +125,18 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	 * @author hejq
 	 */
 	@Override
-	public ModelMap releaseByWorkbook(Workbook workbook, Boolean selfSale, String currency, Integer isPerson) {
+	public ModelMap releaseByWorkbook(Workbook workbook, Boolean selfSale, String currency, Integer isPerson, Integer repeatImport) {
 		// 是否上传个人物料
 		boolean isAPerson = false;
+		boolean isImport = false;
 		if (null != isPerson && isPerson.intValue() == IntegerConstant.YES_SHORT.intValue()) {
 			isAPerson = true;
 			selfSale = false;
 		}
+		if (null != repeatImport && IntegerConstant.YES_SHORT.equals(repeatImport)) {
+			isImport = true;
+		}
 		ModelMap modelMap = new ModelMap();
-		Set<ReleaseProductByBatch> releaseProductByBatchs = new HashSet<>();
 		// 获取第一个工作表
 		Sheet sheet = workbook.getSheetAt(0);
 		int colNum = sheet.getRow(0).getPhysicalNumberOfCells();
@@ -149,6 +154,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			throw new IllegalOperatorException
 					("您上传的信息超过2000条,请拆分成2000以再在上传");
 		}
+		List<ReleaseProductByBatch> releaseProductByBatchs = new ArrayList<>(rowNum);
 		String batch = createNumberService.getTimeNumber("product$goods", 8, rowNum);
 		StoreIn storeIn = getStoreInfo(selfSale);
 		Row headerRow = sheet.getRow(0);
@@ -191,6 +197,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 								releaseProductByBatch.setTag(null);
 							}
 						}
+						validateRepeatInExcel(releaseProductByBatchs, releaseProductByBatch, isImport);
 					}
 					// 简单验证数据,防止空行保存的情况
 					if (blankNum != 3) {
@@ -204,7 +211,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		Long enUU = SystemSession.getUser().getEnterprise().getUu();
 		List<ReleaseProductByBatch> addList = new ArrayList<>(releaseProductByBatchs.size());
 		addList.addAll(releaseProductByBatchs);
-		resetRepeatData(addList, isAPerson);
+		resetRepeatData(addList, isImport, isAPerson);
 		if (isAPerson) {
 			for (ReleaseProductByBatch releaseProductByBatch : addList) {
 				List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(enUU,releaseProductByBatch.getB2cCode(),
@@ -234,16 +241,49 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		return modelMap;
 	}
 
+	/**
+	 * 验证Excel中数据是否重复
+	 *
+	 * @param 	batchList
+	 * @param 	aBatch
+	 * @param 	isImport
+	 */
+	private void validateRepeatInExcel(List<ReleaseProductByBatch> batchList, ReleaseProductByBatch aBatch, Boolean isImport) {
+		if (CollectionUtils.isEmpty(batchList) || !StringUtils.isEmpty(aBatch.getErrmsg()))
+			return ;
+		for (ReleaseProductByBatch each : batchList) {
+			if (StringUtils.isEmpty(each.getErrmsg()) && each.equals(aBatch)) {
+				if (!isImport) {
+					aBatch.setErrmsg(ErrorInfoConstant.REPEAT_IN_EXCEL.getInfo());
+					aBatch.setReleaseCode(ReleaseStatus.had_exists.value());
+					aBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
+					break;
+				} else {
+					if (GoodsUtil.compareWithQtyPrice(each.getPrices(), aBatch.getPrices(), each.getCurrency())) {
+						aBatch.setErrmsg(ErrorInfoConstant.REPEAT_IN_EXCEL.getInfo());
+						aBatch.setReleaseCode(ReleaseStatus.had_exists.value());
+						aBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
+						break;
+					}
+				}
+			}
+		}
+	}
+
 	/**
 	 * 判断是否重复,重复则重设状态
-	 * @param data
+	 * @param 	data
+	 * @param 	isImport
 	 */
-	private void resetRepeatData(List<ReleaseProductByBatch> data, boolean isAPerson) {
+	private void resetRepeatData(List<ReleaseProductByBatch> data, Boolean isImport, boolean isAPerson) {
 		Long enuu = SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null;
 		if (enuu == null) {
 			throw new IllegalOperatorException("企业enuu丢失");
 		}
 		for (ReleaseProductByBatch each : data) {
+			if (StringUtils.hasText(each.getErrmsg())) {
+				continue;
+			}
 			List<Product> standardList = productDao.findMatchStandard(enuu, each.getBrandNameEn(), each.getCode(), IntegerConstant.YES_SHORT);
 			if (!CollectionUtils.isEmpty(standardList)) {
 				each.setB2cBranden(standardList.get(0).getPbranden());
@@ -256,6 +296,12 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			if (!CollectionUtils.isEmpty(productList)) {
 				List<Goods> goodsList = goodsDao.findRepeatGoodsInProductId(productList.get(0).getId(), each.getProductDate(), each.getPackaging(), each.getMinPackage(), each.getMinBuyQty(), each.getSelfMaxDelivery(), each.getSelfMinDelivery(), each.getUnit());
 				if (!CollectionUtils.isEmpty(goodsList)) {
+					if (!isImport) {
+						each.setErrmsg(ErrorInfoConstant.REPEAT_INFO.getInfo());
+						each.setReleaseCode(ReleaseStatus.had_exists.value());
+						each.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
+						continue;
+					}
 					for (Goods goods1 : goodsList) {
 						if (GoodsUtil.compareWithQtyPrice(each.getPrices(), goods1.getPrices(), each.getCurrency())) {
 							each.setErrmsg(ErrorInfoConstant.REPEAT_INFO.getInfo());
@@ -274,7 +320,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 	 * @param aProduct 单个产品
 	 * @param productSet 产品列表
 	 */
-	private Boolean validateTagInfo(ReleaseProductByBatch aProduct, Set<ReleaseProductByBatch> productSet) {
+	private Boolean validateTagInfo(ReleaseProductByBatch aProduct, List<ReleaseProductByBatch> productSet) {
 		for (ReleaseProductByBatch each : productSet) {
 			if (aProduct.getBrandNameEn().equals(each.getBrandNameEn()) && aProduct.getCode().equals(each.getCode())
 					&& aProduct.getTag().equals(each.getTag())) {

+ 23 - 5
src/main/java/com/uas/platform/b2c/prod/store/api/CommodityController.java

@@ -1,5 +1,6 @@
 package com.uas.platform.b2c.prod.store.api;
 
+import com.alibaba.fastjson.JSON;
 import com.uas.platform.b2c.common.account.model.User;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.prod.commodity.model.Goods;
@@ -10,18 +11,16 @@ import com.uas.platform.b2c.prod.product.kind.model.KindInfo;
 import com.uas.platform.b2c.prod.store.facade.CommodityFacade;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageParams;
+import org.apache.commons.collections.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -60,6 +59,25 @@ public class CommodityController {
 		return goodsService.findGoodsByBatchCode(batchCode);
 	}
 
+	/**
+	 * 根据批次号数组查看产品详情
+	 *
+	 * @param batchCodeList		商品批次号
+	 */
+	@RequestMapping(value = "/detail", method = RequestMethod.POST)
+	public List<Goods> findByBatchCodeList(@RequestBody String batchCodeList) {
+		logger.info(String.format("Find GoodsList by batchCodeList "));
+		List<String> batchCodes = JSON.parseArray(batchCodeList,String.class);
+		List<Goods> goodsList = new ArrayList<>();
+		if (!CollectionUtils.isEmpty(batchCodes)) {
+			for (String batch : batchCodes) {
+				Goods g = goodsService.findGoodsByBatchCode(batch);
+				goodsList.add(g);
+			}
+		}
+		return goodsList;
+	}
+
 	/**
 	 * 根据器件UUID获取器件信息
 	 *

BIN
src/main/resources/jxls-tpl/trade/products.xls


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

@@ -52,6 +52,17 @@ define([ 'ngResource' ], function() {
                 url: 'trade/products/match/nonProduct',
                 method: 'GET'
             },
+            // 多选匹配,非标上架版本
+            matchSelected : {
+                url: 'trade/products/match/selected',
+                method: 'POST'
+            },
+            // 根据批次获取产品列表
+            getDataByBatch : {
+                url: 'trade/products/match/batch',
+                method: 'GET',
+                isArray: true
+            },
             updateProduct : {
                 url: 'trade/products/update',
                 method: 'POST'
@@ -85,6 +96,11 @@ define([ 'ngResource' ], function() {
                 url: 'trade/products/update/goods',
                 method: 'POST'
             },
+            // 导出选择的列表
+            exportSelectedProduct: {
+                url: 'trade/products/template/selected/data',
+                method: 'POST'
+            },
             //批量上架信息
             batchPutOn: {
                 url: 'trade/products/batch',

+ 138 - 51
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js

@@ -230,8 +230,14 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		 * @param isStandard
 		 */
 		$scope.toggleStandard = function (isStandard) {
+			if ($scope.standard_tab == 'matchResult') {
+				$scope.lastMaterial = $scope.currenctMaterial;
+			}
 			$scope.standard_tab = isStandard;
 			$scope.param.keyword = '';
+			if ($scope.chooseAllPage) {
+				$scope.chooseAllPage = false;
+			}
 			if (isStandard == 'standard')
 				$scope.param.type = "standard";
 			if (isStandard == 'unstandard')
@@ -270,21 +276,41 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		};
 
 		// 全选
-		$scope.chooseAll = function () {
-			$scope.isChoosedAll = !$scope.isChoosedAll;
+		$scope.chooseAllItem = function () {
+			$scope.chooseAll = !$scope.chooseAll;
 			angular.forEach($scope.currenctMaterial, function (material) {
-				material.isChoosed = $scope.isChoosedAll;
+				material.isChoosed = $scope.chooseAll;
+			});
+			if (!$scope.chooseAll) {
+				$scope.chooseAllPage = false;
+			}
+		};
+
+		$scope.turnAllPage = function () {
+			if ($scope.chooseAll) {
+				$scope.chooseAllPage = true;
+			}
+		};
+
+		$scope.cancelAllPage = function () {
+			$scope.chooseAllPage = false;
+			$scope.chooseAll = false;
+			angular.forEach($scope.currenctMaterial, function (material) {
+				material.isChoosed = false;
 			});
 		};
 
 		// 检查是否全选
 		var checkChoosedAll = function () {
-			$scope.isChoosedAll = true;
+			$scope.chooseAll = true;
 			angular.forEach($scope.currenctMaterial, function (material) {
 				if (!material.isChoosed) {
-					$scope.isChoosedAll = false;
+					$scope.chooseAll = false;
 				}
 			});
+			if (!$scope.chooseAll) {
+				$scope.chooseAllPage = false;
+			}
 		};
 
 		// 单选
@@ -309,6 +335,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 
 		//获取选中之后的信息
 		$scope.getChoosedInfo = function () {
+			$scope.choosedIds = [];
 			angular.forEach($scope.currenctMaterial, function (material) {
 				if (material.isChoosed) {
 					$scope.choosedIds.push(material.id);
@@ -400,7 +427,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		// 批量删除
 		$scope.deleteBatch = function () {
             $scope.getChoosedInfo();
-            if(!$scope.choosedIds || $scope.choosedIds.length == 0) {
+            if (!$scope.choosedIds || $scope.choosedIds.length == 0) {
                 toaster.pop('warning', '提示','请选择要删除的信息');
                 return ;
             }
@@ -414,19 +441,19 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 
 		// 单个删除
 		$scope.deleteMaterial = function(material) {
-			if(!material || !material.id) {
+			if (!material || !material.id) {
 				return ;
 			}
 			Goods.getDeleteProductMessage({productid: material.id}, function (data) {
 				console.log(data);
-				if(data.code == 1) {
+				if (data.code == 1) {
 					$scope.$$nonProduct.deleteMessage = data.message;
 					$scope.choosedIds = [];
 					$scope.choosedIds.push(material.id);
 					$scope.$$nonProduct.deleteGoods = false;
 					$scope.$$nonProduct.deleteMaterial = true;
 					$scope.opendeleteModal();
-				}else {
+				} else {
 					toaster.pop('warning', '提示', data.message);
 				}
 			}, function (response) {
@@ -453,7 +480,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 						return $scope.$$nonProduct.deleteGoods;
 					},
 					selectAll : function () {
-						return $scope.isChoosedAll;
+						return $scope.chooseAllPage;
 					},
 					standard_tab : function () {
 						return $scope.standard_tab;
@@ -800,48 +827,74 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 		$scope.toggleTab = function (status) {
 			$scope.param.type = 'nStandard';
 			$scope.param.count = $scope.$$nonProduct.count;
-			loadData();
+			if (status == 'matchResult') {
+				$scope.currenctMaterial = $scope.lastMaterial;
+				$scope.materialAll = {};
+			} else {
+				loadData();
+			}
 			$scope.standard_tab = status;
 		};
 
 		$scope.closeResultFrame = function (status) {
 			$scope.standard_tab = status;
 			$scope.resultFrame = false;
+			$scope.param.type = 'nStandard';
+			loadData();
 		};
 
 		$scope.closeTip = function () {
 			$scope.resultTip = false;
 		};
 
+		var loadSelectedData = function () {
+			$scope.materialAll = {};
+			Material.getDataByBatch({batch:$scope.batch}, function (data) {
+				$scope.currenctMaterial = data;
+			});
+		};
+
 		// 一键匹配
 		$scope.matchAll = function () {
-			Material.matchNonProduct({}, {}, function (data) {
-				if (data.success){
-					$scope.resultFrame = true;
-					$scope.matchTotal = data.data.total;
-					$scope.matchSuccess = data.data.success;
-					$scope.matchFail = data.data.fail;
-					$scope.standard_tab = 'matchResult';
-					$scope.param.type = "nStandard";
-					loadData();
-				}else {
-					toaster.pop("info", data.message);
+			if ($scope.chooseAllPage) {
+				Material.matchNonProduct({}, {}, function (data) {
+					if (data.success) {
+						$scope.resultFrame = true;
+						$scope.matchTotal = data.data.total;
+						$scope.matchSuccess = data.data.success;
+						$scope.matchFail = data.data.fail;
+						$scope.standard_tab = 'matchResult';
+						$scope.param.type = "nStandard";
+						loadData();
+					} else {
+						toaster.pop("info", data.message);
+					}
+				}, function (error) {
+					toaster.pop("error", "匹配操作失败!")
+				});
+			} else {
+				$scope.getChoosedInfo();
+				if (!$scope.choosedIds || $scope.choosedIds.length == 0) {
+					toaster.pop("info", "您尚未选中任何产品");
+					return ;
 				}
-			}, function (error) {
-				toaster.pop("error", "匹配操作失败!")
-			});
+				Material.matchSelected({}, $scope.choosedIds, function (data) {
+					if (data.success) {
+						$scope.resultFrame = true;
+						$scope.matchTotal = data.data.total;
+						$scope.matchSuccess = data.data.success;
+						$scope.matchFail = data.data.fail;
+						$scope.standard_tab = 'matchResult';
+						$scope.batch = data.data.batch;
+						$scope.currenctMaterial = [];
+						loadSelectedData();
+					} else {
+						toaster.pop("error", data.message);
+					}
+				}, function (error) {
 
-			// Material.matchAll({}, function (data) {
-			// 	if (data.updateCount > 0) {
-			// 		toaster.pop('success', '匹配完成, 本次匹配成功 ' + data.updateCount +' 个,可前往“标准产品”中 , 编辑上架。');
-			// 	}
-			// 	else {
-			// 		toaster.pop('success', '匹配完成, 暂无匹配成功产品,可前往“品牌申请/器件申请”中 , 提出申请。');
-			// 	}
-			// 	loadDataReload();
-			// }, function (response) {
-			// 	toaster.pop('info', response.data);
-			// });
+				})
+			}
 		};
 
 		function downloadByJs(url, keyword, type) {
@@ -867,16 +920,43 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 			form.submit();
 		}
 
+		function downloadSelectedByJs(url, idList) {
+			var form = $("<form>");   //定义一个form表单
+			form.attr('style', 'display:none');   //在form表单中添加查询参数
+			form.attr('target', '');
+			form.attr('method', 'get');
+			form.attr('action', url);
+
+			var input1 = $('<input>');
+			input1.attr('type', 'hidden');
+			input1.attr('name', 'idList');
+			input1.attr('value', idList);
+
+			$('body').append(form);  //将表单放置在web中
+			form.append(input1);   //将查询参数控件提交到表单上
+			form.submit();
+		}
+
 		// 下载模板
 		$scope.download = function() {
 			if ($scope.currenctMaterial && $scope.currenctMaterial.length == 0) {
 				toaster.pop('info', '当前产品列表为空,无法下载');
 				return;
 			}
-			if ('standard' == $scope.standard_tab)
-				downloadByJs('trade/products/template/download/type', $scope.param.keyword, 'standard');
-			if ('unstandard' == $scope.standard_tab)
-				downloadByJs('trade/products/template/download/type', $scope.param.keyword, 'nStandard');
+			if ($scope.chooseAllPage) {
+				if ('standard' == $scope.standard_tab)
+					downloadByJs('trade/products/template/download/type', $scope.param.keyword, 'standard');
+				if ('unstandard' == $scope.standard_tab)
+					downloadByJs('trade/products/template/download/type', $scope.param.keyword, 'nStandard');
+			} else {
+				$scope.getChoosedInfo();
+				if (!$scope.choosedIds || $scope.choosedIds.length == 0) {
+					toaster.pop("info", "您尚未选中任何产品");
+					return ;
+				}
+				var idStr = $scope.choosedIds.join(',');
+				downloadSelectedByJs('trade/products/template/selected/data', idStr);
+			}
 		};
 
 		//初始化页数信息
@@ -1071,8 +1151,15 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 				$scope.materialAll = data;
 				$scope.currenctMaterial = data.content;
 				updateTagCount();
+				if ($scope.currenctMaterial.length == 0) {
+					$scope.chooseAllPage = false;
+				}
 				angular.forEach($scope.currenctMaterial, function (material, index) {
-					material.isChoosed = false;
+					if ($scope.chooseAllPage) {
+						material.isChoosed = true;
+					} else {
+						material.isChoosed = false;
+					}
 					material.submitProduct = {
 						brand: {},
 						commponent: {},
@@ -1087,8 +1174,8 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 				});
 				$scope.param.currentPage = data.number;
 				$scope.acculatePages(data.number, data.totalPages);
-				$scope.isChoosedAll = false;
 				$scope.choosedIds = [];
+				$scope.chooseAll = false;
 			}, function (response) {
 
 			})
@@ -2777,13 +2864,13 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 
         // 确认删除
         $scope.confirmDelete = function () {
-            if(deleteMaterial) {
-                if(selectAll) {
-                    if(standard_tab == 'standard') {
+            if (deleteMaterial) {
+                if (selectAll) {
+                    if (standard_tab == 'standard') {
                         Material.deleteStandardAll(null, null, function (data) {
-                            if(data.code != 1) {
+                            if (data.code != 1) {
                                 toaster.pop('error','错误' ,data.message);
-                            }else {
+                            } else {
                                 toaster.pop('success', '删除成功');
 								$scope.deleteModal = false;
                                 $modalInstance.close(data);
@@ -2791,7 +2878,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
                         }, function (response) {
                             toaster.pop('error', '错误', response.data);
                         });
-                    }else {
+                    } else {
                         Material.deleteUnstandardAll(null, null, function (data) {
                             if(data.code != 1) {
                                 toaster.pop('error', '错误', data.message);
@@ -2804,7 +2891,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
                             toaster.pop('error', '错误', response.data);
                         });
                     }
-                }else {
+                } else {
                     if(!$scope.ids || $scope.ids.length == 0) {
                         toaster.pop('warning', '提示','请选择要删除的信息');
                         return ;
@@ -2818,8 +2905,8 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
                         toaster.pop('error', response.data);
                     });
                 }
-            }else if(deleteGoods){
-                if(!$scope.ids || $scope.ids.length < 1) {
+            } else if (deleteGoods) {
+                if (!$scope.ids || $scope.ids.length < 1) {
                     return ;
                 }
                 Goods.deleteGoodsById({id: $scope.ids[0]}, function (data) {

+ 56 - 50
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_upload_ctrl.js

@@ -38,6 +38,12 @@ define([ 'app/app' ], function(app) {
         //批量发布的类型
         $scope.batch.sellType = null;
 
+
+        $scope.repeatImport = 0;
+		$scope.switchImport = function (type) {
+			$scope.repeatImport = type;
+		};
+
         //翻页的信息
         $scope.pageParams = {};
 
@@ -199,56 +205,56 @@ define([ 'app/app' ], function(app) {
             }
         };
 
-        // 上传Excel批量发布(大量)
-        $scope.upload = function() {
-            if(($scope.batch.myFiles == null) || ($scope.batch.myFiles.length == 0)) {
-                return ;
-            }
-            var file = $scope.batch.myFiles[0];
-            if(!file) {
-                toaster.pop('info', '请选择需要上传的文件');
-                return;
-            }
-            if ($rootScope.$$productOn.tab === 'bathOnPerson') {
-                var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency, isPerson : 1};
-            } else {
-                var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency};
-            }
-            $upload.upload({
-                url: 'release/product/release/excel',
-                file: file,
-                method: 'POST',
-                params : param
-            }).success(function(data) {
-                $scope.selectFile(' ');
-                $scope.batch.myFiles = [];
-                $scope.proInfo = data.info;
-                $scope.result = data;
-                $scope.hadImport = false;
-                // var message = "";
-                // if($scope.result.success) {
-                // 	message = '标准产品' + $scope.result.success + '个';
-                // }
-                // if($scope.result.failure) {
-                // 	if(message) {
-                // 		message = message + ',非标产品' + $scope.result.failure +  '个';
-                // 	}else {
-                // 		message = '非标产品' + $scope.result.failure +  '个';
-                // 	}
-                // }
-                // if($scope.result.filter) {
-                // 	if(message) {
-                // 		message = message + ',过滤' + $scope.result.filter +  '条';
-                // 	}else {
-                // 		message = '过滤' + $scope.result.filter +  '条';
-                // 	}
-                // }
-                // if(!message) {
-                // 	message = '没有提交任何信息'
-                // }
-                toaster.pop('info', '提示', '上传完成');
-                $scope.relTableParams.page(1);
-                $scope.relTableParams.reload();
+		// 上传Excel批量发布(大量)
+		$scope.upload = function() {
+			if(($scope.batch.myFiles == null) || ($scope.batch.myFiles.length == 0)) {
+				return ;
+			}
+			var file = $scope.batch.myFiles[0];
+			if(!file) {
+				toaster.pop('info', '请选择需要上传的文件');
+				return;
+			}
+			if ($rootScope.$$productOn.tab === 'bathOnPerson') {
+				var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency, isPerson : 1};
+			} else {
+                var param = {selfSale : $scope.batch.sellType == 'self', currency : $scope.batch.currency, repeatImport : $scope.repeatImport};
+			}
+			$upload.upload({
+				url: 'release/product/release/excel',
+				file: file,
+				method: 'POST',
+				params : param
+			}).success(function(data) {
+				$scope.selectFile(' ');
+				$scope.batch.myFiles = [];
+				$scope.proInfo = data.info;
+				$scope.result = data;
+				$scope.hadImport = false;
+				// var message = "";
+				// if($scope.result.success) {
+				// 	message = '标准产品' + $scope.result.success + '个';
+				// }
+				// if($scope.result.failure) {
+				// 	if(message) {
+				// 		message = message + ',非标产品' + $scope.result.failure +  '个';
+				// 	}else {
+				// 		message = '非标产品' + $scope.result.failure +  '个';
+				// 	}
+				// }
+				// if($scope.result.filter) {
+				// 	if(message) {
+				// 		message = message + ',过滤' + $scope.result.filter +  '条';
+				// 	}else {
+				// 		message = '过滤' + $scope.result.filter +  '条';
+				// 	}
+				// }
+				// if(!message) {
+				// 	message = '没有提交任何信息'
+				// }
+				toaster.pop('info', '提示', '上传完成');
+				$scope.relTableParams.page(1);
+				$scope.relTableParams.reload();
                 if ($rootScope.$$productOn.tab === 'bathOnPerson') {
                     publicPersonProduct();
                 }

+ 160 - 56
src/main/webapp/resources/view/vendor/forstore/vendor_material.html

@@ -215,26 +215,57 @@
 		font-size: 14px;
 		line-height: 35px;
 	}
-	.search-check .check a{
+	.search-check .check > .operate-btn{
 		font-size: 14px;
 		margin-right: 20px;
+		color: #fff !important;
+		background: #5078cb;
+		position: relative;
+		display: inline-block;
+		height: 30px;
+		line-height: 30px;
+		padding: 0 10px;
+		cursor: pointer;
+	}
+	.search-check .check > .operate-btn .expander {
+		position: absolute;
 		color: #333;
+		right: 0;
+		display: none;
+		height: 57px;
+		line-height: 26px;
+		text-align: center;
+		background: #fff;
+		bottom: -57px;
+		width: 98px;
+		z-index: 10;
+		border: 1px solid #e4e5e5;
 	}
-	.search-check .check a:hover{
-		color: #5078cb;
+	.search-check .check > .operate-btn.more-operate {
+		padding: 0;
+		width: 98px;
+		height: 30px;
+		line-height: 30px;
+		text-align: center;
+		display: inline-block;
 	}
-	.search-check .check .check-active{
-		margin-right: 15px;
+	.search-check .check > .operate-btn.more-operate:hover .expander {
+		display: block;
 	}
-	.search-check .check .check-active span{
-		font-weight: normal;
-		color: #333;
+	.search-check .check > .operate-btn.more-operate .expander span {
+		display: block;
 	}
-	.search-check .check .check-active span:hover{
+	.search-check .check > .operate-btn.more-operate .expander span:hover {
 		color: #5078cb;
-		cursor: pointer;
 	}
-	.search-check .check .check-active label{
+	.pro_management .table .check-active {
+		margin-right: 15px;
+		user-select: none;
+	}
+	.pro_management .table .check-active span {
+		color: #333 !important;
+	}
+	.pro_management .table .check-active label {
 		margin-right: 0 !important;
 	}
 	.check-input input{
@@ -1487,6 +1518,32 @@
 		position: absolute;
 		top: 45px;
 	}
+
+	.no-hover:hover {
+		background: none !important;
+	}
+	.standard-tab.table > tbody > tr.batch-tr {
+		height: 40px;
+	}
+	.standard-tab.table > tbody > tr.batch-tr.active {
+		position: fixed;
+		bottom: 0;
+		z-index: 2000;
+	}
+	.standard-tab.table > tbody > tr.batch-tr.active td {
+		width: 1029px;
+		border-top: 0;
+	}
+	.standard-tab.table > tbody > tr.batch-tr td {
+		padding: 0;
+		border-top: #dff3fd 1px solid;
+	}
+	.standard-tab.table>tbody>tr>td .batch-line {
+		width: 100%;
+		height: 40px;
+		background: #dff3fd;
+		line-height: 40px;
+	}
 </style>
 <div class="user_right fr">
 	<!--货品管理-->
@@ -1518,19 +1575,20 @@
 				<div class="search fl">
 					<input type="text" class="form-control" ng-model="param.keyword" ng-search="onSearch()" placeholder="类目/型号/品牌"/>
 					<button ng-click="onSearch()">搜索</button>
-					<a ng-click="download()">批量导出</a>
+					<!--<a ng-click="download()">批量导出</a>-->
 				</div>
 				<div class="check fr">
-					<a ng-show="!isBatch && standard_tab == 'unstandard'" ng-click="matchAll()"><span ng-show="!isBatch && standard_tab == 'unstandard'">一键匹配</span></a>
-					<a ng-show="!isBatch" ng-click="enterBatch()"><span ng-show="!isBatch">批量操作</span></a>
+					<div class="operate-btn" ng-show="standard_tab == 'unstandard'" ng-click="matchAll()"><span ng-show="standard_tab == 'unstandard'">匹配</span></div>
+					<div class="operate-btn more-operate">
+						<span>更多操作</span>
+						<span class="expander">
+							<span ng-click="download()">导出选中</span>
+							<span ng-click="deleteBatch()" name="delete-material">删除选中</span>
+						</span>
+					</div>
+					<!--<a ng-show="!isBatch" ng-click="enterBatch()"><span ng-show="!isBatch">批量操作</span></a>-->
 					<span class="check-btn" ng-show="isBatch">
-						<label class="check-active">
-							<input type="checkbox"  ng-click="chooseAll()" ng-checked="isChoosedAll" id="AllChoose"/>
-							<label for="AllChoose"></label>
-							<span>全选</span>
-						</label>
-						<a
-								ng-click="deleteBatch()" name="delete-material">删除</a>
+						<a ng-click="deleteBatch()" name="delete-material">删除</a>
 						<a ng-click="exitBatch()">取消</a>
 					</span>
 				</div>
@@ -1538,15 +1596,22 @@
 			<div class="wanted_list01">
 			<!--在售产品-->
 			<div class="tab">
-				<table class="public-tab table">
+				<table class="public-tab standard-tab table">
 					<thead>
 					<tr>
+						<th width="80">
+							<label class="check-active">
+								<input ng-disabled="currenctMaterial.length == 0" type="checkbox"  ng-click="chooseAllItem()" ng-checked="chooseAll || chooseAllPage" id="AllChoose"/>
+								<label for="AllChoose"></label>
+								<span>全选</span>
+							</label>
+						</th>
 						<th width="80">序号</th>
 						<th width="180">产品名称(类目)</th>
 						<th width="200">产品型号</th>
 						<th width="150">品牌</th>
 						<th width="100">单位</th>
-						<th width="80">封装</th>
+						<!--<th width="80">封装</th>-->
 						<th width="180">操作</th>
 					</tr>
 					</thead>
@@ -1557,19 +1622,21 @@
 					</tr>
 					</tbody>
 					<tbody>
-					<tr style="height: 14px;" ng-show="currenctMaterial.length > 0 && standard_tab == 'unstandard' && showTip">
-						<td colspan="7" class="hei17">
-							<span>*匹配成为标准产品方可通过器件选型、参数搜索展示</span><a ng-click="cancelTip()">&times;</a>
-						</td>
-					</tr>
+						<tr style="height: 14px;" ng-show="currenctMaterial.length > 0 && standard_tab == 'unstandard' && showTip">
+							<td colspan="7" class="hei17">
+								<span>*匹配成为标准产品方可通过器件选型、参数搜索展示</span><a ng-click="cancelTip()">&times;</a>
+							</td>
+						</tr>
 					</tbody>
 					<tbody ng-repeat="material in currenctMaterial">
 					<!--<tr ng-class="{ 'active': material.selected }" class="gre-bg">-->
 					<tr ng-class="{ 'active': material.selected, 'gre-bg' : material.exPandOper}">
 						<td class="check-input">
-							<span ng-show="isBatch"><input type="checkbox" ng-checked="material.isChoosed"  ng-click="chooseOne(material)"  id="{{$index+1}}"/><label for="{{$index+1}}"></label><br/></span>
-							<span
-									ng-show="!isBatch" ng-bind="(param.page - 1) * 10 + $index + 1"></span>
+							<span><input type="checkbox" ng-checked="material.isChoosed"  ng-click="chooseOne(material)"  id="{{$index+1}}"/><label for="{{$index+1}}"></label><br/></span>
+						</td>
+						<td>
+							<!--<span ng-show="isBatch"><input type="checkbox" ng-checked="material.isChoosed"  ng-click="chooseOne(material)"  id="{{$index+1}}"/><label for="{{$index+1}}"></label><br/></span>-->
+							<span ng-show="!isBatch" ng-bind="(param.page - 1) * 10 + $index + 1"></span>
 						</td>
 						<td>
 							<span ng-if="material.kind" ng-bind="material.kind" title="{{material.kind}}"></span>
@@ -1584,12 +1651,15 @@
 							<div class="ellipsis-div" ng-if="!material.pbranden" ng-bind="material.pbrand" title="{{material.pbrand}}"></div>
 						</td>
 						<td ng-bind="material.unit || 'PCS'" title="{{material.unit  || 'PCS'}}"></td>
-						<td>
-							<span ng-bind="material.encapsulation || '-'" title="{{material.encapsulation || '-'}}"></span>
-						</td>
+						<!--<td>-->
+							<!--<span ng-bind="material.encapsulation || '-'" title="{{material.encapsulation || '-'}}"></span>-->
+						<!--</td>-->
 						<td class="edit">
 							<span name="delete-material" ng-show="!isBatch && !material.exPandOper && !material.addGoodsOper" ng-click="deleteMaterial(material)"><span>删除</span></span>
-							<span ng-show="!isBatch && !material.exPandOper && !material.addGoodsOper" ng-click="showShelfArea(material)"><span>添加产品</span></span>
+							<span ng-show="!isBatch && !material.exPandOper && !material.addGoodsOper" ng-click="showShelfArea(material)">
+								<span ng-if="material.batchCount">添加产品</span>
+								<span ng-if="!material.batchCount">编辑上架</span>
+							</span>
 							<span ng-if="material.batchCount" ng-show="!isBatch && !material.exPandOper && !material.addGoodsOper" ng-click="expandGoods(material)"><span>展开<i class="fa fa-angle-down" style="margin-left:2px;"></i></span></span>
 							<!--收起-->
 							<span ng-show="!isBatch && material.exPandOper" ng-click="disExpandGoods(material)" class="packUp"><span>收起<i class="fa fa-angle-up" style="margin-left:2px;"></i></span></span>
@@ -1777,9 +1847,7 @@
 														<div class="input-list">
 															<button class="off" ng-click="editGoods(material, goods)">编辑</button>
 															<button ng-if="goods.status != 601 && goods.status != 602" class="ok" ng-click="putOn(material, goods)">上架</button>
-															<button class="ok" ng-click="isRecommendGoods(goods)" name =
-																	"delete-goods">删除
-															</button>
+															<button class="ok" ng-click="isRecommendGoods(goods)" name ="delete-goods">删除</button>
 														</div>
 													</div>
 												</div>
@@ -1805,8 +1873,7 @@
 														<a><img ng-src="{{goods.editPic || 'static/img/store/common/default.png'}}" alt="img"/></a>
 														<div class="edit-img">
 															<a ng-if="goods.editPic" ng-click="deleteImg(goods)" class="delete-img" title="删除"><i class="fa fa-trash"></i></a>
-															<a
-																	ng-click="editGoodsPicture(goods.editPic || 'static/img/store/common/default.png', goods)" title="修改图片"><img ng-src="static/img/icon/update-img.png" /></a>
+															<a ng-click="editGoodsPicture(goods.editPic || 'static/img/store/common/default.png', goods)" title="修改图片"><img ng-src="static/img/icon/update-img.png" /></a>
 														</div>
 													</div>
 													<div class="content margin10">
@@ -1940,6 +2007,23 @@
 						</td>
 					</tr>
 					</tbody>
+					<tbody>
+					<tr class="no-hover batch-tr" ng-if="(chooseAll || chooseAllPage) && currenctMaterial.length != 0">
+						<td colspan="7">
+							<div class="batch-line" ng-if="chooseAll && !chooseAllPage">
+								已选中当前页
+								<em class="red" ng-bind="materialAll.numberOfElements"></em>个产品,
+								<a ng-click="turnAllPage()" class="blue">点击此处</a>切换选中所有页面<em class="red" ng-bind="materialAll.totalElements"></em>个产品
+							</div>
+							<div class="batch-line" ng-if="chooseAllPage">
+								已选中所有页面
+								<em class="red" ng-bind="materialAll.totalElements"></em>个产品,
+								<a ng-click="cancelAllPage()" class="blue">点击此处</a>全部取消选中
+							</div>
+						</td>
+					</tr>
+					<!--<tr class="no-hover batch-tr" ng-if="chooseAll && !chooseAllPage" ng-class="{'active': $data.length > 10}">-->
+					</tbody>
 				</table>
 				<div class="empty" ng-if="currenctMaterial.length == 0">
 					<p class="empty-img">
@@ -2035,7 +2119,7 @@
 							<th width="120">产品名称(类目)</th>
 							<th width="120">品牌</th>
 							<th width="100">型号</th>
-							<th width="100">封装</th>
+							<!--<th width="100">封装</th>-->
 							<th width="80"></th>
 						</tr>
 						</thead>
@@ -2057,30 +2141,31 @@
                                 </select>
 							</td>
 							<td title="{{product.pcmpcode}}" ng-bind="product.pcmpcode || '-'">Lhhjhj-3</td>
-							<td title="{{product.encapsulation}}" ng-bind="product.encapsulation  || '-'">BGA</td>
+							<!--<td title="{{product.encapsulation}}" ng-bind="product.encapsulation  || '-'">BGA</td>-->
 							<td class="confirm"><span ng-if="product.matchresults.length != 0 && product.canMatch" ng-click="updateNStandardOne(product)">确认</span></td>
 						</tr>
 						</tbody>
 						<tr style="height: 40px;" class="no-hover">
 							<td colspan="7" style="border-bottom: none; padding: 0;">
-								<div class="record-line text-right">
-								<span class="set-count">
-									每页显示:
-									<!--<input type="text" value="10" class="form-control">-->
-									<!--<ul>-->
-									<!--<li>15</li>-->
-									<!--</ul>-->
-									<select ng-model="$$nonProduct.count" ng-change="fitCountToTable($$nonProduct.count)">
-										<option value="10">10</option>
-										<option value="15">15</option>
-										<option value="20">20</option>
-									</select>
-								</span>
+								<div class="record-line text-right" ng-if="chooseAllPage">
+									<span class="set-count">
+										每页显示:
+										<select ng-model="$$nonProduct.count" ng-change="fitCountToTable($$nonProduct.count)">
+											<option value="10">10</option>
+											<option value="15">15</option>
+											<option value="20">20</option>
+										</select>
+									</span>
 									显示<span>{{(param.currentPage - 1) * param.count + 1}}</span>-
 									<span ng-if="param.currentPage != materialAll.totalPages">{{param.currentPage * param.count}}</span>
 									<span ng-if="param.currentPage == materialAll.totalPages">{{materialAll.totalElements}}</span>
 									,共:<span style="color: #5078cb;">{{materialAll.totalElements}}</span>个
 								</div>
+								<div class="record-line text-right" ng-if="!chooseAllPage">
+									显示<span>1</span>-
+									<span ng-bind="currenctMaterial.length"></span>
+									,共:<span style="color: #5078cb;">{{currenctMaterial.length}}</span>个
+								</div>
 							</td>
 						</tr>
 						</tbody>
@@ -2196,4 +2281,23 @@
         position: relative;
         top: 7px;
     }
-</style>
+</style>
+
+<script>
+	$(function(){
+		$(document).on('click', function () {
+			if ($(document).scrollTop() + $(window).height() < $('.record-line').offset().top + $('.record-line').height()) {
+				$('.standard-tab.table>tbody>tr.batch-tr').addClass('active')
+			} else {
+				$('.standard-tab.table>tbody>tr.batch-tr').removeClass('active')
+			}
+		})
+		$(window).bind("scroll",function() {
+			if ($(document).scrollTop() + $(window).height() < $('.record-line').offset().top + $('.record-line').height()) {
+				$('.standard-tab.table>tbody>tr.batch-tr').addClass('active')
+			} else {
+				$('.standard-tab.table>tbody>tr.batch-tr').removeClass('active')
+			}
+		});
+	})
+</script>

+ 14 - 1
src/main/webapp/resources/view/vendor/forstore/vendor_upload.html

@@ -510,7 +510,20 @@
                                 <img ng-hide="batch.sellType == 'UAS'" src="static/img/upload/ziying-active.png" alt="">
                             </span>
                         </div>
-                        <div><span ng-if="$$productOn.tab == 'bathOn'">2、</span>请上传已经编辑好的库存表格,选择好上传的文件之后,点击确认上传</div>
+                        <div ng-if="$$productOn.tab == 'bathOn'">2、若存在属性完全相同但价格不一致的产品:</div>
+                        <div class="sale-label" style="margin-top: -10px;" ng-if="$$productOn.tab == 'bathOn'">
+                            <label class="sellType">
+                                <input type="radio" name="import" id="forIgnore" ng-model="repeatImport" value="0" ng-click="switchImport(0)">
+                                <label for="forIgnore"></label>
+                                <span>忽略不导入</span>
+                            </label>
+                            <label class="sellType">
+                                <input type="radio" name="import" id="forImport" ng-model="repeatImport" value="1" ng-click="switchImport(1)">
+                                <label for="forImport"></label>
+                                <span>作为新产品继续导入</span>
+                            </label>
+                        </div>
+                        <div><span ng-if="$$productOn.tab == 'bathOn'">3、</span>请上传已经编辑好的库存表格,选择好上传的文件之后,点击确认上传</div>
                         <div class="upload">
                             <div class="upload-content">
                                 <input type="text" name="txt" id="upload_text" />