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

fixed user module -- frank

parent 47cfc2df
...@@ -16,6 +16,7 @@ import pwc.taxtech.atms.dto.permission.UserPermissionDto; ...@@ -16,6 +16,7 @@ import pwc.taxtech.atms.dto.permission.UserPermissionDto;
import pwc.taxtech.atms.dto.permission.UserPermissionKeyDto; import pwc.taxtech.atms.dto.permission.UserPermissionKeyDto;
import pwc.taxtech.atms.dto.user.*; import pwc.taxtech.atms.dto.user.*;
import pwc.taxtech.atms.entity.User; import pwc.taxtech.atms.entity.User;
import pwc.taxtech.atms.organization.dpo.UserAndUserRoleSaveHKDto;
import pwc.taxtech.atms.service.impl.RoleServiceImpl; import pwc.taxtech.atms.service.impl.RoleServiceImpl;
import pwc.taxtech.atms.service.impl.UserAccountServiceImpl; import pwc.taxtech.atms.service.impl.UserAccountServiceImpl;
import pwc.taxtech.atms.service.impl.UserRoleServiceImpl; import pwc.taxtech.atms.service.impl.UserRoleServiceImpl;
...@@ -83,7 +84,7 @@ public class UserController { ...@@ -83,7 +84,7 @@ public class UserController {
// @ApiOperation(value = "根据传入的用户Id获取该用户的角色机构等信息") // @ApiOperation(value = "根据传入的用户Id获取该用户的角色机构等信息")
@RequestMapping(value = "displaySingle", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "displaySingle", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public UserAndUserRoleSaveDto getSingleUserByUserId(@RequestParam("userId") String userId) { public UserAndUserRoleSaveHKDto getSingleUserByUserId(@RequestParam("userId") String userId) {
return userRoleService.getSingleUserByUserId(userId); return userRoleService.getSingleUserByUserId(userId);
} }
......
...@@ -6,50 +6,28 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -6,50 +6,28 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import pwc.taxtech.atms.common.CommonConstants; import pwc.taxtech.atms.common.*;
import pwc.taxtech.atms.common.CommonUtils;
import pwc.taxtech.atms.common.OperateLogType;
import pwc.taxtech.atms.common.OperationAction;
import pwc.taxtech.atms.common.OperationModule;
import pwc.taxtech.atms.common.RoleSourceEnum;
import pwc.taxtech.atms.common.UserStatus;
import pwc.taxtech.atms.common.message.LogMessage; import pwc.taxtech.atms.common.message.LogMessage;
import pwc.taxtech.atms.common.message.UserMessage; import pwc.taxtech.atms.common.message.UserMessage;
import pwc.taxtech.atms.constant.DimensionConstant; import pwc.taxtech.atms.constant.DimensionConstant;
import pwc.taxtech.atms.constant.UserConstant; import pwc.taxtech.atms.constant.UserConstant;
import pwc.taxtech.atms.dpo.DimensionValueOrgDto; import pwc.taxtech.atms.dpo.*;
import pwc.taxtech.atms.dpo.OrganizationDto;
import pwc.taxtech.atms.dpo.RoleInfo;
import pwc.taxtech.atms.dpo.UserDto;
import pwc.taxtech.atms.dpo.UserOrgDto;
import pwc.taxtech.atms.dpo.UserOrgRoleDto;
import pwc.taxtech.atms.dpo.UserRoleQuery; import pwc.taxtech.atms.dpo.UserRoleQuery;
import pwc.taxtech.atms.dto.OperationResultDto; import pwc.taxtech.atms.dto.OperationResultDto;
import pwc.taxtech.atms.dto.UpdateLogParams; import pwc.taxtech.atms.dto.UpdateLogParams;
import pwc.taxtech.atms.dto.organization.DimensionRoleDto; import pwc.taxtech.atms.dto.organization.*;
import pwc.taxtech.atms.dto.organization.OrgCustomDto;
import pwc.taxtech.atms.dto.organization.OrgRoleDto;
import pwc.taxtech.atms.dto.organization.OrgRoleDtoList;
import pwc.taxtech.atms.dto.organization.SimpleRoleDto;
import pwc.taxtech.atms.dto.role.RoleDto; import pwc.taxtech.atms.dto.role.RoleDto;
import pwc.taxtech.atms.dto.user.DimensionUser; import pwc.taxtech.atms.dto.user.*;
import pwc.taxtech.atms.dto.user.NameDto;
import pwc.taxtech.atms.dto.user.OrganizationRoleInfo;
import pwc.taxtech.atms.dto.user.UpdateParam;
import pwc.taxtech.atms.dto.user.UserAndUserRoleSaveDto;
import pwc.taxtech.atms.dto.user.UserOrganizationDto;
import pwc.taxtech.atms.dto.user.UserRoleDimensionValueDto;
import pwc.taxtech.atms.dto.user.UserRoleDisplayInfo;
import pwc.taxtech.atms.dto.user.UserRoleQueryDto;
import pwc.taxtech.atms.entity.*; import pwc.taxtech.atms.entity.*;
import pwc.taxtech.atms.entity.UserRoleExample.Criteria; import pwc.taxtech.atms.entity.UserRoleExample.Criteria;
import pwc.taxtech.atms.exception.ApplicationException; import pwc.taxtech.atms.exception.ApplicationException;
import pwc.taxtech.atms.organization.dao.OrganizationHKMapper;
import pwc.taxtech.atms.organization.dpo.UserAndUserRoleSaveHKDto;
import pwc.taxtech.atms.organization.entity.OrganizationHK;
import pwc.taxtech.atms.organization.mapper.UserAndRoleTMapper;
import java.util.ArrayList; import javax.annotation.Resource;
import java.util.HashMap; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -285,11 +263,17 @@ public class UserRoleServiceImpl extends AbstractService { ...@@ -285,11 +263,17 @@ public class UserRoleServiceImpl extends AbstractService {
return organizationService.getDimensionValueOrgDtoList(); return organizationService.getDimensionValueOrgDtoList();
} }
public UserAndUserRoleSaveDto getSingleUserByUserId(String userId) { @Autowired
UserAndUserRoleSaveDto userDto = new UserAndUserRoleSaveDto(); private UserAndRoleTMapper userAndRoleTMapper;
@Resource
private OrganizationHKMapper organizationHKMapper;
public UserAndUserRoleSaveHKDto getSingleUserByUserId(String userId) {
UserAndUserRoleSaveHKDto userDto = new UserAndUserRoleSaveHKDto();
User user = userMapper.selectByPrimaryKey(userId); User user = userMapper.selectByPrimaryKey(userId);
if (user != null) { if (user != null) {
userDto = CommonUtils.copyProperties(user, new UserAndUserRoleSaveDto()); userDto = userAndRoleTMapper.toUserAndUserRoleSaveHKDto(user);
// get role list by user // get role list by user
List<Map<String, String>> query = myUserMapper.selectUserRoleListByUserId(userId).stream().distinct() List<Map<String, String>> query = myUserMapper.selectUserRoleListByUserId(userId).stream().distinct()
.collect(Collectors.toList()); .collect(Collectors.toList());
...@@ -304,8 +288,9 @@ public class UserRoleServiceImpl extends AbstractService { ...@@ -304,8 +288,9 @@ public class UserRoleServiceImpl extends AbstractService {
userDto.setRoleIds(arrUserRole); userDto.setRoleIds(arrUserRole);
userDto.setRoleNames(arrUserRoleName); userDto.setRoleNames(arrUserRoleName);
// get org name // get org name
Organization org = organizationMapper.selectByPrimaryKey(user.getOrganizationId()); OrganizationHK org = organizationHKMapper.selectByPrimaryKey(Long.valueOf(user.getOrganizationId()));
if (org != null) { if (org != null) {
userDto.setOrganizationId(user.getOrganizationId());
userDto.setOrgName(org.getName()); userDto.setOrgName(org.getName());
} }
} }
......
package pwc.taxtech.atms.organization.dpo;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
import java.util.List;
@Getter
@Setter
public class UserAndUserRoleSaveHKDto {
@JsonProperty("ID")
private String id;
private String userName;
private String email;
private String password;
private Integer loginType;
private Integer status;
private Date expirationDate;
private Date createTime;
private Date updateTime;
private Boolean isAdmin;
private Date passwordUpdateTime;
private Integer attemptTimes;
private Date lockedTime;
@JsonProperty("organizationID")
private String organizationId;
private String orgName;
@JsonProperty("roleIDs")
private List<String> roleIds;
private List<String> roleNames;
}
package pwc.taxtech.atms.organization.mapper;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import pwc.taxtech.atms.entity.User;
import pwc.taxtech.atms.organization.dpo.UserAndUserRoleSaveHKDto;
@Mapper(componentModel = "spring")
public interface UserAndRoleTMapper {
UserAndRoleTMapper USER_AND_ROLE_T_MAPPER = Mappers.getMapper(UserAndRoleTMapper.class);
UserAndUserRoleSaveHKDto toUserAndUserRoleSaveHKDto(User user);
}
...@@ -8,21 +8,21 @@ ...@@ -8,21 +8,21 @@
<div class="content-container"> <div class="content-container">
<div class="header"> <div class="header">
<button ng-if="hasAddPermission" type="button" class="btn btn-in-grid" ng-click="createUser()"><i class="material-icons middle icon-add">add_circle_outline</i> {{'CreateUser' | translate }}</button> <button ng-if="hasAddPermission" type="button" class="btn btn-in-grid" ng-click="createUser()"><i class="material-icons middle icon-add">add_circle_outline</i> {{'CreateUser' | translate }}</button>
<div class="align-right" style="margin-top:5px;"> <div class="align-right" style="margin-top:5px;">
<!--<button class="btn btn-export" type="button" ng-click="" translate="Export"></button>--> <!--<button class="btn btn-export" type="button" ng-click="" translate="Export"></button>-->
<!--<export-button style="float: right; margin-left: 0px; margin-top: 7px"><export-button>--> <!--<export-button style="float: right; margin-left: 0px; margin-top: 7px"><export-button>-->
</div> </div>
<div class="right-operate "> <div class="right-operate ">
<!-- board展示 --> <!-- board展示 -->
<a class="display-user" href="#/user"><i class="fa fa-th" aria-hidden="true"></i></a><a class="display-user border-left active"> <a class="display-user" href="#/user"><i class="fa fa-th" aria-hidden="true"></i></a><a class="display-user border-left active">
<!-- list展示 --> <!-- list展示 -->
<i class="fa fa-list-ul" aria-hidden="true"></i></a> <i class="fa fa-list-ul" aria-hidden="true"></i></a>
</div> </div>
</div> </div>
<div class="user-grid"> <div class="user-grid">
<span style="margin-left:30px; position: absolute;left: 249px;top: 132px;z-index: 999;">{{'TotalHave'| translate}}<span style="color:red; padding:0px 2px">{{totalCount}}</span>{{'Records'| translate}}</span> <span style="margin-left:30px; position: absolute;left: 249px;top: 132px;z-index: 999;">{{'TotalHave'| translate}}<span
style="color:red; padding:0px 2px">{{totalCount}}</span>{{'Records'| translate}}</span>
<div class="dx-viewport grid-container"> <div class="dx-viewport grid-container">
<div id="userGridContainer" dx-data-grid="userTreeOptions"></div> <div id="userGridContainer" dx-data-grid="userTreeOptions"></div>
</div> </div>
......
...@@ -617,28 +617,6 @@ ...@@ -617,28 +617,6 @@
} }
} }
// 事业部筛选
// if ($scope.selectBusinessUnitList && $scope.selectBusinessUnitList.length > 0) {
// var query = _.filter($scope.selectBusinessUnitList, function (row) {
// return row.ID === user.businessUnitID;
// });
//
// if (!query || query.length === 0) {
// continue;
// }
// }
// 区域
// if ($scope.selectAreaList && $scope.selectAreaList.length > 0) {
// var query = _.filter($scope.selectAreaList, function (row) {
// return row.ID === user.areaID;
// });
//
// if (!query || query.length === 0) {
// continue;
// }
// }
// 角色筛选 // 角色筛选
if ($scope.selectRoleList && $scope.selectRoleList.length > 0) { if ($scope.selectRoleList && $scope.selectRoleList.length > 0) {
var roleIdList = _.pluck(user.roleInfoList, 'ID'); var roleIdList = _.pluck(user.roleInfoList, 'ID');
......
...@@ -48,38 +48,6 @@ ...@@ -48,38 +48,6 @@
</div> </div>
</div> </div>
</div> </div>
<!--事业部-->
<!--<div class="dimension-block">-->
<!--<div class="text-location" ng-click="showMoreBusinessUnitClick()">-->
<!--<span class="text-title" translate="FieldbusinessUnitName"></span>-->
<!--<span class="show-more">-->
<!--<i class="fa fa-angle-down" aria-hidden="true" ng-show="!showMoreBusinessUnit"></i>-->
<!--<i class="fa fa-angle-up" aria-hidden="true" ng-show="showMoreBusinessUnit"></i>-->
<!--</span>-->
<!--</div>-->
<!--<div class="list-container" ng-class="{false:'show-less',true:''}[showMoreBusinessUnit]">-->
<!--<div ng-repeat="x in businessUnitList" class="business-item" ng-class="{true:'active',false:''}[x.selected]" ng-click="singleClickBusinessUnit(x)">-->
<!--<span title="{{x.name}}">{{x.name | limitString:20}}</span>-->
<!--<span ng-if="x.isShowCount" class="label-count">{{x.count}}</span>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!-- 区域 -->
<!--<div class="dimension-block">-->
<!--<div class="text-location" ng-click="showMoreAreaToggle()">-->
<!--<span class="text-title" translate="OrgArea"></span>-->
<!--<span class="show-more">-->
<!--<i class="fa fa-angle-down" aria-hidden="true" ng-show="!showMoreArea"></i>-->
<!--<i class="fa fa-angle-up" aria-hidden="true" ng-show="showMoreArea"></i>-->
<!--</span>-->
<!--</div>-->
<!--<div class="list-container" ng-class="{false:'show-less',true:''}[showMoreArea]">-->
<!--<div ng-repeat="x in areaList" class="business-item" class="business-item" ng-class="{true:'active',false:''}[x.selected]" ng-click="singleClickArea(x)">-->
<!--<span title="{{x.name}}">{{x.name | limitString:20}}</span>-->
<!--<span ng-if="x.isShowCount" class="label-count">{{x.count}}</span>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--角色--> <!--角色-->
<div class="dimension-block"> <div class="dimension-block">
<div class="text-location" ng-click="showMoreRoleToggle()"> <div class="text-location" ng-click="showMoreRoleToggle()">
...@@ -119,16 +87,6 @@ ...@@ -119,16 +87,6 @@
{{'ProjectCompanyCol'|translate}}:{{x.label}} {{'ProjectCompanyCol'|translate}}:{{x.label}}
<span ng-click="singleClickOrg(x)">×</span> <span ng-click="singleClickOrg(x)">×</span>
</div> </div>
<!-- 选择事业部 -->
<!--<div class="query-item" ng-repeat="x in selectBusinessUnitList ">-->
<!--{{'FieldbusinessUnitName'|translate}}:{{x.name}}-->
<!--<span ng-click="singleClickBusinessUnit(x)">×</span>-->
<!--</div>-->
<!-- 选择区域 -->
<!--<div class="query-item" ng-repeat="x in selectAreaList ">-->
<!--{{'OrgArea'|translate}}:{{x.name}}-->
<!--<span ng-click="singleClickArea(x)">×</span>-->
<!--</div>-->
<!-- 选择角色 --> <!-- 选择角色 -->
<div class="query-item" ng-repeat="x in selectRoleList "> <div class="query-item" ng-repeat="x in selectRoleList ">
{{'RoleDesc'|translate}}:{{x.label}} {{'RoleDesc'|translate}}:{{x.label}}
...@@ -232,8 +190,7 @@ ...@@ -232,8 +190,7 @@
<i class="fa fa-plus tree-i" aria-hidden="true" ng-click="toggle(this)" ng-class="{hidden: !collapsed}"></i> <i class="fa fa-plus tree-i" aria-hidden="true" ng-click="toggle(this)" ng-class="{hidden: !collapsed}"></i>
<i class="fa fa-minus tree-i" aria-hidden="true" ng-click="toggle(this)" ng-class="{hidden: collapsed}"></i> <i class="fa fa-minus tree-i" aria-hidden="true" ng-click="toggle(this)" ng-class="{hidden: collapsed}"></i>
</div> </div>
<div class="tree-role-item" ng-class="{true:'tree-item-select',false:''}[role.selected]" ng-click="singleClickRole <div class="tree-role-item" ng-class="{true:'tree-item-select',false:''}[role.selected]" ng-click="singleClickRole(role)">
(role)">
<span title="{{role.label}}">{{role.label | limitString:20}}</span> <span title="{{role.label}}">{{role.label | limitString:20}}</span>
<span ng-if="role.isShowCount" class="label-count">{{role.count}}</span> <span ng-if="role.isShowCount" class="label-count">{{role.count}}</span>
</div> </div>
......
...@@ -9,8 +9,8 @@ controller('editUserModalController', ['$scope', '$log', '$translate', 'uiGridCo ...@@ -9,8 +9,8 @@ controller('editUserModalController', ['$scope', '$log', '$translate', 'uiGridCo
$scope.editUserModel.isAdmin = false; $scope.editUserModel.isAdmin = false;
//按滴滴需求设置用户所属机构默认为滴滴集团 //按滴滴需求设置用户所属机构默认为滴滴集团
$scope.editUserModel.OrganizationID = "BCFA0E77-9F6B-42B3-A486-A003536832CF"; $scope.editUserModel.OrganizationID = "140525724258930688";
$scope.editUserModel.orgName = "滴滴集团"; // $scope.editUserModel.orgName = "滴滴集团";
resetErrorStatus(); resetErrorStatus();
$('.edit-user-modal-wrapper .modal').modal('show'); $('.edit-user-modal-wrapper .modal').modal('show');
......
...@@ -33,15 +33,15 @@ ...@@ -33,15 +33,15 @@
ng-model="editUserModel.Email" required> ng-model="editUserModel.Email" required>
</div> </div>
</div> </div>
<div class="form-group"> <!--<div class="form-group">-->
<label class="control-label col-sm-3"><span class="red-color">*</span><span translate="Company"></label> <!--<label class="control-label col-sm-3"><span class="red-color">*</span><span translate="Company"></label>-->
<div class="col-sm-9"> <!--<div class="col-sm-9">-->
<!--<input id="orgName" type="text" name="orgName" maxlength="100" class="form-control" style="width: 300px;" ng-model="editUserModel.orgName" readonly="readonly" required>--> <!--<input id="orgName" type="text" name="orgName" maxlength="100" class="form-control" style="width: 300px;" ng-model="editUserModel.orgName" readonly="readonly" required>-->
<org-selector selected-org-name="editUserModel.OrgName" selected-org-id="editUserModel.OrganizationID" component-selected-org="" is-show-all="false" is-require="true" <!--<org-selector selected-org-name="editUserModel.OrgName" selected-org-id="editUserModel.OrganizationID" component-selected-org="" is-show-all="false" is-require="true"-->
style="width: 300px;"></org-selector> <!--style="width: 300px;"></org-selector>-->
<label class="error-label" style="font-size:12px;" ng-show="editUserModel.organizationIDError">{{editUserModel.organizationIDError}}</label> <!--<label class="error-label" style="font-size:12px;" ng-show="editUserModel.organizationIDError">{{editUserModel.organizationIDError}}</label>-->
</div> <!--</div>-->
</div> <!--</div>-->
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3" translate="DefaultRole"></label> <label class="control-label col-sm-3" translate="DefaultRole"></label>
<div class="col-sm-9"> <div class="col-sm-9">
......
commonModule.controller('orgSelectorController', ['$scope', 'orgService', '$translate', 'userService', 'loginContext', commonModule.controller('orgSelectorController', ['$scope', 'orgService', '$translate', 'userService', 'loginContext','orgHKService',
function ($scope, orgService, $translate, userService, loginContext) { function ($scope, orgService, $translate, userService, loginContext,orgHKService) {
var NoOptions = { var NoOptions = {
'id': constant.organization.parentIdNull, 'id': constant.organization.parentIdNull,
...@@ -16,7 +16,7 @@ function ($scope, orgService, $translate, userService, loginContext) { ...@@ -16,7 +16,7 @@ function ($scope, orgService, $translate, userService, loginContext) {
$scope.isAdminUser = false; $scope.isAdminUser = false;
var useType = $scope.isShowAll ? 1 : 0; var useType = $scope.isShowAll ? 1 : 0;
orgService.getOrgList(useType).success(function (data) { orgHKService.getOrgList(useType).success(function (data) {
if (data && data.length > 0) { if (data && data.length > 0) {
if ($scope.selectNoOption) { if ($scope.selectNoOption) {
data.splice(0, 0, NoOptions); data.splice(0, 0, NoOptions);
......
...@@ -58,6 +58,9 @@ webservices.factory('orgHKService', ['$http', 'apiConfig', function ($http, apiC ...@@ -58,6 +58,9 @@ webservices.factory('orgHKService', ['$http', 'apiConfig', function ($http, apiC
// }, // },
getOrgTreeData: function (orgId) { getOrgTreeData: function (orgId) {
return $http.get('/orgHK/getOrgTreeData?orgId=' + orgId, apiConfig.create()); return $http.get('/orgHK/getOrgTreeData?orgId=' + orgId, apiConfig.create());
},
getOrgList: function (type) {
return $http.get('/org/display?useType=' + type, 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