提交 71e31bc8 编写于 作者: wenhao.qin's avatar wenhao.qin

联调修改

上级 2fbfce0c
流水线 #42928 已取消 于阶段
......@@ -24,7 +24,6 @@ public interface AccountMapper {
//新增账号
void insertSelective(Account account);
Long insertByOption(Account account);
//更新账号
Integer updateByIdSelective(Account account);
......
......@@ -26,8 +26,8 @@ public class HospitalSaasUserListReq {
private Integer roleId;
@ApiModelProperty("每页显示记录数")
private Integer pageSize;
private Integer pageSize = 10;
@ApiModelProperty("页码")
private Integer pageNo;
private Integer pageNo = 1;
}
......@@ -70,9 +70,9 @@ public class HospitalSaasUserReq {
if (null == this.sourceType) {
throw new PicaWarnException(AccountExceptionEnum.PICA_NOT_EMPTY.getCode(), "资源类型不能为空!");
}
if (!Pattern.matches("^[A-Za-z0-9]{5,10}$", this.password)) {
throw new PicaWarnException(AccountExceptionEnum.PICA_NOT_EMPTY.getCode(), "密码需由6-10位字母或数字组成!");
}
// if (!Pattern.matches("^[A-Za-z0-9]{5,10}$", this.password)) {
// throw new PicaWarnException(AccountExceptionEnum.PICA_NOT_EMPTY.getCode(), "密码需由6-10位字母或数字组成!");
// }
if (Objects.nonNull(this.comment) && this.comment.length() > 100) {
throw new PicaWarnException(AccountExceptionEnum.PICA_NOT_EMPTY.getCode(), "备注长度须≤100字符");
}
......
......@@ -79,16 +79,19 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
//幂等校验
String nxKey = Constants.REPEAT_REGISTER_PREFIX + mobile;
Long resultNx = redisClient.setnx(nxKey, mobile);
if (resultNx == 0) {
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "请勿重复提交");
}
redisClient.expire(nxKey, 2);
if (resultNx == 1) {
//手机号加密
String mobileEncrypt = AESUtil.encryptV0(mobile);
AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobileEncrypt);
Account byMobilePhone = accountMapper.getByMobilePhone(mobileEncrypt);
//密码已经存在的处理逻辑
if (Objects.nonNull(accountInfoEntity) && StringUtils.isNotBlank(accountInfoEntity.getPassword())) {
throw new PicaException(PicaResultCode.PARAM_IS_INVALID.code(), "密码已经存在,不可进行编辑");
}
Account byMobilePhone = accountMapper.getByMobilePhone(mobileEncrypt);
//用户不存在的处理逻辑
if (accountInfoEntity == null) {
redisClient.expire(nxKey, 30);
......@@ -100,7 +103,7 @@ public class HospitalSaasUserServiceImpl implements HospitalSaasUserService {
Integer acctId = accountInfo.getId();
accountInfoDetailMapper.updateCreateInfo(acctId);
Account account = buildDoctorMsg(req, mobileEncrypt, currentTime, req.getSourceType(), password, acctId);
accountMapper.insertByOption(account);
accountMapper.insertSelective(account);
Long userId = account.getId();
processAgreement(userId);
insertAppRole(userId);
......
......@@ -51,169 +51,6 @@
</select>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.Account" useGeneratedKeys="true" keyProperty="id">
insert into p_doctor
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sex != null">
sex,
</if>
<if test="name != null">
name,
</if>
<if test="mobilePhone != null">
mobile_phone,
</if>
<if test="avatarImageUrl != null">
avatar_image_url,
</if>
<if test="acctId != null">
acct_id,
</if>
<if test="email != null">
email,
</if>
<if test="qrcode != null">
qrcode,
</if>
<if test="nickname != null">
nickname,
</if>
<if test="personalSign != null">
personal_sign,
</if>
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="creatId != null">
creat_id,
</if>
<if test="creatTime != null">
creat_time,
</if>
<if test="modifyId != null">
modify_id,
</if>
<if test="modifyTime != null">
modify_time,
</if>
<if test="password != null">
password,
</if>
<if test="info != null">
info,
</if>
<if test="entireFlag != null">
entire_flag,
</if>
<if test="regTime != null">
reg_time,
</if>
<if test="lastLoginTime != null">
last_login_time,
</if>
<if test="unionid != null">
unionid,
</if>
<if test="registerSource != null">
register_source,
</if>
<if test="comment != null">
comment,
</if>
<if test="registerType != null">
register_type,
</if>
<if test="firstLoginTime != null">
first_login_time,
</if>
<if test="card != null">
card,
</if>
<if test="birthday != null">
birthday,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="sex != null">
#{sex,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="mobilePhone != null">
#{mobilePhone,jdbcType=VARCHAR},
</if>
<if test="avatarImageUrl != null">
#{avatarImageUrl,jdbcType=VARCHAR},
</if>
<if test="acctId != null">
#{acctId,jdbcType=INTEGER},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
<if test="qrcode != null">
#{qrcode,jdbcType=VARCHAR},
</if>
<if test="nickname != null">
#{nickname,jdbcType=VARCHAR},
</if>
<if test="personalSign != null">
#{personalSign,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="creatId != null">
#{creatId,jdbcType=INTEGER},
</if>
<if test="creatTime != null">
#{creatTime,jdbcType=TIMESTAMP},
</if>
<if test="modifyId != null">
#{modifyId,jdbcType=INTEGER},
</if>
<if test="modifyTime != null">
#{modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="info != null">
#{info,jdbcType=VARCHAR},
</if>
<if test="entireFlag != null">
#{entireFlag,jdbcType=INTEGER},
</if>
<if test="regTime != null">
#{regTime,jdbcType=DATE},
</if>
<if test="lastLoginTime != null">
#{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="unionid != null">
#{unionid,jdbcType=VARCHAR},
</if>
<if test="registerSource != null">
#{registerSource,jdbcType=INTEGER},
</if>
<if test="comment != null">
#{comment,jdbcType=VARCHAR},
</if>
<if test="registerType != null">
#{registerType,jdbcType=INTEGER},
</if>
<if test="firstLoginTime != null">
#{firstLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="card != null">
#{card,jdbcType=VARCHAR},
</if>
<if test="birthday != null">
#{birthday,jdbcType=DATE},
</if>
</trim>
</insert>
<insert id="insertByOption" useGeneratedKeys="true" keyProperty="id">
insert into p_doctor
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="sex != null">
......
......@@ -164,7 +164,9 @@
<update id="deleteByDoctorId" parameterType="java.lang.Integer">
update permission_doctor_role
set delete_flag = 2
set delete_flag = 2 ,
modified_id = #{modifiedId,jdbcType=BIGINT},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where doctor_id = #{id,jdbcType=BIGINT}
</update>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册