|
@ -1,7 +1,9 @@
|
|
package com.yihu.jw.security.core.userdetails.jdbc;
|
|
package com.yihu.jw.security.core.userdetails.jdbc;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
|
|
import com.yihu.jw.security.core.userdetails.SaltUser;
|
|
import com.yihu.jw.security.core.userdetails.SaltUser;
|
|
|
|
import com.yihu.jw.security.dao.patient.BasePatientWechatDao;
|
|
import com.yihu.jw.security.model.WlyyUserDetails;
|
|
import com.yihu.jw.security.model.WlyyUserDetails;
|
|
import com.yihu.jw.security.model.WlyyUserSimple;
|
|
import com.yihu.jw.security.model.WlyyUserSimple;
|
|
|
|
|
|
@ -72,6 +74,9 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
|
|
@Value("${iHealth.user-info-uri}")
|
|
@Value("${iHealth.user-info-uri}")
|
|
private String iHealthUserInfoUrl;//失败重试次数
|
|
private String iHealthUserInfoUrl;//失败重试次数
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private BasePatientWechatDao basePatientWechatDao;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ClientDetailsService clientDetailsService;
|
|
private ClientDetailsService clientDetailsService;
|
|
|
|
|
|
@ -574,7 +579,18 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
|
|
}
|
|
}
|
|
|
|
|
|
public void updateOpenIdAndWechatId(String openid, String userId,String wechatId) {
|
|
public void updateOpenIdAndWechatId(String openid, String userId,String wechatId) {
|
|
this.getJdbcTemplate().update("update base_patient_wechat p set p.openid = ? where p.patient_id= ? and p.wechat_id", openid, userId,wechatId);
|
|
|
|
|
|
List<BasePatientWechatDo> patientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wechatId,userId);
|
|
|
|
if (patientWechatDos!=null&&patientWechatDos.size()!=0){
|
|
|
|
this.getJdbcTemplate().update("update base_patient_wechat p set p.openid = ? where p.patient_id= ? and p.wechat_id= ? ", openid, userId,wechatId);
|
|
|
|
}else {
|
|
|
|
BasePatientWechatDo basePatientWechatDo=new BasePatientWechatDo();
|
|
|
|
basePatientWechatDo.setCreateTime(new Date());
|
|
|
|
basePatientWechatDo.setOpenid(openid);
|
|
|
|
basePatientWechatDo.setPatientId(userId);
|
|
|
|
basePatientWechatDo.setWechatId(wechatId);
|
|
|
|
basePatientWechatDao.save(basePatientWechatDo);
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public String getSynPath(String wxId){
|
|
public String getSynPath(String wxId){
|