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

根据openid 获取医生id

上级 76dae9aa
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId> <groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-client</artifactId> <artifactId>pica-cloud-account-client</artifactId>
<version>1.0.5.3</version> <version>1.0.6</version>
<name>pica-cloud-account-client</name> <name>pica-cloud-account-client</name>
<packaging>jar</packaging> <packaging>jar</packaging>
......
...@@ -40,5 +40,8 @@ public interface AccountInfoClient { ...@@ -40,5 +40,8 @@ public interface AccountInfoClient {
@GetMapping(value = "/account/info/doctor/union") @GetMapping(value = "/account/info/doctor/union")
PicaResponse<DoctorUnionResp> getDoctorByUnionid( @RequestParam(value = "unionid") String unionid); PicaResponse<DoctorUnionResp> getDoctorByUnionid( @RequestParam(value = "unionid") String unionid);
@GetMapping(value = "/account/info/doctor/openid")
PicaResponse<Integer> getDoctorByOpenid( @RequestParam(value = "openid") String openid);
} }
...@@ -80,4 +80,13 @@ public class AccountInfoController extends AccountBaseController { ...@@ -80,4 +80,13 @@ public class AccountInfoController extends AccountBaseController {
DoctorUnionResp personalInfoDto = wechatService.getDoctorByUnionid(unionid); DoctorUnionResp personalInfoDto = wechatService.getDoctorByUnionid(unionid);
return PicaResponse.toResponse(personalInfoDto); return PicaResponse.toResponse(personalInfoDto);
} }
@ApiOperation(value = "根据openid查看医生id")
@GetMapping(value = "/doctor/openid", produces = "application/json;charset=UTF-8")
public PicaResponse<Integer> getDoctorByOpenid(@RequestParam(value = "openid") String openid) {
Integer doctorId = wechatService.getDoctorByOpenid(openid);
return PicaResponse.toResponse(doctorId);
}
} }
...@@ -15,6 +15,8 @@ public interface AccountWeChatInfoMapper { ...@@ -15,6 +15,8 @@ public interface AccountWeChatInfoMapper {
*/ */
AccountWeChatInfoEntity selectByUnionId(String id); AccountWeChatInfoEntity selectByUnionId(String id);
AccountWeChatInfoEntity selectByOpenId(String openId);
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
int insert(AccountWeChatInfoEntity record); int insert(AccountWeChatInfoEntity record);
......
...@@ -18,4 +18,6 @@ public interface WechatService { ...@@ -18,4 +18,6 @@ public interface WechatService {
DoctorUnionResp getDoctorByUnionid(String unionid); DoctorUnionResp getDoctorByUnionid(String unionid);
Integer getDoctorByOpenid(String openId);
} }
...@@ -183,7 +183,7 @@ public class DoctorServiceImpl implements DoctorService { ...@@ -183,7 +183,7 @@ public class DoctorServiceImpl implements DoctorService {
doctor.setModifyId(doctorId.intValue()); doctor.setModifyId(doctorId.intValue());
doctor.setCreatId(doctorId.intValue()); doctor.setCreatId(doctorId.intValue());
doctor.setCreatTime(currentTime); doctor.setCreatTime(currentTime);
doctor.setModifyTime(new Date()); doctor.setModifyTime(currentTime);
doctor.setRegisterSource(AccountTypeEnum.DEVICE_TYPE_ADMIN.getCode()); doctor.setRegisterSource(AccountTypeEnum.DEVICE_TYPE_ADMIN.getCode());
doctor.setDeleteFlag(1); doctor.setDeleteFlag(1);
doctorMapper.insertSelective(doctor); doctorMapper.insertSelective(doctor);
......
...@@ -98,4 +98,16 @@ public class WechatServiceImpl implements WechatService { ...@@ -98,4 +98,16 @@ public class WechatServiceImpl implements WechatService {
} }
return doctorUnionfoModel; return doctorUnionfoModel;
} }
@Override
public Integer getDoctorByOpenid(String openId) {
AccountWeChatInfoEntity entity = weChatInfoMapper.selectByOpenId(openId);
if (StringUtil.isNotNull(entity)) {
DoctorUnionResp doctorUnionfoModel = getDoctorByUnionid(entity.getUnionid());
if (StringUtil.isNotNull(doctorUnionfoModel)) {
return doctorUnionfoModel.getDoctorId();
}
}
return null;
}
} }
...@@ -48,6 +48,14 @@ ...@@ -48,6 +48,14 @@
limit 1 limit 1
</select> </select>
<select id="selectByOpenId" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from account_wechat_info
where openid = #{openId} and delete_flag = 1
limit 1
</select>
<select id="selectBatchByUnionId" resultMap="BaseResultMap" parameterType="java.util.List"> <select id="selectBatchByUnionId" resultMap="BaseResultMap" parameterType="java.util.List">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册