Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
4ec57567
Commit
4ec57567
authored
Aug 25, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复加好友判断企业id
parent
d0b6aed3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
14 deletions
+24
-14
SendCodeController.java
.../gic/haoban/manage/web/controller/SendCodeController.java
+2
-2
SendCodeController.java
.../gic/haoban/manage/web/controller/SendCodeController.java
+22
-12
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/SendCodeController.java
View file @
4ec57567
...
...
@@ -37,7 +37,7 @@ private static Logger logger = LoggerFactory.getLogger(SendCodeController.class)
*/
@RequestMapping
(
"/send-code"
)
public
HaobanResponse
sendCode
(
String
phoneNumber
,
@RequestParam
(
defaultValue
=
"86"
)
String
nationcode
,
Integer
type
,
@RequestParam
(
defaultValue
=
"0"
)
int
isTest
,
String
wxE
nterpriseId
)
{
Integer
type
,
@RequestParam
(
defaultValue
=
"0"
)
int
isTest
,
String
e
nterpriseId
)
{
if
(
StringUtils
.
isBlank
(
phoneNumber
)
||
null
==
type
)
{
logger
.
info
(
"没有phoneNumber!"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_5
);
...
...
@@ -76,7 +76,7 @@ private static Logger logger = LoggerFactory.getLogger(SendCodeController.class)
logger
.
info
(
"{}-{} 的 验证码:{}"
,
nationcode
,
phoneNumber
,
smsCode
);
//非测试
if
(
isTest
!=
1
)
{
SendSmsResponse
smsResponse
=
validationCodeService
.
sendValidationCode
(
nationcode
,
phoneNumber
,
smsCod
e
);
SendSmsResponse
smsResponse
=
validationCodeService
.
sendValidationCode
Hb3
(
nationcode
,
phoneNumber
,
smsCode
,
enterpriseId
,
null
,
null
,
fals
e
);
logger
.
info
(
"{}-{} 的 验证码 发送结果回执:{}"
,
nationcode
,
phoneNumber
,
JSON
.
toJSONString
(
smsResponse
));
if
(!
smsResponse
.
isSuccess
())
{
HaobanResponse
response
=
new
HaobanResponse
();
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/SendCodeController.java
View file @
4ec57567
package
com
.
gic
.
haoban
.
manage
.
web
.
controller
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.common.utils.CheckSmsCodeUtil
;
import
com.gic.haoban.common.utils.GooglePhoneNumberUtil
;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.communicate.api.service.valid.ValidationCodeService
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.reponse.SendSmsResponse
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
public
class
SendCodeController
extends
WebBaseController
{
...
...
@@ -30,7 +30,11 @@ public class SendCodeController extends WebBaseController{
@Autowired
private
ValidationCodeService
validationCodeService
;
/**
@Autowired
private
StoreService
storeService
;
/**
* 验证码发送
*
* @param phoneNumber
...
...
@@ -38,7 +42,7 @@ public class SendCodeController extends WebBaseController{
*/
@RequestMapping
(
"/send-code"
)
public
HaobanResponse
sendCode
(
String
phoneNumber
,
@RequestParam
(
defaultValue
=
"86"
)
String
nationcode
,
Integer
type
,
@RequestParam
(
defaultValue
=
"0"
)
int
isTest
,
String
wxEnterprise
Id
)
{
Integer
type
,
@RequestParam
(
defaultValue
=
"0"
)
int
isTest
,
String
wxEnterpriseId
,
String
storeId
,
String
clerk
Id
)
{
if
(
StringUtils
.
isBlank
(
phoneNumber
)
||
null
==
type
)
{
logger
.
info
(
"没有phoneNumber!"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_5
);
...
...
@@ -81,7 +85,13 @@ public class SendCodeController extends WebBaseController{
logger
.
info
(
"{}-{} 的 验证码:{}"
,
nationcode
,
phoneNumber
,
smsCode
);
//非测试
if
(
isTest
!=
1
)
{
SendSmsResponse
smsResponse
=
validationCodeService
.
sendValidationCode
(
nationcode
,
phoneNumber
,
smsCode
);
SendSmsResponse
smsResponse
=
null
;
if
(
StringUtils
.
isAnyBlank
(
storeId
,
clerkId
))
{
smsResponse
=
validationCodeService
.
sendValidationCode
(
nationcode
,
phoneNumber
,
smsCode
);
}
else
{
StoreDTO
storeDTO
=
storeService
.
getStore
(
storeId
);
smsResponse
=
validationCodeService
.
sendValidationCodeHb3
(
nationcode
,
phoneNumber
,
smsCode
,
storeDTO
.
getEnterpriseId
(),
storeId
,
clerkId
,
true
);
}
logger
.
info
(
"{}-{} 的 验证码 发送结果回执:{}"
,
nationcode
,
phoneNumber
,
JSON
.
toJSONString
(
smsResponse
));
if
(!
smsResponse
.
isSuccess
())
{
HaobanResponse
response
=
new
HaobanResponse
();
...
...
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