Commit 486c2277 authored by frank.xa.zhang's avatar frank.xa.zhang

add modified function for org and director and shareholder -- frank

parent d1ff2b67
......@@ -6,9 +6,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.navtree.NavTreeDto;
import pwc.taxtech.atms.organization.dpo.OrganizationDirectorDto;
import pwc.taxtech.atms.organization.dpo.OrganizationHKDto;
import pwc.taxtech.atms.organization.dpo.OrganizationShareholderDto;
import pwc.taxtech.atms.organization.entity.OrganizationDirector;
import pwc.taxtech.atms.organization.entity.OrganizationHK;
import pwc.taxtech.atms.organization.entity.OrganizationShareholder;
import pwc.taxtech.atms.service.impl.OrganizationHKServiceImpl;
......@@ -25,7 +26,7 @@ public class OrganizationHKController {
@RequestMapping(value = "getOrgInfoList", method = RequestMethod.GET)
public @ResponseBody
List<OrganizationHK> getOrgInfoList() {
List<OrganizationHKDto> getOrgInfoList() {
logger.info("GET /api/v1/orgHK/getOrgInfoList");
return organizationHKService.getOrgInfo();
}
......@@ -99,4 +100,16 @@ public class OrganizationHKController {
logger.info("PUT /api/v1/orgHK/updateShareholder");
return organizationHKService.updateShareholder(organizationShareholder);
}
@RequestMapping(value = "updateDirectors" ,method=RequestMethod.POST)
public @ResponseBody OperationResultDto<Object> updateDirectors(@RequestBody List<OrganizationDirectorDto> organizationDirectorDtos){
logger.info("POST /api/v1/orgHK/updateDirectors");
return organizationHKService.updateDirectors(organizationDirectorDtos);
}
@RequestMapping(value = "updateShareholders" ,method=RequestMethod.POST)
public @ResponseBody OperationResultDto<Object> updateShareholders(@RequestBody List<OrganizationShareholderDto> organizationShareholderDtos){
logger.info("POST /api/v1/orgHK/updateShareholders");
return organizationHKService.updateShareholders(organizationShareholderDtos);
}
}
......@@ -20,14 +20,16 @@ import pwc.taxtech.atms.entity.ServiceType;
import pwc.taxtech.atms.organization.dao.OrganizationDirectorMapper;
import pwc.taxtech.atms.organization.dao.OrganizationHKMapper;
import pwc.taxtech.atms.organization.dao.OrganizationShareholderMapper;
import pwc.taxtech.atms.organization.dpo.OrganizationDirectorDto;
import pwc.taxtech.atms.organization.dpo.OrganizationHKDto;
import pwc.taxtech.atms.organization.entity.OrganizationDirector;
import pwc.taxtech.atms.organization.entity.OrganizationHK;
import pwc.taxtech.atms.organization.entity.OrganizationHKExample;
import pwc.taxtech.atms.organization.entity.OrganizationShareholder;
import pwc.taxtech.atms.organization.dpo.OrganizationShareholderDto;
import pwc.taxtech.atms.organization.entity.*;
import javax.annotation.Resource;
import java.util.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import static pwc.taxtech.atms.common.CommonConstants.SystemError;
......@@ -58,8 +60,20 @@ public class OrganizationHKServiceImpl {
@Autowired
private BeanUtil beanUtil;
public List<OrganizationHK> getOrgInfo() {
return organizationHKMapper.selectByExample(null);
public List<OrganizationHKDto> getOrgInfo() {
List<OrganizationHKDto> organizationHKDtos = new ArrayList<>();
List<OrganizationHK> organizationHKS = organizationHKMapper.selectByExample(null);
List<OrganizationShareholder> organizationShareholders = organizationShareholderMapper.selectByExample(null);
List<OrganizationDirector> organizationDirectors = organizationDirectorMapper.selectByExample(null);
organizationHKS.forEach(a -> {
OrganizationHKDto organizationHKDto = CommonUtils.copyProperties(a, new OrganizationHKDto());
List<OrganizationShareholderDto> tempShareholders = organizationShareholders.stream().filter(b -> b.getEntityId().equals(a.getId())).map(b -> CommonUtils.copyProperties(b, new OrganizationShareholderDto())).collect(Collectors.toList());
List<OrganizationDirectorDto> tempDirectors = organizationDirectors.stream().filter(c -> c.getEntityId().equals(a.getId())).map(c -> CommonUtils.copyProperties(c, new OrganizationDirectorDto())).collect(Collectors.toList());
organizationHKDto.setShareholders(tempShareholders);
organizationHKDto.setDirectors(tempDirectors);
organizationHKDtos.add(organizationHKDto);
});
return organizationHKDtos;
}
public OperationResultDto enableOrgs(Long orgId) {
......@@ -128,7 +142,7 @@ public class OrganizationHKServiceImpl {
orgOriginal = CommonUtils.copyProperties(org, orgOriginal);
// code唯一验证
beanUtil.copyProperties(orgDto, org);
CommonUtils.copyProperties(orgDto, org);
org.setUpdateTime(new Date());
OrganizationHK orgUpdate = org;
organizationHKMapper.updateByPrimaryKeySelective(org);
......@@ -238,14 +252,22 @@ public class OrganizationHKServiceImpl {
Assert.notNull(result,
"result is null");
result.setLevel(result.getLevel() == null ? 0 : result.getLevel());
if (result.getParentId() == 0) {
// if (result.getParentId() == 0) {
result.setParentName("");
} else {
OrganizationHK tParent = organizationHKMapper.selectByExample(null).stream()
.filter(sa -> Objects.equals(sa.getId(), result.getParentId())).findFirst().orElse(null);
Assert.notNull(tParent, "tParent is null");
result.setParentName(tParent.getName());
}
// } else {
// OrganizationHK tParent = organizationHKMapper.selectByExample(null).stream()
// .filter(sa -> Objects.equals(sa.getId(), result.getParentId())).findFirst().orElse(null);
// Assert.notNull(tParent, "tParent is null");
// result.setParentName(tParent.getName());
// }
OrganizationShareholderExample shareholderExample = new OrganizationShareholderExample();
shareholderExample.createCriteria().andEntityIdEqualTo(orgId);
List<OrganizationShareholderDto> organizationShareholderDtos = organizationShareholderMapper.selectByExample(shareholderExample).stream().map(a -> CommonUtils.copyProperties(a, new OrganizationShareholderDto())).collect(Collectors.toList());
OrganizationDirectorExample directorExample = new OrganizationDirectorExample();
directorExample.createCriteria().andEntityIdEqualTo(orgId);
List<OrganizationDirectorDto> organizationDirectorDtos = organizationDirectorMapper.selectByExample(directorExample).stream().map(a -> CommonUtils.copyProperties(a, new OrganizationDirectorDto())).collect(Collectors.toList());
result.setDirectors(organizationDirectorDtos);
result.setShareholders(organizationShareholderDtos);
return result;
}
......@@ -264,7 +286,7 @@ public class OrganizationHKServiceImpl {
org.setUpdateTime(now);
if (orgDto.getDirectors() != null && orgDto.getDirectors().size() > 0) {
orgDto.getDirectors().forEach(a -> {
OrganizationDirector organizationDirector = beanUtil.copyProperties(a, new OrganizationDirector());
OrganizationDirector organizationDirector = CommonUtils.copyProperties(a, new OrganizationDirector());
organizationDirector.setUpdateTime(now);
organizationDirector.setCreateTime(now);
organizationDirector.setEntityId(org.getId());
......@@ -274,7 +296,7 @@ public class OrganizationHKServiceImpl {
}
if (orgDto.getShareholders() != null && orgDto.getShareholders().size() > 0) {
orgDto.getShareholders().forEach(a -> {
OrganizationShareholder organizationShareholder = beanUtil.copyProperties(a, new OrganizationShareholder());
OrganizationShareholder organizationShareholder = CommonUtils.copyProperties(a, new OrganizationShareholder());
organizationShareholder.setId(distributedIdService.nextId());
organizationShareholder.setInvestmentEntityId(0L);
organizationShareholder.setEntityId(org.getId());
......@@ -392,4 +414,59 @@ public class OrganizationHKServiceImpl {
OrganizationDirector organizationDirector = organizationDirectorMapper.selectByPrimaryKey(organizationDirectorId);
return organizationDirector != null;
}
public OperationResultDto<Object> updateDirectors(List<OrganizationDirectorDto> organizationDirectorDtos) {
OperationResultDto<Object> resultDto = new OperationResultDto<>();
organizationDirectorDtos.forEach(a -> {
OrganizationDirector organizationDirector;
try {
organizationDirector = CommonUtils.copyProperties(a, new OrganizationDirector());
} catch (Exception ex) {
organizationDirector = new OrganizationDirector();
organizationDirector.setDirectorName(a.getDirectorName());
organizationDirector.setDateOfAppointment(new Date(a.getDateOfAppointment()));
organizationDirector.setDateOfResignation(new Date(a.getDateOfResignation()));
organizationDirector.setResidency(a.getResidency());
organizationDirector.setEntityId(Long.valueOf(a.getEntityId()));
}
if (organizationDirector.getId() != null) {
organizationDirectorMapper.deleteByPrimaryKey(organizationDirector.getId());
}
Date now = new Date();
organizationDirector.setId(distributedIdService.nextId());
organizationDirector.setCreateTime(now);
organizationDirector.setUpdateTime(now);
organizationDirectorMapper.insertSelective(organizationDirector);
});
resultDto.setResult(true);
return resultDto;
}
public OperationResultDto<Object> updateShareholders(List<OrganizationShareholderDto> organizationShareholderDtos) {
OperationResultDto<Object> resultDto = new OperationResultDto<>();
organizationShareholderDtos.forEach(a -> {
OrganizationShareholder organizationShareholder;
try {
organizationShareholder = CommonUtils.copyProperties(a, new OrganizationShareholder());
} catch (Exception ex) {
organizationShareholder = new OrganizationShareholder();
organizationShareholder.setEntityId(Long.valueOf(a.getEntityId()));
// organizationShareholder.setClassOfShares(Byte.valueOf(a.getClassOfShares()));
// organizationShareholder.setInvestmentEntityId(Long.valueOf(a.getInvestmentEntityId()));
// organizationShareholder.setCommonPreferred(Boolean.valueOf(a.getCommonPreferred()));
// organizationShareholder.setOwnershipForm(Byte.valueOf(a.getOwnershipForm()));
organizationShareholder.setVotingPercentage(a.getVotingPercentage());
}
if (organizationShareholder.getId() != null) {
organizationShareholderMapper.deleteByPrimaryKey(organizationShareholder.getId());
}
organizationShareholder.setId(distributedIdService.nextId());
Date now = new Date();
organizationShareholder.setUpdateTime(now);
organizationShareholder.setCreateTime(now);
organizationShareholderMapper.insertSelective(organizationShareholder);
});
resultDto.setResult(true);
return resultDto;
}
}
......@@ -123,23 +123,12 @@
var getOrgList = function () {
orgHKService.getOrgInfoList().success(function (data) {
if (data) {
//data.forEach(function (row) {
// if (row.userList) {
// row.userListStr = _.map(row.userList, function (x) { return x.userName; }).join(constant.comma);
// }
//});
// console.log("dat:" + JSON.stringify(data));
if (loginContext.userName && loginContext.userName.toLowerCase() === "simon") {
data = _.filter(data, function (row) {
return row && row.industryID === "10";
});
}
initPagingControl(data.length);
$scope.DataGridSource = data;
$scope.orgUserGridInstance.repaint();
$scope.orgUserGridInstance.refresh();
// console.log($scope.DataGridSource);
// console.log($scope.orgUserGridOptions);
// $scope.shareholderDatasource = data.shareholders;
// $scope.directorDatasource = data.directors;
$scope.oldData = angular.copy(data);
$scope.setGridHeight();
}
......@@ -248,6 +237,7 @@
$scope.isAdd = false;
$scope.orgOperateType = constant.Operation.Edit;
$scope.selectedOrg = $scope.selectCompany;
$scope.showEditModal = true;
};
// 取消编辑机构其他信息
......@@ -333,6 +323,10 @@
$scope.selectNodeCount++;
$scope.selectCompany = data;
$scope.selectCompany.isActiveStr = $translate.instant(isActiveMap[$scope.selectCompany.isActive]);
$scope.directorDatasource = data.directors;
$scope.shareholderDatasource = data.shareholders;
$scope.selectCompany.suborgList = suborgList;
$scope.backups = {};
$scope.backups.enterpriseAccountSetOrgList = angular.copy($scope.selectCompany.enterpriseAccountSetOrgList);
......@@ -556,7 +550,7 @@
bindingOptions: {
dataSource: 'DataGridSource'
},
height:770,
height: 770,
showBorders: true,
paging: {
pageSize: constant.page.logPageSize
......@@ -694,6 +688,8 @@
$scope.showOrgs = false;
console.log(org);
$scope.selectCompany = org;
$scope.shareholderDatasource = org.shareholders;
$scope.directorDatasource = org.directors;
$scope.showSingle = true;
};
......@@ -716,6 +712,310 @@
getOrgList();
};
$scope.addEquity = function () {
$scope.isShowShareholderModal2 = true;
};
$scope.addDirector = function () {
$scope.isShowDirectorModal2 = true;
};
$scope.directorGridOptions = {
bindingOptions: {
dataSource: 'directorDatasource'
},
height: 160,
showBorders: true,
paging: {
pageSize: constant.page.logPageSize
},
pager: {
showPageSizeSelector: true,
allowedPageSizes: constant.page.pageSizeArrary,
showInfo: true
},
keyExpr: "id",
columns: [
{
dataField: "directorName",
allowHeaderFiltering: false,
caption: $translate.instant('directorName')
},
{
dataField: "residency",
allowHeaderFiltering: false,
caption: $translate.instant('residency'),
},
{
dataField: "dateOfAppointment",
allowHeaderFiltering: false,
caption: $translate.instant('dateOfAppointment'),
dataType: "date",
format: "yyyy-MM-dd"
},
{
dataField: "dateOfResignation",
allowHeaderFiltering: false,
caption: $translate.instant('dateOfResignation'),
dataType: "date",
format: "yyyy-MM-dd"
},
{
dataField: "executive",
allowHeaderFiltering: false,
caption: $translate.instant('executive'),
},
{
dataField: "otherRoles",
allowHeaderFiltering: false,
caption: $translate.instant('otherRoles'),
},
{
dataField: "id",
allowHeaderFiltering: false,
caption: $translate.instant('operation'),
cellTemplate: function (container, options) {
try {
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "editDirector2(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">modify</i>edit</button>&nbsp;&nbsp;')
.appendTo(container);
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "deleteDirector2(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>delete</button>&nbsp;&nbsp;')
.appendTo(container);
}
catch (e) {
$log.error(e);
}
}
}
],
onContentReady: function (e) {
$scope.directorGridInstance = e.component;
},
loadPanel: {
enabled: false
},
selection: {
mode: "single"
},
grouping: {
autoExpandAll: false
},
allowColumnResizing: true,
columnAutoWidth: true,
showRowLines: true,
allowColumnReordering: true,
showColumnLines: true,
rowAlternationEnabled: true, //单双行颜色
noDataText: $translate.instant('NoDataText'),
selectAllText: $translate.instant('SelectAll'),
searchPanel: {
placeholder: $translate.instant('Search'),
width: 518,
visible: false
},
headerFilter: {
visible: false,
texts: {
cancel: $translate.instant('Cancel'),
ok: $translate.instant('Confirm'),
emptyValue: $translate.instant('Empty'),
selectAllText: $translate.instant('SelectAll')
}
}
};
$scope.equityGridOptions = {
bindingOptions: {
dataSource: 'shareholderDatasource'
},
height: 150,
showBorders: true,
paging: {
pageSize: constant.page.logPageSize
},
pager: {
showPageSizeSelector: true,
allowedPageSizes: constant.page.pageSizeArrary,
showInfo: true
},
keyExpr: "id",
columns: [
{
dataField: "investmentEntity",
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 '未知';
// }
}
},
{
dataField: "ownershipForm",
allowHeaderFiltering: false,
caption: $translate.instant('ownershipForm'),
},
{
dataField: "commonOrPreferred",
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 '未知';
// }
}
},
{
dataField: "classOfShares",
allowHeaderFiltering: false,
caption: $translate.instant('classOfShares'),
},
{
dataField: "votingPercentage",
allowHeaderFiltering: false,
caption: $translate.instant('votingPercentage'),
},
{
dataField: "id",
allowHeaderFiltering: false,
caption: $translate.instant('operation'),
cellTemplate: function (container, options) {
try {
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "editShareholder2(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">modify</i>edit</button>&nbsp;&nbsp;')
.appendTo(container);
$('<button type="button" class="btn btn-in-grid" style="margin-top: -11px;" onclick = "deleteShareholder2(\'' + options.data.id + '\')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>delete</button>&nbsp;&nbsp;')
.appendTo(container);
}
catch (e) {
$log.error(e);
}
}
}
],
onContentReady: function (e) {
$scope.shareholderGridInstance = e.component;
},
loadPanel: {
enabled: false
},
selection: {
mode: "single"
},
grouping: {
autoExpandAll: false
},
allowColumnResizing: true,
columnAutoWidth: true,
showRowLines: true,
allowColumnReordering: true,
showColumnLines: true,
rowAlternationEnabled: true, //单双行颜色
noDataText: $translate.instant('NoDataText'),
selectAllText: $translate.instant('SelectAll'),
searchPanel: {
placeholder: $translate.instant('Search'),
width: 518,
visible: false
},
headerFilter: {
visible: false,
texts: {
cancel: $translate.instant('Cancel'),
ok: $translate.instant('Confirm'),
emptyValue: $translate.instant('Empty'),
selectAllText: $translate.instant('SelectAll')
}
}
};
$scope.closeSharehoder2 = function () {
$scope.isShowShareholderModal2 = false;
};
$scope.saveShareholder2 = function (shareholderEntity) {
var shareholder = _.filter($scope.shareholderDatasource, function (item) {
return item.id === shareholderEntity.id;
});
if (shareholder && shareholder.length > 0) {
$scope.shareholderDatasource = _.without($scope.shareholderDatasource, shareholder[0]);
}
$scope.shareholderDatasource.push(shareholderEntity);
orgHKService.updateShareholders($scope.shareholderDatasource);
};
window.editShareholder2 = function (id) {
console.log("editShareholder " + id);
var shareholder = _.filter($scope.shareholderDatasource, function (item) {
return item.id === id;
});
if (shareholder && shareholder.length > 0) {
$scope.gModel.editShareholderModel = shareholder[0];
$scope.isShowShareholderModal2 = true;
}
};
window.deleteShareholder2 = function (id) {
console.log("deleteShareholder " + id);
var shareholder = _.filter($scope.shareholderDatasource, function (item) {
return item.id === id;
});
if (shareholder && shareholder.length > 0) {
$scope.shareholderDatasource = _.without($scope.shareholderDatasource, shareholder[0]);
}
};
$scope.closeDirector2 = function () {
$scope.isShowDirectorModal2 = false;
};
$scope.saveDirector2 = function (directorEntity) {
var director = _.filter($scope.directorDatasource, function (item) {
return item.id === directorEntity.id;
});
if (director && director.length > 0) {
$scope.directorDatasource = _.without($scope.directorDatasource, director[0]);
}
$scope.directorDatasource.push(directorEntity);
orgHKService.updateDirectors($scope.directorDatasource);
};
window.editDirector2 = function (id) {
console.log("editDirector " + id);
var director = _.filter($scope.directorDatasource, function (item) {
return item.id === id;
});
if (director && director.length > 0) {
$scope.gModel.editDirectorModel = director[0];
$scope.isShowDirectorModal2 = true;
}
};
window.deleteDirector2 = function (id) {
console.log("deleteDirector " + id);
var director = _.filter($scope.directorDatasource, function (item) {
return item.id === id;
});
if (director && director.length > 0) {
$scope.directorDatasource = _.without($scope.directorDatasource, director[0]);
}
};
(function initialize() {
$log.debug('organizationManageController.ctor()...');
$scope.title = $translate.instant('OrganizationManageTitle');
......
......@@ -106,7 +106,7 @@
{{'ChartInfo' | translate}}
</md-nav-item>
</md-nav-bar>
<div class="ext-content">
<div class="ext-content" style="height:535px;margin-top: 10px">
<div ng-show="currentNavItem==='page1'" class="org-basic-data-table">
<div class="basic-org-info-wrapper">
<div class="right-option">
......@@ -326,8 +326,8 @@
</div>
<!--Direcotr information-->
<div class="label-director">
<label class="basic-label" style="font-weight: bold;font-size: large;">{{'DirectorInfo' | translate}}</label>
<div class="label-director" style="height: 54px;">
<label class="basic-label" style="font-weight: bold;font-size: large;margin-top: 33px">{{'DirectorInfo' | translate}}</label>
</div>
<div class="right-option">
<button type="button" class="btn btn-in-grid" style="width: 117px;"
......@@ -385,10 +385,9 @@
</div>
<operate-log is-show="isShowLog"></operate-log>
<edit-organization-modal is-show="showEditModal" parent-page=".system-manage" operate-type="orgOperateType" is-update="isOrgUpdate"
selected-organization="selectedOrg" dimension-id="showAttributeDimensionID"></edit-organization-modal>
<!--<edit-organization-shareholder-modal is-show-s="isShowShareholderModal2" parent-page=".system-manage" edit-model=""></edit-organization-shareholder-modal>-->
<!--<edit-organization-director-modal is-show-d="isShowDirectorModal2" parent-page=".system-manage" edit-model=""></edit-organization-director-modal>-->
<edit-organization-modal is-show="showEditModal" parent-page=".system-manage" operate-type="orgOperateType" is-update="isOrgUpdate" selected-organization="selectedOrg"></edit-organization-modal>
<edit-organization-shareholder-modal is-show-s="isShowShareholderModal2" parent-page=".system-manage" edit-model-s="gModel.editShareholderModel" on-close="closeSharehoder2()" on-save="saveShareholder2(shareholderEntity)"></edit-organization-shareholder-modal>
<edit-organization-director-modal is-show-d="isShowDirectorModal2" parent-page=".system-manage" edit-model-d="gModel.editDirectorModel" on-close="closeDirector2()" on-save="saveDirector2(directorEntity)"></edit-organization-director-modal>
<!--<edit-equity-modal operate-type="equityEditOperateType" is-update="isEquityUpdate"-->
<!--selected-organization="selectedOrg"></edit-equity-modal>-->
<!--<edit-equity-change-modal operate-type="equityChangeOperateType" is-update="isEquityChange"-->
......
......@@ -178,8 +178,10 @@ commonModule.controller('editOrganizationDirectorModalController', ['$scope', '$
initWatches: function () {
$scope.$watch('isShowD', function (newValue) {
if (newValue) {
if($scope.$parent.$parent.gModel) {
console.log($scope.$parent.$parent.gModel.editDirectorModel);
$scope.editModelD= $scope.$parent.$parent.gModel.editDirectorModel;
$scope.editModelD = $scope.$parent.$parent.gModel.editDirectorModel;
}
$scope.modalManage.directorModal.open();
}
});
......
......@@ -163,12 +163,12 @@
refreshOrg();
$scope.isShowBasic = false;
$scope.orgControlForm.$setPristine();
// $scope.orgControlForm.$setPristine();
if (!orgId) {
orgId = $scope.selectCompany.id;
}
$("#selectedOrgName-error").hide();
// $("#selectedOrgName-error").hide();
$scope.isAdd = false;
$scope.orgHasAccountMapping = false;
orgHKService.getSingleOrg(orgId).success(function (orgData) {
......@@ -288,9 +288,9 @@
// add
newOrg();
} else if (newValue == constant.Operation.Edit) {
if ($scope.selectedOrganization) {
loadOrg($scope.selectedOrganization.id);
}
// if ($scope.selectedOrganization) {
// loadOrg($scope.selectedOrganization.id);
// }
}
}
});
......@@ -362,7 +362,7 @@
bindingOptions: {
dataSource: 'shareholderDatasource'
},
height:150,
height: 150,
showBorders: true,
paging: {
pageSize: constant.page.logPageSize
......@@ -476,7 +476,7 @@
bindingOptions: {
dataSource: 'directorDatasource'
},
height:160,
height: 160,
showBorders: true,
paging: {
pageSize: constant.page.logPageSize
......@@ -596,7 +596,7 @@
value: 'editOrgModel.legalForm'
},
onSelectionChanged: function (args) {
$scope.editOrgModel.legalForm = args.selectedItem.id;
// $scope.editOrgModel.legalForm = args.selectedItem.id;
},
itemTemplate: function (itemData, itemIndex, itemElement) {
var span = $('<span title="' + itemData.name + '">').text(itemData.name);
......@@ -647,7 +647,7 @@
value: 'editOrgModel.entityLevel'
},
onSelectionChanged: function (args) {
$scope.editOrgModel.entityLevel = args.selectedItem.id;
// $scope.editOrgModel.entityLevel = args.selectedItem.id;
},
itemTemplate: function (itemData, itemIndex, itemElement) {
var span = $('<span title="' + itemData.name + '">').text(itemData.name);
......@@ -663,7 +663,7 @@
value: 'editOrgModel.jurisdictionOfFormation'
},
onSelectionChanged: function (args) {
$scope.editOrgModel.jurisdictionOfFormation = args.selectedItem.id;
// $scope.editOrgModel.jurisdictionOfFormation = args.selectedItem.id;
},
itemTemplate: function (itemData, itemIndex, itemElement) {
var span = $('<span title="' + itemData.name + '">').text(itemData.name);
......@@ -693,7 +693,7 @@
value: 'editOrgModel.ownershipFormType'
},
onSelectionChanged: function (args) {
$scope.editOrgModel.ownershipFormType = args.selectedItem.id;
// $scope.editOrgModel.ownershipFormType = args.selectedItem.id;
},
itemTemplate: function (itemData, itemIndex, itemElement) {
var span = $('<span title="' + itemData.name + '">').text(itemData.name);
......@@ -926,11 +926,17 @@
$scope.$watch('isShow', function (newValue, oldValue) {
if (newValue) {
$scope.modalManage.editOrgModal.open();
if ($scope.isAdd) {
$scope.editOrgModel = {};
$scope.selectCompany = {};
$scope.directorDatasource = [];
$scope.shareholderDatasource = [];
}
else {
$scope.editOrgModel = $scope.selectedOrganization;
$scope.selectCompany = $scope.selectedOrganization;
}
}
});
(function initialize() {
......@@ -940,4 +946,5 @@
initParams();
})();
}
]);
])
;
......@@ -175,10 +175,13 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope',
},
initWatches: function () {
$scope.$watch('isShowS', function (newValue, oldValue) {
$scope.$watch('isShowS', function (newValue) {
if (newValue) {
if ($scope.$parent.$parent.gModel) {
console.log($scope.$parent.$parent.gModel.editShareholderModel);
$scope.editModelS= $scope.$parent.$parent.gModel.editShareholderModel;
$scope.editModelS = $scope.$parent.$parent.gModel.editShareholderModel;
}
$scope.modalManage.shareholderModal.open();
}
});
......@@ -187,7 +190,7 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope',
(function initialize() {
$log.debug('editOrganizationShareholderModalController.ctor()...');
$scope.editModelS={};
$scope.editModelS = {};
initParams();
init();
thisModuleService.initWatches();
......
......@@ -34,6 +34,12 @@ webservices.factory('orgHKService', ['$http', 'apiConfig', function ($http, apiC
},
updateShareholder: function (orgShareholder) {
return $http.put('/orgHK/updateShareholder', orgShareholder, apiConfig.create());
},
updateDirectors: function (orgDirectors) {
return $http.post('/orgHK/updateDirectors', orgDirectors, apiConfig.create());
},
updateShareholders: function (orgShareholders) {
return $http.post('/orgHK/updateShareholders', orgShareholders, apiConfig.create());
}
}
}]);
\ No newline at end of file
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