Browse Source

企业圈修改

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@9410 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
dongbw 8 years ago
parent
commit
8252fd50be

+ 9 - 0
src/main/java/com/uas/platform/b2b/service/impl/InvitationRecordServiceImpl.java

@@ -65,9 +65,18 @@ public class InvitationRecordServiceImpl implements InvitationRecordService {
 				+ SystemSession.getUser().getEnterprise().getEnName() + ")");
 		// 先判断记录
 		InvitationRecord oldrecord = invitationRecordDao.findByUseruuAndVendname(useruu, record.getVendname());
+		if (record.getId() != null) { // 如果是已存在的,直接替换
+			oldrecord = invitationRecordDao.findOne(record.getId());
+		}
 		if (oldrecord != null) {
 			oldrecord.setCount(oldrecord.getCount() + 1);
 			oldrecord.setDate(new Date());
+			if (record.getVendname() != null) {
+				oldrecord.setVendname(record.getVendname());
+			}
+			if (record.getVendusername() != null) {
+				oldrecord.setVendusername(record.getVendusername());
+			}
 			if (record.getVendusertel() != null) {
 				oldrecord.setVendusertel(record.getVendusertel().trim());
 			}

+ 2 - 0
src/main/webapp/resources/js/index/app.js

@@ -1223,6 +1223,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
                 InvitationRecord.invite({formStore: data}, {}, function(data) {
                     if(data.success) {
                         toaster.pop('success', '提示', data.success);
+                        $scope.tableParams.reload();
                     }
                     if(data.error) {
                         toaster.pop('error', '提示', data.error);
@@ -15550,6 +15551,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 				InvitationRecord.invite({formStore: data}, {}, function(data) {
 					if(data.success) {
 						toaster.pop('success', '提示', data.success);
+                        $scope.tableParams.reload();
 					}
 					if(data.error) {
 						toaster.pop('error', '提示', data.error);

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

@@ -133,7 +133,7 @@
 				<div class="col-xs-9">
 					<div class="search">
 						<div class="form-group form-group-sm has-feedback" dropdown auto-close="outsideClick" on-toggle="searchAdvance=open">
-							<input type="search" class="form-control input-sm" ng-model="keyword" ng-search="onSearch()" placeholder="输入企业名称、邀请人进行搜索" />
+							<input type="search" ng-if="active == 'invitation'" class="form-control input-sm" ng-model="keyword" ng-search="onSearch()" placeholder="输入企业名称、联系人、邀请人进行搜索" />
 							<a class="btn input-group-addon" ng-click="onSearch()">搜索</a>
 						</div>
 					</div>