Parcourir la source

新增个人登录 绑定企业逻辑

wangdy il y a 8 ans
Parent
commit
b170415f7f

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

@@ -1,17 +1,22 @@
 package com.uas.platform.b2c.common.account.controller;
 
+import com.uas.account.entity.ApplyUserSpace;
 import com.uas.account.entity.UserSpaceDetail;
+import com.uas.account.support.Page;
 import com.uas.account.util.AccountUtils;
 import com.uas.platform.b2c.common.account.model.Enterprise;
 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.fa.payment.utils.StringUtils;
 import com.uas.platform.b2c.prod.store.service.StoreInService;
 import com.uas.platform.b2c.trade.support.ResultMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Map;
+
 /**
  * 企业信息
  * @author suntg
@@ -149,4 +154,77 @@ public class EnterpriseController {
 		enterpriseService.openVendor(enUU,false,false);
 	}
 
+	/**
+	 * 通过名字查找企业详细信息(账户中心)
+	 *
+	 * @param enName
+	 */
+	@RequestMapping(value = "/findByName/{enName}", method = RequestMethod.GET)
+	public UserSpaceDetail findByName(@PathVariable("enName") String enName) {
+		UserSpaceDetail userSpaceDetail = null;
+		if (StringUtils.isEmpty(enName)) {
+			throw new IllegalArgumentException("信息未填写完整!");
+		}
+		try {
+			userSpaceDetail = AccountUtils.findByName(enName);
+		} catch (Exception e) {
+			throw new IllegalArgumentException("账户中心异常!");
+		}
+		return userSpaceDetail;
+	}
+
+	/**
+	 * 发起绑定个人到企业的申请
+	 * @param phone
+	 * @param enName
+	 * @param businessCode
+	 */
+	@RequestMapping(value = "/applyUserSpace", method = RequestMethod.GET)
+	public ResultMap applyUserSpace(String phone, String enName, String businessCode) {
+		if (StringUtils.isEmpty(phone) || StringUtils.isEmpty(enName) || StringUtils.isEmpty(businessCode)) {
+			return ResultMap.success("信息缺失");
+		}
+		try {
+			AccountUtils.applyUserSpace(phone,enName,businessCode);
+		} catch (Exception e) {
+			return ResultMap.success(e.getMessage());
+		}
+		return ResultMap.success("success");
+	}
+
+	/**
+	 * 返回个人申请记录
+	 * @param phone
+	 */
+	@RequestMapping(value = "/findApplyInfo", method = RequestMethod.GET)
+	public Page<ApplyUserSpace> findApplyInfo(String phone) {
+		if (StringUtils.isEmpty(phone)) {
+			throw new IllegalArgumentException("信息未填写完整!");
+		}
+		Page<ApplyUserSpace> applyUserSpacePage= null;
+		try {
+			applyUserSpacePage = AccountUtils.findApplyInfo(phone,1024*1024*1024,1);
+		} catch (Exception e) {
+			throw new IllegalArgumentException("系统异常");
+		}
+		return applyUserSpacePage;
+	}
+
+	/**
+	 * 返回企业未处理审批数量
+	 * @param businessCode
+	 */
+	@RequestMapping(value = "/applyCount", method = RequestMethod.GET)
+	public Map<String, Integer> applyCount(String businessCode) {
+		if (StringUtils.isEmpty(businessCode)) {
+			throw new IllegalArgumentException("信息未填写完整!");
+		}
+		Map<String, Integer> result= null;
+		try {
+			result = AccountUtils.applyCount(businessCode);
+		} catch (Exception e) {
+			throw new IllegalArgumentException("系统异常");
+		}
+		return result;
+	}
 }

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

@@ -18,6 +18,10 @@ define([ 'app/app' ], function(app) {
 	app.register.controller('batchPutOnCtrl', ['$scope', '$rootScope', 'ngTableParams', '$upload', '$q', 'AuthenticationService', 'BaseService', 'StoreInfo', 'SessionService', '$modal', 'toaster', 'ReleaseProductByBatch', 'Loading', 'Enterprise', 'DistributionRule', function ($scope, $rootScope, ngTableParams, $upload, $q, AuthenticationService, BaseService, StoreInfo, SessionService, $modal, toaster, ReleaseProductByBatch, Loading, Enterprise, DistributionRule) {
 
 		$scope.deletePop = false;
+        $scope.personMedol =false;
+        $scope.setPersonMedol = function () {
+        	$scope.personMedol =false;
+        };
 
 		//获取币别信息
 		Enterprise.getCurrencyByRegisterAddress(null, function (data) {
@@ -334,7 +338,7 @@ define([ 'app/app' ], function(app) {
                         return ;
                     }
                     // toaster.pop("success", "提示", "发布成功 :" + data.data + "条");
-                    toaster.pop("success", "提示", "发布成功");
+                    $scope.personMedol = true;
                     $scope.relTableParams.page(1);
                     $scope.relTableParams.reload();
                     $scope.result.success = 0;//设置成0,让前端用户不能点击

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

@@ -453,7 +453,7 @@
                                 </span>
                             </div>-->
                         </div>
-                        <div class="txt-info" ng-if="result && result.total != 0 && !hadImport">成功导入 <span ng-bind="result.success + result.failure">600</span> 个产品(其中标准产品 <span ng-bind="result.success">200</span> 个,非标产品 <span ng-bind="result.failure">400</span> 个)<b class="success-hidden" ng-if="result.filter != 0">,下载 <a ng-click="downloadExcel()">导入失败产品</a></b></div>
+                        <div class="txt-info" ng-if="result && result.total != 0 && !hadImport && $$productOn.tab != 'bathOnPerson'">成功导入 <span ng-bind="result.success + result.failure">600</span> 个产品(其中标准产品 <span ng-bind="result.success">200</span> 个,非标产品 <span ng-bind="result.failure">400</span> 个)<b class="success-hidden" ng-if="result.filter != 0">,下载 <a ng-click="downloadExcel()">导入失败产品</a></b></div>
                         <table ng-table="relTableParams" class="public-tab table" ng-show="$$productOn.tab == 'bathOn'">
                             <thead>
                                 <tr>
@@ -562,6 +562,19 @@
                         <!--<div><a ng-click="cancelDelete()">取消</a><a ng-click="deleteBatch(deleteId)">确认</a></div>-->
                     <!--</div>-->
                 <!--</div>-->
+                <div class="com-modal-wrap" ng-if="result && result.total != 0 && !hadImport && $$productOn.tab == 'bathOnPerson' && personMedol">
+                    <div class="com-del-box">
+                        <div class="title">
+                            <i ng-click="setPersonMedol()"></i>
+                        </div>
+                        <p><img src="static/img/product/check.png" alt="">上传产品成功!</p>
+                        <div class="result">成功上传<span ng-bind="result.success + result.failure">600</span>个产品(其中标准产品<span ng-bind="result.success">200</span>个,非标产品<span ng-bind="result.failure">300</span>个),下载<a ng-click="downloadExcel()">上传失败产品</a></div>
+                        <div class="operate">
+                            <span ng-click="setPersonMedol()">留在当前页</span>
+                            前往 <a ui-sref="vendor_material_person">我的产品库 <i class="fa fa-long-arrow-right"></i></a>
+                        </div>
+                    </div>
+                </div>
             </div>
         </div>
     </div>
@@ -574,18 +587,4 @@
             <div class="img"><img src=""></div>
         </div>
     </div>
-</div>
-<div class="com-modal-wrap">
-    <div class="com-del-box">
-        <div class="title">
-            <i></i>
-        </div>
-        <p><img src="static/img/product/check.png" alt="">上传产品成功!</p>
-        <div class="result">成功上传<span>600</span>个产品(其中标准产品<span>200</span>个,非标产品<span>300</span>个),下载<a href="">上传失败产品</a></div>
-        <div class="operate">
-            <span>留在当前页</span>
-            前往 <a href="">我的产品库 <i class="fa fa-long-arrow-right"></i></a>
-        </div>
-    </div>
-</div>
-
+</div>