Commit f3a7aa52 authored by frank.xa.zhang's avatar frank.xa.zhang

fixed entity page backend-- frank

parent fee7b123
......@@ -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<OrganizationHKDto> 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
OrganizationDto getSingleOrgByOrgId(@RequestParam("orgId") String orgId) {
OrganizationHKDto getSingleOrgByOrgId(@RequestParam("orgId") Long orgId) {
logger.info("POST /api/v1/org/displaySingle");
return organizationService.getSingleOrgByOrgId(orgId);
}
......
......@@ -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() {
......
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;
}
}
......@@ -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);
......
......@@ -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 () {
......
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