|
@ -13,11 +13,14 @@ import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
|
|
|
import com.yihu.jw.entity.hospital.message.BaseBannerDoctorDO;
|
|
|
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
|
|
|
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
|
|
|
import com.yihu.jw.hospital.ykyy.service.YkyyService;
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
import com.yihu.jw.restmodel.web.MixEnvelop;
|
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
|
import com.yihu.jw.rm.base.BaseRequestMapping;
|
|
|
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
|
import com.yihu.mysql.query.BaseJpaService;
|
|
|
import com.yihu.utils.security.MD5;
|
|
@ -29,14 +32,12 @@ import org.checkerframework.checker.units.qual.A;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Random;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoctorDao> {
|
|
@ -59,6 +60,11 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
|
|
|
private BaseDoctorRoleDao baseDoctorRoleDao;
|
|
|
@Autowired
|
|
|
private WlyyChargeDictDao wlyyChargeDictDao;
|
|
|
@Value("${wechat.id}")
|
|
|
private String wechatId;
|
|
|
@Autowired
|
|
|
private HttpClientUtil httpClientUtil;
|
|
|
private static String yktUrl_90 = "http://www.yanketong.com:90/";
|
|
|
/**
|
|
|
* 查询医生信息分页列表.
|
|
|
* @param city
|
|
@ -309,25 +315,57 @@ public class BaseDoctorInfoService extends BaseJpaService<BaseDoctorDO, BaseDoct
|
|
|
public void updateStatus(String doctorId,String status)throws Exception{
|
|
|
baseDoctorDao.updateStatus(doctorId,status);
|
|
|
}
|
|
|
|
|
|
/**修改眼科通密码信息
|
|
|
*
|
|
|
* @param doctorId
|
|
|
* @param password
|
|
|
* @param oldpassword
|
|
|
* @return
|
|
|
*/
|
|
|
public String resetYktPwdByPwd(String doctorId,String password,String oldpassword,String vercode){
|
|
|
String response="";
|
|
|
Map headermap = new HashMap();
|
|
|
headermap.put("verifyCode",vercode);
|
|
|
String url = yktUrl_90+"api/Share/PasswordReset?doctorId="+doctorId+"&password="+password+"&oldpassword="+oldpassword;
|
|
|
response = httpClientUtil.get(url,"GBK",headermap);
|
|
|
logger.info("修改眼科同密码后的信息:"+response);
|
|
|
return response;
|
|
|
}
|
|
|
public Boolean updateDoctorPw(String id,String pw,String orgPw){
|
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findOne(id);
|
|
|
if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
|
|
|
String res =resetYktPwdByPwd(null,id,pw,orgPw);
|
|
|
if (org.apache.commons.lang3.StringUtils.isNoneBlank(res)) {
|
|
|
com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(res);
|
|
|
if (object.getString("code").equalsIgnoreCase("10000")) {
|
|
|
return true;
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
}else {
|
|
|
return false;
|
|
|
}
|
|
|
}else if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){
|
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findOne(id);
|
|
|
|
|
|
String orgPwMd5 = MD5.md5Hex(orgPw + "{" + doctorDO.getSalt() + "}");
|
|
|
if(!orgPwMd5.equals(doctorDO.getPassword())){
|
|
|
return false;
|
|
|
}
|
|
|
//认证信息设置
|
|
|
String salt = randomString(5);
|
|
|
doctorDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
|
|
|
doctorDO.setSalt(salt);
|
|
|
String orgPwMd5 = MD5.md5Hex(orgPw + "{" + doctorDO.getSalt() + "}");
|
|
|
if(!orgPwMd5.equals(doctorDO.getPassword())){
|
|
|
return false;
|
|
|
}
|
|
|
//认证信息设置
|
|
|
String salt = randomString(5);
|
|
|
doctorDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
|
|
|
doctorDO.setSalt(salt);
|
|
|
|
|
|
baseDoctorDao.save(doctorDO);
|
|
|
baseDoctorDao.save(doctorDO);
|
|
|
|
|
|
//设置更新时间
|
|
|
saveDoctorPwlimitDate(id);
|
|
|
//设置更新时间
|
|
|
saveDoctorPwlimitDate(id);
|
|
|
|
|
|
return true;
|
|
|
}else {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
public String randomString(int length) {
|