Commit cc4dccc8 authored by frank.xa.zhang's avatar frank.xa.zhang

fixed shareholder structure -- frank

parent 30a6d8cd
...@@ -171,7 +171,7 @@ public class OrganizationHKController { ...@@ -171,7 +171,7 @@ public class OrganizationHKController {
return organizationHKService.deleteAttachment(attachmentId); return organizationHKService.deleteAttachment(attachmentId);
} }
// @RequestMapping(value = "getShareholders",method = RequestMethod.GET) // @RequestMapping(value = "getShareholders",method = RequestMethod.GET)
// public @ResponseBody OperationResultDto<OrgShareholdersDto> getShareholders(@RequestParam Long orgId){ // public @ResponseBody OperationResultDto<OrgShareholdersDto> getShareholders(@RequestParam Long orgId){
// logger.info("GET /api/v1/orgHK/getShareholders"); // logger.info("GET /api/v1/orgHK/getShareholders");
// return organizationHKService.getShareholders(orgId); // return organizationHKService.getShareholders(orgId);
......
...@@ -358,6 +358,12 @@ ...@@ -358,6 +358,12 @@
ownershipFormTypeList: constant.organizationHK.OwnershipForm ownershipFormTypeList: constant.organizationHK.OwnershipForm
}; };
var now = new Date(); var now = new Date();
orgHKService.getOrgsListInfo().success(function (res) {
if (res && res.result) {
$scope.investmentEntityList = res.data;
}
});
$scope.equityGridOptions = { $scope.equityGridOptions = {
bindingOptions: { bindingOptions: {
dataSource: 'shareholderDatasource' dataSource: 'shareholderDatasource'
...@@ -368,56 +374,84 @@ ...@@ -368,56 +374,84 @@
pageSize: constant.page.logPageSize pageSize: constant.page.logPageSize
}, },
pager: { pager: {
showPageSizeSelector: true, showPageSizeSelector: false,
allowedPageSizes: constant.page.pageSizeArrary, allowedPageSizes: constant.page.pageSizeArrary,
showInfo: true showInfo: true
}, },
keyExpr: "id", keyExpr: "id",
columns: [ columns: [
{ {
dataField: "investmentEntity", dataField: "investmentEntityId",
allowHeaderFiltering: false, allowHeaderFiltering: false,
caption: $translate.instant('investmentEntity'), caption: $translate.instant('investmentEntity'),
calculateDisplayValue: function (data) { calculateDisplayValue: function (data) {
// var importType1 = _.find(constant.importTypeList, function (item) { var importType1 = _.find($scope.investmentEntityList, function (item) {
// return item.value == data.importType; return item.id === data.investmentEntityId;
// }); });
// if (importType1) { if (importType1) {
// return importType1.name; return importType1.name;
// } else { } else {
// return '未知'; return '未知';
// } }
} }
}, },
{ {
dataField: "ownershipForm", dataField: "ownershipForm",
allowHeaderFiltering: false, allowHeaderFiltering: false,
caption: $translate.instant('ownershipForm'), caption: $translate.instant('ownershipForm'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.organizationHK.OwnershipForm, function (item) {
return item.id === data.ownershipForm;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}, },
{ {
dataField: "commonOrPreferred", dataField: "commonPreferred",
allowHeaderFiltering: false, allowHeaderFiltering: false,
caption: $translate.instant('commonOrPreferred'), caption: $translate.instant('commonOrPreferred'),
calculateDisplayValue: function (data) { calculateDisplayValue: function (data) {
// var importType1 = _.find(constant.importTypeList, function (item) { var importType1 = _.find(constant.organizationHK.commonOrPreferredType, function (item) {
// return item.value == data.importType; return item.id === data.commonPreferred;
// }); });
// if (importType1) { if (importType1) {
// return importType1.name; return importType1.name;
// } else { } else {
// return '未知'; return '未知';
// } }
} }
}, },
{ {
dataField: "classOfShares", dataField: "classOfShares",
allowHeaderFiltering: false, allowHeaderFiltering: false,
caption: $translate.instant('classOfShares'), caption: $translate.instant('classOfShares'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.organizationHK.classOfSharesType, function (item) {
return item.id === data.classOfShares;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}, },
{ {
dataField: "votingPercentage", dataField: "votingPercentage",
allowHeaderFiltering: false, allowHeaderFiltering: false,
caption: $translate.instant('votingPercentage'), caption: $translate.instant('votingPercentage'),
calculateDisplayValue: function (data) {
if (data.votingPercentage) {
return data.votingPercentage + "%";
}
else {
return "0%";
}
}
}, },
{ {
dataField: "id", dataField: "id",
...@@ -425,9 +459,9 @@ ...@@ -425,9 +459,9 @@
caption: $translate.instant('operation'), caption: $translate.instant('operation'),
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "editShareholder(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">modify</i>edit</button>&nbsp;&nbsp;') $('<button type="button" class="btn btn-in-grid" style="margin-top: 0px;" onclick = "editShareholder(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">edit</i>edit</button>&nbsp;&nbsp;')
.appendTo(container); .appendTo(container);
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "deleteShareholder(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>delete</button>&nbsp;&nbsp;') $('<button type="button" class="btn btn-in-grid" style="margin-top: 0px;" onclick = "deleteShareholder(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>delete</button>&nbsp;&nbsp;')
.appendTo(container); .appendTo(container);
} }
catch (e) { catch (e) {
...@@ -453,7 +487,7 @@ ...@@ -453,7 +487,7 @@
showRowLines: true, showRowLines: true,
allowColumnReordering: true, allowColumnReordering: true,
showColumnLines: true, showColumnLines: true,
rowAlternationEnabled: true, //单双行颜色 // rowAlternationEnabled: true, //单双行颜色
noDataText: $translate.instant('NoDataText'), noDataText: $translate.instant('NoDataText'),
selectAllText: $translate.instant('SelectAll'), selectAllText: $translate.instant('SelectAll'),
searchPanel: { searchPanel: {
...@@ -482,7 +516,7 @@ ...@@ -482,7 +516,7 @@
pageSize: constant.page.logPageSize pageSize: constant.page.logPageSize
}, },
pager: { pager: {
showPageSizeSelector: true, showPageSizeSelector: false,
allowedPageSizes: constant.page.pageSizeArrary, allowedPageSizes: constant.page.pageSizeArrary,
showInfo: true showInfo: true
}, },
...@@ -513,14 +547,34 @@ ...@@ -513,14 +547,34 @@
format: "yyyy-MM-dd" format: "yyyy-MM-dd"
}, },
{ {
dataField: "executive", dataField: "isExecutive",
allowHeaderFiltering: false, allowHeaderFiltering: false,
caption: $translate.instant('executive'), caption: $translate.instant('executive'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.organizationHK.executiveType, function (item) {
return item.id === data.isExecutive;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}, },
{ {
dataField: "otherRoles", dataField: "otherRoles",
allowHeaderFiltering: false, allowHeaderFiltering: false,
caption: $translate.instant('otherRoles'), caption: $translate.instant('otherRoles'),
calculateDisplayValue: function (data) {
var importType1 = _.find(constant.organizationHK.OtherRoles, function (item) {
return item.id === data.otherRoles;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
}, },
{ {
dataField: "id", dataField: "id",
...@@ -528,9 +582,9 @@ ...@@ -528,9 +582,9 @@
caption: $translate.instant('operation'), caption: $translate.instant('operation'),
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "editDirector(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">modify</i>edit</button>&nbsp;&nbsp;') $('<button type="button" class="btn btn-in-grid" style="margin-top: 0px;" onclick = "editDirector(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">edit</i>edit</button>&nbsp;&nbsp;')
.appendTo(container); .appendTo(container);
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "deleteDirector(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>delete</button>&nbsp;&nbsp;') $('<button type="button" class="btn btn-in-grid" style="margin-top: 0px;" onclick = "deleteDirector(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>delete</button>&nbsp;&nbsp;')
.appendTo(container); .appendTo(container);
} }
catch (e) { catch (e) {
...@@ -556,7 +610,7 @@ ...@@ -556,7 +610,7 @@
showRowLines: true, showRowLines: true,
allowColumnReordering: true, allowColumnReordering: true,
showColumnLines: true, showColumnLines: true,
rowAlternationEnabled: true, //单双行颜色 // rowAlternationEnabled: true, //单双行颜色
noDataText: $translate.instant('NoDataText'), noDataText: $translate.instant('NoDataText'),
selectAllText: $translate.instant('SelectAll'), selectAllText: $translate.instant('SelectAll'),
searchPanel: { searchPanel: {
...@@ -829,24 +883,24 @@ ...@@ -829,24 +883,24 @@
}; };
$scope.saveShareholder = function (shareholderEntity) { $scope.saveShareholder = function (shareholderEntity) {
var shareholder = _.filter($scope.shareholderDatasource, function (item) { var shareholder = _.find($scope.shareholderDatasource, function (item) {
return item.id === shareholderEntity.id; return item.investmentEntityId === shareholderEntity.investmentEntityId;
}); });
if (shareholder && shareholder.length > 0) { if (shareholder) {
$scope.shareholderDatasource = _.without($scope.shareholderDatasource, shareholder[0]); return "duplicated shareholder added, please change to another one.";
} }
$scope.shareholderDatasource.push(shareholderEntity); $scope.shareholderDatasource.push(shareholderEntity);
}; };
window.editShareholder = function (id) { window.editShareholder = function (id) {
console.log("editShareholder " + id); console.log("editShareholder " + id);
var shareholder = _.filter($scope.shareholderDatasource, function (item) { var shareholder = _.find($scope.shareholderDatasource, function (item) {
return item.id === id; return item.id === id;
}); });
if (shareholder && shareholder.length > 0) { if (shareholder) {
$scope.gModel.editShareholderModel = shareholder[0]; $scope.gModel.editShareholderModel = shareholder;
$scope.isShowShareholderModal = true; $scope.isShowShareholderModal = true;
} }
}; };
...@@ -854,11 +908,11 @@ ...@@ -854,11 +908,11 @@
window.deleteShareholder = function (id) { window.deleteShareholder = function (id) {
console.log("deleteShareholder " + id); console.log("deleteShareholder " + id);
var shareholder = _.filter($scope.shareholderDatasource, function (item) { var shareholder = _.find($scope.shareholderDatasource, function (item) {
return item.id === id; return item.id === id;
}); });
if (shareholder && shareholder.length > 0) { if (shareholder) {
$scope.shareholderDatasource = _.without($scope.shareholderDatasource, shareholder[0]); $scope.shareholderDatasource = _.without($scope.shareholderDatasource, shareholder);
} }
}; };
...@@ -867,35 +921,35 @@ ...@@ -867,35 +921,35 @@
}; };
$scope.saveDirector = function (directorEntity) { $scope.saveDirector = function (directorEntity) {
var director = _.filter($scope.directorDatasource, function (item) { var director = _.find($scope.directorDatasource, function (item) {
return item.id === directorEntity.id; return item.id === directorEntity.id;
}); });
if (director && director.length > 0) { if (director) {
$scope.directorDatasource = _.without($scope.directorDatasource, director[0]); $scope.directorDatasource = _.without($scope.directorDatasource, director);
} }
$scope.directorDatasource.push(directorEntity); $scope.directorDatasource.push(directorEntity);
}; };
window.editDirector = function (id) { window.editDirector = function (id) {
console.log("editDirector " + id); console.log("editDirector " + id);
var director = _.filter($scope.directorDatasource, function (item) { var director = _.find($scope.directorDatasource, function (item) {
return item.id === id; return item.id === id;
}); });
if (director && director.length > 0) { if (director) {
$scope.gModel.editDirectorModel = director[0]; $scope.gModel.editDirectorModel = director;
$scope.isShowDirectorModal = true; $scope.isShowDirectorModal = true;
} }
}; };
window.deleteDirector = function (id) { window.deleteDirector = function (id) {
console.log("deleteDirector " + id); console.log("deleteDirector " + id);
var director = _.filter($scope.directorDatasource, function (item) { var director = _.find($scope.directorDatasource, function (item) {
return item.id === id; return item.id === id;
}); });
if (director && director.length > 0) { if (director) {
$scope.directorDatasource = _.without($scope.directorDatasource, director[0]); $scope.directorDatasource = _.without($scope.directorDatasource, director);
} }
}; };
......
...@@ -192,8 +192,8 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope', ...@@ -192,8 +192,8 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope',
$scope.dropdownDatasource = { $scope.dropdownDatasource = {
// investmentEntityTypeList: [], // investmentEntityTypeList: [],
ownershipFormTypeList: constant.organizationHK.OwnershipForm, ownershipFormTypeList: constant.organizationHK.OwnershipForm,
commonOrPreferredTypeList: [{id: "1", name: 'Commmon'}, {id: "2", name: 'Preferred'}], commonOrPreferredTypeList: constant.organizationHK.commonOrPreferredType,
classOfSharesTypeList: [{id: "1", name: 'A'}, {id: "2", name: 'B'}] classOfSharesTypeList: constant.organizationHK.classOfSharesType
}; };
orgHKService.getOrgsListInfo().success(function (res) { orgHKService.getOrgsListInfo().success(function (res) {
if (res && res.result) { if (res && res.result) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment