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
提交
4531a78c
提交
4531a78c
编写于
4月 08, 2024
作者:
xinxu.wang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'release' into 'master'
Release See merge request
!141
上级
f3e4ce02
240648af
流水线
#55028
已失败 于阶段
变更
12
流水线
1
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
147 行增加
和
11 行删除
+147
-11
pom.xml
server/pom.xml
+1
-1
AccountController.java
.../account/account/server/controller/AccountController.java
+3
-3
LoginController.java
...ud/account/account/server/controller/LoginController.java
+17
-4
Account.java
...com/pica/cloud/account/account/server/entity/Account.java
+34
-0
HospitalSaasUserReq.java
...cloud/account/account/server/req/HospitalSaasUserReq.java
+9
-0
HospitalSaasUserDto.java
...loud/account/account/server/resp/HospitalSaasUserDto.java
+9
-0
HospitalSaasUserEditResp.java
...account/account/server/resp/HospitalSaasUserEditResp.java
+10
-0
LoginService.java
...ca/cloud/account/account/server/service/LoginService.java
+1
-0
HospitalSaasUserServiceImpl.java
...ount/server/service/impl/HospitalSaasUserServiceImpl.java
+12
-0
LoginServiceImpl.java
...account/account/server/service/impl/LoginServiceImpl.java
+16
-0
bootstrap-prod.properties
server/src/main/resources/bootstrap-prod.properties
+2
-1
AccountMapper.xml
server/src/main/resources/mybatis/AccountMapper.xml
+33
-2
未找到文件。
server/pom.xml
浏览文件 @
4531a78c
...
...
@@ -102,7 +102,7 @@
<dependency>
<groupId>
com.pica.cloud.foundation
</groupId>
<artifactId>
pica-cloud-kafka
</artifactId>
<version>
1.
3.6
</version>
<version>
1.
4.2.2
</version>
</dependency>
<!--<dependency>-->
<!--<groupId>io.springfox</groupId>-->
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/AccountController.java
浏览文件 @
4531a78c
...
...
@@ -125,9 +125,9 @@ public class AccountController extends AccountBaseController {
if
(
Integer
.
parseInt
(
flag
)
!=
7
)
{
//判断账号是否已经存在
Account
account
=
accountService
.
getByMobilePhone
(
mobilePhone
);
if
(
StringUtil
.
isNull
(
account
))
{
throw
new
PicaException
(
PicaResultCode
.
RESULE_DATA_NONE
.
code
(),
"本APP采用实名注册制\n如需注册请联系客服"
+
redisClient
.
get
(
"mobile_400_1"
));
}
//
if (StringUtil.isNull(account)) {
//
throw new PicaException(PicaResultCode.RESULE_DATA_NONE.code(),"本APP采用实名注册制\n如需注册请联系客服" + redisClient.get( "mobile_400_1"));
//
}
senderId
=
account
==
null
?
0L
:
account
.
getId
();
}
//验证码保存到redis,失效时间10分钟
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/LoginController.java
浏览文件 @
4531a78c
...
...
@@ -86,6 +86,10 @@ public class LoginController extends AccountBaseController {
@Autowired
private
AppletServiceClient
appletServiceClient
;
@Autowired
private
RegisterService
registerService
;
/**
* 密码登录接口(app、H5、web)
*
...
...
@@ -542,10 +546,19 @@ public class LoginController extends AccountBaseController {
intactUtil
.
sendIntact
(
batchNo
,
"login/applet"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_1
,
"req:"
+
JSON
.
toJSONString
(
req
));
Account
account
=
accountService
.
getByMobilePhone
(
req
.
getMobilePhone
());
//获取账号信息
if
(
account
==
null
)
{
intactUtil
.
sendIntact
(
batchNo
,
"login/applet"
,
com
.
pica
.
cloud
.
foundation
.
completeness
.
contract
.
constants
.
CommonConstants
.
INTACT_CONTENT_LOG_STATUS_3
,
"未注册,请验证码登录"
);
return
PicaResponse
.
toResponse
(
null
,
PicaResultCode
.
RESULE_DATA_NONE
.
code
(),
"本APP采用实名注册制\n如需注册请联系客服"
+
redisClient
.
get
(
"mobile_400_1"
));
BaseRequest
request
=
new
BaseRequest
();
request
.
setMobile
(
req
.
getMobilePhone
());
// request.setAuthCode(authCodeReq.getAuthCode());
logger
.
info
(
"login-register:{}"
,
JSONObject
.
toJSONString
(
request
));
request
.
setProductType
(
5
);
request
.
setSourceType
(
9
);
request
.
setLoginIp
(
super
.
getIpAddr
());
request
.
setUserTokenTourist
(
super
.
getUserTokenTourist
());
registerService
.
register
(
request
);
account
=
accountService
.
getByMobilePhone
(
req
.
getMobilePhone
());
//获取账号信息
// intactUtil.sendIntact(batchNo, "login/applet", com.pica.cloud.foundation.completeness.contract.constants.CommonConstants.INTACT_CONTENT_LOG_STATUS_3, "未注册,请验证码登录");
// return PicaResponse.toResponse(null, PicaResultCode.RESULE_DATA_NONE.code(), "本APP采用实名注册制\n如需注册请联系客服" + redisClient.get( "mobile_400_1"));
}
//更新最后登录时间
Account
update
=
new
Account
();
update
.
setId
(
account
.
getId
());
...
...
@@ -587,7 +600,7 @@ public class LoginController extends AccountBaseController {
request
.
setSourceType
(
4
);
request
.
setLoginIp
(
super
.
getIpAddr
());
request
.
setUserTokenTourist
(
super
.
getUserTokenTourist
());
LoginResult
login
=
loginService
.
loginAndRegister
(
request
);
LoginResult
login
=
loginService
.
loginAndRegister
V2
(
request
);
if
(
StringUtil
.
isNotNull
(
login
))
{
int
expiredSeconds
=
24
*
60
*
60
*
30
;
cacheClient
.
set
(
"token-doctor-unionid-"
+
appletModel
.
getUnionId
(),
login
.
getToken
(),
expiredSeconds
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/entity/Account.java
浏览文件 @
4531a78c
...
...
@@ -97,6 +97,40 @@ public class Account {
@ApiModelProperty
(
"乡镇名称"
)
private
String
townName
;
@ApiModelProperty
(
"行政职称 ID"
)
private
Integer
administerTitleId
;
@ApiModelProperty
(
"行政职称 名称"
)
private
String
administerTitleName
;
@ApiModelProperty
(
"微信号"
)
private
String
wechatCode
;
public
String
getWechatCode
()
{
return
wechatCode
;
}
public
void
setWechatCode
(
String
wechatCode
)
{
this
.
wechatCode
=
wechatCode
;
}
public
Integer
getAdministerTitleId
()
{
return
administerTitleId
;
}
public
void
setAdministerTitleId
(
Integer
administerTitleId
)
{
this
.
administerTitleId
=
administerTitleId
;
}
public
String
getAdministerTitleName
()
{
return
administerTitleName
;
}
public
void
setAdministerTitleName
(
String
administerTitleName
)
{
this
.
administerTitleName
=
administerTitleName
;
}
public
Long
getProvince
()
{
return
province
;
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/req/HospitalSaasUserReq.java
浏览文件 @
4531a78c
...
...
@@ -56,6 +56,15 @@ public class HospitalSaasUserReq {
@ApiModelProperty
(
"登录来源 0:运营平台 1:saas"
)
private
Integer
loginFlag
=
0
;
@ApiModelProperty
(
"行政职称 ID"
)
private
Integer
administerTitleId
;
@ApiModelProperty
(
"行政职称 名称"
)
private
String
administerTitleName
;
@ApiModelProperty
(
"微信号"
)
private
String
wechatCode
;
public
void
checkInsertParams
()
{
if
(
StringUtils
.
isBlank
(
this
.
mobile
))
{
throw
new
PicaWarnException
(
AccountExceptionEnum
.
PICA_NOT_EMPTY
.
getCode
(),
"手机号不能为空"
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/resp/HospitalSaasUserDto.java
浏览文件 @
4531a78c
...
...
@@ -38,4 +38,13 @@ public class HospitalSaasUserDto {
@ApiModelProperty
(
"认证状态 3已认证"
)
private
Integer
status
=
0
;
@ApiModelProperty
(
"行政职称 ID"
)
private
Integer
administerTitleId
;
@ApiModelProperty
(
"行政职称 名称"
)
private
String
administerTitleName
;
@ApiModelProperty
(
"微信号"
)
private
String
wechatCode
;
}
server/src/main/java/com/pica/cloud/account/account/server/resp/HospitalSaasUserEditResp.java
浏览文件 @
4531a78c
...
...
@@ -32,4 +32,14 @@ public class HospitalSaasUserEditResp {
private
Integer
acctId
;
private
Integer
status
;
@ApiModelProperty
(
"行政职称 ID"
)
private
Integer
administerTitleId
;
@ApiModelProperty
(
"行政职称 名称"
)
private
String
administerTitleName
;
@ApiModelProperty
(
"微信号"
)
private
String
wechatCode
;
}
server/src/main/java/com/pica/cloud/account/account/server/service/LoginService.java
浏览文件 @
4531a78c
...
...
@@ -27,6 +27,7 @@ public interface LoginService {
* @return
*/
LoginResult
loginAndRegister
(
BaseRequest
request
);
LoginResult
loginAndRegisterV2
(
BaseRequest
request
);
/**
* 微信登录
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/HospitalSaasUserServiceImpl.java
浏览文件 @
4531a78c
...
...
@@ -175,6 +175,8 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
}
if
(
updateNameOrPwd
)
{
account
.
setId
(
byMobilePhone
.
getId
());
account
.
setAdministerTitleId
(
req
.
getAdministerTitleId
());
account
.
setAdministerTitleName
(
req
.
getAdministerTitleName
());
account
.
setModifyId
(
picaUser
.
getId
().
longValue
());
account
.
setModifyTime
(
new
Date
());
accountMapper
.
updateByIdSelective
(
account
);
...
...
@@ -316,6 +318,13 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
if
(
StringUtil
.
isNotNull
(
req
.
getName
()))
{
account
.
setName
(
req
.
getName
());
}
if
(
StringUtil
.
isNotNull
(
req
.
getAdministerTitleId
()))
{
account
.
setAdministerTitleId
(
req
.
getAdministerTitleId
());
}
if
(
StringUtil
.
isNotNull
(
req
.
getAdministerTitleName
()))
{
account
.
setAdministerTitleName
(
req
.
getAdministerTitleName
());
}
account
.
setWechatCode
(
req
.
getWechatCode
());
accountService
.
updateAccountById
(
account
);
/** 修改密码 */
...
...
@@ -485,6 +494,9 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
account
.
setFirstLoginTime
(
currentTime
);
account
.
setLastLoginTime
(
currentTime
);
account
.
setRegisterSource
(
sourceType
);
account
.
setAdministerTitleId
(
hospitalSaasUserReq
.
getAdministerTitleId
());
account
.
setAdministerTitleName
(
hospitalSaasUserReq
.
getAdministerTitleName
());
account
.
setWechatCode
(
hospitalSaasUserReq
.
getWechatCode
());
return
account
;
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/LoginServiceImpl.java
浏览文件 @
4531a78c
...
...
@@ -331,6 +331,22 @@ public class LoginServiceImpl implements LoginService {
}
}
@Override
public
LoginResult
loginAndRegisterV2
(
BaseRequest
baseRequest
)
{
String
mobile
=
baseRequest
.
getMobile
();
AccountInfoEntity
accountInfoEntity
=
accountInfoDetailMapper
.
selectByMobile
(
AESUtil
.
encryptV0
(
mobile
));
logger
.
info
(
"loginAndRegister-accountInfoEntity is null {}, clientIp:{}"
,
(
accountInfoEntity
==
null
),
baseRequest
.
getLoginIp
());
if
(
accountInfoEntity
==
null
)
{
//说明是注册功能
accountUtils
.
checkMobilePhoneAndAuthCode
(
baseRequest
.
getMobile
(),
baseRequest
.
getFlag
()
+
""
,
baseRequest
.
getAuthCode
());
return
registerService
.
register
(
baseRequest
);
}
else
{
//登录功能
accountUtils
.
checkMobilePhoneAndAuthCode
(
baseRequest
.
getMobile
(),
AccountTypeEnum
.
SYSCODE_TYPE_LOGIN
.
getCode
()
+
""
,
baseRequest
.
getAuthCode
());
return
processLogin
(
baseRequest
,
accountInfoEntity
.
getId
(),
AccountTypeEnum
.
LOGIN_CODE
.
getCode
());
}
}
/**
* 登录逻辑处理
* 登录逻辑处理
...
...
server/src/main/resources/bootstrap-prod.properties
浏览文件 @
4531a78c
...
...
@@ -35,7 +35,8 @@ ribbon.ConnectTimeout=60000
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone
=
GMT+8
memcached.url
=
172.19.137.65:11211
#memcached.url=172.19.137.65:11211
memcached.url
=
172.19.137.4:11211
#\u5FAE\u4FE1\u767B\u9646
weChatAppID
=
wx5103ed453ef2dbe8
...
...
server/src/main/resources/mybatis/AccountMapper.xml
浏览文件 @
4531a78c
...
...
@@ -162,6 +162,15 @@
<if
test=
"townName != null"
>
town_name,
</if>
<if
test=
"administerTitleId != null"
>
administer_title_id,
</if>
<if
test=
"administerTitleName != null"
>
administer_title,
</if>
<if
test=
"wechatCode != null"
>
wechat_code,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"sex != null"
>
...
...
@@ -272,6 +281,15 @@
<if
test=
"townName != null"
>
#{townName},
</if>
<if
test=
"administerTitleId != null"
>
#{administerTitleId},
</if>
<if
test=
"administerTitleName != null"
>
#{administerTitleName},
</if>
<if
test=
"wechatCode != null"
>
#{wechatCode},
</if>
</trim>
</insert>
<update
id=
"updateByIdSelective"
parameterType=
"com.pica.cloud.account.account.server.entity.Account"
>
...
...
@@ -373,6 +391,13 @@
<if
test=
"acctId != null"
>
acct_id = #{acctId,jdbcType=INTEGER},
</if>
<if
test=
"administerTitleId != null"
>
administer_title_id = #{administerTitleId,jdbcType=INTEGER},
</if>
<if
test=
"administerTitleName != null"
>
administer_title = #{administerTitleName},
</if>
wechat_code = #{wechatCode}
</set>
where id = #{id,jdbcType=INTEGER}
</update>
...
...
@@ -435,7 +460,10 @@
p.hospital_id as hospitalId,
p.mobile_phone as mobile,
p.comment as comment,
p.status
p.status,
p.administer_title_id as administerTitleId,
p.administer_title as administerTitleName,
p.wechat_code as wechatCode
from p_doctor as p
where
<include
refid=
"select_list_page"
></include>
...
...
@@ -451,7 +479,10 @@
p.comment as comment,
p.password as password,
p.acct_id as acctId,
p.status as status
p.status as status,
p.administer_title_id as administerTitleId,
p.administer_title as administerTitleName,
p.wechat_code as wechatCode
from p_doctor as p
where p.id = #{id, jdbcType=INTEGER}
and p.delete_flag = 1
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录