Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ximai
mes
Commits
af07416e
Commit
af07416e
authored
Jan 15, 2025
by
温志超
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
93490505
a7bf6e5c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
13 deletions
+24
-13
Constants.java
...on/src/main/java/com/ximai/common/constant/Constants.java
+5
-0
TokenService.java
...in/java/com/ximai/framework/web/service/TokenService.java
+1
-0
AppConfigServiceImpl.java
.../com/ximai/mes/pro/service/impl/AppConfigServiceImpl.java
+17
-13
AppConfigMapper.xml
mes/src/main/resources/mapper/md/AppConfigMapper.xml
+1
-0
No files found.
common/src/main/java/com/ximai/common/constant/Constants.java
View file @
af07416e
...
...
@@ -101,6 +101,11 @@ public class Constants {
*/
public
static
final
String
JWT_USERID
=
"userid"
;
/**
* 用户多语言
*/
public
static
final
String
JWT_LOCAL
=
"local"
;
/**
* 用户名称
*/
...
...
framework/src/main/java/com/ximai/framework/web/service/TokenService.java
View file @
af07416e
...
...
@@ -114,6 +114,7 @@ public class TokenService
Map
<
String
,
Object
>
claims
=
new
HashMap
<>();
claims
.
put
(
Constants
.
LOGIN_USER_KEY
,
token
);
claims
.
put
(
Constants
.
JWT_USERNAME
,
loginUser
.
getUsername
());
claims
.
put
(
Constants
.
JWT_LOCAL
,
loginUser
.
getUser
().
getLocale
());
return
createToken
(
claims
);
}
...
...
mes/src/main/java/com/ximai/mes/pro/service/impl/AppConfigServiceImpl.java
View file @
af07416e
...
...
@@ -52,11 +52,14 @@ public class AppConfigServiceImpl implements IAppConfigService {
@Override
public
int
insertAppConfig
(
AppConfig
appConfig
)
{
List
<
AppConfig
>
lastVersion
=
this
.
selectLastVersion
(
appConfig
.
getAppName
());
lastVersion
.
forEach
(
s
->{
s
.
setLastVersion
(
0
);
appConfig
.
updateAction
();
this
.
updateAppConfig
(
appConfig
);
});
//修改历史版本为非最新
if
(
appConfig
.
getLastVersion
()==
0
){
lastVersion
.
forEach
(
s
->{
s
.
setLastVersion
(
1
);
s
.
updateAction
();
appConfigMapper
.
updateAppConfig
(
s
);
});
}
appConfig
.
createAction
();
return
appConfigMapper
.
insertAppConfig
(
appConfig
);
}
...
...
@@ -69,15 +72,16 @@ public class AppConfigServiceImpl implements IAppConfigService {
*/
@Override
public
int
updateAppConfig
(
AppConfig
appConfig
)
{
QueryWrapper
<
AppConfig
>
appConfigQueryWrapper
=
new
QueryWrapper
<>();
List
<
AppConfig
>
appConfigs
=
appConfigMapper
.
selectListByQw
(
appConfigQueryWrapper
);
for
(
AppConfig
config
:
appConfigs
)
{
config
.
setLastVersion
(
1
);
appConfig
.
updateAction
();
appConfigMapper
.
updateAppConfig
(
config
);
}
List
<
AppConfig
>
lastVersion
=
this
.
selectLastVersion
(
appConfig
.
getAppName
());
appConfig
.
updateAction
();
//修改历史版本为非最新
if
(
appConfig
.
getLastVersion
()==
0
){
lastVersion
.
forEach
(
s
->{
s
.
setLastVersion
(
1
);
s
.
updateAction
();
appConfigMapper
.
updateAppConfig
(
s
);
});
}
return
appConfigMapper
.
updateAppConfig
(
appConfig
);
}
...
...
mes/src/main/resources/mapper/md/AppConfigMapper.xml
View file @
af07416e
...
...
@@ -38,6 +38,7 @@
<where>
<if
test=
"version != null and version != ''"
>
and version = #{version}
</if>
<if
test=
"url != null and url != ''"
>
and url = #{url}
</if>
<if
test=
"appName != null and appName != ''"
>
and app_name = #{appName}
</if>
<if
test=
"updateState != null "
>
and update_state = #{updateState}
</if>
<if
test=
"updateDesc != null "
>
and update_desc = #{updateDesc}
</if>
</where>
...
...
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