Commit 943fbc69 authored by frank.xa.zhang's avatar frank.xa.zhang

fixed shareholder structure -- frank

parent bdfa65ae
...@@ -279,7 +279,7 @@ public class OrganizationHKServiceImpl { ...@@ -279,7 +279,7 @@ public class OrganizationHKServiceImpl {
.collect(Collectors.toList()).get(0); .collect(Collectors.toList()).get(0);
parentOrg.setParentName(organization == null ? null : organization.getName()); parentOrg.setParentName(organization == null ? null : organization.getName());
} }
List<OrganizationHK> subOrgs = null; List<OrganizationHK> subOrgs;
if (useType == 1) { if (useType == 1) {
subOrgs = orgs.stream().filter(x -> parentOrg.getId().equals(x.getParentId())).collect(Collectors.toList()); subOrgs = orgs.stream().filter(x -> parentOrg.getId().equals(x.getParentId())).collect(Collectors.toList());
} else { } else {
...@@ -297,15 +297,14 @@ public class OrganizationHKServiceImpl { ...@@ -297,15 +297,14 @@ public class OrganizationHKServiceImpl {
return parentOrg; return parentOrg;
} }
public List<OrganizationHK> findAllOrganizations() { private List<OrganizationHK> findAllOrganizations() {
OrganizationHKExample organizationExample = new OrganizationHKExample(); OrganizationHKExample organizationExample = new OrganizationHKExample();
return organizationHKMapper.selectByExample(organizationExample); return organizationHKMapper.selectByExample(organizationExample);
} }
public OrganizationHKDto getSingleOrgByOrgId(Long orgId) { public OrganizationHKDto getSingleOrgByOrgId(Long orgId) {
OrganizationHK organizationHK = organizationHKMapper.selectByPrimaryKey(orgId); OrganizationHK organizationHK = organizationHKMapper.selectByPrimaryKey(orgId);
OrganizationHKDto result = new OrganizationHKDto(); OrganizationHKDto result =organizationHKTMapper.toOrganizationHKDto(organizationHK);
CommonUtils.copyProperties(organizationHK, result);
Assert.notNull(result, "result is null"); Assert.notNull(result, "result is null");
result.setLevel(result.getLevel() == null ? 0 : result.getLevel()); result.setLevel(result.getLevel() == null ? 0 : result.getLevel());
result.setParentName(""); result.setParentName("");
...@@ -393,7 +392,7 @@ public class OrganizationHKServiceImpl { ...@@ -393,7 +392,7 @@ public class OrganizationHKServiceImpl {
private OperationResultDto checkExist(OrganizationHKDto orgDto) { private OperationResultDto checkExist(OrganizationHKDto orgDto) {
Assert.notNull(orgDto, "orgDto null point error"); Assert.notNull(orgDto, "orgDto null point error");
OrganizationHK queryRoot = null; OrganizationHK queryRoot;
OrganizationHKExample example = new OrganizationHKExample(); OrganizationHKExample example = new OrganizationHKExample();
OrganizationHKExample.Criteria criteria = example.createCriteria(); OrganizationHKExample.Criteria criteria = example.createCriteria();
criteria.andCodeEqualTo(orgDto.getCode()); criteria.andCodeEqualTo(orgDto.getCode());
......
...@@ -11,9 +11,13 @@ import pwc.taxtech.atms.organization.entity.OrganizationHK; ...@@ -11,9 +11,13 @@ import pwc.taxtech.atms.organization.entity.OrganizationHK;
public interface OrganizationHKTMapper { public interface OrganizationHKTMapper {
OrganizationHKTMapper ORGANIZATION_HK_MAPPER = Mappers.getMapper(OrganizationHKTMapper.class); OrganizationHKTMapper ORGANIZATION_HK_MAPPER = Mappers.getMapper(OrganizationHKTMapper.class);
@Mapping(source = "createTime", target = "createTime" ,dateFormat = "yyyy/MM/dd") @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy/MM/dd")
@Mapping(source = "updateTime", target = "updateTime" ,dateFormat = "yyyy/MM/dd") @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy/MM/dd")
@Mapping(source = "dateOfIncorporation", target = "dateOfIncorporation" ,dateFormat = "yyyy/MM/dd") @Mapping(source = "dateOfIncorporation", target = "dateOfIncorporation", dateFormat = "yyyy/MM/dd")
@Mapping(source = "paymentOfAnnualGovernmentFee", target = "paymentOfAnnualGovernmentFee", dateFormat = "yyyy/MM/dd")
@Mapping(source = "annualReturnFillings", target = "annualReturnFillings", dateFormat = "yyyy/MM/dd")
@Mapping(source = "renewalOfBusinessLicense", target = "renewalOfBusinessLicense", dateFormat = "yyyy/MM/dd")
@Mapping(source = "annualAuditRequirement", target = "annualAuditRequirement", dateFormat = "yyyy/MM/dd")
OrganizationHKDto toOrganizationHKDto(OrganizationHK organizationHK); OrganizationHKDto toOrganizationHKDto(OrganizationHK organizationHK);
OrgInfoDto toOrgInfoDto(OrganizationHK organizationHK); OrgInfoDto toOrgInfoDto(OrganizationHK organizationHK);
......
...@@ -269,7 +269,6 @@ ...@@ -269,7 +269,6 @@
if ($scope.selectNodeCount > 1) { if ($scope.selectNodeCount > 1) {
$scope.showOrgs = false; $scope.showOrgs = false;
$(".detail-info").css("display", "block"); $(".detail-info").css("display", "block");
} }
$scope.selectNodeCount++; $scope.selectNodeCount++;
$scope.selectCompany = data; $scope.selectCompany = data;
...@@ -1350,7 +1349,6 @@ ...@@ -1350,7 +1349,6 @@
$scope.eventsOfCurrentEntity = angular.copy(calendarEventList); $scope.eventsOfCurrentEntity = angular.copy(calendarEventList);
}; };
$scope.eventsOfCurrentEntity = []; $scope.eventsOfCurrentEntity = [];
$scope.compliance = { $scope.compliance = {
selectedItems: [], selectedItems: [],
...@@ -1458,11 +1456,11 @@ ...@@ -1458,11 +1456,11 @@
OrgChart.templates.myTemplate.field_0 = '<text style="font-size: 20px;" fill="#000" x="100" y="90" text-anchor="middle">{val}</text>'; OrgChart.templates.myTemplate.field_0 = '<text style="font-size: 20px;" fill="#000" x="100" y="90" text-anchor="middle">{val}</text>';
OrgChart.templates.myTemplate.link = '<path stroke="#000" stroke-width="1px" fill="none" link-id="[{id}][{child-id}]" d="M{xa},{ya} L{xb},{yb} {xc},{yc} {xd},{yd}" />'; OrgChart.templates.myTemplate.link = '<path stroke="#000" stroke-width="1px" fill="none" link-id="[{id}][{child-id}]" d="M{xa},{ya} L{xb},{yb} {xc},{yc} {xd},{yd}" />';
OrgChart.templates.myTemplate.secondlink = '<path stroke="#000" stroke-width="1px" fill="none" link-id="[{id}][{child-id}]" d="M{xa},{ya} L{xb},{yb} {xc},{yc} {xd},{yd}" />'; // OrgChart.templates.myTemplate.secondlink = '<path stroke="#000" stroke-width="1px" fill="none" link-id="[{id}][{child-id}]" d="M{xa},{ya} L{xb},{yb} {xc},{yc} {xd},{yd}" />';
OrgChart.templates.myTemplate.plus = OrgChart.templates.myTemplate.plus =
'<rect x="0" y="0" width="36" height="36" rx="12" ry="12" fill="#2E2E2E" stroke="#aeaeae" stroke-width="1"></rect>' '<rect x="0" y="0" width="36" height="36" rx="12" ry="12" fill="#2E2E2E" stroke="#aeaeae" stroke-width="1"></rect>'
+ '<line x1="4" y1="18" x2="32" y2="18" stroke-width="1" stroke="#aeaeae"></line>' + '<line x1="4" y1="18" x2="32" y2="18" stroke-width="1" stroke="#aeaeae"></line>'
+ '<line x1="18" y1="4" x2="18" y2="32" stroke-width="1" stroke="#aeaeae"></line>'; + '<line x1="18" y1="4" x2="18" y2="32" stroke-width= "1" stroke="#aeaeae"></line>';
OrgChart.templates.myTemplate.minus = OrgChart.templates.myTemplate.minus =
'<rect x="0" y="0" width="36" height="36" rx="12" ry="12" fill="#2E2E2E" stroke="#aeaeae" stroke-width="1"></rect>' '<rect x="0" y="0" width="36" height="36" rx="12" ry="12" fill="#2E2E2E" stroke="#aeaeae" stroke-width="1"></rect>'
...@@ -1477,7 +1475,7 @@ ...@@ -1477,7 +1475,7 @@
// remove: {text: "Remove"} // remove: {text: "Remove"}
// }, // },
menu: { menu: {
pdf: {text: "Export PDF"}, // pdf: {text: "Export PDF"},
png: {text: "Export PNG"} png: {text: "Export PNG"}
// svg: {text: "Export SVG"}, // svg: {text: "Export SVG"},
// csv: {text: "Export CSV"} // csv: {text: "Export CSV"}
...@@ -1491,12 +1489,12 @@ ...@@ -1491,12 +1489,12 @@
// img_0: "img" // img_0: "img"
}, },
// nodes: [ // nodes: [
// {id: 1, name: "Amber McKenzie", percent: "",spids:[]}, // {id: 1, name: "Shareholder1", percent: "100%",spids:[]},
// {id: 2, name: "Amber McKenzie", percent: "100%"}, // {id: 2, name: "Shareholder2", percent: "100%"},
// {id: 3, name: "Amber McKenzie", percent: "100%"}, // {id: 3, name: "Shareholder3", percent: "100%"},
// {id: 4, pid: 1, spids: [2, 3], name: "Amber McKenzie", percent: "100%"}, // {id: 4, pid: 1, spids: [2, 3], name: "Comapny", percent: ""},
// {id: 5, pid: 4, name: "Ava Field", percent: "100%"}, // {id: 5, pid: 4, name: "Subsidary1", percent: "100%"},
// {id: 6, pid: 5, name: "Peter Stevens", percent: "100%"} // // {id: 6, pid: 4, name: "Subsidary2", percent: "100%"}
// ], // ],
nodes: nodesCotent, nodes: nodesCotent,
onExportStart: exportStart, onExportStart: exportStart,
...@@ -1513,12 +1511,26 @@ ...@@ -1513,12 +1511,26 @@
//第一次在加载时的元素 //第一次在加载时的元素
initialized = true; initialized = true;
} }
// middleNode = {id: 4, pid: 1, spids: [2, 3], name: "Comapny", percent: "100%"};
if (middleNode && middleNode.id > 0) { if (middleNode && middleNode.id > 0) {
var middleNodeSelector = "svg>g[node-id=" + middleNode.id + "]>rect"; var middleNodeSelector = "svg>g[node-id=" + middleNode.id + "]>rect";
var polygon = makeSVG('polygon', {"points": '100,0 0,100 200,100', style: "fill:#ffff;stroke:#000;stroke-width:1", height: 115, width: 250}); var polygon = makeSVG('polygon', {"points": '100,0 0,100 200,100', style: "fill:#ffff;stroke:#000;stroke-width:1", height: 115, width: 250});
$(middleNodeSelector).css("fill", "transparent").css("stroke-width", 0).after(polygon); $(middleNodeSelector).css("fill", "transparent").css("stroke-width", 0).after(polygon);
}
var node = _.find(nodesCotentValue, function (item) {
return item.id === 1;
});
var linkSelector = "svg>g[link-id='[1][" + middleNode.id + "]']";
$(linkSelector + ">g").attr("transform", "matrix(1,0,0,1,80,166) rotate(0)");
// var linkRateG = makeSVG('g', {"transform": "matrix(1,0,0,1,100,166) rotate(0)"});
// $(linkSelector + ">path").after(linkRateG);
var linkSelectorG = linkSelector + ">g";
// var linkRateText = makeSVG('text', {"text-anchor": "middle", "fill": "#aeaeae", "width": "290", "x": "0", "y": "0", "style": "font-size:10px"});
// $(linkSelectorG).append(linkRateText);
var linkSelectorGText = linkSelectorG + ">text";
$(linkSelectorGText).text(node.percent + "%");
// var ellipse = makeSVG('ellipse', {"cx": '100', "cy": "50", "rx": "100", "ry": "50", style: "fill:blue;stroke:purple;stroke-width:2", height: 115, width: 250}); // var ellipse = makeSVG('ellipse', {"cx": '100', "cy": "50", "rx": "100", "ry": "50", style: "fill:blue;stroke:purple;stroke-width:2", height: 115, width: 250});
// var ellipse1 = makeSVG('ellipse', {"cx": '100', "cy": "50", "rx": "100", "ry": "50", style: "fill:blue;stroke:purple;stroke-width:2", height: 115, width: 250}); // var ellipse1 = makeSVG('ellipse', {"cx": '100', "cy": "50", "rx": "100", "ry": "50", style: "fill:blue;stroke:purple;stroke-width:2", height: 115, width: 250});
// var ellipse2 = makeSVG('ellipse', {"cx": '100', "cy": "50", "rx": "100", "ry": "50", style: "fill:blue;stroke:purple;stroke-width:2", height: 115, width: 250}); // var ellipse2 = makeSVG('ellipse', {"cx": '100', "cy": "50", "rx": "100", "ry": "50", style: "fill:blue;stroke:purple;stroke-width:2", height: 115, width: 250});
...@@ -1526,18 +1538,28 @@ ...@@ -1526,18 +1538,28 @@
// $("svg>g[node-id=4]>rect").after(ellipse); // $("svg>g[node-id=4]>rect").after(ellipse);
// $("svg>g[node-id=5]>rect").after(ellipse1); // $("svg>g[node-id=5]>rect").after(ellipse1);
// $("svg>g[node-id=6]>rect").after(ellipse2); // $("svg>g[node-id=6]>rect").after(ellipse2);
// $("svg>g[node-id=5]").attr("transform","matrix(1, 0, 0, 1, 360, 0)"); // $("svg>g[node-id=5]").attr("transform","matrix(1, 0, 0, 1, 360, 0)");
// $("svg>g[node-id=6]").attr("transform","matrix(1, 0, 0, 1, 590, 0)"); // $("svg>g[node-id=6]").attr("transform","matrix(1, 0, 0, 1, 590, 0)");
if (middleNode.id > 2) {
if (middleNode && middleNode.id > 2) {
var count = 0; var count = 0;
for (var i = middleNode.id - 1; i > 1; i--) { for (var i = 2; i < middleNode.id; i++) {
var nodeSelector = "svg>g[second-link-id='[" + middleNode.id + "][" + i + "]']>path"; var subNode = _.find(nodesCotentValue, function (item) {
return item.id === i;
});
var nodeSelector = "svg>g[second-link-id='[" + middleNode.id + "][" + i + "]']";
var value = 320 + 220 * count; var value = 320 + 220 * count;
$(nodeSelector).attr("stroke", "#000"); $(nodeSelector + ">path").attr("stroke", "#000");
$(nodeSelector).attr("d", "M100,180 L100,160 L" + value + ",160 L" + value + ",102"); $(nodeSelector + ">path").attr("d", "M100,180 L100,160 L" + value + ",160 L" + value + ",102");
count++; count++;
var val2 = value - 20;
var rateG = makeSVG('g', {"transform": "matrix(1,0,0,1," + val2 + ",128) rotate(0)"});
$(nodeSelector + ">path").after(rateG);
var nodeSelectorG = nodeSelector + ">g";
var rateText = makeSVG('text', {"text-anchor": "middle", "fill": "#aeaeae", "width": "290", "x": "0", "y": "0", "style": "font-size:10px"});
$(nodeSelectorG).append(rateText);
var nodeSelectorGText = nodeSelectorG + ">text";
$(nodeSelectorGText).text(subNode.percent + "%");
}
} }
} }
// $("svg>g[second-link-id='[4][2]']>path").attr("d", "M210,180 L210,160 L440,160 L440,102"); // $("svg>g[second-link-id='[4][2]']>path").attr("d", "M210,180 L210,160 L440,160 L440,102");
...@@ -1560,7 +1582,7 @@ ...@@ -1560,7 +1582,7 @@
canvg(document.getElementById('canvas'), svg); canvg(document.getElementById('canvas'), svg);
var canvas = document.getElementById("canvas"); var canvas = document.getElementById("canvas");
var a = document.createElement("a"); var a = document.createElement("a");
a.download = "fallback.png"; a.download = "OrgChart.png";
a.href = canvas.toDataURL("image/png"); a.href = canvas.toDataURL("image/png");
a.click(); a.click();
return false; return false;
...@@ -1572,6 +1594,8 @@ ...@@ -1572,6 +1594,8 @@
var middleNode; var middleNode;
var nodesCotentValue;
var initOrgChart = function (orgId) { var initOrgChart = function (orgId) {
orgHKService.getOrgTreeData(orgId).success(function (res) { orgHKService.getOrgTreeData(orgId).success(function (res) {
if (res && res.result) { if (res && res.result) {
...@@ -1587,6 +1611,7 @@ ...@@ -1587,6 +1611,7 @@
}); });
} }
initOrgTree(res.data); initOrgTree(res.data);
nodesCotentValue = res.data;
} }
}); });
}; };
......
...@@ -332,8 +332,7 @@ ...@@ -332,8 +332,7 @@
</div> </div>
<div class="right-option"> <div class="right-option">
<button type="button" class="btn btn-in-grid" style="width: 117px;" <button type="button" class="btn btn-in-grid" style="width: 117px;"
ng-click="addDirector()"><i ng-click="addDirector()"><i class="material-icons middle">create</i>{{'Create' | translate}}
class="material-icons middle">create</i>{{'Create' | translate}}
</button> </button>
</div> </div>
<div class="current-holding-info"> <div class="current-holding-info">
...@@ -353,7 +352,7 @@ ...@@ -353,7 +352,7 @@
<span class="compliance-lable">{{'ComplianceCheckList'|translate}}</span> <span class="compliance-lable">{{'ComplianceCheckList'|translate}}</span>
</div> </div>
<div class="org-compliance-info-body"> <div class="org-compliance-info-body">
<!-- <div id="ComplianceGridContainer" dx-data-grid="complianceGridOptions" style="margin-top: 10px;"></div>--> <!-- <div id="ComplianceGridContainer" dx-data-grid="complianceGridOptions" style="margin-top: 10px;"></div>-->
<div id="data-grid-compliance"> <div id="data-grid-compliance">
<div style="color: red;float: left;margin: 10px 20px;">+ New Action Item</div> <div style="color: red;float: left;margin: 10px 20px;">+ New Action Item</div>
<div class="complianceSaveSelected" dx-button="complianceRevertButtonOptions"></div> <div class="complianceSaveSelected" dx-button="complianceRevertButtonOptions"></div>
......
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