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 {
return organizationHKService.deleteAttachment(attachmentId);
}
// @RequestMapping(value = "getShareholders",method = RequestMethod.GET)
// @RequestMapping(value = "getShareholders",method = RequestMethod.GET)
// public @ResponseBody OperationResultDto<OrgShareholdersDto> getShareholders(@RequestParam Long orgId){
// logger.info("GET /api/v1/orgHK/getShareholders");
// return organizationHKService.getShareholders(orgId);
......
......@@ -358,6 +358,12 @@
ownershipFormTypeList: constant.organizationHK.OwnershipForm
};
var now = new Date();
orgHKService.getOrgsListInfo().success(function (res) {
if (res && res.result) {
$scope.investmentEntityList = res.data;
}
});
$scope.equityGridOptions = {
bindingOptions: {
dataSource: 'shareholderDatasource'
......@@ -368,56 +374,84 @@
pageSize: constant.page.logPageSize
},
pager: {
showPageSizeSelector: true,
showPageSizeSelector: false,
allowedPageSizes: constant.page.pageSizeArrary,
showInfo: true
},
keyExpr: "id",
columns: [
{
dataField: "investmentEntity",
dataField: "investmentEntityId",
allowHeaderFiltering: false,
caption: $translate.instant('investmentEntity'),
calculateDisplayValue: function (data) {
// var importType1 = _.find(constant.importTypeList, function (item) {
// return item.value == data.importType;
// });
// if (importType1) {
// return importType1.name;
// } else {
// return '未知';
// }
var importType1 = _.find($scope.investmentEntityList, function (item) {
return item.id === data.investmentEntityId;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
},
{
dataField: "ownershipForm",
allowHeaderFiltering: false,
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,
caption: $translate.instant('commonOrPreferred'),
calculateDisplayValue: function (data) {
// var importType1 = _.find(constant.importTypeList, function (item) {
// return item.value == data.importType;
// });
// if (importType1) {
// return importType1.name;
// } else {
// return '未知';
// }
var importType1 = _.find(constant.organizationHK.commonOrPreferredType, function (item) {
return item.id === data.commonPreferred;
});
if (importType1) {
return importType1.name;
} else {
return '未知';
}
}
},
{
dataField: "classOfShares",
allowHeaderFiltering: false,
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",
allowHeaderFiltering: false,
caption: $translate.instant('votingPercentage'),
calculateDisplayValue: function (data) {
if (data.votingPercentage) {
return data.votingPercentage + "%";
}
else {
return "0%";
}
}
},
{
dataField: "id",
......@@ -425,9 +459,9 @@
caption: $translate.instant('operation'),
cellTemplate: function (container, options) {
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);
$('<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);
}
catch (e) {
......@@ -453,7 +487,7 @@
showRowLines: true,
allowColumnReordering: true,
showColumnLines: true,
rowAlternationEnabled: true, //单双行颜色
// rowAlternationEnabled: true, //单双行颜色
noDataText: $translate.instant('NoDataText'),
selectAllText: $translate.instant('SelectAll'),
searchPanel: {
......@@ -482,7 +516,7 @@
pageSize: constant.page.logPageSize
},
pager: {
showPageSizeSelector: true,
showPageSizeSelector: false,
allowedPageSizes: constant.page.pageSizeArrary,
showInfo: true
},
......@@ -513,14 +547,34 @@
format: "yyyy-MM-dd"
},
{
dataField: "executive",
dataField: "isExecutive",
allowHeaderFiltering: false,
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",
allowHeaderFiltering: false,
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",
......@@ -528,9 +582,9 @@
caption: $translate.instant('operation'),
cellTemplate: function (container, options) {
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);
$('<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);
}
catch (e) {
......@@ -556,7 +610,7 @@
showRowLines: true,
allowColumnReordering: true,
showColumnLines: true,
rowAlternationEnabled: true, //单双行颜色
// rowAlternationEnabled: true, //单双行颜色
noDataText: $translate.instant('NoDataText'),
selectAllText: $translate.instant('SelectAll'),
searchPanel: {
......@@ -829,24 +883,24 @@
};
$scope.saveShareholder = function (shareholderEntity) {
var shareholder = _.filter($scope.shareholderDatasource, function (item) {
return item.id === shareholderEntity.id;
var shareholder = _.find($scope.shareholderDatasource, function (item) {
return item.investmentEntityId === shareholderEntity.investmentEntityId;
});
if (shareholder && shareholder.length > 0) {
$scope.shareholderDatasource = _.without($scope.shareholderDatasource, shareholder[0]);
if (shareholder) {
return "duplicated shareholder added, please change to another one.";
}
$scope.shareholderDatasource.push(shareholderEntity);
};
window.editShareholder = function (id) {
console.log("editShareholder " + id);
var shareholder = _.filter($scope.shareholderDatasource, function (item) {
var shareholder = _.find($scope.shareholderDatasource, function (item) {
return item.id === id;
});
if (shareholder && shareholder.length > 0) {
$scope.gModel.editShareholderModel = shareholder[0];
if (shareholder) {
$scope.gModel.editShareholderModel = shareholder;
$scope.isShowShareholderModal = true;
}
};
......@@ -854,11 +908,11 @@
window.deleteShareholder = function (id) {
console.log("deleteShareholder " + id);
var shareholder = _.filter($scope.shareholderDatasource, function (item) {
var shareholder = _.find($scope.shareholderDatasource, function (item) {
return item.id === id;
});
if (shareholder && shareholder.length > 0) {
$scope.shareholderDatasource = _.without($scope.shareholderDatasource, shareholder[0]);
if (shareholder) {
$scope.shareholderDatasource = _.without($scope.shareholderDatasource, shareholder);
}
};
......@@ -867,35 +921,35 @@
};
$scope.saveDirector = function (directorEntity) {
var director = _.filter($scope.directorDatasource, function (item) {
var director = _.find($scope.directorDatasource, function (item) {
return item.id === directorEntity.id;
});
if (director && director.length > 0) {
$scope.directorDatasource = _.without($scope.directorDatasource, director[0]);
if (director) {
$scope.directorDatasource = _.without($scope.directorDatasource, director);
}
$scope.directorDatasource.push(directorEntity);
};
window.editDirector = function (id) {
console.log("editDirector " + id);
var director = _.filter($scope.directorDatasource, function (item) {
var director = _.find($scope.directorDatasource, function (item) {
return item.id === id;
});
if (director && director.length > 0) {
$scope.gModel.editDirectorModel = director[0];
if (director) {
$scope.gModel.editDirectorModel = director;
$scope.isShowDirectorModal = true;
}
};
window.deleteDirector = function (id) {
console.log("deleteDirector " + id);
var director = _.filter($scope.directorDatasource, function (item) {
var director = _.find($scope.directorDatasource, function (item) {
return item.id === id;
});
if (director && director.length > 0) {
$scope.directorDatasource = _.without($scope.directorDatasource, director[0]);
if (director) {
$scope.directorDatasource = _.without($scope.directorDatasource, director);
}
};
......
......@@ -192,8 +192,8 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope',
$scope.dropdownDatasource = {
// investmentEntityTypeList: [],
ownershipFormTypeList: constant.organizationHK.OwnershipForm,
commonOrPreferredTypeList: [{id: "1", name: 'Commmon'}, {id: "2", name: 'Preferred'}],
classOfSharesTypeList: [{id: "1", name: 'A'}, {id: "2", name: 'B'}]
commonOrPreferredTypeList: constant.organizationHK.commonOrPreferredType,
classOfSharesTypeList: constant.organizationHK.classOfSharesType
};
orgHKService.getOrgsListInfo().success(function (res) {
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