From e74b13eaf8b837356357125a0fa179d6f7de5b08 Mon Sep 17 00:00:00 2001 From: MaxKey Date: Thu, 26 May 2022 17:13:39 +0800 Subject: [PATCH] status fix --- .../maxkey/constants/ConstsOperateAction.java | 3 + .../src/app/entity/BaseEntity.ts | 9 +- .../maxkey-web-app/src/app/entity/Users.ts | 18 +- .../config/profile/profile.component.html | 721 ++++++++---------- .../config/profile/profile.component.ts | 7 +- .../maxkey-web-app/src/assets/i18n/en-US.json | 1 + .../maxkey-web-app/src/assets/i18n/zh-CN.json | 5 +- .../routes/accounts/accounts.component.html | 9 +- .../user-editer/user-editer.component.html | 1 + .../src/app/routes/users/users.component.html | 8 +- .../src/assets/i18n/en-US.json | 1 + .../src/assets/i18n/zh-CN.json | 1 + .../src/style-icons-auto.ts | 5 + .../web/contorller/AccountsController.java | 7 + .../web/contorller/UserInfoController.java | 3 + 15 files changed, 378 insertions(+), 421 deletions(-) diff --git a/maxkey-core/src/main/java/org/maxkey/constants/ConstsOperateAction.java b/maxkey-core/src/main/java/org/maxkey/constants/ConstsOperateAction.java index c9ba603b0..adce61f9d 100644 --- a/maxkey-core/src/main/java/org/maxkey/constants/ConstsOperateAction.java +++ b/maxkey-core/src/main/java/org/maxkey/constants/ConstsOperateAction.java @@ -37,6 +37,8 @@ public final class ConstsOperateAction { public static final String DISABLE = "disable"; + public static final String INACTIVE = "inactive"; + public static final String LOCK = "lock"; public static final String UNLOCK = "unlock"; @@ -49,6 +51,7 @@ public final class ConstsOperateAction { statusActon= new ConcurrentHashMap(); statusActon.put(ConstsStatus.ACTIVE, ENABLE); statusActon.put(ConstsStatus.DISABLED, DISABLE); + statusActon.put(ConstsStatus.INACTIVE, INACTIVE); statusActon.put(ConstsStatus.LOCK, LOCK); statusActon.put(ConstsStatus.UNLOCK, UNLOCK); statusActon.put(ConstsStatus.DELETE, DELETE); diff --git a/maxkey-web-frontend/maxkey-web-app/src/app/entity/BaseEntity.ts b/maxkey-web-frontend/maxkey-web-app/src/app/entity/BaseEntity.ts index 663016f6a..d99df780a 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/app/entity/BaseEntity.ts +++ b/maxkey-web-frontend/maxkey-web-app/src/app/entity/BaseEntity.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - export class BaseEntity { id!: String; @@ -23,6 +22,7 @@ export class BaseEntity { status!: Number; description!: String; switch_status: boolean = false; + str_status!: String; constructor() { this.status = 1; @@ -31,6 +31,7 @@ export class BaseEntity { Object.assign(this, data); if (this.status == 1) { this.switch_status = true; + this.str_status = `${this.status}`; } } trans(): void { diff --git a/maxkey-web-frontend/maxkey-web-app/src/app/entity/Users.ts b/maxkey-web-frontend/maxkey-web-app/src/app/entity/Users.ts index 62af1b50e..062de06bc 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/app/entity/Users.ts +++ b/maxkey-web-frontend/maxkey-web-app/src/app/entity/Users.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - import { BaseEntity } from './BaseEntity'; @@ -143,7 +142,8 @@ export class Users extends BaseEntity { switch_dynamic: boolean = false; gender_select!: String; - + str_married!: String; + str_idType!: String; constructor() { super(); this.status = 1; @@ -152,6 +152,8 @@ export class Users extends BaseEntity { this.userType = 'EMPLOYEE'; this.userState = 'RESIDENT'; this.gender_select = '1'; + this.str_married = '0'; + this.str_idType = '0'; } override init(data: any): void { @@ -164,6 +166,9 @@ export class Users extends BaseEntity { } else { this.gender_select = '2'; } + this.str_status = `${this.status}`; + this.str_married = `${this.married}`; + this.str_idType = `${this.idType}`; } override trans(): void { if (this.switch_status) { @@ -177,5 +182,8 @@ export class Users extends BaseEntity { } else { this.gender = 2; } + this.status = Number.parseInt(`${this.str_status}`); + this.married = Number.parseInt(`${this.str_married}`); + this.idType = Number.parseInt(`${this.str_idType}`); } } diff --git a/maxkey-web-frontend/maxkey-web-app/src/app/routes/config/profile/profile.component.html b/maxkey-web-frontend/maxkey-web-app/src/app/routes/config/profile/profile.component.html index e2250946b..af4673251 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/app/routes/config/profile/profile.component.html +++ b/maxkey-web-frontend/maxkey-web-app/src/app/routes/config/profile/profile.component.html @@ -10,47 +10,36 @@ {{ 'mxk.text.id' | i18n }} - - + +
- {{ 'mxk.users.displayName' | i18n }} - - + {{ 'mxk.users.displayName' | i18n }} + + +
- {{ 'mxk.users.username' | i18n }} - - + {{ 'mxk.users.username' | i18n }} + + +
{{ 'mxk.users.gender' | i18n }} - + @@ -59,28 +48,19 @@ - {{ 'mxk.users.picture' | i18n }} + {{ 'mxk.users.picture' | i18n }} +
- +
Upload
- + @@ -90,72 +70,103 @@
- {{ 'mxk.users.employeeNumber' | i18n }} - - + {{ 'mxk.users.employeeNumber' | i18n }} + + + - {{ 'mxk.users.windowsAccount' | i18n }} + {{ 'mxk.users.windowsAccount' | i18n }} + - +
- {{ 'mxk.users.mobile' | i18n }} - - + {{ 'mxk.users.mobile' | i18n }} + + - {{ 'mxk.users.email' | i18n }} - - + {{ 'mxk.users.email' | i18n }} + +
+
- {{ 'mxk.users.userType' | i18n }} - - + {{ 'mxk.users.userType' | i18n }} + + + + + + + + + + + + + + - {{ 'mxk.users.userstate' | i18n }} - - + {{ 'mxk.users.userstate' | i18n }} + + + + + + + + + + + +
+ +
+ + {{ 'mxk.text.sortIndex' | i18n }} + + + + + + + {{ 'mxk.text.status' | i18n }} + + + + + + + + +
@@ -163,53 +174,37 @@
- {{ 'mxk.users.familyName' | i18n }} + {{ 'mxk.users.familyName' | i18n }} + - + - {{ 'mxk.users.middleName' | i18n }} + {{ 'mxk.users.middleName' | i18n }} + - +
- {{ 'mxk.users.givenName' | i18n }} + {{ 'mxk.users.givenName' | i18n }} + - + - {{ 'mxk.users.nickName' | i18n }} + {{ 'mxk.users.nickName' | i18n }} + - +
@@ -217,19 +212,22 @@ {{ 'mxk.users.idtype' | i18n }} - + + + + + + + - {{ 'mxk.users.idCardNo' | i18n }} + {{ 'mxk.users.idCardNo' | i18n }} + - +
@@ -237,45 +235,41 @@ {{ 'mxk.users.married' | i18n }} - + + + + + + + - {{ 'mxk.users.birthDate' | i18n }} + {{ 'mxk.users.birthDate' | i18n }} + - +
- {{ 'mxk.users.preferredLanguage' | i18n }} + {{ 'mxk.users.preferredLanguage' | + i18n }} + - + - {{ 'mxk.users.startWorkDate' | i18n }} + {{ 'mxk.users.startWorkDate' | i18n }} + - +
@@ -283,19 +277,15 @@ {{ 'mxk.users.website' | i18n }} - + {{ 'mxk.users.ims' | i18n }} - + @@ -303,168 +293,120 @@
- {{ 'mxk.users.organization' | i18n }} - - + {{ 'mxk.users.organization' | i18n }} + + + - {{ 'mxk.users.division' | i18n }} - - + {{ 'mxk.users.division' | i18n }} + + +
- {{ 'mxk.users.departmentId' | i18n }} - - + {{ 'mxk.users.departmentId' | i18n }} + + + - {{ 'mxk.users.department' | i18n }} - - + {{ 'mxk.users.department' | i18n }} + + +
- {{ 'mxk.users.costCenter' | i18n }} - - + {{ 'mxk.users.costCenter' | i18n }} + + + - {{ 'mxk.users.jobLevel' | i18n }} - - + {{ 'mxk.users.jobLevel' | i18n }} + + +
- {{ 'mxk.users.jobTitle' | i18n }} - - + {{ 'mxk.users.jobTitle' | i18n }} + + + {{ 'mxk.users.manager' | i18n }} - - + +
- {{ 'mxk.users.assistant' | i18n }} - - + {{ 'mxk.users.assistant' | i18n }} + + + - {{ 'mxk.users.workOfficeName' | i18n }} - - + {{ 'mxk.users.workOfficeName' | i18n }} + + +
- {{ 'mxk.users.entryDate' | i18n }} - - + {{ 'mxk.users.entryDate' | i18n }} + + + - {{ 'mxk.users.quitDate' | i18n }} - - + {{ 'mxk.users.quitDate' | i18n }} + + +
@@ -472,93 +414,80 @@
- {{ 'mxk.users.workPhoneNumber' | i18n }} - - + {{ 'mxk.users.workPhoneNumber' | i18n }} + + + - {{ 'mxk.users.workEmail' | i18n }} - - + {{ 'mxk.users.workEmail' | i18n }} + + +
- {{ 'mxk.users.workCountry' | i18n }} - - + {{ 'mxk.users.workCountry' | i18n }} + + + - {{ 'mxk.users.workRegion' | i18n }} - - + {{ 'mxk.users.workRegion' | i18n }} + + +
- {{ 'mxk.users.workLocality' | i18n }} - - + {{ 'mxk.users.workLocality' | i18n }} + + + - {{ 'mxk.users.workStreetAddress' | i18n }} - - + {{ 'mxk.users.workStreetAddress' | i18n }} + + +
- {{ 'mxk.users.workPostalCode' | i18n }} - - + {{ 'mxk.users.workPostalCode' | i18n }} + + + {{ 'mxk.users.workFax' | i18n }} - - + +
@@ -566,93 +495,81 @@
- {{ 'mxk.users.homeEmail' | i18n }} - - + {{ 'mxk.users.homeEmail' | i18n }} + + + - {{ 'mxk.users.homePhoneNumber' | i18n }} - - + {{ 'mxk.users.homePhoneNumber' | i18n }} + + +
{{ 'mxk.users.homeFax' | i18n }} - - + + - {{ 'mxk.users.homePostalCode' | i18n }} - - + {{ 'mxk.users.homePostalCode' | i18n }} + + +
- {{ 'mxk.users.homeCountry' | i18n }} - - + {{ 'mxk.users.homeCountry' | i18n }} + + + - {{ 'mxk.users.homeRegion' | i18n }} - - + {{ 'mxk.users.homeRegion' | i18n }} + + +
- {{ 'mxk.users.homeLocality' | i18n }} - - + {{ 'mxk.users.homeLocality' | i18n }} + + + - {{ 'mxk.users.homeStreetAddress' | i18n }} - - + {{ 'mxk.users.homeStreetAddress' | + i18n }} + + +
@@ -671,4 +588,4 @@
- + \ No newline at end of file diff --git a/maxkey-web-frontend/maxkey-web-app/src/app/routes/config/profile/profile.component.ts b/maxkey-web-frontend/maxkey-web-app/src/app/routes/config/profile/profile.component.ts index ce8d8b697..15ce78c28 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/app/routes/config/profile/profile.component.ts +++ b/maxkey-web-frontend/maxkey-web-app/src/app/routes/config/profile/profile.component.ts @@ -1,19 +1,18 @@ /* * Copyright [2022] [MaxKey of copyright http://www.maxkey.top] - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ - import { Component, ChangeDetectorRef, Input, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; diff --git a/maxkey-web-frontend/maxkey-web-app/src/assets/i18n/en-US.json b/maxkey-web-frontend/maxkey-web-app/src/assets/i18n/en-US.json index 3f4e1b6d8..b5e7a74e4 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/assets/i18n/en-US.json +++ b/maxkey-web-frontend/maxkey-web-app/src/assets/i18n/en-US.json @@ -153,6 +153,7 @@ "status.lock":"Locked", "status.inactive":"Inactive", "status.delete":"Deleted", + "status.forbidden":"Forbidden", "userstate":"UserState", "userstate.resident":"Resident", "userstate.withdrawn":"Withdrawn", diff --git a/maxkey-web-frontend/maxkey-web-app/src/assets/i18n/zh-CN.json b/maxkey-web-frontend/maxkey-web-app/src/assets/i18n/zh-CN.json index 4496187c8..7e3fadd3a 100644 --- a/maxkey-web-frontend/maxkey-web-app/src/assets/i18n/zh-CN.json +++ b/maxkey-web-frontend/maxkey-web-app/src/assets/i18n/zh-CN.json @@ -50,8 +50,8 @@ }, "audit" : { "": "审计", - "logins": "登录日志", - "loginapps": "应用登录日志", + "logins": "系统登录日志", + "loginapps": "应用访问日志", "synchronizer": "同步器日志", "connector": "连接器日志", "operate": "管理日志" @@ -157,6 +157,7 @@ "status.lock":"锁定", "status.inactive":"不活动", "status.delete":"已删除", + "status.forbidden":"禁用", "userstate":"用户状态", "userstate.resident":"在职", "userstate.withdrawn":"离职", diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/accounts/accounts.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/accounts/accounts.component.html index 6f4bf7309..b0cf32089 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/accounts/accounts.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/accounts/accounts.component.html @@ -75,7 +75,8 @@ {{ data.relatedUsername }} - + +
@@ -83,7 +84,11 @@ style="float: left">{{ 'mxk.text.enable' | i18n }} - + diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/user-editer/user-editer.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/user-editer/user-editer.component.html index 313620864..70f7b94fb 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/user-editer/user-editer.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/user-editer/user-editer.component.html @@ -164,6 +164,7 @@ id="status"> + diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/users.component.html b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/users.component.html index 9a1261b47..92c4ef873 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/users.component.html +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/app/routes/users/users.component.html @@ -95,7 +95,8 @@ i18n) }} - + + @@ -127,12 +128,15 @@ }}
  • {{ 'mxk.text.lock' | i18n }}
  • -
  • {{ +
  • {{ 'mxk.text.disable' | i18n }}
  • {{ 'mxk.text.enable' | i18n }}
  • +
  • {{ + 'mxk.text.enable' | i18n + }}
  • {{ 'mxk.text.unlock' | i18n }}
  • diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json index 53b2cbdb7..6aaa7c5a0 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/en-US.json @@ -163,6 +163,7 @@ "status.lock":"Locked", "status.inactive":"Inactive", "status.delete":"Deleted", + "status.forbidden":"Forbidden", "userstate":"UserState", "userstate.resident":"Resident", "userstate.withdrawn":"Withdrawn", diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json index b38e63471..e2678decb 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/assets/i18n/zh-CN.json @@ -162,6 +162,7 @@ "status.active":"活动", "status.lock":"锁定", "status.inactive":"不活动", + "status.forbidden":"禁用", "status.delete":"已删除", "userstate":"用户状态", "userstate.resident":"在职", diff --git a/maxkey-web-frontend/maxkey-web-mgt-app/src/style-icons-auto.ts b/maxkey-web-frontend/maxkey-web-mgt-app/src/style-icons-auto.ts index badd1eb3c..b976a38dc 100644 --- a/maxkey-web-frontend/maxkey-web-mgt-app/src/style-icons-auto.ts +++ b/maxkey-web-frontend/maxkey-web-mgt-app/src/style-icons-auto.ts @@ -33,6 +33,7 @@ import { CloudOutline, CopyrightOutline, CustomerServiceOutline, + ClockCircleFill, DashboardOutline, DatabaseOutline, DingdingOutline, @@ -103,6 +104,7 @@ import { SendOutline, SmallDashOutline, DashOutline, + WarningFill, FileProtectOutline, HistoryOutline, AuditOutline @@ -118,6 +120,8 @@ export const ICONS_AUTO = [ BorderRightOutline, CloudOutline, CopyrightOutline, + ClockCircleFill, + CustomerServiceOutline, DashboardOutline, DatabaseOutline, @@ -194,5 +198,6 @@ export const ICONS_AUTO = [ DashOutline, FileProtectOutline, HistoryOutline, + WarningFill, AuditOutline ]; diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsController.java index 54ad04fce..55c22b70f 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsController.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/AccountsController.java @@ -137,7 +137,14 @@ public class AccountsController { @ResponseBody public ResponseEntity updateStatus(@ModelAttribute Accounts accounts,@CurrentUser UserInfo currentUser) { _logger.debug(""+accounts); + Accounts loadAccount = accountsService.get(accounts.getId()); accounts.setInstId(currentUser.getInstId()); + accounts.setAppId(loadAccount.getAppId()); + accounts.setAppName(loadAccount.getAppName()); + accounts.setUserId(loadAccount.getUserId()); + accounts.setUsername(loadAccount.getUsername()); + accounts.setDisplayName(loadAccount.getDisplayName()); + accounts.setRelatedUsername(loadAccount.getRelatedUsername()); if (accountsService.updateStatus(accounts)) { systemLog.insert( ConstsEntryType.ACCOUNT, diff --git a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/UserInfoController.java b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/UserInfoController.java index 446a4486a..7a795ccb6 100644 --- a/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/UserInfoController.java +++ b/maxkey-webs/maxkey-web-mgt/src/main/java/org/maxkey/web/contorller/UserInfoController.java @@ -238,7 +238,10 @@ public class UserInfoController { @ResponseBody public ResponseEntity updateStatus(@ModelAttribute UserInfo userInfo,@CurrentUser UserInfo currentUser) { _logger.debug(""+userInfo); + UserInfo loadUserInfo = userInfoService.get(userInfo.getId()); userInfo.setInstId(currentUser.getInstId()); + userInfo.setUsername(loadUserInfo.getUsername()); + userInfo.setDisplayName(loadUserInfo.getDisplayName()); if(userInfoService.updateStatus(userInfo)) { systemLog.insert( ConstsEntryType.USERINFO,