Browse Source

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

liusw 7 years ago
parent
commit
0503f52b01

+ 4 - 1
.gitignore

@@ -60,5 +60,8 @@ buildNumber.properties
 # /src/test/
 /src/test/java/com/uas/platform/b2c/RegistForMall.java
 /src/test/java/com/uas/platform/b2c/testForRestTemplate.java
-/.gitignore
 /src/test/java/com/uas/platform/b2c/testAaa.java
+/src/main/java/com/uas/platform/b2c/fa/payment/dao/AssociatorSubAccountDao.java
+/src/main/java/com/uas/platform/b2c/fa/payment/model/AssociatorSubAccount.java
+/.gitignore
+!/.gitignore

+ 11 - 1
src/main/java/com/uas/platform/b2c/prod/commodity/dao/ReleaseProductByBatchDao.java

@@ -79,9 +79,19 @@ public interface ReleaseProductByBatchDao
      * @param publisherUu the publisher uu 发布人
      * @param batchid     the batchid 批次号
      */
-    @Procedure(procedureName = "PRODUCT_RELEASE_VALID_V2")
+    @Procedure(procedureName = "PRODUCT_RELEASE_VALID_V3")
 	public void callValidProcedure(Long publisherUu, String batchid);
 
+
+	/**
+	 * 批量上架验证数据信息是否重复
+	 * @param batch 本批次代码
+	 * @param isPersonal 是否是个人
+	 * @param enuu 公司enuu
+	 */
+	@Procedure(procedureName = "PRODUCT_RELEASE_EXIST_VALID_V1")
+	void callReleaseExistValidProcedure(String batch, Boolean isPersonal, Long enuu);
+
 	/**
 	 * 验证器件和品牌的信息pcb
 	 * @param publisherUu

+ 2 - 2
src/main/java/com/uas/platform/b2c/prod/commodity/model/Product.java

@@ -19,8 +19,8 @@ import java.util.Set;
 	@Index(name = "products_enuu_index", columnList = "pr_enuu"),
 	@Index(name = "products_cmpcode_index", columnList = "pr_cmpcode"),
 	@Index(name = "products_brand_index", columnList = "pr_brand"),
-	@Index(name = "products_enuu_code_index", columnList = "pr_code, pr_enuu", unique = true),
-	@Index(name = "products_enuu_standard_index", columnList = "pr_enuu, pr_standard"),
+	@Index(name = "products_enuu_code_index", columnList = "pr_enuu,pr_code", unique = true),
+	@Index(name = "products_enuu_standard_index", columnList = "pr_enuu,pr_standard"),
 	@Index(name = "products_erpdown_index", columnList = "pr_erpdown")})
 @Logger
 //@Cacheable

+ 15 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java

@@ -542,6 +542,12 @@ public class ReleaseProductByBatch implements Serializable {
 	@Column(name = "rel_spec")
 	private String spec;
 
+	/**
+	 * 物料id信息
+	 */
+	@Column(name = "rel_productid")
+	private Long productid;
+
 	/**
 	 * 规格书信息
 	 */
@@ -1823,4 +1829,13 @@ public class ReleaseProductByBatch implements Serializable {
 		this.goodsCount = goodsCount;
 		return this;
 	}
+
+	public Long getProductid() {
+		return productid;
+	}
+
+	public ReleaseProductByBatch setProductid(Long productid) {
+		this.productid = productid;
+		return this;
+	}
 }

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

@@ -243,44 +243,36 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 						releaseProductByBatch.setErrmsg(releaseProductByBatch.getErrmsg().substring(1));
 						releaseProductByBatch.setReleaseCode(ReleaseStatus.lack_info.value());
 						releaseProductByBatch.setReleaseStatus(ReleaseStatus.lack_info.getPhrase());
-					} else {
-						// 导入成功的需要判断自定义标签是否重复
-						if (!CollectionUtils.isEmpty(releaseProductByBatchs) && releaseProductByBatch.getTag() != null) {
-							if (validateTagInfo(releaseProductByBatch, releaseProductByBatchs)) {
-								releaseProductByBatch.setTag(null);
-							}
-						}
-						validateRepeatInExcel(releaseProductByBatchs, releaseProductByBatch, isImport);
 					}
-					// 简单验证数据,防止空行保存的情况
-					if (blankNum != 3) {
+					// 简单验证数据,防止空行保存的情况(品牌、类目、型号、库存量)
+					if (blankNum != 4) {
 						total++;
 						releaseProductByBatchs.add(releaseProductByBatch);
 					}
 				}
 			}
 		}
+
 		Long userUU = SystemSession.getUser().getUserUU();
 		Long enUU = SystemSession.getUser().getEnterprise().getUu();
 		List<ReleaseProductByBatch> addList = new ArrayList<>(releaseProductByBatchs.size());
 		addList.addAll(releaseProductByBatchs);
-		resetRepeatData(addList, isImport, isAPerson);
+        commonDao.save(addList, ReleaseProductByBatch.class);
+        releaseProductByBatchDao.callReleaseExistValidProcedure(batch, isAPerson, enUU);
 		if (isAPerson) {
 			for (ReleaseProductByBatch releaseProductByBatch : addList) {
-				List<Product> productList = productDao.findByEnUUAndPcmpcodeAndPbrandenAndB2cEnabled(enUU,releaseProductByBatch.getB2cCode(),
-						releaseProductByBatch.getB2cBranden(),IntegerConstant.YES_SHORT);
-				if (!CollectionUtils.isEmpty(productList)) {
-				    List<ProductPerson> productPersonList = productPersonDao.findByProductId(productList.get(0).getId());
-				    if (!CollectionUtils.isEmpty(productPersonList)) {
+                Long productid = releaseProductByBatch.getProductid();
+                if (productid != null) {
+                    List<ProductPerson> productPersonList = productPersonDao.findByProductId(productid);
+                    if (!CollectionUtils.isEmpty(productPersonList)) {
                         releaseProductByBatch.setErrmsg(ErrorInfoConstant.REPEAT_INFO.getInfo());
                         releaseProductByBatch.setReleaseCode(ReleaseStatus.had_exists.value());
                         releaseProductByBatch.setReleaseStatus(ReleaseStatus.had_exists.getPhrase());
                         total --;
                     }
-				}
+                }
 			}
 		}
-		commonDao.save(addList, ReleaseProductByBatch.class);
 
 		if (isPcb) {
 			releaseProductByBatchDao.callValidProcedurePcb(enUU, batch);
@@ -1721,7 +1713,7 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		}
 		Enterprise enterprise = SystemSession.getUser().getEnterprise();
 		final Object[] obj = new Object[]{enterprise.getUu(), enterprise.getEnName(), batch};
-		String sql = "/*#mycat:db_type=master*/ set @enuu = %s; set @enName = '%s'; set @batch = '%s'; call RELEASE_TO_GOODS_V2(@enuu, @enName, @batch, @out); select @out";
+		String sql = "/*#mycat:db_type=master*/ set @enuu = %s; set @enName = '%s'; set @batch = '%s'; call RELEASE_TO_GOODS_V3(@enuu, @enName, @batch, @out); select @out";
 		final String updateSql = String.format(sql, obj);
 		String num = jdbcTemplate.execute(new StatementCallback<String>() {
 

+ 10 - 6
src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java

@@ -1652,14 +1652,18 @@ public class OrderServiceImpl implements OrderService {
     @Override
     public Order findOrderDetail(String orderid) {
         Order order = orderDao.findOrderByOrderid(orderid);
-        if (order.getBuyerenuu() != null && order.getBuyerentername() == null) {
-            Enterprise enterprise = enterpriseDao.findByUu(order.getBuyerenuu());
-            if (enterprise != null) {
-                order.setBuyerentername(enterprise.getEnName());
+        if (order != null) {
+            if (order.getBuyerenuu() != null && order.getBuyerentername() == null) {
+                Enterprise enterprise = enterpriseDao.findByUu(order.getBuyerenuu());
+                if (enterprise != null) {
+                    order.setBuyerentername(enterprise.getEnName());
+                }
             }
+            order.setReceiveName(sysConf.getEnName());
+            return order;
+        } else {
+            throw new IllegalOperatorException("找不到指定的订单");
         }
-        order.setReceiveName(sysConf.getEnName());
-        return order;
     }
 
     @Override

+ 3 - 1
src/main/resources/dev/jdbc.properties

@@ -8,4 +8,6 @@ jdbc.maxIdle=50
 jdbc.minIdle=1
 jdbc.suspectTimeout=60
 jdbc.timeBetweenEvictionRunsMillis=30000
-jdbc.minEvictableIdleTimeMillis=60000
+jdbc.minEvictableIdleTimeMillis=60000
+jdbc.validationQuery=SELECT 1
+jdbc.testWhileIdle=true

BIN
src/main/resources/jxls-tpl/product/product-import-error.xls


BIN
src/main/resources/jxls-tpl/product/productStandarPutOn.xls


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


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


+ 1 - 1
src/main/resources/log4j.properties

@@ -8,7 +8,7 @@ log4j.appender.stdout.layout.ConversionPattern=%d %p [%c]:%m%n
 
 log4j.appender.logfile=org.apache.log4j.RollingFileAppender
 log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
-#log4j.appender.logfile.File=../log4j.log
+log4j.appender.logfile.File=../log4j.log
 #log4j.appender.logfile.File=$CATALINA_BASE/logs/b2c_log4j.log
 # Keep three backup files.
 log4j.appender.logfile.MaxBackupIndex=3

+ 3 - 1
src/main/resources/prod/jdbc.properties

@@ -8,4 +8,6 @@ jdbc.maxIdle=50
 jdbc.minIdle=50
 jdbc.suspectTimeout=60
 jdbc.timeBetweenEvictionRunsMillis=30000
-jdbc.minEvictableIdleTimeMillis=60000
+jdbc.minEvictableIdleTimeMillis=60000
+jdbc.validationQuery=SELECT 1
+jdbc.testWhileIdle=true

+ 3 - 1
src/main/resources/test/jdbc.properties

@@ -8,4 +8,6 @@ jdbc.maxIdle=50
 jdbc.minIdle=1
 jdbc.suspectTimeout=60
 jdbc.timeBetweenEvictionRunsMillis=30000
-jdbc.minEvictableIdleTimeMillis=60000
+jdbc.minEvictableIdleTimeMillis=60000
+jdbc.validationQuery=SELECT 1
+jdbc.testWhileIdle=true