Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-auth
Overview
Overview
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
base_platform_enterprise
gic-platform-auth
Commits
711cab91
Commit
711cab91
authored
Nov 14, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增子管理员,如果是自动生成密码,则发送短信
parent
8ccd8a63
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
13 deletions
+47
-13
pom.xml
gic-platform-auth-web/pom.xml
+5
-0
UserController.java
...main/java/com/gic/auth/web/controller/UserController.java
+39
-13
dubbo-gic-platform-auth-web.xml
...th-web/src/main/resources/dubbo-gic-platform-auth-web.xml
+3
-0
No files found.
gic-platform-auth-web/pom.xml
View file @
711cab91
...
@@ -154,6 +154,11 @@
...
@@ -154,6 +154,11 @@
<artifactId>
gic-open-platform-api
</artifactId>
<artifactId>
gic-open-platform-api
</artifactId>
<version>
${gic-open-platform-api}
</version>
<version>
${gic-open-platform-api}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-marketing-process-api
</artifactId>
<version>
${gic-marketing-process-api}
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
gic-platform-auth-web/src/main/java/com/gic/auth/web/controller/UserController.java
View file @
711cab91
package
com
.
gic
.
auth
.
web
.
controller
;
package
com
.
gic
.
auth
.
web
.
controller
;
import
com.gic.auth.constant.UserConstants
;
import
com.gic.marketing.process.api.service.sms.SmsSendApiService
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.log4j.LogManager
;
import
org.apache.log4j.LogManager
;
import
org.apache.log4j.Logger
;
import
org.apache.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -29,20 +32,34 @@ public class UserController {
...
@@ -29,20 +32,34 @@ public class UserController {
@Autowired
@Autowired
private
UserApiService
userApiService
;
private
UserApiService
userApiService
;
@Autowired
private
SmsSendApiService
smsSendApiService
;
@RequestMapping
(
"/save-or-update-user"
)
@RequestMapping
(
"/save-or-update-user"
)
public
RestResponse
editUser
(
@Validated
({
UserDTO
.
UserQoValid
.
class
})
UserDTO
userDTO
)
{
public
RestResponse
editUser
(
@Validated
({
UserDTO
.
UserQoValid
.
class
})
UserDTO
userDTO
)
{
if
(
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getSuperAdmin
().
intValue
()
==
0
)
{
if
(
UserDetailUtils
.
getUserDetail
().
getUserInfo
().
getSuperAdmin
().
intValue
()
==
0
)
{
return
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"子管理员不能编辑"
);
return
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"子管理员不能编辑"
);
}
}
Integer
operationPassword
=
userDTO
.
getOperPasswordType
();
Integer
operationPassword
=
userDTO
.
getOperPasswordType
();
userDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
userDTO
.
setEnterpriseId
(
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
());
boolean
isNeedSendSms
=
false
;
//发送短信的参数
String
[]
smsArr
=
new
String
[
0
];
if
(
operationPassword
!=
null
&&
operationPassword
.
intValue
()
==
1
)
{
if
(
operationPassword
!=
null
&&
operationPassword
.
intValue
()
==
1
)
{
//如果是1,则不用验证密码
//如果是1,则不用验证密码
}
else
{
}
else
{
String
password
=
UserPasswordUtils
.
validPassword
(
userDTO
.
getPasswordType
(),
userDTO
.
getPassword
());
String
password
=
UserPasswordUtils
.
validPassword
(
userDTO
.
getPasswordType
(),
userDTO
.
getPassword
());
userDTO
.
setPassword
(
UserPasswordUtils
.
getEncryptPassword
(
password
));
userDTO
.
setPassword
(
UserPasswordUtils
.
getEncryptPassword
(
password
));
isNeedSendSms
=
UserConstants
.
CREATE_AUTO
==
userDTO
.
getPasswordType
().
intValue
();
if
(
isNeedSendSms
)
{
//发送短信,通知自动生成密码
if
(
StringUtils
.
isBlank
(
userDTO
.
getPhoneAreaCode
()))
{
userDTO
.
setPhoneAreaCode
(
"86"
);
}
smsArr
=
new
String
[]{
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseName
(),
userDTO
.
getPhoneNumber
(),
password
};
}
}
}
ServiceResponse
userResult
;
ServiceResponse
userResult
;
//普通用户
//普通用户
...
@@ -53,6 +70,13 @@ public class UserController {
...
@@ -53,6 +70,13 @@ public class UserController {
userResult
=
userApiService
.
editUser
(
userDTO
);
userResult
=
userApiService
.
editUser
(
userDTO
);
}
}
if
(
userResult
.
isSuccess
())
{
if
(
userResult
.
isSuccess
())
{
if
(
isNeedSendSms
)
{
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
"GICpassword001"
,
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseId
(),
userDTO
.
getPhoneAreaCode
(),
userDTO
.
getPhoneNumber
(),
smsArr
);
if
(!
smsSendResult
.
isSuccess
())
{
logger
.
warn
(
smsSendResult
.
getMessage
());
}
}
if
(
userDTO
.
getUserId
()
==
null
)
{
if
(
userDTO
.
getUserId
()
==
null
)
{
LogUtils
.
createLog
(
OperationResultUtils
.
LOG_NEW
+
"管理员"
,
userDTO
.
getUserName
());
LogUtils
.
createLog
(
OperationResultUtils
.
LOG_NEW
+
"管理员"
,
userDTO
.
getUserName
());
}
else
{
}
else
{
...
@@ -66,12 +90,13 @@ public class UserController {
...
@@ -66,12 +90,13 @@ public class UserController {
/**
/**
* 用户详情
* 用户详情
* @Title: getUserById
*
* @Description:
* @param userId
* @author guojuxing
* @return com.gic.commons.webapi.reponse.RestResponse
* @param userId
*
* @return com.gic.commons.webapi.reponse.RestResponse
* @Title: getUserById
*/
* @Description: * @author guojuxing
*/
@RequestMapping
(
"/get-user-by-id"
)
@RequestMapping
(
"/get-user-by-id"
)
public
RestResponse
getUserById
(
Integer
userId
)
{
public
RestResponse
getUserById
(
Integer
userId
)
{
return
ResultControllerUtils
.
commonResultOne
(
userApiService
.
getUserById
(
userId
),
UserDetailVO
.
class
);
return
ResultControllerUtils
.
commonResultOne
(
userApiService
.
getUserById
(
userId
),
UserDetailVO
.
class
);
...
@@ -98,14 +123,15 @@ public class UserController {
...
@@ -98,14 +123,15 @@ public class UserController {
/**
/**
* 逻辑删除用户对应分组数据
* 逻辑删除用户对应分组数据
* @Title: removeUserAccountGroup
*
* @Description:
* @author guojuxing
* @param type
* @param type
* @param accountGroupId
* @param accountGroupId
* @param userId
* @param userId
* @return com.gic.commons.webapi.reponse.RestResponse
* @return com.gic.commons.webapi.reponse.RestResponse
*/
*
* @Title: removeUserAccountGroup
* @Description: * @author guojuxing
*/
@RequestMapping
(
"/remove-user-account-group"
)
@RequestMapping
(
"/remove-user-account-group"
)
public
RestResponse
removeUserAccountGroup
(
Integer
type
,
Integer
accountGroupId
,
Integer
userId
)
{
public
RestResponse
removeUserAccountGroup
(
Integer
type
,
Integer
accountGroupId
,
Integer
userId
)
{
ServiceResponse
<
String
>
result
=
userApiService
.
removeAccountGroup
(
accountGroupId
,
userId
,
type
);
ServiceResponse
<
String
>
result
=
userApiService
.
removeAccountGroup
(
accountGroupId
,
userId
,
type
);
...
...
gic-platform-auth-web/src/main/resources/dubbo-gic-platform-auth-web.xml
View file @
711cab91
...
@@ -68,4 +68,6 @@
...
@@ -68,4 +68,6 @@
<dubbo:reference
interface=
"com.gic.open.api.service.AppTokenApiService"
id=
"appTokenApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.open.api.service.AppTokenApiService"
id=
"appTokenApiService"
timeout=
"6000"
/>
<!--运营管理员-->
<!--运营管理员-->
<dubbo:reference
interface=
"com.gic.auth.service.OperationUserApiService"
id=
"operationUserApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.auth.service.OperationUserApiService"
id=
"operationUserApiService"
timeout=
"6000"
/>
<!--短信发送-->
<dubbo:reference
interface=
"com.gic.marketing.process.api.service.sms.SmsSendApiService"
id=
"smsSendApiService"
timeout=
"60000"
/>
</beans>
</beans>
\ No newline at end of file
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