Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-smf-user
Commits
5bc59e07
Commit
5bc59e07
authored
3 years ago
by
nivetha
Browse files
Options
Download
Patches
Plain Diff
User default pwd & search user modifications
parent
82c90817
master
bulkupload
delete-user
delete-user-fix
increase_timeout
institute-district
maney-test
sessionTimeout
updateEmailContentforOTP
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/main/java/com/tarento/retail/dao/impl/UserDaoImpl.java
+23
-1
src/main/java/com/tarento/retail/dao/impl/UserDaoImpl.java
src/main/java/com/tarento/retail/service/impl/UserServiceImpl.java
+4
-3
...java/com/tarento/retail/service/impl/UserServiceImpl.java
src/main/java/com/tarento/retail/util/Constants.java
+13
-0
src/main/java/com/tarento/retail/util/Constants.java
src/main/java/com/tarento/retail/util/Sql.java
+3
-0
src/main/java/com/tarento/retail/util/Sql.java
with
43 additions
and
4 deletions
+43
-4
src/main/java/com/tarento/retail/dao/impl/UserDaoImpl.java
+
23
−
1
View file @
5bc59e07
...
...
@@ -909,7 +909,29 @@ public class UserDaoImpl implements UserDao {
paramMap
.
put
(
Constants
.
Parameters
.
LAST_NAME
,
keyword
);
paramMap
.
put
(
Constants
.
Parameters
.
COUNTRY
,
keyword
);
}
// dynamic key value search
if
(
searchRequest
.
getSearch
()
!=
null
&&
searchRequest
.
getSearch
().
size
()
>
0
)
{
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
searchRequest
.
getSearch
().
entrySet
())
{
condition
=
addQueryCondition
(
builder
,
condition
);
if
(
entry
.
getValue
()
instanceof
List
)
{
if
(
Constants
.
UserSearchFields
.
MAPPING
.
containsKey
(
entry
.
getKey
()))
{
builder
.
append
(
Constants
.
UserSearchFields
.
MAPPING
.
get
(
entry
.
getKey
()));
}
else
{
builder
.
append
(
entry
.
getKey
());
}
builder
.
append
(
NamedUserQueries
.
IN_CLAUSE
);
paramMap
.
put
(
Constants
.
Parameters
.
IN_VALUE
,
entry
.
getValue
());
}
else
{
if
(
Constants
.
UserSearchFields
.
MAPPING
.
containsKey
(
entry
.
getKey
()))
{
builder
.
append
(
Constants
.
UserSearchFields
.
MAPPING
.
get
(
entry
.
getKey
()));
}
else
{
builder
.
append
(
entry
.
getKey
());
}
builder
.
append
(
NamedUserQueries
.
APPEND_VALUE
);
paramMap
.
put
(
Constants
.
Parameters
.
VALUE
,
entry
.
getValue
());
}
}
}
// limit & offset
if
(
searchRequest
.
getLimit
()
>
0
)
{
builder
.
append
(
NamedUserQueries
.
LIMIT
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/retail/service/impl/UserServiceImpl.java
+
4
−
3
View file @
5bc59e07
...
...
@@ -156,10 +156,11 @@ public class UserServiceImpl implements UserDetailsService, UserService {
@Override
public
User
save
(
User
user
)
{
if
(
StringUtils
.
isNotBlank
(
user
.
getPassword
()))
{
String
encryptedPassword
=
bcryptEncoder
.
encode
(
user
.
getPassword
());
user
.
setPassword
(
encryptedPassword
);
if
(
StringUtils
.
isBlank
(
user
.
getPassword
()))
{
user
.
setPassword
(
"UP-SMF#User"
);
}
String
encryptedPassword
=
bcryptEncoder
.
encode
(
user
.
getPassword
());
user
.
setPassword
(
encryptedPassword
);
return
userDao
.
save
(
user
);
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/retail/util/Constants.java
+
13
−
0
View file @
5bc59e07
package
com.tarento.retail.util
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
Constants
{
/**
...
...
@@ -96,6 +99,8 @@ public class Constants {
public
static
final
String
COUNTRY
=
"country"
;
public
static
final
String
LIMIT
=
"limit"
;
public
static
final
String
OFFSET
=
"offset"
;
public
static
final
String
IN_VALUE
=
"inValues"
;
public
static
final
String
VALUE
=
"value"
;
}
public
interface
EmailTemplate
{
...
...
@@ -177,4 +182,12 @@ public class Constants {
}
}
public
interface
UserSearchFields
{
public
static
final
Map
<
String
,
String
>
MAPPING
=
new
HashMap
<
String
,
String
>()
{
{
put
(
"userId"
,
"usr.id"
);
}
};
}
}
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/retail/util/Sql.java
+
3
−
0
View file @
5bc59e07
...
...
@@ -190,6 +190,9 @@ public interface Sql {
Constants
.
Parameters
.
COUNTRY
);
final
String
LIMIT
=
String
.
format
(
" limit :%s "
,
Constants
.
Parameters
.
LIMIT
);
final
String
OFFSET
=
String
.
format
(
" offset :%s "
,
Constants
.
Parameters
.
OFFSET
);
final
String
IN_CLAUSE
=
String
.
format
(
" IN (:%s)"
,
Constants
.
Parameters
.
IN_VALUE
);
final
String
APPEND_VALUE
=
String
.
format
(
" = :%s "
,
Constants
.
Parameters
.
VALUE
);
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets