Commit 5783d9e9 authored by frank.xa.zhang's avatar frank.xa.zhang

fixed page issue -- frank

parent cba7426d
This diff is collapsed.
......@@ -45,7 +45,7 @@ public class POIUtil {
}
Row targetRow = targetSheet.createRow(r);
for (int c = row.getFirstCellNum(); c <= row.getLastCellNum(); c++) {
if(c < 0 ){
if (c < 0) {
continue;
}
Cell cell = row.getCell(c);
......@@ -76,10 +76,10 @@ public class POIUtil {
if (null != cell.getCellComment()) {
targetCell.setCellComment(cell.getCellComment());
}
if (null != cell.getCellStyle() && targetCell.getCellStyle() != null ) {
try{
if (null != cell.getCellStyle() && targetCell.getCellStyle() != null) {
try {
targetCell.getCellStyle().cloneStyleFrom(cell.getCellStyle());
}catch (Exception e){
} catch (Exception e) {
//e.printStackTrace();
}
}
......@@ -90,11 +90,11 @@ public class POIUtil {
}
}
public static void cloneSheetAndStyle(Sheet sheet, Sheet targetSheet,Workbook tWorkbook) {
public static void cloneSheetAndStyle(Sheet sheet, Sheet targetSheet, Workbook tWorkbook) {
//设置合并单元格
List<CellRangeAddress> merges = sheet.getMergedRegions();
if(CollectionUtils.isNotEmpty(merges)){
for(CellRangeAddress merge : merges){
List<CellRangeAddress> merges = sheet.getMergedRegions();
if (CollectionUtils.isNotEmpty(merges)) {
for (CellRangeAddress merge : merges) {
targetSheet.addMergedRegion(merge);
}
}
......@@ -105,7 +105,7 @@ public class POIUtil {
}
Row targetRow = targetSheet.createRow(r);
for (int c = row.getFirstCellNum(); c <= row.getLastCellNum(); c++) {
if(c < 0 ){
if (c < 0) {
continue;
}
Cell cell = row.getCell(c);
......@@ -116,9 +116,9 @@ public class POIUtil {
targetCell.setCellType(cell.getCellTypeEnum());
switch (cell.getCellTypeEnum()) {
case STRING:
if (cell.getStringCellValue().indexOf("KeyIn")>0){
if (cell.getStringCellValue().indexOf("KeyIn") > 0) {
targetCell.setCellValue("");
}else{
} else {
targetCell.setCellValue(cell.getStringCellValue());
}
break;
......@@ -141,11 +141,11 @@ public class POIUtil {
targetCell.setCellComment(cell.getCellComment());
}
if (null != cell.getCellStyle()) {
CellStyle newstyle=tWorkbook.createCellStyle();
CellStyle newstyle = tWorkbook.createCellStyle();
targetCell.setCellStyle(newstyle);
try{
try {
targetCell.getCellStyle().cloneStyleFrom(cell.getCellStyle());
}catch (Exception e){
} catch (Exception e) {
//e.printStackTrace();
}
}
......@@ -155,6 +155,7 @@ public class POIUtil {
}
}
}
public static String getCellFormulaString(Cell cell) {
switch (cell.getCellTypeEnum()) {
case STRING:
......@@ -192,14 +193,14 @@ public class POIUtil {
return row;
}
public static Row createAndCloneRow(Workbook wb , Sheet sheet, Integer destRowIndex, Row fromRow) {
public static Row createAndCloneRow(Workbook wb, Sheet sheet, Integer destRowIndex, Row fromRow) {
Row toRow = null;
if (sheet.getRow(destRowIndex) != null) {
int lastRowNo = sheet.getLastRowNum();
sheet.shiftRows(destRowIndex, lastRowNo, 1);
}
toRow = sheet.createRow(destRowIndex);
for (Iterator cellIt = fromRow.cellIterator(); cellIt.hasNext();) {
for (Iterator cellIt = fromRow.cellIterator(); cellIt.hasNext(); ) {
Cell tmpCell = (Cell) cellIt.next();
Cell newCell = toRow.createCell(tmpCell.getColumnIndex());
copyCell(wb, tmpCell, newCell, false);
......@@ -207,9 +208,9 @@ public class POIUtil {
return toRow;
}
public static void copyCell(Workbook wb,Cell srcCell, Cell distCell,
public static void copyCell(Workbook wb, Cell srcCell, Cell distCell,
boolean copyValueFlag) {
CellStyle newstyle=wb.createCellStyle();
CellStyle newstyle = wb.createCellStyle();
newstyle.cloneStyleFrom(srcCell.getCellStyle());
// copyCellStyle(wb,srcCell.getCellStyle(), newstyle);
// distCell.setEncoding(srcCell.getEncoding());
......@@ -244,7 +245,7 @@ public class POIUtil {
}
}
public static void copyCellStyle(Workbook wb,CellStyle fromStyle,
public static void copyCellStyle(Workbook wb, CellStyle fromStyle,
CellStyle toStyle) {
toStyle.setAlignment(HorizontalAlignment.forInt(fromStyle.getAlignment()));
//边框和边框颜色
......@@ -263,7 +264,7 @@ public class POIUtil {
//
toStyle.setDataFormat(fromStyle.getDataFormat());
toStyle.setFillPattern(FillPatternType.forInt(fromStyle.getFillPattern()));
toStyle.setFont(wb.getFontAt(fromStyle.getFontIndex()));
toStyle.setFont(wb.getFontAt(fromStyle.getFontIndex()));
toStyle.setHidden(fromStyle.getHidden());
toStyle.setIndention(fromStyle.getIndention());//首行缩进
toStyle.setLocked(fromStyle.getLocked());
......
......@@ -7,7 +7,9 @@ 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.OrganizationHKDto;
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;
import java.util.List;
......@@ -69,4 +71,32 @@ public class OrganizationHKController {
logger.info("POST /api/v1/orgHK/add");
return organizationHKService.addOrg(orgDto);
}
@RequestMapping(value = "addDirecotr", method = RequestMethod.POST)
public @ResponseBody
OperationResultDto<Object> addDirector(@RequestBody OrganizationDirector organizationDirector) {
logger.info("POST /api/v1/orgHK/addDirecotr");
return organizationHKService.addOrgDirector(organizationDirector);
}
@RequestMapping(value = "addShareholder", method = RequestMethod.POST)
public @ResponseBody
OperationResultDto<Object> addShareholder(@RequestBody OrganizationShareholder organizationShareholder) {
logger.info("POST /api/v1/orgHK/addShareholder");
return organizationHKService.addOrgShareholder(organizationShareholder);
}
@RequestMapping(value = "updateDirector", method = RequestMethod.PUT)
public @ResponseBody
OperationResultDto<Object> updateDirector(@RequestBody OrganizationDirector organizationDirector) {
logger.info("PUT /api/v1/orgHK/updateDirector");
return organizationHKService.updateDirector(organizationDirector);
}
@RequestMapping(value = "updateShareholder", method = RequestMethod.PUT)
public @ResponseBody
OperationResultDto<Object> updateShareholder(@RequestBody OrganizationShareholder organizationShareholder) {
logger.info("PUT /api/v1/orgHK/updateShareholder");
return organizationHKService.updateShareholder(organizationShareholder);
}
}
......@@ -12,16 +12,19 @@ import pwc.taxtech.atms.common.*;
import pwc.taxtech.atms.common.message.LogMessage;
import pwc.taxtech.atms.common.message.OrganizationMessage;
import pwc.taxtech.atms.common.util.BeanUtil;
import pwc.taxtech.atms.constant.OrganizationConstant;
import pwc.taxtech.atms.dto.OperationLogDto;
import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.UpdateLogParams;
import pwc.taxtech.atms.dto.navtree.NavTreeDto;
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.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 javax.annotation.Resource;
import java.util.*;
......@@ -40,9 +43,18 @@ public class OrganizationHKServiceImpl {
@Resource
private OrganizationHKMapper organizationHKMapper;
@Resource
private OrganizationDirectorMapper organizationDirectorMapper;
@Resource
private OrganizationShareholderMapper organizationShareholderMapper;
@Autowired
private OperationLogServiceImpl operationLogService;
@Autowired
private AuthUserHelper authUserHelper;
@Autowired
private BeanUtil beanUtil;
......@@ -149,7 +161,7 @@ public class OrganizationHKServiceImpl {
return orgList.stream().map(this::rotateOrganizationDtoToNavTreeDto).collect(Collectors.toList());
}
public List<OrganizationHKDto> getOrgList(Integer useType) {
private List<OrganizationHKDto> getOrgList(Integer useType) {
List<OrganizationHKDto> orgDtoList = new ArrayList<>();
List<OrganizationHK> orgList = findAllOrganizations();
if (!orgList.isEmpty()) {
......@@ -214,7 +226,7 @@ public class OrganizationHKServiceImpl {
return parentOrg;
}
public List<OrganizationHK> findAllOrganizations() {
private List<OrganizationHK> findAllOrganizations() {
OrganizationHKExample organizationExample = new OrganizationHKExample();
return organizationHKMapper.selectByExample(organizationExample);
}
......@@ -243,18 +255,34 @@ public class OrganizationHKServiceImpl {
if (result != null && !BooleanUtils.isTrue(result.getResult())) {
return new OperationResultDto(result.getResult(), result.getResultMsg());
}
if (Objects.equals(orgDto.getParentId(), OrganizationConstant.NoParentId)) {
orgDto.setParentId(null);
orgDto.setpLevel(0);
} else {
}
orgDto.setParentId(null);
orgDto.setPLevel(0);
orgDto.setId(distributedIdService.nextId());
Date now = new Date();
OrganizationHK org = copyProperties(orgDto, new OrganizationHK());
org.setCreateTime(now);
org.setUpdateTime(now);
if (orgDto.getDirectors() != null && orgDto.getDirectors().size() > 0) {
orgDto.getDirectors().forEach(a -> {
OrganizationDirector organizationDirector = beanUtil.copyProperties(a, new OrganizationDirector());
organizationDirector.setUpdateTime(now);
organizationDirector.setCreateTime(now);
organizationDirector.setEntityId(org.getId());
organizationDirector.setId(distributedIdService.nextId());
organizationDirectorMapper.insertSelective(organizationDirector);
});
}
if (orgDto.getShareholders() != null && orgDto.getShareholders().size() > 0) {
orgDto.getShareholders().forEach(a -> {
OrganizationShareholder organizationShareholder = beanUtil.copyProperties(a, new OrganizationShareholder());
organizationShareholder.setId(distributedIdService.nextId());
organizationShareholder.setInvestmentEntityId(0L);
organizationShareholder.setEntityId(org.getId());
organizationShareholder.setCreateTime(now);
organizationShareholder.setUpdateTime(now);
organizationShareholderMapper.insertSelective(organizationShareholder);
});
}
organizationHKMapper.insertSelective(org);
UpdateLogParams tempCommonLogParms = new UpdateLogParams();
......@@ -308,4 +336,60 @@ public class OrganizationHKServiceImpl {
}
return new OperationResultDto(true);
}
public OperationResultDto<Object> addOrgDirector(OrganizationDirector organizationDirector) {
OperationResultDto<Object> operationResultDto = new OperationResultDto<>();
organizationDirectorMapper.insertSelective(organizationDirector);
operationResultDto.setResult(true);
return operationResultDto;
}
public OperationResultDto<Object> addOrgShareholder(OrganizationShareholder organizationShareholder) {
OperationResultDto<Object> operationResultDto = new OperationResultDto<>();
organizationShareholderMapper.insertSelective(organizationShareholder);
operationResultDto.setResult(true);
return operationResultDto;
}
public OperationResultDto<Object> updateDirector(OrganizationDirector organizationDirector) {
OperationResultDto<Object> resultDto = new OperationResultDto<>();
if (existDirector(organizationDirector.getId())) {
Date now = new Date();
organizationDirector.setUpdateTime(now);
organizationDirector.setUpdateBy(authUserHelper.getCurrentUserId());
organizationDirectorMapper.updateByPrimaryKey(organizationDirector);
resultDto.setResult(true);
} else {
resultDto.setResult(false);
resultDto.setResultMsg("Not exist director");
}
return resultDto;
}
public OperationResultDto<Object> updateShareholder(OrganizationShareholder organizationShareholder) {
OperationResultDto<Object> resultDto = new OperationResultDto<>();
if (existShareholder(organizationShareholder.getId())) {
Date now = new Date();
organizationShareholder.setUpdateTime(now);
organizationShareholder.setUpdateBy(authUserHelper.getCurrentUserId());
organizationShareholderMapper.updateByPrimaryKey(organizationShareholder);
resultDto.setResult(true);
} else {
resultDto.setResult(false);
resultDto.setResultMsg("Not exist director");
}
return resultDto;
}
private boolean existShareholder(Long organizationShardholderId) {
OrganizationShareholder organizationShareholder = organizationShareholderMapper.selectByPrimaryKey(organizationShardholderId);
return organizationShareholder != null;
}
private boolean existDirector(Long organizationDirectorId) {
OrganizationDirector organizationDirector = organizationDirectorMapper.selectByPrimaryKey(organizationDirectorId);
return organizationDirector != null;
}
}
......@@ -90,5 +90,13 @@
<classifier>jdk15</classifier>
</dependency>
<!--Excel to Json End-->
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.8</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
package pwc.taxtech.atms.organization.dpo;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@ToString
@NoArgsConstructor
public class OrganizationDirectorDto {
String id;
String entityId;
String directorName;
String residency;
String dateOfAppointment;
String dateOfResignation;
String isExecutive;
String otherRoles;
String isDelete;
}
package pwc.taxtech.atms.organization.dpo;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.util.List;
@Getter
@Setter
@ToString
public class OrganizationHKDto {
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
......@@ -38,284 +45,12 @@ public class OrganizationHKDto {
private String structureId;
private String industryId;
private String businessUnitId;
private String parentName;
private List<OrganizationHKDto> subOrgs;
private Integer pLevel;
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
private Integer level;
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
public List<OrganizationHKDto> getSubOrgs() {
return subOrgs;
}
public void setSubOrgs(List<OrganizationHKDto> subOrgs) {
this.subOrgs = subOrgs;
}
public Integer getpLevel() {
return pLevel;
}
public void setpLevel(Integer pLevel) {
this.pLevel = pLevel;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Boolean getActive() {
return isActive;
}
public void setActive(Boolean active) {
isActive = active;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getLegalForm() {
return legalForm;
}
public void setLegalForm(String legalForm) {
this.legalForm = legalForm;
}
public String getRegisterAddress() {
return registerAddress;
}
public void setRegisterAddress(String registerAddress) {
this.registerAddress = registerAddress;
}
public Float getAuthorisedCapital() {
return authorisedCapital;
}
public void setAuthorisedCapital(Float authorisedCapital) {
this.authorisedCapital = authorisedCapital;
}
public Float getIssuedCapital() {
return issuedCapital;
}
public void setIssuedCapital(Float issuedCapital) {
this.issuedCapital = issuedCapital;
}
public String getIndustry() {
return industry;
}
public void setIndustry(String industry) {
this.industry = industry;
}
public String getPaymentOfAnnualGovernmentFee() {
return paymentOfAnnualGovernmentFee;
}
public void setPaymentOfAnnualGovernmentFee(String paymentOfAnnualGovernmentFee) {
this.paymentOfAnnualGovernmentFee = paymentOfAnnualGovernmentFee;
}
public String getAnnualReturnFillings() {
return annualReturnFillings;
}
public void setAnnualReturnFillings(String annualReturnFillings) {
this.annualReturnFillings = annualReturnFillings;
}
public String getBoardMeetingRequirement() {
return boardMeetingRequirement;
}
public void setBoardMeetingRequirement(String boardMeetingRequirement) {
this.boardMeetingRequirement = boardMeetingRequirement;
}
public String getBusinessLicense() {
return businessLicense;
}
public void setBusinessLicense(String businessLicense) {
this.businessLicense = businessLicense;
}
public String getRenewalOfBusinessLicense() {
return renewalOfBusinessLicense;
}
public void setRenewalOfBusinessLicense(String renewalOfBusinessLicense) {
this.renewalOfBusinessLicense = renewalOfBusinessLicense;
}
public String getEntityLevel() {
return entityLevel;
}
public void setEntityLevel(String entityLevel) {
this.entityLevel = entityLevel;
}
public String getDateOfIncorporation() {
return dateOfIncorporation;
}
public void setDateOfIncorporation(String dateOfIncorporation) {
this.dateOfIncorporation = dateOfIncorporation;
}
public String getJurisdictionOfFormation() {
return jurisdictionOfFormation;
}
public void setJurisdictionOfFormation(String jurisdictionOfFormation) {
this.jurisdictionOfFormation = jurisdictionOfFormation;
}
public String getFinancialYearEnd() {
return financialYearEnd;
}
public void setFinancialYearEnd(String financialYearEnd) {
this.financialYearEnd = financialYearEnd;
}
public String getAnnualAuditRequirement() {
return annualAuditRequirement;
}
public void setAnnualAuditRequirement(String annualAuditRequirement) {
this.annualAuditRequirement = annualAuditRequirement;
}
public String getRegisteredAgent() {
return registeredAgent;
}
public void setRegisteredAgent(String registeredAgent) {
this.registeredAgent = registeredAgent;
}
public String getOwnershipForm() {
return ownershipForm;
}
public void setOwnershipForm(String ownershipForm) {
this.ownershipForm = ownershipForm;
}
public String getResidentSecretary() {
return residentSecretary;
}
public void setResidentSecretary(String residentSecretary) {
this.residentSecretary = residentSecretary;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public String getAreaId() {
return areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getRegionId() {
return regionId;
}
public void setRegionId(String regionId) {
this.regionId = regionId;
}
public String getStructureId() {
return structureId;
}
public void setStructureId(String structureId) {
this.structureId = structureId;
}
public String getIndustryId() {
return industryId;
}
public void setIndustryId(String industryId) {
this.industryId = industryId;
}
public String getBusinessUnitId() {
return businessUnitId;
}
public void setBusinessUnitId(String businessUnitId) {
this.businessUnitId = businessUnitId;
}
@JsonProperty("directors")
private List<OrganizationDirectorDto> directors;
@JsonProperty("shareholders")
private List<OrganizationShareholderDto> shareholders;
}
package pwc.taxtech.atms.organization.dpo;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@NoArgsConstructor
@ToString
public class OrganizationShareholderDto {
String id;
String entityId;
String investmentEntityId;
String ownershipForm;
String commonPreferred;
String classOfShares;
String votingPercentage;
}
......@@ -387,8 +387,8 @@
<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-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-equity-modal operate-type="equityEditOperateType" is-update="isEquityUpdate"-->
<!--selected-organization="selectedOrg"></edit-equity-modal>-->
<!--<edit-equity-change-modal operate-type="equityChangeOperateType" is-update="isEquityChange"-->
......
commonModule.controller('editOrganizationDirectorModalController', ['$scope', '$log', 'ackUibModal', '$translate', function ($scope, $log, ackUibModal, $translate) {
commonModule.controller('editOrganizationDirectorModalController', ['$scope', '$log', 'ackUibModal', '$translate', 'orgHKService', function ($scope, $log, ackUibModal, $translate, orgHKService) {
'use strict';
$scope.isShow = false;
//模态框管理
$scope.modalManage = {
......@@ -16,16 +15,22 @@ commonModule.controller('editOrganizationDirectorModalController', ['$scope', '$
$scope.modalInstance.open();
},
close: function () {
$scope.onClose();
$scope.modalInstance.close();
},
cancel: function () {
$scope.onClose();
$scope.modalInstance.cancel();
},
save:function () {
save: function () {
var dxResult = DevExpress.validationEngine.validateGroup($('#directorControlForm').dxValidationGroup("instance")).isValid;
if (dxResult) {
if (!$scope.editModelD.id) {
$scope.editModelD.id = PWC.newGuid();
}
$scope.onSave({directorEntity: $scope.editModelD});
$scope.editModelD = {};
$scope.modalManage.directorModal.close();
}
}
}
......@@ -34,19 +39,15 @@ commonModule.controller('editOrganizationDirectorModalController', ['$scope', '$
var now = new Date();
var initParams = function () {
$scope.editModel = {};
$scope.dropdownDatasource = {
otherRolesTypeList: constant.organizationHK.OtherRoles,
executiveTypeList: constant.organizationHK.executiveType
};
$scope.textOptions = {
directorNameOption: {
bindingOptions: {
value: 'editModel.directorName'
value: 'editModelD.directorName'
},
maxLength: 100,
placeholder: $translate.instant('directorName'),
......@@ -54,7 +55,7 @@ commonModule.controller('editOrganizationDirectorModalController', ['$scope', '$
},
residencyOption: {
bindingOptions: {
value: 'editModel.residency'
value: 'editModelD.residency'
},
maxLength: 100,
placeholder: $translate.instant('residency'),
......@@ -62,7 +63,7 @@ commonModule.controller('editOrganizationDirectorModalController', ['$scope', '$
},
dateOfAppointmentOption: {
bindingOptions: {
value: 'editModel.dateOfAppointment'
value: 'editModelD.dateOfAppointment'
},
type: "date",
value: now,
......@@ -72,7 +73,7 @@ commonModule.controller('editOrganizationDirectorModalController', ['$scope', '$
},
dateOfResignationOption: {
bindingOptions: {
value: 'editModel.dateOfResignation'
value: 'editModelD.dateOfResignation'
},
type: "date",
value: now,
......@@ -83,10 +84,10 @@ commonModule.controller('editOrganizationDirectorModalController', ['$scope', '$
executiveOption: {
bindingOptions: {
dataSource: 'dropdownDatasource.executiveTypeList',
value: 'editModel.executive'
value: 'editModelD.executive'
},
onSelectionChanged: function (args) {
$scope.editModel.executive = args.selectedItem.id;
// $scope.editModel.executive = args.selectedItem.id;
},
itemTemplate: function (itemData, itemIndex, itemElement) {
var span = $('<span title="' + itemData.name + '">').text(itemData.name);
......@@ -99,10 +100,10 @@ commonModule.controller('editOrganizationDirectorModalController', ['$scope', '$
otherRolesOption: {
bindingOptions: {
dataSource: 'dropdownDatasource.otherRolesTypeList',
value: 'editModel.otherRoles'
value: 'editModelD.otherRoles'
},
onSelectionChanged: function (args) {
$scope.editModel.otherRoles = args.selectedItem.id;
// $scope.editModel.otherRoles = args.selectedItem.id;
},
itemTemplate: function (itemData, itemIndex, itemElement) {
var span = $('<span title="' + itemData.name + '">').text(itemData.name);
......@@ -172,14 +173,13 @@ commonModule.controller('editOrganizationDirectorModalController', ['$scope', '$
var thisModuleService = {
initEvents: function () {
$scope.save = function () {
};
},
initWatches: function () {
$scope.$watch('isShowD', function (newValue, oldValue) {
$scope.$watch('isShowD', function (newValue) {
if (newValue) {
console.log($scope.$parent.$parent.gModel.editDirectorModel);
$scope.editModelD= $scope.$parent.$parent.gModel.editDirectorModel;
$scope.modalManage.directorModal.open();
}
});
......@@ -188,6 +188,7 @@ commonModule.controller('editOrganizationDirectorModalController', ['$scope', '$
(function initialize() {
$log.debug('editOrganizationDirectorModalController.ctor()...');
$scope.editModelD = {};
initParams();
init();
thisModuleService.initWatches();
......
......@@ -8,9 +8,10 @@ commonModule.directive('editOrganizationDirectorModal', ['$log', function ($log)
controller: 'editOrganizationDirectorModalController',
scope: {
isShowD: '=?',
editModelD: '=?',
parentPage: '@',
editModel: '=?',
onClose:'&'
onClose:'&',
onSave:'&'
},
link: function (scope, element) {
}
......
......@@ -169,8 +169,7 @@
</button>
</span>
</div>
<edit-organization-shareholder-modal is-show-s="isShowShareholderModal" parent-page=".edit-organization-modal-wrapper" edit-model="editShareholder"
on-close="closeSharehoder()"></edit-organization-shareholder-modal>
<edit-organization-director-modal is-show-d="isShowDirectorModal" parent-page=".edit-organization-modal-wrapper" edit-model="editDirector" on-close="closeDirector()"></edit-organization-director-modal>
<edit-organization-shareholder-modal is-show-s="isShowShareholderModal" parent-page=".edit-organization-modal-wrapper" edit-model-s="gModel.editShareholderModel" on-close="closeSharehoder()" on-save="saveShareholder(shareholderEntity)"></edit-organization-shareholder-modal>
<edit-organization-director-modal is-show-d="isShowDirectorModal" parent-page=".edit-organization-modal-wrapper" edit-model-d="gModel.editDirectorModel" on-close="closeDirector()" on-save="saveDirector(directorEntity)"></edit-organization-director-modal>
</script>
</div>
\ No newline at end of file
commonModule.controller('editOrganizationShareholderModalController', ['$scope', '$log', 'ackUibModal','$translate', function ($scope, $log, ackUibModal,$translate) {
commonModule.controller('editOrganizationShareholderModalController', ['$scope', '$log', 'ackUibModal', '$translate', function ($scope, $log, ackUibModal, $translate) {
'use strict';
$scope.isShow = false;
//模态框管理
$scope.modalManage = {
shareholderModal: {
......@@ -16,23 +14,28 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope',
$scope.modalInstance.open();
},
close: function () {
$scope.onClose();
$scope.modalInstance.close();
},
cancel: function () {
$scope.onClose();
$scope.modalInstance.cancel();
},
save:function () {
save: function () {
var dxResult = DevExpress.validationEngine.validateGroup($('#shareholderControlForm').dxValidationGroup("instance")).isValid;
if (dxResult) {
if (!$scope.editModelS.id) {
$scope.editModelS.id = PWC.newGuid();
}
$scope.onSave({shareholderEntity: $scope.editModelS});
$scope.editModelS = {};
$scope.modalManage.shareholderModal.close();
}
}
}
};
var initParams = function () {
$scope.editModel = {};
$scope.ownershipFormTypeList = constant.organizationHK.OwnershipForm;
$scope.commonOrPreferredTypeList = ['Commmon', 'Preferred'];
$scope.classOfSharesTypeList = ['A', 'B'];
......@@ -47,11 +50,11 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope',
$scope.textboxOption = {
investmentEntityOption: {
bindingOptions: {
dataSource: 'dropdownDatasource.investmentEntityTypeList',
value: 'editModel.investmentEntity'
dataSource: 'dropdownDatasource.ownershipFormTypeList',
value: 'editModelS.investmentEntity'
},
onSelectionChanged: function (args) {
$scope.editModel.investmentEntity = args.selectedItem.id;
// $scope.editModelS.investmentEntity = args.selectedItem.id;
},
itemTemplate: function (itemData, itemIndex, itemElement) {
var span = $('<span title="' + itemData.name + '">').text(itemData.name);
......@@ -64,10 +67,10 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope',
ownershipFormOption: {
bindingOptions: {
dataSource: 'dropdownDatasource.ownershipFormTypeList',
value: 'editModel.ownershipForm'
value: 'editModelS.ownershipForm'
},
onSelectionChanged: function (args) {
$scope.editModel.ownershipForm = args.selectedItem.id;
// $scope.editModelS.ownershipForm = args.selectedItem.id;
},
itemTemplate: function (itemData, itemIndex, itemElement) {
var span = $('<span title="' + itemData.name + '">').text(itemData.name);
......@@ -80,10 +83,10 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope',
commonOrPreferredOption: {
bindingOptions: {
dataSource: 'dropdownDatasource.commonOrPreferredTypeList',
value: 'editModel.commonOrPreferred'
value: 'editModelS.commonOrPreferred'
},
onSelectionChanged: function (args) {
$scope.editModel.commonOrPreferred = args.selectedItem.id;
// $scope.editModelS.commonOrPreferred = args.selectedItem.id;
},
itemTemplate: function (itemData, itemIndex, itemElement) {
var span = $('<span title="' + itemData.name + '">').text(itemData.name);
......@@ -96,10 +99,10 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope',
classOfSharesOption: {
bindingOptions: {
dataSource: 'dropdownDatasource.classOfSharesTypeList',
value: 'editModel.classOfShares'
value: 'editModelS.classOfShares'
},
onSelectionChanged: function (args) {
$scope.editModel.classOfShares = args.selectedItem.id;
// $scope.editModelS.classOfShares = args.selectedItem.id;
},
itemTemplate: function (itemData, itemIndex, itemElement) {
var span = $('<span title="' + itemData.name + '">').text(itemData.name);
......@@ -111,7 +114,7 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope',
},
votingPercentageOption: {
bindingOptions: {
value: 'editModel.votingPercentage'
value: 'editModelS.votingPercentage'
},
maxLength: 100,
placeholder: $translate.instant('votingPercentage'),
......@@ -169,14 +172,13 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope',
var thisModuleService = {
initEvents: function () {
$scope.save = function () {
};
},
initWatches: function () {
$scope.$watch('isShowS', function (newValue, oldValue) {
if (newValue) {
console.log($scope.$parent.$parent.gModel.editShareholderModel);
$scope.editModelS= $scope.$parent.$parent.gModel.editShareholderModel;
$scope.modalManage.shareholderModal.open();
}
});
......@@ -185,6 +187,7 @@ commonModule.controller('editOrganizationShareholderModalController', ['$scope',
(function initialize() {
$log.debug('editOrganizationShareholderModalController.ctor()...');
$scope.editModelS={};
initParams();
init();
thisModuleService.initWatches();
......
......@@ -9,8 +9,9 @@ commonModule.directive('editOrganizationShareholderModal', ['$log', function ($l
scope: {
isShowS: '=?',
parentPage: '@',
editModel: '=?',
onClose:'&'
editModelS: '=?',
onClose:'&',
onSave:'&'
},
link: function (scope, element) {
}
......
......@@ -22,6 +22,18 @@ webservices.factory('orgHKService', ['$http', 'apiConfig', function ($http, apiC
},
addOrg: function (org) {
return $http.post('/orgHK/add', org, apiConfig.create());
},
addDirecotr: function (orgDirector) {
return $http.post('/orgHK/addDirecotr', orgDirector, apiConfig.create());
},
addShareholder: function (orgShareholder) {
return $http.post('/orgHK/addShareholder', orgShareholder, apiConfig.create());
},
updateDirector: function (orgDirector) {
return $http.put('/orgHK/updateDirector', orgDirector, apiConfig.create());
},
updateShareholder: function (orgShareholder) {
return $http.put('/orgHK/updateShareholder', orgShareholder, 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