Browse Source

Merge remote-tracking branch 'origin/release-201827-wangcz' into release-201827-wangcz

shenjj 7 years ago
parent
commit
a0794fea68
53 changed files with 249 additions and 185 deletions
  1. 3 3
      src/main/java/com/uas/platform/b2c/fa/payment/controller/BankInfoController.java
  2. 13 2
      src/main/java/com/uas/platform/b2c/fa/payment/dao/BankInfoDao.java
  3. 2 4
      src/main/java/com/uas/platform/b2c/fa/payment/service/BankInfoService.java
  4. 5 5
      src/main/java/com/uas/platform/b2c/fa/payment/service/impl/BankInfoServiceImpl.java
  5. 25 20
      src/main/java/com/uas/platform/b2c/prod/commodity/constant/ModifyConstant.java
  6. 8 0
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/GoodsDao.java
  7. 10 16
      src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java
  8. 7 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsService.java
  9. 43 48
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java
  10. 2 1
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java
  11. 120 84
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java
  12. BIN
      src/main/resources/jxls-tpl/trade/products-error.xls
  13. BIN
      src/main/resources/jxls-tpl/trade/products.xls
  14. BIN
      src/main/resources/jxls-tpl/trade/releaseByBatch-rmb.xls
  15. BIN
      src/main/resources/jxls-tpl/trade/releasebyBatch-usd.xls
  16. BIN
      src/main/webapp/resources/img/all/default.png
  17. BIN
      src/main/webapp/resources/img/all/empty-cart.png
  18. BIN
      src/main/webapp/resources/img/all/qrcode_mall.png
  19. BIN
      src/main/webapp/resources/img/all/u.png
  20. BIN
      src/main/webapp/resources/img/common/mall-logo.png
  21. BIN
      src/main/webapp/resources/img/common/uas-mall.png
  22. BIN
      src/main/webapp/resources/img/common/uas_mall.png
  23. BIN
      src/main/webapp/resources/img/example/tip_logo.png
  24. BIN
      src/main/webapp/resources/img/help/brand.png
  25. BIN
      src/main/webapp/resources/img/help/buy-search.png
  26. BIN
      src/main/webapp/resources/img/help/kind.png
  27. BIN
      src/main/webapp/resources/img/help/market.png
  28. BIN
      src/main/webapp/resources/img/help/orderinfo.png
  29. BIN
      src/main/webapp/resources/img/help/register.png
  30. BIN
      src/main/webapp/resources/img/help/search.png
  31. BIN
      src/main/webapp/resources/img/help/search1.png
  32. BIN
      src/main/webapp/resources/img/help/search2.png
  33. BIN
      src/main/webapp/resources/img/help/search3.png
  34. BIN
      src/main/webapp/resources/img/help/seller-apply-brand.png
  35. BIN
      src/main/webapp/resources/img/help/seller-apply-component.png
  36. BIN
      src/main/webapp/resources/img/help/seller-apply-componentInfo.png
  37. BIN
      src/main/webapp/resources/img/help/seller-batch-publish.png
  38. BIN
      src/main/webapp/resources/img/help/sign.png
  39. BIN
      src/main/webapp/resources/img/logo/squirrel_logo_weixin.jpg
  40. BIN
      src/main/webapp/resources/img/logo/uas_mall.png
  41. BIN
      src/main/webapp/resources/img/logo/uas_mall_hor.png
  42. BIN
      src/main/webapp/resources/img/mobile/client-icon-32.png
  43. BIN
      src/main/webapp/resources/img/mobile/yrsc_weixin.jpg
  44. BIN
      src/main/webapp/resources/img/store/common/default.png
  45. BIN
      src/main/webapp/resources/img/user/images/default.png
  46. BIN
      src/main/webapp/resources/img/user/images/erweima01.jpg
  47. BIN
      src/main/webapp/resources/img/user/images/logo.png
  48. BIN
      src/main/webapp/resources/img/vendor/images/erweima01.jpg
  49. BIN
      src/main/webapp/resources/img/vendor/images/logo.png
  50. BIN
      src/main/webapp/resources/img/vendor/images/user_logo.png
  51. 1 1
      src/main/webapp/resources/js/sso/controllers/staffManagementCtrl.js
  52. 9 1
      src/main/webapp/resources/js/usercenter/controllers/forstore/bomListDetailCtrl.js
  53. 1 0
      src/main/webapp/resources/view/usercenter/forstore/bomListDetail.html

+ 3 - 3
src/main/java/com/uas/platform/b2c/fa/payment/controller/BankInfoController.java

@@ -271,11 +271,11 @@ public class BankInfoController {
 	/**
 	 * 根据银行账号返回账户数
 	 * @param number 银行账号
-	 * @param type   类型,卖家、买家、平台
+	 * @param accountType   类型,卖家、买家、平台
 	 * @return
 	 */
 	@RequestMapping(value = "/number/count", method = RequestMethod.GET)
-	public ResultMap getCountByNumber(Integer type, String number){
-		return bankInfoService.getCountByNumber(type, number);
+	public ResultMap getCountByNumber(String accountType, String number){
+		return bankInfoService.getCountByNumber(accountType, number);
 	}
 }

+ 13 - 2
src/main/java/com/uas/platform/b2c/fa/payment/dao/BankInfoDao.java

@@ -125,8 +125,19 @@ public interface BankInfoDao extends CrudRepository<BankInfo, Long>, JpaSpecific
 	 * @param number
 	 * @return
 	 */
-	@Query("select count(b) from BankInfo b where b.enuu=:enuu and b.dissociative=:dissociative and b.status=:status and b.number=:number")
-	int getSupCountByNumberAndDissociative(@Param("enuu") Long enuu, @Param("dissociative") Integer dissociative, @Param("status") Integer status, @Param("number") String number);
+	@Query("select count(b) from BankInfo b where b.enuu=:enuu and b.dissociative=:dissociative and b.status=:status and b.number=:number and b.accountType =:accountType")
+	int getSupCountByNumberAndDissociative(@Param("enuu") Long enuu, @Param("dissociative") Integer dissociative, @Param("status") Integer status, @Param("number") String number, @Param("accountType") String accountType);
+
+	/**
+	 * 根据银行账号查询个人账号下的账户个数
+	 * @param useruu
+	 * @param dissociative
+	 * @param status
+	 * @param number
+	 * @return
+	 */
+	@Query("select count(b) from BankInfo b where b.enuu=:enuu and b.dissociative=:dissociative and b.status=:status and b.number=:number and b.accountType =:accountType")
+	int getBuyCountByNumberAndDissociative(@Param("enuu") Long useruu, @Param("dissociative") Integer dissociative, @Param("status") Integer status, @Param("number") String number, @Param("accountType") String accountType);
 
 	/**
 	 * 银行账户返回企业账户数

+ 2 - 4
src/main/java/com/uas/platform/b2c/fa/payment/service/BankInfoService.java

@@ -4,8 +4,6 @@ import com.uas.platform.b2c.common.base.model.FileUpload;
 import com.uas.platform.b2c.fa.payment.model.BankInfo;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.model.PageParams;
-import com.uas.platform.core.model.Status;
-import com.uas.platform.core.model.Type;
 import org.springframework.data.domain.Page;
 
 import java.util.List;
@@ -125,11 +123,11 @@ public interface BankInfoService {
 	/**
 	 * 根据银行账号返回账户数
 	 *
-	 * @param type
+	 * @param accountType
 	 * @param number
 	 * @return
 	 */
-	ResultMap getCountByNumber(Integer type, String number);
+	ResultMap getCountByNumber(String accountType, String number);
 
 	/**
 	 * 获取

+ 5 - 5
src/main/java/com/uas/platform/b2c/fa/payment/service/impl/BankInfoServiceImpl.java

@@ -359,8 +359,8 @@ public class BankInfoServiceImpl implements BankInfoService {
 	}
 
 	@Override
-	public ResultMap getCountByNumber(Integer type, String number) {
-		if (type != Type.MALL.value() && type != Type.BUYER.value() && type != Type.SUP.value()){
+	public ResultMap getCountByNumber(String accountType, String number) {
+		if (!AccountType.PAY_TYPE.equals(accountType)  && !AccountType.RECEIVE_TYPE.equals(accountType)){
 			return new ResultMap(CodeType.ERROR_STATE, "类型不存在,确认要查找账户的类型");
 		}
 		if (StringUtils.isEmpty(number)) {
@@ -368,10 +368,10 @@ public class BankInfoServiceImpl implements BankInfoService {
 		}
 		Integer count = null;
 		User user = SystemSession.getUser();
-		if (user.getEnterprise() != null) {
-			count = bankInfoDao.getSupCountByNumberAndDissociative(user.getEnterprise().getUu(), Type.ENTERPRISING.value(), Status.ALLOW.value(), number);
+		if (user.getEnterprise() == null) {
+			count = bankInfoDao.getBuyCountByNumberAndDissociative(user.getUserUU(), Type.PERSONAL.value(), Status.ALLOW.value(), number, accountType);
 		}else {
-			count = bankInfoDao.getBuyerCountByNumberAndDissociative(user.getUserUU(), Type.PERSONAL.value(), Status.ALLOW.value(), number);
+			count = bankInfoDao.getSupCountByNumberAndDissociative(user.getEnterprise().getUu(), Type.ENTERPRISING.value(), Status.ALLOW.value(), number, accountType);
 		}
 		return ResultMap.success(count);
 	}

+ 25 - 20
src/main/java/com/uas/platform/b2c/prod/commodity/constant/ModifyConstant.java

@@ -18,17 +18,17 @@ public class ModifyConstant {
     /**
      * 导入最大行数
      */
-    public static final int EXCEL_MAX_ROW = 2000;
+    public static final int EXCEL_MAX_ROW = 2002;
 
     /**
      * The constant TOTAL_ROW.
      */
-    public static final int TOTAL_COLUMN = 22;
+    public static final int TOTAL_COLUMN = 21;
 
     /**
      * The constant MAX_TOTAL_COLUMN.
      */
-    public static final int MAX_TOTAL_COLUMN = 23;
+    public static final int MAX_TOTAL_COLUMN = 22;
 
     /**
      * 产品编码
@@ -38,17 +38,17 @@ public class ModifyConstant {
     /**
      * The constant PRODUCT_KIND.
      */
-    public static final int PRODUCT_KIND = 1;
+    public static final int PRODUCT_KIND = 2;
 
     /**
      * The constant PRODUCT_CODE.
      */
-    public static final int PRODUCT_CODE = 2;
+    public static final int PRODUCT_CODE = 3;
 
     /**
      * The constant PRODUCT_BRAND.
      */
-    public static final int PRODUCT_BRAND = 3;
+    public static final int PRODUCT_BRAND = 1;
 
     /**
      * The constant PRODUCT_BRAND.
@@ -63,67 +63,72 @@ public class ModifyConstant {
     /**
      * The constant PACKAGE_METHOD.
      */
-    public static final int PACKAGE_METHOD = 6;
+    public static final int PACKAGE_METHOD = 5;
 
     /**
      * The constant MIN_DELIVERY.
      */
-    public static final int MIN_DELIVERY = 7;
+    public static final int MIN_DELIVERY = 6;
 
     /**
      * The constant MAX_DELIVERY.
      */
-    public static final int MAX_DELIVERY = 8;
+    public static final int MAX_DELIVERY = 7;
 
     /**
      * The constant BREAK_UP.
      */
-    public static final int BREAK_UP = 9;
+    public static final int BREAK_UP = 8;
 
     /**
      * The constant PACKAGE_NUMBER.
      */
-    public static final int PACKAGE_NUMBER = 10;
+    public static final int PACKAGE_NUMBER = 9;
 
     /**
      * 最小起订量
      */
-    public static final int BUY_MIN_QTY = 11;
+    public static final int BUY_MIN_QTY = 10;
 
     /**
      * 分段价格开始
      */
-    public static final int PRICE_FIRST = 12;
+    public static final int PRICE_FIRST = 11;
 
     /**
      * 第二个分段
      */
-    public static final int QTY_SECOND_START = 13;
+    public static final int QTY_SECOND_START = 12;
 
     /**
      * 第二个分段
      */
-    public static final int PRICE_SECOND = 14;
+    public static final int PRICE_SECOND = 13;
 
     /**
      * 第三个分段
      */
-    public static final int QTY_THIRD_START = 15;
+    public static final int QTY_THIRD_START = 14;
 
     /**
      * 第三个分段
      */
-    public static final int PRICE_THIRD = 16;
+    public static final int PRICE_THIRD = 15;
 
     /**
      * The constant SALE_METHOD.
      */
-    public static final int SALE_METHOD = 17;
+    public static final int SALE_METHOD = 16;
 
     /**
      * The constant RESERVE_NUMBER.
      */
-    public static final int RESERVE_NUMBER = 18;
+    public static final int RESERVE_NUMBER = 17;
+
+    /**
+     * 成本单价
+     */
+    public static final int COST_PRICE = 18;
 
     /**
      * The constant CUSTOM_LABEL.
@@ -133,7 +138,7 @@ public class ModifyConstant {
     /**
      * The constant SALE_STATUS.
      */
-    public static final int SALE_STATUS = 20;
+    public static final int SALE_STATUS = 19;
 
     /**
      * The constant MATCH_STATUS.

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

@@ -43,6 +43,14 @@ public interface GoodsDao extends JpaSpecificationExecutor<Goods>, JpaRepository
      */
     Goods findByBatchCode(String batchCode);
 
+    /**
+     * 批量获取在售产品信息
+     * @param batchCodes
+     * @return
+     */
+    @Query(value = "select g from Goods g where g.batchCode in (:batchCodes)")
+    List<Goods> findByBatchCodes(@Param("batchCodes") List<String> batchCodes);
+
     /**
      * 根据UUID和状态查找对应的货物信息
      *

+ 10 - 16
src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java

@@ -593,21 +593,18 @@ public class ReleaseProductByBatch implements Serializable {
 		ReleaseProductByBatch that = (ReleaseProductByBatch) o;
 
 		if (!brandNameEn.equals(that.brandNameEn)) return false;
-		if (!code.equals(that.code)) return false;
-		if (!minBuyQtyStr.equals(that.minBuyQtyStr)) return false;
-		if (!productDate.equals(that.productDate)) return false;
-		if (!minPackageStr.equals(that.minPackageStr)) return false;
-		if (!packaging.equals(that.packaging)) return false;
-		if (!selfMaxDeliveryStr.equals(that.selfMaxDeliveryStr)) return false;
+//		if (!code.equals(that.code)) return false;
+//		if (!minBuyQtyStr.equals(that.minBuyQtyStr)) return false;
+//		if (!productDate.equals(that.productDate)) return false;
+//		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());
-		return selfMinDeliveryStr.equals(that.selfMinDeliveryStr);
+		return code.equals(that.code);
 	}
 
 	public void setBatchCodeByExcel(Object value) {
-		if (StringUtils.isEmpty(value)) {
-			addErrmsg(ErrorInfoConstant.BATCH_EMPTY.getInfo());
-		}
 		setBatchCode(StringUtilB2C.getStr(value).trim());
 	}
 
@@ -1485,20 +1482,17 @@ public class ReleaseProductByBatch implements Serializable {
 
 	public Goods releaseProductByBatchConvertToGoods(ReleaseProductByBatch releaseProductByBatch) {
 		Goods goods = new Goods();
-		goods.setBrandNameCn(releaseProductByBatch.getBrandNameEn());
+		goods.setBrandNameEn(releaseProductByBatch.getBrandNameEn());
 		goods.setCurrencyName(releaseProductByBatch.getCurrency());
 		goods.setCode(releaseProductByBatch.getCode());
 		goods.setCreatedDate(new Date());
 		goods.setUpdateDate(new Date());
 		goods.setMinDelivery(releaseProductByBatch.getSelfMinDelivery());
 		goods.setMaxDelivery(releaseProductByBatch.getSelfMaxDelivery());
-//		goods.setSelfDeliveryDemMaxTime(releaseProductByBatch.getDeliveryDemMaxTime());
-//		goods.setSelfDeliveryDemMinTime(releaseProductByBatch.getDeliveryDemMinTime());
-//		goods.setSelfDeliveryHKMaxTime(releaseProductByBatch.getDeliveryHKMaxTime());
-//		goods.setSelfDeliveryHKMinTime(releaseProductByBatch.getDeliveryHKMinTime());
 		goods.setProduceDate(releaseProductByBatch.getProductDate());
 		goods.setPublisherUU(releaseProductByBatch.getPublisherUu());
 		goods.setPublisherName(releaseProductByBatch.getPublisherName());
+		goods.setPublishPhone(releaseProductByBatch.getPublisherTel());
 		goods.setMinBuyQty(releaseProductByBatch.getMinBuyQty());
 		goods.setMinPackQty(releaseProductByBatch.getMinPackage());
 		goods.setUuid(releaseProductByBatch.getComponentUuId());
@@ -1508,12 +1502,12 @@ public class ReleaseProductByBatch implements Serializable {
 		goods.setRmbTaxRate(releaseProductByBatch.getRmbTaxRate());
 		goods.setUsdTaxRate(releaseProductByBatch.getUsdTaxRate());
 		goods.setReserve(releaseProductByBatch.getReserve());
-		goods.setPublishPhone(releaseProductByBatch.getPublisherTel());
 		goods.setReturnInWeek(releaseProductByBatch.getReturnInWeek());
 		goods.setShipArea(releaseProductByBatch.getShipArea());
 		goods.setSampleQty(releaseProductByBatch.getSampleqty());
 		goods.setKindNameCn(releaseProductByBatch.getKindName());
 		goods.setImg(releaseProductByBatch.getImg());
+		goods.setProductid(releaseProductByBatch.getProductid());
 		return goods;
 	}
 

+ 7 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsService.java

@@ -65,6 +65,13 @@ public interface GoodsService {
      */
     Goods findGoodsByBatchCode(String code);
 
+    /**
+     * 在售产品批次号
+     * @param batchCodes 批次号
+     * @return List<Goods>
+     */
+    List<Goods> findGoodsByBatchCodes(List<String> batchCodes);
+
     /**
      * 根据uuid查找简单货物信息
      *

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

@@ -1,7 +1,5 @@
 package com.uas.platform.b2c.prod.commodity.service.impl;
 
-import static com.uas.platform.core.persistence.criteria.PredicateUtils.like;
-
 import com.alibaba.fastjson.JSONObject;
 import com.uas.api.b2c_erp.core.model.OperateErrorStatus;
 import com.uas.api.b2c_erp.seller.model.GoodsFUas;
@@ -20,24 +18,13 @@ 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.support.SystemSession;
-import com.uas.platform.b2c.core.utils.DoubleArith;
-import com.uas.platform.b2c.core.utils.FastjsonUtils;
-import com.uas.platform.b2c.core.utils.NumberUtil;
-import com.uas.platform.b2c.core.utils.RegexConstant;
-import com.uas.platform.b2c.core.utils.StringUtilB2C;
+import com.uas.platform.b2c.core.utils.*;
 import com.uas.platform.b2c.external.erp.commodity.util.ModelConverter;
 import com.uas.platform.b2c.prod.commodity.constant.DoubleConstant;
 import com.uas.platform.b2c.prod.commodity.constant.IntegerConstant;
 import com.uas.platform.b2c.prod.commodity.constant.StringConstant;
 import com.uas.platform.b2c.prod.commodity.constant.UploadConstant;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsHistoryDao;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsModifyInfoDao;
-import com.uas.platform.b2c.prod.commodity.dao.GoodsSimpleDao;
-import com.uas.platform.b2c.prod.commodity.dao.PCBDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductDetailDao;
-import com.uas.platform.b2c.prod.commodity.dao.ProductPrivateDao;
+import com.uas.platform.b2c.prod.commodity.dao.*;
 import com.uas.platform.b2c.prod.commodity.model.*;
 import com.uas.platform.b2c.prod.commodity.model.GoodsHistory.OperateType;
 import com.uas.platform.b2c.prod.commodity.service.*;
@@ -79,11 +66,7 @@ import com.uas.platform.b2c.trade.support.CodeType;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.b2c.trade.util.BoundedExecutor;
 import com.uas.platform.core.exception.IllegalOperatorException;
-import com.uas.platform.core.model.Constant;
-import com.uas.platform.core.model.EncodingRulesConstant;
-import com.uas.platform.core.model.PageInfo;
-import com.uas.platform.core.model.PageParams;
-import com.uas.platform.core.model.Type;
+import com.uas.platform.core.model.*;
 import com.uas.platform.core.persistence.criteria.CriterionExpression;
 import com.uas.platform.core.persistence.criteria.CriterionExpression.Operator;
 import com.uas.platform.core.persistence.criteria.LogicalExpression;
@@ -91,33 +74,6 @@ import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.platform.core.persistence.criteria.SimpleExpression;
 import com.uas.platform.core.util.StringUtil;
 import com.uas.platform.core.util.serializer.FlexJsonUtils;
-import java.math.BigInteger;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-import javax.servlet.http.HttpServletRequest;
 import org.apache.commons.beanutils.ConvertUtils;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
@@ -142,6 +98,26 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.ui.ModelMap;
 import org.springframework.util.StringUtils;
 
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import javax.servlet.http.HttpServletRequest;
+import java.math.BigInteger;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import static com.uas.platform.core.persistence.criteria.PredicateUtils.like;
+
 
 /**
  * @author ChenHao
@@ -400,7 +376,26 @@ public class GoodsServiceImpl implements GoodsService {
 
     @Override
     public Goods findGoodsByBatchCode(String code) {
-        return goodsDao.findByBatchCode(code);
+        if (StringUtils.isEmpty(code)) {
+            return null;
+        } else {
+            return goodsDao.findByBatchCode(code);
+        }
+    }
+
+    /**
+     * 在售产品批次号
+     *
+     * @param batchCodes 批次号
+     * @return List<Goods>
+     */
+    @Override
+    public List<Goods> findGoodsByBatchCodes(List<String> batchCodes) {
+        if (CollectionUtils.isEmpty(batchCodes)) {
+            return new ArrayList<>();
+        } else {
+            return goodsDao.findByBatchCodes(batchCodes);
+        }
     }
 
     @Override

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

@@ -490,7 +490,8 @@ public class ProductServiceImpl implements ProductService {
         for (V_ProductPrivate product : productList) {
             List<Goods> goodsList = goodsDao.findByProductIdOrderByGoodsId(product.getId());
             if (!CollectionUtils.isEmpty(goodsList)) {
-                resultList.addAll(goodsList);
+                //目前现在一颗物料只能存在一个在售产品,目前取id最大的在售产品信息
+                resultList.add(goodsList.get(0));
             } else {
                 Goods g = Goods.productConvertGoods(product);
                 resultList.add(g);

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

@@ -425,9 +425,6 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			Object skuObj = readWorkBookCell(row.getCell(ModifyConstant.SKU_CODE), Cell.CELL_TYPE_STRING,
 					r, ModifyConstant.SKU_CODE);
 			aBatch.setBatchCodeByExcel(skuObj);
-			if (!validateBatchCode(aBatch.getBatchCode(), aBatch)) {
-				aBatch.addErrmsg(ErrorInfoConstant.BATCH_ERROR.getInfo());
-			}
 
 			Object sellObj = readWorkBookCell(row.getCell(ModifyConstant.SALE_METHOD), Cell.CELL_TYPE_STRING,
 					r, ModifyConstant.SALE_METHOD);
@@ -454,21 +451,21 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				aBatch.setReleaseStatus(ReleaseStatus.lack_info.getPhrase());
 			} else {
 				// 导入成功的需要判断自定义标签是否重复
-				if (CollectionUtils.isNotEmpty(batchList) && aBatch.getTag() != null) {
-					if (validateTagInfo(aBatch, batchList)) {
-						aBatch.setTag(null);
-					}
-				}
+//				if (CollectionUtils.isNotEmpty(batchList) && aBatch.getTag() != null) {
+//					if (validateTagInfo(aBatch, batchList)) {
+//						aBatch.setTag(null);
+//					}
+//				}
 				validateRepeatInExcel(batchList, aBatch, true);
 			}
 			batchList.add(aBatch);
 			total++;
 		}
+		int success = goodsFillDataToExcelAndUpdate(batchList);
 		Long userUU = SystemSession.getUser().getUserUU();
-		Long enUU = SystemSession.getUser().getEnterprise().getUu();
-		resetRepeatData(batchList, true, false);
-		setDefaultTag(batchList);
-		int success = modifyGoodsByBatch(batchList);
+//		Long enUU = SystemSession.getUser().getEnterprise().getUu();
+//		resetRepeatData(batchList, true, false);
+//		setDefaultTag(batchList);
 		commonDao.save(batchList, ReleaseProductByBatch.class);
 		Integer filter = releaseProductByBatchDao.getCountOfImportFail(userUU, batch, failCode);
 		modelMap.put("total", total);
@@ -479,6 +476,73 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		return modelMap;
 	}
 
+	/**
+	 * 根据批次号设置需要被修改的信息
+	 * @param batchList
+	 */
+	private Integer goodsFillDataToExcelAndUpdate(List<ReleaseProductByBatch> batchList) {
+		int result = 0;
+		if (CollectionUtils.isEmpty(batchList)) {
+			return result;
+		}
+		List<String> batchCodes = new ArrayList<>();
+		for (ReleaseProductByBatch aBatch : batchList) {
+			if (!StringUtilB2C.isEmpty(aBatch.getBatchCode())) {
+				batchCodes.add(aBatch.getBatchCode());
+			}
+		}
+
+		List<Goods> goodses = new ArrayList<>();
+		if (CollectionUtils.isNotEmpty(batchCodes)) {
+			goodses = goodsService.findGoodsByBatchCodes(batchCodes);
+		}
+		Goods newGoods = null;
+		for (ReleaseProductByBatch aBatch : batchList) {
+			newGoods = null;
+			for (Goods goods : goodses) {
+				if (goods.getBatchCode().equals(aBatch.getBatchCode())) {
+					aBatch.setB2cBranden(goods.getBrandNameEn());
+					aBatch.setBrandNameEn(goods.getBrandNameEn());
+					aBatch.setKindName(goods.getKindNameCn());
+					aBatch.setB2cCode(goods.getCode());
+					aBatch.setCode(goods.getCode());
+					aBatch.setCurrency(goods.getCurrencyName());
+					if (goods.getUuid() == null) {
+						aBatch.setReleaseCode(ReleaseStatus.failure.value());
+						aBatch.setReleaseStatus(ReleaseStatus.failure.getPhrase());
+					}
+					fillInGoods(goods, aBatch);
+					newGoods = goods;
+					break;
+				}
+			}
+			if (newGoods == null) {
+				newGoods = aBatch.releaseProductByBatchConvertToGoods(aBatch);
+			}
+			ResultMap resultMap = goodsService.updateGoods(newGoods);
+			if (resultMap.isSuccess()) {
+				Goods goods1 = (Goods) resultMap.getData();
+				if (Status.REMOVED.value() == aBatch.getStatus() && Status.REMOVED.value() != goods1.getStatus()) {
+					ResultMap offMap = goodsService.offShelfGoodsByProvider(newGoods.getBatchCode(), null, false);
+					if (offMap.isSuccess()) {
+						result++;
+					} else {
+						aBatch.setErrmsg(offMap.getMessage());
+						aBatch.setReleaseCode(ReleaseStatus.lack_info.value());
+						aBatch.setReleaseStatus(ReleaseStatus.lack_info.getPhrase());
+					}
+				} else {
+					result++;
+				}
+			} else {
+				aBatch.setErrmsg(resultMap.getMessage());
+				aBatch.setReleaseCode(ReleaseStatus.lack_info.value());
+				aBatch.setReleaseStatus(ReleaseStatus.lack_info.getPhrase());
+			}
+		}
+		return result;
+	}
+
 	/**
 	 * 给自定义标签为空的batch设置默认自定义标签
 	 * @param batchList
@@ -622,21 +686,21 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 				rowNum, ModifyConstant.PRODUCT_SPEC);
 		aProduct.setSpec(StringUtilB2C.getStr(specValue));
 
-		Cell productCell = row.getCell(ModifyConstant.PRODUCE_DATE);
-		if (productCell != null && productCell.getCellType() == 0) {
-			if (HSSFDateUtil.isCellDateFormatted(productCell)) {
-				SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-				String productStr = sdf.format(productCell.getDateCellValue());
-				aProduct.setProductDateByExcel(productStr);
-			} else {
-				aProduct.setProductDateByExcel(readWorkBookCell(row.getCell(ModifyConstant.PRODUCE_DATE), Cell.CELL_TYPE_STRING,
-						rowNum, ModifyConstant.PRODUCE_DATE));
-			}
-		} else {
-			Object produceValue = readWorkBookCell(row.getCell(ModifyConstant.PRODUCE_DATE), Cell.CELL_TYPE_STRING,
-					rowNum, ModifyConstant.PRODUCE_DATE);
-			aProduct.setProductDateByExcel(produceValue);
-		}
+//		Cell productCell = row.getCell(ModifyConstant.PRODUCE_DATE);
+//		if (productCell != null && productCell.getCellType() == 0) {
+//			if (HSSFDateUtil.isCellDateFormatted(productCell)) {
+//				SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+//				String productStr = sdf.format(productCell.getDateCellValue());
+//				aProduct.setProductDateByExcel(productStr);
+//			} else {
+//				aProduct.setProductDateByExcel(readWorkBookCell(row.getCell(ModifyConstant.PRODUCE_DATE), Cell.CELL_TYPE_STRING,
+//						rowNum, ModifyConstant.PRODUCE_DATE));
+//			}
+//		} else {
+//			Object produceValue = readWorkBookCell(row.getCell(ModifyConstant.PRODUCE_DATE), Cell.CELL_TYPE_STRING,
+//					rowNum, ModifyConstant.PRODUCE_DATE);
+//			aProduct.setProductDateByExcel(produceValue);
+//		}
 
 		Object packageMethodValue = readWorkBookCell(row.getCell(ModifyConstant.PACKAGE_METHOD), Cell.CELL_TYPE_STRING,
 				rowNum, ModifyConstant.PACKAGE_METHOD);
@@ -677,52 +741,21 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
             aProduct.setReserveByExcel(reserveValue);
         }
 
-		Object statusValue = readWorkBookCell(row.getCell(ModifyConstant.SALE_STATUS), Cell.CELL_TYPE_STRING,
-				rowNum, ModifyConstant.SALE_STATUS);
+		Object statusValue = readWorkBookCell(row.getCell(ModifyConstant.COST_PRICE), Cell.CELL_TYPE_STRING,
+				rowNum, ModifyConstant.COST_PRICE);
         if (!StringUtils.isEmpty(statusValue)) {
-            aProduct.setStatusByExcel(statusValue);
+            aProduct.setCostPriceByExcel(statusValue);
         }
 
-		Object tagValue = readWorkBookCell(row.getCell(ModifyConstant.CUSTOM_LABEL), Cell.CELL_TYPE_STRING,
-				rowNum, ModifyConstant.CUSTOM_LABEL);
-        if (!StringUtils.isEmpty(tagValue)) {
-            aProduct.setTagByExcel(tagValue.toString().trim());
-        }
-		// 自定义标签不为null,则检查是否重复
-		if (aProduct.getCode() != null && aProduct.getBrandNameEn() != null && aProduct.getTag() != null) {
-			resetTag(aProduct);
-		}
-	}
-
-	/**
-	 * 验证批次号是否正确,并为该公司下的goods
-	 * @param batchCode
-	 * @param aBatch
-	 * @return
-	 */
-	private boolean validateBatchCode(String batchCode, ReleaseProductByBatch aBatch) {
-		if (StringUtils.isEmpty(batchCode)) {
-			return false;
-		}
-		Goods goods = goodsDao.findByBatchCode(batchCode);
-		if (goods == null) {
-			return false;
-		}
-		aBatch.setB2cBranden(goods.getBrandNameEn());
-		aBatch.setBrandNameEn(goods.getBrandNameEn());
-		aBatch.setKindName(goods.getKindNameCn());
-		aBatch.setB2cCode(goods.getCode());
-		aBatch.setCode(goods.getCode());
-		aBatch.setCurrency(goods.getCurrencyName());
-		if (goods.getUuid() == null) {
-			aBatch.setReleaseCode(ReleaseStatus.failure.value());
-			aBatch.setReleaseStatus(ReleaseStatus.failure.getPhrase());
-		}
-		Long enuu = SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null;
-		if (goods.getEnUU() != null) {
-			return goods.getEnUU().equals(enuu);
-		}
-		return goods.getEnUU() == null && enuu == null;
+//		Object tagValue = readWorkBookCell(row.getCell(ModifyConstant.CUSTOM_LABEL), Cell.CELL_TYPE_STRING,
+//				rowNum, ModifyConstant.CUSTOM_LABEL);
+//        if (!StringUtils.isEmpty(tagValue)) {
+//            aProduct.setTagByExcel(tagValue.toString().trim());
+//        }
+//		// 自定义标签不为null,则检查是否重复
+//		if (aProduct.getCode() != null && aProduct.getBrandNameEn() != null && aProduct.getTag() != null) {
+//			resetTag(aProduct);
+//		}
 	}
 
 	private void validateModifyExcel(Row headerRow) {
@@ -746,19 +779,22 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			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;
-					}
-				}
+				aBatch.setErrmsg(ErrorInfoConstant.REPEAT_IN_EXCEL.getInfo());
+				aBatch.setReleaseCode(ReleaseStatus.had_exists.value());
+				aBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
+//				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;
+//					}
+//				}
 			}
 		}
 	}
@@ -934,7 +970,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			aProduct.setUsdTaxRate(0d);
 		} else {
 			aProduct.setCurrency("RMB");
-			aProduct.setRmbTaxRate(0.17d);
+			aProduct.setRmbTaxRate(0.16d);
 		}
 	}
 

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


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


BIN
src/main/resources/jxls-tpl/trade/releaseByBatch-rmb.xls


BIN
src/main/resources/jxls-tpl/trade/releasebyBatch-usd.xls


BIN
src/main/webapp/resources/img/all/default.png


BIN
src/main/webapp/resources/img/all/empty-cart.png


BIN
src/main/webapp/resources/img/all/qrcode_mall.png


BIN
src/main/webapp/resources/img/all/u.png


BIN
src/main/webapp/resources/img/common/mall-logo.png


BIN
src/main/webapp/resources/img/common/uas-mall.png


BIN
src/main/webapp/resources/img/common/uas_mall.png


BIN
src/main/webapp/resources/img/example/tip_logo.png


BIN
src/main/webapp/resources/img/help/brand.png


BIN
src/main/webapp/resources/img/help/buy-search.png


BIN
src/main/webapp/resources/img/help/kind.png


BIN
src/main/webapp/resources/img/help/market.png


BIN
src/main/webapp/resources/img/help/orderinfo.png


BIN
src/main/webapp/resources/img/help/register.png


BIN
src/main/webapp/resources/img/help/search.png


BIN
src/main/webapp/resources/img/help/search1.png


BIN
src/main/webapp/resources/img/help/search2.png


BIN
src/main/webapp/resources/img/help/search3.png


BIN
src/main/webapp/resources/img/help/seller-apply-brand.png


BIN
src/main/webapp/resources/img/help/seller-apply-component.png


BIN
src/main/webapp/resources/img/help/seller-apply-componentInfo.png


BIN
src/main/webapp/resources/img/help/seller-batch-publish.png


BIN
src/main/webapp/resources/img/help/sign.png


BIN
src/main/webapp/resources/img/logo/squirrel_logo_weixin.jpg


BIN
src/main/webapp/resources/img/logo/uas_mall.png


BIN
src/main/webapp/resources/img/logo/uas_mall_hor.png


BIN
src/main/webapp/resources/img/mobile/client-icon-32.png


BIN
src/main/webapp/resources/img/mobile/yrsc_weixin.jpg


BIN
src/main/webapp/resources/img/store/common/default.png


BIN
src/main/webapp/resources/img/user/images/default.png


BIN
src/main/webapp/resources/img/user/images/erweima01.jpg


BIN
src/main/webapp/resources/img/user/images/logo.png


BIN
src/main/webapp/resources/img/vendor/images/erweima01.jpg


BIN
src/main/webapp/resources/img/vendor/images/logo.png


BIN
src/main/webapp/resources/img/vendor/images/user_logo.png


+ 1 - 1
src/main/webapp/resources/js/sso/controllers/staffManagementCtrl.js

@@ -262,7 +262,7 @@ define(['app/app'], function (app) {
             // }
             Enterprise.removeUser({uu: user.userUU}, function () {
                 toaster.pop('success', '提示', '用户删除成功。');
-                $scope.tableParams.page(1);
+                // $scope.tableParams.page(1);
                 $scope.tableParams.reload();
                 $scope.showDelUserFlag = false;
             }, function (response) {

+ 9 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/bomListDetailCtrl.js

@@ -277,7 +277,15 @@ define(['app/app'], function(app) {
             }, function (err) {
                 toaster.pop('error', err.data);
             })
-        }
+        };
+
+        // 新增单条物料信息
+        $scope.addNewBom = function () {
+            $scope.bomData.seekPurchaseByBatchs.unshift({});
+            $scope.setEditBom(true);
+            $scope.onCheckAllCheck();
+        };
+
         // 删除BOM提示框
         $scope.showDeleteBomBox = false;
         $scope.setShowDeleteBomBox = function (flag) {

+ 1 - 0
src/main/webapp/resources/view/usercenter/forstore/bomListDetail.html

@@ -211,6 +211,7 @@
         <button class="operate-btn" ng-click="setEditBom(true)">编辑BOM</button>
         <button class="operate-btn" ng-click="deleteProduct()">删除物料</button>
         <button class="operate-btn" ng-click="deleteBom()">删除本BOM</button>
+        <button class="operate-btn" ng-click="addNewBom()">新增物料</button>
         <div class="fr" ng-show="editBom || editSeek">
             <button class="sure-btn" ng-click="sure(true)">确认</button>
             <button class="sure-btn cancel-btn" ng-click="sure(false)">取消</button>