Browse Source

Merge remote-tracking branch 'origin/dev-mysql' into dev-mysql

hulh 8 years ago
parent
commit
ff1deacfb8

+ 4 - 4
src/main/java/com/uas/platform/b2c/common/account/controller/EnterpriseController.java

@@ -214,13 +214,13 @@ public class EnterpriseController {
 			if (!CollectionUtils.isEmpty(applyUserSpacePage.getContent())) {
 			if (!CollectionUtils.isEmpty(applyUserSpacePage.getContent())) {
 				List<ApplyUserSpace> applyUserSpaceList = applyUserSpacePage.getContent();
 				List<ApplyUserSpace> applyUserSpaceList = applyUserSpacePage.getContent();
 				for (ApplyUserSpace applyUserSpace : applyUserSpaceList) {
 				for (ApplyUserSpace applyUserSpace : applyUserSpaceList) {
-					Enterprise e = enterpriseService.findByEnBussinessCode(applyUserSpace.getBusinessCode());
+					List<Enterprise> e = enterpriseService.findByEnBussinessCode(applyUserSpace.getBusinessCode());
 					User admin = null;
 					User admin = null;
-					if (null != e && null != e.getEnAdminuu()) {
-						admin = userService.findUserByUserUU(e.getEnAdminuu());
+					if (!CollectionUtils.isEmpty(e) && e.get(0).getEnAdminuu() != null) {
+						admin = userService.findUserByUserUU(e.get(0).getEnAdminuu());
 					}
 					}
 					Map<String,Object> map = new HashMap<>();
 					Map<String,Object> map = new HashMap<>();
-					map.put("enName", e.getEnName());
+					map.put("enName", CollectionUtils.isEmpty(e) ? "" : e.get(0).getEnName());
 					map.put("date",applyUserSpace.getSubmitDate());
 					map.put("date",applyUserSpace.getSubmitDate());
 					map.put("adminName",admin == null ? null : admin.getUserName());
 					map.put("adminName",admin == null ? null : admin.getUserName());
 					map.put("status",applyUserSpace.getStatus());
 					map.put("status",applyUserSpace.getStatus());

+ 1 - 1
src/main/java/com/uas/platform/b2c/common/account/dao/EnterpriseDao.java

@@ -25,5 +25,5 @@ public interface EnterpriseDao extends JpaSpecificationExecutor<Enterprise>, Jpa
 	 * @param bussinessCode
 	 * @param bussinessCode
 	 * @return
 	 * @return
 	 */
 	 */
-	public Enterprise findByEnBussinessCode(String bussinessCode);
+	public List<Enterprise> findByEnBussinessCode(String bussinessCode);
 }
 }

+ 1 - 1
src/main/java/com/uas/platform/b2c/common/account/service/EnterpriseService.java

@@ -44,7 +44,7 @@ public interface EnterpriseService {
 	 * @param bussinessCode
 	 * @param bussinessCode
 	 * @return
 	 * @return
 	 */
 	 */
-	Enterprise findByEnBussinessCode(String bussinessCode);
+	List<Enterprise> findByEnBussinessCode(String bussinessCode);
 
 
 	/**
 	/**
 	 * 个人用户注册企业信息
 	 * 个人用户注册企业信息

+ 1 - 1
src/main/java/com/uas/platform/b2c/common/account/service/impl/EnterpriseServiceImpl.java

@@ -57,7 +57,7 @@ public class EnterpriseServiceImpl implements EnterpriseService{
 	}
 	}
 
 
 	@Override
 	@Override
-	public Enterprise findByEnBussinessCode(String bussinessCode) {
+	public List<Enterprise> findByEnBussinessCode(String bussinessCode) {
 		return enterpriseDao.findByEnBussinessCode(bussinessCode);
 		return enterpriseDao.findByEnBussinessCode(bussinessCode);
 	}
 	}
 
 

+ 1 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/constant/ErrorInfoConstant.java

@@ -18,6 +18,7 @@ public enum  ErrorInfoConstant {
     PRODUCE_DATE_INFO("E列:生产日期不能为空"),
     PRODUCE_DATE_INFO("E列:生产日期不能为空"),
     PACKAGE_METHOD_INFO("F列:包装方式只能填写中英文"),
     PACKAGE_METHOD_INFO("F列:包装方式只能填写中英文"),
     PACKAGE_EMPTY_INFO("F列:包装方式不能为空"),
     PACKAGE_EMPTY_INFO("F列:包装方式不能为空"),
+    PERSON_PACKAGE_EMPTY_INFO("C列:规格信息不能为空"),
     DELIVERY_EMPTY_INFO("G-H列:存在交期的信息为空"),
     DELIVERY_EMPTY_INFO("G-H列:存在交期的信息为空"),
     DELIVERY_VALUE_INFO("G-H列:交期只能填写1-31之间的整数值"),
     DELIVERY_VALUE_INFO("G-H列:交期只能填写1-31之间的整数值"),
     PRICE_INFO("K列:单价必须是小于1万的正数"),
     PRICE_INFO("K列:单价必须是小于1万的正数"),

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

@@ -584,7 +584,11 @@ public class ReleaseProductByBatch implements Serializable {
 				}
 				}
 			}
 			}
 		} else {
 		} else {
-			addErrmsg(ErrorInfoConstant.PACKAGE_EMPTY_INFO.getInfo());
+			if (!isAPerson) {
+				addErrmsg(ErrorInfoConstant.PACKAGE_EMPTY_INFO.getInfo());
+			} else {
+				addErrmsg(ErrorInfoConstant.PERSON_PACKAGE_EMPTY_INFO.getInfo());
+			}
 		}
 		}
 		String packagingData = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(value));
 		String packagingData = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(value));
 		try {
 		try {

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

@@ -29,6 +29,7 @@ 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.model.StoreStatus;
 import com.uas.platform.b2c.prod.store.service.StoreInService;
 import com.uas.platform.b2c.prod.store.service.StoreInService;
 import com.uas.platform.b2c.trade.order.StringConstant.Currency;
 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.exception.IllegalOperatorException;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.persistence.criteria.CriterionExpression;
 import com.uas.platform.core.persistence.criteria.CriterionExpression;
@@ -1042,12 +1043,13 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 
 
 		List<ReleaseProductByBatch> releaseProductByBatchList =
 		List<ReleaseProductByBatch> releaseProductByBatchList =
 				releaseProductByBatchDao.findByRelbatchid(batch);
 				releaseProductByBatchDao.findByRelbatchid(batch);
+		List<Long> productIds = null;
+		List<ProductPrivate> productPrivateList = null;
 		if (!CollectionUtils.isEmpty(releaseProductByBatchList)) {
 		if (!CollectionUtils.isEmpty(releaseProductByBatchList)) {
 			List<com.uas.ps.entity.Product> products = convertProduct(releaseProductByBatchList,false);
 			List<com.uas.ps.entity.Product> products = convertProduct(releaseProductByBatchList,false);
 			// TODO 什么接口
 			// TODO 什么接口
 			String result = restTemplate.postForEntity(productServiceIp + "/product/update", products, String.class).getBody();
 			String result = restTemplate.postForEntity(productServiceIp + "/product/update", products, String.class).getBody();
-			List<Long> productIds = JSON.parseArray(result, Long.class);
-			// 默认为b2c Enable开启
+			productIds = JSON.parseArray(result, Long.class);
 			List<ProductPrivate> productPrivates = new ArrayList<>();
 			List<ProductPrivate> productPrivates = new ArrayList<>();
 			for (Long prId : productIds) {
 			for (Long prId : productIds) {
 				ProductPrivate productPrivate = productPrivateDao.findByPrId(prId);
 				ProductPrivate productPrivate = productPrivateDao.findByPrId(prId);
@@ -1056,14 +1058,10 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 					productPrivate.setPrId(prId);
 					productPrivate.setPrId(prId);
 				}
 				}
 				productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
 				productPrivate.setB2cEnabled(IntegerConstant.YES_SHORT);
-				// 统计现在有多少在售信息
-                int batchCount = goodsDao.findCountByProductid(prId);
-                productPrivate.setBatchCount(batchCount);
-                productPrivates.add(productPrivate);
+				productPrivates.add(productPrivate);
 			}
 			}
-			productPrivateDao.save(productPrivates);
+			productPrivateList = productPrivateDao.save(productPrivates);
 		}
 		}
-
 		Enterprise enterprise = SystemSession.getUser().getEnterprise();
 		Enterprise enterprise = SystemSession.getUser().getEnterprise();
 		final Object[] obj = new Object[]{enterprise.getUu(), enterprise.getEnName(), batch};
 		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_V2(@enuu, @enName, @batch, @out); select @out";
@@ -1082,6 +1080,14 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 			}
 			}
 		});
 		});
 
 
+		if (null != productIds) {
+			for (ProductPrivate productPrivate : productPrivateList) {
+				// 统计现在有多少在售信息
+				int batchCount = goodsDao.findCountByProductid(productPrivate.getPrId());
+				productPrivate.setBatchCount(batchCount);
+			}
+			productPrivateDao.save(productPrivateList);
+		}
 
 
 //		Enterprise enterprise = SystemSession.getUser().getEnterprise();
 //		Enterprise enterprise = SystemSession.getUser().getEnterprise();
 //		final Object[] obj = new Object[]{enterprise.getUu(), enterprise.getEnName(), batch};
 //		final Object[] obj = new Object[]{enterprise.getUu(), enterprise.getEnName(), batch};
@@ -1124,8 +1130,8 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		}
 		}
 		List<com.uas.ps.entity.Product> products = new ArrayList<>();
 		List<com.uas.ps.entity.Product> products = new ArrayList<>();
 		for (ReleaseProductByBatch releaseProductByBatch : releaseProductByBatchList) {
 		for (ReleaseProductByBatch releaseProductByBatch : releaseProductByBatchList) {
-		    if (releaseProductByBatch.getReleaseCode().equals(ReleaseStatus.failure) ||
-                    releaseProductByBatch.getReleaseCode().equals(ReleaseStatus.success)) {
+		    if (releaseProductByBatch.getReleaseCode().equals(ReleaseStatus.failure.value()) ||
+                    releaseProductByBatch.getReleaseCode().equals(ReleaseStatus.success.value())) {
                 com.uas.ps.entity.Product product = new com.uas.ps.entity.Product();
                 com.uas.ps.entity.Product product = new com.uas.ps.entity.Product();
                 // releaseProductByBatch.getCode(); 在公有库生成
                 // releaseProductByBatch.getCode(); 在公有库生成
                 product.setMinPack(releaseProductByBatch.getMinPackage());
                 product.setMinPack(releaseProductByBatch.getMinPackage());

+ 5 - 5
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_account_management_ctrl.js

@@ -760,7 +760,7 @@ define(['app/app'], function(app) {
           $scope.emailEnable = function (newUserEmail) {
           $scope.emailEnable = function (newUserEmail) {
             //邮箱不可用
             //邮箱不可用
             if ((newUserEmail == null || newUserEmail.length > 30)
             if ((newUserEmail == null || newUserEmail.length > 30)
-                || !/^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(
+                || !(/^([0-9A-Za-z\-_\.]+)@([0-9a-z]+\.[a-z]{2,3}(\.[a-z]{2})?)$/g).test(
                     newUserEmail)) {
                     newUserEmail)) {
               $scope.checkSuccess1 = false;
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
               $scope.checkFailed1 = true;
@@ -819,8 +819,8 @@ define(['app/app'], function(app) {
           //校验验证码
           //校验验证码
           $scope.validCheckCode = function (checkCode) {
           $scope.validCheckCode = function (checkCode) {
             if(!checkCode){
             if(!checkCode){
-              $scope.checkSuccess2 = false;
-              $scope.checkFailed2 = true;
+              // $scope.checkSuccess2 = false;
+              // $scope.checkFailed2 = true;
               return false;
               return false;
             }
             }
             User.validCheckCode({checkCode: checkCode,newUserEmail:$scope.user.newUserEmail}, function (data) {
             User.validCheckCode({checkCode: checkCode,newUserEmail:$scope.user.newUserEmail}, function (data) {
@@ -989,8 +989,8 @@ define(['app/app'], function(app) {
           //校验验证码
           //校验验证码
           $scope.validTelCheckCode = function (telCheckCode) {
           $scope.validTelCheckCode = function (telCheckCode) {
             if(!telCheckCode){
             if(!telCheckCode){
-              $scope.checkSuccess2 = false;
-              $scope.checkFailed2 = true;
+              // $scope.checkSuccess2 = false;
+              // $scope.checkFailed2 = true;
               return false;
               return false;
             }
             }
             User.validTelCheckCode({telCheckCode: telCheckCode,newUserTel:$scope.user.newUserTel},
             User.validTelCheckCode({telCheckCode: telCheckCode,newUserTel:$scope.user.newUserTel},

+ 1 - 1
src/main/webapp/resources/view/vendor/modal/updateUserEmail.html

@@ -111,7 +111,7 @@
             <label class="col-md-3 col-sm-3 col text-right" ng-show="userInfo.userEmail==null?true:false">邮箱地址:</label>
             <label class="col-md-3 col-sm-3 col text-right" ng-show="userInfo.userEmail==null?true:false">邮箱地址:</label>
             <div class="col-md-8 col-sm-8 col">
             <div class="col-md-8 col-sm-8 col">
                 <input ng-model="user.newUserEmail"
                 <input ng-model="user.newUserEmail"
-                       class="form-control input-sm" type="newUserEmail" ng-blur="emailEnable(user.newUserEmail)" placeholder="新邮箱地址">
+                       class="form-control input-sm" type="newUserEmail" ng-change="emailEnable(user.newUserEmail)" placeholder="新邮箱地址">
                 <!-- <div>密码复杂度</div> -->
                 <!-- <div>密码复杂度</div> -->
             </div>
             </div>
             <div class="col">
             <div class="col">

+ 1 - 1
src/main/webapp/resources/view/vendor/modal/updateUserTel.html

@@ -110,7 +110,7 @@
             <label class="col-md-3 col-sm-3 col text-right">新手机号:</label>
             <label class="col-md-3 col-sm-3 col text-right">新手机号:</label>
             <div class="col-md-8 col-sm-8 col">
             <div class="col-md-8 col-sm-8 col">
                 <input ng-model="user.newUserTel"
                 <input ng-model="user.newUserTel"
-                       class="form-control input-sm" type="newUserTel" ng-blur="telEnable(user.newUserTel)">
+                       class="form-control input-sm" type="newUserTel" ng-change="telEnable(user.newUserTel)">
                 <!-- <div>密码复杂度</div> -->
                 <!-- <div>密码复杂度</div> -->
             </div>
             </div>
             <div class="col">
             <div class="col">