Эх сурвалжийг харах

Merge branch 'dev-mysql' into erp_batchToGoods_20180117

yujia 8 жил өмнө
parent
commit
e6a2dd73e6
20 өөрчлөгдсөн 144 нэмэгдсэн , 111 устгасан
  1. 6 3
      src/main/java/com/uas/platform/b2c/common/account/controller/EnterpriseController.java
  2. 1 1
      src/main/java/com/uas/platform/b2c/common/account/dao/EnterpriseDao.java
  3. 1 1
      src/main/java/com/uas/platform/b2c/common/account/service/EnterpriseService.java
  4. 1 1
      src/main/java/com/uas/platform/b2c/common/account/service/impl/EnterpriseServiceImpl.java
  5. 16 16
      src/main/java/com/uas/platform/b2c/logistics/service/impl/AddressServiceImpl.java
  6. 1 0
      src/main/java/com/uas/platform/b2c/prod/commodity/constant/ErrorInfoConstant.java
  7. 5 5
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/ProductController.java
  8. 1 1
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/ReleaseProductByBatchController.java
  9. 5 1
      src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java
  10. 2 2
      src/main/java/com/uas/platform/b2c/prod/commodity/service/ProductService.java
  11. 28 14
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ProductServiceImpl.java
  12. 40 31
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/ReleaseProductByBatchServiceImpl.java
  13. BIN
      src/main/resources/jxls-tpl/trade/releaseByBatch-person.xls
  14. 13 12
      src/main/webapp/resources/js/usercenter/controllers/forstore/account_manager_ctrl.js
  15. 15 14
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_account_management_ctrl.js
  16. 1 1
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialCtrl.js
  17. 4 4
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_materialPersonCtrl.js
  18. 2 2
      src/main/webapp/resources/view/vendor/forstore/vendor_material.html
  19. 1 1
      src/main/webapp/resources/view/vendor/modal/updateUserEmail.html
  20. 1 1
      src/main/webapp/resources/view/vendor/modal/updateUserTel.html

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

@@ -214,10 +214,13 @@ public class EnterpriseController {
 			if (!CollectionUtils.isEmpty(applyUserSpacePage.getContent())) {
 				List<ApplyUserSpace> applyUserSpaceList = applyUserSpacePage.getContent();
 				for (ApplyUserSpace applyUserSpace : applyUserSpaceList) {
-					Enterprise e = enterpriseService.findByEnBussinessCode(applyUserSpace.getBusinessCode());
-					User admin = userService.findUserByUserUU(e.getEnAdminuu());
+					List<Enterprise> e = enterpriseService.findByEnBussinessCode(applyUserSpace.getBusinessCode());
+					User admin = null;
+					if (!CollectionUtils.isEmpty(e) && e.get(0).getEnAdminuu() != null) {
+						admin = userService.findUserByUserUU(e.get(0).getEnAdminuu());
+					}
 					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("adminName",admin == null ? null : admin.getUserName());
 					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
 	 * @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
 	 * @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
-	public Enterprise findByEnBussinessCode(String bussinessCode) {
+	public List<Enterprise> findByEnBussinessCode(String bussinessCode) {
 		return enterpriseDao.findByEnBussinessCode(bussinessCode);
 	}
 

+ 16 - 16
src/main/java/com/uas/platform/b2c/logistics/service/impl/AddressServiceImpl.java

@@ -75,48 +75,48 @@ public class AddressServiceImpl implements AddressService {
 		Long useruu = address.getUseruu();
 		int type = address.getType();
 		List<Address> addresses = null;
-		if(useruu != null) {
+		if (Type.Address_Shipping_Code.value() == address.getType()) {
 			addresses = addressDao.findByUseruuAndEnuuAndTypeAndUsetypeOrderByNumAsc(useruu, address.getEnuu(), type, (short)1);
-		}else {
+		} else {
 			addresses = addressDao.findByEnuuAndTypeAndUsetypeOrderByNumAsc(address.getEnuu(), type, (short)2);
 		}
 		int num = 1;
-		long modifyId = address.getId().longValue();
-		int modifyNum = address.getNum().intValue();
-		if (setTop){
+		long modifyId = address.getId();
+		int modifyNum = address.getNum();
+		if (setTop) {
 			for (Address add : addresses) {
-				if (add.getId().longValue() == modifyId) {
+				if (add.getId() == modifyId) {
 					add.setNum(1);
 				} else {
 					// 这里拿到的已经是排序了的,直接依次设置num即可
 					add.setNum(++num);
 				}
 			}
-		}else {
-			if (modifyNum == 1){ //取消默认地址
+		} else {
+			if (modifyNum == 1) { //取消默认地址
 				for (Address add : addresses) { //空出默认地址位置
 					add.setNum(++num);
 				}
-			}else {
+			} else {
 				int firstNum = addresses.get(0).getNum();
-				if (firstNum == 1){ //有默认地址情况
+				if (firstNum == 1) { //有默认地址情况
 					num++; //空出默认地址位置
 					for (Address add : addresses) {
-						if (add.getNum() != 1){
-							if (add.getId().longValue() != modifyId){
+						if (add.getNum() != 1) {
+							if (add.getId() != modifyId) {
 								//不是修改的地址或者默认地址,则重新排序
 								add.setNum(++num);
-							}else {
+							} else {
 								add.setNum(2);
 							}
 						}
 					}
-				}else { //没有默认地址情况
+				} else { //没有默认地址情况
 					num++; //空出默认地址位置
 					for (Address add : addresses) {
-						if (add.getId().longValue() != modifyId){
+						if (add.getId() != modifyId) {
 							add.setNum(++num);
-						}else {
+						} else {
 							add.setNum(2);
 						}
 					}

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

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

@@ -232,16 +232,16 @@ public class ProductController {
 	 * 批量删除所有的非标的产品
 	 */
 	@RequestMapping(value = "/unstandard", method = RequestMethod.DELETE)
-	private ResultMap deleteUnstandardByBatch() {
-		 return productService.deleteBatch(ProductConstant.NSTANDARD);
+	private ResultMap deleteUnstandardByBatch(Integer isPerson) {
+		 return productService.deleteBatch(ProductConstant.NSTANDARD, isPerson);
 	}
 
 	/**
 	 * 批量删除所有的标准的产品
 	 */
 	@RequestMapping(value = "/standard", method = RequestMethod.DELETE)
-	private ResultMap deleteStandardByBatch() {
-		return productService.deleteBatch(ProductConstant.STANDARD);
+	private ResultMap deleteStandardByBatch(Integer isPerson) {
+		return productService.deleteBatch(ProductConstant.STANDARD, isPerson);
 	}
 
 	/**
@@ -290,7 +290,7 @@ public class ProductController {
 	 * @return
 	 */
 	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
-	public Product getProducts(@PathVariable("id") Long id) {
+	public V_ProductPrivate getProducts(@PathVariable("id") Long id) {
 		return productService.getProductById(id);
 	}
 

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

@@ -296,7 +296,7 @@ public class ReleaseProductByBatchController {
         ModelAndView modelAndView = new ModelAndView();
         logger.log("商品批次", "下载批量上架商品的Excel模板");
         if (null != isPerson && isPerson.intValue() == IntegerConstant.YES_SHORT.intValue()) {
-            modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/trade/releasebyBatch-person", "个人产品导入模板-优软商城"));
+            modelAndView.setView(new JxlsExcelView("classpath:jxls-tpl/trade/releaseByBatch-person", "个人产品导入模板-优软商城"));
             return modelAndView;
         }
         if (Currency.USD.equals(currency)) {

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

@@ -584,7 +584,11 @@ public class ReleaseProductByBatch implements Serializable {
 				}
 			}
 		} 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));
 		try {

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

@@ -57,7 +57,7 @@ public interface ProductService {
      *
      * @param type 批量删除的类型
      */
-    ResultMap deleteBatch(String type);
+    ResultMap deleteBatch(String type, Integer isPerson);
 
     /**
      * 单个匹配
@@ -168,7 +168,7 @@ public interface ProductService {
      * @param id
      * @return
      */
-    Product getProductById(Long id);
+    V_ProductPrivate getProductById(Long id);
 
     /**
      * 通过product id获取物料交易详情

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

@@ -194,6 +194,8 @@ public class ProductServiceImpl implements ProductService {
     @Override
     public Page<V_ProductPrivate> getAllProducts(final PageInfo page, String keyword, String type) {
         page.expression(PredicateUtils.eq("enUU", SystemSession.getUser().getEnterprise().getUu(), true));
+        page.expression(PredicateUtils.isNotNull("pcmpcode"));
+        page.expression(PredicateUtils.isNotNull("pbranden"));
         if (StringUtils.isEmpty(type)) {
             type = "nStandard";
         }
@@ -366,12 +368,12 @@ public class ProductServiceImpl implements ProductService {
             if (null != isPerson && isPerson.intValue() == IntegerConstant.YES_SHORT.intValue()) {
                 List<ProductPerson> productPersonList = productPersonDao.findByProductIdAndUserUU(id,SystemSession.getUser().getUserUU());
                 if (!CollectionUtils.isEmpty(productPersonList)) {
-                    Map<String,Object> requestMap = new HashMap<>();
-                    requestMap.put("userUU",productPersonList.get(0).getUserUU());
-                    requestMap.put("productId",productPersonList.get(0).getProductId());
-                    String res  = restTemplate.postForEntity( productServiceIp+"/product/assign/delete", null, String.class, requestMap).getBody();
-//                    Long ppid = productPersonList.get(0).getId();
-//                    productPersonDao.delete(ppid);
+//                    Map<String,Object> requestMap = new HashMap<>();
+//                    requestMap.put("userUU",productPersonList.get(0).getUserUU());
+//                    requestMap.put("productId",productPersonList.get(0).getProductId());
+//                    String res  = restTemplate.postForEntity( productServiceIp+"/product/assign/delete", null, String.class, requestMap).getBody();
+                    Long ppid = productPersonList.get(0).getId();
+                    productPersonDao.delete(ppid);
                 }
                 continue;
             }
@@ -409,7 +411,9 @@ public class ProductServiceImpl implements ProductService {
                     //删除外键关联的匹配结果列表,不然删除product失败
                     Set<ProductMatchResult> productMatchResultSet =  product.getMatchresults();
                     productMatchResultDao.delete(productMatchResultSet);
-                    goodsService.deleteGoods(goodses);
+                    if (CollectionUtils.isNotEmpty(goodses)) {
+                        goodsService.deleteGoods(goodses);
+                    }
                     ProductPrivate productPrivate = productPrivateDao.findByPrId(product.getId());
                     if (productPrivate == null) {
                         productPrivate = new ProductPrivate();
@@ -431,7 +435,7 @@ public class ProductServiceImpl implements ProductService {
      * @param type 批量删除的类型
      */
     @Override
-    public ResultMap deleteBatch(String type) {
+    public ResultMap deleteBatch(String type, Integer isPerson) {
         Integer standard = null;
         List<ProductPerson> personList = new ArrayList<>();
         Integer fail = 0;
@@ -445,6 +449,14 @@ public class ProductServiceImpl implements ProductService {
         List<Product> products = productDao.findProductByEnuuAndStandard(uu, standard);
         Set<String> uuids = new HashSet<>();
         for (Product product : products) {
+            if (null != isPerson && isPerson.intValue() == IntegerConstant.YES_SHORT.intValue()) {
+                List<ProductPerson> productPersonList = productPersonDao.findByProductIdAndUserUU(product.getId(),SystemSession.getUser().getUserUU());
+                if (!CollectionUtils.isEmpty(productPersonList)) {
+                    Long ppid = productPersonList.get(0).getId();
+                    productPersonDao.delete(ppid);
+                }
+                continue;
+            }
             try {
                 personList = productPersonDao.findByProductId(product.getId());
                 if (CollectionUtils.isNotEmpty(personList)) {
@@ -478,7 +490,10 @@ public class ProductServiceImpl implements ProductService {
                     Set<ProductMatchResult> productMatchResultSet =  product.getMatchresults();
                     productMatchResultDao.delete(productMatchResultSet);
                     goodsService.deleteGoods(goodses);
-                    productDao.delete(product.getId());
+                    //productDao.delete(product.getId());
+                    ProductPrivate productPrivate = productPrivateDao.findByPrId(product.getId());
+                    productPrivate.setB2cEnabled(IntegerConstant.NO_SHORT);
+                    productPrivateDao.save(productPrivate);
                     if (!StringUtils.isEmpty(product.getCmpUuId())) {
                         uuids.add(product.getCmpUuId());
                     }
@@ -1333,11 +1348,11 @@ public class ProductServiceImpl implements ProductService {
      * @return
      */
     @Override
-    public Product getProductById(Long id) {
-        if(id == null) {
+    public V_ProductPrivate getProductById(Long id) {
+        if (id == null) {
             return null;
-        }else {
-            return productDao.findOne(id);
+        } else {
+            return v_productPrivateDao.findOne(id);
         }
     }
 
@@ -1493,7 +1508,6 @@ public class ProductServiceImpl implements ProductService {
         g.setBreakUp(Boolean.FALSE);
         g.setReserve(product.getErpReserve());
         String packaging = (detail == null || detail.getPackaging() == null) ? product.getPackaging(): detail.getPackaging();
-        packaging =  (packaging == null) ? StringConstant.DEFAULTPACKAGING  : packaging;
         g.setPackaging(packaging);
 
         String produceDate = (detail == null || detail.getProduceDate() == null) ? product.getProduceDate() : detail.getProduceDate();

+ 40 - 31
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.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;
@@ -1042,12 +1043,13 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 
 		List<ReleaseProductByBatch> releaseProductByBatchList =
 				releaseProductByBatchDao.findByRelbatchid(batch);
+		List<Long> productIds = null;
+		List<ProductPrivate> productPrivateList = null;
 		if (!CollectionUtils.isEmpty(releaseProductByBatchList)) {
 			List<com.uas.ps.entity.Product> products = convertProduct(releaseProductByBatchList,false);
 			// TODO 什么接口
 			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<>();
 			for (Long prId : productIds) {
 				ProductPrivate productPrivate = productPrivateDao.findByPrId(prId);
@@ -1056,14 +1058,10 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 					productPrivate.setPrId(prId);
 				}
 				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();
 		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";
@@ -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();
 //		final Object[] obj = new Object[]{enterprise.getUu(), enterprise.getEnName(), batch};
@@ -1124,29 +1130,32 @@ public class ReleaseProductByBatchServiceImpl implements ReleaseProductByBatchSe
 		}
 		List<com.uas.ps.entity.Product> products = new ArrayList<>();
 		for (ReleaseProductByBatch releaseProductByBatch : releaseProductByBatchList) {
-			com.uas.ps.entity.Product product = new com.uas.ps.entity.Product();
-			// releaseProductByBatch.getCode(); 在公有库生成
-			product.setMinPack(releaseProductByBatch.getMinPackage());
-			product.setCmpImg(releaseProductByBatch.getImg());
-			product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
-			product.setBrand(releaseProductByBatch.getBrandNameEn());
-			product.setCmpCode(releaseProductByBatch.getCode());
-			product.setCmpUuid(releaseProductByBatch.getComponentUuId());
-			product.setKind(releaseProductByBatch.getKindName());
-			product.setKindId(releaseProductByBatch.getKindUuid());
-			product.setpCmpCode(releaseProductByBatch.getB2cCode());
-			product.setpBrand(releaseProductByBatch.getB2cBrandcn());
-			product.setpBrandEn(releaseProductByBatch.getB2cBranden());
-			product.setpBrandId(releaseProductByBatch.getBrandId());
-			product.setpBrandUuid(releaseProductByBatch.getBranduuid());
-			product.setStandard(releaseProductByBatch.getComponentUuId() == null ? (short)0 : (short)1);
-			product.setCmpUuid(releaseProductByBatch.getComponentUuId());
-			if (isAPerson) {
-				product.setSpec(releaseProductByBatch.getPackaging());
-			}
-			String batchCode = "PNUM" + createNumberService.getTimeNumber("trade$product_import_num", 8);
-			product.setCode(batchCode);
-			products.add(product);
+		    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();
+                // releaseProductByBatch.getCode(); 在公有库生成
+                product.setMinPack(releaseProductByBatch.getMinPackage());
+                product.setCmpImg(releaseProductByBatch.getImg());
+                product.setEnUU(SystemSession.getUser().getEnterprise().getUu());
+                product.setBrand(releaseProductByBatch.getBrandNameEn());
+                product.setCmpCode(releaseProductByBatch.getCode());
+                product.setCmpUuid(releaseProductByBatch.getComponentUuId());
+                product.setKind(releaseProductByBatch.getKindName());
+                product.setKindId(releaseProductByBatch.getKindUuid());
+                product.setpCmpCode(releaseProductByBatch.getB2cCode());
+                product.setpBrand(releaseProductByBatch.getB2cBrandcn());
+                product.setpBrandEn(releaseProductByBatch.getB2cBranden());
+                product.setpBrandId(releaseProductByBatch.getBrandId());
+                product.setpBrandUuid(releaseProductByBatch.getBranduuid());
+                product.setStandard(releaseProductByBatch.getComponentUuId() == null ? (short)0 : (short)1);
+                product.setCmpUuid(releaseProductByBatch.getComponentUuId());
+                if (isAPerson) {
+                    product.setSpec(releaseProductByBatch.getPackaging());
+                }
+                String batchCode = "PNUM" + createNumberService.getTimeNumber("trade$product_import_num", 8);
+                product.setCode(batchCode);
+                products.add(product);
+            }
 		}
 		return products;
 	}

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


+ 13 - 12
src/main/webapp/resources/js/usercenter/controllers/forstore/account_manager_ctrl.js

@@ -810,7 +810,7 @@ define(['app/app'], function (app) {
             });
           };
           //如果之前未绑定
-          if($scope.userInfo.userEmail==null?true:false){
+          if($scope.userInfo.userEmail==null ? true:false){
             $scope.checkSuccess = true;
           }
 
@@ -825,7 +825,6 @@ define(['app/app'], function (app) {
                     newUserEmail)) {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
-              $scope.sendSuccess = false;
               $scope.checkFailed1_1 = false;
               return false;
             }
@@ -833,25 +832,26 @@ define(['app/app'], function (app) {
               if (data.data == "true") {//邮箱可用
                 $scope.checkSuccess1 = true;
                 $scope.checkFailed1 = false;
-                $scope.sendSuccess = true;
                 $scope.checkFailed1_1 = false;
               } else {//邮箱不可用
                 $scope.checkSuccess1 = false;
                 $scope.checkFailed1 = false;
-                $scope.sendSuccess = false;
                 $scope.checkFailed1_1 = true;
               }
             }, function () {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
-              $scope.sendSuccess = false;
               $scope.checkFailed1_1 = false;
             });
           };
 
           $scope.codeSuccess = false;
+          $scope.sendSuccess = true;
           //发送验证码
           $scope.sendCheckCode = function (newUserEmail) {
+            if (!$scope.checkSuccess1 || ($scope.userInfo.userEmail==null && !$scope.checkSuccess)) {
+              return;
+						}
             $scope.sendSuccess = false;
             User.sendCheckCode({newUserEmail: newUserEmail}, function () {
               $scope.codeSuccess = true;
@@ -872,6 +872,7 @@ define(['app/app'], function (app) {
                   }, 1000, 60);
             }, function (response) {
               toaster.pop('error', '错误', response.data);
+              $scope.sendSuccess = true;
             });
           };
 
@@ -938,7 +939,6 @@ define(['app/app'], function (app) {
               $scope.validSuccess = false;
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = false;
-              $scope.sendSuccess = false;
               window.location.href = "user#/accountManager/sec";
               window.location.reload();
               $modalInstance.close();
@@ -983,7 +983,6 @@ define(['app/app'], function (app) {
           };
 
           //新手机号是否可用
-          $scope.sendSuccess = false;
           $scope.checkFailed1 = false;
           $scope.checkFailed1_1 = false;
           $scope.checkSuccess1 = false;
@@ -991,7 +990,6 @@ define(['app/app'], function (app) {
             if (newUserTel == null || !/^[0-9]{8,11}$/.test(newUserTel)) {
               $scope.checkFailed1 = true;
               $scope.checkSuccess1 = false;
-              $scope.sendSuccess = false;
               $scope.checkFailed1_1 = false;
               return false;
             }
@@ -1002,13 +1000,11 @@ define(['app/app'], function (app) {
               if (data.data == "true") {//手机可用
                 $scope.checkSuccess1 = true;
                 $scope.checkFailed1 = false;
-                $scope.sendSuccess = true;
                 $scope.checkFailed1_1 = false;
               } else {//手机不可用
                 $scope.checkFailed1_1 = true;
                 $scope.checking1 = false;
                 $scope.checkSuccess1 = false;
-                $scope.sendSuccess = false;
               }
             }, function () {
               $scope.checkFailed1 = true;
@@ -1018,10 +1014,14 @@ define(['app/app'], function (app) {
             });
           };
 
-          //发送验证码
+          // 发送验证码
           $scope.codeSuccess = false;
-          //发送验证码
+          $scope.sendSuccess = true;
+          // 发送验证码
           $scope.sendTelCheckCode = function (newUserTel) {
+            if (!$scope.checkSuccess1) {
+              return;
+            }
             $scope.sendSuccess = false;
             User.sendTelCheckCode({newUserTel: newUserTel}, function () {
               $scope.codeSuccess = true;
@@ -1042,6 +1042,7 @@ define(['app/app'], function (app) {
                   }, 1000, 60);
             }, function (response) {
               toaster.pop('error', '错误', response.data);
+              $scope.sendSuccess = true;
             });
           };
 

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

@@ -760,11 +760,10 @@ define(['app/app'], function(app) {
           $scope.emailEnable = function (newUserEmail) {
             //邮箱不可用
             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)) {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
-              $scope.sendSuccess = false;
               $scope.checkFailed1_1 = false;
               return false;
             }
@@ -772,25 +771,26 @@ define(['app/app'], function(app) {
               if (data.data == "true") {//邮箱可用
                 $scope.checkSuccess1 = true;
                 $scope.checkFailed1 = false;
-                $scope.sendSuccess = true;
                 $scope.checkFailed1_1 = false;
               } else {//邮箱不可用
                 $scope.checkSuccess1 = false;
                 $scope.checkFailed1 = false;
-                $scope.sendSuccess = false;
                 $scope.checkFailed1_1 = true;
               }
             }, function () {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
-              $scope.sendSuccess = false;
               $scope.checkFailed1_1 = false;
             });
           };
 
           $scope.codeSuccess = false;
+          $scope.sendSuccess = true;
           //发送验证码
           $scope.sendCheckCode = function (newUserEmail) {
+            if (!$scope.checkSuccess1 || ($scope.userInfo.userEmail==null && !$scope.checkSuccess)) {
+              return;
+            }
             $scope.sendSuccess = false;
             User.sendCheckCode({newUserEmail: newUserEmail}, function () {
               $scope.codeSuccess = true;
@@ -811,6 +811,7 @@ define(['app/app'], function(app) {
                   }, 1000, 60);
             }, function (response) {
               toaster.pop('error', '错误', response.data);
+              $scope.sendSuccess = true;
             });
           };
 
@@ -819,8 +820,8 @@ define(['app/app'], function(app) {
           //校验验证码
           $scope.validCheckCode = function (checkCode) {
             if(!checkCode){
-              $scope.checkSuccess2 = false;
-              $scope.checkFailed2 = true;
+              // $scope.checkSuccess2 = false;
+              // $scope.checkFailed2 = true;
               return false;
             }
             User.validCheckCode({checkCode: checkCode,newUserEmail:$scope.user.newUserEmail}, function (data) {
@@ -877,7 +878,6 @@ define(['app/app'], function(app) {
               $scope.validSuccess = false;
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = false;
-              $scope.sendSuccess = false;
               window.location.href = "vendor#/account/management/sec";
               window.location.reload();
               $modalInstance.close();
@@ -922,7 +922,6 @@ define(['app/app'], function(app) {
           };
 
           //新手机号是否可用
-          $scope.sendSuccess = false;
           $scope.checkFailed1 = false;
           $scope.checkFailed1_1 = false;
           $scope.checkSuccess1 = false;
@@ -930,7 +929,6 @@ define(['app/app'], function(app) {
             if (newUserTel == null || !/^[0-9]{8,11}$/.test(newUserTel)) {
               $scope.checkFailed1 = true;
               $scope.checkSuccess1 = false;
-              $scope.sendSuccess = false;
               $scope.checkFailed1_1 = false;
               return false;
             }
@@ -941,13 +939,11 @@ define(['app/app'], function(app) {
               if (data.data == "true") {//手机可用
                 $scope.checkSuccess1 = true;
                 $scope.checkFailed1 = false;
-                $scope.sendSuccess = true;
                 $scope.checkFailed1_1 = false;
               } else {//手机不可用
                 $scope.checkFailed1_1 = true;
                 $scope.checking1 = false;
                 $scope.checkSuccess1 = false;
-                $scope.sendSuccess = false;
               }
             }, function () {
               $scope.checkFailed1 = true;
@@ -959,8 +955,12 @@ define(['app/app'], function(app) {
 
           //发送验证码
           $scope.codeSuccess = false;
+          $scope.sendSuccess = true;
           //发送验证码
           $scope.sendTelCheckCode = function (newUserTel) {
+            if (!$scope.checkSuccess1) {
+              return;
+            }
             $scope.sendSuccess = false;
             User.sendTelCheckCode({newUserTel: newUserTel}, function () {
               $scope.codeSuccess = true;
@@ -981,6 +981,7 @@ define(['app/app'], function(app) {
                   }, 1000, 60);
             }, function (response) {
               toaster.pop('error', '错误', response.data);
+              $scope.sendSuccess = true;
             });
           };
 
@@ -989,8 +990,8 @@ define(['app/app'], function(app) {
           //校验验证码
           $scope.validTelCheckCode = function (telCheckCode) {
             if(!telCheckCode){
-              $scope.checkSuccess2 = false;
-              $scope.checkFailed2 = true;
+              // $scope.checkSuccess2 = false;
+              // $scope.checkFailed2 = true;
               return false;
             }
             User.validTelCheckCode({telCheckCode: telCheckCode,newUserTel:$scope.user.newUserTel},

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

@@ -153,7 +153,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
             //获取店铺的信息
             StoreInfo.getStoreInfoByEnuu({enUU : $rootScope.userInfo.enterprise.uu}, function(data) {
                 $scope.storeInfo = data;
-				if (!$scope.storeInfo || $scope.storeInfo.status != 'OPENED' || $scope.storeInfo.storeName.indexOf('优软测试二') > 0 || $scope.storeInfo.storeName.indexOf('优软商城') > 0) {
+				if (!$scope.storeInfo || $scope.storeInfo.status != 'OPENED' || $scope.storeInfo.storeName.indexOf('优软测试二') > -1 || $scope.storeInfo.storeName.indexOf('优软商城') > -1) {
 					$scope.$$nonProduct.canSelfSale = false;
 				} else {
 					$scope.$$nonProduct.canSelfSale = true;

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

@@ -400,7 +400,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 			var modalInstance = $modal.open({
 				animation: true,
 				templateUrl: 'static/view/common/modal/delete_modal.html',
-				controller: 'vendor_delete_ctrl',
+				controller: 'vendor_delete_person_ctrl',
 				resolve: {
 					ids: function() {
 						return $scope.choosedIds;
@@ -2561,7 +2561,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
 
 
 	//批量删除信息
-	app.register.controller('vendor_delete_ctrl', ['$scope', 'ids', 'Goods', 'Material', 'toaster', 'deleteMaterial', 'deleteGoods', 'selectAll', 'ProductServiceQuery', 'standard_tab', '$modalInstance', 'message', function ($scope, ids, Goods, Material, toaster, deleteMaterial, deleteGoods, selectAll, ProductServiceQuery, standard_tab, $modalInstance, message) {
+	app.register.controller('vendor_delete_person_ctrl', ['$scope', 'ids', 'Goods', 'Material', 'toaster', 'deleteMaterial', 'deleteGoods', 'selectAll', 'ProductServiceQuery', 'standard_tab', '$modalInstance', 'message', function ($scope, ids, Goods, Material, toaster, deleteMaterial, deleteGoods, selectAll, ProductServiceQuery, standard_tab, $modalInstance, message) {
 		$scope.deleteModal = true;
         $scope.message = message;
 
@@ -2572,7 +2572,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
             if(deleteMaterial) {
                 if(selectAll) {
                     if(standard_tab == 'standard') {
-                        Material.deleteStandardAll(null, null, function (data) {
+                        Material.deleteStandardAll({isPerson: 1}, function (data) {
                             if(data.code != 1) {
                                 toaster.pop('error','错误' ,data.message);
                             }else {
@@ -2584,7 +2584,7 @@ define([ 'app/app', 'jquery-uploadify' ], function(app) {
                             toaster.pop('error', '错误', response.data);
                         });
                     }else {
-                        Material.deleteUnstandardAll(null, null, function (data) {
+                        Material.deleteUnstandardAll({isPerson: 1}, function (data) {
                             if(data.code != 1) {
                                 toaster.pop('error', '错误', data.message);
                             }else {

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

@@ -1707,7 +1707,7 @@
                                                     <div class="content margin10">
                                                         <!--<p class="title">自营 / 寄售</p>-->
                                                         <div class="input-list">
-                                                            <select ng-disabled="$$nonProduct.canSelfSale" name="selfSale" class="wid56 select-adder form-control" ng-model="goods.editSelfSale" ng-disabled="$$nonProduct.canSelfSale">
+                                                            <select ng-disabled="!$$nonProduct.canSelfSale" name="selfSale" class="wid56 select-adder form-control" ng-model="goods.editSelfSale">
                                                                 <option value="1">自营</option>
                                                                 <option value="2">寄售</option>
                                                             </select>
@@ -1900,7 +1900,7 @@
 													<div class="content margin10">
 														<!--<p class="title">自营 / 寄售</p>-->
 														<div class="input-list">
-															<select name="editSelfSale" ng-change="changeSaleMode(goods)" class="wid56 select-adder form-control" ng-model="goods.editSelfSale" ng-disabled="$$nonProduct.canSelfSale">
+															<select name="editSelfSale" ng-change="changeSaleMode(goods)" class="wid56 select-adder form-control" ng-model="goods.editSelfSale" ng-disabled="!$$nonProduct.canSelfSale">
 																<option value="1">自营</option>
 																<option value="2">寄售</option>
 															</select>

+ 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>
             <div class="col-md-8 col-sm-8 col">
                 <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 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>
             <div class="col-md-8 col-sm-8 col">
                 <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 class="col">