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
提交
09515b30
提交
09515b30
编写于
9月 11, 2019
作者:
rushui.chen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
20190911 双写模式把信息写入doctor表
上级
b06baf81
流水线
#14366
已失败 于阶段
in 0 second
变更
7
流水线
1
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
895 行增加
和
640 行删除
+895
-640
DoctorMapper.java
...ica/cloud/account/account/server/mapper/DoctorMapper.java
+6
-2
LoginServiceImpl.java
...account/account/server/service/impl/LoginServiceImpl.java
+0
-2
ModifyMobileServiceImpl.java
.../account/server/service/impl/ModifyMobileServiceImpl.java
+20
-0
PasswordServiceImpl.java
...ount/account/server/service/impl/PasswordServiceImpl.java
+37
-3
RegisterServiceImpl.java
...ount/account/server/service/impl/RegisterServiceImpl.java
+8
-5
bootstrap-dev.properties
server/src/main/resources/bootstrap-dev.properties
+4
-0
DoctorMapper.xml
server/src/main/resources/mybatis/DoctorMapper.xml
+820
-628
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/mapper/DoctorMapper.java
浏览文件 @
09515b30
...
@@ -40,6 +40,12 @@ public interface DoctorMapper {
...
@@ -40,6 +40,12 @@ public interface DoctorMapper {
int
updateByPrimaryKeySelective
(
Doctor
record
);
int
updateByPrimaryKeySelective
(
Doctor
record
);
/**
* 通过账户id更新用户信息
* @param doctor
*/
void
updateByAcctId
(
Doctor
doctor
);
int
deleteByPrimaryKey
(
Integer
id
);
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
Doctor
record
);
int
insert
(
Doctor
record
);
...
@@ -47,6 +53,4 @@ public interface DoctorMapper {
...
@@ -47,6 +53,4 @@ public interface DoctorMapper {
int
insertSelective
(
Doctor
record
);
int
insertSelective
(
Doctor
record
);
int
updateByPrimaryKey
(
Doctor
record
);
int
updateByPrimaryKey
(
Doctor
record
);
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/service/impl/LoginServiceImpl.java
浏览文件 @
09515b30
...
@@ -117,7 +117,6 @@ public class LoginServiceImpl implements LoginService {
...
@@ -117,7 +117,6 @@ public class LoginServiceImpl implements LoginService {
}
}
}
}
@Override
@Override
public
String
loginAndRegister
(
BaseRequest
baseRequest
)
{
public
String
loginAndRegister
(
BaseRequest
baseRequest
)
{
String
mobile
=
baseRequest
.
getMobile
();
String
mobile
=
baseRequest
.
getMobile
();
...
@@ -237,7 +236,6 @@ public class LoginServiceImpl implements LoginService {
...
@@ -237,7 +236,6 @@ public class LoginServiceImpl implements LoginService {
processAccountUnion
(
request
.
getAccId
(),
unionId
);
processAccountUnion
(
request
.
getAccId
(),
unionId
);
}
}
private
void
processAccountUnion
(
Integer
acctId
,
String
unionId
)
{
private
void
processAccountUnion
(
Integer
acctId
,
String
unionId
)
{
AccountUnionEntity
accountUnionEntity
=
new
AccountUnionEntity
();
AccountUnionEntity
accountUnionEntity
=
new
AccountUnionEntity
();
accountUnionEntity
.
setAcctId
(
acctId
.
longValue
());
accountUnionEntity
.
setAcctId
(
acctId
.
longValue
());
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/ModifyMobileServiceImpl.java
浏览文件 @
09515b30
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
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.AccountInfoEntity
;
import
com.pica.cloud.account.account.server.entity.Doctor
;
import
com.pica.cloud.account.account.server.enums.AccountExceptionEnum
;
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.exception.AccountException
;
import
com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper
;
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.service.ModifyMobileService
;
import
com.pica.cloud.account.account.server.service.ModifyMobileService
;
import
com.pica.cloud.foundation.utils.utils.EncryptCreateUtil
;
import
com.pica.cloud.foundation.utils.utils.EncryptCreateUtil
;
import
com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -18,6 +22,12 @@ public class ModifyMobileServiceImpl implements ModifyMobileService {
...
@@ -18,6 +22,12 @@ public class ModifyMobileServiceImpl implements ModifyMobileService {
@Autowired
@Autowired
private
AccountInfoDetailMapper
accountInfoDetailMapper
;
private
AccountInfoDetailMapper
accountInfoDetailMapper
;
@Autowired
private
DoctorMapper
doctorMapper
;
@Value
(
"${doubleWritingMode}"
)
private
boolean
doubleWritingMode
;
@Override
@Override
public
void
modify
(
Integer
acctId
,
String
mobile
)
{
public
void
modify
(
Integer
acctId
,
String
mobile
)
{
AccountInfoEntity
entity
=
accountInfoDetailMapper
.
selectByPrimaryKey
(
acctId
);
AccountInfoEntity
entity
=
accountInfoDetailMapper
.
selectByPrimaryKey
(
acctId
);
...
@@ -31,5 +41,15 @@ public class ModifyMobileServiceImpl implements ModifyMobileService {
...
@@ -31,5 +41,15 @@ public class ModifyMobileServiceImpl implements ModifyMobileService {
accountInfoEntity
.
setModifiedTime
(
new
Date
());
accountInfoEntity
.
setModifiedTime
(
new
Date
());
accountInfoEntity
.
setMobilePhone
(
EncryptCreateUtil
.
encrypt
(
mobile
));
accountInfoEntity
.
setMobilePhone
(
EncryptCreateUtil
.
encrypt
(
mobile
));
accountInfoDetailMapper
.
updateMobileByPrimaryKey
(
accountInfoEntity
);
accountInfoDetailMapper
.
updateMobileByPrimaryKey
(
accountInfoEntity
);
if
(
doubleWritingMode
)
{
//更新p_doctor表中用户的手机号
Date
currentTime
=
new
Date
();
Doctor
doctor
=
new
Doctor
();
doctor
.
setAcctId
(
acctId
);
doctor
.
setModifyTime
(
currentTime
);
doctor
.
setModifyId
(
acctId
);
doctor
.
setMobilePhone
(
EncryptCreateUtil
.
encrypt
(
mobile
));
doctorMapper
.
updateByAcctId
(
doctor
);
}
}
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/PasswordServiceImpl.java
浏览文件 @
09515b30
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
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.AccountInfoEntity
;
import
com.pica.cloud.account.account.server.entity.Doctor
;
import
com.pica.cloud.account.account.server.entity.LogPWDModifyEntity
;
import
com.pica.cloud.account.account.server.entity.LogPWDModifyEntity
;
import
com.pica.cloud.account.account.server.enums.AccountTypeEnum
;
import
com.pica.cloud.account.account.server.enums.AccountTypeEnum
;
import
com.pica.cloud.account.account.server.enums.AccountExceptionEnum
;
import
com.pica.cloud.account.account.server.enums.AccountExceptionEnum
;
...
@@ -8,10 +9,12 @@ import com.pica.cloud.account.account.server.exception.AccountException;
...
@@ -8,10 +9,12 @@ import com.pica.cloud.account.account.server.exception.AccountException;
import
com.pica.cloud.account.account.server.log.AccountLogEntityUtils
;
import
com.pica.cloud.account.account.server.log.AccountLogEntityUtils
;
import
com.pica.cloud.account.account.server.log.AccountLogUtils
;
import
com.pica.cloud.account.account.server.log.AccountLogUtils
;
import
com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper
;
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.req.BaseRequest
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
import
com.pica.cloud.account.account.server.service.PasswordService
;
import
com.pica.cloud.account.account.server.service.PasswordService
;
import
com.pica.cloud.foundation.utils.utils.EncryptCreateUtil
;
import
com.pica.cloud.foundation.utils.utils.EncryptCreateUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -22,19 +25,29 @@ public class PasswordServiceImpl implements PasswordService {
...
@@ -22,19 +25,29 @@ public class PasswordServiceImpl implements PasswordService {
@Autowired
@Autowired
private
AccountInfoDetailMapper
accountInfoDetailMapper
;
private
AccountInfoDetailMapper
accountInfoDetailMapper
;
@Autowired
private
DoctorMapper
doctorMapper
;
@Autowired
@Autowired
private
AccountLogUtils
picaLogUtils
;
private
AccountLogUtils
picaLogUtils
;
@Value
(
"${doubleWritingMode}"
)
private
boolean
doubleWritingMode
;
@Override
@Override
public
void
modifyPassword
(
Integer
acctId
,
String
oldPwd
,
String
pwd
)
{
public
void
modifyPassword
(
Integer
acctId
,
String
oldPwd
,
String
pwd
)
{
AccountInfoEntity
entity
=
accountInfoDetailMapper
.
selectByPrimaryKey
(
acctId
);
AccountInfoEntity
entity
=
accountInfoDetailMapper
.
selectByPrimaryKey
(
acctId
);
if
(
entity
.
getPassword
().
equals
(
oldPwd
))
{
if
(
entity
.
getPassword
().
equals
(
oldPwd
))
{
Date
currentTime
=
new
Date
();
AccountInfoEntity
accountInfoEntity
=
new
AccountInfoEntity
();
AccountInfoEntity
accountInfoEntity
=
new
AccountInfoEntity
();
accountInfoEntity
.
setId
(
acctId
);
accountInfoEntity
.
setId
(
acctId
);
accountInfoEntity
.
setModifiedId
(
acctId
);
accountInfoEntity
.
setModifiedId
(
acctId
);
accountInfoEntity
.
setModifiedTime
(
new
Date
()
);
accountInfoEntity
.
setModifiedTime
(
currentTime
);
accountInfoEntity
.
setPassword
(
pwd
);
accountInfoEntity
.
setPassword
(
pwd
);
accountInfoDetailMapper
.
updatePasswordByPrimaryKey
(
accountInfoEntity
);
accountInfoDetailMapper
.
updatePasswordByPrimaryKey
(
accountInfoEntity
);
if
(
doubleWritingMode
)
{
processDoubleWrite
(
acctId
,
pwd
);
}
//密码修改日志
//密码修改日志
LogPWDModifyEntity
logPWDModifyEntity
=
AccountLogEntityUtils
.
getLogPWDModifyEntity
(
acctId
,
entity
.
getMobilePhone
(),
LogPWDModifyEntity
logPWDModifyEntity
=
AccountLogEntityUtils
.
getLogPWDModifyEntity
(
acctId
,
entity
.
getMobilePhone
(),
oldPwd
,
pwd
,
AccountTypeEnum
.
LOG_TYPE_PASSWORD
.
getCode
());
oldPwd
,
pwd
,
AccountTypeEnum
.
LOG_TYPE_PASSWORD
.
getCode
());
...
@@ -48,13 +61,18 @@ public class PasswordServiceImpl implements PasswordService {
...
@@ -48,13 +61,18 @@ public class PasswordServiceImpl implements PasswordService {
public
void
forgetPassword
(
BaseRequest
request
)
{
public
void
forgetPassword
(
BaseRequest
request
)
{
AccountInfoEntity
entity
=
accountInfoDetailMapper
.
selectByMobile
(
EncryptCreateUtil
.
encrypt
(
request
.
getMobile
()));
AccountInfoEntity
entity
=
accountInfoDetailMapper
.
selectByMobile
(
EncryptCreateUtil
.
encrypt
(
request
.
getMobile
()));
if
(
entity
!=
null
)
{
if
(
entity
!=
null
)
{
String
password
=
request
.
getPassword
();
Integer
accId
=
entity
.
getId
();
Integer
accId
=
entity
.
getId
();
Date
currentTime
=
new
Date
();
AccountInfoEntity
accountInfoEntity
=
new
AccountInfoEntity
();
AccountInfoEntity
accountInfoEntity
=
new
AccountInfoEntity
();
accountInfoEntity
.
setId
(
accId
);
accountInfoEntity
.
setId
(
accId
);
accountInfoEntity
.
setModifiedId
(
accId
);
accountInfoEntity
.
setModifiedId
(
accId
);
accountInfoEntity
.
setModifiedTime
(
new
Date
()
);
accountInfoEntity
.
setModifiedTime
(
currentTime
);
accountInfoEntity
.
setPassword
(
request
.
getPassword
()
);
accountInfoEntity
.
setPassword
(
password
);
accountInfoDetailMapper
.
updatePasswordByPrimaryKey
(
accountInfoEntity
);
accountInfoDetailMapper
.
updatePasswordByPrimaryKey
(
accountInfoEntity
);
if
(
doubleWritingMode
)
{
processDoubleWrite
(
accId
,
password
);
}
//密码修改日志
//密码修改日志
LogPWDModifyEntity
logPWDModifyEntity
=
AccountLogEntityUtils
.
getLogPWDModifyEntity
(
accId
,
entity
.
getMobilePhone
(),
LogPWDModifyEntity
logPWDModifyEntity
=
AccountLogEntityUtils
.
getLogPWDModifyEntity
(
accId
,
entity
.
getMobilePhone
(),
""
,
request
.
getPassword
(),
AccountTypeEnum
.
LOG_TYPE_PASSWORD
.
getCode
());
""
,
request
.
getPassword
(),
AccountTypeEnum
.
LOG_TYPE_PASSWORD
.
getCode
());
...
@@ -64,4 +82,20 @@ public class PasswordServiceImpl implements PasswordService {
...
@@ -64,4 +82,20 @@ public class PasswordServiceImpl implements PasswordService {
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_NOT_REGISTER
);
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_NOT_REGISTER
);
}
}
}
}
/**
* 双写模式,把密码存储到p_doctor表
*
* @param accId
* @param password
*/
private
void
processDoubleWrite
(
Integer
accId
,
String
password
)
{
Date
currentTime
=
new
Date
();
Doctor
doctor
=
new
Doctor
();
doctor
.
setPassword
(
password
);
doctor
.
setAcctId
(
accId
);
doctor
.
setModifyTime
(
currentTime
);
doctor
.
setModifyId
(
accId
);
doctorMapper
.
updateByAcctId
(
doctor
);
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/RegisterServiceImpl.java
浏览文件 @
09515b30
...
@@ -14,6 +14,7 @@ import com.pica.cloud.account.account.server.log.AccountLogUtils;
...
@@ -14,6 +14,7 @@ import com.pica.cloud.account.account.server.log.AccountLogUtils;
import
com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper
;
import
com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper
;
import
com.pica.cloud.account.account.server.mapper.AccountMapper
;
import
com.pica.cloud.account.account.server.mapper.AccountMapper
;
import
com.pica.cloud.account.account.server.mapper.AccountPatientInfoMapper
;
import
com.pica.cloud.account.account.server.mapper.AccountPatientInfoMapper
;
import
com.pica.cloud.account.account.server.mapper.DoctorMapper
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
import
com.pica.cloud.account.account.server.req.BaseRequest
;
import
com.pica.cloud.account.account.server.service.RegisterService
;
import
com.pica.cloud.account.account.server.service.RegisterService
;
import
com.pica.cloud.account.account.server.util.AccountUtils
;
import
com.pica.cloud.account.account.server.util.AccountUtils
;
...
@@ -24,6 +25,7 @@ import org.slf4j.Logger;
...
@@ -24,6 +25,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -62,13 +64,13 @@ public class RegisterServiceImpl implements RegisterService {
...
@@ -62,13 +64,13 @@ public class RegisterServiceImpl implements RegisterService {
Date
currentTime
=
new
Date
();
Date
currentTime
=
new
Date
();
int
productType
=
baseRequest
.
getProductType
();
int
productType
=
baseRequest
.
getProductType
();
int
sourceType
=
baseRequest
.
getSourceType
();
int
sourceType
=
baseRequest
.
getSourceType
();
String
password
=
baseRequest
.
getPassword
();
AccountInfoEntity
accountInfo
=
new
AccountInfoEntity
();
AccountInfoEntity
accountInfo
=
new
AccountInfoEntity
();
accountInfo
.
setMobilePhone
(
EncryptCreateUtil
.
encrypt
(
baseRequest
.
getMobile
()));
accountInfo
.
setMobilePhone
(
EncryptCreateUtil
.
encrypt
(
baseRequest
.
getMobile
()));
if
(
StringUtils
.
isNotEmpty
(
baseRequest
.
getPassword
()))
{
if
(
StringUtils
.
isEmpty
(
password
))
{
accountInfo
.
setPassword
(
baseRequest
.
getPassword
());
password
=
""
;
}
else
{
accountInfo
.
setPassword
(
""
);
}
}
accountInfo
.
setPassword
(
password
);
accountInfo
.
setCreatedTime
(
currentTime
);
accountInfo
.
setCreatedTime
(
currentTime
);
accountInfo
.
setCreatedId
(
0
);
accountInfo
.
setCreatedId
(
0
);
accountInfo
.
setModifiedId
(
0
);
accountInfo
.
setModifiedId
(
0
);
...
@@ -93,10 +95,11 @@ public class RegisterServiceImpl implements RegisterService {
...
@@ -93,10 +95,11 @@ public class RegisterServiceImpl implements RegisterService {
}
else
{
}
else
{
Account
account
=
new
Account
();
Account
account
=
new
Account
();
account
.
setAcctId
(
acctId
);
account
.
setAcctId
(
acctId
);
account
.
setMobilePhone
(
EncryptCreateUtil
.
encrypt
(
account
.
getMobilePhone
()));
//手机号加密
account
.
setMobilePhone
(
EncryptCreateUtil
.
encrypt
(
account
.
getMobilePhone
()));
account
.
setDeleteFlag
(
1
);
account
.
setDeleteFlag
(
1
);
account
.
setCreatId
(
0L
);
account
.
setCreatId
(
0L
);
account
.
setModifyId
(
0L
);
account
.
setModifyId
(
0L
);
account
.
setPassword
(
password
);
account
.
setCreatTime
(
currentTime
);
account
.
setCreatTime
(
currentTime
);
account
.
setModifyTime
(
currentTime
);
account
.
setModifyTime
(
currentTime
);
account
.
setFirstLoginTime
(
currentTime
);
account
.
setFirstLoginTime
(
currentTime
);
...
...
server/src/main/resources/bootstrap-dev.properties
浏览文件 @
09515b30
...
@@ -41,4 +41,8 @@ weChatAppID=wx5103ed453ef2dbe8
...
@@ -41,4 +41,8 @@ weChatAppID=wx5103ed453ef2dbe8
weChatAppSecret
=
6faa9bef3302786c08b2baf278613f38
weChatAppSecret
=
6faa9bef3302786c08b2baf278613f38
weChatURL
=
https://api.weixin.qq.com/sns/userinfo?
weChatURL
=
https://api.weixin.qq.com/sns/userinfo?
doubleWritingMode
=
true
server/src/main/resources/mybatis/DoctorMapper.xml
浏览文件 @
09515b30
此差异已折叠。
点击以展开。
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录