Browse Source

Merge branch 'dev-mysql' of ssh://10.10.100.21/source/platform-b2c into dev-mysql

yujia 8 years ago
parent
commit
30e15d3c39
100 changed files with 2301 additions and 911 deletions
  1. 4 0
      pom.xml
  2. 11 2
      src/main/java/com/uas/platform/b2c/common/account/controller/EnterpriseController.java
  3. 46 27
      src/main/java/com/uas/platform/b2c/common/account/controller/UserController.java
  4. 3 0
      src/main/java/com/uas/platform/b2c/common/account/service/EnterpriseService.java
  5. 19 1
      src/main/java/com/uas/platform/b2c/common/account/service/UserService.java
  6. 5 0
      src/main/java/com/uas/platform/b2c/common/account/service/impl/EnterpriseServiceImpl.java
  7. 46 6
      src/main/java/com/uas/platform/b2c/common/account/service/impl/UserServiceImpl.java
  8. 9 3
      src/main/java/com/uas/platform/b2c/common/account/v2/service/impl/UserServiceImpl.java
  9. 10 10
      src/main/java/com/uas/platform/b2c/common/search/constant/SearchUrl.java
  10. 2 2
      src/main/java/com/uas/platform/b2c/common/search/controller/SearcherController.java
  11. 5 4
      src/main/java/com/uas/platform/b2c/common/search/rpc/service/Impl/SearchServiceImpl.java
  12. 20 4
      src/main/java/com/uas/platform/b2c/common/search/service/impl/SearcherServiceImpl.java
  13. 243 221
      src/main/java/com/uas/platform/b2c/core/filter/SSOInterceptor.java
  14. 23 10
      src/main/java/com/uas/platform/b2c/external/erp/commodity/service/impl/ProductDetailERPServiceImpl.java
  15. 19 16
      src/main/java/com/uas/platform/b2c/external/erp/order/service/impl/OrderServiceImpl.java
  16. 1 0
      src/main/java/com/uas/platform/b2c/external/erp/order/util/ModelConverter.java
  17. 10 6
      src/main/java/com/uas/platform/b2c/external/erp/prod/service/impl/ProdServiceImpl.java
  18. 4 3
      src/main/java/com/uas/platform/b2c/fa/payment/controller/InstallmentController.java
  19. 3 2
      src/main/java/com/uas/platform/b2c/fa/payment/service/InstallmentService.java
  20. 55 26
      src/main/java/com/uas/platform/b2c/fa/payment/service/impl/InstallmentServiceImpl.java
  21. 9 0
      src/main/java/com/uas/platform/b2c/fa/settlement/service/BillSubmitService.java
  22. 38 1
      src/main/java/com/uas/platform/b2c/fa/settlement/service/impl/BillSubmitServiceImpl.java
  23. 5 4
      src/main/java/com/uas/platform/b2c/logistics/service/impl/AddressServiceImpl.java
  24. 7 5
      src/main/java/com/uas/platform/b2c/prod/commodity/controller/GoodsController.java
  25. 11 1
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/GoodsDao.java
  26. 9 0
      src/main/java/com/uas/platform/b2c/prod/commodity/dao/ProductDao.java
  27. 14 0
      src/main/java/com/uas/platform/b2c/prod/commodity/model/Goods.java
  28. 7 0
      src/main/java/com/uas/platform/b2c/prod/commodity/service/GoodsService.java
  29. 5 46
      src/main/java/com/uas/platform/b2c/prod/commodity/service/impl/GoodsServiceImpl.java
  30. 21 0
      src/main/java/com/uas/platform/b2c/prod/product/brand/api/BrandController.java
  31. 1 0
      src/main/java/com/uas/platform/b2c/prod/product/brand/controller/BrandController.java
  32. 14 1
      src/main/java/com/uas/platform/b2c/prod/product/brand/controller/BrandMapController.java
  33. 12 0
      src/main/java/com/uas/platform/b2c/prod/product/brand/dao/BrandDao.java
  34. 15 0
      src/main/java/com/uas/platform/b2c/prod/product/brand/dao/BrandInfoDao.java
  35. 20 0
      src/main/java/com/uas/platform/b2c/prod/product/brand/modal/BrandTemp.java
  36. 2 0
      src/main/java/com/uas/platform/b2c/prod/product/brand/service/BrandMapService.java
  37. 20 0
      src/main/java/com/uas/platform/b2c/prod/product/brand/service/BrandService.java
  38. 44 4
      src/main/java/com/uas/platform/b2c/prod/product/brand/service/impl/BrandMapServiceImpl.java
  39. 18 0
      src/main/java/com/uas/platform/b2c/prod/product/brand/service/impl/BrandServiceImpl.java
  40. 1 0
      src/main/java/com/uas/platform/b2c/prod/product/component/api/ComponentController.java
  41. 12 4
      src/main/java/com/uas/platform/b2c/prod/product/component/dao/ComponentDao.java
  42. 74 0
      src/main/java/com/uas/platform/b2c/prod/product/component/modal/ComponentGoods.java
  43. 7 0
      src/main/java/com/uas/platform/b2c/prod/product/component/service/ComponentService.java
  44. 4 0
      src/main/java/com/uas/platform/b2c/prod/product/component/service/impl/ComponentServiceImpl.java
  45. 0 12
      src/main/java/com/uas/platform/b2c/trade/order/model/Purchase.java
  46. 14 0
      src/main/java/com/uas/platform/b2c/trade/order/model/PurchaseDetail.java
  47. 9 0
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java
  48. 9 0
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/PurchaseDetailServiceImpl.java
  49. 7 0
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/PurchaseServiceImpl.java
  50. 17 0
      src/main/java/com/uas/platform/b2c/trade/presale/model/Cart.java
  51. 6 1
      src/main/java/com/uas/platform/b2c/trade/support/CodeType.java
  52. 1 1
      src/main/resources/prod/account.properties
  53. 2 2
      src/main/resources/test/sys.properties
  54. 7 3
      src/main/webapp/WEB-INF/views/normal/adminWithNav.html
  55. 5 1
      src/main/webapp/resources/css/erp/align.css
  56. 21 7
      src/main/webapp/resources/js/admin/app.js
  57. 61 0
      src/main/webapp/resources/js/admin/controllers/ads/ads_brand.js
  58. 171 0
      src/main/webapp/resources/js/admin/controllers/search/search_See.js
  59. 16 6
      src/main/webapp/resources/js/common/controllers/commonCtrls.js
  60. 68 22
      src/main/webapp/resources/js/common/module/chat_web_module.js
  61. 13 2
      src/main/webapp/resources/js/common/query/brand.js
  62. 4 0
      src/main/webapp/resources/js/common/query/enterprise.js
  63. 46 61
      src/main/webapp/resources/js/usercenter/controllers/forstore/account_manager_ctrl.js
  64. 225 194
      src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_cart_ctrl.js
  65. 1 0
      src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_home_ctrl.js
  66. 230 0
      src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_transfer_ctrl.js
  67. 35 4
      src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js
  68. 4 4
      src/main/webapp/resources/js/vendor/app.js
  69. 2 2
      src/main/webapp/resources/js/vendor/controllers/forstore/pay_center_ctrl.js
  70. 12 4
      src/main/webapp/resources/js/vendor/controllers/forstore/purchase_detail.js
  71. 45 61
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_account_management_ctrl.js
  72. 8 2
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_deliveryRule_ctrl.js
  73. 1 0
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_index_ctrl.js
  74. 7 2
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_logistics_ctrl.js
  75. 27 0
      src/main/webapp/resources/view/admin/ads/ads_brand.html
  76. 70 0
      src/main/webapp/resources/view/admin/search/search_See.html
  77. 17 5
      src/main/webapp/resources/view/common/sidebar.html
  78. 56 26
      src/main/webapp/resources/view/usercenter/forstore/buyer_cart.html
  79. 2 2
      src/main/webapp/resources/view/usercenter/forstore/buyer_invoice.html
  80. 2 2
      src/main/webapp/resources/view/usercenter/forstore/buyer_order.html
  81. 1 1
      src/main/webapp/resources/view/usercenter/forstore/buyer_transfer.html
  82. 2 2
      src/main/webapp/resources/view/usercenter/forstore/order_detail.html
  83. 62 33
      src/main/webapp/resources/view/usercenter/forstore/order_pay.html
  84. 3 1
      src/main/webapp/resources/view/usercenter/forstore/pay_center.html
  85. 2 2
      src/main/webapp/resources/view/usercenter/forstore/query_logistics.html
  86. 19 3
      src/main/webapp/resources/view/usercenter/header.html
  87. 2 2
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_erp.html
  88. 4 2
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_unstandard_erp.html
  89. 3 3
      src/main/webapp/resources/view/vendor/forstore/erp/vendor_onSale_erp.html
  90. 3 3
      src/main/webapp/resources/view/vendor/forstore/purchase_detail.html
  91. 3 2
      src/main/webapp/resources/view/vendor/forstore/query_logistics.html
  92. 3 0
      src/main/webapp/resources/view/vendor/forstore/vendor-invoice.html
  93. 36 8
      src/main/webapp/resources/view/vendor/forstore/vendor_delivery.html
  94. 1 1
      src/main/webapp/resources/view/vendor/forstore/vendor_index.html
  95. 1 1
      src/main/webapp/resources/view/vendor/forstore/vendor_material.html
  96. 1 1
      src/main/webapp/resources/view/vendor/forstore/vendor_onSale.html
  97. 3 3
      src/main/webapp/resources/view/vendor/forstore/vendor_order.html
  98. 1 1
      src/main/webapp/resources/view/vendor/forstore/vendor_store_maintain.html
  99. 3 3
      src/main/webapp/resources/view/vendor/forstore/vendor_upload.html
  100. 19 4
      src/main/webapp/resources/view/vendor/header.html

+ 4 - 0
pom.xml

@@ -432,6 +432,10 @@
 			<artifactId>classmate</artifactId>
 			<version>1.1.0</version>
 		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>servlet-api</artifactId>
+		</dependency>
 	</dependencies>
 	<build>
 		<finalName>platform-b2c</finalName>

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

@@ -3,9 +3,8 @@ package com.uas.platform.b2c.common.account.controller;
 import com.uas.account.entity.UserSpaceDetail;
 import com.uas.account.util.AccountUtils;
 import com.uas.platform.b2c.common.account.model.Enterprise;
-import com.uas.platform.b2c.common.account.model.FormEnterprise;
-import com.uas.platform.b2c.common.account.model.User;
 import com.uas.platform.b2c.common.account.model.UserBaseInfo;
+import com.uas.platform.b2c.common.account.model.FormEnterprise;
 import com.uas.platform.b2c.common.account.service.EnterpriseService;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.prod.store.service.StoreInService;
@@ -52,6 +51,16 @@ public class EnterpriseController {
 		}
 	}
 
+	/**
+	 * 根据UU获取管理员信息
+	 * @param enuu 企业uu号
+	 * @return 完整的企业信息
+	 */
+	@RequestMapping(value = "/{enuu}/admin", method = RequestMethod.GET)
+	public UserBaseInfo getEnterpriseAdminInfo(@PathVariable Long enuu){
+		return enterpriseService.getEnterpriseAdminInfo(enuu);
+	}
+
 	/**
 	 * 修改企业基本资料
 	 *

+ 46 - 27
src/main/java/com/uas/platform/b2c/common/account/controller/UserController.java

@@ -116,26 +116,27 @@ public class UserController {
 
 	/**
 	 * 修改用户密码
-	 *
-	 * @param password	用户输入密码
+	 * @param session 获取session
+	 * @param password 旧密码
+	 * @param newPassword 新密码
+	 * @param secLevel 密码强度
+	 * @return
 	 */
 	@RequestMapping(value = "/updatePassword", method = RequestMethod.POST)
-	public ResponseEntity<String> updatePassword(final HttpSession session, final String password, final String newPassword,final Short secLevel) {
+	public ResponseEntity<String> updatePassword(final HttpSession session, final String password, final String newPassword, final Short secLevel) {
 		if (password.equals(newPassword)) {
 			throw new IllegalOperatorException("新密码与旧密码相同");
 		}
-		if(newPassword.length()<8 || newPassword.matches("^[0-9]*$") || newPassword.matches("^[A-Za-z]*$")){
-			throw new IllegalOperatorException("密码强度不够,请重新输入");
-		}
-		if(newPassword.length()>20){
-			throw new IllegalOperatorException("密码超过20位,请重新输入");
+		String middlLevelReg = "^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$";
+		if (!newPassword.matches(middlLevelReg)) {
+			throw new IllegalOperatorException("密码格式有误,请重新输入");
 		}
 		User sysUser = SystemSession.getUser();
 		User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
 		if (!StringUtils.isEmpty(newPassword)) {
 			user.setPwdSecLevel(secLevel);
 			user = userService.updatePassword(user, password, newPassword);
-			if(sysUser.getEnterprise()!=null){
+			if (sysUser.getEnterprise() != null) {
 				user.setCurrentEnterprise(sysUser.getEnterprise().getUu());
 			}
 			session.setAttribute("user", user);
@@ -174,15 +175,26 @@ public class UserController {
 	public ResponseEntity<String> sendCheckCode(final String newUserEmail, final HttpSession session) {
 		User sysUser = SystemSession.getUser();
 		User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
+		Long checkTime = (Long)session.getAttribute("checkTime");
+		if (!StringUtils.isEmpty(checkTime)){
+			Long nowTime = System.currentTimeMillis();
+			if((nowTime-checkTime)<60 * 1000){
+				throw new IllegalOperatorException("验证码发送频繁...");
+			}
+		}
 		if (!StringUtils.isEmpty(newUserEmail)) {
-			//发送邮件
+			String pageToken = (String) session.getAttribute("pageToken");
+			if (pageToken == null || pageToken.equals("")) {
+				throw new IllegalOperatorException("页面信息获取失败!");
+			}
+			// 发送邮件
 			ModelMap data = new ModelMap();
 			String checkCode = String.valueOf((int) ((Math.random() * 9 + 1) * 100000));
 			data.put("checkcode", checkCode);
 			try {
 				mailService.send("a4c45a22-436a-430c-9667-4edfd7d04a27", newUserEmail, data);
 				session.setAttribute("checkCode", checkCode);
-				session.setAttribute("checkTime", new Date().getTime());
+				session.setAttribute("checkTime", System.currentTimeMillis());
 				session.setAttribute("newUserEmail",newUserEmail);
 				assert logger != null;
 				logger.log("用户信息", "发送用户邮箱地址,UU:" + user.getUserUU());
@@ -206,22 +218,22 @@ public class UserController {
 		Map<String,Object> result = new HashMap<String,Object>();
 		if (!StringUtils.isEmpty(checkCode) && !StringUtils.isEmpty(newUserEmail)) {
 			Long checkTime = (Long) session.getAttribute("checkTime");
-			Long nowTime = new Date().getTime();
+			Long nowTime = System.currentTimeMillis();
 			String _checkCode = (String) session.getAttribute("checkCode");
 			String _newUserEmail = (String) session.getAttribute("newUserEmail");
-			//验证码失效
+			// 验证码失效
 			if((nowTime-checkTime)>10 * 60 * 1000 || _checkCode == null) {
 				result.put("status", 2);
 				result.put("message", "验证码失效");
 				return result;
 			}
-			//验证码错误
+			// 验证码错误
 			if (!_checkCode.equals(checkCode) || !_newUserEmail.equals(newUserEmail)) {
 				result.put("status", 0);
 				result.put("message", "验证码错误");
 				return result;
 			}
-			//验证码正确
+			// 验证码正确
 			if (_checkCode.equals(checkCode)) {
 				result.put("status", 1);
 				result.put("message", "验证码正确");
@@ -245,7 +257,7 @@ public class UserController {
 		if (userEmail!=null && userEmail.equals(newUserEmail)) {
 			throw new IllegalOperatorException("新邮箱地址与旧邮箱地址相同");
 		}
-		//正则校验邮箱地址
+		// 正则校验邮箱地址
 		if(!newUserEmail.matches("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+")){
 			throw new IllegalOperatorException("新邮箱地址格式不正确");
 		}
@@ -267,7 +279,7 @@ public class UserController {
 				throw new IllegalOperatorException("旧邮箱地址校验错误");
 			}
 			user.setUserEmail(newUserEmail);
-			user = userService.save(user);
+			user = userService.updateUserEmail(user.getUserTel(),newUserEmail,user.getUserUU());
 			if(sysUser.getEnterprise()!=null){
 				user.setCurrentEnterprise(sysUser.getEnterprise().getUu());
 			}
@@ -309,8 +321,15 @@ public class UserController {
 	public ResponseEntity<String> sendTelCheckCode(final String newUserTel, final HttpSession session) {
 		User sysUser = SystemSession.getUser();
 		User user = userService.findUserPwdByUserUU(sysUser.getUserUU());
+		Long checkTime = (Long)session.getAttribute("telCheckTime");
+		if (!StringUtils.isEmpty(checkTime)){
+			Long nowTime = System.currentTimeMillis();
+			if((nowTime-checkTime)<60 * 1000){
+				throw new IllegalOperatorException("验证码发送频繁...");
+			}
+		}
 		if (!StringUtils.isEmpty(newUserTel)) {
-			//页面Token校验
+			// 页面Token校验
 			String pageToken = (String) session.getAttribute("pageToken");
 			if (pageToken == null || pageToken.equals("")) {
 				throw new IllegalOperatorException("页面信息获取失败!");
@@ -319,7 +338,7 @@ public class UserController {
 			try {
 				smsService.send("1eba04ae-f3d9-4105-ad32-0196309fabb3", newUserTel, new Object[] {checkCode});
 				session.setAttribute("telCheckCode", checkCode);
-				session.setAttribute("telCheckTime", new Date().getTime());
+				session.setAttribute("telCheckTime", System.currentTimeMillis());
 				session.setAttribute("newUserTel", newUserTel);
 				assert logger != null;
 				logger.log("用户信息", "发送手机验证码,UU:" + user.getUserUU());
@@ -342,22 +361,22 @@ public class UserController {
 		Map<String, Object> result = new HashMap<String, Object>();
 		if (!StringUtils.isEmpty(telCheckCode) && !StringUtils.isEmpty(newUserTel)) {
 			Long checkTime = (Long) session.getAttribute("telCheckTime");
-			Long nowTime = new Date().getTime();
+			Long nowTime = System.currentTimeMillis();
 			String _checkCode = (String) session.getAttribute("telCheckCode");
 			String _newUserTel = (String) session.getAttribute("newUserTel");
-			//验证码失效
+			// 验证码失效
 			if ((nowTime - checkTime) > 10 * 60 * 1000 || _checkCode == null) {
 				result.put("status", 2);
 				result.put("message", "验证码失效");
 				return result;
 			}
-			//验证码错误
+			// 验证码错误
 			if (!_checkCode.equals(telCheckCode) || !_newUserTel.equals(newUserTel)) {
 				result.put("status",0);
 				result.put("message", "验证码错误");
 				return result;
 			}
-			//验证码正确
+			// 验证码正确
 			if (_checkCode.equals(telCheckCode)) {
 				result.put("status", 1);
 				result.put("message", "验证码正确");
@@ -381,11 +400,11 @@ public class UserController {
 		if (userTel.equals(newUserTel)) {
 			throw new IllegalOperatorException("新手机号与旧手机号相同");
 		}
-		//手机号码正则表达式校验
+		// 手机号码正则表达式校验
 		if(!newUserTel.matches("^[0-9]{8,11}$")){
 			throw new IllegalOperatorException("新手机号格式不正确...");
 		}
-		//防止用户非法操作
+		// 防止用户非法操作
 		String _checkCode = (String) session.getAttribute("telCheckCode");
 		if(!_checkCode.equals(telCheckCode)){
 			throw new IllegalOperatorException("验证码错误");
@@ -401,7 +420,7 @@ public class UserController {
 				throw new IllegalOperatorException("手机号不可用...");
 			}
 			user.setUserTel(newUserTel);
-			user = userService.save(user);
+			user = userService.updateUserTel(userTel,newUserTel,user.getUserUU());
 			if(sysUser.getEnterprise()!=null){
 				user.setCurrentEnterprise(sysUser.getEnterprise().getUu());
 			}
@@ -464,7 +483,7 @@ public class UserController {
 		if (userPay != null && userPay.equals(newUserPay)) {
 			throw new IllegalOperatorException("新密码与旧密码相同");
 		}
-		//新密码正则校验
+		// 新密码正则校验
 		if(!newUserPay.matches("^\\d{6}$")){
 			throw new IllegalOperatorException("新密码格式不正确...");
 		}

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

@@ -4,6 +4,7 @@ import com.uas.platform.b2c.common.account.controller.EnterpriseController;
 import com.uas.platform.b2c.common.account.model.Enterprise;
 import com.uas.platform.b2c.common.account.model.FormEnterprise;
 import com.uas.platform.b2c.common.account.model.User;
+import com.uas.platform.b2c.common.account.model.UserBaseInfo;
 import com.uas.platform.b2c.trade.support.ResultMap;
 
 import java.util.List;
@@ -19,6 +20,8 @@ public interface EnterpriseService {
 	 * @return List<EnterpriseUas>
 	 */
 	List<Enterprise> getEnterpriseInfos(List<Long> enuus);
+
+	public UserBaseInfo getEnterpriseAdminInfo(Long uu);
 	
 	// 得到企业是否有需要结算单据状态
 	public Enterprise getReceiptStatus(Enterprise enter);

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

@@ -78,7 +78,7 @@ public interface UserService {
 	List<User> findAll();
 
 	/**
-	 * 保存用户信息(邮箱,手机,姓名)
+	 * 保存用户信息(邮箱,姓名)
 	 * @param user
 	 * @return
 	 */
@@ -151,4 +151,22 @@ public interface UserService {
 	 * @return
 	 */
 	Page<User> getPageStatusRealAuth(final PageParams pageInfo, Short idEnable);
+
+	/**
+	 * 修改手机号
+	 * @param oldTel
+	 * @param newTel
+	 * @param uu
+	 * @return
+	 */
+	User updateUserTel(String oldTel, String newTel, Long uu);
+
+	/**
+	 * 修改邮箱
+	 * @param tel
+	 * @param newEmail
+	 * @param uu
+	 * @return
+	 */
+	User updateUserEmail(String tel, String newEmail, Long uu);
 }

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

@@ -56,6 +56,11 @@ public class EnterpriseServiceImpl implements EnterpriseService{
 		return enterpriseDao.findByUus(enuus);
 	}
 
+	@Override
+	public UserBaseInfo getEnterpriseAdminInfo(Long uu) {
+		return userBaseInfoDao.findUserByUserUU(enterpriseDao.findByUu(uu).getEnAdminuu());
+	}
+
 	@Override
 	public Enterprise getReceiptStatus(Enterprise enter) {
 		List<Receipt> receipts = receiptDao.findBySellerenuu(enter.getUu());

+ 46 - 6
src/main/java/com/uas/platform/b2c/common/account/service/impl/UserServiceImpl.java

@@ -37,6 +37,7 @@ import org.springframework.data.jpa.domain.Specification;
 import org.springframework.security.core.userdetails.UsernameNotFoundException;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
 
 @Service
 public class UserServiceImpl implements UserService {
@@ -438,12 +439,7 @@ public class UserServiceImpl implements UserService {
 
 	@Override
 	public User saveRealAuth(User user) {
-		User sysUser = userDao.findOne(user.getUserUU());
-		if(sysUser==null){
-			throw new IllegalOperatorException("找不到用户");
-		}
-		sysUser.setIdEnable(user.getIdEnable());
-		return userDao.save(sysUser);
+		return userDao.save(user);
 	}
 
 	@Override
@@ -458,4 +454,48 @@ public class UserServiceImpl implements UserService {
 			}
 		}, info);
 	}
+
+	@Override
+	public User updateUserTel(String oldTel, String newTel,Long uu) {
+		// 旧手机号是否正确
+		User user = userDao.findOne(uu);
+			if(!user.getUserTel().equals(oldTel)){
+				throw new IllegalOperatorException("旧手机号错误");
+			}
+			try {
+				if(!StringUtils.isEmpty(oldTel) && !StringUtils.isEmpty(newTel)) {
+					// 保存数据库
+					List<com.uas.account.entity.User> users = AccountUtils.updateTel(oldTel, newTel);
+					if (users != null && users.size() > 0) {
+						user.setUserTel(users.get(0).getUid());
+						user = userDao.save(user);
+						return user;
+					}
+				}
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+			return null;
+		}
+
+	@Override
+	public User updateUserEmail(String tel, String newEmail, Long uu) {
+
+		try {
+			if(!StringUtils.isEmpty(tel) && !StringUtils.isEmpty(newEmail)) {
+				User user = userDao.findOne(uu);
+				// 从账户中心返回的数据
+				List<com.uas.account.entity.User> users = AccountUtils.updateEmail(tel,newEmail);
+				// 保存数据库
+				if (users != null && users.size() > 0) {
+					user.setUserEmail(users.get(0).getSecondUID());
+					user = userDao.save(user);
+					return user;
+				}
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		throw new IllegalOperatorException("数据更新失败...");
+	}
 }

+ 9 - 3
src/main/java/com/uas/platform/b2c/common/account/v2/service/impl/UserServiceImpl.java

@@ -72,9 +72,15 @@ public class UserServiceImpl implements UserService {
         u.setUserTel(user.getUid());
         u.setEnable((short) 1);
         u.setUserEmail(user.getSecondUID());
-        u.setUserUU(Long.valueOf(user.getDialectUID()));
-        u.setPwdSecLevel(user.getPwdSecLevel());
-        u.setLastLoginTime(user.getLastLoginTime());
+        if (!StringUtils.isEmpty(user.getDialectUID())) {
+            u.setUserUU(Long.valueOf(user.getDialectUID()));
+        }
+        if (user.getPwdSecLevel()!=null) {
+            u.setPwdSecLevel(user.getPwdSecLevel());
+        }
+        if(user.getLastLoginTime()!=null){
+            u.setLastLoginTime(user.getLastLoginTime());
+        }
         Enterprise enterprise = null;
         if(user.getSpaceDialectUID()!=null){
             enterprise = enterpriseDao.findByUu(Long.valueOf(user.getSpaceDialectUID()));

+ 10 - 10
src/main/java/com/uas/platform/b2c/common/search/constant/SearchUrl.java

@@ -10,23 +10,23 @@ public class SearchUrl {
     /**
      * 获取类目id
      */
-    public static final String KIND_ID_URL = "/search/kindIds/{keyword}";
+    public static final String KIND_ID_URL = "/search/kindIds?keyword={keyword}";
 
     /**
      * 获取类目的数据
      *
      */
-    public static final String KIND_INFO_URL = "/search/kinds/{keyword}?page={page}&size={size}";
+    public static final String KIND_INFO_URL = "/search/kinds?keyword={keyword}&page={page}&size={size}";
 
     /**
      * 搜索品牌的id
      */
-    public static final String BRAND_ID_URL = "/search/brandIds/{keyword}?page={page}&size={size}";
+    public static final String BRAND_ID_URL = "/search/brandIds?keyword={keyword}&page={page}&size={size}";
 
     /**
      * 搜索品牌的具体信息
      */
-    public static final String BRAND_INFO_URL = "/search/brands/{keyword}?page={page}&size={size}";
+    public static final String BRAND_INFO_URL = "/search/brands?keyword={keyword}&page={page}&size={size}";
 
 
     /**
@@ -59,38 +59,38 @@ public class SearchUrl {
     /**
      * 根据关键字联想
      */
-    public static final String SIMILAR_KEYWORD_URL = "/search/similarKeywords/{keyword}";
+    public static final String SIMILAR_KEYWORD_URL = "/search/similarKeywords?keyword={keyword}";
 
 
     /**
      * 根据关键字联想器件
      */
-    public static final String SIMILAR_COMPONENT_URL = "/search/similarComponents/{keyword}";
+    public static final String SIMILAR_COMPONENT_URL = "/search/similarComponents?keyword={keyword}";
 
 
     /**
      * 根据关键字联想品牌
      */
-    public static final String SIMILAR_BRAND_URL = "/search/similarBrands/{keyword}";
+    public static final String SIMILAR_BRAND_URL = "/search/similarBrands?keyword={keyword}";
 
 
     /**
      * 根据关键字联想类目
      */
-    public static final String SIMILAR_KIND_URL = "/search/similarKinds/{keyword}";
+    public static final String SIMILAR_KIND_URL = "/search/similarKinds?keyword={keyword}";
 
 
 
     /**
      * 获取某个信息的叶子节点
      */
-    public static final String SIMILAR_LEAF_KIND_URL = "/search/similarLeafKinds/{keyword}";
+    public static final String SIMILAR_LEAF_KIND_URL = "/search/similarLeafKinds?keyword={keyword}";
 
 
     /**
      * 获取类目的层级
      */
-    public static final String SIMILAR__KIND_LEVEL_URL = "/search/similarKindsByLevel?kindName={kindName}&level={level}";
+    public static final String SIMILAR__KIND_LEVEL_URL = "/search/similarKindsByLevel?keyword={kindName}&level={level}";
 
 
     /**

+ 2 - 2
src/main/java/com/uas/platform/b2c/common/search/controller/SearcherController.java

@@ -256,8 +256,8 @@ public class SearcherController {
 	 */
 	@RequestMapping(value = "/similarKeywords", method = RequestMethod.GET)
 	@ResponseBody
-	public List<String> getSimilarKeywords(String keyword) {
-		return (List<String>) searcherService.getSimilarKeywords(keyword).get("all");
+	public Map<String,Object> getSimilarKeywords(String keyword) {
+		return  searcherService.getSimilarKeywords(keyword);
 	}
 
 	/**

+ 5 - 4
src/main/java/com/uas/platform/b2c/common/search/rpc/service/Impl/SearchServiceImpl.java

@@ -1,6 +1,7 @@
 package com.uas.platform.b2c.common.search.rpc.service.Impl;
 
 
+import com.alibaba.fastjson.JSONArray;
 import com.uas.platform.b2c.common.search.constant.SearchUrl;
 import com.uas.platform.b2c.common.search.rpc.service.SearchService;
 import com.uas.platform.b2c.core.config.SysConf;
@@ -215,13 +216,13 @@ public class SearchServiceImpl implements SearchService{
         }else {
             try {
                 List<String> reMapA = FastjsonUtils.fromJson(strA, List.class);
-                List<String> reMapC = FastjsonUtils.fromJson(strC, List.class);
-                List<String> reMapB = FastjsonUtils.fromJson(strB, List.class);
-                List<String> reMapK = FastjsonUtils.fromJson(strK, List.class);
+                List<Object> reMapC = FastjsonUtils.fromJsonArray(strC);
+                List<Object> reMapB = FastjsonUtils.fromJsonArray(strB);
+                List<Object> reMapK = FastjsonUtils.fromJsonArray(strK);
                 map.clear();
                 map.put("all",reMapA);
                 map.put("kind",reMapK);
-                map.put("componet",reMapC);
+                map.put("component",reMapC);
                 map.put("brand",reMapB);
                 return map;
             }catch (Exception e) {

+ 20 - 4
src/main/java/com/uas/platform/b2c/common/search/service/impl/SearcherServiceImpl.java

@@ -8,6 +8,8 @@ import com.uas.platform.b2c.common.search.rpc.service.SearchService;
 import com.uas.platform.b2c.common.search.service.SearcherService;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
+import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
+import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.prod.product.brand.dao.BrandDao;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentGoodsDao;
 import com.uas.platform.b2c.prod.product.component.dao.ComponentInfoDao;
@@ -57,6 +59,9 @@ public class SearcherServiceImpl implements SearcherService {
 	@Autowired
 	private BrandDao brandDao;
 
+	@Autowired
+	private GoodsDao goodsDao;
+
 	@Autowired
 	private SearchHistoryDao searchHistoryDao;
 
@@ -201,11 +206,22 @@ public class SearcherServiceImpl implements SearcherService {
 		List<ComponentGoods> components = new ArrayList<>();
 		if (!CollectionUtils.isEmpty(componentIds)) {
 			for (int i = 0 ;i < componentIds.size() ; i++){
-				Long cid = Long.valueOf(componentIds.get(i).toString());
+				Long cid = null;
+				if(!StringUtils.isEmpty
+						(componentIds.get(i)))  {
+					cid = Long.valueOf(componentIds.get(i).toString());
+				}
 				Long gid = goodsIds.get(i) == null ? 0L : Long.valueOf(goodsIds.get(i).toString());
-				ComponentGoods componentGoods = componentGoodsDao.findByCmpIdAndGoId(cid, gid);
-				if (componentGoods != null){
-					components.add(componentGoods);
+				if((cid == null) && (gid != 0L)) {
+					Goods goods = goodsDao.findOne(gid);
+					if(goods != null) {
+						components.add(new ComponentGoods(goods));
+					}
+				}else if(cid != null){
+					ComponentGoods componentGoods = componentGoodsDao.findByCmpIdAndGoId(cid, gid);
+					if (componentGoods != null){
+						components.add(componentGoods);
+					}
 				}
 			}
 			map.put("components", components);// 当前页器件内容

+ 243 - 221
src/main/java/com/uas/platform/b2c/core/filter/SSOInterceptor.java

@@ -44,246 +44,268 @@ import java.util.*;
  */
 public class SSOInterceptor extends AbstractSSOInterceptor {
 
-	private static final Logger logger = Logger.getLogger(SSOInterceptor.class);
+    private static final Logger logger = Logger.getLogger(SSOInterceptor.class);
 
-	@Autowired
-	private UserService userService;
-	@Autowired
-	private ResourceItemDao resourceItemDao;
-	@Autowired
-	private SigninLogService signinLogService;
-	@Value("#{sys.profile}")
-	private String profile;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private ResourceItemDao resourceItemDao;
+    @Autowired
+    private SigninLogService signinLogService;
+    @Value("#{sys.profile}")
+    private String profile;
 
-	private final DeviceResolver deviceResolver = new LiteDeviceResolver();
+    @Value("#{sys.enUU}")
+    private String enUU;
 
-	private HashMap<String, Collection<ConfigAttribute>> resourceMap;
-	private HashMap<Long, Collection<GrantedAuthority>> authorities;
+    private final DeviceResolver deviceResolver = new LiteDeviceResolver();
 
-	private User getUserByToken(SSOToken token) {
-		User authedUser = null;
-		if (token.getData() != null) {
-			com.uas.account.entity.User tokenUser = FlexJsonUtils.fromJson(token.getData(), com.uas.account.entity.User.class);
-			if (!StringUtils.isEmpty(tokenUser.getDialectUID())) {
-				// dialectUID表示client系统自己的唯一标识,比如user_uu,手机号没设置的情况下使用
-				authedUser = userService.findUserByUserUU(Long.parseLong(tokenUser.getDialectUID()));
-			} else if (!StringUtils.isEmpty(tokenUser.getUid())) {
-				// UID表示所有系统公认的唯一标识,这里统一使用手机号
-				authedUser = userService.findUserByUserTel(tokenUser.getUid());
-			} else {
-				logger.error(String.format("invalid user %s, please set uid or dialectUID", tokenUser.getName()));
-			}
-			if (authedUser != null && authedUser.getEnterprises() != null) {
-				// 企业资料在client系统自己的唯一标识,比如en_uu
-				if (tokenUser.getSpaceDialectUID() != null) {
-					authedUser.setCurrentEnterprise(Long.parseLong(tokenUser.getSpaceDialectUID()));
-				} else if (tokenUser.getSpaceUID() != null) {
-					for (Enterprise enterprise : authedUser.getEnterprises()) {
-						// 企业资料在所有系统公认的唯一标识,这里使用商业登记证号
-						if (tokenUser.getSpaceUID().equals(enterprise.getEnBussinessCode())) {
-							authedUser.setEnterprise(enterprise);
-							break;
-						}
-					}
-				}
-			}
-		}
-		return authedUser;
-	}
+    private HashMap<String, Collection<ConfigAttribute>> resourceMap;
+    private HashMap<Long, Collection<GrantedAuthority>> authorities;
 
-	@Override
-	protected boolean onAuthenticateFailed(HttpServletRequest request, HttpServletResponse response) {
-		SystemSession.clear();
-		if (request.getRequestURI().endsWith(PathConstant.AUTHENTICATION_URL)) {
-			return true;
-		}
-		response.setStatus(HttpStatus.UNAUTHORIZED.value());
-		if (!isRedirectAble(request)) {
-			try {
-				printJson(response, new ModelMap("loginUrl", getLoginPage(request, response)));
-			} catch (IOException e) {
-				e.printStackTrace();
-			}
-		}
-		return false;
-	}
+    private User getUserByToken(SSOToken token) {
+        User authedUser = null;
+        if (token.getData() != null) {
+            com.uas.account.entity.User tokenUser = FlexJsonUtils.fromJson(token.getData(), com.uas.account.entity.User.class);
+            if (!StringUtils.isEmpty(tokenUser.getDialectUID())) {
+                // dialectUID表示client系统自己的唯一标识,比如user_uu,手机号没设置的情况下使用
+                authedUser = userService.findUserByUserUU(Long.parseLong(tokenUser.getDialectUID()));
+            } else if (!StringUtils.isEmpty(tokenUser.getUid())) {
+                // UID表示所有系统公认的唯一标识,这里统一使用手机号
+                authedUser = userService.findUserByUserTel(tokenUser.getUid());
+            } else {
+                logger.error(String.format("invalid user %s, please set uid or dialectUID", tokenUser.getName()));
+            }
+            if (authedUser != null && authedUser.getEnterprises() != null) {
+                // 企业资料在client系统自己的唯一标识,比如en_uu
+                if (tokenUser.getSpaceDialectUID() != null) {
+                    authedUser.setCurrentEnterprise(Long.parseLong(tokenUser.getSpaceDialectUID()));
+                } else if (tokenUser.getSpaceUID() != null) {
+                    for (Enterprise enterprise : authedUser.getEnterprises()) {
+                        // 企业资料在所有系统公认的唯一标识,这里使用商业登记证号
+                        if (tokenUser.getSpaceUID().equals(enterprise.getEnBussinessCode())) {
+                            authedUser.setEnterprise(enterprise);
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+        return authedUser;
+    }
 
-	/**
-	 * 输出json格式
-	 * 
-	 * @param obj
-	 * @throws IOException
-	 */
-	protected void printJson(HttpServletResponse response, Object obj) throws IOException {
-		response.addHeader("Content-Type", "application/json; charset=UTF-8");
-		PrintWriter printWriter = response.getWriter();
-		printWriter.append(FlexJsonUtils.toJson(obj));
-		printWriter.flush();
-		printWriter.close();
-	}
+    @Override
+    protected boolean onAuthenticateFailed(HttpServletRequest request, HttpServletResponse response) {
+        SystemSession.clear();
+        if (request.getRequestURI().endsWith(PathConstant.AUTHENTICATION_URL)) {
+            return true;
+        }
+        response.setStatus(HttpStatus.UNAUTHORIZED.value());
+        if (!isRedirectAble(request)) {
+            try {
+                printJson(response, new ModelMap("loginUrl", getLoginPage(request, response)));
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+        return false;
+    }
 
-	private String getLoginPage(HttpServletRequest request, HttpServletResponse response) throws IOException {
-		request.getSession().setAttribute(SSOConfig.SSOReferer, request.getHeader("Referer"));
-		SSOHelper.clearLogin(request, response);
-		String redirectUrl = SSOHelper.getRedirectRefererLoginUrl(request);
-		/*boolean cross = SSOHelper.isCrossDomain(request);
+    /**
+     * 输出json格式
+     *
+     * @param obj
+     * @throws IOException
+     */
+    protected void printJson(HttpServletResponse response, Object obj) throws IOException {
+        response.addHeader("Content-Type", "application/json; charset=UTF-8");
+        PrintWriter printWriter = response.getWriter();
+        printWriter.append(FlexJsonUtils.toJson(obj));
+        printWriter.flush();
+        printWriter.close();
+    }
+
+    private String getLoginPage(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        request.getSession().setAttribute(SSOConfig.SSOReferer, request.getHeader("Referer"));
+        SSOHelper.clearLogin(request, response);
+        String redirectUrl;
+        if ("prod".equals(profile)) {
+            redirectUrl = (SSOHelper.getRedirectLoginUrl(request, "https://www.usoftmall.com" + request.getRequestURI()));
+        } else {
+            if (null == request.getParameter("returnURL") || "".equals(request.getParameter("returnURL"))) {
+                redirectUrl = (SSOHelper.getRedirectLoginUrl(request,"http://192.168.253.12:23400" + request.getRequestURI()));
+            } else {
+                redirectUrl = (SSOHelper.getRedirectLoginUrl(request, request.getParameter("returnURL")));
+            }
+        }
+        //String redirectUrl = SSOHelper.getRedirectRefererLoginUrl(request);
+        /*boolean cross = SSOHelper.isCrossDomain(request);
 		if (cross) {
 			// 跨域代理界面
 			redirectUrl = request.getContextPath() + "/login/proxy";
 		}*/
-		return redirectUrl;
-	}
+        return redirectUrl;
+    }
 
-	@Override
-	protected void onAuthenticateSuccess(HttpServletRequest request, HttpServletResponse response) {
-		User user = (User) request.getSession().getAttribute("user");
-		SSOToken token = SSOHelper.attrToken(request);
-		// cookie变化的情况下,session可能还未变化
-		if (user == null || (user.getUserTel() != null && !token.getUid().equals(user.getUserTel()))) {
-			user = getUserByToken(token);
-			if (user != null) {
-				user.setIp(AgentUtils.getIp(request));
-				request.getSession().setAttribute("user", user);
-				setGrantedAuthorities(user);
-			}
-		}
-		if (user != null) {
-			SystemSession.setUser(user);
-			accessDecision(request, user);
-		}
-	}
+    @Override
+    protected void onAuthenticateSuccess(HttpServletRequest request, HttpServletResponse response) {
+        User user = (User) request.getSession().getAttribute("user");
+        SSOToken token = SSOHelper.attrToken(request);
+        // cookie变化的情况下,session可能还未变化
+        if (user == null || (user.getUserTel() != null && !token.getUid().equals(user.getUserTel()))) {
+            user = getUserByToken(token);
+            if (user != null) {
+                user.setIp(AgentUtils.getIp(request));
+                request.getSession().setAttribute("user", user);
+            }
+        }
+        setGrantedAuthorities(user);
+        if (user != null) {
+            SystemSession.setUser(user);
+            accessDecision(request, user);
+        }
+    }
 
-	/**
-	 * 权限验证
-	 */
-	private void accessDecision(HttpServletRequest request, User user) {
-		Collection<ConfigAttribute> configAttributes = getAttributes(request);
-		if (null == configAttributes || configAttributes.size() == 0 || user.isSys()) {
-			return;
-		}
-		Iterator<ConfigAttribute> iterator = configAttributes.iterator();
-		String needPermission = null;
-		if (!authorities.containsKey(user.getUserUU())) {
-			setGrantedAuthorities(user);
-		}
-		Collection<GrantedAuthority> userAuthorities = authorities.get(user.getUserUU());
-		while (iterator.hasNext()) {
-			ConfigAttribute configAttribute = iterator.next();
-			needPermission = configAttribute.getAttribute();
-			if (userAuthorities != null) {
-				for (GrantedAuthority ga : userAuthorities) {
-					if (needPermission.equals(ga.getAuthority())) {
-						return;
-					}
-				}
-			}
-		}
-		if (needPermission != null){
-			return;
-//			throw new AccessDeniedException("无法访问,没有 " + needPermission + " 权限!");
-		}
-	}
+    /**
+     * 权限验证
+     */
+    private void accessDecision(HttpServletRequest request, User user) {
+        Collection<ConfigAttribute> configAttributes = getAttributes(request);
+        if (null == configAttributes || configAttributes.size() == 0 || user.isSys()) {
+            return;
+        }
+        Iterator<ConfigAttribute> iterator = configAttributes.iterator();
+        String needPermission = null;
+        if (null == authorities || !authorities.containsKey(user.getUserUU())) {
+            setGrantedAuthorities(user);
+        }
+        Collection<GrantedAuthority> userAuthorities = authorities.get(user.getUserUU());
+        while (iterator.hasNext()) {
+            ConfigAttribute configAttribute = iterator.next();
+            needPermission = configAttribute.getAttribute();
+            if (userAuthorities != null) {
+                for (GrantedAuthority ga : userAuthorities) {
+                    if (needPermission.equals(ga.getAuthority())) {
+                        return;
+                    }
+                }
+            }
+        }
+        // 暂时在正式 过滤admin访问权限
+        if (needPermission != null) {
+            if ("prod".equals(profile)) {
+                if (!user.getEnterprise().getUu().toString().equals(enUU)) {
+                    if ("进入优软商城后台进行运营维护".equals(needPermission)) {
+                        throw new AccessDeniedException("无法访问,没有 " + needPermission + " 权限!");
+                    }
+                }
+            }
+        }
+    }
 
-	@Override
-	public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
-		try {
-			super.afterCompletion(request, response, handler, ex);
-		} finally {
-			SystemSession.clear();
-		}
-	}
+    @Override
+    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
+        try {
+            super.afterCompletion(request, response, handler, ex);
+        } finally {
+            SystemSession.clear();
+        }
+    }
 
-	/**
-	 * 加载资源,初始化资源变量
-	 * 
-	 */
-	private void loadResourceDefine() {
-		if (resourceMap == null) {
-			resourceMap = new HashMap<String, Collection<ConfigAttribute>>();
-			List<ResourceItem> resources = resourceItemDao.findAll();
-			for (ResourceItem resource : resources) {
-				Collection<ConfigAttribute> configAttributes = new ArrayList<ConfigAttribute>();
-				ConfigAttribute configAttribute = new SecurityConfig(resource.getName());
-				configAttributes.add(configAttribute);
-				resourceMap.put(resource.getMethod() + ":" + resource.getUrl(), configAttributes);
-			}
-		}
-	}
+    /**
+     * 加载资源,初始化资源变量
+     */
+    private void loadResourceDefine() {
+        if (resourceMap == null) {
+            resourceMap = new HashMap<String, Collection<ConfigAttribute>>();
+            List<ResourceItem> resources = resourceItemDao.findAll();
+            for (ResourceItem resource : resources) {
+                Collection<ConfigAttribute> configAttributes = new ArrayList<ConfigAttribute>();
+                ConfigAttribute configAttribute = new SecurityConfig(resource.getName());
+                configAttributes.add(configAttribute);
+                resourceMap.put(resource.getMethod() + ":" + resource.getUrl(), configAttributes);
+            }
+        }
+    }
 
-	/**
-	 * 根据路径获取访问权限的集合接口
-	 * 
-	 * @param request
-	 * @return
-	 * @throws IllegalArgumentException
-	 */
-	public Collection<ConfigAttribute> getAttributes(HttpServletRequest request) throws IllegalArgumentException {
-		if (resourceMap == null)
-			loadResourceDefine();
+    /**
+     * 根据路径获取访问权限的集合接口
+     *
+     * @param request
+     * @return
+     * @throws IllegalArgumentException
+     */
+    public Collection<ConfigAttribute> getAttributes(HttpServletRequest request) throws IllegalArgumentException {
+        if (resourceMap == null)
+            loadResourceDefine();
 
-		for (Iterator<String> iter = resourceMap.keySet().iterator(); iter.hasNext();) {
-			String resourceKey = iter.next();
-			String[] resourceParam = resourceKey.split(":");
-			String resourceMethod = resourceParam[0];
-			String resourceUrl = resourceParam[1];
-			AntPathRequestMatcher matcher = new AntPathRequestMatcher(resourceUrl);
-			if (null != resourceUrl && request.getMethod().equals(resourceMethod) && matcher.matches(request)) {
-				return resourceMap.get(resourceKey);
-			}
-		}
-		return null;
-	}
+        for (Iterator<String> iter = resourceMap.keySet().iterator(); iter.hasNext(); ) {
+            String resourceKey = iter.next();
+            String[] resourceParam = resourceKey.split(":");
+            String resourceMethod = resourceParam[0];
+            String resourceUrl = resourceParam[1];
+            AntPathRequestMatcher matcher = new AntPathRequestMatcher(resourceUrl);
+            if (null != resourceUrl && request.getMethod().equals(resourceMethod) && matcher.matches(request)) {
+                return resourceMap.get(resourceKey);
+            }
+        }
+        return null;
+    }
 
-	private void setGrantedAuthorities(User user) {
-		Set<GrantedAuthority> authSet = new HashSet<GrantedAuthority>();
-		user.setCurrentEnterpriseRoles();
-		Set<Role> roles = user.getRoles();
-		if (!CollectionUtils.isEmpty(roles)) {
-			for (Role role : roles) {
-				if (role.isSys()) {// 超级账号
-					user.setIssys(Constant.YES);
-					break;
-				}
-				Set<ResourceItem> resourceItems = role.getResourceItems();
-				if (!CollectionUtils.isEmpty(resourceItems)) {
-					for (ResourceItem res : resourceItems) {
-						authSet.add(new SimpleGrantedAuthority(res.getName()));
-					}
-				}
-			}
-		}
-		if (authorities == null) {
-			authorities = new HashMap<Long, Collection<GrantedAuthority>>();
-		}
-		authorities.put(user.getUserUU(), authSet);
-	}
+    private void setGrantedAuthorities(User user) {
+        Set<GrantedAuthority> authSet = new HashSet<GrantedAuthority>();
+        user.setCurrentEnterpriseRoles();
+        Set<Role> roles = user.getRoles();
+        if (!CollectionUtils.isEmpty(roles)) {
+            for (Role role : roles) {
+                if (role.isSys()) {// 超级账号
+                    user.setIssys(Constant.YES);
+                    break;
+                }
+                Set<ResourceItem> resourceItems = role.getResourceItems();
+                if (!CollectionUtils.isEmpty(resourceItems)) {
+                    for (ResourceItem res : resourceItems) {
+                        authSet.add(new SimpleGrantedAuthority(res.getName()));
+                    }
+                }
+            }
+        }
+        if (authorities == null) {
+            authorities = new HashMap<Long, Collection<GrantedAuthority>>();
+        }
+        authorities.put(user.getUserUU(), authSet);
+    }
 
-	@Override
-	protected void sendRedirect(HttpServletRequest request, HttpServletResponse response) throws IOException {
-		boolean cross = SSOHelper.isCrossDomain(request);
-		if (cross) {
-			request.getSession().setAttribute("SSOReferer", request.getRequestURL());
-			if ("prod".equals(profile)){
-				response.sendRedirect(SSOHelper.getRedirectLoginUrl(request, "https://www.usoftmall.com"+request.getRequestURI()));
-			}else{
-				response.sendRedirect(SSOHelper.getRedirectLoginUrl(request, request.getParameter("returnURL"))+ "&baseUrl=http://192.168.253.121:3000/login/other" );
-			}
-		} else {
-			SSOHelper.clearRedirectLogin(request, response);
-		}
-	}
+    @Override
+    protected void sendRedirect(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        boolean cross = SSOHelper.isCrossDomain(request);
+        if (cross) {
+            request.getSession().setAttribute("SSOReferer", request.getRequestURL());
+            if ("prod".equals(profile)) {
+                response.sendRedirect(SSOHelper.getRedirectLoginUrl(request, "https://www.usoftmall.com" + request.getRequestURI()));
+            } else {
+                if (null == request.getParameter("returnURL") || "".equals(request.getParameter("returnURL"))) {
+                    response.sendRedirect(SSOHelper.getRedirectLoginUrl(request,"http://192.168.253.12:23400" + request.getRequestURI()));
+                } else {
+                    response.sendRedirect(SSOHelper.getRedirectLoginUrl(request, request.getParameter("returnURL")));
+                }
+            }
+        } else {
+            SSOHelper.clearRedirectLogin(request, response);
+        }
+    }
 
-	private SitePreference getDefaultSitePreferenceForDevice(Device device) {
-		if (device == null) {
-			return null;
-		}
-		if (device.isMobile()) {
-			return SitePreference.MOBILE;
-		}
-		if (device.isTablet()) {
-			return SitePreference.TABLET;
-		}
-		return SitePreference.NORMAL;
-	}
+    private SitePreference getDefaultSitePreferenceForDevice(Device device) {
+        if (device == null) {
+            return null;
+        }
+        if (device.isMobile()) {
+            return SitePreference.MOBILE;
+        }
+        if (device.isTablet()) {
+            return SitePreference.TABLET;
+        }
+        return SitePreference.NORMAL;
+    }
 
 }

+ 23 - 10
src/main/java/com/uas/platform/b2c/external/erp/commodity/service/impl/ProductDetailERPServiceImpl.java

@@ -3,9 +3,12 @@ package com.uas.platform.b2c.external.erp.commodity.service.impl;
 import com.uas.api.b2c_erp.seller.model.ProductDetailERP;
 import com.uas.api.b2c_erp.seller.service.ProductDetailERPService;
 import com.uas.platform.b2c.common.account.service.EnterpriseService;
+import com.uas.platform.b2c.core.config.SysConf;
 import com.uas.platform.b2c.core.constant.Status;
 import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.core.support.log.ErpB2cBufferedLogger;
 import com.uas.platform.b2c.external.erp.commodity.util.ModelConverter;
+import com.uas.platform.b2c.prod.commodity.constant.IntegerConstant;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsDao;
 import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
 import com.uas.platform.b2c.prod.commodity.dao.ProductDetailDao;
@@ -13,8 +16,8 @@ import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.prod.commodity.model.Product;
 import com.uas.platform.b2c.prod.commodity.model.ProductDetail;
 import com.uas.platform.b2c.prod.commodity.service.GoodsService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import com.uas.platform.core.logging.BufferedLoggerManager;
+import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
 
@@ -44,7 +47,12 @@ public class ProductDetailERPServiceImpl implements ProductDetailERPService {
     @Autowired
     private EnterpriseService enterpriseService;
 
-    private static final Logger logger = LoggerFactory.getLogger(ProductDetailERPServiceImpl.class);
+    private static final ErpB2cBufferedLogger logger = BufferedLoggerManager.getLogger(ErpB2cBufferedLogger.class);
+
+    private final Logger loggerInfo = Logger.getLogger(getClass());
+
+    @Autowired
+    private SysConf sysConf;
 
     @Override
     public boolean uploadProductDetailERP(List<ProductDetailERP> productDetailERPList) {
@@ -53,21 +61,25 @@ public class ProductDetailERPServiceImpl implements ProductDetailERPService {
         for (ProductDetailERP productDetailERP : productDetailERPList) {
             ProductDetail productDetail = ModelConverter.convert(productDetailERP);
 
+            List<Product> products = productDao.getProductByEnUUAndProdNum(enuu, productDetail.getCode());
+            if (!CollectionUtils.isEmpty(products)) {
+                productDetail.setProductId(products.get(0).getId());
+            }
+            // 如果已存在物料交易信息删除之前那一条,保存新的物料交易信息
             ProductDetail productDetailExist = productDetailDao.findByProductId(productDetail.getProductId());
             if (productDetailExist != null) {
-                List<Product> products = productDao.getProductByEnUUAndProdNum(enuu, productDetail.getCode());
-                if (!CollectionUtils.isEmpty(products)) {
-                    productDetail.setProductId(products.get(0).getId());
-                }
-                productDetails.add(productDetail);
+                productDetailDao.delete(productDetailExist);
             }
+            productDetails.add(productDetail);
         }
         productDetailDao.save(productDetails);
+        logger.log("物料交易详情", "初始化交易详情,企业:" + SystemSession.getUser().getEnterprise().getEnName() + ",数量:" + productDetails.size());
         return true;
     }
 
     @Override
     public String getCurrency() {
+        logger.log("物料详情", "获取币别,企业:" + SystemSession.getUser().getEnterprise().getEnName());
         return enterpriseService.getCurrencyByRegisterAddress().getData().toString();
     }
 
@@ -75,7 +87,6 @@ public class ProductDetailERPServiceImpl implements ProductDetailERPService {
     public void updateReserve(List<ProductDetailERP> productDetailERPList) {
         List<ProductDetail> productDetails = new ArrayList<ProductDetail>();
         Long enuu = SystemSession.getUser().getEnterprise().getUu();
-        logger.info("size : " + productDetailERPList.size());
         for (ProductDetailERP productDetailERP : productDetailERPList) {
             List<Product> products = productDao.getProductByEnUUAndProdNum(enuu, productDetailERP.getCode());// 获取对应商城物料信息
             if (!CollectionUtils.isEmpty(products)) {
@@ -104,6 +115,8 @@ public class ProductDetailERPServiceImpl implements ProductDetailERPService {
                                 if (Double.compare(subtractDecimal.doubleValue(), good.getReserve()) < 0) {// 差值小于此批次数量,下架部分库存
                                     Goods nowGood = goodsDao.findOne(good.getId());
                                     good.setReserve(BigDecimal.valueOf(good.getReserve()).subtract(subtractDecimal).doubleValue());
+                                    good.setSelfSale(sysConf.getStoreid().equals(good.getStoreid())? IntegerConstant.B2C_SALE.toString() : IntegerConstant.SELF_SALE.toString());// 设置自营寄售
+                                    loggerInfo.info(SystemSession.getUser().getEnterprise().getEnName() + "更新库存: " + products.get(0).getProdNum() + ",self is" + good.getSelfSale());
                                     goodsService.updateGoods(nowGood, good);
                                     goodsService.updateComponentTradeInfos(nowGood.getUuid());
                                     break;
@@ -124,7 +137,7 @@ public class ProductDetailERPServiceImpl implements ProductDetailERPService {
                 }
             }
         }
-
+        logger.log("物料详情", "更新物料库存信息,企业:" + SystemSession.getUser().getEnterprise().getEnName() + ",数量:" + productDetails.size());
         productDetailDao.save(productDetails);
     }
 }

+ 19 - 16
src/main/java/com/uas/platform/b2c/external/erp/order/service/impl/OrderServiceImpl.java

@@ -13,7 +13,6 @@ import com.uas.platform.b2c.core.support.log.ErpB2cBufferedLogger;
 import com.uas.platform.b2c.external.erp.order.util.ModelConverter;
 import com.uas.platform.b2c.prod.commodity.dao.GoodsHistoryDao;
 import com.uas.platform.b2c.prod.commodity.dao.ProductDao;
-import com.uas.platform.b2c.prod.commodity.model.GoodsHistory;
 import com.uas.platform.b2c.prod.commodity.model.Product;
 import com.uas.platform.b2c.trade.order.dao.OrderDao;
 import com.uas.platform.b2c.trade.order.dao.PurchaseDao;
@@ -25,6 +24,7 @@ import com.uas.platform.core.model.Status;
 import com.uas.platform.core.persistence.criteria.LogicalExpression;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.platform.core.persistence.criteria.SimpleExpression;
+import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.util.CollectionUtils;
@@ -34,6 +34,7 @@ import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 public class OrderServiceImpl implements OrderService {
@@ -59,6 +60,8 @@ public class OrderServiceImpl implements OrderService {
 	@Autowired
 	private EnterpriseDao enterpriseDao;
 
+	private final Logger loggerInfo = Logger.getLogger(getClass());
+
 	private static final ErpB2cBufferedLogger logger = BufferedLoggerManager.getLogger(ErpB2cBufferedLogger.class);
 
 	@Override
@@ -96,7 +99,10 @@ public class OrderServiceImpl implements OrderService {
 				return null;
 			}
 		});
+
 		List<Order> orders = new ArrayList<Order>();
+		String sourceapp = "ERP";
+        Date startDate = new Date();
 		for (Purchase purchase : purcs) {
 			boolean codeExists = false;
 			Order order = ModelConverter.getOrder(purchase);
@@ -109,21 +115,21 @@ public class OrderServiceImpl implements OrderService {
 			if (enterprise != null) {// 设置买方企业信息
 				order.setBuyerEn(com.uas.platform.b2c.external.erp.common.util.ModelConverter.convert(enterprise));
 			}
-
 			for (OrderDetail orderDetail : order.getDetails()) {
-				List<GoodsHistory> goodsHistorys = goodsHistoryDao.findByBatchCode(orderDetail.getBatchCode());// 获取上架历史信息
-				if (!CollectionUtils.isEmpty(goodsHistorys)) {
-					orderDetail.setPublisheruu(goodsHistorys.get(0).getPublisherUU());// 添加发布人uu
-					List<Product> products = productDao.findByEnUUAndCmpUuId(SystemSession.getUser().getEnterprise().getUu(), goodsHistorys.get(0).getUuid());//获取物料信息
-					if (!CollectionUtils.isEmpty(products)) {
-						orderDetail.setCode(products.get(0).getProdNum());// 设置物料编号,有物料编号才回传到ERP
-						codeExists = true;
-					}
+				List<Product> products = productDao.findByEnUUAndCmpUuIdAndSourceApp(SystemSession.getUser().getEnterprise().getUu(), orderDetail.getUuid(), sourceapp);//获取物料信息
+				if (!CollectionUtils.isEmpty(products)) {
+					orderDetail.setCode(products.get(0).getProdNum());// 设置物料编号,有物料编号才回传到ERP
+					codeExists = true;
 				}
 			}
-			if (codeExists)
+			if (codeExists) {
 				orders.add(order);
+			}
 		}
+        Date endDate = new Date();
+        loggerInfo.info(purcs.size() + "条处理历时" + (endDate.getTime() - startDate.getTime()) + "毫秒");
+        loggerInfo.info(" erp预下载订单数 " +  purcs.size() + ", 实际下载数 " +  orders.size());
+        logger.log("销售订单", "企业下载销售订单,企业:" + SystemSession.getUser().getEnterprise().getEnName() + "数量:" + orders.size());
 		return orders;
 	}
 
@@ -166,6 +172,7 @@ public class OrderServiceImpl implements OrderService {
 
 	@Override
 	public Long findAdminuu() {
+		logger.log("销售订单", "获取企业商城管理员,企业:" + SystemSession.getUser().getEnterprise().getEnName());
 		return SystemSession.getUser().getEnterprise().getEnAdminuu();
 	}
 
@@ -173,14 +180,10 @@ public class OrderServiceImpl implements OrderService {
 	public boolean backOrder(long[] orderids) {
 		for (long orderid : orderids) {
 			Purchase purchase = purchaseDao.findOne(orderid);
-//			if (Status.CONFIRMED.value() == purchase.getStatus()) {// 将确认收款的订单生成出货单
-//				purchaseService.purToBeShiped(orderid);
-//			}
-
 			purchase.setSendstatus(Status.DOWNLOADED.value());
 			purchaseDao.save(purchase);
-
 		}
+		logger.log("销售订单", "回写已下载订单,企业:" + SystemSession.getUser().getEnterprise().getEnName() + "数量:" + orderids.length);
 		return true;
 	}
 }

+ 1 - 0
src/main/java/com/uas/platform/b2c/external/erp/order/util/ModelConverter.java

@@ -72,6 +72,7 @@ public class ModelConverter {
 		orderDetail.setTax(detail.getTax());
 		orderDetail.setCurrency(detail.getCurrencyName());
 		orderDetail.setStatus(detail.getStatus());
+		orderDetail.setPublisheruu(detail.getSellPublishuu());
 		return orderDetail;
 	}
 

+ 10 - 6
src/main/java/com/uas/platform/b2c/external/erp/prod/service/impl/ProdServiceImpl.java

@@ -13,6 +13,7 @@ import com.uas.platform.b2c.prod.store.dao.StoreInDao;
 import com.uas.platform.b2c.prod.store.model.StoreIn;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import org.apache.log4j.Logger;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
 
@@ -38,7 +39,6 @@ public class ProdServiceImpl implements ProdService {
 
     private static final ErpB2cBufferedLogger logger = BufferedLoggerManager.getLogger(ErpB2cBufferedLogger.class);
 
-    // TODO
     private final Logger loggerOut = Logger.getLogger(getClass());
 
     @Override
@@ -49,15 +49,17 @@ public class ProdServiceImpl implements ProdService {
             List<Product> productExists = productDao.getProductByEnUUAndProdNum(enuu, prod.getPr_code());
             Product product = ModelConverter.convert(prod);
             if (!CollectionUtils.isEmpty(productExists)) {
-                product.setId(productExists.get(0).getId());
-                product.setCmpUuId(null);// 将已存在的变更过物料uuid置为null,以便后续进行重新匹配
+                Product existProduct = productExists.get(0);
+                BeanUtils.copyProperties(product, productExists.get(0), "id");
+                existProduct.setCmpUuId(null);// 将已存在的变更过物料uuid置为null,以便后续进行重新匹配
+                products.add(existProduct);
+            } else {
+                products.add(product);
             }
-            products.add(product);
         }
         productDao.save(products);// 保存上传的物料
 
-        logger.log("物料资料", "上传物料资料,数量:" + prods.size());
-        loggerOut.info("--------------" + SystemSession.getUser().getEnterprise().getEnName() + " 上传物料资料,数量:" + prods.size() + "---------------");
+        logger.log("物料资料",  SystemSession.getUser().getEnterprise().getEnName() + "上传物料资料,数量:" + prods.size());
         return "success";
     }
 
@@ -68,6 +70,7 @@ public class ProdServiceImpl implements ProdService {
         productService.matchAll();// 匹配上传的物料
         Date end = new Date();
         loggerOut.info("匹配完成, 历时" + (start.getTime() - end.getTime())/1000 + "秒");
+        logger.log("物料资料", "ERP匹配上传物料,企业:" + SystemSession.getUser().getEnterprise().getEnName());
     }
 
     @Override
@@ -106,6 +109,7 @@ public class ProdServiceImpl implements ProdService {
         if (!CollectionUtils.isEmpty(storeIn)) {
             return url = "/store/" + storeIn.get(0).getUuid();
         }
+        logger.log("物料资料", "ERP获取店铺路径,企业:" + SystemSession.getUser().getEnterprise().getEnName());
         return url;
     }
 }

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

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.fa.payment.model.Installment;
 import com.uas.platform.b2c.fa.payment.service.InstallmentService;
+import com.uas.platform.b2c.trade.support.ResultMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -55,8 +56,8 @@ public class InstallmentController {
      * @param purchaseId 采购单id
      */
     @RequestMapping(value = "/{purchaseId}", method = RequestMethod.DELETE)
-    public void deleteInstallment(@PathVariable("purchaseId") Long purchaseId) {
-        installmentService.deleteInstallment(purchaseId);
+    public ResultMap deleteInstallment(@PathVariable("purchaseId") Long purchaseId) {
+        return installmentService.deleteInstallment(purchaseId);
     }
 
     /**
@@ -65,7 +66,7 @@ public class InstallmentController {
      * @return
      */
     @RequestMapping(value = "/{purchaseId}/validate", method = RequestMethod.GET)
-    public String validateEnableInstallment(@PathVariable("purchaseId") Long purchaseId) {
+    public ResultMap validateEnableInstallment(@PathVariable("purchaseId") Long purchaseId) {
         return installmentService.validationEnableInstallment(purchaseId);
     }
 }

+ 3 - 2
src/main/java/com/uas/platform/b2c/fa/payment/service/InstallmentService.java

@@ -2,6 +2,7 @@ package com.uas.platform.b2c.fa.payment.service;
 
 import com.uas.platform.b2c.fa.payment.model.BankTransfer;
 import com.uas.platform.b2c.fa.payment.model.Installment;
+import com.uas.platform.b2c.trade.support.ResultMap;
 
 /**
  * 分期支付service
@@ -39,14 +40,14 @@ public interface InstallmentService {
      * 删除分期信息
      * @param purchaseId
      */
-    void deleteInstallment(Long purchaseId);
+    ResultMap deleteInstallment(Long purchaseId);
 
     /**
      * 验证卖家是否能够设置分期信息
      * @param purchaseId
      * @return
      */
-    String validationEnableInstallment(Long purchaseId);
+    ResultMap validationEnableInstallment(Long purchaseId);
 
     /**
      * 采购单改价后更新分期信息

+ 55 - 26
src/main/java/com/uas/platform/b2c/fa/payment/service/impl/InstallmentServiceImpl.java

@@ -21,6 +21,8 @@ import com.uas.platform.b2c.trade.order.dao.PurchaseDetailDao;
 import com.uas.platform.b2c.trade.order.model.Order;
 import com.uas.platform.b2c.trade.order.model.Purchase;
 import com.uas.platform.b2c.trade.order.model.PurchaseDetail;
+import com.uas.platform.b2c.trade.support.CodeType;
+import com.uas.platform.b2c.trade.support.ResultMap;
 import com.uas.platform.core.exception.IllegalOperatorException;
 import com.uas.platform.core.util.mq.MessageType;
 import org.apache.commons.collections.CollectionUtils;
@@ -238,8 +240,12 @@ public class InstallmentServiceImpl implements InstallmentService{
     }
 
     @Override
-    public void deleteInstallment(Long purchaseId) {
-        validatePurchase(purchaseId);
+    public ResultMap deleteInstallment(Long purchaseId) {
+        ResultMap resultMap = validatePurchase(purchaseId);// 验证采购订单
+        if (1 != resultMap.getCode()) {// 验证错误
+            return resultMap;
+        }
+
         Purchase purchase = purchaseDao.findOne(purchaseId);
         Order order = orderDao.findByOrderid(purchase.getOrderid());
 
@@ -254,6 +260,7 @@ public class InstallmentServiceImpl implements InstallmentService{
         purchaseDao.save(purchase);
 
         installmentDao.delete(installment.getId());
+        return resultMap;
     }
 
     @Override
@@ -316,17 +323,27 @@ public class InstallmentServiceImpl implements InstallmentService{
     }
 
     @Override
-    public String validationEnableInstallment(Long purchaseId) {
-        validatePurchase(purchaseId);// 验证采购单、订单信息
-        validateBankInfo(Type.SUP.value(), Status.ALLOW.value());// 验证银行账户信息
-        validateInstallmentStore();// 验证是否设置分期权限
-        return "success";
+    public ResultMap validationEnableInstallment(Long purchaseId) {
+        ResultMap resultMap = validatePurchase(purchaseId);// 验证采购单、订单信息 return error code 5 7 6
+        if (1 != resultMap.getCode()) {
+            return resultMap;
+        }
+
+        resultMap = validateBankInfo(Type.SUP.value(), Status.ALLOW.value());// 验证银行账户信息 return error code 3
+        if (1 != resultMap.getCode()) {
+            return resultMap;
+        }
+
+        resultMap = validateInstallmentStore();// 验证是否设置分期权限 return error code 13
+        return resultMap;
     }
 
-    void validateInstallmentStore() {
+    ResultMap validateInstallmentStore() {
         InstallmentStore installmentStore = installmentStoreDao.findByEnuuAndEnable(SystemSession.getUser().getEnterprise().getUu(), (short) 1);
-        if (installmentStore == null)
-            throw new IllegalOperatorException("当前企业没有设置分期功能权限,如有需要请联系客服");
+        if (installmentStore == null) {
+            return new ResultMap(CodeType.NO_AUTHORITY.code(), "当前企业没有设置分期功能权限,如有需要请联系客服");
+        }
+        return ResultMap.success(null);
     }
 
     /**
@@ -334,32 +351,44 @@ public class InstallmentServiceImpl implements InstallmentService{
      * @param type
      * @param status
      */
-    void validateBankInfo(Integer type, Integer status) {
+    ResultMap validateBankInfo(Integer type, Integer status) {
         List<BankInfo> bankInfos = bankInfoService.getEnterpriseBankInfoContainsStatus(type, status);
-        if (CollectionUtils.isEmpty(bankInfos))
-            throw new IllegalOperatorException("当前企业没有设置收款账户,请在 结算中心--收款账户信息 管理您的收款账户信息");
+        if (CollectionUtils.isEmpty(bankInfos)) {
+            return new ResultMap(CodeType.NOT_COMPLETE_INFO.code(), "当前企业没有设置收款账户,请在 结算中心--收款账户信息 管理您的收款账户信息");
+        }
+        return ResultMap.success(null);
     }
 
     /**
      * 验证采购单、订单信息
      * @param purchaseId
      */
-    void validatePurchase(Long purchaseId) {
-        if (SystemSession.getUser().getEnterprise() == null)
-            throw new IllegalOperatorException("当前账户为个人账户,请选择企业后再执行此操作");
+    ResultMap validatePurchase(Long purchaseId) {
+        if (SystemSession.getUser().getEnterprise() == null) {
+            return new ResultMap(CodeType.ERROR_STATE.code(), "当前账户为个人账户,请选择企业后再执行此操作");
+        }
 
         Purchase purchase = purchaseDao.findOne(purchaseId);
-        if (purchase == null)
-            throw new IllegalOperatorException("订单不存在,请重新确认订单信息");
-        if (!SystemSession.getUser().getEnterprise().getUu().equals(purchase.getSellerenuu()))
-            throw new IllegalOperatorException("此订单不属于当前企业,请重新确认订单信息");
-        if (Status.TOBECONFIRMED.value() != purchase.getStatus().intValue())
-            throw new IllegalOperatorException("此订单状态不为待付款,不可修改分期信息");
+        if (purchase == null) {
+            return new ResultMap(CodeType.NOT_EXiST.code(), "订单不存在,请重新确认订单信息");
+        }
+
+        if (!SystemSession.getUser().getEnterprise().getUu().equals(purchase.getSellerenuu())) {
+            return new ResultMap(CodeType.NOT_PERMIT.code(), "此订单不属于当前企业,请重新确认订单信息");
+        }
+
+        if (Status.TOBECONFIRMED.value() != purchase.getStatus().intValue()) {
+            return new ResultMap(CodeType.ERROR_STATE.code(), "此订单状态不为待付款,不可修改分期信息");
+        }
 
         Order order = orderDao.findByOrderid(purchase.getOrderid());
-        if (order == null)
-            throw new IllegalOperatorException("订单不存在,请重新确认订单信息");
-        if (Status.TOBEPAID.value() != order.getStatus().intValue() && Status.TOBECONFIRMED.value() != order.getStatus().intValue())
-            throw new IllegalOperatorException("此订单状态不为待付款,不可修改分期信息");
+        if (order == null) {
+            return new ResultMap(CodeType.NOT_EXiST.code(), "订单不存在,请重新确认订单信息");
+        }
+        if (Status.TOBEPAID.value() != order.getStatus().intValue() && Status.TOBECONFIRMED.value() != order.getStatus().intValue()) {
+            return new ResultMap(CodeType.ERROR_STATE.code(), "此订单状态不为待付款,不可修改分期信息");
+        }
+
+        return ResultMap.success(null);
     }
 }

+ 9 - 0
src/main/java/com/uas/platform/b2c/fa/settlement/service/BillSubmitService.java

@@ -1,6 +1,7 @@
 package com.uas.platform.b2c.fa.settlement.service;
 
 import com.uas.platform.b2c.fa.settlement.model.BillSubmit;
+import com.uas.platform.b2c.trade.order.model.Order;
 import com.uas.platform.core.model.PageInfo;
 import org.springframework.data.domain.Page;
 
@@ -37,4 +38,12 @@ public interface BillSubmitService {
      * @return
      */
     List<BillSubmit> auditBillSubmit(String ids);
+
+
+    /**
+     * 管理平台确认收款新增发票申请
+     * @param order 订单信息
+     * @return
+     */
+    BillSubmit saveByAdmin(Order order);
 }

+ 38 - 1
src/main/java/com/uas/platform/b2c/fa/settlement/service/impl/BillSubmitServiceImpl.java

@@ -107,7 +107,7 @@ public class BillSubmitServiceImpl implements BillSubmitService {
         return billSubmitDao.save(billSubmits);
     }
 
-    // 初始化发票申请
+    // 初始化发票申请(用户发起用)
     public BillSubmit createBillSubmit(Bill bill, List<Order> orders, Long buyerEnuu) {
         Long buyeruu = SystemSession.getUser().getUserUU();
         // 发票基本信息
@@ -156,6 +156,43 @@ public class BillSubmitServiceImpl implements BillSubmitService {
         return billSubmit;
     }
 
+    @Override
+    public BillSubmit saveByAdmin(Order order) {
+        Bill bill = billDao.findOne(order.getInvoiceid());
+        if (bill == null) {
+            throw new IllegalOperatorException("买家选择需要开票,但发票信息不存在,请重新确认");
+        }
+
+        // 发票基本信息
+        BillSubmit billSubmit = new BillSubmit();
+        billSubmit.setInvoicetitle(bill.getHead());
+        billSubmit.setInvoiceid(bill.getId());
+        billSubmit.setInvoiceAddress(bill.getArea() + "," + bill.getDetailAddress());
+        billSubmit.setInvoicetype(bill.getKind());
+        billSubmit.setCreateTime(new Date());
+        billSubmit.setReceiverName(bill.getName());
+        billSubmit.setRecTel(bill.getTelephone());
+        billSubmit.setStatus(Status.SUBMITTED.value());
+        billSubmit.setSubmituu(order.getBuyeruu());
+        if (order.getBuyerenuu() != null)
+            billSubmit.setSubmitEnuu(order.getBuyerenuu());
+
+        billSubmit.setSellername(order.getSellername());
+        billSubmit.setSellerenuu(order.getSellerenuu());
+
+        order.setInvoicetype(bill.getKind());
+        order.setInvoiceAddress(bill.getArea() + "," + bill.getDetailAddress());
+        order.setInvoiceid(bill.getId());
+        order.setInvoicetitle(bill.getHead());
+        order.setVatBillStatus(Status.TOBEMAKE_BILL.value());
+        orderDao.save(order);
+
+        billSubmit.setPrice(order.getPrice());
+        billSubmit.setOrderids(order.getOrderid());
+
+        return billSubmitDao.save(billSubmit);
+    }
+
     @Override
     public Page<BillSubmit> getAll(final PageInfo pageInfo, String keyword, String invoicetype , String status, String role) {
         if (Type.BUYER.name().equals(role)) {

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

@@ -148,6 +148,7 @@ public class AddressServiceImpl implements AddressService {
 					num =addressDao.getCountByUseruuTypeUsetypeAndDissociative(user.getUserUU(),address.getType(), address.getUsetype(), Type.PERSONAL.value());
 				}
 			}else {
+				address.setUseruu(user.getUserUU());
 				address.setEnuu(user.getEnterprise().getUu());
 				address.setUsetype((short)2);
 				num = addressDao.getCountByEnuuAndTypeAndUsetype(user.getEnterprise().getUu(), address.getType(), address.getUsetype());
@@ -156,13 +157,13 @@ public class AddressServiceImpl implements AddressService {
 		}
 		Long modifyId = address.getId();
 		Address add = save(address);
-		if (modifyId == null && add.getNum().intValue() == 1){
+		if (modifyId == null && add.getNum() == 1){
 			isSetTop = true;
 		}
 		if(modifyId == null || isSetTop) { //只有新增加的地址 或者需要被置顶的地址 才需要重新排序。
 			setTop(add.getId(), isSetTop);
 		}
-		if (address.getNum().intValue() == 1 && !isSetTop) { //取消默认地址的时候需要重新排序
+		if (address.getNum() == 1 && !isSetTop) { //取消默认地址的时候需要重新排序
 			setTop(add.getId(), isSetTop);
 		}
 		return add;
@@ -173,9 +174,9 @@ public class AddressServiceImpl implements AddressService {
 		List<Address> address = new ArrayList<Address>();
 		if (send) {
 			if (enuu != null) {
-				address = addressDao.findByUseruuAndEnuuAndTypeAndUsetypeOrderByNumAsc(useruu, enuu, Type.Address_Sending_Code.value(), (short)1);
+				address = addressDao.findByEnuuAndTypeAndUsetypeOrderByNumAsc(enuu, Type.Address_Sending_Code.value(), (short)2);
 			} else {
-				address = addressDao.findByUseruuAndTypeAndUsetypeAndDissociative(useruu, Type.Address_Sending_Code.value(), (short)1, Type.PERSONAL.value());
+				address = addressDao.findByUseruuAndTypeAndUsetypeAndDissociative(useruu, Type.Address_Sending_Code.value(), (short)2, Type.PERSONAL.value());
 			}
 		} else {
 			if (enuu != null) {

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

@@ -95,9 +95,9 @@ public class GoodsController {
 		PageInfo info = new PageInfo(params);
 		Long enUU = SystemSession.getUser().getEnterprise().getUu();
 		info.filter("enUU", enUU);
-		if (status.equals("AVAILABLE")) {
+		if ("AVAILABLE".equals(status)) {
 			info.filter("status", Status.AVAILABLE.value());
-		} else if (status.equals("UNAVAILABLE")) {
+		} else if ("UNAVAILABLE".equals(status)) {
 			info.filter("status", Status.UNAVAILABLE.value());
 		}
 		Page<Goods> page = goodsService.findPageByStatus(info, keyword);
@@ -116,9 +116,9 @@ public class GoodsController {
     @RequestMapping(value = "/saling/admin", method = RequestMethod.GET)
 	public Page<Goods> findSalingGoodsAdmin(PageParams params, String status, String keyword) {
 		PageInfo info = new PageInfo(params);
-		if (status.equals("AVAILABLE")) {
+		if ("AVAILABLE".equals(status)) {
 			info.filter("status", Status.AVAILABLE.value());
-		} else if (status.equals("UNAVAILABLE")) {
+		} else if ("UNAVAILABLE".equals(status)) {
 			info.filter("status", Status.UNAVAILABLE.value());
 		}
 		Page<Goods> page = goodsService.findPageByStatus(info, keyword);
@@ -214,7 +214,8 @@ public class GoodsController {
     @RequestMapping(value = "/simple/byUuidAndCurrency", method = RequestMethod.GET, params = "_status=available")
 	@ResponseBody
 	public List<GoodsSimple> findSimpleAvailableByUuid(String uuid, String currencyName) {
-		if (StringUtils.isEmpty(currencyName) || "without".equals(currencyName)) {// 不进行币别筛选
+		// 不进行币别筛选
+		if (StringUtils.isEmpty(currencyName) || "without".equals(currencyName)) {
 			logger.log("商品批次", "根据商品uuid获取有效的商品批次", "uuid: " + uuid);
 			return goodsService.findSimpleAvailableByUuid(uuid);
 		} else {
@@ -313,6 +314,7 @@ public class GoodsController {
 	public Goods findByBatchCode(@PathVariable String batchCode) {
 		batchCode = StringUtilB2C.decodeValue(batchCode);
 		Goods goods = goodsService.findGoodsByBatchCode(batchCode);
+		goodsService.addVisitCount(batchCode);
 		logger.log("商品批次", "根据批次号获取商品信息", "批次号:" + batchCode);
 		return goods;
 	}

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

@@ -409,7 +409,7 @@ public interface GoodsDao extends JpaSpecificationExecutor<Goods>, JpaRepository
      * @param storeUuid 店铺UUID
      * @return the set
      */
-    @Query(value = "select distinct g.kindUuid from Goods g where g.storeid = :storeUuid and g.status=601")
+    @Query(value = "select distinct g.kindUuid from Goods g where g.storeid = :storeUuid and g.status=601 and g.kindUuid is not null")
 	Set<Long> findAllKindsByStoreUuid(@Param("storeUuid") String storeUuid);
 
     /**
@@ -521,4 +521,14 @@ public interface GoodsDao extends JpaSpecificationExecutor<Goods>, JpaRepository
      */
     @Query(value = "select sum(go_reserve) from trade$goods where go_enuu=:enuu and cmp_uuid=:uuid and go_status=:status ", nativeQuery = true)
     Double getSumReserveByEnUUAndUuidAndStatus(@Param("enuu") Long enuu, @Param("uuid") String uuid, @Param("status") Integer status);
+
+    /**
+     * 产品点击次数加一
+     * @param batchCode
+     * @return
+     */
+    @Modifying
+    @Transactional
+    @Query( nativeQuery = true, value = "update trade$goods set go_visit_count = ifnull(go_visit_count, 0) + 1 where go_batchcode = :batchCode")
+    public void addVisitCount(@Param("batchCode") String batchCode);
 }

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

@@ -88,6 +88,15 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
      */
     List<Product> findByEnUUAndCmpUuId(Long enuu, String uuid);
 
+    /**
+     * 通过企业uu,标准器件uuid,来源获取物料信息
+     * @param enuu 企业uu
+     * @param uuid 标准器件uuid
+     * @param sourceapp 来源
+     * @return
+     */
+    List<Product> findByEnUUAndCmpUuIdAndSourceApp(Long enuu, String uuid, String sourceapp);
+
     /**
      * 获取该企业的产品信息
      * @param enuu 企业的uu号

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

@@ -212,6 +212,12 @@ public class Goods implements Serializable {
 	@Transient
 	private Double oldReserve;
 
+	/**
+	 * 单位
+	 */
+	@Column(name = "go_unit")
+	private String unit;
+
 	/**
 	 * 发布备注
 	 */
@@ -561,6 +567,14 @@ public class Goods implements Serializable {
 		this.img = img;
 	}
 
+	public String getUnit() {
+		return unit;
+	}
+
+	public void setUnit(String unit) {
+		this.unit = unit;
+	}
+
 	public String getKindNameCn() {
 		return kindNameCn;
 	}

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

@@ -548,4 +548,11 @@ public interface GoodsService {
      * @return
      */
     ResultMap updateGoodsRelateInfo(List<Order> orders, List<Cart> carts, List<GoodsBrowsingHistory> browsingHistoryList, Product product, ProductStandardPutOnInfo putOnInfo, GoodsHistory goodsHistory, Goods goods);
+
+    /**
+     * 商品点击次数加一
+     * @param uuid
+     * @return
+     */
+    public void addVisitCount(String batchCode);
 }

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

@@ -57,7 +57,6 @@ import com.uas.platform.core.persistence.criteria.SimpleExpression;
 import com.uas.platform.core.util.StringUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
-import org.apache.log4j.Logger;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
@@ -183,8 +182,6 @@ public class GoodsServiceImpl implements GoodsService {
 	@Autowired
 	private ProductDetailDao productDetailDao;
 
-	private final Logger logger = Logger.getLogger(getClass());
-
 	@Autowired
 	public GoodsServiceImpl(KindService kindService, StoreInDao storeInDao, StoreInService storeInService, ProductStandardPutOnInfoDao productStandardPutOnInfoDao, ProductDao productDao, BrowsingHistoryService browsingHistoryService, RecommendProductService recommendProductService) {
 		this.kindService = kindService;
@@ -1875,7 +1872,6 @@ public class GoodsServiceImpl implements GoodsService {
 	@Override
 	public ResultMap offShelfGoodsByProvider(String batchCodes) {
 		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-		logger.info(String.format("%s 商城测试下架时间记录1", dateFormat.format(new Date())));
 		if (StringUtils.isEmpty(batchCodes)) {
 			return new ResultMap(CodeType.NO_INFO.code(), "待下架批次号字符串不能为空");
 		}
@@ -1887,11 +1883,8 @@ public class GoodsServiceImpl implements GoodsService {
 		List<String> batchCodeList = new ArrayList<>();
 
 		String storeUuid = "";
-		logger.info(String.format("%s 商城测试下架时间记录2", dateFormat.format(new Date())));
 		for (String batchCode : batchCodeArr) {
-			logger.info(String.format("%s 商城测试下架时间记录 调用下架方法开始", dateFormat.format(new Date())));
 			ResultMap resultMap = offShelfOneGoodsByProvider(batchCode);
-			logger.info(String.format("%s 商城测试下架时间记录  调用下架方法结束", dateFormat.format(new Date())));
 			if (resultMap.isSuccess()) {
 				Goods goods = (Goods) resultMap.getData();
 				uuids.add(goods.getUuid());
@@ -1901,17 +1894,13 @@ public class GoodsServiceImpl implements GoodsService {
 			}
 		}
 		for (String uuid : uuids) {
-			logger.info(String.format("%s 商城测试下架时间记录 更新器件库存信息 开始", dateFormat.format(new Date())));
 			updateComponentTradeInfos(uuid);
-			logger.info(String.format("%s 商城测试下架时间记录 更新器件库存信息 结束", dateFormat.format(new Date())));
 		}
 
 		if (!StringUtils.isEmpty(storeUuid)) {
-			logger.info(String.format("%s 商城测试下架时间记录 更新推荐库存信息开始", dateFormat.format(new Date())));
 			List<String> list = Arrays.asList(batchCodeArr);
 			Set<String> batchCodeSet = new HashSet<>(list);
 			recommendProductService.deleteProductsWhenSellerUpdateReserve(storeUuid, batchCodeSet);
-			logger.info(String.format("%s 商城测试下架时间记录 更新推荐库存信息结束", dateFormat.format(new Date())));
 		}
 
 		if (batchCodeList.size() == 0) {
@@ -1929,7 +1918,6 @@ public class GoodsServiceImpl implements GoodsService {
 	@Transactional
 	public ResultMap offShelfOneGoodsByProvider(String batchCode) {
 		SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-		logger.info(String.format("%s 商城测试下架时间记录 进入下架方法", dateFormat.format(new Date())));
 		if (StringUtils.isEmpty(batchCode)) {
 			return new ResultMap(CodeType.NO_INFO.code(), "待下架批次号不能为空");
 		}
@@ -1948,26 +1936,11 @@ public class GoodsServiceImpl implements GoodsService {
 		}
 		goods.setStatus(Status.REMOVED.value());
 
-		logger.info(String.format("%s 商城测试下架时间记录 转历史库存 开始", dateFormat.format(new Date())));
 		GoodsHistory goodsHist = goodsHistoryService.converTGoodsHist(goods,
 				GoodsHistory.OperateType.Down.getPhrase());
-		logger.info(String.format("%s 商城测试下架时间记录 转历史库存 结束", dateFormat.format(new Date())));
 		goodsHist.setMessage(goodsHist.getMessage() + "该批次下架");
 		goodsHistoryService.save(goodsHist);
 
-//		ProductStandardPutOnInfo standardPutOnInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
-//		if(standardPutOnInfo != null) {
-//			standardPutOnInfo.setStatus(Status.REMOVED.value());
-//			standardPutOnInfo.setAvailableOnSale(NumberUtil.add(standardPutOnInfo.getAvailableOnSale(), standardPutOnInfo.getOnSaleQty()));
-//			standardPutOnInfo.setOnSaleQty(0.0d);
-//			productStandardPutOnInfoDao.save(standardPutOnInfo);
-//
-//			Product product = productDao.findOne(standardPutOnInfo.getProductid());
-//			product.setAvailableOnSale(standardPutOnInfo.getAvailableOnSale());
-//			product.setOnSaleQty(standardPutOnInfo.getOnSaleQty());
-//			productDao.save(product);
-//		}
-
 		//下架对应的批次
 		goodsDao.deleteByBatchCode(goods.getBatchCode());
 		return ResultMap.success(goods);
@@ -2291,28 +2264,11 @@ public class GoodsServiceImpl implements GoodsService {
 			histories.add(goodsHistory);
 			goodsUpdate.add(goods);
 
-//			ProductStandardPutOnInfo standardPutOnInfo = productStandardPutOnInfoDao.findOne(goods.getStandprodid());
-//			if(standardPutOnInfo != null) {
-//				standardPutOnInfo.setStatus(Status.REMOVED.value());
-//				standardPutOnInfo.setAvailableOnSale(NumberUtil.add(standardPutOnInfo.getAvailableOnSale(), standardPutOnInfo.getOnSaleQty()));
-//				standardPutOnInfo.setOnSaleQty(0.0d);
-//				productStandardPutOnInfoList.add(standardPutOnInfo);
-//
-//				Product product = productDao.findOne(standardPutOnInfo.getProductid());
-//				product.setAvailableOnSale(standardPutOnInfo.getAvailableOnSale());
-//				product.setOnSaleQty(standardPutOnInfo.getOnSaleQty());
-//				products.add(product);
-//			}else {
-//				throw new IllegalOperatorException("找不到对应的标准上架产品信息");
-//			}
-//			productStandardPutOnInfoService.updateAvailableQty(goods.getStandprodid(), goods.getReserve());
             uuids.add(goods.getUuid());
 		}
 
 		goodsDao.delete(goodsUpdate);
         goodsHistoryDao.save(histories);
-//		productDao.save(products);
-//		productStandardPutOnInfoDao.save(productStandardPutOnInfoList);
         for (String uuid : uuids) {
             updateComponentTradeInfos(uuid);
         }
@@ -2374,9 +2330,12 @@ public class GoodsServiceImpl implements GoodsService {
 		orderService.save(orders);
 		cartService.saveCart(carts);
 		browsingHistoryService.saveGoodsBrowsingHistoryList(browsingHistoryList);
-//		productStandardPutOnInfoService.save(putOnInfo);
-//		productService.save(product);
 		goodsHistoryService.save(goodsHistory);
 		return ResultMap.success(null);
 	}
+
+	@Override
+	public void addVisitCount(String batchCode) {
+		goodsDao.addVisitCount(batchCode);
+	}
 }

+ 21 - 0
src/main/java/com/uas/platform/b2c/prod/product/brand/api/BrandController.java

@@ -45,6 +45,26 @@ public class BrandController {
 		return brandService.getAllBrandInfo();
 	}
 
+	/**
+	 * 查找已推广的按权重排序的品牌信息
+	 *
+	 * @return 品牌简易信息
+	 */
+	@RequestMapping(value = "/Info/weight", method = RequestMethod.GET)
+	public List<BrandInfo> getBrankInfoOrderByWeight() {
+		return brandService.getAllBrandInfoByWeight();
+	}
+
+	/**
+	 * 修改某个品牌的 权重
+	 *
+	 * @return 品牌简易信息
+	 */
+	@RequestMapping(value = "/Info/weight", method = RequestMethod.PUT)
+	public BrandInfo updateBrankInfoOrderByWeight(@RequestBody BrandInfo brandInfo ,@RequestParam Double weight) {
+		return brandService.updateBrankInfoOrderByWeight(brandInfo,weight);
+	}
+
 	/**
 	 * 获取按首字母分组的品牌信息
 	 * @return 品牌简易信息
@@ -110,6 +130,7 @@ public class BrandController {
 	 */
 	@RequestMapping(value = "/{uuid}")
 	private Brand findByUuid(@PathVariable("uuid") String uuid) {
+		brandService.addVisitCount(uuid);
 		return brandService.findByUuid(uuid);
 	}
 

+ 1 - 0
src/main/java/com/uas/platform/b2c/prod/product/brand/controller/BrandController.java

@@ -52,6 +52,7 @@ public class BrandController {
 	 */
 	@RequestMapping(value = "/{uuid}", method = RequestMethod.GET)
 	public Brand findByUuid(@PathVariable("uuid") String uuid) {
+		brandService.addVisitCount(uuid);
 		return brandService.findByUuid(uuid);
 	}
 

+ 14 - 1
src/main/java/com/uas/platform/b2c/prod/product/brand/controller/BrandMapController.java

@@ -97,9 +97,22 @@ public class BrandMapController {
 		return mapService.deleteOneMap(id);
 	}
 
+	/**
+	 * 初始化品牌映射数据
+	 */
 	@RequestMapping(value = "/initMap", method = RequestMethod.POST)
-	public void initAllBrandMap(){
+	public void initAllBrandMap() {
 		logger.log("品牌映射", "品牌映射初始化");
 		mapService.initBrandMap();
 	}
+
+	/**
+	 * 根据enuu初始化品牌映射数据
+	 * @param enuu
+	 */
+	@RequestMapping(value = "/initMap/{enuu}", method = RequestMethod.GET)
+	public void initBrandMapByEnUU(@PathVariable Long enuu) {
+		logger.log("品牌映射", "品牌映射初始化");
+		mapService.initBrandMapByEnUU(enuu);
+	}
 }

+ 12 - 0
src/main/java/com/uas/platform/b2c/prod/product/brand/dao/BrandDao.java

@@ -7,11 +7,13 @@ import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
 import com.uas.platform.b2c.prod.product.brand.modal.Brand;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 品牌
@@ -78,4 +80,14 @@ public interface BrandDao extends JpaSpecificationExecutor<Brand>, JpaRepository
 	 */
 	@Query(value = "select b from Brand b  where b.inital in :initals and (b.nameEn like %:keyword% or b.nameCn like %:keyword%)")
 	public Page<Brand> findInInitalsPage(@Param("initals") String[] initals ,@Param("keyword") String keyword, Pageable pageable);
+
+	/**
+	 * 器件点击次数加一
+	 * @param uuid
+	 * @return
+	 */
+	@Modifying
+	@Transactional
+	@Query( nativeQuery = true, value = "update product$brand b set b.br_visit_count = ifnull(b.br_visit_count, 0) + 1 where b.br_uuid = :uuid")
+	public void addVisitCount(@Param("uuid") String uuid);
 }

+ 15 - 0
src/main/java/com/uas/platform/b2c/prod/product/brand/dao/BrandInfoDao.java

@@ -66,4 +66,19 @@ public interface BrandInfoDao extends JpaSpecificationExecutor<BrandInfo>, JpaRe
 	 */
 	@Query(nativeQuery = true, value = "select * from product$brand where br_inital in :initals")
 	public List<BrandInfo> findInInitals(@Param("initals") String[] initals);
+
+	/**
+	 * 根据权重倒序排列品牌信息
+	 * @return
+	 */
+	@Query(value = "select b from BrandInfo b where b.weight is not null and b.weight <> 0 order by b.weight desc")
+	public List<BrandInfo> findByWeight();
+
+	/**
+	 * 根据权重倒序排列品牌信息
+	 * @return
+	 */
+	@Modifying
+	@Query(value = "update BrandInfo b set b.weight = :increaseNum where b.uuid = :uuid")
+	public int setWeight(@Param("uuid") String uuid, @Param("increaseNum") Double increaseNum);
 }

+ 20 - 0
src/main/java/com/uas/platform/b2c/prod/product/brand/modal/BrandTemp.java

@@ -29,6 +29,26 @@ public class BrandTemp {
 	@Column(name = "name_sd")
 	private String nameSd;
 
+	@Override
+	public boolean equals(Object o) {
+		if (this == o) return true;
+		if (o == null || getClass() != o.getClass()) return false;
+
+		BrandTemp temp = (BrandTemp) o;
+
+		if (nameCd != null ? !nameCd.equals(temp.nameCd) : temp.nameCd != null)
+			return false;
+		return nameSd != null ? nameSd.equals(temp.nameSd) : temp.nameSd == null;
+
+	}
+
+	@Override
+	public int hashCode() {
+		int result = nameCd != null ? nameCd.hashCode() : 0;
+		result = 31 * result + (nameSd != null ? nameSd.hashCode() : 0);
+		return result;
+	}
+
 	public Long getId() {
 		return id;
 	}

+ 2 - 0
src/main/java/com/uas/platform/b2c/prod/product/brand/service/BrandMapService.java

@@ -38,4 +38,6 @@ public interface BrandMapService {
 	Object deleteOneMap(Long id);
 
 	void initBrandMap();
+
+	void initBrandMapByEnUU(Long enuu);
 }

+ 20 - 0
src/main/java/com/uas/platform/b2c/prod/product/brand/service/BrandService.java

@@ -42,6 +42,19 @@ public interface BrandService {
 	 */
 	public List<BrandInfo> getAllBrandInfo();
 
+	/**
+	 * 查找已推广的按权重排序的品牌信息
+	 * @author wangdy
+	 * @return 品牌简易信息
+	 */
+	public List<BrandInfo> getAllBrandInfoByWeight();
+
+	/**
+	 * 修改某个品牌的 权重
+	 * @return 品牌简易信息
+	 */
+	public BrandInfo updateBrankInfoOrderByWeight(BrandInfo brandInfo , Double weight);
+
 	/**
 	 * 获取按首字母分组的品牌信息
 	 * @return 品牌简易信息
@@ -165,4 +178,11 @@ public interface BrandService {
 	 * @return 品牌信息
 	 */
 	public List<BrandMostSimpleInfo> getBatchBrandMostSimpleInfs(List<Long> batchIds);
+
+	/**
+	 * 器件点击次数加一
+	 * @param uuid
+	 * @return
+	 */
+	public void addVisitCount(String uuid);
 }

+ 44 - 4
src/main/java/com/uas/platform/b2c/prod/product/brand/service/impl/BrandMapServiceImpl.java

@@ -30,10 +30,7 @@ import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * 品牌映射服务的实现类
@@ -181,4 +178,47 @@ public class BrandMapServiceImpl implements BrandMapService{
 			}
 		}
 	}
+
+	@Override
+	public void initBrandMapByEnUU(Long enuu) {
+		List<BrandTemp> originalList = brandTempDao.getAllBySdNameNotNull();
+		Set<BrandTemp> convertList = new LinkedHashSet<>(originalList.size());
+		for (BrandTemp temp : originalList){
+			if (!temp.getNameCd().equals(temp.getNameSd())) { //相同的不记录
+				convertList.add(temp);
+			}
+		}
+		List<BrandMap> resultList = new ArrayList<>();
+
+		List<StoreIn> storeList = storeInDao.findByEnUU(enuu);
+		if (CollectionUtils.isEmpty(storeList)){
+			throw new IllegalOperatorException("对应的店铺信息丢失,请刷新重新");
+		}else{
+			StoreIn store = storeList.get(0);
+			for (BrandTemp temp : convertList){
+				List<Brand> brandList = brandDao.findByNameEn(temp.getNameSd());
+				if (!CollectionUtils.isEmpty(brandList)){
+					Brand brand = brandList.get(0);
+					BrandMap map = new BrandMap();
+					map.setNameStandardEn(temp.getNameSd());
+					map.setNameStandardCn(brand.getNameCn());
+					map.setBrandid(brand.getId());
+					map.setUuid(brand.getUuid());
+					map.setNameChildEn(temp.getNameCd());
+					map.setNameChildCn(temp.getNameCd());
+					map.setEnuu(store.getEnUU());
+					map.setEnName(store.getStoreName());
+					map.setType(store.getType());
+
+					User user = SystemSession.getUser();
+					map.setUserUU(user.getUserUU());
+					map.setOperateName(user.getUserName());
+					map.setOperateTime(new Date());
+
+					resultList.add(map);
+				}
+			}
+			brandMapDao.save(resultList);
+		}
+	}
 }

+ 18 - 0
src/main/java/com/uas/platform/b2c/prod/product/brand/service/impl/BrandServiceImpl.java

@@ -26,6 +26,7 @@ import org.springframework.data.domain.Sort;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
 import javax.persistence.criteria.CriteriaBuilder;
@@ -62,6 +63,18 @@ public class BrandServiceImpl implements BrandService {
 		return brandInfoDao.findAll();
 	}
 
+	@Override
+	public List<BrandInfo> getAllBrandInfoByWeight() {
+		return brandInfoDao.findByWeight();
+	}
+
+	@Override
+	@Transactional
+	public BrandInfo updateBrankInfoOrderByWeight(BrandInfo brandInfo , Double weight) {
+		brandInfoDao.setWeight(brandInfo.getUuid(),weight);
+		return brandInfoDao.findOne(brandInfo.getId());
+	}
+
 	@Override
 	public Map<String, List<BrandInfo>> getInitialSimpleInfo() {
 		List<BrandInfo> brands = brandInfoDao.findAll();
@@ -371,4 +384,9 @@ public class BrandServiceImpl implements BrandService {
 		}
 		return brandMostSimpleInfoDao.findBatchBrands(batchIds);
 	}
+
+	@Override
+	public void addVisitCount(String uuid) {
+		brandDao.addVisitCount(uuid);
+	}
 }

+ 1 - 0
src/main/java/com/uas/platform/b2c/prod/product/component/api/ComponentController.java

@@ -166,6 +166,7 @@ public class ComponentController {
 		// 获取user信息 方便获取器件信息时 能根据是否登录 返回不同的附件链接,不登陆 不能看附件信息。
 		User user = (User) request.getSession().getAttribute("user");
 		SystemSession.setUser(user);
+		componentService.addVisitCount(uuid);
 		return componentService.findByUuid(uuid);
 	}
 

+ 12 - 4
src/main/java/com/uas/platform/b2c/prod/product/component/dao/ComponentDao.java

@@ -4,14 +4,12 @@ import java.util.List;
 
 import javax.persistence.QueryHint;
 
-import org.springframework.data.jpa.repository.JpaRepository;
-import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
-import org.springframework.data.jpa.repository.Query;
-import org.springframework.data.jpa.repository.QueryHints;
+import org.springframework.data.jpa.repository.*;
 import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
 import com.uas.platform.b2c.prod.product.component.modal.Component;
+import org.springframework.transaction.annotation.Transactional;
 
 @Repository
 public interface ComponentDao extends JpaSpecificationExecutor<Component>, JpaRepository<Component, Long> {
@@ -122,4 +120,14 @@ public interface ComponentDao extends JpaSpecificationExecutor<Component>, JpaRe
 	 */
 	@Query("select count(1) from Component")
 	public Integer findAllCount();
+
+	/**
+	 * 器件点击次数加一
+	 * @param uuid
+	 * @return
+	 */
+	@Modifying
+	@Transactional
+	@Query( nativeQuery = true, value = "update product$component set cmp_visit_count = ifnull(cmp_visit_count, 0) + 1 where cmp_uuid = :uuid")
+	public void addVisitCount(@Param("uuid") String uuid);
 }

+ 74 - 0
src/main/java/com/uas/platform/b2c/prod/product/component/modal/ComponentGoods.java

@@ -1,6 +1,7 @@
 package com.uas.platform.b2c.prod.product.component.modal;
 
 import com.alibaba.fastjson.annotation.JSONField;
+import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.prod.commodity.model.GoodsQtyPrice;
 import com.uas.platform.b2c.prod.product.brand.modal.BrandInfo;
 import com.uas.platform.b2c.prod.product.kind.model.KindInfo;
@@ -146,6 +147,11 @@ public class ComponentGoods implements Serializable {
 	@Transient
 	private boolean hasSample;
 
+	@Transient
+	private String brandEn;
+
+	@Transient
+	private String kindName;
 	/**
 	 * 本批次的库存数量
 	 */
@@ -290,6 +296,22 @@ public class ComponentGoods implements Serializable {
 		return b2cMaxDelivery;
 	}
 
+	public String getBrandEn() {
+		return brandEn;
+	}
+
+	public void setBrandEn(String brandEn) {
+		this.brandEn = brandEn;
+	}
+
+	public String getKindName() {
+		return kindName;
+	}
+
+	public void setKindName(String kindName) {
+		this.kindName = kindName;
+	}
+
 	public void setB2cMaxDelivery(Short b2cMaxDelivery) {
 		this.b2cMaxDelivery = b2cMaxDelivery;
 	}
@@ -568,4 +590,56 @@ public class ComponentGoods implements Serializable {
 		this.breakUp = breakUp;
 		return this;
 	}
+
+    public ComponentGoods() {
+    }
+	public ComponentGoods(Goods goods) {
+		this.cmpId = 0L;
+		this.goId = goods.getId();
+		this.code = goods.getCode();
+		this.img = goods.getImg();
+		this.uuid = goods.getUuid();
+		this.breakUp = goods.getBreakUp();
+		this.batchCode = goods.getBatchCode();
+		this.minpriceusd = goods
+				.getMinPriceUSD() == null ? ""
+				: goods
+				.getMinPriceUSD().toString();
+		this.minpricermb = goods
+				.getMinPriceRMB() == null ? ""
+				: goods
+				.getMinPriceRMB().toString();
+		this.status = goods.getStatus();
+		this.kindid = goods.getKindUuid();
+		this.brandEn = goods.getBrandNameEn();
+		this.kindName = goods.getKindNameCn();
+		this.brandid = goods.getBrandid();
+//		this. BrandInfo brand;
+//		this. KindInfo kind;
+		this.attach = goods.getAttach();
+		this.sampleQty = goods.getSampleQty();
+		this.sampleAppliedQty = goods
+				.getSampleAppliedQty();
+		this.reserve = goods.getReserve();
+		this.unit = goods.getUnit();
+		this.qtyPrice = goods.getQtyPrice();
+		this.currencyName = goods
+				.getCurrencyName();
+		this.cmpReserve = 0d;
+		this.produceDate = goods.getProduceDate();
+		this.original = goods.getOriginal();
+		this.packaging = goods.getPackaging();
+		this.encapsulation = goods
+				.getEncapsulation();
+		this.minPackQty = goods.getMinPackQty();
+		this.minBuyQty = goods.getMinBuyQty();
+		this.updateDate = goods.getUpdateDate();
+		this.b2cMaxDelivery = goods
+				.getB2cMaxDelivery();
+		this.b2cMinDelivery = goods
+				.getB2cMinDelivery();
+		this.shipArea = goods.getShipArea();
+		this.storeId = goods.getStoreid();
+		this.storeName = goods.getStoreName();
+	}
 }

+ 7 - 0
src/main/java/com/uas/platform/b2c/prod/product/component/service/ComponentService.java

@@ -210,4 +210,11 @@ public interface ComponentService {
 	 * @return 器件信息
 	 */
 	List<ComponentInfo> getBatchComponents(List<Long> batchIds);
+
+	/**
+	 * 器件点击次数加一
+	 * @param uuid
+	 * @return
+	 */
+	public void addVisitCount(String uuid);
 }

+ 4 - 0
src/main/java/com/uas/platform/b2c/prod/product/component/service/impl/ComponentServiceImpl.java

@@ -544,4 +544,8 @@ public class ComponentServiceImpl implements ComponentService {
 		return componentInfoDao.findByBatchids(batchIds);
 	}
 
+	@Override
+	public void addVisitCount(String uuid) {
+		componentDao.addVisitCount(uuid);
+	}
 }

+ 0 - 12
src/main/java/com/uas/platform/b2c/trade/order/model/Purchase.java

@@ -10,18 +10,6 @@ import com.uas.platform.core.persistence.StatusColumn;
 import org.hibernate.annotations.Cache;
 import org.hibernate.annotations.CacheConcurrencyStrategy;
 
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.FetchType;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.OneToMany;
-import javax.persistence.OrderBy;
-import javax.persistence.Table;
-import javax.persistence.Transient;
 import javax.persistence.*;
 import java.io.Serializable;
 import java.util.Date;

+ 14 - 0
src/main/java/com/uas/platform/b2c/trade/order/model/PurchaseDetail.java

@@ -83,6 +83,12 @@ public class PurchaseDetail extends Document {
 	@Column(name = "cmp_uuid")
 	private String uuid;
 
+	/**
+	 * 卖方上架人uu
+	 */
+	@Column(name = "pud_sellpublishuu")
+	private Long sellPublishuu;
+
 	/*
 	 * 开票的状态 700 待开发票 701 待收发票 702 已收发票 703 不需开票
 	 */
@@ -521,6 +527,14 @@ public class PurchaseDetail extends Document {
 		this.uuid = uuid;
 	}
 
+	public Long getSellPublishuu() {
+		return sellPublishuu;
+	}
+
+	public void setSellPublishuu(Long sellPublishuu) {
+		this.sellPublishuu = sellPublishuu;
+	}
+
 	/**
 	 * Gets original.
 	 *

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

@@ -29,6 +29,7 @@ import com.uas.platform.b2c.fa.settlement.dao.BillDao;
 import com.uas.platform.b2c.fa.settlement.dao.BillInfoDao;
 import com.uas.platform.b2c.fa.settlement.model.Bill;
 import com.uas.platform.b2c.fa.settlement.model.BillInfo;
+import com.uas.platform.b2c.fa.settlement.service.BillSubmitService;
 import com.uas.platform.b2c.logistics.dao.AddressDao;
 import com.uas.platform.b2c.logistics.dao.InvoiceFOrderDao;
 import com.uas.platform.b2c.logistics.dao.InvoiceFPurchaseDao;
@@ -193,6 +194,8 @@ public class OrderServiceImpl implements OrderService {
     private InstallmentDao installmentDao;
     @Autowired
     private InstallmentDetailDao installmentDetailDao;
+    @Autowired
+    private BillSubmitService billSubmitService;
 
     /**
      * 保存订单信息
@@ -1431,6 +1434,12 @@ public class OrderServiceImpl implements OrderService {
                 }
                 purchase.setSendstatus(Status.NOT_UPLOAD.value());
                 purchaseDao.save(purchase);
+
+                // 如果买家需要开发票,则生成发票申请
+                if (Type.Bill_No.value() != newOrder.getInvoicetype().intValue()) {
+                    billSubmitService.saveByAdmin(newOrder);
+                }
+
                 //发送短信,异常不作处理
                 try {
                     sendMessage(purchase);

+ 9 - 0
src/main/java/com/uas/platform/b2c/trade/order/service/impl/PurchaseDetailServiceImpl.java

@@ -4,6 +4,8 @@ import com.uas.platform.b2c.common.account.model.User;
 import com.uas.platform.b2c.core.config.SysConf;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.DoubleArith;
+import com.uas.platform.b2c.prod.commodity.dao.GoodsHistoryDao;
+import com.uas.platform.b2c.prod.commodity.model.GoodsHistory;
 import com.uas.platform.b2c.prod.commodity.service.GoodsService;
 import com.uas.platform.b2c.prod.product.common.service.CreateNumberService;
 import com.uas.platform.b2c.trade.order.dao.OrderDetailDao;
@@ -57,6 +59,9 @@ public class PurchaseDetailServiceImpl implements PurchaseDetailService {
 	
 	@Autowired
 	private CreateNumberService createNumberService;
+
+	@Autowired
+	private GoodsHistoryDao goodsHistoryDao;
 	
 	@Autowired
 	private SysConf sysConf;
@@ -194,6 +199,10 @@ public class PurchaseDetailServiceImpl implements PurchaseDetailService {
 			pDetail.setPurchase(purchase);
 			pDetail.setBillStatus(Status.TOBEMAKE_BILL.value());
 			pDetail.setStatusToBeConfirmed(sysConf.getAdminUU());
+			List<GoodsHistory> goodsHistories = goodsHistoryDao.findByBatchCode(pDetail.getBatchCode()); // 查询批次上架人
+			if (CollectionUtils.isNotEmpty(goodsHistories)) {
+				pDetail.setSellPublishuu(goodsHistories.get(0).getPublisherUU());
+			}
 			details.add(pDetail);
 		}
 		purchase.setCmpQty(uuids.size());

+ 7 - 0
src/main/java/com/uas/platform/b2c/trade/order/service/impl/PurchaseServiceImpl.java

@@ -24,6 +24,7 @@ import com.uas.platform.b2c.fa.settlement.dao.BillDao;
 import com.uas.platform.b2c.fa.settlement.dao.BillInfoDao;
 import com.uas.platform.b2c.fa.settlement.model.Bill;
 import com.uas.platform.b2c.fa.settlement.model.BillInfo;
+import com.uas.platform.b2c.fa.settlement.service.BillSubmitService;
 import com.uas.platform.b2c.logistics.dao.*;
 import com.uas.platform.b2c.logistics.model.*;
 import com.uas.platform.b2c.logistics.service.InvoiceFPurchaseService;
@@ -152,6 +153,8 @@ public class PurchaseServiceImpl implements PurchaseService {
     private InstallmentDetailDao installmentDetailDao;
 	@Autowired
 	private InstallmentService installmentService;
+	@Autowired
+	private BillSubmitService billSubmitService;
 
 	@Override
 	public Purchase save(Purchase purchase) {
@@ -708,6 +711,10 @@ public class PurchaseServiceImpl implements PurchaseService {
         if (statusList.contains(purchase.getStatus())) {
             if (isReceived) {
                 purchase.setStatusComfirmed(userUU);
+				// 如果买家需要开发票,则生成发票申请
+				if (Type.Bill_No.value() != newOrder.getInvoicetype().intValue()) {
+					billSubmitService.saveByAdmin(newOrder);
+				}
             } else {
                 purchase.setStatusToBePaidAgain(userUU);
             }

+ 17 - 0
src/main/java/com/uas/platform/b2c/trade/presale/model/Cart.java

@@ -1,8 +1,10 @@
 package com.uas.platform.b2c.trade.presale.model;
 
+import com.uas.platform.b2c.common.account.model.Enterprise;
 import com.uas.platform.b2c.core.utils.NumberUtil;
 import com.uas.platform.b2c.prod.commodity.model.Goods;
 import com.uas.platform.b2c.prod.commodity.model.GoodsSimple;
+import com.uas.platform.b2c.prod.store.model.StoreIn;
 import com.uas.platform.b2c.prod.store.model.StoreType;
 import com.uas.platform.b2c.trade.presale.status.cartStatus;
 import com.uas.platform.core.model.Status;
@@ -148,6 +150,13 @@ public class Cart {
 	@Column(name = "cart_store_uuid")
 	private String storeUuid;
 
+	/**
+	 * 店铺企业信息
+	 */
+	@OneToOne(cascade = { CascadeType.REFRESH }, fetch = FetchType.EAGER)
+	@JoinColumn(name = "cart_store_uuid", referencedColumnName = "st_uuid" ,insertable = false, updatable = false)
+	private StoreIn storeEnterprise;
+
 	/**
 	 * 店铺名称
 	 */
@@ -556,6 +565,14 @@ public class Cart {
 		return this;
 	}
 
+	public StoreIn getStoreEnterprise() {
+		return storeEnterprise;
+	}
+
+	public void setStoreEnterprise(StoreIn storeEnterprise) {
+		this.storeEnterprise = storeEnterprise;
+	}
+
 	@Override
 	public String toString() {
 		return "Cart [id=" + id + ", uu=" + uu + ", enuu=" + enuu + ", uuid=" + uuid + ", batchCode=" + batchCode

+ 6 - 1
src/main/java/com/uas/platform/b2c/trade/support/CodeType.java

@@ -58,7 +58,12 @@ public enum CodeType {
 	/**
 	 * 超时请求
 	 */
-	TIME_OUT(12, "TIME_OUT");
+	TIME_OUT(12, "TIME_OUT"),
+
+	/**
+	 * 无操作权限
+	 */
+	NO_AUTHORITY(13, "NO_AUTHORITY");
 
 	private int code;
 

+ 1 - 1
src/main/resources/prod/account.properties

@@ -11,7 +11,7 @@ sso.cookie.secure=true
 sso.cookie.httponly=true
 sso.login.url=https://account.ubtob.com/sso/login
 sso.logout.url=https://account.ubtob.com/sso/logout
-sso.register.url=http://account.ubtob.com/sso/register
+sso.register.url=https://account.ubtob.com/sso/register_p
 
 #cross domain
 sso.ask.url=https://account.ubtob.com/sso/login/ask

+ 2 - 2
src/main/resources/test/sys.properties

@@ -30,9 +30,9 @@ newsMicroServiceIp=news.usoftchina.com
 newsRedisRefresh=3600
 floorMicroServiceIp=10.10.101.23
 carouselMicroServiceIp=10.10.101.23
-storecmsMicroServiceIp=10.10.101.23
+storecmsMicroServiceIp=192.168.253.12
 endpointUri=10.10.101.23
-recommendPort=20102
+recommendPort=20100
 # upload file
 uploadFileUrl = http://10.10.100.200:9999
 # search file

+ 7 - 3
src/main/webapp/WEB-INF/views/normal/adminWithNav.html

@@ -207,10 +207,14 @@
 			<li class="nav-node"><a href="#help/publish" ><i
 					class="fa fa-envelope"></i><span> 发布</span></a></li>
 
-			<!--<li class="nav-header">推广管理</li>
-			<li class="nav-node"><a href="#help/maintenance" ><i
+			<li class="nav-header">推广管理</li>
+			<li class="nav-node"><a href="#ads/brand" ><i
 					class="fa fa-upload"></i><span> 品牌推广</span></a></li>
-			<li class="nav-node"><a href="#help/publish" ><i
+
+			<li class="nav-header">搜索预览</li>
+			<li class="nav-node"><a href="#search/see" ><i
+					class="fa fa-upload"></i><span> 搜索预览</span></a></li>
+			<!--<li class="nav-node"><a href="#help/publish" ><i
 					class="fa fa-upload"></i><span> 产品推广</span></a></li>
 			<li class="nav-node"><a href="#help/publish" ><i
 					class="fa fa-upload"></i><span> 店铺推广</span></a></li>-->

+ 5 - 1
src/main/webapp/resources/css/erp/align.css

@@ -1,3 +1,7 @@
 .user_content .user_right {
-    margin-right: 90px;
+    float: none!important;
+    margin: 0 auto;
+}
+.wrap {
+    width: 100%;
 }

+ 21 - 7
src/main/webapp/resources/js/admin/app.js

@@ -721,13 +721,27 @@
             controllerUrl: 'app/controllers/AutomaticReceiving',
             title: '买家提醒发货时间条件'
         })).state('downAllGoodsByEnterprise', angularAMD.route({
-			//下架该公司所有的商品
-			url : '/product/downAllGoodsByEnterprise',
-			templateUrl: 'static/view/admin/product/downGoodsByEnterprise.html',
-			controller: 'downGoodsByEnterpriseCtrl',
-			controllerUrl: 'app/controllers/product/downGoodsByEnterprise',
-			title: '下架公司产品'
-		})).state('internalMessage', angularAMD.route({
+            //下架该公司所有的商品
+            url : '/product/downAllGoodsByEnterprise',
+            templateUrl: 'static/view/admin/product/downGoodsByEnterprise.html',
+            controller: 'downGoodsByEnterpriseCtrl',
+            controllerUrl: 'app/controllers/product/downGoodsByEnterprise',
+            title: '下架公司产品'
+        })).state('adsBrand', angularAMD.route({
+            //品牌推广
+            url : '/ads/brand',
+            templateUrl: 'static/view/admin/ads/ads_brand.html',
+            controller: 'adsBrandCtrl',
+            controllerUrl: 'app/controllers/ads/ads_brand',
+            title: '品牌推广'
+        })).state('searchSee', angularAMD.route({
+            //搜索预览
+            url : '/search/see',
+            templateUrl: 'static/view/admin/search/search_See.html',
+            controller: 'SearchSeeBrandCtrl',
+            controllerUrl: 'app/controllers/search/search_See',
+            title: '搜索预览'
+        })).state('internalMessage', angularAMD.route({
 			// 消息列表
 			url: '/internalMessages',
 			templateUrl: 'static/view/admin/common/message/internalMessageList.html',

+ 61 - 0
src/main/webapp/resources/js/admin/controllers/ads/ads_brand.js

@@ -0,0 +1,61 @@
+define([ 'app/app' ], function(app) {
+    //品牌审批
+    app.register.controller('adsBrandCtrl', ['$scope', 'NgTableParams', 'BrandDisable', 'BrandActive', 'toaster', 'BaseService', function($scope, NgTableParams, BrandDisable, BrandActive ,toaster, BaseService) {
+        BaseService.scrollBackToTop();
+
+        $scope.load =  function(params) {
+            if (params == "weight") {
+                BrandActive.getSimpleInfoByWeight({}, {}, function(data) {
+                    $scope.brands =data;
+                    //$scope.isDisable = true;
+                    $scope.brandsTableParams = new NgTableParams({}, { dataset: $scope.brands});
+                }, function(){
+
+                })
+            } else {
+                $scope.isDisable = false;
+                loadData();
+            }
+        };
+
+        var loadData = function(){
+            BrandActive.getSimpleInfo({}, {}, function(data){
+                $scope.brands = data;
+                $scope.brandsTableParams = new NgTableParams({}, { dataset: $scope.brands});
+            }, function(){
+            })
+        };
+
+        loadData();
+
+        $scope.weight = function(brand){
+            BrandActive.setSimpleInfoWeight({weight: brand.inputWeight}, brand, function(data){
+                toaster.pop('success', '处理成功', '【' + data[0].nameCn + '】' + '禁用成功');
+                loadData();
+            }, function(res){
+                toaster.pop('error', '错误', res.data);
+            })
+        };
+        $scope.disweight = function(brand){
+            BrandActive.setSimpleInfoWeight({weight: 0}, brand, function(data){
+                if (data.weight == 0){
+                    toaster.pop('success', '处理成功', '【' + data.nameCn + '】' + '已取消推广');
+                    $scope.load('weight');
+                } else{
+                    toaster.pop('error', '错误', '取消推广失败');
+                }
+            }, function(res){
+                toaster.pop('error', '错误', res.data);
+            })
+        };
+        $scope.updateweight = function(brand){
+            BrandActive.setSimpleInfoWeight({weight: brand.inputWeight}, brand, function(data){
+                toaster.pop('success', '处理成功', '【' + data.nameCn + '】' + '已修改推广');
+                $scope.load('weight');
+            }, function(res){
+                toaster.pop('error', '错误', res.data);
+            })
+        };
+
+    }]);
+});

+ 171 - 0
src/main/webapp/resources/js/admin/controllers/search/search_See.js

@@ -0,0 +1,171 @@
+define(['app/app'], function (app) {
+    'use strict';
+    app.register.controller('SearchSeeBrandCtrl', ['$scope', '$http', '$rootScope', 'SessionService', function($scope, $http, $rootScope, SessionService) {
+        $scope.searchType = 'original';// 搜索类型
+        $scope.searchType = {
+            original: false,
+            inaction: false,
+            proffing: false,
+            brand: false,
+            isCmp: function() {
+                var me = this;
+                return me.original || me.inaction || me.proffing;
+            }
+        };
+        if(SessionService.get('brand')) {
+            $scope.searchType.brand = true;
+        }
+
+        var componentSearchType = SessionService.get('component');
+        if(componentSearchType) {
+            $scope.searchType = angular.fromJson(componentSearchType);
+            $scope.searchType.isCmp = function() {
+                var me = this;
+                return me.original || me.inaction || me.proffing;
+            }
+        }
+
+        // 点击搜索库存、样品、呆滞
+        $scope.cmpTypeClick = function() {
+            if($scope.searchType.isCmp()) {
+                $scope.searchType.brand = false;
+            }
+        };
+
+        // 点击搜索品牌
+        $scope.brandTypeClick = function() {
+            if($scope.searchType.brand) {
+                $scope.searchType.original = false;
+                $scope.searchType.inaction = false;
+                $scope.searchType.proffing = false;
+            }
+        };
+
+        // 选搜索类型
+        $scope.setSearchType = function(t) {
+            $scope.searchType = t;
+        };
+
+        // 搜索
+        $scope.search = function() {
+            if($scope.keyword) {
+                if($scope.searchType.brand) {
+                    SessionService.set('brand', true);
+                    SessionService.unset('component');
+                    window.location.href = 'search?w=' + encodeURI(encodeURIComponent($scope.keyword)) + '&type=brand';
+                }else if($scope.searchType.isCmp()){
+                    SessionService.set('component', angular.toJson($scope.searchType));
+                    SessionService.unset('brand');
+                    window.location.href = 'search?w=' + encodeURI(encodeURIComponent($scope.keyword)) + '&type=component';
+                }else {
+                    SessionService.unset('component');
+                    SessionService.unset('brand');
+                    var timestart = (new Date()).valueOf();
+                    $http({
+                        method:'GET',
+                        url:'api/product/component/search/compGoods',
+                        params:{
+                            'keyword' : $scope.keyword
+                     }}).then(function (data) {
+                        $scope.result = data.data;
+                        $scope.result.time = (new Date()).valueOf() - timestart;
+                        console.log(data);
+                    },function (error) {
+                    });
+
+                    $http({
+                        method:'GET',
+                        url:'search/componentGoods/collect',
+                        params:{
+                            'keyword' : $scope.keyword,
+                            'collectList' : 'goods_kind',
+                            'paramJSON':{}
+                        }}).then(function (data) {
+                        $scope.result = data.data;
+                        $scope.kindtime = (new Date()).valueOf() - timestart;
+                        console.log(data);
+                    },function (error) {
+                    });
+
+
+
+                   // window.location.href = 'search?w=' + encodeURI(encodeURIComponent($scope.keyword)) + '&type=all';
+                }
+
+            }
+        };
+
+        // 搜索框获得焦点,显示联想框
+        $scope.onFocus = function() {
+            $scope.associate = true;
+            $scope.selectIndex = -1;
+            if(!$scope.keyword) $scope.keyword = '';
+        };
+
+        // 搜索框失去焦点,关闭联想框
+        $scope.onBlur = function() {
+            $scope.associate = false;
+        };
+
+        // 搜索框通过按键选取想要的联想词
+        $scope.onKeyup = function() {
+            if($scope.associates && $scope.associates.length) {
+                if(event.keyCode == 40) { //监听到按下键
+                    $scope.selectIndex ++;
+                    if($scope.selectIndex >= $scope.associates.length) $scope.selectIndex = 0;
+                    $scope.keyword = $scope.associates[$scope.selectIndex];
+                } else if(event.keyCode == 38) { //监听到按上键
+                    $scope.selectIndex --;
+                    if($scope.selectIndex < 0) $scope.selectIndex = $scope.associates.length - 1;
+                    $scope.keyword = $scope.keyword = $scope.associates[$scope.selectIndex];
+                } else if(event.keyCode == 13) { //确定键
+                    $scope.search();
+                }
+            }
+        };
+
+        // 输入框内容变化,获取新的联想词
+        $scope.onChange = function() {
+            if ($scope.keyword) {
+                var params = {
+                    keyword: $scope.keyword
+                };
+                if($rootScope.userInfo) {
+                    params.userUU = $rootScope.userInfo.userUU;
+                }
+                $http.get('search/similarKeywords', {
+                    params : params
+                }).success(function(data){
+                    $scope.associates = data;// 联想词数组
+                }).error(function(response) {
+
+                });
+            } else {
+                $scope.associates = [];// 联想词数组
+            }
+
+        };
+
+        // 点击联想词
+        $scope.onAssociateClick = function(component) {
+            $scope.keyword = component;
+            $scope.search();
+        };
+
+        // 鼠标进入联想词框,不能关闭联想词框
+        $scope.onAssociateEnter = function() {
+            $scope.associateEnter = true;
+        };
+
+        // 鼠标离开联想词框,可以关闭联想词框
+        $scope.onAssociateLeave = function() {
+            $scope.associateEnter = false;
+        };
+
+        // 热词
+        $scope.hotwords = [{name : 'SCT2080KEC', url :'product#/component/1100400300009990/'},
+            {name : '电池组', url : 'product#/kinds/346'},
+            {name : 'Vishay',url : 'product#/brand/30327265e42a871be050007f01003d96/'},
+            {name : 'Panasonic Battery', url : 'product#/brand/30327265e4e7871be050007f01003d96/'}];
+    }]);
+});

+ 16 - 6
src/main/webapp/resources/js/common/controllers/commonCtrls.js

@@ -99,13 +99,13 @@ define([ 'app/app' ], function(app) {
 			$scope.switchto = function(enUU) {
 				AuthenticationService.reSignin(enUU).success(function(){
 					//$window.location.reload();
-					if (!enUU || enUU == '0'){
+					/*if (!enUU || enUU == '0'){
 						var now = window.location.href.toString();
 						if (now.indexOf('vendor') > -1){
                             location.href = './register-saler';
                             return;
 						}
-					}
+					}*/
                     location.href = './';
 				});
 			};
@@ -956,7 +956,7 @@ define([ 'app/app' ], function(app) {
 	}]);
 
 	// Web Chat侧边栏的Controller
-	app.controller('WebChatCtrl', ['$scope', '$interval', 'AuthenticationService', 'ChatBusinessLayer', 'toaster', function($scope, $interval, AuthenticationService, ChatBusinessLayer, toaster) {
+	app.controller('WebChatCtrl', ['$scope', '$interval', 'AuthenticationService', 'ChatBusinessLayer', 'toaster','$rootScope', function($scope, $interval, AuthenticationService, ChatBusinessLayer, toaster ,$rootScope) {
 		$scope.userInfo = null;
 		$scope.countData = 0;
 		$scope.goWebChat = goWebChat;
@@ -975,6 +975,12 @@ define([ 'app/app' ], function(app) {
 		}
 
 		function accessRealTimeData(param) {
+			//先调一次
+            ChatBusinessLayer.accessUnreadMessageCount(param).then(function (count) {
+                $scope.countData = count;
+            }, function () {
+                $scope.countData = 0;
+            });
 			$interval(function () {
 				ChatBusinessLayer.accessUnreadMessageCount(param).then(function (count) {
 					$scope.countData = count;
@@ -995,12 +1001,16 @@ define([ 'app/app' ], function(app) {
 			}
 
 			//获得窗口的垂直位置
-			var iTop = (window.screen.availHeight - 30 - 600) / 2;
+			var iTop = (window.screen.availHeight - 30 - 780) / 2;
 			//获得窗口的水平位置
 			var iLeft = (window.screen.availWidth - 10 - 1030) / 2;
-			var newTab = window.open('', '即时对话框', 'height=600, width=1030, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
-
+			var newTab = window.open('', '即时对话框', 'height=750, width=1000, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
+			newTab.close();
+            var newTab = window.open('', '即时对话框', 'height=750, width=1000, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
 			var chatInfoDto = { userPhone: $scope.param.phone, enUU: $scope.param.enUU };
+			if (!chatInfoDto.enUU){
+				chatInfoDto = {userPhone: $scope.param.phone};
+			}
 			ChatBusinessLayer.visitWebChat(chatInfoDto, 'LIST').then(function (gid) {
 				console.log(gid);
 				//newTab.location.href = 'http://192.168.253.31:20220/chat/visit?gid=' + gid;

+ 68 - 22
src/main/webapp/resources/js/common/module/chat_web_module.js

@@ -19,6 +19,25 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
 			}
 			return param;
 		}
+
+		function getAdminInfo(enUU) {
+			/*Enterprise.getEnterpriseAdminInfo({enuu : enUU}, function(data) {
+				var phone = data.userTel;
+				if (!/^1\d{10}$/.test(phone)){
+					return phone;
+				}
+			},function(response) {
+				return;
+			});
+*/
+			var promise = Enterprise.getEnterpriseAdminInfo({enuu : enUU}, {}).$promise;
+
+			return promise.then(function (data) {
+				return data.userTel;
+			}, function () {
+				return 0;
+			});
+		}
 		
 		function accessUnreadMessageCount(param) {
 			var promise = Chat.countUnReadSessionsWhenUserQuery(param, {}).$promise;
@@ -51,10 +70,10 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
 		 * @param type			聊天类型
 		 */
 		function visitWebChat(chatInfoDto, type) {
-			if (!chatInfoDto || !type || !chatInfoDto.enUU || (type === 'CHAT' && !chatInfoDto.otherEnUU)) return {};
+			if (!chatInfoDto || !type || (type === 'CHAT' && !chatInfoDto.otherEnUU)) return {};
 			chatInfoDto.type = type;
 
-			var promise = getEnterpriseInfo(chatInfoDto.enUU).then(function (enterprise) {
+			var promise = getEnterpriseInfo(chatInfoDto.enUU ? chatInfoDto.enUU : 0).then(function (enterprise) {
 				if (enterprise && enterprise.enUU) {
 					chatInfoDto.enterprise = enterprise;
 				} else {
@@ -91,9 +110,10 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
 		this.visitWebChat = visitWebChat;
 		this.getParamsFromUserInfo = getParamsFromUserInfo;
 		this.accessUnreadMessageCount = accessUnreadMessageCount;
+		this.getAdminInfo = getAdminInfo;
 	}]);
 
-	module.controller('ChatContactCtrl', ['$rootScope', 'ChatBusinessLayer', 'toaster', function ($rootScope, ChatBusinessLayer, toaster) {
+	module.controller('ChatContactCtrl', ['$rootScope', 'ChatBusinessLayer', 'toaster','Enterprise', function ($rootScope, ChatBusinessLayer, toaster, Enterprise) {
 
 		var vm = this;
 		vm.param = {};
@@ -114,30 +134,56 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
 		 * @param userType	联系人用户类型
 		 */
 		function contactWithOther(phone, enUU, userType) {
-			console.log(phone, enUU, userType);
 			//获得窗口的垂直位置
-			var iTop = (window.screen.availHeight - 30 - 600) / 2;
+			var iTop = (window.screen.availHeight - 30 - 780) / 2;
 			//获得窗口的水平位置
 			var iLeft = (window.screen.availWidth - 10 - 1030) / 2;
-			var newTab = window.open('', '即时对话框', 'height=600, width=1030, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no'),
-				chatInfoDto = {
-				userPhone: vm.param.phone,
-				enUU: vm.param.enUU,
-				userType: userType == vm.UserType.STORE ? vm.UserType.ENTERPRISE : vm.UserType.STORE,
-				toPhone: phone,
-				otherEnUU: enUU,
-				otherUserType: userType
-			};
-			ChatBusinessLayer.visitWebChat(chatInfoDto, 'CHAT').then(function (gid) {
-				//newTab.location.href = 'http://192.168.253.31:20220/chat/visit?gid='  gid;
-				newTab.location.href = 'http://im.ubtob.com/chat/visit?gid=' + gid;
-			}, function (error) {
-				console.log(error);
-				newTab.close();
-				toaster.pop('warning', '对方没有开通客服系统,请联系官方客服!');
-			});
+			if (!/^1\d{10}$/.test(phone)){
+				ChatBusinessLayer.getAdminInfo(enUU).then(function (userTel) {
+					phone = userTel;
+					/*if (!/^1\d{10}$/.test(phone)){
+						toaster.pop('warning', '该店铺暂无管理员电话号码!');
+						return;
+					}*/
+					console.log(phone, enUU, userType,iTop,iLeft);
+					startChat(phone,enUU,userType,iTop,iLeft);
+				});
+			}else {
+                startChat(phone,enUU,userType,iTop,iLeft);
+			}
 		}
 
+		var startChat= function (phone,enUU,userType,iTop,iLeft) {
+            if ($rootScope.newTab){
+                $rootScope.newTab.close();
+            }
+            var newTab = window.open('', '即时对话框', 'height=750, width=1000, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
+            newTab.close();
+            var newTab = window.open('', '即时对话框', 'height=750, width=1000, top=' + iTop + ', left=' + iLeft + ', toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
+			var chatInfoDto = {
+                    userPhone: vm.param.phone,
+                    enUU: vm.param.enUU,
+                    userType: userType == vm.UserType.STORE ? vm.UserType.ENTERPRISE : vm.UserType.STORE,
+                    toPhone: phone,
+                    otherEnUU: enUU,
+                    otherUserType: userType
+                };
+            ChatBusinessLayer.visitWebChat(chatInfoDto, 'CHAT').then(function (gid) {
+                if (!gid || gid == ''){
+                    newTab.close();
+                    toaster.pop('warning', '您暂未开通聊天帐号!');
+                    return;
+                }
+                //newTab.location.href = 'http://192.168.253.121:20220/chat/visit?gid=' +  gid;
+                newTab.location.href = 'http://im.ubtob.com/chat/visit?gid=' + gid;
+            }, function (error) {
+                console.log(error);
+                newTab.close();
+                toaster.pop('warning', '对方没有开通客服系统,请联系官方客服!');
+            });
+            $rootScope.newTab = newTab;
+        }
+
 	}]);
 
 });

+ 13 - 2
src/main/webapp/resources/js/common/query/brand.js

@@ -1,7 +1,7 @@
 define([ 'ngResource' ], function() {
 	angular.module('brandServices', [ 'ngResource' ]).factory('BrandsSubmit', ['$resource', 'BaseService', function($resource, BaseService) {
 		//获取BrandSubmit的分页数据
-		var rootPath = BaseService.getRootPath();
+		var rootPath = BaseService.getRootPath() + '/';
 		return $resource('produce/brandSubmit', {}, {
 			//未审核
 			getUnAudited : {
@@ -18,7 +18,7 @@ define([ 'ngResource' ], function() {
 		});
 	}]).factory('BrandSubmit', ['$resource', 'BaseService', function($resource, BaseService) {
 		//对单个BrandSubmit的操作
-		var rootPath = BaseService.getRootPath();
+		var rootPath = BaseService.getRootPath() + '/';
 		return $resource('produce/brandSubmit/:id', {}, {
 			//提交(保存)
 			submit : {
@@ -85,6 +85,17 @@ define([ 'ngResource' ], function() {
 				method : 'GET',
 				isArray : true
 			},
+            // 查找已推广的按权重排序的品牌信息
+            getSimpleInfoByWeight : {
+                url : 'api/product/brand/Info/weight',
+                method : 'GET',
+                isArray : true
+            },
+            // 修改权重品牌信息
+           setSimpleInfoWeight : {
+                url : 'api/product/brand/Info/weight',
+                method : 'PUT'
+            },
 			// 根据品牌ID获取相关的类目列表
 			getKinds : {
 				url: 'api/product/brand/:brandId/kinds',

+ 4 - 0
src/main/webapp/resources/js/common/query/enterprise.js

@@ -152,6 +152,10 @@ define([ 'angular', 'ui-bootstrap', 'ngResource' ], function(angular) {
             getEnterpriseDetailInfo : {
                 url : 'basic/enterprise/:enuu/detailInfo',
                 method : 'GET'
+            },
+            getEnterpriseAdminInfo : {
+                url : 'basic/enterprise/:enuu/admin',
+                method : 'GET'
             },
 			getAllUsersByEnuu : {
 				url : 'basic/user/enterprise/info',

+ 46 - 61
src/main/webapp/resources/js/usercenter/controllers/forstore/account_manager_ctrl.js

@@ -10,6 +10,7 @@ define(['app/app'], function (app) {
         function ($scope, $rootScope, ngTableParams, BaseService,
             ShippingAddress, $modal, Enterprise, User, toaster, $http,
             $stateParams) {
+          document.title = '账户管理-优软商城';
           $rootScope.active = 'account_manager';
           $scope.tab = 'base';
           $scope.userInfo = $rootScope.userInfo;
@@ -670,12 +671,12 @@ define(['app/app'], function (app) {
             });
           };
 
-          //对新密码进行校验
+          // 对新密码进行校验
           $scope.checkSuccess1 = false;
           $scope.checkFailed1 = false;
           $scope.checkNewPassword = function (newPassword) {
-            var reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$/;
-            if (newPassword == null || !reg.test(newPassword)) {
+            var middlLevelReg = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/;
+            if (newPassword == null || !middlLevelReg.test(newPassword)) {
               //toaster.pop('error', '错误', '密码为8-20字符的英文、数字混合');
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
@@ -690,7 +691,7 @@ define(['app/app'], function (app) {
             $scope.checkPasswordLevel(newValue);
           });
 
-          //密码强度校验
+          // 密码强度校验
           $scope.secLevel = 0;
           $scope.checkPasswordLevel = function (newPassword) {
             $scope.checkFailed1 = false;
@@ -698,20 +699,18 @@ define(['app/app'], function (app) {
               $scope.secLevel = 0;
               return false;
             }
-            //不足8位,或仅有数字,或仅有英文
-            if (newPassword.length < 8 || /^[0-9]*$/.test(newPassword)
-                || /^[A-Za-z]*$/.test(newPassword)) {
-              $scope.secLevel = 1;
-              return false;
-            }
-            if (/^[A-Z0-9]{8,20}$/.test(newPassword) || /^[a-z0-9]{8,20}$/.test(
-                    newPassword)) {//达到8位,且 仅有数字+英文小写 或 仅有数字+英文大写
-              $scope.secLevel = 2;
-              return false;
-            }
-            if (/^(?=.*[0-9].*)(?=.*[A-Z].*)(?=.*[a-z].*).{8,20}$/.test(
-                    newPassword)) {
+            // 密码强度中的正则
+            var middlLevelReg = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/;
+            // 密码强度高的正则
+            var heightLevelReg = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/;
+            if(heightLevelReg.test(newPassword)){
               $scope.secLevel = 3;
+              return true;
+            }else if(middlLevelReg.test(newPassword)){
+              $scope.secLevel = 2;
+              return true;
+            }else{
+              $scope.secLevel = 1;
               return false;
             }
           }
@@ -730,25 +729,26 @@ define(['app/app'], function (app) {
             $scope.checkFailed2 = true;
           }
 
-          //修改密码
+          // 修改密码
           $scope.ok = function () {
-            //原密码校验
+            // 原密码校验
             if(!$scope.checkSuccess){
               $scope.checkPassword($scope.user.password);
             }
-            //新密码校验
+            // 新密码校验
             $scope.checkNewPassword($scope.user.newPassword);
-            //再次输入密码校验
+            // 再次输入密码校验
             $scope.checkNewPassword1();
             if(!$scope.checkSuccess || !$scope.checkSuccess1 || !$scope.checkSuccess2){
                 return;
             }
-            if ($scope.user.newPassword == $scope.user.password) {
-              toaster.pop('error', '错误', '新密码与原密码相同');
+            // 密码强度校验
+            if(!$scope.checkPasswordLevel($scope.user.newPassword)){
+              toaster.pop('error', '错误', '密码强度不够,请重新输入');
               return;
             }
-            if ($scope.secLevel <= 1) {
-              toaster.pop('error', '错误', '密码强度不够,请重新输入');
+            if ($scope.user.newPassword == $scope.user.password) {
+              toaster.pop('error', '错误', '新密码与原密码相同');
               return;
             }
             if ($scope.user.newPassword == $scope.user.newPassword1) {//验证重复密码相等
@@ -793,6 +793,7 @@ define(['app/app'], function (app) {
   app.register.controller('UserEmailCtrl',
       ['$scope', '$modalInstance', 'user', 'User', 'toaster', '$interval',
         function ($scope, $modalInstance, user, User, toaster, $interval) {
+          User.getPageToken();
           $scope.user = user;
           $scope.user.userEmail = null;
           $scope.user.newUserEmail = null;
@@ -874,8 +875,8 @@ define(['app/app'], function (app) {
                       }
                     }
                   }, 1000, 60);
-            }, function () {
-              $scope.codeSuccess = false;
+            }, function (response) {
+              toaster.pop('error', '错误', response.data);
             });
           };
 
@@ -1040,8 +1041,8 @@ define(['app/app'], function (app) {
                       }
                     }
                   }, 1000, 60);
-            }, function () {
-              $scope.codeSuccess = false;
+            }, function (response) {
+              toaster.pop('error', '错误', response.data);
             });
           };
 
@@ -1359,7 +1360,7 @@ define(['app/app'], function (app) {
           $scope.checkSuccess2 = false;
           $scope.checkFailed2 = false;
           $scope.choose = function () {
-            if ($scope.uq[0].question != "") {
+            if ($scope.uq[0]!=undefined && $scope.uq[0].question != undefined && $scope.uq[0].question!="") {
               $scope.checkSuccess = true;
               $scope.checkFailed = false;
             } else {
@@ -1369,7 +1370,7 @@ define(['app/app'], function (app) {
           }
 
           $scope.choose1 = function () {
-            if ($scope.uq[1].question != "") {
+            if ($scope.uq[1]!=undefined && $scope.uq[1].question != undefined && $scope.uq[1].question!="") {
               $scope.checkSuccess2 = true;
               $scope.checkFailed2 = false;
             } else {
@@ -1386,17 +1387,17 @@ define(['app/app'], function (app) {
           $scope.checkFailed3 = false;
           $scope.checkFailed3_1 = false;
           $scope.inputAnswer = function () {
-            if ($scope.uq[0].answer == null) {
+            if ($scope.uq[0]==undefined || $scope.uq[0].answer == undefined || $scope.uq[0].answer=="") {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
               $scope.checkFailed1_1 = false;
-              return;
+              return false;
             }
             if ($scope.uq[0].answer.length > 30) {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = false;
               $scope.checkFailed1_1 = true;
-              return;
+              return false;
             }
             $scope.checkSuccess1 = true;
             $scope.checkFailed1 = false;
@@ -1404,17 +1405,17 @@ define(['app/app'], function (app) {
           }
 
           $scope.inputAnswer1 = function () {
-            if ($scope.uq[1].answer == null) {
+            if ($scope.uq[1]==undefined || $scope.uq[1].answer == undefined || $scope.uq[1].answer=="") {
               $scope.checkSuccess3 = false;
               $scope.checkFailed3 = true;
               $scope.checkFailed3_1 = false;
-              return;
+              return false;
             }
             if ($scope.uq[1].answer.length > 30) {
               $scope.checkSuccess3 = false;
               $scope.checkFailed3 = false;
               $scope.checkFailed3_1 = true;
-              return;
+              return false;
             }
             $scope.checkSuccess3 = true;
             $scope.checkFailed3 = false;
@@ -1423,35 +1424,19 @@ define(['app/app'], function (app) {
 
           //保存密保
           $scope.ok = function () {
+            //问题1校验
+            $scope.choose();
+            $scope.inputAnswer();
+            $scope.choose1();
+            $scope.inputAnswer1();
+            if(!$scope.checkSuccess || !$scope.checkSuccess1 || !$scope.checkSuccess2 || !$scope.checkSuccess3){
+              return;
+            }
             var arr = [];
             for (var key in $scope.uq) {
               $scope.uq[key].sort = Number(key) + 1;
               arr[key] = $scope.uq[key];
             }
-            if(!arr[0].question){
-              $scope.checkFailed = true;
-              return;
-            }
-            if(!arr[0].answer){
-              $scope.checkFailed1 = true;
-              return;
-            }
-            if((arr[0].answer).length>30){
-              $scope.checkFailed1_1 = true;
-              return;
-            }
-            if(!arr[1].question){
-              $scope.checkFailed2 = true;
-              return;
-            }
-            if(!arr[1].answer){
-              $scope.checkFailed3 = true;
-              return;
-            }
-            if((arr[1].answer).length>30){
-              $scope.checkFailed3_1 = true;
-              return;
-            }
             User.updateUserQuestion({}, arr, function () {
               toaster.pop('success', '成功', '密保问题设置成功。');
               $modalInstance.close();

+ 225 - 194
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_cart_ctrl.js

@@ -43,47 +43,47 @@ define(["app/app", 'jquery-summernote'], function(app) {
 		$scope.isChooseAll = false;
 
 		$scope.loadData = function (){
-			Cart.getPageInfo($scope.pageInfo, function(data) {
-				$scope.isDataLoading = false;
-				$scope.total = data.totalElements;
-				$scope.pageNum = data.totalPages;
+				Cart.getPageInfo($scope.pageInfo, function(data) {
+					$scope.isDataLoading = false;
+					$scope.total = data.totalElements;
+					$scope.pageNum = data.totalPages;
 
-				angular.forEach(data.content, function (cart) {
-					cart.buyCurrency = cart.currencyName.indexOf("RMB") > -1 ? "RMB" : "USD";
-					cart.isSelect = false;
-					//计算分段和统计一下价格
-					$scope.getPrice(cart);
-
-					//便于后期循环
-					$scope.carts.push(cart);
-					$scope.disabledAddAndSub(cart);
-					$scope.countByPage += 1;
-					var isContain = false;
-					for (var i = 0; i < $scope.cartMap.length; i++) {
-						if(angular.equals($scope.cartMap[i].name, cart.storeName)) {
-							$scope.cartMap[i].arr.push(cart);
-							isContain = true;
+					angular.forEach(data.content, function (cart) {
+						cart.buyCurrency = cart.currencyName.indexOf("RMB") > -1 ? "RMB" : "USD";
+						cart.isSelect = false;
+						//计算分段和统计一下价格
+						$scope.getPrice(cart);
+
+						//便于后期循环
+						$scope.carts.push(cart);
+						$scope.disabledAddAndSub(cart);
+						$scope.countByPage += 1;
+						var isContain = false;
+						for (var i = 0; i < $scope.cartMap.length; i++) {
+							if(angular.equals($scope.cartMap[i].name, cart.storeName)) {
+								$scope.cartMap[i].arr.push(cart);
+								isContain = true;
+							}
 						}
-					}
-					if(!isContain) {
-						var obj = {};
-						obj.name = cart.storeName;
-						obj.arr = [];
-						obj.arr.push(cart);
-						$scope.cartMap.push(obj);
-					}
-				});
-				$scope.cartIsEmpty = !$scope.carts.length ? true : false;
-				//设置全选的复选框
-				$scope.isChooseAll = $scope.isAllSelect($scope.carts);
+						if(!isContain) {
+							var obj = {};
+							obj.name = cart.storeName;
+							obj.arr = [];
+							obj.arr.push(cart);
+							$scope.cartMap.push(obj);
+						}
+					});
+					$scope.cartIsEmpty = !$scope.carts.length ? true : false;
+					//设置全选的复选框
+					$scope.isChooseAll = $scope.isAllSelect($scope.carts);
 
-				//设置店铺复选框的状态
-				angular.forEach($scope.cartMap, function (store) {
-					$scope.selectedStore[store.name] = $scope.isAllSelect(store.arr);
+					//设置店铺复选框的状态
+					angular.forEach($scope.cartMap, function (store) {
+						$scope.selectedStore[store.name] = $scope.isAllSelect(store.arr);
+					});
+				},function() {
+					toaster.pop('error', "提示", "获取购物车信息失败,请刷新页面");
 				});
-			},function() {
-				toaster.pop('error', "提示", "获取购物车信息失败,请刷新页面");
-			});
 		};
 
 		$scope.loadData();
@@ -120,7 +120,7 @@ define(["app/app", 'jquery-summernote'], function(app) {
 			//计算总价格
 			$scope.calculateAmount($scope.selectedStoreCarts);
 		};
-
+		
 		// 减少按钮,每次减minPackQty
 		$scope.reduce = function(cart){
 			if(cart.status == 1) {
@@ -139,7 +139,7 @@ define(["app/app", 'jquery-summernote'], function(app) {
 			//计算总价格
 			$scope.calculateAmount($scope.selectedStoreCarts);
 		};
-
+				
 		//根据搜索词过滤购物车信息,对类目、品牌、器件筛选
 		$scope.cartFilterCurrency = function(cartGroup) {
 			var result = false;
@@ -167,8 +167,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
 
 		$scope.closeTable = function() {
 			console.log('0kds');
-		};
-		// //监听点击的位置,隐藏价格梯度的信息
+        };
+        // //监听点击的位置,隐藏价格梯度的信息
 		// document.onclick = function(event) {
 		// 	$scope.$apply(function () {
 		// 		angular.forEach($scope.carts, function (cart) {
@@ -181,9 +181,9 @@ define(["app/app", 'jquery-summernote'], function(app) {
 
 		//查看价格分段。
 		$scope.togglePrice = function (cart) {
-			cart.display = cart.display == 'block' ? 'none' : 'block';
-		};
-		// 统计已勾选批次
+            cart.display = cart.display == 'block' ? 'none' : 'block';
+        };
+        // 统计已勾选批次
 		var creatSelectArr = function(){
 			var arr = [];
 			angular.forEach($scope.carts, function(cart) {
@@ -220,20 +220,46 @@ define(["app/app", 'jquery-summernote'], function(app) {
 
 		// 输入购买量限制
 		$scope.blurNum = function (c) {
+			// c.inputError = 0;
+			// c.noInputError = 0;
 			if(isNaN(c.number)) {
 				toaster.pop('info','提示','请输入数字');
 				c.number = c.goods.minBuyQty;
 			}
 			c.number = Number(c.number);
 			if (c.number < c.goods.minBuyQty || !c.number) {
-				toaster.pop("info", "提示", "该商品最少购买" + c.goods.minBuyQty + "件");
-				c.number = c.goods.minBuyQty;
+				// toaster.pop("info", "提示", "该商品最少购买" + c.goods.minBuyQty + "件");
+				if (c.goods.breakUp) {
+					toaster.pop('info','提示','最小起订量为' + c.goods.minBuyQty);
+					// c.noInputError = 1;
+					c.number = c.goods.minBuyQty;
+					// $timeout(function () {
+					// 	c.noInputError = 1;
+					// }, 3000);
+				} else {
+					// c.inputError = 1;
+					toaster.pop('info','提示','最小起订量为' + c.goods.minBuyQty);
+					c.number = c.goods.minBuyQty;
+					// $timeout(function () {
+					// 	c.inputError = 0;
+					// }, 3000);
+				}
 			}else if(c.number > c.goods.reserve){
-				toaster.pop("info", "提示", "库存不足");
+				// toaster.pop("info", "提示", "库存不足");
 				if(c.goods.breakUp) {
+					toaster.pop("info", "提示", "库存不足");
+					// c.noInputError = 2;
 					c.number = c.goods.reserve;
+					// $timeout(function () {
+					// 	c.noInputError = 0;
+					// }, 3000);
 				}else {
+					// c.inputError = 2;
+					toaster.pop("info", "提示", "库存不足")
 					c.number = Number(NumberService.sub(c.goods.reserve, c.goods.reserve % c.goods.minPackQty));
+					// $timeout(function () {
+					// 	c.inputError = 0;
+					// }, 3000);
 				}
 				if(Number(c.number) < Number(c.goods.minBuyQty)) {
 					c.number = c.goods.minBuyQty;
@@ -242,8 +268,13 @@ define(["app/app", 'jquery-summernote'], function(app) {
 				if(!c.goods.breakUp) {
 					var remander = c.number % c.goods.minPackQty;
 					if(remander != 0) {
+						// c.inputError = 3;
+						toaster.pop("info", "提示", "不支持拆包且包装量为" + c.goods.minPackQty);
 						c.number = NumberService.sub(c.number, c.number % c.goods.minPackQty);
 						c.number = NumberService.add(c.number, c.goods.minPackQty);
+						// $timeout(function () {
+						// 	c.inputError = 0;
+						// }, 3000);
 					}
 					if(Number(c.number) > Number(c.goods.reserve)) {
 						c.number = NumberService.sub(c.goods.reserve, c.goods.reserve % c.goods.minPackQty);
@@ -328,8 +359,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
 						return ;
 					}
 				}
-				$scope.totalMoneyInfo.countBT++;
-				$scope.selectedStoreCarts.push(cart);
+                $scope.totalMoneyInfo.countBT++;
+                $scope.selectedStoreCarts.push(cart);
 			}else {//取消勾选
 				$scope.totalMoneyInfo.countBT--;
 				$scope.selectedStoreCarts = $scope.selectedStoreCarts.filter(function(item) {
@@ -373,36 +404,36 @@ define(["app/app", 'jquery-summernote'], function(app) {
 			}
 		};
 
-		// 清空失效产品
-		$scope.deleteInvalid = function(){
+        // 清空失效产品
+        $scope.deleteInvalid = function(){
 			var arr = [];
-			angular.forEach($scope.carts, function(cart){
-				if(cart.status == 1){
-					arr.push(cart.id);
-				}
-			});
-			if(arr.length <= 0) {
-				toaster.pop('warning', '提示', '购物车内目前没有失效的产品');
-				return ;
-			}
-			var ids = angular.toJson(arr);
-			$modal.open({
-				templateUrl : 'static/view/common/modal/invalid_delete_modal.html',
-				controller : 'cartDeleteCtrl',
-				size : 'md',
-				resolve : {
-					description : function () {
-						return '是否删除购物车内的无效商品';
-					},
-					ids : function () {
-						return ids;
-					}
-				}
-			}).result.then(function () {
+            angular.forEach($scope.carts, function(cart){
+                if(cart.status == 1){
+                    arr.push(cart.id);
+                }
+            });
+            if(arr.length <= 0) {
+                toaster.pop('warning', '提示', '购物车内目前没有失效的产品');
+                return ;
+            }
+            var ids = angular.toJson(arr);
+            $modal.open({
+                templateUrl : 'static/view/common/modal/invalid_delete_modal.html',
+                controller : 'cartDeleteCtrl',
+                size : 'md',
+                resolve : {
+                    description : function () {
+                        return '是否删除购物车内的无效商品';
+                    },
+                    ids : function () {
+                        return ids;
+                    }
+                }
+            }).result.then(function () {
 				afterDeleteRefreshInfo(arr);
 			}, function () {
-			});
-		};
+            });
+        };
 
 		var afterDeleteRefreshInfo = function (arr) {
 			if(arr.length < 1) {
@@ -446,22 +477,22 @@ define(["app/app", 'jquery-summernote'], function(app) {
 			$scope.calculateAmount($scope.selectedStoreCarts);
 		}
 
-		$scope.deleteById = function(id){
-			var arr = [];
-			if(id != null){
-				arr.push(id);
-			}else {
-				angular.forEach($scope.carts, function(cart){
-					if(cart.isSelect){
-						arr.push(cart.id);
-					}
-				});
-			}
-			if(arr.length <= 0) {
+        $scope.deleteById = function(id){
+            var arr = [];
+            if(id != null){
+                arr.push(id);
+            }else {
+                angular.forEach($scope.carts, function(cart){
+                    if(cart.isSelect){
+                        arr.push(cart.id);
+                    }
+                });
+            }
+            if(arr.length <= 0) {
 				toaster.pop('warning', '提示', '请选择需要删除的商品');
 				return ;
 			}
-			var ids = angular.toJson(arr);
+            var ids = angular.toJson(arr);
 			$modal.open({
 				templateUrl : 'static/view/common/modal/delete_modal.html',
 				controller : 'cartDeleteCtrl',
@@ -470,9 +501,9 @@ define(["app/app", 'jquery-summernote'], function(app) {
 					description : function () {
 						return '是否删除此商品';
 					},
-					ids : function () {
-						return ids;
-					}
+                    ids : function () {
+                        return ids;
+                    }
 				}
 			}).result.then(function () {
 				afterDeleteRefreshInfo(arr);
@@ -499,8 +530,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
 				});
 				return !contain;
 			});
-		};
-		//判断是空对象
+        };
+        //判断是空对象
 		$scope.isNullObject = function(obj) {
 			var isObject = true;
 			for(var k in obj) {
@@ -538,8 +569,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
 					cart.contactSeller = false;
 				};
 			});
-		};
-		/**
+        };
+        /**
 		 * 监听点击的位置,隐藏相应的状态框
 		 * @param event
 		 */
@@ -576,8 +607,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
 					if(!isThisTag) {
 						$scope.carts[i].contactSeller = false;
 					}
-				}
-			});
+                }
+            });
 		};
 
 
@@ -599,23 +630,23 @@ define(["app/app", 'jquery-summernote'], function(app) {
 		$scope.setAllCartCheck = function(checked) {
 			$scope.selectedStoreCarts = [];
 			angular.forEach($scope.cartMap, function(store) {
-				if(store.arr && store.arr.length > 0) {
-					var storeChecked = false;
-					angular.forEach(store.arr, function (cart) {
-						if(cart.status != 1 && checked) {//购物车的信息是否有效【是否下架】
-							cart.isSelect = checked;
-							storeChecked = true;
-							$scope.selectedStoreCarts.push(cart);
+					if(store.arr && store.arr.length > 0) {
+						var storeChecked = false;
+						angular.forEach(store.arr, function (cart) {
+							if(cart.status != 1 && checked) {//购物车的信息是否有效【是否下架】
+								cart.isSelect = checked;
+								storeChecked = true;
+								$scope.selectedStoreCarts.push(cart);
+							}else {
+								cart.isSelect = false;
+							}
+						});
+						if(storeChecked) {
+							$scope.selectedStore[store.name] = checked;//店铺的复选框也需要同步
 						}else {
-							cart.isSelect = false;
+							$scope.selectedStore[store.name] = false;//如果没有执行过storeChecked = true,则该店铺代表所有的都没有勾选
 						}
-					});
-					if(storeChecked) {
-						$scope.selectedStore[store.name] = checked;//店铺的复选框也需要同步
-					}else {
-						$scope.selectedStore[store.name] = false;//如果没有执行过storeChecked = true,则该店铺代表所有的都没有勾选
 					}
-				}
 
 			});
 		};
@@ -634,8 +665,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
 				}
 			}
 			return !isAlldisabled&&isAllChecked;
-		};
-		/**
+        };
+        /**
 		 * 店铺选中状态信息
 		 */
 		$scope.selectedStore = {};
@@ -780,17 +811,17 @@ define(["app/app", 'jquery-summernote'], function(app) {
 			SessionService.set("buyNow",false);
 			var jsonOrderDetails = angular.toJson(result);
 			Order.saveByGroup({}, jsonOrderDetails, function(result){
-				if(result.code == 1) {
+                if(result.code == 1) {
 					if(result.message) {
 						toaster.pop('info', result.message);
 					}
-					$state.go('order_pay', {orderid :  enIdFilter(result.data.orderid)});
-				}else if(result.code == 7){
-					toaster.pop('info', '提示', "选中的购物车信息已经失效,将为您刷新界面之后重新操作");
+                    $state.go('order_pay', {orderid :  enIdFilter(result.data.orderid)});
+                }else if(result.code == 7){
+                    toaster.pop('info', '提示', "选中的购物车信息已经失效,将为您刷新界面之后重新操作");
 					$timeout(function () {
 						window.location.reload();
 					}, 1500);
-				}else {
+                }else {
 					toaster.pop('info', '提示', result.message);
 				}
 			}, function(res){
@@ -838,41 +869,41 @@ define(["app/app", 'jquery-summernote'], function(app) {
 			}
 
 		};
-		// 移入收藏后删除购物车操作
+        // 移入收藏后删除购物车操作
 		$scope.collectDelete = function(id){
-			var arr = [];
-			if(id != null){
-				arr.push(id);
-			}else {
-				angular.forEach($scope.carts, function(cart){
-					if(cart.isSelect){
-						arr.push(cart.id);
-					}
-				});
-			}
-			var ids = angular.toJson(arr);
-			Cart.deleteById({ids : ids}, function(data){
-				$rootScope.countCart = $rootScope.countCart - arr.length;
-
-				//更新选中的购物车信息
-				$scope.selectedStoreCarts = $scope.arrayFilterId($scope.selectedStoreCarts, arr);
-				//更新购物车信息
-				$scope.carts = $scope.arrayFilterId($scope.carts, arr);
-				//判断是否全部删除,如果全部删除,就将全选置为取消状态。
-				if($scope.carts.length == 0) {
-					$scope.isChooseAll = false;
+            var arr = [];
+            if(id != null){
+                arr.push(id);
+            }else {
+                angular.forEach($scope.carts, function(cart){
+                    if(cart.isSelect){
+                        arr.push(cart.id);
+                    }
+                });
+            }
+            var ids = angular.toJson(arr);
+            Cart.deleteById({ids : ids}, function(data){
+                $rootScope.countCart = $rootScope.countCart - arr.length;
+
+                //更新选中的购物车信息
+                $scope.selectedStoreCarts = $scope.arrayFilterId($scope.selectedStoreCarts, arr);
+                //更新购物车信息
+                $scope.carts = $scope.arrayFilterId($scope.carts, arr);
+                //判断是否全部删除,如果全部删除,就将全选置为取消状态。
+                if($scope.carts.length == 0) {
+                    $scope.isChooseAll = false;
 					$scope.cartIsEmpty = true;
-				}
+                }
 
-				//更新map中购物车信息
-				var deleteStoreName = [];
+                //更新map中购物车信息
+                var deleteStoreName = [];
 				angular.forEach($scope.cartMap, function(store) {
-					if(store.arr && store.arr.length > 0) {
-						store.arr = $scope.arrayFilterId(store.arr, arr)
-						if(!store.arr || !store.arr.length || store.arr.length == 0) {
-							deleteStoreName.push(store.name);
+						if(store.arr && store.arr.length > 0) {
+							store.arr = $scope.arrayFilterId(store.arr, arr)
+							if(!store.arr || !store.arr.length || store.arr.length == 0) {
+								deleteStoreName.push(store.name);
+							}
 						}
-					}
 				});
 				//删除$scope.cartMap多余的部分。
 				angular.forEach(deleteStoreName, function(storeName) {
@@ -881,27 +912,27 @@ define(["app/app", 'jquery-summernote'], function(app) {
 					});
 				});
 
-				//计算总金额
-				$scope.calculateAmount($scope.selectedStoreCarts);
+                //计算总金额
+                $scope.calculateAmount($scope.selectedStoreCarts);
 
-			}, function (res) {
-				toaster.pop('error', '系统错误', '购物车信息删除失败' + res.data);
-			});
+            }, function (res) {
+                toaster.pop('error', '系统错误', '购物车信息删除失败' + res.data);
+            });
 
 
 		};
-		// 移入收藏
-		$scope.collect = function(uuid, id) {
+        // 移入收藏
+        $scope.collect = function(uuid, id) {
 			if(uuid){
-				ComponentActive.getSimpleInfoByUuid({uuid: uuid}, { }, function(data){
-					var obj = {'componentid': data.id, 'kind': 2};
-					collectionService.saveEntity({ }, obj, function(data) {
-						$scope.collectDelete(id);
-						toaster.pop('success', '收藏成功');
-					}, function(response) {
-						toaster.pop('error', '收藏失败');
-					})
-				});
+                ComponentActive.getSimpleInfoByUuid({uuid: uuid}, { }, function(data){
+                    var obj = {'componentid': data.id, 'kind': 2};
+                    collectionService.saveEntity({ }, obj, function(data) {
+                        $scope.collectDelete(id);
+                        toaster.pop('success', '收藏成功');
+                    }, function(response) {
+                        toaster.pop('error', '收藏失败');
+                    })
+                });
 			}else{
 				var uuids = [];
 				angular.forEach($scope.cartMap, function(store){
@@ -915,14 +946,14 @@ define(["app/app", 'jquery-summernote'], function(app) {
 					toaster.pop('info', '你还未选择任何产品');
 					return;
 				}
-				collectionService.saveStores({ }, uuids, function(response){
+                collectionService.saveStores({ }, uuids, function(response){
 					if(response.data == "success"){
-						$scope.collectDelete();
-						toaster.pop('success', '收藏成功');
+                        $scope.collectDelete();
+                        toaster.pop('success', '收藏成功');
 					}
 				},function () {
-					toaster.pop('error', '收藏失败');
-				})
+                    toaster.pop('error', '收藏失败');
+                })
 			}
 		}
 
@@ -968,32 +999,32 @@ define(["app/app", 'jquery-summernote'], function(app) {
 		}
 	}]);
 
-	/**
-	 * 删除的逻辑
-	 */
+    /**
+     * 删除的逻辑
+     */
 	app.register.controller('cartDeleteCtrl', ['$scope', 'description', 'Cart', '$modalInstance', 'toaster', 'ids', function ($scope, description, Cart, $modalInstance, toaster,ids) {
 
-		$scope.confirmDelete = function () {
-			Cart.deleteById({ids : ids}, function(data){
-				toaster.pop('success', '成功删除');
-				$modalInstance.close()
-			}, function (res) {
-				toaster.pop('error', '系统错误', '购物车信息删除失败' + res.data);
-			});
-		};
-
-		$scope.confirmDeleteInvalid = function () {
-			Cart.deleteById({ids : ids}, function(data){
-				toaster.pop('success', '成功清除购物车内的无效产品');
-				$modalInstance.close()
-			}, function (res) {
-				toaster.pop('error', '系统错误', '购物车信息删除失败' + res.data);
-			});
-		};
-
-		$scope.cancleDelete = function () {
-			$modalInstance.dismiss();
-		}
+        $scope.confirmDelete = function () {
+            Cart.deleteById({ids : ids}, function(data){
+                toaster.pop('success', '成功删除');
+                $modalInstance.close()
+            }, function (res) {
+                toaster.pop('error', '系统错误', '购物车信息删除失败' + res.data);
+            });
+        };
+
+        $scope.confirmDeleteInvalid = function () {
+            Cart.deleteById({ids : ids}, function(data){
+                toaster.pop('success', '成功清除购物车内的无效产品');
+                $modalInstance.close()
+            }, function (res) {
+                toaster.pop('error', '系统错误', '购物车信息删除失败' + res.data);
+            });
+        };
+
+        $scope.cancleDelete = function () {
+            $modalInstance.dismiss();
+        }
 
 	}]);
 

+ 1 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_home_ctrl.js

@@ -6,6 +6,7 @@ define(['app/app', 'calendar'], function(app) {
     app.register.controller('homeCtrl', ['$scope', '$rootScope', 'Recommendation', 'ShippingAddress', 'Bill', '$q', 'toaster', '$modal', 'Goods', 'StoreInfo', function ($scope, $rootScope, Recommendation, ShippingAddress, Bill, $q, toaster, $modal, Goods, StoreInfo) {
         $rootScope.active = 'home';
         document.title='买家中心-优软商城';
+        $scope.userInfo = $rootScope.userInfo;
         var getRecommendComps = function (userUU, usedFor, pageable) {
             Recommendation.getRecommendComps({page: pageable.page, size: pageable.size}, function (data) {
                 $scope.recommendComps = data.content;

+ 230 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_transfer_ctrl.js

@@ -398,6 +398,25 @@ define([ 'app/app' ], function(app) {
 		// //开始时,就获取账户信息
 		// getBuyAccount();
 
+		//新增账户
+		$scope.editAccount = function() {
+			var modalInstance = $modal.open({
+				templateUrl : 'static/view/common/bankInfoModal.html',
+				controller : 'AccountCtrl',
+				resolve : {
+					account : function() {
+						return {};
+					}
+				}
+			});
+
+			modalInstance.result.then(function(account) {
+				$scope.buyAccount = account;
+			}, function() {
+
+			});
+		};
+
 		//获取管理平台账户信息
 		var getSellerAccount = function() {
 			// 平台账户
@@ -768,6 +787,217 @@ define([ 'app/app' ], function(app) {
 		};
 	}]);
 
+	app.register.controller('AccountCtrl', ['$scope', '$modalInstance', 'account', 'bankInfoService', 'toaster', function($scope, $modalInstance, account, bankInfoService, toaster){
+
+		/**
+		 * 目前只支持的银行
+		 * @type {string[]}
+		 */
+		$scope.bankList = [
+			'中国银行','中国建设银行','中国工商银行','中国农业银行','交通银行','招商银行','中国民生银行',
+			'兴业银行','中信银行','中国光大银行','广发银行','平安银行','中国邮政储蓄银行','华夏银行','浦发银行'
+		];
+
+		var initIndex = function () {
+			$scope.selectIndex = -1;
+			$scope.downIndex = 0;
+		};
+
+		$scope.getItemFocus = function() {
+			$scope.showBankFrame = true;
+			$scope.matchData = true;
+			$scope.resultList = $scope.bankList;
+			initIndex();
+		};
+
+		$scope.onItemBlur = function () {
+			if ($scope.time){
+				clearTimeout($scope.time);
+			}
+			$scope.time = setTimeout(function () {
+				$scope.$apply(function () {
+					$scope.showBankFrame = false;
+				});
+			}, 200);
+		};
+		$scope.onKeyUp = function () {
+			var dom = document.getElementById("ulContent");
+			console.log(event);
+			if ($scope.showBankFrame){
+				if(event.keyCode == 40) { //监听到按下键
+					$scope.selectIndex ++;
+					if ($scope.downIndex == 5){
+						dom.scrollTop += 44;
+					}
+					if ($scope.downIndex <= 4){
+						$scope.downIndex++;
+					}
+					if($scope.selectIndex >= $scope.resultList.length){
+						$scope.selectIndex = 0;
+						dom.scrollTop = 0;
+						$scope.downIndex = 1;
+					}
+					$scope.account.bankname = $scope.resultList[$scope.selectIndex];
+					// $scope.containsAttr($scope.logistics.companyName);
+				} else if(event.keyCode == 38) { //监听到按上键
+					$scope.selectIndex --;
+					if ($scope.downIndex == 1){
+						dom.scrollTop -= 44;
+					}
+					if ($scope.downIndex >= 2){
+						$scope.downIndex--;
+					}
+					if($scope.selectIndex < 0){
+						$scope.selectIndex = $scope.resultList.length - 1;
+						dom.scrollTop = 2400;
+						$scope.downIndex = 5;
+					}
+					$scope.account.bankname = $scope.resultList[$scope.selectIndex];
+					// $scope.containsAttr($scope.logistics.companyName);
+				} else if(event.keyCode == 13) { //确定键
+					$scope.showBankFrame = false;
+				}
+			}
+		};
+
+		$scope.showList = function () {
+			$scope.showBankFrame = !$scope.showBankFrame;
+			$scope.matchData = true;
+			$scope.resultList = $scope.bankList;
+		};
+
+		$scope.inputBankName = function () {
+			$scope.showBankFrame = true;
+		};
+
+		$scope.fitBankToAccount = function (item) {
+			$scope.account.bankname = item;
+			$scope.showBankFrame = false;
+		};
+
+		$scope.account = account;
+		if($scope.account) {
+			$scope.title = "修改账户";
+		}else {
+			$scope.title = "新增账户";
+			$scope.account = {};
+		}
+
+		var matchArray = function () {
+			$scope.account.bankname = $scope.account.bankname ? $scope.account.bankname : '';
+			$scope.resultList = $scope.bankList.filter(function (data) {
+				if (data.indexOf($scope.account.bankname) >= 0){
+					return data;
+				}
+			});
+			if ($scope.resultList.length > 0){
+				$scope.matchData = true;
+			}else{
+				$scope.matchData = false;
+			}
+		};
+
+		/**
+		 * 验证新增账户格式
+		 * @param num
+		 */
+		$scope.checkAccount = function (num) {
+			var size;
+			if (num == 1){
+				//验证开户银行名称
+				$scope.showBankFrame = true;
+				matchArray();
+			}else if(num == 2){
+				//验证开户支行名称
+				if($scope.account.branchname){
+					size = $scope.account.branchname.replace(/[^\x00-\xff]/g,'**').length;
+					if (size > 40){
+						$scope.branchError = true;
+					}else {
+						$scope.branchError = false;
+					}
+					var telPatt = new RegExp("^[\u2E80-\u9FFF]+$");
+					if (telPatt.test($scope.account.branchname)){
+						$scope.branchPattError = false;
+					}else {
+						$scope.branchPattError = true;
+					}
+				}
+			}else if(num == 3){
+				//验证银行账号
+				if ($scope.account.number){
+					size = $scope.account.number.replace(/[^\x00-\xff]/g,'**').length;
+					if (size > 30){
+						$scope.numberError = true;
+					}else {
+						$scope.numberError = false;
+					}
+					var numPatt = new RegExp("^[0-9]+$");
+					if (numPatt.test($scope.account.number)){
+						$scope.numberPattError = false;
+					}else {
+						$scope.numberPattError = true;
+					}
+					validateRepeat($scope.account.number);
+				}
+			}else if(num == 4){
+				//验证开户名称
+				if ($scope.account.accountname){
+					size = $scope.account.accountname.replace(/[^\x00-\xff]/g,'**').length;
+					if (size > 100){
+						$scope.nameError = true;
+					}else {
+						$scope.nameError = false;
+					}
+				}
+			}
+		};
+
+		var validateRepeat = function (number) {
+			bankInfoService.getCountByNumber({type:1061, number:number}, {}, function (data) {
+				if (data.success){
+					if (data.data != 0){
+						$scope.repeatError = true;
+					}else {
+						$scope.repeatError = false;
+					}
+				}else {
+					toaster.pop("info", data.message);
+				}
+			});
+		};
+
+		$scope.confirm = function() {
+			var account = $scope.account;
+
+			if (!account){
+				toaster.pop('error', '请按要求填写正确的信息');
+				return ;
+			}
+			if (!account.bankname || !account.branchname || !account.number || !account.accountname){
+				toaster.pop('error', '请按要求填写正确的信息');
+				return ;
+			}
+			if (!$scope.matchData || $scope.branchError || $scope.branchPattError || $scope.numberError || $scope.numberPattError ||
+				$scope.nameError || $scope.repeatError){
+				toaster.pop('error', '请按要求填写正确的信息');
+				return ;
+			}
+
+			var method = 'saveBuyPersonalBank'; //不区分个人和企业账户
+			bankInfoService[method].call(null, null, $scope.account, function(data) {
+				toaster.pop('success', '保存成功');
+				$modalInstance.close(data)
+			},function (response) {
+				toaster.pop('warning', '保存信息失败');
+			});
+		};
+
+		$scope.cancel = function() {
+			$modalInstance.dismiss();
+		}
+
+	}]);
 
 	app.register.controller('BankInfoCtrl', ['$scope', '$modalInstance', 'account', 'kind', function($scope, $modalInstance, account, kind){
 		$scope.account = account;

+ 35 - 4
src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js

@@ -416,25 +416,56 @@ define(['app/app'], function(app) {
 
 		// 输入购买量限制
 		$scope.blurNum = function (detail) {
+			// detail.inputError = 0;
+			// detail.noInputError = 0;
 			detail.number = Number(detail.number);
 			if (detail.number < detail.goodsHistory.minBuyQty || !detail.number) {
-				toaster.pop("info", "提示", "该商品最少购买" + detail.goodsHistory.minBuyQty + "件");
-				detail.number = detail.goodsHistory.minBuyQty;
+				// toaster.pop("info", "提示", "该商品最少购买" + detail.goodsHistory.minBuyQty + "件");
+				if(detail.goodsHistory.breakUp) {
+					// detail.noInputError = 1;
+					toaster.pop('info','提示','最小起订量为' + detail.goodsHistory.minBuyQty);
+					detail.number = detail.goodsHistory.minBuyQty;
+					// $timeout(function () {
+					// 	c.noInputError = 0;
+					// }, 3000);
+				}else{
+					// detail.inputError = 1;
+					toaster.pop('info','提示','最小起订量为' + detail.goodsHistory.minBuyQty);
+					detail.number = detail.goodsHistory.minBuyQty;
+					// $timeout(function () {
+					// 	detail.inputError = 0;
+					// },3000);
+				}
 			}else if(detail.number > detail.goodsHistory.reserve){
 				if(detail.goodsHistory.breakUp) {
+					// detail.noInputError = 2;
+					toaster.pop('info','提示','库存不足');
 					detail.number = detail.goodsHistory.reserve;
+					// $timeout(function () {
+					// 	c.noInputError = 0;
+					// }, 3000);
 				}else{
-					detail.number = Number(NumberService.sub(detail.goodsHistory.reserve, detail.goodsHistory.reserve %detail.goodsHistory.minPackQty));
+					// detail.inputError = 2;
+					toaster.pop('info','提示','库存不足');
+					detail.number = Number(NumberService.sub(detail.goodsHistory.reserve, detail.goodsHistory.reserve % detail.goodsHistory.minPackQty));
+					// $timeout(function () {
+					// 	detail.inputError = 0;
+					// },3000);
 				}
-				toaster.pop('info', '提示','库存不足');
+				// toaster.pop('info', '提示','库存不足');
 			}else {
 				if(!detail.goodsHistory.breakUp) {
 					var remandar = detail.number % detail.goodsHistory.minPackQty;
 					if(remandar != 0) {
+						// detail.inputError = 3;
+						toaster.pop("info", "提示", "不支持拆包且包装量为" + detail.goodsHistory.minPackQty);
 						detail.number = Number(NumberService.add(NumberService.sub(detail.number, detail.number % detail.goodsHistory.minPackQty), detail.goodsHistory.minPackQty));
 						if(detail.number > detail.goodsHistory.reserve) {
 							detail.number = NumberService.sub(detail.goodsHistory.reserve, detail.goodsHistory.reserve % detail.goodsHistory.minPackQty);
 						}
+						// $timeout(function () {
+						// 	detail.inputError = 0;
+						// },3000);
 					}
 				}
 			}

+ 4 - 4
src/main/webapp/resources/js/vendor/app.js

@@ -541,7 +541,7 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
             controllerUrl : "app/controllers/forstore/vendor_undercarriageCtrl",
             controller : 'vendor_undercarriageCtrl'
         })).state('pay_center', angularAMD.route({
-			url: '/payCenter',
+			url: '/payCenter?tab',
 			templateUrl: 'static/view/vendor/forstore/pay_center.html',
 			controller: 'payCenterCtrl',
 			controllerUrl: 'app/controllers/forstore/pay_center_ctrl'
@@ -910,8 +910,8 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 	/**
 	 * 卖家中心菜单控制器
 	 */
-	app.controller('VendorMenuCtrl', ['$scope', 'StoreInfo','$rootScope', function ($scope, StoreInfo,$rootScope) {
-        //是寄售店铺
+	app.controller('VendorMenuCtrl', ['$scope', 'StoreInfo','$rootScope', function ($scope, StoreInfo, $rootScope) {
+       /* //是寄售店铺
         $scope.isCONSIGNMENT = false;
 
         StoreInfo.findShopOwnerApplyByNormalStatus({}, {}, function (result) {
@@ -921,7 +921,7 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
             $scope.isCONSIGNMENT = true;
        		 }}, function (error) {
 
-        });
+        });*/
 	}]);
 
 

+ 2 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/pay_center_ctrl.js

@@ -3,7 +3,7 @@
  */
 define(['app/app'], function(app) {
     'use strict';
-    app.register.controller('payCenterCtrl', ['$scope', '$rootScope', 'bankInfoService', 'Loading', 'toaster', '$upload', 'ngTableParams', 'BaseService', 'SessionService', 'bankTransferService', 'Purchase', '$filter', function($scope, $rootScope, bankInfoService, Loading, toaster, $upload, ngTableParams, BaseService, SessionService, bankTransferService, Purchase, $filter) {
+    app.register.controller('payCenterCtrl', ['$scope', '$rootScope', 'bankInfoService', 'Loading', 'toaster', '$upload', 'ngTableParams', 'BaseService', 'SessionService', 'bankTransferService', 'Purchase', '$filter', '$stateParams', function($scope, $rootScope, bankInfoService, Loading, toaster, $upload, ngTableParams, BaseService, SessionService, bankTransferService, Purchase, $filter, $stateParams) {
         $rootScope.active = 'pay_center';
 
         document.title = '结算中心-优软商城';
@@ -16,7 +16,7 @@ define(['app/app'], function(app) {
         $scope.$payCenter = {};
         $scope.param = {};
 
-        $scope.tab = hiStatus == null ? 'paymentRecord' : hiStatus;
+        $scope.tab = $stateParams.tab == 'accountTab' ? $stateParams.tab : hiStatus == null ? 'paymentRecord' : hiStatus;
         $scope.$$bankInfo = {};
 
         $scope.paytype = 'ALL';

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

@@ -62,11 +62,19 @@ define(['app/app'], function(app) {
 			} else {
 				if (!$scope.isShow) {
 					Installment.validationCount({purchaseId : $scope.purchase.id}, null, function (data) {
-						$scope.isShow = true;
+						if (!data.success) {
+							// code==3,表示未设置账户
+							if (data.code == 3) {
+								$scope.setShowNoAccountBox(true);
+							} else {
+								toaster.pop('error', data.message);
+							}
+							$scope.isShow = false;
+						} else {
+							$scope.isShow = true;
+						}
 					}, function (error) {
-						// toaster.pop('error', error.data);
-						$scope.setShowNoAccountBox(true);
-						$scope.isShow = false;
+						toaster.pop('error', '系统错误');
 					});
 				} else {
 					$scope.isShow = false;

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

@@ -592,12 +592,12 @@ define(['app/app'], function(app) {
             });
           };
 
-          //对新密码进行校验
+          // 对新密码进行校验
           $scope.checkSuccess1 = false;
           $scope.checkFailed1 = false;
           $scope.checkNewPassword = function (newPassword) {
-            var reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$/;
-            if (newPassword == null || !reg.test(newPassword)) {
+            var middlLevelReg = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/;
+            if (newPassword == null || !middlLevelReg.test(newPassword)) {
               //toaster.pop('error', '错误', '密码为8-20字符的英文、数字混合');
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
@@ -612,7 +612,7 @@ define(['app/app'], function(app) {
             $scope.checkPasswordLevel(newValue);
           });
 
-          //密码强度校验
+          // 密码强度校验
           $scope.secLevel = 0;
           $scope.checkPasswordLevel = function (newPassword) {
             $scope.checkFailed1 = false;
@@ -620,20 +620,18 @@ define(['app/app'], function(app) {
               $scope.secLevel = 0;
               return false;
             }
-            //不足8位,或仅有数字,或仅有英文
-            if (newPassword.length < 8 || /^[0-9]*$/.test(newPassword)
-                || /^[A-Za-z]*$/.test(newPassword)) {
-              $scope.secLevel = 1;
-              return false;
-            }
-            if (/^[A-Z0-9]{8,20}$/.test(newPassword) || /^[a-z0-9]{8,20}$/.test(
-                    newPassword)) {//达到8位,且 仅有数字+英文小写 或 仅有数字+英文大写
-              $scope.secLevel = 2;
-              return false;
-            }
-            if (/^(?=.*[0-9].*)(?=.*[A-Z].*)(?=.*[a-z].*).{8,20}$/.test(
-                    newPassword)) {
+            // 密码强度中的正则
+            var middlLevelReg = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/;
+            // 密码强度高的正则
+            var heightLevelReg = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/;
+            if(heightLevelReg.test(newPassword)){
               $scope.secLevel = 3;
+              return true;
+            }else if(middlLevelReg.test(newPassword)){
+              $scope.secLevel = 2;
+              return true;
+            }else{
+              $scope.secLevel = 1;
               return false;
             }
           }
@@ -652,25 +650,26 @@ define(['app/app'], function(app) {
             $scope.checkFailed2 = true;
           }
 
-          //修改密码
+          // 修改密码
           $scope.ok = function () {
-            //原密码校验
+            // 原密码校验
             if(!$scope.checkSuccess){
               $scope.checkPassword($scope.user.password);
             }
-            //新密码校验
+            // 新密码校验
             $scope.checkNewPassword($scope.user.newPassword);
-            //再次输入密码校验
+            // 再次输入密码校验
             $scope.checkNewPassword1();
             if(!$scope.checkSuccess || !$scope.checkSuccess1 || !$scope.checkSuccess2){
               return;
             }
-            if ($scope.user.newPassword == $scope.user.password) {
-              toaster.pop('error', '错误', '新密码与原密码相同');
+            // 密码强度校验
+            if(!$scope.checkPasswordLevel($scope.user.newPassword)){
+              toaster.pop('error', '错误', '密码强度不够,请重新输入');
               return;
             }
-            if ($scope.secLevel <= 1) {
-              toaster.pop('error', '错误', '密码强度不够,请重新输入');
+            if ($scope.user.newPassword == $scope.user.password) {
+              toaster.pop('error', '错误', '新密码与原密码相同');
               return;
             }
             if ($scope.user.newPassword == $scope.user.newPassword1) {//验证重复密码相等
@@ -715,6 +714,7 @@ define(['app/app'], function(app) {
   app.register.controller('UserEmailCtrl',
       ['$scope', '$modalInstance', 'user', 'User', 'toaster', '$interval',
         function ($scope, $modalInstance, user, User, toaster, $interval) {
+          User.getPageToken();
           $scope.user = user;
           $scope.user.userEmail = null;
           $scope.user.newUserEmail = null;
@@ -796,8 +796,8 @@ define(['app/app'], function(app) {
                       }
                     }
                   }, 1000, 60);
-            }, function () {
-              $scope.codeSuccess = false;
+            }, function (response) {
+              toaster.pop('error', '错误', response.data);
             });
           };
 
@@ -962,8 +962,8 @@ define(['app/app'], function(app) {
                       }
                     }
                   }, 1000, 60);
-            }, function () {
-              $scope.codeSuccess = false;
+            }, function (response) {
+              toaster.pop('error', '错误', response.data);
             });
           };
 
@@ -1281,7 +1281,7 @@ define(['app/app'], function(app) {
           $scope.checkSuccess2 = false;
           $scope.checkFailed2 = false;
           $scope.choose = function () {
-            if ($scope.uq[0].question != "") {
+            if ($scope.uq[0]!=undefined && $scope.uq[0].question != undefined && $scope.uq[0].question!="") {
               $scope.checkSuccess = true;
               $scope.checkFailed = false;
             } else {
@@ -1291,7 +1291,7 @@ define(['app/app'], function(app) {
           }
 
           $scope.choose1 = function () {
-            if ($scope.uq[1].question != "") {
+            if ($scope.uq[1]!=undefined && $scope.uq[1].question != undefined && $scope.uq[1].question!="") {
               $scope.checkSuccess2 = true;
               $scope.checkFailed2 = false;
             } else {
@@ -1308,17 +1308,17 @@ define(['app/app'], function(app) {
           $scope.checkFailed3 = false;
           $scope.checkFailed3_1 = false;
           $scope.inputAnswer = function () {
-            if ($scope.uq[0].answer == null) {
+            if ($scope.uq[0]==undefined || $scope.uq[0].answer == undefined || $scope.uq[0].answer=="") {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = true;
               $scope.checkFailed1_1 = false;
-              return;
+              return false;
             }
             if ($scope.uq[0].answer.length > 30) {
               $scope.checkSuccess1 = false;
               $scope.checkFailed1 = false;
               $scope.checkFailed1_1 = true;
-              return;
+              return false;
             }
             $scope.checkSuccess1 = true;
             $scope.checkFailed1 = false;
@@ -1326,17 +1326,17 @@ define(['app/app'], function(app) {
           }
 
           $scope.inputAnswer1 = function () {
-            if ($scope.uq[1].answer == null) {
+            if ($scope.uq[1]==undefined || $scope.uq[1].answer == undefined || $scope.uq[1].answer=="") {
               $scope.checkSuccess3 = false;
               $scope.checkFailed3 = true;
               $scope.checkFailed3_1 = false;
-              return;
+              return false;
             }
             if ($scope.uq[1].answer.length > 30) {
               $scope.checkSuccess3 = false;
               $scope.checkFailed3 = false;
               $scope.checkFailed3_1 = true;
-              return;
+              return false;
             }
             $scope.checkSuccess3 = true;
             $scope.checkFailed3 = false;
@@ -1345,35 +1345,19 @@ define(['app/app'], function(app) {
 
           //保存密保
           $scope.ok = function () {
+            //问题1校验
+            $scope.choose();
+            $scope.inputAnswer();
+            $scope.choose1();
+            $scope.inputAnswer1();
+            if(!$scope.checkSuccess || !$scope.checkSuccess1 || !$scope.checkSuccess2 || !$scope.checkSuccess3){
+              return;
+            }
             var arr = [];
             for (var key in $scope.uq) {
               $scope.uq[key].sort = Number(key) + 1;
               arr[key] = $scope.uq[key];
             }
-            if(!arr[0].question){
-              $scope.checkFailed = true;
-              return;
-            }
-            if(!arr[0].answer){
-              $scope.checkFailed1 = true;
-              return;
-            }
-            if((arr[0].answer).length>30){
-              $scope.checkFailed1_1 = true;
-              return;
-            }
-            if(!arr[1].question){
-              $scope.checkFailed2 = true;
-              return;
-            }
-            if(!arr[1].answer){
-              $scope.checkFailed3 = true;
-              return;
-            }
-            if((arr[1].answer).length>30){
-              $scope.checkFailed3_1 = true;
-              return;
-            }
             User.updateUserQuestion({}, arr, function () {
               toaster.pop('success', '成功', '密保问题设置成功。');
               $modalInstance.close();

+ 8 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_deliveryRule_ctrl.js

@@ -424,6 +424,7 @@ define([ 'app/app' ], function(app) {
                         DistributionRule.saveRule({isAdd:isAdd, isActive:$scope.isActive}, $scope.modifyRule , function (data) {
                             if (data.success){
                                 $scope.editFrame = false;
+                                $scope.chooseBox = false;
                                 $scope.tab = 'deliverRule';
                                 if (isAdd){
                                     toaster.pop('info', "保存成功");
@@ -489,6 +490,7 @@ define([ 'app/app' ], function(app) {
 
         $scope.cancelEdit = function () {
             $scope.editFrame = false;
+            $scope.chooseBox = false;
             $scope.tab = 'deliverRule';
         };
 
@@ -584,7 +586,7 @@ define([ 'app/app' ], function(app) {
                                 items: null,
                                 selectedNum : 0,
                                 folded: true
-                            }
+                            };
                             $scope.hmtChild.items = convert(v, $scope.hmtChild);
                             var hmtArr = [];
                             hmtArr.push($scope.hmtChild);
@@ -601,7 +603,7 @@ define([ 'app/app' ], function(app) {
             $scope.chooseBox = true;
             $scope.tree = $scope.tree ? $scope.tree : new TreeData($scope.cityData);
             $scope.tree.newInitData($scope.mapArray);
-        }
+        };
 
         /**
          * 切换生效状态
@@ -649,6 +651,10 @@ define([ 'app/app' ], function(app) {
             $scope.deleteFrame = false;
         };
 
+        // document.addEventListener('click', this.checkShowFilter){
+        //
+        // }
+
     }]);
 
     // 地区选择

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

@@ -6,6 +6,7 @@ define(['app/app', 'calendar'], function(app) {
     'use strict';
     app.register.controller('vendorIndexCtrl', ['$scope', 'toaster', 'VendorService', '$rootScope', 'News', '$filter','$modal', function($scope, toaster, VendorService, $rootScope, News, $filter,$modal) {
         $rootScope.active = 'index';
+        $scope.userInfo = $rootScope.userInfo;
         //个人账户
         if (!$rootScope.userInfo.enterprise){
             window.location.href = './register-saler';

+ 7 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_logistics_ctrl.js

@@ -11,7 +11,12 @@ define(['app/app', 'calendar'], function (app) {
 		$scope.tab = 'logistic';
 		$scope.canAddTotal = 20;
         //是寄售店铺
-        $scope.isCONSIGNMENT = false;
+		if ($rootScope.store && (!$rootScope.store.status || $rootScope.store.status === 'OPENED')){
+            $scope.isCONSIGNMENT = false;
+		}else {
+            $scope.isCONSIGNMENT = true;
+		}
+       /* $scope.isCONSIGNMENT = false;
         StoreInfo.findShopOwnerApplyByNormalStatus({}, {}, function (result) {
             if (!result.data) {
                 $scope.isCONSIGNMENT = true;
@@ -20,7 +25,7 @@ define(['app/app', 'calendar'], function (app) {
                 $scope.isCONSIGNMENT = true;
             }}, function (error) {
 
-        });
+        });*/
 		$scope.addressEx = {};
 
 		//地址的条数是否超过5条

+ 27 - 0
src/main/webapp/resources/view/admin/ads/ads_brand.html

@@ -0,0 +1,27 @@
+<div class="row-fluid sortable">
+    <div class="box span12">
+        <div class="box-header well" data-original-title>
+            <h2><i class="icon-user"></i> <a ng-click="load('weight')">已推广品牌 </a> / <a ng-click="load('disweight')">所有品牌</a></h2>
+        </div>
+        <div class="box-content">
+            <!-- ng-tableStart -->
+            <div class="fullscreen" style="padding: 10px;overflow-y:auto;">
+                <table ng-table="brandsTableParams" class="table table-condensed table-bordered table-striped">
+                    <tr ng-repeat="brand in $data">
+                        <td data-title="'品牌名'" filter="{nameCn: 'text'}">{{brand.nameCn}}</td>
+                        <td data-title="'厂商'" filter="{nameCn: 'text'}">{{brand.nameCn}}</td>
+                        <td data-title="'权重'" >{{brand.weight}}</td>
+                        <td data-title="'操作'">
+                            <button ng-click="updateweight(brand)" class="btn btn-danger btn-sm" ng-if="!brand.weight"><i class="fa fa-check"></i> 推广</button>
+                            <button ng-click="disweight(brand)" class="btn btn-danger btn-sm" ng-if="brand.weight"><i class="fa fa-check"></i> 解除推广</button>
+                            <button ng-click="updateweight(brand)" class="btn btn-danger btn-sm" ng-if="brand.weight"><i class="fa fa-check"></i> 修改推广</button>
+                            <input type="number" style="height: 30px"  ng-model="brand.inputWeight"/>
+                        </td>
+                    </tr>
+                </table>
+            </div>
+            <!-- ng-tableEnd -->
+        </div>
+    </div><!--/span-->
+
+</div><!--/row-->

+ 70 - 0
src/main/webapp/resources/view/admin/search/search_See.html

@@ -0,0 +1,70 @@
+<style>
+    .row {
+        margin-bottom: 10px;
+    }
+</style>
+<div>
+    <div class="box-header well">
+        搜索预览
+    </div>
+    <div  class="box-content">
+        <div class="row">
+            <div class="col-xs-1">
+                <p style="margin-top: 8px; font-weight: bold;">
+                    共<span class="totalNum">{{result.total}}</span>条
+                </p>
+                <p style="margin-top: 8px; font-weight: bold;">
+                    共耗时<span class="totalNum">{{result.time}}</span>ms  ,kind共耗时 {{kindtime}} ms
+                </p>
+            </div>
+            <div class="col-xs-offset-4 col-xs-7">
+                <div class="input-group">
+                    <input type="search" style="width:80%;" class="form-control" ng-model="keyword" ng-change="onChange()" ng-search="search()" ng-focus="onFocus()" ng-blur="onBlur()" ng-keyup="onKeyup()"placeholder="型号/类目/品牌">
+                    <span class="input-group-btn">
+					<button ng-click="search()" class="btn btn-primary" type="button">搜索</button>
+				</span>
+                </div>
+                <ul class="association" ng-show="associate || associateEnter"  ng-class="{'none': !associate || !associateEnter}" ng-mouseenter="onAssociateEnter()" ng-mouseleave="onAssociateLeave()">
+                    <li ng-repeat="as in associates" ng-bind="as" ng-class="{'active': $index==selectIndex}"
+                        ng-click="onAssociateClick(as)"></li>
+                </ul>
+            </div>
+        </div>
+        <!--
+            <div class="row">
+                <div class="col-xs-offset-9 col-xs-4">
+                    <a class="btn btn-primary" ng-click="addKeyWord()"><i class="fa fa-plus"></i>添加关键词</a>
+                    <a class="btn btn-primary" ng-click="addKeyWords()"><i class="fa fa-plus"></i>批量添加关键词</a>
+                </div>
+            </div>
+            -->
+        <p ng-model="test"></p>
+        <table ng-table="logUsageTableParams"
+               class="table table-bordered table-striped table-hover" style="word-break:break-all; word-wrap:break-all;">
+            <thead>
+            <tr class="tr-default">
+                <th width="10%;" class="text-center">用户UU号</th>
+                <th width="7%;" class="text-center">用户名</th>
+                <th width="10%" class="text-center">标题</th>
+                <th width="30%" class="text-center">具体操作信息</th>
+                <th width="8%%" class="text-center">时间</th>
+                <th width="10%" class="text-center">ip</th>
+                <th width="10%" class="text-center">手机号</th>
+                <th width="15%" class="text-center">邮箱</th>
+            </tr>
+            </thead>
+            <tbody ng-repeat="logUsage in $data">
+            <tr class="text-center">
+                <td><span ng-bind="logUsage.userUU"></span></td>
+                <td><span ng-bind="logUsage.user.userName"></span></td>
+                <td><span ng-bind="logUsage.title"></span></td>
+                <td><span ng-bind="logUsage.message+logUsage.detail"></span></td>
+                <td><span ng-bind="logUsage.time | date:'yyyy-MM-dd HH:mm:ss'"></span></td>
+                <td><span ng-bind="logUsage.ip"></span></td>
+                <td><span ng-bind="logUsage.user.userTel"></span></td>
+                <td><span ng-bind="logUsage.user.userEmail"></span></td>
+            </tr>
+            </tbody>
+        </table>
+    </div>
+</div>

+ 17 - 5
src/main/webapp/resources/view/common/sidebar.html

@@ -335,6 +335,16 @@
         position: relative;
         z-index: 10;
     }
+	#sidebar .remind-point {
+		width: 8px;
+		height: 8px;
+		display: block;
+		border-radius: 100%;
+		background: red;
+		position: relative;
+		top: -31px;
+		right: -27px;
+	}
 </style>
 <div id="sidebar">
 	<ul class="sidebar-content">
@@ -365,14 +375,16 @@
 			</div>
 		</li>
 		<!-- TODO huxz IM暂时不放出 -->
-		<!--<li ng-controller="WebChatCtrl">
-			<a href="javascript:void(0)" ng-click="goWebChat()" style="width: 36px; height: 38px; line-height: 30px;"><i class="fa" ng-class="{ 'fa-comments': countData > 0, 'fa-comments-o': countData <= 0 }" aria-hidden="true" style="font-size: 18px;color: #FFFFFF;"></i>&lt;!&ndash;<img src="static/img/icon/talk.png"/>&ndash;&gt;</a>
+		<li ng-controller="WebChatCtrl">
+			<a href="javascript:void(0)" ng-click="goWebChat()" style="width: 36px; height: 38px; line-height: 30px;"><i class="fa fa-comments-o" aria-hidden="true" style="font-size: 18px;color: #FFFFFF;"></i><!--ng-class="{ 'fa-comments': countData > 0, 'fa-comments-o': countData <= 0 }"-->
+				<i class="remind-point" ng-if="countData > 0"></i><!--<img src="static/img/icon/talk.png"/>-->
+			</a>
 			<div class="massage sidebar-menu" style="width: 100px;" title="优软客服">优软互联<em><span ng-if="userInfo">(<span ng-bind="countData || 0 | number"></span>)</span></em></div>
-		</li>-->
-		<!--<li ng-controller="ScrollToTopCtrl">
+		</li>
+		<li ng-controller="ScrollToTopCtrl">
 			<a href="javascript:void(0)" ng-click="scrollToTop()"><img src="static/img/icon/top.png"/></a>
 			<div class="sidebar-menu" style="width: 100px">返回顶部</div>
-		</li>-->
+		</li>
 	</ul>
 </div>
 <div id="sidebar" style="height: 76px;bottom: 10px;top: inherit;">

+ 56 - 26
src/main/webapp/resources/view/usercenter/forstore/buyer_cart.html

@@ -323,6 +323,7 @@
 		width: 70px;
 		height: 29px;
 		line-height: 29px;
+		border: 1px solid #ccc;
 	}
 	.shopCar .btn-wrap .number{
 		width: 124px;
@@ -498,6 +499,30 @@
 	.sure_oder select:disabled.select:hover{
 		cursor: not-allowed;
 	}
+	/*添加是否可拆买、库存不足等提示*/
+	/*.shopCar .oder_list dl .line02 em.tip{*/
+		/*display: inline-block;*/
+		/*margin-top: 6px;*/
+		/*width: 165px;*/
+		/*text-align: left;*/
+		/*font-size: 12px;*/
+		/*font-weight: normal ;*/
+		/*line-height: 18px;*/
+		/*color: #e64040;*/
+	/*}*/
+	/*.shopCar .oder_list dl .line02 em.tip i{*/
+		/*font-size: 12px;*/
+		/*font-style: normal ;*/
+		/*color: #e64040;*/
+	/*}*/
+	/*.shopCar .oder_list dl .line02 em.tips{*/
+		/*width: 124px;*/
+		/*text-align: center;*/
+	/*}*/
+	/*.shopCar .oder_list dl .line02 em.tip1{*/
+		/*width: 200px;*/
+		/*margin-left: -10px;*/
+	/*}*/
 	.com-del-box {
 		top: 101%!important ;
 		left: 24%!important ;
@@ -521,11 +546,11 @@
 		</div>
 		<div class="oder_list" style="margin-top: 0; background: #f5f5f5;">
 			<!--<div class="page">-->
-			<!--<ul>-->
-			<!--<li><a ng-click="jumpToPage(pageInfo.page - 1)">上一页</a> </li>-->
-			<!--<li>第<input ng-model="toPage" ng-search="jumpToPage(toPage)">页</li>-->
-			<!--<li><a ng-click="jumpToPage(pageInfo.page + 1)">下一页</a> </li>-->
-			<!--</ul>-->
+				<!--<ul>-->
+					<!--<li><a ng-click="jumpToPage(pageInfo.page - 1)">上一页</a> </li>-->
+					<!--<li>第<input ng-model="toPage" ng-search="jumpToPage(toPage)">页</li>-->
+					<!--<li><a ng-click="jumpToPage(pageInfo.page + 1)">下一页</a> </li>-->
+				<!--</ul>-->
 			<!--</div>-->
 			<!--购物车清单-->
 			<dl style="display: inline-block;" when-scrolled="scrollLoadData()">
@@ -558,8 +583,8 @@
 							</a>
 						</span>
 						<span style="width: 22%; text-align: left; position: relative;"><img src="static/img/common/songguo.png">
-							<!--<a name="{{store.arr[0].id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(store.arr[0].sellPhone, store.arr[0].enuu, chat.UserType.STORE)">联系卖家</a>-->
-							<a name="{{store.arr[0].id}}" href="javascript:void(0)" class="contact_btn" ng-click="showContact(store.arr[0])">联系卖家</a>
+							<a name="{{store.arr[0].id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(store.arr[0].sellPhone, store.arr[0].storeEnterprise.enUU, chat.UserType.STORE)">联系卖家</a>
+							<!--<a name="{{store.arr[0].id}}" href="javascript:void(0)" class="contact_btn" ng-click="showContact(store.arr[0])">联系卖家</a>-->
 							<div name="{{store.arr[0].id}}" class="buyer-contact" ng-if="store.arr[0].contactSeller">
 									 <div class="contact-title">
 										 <a ng-click="store.arr[0].contactSeller = false"><i class="fa fa-close fa-lg" aria-hidden="true"></i></a>
@@ -616,10 +641,15 @@
 								<div class="btn-wrap">
 									<span class="number">
 										<a class="reduce" ng-disabled="cart.minusDisabled || cart.status == 1" ng-click="reduce(cart)">-</a>
-										<input type="text" ng-disabled="cart.status == 1" ng-model="cart.number" ng-blur="blurNum(cart)">
+										<input type="text" ng-disabled="cart.status == 1" ng-model="cart.number"  ng-blur="blurNum(cart)">
 										<a class="add" ng-disabled="cart.addDisabled || cart.status == 1" ng-click="add(cart)">+</a>
 									</span>
 									<i ng-if="cart.status == 2" style="color: #f00; margin-left: 32px;">库存紧张</i>
+									<!--<em class="tip tip1" ng-if="!cart.goods.breakUp && cart.inputError == 3">不支持拆包且包装数量为<i ng-bind="cart.minPackQty"></i></em>-->
+									<!--<em class="tip tips" ng-if="cart.goods.breakUp && cart.noInputError == 2">库存不足</em>-->
+									<!--<em class="tip tips" ng-if="!cart.goods.breakUp && cart.inputError == 2">库存不足</em>-->
+									<!--<em class="tip tips" ng-if="cart.goods.breakUp  && cart.noInputError == 1">最小起订量为<i ng-bind="cart.goods.minBuyQty"></i></em>-->
+									<!--<em class="tip tips" ng-if="!cart.goods.breakUp && cart.inputError == 1">最小起订量为<i ng-bind="cart.goods.minBuyQty"></i></em>-->
 								</div>
 							</span>
 							<span class="wd02" style="position: relative">
@@ -695,13 +725,14 @@
 						</dd>
 					</div>
 				</div>
-				<div class="no-store" ng-if="cartIsEmpty">
-					<img src="static/img/all/empty-cart.png">
-					<p>
-						您的购物车空空如也,请先挑选您想要购买的产品吧!
-						<br>
-						<a href="/">马上去逛一逛</a>
-					</p>
+				<div class="text-center row"ng-if="cartIsEmpty">
+					<div class="col-xs-offset-3 col-xs-2">
+						<img src="static/img/all/empty-cart.png">
+					</div>
+					<div class="col-xs-5">
+						<p class="grey f16">您的购物车空空如也,请先挑选您想要购买的产品吧!</p>
+						<a href=".">马上去逛一逛</a>&nbsp;<i class="fa fa-arrow-right"></i>
+					</div>
 				</div>
 				<p class="height16" ng-if="!cartIsEmpty">&nbsp</p>
 				<dd class="all_price fixed-bottom" ng-if="!cartIsEmpty && countByPage > 4">
@@ -757,7 +788,6 @@
 		</ul>
 	</div>-->
 </div>
-
 <style>
 	.no-store{
 		height: 255px;
@@ -783,14 +813,14 @@
 	}
 </style>
 <script>
-	$(function(){
-		$(window).bind("scroll",function() {
-			// 判断窗口的滚动条是否接近页面底部,这里的20可以自定义
-			if ($(document).scrollTop() + $(window).height() > $(document).height() - 330) {
-				$('.shopCar .oder_list dl .all_price.fixed-bottom').slideUp()
-			}else {
-				$('.shopCar .oder_list dl .all_price.fixed-bottom').slideDown()
-			}
-		})
-	})
+    $(function(){
+        $(window).bind("scroll",function() {
+            // 判断窗口的滚动条是否接近页面底部,这里的20可以自定义
+            if ($(document).scrollTop() + $(window).height() > $(document).height() - 330) {
+                $('.shopCar .oder_list dl .all_price.fixed-bottom').slideUp()
+            }else {
+                $('.shopCar .oder_list dl .all_price.fixed-bottom').slideDown()
+            }
+        })
+    })
 </script>

+ 2 - 2
src/main/webapp/resources/view/usercenter/forstore/buyer_invoice.html

@@ -639,9 +639,9 @@
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>联系电话:</label>
                         <div class="form-input-line">
                             <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initTelephone&&form.billTel.$error.required, 'bg-fff':!initFlag.initTelephone&&(!form.billTel.$invalid||!form.billTel.$touched)}" ng-model="bill.telephone" ng-focus="form.billTel.$touched = false" ng-blur="form.billTel.$touched = true; initFlag.initTelephone=false;" name="billTel"
-                                   ng-pattern="/^[0-9]*$/" ng-minlength="8" ng-maxlength="11" required="required" placeholder="请输入联系电话">
+                                   ng-pattern="/^[0-9\\-]*$/" ng-minlength="8" ng-maxlength="13" required="required" placeholder="请输入联系电话">
                         </div>
-                        <div class="text-inverse error col-md-3" ng-show="form.billTel.$touched&&form.billTel.$invalid" ng-bind="form.billTel.$error.required?'请填写联系电话':'请输入8-11位数字'"></div>
+                        <div class="text-inverse error col-md-3" ng-show="form.billTel.$touched&&form.billTel.$invalid" ng-bind="form.billTel.$error.required?'请填写联系电话':'请输入8-13位电话号码'"></div>
                     </div>
                     <div class="form-group address">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>所在地区:</label>

+ 2 - 2
src/main/webapp/resources/view/usercenter/forstore/buyer_order.html

@@ -785,8 +785,8 @@
                         </span>
 						<span style="position: relative; width: 10%;">
                             <img src="static/img/common/songguo.png"/>
-                            <!--<a name="{{order.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.sellPhone, order.sellerenuu, chat.UserType.STORE)">联系卖家</a>-->
-							<a name="{{order.id}}" href="javascript:void(0)" class="contact_btn" ng-click="contactSeller(order)">联系卖家</a>
+                            <a name="{{order.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.sellPhone, order.sellerenuu, chat.UserType.STORE)">联系卖家</a>
+							<!--<a name="{{order.id}}" href="javascript:void(0)" class="contact_btn" ng-click="contactSeller(order)">联系卖家</a>-->
                              <div name="{{order.id}}" class="seller-contact" ng-if="order.active" ng-class="{true : 'seller-contact-info', false : 'display-none'}[order.active]">
                                  <div class="contact-title">
                                      <a ng-click="order.active=false"><i class="fa fa-close fa-lg" aria-hidden="true"></i></a>

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

@@ -17,7 +17,7 @@
 						<div ng-if="buyAccountInfos.length > 1"><button class="change-count" ng-click="changebuyAccount(buyAccount.id)">更换账户</button></div>
 					</li>
 					<li class="no-count" ng-if="!buyAccount">
-						<span><i class="fa fa-exclamation-circle"></i>暂未设置付款账户,前往  <a href="user#/payCenter" target="_blank">设置付款账户</a></span>
+						<span><i class="fa fa-exclamation-circle"></i>暂未设置付款账户,前往  <a href="javascript:void(0)" ng-click="editAccount()">设置付款账户</a></span>
 					</li>
 				</ul>
 			</div>

+ 2 - 2
src/main/webapp/resources/view/usercenter/forstore/order_detail.html

@@ -413,8 +413,8 @@
 								<a ng-href="store/{{order.orderDetails[0].storeid}}" ng-bind="order.storeName" class="hover-color" target="_blank"></a>
 							</i>
 							<img src="static/img/common/songguo.png" style="margin-right:0; ">
-							<!--<a href="javascript:void(0)" class="contact_btn" title="联系卖家" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.buyerTel, order.buyerenuu, chat.UserType.STORE)">联系卖家</a>-->
-							<a href="javascript:void(0)" class="contact_btn" title="联系卖家" ng-click="contactSeller()">联系卖家</a>
+							<a href="javascript:void(0)" class="contact_btn" title="联系卖家" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.buyerTel, order.buyerenuu, chat.UserType.STORE)">联系卖家</a>
+							<!--<a href="javascript:void(0)" class="contact_btn" title="联系卖家" ng-click="contactSeller()">联系卖家</a>-->
 							<div class="contact-box" ng-if="contactBNox">
 								<div class="title"><i class="fa fa-close fa-lg" ng-click="closeBox()"></i></div>
 								<div class="content">

+ 62 - 33
src/main/webapp/resources/view/usercenter/forstore/order_pay.html

@@ -581,6 +581,30 @@
 		font-size: 14px;
 		color: #fff;
 	}
+	/*添加是否可拆买、库存不足等提示*/
+	/*.sure_oder .btn-wrap .tip{*/
+		/*display: inline-block;*/
+		/*margin-top: 4px;*/
+		/*width: 150px;*/
+		/*text-align: left;*/
+		/*font-size: 12px;*/
+		/*font-weight: normal ;*/
+		/*line-height: 18px;*/
+		/*color: #e64040;*/
+	/*}*/
+	/*.sure_oder .btn-wrap .tip1{*/
+		/*width: 200px;*/
+		/*margin-left: -10px;*/
+	/*}*/
+	/*.sure_oder .btn-wrap .tip i{*/
+		/*font-size: 12px;*/
+		/*font-style: normal ;*/
+		/*color: #e64040;*/
+	/*}*/
+	/*.sure_oder .btn-wrap em.tips{*/
+		/*width: 124px;*/
+		/*text-align: center;*/
+	/*}*/
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr" id="pay-cart">
@@ -671,8 +695,8 @@
                             &nbsp;&nbsp;<img src="static/img/user/images/shop_home01.png"/>
 							店铺:<a ng-href="store/{{details[0].storeid}}" ng-bind="::key" class="hover-color" target="_blank"></a>
 							<img src="static/img/common/songguo.png" style="margin-left: 110px; margin-right:0; ">
-							<!--<a href="javascript:void(0)" class="contact_btn" title="联系卖家" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.buyerTel, order.buyerenuu, chat.UserType.STORE)">联系卖家</a>-->
-							<a class="contact_btn" title="联系卖家" name="{{key}}" ng-click="contactSeller(key)">联系卖家</a>
+							<a href="javascript:void(0)" class="contact_btn" title="联系卖家" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.buyerTel, order.buyerenuu, chat.UserType.STORE)">联系卖家</a>
+							<!--<a class="contact_btn" title="联系卖家" name="{{key}}" ng-click="contactSeller(key)">联系卖家</a>-->
 							<!--<a class="contact_btn" title="联系卖家" ng-click="contactSeller(details[0])">联系卖家</a>-->
 							<div class="contact-box" ng-if="storeContactInfos[key].contactSeller" name="{{key}}">
 								<div class="title"><i class="fa fa-close fa-lg" ng-click="storeContactInfos[key].contactSeller = false"></i></div>
@@ -698,34 +722,39 @@
 								<p><a href="product/brand/{{detail.branduuid}}/" target="_blank" style="color: #323232">品牌:<b ng-bind="detail.brName" style="color: #323232" title="{{detail.brName}}"></b></a></p>
 							</div>
                         </span>
-							<span class="wd01" ng-if="order.status == 501">
+						<span class="wd01" ng-if="order.status == 501">
 							交期 :
 							<i ng-if="detail.goodsHistory.b2cMinDelivery == detail.goodsHistory.b2cMaxDelivery" ng-bind="detail.goodsHistory.b2cMinDelivery"></i>
 							<i ng-if="detail.goodsHistory.b2cMinDelivery != detail.goodsHistory.b2cMaxDelivery" ng-bind="detail.goodsHistory.b2cMinDelivery + '-' + detail.goodsHistory.b2cMaxDelivery"></i>
-								<!--{{detail.goodsHistory.b2cMinDelivery}}-{{detail.goodsHistory.b2cMaxDelivery}}-->
+							<!--{{detail.goodsHistory.b2cMinDelivery}}-{{detail.goodsHistory.b2cMaxDelivery}}-->
 						</span>
-							<span class="wd01" ng-if="order.status != 501">
+						<span class="wd01" ng-if="order.status != 501">
 							交期 :
 						<i ng-if="detail.b2cMinDelivery == detail.b2cMaxDelivery" ng-bind="detail.b2cMinDelivery"></i>
 						<i ng-if="detail.b2cMinDelivery != detail.b2cMaxDelivery" ng-bind="detail.b2cMinDelivery + '-' + detail.b2cMaxDelivery"></i>
 						</span>
-							<span>
+						<span>
 							<select class="select" ng-model="detail.currencyName" ng-if="order.buyNow&&(order.status == 501)&&(detail.goodsHistory.currencyName=='RMB-USD')" ng-change="changeCurrency(detail)">
 								<option value="RMB" selected="selected" ng-bind="detail.rmbUnitPrice | formateNumber : 6 | currencySysmbol : 'RMB'"></option>
 								<option value="USD" ng-bind="detail.usdUnitPrice | formateNumber : 6 | currencySysmbol : 'USD'"></option>
 							</select>
 						</span>
-							<span class="wd01" ng-if="(order.status == 501)&&(detail.goodsHistory.currencyName == 'RMB')" ng-bind="detail.rmbUnitPrice | formateNumber : 6 | currencySysmbol : 'RMB'"></span>
-							<span class="wd01" ng-if="(order.status == 501)&&(detail.goodsHistory.currencyName == 'USD')" ng-bind="detail.usdUnitPrice | formateNumber : 6 | currencySysmbol : 'USD'"></span>
-							<span class="wd01" ng-bind="detail.taxUnitprice | formateNumber : 6 | currencySysmbol : 'RMB'" ng-if="detail.currencyName.indexOf('RMB') > -1 && order.status != 501"></span>
-							<span class="wd01" ng-bind="detail.taxUnitprice | formateNumber : 6 | currencySysmbol : 'USD'" ng-if="detail.currencyName.indexOf('USD') > -1 && order.status != 501"></span>
-							<span class="wd01">
+						<span class="wd01" ng-if="(order.status == 501)&&(detail.goodsHistory.currencyName == 'RMB')" ng-bind="detail.rmbUnitPrice | formateNumber : 6 | currencySysmbol : 'RMB'"></span>
+						<span class="wd01" ng-if="(order.status == 501)&&(detail.goodsHistory.currencyName == 'USD')" ng-bind="detail.usdUnitPrice | formateNumber : 6 | currencySysmbol : 'USD'"></span>
+						<span class="wd01" ng-bind="detail.taxUnitprice | formateNumber : 6 | currencySysmbol : 'RMB'" ng-if="detail.currencyName.indexOf('RMB') > -1 && order.status != 501"></span>
+						<span class="wd01" ng-bind="detail.taxUnitprice | formateNumber : 6 | currencySysmbol : 'USD'" ng-if="detail.currencyName.indexOf('USD') > -1 && order.status != 501"></span>
+						<span class="wd01">
                             <div class="btn-wrap">
                             <span class="number add-minus" ng-if="order.status == 501">
                                 <a href="javascript:void(0)" class="reduce" ng-click="reduce(detail)" ng-disabled="detail.minusDisabled">-</a>
                                 <input type="text" ng-model="detail.number" ng-readonly="order.status != 501" ng-blur="blurNum(detail)">
                                 <a href="javascript:void(0)" class="add" ng-click="add(detail)" ng-disabled="detail.addDisabled">+</a>
                             </span>
+							<!--<em class="tip tip1" ng-if="!detail.goodsHistory.breakUp && detail.inputError == 3">不支持拆包且包装数量为<i ng-bind="detail.goodsHistory.minPackQty"></i></em>-->
+							<!--<em class="tip tips" ng-if="!detail.goodsHistory.breakUp && detail.inputError == 2">库存不足</em>-->
+							<!--<em class="tip tips" ng-if="detail.goodsHistory.breakUp && detail.noInputError == 2">库存不足</em>-->
+							<!--<em class="tip tips" ng-if="!detail.goodsHistory.breakUp && detail.inputError == 1">最小起订量为<i ng-bind="detail.goodsHistory.minBuyQty"></i></em>-->
+							<!--<em class="tip tips" ng-if="detail.goodsHistory.breakUp && detail.noInputError == 1">最小起订量为<i ng-bind="detail.goodsHistory.minBuyQty"></i></em>-->
 							<span ng-if="order.status != 501" ng-bind="detail.number" class="number" style="border: none;"></span>
                             </div>
                         </span>
@@ -761,7 +790,7 @@
 									<i ng-bind="detail.remark">金石为开取数据五块钱叫稍微亲上加亲</i>
 								</div>
 								<em ng-if="order.status!=501 && !detail.remark">&nbsp;</em>
-								<!--<em ng-if="order.status!=501" ng-bind="detail.remark" style="color: #333; line-height: 20px; display: inline-block; padding-top: 10px;"></em>-->
+                        		<!--<em ng-if="order.status!=501" ng-bind="detail.remark" style="color: #333; line-height: 20px; display: inline-block; padding-top: 10px;"></em>-->
 							</span>
 						</dd>
 						<dd class="oder-remark">
@@ -816,17 +845,17 @@
 						</dd>
 						<div class="self-list" ng-if="order.status==501 && deliveryList[details[0].storeid].method == 1303">
 							<!--自提点列表-->
-							<ul class="self-advice" ng-if="order.status == 501">
-								<li ng-repeat="item in takeSelfMap[details[0].storeid]">
-									<label class="check-act">
-										<input type="radio" id="{{item.id}}" name="1" ng-click="updateTakeSelf(details[0].storeid, item)"/>
-										<label for="{{item.id}}"></label>
-									</label>
-									<strong style="margin-left: 0" ng-bind="item.takename"></strong>
-									<strong>地址:<i ng-bind="item.area"></i>&nbsp;&nbsp;<i ng-bind="item.detailAddress"></i></strong>
-									<strong>营业时间:<i ng-bind="item.businesstime">周一至周五 8:30-18:00</i></strong>
-								</li>
-							</ul>
+								<ul class="self-advice" ng-if="order.status == 501">
+									<li ng-repeat="item in takeSelfMap[details[0].storeid]">
+										<label class="check-act">
+											<input type="radio" id="{{item.id}}" name="1" ng-click="updateTakeSelf(details[0].storeid, item)"/>
+											<label for="{{item.id}}"></label>
+										</label>
+										<strong style="margin-left: 0" ng-bind="item.takename"></strong>
+										<strong>地址:<i ng-bind="item.area"></i>&nbsp;&nbsp;<i ng-bind="item.detailAddress"></i></strong>
+										<strong>营业时间:<i ng-bind="item.businesstime">周一至周五 8:30-18:00</i></strong>
+									</li>
+								</ul>
 						</div>
 						<dd class="line60" ng-if="order.status!=501 && (takeList ? takeList[details[0].storeid] : takeSelf)">
 							<span class="user-address" style="padding-left: 40px;" ng-if="takeList && takeList[details[0].storeid]">
@@ -841,16 +870,16 @@
 							</span>
 						</dd>
 						<!--<div class="self-list" ng-if="order.status!=501">-->
-						<!--<span ng-if="takeList">-->
-						<!--<strong style="margin-left: 0" ng-bind="takeList[details[0].storeid].takename"></strong>-->
-						<!--<strong>地址:<i ng-bind="takeList[details[0].storeid].area"></i>&nbsp;&nbsp;<i ng-bind="takeList[details[0].storeid].detailAddress"></i></strong>-->
-						<!--<strong>营业时间:<i ng-bind="takeList[details[0].storeid].businesstime">周一至周五 8:30-18:00</i></strong>-->
-						<!--</span>-->
-						<!--<span ng-if="!takeList && takeSelf">-->
-						<!--<strong style="margin-left: 0" ng-bind="takeSelf.takename"></strong>-->
-						<!--<strong>地址:<i ng-bind="takeSelf.area"></i>&nbsp;&nbsp;<i ng-bind="takeSelf.detailAddress"></i></strong>-->
-						<!--<strong>营业时间:<i ng-bind="takeSelf.businesstime">周一至周五 8:30-18:00</i></strong>-->
-						<!--</span>-->
+							<!--<span ng-if="takeList">-->
+								<!--<strong style="margin-left: 0" ng-bind="takeList[details[0].storeid].takename"></strong>-->
+								<!--<strong>地址:<i ng-bind="takeList[details[0].storeid].area"></i>&nbsp;&nbsp;<i ng-bind="takeList[details[0].storeid].detailAddress"></i></strong>-->
+								<!--<strong>营业时间:<i ng-bind="takeList[details[0].storeid].businesstime">周一至周五 8:30-18:00</i></strong>-->
+							<!--</span>-->
+							<!--<span ng-if="!takeList && takeSelf">-->
+								<!--<strong style="margin-left: 0" ng-bind="takeSelf.takename"></strong>-->
+								<!--<strong>地址:<i ng-bind="takeSelf.area"></i>&nbsp;&nbsp;<i ng-bind="takeSelf.detailAddress"></i></strong>-->
+								<!--<strong>营业时间:<i ng-bind="takeSelf.businesstime">周一至周五 8:30-18:00</i></strong>-->
+							<!--</span>-->
 						<!--</div>-->
 					</div>
 					<dd class="pay_price">

+ 3 - 1
src/main/webapp/resources/view/usercenter/forstore/pay_center.html

@@ -231,6 +231,8 @@
 	#pay_center .tab .user-account-table {
 		width:98%;
 		text-align: center;
+		table-layout: fixed;
+		margin:0 auto 40px;
 	}
 	#pay_center .tab .user-account-table thead {
 		background: #89aefa;
@@ -405,7 +407,7 @@
 						<span>新增账户</span>
 					</div>
 				</div>
-				<table class="user-account-table table" ng-table="bankInfoTableParams" style="table-layout: fixed;margin-bottom:40px;">
+				<table class="user-account-table table" ng-table="bankInfoTableParams">
 					<thead>
 						<th>开户银行</th>
 						<th >开户支行</th>

+ 2 - 2
src/main/webapp/resources/view/usercenter/forstore/query_logistics.html

@@ -199,8 +199,8 @@
                         <span style="margin-right: 0;">订单号:</span>
                         <span style="margin-left: 0; margin-right: 30px;" ng-bind="order.orderid"></span>
                         <span style="margin-right: 0px;"><img src="static/img/user/images/shop_home.png" />&nbsp;<a ng-bind="order.storeName" style="margin-left: 0;margin-right: 20px;" href="store/{{::order.storeid}}" target="_blank"></a></span>
-                        <span><img src="static/img/common/songguo.png"/><!--<a href="#" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.sellPhone, order.sellerenuu, chat.UserType.STORE)">联系卖家</a>-->
-                            <a class="contact_btn" ng-click="contactSeller()">联系卖家</a>
+                        <span><img src="static/img/common/songguo.png"/><a href="#" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.sellPhone, order.sellerenuu, chat.UserType.STORE)">联系卖家</a>
+                            <!--<a class="contact_btn" ng-click="contactSeller()">联系卖家</a>-->
                             <div class="contact-box" ng-if="contactBNox">
 								<div class="title"><i class="fa fa-close fa-lg" ng-click="closeBox()"></i></div>
 								<div class="content">

+ 19 - 3
src/main/webapp/resources/view/usercenter/header.html

@@ -169,7 +169,7 @@
         position: absolute;
         left: 0;
         top: 100%;
-        right: 61px;
+        right: 72px;
         list-style: none;
         -webkit-padding-start: 0;
         background: #ffffff;
@@ -190,6 +190,15 @@
         background: #EEEEEE;
         cursor: pointer;
     }
+    #mall-search .association li.similar-title {
+        font-size: 16px;
+        font-weight: bold;
+        cursor: default;
+        border-top: 1px solid #ccc;
+    }
+    #mall-search .association li.similar-title:first-child {
+        border-top: none;
+    }
     .association.none{
         border: none !important;
     }
@@ -212,8 +221,15 @@
             <input type="text" ng-model="keyword" ng-change="onChange()" ng-search="search()" ng-focus="onFocus()" ng-blur="onBlur()" ng-keyup="onKeyup()"placeholder="型号/类目/品牌" />
             <a class="seek" ng-click="search()">搜索</a>
             <ul class="association" ng-show="associate || associateEnter"  ng-class="{'none': !associate || !associateEnter}" ng-mouseenter="onAssociateEnter()" ng-mouseleave="onAssociateLeave()">
-                <li ng-repeat="as in associates" ng-bind="as" ng-class="{'active': $index==selectIndex}"
-                    ng-click="onAssociateClick(as)"></li>
+                <li class="similar-title" ng-if="associates.component && associates.component.length > 0">型号:</li>
+                <li ng-repeat="as in associates.component" ng-bind="as.code" ng-class="{'active': $index==selectIndex}"
+                    ng-click="onAssociateClick(as.code)"></li>
+                <li class="similar-title" ng-if="associates.component && associates.brand.length > 0">品牌:</li>
+                <li ng-repeat="as in associates.brand" ng-bind="as.nameCn" ng-class="{'active': $index==selectIndex}"
+                    ng-click="onAssociateClick(as.nameCn)"></li>
+                <li class="similar-title" ng-if="associates.component && associates.kind.length > 0">类目:</li>
+                <li ng-repeat="as in associates.kind" ng-bind="as.nameCn" ng-class="{'active': $index==selectIndex}"
+                    ng-click="onAssociateClick(as.nameCn)"></li>
             </ul>
         </div>
     </div>

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

@@ -497,8 +497,8 @@
 						</td>
 						<td ng-bind="material.unit || 'PCS'" title="{{material.unit  || 'PCS'}}"></td>
 						<td>
-							<a ng-if="material.cmpUuId" ng-href="product/component/{{material.cmpUuId}}/" ng-bind="material.pcmpcode" title="{{material.pcmpcode}}" style="color: #333;"></a>
-							<span ng-if="!material.cmpUuId" ng-bind="material.pcmpcode" title="{{material.pcmpcode}}"></span>
+							<!--<a ng-if="material.cmpUuId" ng-href="product/component/{{material.cmpUuId}}/" ng-bind="material.pcmpcode" title="{{material.pcmpcode}}" style="color: #333;"></a>-->
+							<span ng-bind="material.pcmpcode" title="{{material.pcmpcode}}"></span>
 						</td>
 						<td>
 							<a ng-show="!material.selected" ng-click="showShelfArea(material)"><span>去上架</span></a>

+ 4 - 2
src/main/webapp/resources/view/vendor/forstore/erp/vendor_material_unstandard_erp.html

@@ -109,7 +109,9 @@
 	.public-tab.table>tbody>tr>td{
 		border-top: none;
 		border-bottom: #e8e8e8 1px solid;
-        overflow: inherit;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
 	}
 	.public-tab.table>tbody>tr>td a{
 		margin: 0 10px;
@@ -520,7 +522,7 @@
 				<a ng-click="download()">批量导出</a>
 			</div>
 			<div class="check fr">
-				<!--<a ng-show="!isBatch && standard_tab == 'unstandard'" ng-click="matchAll()"><span ng-show="!isBatch && standard_tab == 'unstandard'">一键匹配</span></a>-->
+				<a ng-show="!isBatch && standard_tab == 'unstandard'" ng-click="matchAll()"><span ng-show="!isBatch && standard_tab == 'unstandard'">一键匹配</span></a>
 				<a ng-show="!isBatch" ng-click="enterBatch()"><span ng-show="!isBatch">批量操作</span></a>
 				<span class="check-btn" ng-show="isBatch">
                     <label class="check-active">

+ 3 - 3
src/main/webapp/resources/view/vendor/forstore/erp/vendor_onSale_erp.html

@@ -675,9 +675,9 @@
                             </div>
                         </td>
                         <td class="padding0">
-                            <div ng-if="!commodity.sourceId"><a class="edit" ng-click="editCommodity(commodity)">修改</a></div><!--updateCommodityInfo(commodity, false)-->
-                            <div ng-if="commodity.sourceId"><a style="margin: 0;">来源UAS</a></div>
-                            <div ng-if="!commodity.sourceId"><a ng-click="soldOut(commodity)">下架</a></div>
+                            <div><a class="edit" ng-click="editCommodity(commodity)">修改</a></div><!--updateCommodityInfo(commodity, false)-->
+                            <!--<div ng-if="commodity.sourceId"><a style="margin: 0;">来源UAS</a></div>-->
+                            <div><a ng-click="soldOut(commodity)">下架</a></div>
                         </td>
                     </tr>
                     <tr class="edit-form" ng-if="commodity.edit">

+ 3 - 3
src/main/webapp/resources/view/vendor/forstore/purchase_detail.html

@@ -465,8 +465,8 @@
 								<!--<a ng-if="purchase.pu_buyentername" name="{{purchase.id}}" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">|{{purchase.pu_buyentername}}</a>-->
 							</i>
 							<img src="static/img/common/songguo.png" style="margin-right:0; ">
-							<!--<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>-->
-							<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-click="contactSeller()">联系买家</a>
+							<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>
+							<!--<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-click="contactSeller()">联系买家</a>-->
 							<div class="contact-box" ng-if="contactBNox">
 								<div class="title"><i class="fa fa-close fa-lg" ng-click="closeBox()"></i></div>
 								<div class="content">
@@ -939,7 +939,7 @@
 		</p>
 		<div class="deal-btn">
 			<a ng-click="setShowNoAccountBox(false)">确定</a>
-			<a href="vendor#/payCenter" target="_blank">设置收款账户<i class="fa fa-long-arrow-right"></i></a>
+			<a ui-sref="pay_center({tab:'accountTab'})" target="_blank">设置收款账户<i class="fa fa-long-arrow-right"></i></a>
 		</div>
 	</div>
 </div>

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

@@ -205,8 +205,9 @@
                     <div class="logistics-content">
                         <div class="img"><img src="static/img/icon/member.png"  alt=""/></div>
                         <div class="content" style="position: relative;">
-                            <p><span ng-bind="purchase.buyername"></span> &nbsp;<em ng-show="purchase.buyentername">|</em>&nbsp; <em class="name" ng-bind="purchase.buyentername"></em><img src="static/img/common/songguo.png" /><!--<a href="#" class="contact-btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>-->
-                            <a class="contact_btn" ng-click="contactSeller()">联系买家</a>
+                            <p><span ng-bind="purchase.buyername"></span> &nbsp;<em ng-show="purchase.buyentername">|</em>&nbsp; <em class="name" ng-bind="purchase.buyentername"></em><img src="static/img/common/songguo.png" />
+                                <a href="#" class="contact-btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>
+                            <!--<a class="contact_btn" ng-click="contactSeller()">联系买家</a>-->
                             <div class="contact-box" ng-if="contactBNox">
                                 <div class="title"><i class="fa fa-close fa-lg" ng-click="closeBox()"></i></div>
                                 <div class="content">

+ 3 - 0
src/main/webapp/resources/view/vendor/forstore/vendor-invoice.html

@@ -251,6 +251,9 @@
     .vendor-invoice .select-adder {
         background-position-x: 113%!important;
     }
+    #checkAll[disabled] + label {
+        cursor: not-allowed;
+    }
 </style>
 <div class="count user_right fr">
     <div class="count_center">

+ 36 - 8
src/main/webapp/resources/view/vendor/forstore/vendor_delivery.html

@@ -75,7 +75,9 @@
         border-radius: 3px;
     }
     .sell_oder .sure_oder .oder_xq_list dl span .dropdown-menu{
-        top: 95%;
+        position: unset;
+        float: none;
+        /*top: 95%;*/
         line-height: 23px;
         max-height: 120px;
         overflow-y: auto;
@@ -83,6 +85,9 @@
         display: block;
         overflow-x: hidden;
         border-radius: 0;
+        box-shadow: none;
+        margin-top: 1px;
+        border: none;
     }
     .sell_oder .sure_oder .oder_xq_list dl span .dropdown-menu li{
         font-size: 14px;
@@ -478,6 +483,17 @@
         margin-top: -1px;
         height: 32px;
     }
+    #oder-detail .line60.logistic-input span.input-ul >div {
+        position: relative;
+        -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175);
+        box-shadow: 0 6px 12px rgba(0,0,0,.175);
+    }
+    #oder-detail .line60.logistic-input span.input-ul >div >a {
+        width: 170px;
+        background: #e8e8e8;
+        color: #666!important;
+        display: block;
+    }
     #oder-detail .line60.logistic-input span.input-ul em{
     }
     #oder-detail .line60.logistic-input .logistic-input-01{
@@ -510,6 +526,15 @@
     .form-control[readonly]{
         background-color: #ffffff;
     }
+    .input-ul ::-webkit-scrollbar {
+        padding-left: 0 !important;
+        background-color: #c1c1c1;
+        width: 8px;
+    }
+    .input-ul ::-webkit-scrollbar-thumb {
+        -webkit-border-radius: 5px !important;
+        border-radius: 5px !important;
+    }
 </style>
 <div class="user_right fr">
     <!--订单发货-->
@@ -574,8 +599,8 @@
 								<!--<a ng-if="purchase.pu_buyentername" name="{{purchase.id}}" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">|{{purchase.pu_buyentername}}</a>-->
 							</i>
 							<img src="static/img/common/songguo.png" style="margin-right:0; ">
-                            <!--<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>-->
-							<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" >联系买家</a>
+                            <a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>
+							<!--<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" >联系买家</a>-->
 						</span>
                     </dd>
                     <div ng-class="{'limit-3': !open}" style="width: 100%; margin: 0 auto; overflow: hidden;">
@@ -672,10 +697,13 @@
                             <span class="input-ul">
                                 <input id="addr" style="border: #5078cb 1px solid;" type="text" class="form-control select-adder" ng-focus="getItemFocus()" ng-blur="onItemBlur()" ng-keydown="onKeyup()" ng-model="logistics.companyName" placeholder="请选择物流公司" autocomplete="off" maxlength="15" readonly="readonly" >
                                 <!--<em name="companyName" ng-click="changeShowLogistics()" class="btn-position"><i class="fa fa-caret-down" aria-hidden="true"></i></em>-->
-                                <ul id="ulContent" ng-if="showCompanyName" class="dropdown-menu">
-                                    <li ng-click="showDefaultText()">请选择物流公司</li>
-                                    <li ng-click="showText(data)" ng-repeat="data in data_list" ng-class="{'active': $index==selectIndex}" ng-bind="data.companyName"></li>
-                                </ul>
+                                <div ng-if="showCompanyName">
+                                    <ul id="ulContent" class="dropdown-menu">
+                                        <li ng-click="showDefaultText()">请选择物流公司</li>
+                                        <li ng-click="showText(data)" ng-repeat="data in data_list" ng-class="{'active': $index==selectIndex}" ng-bind="data.companyName"></li>
+                                    </ul>
+                                    <a ng-click="addDistributor()">+&nbsp;新增配送商</a>
+                                </div>
                             </span>
                             <span  style="width: 10%;"> 物流单号 :&nbsp;</span>
                             <span style="margin-right: 20px; width: 160px; float: left;">
@@ -694,7 +722,7 @@
                         <div ng-if="checkinvoice.status==406">
                             <a href="javascript:void(0)" ng-click="saveCheck()" class="confirm">确认发货</a>
                             <a ng-click="backToDelivery()" class="cancel">取消</a>
-                            <a ng-click="addDistributor()" class="add">新增配送商</a>
+                            <!--<a ng-click="addDistributor()" class="add">新增配送商</a>-->
                         </div>
                     </dd>
                 </dl>

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

@@ -19,7 +19,7 @@
             <dl>
                 <dt><img src="static/img/vendor/images/user_photo.png" /></dt>
                 <dd>
-                    <span>{{userInfo.userName}}  | <br/><!--<em>账户余额:¥68899.99</em>--></span>
+                    <span ng-bind="userInfo.userName">  | <br/><!--<em>账户余额:¥68899.99</em>--></span>
                     <span ng-bind="vendor.enName || '个人账户'"><br/> <!--<em>账户余额:¥68899.99</em>--></span>
                     <a ui-sref="vendor_account_management" href="#/account/management/">账户设置&nbsp;》</a>
                     <!--<p><img src="static/img/vendor/images/sell_grade.png"/>专有服务:******</p>-->

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

@@ -573,7 +573,7 @@
 								</div>
 							</div>
 							<div class="content">
-								<p class="title">价格梯度</p>
+								<p class="title">梯度/pcs</p>
 								<div class="input-list" ng-repeat="price in goods.prices">
 									<p>
 										<span><input ng-disabled="$index == 0" type="number" class="wid42 form-control"  placeholder="数量" ng-model="price.start" ng-blur="changePriceStart(goods, $index)" ng-pattern="/^[0-9]*$/"/></span>

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

@@ -579,7 +579,7 @@
                         <th width="220">产品信息</th>
                         <th width="115">包装/生产日期</th>
                         <th width="140">库存</th>
-                        <th width="105">数量</th>
+                        <th width="105">梯度/pcs</th>
                         <th ng-if="onsale.currency == 'USD'" width="116">单价<b style="font-size: 12px;font-weight: 600">($)</b></th>
                         <th ng-if="onsale.currency == 'RMB'" width="116">单价<b style="font-size: 12px;font-weight: 600">(¥)</b></th>
                         <th width="120">交期</th>

+ 3 - 3
src/main/webapp/resources/view/vendor/forstore/vendor_order.html

@@ -1229,8 +1229,8 @@
                         </span>
 						<span style="position: relative;">
                             <img src="static/img/common/songguo.png">
-                            <!--<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>-->
-							<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-click="contactBuyer(purchase)">联系买家</a>
+                            <a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(purchase.buyPhone, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>
+							<!--<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-click="contactBuyer(purchase)">联系买家</a>
                              <div name="{{purchase.id}}" class="buyer-contact" ng-if="purchase.active" ng-class="{true : 'buyer-contact-info', false : 'display-none'}[purchase.active]">
                                  <div class="contact-title">
                                      <a ng-click="purchase.active=false"><i class="fa fa-close fa-lg" aria-hidden="true"></i></a>
@@ -1246,7 +1246,7 @@
                                      <textarea class="send-message" placeholder="给买家发送站内消息"></textarea>
                                  </div>
                                  <div style="display: none;" class="send-button"><a class="send">发送</a></div>
-                            </div>
+                            </div>-->
                         </span>
 						<span class="print-icon" style="width: 8%;">
 							<a title="打印订单"><i class="fa fa-print fa-lg"></i></a>

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

@@ -566,7 +566,7 @@
 	}
 </style>
 <!-- 店铺信息 -->
-<div class="container vendor_store_maintain">
+<div class="container vendor_store_maintain user_right">
 	<div style="margin-bottom: 30px;" class="width120">
 		<div class="row com_row" style="margin-top: 10px;">
 			<div class="col-md-12 custom_col">

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

@@ -361,7 +361,7 @@
                                     <th width="150" style="padding-left: 10px;">器件属性</th>
                                     <th width="150">产品固有属性</th>
                                     <th width="200">产品自定义属性</th>
-                                    <th width="100">数量</th>
+                                    <th width="100">梯度/pcs</th>
                                     <th width="100">单价(<em ng-bind="batch.currency == 'RMB' ? '¥' : '$'"></em>)</th>
                                     <th width="70">操作</th>
                                 </tr>
@@ -373,9 +373,9 @@
                                         <span ng-bind="$index+1"></span>
                                     </td>
                                     <td style="padding-left: 10px;">
-                                        <div class="text-more">品牌:&nbsp;<em title="{{batchCommodity.b2cBranden || '空'}}" ng-bind="batchCommodity.brandNameEn || '空'"></em></div>
+                                        <div class="text-more">品牌:&nbsp;<em title="{{batchCommodity.brandNameEn || '空'}}" ng-bind="batchCommodity.brandNameEn || '空'"></em></div>
                                         <div class="text-more">类目:&nbsp;<em title="{{batchCommodity.kindName || '空'}}" ng-bind="batchCommodity.kindName || '空'"></em></div>
-                                        <div class="text-more">型号:&nbsp;<em title="{{batchCommodity.b2cCode || '空'}}" ng-bind="batchCommodity.code || '空'"></em></div>
+                                        <div class="text-more">型号:&nbsp;<em title="{{batchCommodity.code || '空'}}" ng-bind="batchCommodity.code || '空'"></em></div>
                                     </td>
                                     <td>
                                         <!--<div>类型:&nbsp;<span ng-bind="batchCommodity.original == 1311 ? '现货' : '呆滞库存' "></span></div>-->

+ 19 - 4
src/main/webapp/resources/view/vendor/header.html

@@ -169,7 +169,7 @@
         position: absolute;
         left: 0;
         top: 100%;
-        right: 61px;
+        right: 72px;
         list-style: none;
         -webkit-padding-start: 0;
         background: #ffffff;
@@ -182,7 +182,6 @@
         line-height: 30px;
         text-align: left;
     }
-
     #mall-search .association li.active, #mall-search .association li.active:hover {
         background: #dddddd;
     }
@@ -190,6 +189,15 @@
         background: #EEEEEE;
         cursor: pointer;
     }
+    #mall-search .association li.similar-title {
+        font-size: 16px;
+        font-weight: bold;
+        cursor: default;
+        border-top: 1px solid #ccc;
+    }
+    #mall-search .association li.similar-title:first-child {
+        border-top: none;
+    }
     .association.none{
         border: none !important;
     }
@@ -211,8 +219,15 @@
             <input type="text" ng-model="keyword" ng-change="onChange()" ng-search="search()" ng-focus="onFocus()" ng-blur="onBlur()" ng-keyup="onKeyup()"placeholder="型号/类目/品牌" />
             <a class="seek" ng-click="search()">搜索</a>
             <ul class="association" ng-show="associate || associateEnter" ng-mouseenter="onAssociateEnter()" ng-mouseleave="onAssociateLeave()" ng-class="{'none': !associate || !associateEnter}">
-                <li ng-repeat="as in associates" ng-bind="as" ng-class="{'active': $index==selectIndex}"
-                    ng-click="onAssociateClick(as)"></li>
+                <li class="similar-title" ng-if="associates.component && associates.component.length > 0">型号:</li>
+                <li ng-repeat="as in associates.component" ng-bind="as.code" ng-class="{'active': $index==selectIndex}"
+                    ng-click="onAssociateClick(as.code)"></li>
+                <li class="similar-title" ng-if="associates.component && associates.brand.length > 0">品牌:</li>
+                <li ng-repeat="as in associates.brand" ng-bind="as.nameCn" ng-class="{'active': $index==selectIndex}"
+                    ng-click="onAssociateClick(as.nameCn)"></li>
+                <li class="similar-title" ng-if="associates.component && associates.kind.length > 0">类目:</li>
+                <li ng-repeat="as in associates.kind" ng-bind="as.nameCn" ng-class="{'active': $index==selectIndex}"
+                    ng-click="onAssociateClick(as.nameCn)"></li>
             </ul>
         </div>
     </div>

Some files were not shown because too many files changed in this diff