Browse Source

增加企业邀请记录查询

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@8889 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
hejq 9 years ago
parent
commit
73c675f5cc

+ 16 - 1
src/main/java/com/uas/platform/b2b/controller/InvitationRecordController.java

@@ -43,7 +43,7 @@ public class InvitationRecordController {
 	}
 
 	/**
-	 * 查询邀请记录
+	 * 查询邀请记录(个人)
 	 * 
 	 * @return
 	 */
@@ -56,4 +56,19 @@ public class InvitationRecordController {
 		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
 		return searchService.getInvitationByKeyword(keyword, pageParams);
 	}
+
+	/**
+	 * 查询邀请记录(企业)
+	 * 
+	 * @return
+	 */
+	@RequestMapping(value = "/recordsByEn", method = RequestMethod.GET)
+	private SPage<InvitationRecord> getRecordsByEn(PageParams params, String keyword) {
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		pageParams.getFilters().put("in_enuu", SystemSession.getUser().getEnterprise().getUu());
+		List<Sort> sortList = new ArrayList<>();
+		sortList.add(new Sort("in_id", false, Type.LONG, new Long(1)));
+		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
+		return searchService.getInvitationByKeyword(keyword, pageParams);
+	}
 }

+ 37 - 0
src/main/java/com/uas/platform/b2b/erp/controller/UserSpaceDetailController.java

@@ -12,7 +12,9 @@ import org.springframework.web.bind.annotation.RestController;
 import com.uas.account.entity.UserSpaceDetail;
 import com.uas.account.support.Page;
 import com.uas.platform.b2b.erp.model.PageInfo;
+import com.uas.platform.b2b.model.InvitationRecord;
 import com.uas.platform.b2b.search.SearchService;
+import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.core.util.serializer.FlexJsonUtils;
 import com.uas.search.b2b.model.PageParams;
 import com.uas.search.b2b.model.SPage;
@@ -55,4 +57,39 @@ public class UserSpaceDetailController {
 		}
 		return userSpaceDetails;
 	}
+	
+	/**
+	 * 获取邀请记录
+	 * 
+	 * @param data
+	 * @return
+	 * @throws UnsupportedEncodingException
+	 */
+	@RequestMapping(value="/invitations", method = RequestMethod.GET)
+	public Page<InvitationRecord> invitations(@RequestParam("data") String data) throws UnsupportedEncodingException {
+		Page<InvitationRecord> records = new Page<InvitationRecord>();
+		String jsonStr = URLDecoder.decode(data, "UTF-8");
+		PageInfo pageInfo = FlexJsonUtils.fromJson(jsonStr, PageInfo.class);
+		PageParams pageParams = new PageParams();
+		pageParams.setPage(pageInfo.getPageNumber());
+		pageParams.setSize(pageInfo.getPageSize());
+		try {
+			if (pageInfo.getEnuu() != null) {
+				pageParams.getFilters().put("in_enuu", pageInfo.getEnuu());
+			} else {
+				pageParams.getFilters().put("in_enuu", SystemSession.getUser().getEnterprise().getUu());
+			}
+			if (pageInfo.getUseruu() != null) {
+				pageParams.getFilters().put("in_useruu", pageInfo.getUseruu());
+			}
+			SPage<InvitationRecord> details = searchService.getInvitationByKeyword(pageInfo.getKeyword(),
+					pageParams);
+			records.setContent(details.getContent());
+			records.setNumber(details.getPage());
+			records.setTotalElements(details.getTotalElement());
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return records;
+	}
 }

+ 59 - 3
src/main/webapp/resources/js/index/app.js

@@ -513,6 +513,10 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             url : '/invitation',
             templateUrl : "static/tpl/index/baseInfo/invitation.html",
             controller : 'InvitationCtrl'
+        }).state('baseInfo.invitationforEn', {
+            url : '/invitationforEn',
+            templateUrl : "static/tpl/index/baseInfo/invitation.html",
+            controller : 'InvitationByEnCtrl'
         }).state('qc', {
             url : "/qc",
             views : {
@@ -1060,12 +1064,15 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	}]);
 	
 	/**
-	 * 邀请记录
+	 * 邀请记录(个人)
 	 */
 	app.controller('InvitationCtrl', ['$scope', 'toaster', 'InvitationRecord', 'BaseService', 'ngTableParams', function($scope, toaster, InvitationRecord, BaseService, ngTableParams) {
 		BaseService.scrollBackToTop();
 		$scope.status = "invitation";
-
+		var getService = function() {
+			return InvitationRecord.records;
+		};
+		
 		$scope.tableParams = new ngTableParams({ // ng-Table参数
 			page : 1,
 			count : 10,
@@ -1079,7 +1086,50 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 				var pageParams = params.url();
 				pageParams.keyword = $scope.keyword;
 				$scope.tip = $scope.keyword;
-				InvitationRecord.records.call(null, BaseService.parseParams(pageParams), function(page){
+				getService().call(null, BaseService.parseParams(pageParams), function(page){
+					$scope.loading = false;
+					if(page) {
+						params.total(page.totalElement);
+						$defer.resolve(page.content);
+					}
+				}, function(response){
+					$scope.loading = false;
+					toaster.pop('error', '数据加载失败', response.data);
+				});
+			}
+		});
+		
+		$scope.onSearch = function(keyword){
+			$scope.tableParams.page(1);
+  			$scope.tableParams.reload();
+  			$scope.tip = keyword;
+		}
+	}]);
+	
+	/**
+	 * 邀请记录(个人)
+	 */
+	app.controller('InvitationByEnCtrl', ['$scope', 'toaster', 'InvitationRecord', 'BaseService', 'ngTableParams', function($scope, toaster, InvitationRecord, BaseService, ngTableParams) {
+		BaseService.scrollBackToTop();
+		$scope.status = "invitationTeam";
+		var getService = function() {
+			return InvitationRecord.getRecordsByEn;
+		};
+		
+		$scope.tableParams = new ngTableParams({ // ng-Table参数
+			page : 1,
+			count : 10,
+			sorting: {
+            }
+		}, {
+			total : 0, 
+			counts: [],
+			getData : function($defer, params) { // 获取数据的方法
+				$scope.loading = true;
+				var pageParams = params.url();
+				pageParams.keyword = $scope.keyword;
+				$scope.tip = $scope.keyword;
+				getService().call(null, BaseService.parseParams(pageParams), function(page){
 					$scope.loading = false;
 					if(page) {
 						params.total(page.totalElement);
@@ -1943,6 +1993,12 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		// 未采纳
 		case 'refused':
 			fn = 'getRefused';break;
+		// 个人
+		case 'personal':
+			fn = 'getPersonal';break;
+		// 集体
+		case 'teams':
+		fn = 'getTeams';break;
 		}
 		return fn;
 	};

+ 4 - 0
src/main/webapp/resources/js/index/services/BaseInfo.js

@@ -355,6 +355,10 @@ define(['ngResource'], function() {
 			records: {
 				url: 'invitationrecord/records',
 				method: 'GET',
+			},
+			getRecordsByEn: {
+				url: 'invitationrecord/recordsByEn',
+				method: 'GET',
 			}
 		})
 	}]);

+ 1 - 1
src/main/webapp/resources/tpl/index/baseInfo/prodList.html

@@ -188,7 +188,7 @@
                         <a ng-bind="::product.title" ui-sref="sale.productDetail({id:product.id})" target="_self"  title="查看详情"></a>
                     </div>
                 </td>
-                <td class="hover-show text-center" ng-class="{'bg01' : product.cmpUuId != null && product.cmpCode != null , 'bg02' : product.cmpUuId == null && product.cmpCode != null , '': product.cmpCode == null}"><a href="#" title="产品型号" ng-bind="::product.cmpCode"></a></td>
+                <td class="hover-show text-center" ng-class="{'bg01' : product.cmpUuId != null && product.cmpCode != null , 'bg02' : product.cmpUuId == null && product.cmpCode != null , '': product.cmpCode == null}"><a href="http://www.usoftmall.com/product#/component/{{product.cmpUuId}}" title="产品型号" ng-bind="::product.cmpCode" ng-disabled="product.cmpUuId==null"></a></td>
                 <td class="line-h20 text-center" title="{{product.brand}}" ng-bind="::product.brand"></td>
                 <td class="text-center" title="单位" ng-bind="::product.unit"></td>
                 <td class="text-center"><a ui-sref="sale.productDetail({id:product.id})" ng-click="isProductEdit()" target="_self" title="编辑" style="position: relative;top:1px;"><i class="fa fa-lg fa-edit"></i></a>|<a ng-click="deleteById(product.id)"  title="删除"><i class="fa fa-lg fa-trash"></i></a></td>

+ 5 - 1
src/main/webapp/resources/tpl/index/baseInfo/vendorAndCustomer.html

@@ -17,7 +17,11 @@
 				</div>
 				<div class="btn-group btn-group-sm">
 					<a type="button" class="btn btn-default btn-line" ui-sref="baseInfo.invitation"
-						ng-class="{'btn-info':status=='invitation'}" style="width: 110px;">邀请注册记录</a>
+						ng-class="{'btn-info':status=='invitation'}" style="width: 110px;">个人邀请注册记录</a>
+				</div>
+				<div class="btn-group btn-group-sm">
+					<a type="button" class="btn btn-default btn-line" ui-sref="baseInfo.invitationforEn"
+						ng-class="{'btn-info':status=='invitationTeam'}" style="width: 110px;">企业邀请注册记录</a>
 				</div>
 			</div>
 		</div>

+ 1 - 1
src/main/webapp/resources/tpl/index/purc/prodList.html

@@ -189,7 +189,7 @@
                         <a ng-bind="::product.title" ui-sref="purc.productDetail({id:product.id})" target="_self"  title="查看详情"></a>
                     </div>
                 </td>
-                <td class="hover-show text-center" ng-class="{'bg01' : product.cmpUuId != null && product.cmpCode != null , 'bg02' : product.cmpUuId == null && product.cmpCode != null , '': product.cmpCode == null}"><a href="#" title="物料型号" ng-bind="::product.cmpCode"></a></td>
+                <td class="hover-show text-center" ng-class="{'bg01' : product.cmpUuId != null && product.cmpCode != null , 'bg02' : product.cmpUuId == null && product.cmpCode != null , '': product.cmpCode == null}"><a href="http://www.usoftmall.com/product#/component/{{product.cmpUuId}}" title="物料型号" ng-bind="::product.cmpCode" ng-disabled="product.cmpUuId==null"></a></td>
                 <td class="line-h20 text-center" title="{{product.brand}}" ng-bind="::product.brand"></td>
                 <td class="text-center" title="单位" ng-bind="::product.unit"></td>
                  <td class="text-center"><a ui-sref="sale.productDetail({id:product.id})" target="_self" title="编辑" style="position: relative;top:1px;"><i class="fa fa-lg fa-edit"></i></a>|<a ng-click="deleteById(product.id)"  title="删除"><i class="fa fa-lg fa-trash"></i></a></td>