Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
f3a7aa52
Commit
f3a7aa52
authored
Jul 09, 2019
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed entity page backend-- frank
parent
fee7b123
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
179 additions
and
141 deletions
+179
-141
OrganizationController.java
...a/pwc/taxtech/atms/controller/OrganizationController.java
+8
-8
OrganizationServiceImpl.java
...wc/taxtech/atms/service/impl/OrganizationServiceImpl.java
+0
-0
RoleServiceImpl.java
...n/java/pwc/taxtech/atms/service/impl/RoleServiceImpl.java
+67
-67
OrganizationHKDto.java
.../pwc/taxtech/atms/organization/dpo/OrganizationHKDto.java
+38
-0
organization-manage.ctrl.js
...astructure/organizationManage/organization-manage.ctrl.js
+58
-58
edit-organization-modal.ctrl.js
...s/edit-organization-modal/edit-organization-modal.ctrl.js
+8
-8
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/OrganizationController.java
View file @
f3a7aa52
...
...
@@ -6,18 +6,18 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.*
;
import
pwc.taxtech.atms.dpo.*
;
import
pwc.taxtech.atms.dpo.OrgBasicDto
;
import
pwc.taxtech.atms.dpo.OrgInfoDto
;
import
pwc.taxtech.atms.dpo.OrgSelectDto
;
import
pwc.taxtech.atms.dpo.OrganizationDto
;
import
pwc.taxtech.atms.dto.*
;
import
pwc.taxtech.atms.dto.organization.OrganizationExtraDto
;
import
pwc.taxtech.atms.dto.dimension.DimensionOrgDtoDashboard
;
import
pwc.taxtech.atms.dto.dimension.OrgDashboardParams
;
import
pwc.taxtech.atms.dto.navtree.DevTreeDto
;
import
pwc.taxtech.atms.dto.navtree.NavTreeDto
;
import
pwc.taxtech.atms.dto.organization.DimensionRoleDto
;
import
pwc.taxtech.atms.dto.organization.OrgDto
;
import
pwc.taxtech.atms.dto.organization.OrgGeneralInfoDto
;
import
pwc.taxtech.atms.dto.organization.UpdateOrgDimensionDto
;
import
pwc.taxtech.atms.dto.organization.*
;
import
pwc.taxtech.atms.dto.vatdto.JsonExportDto
;
import
pwc.taxtech.atms.organization.dpo.OrganizationHKDto
;
import
pwc.taxtech.atms.service.impl.OrganizationServiceImpl
;
import
pwc.taxtech.atms.service.impl.UserRoleServiceImpl
;
import
pwc.taxtech.atms.service.impl.UserServiceImpl
;
...
...
@@ -62,7 +62,7 @@ public class OrganizationController {
// @ApiOperation(value = "根据使用的方式获取机构的展示列表")
@RequestMapping
(
value
=
"display"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
List
<
OrganizationDto
>
getOrgList
(
@RequestParam
(
"useType"
)
Integer
useType
)
{
List
<
Organization
HK
Dto
>
getOrgList
(
@RequestParam
(
"useType"
)
Integer
useType
)
{
return
organizationService
.
getOrgList
(
useType
);
}
...
...
@@ -184,7 +184,7 @@ public class OrganizationController {
// @ApiOperation(value = "通过orgId获取一个组织的信息")
@RequestMapping
(
value
=
"displaySingle"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
Organization
Dto
getSingleOrgByOrgId
(
@RequestParam
(
"orgId"
)
Stri
ng
orgId
)
{
Organization
HKDto
getSingleOrgByOrgId
(
@RequestParam
(
"orgId"
)
Lo
ng
orgId
)
{
logger
.
info
(
"POST /api/v1/org/displaySingle"
);
return
organizationService
.
getSingleOrgByOrgId
(
orgId
);
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/OrganizationServiceImpl.java
View file @
f3a7aa52
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/RoleServiceImpl.java
View file @
f3a7aa52
...
...
@@ -511,73 +511,73 @@ public class RoleServiceImpl extends AbstractService {
}
public
List
<
UserRoleInfo
>
getAllOwnUserRoleList
()
{
logger
.
debug
(
"Start to get all own user roles"
);
List
<
User
>
userList
=
userService
.
findAllUsers
();
// 角色列表
List
<
Role
>
roleList
=
findAll
();
// 原始维度
List
<
UserRole
>
userRoleList
=
userRoleService
.
findAllUserRoles
();
List
<
Organization
>
organizationList
=
organizationService
.
findAllOrganizations
();
List
<
UserRoleInfo
>
retList
=
new
ArrayList
<>();
for
(
User
userItem
:
userList
)
{
List
<
UserRole
>
sameList
=
userRoleList
.
stream
().
filter
(
sa
->
userItem
.
getId
().
equals
(
sa
.
getUserId
()))
.
collect
(
Collectors
.
toList
());
List
<
Organization
>
orgList
=
organizationList
.
stream
()
.
filter
(
sa
->
sa
.
getId
().
equals
(
userItem
.
getOrganizationId
())).
collect
(
Collectors
.
toList
());
if
(
orgList
.
isEmpty
())
{
continue
;
}
Organization
org
=
orgList
.
get
(
0
);
UserRoleInfo
userRoleInfo
=
new
UserRoleInfo
();
userRoleInfo
.
setUserName
(
userItem
.
getUserName
());
userRoleInfo
.
setStatus
(
userItem
.
getStatus
());
userRoleInfo
.
setServiceTypeId
(
""
);
userRoleInfo
.
setRoleInfoList
(
new
ArrayList
<>());
userRoleInfo
.
setOrganizationName
(
org
.
getName
());
userRoleInfo
.
setOrganizationId
(
org
.
getId
());
userRoleInfo
.
setIsAccessible
(
true
);
userRoleInfo
.
setEmail
(
userItem
.
getEmail
());
userRoleInfo
.
setBusinessUnitId
(
org
.
getBusinessUnitId
());
userRoleInfo
.
setAreaId
(
org
.
getAreaId
());
userRoleInfo
.
setId
(
userItem
.
getId
());
List
<
RoleInfo
>
roleInfoList
=
new
ArrayList
<>();
for
(
UserRole
userRole
:
sameList
)
{
for
(
Role
role
:
roleList
)
{
if
(
role
.
getId
().
equals
(
userRole
.
getRoleId
()))
{
RoleInfo
roleInfo
=
new
RoleInfo
();
roleInfo
.
setDimensionId
(
""
);
roleInfo
.
setDimensionValue
(
""
);
roleInfo
.
setDimensionValueId
(
""
);
roleInfo
.
setId
(
role
.
getId
());
roleInfo
.
setIsAccessible
(
true
);
roleInfo
.
setIsHeritable
(
true
);
roleInfo
.
setName
(
role
.
getName
());
roleInfo
.
setRoleSource
(
RoleSourceEnum
.
OriginalLevel
.
value
());
roleInfoList
.
add
(
roleInfo
);
}
}
}
userRoleInfo
.
setRoleInfoList
(
roleInfoList
);
retList
.
add
(
userRoleInfo
);
}
// 这里可以一次查出来再合并
retList
.
forEach
(
l
->{
if
(
null
!=
l
.
getBusinessUnitId
()){
BusinessUnit
bu
=
businessUnitMapper
.
selectByPrimaryKey
(
l
.
getBusinessUnitId
());
if
(
bu
!=
null
){
l
.
setBusinessUnitName
(
bu
.
getName
());
}
}
if
(
null
!=
l
.
getAreaId
()){
Area
area
=
areaMapper
.
selectByPrimaryKey
(
l
.
getAreaId
());
if
(
area
!=
null
){
l
.
setAreaName
(
area
.
getName
());
}
}
});
return
retList
;
//
logger.debug("Start to get all own user roles");
//
List<User> userList = userService.findAllUsers();
//
// 角色列表
//
List<Role> roleList = findAll();
//
// 原始维度
//
List<UserRole> userRoleList = userRoleService.findAllUserRoles();
// List<OrganizationHK
> organizationList = organizationService.findAllOrganizations();
//
List<UserRoleInfo> retList = new ArrayList<>();
//
//
for (User userItem : userList) {
//
List<UserRole> sameList = userRoleList.stream().filter(sa -> userItem.getId().equals(sa.getUserId()))
//
.collect(Collectors.toList());
// List<OrganizationHK
> orgList = organizationList.stream()
//
.filter(sa -> sa.getId().equals(userItem.getOrganizationId())).collect(Collectors.toList());
//
if (orgList.isEmpty()) {
//
continue;
//
}
// OrganizationHK
org = orgList.get(0);
//
UserRoleInfo userRoleInfo = new UserRoleInfo();
//
userRoleInfo.setUserName(userItem.getUserName());
//
userRoleInfo.setStatus(userItem.getStatus());
//
userRoleInfo.setServiceTypeId("");
//
userRoleInfo.setRoleInfoList(new ArrayList<>());
//
userRoleInfo.setOrganizationName(org.getName());
//
userRoleInfo.setOrganizationId(org.getId());
//
userRoleInfo.setIsAccessible(true);
//
userRoleInfo.setEmail(userItem.getEmail());
//
userRoleInfo.setBusinessUnitId(org.getBusinessUnitId());
//
userRoleInfo.setAreaId(org.getAreaId());
//
userRoleInfo.setId(userItem.getId());
//
//
List<RoleInfo> roleInfoList = new ArrayList<>();
//
for (UserRole userRole : sameList) {
//
for (Role role : roleList) {
//
if (role.getId().equals(userRole.getRoleId())) {
//
RoleInfo roleInfo = new RoleInfo();
//
roleInfo.setDimensionId("");
//
roleInfo.setDimensionValue("");
//
roleInfo.setDimensionValueId("");
//
roleInfo.setId(role.getId());
//
roleInfo.setIsAccessible(true);
//
roleInfo.setIsHeritable(true);
//
roleInfo.setName(role.getName());
//
roleInfo.setRoleSource(RoleSourceEnum.OriginalLevel.value());
//
roleInfoList.add(roleInfo);
//
}
//
}
//
}
//
userRoleInfo.setRoleInfoList(roleInfoList);
//
retList.add(userRoleInfo);
//
}
//
// 这里可以一次查出来再合并
//
retList.forEach(l->{
//
if(null!=l.getBusinessUnitId()){
//
BusinessUnit bu = businessUnitMapper.selectByPrimaryKey(l.getBusinessUnitId());
//
if(bu!=null){
//
l.setBusinessUnitName(bu.getName());
//
}
//
}
//
if (null!=l.getAreaId()){
//
Area area = areaMapper.selectByPrimaryKey(l.getAreaId());
//
if(area!=null){
//
l.setAreaName(area.getName());
//
}
//
}
//
});
return
java
.
util
.
Collections
.
emptyList
()
;
}
public
List
<
UserRoleInfo
>
getAllUserRoleList
()
{
...
...
atms-dao/src/main/java/pwc/taxtech/atms/organization/dpo/OrganizationHKDto.java
0 → 100644
View file @
f3a7aa52
package
pwc
.
taxtech
.
atms
.
organization
.
dpo
;
import
pwc.taxtech.atms.organization.entity.OrganizationHK
;
import
java.util.List
;
public
class
OrganizationHKDto
extends
OrganizationHK
{
private
String
parentName
;
private
List
<
OrganizationHKDto
>
subOrgs
;
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
;
}
}
atms-web/src/main/webapp/app/admin/infrastructure/organizationManage/organization-manage.ctrl.js
View file @
f3a7aa52
...
...
@@ -335,55 +335,55 @@
}
});
var
loadUserRoleList
=
function
(
orgID
)
{
roleService
.
getUserRoleList
(
orgID
,
''
,
''
).
success
(
function
(
data
)
{
// 构造用户信息
var
roleStaticsList
=
[];
var
userRoleShowList
=
[];
if
(
data
&&
data
.
length
>
0
)
{
data
.
forEach
(
function
(
row
)
{
var
uniqRoleList
=
_
.
uniq
(
row
.
roleInfoList
,
function
(
item
)
{
return
item
.
name
});
row
.
roleNameList
=
_
.
map
(
uniqRoleList
,
function
(
x
)
{
return
x
.
name
;
}).
join
(
constant
.
comma
);
//var roleNames = _.pluck(row.roleInfoList, 'name');
//row.roleNameList = roleNames.join(',');
if
(
!
row
.
isAccessible
)
{
row
.
roleNameList
=
$translate
.
instant
(
'UnAccessable'
);
}
row
.
hasEditPermission
=
$scope
.
hasEditPermission
;
userRoleShowList
.
push
({
id
:
row
.
id
,
userName
:
row
.
userName
,
roleNameList
:
row
.
roleNameList
});
row
.
roleInfoList
.
forEach
(
function
(
role
)
{
var
one
=
_
.
find
(
roleStaticsList
,
function
(
data
)
{
return
data
.
id
===
role
.
id
;
});
if
(
one
)
{
one
.
count
++
;
}
else
{
role
.
count
=
1
;
roleStaticsList
.
push
(
role
);
}
});
});
}
$scope
.
roleStaticsList
=
roleStaticsList
;
$scope
.
userRoleList
=
JSON
.
stringify
(
userRoleShowList
);
$scope
.
userRoleGridOptions
.
data
=
data
;
//用户数统计
$scope
.
userCount
=
data
.
length
||
0
;
});
};
//
var loadUserRoleList = function (orgID) {
//
roleService.getUserRoleList(orgID, '', '').success(function (data) {
//
// 构造用户信息
//
var roleStaticsList = [];
//
//
var userRoleShowList = [];
//
if (data && data.length > 0) {
//
data.forEach(function (row) {
//
//
var uniqRoleList = _.uniq(row.roleInfoList, function (item) {
//
return item.name
//
});
//
row.roleNameList = _.map(uniqRoleList, function (x) {
//
return x.name;
//
}).join(constant.comma);
//
//
//var roleNames = _.pluck(row.roleInfoList, 'name');
//
//row.roleNameList = roleNames.join(',');
//
//
if (!row.isAccessible) {
//
row.roleNameList = $translate.instant('UnAccessable');
//
}
//
//
row.hasEditPermission = $scope.hasEditPermission;
//
//
userRoleShowList.push({id: row.id, userName: row.userName, roleNameList: row.roleNameList});
//
row.roleInfoList.forEach(function (role) {
//
var one = _.find(roleStaticsList, function (data) {
//
return data.id === role.id;
//
});
//
//
if (one) {
//
one.count++;
//
} else {
//
role.count = 1;
//
roleStaticsList.push(role);
//
}
//
});
//
});
//
}
//
//
$scope.roleStaticsList = roleStaticsList;
//
//
$scope.userRoleList = JSON.stringify(userRoleShowList);
//
$scope.userRoleGridOptions.data = data;
//
//用户数统计
//
$scope.userCount = data.length || 0;
//
});
//
};
// 选中机构
$scope
.
selectOrganization
=
function
(
branch
)
{
...
...
@@ -441,21 +441,21 @@
// $scope.editOrgExtraModel.unifiedSocialCreditCode = $scope.selectCompany.taxPayerNumber;
// $scope.selectCompanyExtra.unifiedSocialCreditCode = $scope.selectCompany.taxPayerNumber;
//加载用户权限list
loadUserRoleList
(
org
.
id
);
generalSelectCompanyText
();
//
loadUserRoleList(org.id);
//
generalSelectCompanyText();
cancelWebChange
();
// $scope.updateOrgExtraCancel()
});
orgService
.
getSingleOrgExtra
(
org
.
id
).
success
(
function
(
data
)
{
if
(
data
)
{
$scope
.
selectCompanyExtra
=
data
;
$scope
.
editOrgExtraModel
=
angular
.
copy
(
data
);
generalSelectCompanyExtraText
();
}
});
//
orgService.getSingleOrgExtra(org.id).success(function (data) {
//
if (data) {
//
$scope.selectCompanyExtra = data;
//
$scope.editOrgExtraModel = angular.copy(data);
// //
generalSelectCompanyExtraText();
//
}
//
});
// getEquityListByOrgId(org.id);
...
...
atms-web/src/main/webapp/app/common/controls/edit-organization-modal/edit-organization-modal.ctrl.js
View file @
f3a7aa52
...
...
@@ -754,12 +754,12 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
// 基础数据初始化
var
init
=
function
()
{
loadProjectIndustryList
();
//
loadProjectIndustryList();
loadOrganizationStructureService
();
loadBusinessUnitList
();
loadProvinceList
();
loadEnterpriseAccountSetList
();
getAllDimensionList
();
//
loadEnterpriseAccountSetList();
//
getAllDimensionList();
// loadprojectClient();
initDatePicker
();
};
...
...
@@ -1243,11 +1243,11 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
};
// 获取所有维度值和维度值配置信息
var
getAllDimensionList
=
function
()
{
dimensionService
.
getAllDimensionList
().
success
(
function
(
data
)
{
$scope
.
dimensionList
=
data
;
});
};
//
var getAllDimensionList = function () {
//
dimensionService.getAllDimensionList().success(function (data) {
//
$scope.dimensionList = data;
//
});
//
};
// 获取添加自定义纬度列表
var
getAddOrgSetDimension
=
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment