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
提交
692ebac1
提交
692ebac1
编写于
9月 25, 2020
作者:
wangyongbo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
绑定逻辑判断
上级
af8358e1
流水线
#30507
已失败 于阶段
in 0 second
变更
1
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
32 行增加
和
20 行删除
+32
-20
LoginServiceImpl.java
...account/account/server/service/impl/LoginServiceImpl.java
+32
-20
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/service/impl/LoginServiceImpl.java
浏览文件 @
692ebac1
...
...
@@ -485,7 +485,8 @@ public class LoginServiceImpl implements LoginService {
result
.
setMobile
(
request
.
getMobile
());
AccountInfoEntity
accountInfo
=
accountInfoDetailMapper
.
selectByMobile
(
AESUtil
.
encryptV0
(
request
.
getMobile
()));
Integer
acctId
=
accountInfo
.
getId
();
processAccountUnion
(
acctId
,
request
.
getUnionId
(),
request
.
getProductType
());
AccountWeChatInfoEntity
entity
=
accountWeChatInfoMapper
.
selectByUnionId
(
request
.
getUnionId
());
processAccountUnion
(
acctId
,
request
.
getUnionId
(),
request
.
getProductType
(),
entity
);
return
result
;
}
...
...
@@ -519,7 +520,7 @@ public class LoginServiceImpl implements LoginService {
updateWechatInfoUser
(
entity
,
weChatUserInfoEntity
);
}
Integer
acctId
=
doctorInfoMapper
.
getAcctIdByDoctorId
(
doctorId
);
processAccountUnion
(
acctId
,
unionId
,
request
.
getProductType
());
processAccountUnion
(
acctId
,
unionId
,
request
.
getProductType
()
,
entity
);
return
weChatUserInfoEntity
.
getNickname
();
}
...
...
@@ -540,7 +541,7 @@ public class LoginServiceImpl implements LoginService {
updateWechatInfoUser
(
entity
,
weChatUserInfoEntity
);
}
Integer
acctId
=
doctorInfoMapper
.
getAcctIdByDoctorId
(
doctorId
);
processAccountUnion
(
acctId
,
unionId
,
request
.
getProductType
());
processAccountUnion
(
acctId
,
unionId
,
request
.
getProductType
()
,
entity
);
Map
<
String
,
String
>
rtnMap
=
new
HashMap
();
rtnMap
.
put
(
"openId"
,
weChatEntity
.
getOpenid
());
rtnMap
.
put
(
"nickname"
,
weChatUserInfoEntity
.
getNickname
());
...
...
@@ -554,7 +555,7 @@ public class LoginServiceImpl implements LoginService {
* @param acctId
* @param unionId
*/
private
void
processAccountUnion
(
Integer
acctId
,
String
unionId
,
Integer
productType
)
{
private
void
processAccountUnion
(
Integer
acctId
,
String
unionId
,
Integer
productType
,
AccountWeChatInfoEntity
entity
)
{
//接入新旭事务一致性
String
batchNo
=
IntactUtils
.
getUUID
();
if
(
null
==
acctId
||
0
==
acctId
){
...
...
@@ -564,7 +565,7 @@ public class LoginServiceImpl implements LoginService {
intactUtil
.
sendIntact
(
batchNo
,
"processAccountUnion"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_1
,
"acctId:"
+
acctId
+
",unionId:"
+
unionId
+
",productType:"
+
productType
);
//先查询当前产品线是否有记录?如果有就更新成delete_flag=2; 然后在插入新的绑定记录
AccountUnionEntity
accountUnionResult
=
accountUnionMapper
.
selectByUnionId
(
unionId
);
if
(
accountUnionResult
!=
null
)
{
if
(
accountUnionResult
!=
null
&&
entity
!=
null
)
{
intactUtil
.
sendIntact
(
batchNo
,
"processAccountUnion"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"该微信号已绑定其他云鹊医账户,你可以使用微信登录云鹊医,在「设置」页解除绑定"
);
throw
new
PicaException
(
AccountExceptionEnum
.
PICA_WECHAT_UNBIND
.
getCode
(),
AccountExceptionEnum
.
PICA_WECHAT_UNBIND
.
getMessage
());
...
...
@@ -573,25 +574,36 @@ public class LoginServiceImpl implements LoginService {
map
.
put
(
"acctId"
,
acctId
);
map
.
put
(
"unionType"
,
AccountTypeEnum
.
UNION_LOGIN_WE_CHAT
.
getCode
());
AccountUnionEntity
accountUnionEntityAccount
=
accountUnionMapper
.
selectByAcctId
(
map
);
AccountWeChatInfoEntity
entity2
=
null
;
if
(
accountUnionEntityAccount
!=
null
)
{
intactUtil
.
sendIntact
(
batchNo
,
"processAccountUnion"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"该手机号已绑定其他微信号,你可以在「设置」页解除绑定"
);
throw
new
PicaException
(
AccountExceptionEnum
.
PICA_WECHAT_BIND_OTHER
.
getCode
(),
AccountExceptionEnum
.
PICA_WECHAT_BIND_OTHER
.
getMessage
());
/**判断微信信息表是否存在 */
entity2
=
accountWeChatInfoMapper
.
selectByUnionId
(
accountUnionEntityAccount
.
getUnionId
());
if
(
entity2
!=
null
)
{
intactUtil
.
sendIntact
(
batchNo
,
"processAccountUnion"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"该手机号已绑定其他微信号,你可以在「设置」页解除绑定"
);
throw
new
PicaException
(
AccountExceptionEnum
.
PICA_WECHAT_BIND_OTHER
.
getCode
(),
AccountExceptionEnum
.
PICA_WECHAT_BIND_OTHER
.
getMessage
());
}
}
AccountUnionEntity
accountUnionEntity
=
new
AccountUnionEntity
();
accountUnionEntity
.
setAcctId
(
acctId
.
longValue
());
accountUnionEntity
.
setDeleteFlag
(
1
);
accountUnionEntity
.
setUnionId
(
unionId
);
accountUnionEntity
.
setCreatedTime
(
new
Date
());
accountUnionEntity
.
setModifiedTime
(
new
Date
());
accountUnionEntity
.
setCreatedId
(
acctId
);
accountUnionEntity
.
setModifiedId
(
acctId
);
accountUnionEntity
.
setUnionType
(
AccountTypeEnum
.
UNION_LOGIN_WE_CHAT
.
getCode
());
accountUnionMapper
.
insertSelective
(
accountUnionEntity
);
if
(
doubleWritingMode
)
{
//双写模式
doctorService
.
bindWeChat
(
acctId
,
unionId
);
if
(
accountUnionResult
==
null
||
accountUnionEntityAccount
==
null
)
{
AccountUnionEntity
accountUnionEntity
=
new
AccountUnionEntity
();
accountUnionEntity
.
setAcctId
(
acctId
.
longValue
());
accountUnionEntity
.
setDeleteFlag
(
1
);
accountUnionEntity
.
setUnionId
(
unionId
);
accountUnionEntity
.
setCreatedTime
(
new
Date
());
accountUnionEntity
.
setModifiedTime
(
new
Date
());
accountUnionEntity
.
setCreatedId
(
acctId
);
accountUnionEntity
.
setModifiedId
(
acctId
);
accountUnionEntity
.
setUnionType
(
AccountTypeEnum
.
UNION_LOGIN_WE_CHAT
.
getCode
());
accountUnionMapper
.
insertSelective
(
accountUnionEntity
);
if
(
doubleWritingMode
)
{
//双写模式
doctorService
.
bindWeChat
(
acctId
,
unionId
);
}
intactUtil
.
sendIntact
(
batchNo
,
"processAccountUnion"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"acctId:"
+
acctId
+
",unionId:"
+
unionId
+
",productType:"
+
productType
);
}
intactUtil
.
sendIntact
(
batchNo
,
"processAccountUnion"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"acctId:"
+
acctId
+
",unionId:"
+
unionId
+
",productType:"
+
productType
);
}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录