Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-platform-enterprise
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-enterprise
Commits
d9ef027d
Commit
d9ef027d
authored
Jan 08, 2020
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改超级管理员,添加发送短信业务逻辑
parent
8f31b0c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
3 deletions
+33
-3
EnterpriseController.java
...om/gic/operation/web/controller/EnterpriseController.java
+33
-3
No files found.
gic-platform-operation-web/src/main/java/com/gic/operation/web/controller/EnterpriseController.java
View file @
d9ef027d
...
...
@@ -7,6 +7,9 @@ import java.util.List;
import
java.util.Map
;
import
com.gic.auth.constant.UserConstants
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.enterprise.utils.AutoCreatePasswordUtils
;
import
com.gic.enterprise.utils.UserDetailUtils
;
import
com.gic.finance.constant.EnterprisePlatformTypeEnum
;
import
com.gic.marketing.process.api.service.sms.SmsSendApiService
;
import
com.gic.open.api.dto.market.MarketUserDTO
;
...
...
@@ -112,7 +115,7 @@ public class EnterpriseController {
if
(
result
.
isSuccess
()
&&
UserConstants
.
CREATE_AUTO
==
userDTO
.
getPasswordType
().
intValue
())
{
//发送短信,通知自动生成密码
if
(
StringUtils
.
isBlank
(
userDTO
.
getPhoneAreaCode
()))
{
userDTO
.
setPhoneAreaCode
(
"86"
);
userDTO
.
setPhoneAreaCode
(
"
+
86"
);
}
String
[]
smsArr
=
new
String
[]
{
enterpriseDTO
.
getEnterpriseName
(),
userDTO
.
getPhoneNumber
(),
password
};
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
"GICpassword001"
,
...
...
@@ -192,7 +195,33 @@ public class EnterpriseController {
@RequestMapping
(
"/edit-user"
)
public
RestResponse
editUser
(
UserDTO
userDTO
)
{
return
ResultControllerUtils
.
commonResult
(
userApiService
.
editAdmin
(
userDTO
));
//自动密码
boolean
isAutoPassword
=
userDTO
.
getPasswordType
()
==
UserConstants
.
CREATE_AUTO
;
if
(
isAutoPassword
)
{
String
password
=
UserPasswordUtil
.
createPasswordAuto
();
//密码加密
userDTO
.
setPassword
(
UserPasswordUtil
.
getEncryptPassword
(
password
));
}
if
(
userDTO
.
getPasswordType
()
!=
null
&&
userDTO
.
getPasswordType
().
intValue
()
!=
UserConstants
.
CREATE_AUTO
)
{
//如果是自定义密码
if
(
StringUtils
.
isBlank
(
userDTO
.
getPassword
()))
{
return
RestResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"密码为空,操作有误"
);
}
userDTO
.
setPassword
(
AutoCreatePasswordUtils
.
encryptPassword
(
userDTO
.
getPassword
()));
}
ServiceResponse
<
Void
>
result
=
userApiService
.
editAdmin
(
userDTO
);
//自动创建密码,需要发送短信
if
(
result
.
isSuccess
()
&&
isAutoPassword
)
{
String
[]
smsArr
=
new
String
[]
{
UserDetailUtils
.
getUserDetail
().
getEnterpriseInfo
().
getEnterpriseName
(),
userDTO
.
getPhoneNumber
(),
userDTO
.
getPassword
()
};
ServiceResponse
<
Void
>
smsSendResult
=
smsSendApiService
.
sendPlatformSms
(
"GICpassword001"
,
UserDetailUtils
.
getUserDetail
().
getEnterpriseId
(),
userDTO
.
getPhoneAreaCode
(),
userDTO
.
getPhoneNumber
(),
smsArr
);
if
(!
smsSendResult
.
isSuccess
())
{
LOGGER
.
warn
(
smsSendResult
.
getMessage
());
}
}
return
ResultControllerUtils
.
commonResult
(
result
);
}
@RequestMapping
(
"/get-enterprise"
)
...
...
@@ -435,7 +464,8 @@ public class EnterpriseController {
@RequestMapping
(
"/list-coupon"
)
public
RestResponse
listCoupon
(
BigDecimal
price
,
Long
isvId
,
Long
enterpriseId
,
Long
serveId
,
Long
skuId
)
{
return
ResultControllerUtils
.
commonResult
(
couponApiService
.
listEnterpriseCouponByServeId
(
price
,
isvId
,
enterpriseId
,
serveId
,
skuId
),
CouponLogVO
.
class
);
couponApiService
.
listEnterpriseCouponByServeId
(
price
,
isvId
,
enterpriseId
,
serveId
,
skuId
),
CouponLogVO
.
class
);
}
@RequestMapping
(
"/order-detail"
)
...
...
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