Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AutogeneralShanghai
yd-backend
Commits
a8b60061
Commit
a8b60061
authored
Sep 17, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
232a5106
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
139 additions
and
2 deletions
+139
-2
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
+28
-0
yd-api/src/main/java/com/yd/dal/entity/sms/ShortMessageSendRecord.java
+65
-1
yd-api/src/main/java/com/yd/dal/mapper/sms/ShortMessageSendRecordMapper.java
+9
-0
yd-api/src/main/java/com/yd/dal/service/sms/ShortMessageSendRecordService.java
+2
-0
yd-api/src/main/java/com/yd/dal/service/sms/impl/ShortMessageSendRecordServiceImpl.java
+10
-0
yd-api/src/main/resources/mapper/sms/ShortMessageSendRecordMapper.xml
+25
-1
No files found.
yd-api/src/main/java/com/yd/api/practitioner/service/impl/PractitionerServiceImpl.java
View file @
a8b60061
...
@@ -293,6 +293,8 @@ import com.yd.util.PDFConfiguration;
...
@@ -293,6 +293,8 @@ import com.yd.util.PDFConfiguration;
import
com.yd.util.SpringContextUtil
;
import
com.yd.util.SpringContextUtil
;
import
com.yd.util.config.ZHBErrorConfig
;
import
com.yd.util.config.ZHBErrorConfig
;
import
com.yd.util.deshandler.DESTypeHandler
;
import
com.yd.util.deshandler.DESTypeHandler
;
import
com.yd.dal.entity.sms.ShortMessageSendRecord
;
import
com.yd.dal.service.sms.ShortMessageSendRecordService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -394,6 +396,9 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -394,6 +396,9 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
private
SendService
sendService
;
private
SendService
sendService
;
@Autowired
@Autowired
private
AclSystemMessageService
aclSystemMessageService
;
private
AclSystemMessageService
aclSystemMessageService
;
@Autowired
private
ShortMessageSendRecordService
shortMessageSendRecordService
;
@Override
@Override
public
PractitionerLoginResponseVO
practitionerLogin
(
PractitionerLoginRequestVO
requestVO
)
{
public
PractitionerLoginResponseVO
practitionerLogin
(
PractitionerLoginRequestVO
requestVO
)
{
PractitionerLoginResponseVO
responseVO
=
new
PractitionerLoginResponseVO
();
PractitionerLoginResponseVO
responseVO
=
new
PractitionerLoginResponseVO
();
...
@@ -458,6 +463,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -458,6 +463,10 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
responseVO
.
setCanSeeSalaryList
(
practitionerInfo
.
getCanSeeSalaryList
());
responseVO
.
setCanSeeSalaryList
(
practitionerInfo
.
getCanSeeSalaryList
());
responseVO
.
setLoginLogId
(
loginLogId
);
responseVO
.
setLoginLogId
(
loginLogId
);
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
//更新ag_sms_record表的is_use为已使用状态
updateSmsRecordIsUse
(
mobileNo
);
// }
// }
}
else
{
}
else
{
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830001"
)));
responseVO
.
setCommonResult
(
new
CommonResult
(
false
,
ZHBErrorConfig
.
getErrorInfo
(
"830001"
)));
...
@@ -470,6 +479,25 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
...
@@ -470,6 +479,25 @@ public class PractitionerServiceImpl implements com.yd.api.practitioner.service.
return
responseVO
;
return
responseVO
;
}
}
/**
* 登录成功后,将 ag_sms_record 中该手机号最新未使用的验证码短信置为已使用
* @param mobileNo
*/
private
void
updateSmsRecordIsUse
(
String
mobileNo
)
{
if
(
Strings
.
isNullOrEmpty
(
mobileNo
))
{
return
;
}
try
{
ShortMessageSendRecord
smsRecord
=
shortMessageSendRecordService
.
findLatestUnused
(
mobileNo
,
"1"
);
if
(
smsRecord
!=
null
&&
smsRecord
.
getId
()
!=
null
)
{
shortMessageSendRecordService
.
updateIsUse
(
smsRecord
.
getId
(),
1
);
}
}
catch
(
Exception
e
)
{
// 更新短信状态失败不应影响登录主流程
log
.
error
(
"更新短信验证码使用状态失败, mobileNo={}"
,
mobileNo
,
e
);
}
}
private
void
getOpenIdUrl
(
PractitionerLoginResponseVO
responseVO
,
AclCustomer
customer
)
{
private
void
getOpenIdUrl
(
PractitionerLoginResponseVO
responseVO
,
AclCustomer
customer
)
{
String
openId
=
customer
.
getYdWechatOpenid
();
String
openId
=
customer
.
getYdWechatOpenid
();
if
(
Strings
.
isNullOrEmpty
(
openId
))
{
if
(
Strings
.
isNullOrEmpty
(
openId
))
{
...
...
yd-api/src/main/java/com/yd/dal/entity/sms/ShortMessageSendRecord.java
View file @
a8b60061
...
@@ -78,6 +78,26 @@ public class ShortMessageSendRecord implements Serializable {
...
@@ -78,6 +78,26 @@ public class ShortMessageSendRecord implements Serializable {
*/
*/
private
String
templateCode
;
private
String
templateCode
;
/**
* 账号类型(0-阿里云账号;1—大汉三通行业账号;2—大汉三通营销账号)
*/
private
String
userType
;
/**
* 短信发送状态(0—成功;1—接口处理失败;2—运营商网关失败)
*/
private
String
smsStatus
;
/**
* 短信发送结果
*/
private
String
smsMessage
;
/**
* 是否使用 0-未使用 1-已使用
*/
private
Integer
isUse
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
public
Long
getId
()
{
public
Long
getId
()
{
...
@@ -192,6 +212,38 @@ public class ShortMessageSendRecord implements Serializable {
...
@@ -192,6 +212,38 @@ public class ShortMessageSendRecord implements Serializable {
this
.
templateCode
=
templateCode
;
this
.
templateCode
=
templateCode
;
}
}
public
String
getUserType
()
{
return
userType
;
}
public
void
setUserType
(
String
userType
)
{
this
.
userType
=
userType
;
}
public
String
getSmsStatus
()
{
return
smsStatus
;
}
public
void
setSmsStatus
(
String
smsStatus
)
{
this
.
smsStatus
=
smsStatus
;
}
public
String
getSmsMessage
()
{
return
smsMessage
;
}
public
void
setSmsMessage
(
String
smsMessage
)
{
this
.
smsMessage
=
smsMessage
;
}
public
Integer
getIsUse
()
{
return
isUse
;
}
public
void
setIsUse
(
Integer
isUse
)
{
this
.
isUse
=
isUse
;
}
@Override
@Override
public
boolean
equals
(
Object
that
)
{
public
boolean
equals
(
Object
that
)
{
if
(
this
==
that
)
{
if
(
this
==
that
)
{
...
@@ -217,7 +269,11 @@ public class ShortMessageSendRecord implements Serializable {
...
@@ -217,7 +269,11 @@ public class ShortMessageSendRecord implements Serializable {
&&
(
this
.
getReturnMessage
()
==
null
?
other
.
getReturnMessage
()
==
null
:
this
.
getReturnMessage
().
equals
(
other
.
getReturnMessage
()))
&&
(
this
.
getReturnMessage
()
==
null
?
other
.
getReturnMessage
()
==
null
:
this
.
getReturnMessage
().
equals
(
other
.
getReturnMessage
()))
&&
(
this
.
getRequestId
()
==
null
?
other
.
getRequestId
()
==
null
:
this
.
getRequestId
().
equals
(
other
.
getRequestId
()))
&&
(
this
.
getRequestId
()
==
null
?
other
.
getRequestId
()
==
null
:
this
.
getRequestId
().
equals
(
other
.
getRequestId
()))
&&
(
this
.
getBizId
()
==
null
?
other
.
getBizId
()
==
null
:
this
.
getBizId
().
equals
(
other
.
getBizId
()))
&&
(
this
.
getBizId
()
==
null
?
other
.
getBizId
()
==
null
:
this
.
getBizId
().
equals
(
other
.
getBizId
()))
&&
(
this
.
getTemplateCode
()
==
null
?
other
.
getTemplateCode
()
==
null
:
this
.
getTemplateCode
().
equals
(
other
.
getTemplateCode
()));
&&
(
this
.
getTemplateCode
()
==
null
?
other
.
getTemplateCode
()
==
null
:
this
.
getTemplateCode
().
equals
(
other
.
getTemplateCode
()))
&&
(
this
.
getUserType
()
==
null
?
other
.
getUserType
()
==
null
:
this
.
getUserType
().
equals
(
other
.
getUserType
()))
&&
(
this
.
getSmsStatus
()
==
null
?
other
.
getSmsStatus
()
==
null
:
this
.
getSmsStatus
().
equals
(
other
.
getSmsStatus
()))
&&
(
this
.
getSmsMessage
()
==
null
?
other
.
getSmsMessage
()
==
null
:
this
.
getSmsMessage
().
equals
(
other
.
getSmsMessage
()))
&&
(
this
.
getIsUse
()
==
null
?
other
.
getIsUse
()
==
null
:
this
.
getIsUse
().
equals
(
other
.
getIsUse
()));
}
}
@Override
@Override
...
@@ -238,6 +294,10 @@ public class ShortMessageSendRecord implements Serializable {
...
@@ -238,6 +294,10 @@ public class ShortMessageSendRecord implements Serializable {
result
=
prime
*
result
+
((
getRequestId
()
==
null
)
?
0
:
getRequestId
().
hashCode
());
result
=
prime
*
result
+
((
getRequestId
()
==
null
)
?
0
:
getRequestId
().
hashCode
());
result
=
prime
*
result
+
((
getBizId
()
==
null
)
?
0
:
getBizId
().
hashCode
());
result
=
prime
*
result
+
((
getBizId
()
==
null
)
?
0
:
getBizId
().
hashCode
());
result
=
prime
*
result
+
((
getTemplateCode
()
==
null
)
?
0
:
getTemplateCode
().
hashCode
());
result
=
prime
*
result
+
((
getTemplateCode
()
==
null
)
?
0
:
getTemplateCode
().
hashCode
());
result
=
prime
*
result
+
((
getUserType
()
==
null
)
?
0
:
getUserType
().
hashCode
());
result
=
prime
*
result
+
((
getSmsStatus
()
==
null
)
?
0
:
getSmsStatus
().
hashCode
());
result
=
prime
*
result
+
((
getSmsMessage
()
==
null
)
?
0
:
getSmsMessage
().
hashCode
());
result
=
prime
*
result
+
((
getIsUse
()
==
null
)
?
0
:
getIsUse
().
hashCode
());
return
result
;
return
result
;
}
}
...
@@ -261,6 +321,10 @@ public class ShortMessageSendRecord implements Serializable {
...
@@ -261,6 +321,10 @@ public class ShortMessageSendRecord implements Serializable {
sb
.
append
(
", requestId="
).
append
(
requestId
);
sb
.
append
(
", requestId="
).
append
(
requestId
);
sb
.
append
(
", bizId="
).
append
(
bizId
);
sb
.
append
(
", bizId="
).
append
(
bizId
);
sb
.
append
(
", templateCode="
).
append
(
templateCode
);
sb
.
append
(
", templateCode="
).
append
(
templateCode
);
sb
.
append
(
", userType="
).
append
(
userType
);
sb
.
append
(
", smsStatus="
).
append
(
smsStatus
);
sb
.
append
(
", smsMessage="
).
append
(
smsMessage
);
sb
.
append
(
", isUse="
).
append
(
isUse
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
return
sb
.
toString
();
...
...
yd-api/src/main/java/com/yd/dal/mapper/sms/ShortMessageSendRecordMapper.java
View file @
a8b60061
package
com
.
yd
.
dal
.
mapper
.
sms
;
package
com
.
yd
.
dal
.
mapper
.
sms
;
import
org.apache.ibatis.annotations.Param
;
import
com.yd.dal.entity.sms.ShortMessageSendRecord
;
import
com.yd.dal.entity.sms.ShortMessageSendRecord
;
public
interface
ShortMessageSendRecordMapper
{
public
interface
ShortMessageSendRecordMapper
{
...
@@ -14,4 +15,12 @@ public interface ShortMessageSendRecordMapper {
...
@@ -14,4 +15,12 @@ public interface ShortMessageSendRecordMapper {
int
updateByPrimaryKeySelective
(
ShortMessageSendRecord
record
);
int
updateByPrimaryKeySelective
(
ShortMessageSendRecord
record
);
int
updateByPrimaryKey
(
ShortMessageSendRecord
record
);
int
updateByPrimaryKey
(
ShortMessageSendRecord
record
);
ShortMessageSendRecord
selectLatestUnused
(
@Param
(
"mobileNo"
)
String
mobileNo
,
@Param
(
"smsType"
)
String
smsType
);
int
updateIsUse
(
@Param
(
"id"
)
Long
id
,
@Param
(
"isUse"
)
Integer
isUse
);
}
}
yd-api/src/main/java/com/yd/dal/service/sms/ShortMessageSendRecordService.java
View file @
a8b60061
...
@@ -11,5 +11,7 @@ public interface ShortMessageSendRecordService {
...
@@ -11,5 +11,7 @@ public interface ShortMessageSendRecordService {
// ShortMessageSendRecord update(ShortMessageSendRecord shortMessageSendRecord);
// ShortMessageSendRecord update(ShortMessageSendRecord shortMessageSendRecord);
// ShortMessageSendRecord findById(Long id);
// ShortMessageSendRecord findById(Long id);
ShortMessageSendRecord
findLatestUnused
(
String
mobileNo
,
String
smsType
);
void
updateIsUse
(
Long
id
,
Integer
isUse
);
}
}
yd-api/src/main/java/com/yd/dal/service/sms/impl/ShortMessageSendRecordServiceImpl.java
View file @
a8b60061
...
@@ -17,4 +17,14 @@ public class ShortMessageSendRecordServiceImpl implements ShortMessageSendRecord
...
@@ -17,4 +17,14 @@ public class ShortMessageSendRecordServiceImpl implements ShortMessageSendRecord
public
void
save
(
ShortMessageSendRecord
shortMessageSendRecord
)
{
public
void
save
(
ShortMessageSendRecord
shortMessageSendRecord
)
{
shortMessageSendRecordMapper
.
insert
(
shortMessageSendRecord
);
shortMessageSendRecordMapper
.
insert
(
shortMessageSendRecord
);
}
}
@Override
public
ShortMessageSendRecord
findLatestUnused
(
String
mobileNo
,
String
smsType
)
{
return
shortMessageSendRecordMapper
.
selectLatestUnused
(
mobileNo
,
smsType
);
}
@Override
public
void
updateIsUse
(
Long
id
,
Integer
isUse
)
{
shortMessageSendRecordMapper
.
updateIsUse
(
id
,
isUse
);
}
}
}
yd-api/src/main/resources/mapper/sms/ShortMessageSendRecordMapper.xml
View file @
a8b60061
...
@@ -16,10 +16,17 @@
...
@@ -16,10 +16,17 @@
<result
column=
"request_id"
jdbcType=
"VARCHAR"
property=
"requestId"
/>
<result
column=
"request_id"
jdbcType=
"VARCHAR"
property=
"requestId"
/>
<result
column=
"biz_id"
jdbcType=
"VARCHAR"
property=
"bizId"
/>
<result
column=
"biz_id"
jdbcType=
"VARCHAR"
property=
"bizId"
/>
<result
column=
"template_code"
jdbcType=
"VARCHAR"
property=
"templateCode"
/>
<result
column=
"template_code"
jdbcType=
"VARCHAR"
property=
"templateCode"
/>
<!-- 新增字段 -->
<result
column=
"user_type"
jdbcType=
"VARCHAR"
property=
"userType"
/>
<result
column=
"sms_status"
jdbcType=
"VARCHAR"
property=
"smsStatus"
/>
<result
column=
"sms_message"
jdbcType=
"VARCHAR"
property=
"smsMessage"
/>
<result
column=
"is_use"
jdbcType=
"INTEGER"
property=
"isUse"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, mobile_no, business_type, business_id, sms_type, sms_content, verification_code,
id, mobile_no, business_type, business_id, sms_type, sms_content, verification_code,
send_time, expire_time, send_status, return_message, request_id, biz_id, template_code
send_time, expire_time, send_status, return_message, request_id, biz_id, template_code,
user_type, sms_status, sms_message, is_use
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select
select
...
@@ -190,4 +197,21 @@
...
@@ -190,4 +197,21 @@
template_code = #{templateCode,jdbcType=VARCHAR}
template_code = #{templateCode,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</update>
<select
id=
"selectLatestUnused"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_sms_record
where mobile_no = #{mobileNo,jdbcType=VARCHAR}
and sms_type = #{smsType,jdbcType=VARCHAR}
and is_use = 0
order by send_time desc
limit 1
</select>
<update
id=
"updateIsUse"
>
update ag_sms_record
set is_use = #{isUse,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
</mapper>
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