Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-account
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.account
pica-cloud-account
提交
dfe1eeaf
提交
dfe1eeaf
编写于
1月 16, 2020
作者:
rushui.chen
浏览文件
操作
浏览文件
下载
差异文件
20200116 手机号变更记录表
上级
fe602ac8
0b3bdc2b
流水线
#20894
已失败 于阶段
in 0 second
变更
8
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
297 行增加
和
2 行删除
+297
-2
AutoCodeController.java
...account/account/server/controller/AutoCodeController.java
+1
-0
ModifyMobileController.java
...unt/account/server/controller/ModifyMobileController.java
+3
-0
LogMobileModify.java
.../cloud/account/account/server/entity/LogMobileModify.java
+95
-0
LogMobileModifyMapper.java
.../account/account/server/mapper/LogMobileModifyMapper.java
+17
-0
ModifyMobileService.java
...d/account/account/server/service/ModifyMobileService.java
+10
-0
LoginServiceImpl.java
...account/account/server/service/impl/LoginServiceImpl.java
+2
-2
ModifyMobileServiceImpl.java
.../account/server/service/impl/ModifyMobileServiceImpl.java
+27
-0
LogMobileModifyMapper.xml
server/src/main/resources/mybatis/LogMobileModifyMapper.xml
+142
-0
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/controller/AutoCodeController.java
浏览文件 @
dfe1eeaf
...
...
@@ -87,6 +87,7 @@ public class AutoCodeController extends AccountBaseController {
long
senderId
=
accountIdByMobilePhone
==
null
?
0L
:
accountIdByMobilePhone
;
//验证码保存到redis,失效时间10分钟
cacheClient
.
set
(
this
.
getAuthCodeKey
(
mobilePhone
,
flag
),
authCode
,
600
);
//处理验证码原子性的问题
cacheClient
.
set
(
RegisterCodeKeyUtils
.
getRegisterKey
(
mobilePhone
,
authCode
),
100
,
600
);
logger
.
info
(
this
.
getAuthCodeKey
(
mobilePhone
,
flag
));
//发送短信
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/ModifyMobileController.java
浏览文件 @
dfe1eeaf
...
...
@@ -45,14 +45,17 @@ public class ModifyMobileController extends AccountBaseController {
public
PicaResponse
modifyMobile
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
Long
doctorId
=
super
.
getDoctorIdByToken
();
Doctor
doctorInfo
=
doctorService
.
getDoctorInfo
(
doctorId
.
intValue
());
//旧的手机号
String
mobilePhone
=
doctorInfo
.
getMobilePhone
();
Integer
acctId
=
modifyMobileService
.
getAcctIdByMobile
(
mobilePhone
);
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
//新的手机号
String
mobile
=
request
.
getMobile
();
accountUtils
.
checkMobilePhoneAndAuthCode
(
mobile
,
AccountTypeEnum
.
SYSCODE_TYPE_MODIFY_MOBILE
.
getCode
()
+
""
,
request
.
getAuthCode
());
//判断当前手机号是否已经注册过
AccountInfoEntity
accountInfoEntity
=
accountService
.
getAccountByMobilePhone
(
mobile
);
if
(
accountInfoEntity
==
null
)
{
modifyMobileService
.
recodeMobileModify
(
acctId
,
mobilePhone
,
mobile
);
modifyMobileService
.
modify
(
acctId
,
mobile
);
return
PicaResponse
.
toResponse
();
}
else
{
...
...
server/src/main/java/com/pica/cloud/account/account/server/entity/LogMobileModify.java
0 → 100644
浏览文件 @
dfe1eeaf
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
public
class
LogMobileModify
{
private
Integer
id
;
private
Integer
acctId
;
private
String
mobilePhoneNew
;
private
String
mobilePhoneOld
;
private
Date
modifiedTime
;
private
Integer
modifiedId
;
private
Integer
deleteFlag
;
private
Integer
createdId
;
private
Date
createdTime
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getAcctId
()
{
return
acctId
;
}
public
void
setAcctId
(
Integer
acctId
)
{
this
.
acctId
=
acctId
;
}
public
String
getMobilePhoneNew
()
{
return
mobilePhoneNew
;
}
public
void
setMobilePhoneNew
(
String
mobilePhoneNew
)
{
this
.
mobilePhoneNew
=
mobilePhoneNew
==
null
?
null
:
mobilePhoneNew
.
trim
();
}
public
String
getMobilePhoneOld
()
{
return
mobilePhoneOld
;
}
public
void
setMobilePhoneOld
(
String
mobilePhoneOld
)
{
this
.
mobilePhoneOld
=
mobilePhoneOld
==
null
?
null
:
mobilePhoneOld
.
trim
();
}
public
Date
getModifiedTime
()
{
return
modifiedTime
;
}
public
void
setModifiedTime
(
Date
modifiedTime
)
{
this
.
modifiedTime
=
modifiedTime
;
}
public
Integer
getModifiedId
()
{
return
modifiedId
;
}
public
void
setModifiedId
(
Integer
modifiedId
)
{
this
.
modifiedId
=
modifiedId
;
}
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
public
Integer
getCreatedId
()
{
return
createdId
;
}
public
void
setCreatedId
(
Integer
createdId
)
{
this
.
createdId
=
createdId
;
}
public
Date
getCreatedTime
()
{
return
createdTime
;
}
public
void
setCreatedTime
(
Date
createdTime
)
{
this
.
createdTime
=
createdTime
;
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/mapper/LogMobileModifyMapper.java
0 → 100644
浏览文件 @
dfe1eeaf
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
mapper
;
import
com.pica.cloud.account.account.server.entity.LogMobileModify
;
public
interface
LogMobileModifyMapper
{
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
LogMobileModify
record
);
int
insertSelective
(
LogMobileModify
record
);
LogMobileModify
selectByPrimaryKey
(
Integer
id
);
int
updateByPrimaryKeySelective
(
LogMobileModify
record
);
int
updateByPrimaryKey
(
LogMobileModify
record
);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/service/ModifyMobileService.java
浏览文件 @
dfe1eeaf
...
...
@@ -13,4 +13,14 @@ public interface ModifyMobileService {
Integer
getAcctIdByMobile
(
String
phone
);
/**
* 记录手机号的变更记录
* @param acctId
* @param mobilePhone
* @param mobile
*/
void
recodeMobileModify
(
Integer
acctId
,
String
mobilePhone
,
String
mobile
);
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/LoginServiceImpl.java
浏览文件 @
dfe1eeaf
...
...
@@ -307,7 +307,7 @@ public class LoginServiceImpl implements LoginService {
* @param unionId
*/
private
void
processAccountUnion
(
Integer
acctId
,
String
unionId
,
Integer
productType
)
{
//先查询当前产品线是否有记录?如果有就更新成delete_flag=2; 然后在插入
//先查询当前产品线是否有记录?如果有就更新成delete_flag=2; 然后在插入
新的绑定记录
AccountUnionEntity
accountUnionResult
=
accountUnionMapper
.
selectByUnionId
(
unionId
);
if
(
accountUnionResult
!=
null
){
accountUnionMapper
.
updateUnionStatus
(
unionId
);
...
...
@@ -316,7 +316,7 @@ public class LoginServiceImpl implements LoginService {
accountUnionEntity
.
setAcctId
(
acctId
.
longValue
());
accountUnionEntity
.
setDeleteFlag
(
1
);
accountUnionEntity
.
setUnionId
(
unionId
);
accountUnionEntity
.
setCreatedTime
(
new
Date
())
accountUnionEntity
.
setCreatedTime
(
new
Date
())
;
accountUnionEntity
.
setModifiedTime
(
new
Date
());
accountUnionEntity
.
setCreatedId
(
acctId
);
accountUnionEntity
.
setModifiedId
(
acctId
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/ModifyMobileServiceImpl.java
浏览文件 @
dfe1eeaf
...
...
@@ -2,10 +2,12 @@ package com.pica.cloud.account.account.server.service.impl;
import
com.pica.cloud.account.account.server.entity.AccountInfoEntity
;
import
com.pica.cloud.account.account.server.entity.Doctor
;
import
com.pica.cloud.account.account.server.entity.LogMobileModify
;
import
com.pica.cloud.account.account.server.enums.AccountExceptionEnum
;
import
com.pica.cloud.account.account.server.exception.AccountException
;
import
com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper
;
import
com.pica.cloud.account.account.server.mapper.DoctorMapper
;
import
com.pica.cloud.account.account.server.mapper.LogMobileModifyMapper
;
import
com.pica.cloud.account.account.server.service.ModifyMobileService
;
import
com.pica.cloud.account.account.server.util.AESUtil
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -25,6 +27,9 @@ public class ModifyMobileServiceImpl implements ModifyMobileService {
@Autowired
private
DoctorMapper
doctorMapper
;
@Autowired
private
LogMobileModifyMapper
logMobileModifyMapper
;
@Value
(
"${doubleWritingMode}"
)
private
boolean
doubleWritingMode
;
...
...
@@ -64,4 +69,26 @@ public class ModifyMobileServiceImpl implements ModifyMobileService {
AccountInfoEntity
accountInfoEntity
=
accountInfoDetailMapper
.
selectByMobile
(
phone
);
return
accountInfoEntity
.
getId
();
}
/**
* 记录账号对应的手机号的变更信息
*
* @param acctId
* @param mobilePhone
* @param mobile
*/
@Override
public
void
recodeMobileModify
(
Integer
acctId
,
String
mobilePhone
,
String
mobile
)
{
Date
date
=
new
Date
();
LogMobileModify
logMobileModify
=
new
LogMobileModify
();
logMobileModify
.
setAcctId
(
acctId
);
logMobileModify
.
setDeleteFlag
(
1
);
logMobileModify
.
setCreatedId
(
acctId
);
logMobileModify
.
setCreatedTime
(
date
);
logMobileModify
.
setModifiedId
(
acctId
);
logMobileModify
.
setModifiedTime
(
date
);
logMobileModify
.
setMobilePhoneNew
(
mobile
);
logMobileModify
.
setMobilePhoneOld
(
mobilePhone
);
logMobileModifyMapper
.
insert
(
logMobileModify
);
}
}
server/src/main/resources/mybatis/LogMobileModifyMapper.xml
0 → 100644
浏览文件 @
dfe1eeaf
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pica.cloud.account.account.server.mapper.LogMobileModifyMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.account.account.server.entity.LogMobileModify"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"acct_id"
property=
"acctId"
jdbcType=
"INTEGER"
/>
<result
column=
"mobile_phone_new"
property=
"mobilePhoneNew"
jdbcType=
"VARCHAR"
/>
<result
column=
"mobile_phone_old"
property=
"mobilePhoneOld"
jdbcType=
"VARCHAR"
/>
<result
column=
"modified_time"
property=
"modifiedTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"modified_id"
property=
"modifiedId"
jdbcType=
"INTEGER"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"created_id"
property=
"createdId"
jdbcType=
"INTEGER"
/>
<result
column=
"created_time"
property=
"createdTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, acct_id, mobile_phone_new, mobile_phone_old, modified_time, modified_id, delete_flag,
created_id, created_time
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from log_mobile_modify
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from log_mobile_modify
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.LogMobileModify"
>
insert into log_mobile_modify (id, acct_id, mobile_phone_new,
mobile_phone_old, modified_time, modified_id,
delete_flag, created_id, created_time
)
values (#{id,jdbcType=INTEGER}, #{acctId,jdbcType=INTEGER}, #{mobilePhoneNew,jdbcType=VARCHAR},
#{mobilePhoneOld,jdbcType=VARCHAR}, #{modifiedTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER},
#{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogMobileModify"
>
insert into log_mobile_modify
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"acctId != null"
>
acct_id,
</if>
<if
test=
"mobilePhoneNew != null"
>
mobile_phone_new,
</if>
<if
test=
"mobilePhoneOld != null"
>
mobile_phone_old,
</if>
<if
test=
"modifiedTime != null"
>
modified_time,
</if>
<if
test=
"modifiedId != null"
>
modified_id,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</if>
<if
test=
"createdId != null"
>
created_id,
</if>
<if
test=
"createdTime != null"
>
created_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"acctId != null"
>
#{acctId,jdbcType=INTEGER},
</if>
<if
test=
"mobilePhoneNew != null"
>
#{mobilePhoneNew,jdbcType=VARCHAR},
</if>
<if
test=
"mobilePhoneOld != null"
>
#{mobilePhoneOld,jdbcType=VARCHAR},
</if>
<if
test=
"modifiedTime != null"
>
#{modifiedTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifiedId != null"
>
#{modifiedId,jdbcType=INTEGER},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=INTEGER},
</if>
<if
test=
"createdId != null"
>
#{createdId,jdbcType=INTEGER},
</if>
<if
test=
"createdTime != null"
>
#{createdTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogMobileModify"
>
update log_mobile_modify
<set
>
<if
test=
"acctId != null"
>
acct_id = #{acctId,jdbcType=INTEGER},
</if>
<if
test=
"mobilePhoneNew != null"
>
mobile_phone_new = #{mobilePhoneNew,jdbcType=VARCHAR},
</if>
<if
test=
"mobilePhoneOld != null"
>
mobile_phone_old = #{mobilePhoneOld,jdbcType=VARCHAR},
</if>
<if
test=
"modifiedTime != null"
>
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifiedId != null"
>
modified_id = #{modifiedId,jdbcType=INTEGER},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if
test=
"createdId != null"
>
created_id = #{createdId,jdbcType=INTEGER},
</if>
<if
test=
"createdTime != null"
>
created_time = #{createdTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pica.cloud.account.account.server.entity.LogMobileModify"
>
update log_mobile_modify
set acct_id = #{acctId,jdbcType=INTEGER},
mobile_phone_new = #{mobilePhoneNew,jdbcType=VARCHAR},
mobile_phone_old = #{mobilePhoneOld,jdbcType=VARCHAR},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
modified_id = #{modifiedId,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
created_id = #{createdId,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录