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
提交
26d1e997
提交
26d1e997
编写于
3月 09, 2022
作者:
minghao.wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature: 创建用户
上级
788524eb
流水线
#43178
已失败 于阶段
变更
9
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
133 行增加
和
3 行删除
+133
-3
pom.xml
common/pom.xml
+1
-1
CreateAccountReq.java
...ca/cloud/account/account/common/req/CreateAccountReq.java
+40
-0
pom.xml
server/pom.xml
+1
-1
AccountController.java
.../account/account/server/controller/AccountController.java
+9
-0
Account.java
...com/pica/cloud/account/account/server/entity/Account.java
+20
-0
AccountExceptionEnum.java
...ud/account/account/server/enums/AccountExceptionEnum.java
+6
-0
AccountService.java
.../cloud/account/account/server/service/AccountService.java
+5
-0
AccountServiceImpl.java
...count/account/server/service/impl/AccountServiceImpl.java
+30
-0
AccountMapper.xml
server/src/main/resources/mybatis/AccountMapper.xml
+21
-1
未找到文件。
common/pom.xml
浏览文件 @
26d1e997
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<groupId>
com.pica.cloud.account
</groupId>
<groupId>
com.pica.cloud.account
</groupId>
<artifactId>
pica-cloud-account-common
</artifactId>
<artifactId>
pica-cloud-account-common
</artifactId>
<version>
1.0.
8
</version>
<version>
1.0.
9
</version>
<name>
pica-cloud-account-common
</name>
<name>
pica-cloud-account-common
</name>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
...
...
common/src/main/java/com/pica/cloud/account/account/common/req/CreateAccountReq.java
0 → 100644
浏览文件 @
26d1e997
package
com
.
pica
.
cloud
.
account
.
account
.
common
.
req
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
@ApiModel
public
class
CreateAccountReq
{
@ApiModelProperty
(
"机构id"
)
private
Integer
hospitalId
;
@ApiModelProperty
(
"输入姓名"
)
private
String
doctorName
;
@ApiModelProperty
(
"手机号"
)
private
String
mobilePhone
;
public
Integer
getHospitalId
()
{
return
hospitalId
;
}
public
void
setHospitalId
(
Integer
hospitalId
)
{
this
.
hospitalId
=
hospitalId
;
}
public
String
getDoctorName
()
{
return
doctorName
;
}
public
void
setDoctorName
(
String
doctorName
)
{
this
.
doctorName
=
doctorName
;
}
public
String
getMobilePhone
()
{
return
mobilePhone
;
}
public
void
setMobilePhone
(
String
mobilePhone
)
{
this
.
mobilePhone
=
mobilePhone
;
}
}
server/pom.xml
浏览文件 @
26d1e997
...
@@ -161,7 +161,7 @@
...
@@ -161,7 +161,7 @@
<dependency>
<dependency>
<groupId>
com.pica.cloud.account
</groupId>
<groupId>
com.pica.cloud.account
</groupId>
<artifactId>
pica-cloud-account-common
</artifactId>
<artifactId>
pica-cloud-account-common
</artifactId>
<version>
1.
0.8
</version>
<version>
1.
1.0
</version>
</dependency>
</dependency>
<dependency>
<dependency>
...
...
server/src/main/java/com/pica/cloud/account/account/server/controller/AccountController.java
浏览文件 @
26d1e997
...
@@ -2,6 +2,7 @@ package com.pica.cloud.account.account.server.controller;
...
@@ -2,6 +2,7 @@ package com.pica.cloud.account.account.server.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pica.cloud.account.account.common.req.CreateAccountReq
;
import
com.pica.cloud.account.account.server.constants.Constants
;
import
com.pica.cloud.account.account.server.constants.Constants
;
import
com.pica.cloud.account.account.server.entity.Account
;
import
com.pica.cloud.account.account.server.entity.Account
;
import
com.pica.cloud.account.account.server.entity.Doctor
;
import
com.pica.cloud.account.account.server.entity.Doctor
;
...
@@ -462,6 +463,14 @@ public class AccountController extends AccountBaseController {
...
@@ -462,6 +463,14 @@ public class AccountController extends AccountBaseController {
return
PicaResponse
.
toResponse
(
doctorService
.
getDoctorsByInnerOrg
());
return
PicaResponse
.
toResponse
(
doctorService
.
getDoctorsByInnerOrg
());
}
}
@EnabledLoginValidate
@ApiOperation
(
"代客下单-创建用户"
)
@PostMapping
(
"/create"
)
public
PicaResponse
createAccountV2
(
@RequestBody
CreateAccountReq
req
)
{
return
PicaResponse
.
toResponse
(
accountService
.
createAccountV2
(
req
,
fetchPicaUser
()));
}
//手机格式校验
//手机格式校验
private
void
checkMobilePhone
(
String
mobilePhone
)
{
private
void
checkMobilePhone
(
String
mobilePhone
)
{
if
(
StringUtils
.
isBlank
(
mobilePhone
)
||
!
ValidateUtils
.
isMobile
(
mobilePhone
))
{
if
(
StringUtils
.
isBlank
(
mobilePhone
)
||
!
ValidateUtils
.
isMobile
(
mobilePhone
))
{
...
...
server/src/main/java/com/pica/cloud/account/account/server/entity/Account.java
浏览文件 @
26d1e997
...
@@ -26,6 +26,10 @@ public class Account {
...
@@ -26,6 +26,10 @@ public class Account {
private
Integer
certifyStatus
;
private
Integer
certifyStatus
;
private
Integer
hospitalId
;
private
String
hospital
;
private
String
nation
;
private
String
nation
;
private
String
nativePlace
;
private
String
nativePlace
;
...
@@ -91,6 +95,22 @@ public class Account {
...
@@ -91,6 +95,22 @@ public class Account {
this
.
nation
=
nation
;
this
.
nation
=
nation
;
}
}
public
Integer
getHospitalId
()
{
return
hospitalId
;
}
public
void
setHospitalId
(
Integer
hospitalId
)
{
this
.
hospitalId
=
hospitalId
;
}
public
String
getHospital
()
{
return
hospital
;
}
public
void
setHospital
(
String
hospital
)
{
this
.
hospital
=
hospital
;
}
public
Integer
getCertifyStatus
()
{
public
Integer
getCertifyStatus
()
{
return
certifyStatus
;
return
certifyStatus
;
}
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/enums/AccountExceptionEnum.java
浏览文件 @
26d1e997
...
@@ -70,6 +70,12 @@ public enum AccountExceptionEnum {
...
@@ -70,6 +70,12 @@ public enum AccountExceptionEnum {
MOBILE_NOT_REGISTER
(
"216560"
,
"手机号{mobile}尚未注册"
),
MOBILE_NOT_REGISTER
(
"216560"
,
"手机号{mobile}尚未注册"
),
PARAMS_BIZ_TYPE_EMPTY
(
"216561"
,
"参数bizType不能为空"
),
PARAMS_BIZ_TYPE_EMPTY
(
"216561"
,
"参数bizType不能为空"
),
PROOF_GET_FAIL
(
"216562"
,
"网络出了点问题,请稍后重试"
),
PROOF_GET_FAIL
(
"216562"
,
"网络出了点问题,请稍后重试"
),
CRM_MOBILE_EXIST_IN_HOSPITAL
(
"216563"
,
"该手机号已存在本机构中"
),
CRM_MOBILE_NOT_IN_HOSPITAL
(
"216564"
,
"该手机号已存在,但未加入机构,请至云鹊医App中加入机构"
),
CRM_MOBILE_IN_ANOTHER_HOSPITAL
(
"216565"
,
"该手机号已存在于{hospitalName}中,如需修改请至云鹊医App中修改所属机构"
),
xxx_xxx
(
""
,
""
);
xxx_xxx
(
""
,
""
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/AccountService.java
浏览文件 @
26d1e997
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
;
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
;
import
com.pica.cloud.account.account.common.req.CreateAccountReq
;
import
com.pica.cloud.account.account.server.entity.Account
;
import
com.pica.cloud.account.account.server.entity.Account
;
import
com.pica.cloud.account.account.server.entity.AccountInfoEntity
;
import
com.pica.cloud.account.account.server.entity.AccountInfoEntity
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -24,6 +26,9 @@ public interface AccountService {
...
@@ -24,6 +26,9 @@ public interface AccountService {
//创建账号
//创建账号
void
createAccount
(
Account
account
,
Integer
bizType
);
void
createAccount
(
Account
account
,
Integer
bizType
);
// 创建账号
Integer
createAccountV2
(
CreateAccountReq
req
,
PicaUser
picaUser
);
//更新账号信息
//更新账号信息
void
updateAccountById
(
Account
account
);
void
updateAccountById
(
Account
account
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/AccountServiceImpl.java
浏览文件 @
26d1e997
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
service
.
impl
;
import
com.pica.cloud.account.account.common.req.CreateAccountReq
;
import
com.pica.cloud.account.account.server.entity.Account
;
import
com.pica.cloud.account.account.server.entity.Account
;
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.enums.AccountExceptionEnum
;
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.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.AccountMapper
;
import
com.pica.cloud.account.account.server.mapper.AccountMapper
;
import
com.pica.cloud.account.account.server.service.AccountService
;
import
com.pica.cloud.account.account.server.service.AccountService
;
...
@@ -10,6 +13,7 @@ import com.pica.cloud.foundation.encryption.common.constants.EncryptConstants;
...
@@ -10,6 +13,7 @@ import com.pica.cloud.foundation.encryption.common.constants.EncryptConstants;
import
com.pica.cloud.foundation.encryption.util.EncryptUtils
;
import
com.pica.cloud.foundation.encryption.util.EncryptUtils
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
com.pica.cloud.foundation.utils.entity.PicaUser
;
import
com.pica.cloud.foundation.utils.utils.ValidateUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -128,6 +132,32 @@ public class AccountServiceImpl implements AccountService {
...
@@ -128,6 +132,32 @@ public class AccountServiceImpl implements AccountService {
}
}
}
}
@Override
public
Integer
createAccountV2
(
CreateAccountReq
req
,
PicaUser
picaUser
)
{
/** 参数校验 */
if
(
StringUtils
.
isEmpty
(
req
.
getMobilePhone
())
||
StringUtils
.
isEmpty
(
req
.
getDoctorName
())
||
req
.
getHospitalId
()
==
null
)
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_PARAMS_ERROR
);
}
if
(!
ValidateUtils
.
isMobile
(
req
.
getMobilePhone
()))
{
throw
new
AccountException
(
AccountExceptionEnum
.
PICA_MOBILE_ERROR
);
}
/** 手机号已被占用,且机构不存在或机构为空 */
String
encryptMobilePhone
=
EncryptUtils
.
encryptContent
(
req
.
getMobilePhone
(),
EncryptConstants
.
ENCRYPT_TYPE_MOBILE
);
Account
account
=
accountMapper
.
getByMobilePhone
(
encryptMobilePhone
);
if
(
account
==
null
)
{
/** TODO: 新增流程 */
return
0
;
}
if
(
account
.
getHospitalId
()
==
null
||
account
.
getHospitalId
()
==
0
)
{
throw
new
AccountException
(
AccountExceptionEnum
.
CRM_MOBILE_NOT_IN_HOSPITAL
);
}
if
(!
req
.
getHospitalId
().
equals
(
account
.
getHospitalId
()))
{
throw
new
AccountException
(
AccountExceptionEnum
.
CRM_MOBILE_IN_ANOTHER_HOSPITAL
.
getCode
(),
AccountExceptionEnum
.
CRM_MOBILE_IN_ANOTHER_HOSPITAL
.
getMessage
().
replace
(
"{hospitalName}"
,
account
.
getHospital
()));
}
throw
new
AccountException
(
AccountExceptionEnum
.
CRM_MOBILE_EXIST_IN_HOSPITAL
);
}
//更新账号信息
//更新账号信息
@Override
@Override
@Transactional
@Transactional
...
...
server/src/main/resources/mybatis/AccountMapper.xml
浏览文件 @
26d1e997
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"certify_status"
jdbcType=
"INTEGER"
property=
"certifyStatus"
/>
<result
column=
"certify_status"
jdbcType=
"INTEGER"
property=
"certifyStatus"
/>
<result
column=
"nation"
jdbcType=
"VARCHAR"
property=
"nation"
/>
<result
column=
"nation"
jdbcType=
"VARCHAR"
property=
"nation"
/>
<result
column=
"hospital"
jdbcType=
"VARCHAR"
property=
"hospital"
/>
<result
column=
"hospital_id"
jdbcType=
"INTEGER"
property=
"hospitalId"
/>
<result
column=
"avatar_image_url"
jdbcType=
"VARCHAR"
property=
"avatarImageUrl"
/>
<result
column=
"avatar_image_url"
jdbcType=
"VARCHAR"
property=
"avatarImageUrl"
/>
<result
column=
"email"
jdbcType=
"VARCHAR"
property=
"email"
/>
<result
column=
"email"
jdbcType=
"VARCHAR"
property=
"email"
/>
<result
column=
"qrcode"
jdbcType=
"VARCHAR"
property=
"qrcode"
/>
<result
column=
"qrcode"
jdbcType=
"VARCHAR"
property=
"qrcode"
/>
...
@@ -36,7 +38,7 @@
...
@@ -36,7 +38,7 @@
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, sex, name, mobile_phone, status, certify_status, nation, avatar_image_url, email, qrcode, nickname, personal_sign, delete_flag,
id, sex, name, mobile_phone, status, certify_status, nation,
hospital, hospital_id,
avatar_image_url, email, qrcode, nickname, personal_sign, delete_flag,
creat_id, creat_time, modify_id, modify_time, password, info, entire_flag, reg_time, last_login_time,
creat_id, creat_time, modify_id, modify_time, password, info, entire_flag, reg_time, last_login_time,
unionid, register_source, comment, register_type, first_login_time, card, birthday
unionid, register_source, comment, register_type, first_login_time, card, birthday
</sql>
</sql>
...
@@ -63,6 +65,12 @@
...
@@ -63,6 +65,12 @@
<if
test=
"avatarImageUrl != null"
>
<if
test=
"avatarImageUrl != null"
>
avatar_image_url,
avatar_image_url,
</if>
</if>
<if
test=
"hospitalId != null"
>
hospital_id,
</if>
<if
test=
"hospital != null"
>
hospital,
</if>
<if
test=
"acctId != null"
>
<if
test=
"acctId != null"
>
acct_id,
acct_id,
</if>
</if>
...
@@ -143,6 +151,12 @@
...
@@ -143,6 +151,12 @@
<if
test=
"avatarImageUrl != null"
>
<if
test=
"avatarImageUrl != null"
>
#{avatarImageUrl,jdbcType=VARCHAR},
#{avatarImageUrl,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"hospitalId != null"
>
hospitalId,
</if>
<if
test=
"hospital != null"
>
hospital,
</if>
<if
test=
"acctId != null"
>
<if
test=
"acctId != null"
>
#{acctId,jdbcType=INTEGER},
#{acctId,jdbcType=INTEGER},
</if>
</if>
...
@@ -227,6 +241,12 @@
...
@@ -227,6 +241,12 @@
<if
test=
"nativePlace != null"
>
<if
test=
"nativePlace != null"
>
native_place = #{nativePlace,jdbcType=VARCHAR},
native_place = #{nativePlace,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"hospital != null"
>
hospital = #{hospital, jdbcType=VARCHAR},
</if>
<if
test=
"hospitalId != null"
>
hospital_id = #{hospitalId,jdbcType=INTEGER},
</if>
<if
test=
"sex != null"
>
<if
test=
"sex != null"
>
sex = #{sex,jdbcType=INTEGER},
sex = #{sex,jdbcType=INTEGER},
</if>
</if>
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录