提交 72ff63c9 编写于 作者: xinxu.wang's avatar xinxu.wang

Merge branch 'release' into 'master'

Release

See merge request !133
流水线 #52892 已失败 于阶段
......@@ -24,4 +24,6 @@ public interface AcctPatUnionMapper {
int initBatch(List<AcctPatUnion> list);
String selectUnionIdByPatientId(Integer patientId);
void deleteByUnionId(AcctPatUnion record);
}
\ No newline at end of file
......@@ -248,8 +248,27 @@ public class PatHealthPackServiceIml implements PatHealthPackService {
//被绑定
//且非传入acct_d
if (!patUnion.getAcctId().equals(patInfoReq.getAcctId())) {
resp.setBindStatus(false);
resp.setMsg(AccountExceptionEnum.PAT_UNIONID_BINDED_ERROR.getMessage());
/** 更新绑定关系 */
AcctPatUnion acctPatUnion = new AcctPatUnion();
acctPatUnion.setUnionId(patInfoReq.getUnionId());
acctPatUnion.setModifiedId(patInfoReq.getAcctId());
acctPatUnion.setModifiedTime(new Date());
patUnionMapper.deleteByUnionId(acctPatUnion);
AcctPatUnion entity = new AcctPatUnion();
entity.setAcctId(patInfoReq.getAcctId());
entity.setUnionId(patInfoReq.getUnionId());
entity.setUnionType(AccountTypeEnum.UNION_LOGIN_WE_CHAT.getCode());
entity.setDeleteFlag(1);
entity.setCreatedId(patInfoReq.getPatientId());
entity.setModifiedId(patInfoReq.getPatientId());
entity.setCreatedTime(new Date());
entity.setModifiedTime(new Date());
patUnionMapper.insert(entity);
resp.setBindStatus(true);
// resp.setMsg(AccountExceptionEnum.PAT_UNIONID_BINDED_ERROR.getMessage());
} else {
//unionId,已被传入acctId绑定,返回 true
resp.setBindStatus(true);
......@@ -260,8 +279,27 @@ public class PatHealthPackServiceIml implements PatHealthPackService {
if (Objects.nonNull(patUnion)) {
//acctId已有unionId,且不是传入的unionId
if (!patUnion.getUnionId().equals(patInfoReq.getUnionId())) {
resp.setBindStatus(false);
resp.setMsg(AccountExceptionEnum.PAT_MOBILE_BINDED_WECHAT_ERROR.getMessage());
/** 更新绑定关系 */
AcctPatUnion acctPatUnion = new AcctPatUnion();
acctPatUnion.setUnionId(patUnion.getUnionId());
acctPatUnion.setModifiedId(patInfoReq.getAcctId());
acctPatUnion.setModifiedTime(new Date());
patUnionMapper.deleteByUnionId(acctPatUnion);
AcctPatUnion entity = new AcctPatUnion();
entity.setAcctId(patInfoReq.getAcctId());
entity.setUnionId(patInfoReq.getUnionId());
entity.setUnionType(AccountTypeEnum.UNION_LOGIN_WE_CHAT.getCode());
entity.setDeleteFlag(1);
entity.setCreatedId(patInfoReq.getPatientId());
entity.setModifiedId(patInfoReq.getPatientId());
entity.setCreatedTime(new Date());
entity.setModifiedTime(new Date());
patUnionMapper.insert(entity);
resp.setBindStatus(true);
// resp.setMsg(AccountExceptionEnum.PAT_MOBILE_BINDED_WECHAT_ERROR.getMessage());
}
} else {
//未绑定 新增绑定记录
......
......@@ -184,4 +184,14 @@
and apu.union_type = 1
limit 1
</select>
<update id="deleteByUnionId" parameterType="com.pica.cloud.account.account.server.entity.AcctPatUnion" >
update account_pat_union
set
delete_flag = 2,
modified_id = #{modifiedId,jdbcType=INTEGER},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where union_id = #{unionId,jdbcType=VARCHAR} and delete_flag = 1
</update>
</mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册