Commit e3774c2c authored by eddie.woo's avatar eddie.woo

modify

parent dab6c28f
...@@ -988,7 +988,7 @@ public class EnterpriseAccountServiceImpl extends AbstractService { ...@@ -988,7 +988,7 @@ public class EnterpriseAccountServiceImpl extends AbstractService {
//endregion //endregion
//1. 如果将标准科目对应到企业科目的父级,那么该企业科目的子级都对应到该标准科目 //1. 如果将标准科目对应到企业科目的父级,那么该企业科目的子级都对应到该标准科目
updateManualMapChildAccount(eaList, eAccount, stdAccount, accountSetId, industryId, organization.getId()); // updateManualMapChildAccount(eaList, eAccount, stdAccount, accountSetId, industryId, organization.getId());
//region 添加日志 //region 添加日志
OperationLogDto operationLogDto = new OperationLogDto(); OperationLogDto operationLogDto = new OperationLogDto();
...@@ -1009,13 +1009,13 @@ public class EnterpriseAccountServiceImpl extends AbstractService { ...@@ -1009,13 +1009,13 @@ public class EnterpriseAccountServiceImpl extends AbstractService {
//region 手动对应当前的所有父级科目 //region 手动对应当前的所有父级科目
//清空ParentAccountMapResult //清空ParentAccountMapResult
this.mapParentAccountResult = Maps.newHashMap(); // this.mapParentAccountResult = Maps.newHashMap();
mapAccountUpdateParent(Lists.newArrayList(accountMapDto.getEnterpriseAccountCodes()), accountSetId, industryId, // mapAccountUpdateParent(Lists.newArrayList(accountMapDto.getEnterpriseAccountCodes()), accountSetId, industryId,
organization.getId(), true); // organization.getId(), true);
//endregion //endregion
AccountMapDto mapDto = new AccountMapDto(); AccountMapDto mapDto = new AccountMapDto();
mapDto.setParentAccountMappingResult(this.mapParentAccountResult); mapDto.setParentAccountMappingResult(this.mapParentAccountResult); //todo 此处有线程安全问题
return OperationResultDto.success(mapDto); return OperationResultDto.success(mapDto);
} }
......
...@@ -511,18 +511,18 @@ ...@@ -511,18 +511,18 @@
v['stdCode'] = codeToUpdate; v['stdCode'] = codeToUpdate;
v['stdName'] = nameToUpdate; v['stdName'] = nameToUpdate;
v['stdResult'] = getStdResult(codeToUpdate, nameToUpdate); v['stdResult'] = getStdResult(codeToUpdate, nameToUpdate);
//todo 需求不需要覆盖子节点
//找出该选中节点的所有子节点,然后复制,避免再次从数据库获取数据 //找出该选中节点的所有子节点,然后复制,避免再次从数据库获取数据
$scope.gridApiSubject.grid.rows.forEach(function (row) { // $scope.gridApiSubject.grid.rows.forEach(function (row) {
if (row.entity.parentCode === v.code) { // if (row.entity.parentCode === v.code) {
row.entity['stdCode'] = codeToUpdate; // row.entity['stdCode'] = codeToUpdate;
row.entity['stdName'] = nameToUpdate; // row.entity['stdName'] = nameToUpdate;
row.entity['stdResult'] = getStdResult(codeToUpdate, nameToUpdate); // row.entity['stdResult'] = getStdResult(codeToUpdate, nameToUpdate);
//
//再次更新该row下面的子节点如果存在的话 // //再次更新该row下面的子节点如果存在的话
updateChildrenMappedCodeNameRecursive($scope.gridApiSubject.grid.rows, row.entity['code'], codeToUpdate, nameToUpdate); // updateChildrenMappedCodeNameRecursive($scope.gridApiSubject.grid.rows, row.entity['code'], codeToUpdate, nameToUpdate);
} // }
}); // });
}); });
}; };
...@@ -855,7 +855,7 @@ ...@@ -855,7 +855,7 @@
if (newVal !== oldVal) { if (newVal !== oldVal) {
//初始化右侧标准科目的树,使用jquery fancytree的方式来显示树,所以需要用到ajax的方式 //初始化右侧标准科目的树,使用jquery fancytree的方式来显示树,所以需要用到ajax的方式
var stdAccountUrl = '/stdAccount/stdAccountHierarchy?orgID=' + $scope.selectedOrgID; var stdAccountUrl = '/stdAccount/stdAccountHierarchy?orgID=' + $scope.selectedOrgID;
commonWebService.initFancyTreeAjax('treetable', stdAccountUrl, mapStdAccount); commonWebService.initAllFancyTreeAjax('treetable', stdAccountUrl, mapStdAccount);
$scope.LoadEtsSubjectBySelectedOrg(); $scope.LoadEtsSubjectBySelectedOrg();
} }
......
...@@ -252,6 +252,109 @@ webservices.factory('commonWebService', ['$http', 'apiConfig', 'loginContext', ' ...@@ -252,6 +252,109 @@ webservices.factory('commonWebService', ['$http', 'apiConfig', 'loginContext', '
node.setExpanded(false); node.setExpanded(false);
}); });
} }
},
initAllFancyTreeAjax: function (treeID, ajaxUrl, dblFn) {
var prefixUrl = loginContext.apiHost + constant.webapi.prefix;
var ajaxUrl = prefixUrl + ajaxUrl;
var ajaxSource = $.ajax({
url: ajaxUrl,
beforeSend: function (xhr) {
xhr.setRequestHeader('Authorization', tokenType + ' ' + apiToken);
}
});
var treeOptions = {
extensions: ["edit", "glyph", "table", "filter"],
quicksearch: true,
checkbox: false,
glyph: glyph_opts,
source: ajaxSource,
table: {
checkboxColumnIdx: 1,
nodeColumnIdx: 2
},
dblclick: function (event, data) {
var node = data.node.data;
var code = node.code;
var name = node.fullName;
var acctProp = node.acctProp;
var direction = node.direction;
var hasChildren = node.hasChildren;
if (code != null) {
dblFn(code, name, acctProp, direction);
}
},
renderColumns: function (event, data) {
var node = data.node,
$tdList = $(node.tr).find(">td");
$tdList.eq(3).text(!!node.folder);
},
filter: {
autoApply: true, // Re-apply last filter if lazy data is loaded
autoExpand: true, // Expand all branches that contain matches while filtered
counter: true, // Show a badge with number of matching child nodes near parent icons
fuzzy: false, // Match single characters in order, e.g. 'fb' will match 'FooBar'
hideExpandedCounter: false, // Hide counter badge if parent is expanded
hideExpanders: false, // Hide expanders if all child nodes are hidden by filter
highlight: true, // Highlight matches by wrapping inside <mark> tags
leavesOnly: false, // Match end nodes only
nodata: true, // Display a 'no data' status node if result is empty
mode: "hide", // Grayout unmatched nodes (pass "hide" to remove unmatched node instead)
regularExpression: false,
matchWholeBranch: false
}
};
///由于fancyTree第一次ajax请求加载的时候,只需要把发送ajax option即可,不需要使用callback去赋值
///但是第二次ajax请求重新渲染fancytree的话,需要ajax.done获取返回的数据并做为参数传递给fancytree去重新渲染
///所以使用了tick来判断是否是首次请求
var tree = $.ui.fancytree.getTree("#" + treeID);
if (tree) {
ajaxSource.done(function (data) {
tree.reload(data).done(function () {
console.log('reloaded');
});
}).fail(function (err) { console.log(err); });
} else {
$("#" + treeID).fancytree(treeOptions);
}
$("input[name=fancytree-search]").keyup(function (e) {
var n,
tree = $.ui.fancytree.getTree("#" + treeID),
opts = {},
filterFunc = tree.options.filter.matchWholeBranch ? tree.filterBranches : tree.filterNodes,
match = $(this).val();
opts.nodata = tree.options.filter.nodata;
opts.leavesOnly = tree.options.filter.leavesOnly;
opts.highlight = tree.options.filter.highlight;
opts.hideExpanders = tree.options.filter.hideExpanders;
opts.fuzzy = tree.options.filter.fuzzy;
opts.autoApply = tree.options.filter.autoApply;
opts.mode = tree.options.filter.mode;
opts.autoExpand = tree.options.filter.autoExpand;
opts.counter = tree.options.filter.counter;
if (e && e.which === $.ui.keyCode.ESCAPE || $.trim(match) === "") {
$("input[name=fancytree-search]").val("");
tree.clearFilter();
return;
}
//opts.
if (tree.options.filter.regularExpression) {
// Pass function to perform match
n = filterFunc.call(tree, function (node) {
return new RegExp(match, "i").test(node.title);
}, opts);
} else {
// Pass a string to perform case insensitive matching
n = filterFunc.call(tree, match, opts);
}
}).focus();
} }
}; };
}]); }]);
\ 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