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
提交
0edf4832
提交
0edf4832
编写于
7月 09, 2020
作者:
peijun.zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
账户增加 直播渠道用户
上级
a7fef2a1
变更
8
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
33 行增加
和
14 行删除
+33
-14
AccountController.java
.../account/account/server/controller/AccountController.java
+4
-3
LoginController.java
...ud/account/account/server/controller/LoginController.java
+1
-0
AccountTypeEnum.java
...a/cloud/account/account/server/enums/AccountTypeEnum.java
+1
-0
AccountService.java
.../cloud/account/account/server/service/AccountService.java
+1
-1
AccountServiceImpl.java
...count/account/server/service/impl/AccountServiceImpl.java
+11
-3
CircleAccountServiceImpl.java
...account/server/service/impl/CircleAccountServiceImpl.java
+4
-1
LoginServiceImpl.java
...account/account/server/service/impl/LoginServiceImpl.java
+10
-5
PasswordServiceImpl.java
...ount/account/server/service/impl/PasswordServiceImpl.java
+1
-1
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/controller/AccountController.java
浏览文件 @
0edf4832
...
...
@@ -204,7 +204,7 @@ public class AccountController extends AccountBaseController {
account
.
setRegisterSource
(
AccountTypeEnum
.
DEVICE_TYPE_H5
.
getCode
());
//H5注册
}
//创建账号
accountService
.
createAccount
(
account
);
accountService
.
createAccount
(
account
,
null
);
//生成token并返回
String
newToken
=
this
.
generateToken
(
account
,
deviceType
);
...
...
@@ -379,8 +379,9 @@ public class AccountController extends AccountBaseController {
default
:
account2
.
setRegisterSource
(
AccountTypeEnum
.
DEVICE_TYPE_H5
.
getCode
());
//H5注册
}
//创建账号
accountService
.
createAccount
(
account2
);
//创建web live账号
accountService
.
createAccount
(
account2
,
AccountTypeEnum
.
PRODUCT_TYPE_ECO_LIVE
.
getCode
());
//生成token并返回
String
newToken
=
this
.
generateTokenWebLive
(
account2
,
deviceType
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/LoginController.java
浏览文件 @
0edf4832
...
...
@@ -198,6 +198,7 @@ public class LoginController extends AccountBaseController {
try
{
cacheClient
.
expire
(
cache_prifix
+
request
.
getWeChatCode
(),
60
);
long
doctorId
=
super
.
getDoctorIdByToken
();
logger
.
info
(
"bindWeChat doctorId:{}"
,
doctorId
);
String
nickname
=
loginService
.
bindWeChat
(
doctorId
,
request
);
Map
<
String
,
String
>
map
=
new
HashMap
();
map
.
put
(
"nickname"
,
nickname
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/enums/AccountTypeEnum.java
浏览文件 @
0edf4832
...
...
@@ -23,6 +23,7 @@ public enum AccountTypeEnum {
//产品来源相关枚举
PRODUCT_TYPE_DOCTOR
(
1
,
"云鹊医产品系"
),
PRODUCT_TYPE_HEALTH
(
2
,
"云鹊健康产品系"
),
PRODUCT_TYPE_ECO_LIVE
(
3
,
"生态直播"
),
//终端类型
DEVICE_TYPE_ANDROID
(
1
,
"安卓"
),
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/AccountService.java
浏览文件 @
0edf4832
...
...
@@ -22,7 +22,7 @@ public interface AccountService {
Account
getByUnionid
(
String
unionid
);
//创建账号
void
createAccount
(
Account
account
);
void
createAccount
(
Account
account
,
Integer
bizType
);
//更新账号信息
void
updateAccountById
(
Account
account
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/AccountServiceImpl.java
浏览文件 @
0edf4832
...
...
@@ -77,7 +77,7 @@ public class AccountServiceImpl implements AccountService {
//创建账号
@Override
@Transactional
public
void
createAccount
(
Account
account
)
{
public
void
createAccount
(
Account
account
,
Integer
bizType
)
{
//账户表
AccountInfoEntity
accountInfo
=
new
AccountInfoEntity
();
Date
currentTime
=
new
Date
();
...
...
@@ -90,7 +90,11 @@ public class AccountServiceImpl implements AccountService {
accountInfo
.
setRegTime
(
currentTime
);
accountInfo
.
setDeleteFlag
(
1
);
accountInfo
.
setSex
(
0
);
accountInfo
.
setRegisterProduct
(
AccountTypeEnum
.
PRODUCT_TYPE_DOCTOR
.
getCode
());
if
(
null
!=
bizType
&&
bizType
.
equals
(
AccountTypeEnum
.
PRODUCT_TYPE_ECO_LIVE
.
getCode
()))
{
accountInfo
.
setRegisterProduct
(
AccountTypeEnum
.
PRODUCT_TYPE_ECO_LIVE
.
getCode
());
}
else
{
accountInfo
.
setRegisterProduct
(
AccountTypeEnum
.
PRODUCT_TYPE_DOCTOR
.
getCode
());
}
if
(
null
!=
account
.
getRegisterSource
()
&&
0
!=
account
.
getRegisterSource
()){
accountInfo
.
setRegisterSource
(
account
.
getRegisterSource
());
}
else
{
...
...
@@ -106,7 +110,11 @@ public class AccountServiceImpl implements AccountService {
account
.
setModifyId
(
0L
);
account
.
setAcctId
(
acctId
);
account
.
setCreatTime
(
currentTime
);
account
.
setRegisterSource
(
AccountTypeEnum
.
DEVICE_TYPE_H5
.
getCode
());
if
(
null
!=
account
.
getRegisterSource
()
&&
0
!=
account
.
getRegisterSource
()){
account
.
setRegisterSource
(
account
.
getRegisterSource
());
}
else
{
account
.
setRegisterSource
(
AccountTypeEnum
.
DEVICE_TYPE_H5
.
getCode
());
}
account
.
setModifyTime
(
currentTime
);
account
.
setFirstLoginTime
(
currentTime
);
account
.
setLastLoginTime
(
currentTime
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/CircleAccountServiceImpl.java
浏览文件 @
0edf4832
...
...
@@ -3,6 +3,7 @@ package com.pica.cloud.account.account.server.service.impl;
import
com.pica.cloud.account.account.common.req.circle.CircleAcctInit
;
import
com.pica.cloud.account.account.common.req.circle.CircleAcctInitReq
;
import
com.pica.cloud.account.account.server.entity.Account
;
import
com.pica.cloud.account.account.server.enums.AccountTypeEnum
;
import
com.pica.cloud.account.account.server.mapper.AccountMapper
;
import
com.pica.cloud.account.account.server.service.CircleAccountService
;
import
com.pica.cloud.account.account.server.service.AccountService
;
...
...
@@ -47,10 +48,12 @@ public class CircleAccountServiceImpl implements CircleAccountService {
account
.
setNickname
(
acct
.
getUserName
());
account
.
setMobilePhone
(
acct
.
getEncryMobile
());
account
.
setRegisterSource
(
circleAcctInitReq
.
getRegisterSource
());
accountService
.
createAccount
(
account
);
accountService
.
createAccount
(
account
,
AccountTypeEnum
.
PRODUCT_TYPE_ECO_LIVE
.
getCode
()
);
savedIds
.
add
(
account
.
getId
().
intValue
());
logger
.
info
(
"createCircleAccount insert {}"
,
account
.
getId
().
intValue
());
}
else
{
savedIds
.
add
(
dbAcct
.
getId
().
intValue
());
logger
.
info
(
"createCircleAccount exist {}"
,
dbAcct
.
getId
().
intValue
());
}
}
}
catch
(
Exception
e
){
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/LoginServiceImpl.java
浏览文件 @
0edf4832
...
...
@@ -270,7 +270,7 @@ public class LoginServiceImpl implements LoginService {
intactUtil
.
sendIntact
(
batchNo
,
"pwdLoginCorrect"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"request:"
+
JSON
.
toJSONString
(
request
)+
",+mobile 此手机号无用户:"
+
mobile
+
",encrypt:"
+
",accountInfoEntity:"
+
JSON
.
toJSONString
(
accountInfoEntity
));
}
Integer
userId
=
0
;
if
(
productType
==
AccountTypeEnum
.
PRODUCT_TYPE_DOCTOR
.
getCode
())
{
if
(
productType
!=
AccountTypeEnum
.
PRODUCT_TYPE_HEALTH
.
getCode
())
{
userId
=
doctorInfo
.
getId
();
}
else
if
(
productType
==
AccountTypeEnum
.
PRODUCT_TYPE_HEALTH
.
getCode
())
{
AccountPatientInfoEntity
accountPatientInfoEntity
=
accountPatientInfoMapper
.
selectByAcctId
(
acctId
);
...
...
@@ -288,7 +288,7 @@ public class LoginServiceImpl implements LoginService {
result
.
setUserId
(
userId
.
longValue
());
result
.
setMobile
(
mobile
);
result
.
setDoctorId
(
EncryptUtils
.
encryptContent
(
userId
+
""
,
EncryptConstants
.
ENCRYPT_TYPE_ID
));
if
(
productType
==
AccountTypeEnum
.
PRODUCT_TYPE_DOCTOR
.
getCode
())
{
if
(
productType
!=
AccountTypeEnum
.
PRODUCT_TYPE_HEALTH
.
getCode
())
{
//非居民时,都为医生产品渠道
result
.
setEntireFlag
(
doctorInfo
.
getEntireFlag
());
LogLoginEntity
entity
=
AccountLogEntityUtils
.
getLogLoginEntity
(
acctId
,
productType
,
sourceType
,
...
...
@@ -353,7 +353,7 @@ public class LoginServiceImpl implements LoginService {
result
.
setMobile
(
baseRequest
.
getMobile
());
result
.
setDoctorId
(
EncryptUtils
.
encryptContent
(
userId
+
""
,
EncryptConstants
.
ENCRYPT_TYPE_ID
));
//是否完善过个人信息(云鹊医app才需要)
if
(
baseRequest
.
getProductType
()
==
AccountTypeEnum
.
PRODUCT_TYPE_DOCTOR
.
getCode
())
{
if
(
baseRequest
.
getProductType
()
!=
AccountTypeEnum
.
PRODUCT_TYPE_HEALTH
.
getCode
())
{
Doctor
doctorEntity
=
doctorInfoMapper
.
selectByPrimaryKey
(
userId
.
intValue
());
result
.
setEntireFlag
(
doctorEntity
.
getEntireFlag
());
}
...
...
@@ -416,7 +416,7 @@ public class LoginServiceImpl implements LoginService {
result
.
setUserId
(
userId
);
result
.
setBindFlag
(
AccountTypeEnum
.
BIND_STATUS_SUCCESS
.
getCode
()
+
""
);
result
.
setDoctorId
(
EncryptUtils
.
encryptContent
(
userId
+
""
,
EncryptConstants
.
ENCRYPT_TYPE_ID
));
if
(
request
.
getProductType
()
==
AccountTypeEnum
.
PRODUCT_TYPE_DOCTOR
.
getCode
())
{
if
(
request
.
getProductType
()
!=
AccountTypeEnum
.
PRODUCT_TYPE_HEALTH
.
getCode
())
{
PICAPDoctor
doctor
=
doctorInfoMapper
.
queryDoctor
(
userId
);
result
.
setEntireFlag
(
doctor
.
getEntire_flag
());
result
.
setMobile
(
AESUtil
.
decryptV0
(
doctor
.
getMobile_phone
()));
...
...
@@ -528,6 +528,11 @@ public class LoginServiceImpl implements LoginService {
private
void
processAccountUnion
(
Integer
acctId
,
String
unionId
,
Integer
productType
)
{
//接入新旭事务一致性
String
batchNo
=
IntactUtils
.
getUUID
();
if
(
null
==
acctId
||
0
==
acctId
){
throw
new
PicaException
(
AccountExceptionEnum
.
PICA_LOGIN_AGAIN
.
getCode
(),
AccountExceptionEnum
.
PICA_LOGIN_AGAIN
.
getMessage
());
}
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
);
...
...
@@ -751,7 +756,7 @@ public class LoginServiceImpl implements LoginService {
result
.
setUserId
(
userId
);
result
.
setBindFlag
(
AccountTypeEnum
.
BIND_STATUS_SUCCESS
.
getCode
()
+
""
);
result
.
setDoctorId
(
EncryptUtils
.
encryptContent
(
userId
+
""
,
EncryptConstants
.
ENCRYPT_TYPE_ID
));
if
(
request
.
getProductType
()
==
AccountTypeEnum
.
PRODUCT_TYPE_DOCTOR
.
getCode
())
{
if
(
request
.
getProductType
()
!=
AccountTypeEnum
.
PRODUCT_TYPE_HEALTH
.
getCode
())
{
PICAPDoctor
doctor
=
doctorInfoMapper
.
queryDoctor
(
userId
);
result
.
setEntireFlag
(
doctor
.
getEntire_flag
());
result
.
setMobile
(
AESUtil
.
decryptV0
(
doctor
.
getMobile_phone
()));
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/PasswordServiceImpl.java
浏览文件 @
0edf4832
...
...
@@ -133,7 +133,7 @@ public class PasswordServiceImpl implements PasswordService {
result
.
setMobile
(
request
.
getMobile
());
result
.
setDoctorId
(
EncryptUtils
.
encryptContent
(
userId
+
""
,
EncryptConstants
.
ENCRYPT_TYPE_ID
));
// 是否完善过个人信息(云鹊医app才需要)
if
(
request
.
getProductType
()
==
AccountTypeEnum
.
PRODUCT_TYPE_DOCTOR
.
getCode
())
{
if
(
request
.
getProductType
()
!=
AccountTypeEnum
.
PRODUCT_TYPE_HEALTH
.
getCode
())
{
Doctor
doctorEntity
=
doctorInfoMapper
.
selectByPrimaryKey
(
userId
.
intValue
());
result
.
setEntireFlag
(
doctorEntity
.
getEntireFlag
());
}
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录